@lancejpollard/quadratic-residue-prng.js

1.0.0 • Public • Published

Permutation PRNG

const permute = require('@lancejpollard/quadratic-residue-prng.js')

const E = 3132343537383103113163n
const A = 975319753197531975319n
const O = 541613713n
const U = 32 ** 15

let i = 0
while (i < U) {
  const x = permute(i, E, A, O, U)
  console.log(x)
  i++
}
  • E, A, and O must be primes smaller than U, with E the largest, A the second largest, and O relatively small.
  • U can be any bigint.
  • All numbers must be bigint.
  • i is an incrementing bigint

Readme

Keywords

none

Package Sidebar

Install

npm i @lancejpollard/quadratic-residue-prng.js

Weekly Downloads

28

Version

1.0.0

License

none

Unpacked Size

901 B

Total Files

3

Last publish

Collaborators

  • lancejpollard