binarifyit

1.0.2 • Public • Published

binarify

Transform an integer into its binary form with the desire number of bits.

Install

npm i binarifyit

Usage

The function receives two arguments: number and bits. The former is the number you want to transform while the latter is the number of bits you want.

If the bits parameter is not specified, the transform will return the default number of bits.

const binarifyit = require('binaryfyit')

console.log(binarifyit(5)) // 101
console.log(binarifyit(5,6)) // 000101

Licence

MIT

Readme

Keywords

Package Sidebar

Install

npm i binarifyit

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

2.58 kB

Total Files

4

Last publish

Collaborators

  • ddazal