Hey all i am in need of something simple to convert character(s) into ASCII and then make that into a Hex code.
So as an example the “A” character would be:
0xF100 + ascii_code = Hex
and that would turn out to be:
0xF100 + 65 = 0xF141
Any help would be great!
toString accepts a radix parameter, with which you can convert the ASCII code to hexadecimal like this:
var data = "A"; console.log("0xF1" + data.charCodeAt(0).toString(16));
16 means base 16, which is hexadecimal.
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .