function strToCode(str){
if(str==="")
return "";
var charCode = [];
for(let i=0;i<str.length;i++){
charCode.push("0x"+str.charCodeAt(i).toString(16));
}
return charCode
}
strToCode("gfuiwg"); // ["0x67", "0x66", "0x75", "0x69", "0x77", "0x67"]