List of utility methods to do Hex to Number
hexNumber()String.prototype.hexNumber = function() { return /^(0x)?[0-9a-f]*$/i.test(this); }; | |
hexToNumber()String.prototype.hexToNumber = function(){ return Number(parseInt( this, 16 )); }; Number.prototype.toBinaryString = function( length ){ var s = Number(this).toString( 2 ); while( length && s.length < length ){ s = '0' + s; return s; ... |