Package Exports
- fast-bin
- fast-bin/binarize
- fast-bin/unbinarize
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fast-bin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
fast-bin
Quickly Convert an Array of Numbers into their Minimal Binary Representations
install
npm install fast-binusage
binarize an array of numbers
const binarize = require('fast-bin/binarize');
const input = [0, 1, 2, 3, 4];
const { data: output, nbits } = binarize({ data: input });
// output is '000001010011100'
// nbits is 3unbinarize a string
const unbinarize = require('fast-bin/unbinarize');
const data = '00011011';
const nbits = 2;
const arr = unbinarize({ data, nbits });
// arr is [0, 1, 2, 3]support
Post an issue at https://github.com/danieljdufour/fast-bin