int53
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/int53 package

1.0.0 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.047,158latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.047,158
0.2.470,916
0.2.36
0.2.23
0.2.13
0.2.02
0.1.02
0.0.25
0.0.12

Package Sidebar

Install

npm i int53

Weekly Downloads

110,446

Version

1.0.0

License

BSD-3-Clause

Unpacked Size

4.19 kB

Total Files

3

Last publish

Collaborators

  • dannycoates