1.0.1 • Published 5 years ago

@chengaoyuan/int64 v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

int64

npm version install size NPM Downloads Build Status Coverage Status

Installation

$ npm install @chengaoyuan/int64

Usage

import { setInt64, setUint64, getInt64, getUint64 } from "@chengaoyuan/int64";
const ab = new ArrayBuffer(8);
const dv = new DataView(ab);

setInt64(dv, 0, 1234567890, false);
console.log(getInt64(dv, 0, false)); // out: 1234567890

setInt64(dv, 0, -1234567890, true);
console.log(getInt64(dv, 0, true)); // out: -1234567890

setUint64(dv, 0, 1234567890, false);
console.log(getUint64(dv, 0, false)); // out: 1234567890

Testing

$ npm test