binarystring

0.0.2 • Public • Published

install

npm install binarystring --save

Convert integer to binary string

byInt8(int_number)

byInt16(int_number)

byInt32(int_number)

Convert binary string to integer

toInt8(8bit_binary_string)

toInt16(16bit_binary_string)

toInt32(32bit_binary_string)

Exmaple

const { toInt32, byInt32, byInt16, toInt16, toInt8, byInt8 } = require("binarystring");

console.log(byInt8(113));   // 01110001
console.log(byInt16(113));  // 00000000 01110001
console.log(byInt32(113));  // 00000000 00000000 00000000 01110001

console.log(toInt8("01110001"));   // 113
console.log(toInt16("00000000 01110001"));   // 113
console.log(toInt32("00000000 00000000 00000000 01110001"));   // 113

License

Apache License 2.0

/binarystring/

    Package Sidebar

    Install

    npm i binarystring

    Weekly Downloads

    1

    Version

    0.0.2

    License

    Apache-2.0

    Last publish

    Collaborators

    • leogiese