API reference / @evolu/common / Evolu/Protocol / encodeAndEncryptDbChange

Function: encodeAndEncryptDbChange()

function encodeAndEncryptDbChange(deps): (message, key) => EncryptedDbChange;

Defined in: packages/common/src/Evolu/Protocol.ts:1698

Encodes and encrypts a DbChange using the provided owner's encryption key. Returns an encrypted binary representation as EncryptedDbChange.

The format includes the protocol version for backward compatibility and the timestamp for tamper-proof verification that the timestamp matches the change data.

Parameters

ParameterType
depsSymmetricCryptoDep

Returns

(message, key): EncryptedDbChange;

Parameters

ParameterType
messageCrdtMessage
keyUint8Array<ArrayBufferLike> & Brand<"Length32"> & Brand<"EncryptionKey">

Returns

EncryptedDbChange

Was this page helpful?