菜农电子淘宝:https://hotcomlock.taobao.com/ 准备出书:http://hotcomlock.com/hotcomlock.html
function Base4096ToHex(hotcodestr) {
var str, ptr, ctr, i, j, num, hexstr;
hexstr = HotCodeToHex(hotcodestr);
str = "";
for(i = 0;i < hexstr.length;i +=8) {
num = hextoint(hexstr.substr(i, 4)) - 0xae00;
ptr = inttohex(num, 4);
ctr = ptr.substr(2, 2) + ptr.substr(1, 1);
num = hextoint(hexstr.substr(i + 4, 4)) - 0xae00;
ptr = inttohex(num, 4);
ctr += ptr.substr(1, 1) + ptr.substr(2, 2);
while(ctr.substr(ctr.length - 2, 2) == "00"){
ctr = ctr.substr(0, ctr.length - 2);
}
str += ctr;
}
return str;
}
|