Skip to Content
Anuma SDKReactEncryptionencryptDataBytes

encryptDataBytes

encryptDataBytes(plaintext: Uint8Array, address: string): Promise<Uint8Array<ArrayBufferLike>>

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

Like encryptData but takes raw bytes and returns the raw encrypted [IV][ciphertext+tag] Uint8Array instead of a hex string. Avoids the hex round-trip (encryptData returns hex, which callers immediately convert back to bytes) — for large binary media that hex string is a ~1.37x copy of the whole payload. Use for binary uploads (e.g. enc:v3 media frames).

Parameters

ParameterTypeDescription

plaintext

Uint8Array

The raw bytes to encrypt

address

string

The wallet address associated with the encryption key

Returns

Promise<Uint8Array<ArrayBufferLike>>

Encrypted data as raw bytes (IV + ciphertext + auth tag)

Last updated on