十进制数组转成以空格隔开的十六进制字符串
[1,2,3,4,5] => ‘01 02 03 04 05’
const decArrayToHexStr = (array) => {var hexStr = ""for(var i = 0; i < array.length; i++) {var str = array[i].toString(16).toUpperCase();if (str.length < 2) {str = "0" + str}hexStr = hexStr + str + " "}return hexStr.substr(0, hexStr.length - 1)
}
以空格隔开的十六进制字符串转为十进制数组
‘01 02 03 04 05’ ==> [1, 2, 3, 4, 5]
const hexStrToDecArray = (str) => {var strArray = str.split(" ")var decArray = []for(var i = 0; i < strArray.length; i++) {decArray.push(parseInt(strArray[i], 16))}return decArray
}
二进制字符串转十六进制
const bin_to_hex(s