mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 12:11:36 +00:00
fix: bigInt (#472)
This commit is contained in:
parent
a6bb919268
commit
d7061f73b2
@ -323,7 +323,7 @@ function toUInt64 (n) {
|
||||
if (n > MAX_UINT || typeof n === 'string') {
|
||||
const buf = new Uint8Array(8)
|
||||
const view = new DataView(buf.buffer)
|
||||
view.setBigUint64(0, n)
|
||||
view.setBigUint64(0, BigInt(n))
|
||||
return buf
|
||||
}
|
||||
return concat([new Uint8Array(4), common.toUInt32(n)])
|
||||
|
Loading…
Reference in New Issue
Block a user