You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
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;
|
|
}
|
|
console.log(hex_to_ascii('3132'));
|
|
console.log(hex_to_ascii('313030')); |