{"name":"alea","version":"1.0.1","description":"Implementation of the Alea PRNG by Johannes Baagøe","main":"alea.js","scripts":{"test":"node test"},"keywords":["badass","pseudo","random","number","generator"],"devDependencies":{"tape":"~0.1.1"},"repository":{"type":"git","url":"git+https://github.com/coverslide/node-alea.git"},"author":{"name":"Richard Hoffman","email":"coverslide@gmail.com","url":"http://coverslide.me"},"testling":{"files":"test.js","browsers":{"ie":[6,7,8,9],"ff":[3.6,4,17,"nightly"],"chrome":[22,23,"canary"],"opera":[10,11,12,"next"],"safari":[5.1]}},"license":"MIT","gitHead":"4107f9c589f5dbee7f2e9d425c6e3bbee70e6cb9","bugs":{"url":"https://github.com/coverslide/node-alea/issues"},"homepage":"https://github.com/coverslide/node-alea#readme","_id":"alea@1.0.1","_nodeVersion":"16.5.0","_npmVersion":"7.19.1","dist":{"integrity":"sha512-QU+wv+ziDXaMxRdsQg/aH7sVfWdhKps5YP97IIwFkHCsbDZA3k87JXoZ5/iuemf4ntytzIWeScrRpae8+lDrXA==","shasum":"957f60741c5ad11b13f72aa02a6b89fe96a26dc4","tarball":"http://registry-npm.ywwl.com/alea/download/alea-1.0.1.tgz","fileCount":6,"unpackedSize":9581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhN554CRA9TVsSAnZWagAAwtEQAJa/SSFavlwE5+3ILa+O\nBljTDlyoXDiaJitRSUKRE0r+5mRyZaHB+pJgVQMdb3Fn6msDZmQ2+/EZHiZi\nVMJtOem1rXLYSdtM1cmJC7pTAq/JG4tQ9T3SnoIaVExWsNXFFlLpYxCuOmv9\n+c0Ytr75GRhTgcp855t7/X0ALia0ALm8lNr/OcQkdotm5+jh91kyTDs1kDMw\n1CDmS4Gn6rxB4FdlJeBGPf516fB6OX+dEHQJPCaMW2HDoV4XBJxETHO4Nm/y\ndY9+N4fTNh4HVJFD6Zs5o52WZMT55QeoeFZg+d+7fgs0cQy7Z3MxQksoZiLS\nMdwZXh80LSHrEXf8KyeLSF22QmkTVGizvgpCy4W4/3j1/sE2u/QAaJzyWJdu\nvHNGiFhoR3JWFBbqH+3RrnXl737d7d4sGpZadRlmnjlncJLYEThENhi2UeB9\n92pcOg3jfh+fttGgkFzRm64+JU2kjy6RZWTAo+JZRD61cZiIBbt/6F6eHrtk\nIp6YYChT8HyTh8G0lJHX5jykldtIV+2Cwl6RNK20t6h1CHsr2di6Jqf3ISJC\nWyw+UctlgVcbQVgN9aj3Dh80B+bvesWXs3WMwc8EzWX1fr4L4UohlZ3EQtfp\nDruCUv1p5S2Eqt8j/Uc559qECkVy1AxYrKdZKFDf5b4OfBg0Qe2OiAf2J8EV\nXHQ2\r\n=HjQZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEXis3jxqjauVBbBCOs/w7ErsndmcuLy5ZZ3OSyQp5GTAiBuD2iSGAZf60+K4TUHJjKUmjio5M4XvzKSZpTqc+IoRQ=="}],"size":3818,"noattachment":false,"key":"/alea/-/alea-1.0.1.tgz"},"_npmUser":{"name":"coverslide","email":"coverslide@gmail.com"},"directories":{},"maintainers":[{"name":"coverslide","email":"coverslide@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alea_1.0.1_1631034999813_0.724311455874741"},"_hasShrinkwrap":false,"readme":"# Alea\n\nA simple copy-and-paste implementation of Johannes Baagøe's Alea PRNG\n\nMostly packaged so I can easily include it in my projeccts. Nothing more\n\nJavaScript's Math.random() is fast, but has problems. First, it isn't seedable, second, its randomness leaves a bit to be desired. [Johannes Baagøe](http://baagoe.org/) has done some great work in trying to find a more modern PRNG algorithm that performs well on JavaScript, and Alea seems to be the one that has come out ahead ([benchmarks](http://jsperf.com/prng-comparison)).\n\n## Installation\n\n\tnpm install alea\n\n## Usage\n\n\tvar Alea = require('alea')\n\t\n\tvar prng = new Alea() // add an optional seed param\n\n\tvar nextRandnum = prng() // just call the return value of Alea\n\n## Additions\n\nAlso adds the ability to sync up two Alea PRNGs via the importState and exportState methods.\n\n\tvar prng1 = new Alea(200)\n\n\tprng1()\n\tprng1()\n\n\t// after generating a few random numbers, we will initialize a new PRNG\n\n\tvar prng2 = Alea.importState(prng1.exportState())\n\n\t// this should echo true, true, true\n\tconsole.log(prng2() == prng1())\n\tconsole.log(prng2() == prng1())\n\tconsole.log(prng2() == prng1())\n\nThe theory behind this is that while a server is running a simulation (for example, a game) and clients connect to the server, each client will run its own simulation without having to depend 100% on the server for every update of the simulation state. By importing the current generator state from the server, a client can join in at any time and have an accurate simulation fully in sync with the server.\n\n## Acknowledgements\n\nEverything in this module was made by Johannes Baagøe. I just wanted this in npm.\nRead more on his [homepage](http://baagoe.org/).\n","publish_time":1631035000018,"_cnpm_publish_time":1631035000018,"dist-tags":{"latest":"1.0.1"}}