minor
This commit is contained in:
parent
390761df30
commit
eda57898a7
|
@ -201,19 +201,14 @@ function mimeFromData ( data ) {
|
||||||
|
|
||||||
function writeUIntLE( buf, value, offset, byteLength ) {
|
function writeUIntLE( buf, value, offset, byteLength ) {
|
||||||
if ( byteLength == 8 ) {
|
if ( byteLength == 8 ) {
|
||||||
try {
|
|
||||||
value = BigInt( value )
|
value = BigInt( value )
|
||||||
} catch ( err ) {
|
|
||||||
log( err )
|
|
||||||
}
|
|
||||||
var low = value & 0xffffffffn
|
var low = value & 0xffffffffn
|
||||||
var high = ( value - low ) / 0x100000000n
|
var high = ( value - low ) / 0x100000000n
|
||||||
buf.writeUInt32LE( Number( low ), offset )
|
buf.writeUInt32LE( Number( low ), offset )
|
||||||
buf.writeUInt32LE( Number( high ), offset + 4 )
|
buf.writeUInt32LE( Number( high ), offset + 4 )
|
||||||
return offset + byteLength
|
return offset + byteLength
|
||||||
} else {
|
} else {
|
||||||
value = Number( value )
|
return buf.writeUIntLE( Number( value ), offset, byteLength )
|
||||||
return buf.writeUIntLE( value, offset, byteLength )
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user