How to use the xorshift.randomint function in xorshift

To help you get started, we’ve selected a few xorshift examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github midwayjs / pandora / packages / tracer / src / utils.ts View on Github external
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');
}
github midwayjs / pandora / packages / metrics / src / util / TraceUtil.ts View on Github external
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');
}
github jaegertracing / jaeger-client-node / src / util.js View on Github external
static getRandom64(): Buffer {
    let randint = xorshift.randomint();
    let buf = this.newBuffer(8);
    buf.writeUInt32BE(randint[0], 0);
    buf.writeUInt32BE(randint[1], 4);
    return buf;
  }
github jaegertracing / jaeger-client-node / src / util.js View on Github external
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;
  }
github jaegertracing / jaeger-client-node / src / util.js View on Github external
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;
  }

xorshift

Random number generator using xorshift128+

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis