fix
This commit is contained in:
parent
04fe51933a
commit
4def0cedc2
@ -1,7 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
server: {
|
server: {
|
||||||
host: "127.0.0.1",
|
host: "127.0.0.1",
|
||||||
port: 9339,
|
port: 3456,
|
||||||
},
|
},
|
||||||
|
|
||||||
auth: {
|
auth: {
|
||||||
|
@ -70,13 +70,16 @@ class Crypto {
|
|||||||
|
|
||||||
generateNonce() {
|
generateNonce() {
|
||||||
const timestamp = Date.now()
|
const timestamp = Date.now()
|
||||||
const random = Math.floor(Math.random() * 0xffffffff)
|
const high = Math.floor(timestamp / 0x100000000) >>> 0
|
||||||
|
const low = (timestamp >>> 0)
|
||||||
|
|
||||||
|
const random = Math.floor(Math.random() * 0xffffffff) >>> 0
|
||||||
const nonceBuffer = Buffer.alloc(16)
|
const nonceBuffer = Buffer.alloc(16)
|
||||||
nonceBuffer.writeUInt32BE(timestamp >> 32, 0)
|
|
||||||
nonceBuffer.writeUInt32BE(timestamp & 0xffffffff, 4)
|
nonceBuffer.writeUInt32BE(high, 0)
|
||||||
|
nonceBuffer.writeUInt32BE(low, 4)
|
||||||
nonceBuffer.writeUInt32BE(random, 8)
|
nonceBuffer.writeUInt32BE(random, 8)
|
||||||
nonceBuffer.writeUInt32BE(random ^ timestamp, 12)
|
nonceBuffer.writeUInt32BE((random ^ low) >>> 0, 12)
|
||||||
|
|
||||||
return nonceBuffer
|
return nonceBuffer
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user