Skip to content

Instantly share code, notes, and snippets.

@lemonlatte
Created August 13, 2018 03:54
Show Gist options
  • Save lemonlatte/5d428422a37435535b832f988c70c6c5 to your computer and use it in GitHub Desktop.
Save lemonlatte/5d428422a37435535b832f988c70c6c5 to your computer and use it in GitHub Desktop.
hex to string in JS
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