Skip to content

deriveChunkNonce

deriveChunkNonce(baseNonce, chunkIndex, isLast): Uint8Array

Defined in: packages/filecoin-encryption-envelope/src/nonce.ts:17

Derive the 12-byte AEAD nonce for one chunk: baseNonce (7) ‖ chunkIndex (4, big-endian) ‖ last_flag (1).

Returns a freshly allocated array; baseNonce is never mutated.

ParameterType
baseNonceUint8Array
chunkIndexnumber
isLastboolean

Uint8Array