Nodejs Utililty Methods Number to Binary Convert

List of utility methods to do Number to Binary Convert

Description

The list of methods to do Number to Binary Convert are organized into topic(s).

Method

bin()
Number.prototype.bin = function () { 
  var shifted = this
    , result = '';
  for (var flag = 0; flag < 32; flag++) {
    result += String(shifted >>> 31);
    shifted <<= 1;
  return result;
bin32()
Number.prototype.bin32 = function () {
  var result = this.toString(2);
  while (result.length < 32) {
    result = '0' + result;
  return result;
var reverseBits = function (n) {
  return parseInt(n.bin32().split('').reverse().join(''), 2);
...