Skip to content

Instantly share code, notes, and snippets.

@alperbayram
Created April 26, 2022 08:46
Show Gist options
  • Save alperbayram/14477dae2cd60d190d7df4c94a479b4e to your computer and use it in GitHub Desktop.
Save alperbayram/14477dae2cd60d190d7df4c94a479b4e to your computer and use it in GitHub Desktop.
Hex to ascii with javascript
function hexToAscii(hexx) {
var hex = hexx.toString(); //force conversion
var str = "";
for (var i = 0; i < hex.length && hex.substr(i, 2) !== "00"; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
console.log(str);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment