Kit
Functions

getI64Decoder

getI64Decoder(config): FixedSizeDecoder<bigint, 8>

Returns a decoder for 64-bit signed integers (i64).

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

For more details, see getI64Codec.

Parameters

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

Returns

FixedSizeDecoder<bigint, 8>

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

Example

Decoding an i64 value.

const decoder = getI64Decoder();
const value = decoder.decode(new Uint8Array([
  0xd6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
])); // -42n

See

getI64Codec

On this page