You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

biguintle

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

biguintle

Encode / decode unsigned BigInt as little endian

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
19
Maintainers
1
Weekly downloads
 
Created
Source

biguintle

Build Status abstract-encoding

Encode / decode unsigned BigInt as little endian

Usage

var bigUintLE = require('biguintle')

var bigUint = 2n ** 64n - 1n // UINT64_MAX

assert(bigUintLE.encodingLength(bigUint) === 8)
var buf = bigUintLE.encode(bigUint)
assert(bigUintLE.encode.bytes === 8 && buf.byteLength === 8)

var num = bigUintLE.decode()

API

var buf = bigUintLE.encode(bu, [buf, [byteOffset]])

Write BigInt 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.

var bytes = bigUintLE.encode.bytes

Number of bytes last encoded

var bigUint = bigUintLE.decode(buf, [byteOffset], [byteLength])

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.

var bytes = bigUintLE.decode.bytes

Number of bytes last decoded

var bytes = bigUintLE.encodingLength(bu)

Number of bytes required to encode BigInt bu

Install

npm install biguintle

License

ISC

Keywords

bigint

FAQs

Package last updated on 12 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.