Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function getRandom64() {
let randint = xorshift.randomint();
let buf = new Buffer(8);
buf.writeUInt32BE(randint[0], 0);
buf.writeUInt32BE(randint[1], 4);
return buf.toString('hex');
}
export function getRandom64() {
let randint = xorshift.randomint();
let buf = new Buffer(8);
buf.writeUInt32BE(randint[0], 0);
buf.writeUInt32BE(randint[1], 4);
return buf.toString('hex');
}
static getRandom64(): Buffer {
let randint = xorshift.randomint();
let buf = this.newBuffer(8);
buf.writeUInt32BE(randint[0], 0);
buf.writeUInt32BE(randint[1], 4);
return buf;
}
static getRandom128(): Buffer {
let randint1 = xorshift.randomint();
let randint2 = xorshift.randomint();
let buf = this.newBuffer(16);
buf.writeUInt32BE(randint1[0], 0);
buf.writeUInt32BE(randint1[1], 4);
buf.writeUInt32BE(randint2[0], 8);
buf.writeUInt32BE(randint2[1], 12);
return buf;
}
static getRandom128(): Buffer {
let randint1 = xorshift.randomint();
let randint2 = xorshift.randomint();
let buf = this.newBuffer(16);
buf.writeUInt32BE(randint1[0], 0);
buf.writeUInt32BE(randint1[1], 4);
buf.writeUInt32BE(randint2[0], 8);
buf.writeUInt32BE(randint2[1], 12);
return buf;
}