test - asym box : Check toStr and fromStr are equal
ci/woodpecker/push/test Pipeline failed

This commit is contained in:
2024-05-14 15:24:33 +02:00
parent 25a8275c91
commit 925517ac2c
+1
View File
@@ -32,6 +32,7 @@ test('toString and fromString are inverses', async () => {
const box = (await asymmetric.PrivateBox.encrypt<Uint8Array>(pub, data)).expect("Should encrypt the data")
const str = box.toString()
const box2 = asymmetric.PrivateBox.fromString<Uint8Array>(str).expect("Should parse the string")
expect(box).toEqual(box2)
const plain = (await box2.decrypt(priv)).expect("Should decrypt the data")
expect(plain).toEqual(data)