|
|
@ -156,16 +156,6 @@ function bytesToArrayBuffer (b) { |
|
|
|
return (new Uint8Array(b)).buffer; |
|
|
|
return (new Uint8Array(b)).buffer; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function bufferConcat(buffer1, buffer2) { |
|
|
|
|
|
|
|
var l1 = buffer1.byteLength || buffer1.length, |
|
|
|
|
|
|
|
l2 = buffer2.byteLength || buffer2.length; |
|
|
|
|
|
|
|
var tmp = new Uint8Array(l1 + l2); |
|
|
|
|
|
|
|
tmp.set(buffer1 instanceof ArrayBuffer ? new Uint8Array(buffer1) : buffer1, 0); |
|
|
|
|
|
|
|
tmp.set(buffer2 instanceof ArrayBuffer ? new Uint8Array(buffer2) : buffer2, l1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return tmp.buffer; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function bytesFromArrayBuffer (buffer) { |
|
|
|
function bytesFromArrayBuffer (buffer) { |
|
|
|
var len = buffer.byteLength, |
|
|
|
var len = buffer.byteLength, |
|
|
|
byteView = new Uint8Array(buffer), |
|
|
|
byteView = new Uint8Array(buffer), |
|
|
@ -178,6 +168,16 @@ function bytesFromArrayBuffer (buffer) { |
|
|
|
return bytes; |
|
|
|
return bytes; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function bufferConcat(buffer1, buffer2) { |
|
|
|
|
|
|
|
var l1 = buffer1.byteLength || buffer1.length, |
|
|
|
|
|
|
|
l2 = buffer2.byteLength || buffer2.length; |
|
|
|
|
|
|
|
var tmp = new Uint8Array(l1 + l2); |
|
|
|
|
|
|
|
tmp.set(buffer1 instanceof ArrayBuffer ? new Uint8Array(buffer1) : buffer1, 0); |
|
|
|
|
|
|
|
tmp.set(buffer2 instanceof ArrayBuffer ? new Uint8Array(buffer2) : buffer2, l1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return tmp.buffer; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function longToInts (sLong) { |
|
|
|
function longToInts (sLong) { |
|
|
|
var divRem = bigStringInt(sLong).divideAndRemainder(bigint(0x100000000)); |
|
|
|
var divRem = bigStringInt(sLong).divideAndRemainder(bigint(0x100000000)); |
|
|
|
|
|
|
|
|
|
|
|