function long2bin(p) { var r = new ArrayBuffer(8); r[7] = p & 0xff; r[6] = p >> 8 & 0xff; r[5] = p >> 16 & 0xff; r[4] = p >> 24 & 0xff; p = p.toString(16); //轉換成16進位制,取出高位 if (p.length <= 8) { return r; } p = parseInt(p.substr(0, p.length - 8),16);//取出高位,並轉換成int r[3] = p & 0xff; r[2] = p >> 8 & 0xff; r[1] = p >> 16 & 0xff; r[0] = p >> 24 & 0xff; return r; }
function long2bin(p) { var r = new ArrayBuffer(8); r[7] = p & 0xff; r[6] = p >> 8 & 0xff; r[5] = p >> 16 & 0xff; r[4] = p >> 24 & 0xff; p = p.toString(16); //轉換成16進位制,取出高位 if (p.length <= 8) { return r; } p = parseInt(p.substr(0, p.length - 8),16);//取出高位,並轉換成int r[3] = p & 0xff; r[2] = p >> 8 & 0xff; r[1] = p >> 16 & 0xff; r[0] = p >> 24 & 0xff; return r; }