Skip to content

bigIntFromBytesLe

bigIntFromBytesLe(bytes): bigint

Defined in: packages/core/src/big-int/from-bytes-le.ts:14

Decodes two’s complement, little-endian bytes back into a bigint — the inverse of bigIntToBytesLe.

The high bit of the last byte is the sign, so any width round-trips: 0xff and 0xff_ff both decode to -1. Reach for bigIntFromBytesBe when the most significant byte comes first, which is what wire formats usually specify.

Time complexity: O(n) in the byte count.

Uint8Array

The encoding. An empty input decodes to zero.

bigint