Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

int53

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

int53

silly 53bit integer buffer serialization

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
119K
increased by25.7%
Maintainers
1
Weekly downloads
 
Created
Source

int53

serialization of 53-bit integers to and from 8 byte buffers.

usage

var int53 = require('int53')

var a = Buffer(8)

int53.writeUInt64BE(0xFFFFFFFFFFF, a)

var b = Buffer('0000FFFFFFFFFFFF', 'hex')

var x = int53.readUInt64BE(b)

API

var number = int53.readInt64BE(buffer, offset)
var number = int53.readInt64LE(buffer, offset)
var number = int53.readUInt64BE(buffer, offset)
var number = int53.readUInt64LE(buffer, offset)

int53.writeInt64BE(number, buffer, offset)
int53.writeInt64LE(number, buffer, offset)
int53.writeUInt64BE(number, buffer, offset)
int53.writeUInt64LE(number, buffer, offset)

why?

Sometimes you need to read and write 64-bit integers. For some things like timestamps, file sizes, and counters the 53-bits offered by a double is enough to get by, and easier to work with than a bigint module.

License

BSD

Keywords

FAQs

Package last updated on 07 Feb 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc