@chengaoyuan/int64
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

/@chengaoyuan/int64/

    Package Sidebar

    Install

    npm i @chengaoyuan/int64

    Weekly Downloads

    5

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    18 kB

    Total Files

    6

    Last publish

    Collaborators

    • chengaoyuan