js string 转换为十六进制转义序列
function convertToHexEscape(str) { let hexEscape = ""; for (let i = 0; i < str.length; i++) { const charCode = str.charCodeAt(i); const hexValue = charCode.toString(16); hexEscape += "\\x" + hexValue; } return hexEscape; } const input = "los28199"; const hexEscapeSequence = convertToHexEscape(input); console.log(hexEscapeSequence);