📜  javascript ascii 到 hex - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:30.334000             🧑  作者: Mango

代码示例1
function ascii_to_hex(str)
  {
    var arr1 = [];
    for (var n = 0, l = str.length; n < l; n ++) 
     {
        var hex = Number(str.charCodeAt(n)).toString(16);
        arr1.push(hex);
     }
    return arr1.join('');
   }