1.0.2 • Published 5 years ago

binarifyit v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

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