List of utility methods to do Number to Binary Convert
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); ... |