Node.js examples for Number:Hex
Returns the integer i in hexadecimal string form with leading zeroes
/** Returns the integer i in hexadecimal string form, * with leading zeroes, such that/* ww w . jav a2 s. com*/ * the resulting string is at least byteCount*2 characters long. * @param {int} i * @param {int} byteCount */ toHexString = function(i, byteCount) { var string = (new Number(i)).toString(16); while(string.length < byteCount*2) { string = '0'+string; } return string; }