You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I'm doing something wrong but I can't get a UUID -> encrypt -> encode -> decode -> decrypt -> UUID flow working.
importcryptofrom'crypto'import{Encoder,Encrypter}from'objectid64'global.crypto=crypto.webcryptoconstencoder=newEncoder()constkey=awaitEncrypter.generateKey()constencrypter=newEncrypter(key)constuuid=crypto.randomUUID()console.log(uuid)// 4874c42f-61e3-42c8-9a39-4007a81737e7constbinUuid=encoder.toBinUUID(uuid)constencrypted=awaitencrypter.fromUUID(binUuid)constencoded=encoder.fromBinUUID(encrypted)console.log(encoded)// MxbKSQB-fuDtqUJayvuVCOconstdecoded=encoder.toBinUUID(encoded)constdecrypted=awaitencrypter.toUUID(decoded)constuuid2=encoder.fromBinUUID(decrypted)console.log(uuid2)// 4874c42f-61e3-42c8-9C3, uuid is not recovered in fullconsole.log(uuid===uuid2)// false
Maybe I'm doing something wrong but I can't get a UUID -> encrypt -> encode -> decode -> decrypt -> UUID flow working.
Node.js version: 16.17.1
objectid64 version: 3.2.1
The text was updated successfully, but these errors were encountered: