I know device ID is a 24 hex digits in a string. I want to compress it to 6-char string using the following algorithm.
Since String class on Electron has no fromCharCode function and no parseInt function is available either, how can I implement the same algorithm?
Thanks.
function hexToString(hex) {
var string = ""
for (var i = 0; i < hex.length; i+= 4){
string += String.fromCharCode(parseInt(hex.substring(i,i + 4), 16)) // get char from ascii code which goes from 0 to 65536
}
return string;
}