Created
August 13, 2018 03:54
-
-
Save lemonlatte/5d428422a37435535b832f988c70c6c5 to your computer and use it in GitHub Desktop.
hex to string in JS
This file contains 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 hexToString (hex) { | |
var string = ''; | |
for (var i = 0; i < hex.length; i += 2) { | |
string += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); | |
} | |
return string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment