Created
April 26, 2022 08:46
-
-
Save alperbayram/14477dae2cd60d190d7df4c94a479b4e to your computer and use it in GitHub Desktop.
Hex to ascii with javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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