Kit
Functions

getU64Decoder

getU64Decoder(config): FixedSizeDecoder<bigint, 8>

Returns a decoder for 64-bit unsigned integers (u64).

This decoder deserializes u64 values from 8 bytes. The decoded value is always a bigint.

For more details, see getU64Codec.

Parameters

ParameterTypeDescription
configNumberCodecConfigOptional configuration to specify endianness (little by default).

Returns

FixedSizeDecoder<bigint, 8>

A FixedSizeDecoder<bigint, 8> for decoding u64 values.

Example

Decoding a u64 value.

const decoder = getU64Decoder();
const value = decoder.decode(new Uint8Array([0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])); // 42n

See

getU64Codec

On this page