int-to-binary
Integer to signed/unsigned binary converter.
Install
npm:
npm i int-to-binary
or yarn:
yarn add int-to-binary
Usage
Include the module
const itb = ; //convet number to signed (length) bits binaryitb; //convet number to unsigned (length) bits binaryitb;
Examples
Integer to unsigned binary:
const itb = ; console;// 0111 console;// 00111 console;// 100000 console;// 00000000000000000000000000000001// default length is 32 bits if not provided
Integer to signed binary:
const itb = ; console;// 1111 console;// 11111 console;// 011111 console;// 11111111111111111111111111111111// default length is 32 bits if not provided