In Javascript, how do I convert a string representation of a hex value to its hex representation?
What I am returning from the checksum routine is the string value "FE". I need this hexadecimal representation of "\ xFE"
I cannot just do this, as this gives me an error:
var crc = "FE";
var hex = "\x" + crc;
This just gives me a new 4-character ASCII string:
var crc = "FE";
var hex = "0x" + "FE";
Thanks for any guidance.
source
share