Encode / decode unsigned BigInt as big endian
npm install biguintbebiguintbe
> Encode / decode unsigned BigInt as big endian
``js
var bigUintBE = require('biguintbe')
var bigUint = 2n ** 64n - 1n // UINT64_MAX
assert(bigUintBE.encodingLength(bigUint) === 8)
var buf = bigUintBE.encode(bigUint)
assert(bigUintBE.encode.bytes === 8 && buf.byteLength === 8)
var num = bigUintBE.decode()
`
bu to optional Buffer or TypedArray buf at optional
Number byteOffset. If buf is not set a new Buffer is allocated the size
of the byte width of bu. byteOffset defaults to 0.$3
Number of bytes last encoded$3
Read BigInt from Buffer or TypedArray buf at optional
Number byteOffset for optional Number byteLength bytes. Note that if you
do not give a byteLength all of buf will be decoded, since BigInts do
not have a natural width.$3
Number of bytes last decoded$3
Number of bytes required to encode BigInt buInstall
`sh
npm install biguintbe
``