javascript number to hex string code example
Example 1: javascript convert number to hex
hexString = yourNumber.toString(16);
Example 2: javascript convert number to hex
yourNumber = parseInt(hexString, 16);
Example 3: javascript hex to string
function hex_to_ascii(str1)
{
var hex = str1.toString();
var str = '';
for (var n = 0; n < hex.length; n += 2) {
str += String.fromCharCode(parseInt(hex.substr(n, 2), 16));
}
return str;
}