Skip to Content
Anuma SDKReactEncryptiondecryptDataBytesFromBytes

decryptDataBytesFromBytes

decryptDataBytesFromBytes(encrypted: Uint8Array, address: string, version: EncryptionKeyVersion): Promise<Uint8Array<ArrayBufferLike>>

Defined in: src/react/useEncryption.ts:638 

Like decryptDataBytes but takes the raw encrypted bytes ([IV][ciphertext+tag]) directly instead of a hex string. Skips the hexToBytes conversion — for large binary media the hex string the caller would otherwise build is a ~1.37x copy of the whole payload (a ~1GB string for a 500MB video), plus this avoids a second byte copy. Same key resolution as decryptDataBytes.

Parameters

ParameterTypeDefault valueDescription

encrypted

Uint8Array

undefined

Raw encrypted bytes (IV + ciphertext + auth tag), no hex

address

string

undefined

The wallet address associated with the encryption key

version

EncryptionKeyVersion

"v3"

Encryption key version to decrypt with (defaults to “v3”)

Returns

Promise<Uint8Array<ArrayBufferLike>>

Decrypted data as Uint8Array

Last updated on