{"_id":"@aspiesoft/random-number-js","_rev":"5-2f90ffcb46dc416e72c4cd74e2010a1d","name":"@aspiesoft/random-number-js","dist-tags":{"latest":"1.3.3"},"versions":{"1.1.0":{"name":"@aspiesoft/random-number-js","version":"1.1.0","description":"Generate random numbers with more variety.","license":"MIT","author":{"name":"AspieSoft"},"main":"script.min.js","scripts":{"test":"node test.js","build":"node build.js"},"repository":{"type":"git","url":"git://github.com/aspiesoft/random-number-js.git"},"keywords":["random","number","js","javascript","nodejs"],"devDependencies":{"@aspiesoft/miniforge-js":"^1.0.0"},"gitHead":"58d2a952af3b549a2e4a5b955fa9aea01d0799d1","bugs":{"url":"https://github.com/aspiesoft/random-number-js/issues"},"homepage":"https://github.com/aspiesoft/random-number-js#readme","_id":"@aspiesoft/random-number-js@1.1.0","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"integrity":"sha512-qaMW8yWQox4IEeeuN34yKN+RW7WnYtgVqshmsjbJdAjX2IMkbhgVrJfKRDRtfju5bMRv1VS3Arpa2I1xwWaW9Q==","shasum":"ba7fea05d7fe0fb82f5d48e8b8222e26cf4f5997","tarball":"https://registry.npmjs.org/@aspiesoft/random-number-js/-/random-number-js-1.1.0.tgz","fileCount":4,"unpackedSize":7102,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfd0D6CRA9TVsSAnZWagAADLgQAJFxDbvA3FPrMgS56rc5\nVpJg3aS/FVs/8aIcwPQAszrszdAw+iPFKxRG0RFG4Nr1lyCLW5mEFoeSWlo1\nM3gURa/7XgBoUJzmYu3cPNBfBY63a82OPqyjlFof4IKH4HBUykHXSUBWFR0V\nufNS3MunA/gtQevw6vngPWCYwuCjYQK/N8ai238LB5vseaKlj/Uf3StCHJ7d\ncwzYagBdII0w7zbzTDhAao4v6Bahtl2zbM5EWCTERSMK8ROsoJJstx+fQgsR\nqRvjRTtvDeHfb04GCffEd6eMzkiKnl266nRIZOL1Tu8b9UB3x17OdjXPo9Mn\najCGmcPvpLySuR7dEQ+yqlvrVCEswIRW+o0Izq5RtI5bLo3bZCw2BO7/A/4A\nbJD09GbHNqfQUlRMuDKfr5Lu3zlNN0Dm9Zlj6FxhxU4bsUBPAtl43+0I1YRU\nko6eXwGgQYG/8MkkjGOzoDNgUFyjPH6Zb+LBN7bwkbHUSGHZ98juShv7DPjd\no3POej+v/2OvEqT6DX9J9XTmh5WY/riBM9/hy2HM4B2JUMBK1p9XEbnlQy+X\nt5rVl4e3U4lXqz1b1E8/6OGP+6g4gzu3YCJfYLMwfQvg7vhC60FjqISm1V7F\nYh1VseSJ10VO1YG2yB2ybOsWb6IAdFNtZOpgVPHpXllCkNapk/e8aewS3Tu0\nzave\r\n=wmpY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClACafc0Es6g79SXWV/C4cYYHHSRgwLZbuH5IkUh09/gIhAIDmD+MbbN2J8cNzbKzqQgtQJ9AEcseuEdrUwxJLNK9t"}]},"maintainers":[{"name":"aspiesoft","email":"aspiesoftweb@gmail.com"}],"_npmUser":{"name":"aspiesoft","email":"aspiesoftweb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/random-number-js_1.1.0_1601650938458_0.04092228546846721"},"_hasShrinkwrap":false},"1.2.0":{"name":"@aspiesoft/random-number-js","version":"1.2.0","description":"Generate random numbers with more variety.","license":"MIT","author":{"name":"AspieSoft"},"main":"script.min.js","scripts":{"test":"node test.js","build":"node build.js"},"repository":{"type":"git","url":"git://github.com/aspiesoft/random-number-js.git"},"keywords":["random","number","js","javascript","nodejs"],"devDependencies":{"@aspiesoft/miniforge-js":"^1.0.0"},"gitHead":"db154edae514fe32559659eec63a6bc359986a4b","bugs":{"url":"https://github.com/aspiesoft/random-number-js/issues"},"homepage":"https://github.com/aspiesoft/random-number-js#readme","_id":"@aspiesoft/random-number-js@1.2.0","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Z27sTDkmSpyRjLNmvQ2st/sud5XW5ray9IxLKl7aActiNPW+g5hvqLGUyToALcRi9DTPw3hD7ALZtVmxYFcjIQ==","shasum":"f35d3f0efc6a9f0170bd3a7d911d8ee31227803e","tarball":"https://registry.npmjs.org/@aspiesoft/random-number-js/-/random-number-js-1.2.0.tgz","fileCount":4,"unpackedSize":7105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfd0MYCRA9TVsSAnZWagAALtIP/ihlKCfwE3BFJTUJoVCo\nqc0soiwBi4GRJeNr4DsHbraRFC1T5VTmEWbrcLwHhkhi5NUS8CKOUf4xQkce\nlrHovtwcFeyfSMcgL3sw3nUMm044wK2Qb33S2Ijqsgk3K8DDTekfEVYh+Nu/\nlqWLioh9Fc1ocNpg9Q8e/df4gEZfM6SX7SvoX7wJHMkkWew79zAh7ymEHiz/\nsBJthaRyr8if3fTJSFPVyHS1lb70AlfRTPWXWB1F4WCiD0r5+DcrdGSLwdLG\nijXvDrbZ1roskL0z9lhShrH/UL+m1evEos1ijs94PrRKMJ6xSWMMpyWnP+Xa\nCy0MFspGN0z535onPUlhRefVwUkFvnn+DBNo0P+OtckvNcEMXGfT+5ZaQHRu\nr/tsF6MD5ZTS5xexDAmZHm/cGB3/A3G39gsBaJdUbswGeGJbwU2EGZK/ff2s\nrZmS0zfvcljwoYwElRU2zsiJAaRfa6fOD8WwJGSxT7w6pxaxHkDvCui7KQTZ\nMwiJsh9vgPPU04N6BjsblOD8xy+Q/f5xx6sO85wSWPD2oZ0FaQVSassV7fJz\nnBGg61/925n4SdqOJDaovoXPWAPSUzjvH+rf7Zg7Nkpcj7rKk7d/bvugT7vC\ni7/9KnamjQH6JZEcfbZu8aPgfUqZ/zK/vYh2QukM6QbYwv5dwOv1qd9g26rp\ne3HY\r\n=/Zzd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHRqfni+OKeUdrvmLQQf0fPdN/PKfo5cLhf4jyUkWUbYAiEA7bZdxzSHEFCnBFBshg4eyPhmxay2s6Qk4u75DUjJ0Ew="}]},"maintainers":[{"name":"aspiesoft","email":"aspiesoftweb@gmail.com"}],"_npmUser":{"name":"aspiesoft","email":"aspiesoftweb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/random-number-js_1.2.0_1601651480151_0.44509843496406476"},"_hasShrinkwrap":false},"1.3.0":{"name":"@aspiesoft/random-number-js","version":"1.3.0","description":"Generate random numbers with more variety.","license":"MIT","author":{"name":"AspieSoft"},"main":"script.min.js","scripts":{"test":"node test.js","build":"node build.js"},"repository":{"type":"git","url":"git://github.com/aspiesoft/random-number-js.git"},"keywords":["random","number","js","javascript","nodejs"],"devDependencies":{"@aspiesoft/miniforge-js":"^1.0.0"},"gitHead":"aed0de439553a88c79d7c483ade2d2e70bf9b735","bugs":{"url":"https://github.com/aspiesoft/random-number-js/issues"},"homepage":"https://github.com/aspiesoft/random-number-js#readme","_id":"@aspiesoft/random-number-js@1.3.0","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-MOWVjPliPuHGY3d/GR62eyiFWXzc2cJgLxp82zG2YDftcrtyVEv0vqPJ+/C+Uv7OsuR3PS8bxH6oL8XEwxM7zQ==","shasum":"d6243520718008dcad65db0f92a4bdd3382685f3","tarball":"https://registry.npmjs.org/@aspiesoft/random-number-js/-/random-number-js-1.3.0.tgz","fileCount":4,"unpackedSize":8156,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrCaQCRA9TVsSAnZWagAAN3MP/3CO5e35025uA9nK09Ma\nlLZHKFzSsWY8EoeAvflctl42q5wMm2C3uERGlpfVZ9F457KsrpP+4P2LnddY\nUWLfCdLMehvkwd7OkE/GAz1DOWu4u9UlWN9SV40u/61UpqZkKeJ/HBRWeRmX\nYaLAOXAKSSFsNW0ZLb975ungOsu9Zs8YG9f+BzyYUK9Q9ufW4xwKMCCNEizh\nlP/Z4UWfM0dOcBWYwJZjE7ii4vJ44mUR+kSMjKJoGM2CZrS9c6h9ICZdSwJ4\nveB0mStbil6fh2pdIbo0V+JZ3SMxT9rxojEL1Lu8Ycjf9J/O6TaZsR7Uc8vc\ntbzhGGlZ+7tx6s22BfDtKrRQ3qsIKl//ZOOenMF9VRQ5dEC4RsiXnCMtA5zL\nktA09w5XYv5GkfAYxL4A1fPabx1Zw0hWoZ++yg+SfTZlPMKOvNDsMP16PUbd\nO4eD6zGIQS0k86PO8CRGlOcolQVCfJ/bg1hHvfVT+yUjdAg+rAisIhhGIWU4\nsqKJTmLBbEbMJDbgTV0qomMds2tFcuQZvQnD8L2i9TxIcaXY4MIm0dH7tPxc\nJ08ePHYtx834Z0NE9cBMgO7PHSgk5F0J0hKnPFFVaaSGurEYAm4/s1vpjzsT\nR6qyj6yDFZVCAv8AIBTIveJqQw08hfFwn6FLDHjdQoAyrJg4/P5GmRH38gzT\nssaS\r\n=vEmr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbEAUBeF9OhlpQvZybQSvXgYZahnl0EcQB6UP7/VGE5gIhAJts2xv6iboAbioNsjdG4/IjZPGR6Cvg71N/4EnlSVZo"}]},"_npmUser":{"name":"aspiesoft","email":"aspiesoftweb@gmail.com"},"directories":{},"maintainers":[{"name":"aspiesoft","email":"aspiesoftweb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/random-number-js_1.3.0_1605117584335_0.4895946498593382"},"_hasShrinkwrap":false},"1.3.2":{"name":"@aspiesoft/random-number-js","version":"1.3.2","description":"Generate random numbers with more variety.","license":"MIT","author":{"name":"AspieSoft"},"main":"script.min.js","scripts":{"test":"node test.js","build":"node build.js"},"repository":{"type":"git","url":"git://github.com/aspiesoft/random-number-js.git"},"keywords":["random","number","js","javascript","nodejs"],"devDependencies":{"@aspiesoft/miniforge-js":"^1.0.0"},"gitHead":"3c79d49ec909c9277230f829b1e957e1a0a3b183","bugs":{"url":"https://github.com/aspiesoft/random-number-js/issues"},"homepage":"https://github.com/aspiesoft/random-number-js#readme","_id":"@aspiesoft/random-number-js@1.3.2","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Opfi18x79J+dZTpRSxlekoFbVgz+OgC9GRoY5hQLKSa979z4liRGlh36qeW5rYu5N1bB9TAPPcUNUSkThNt3bA==","shasum":"0868a931572de844fe0289aed0e6a03d0bddc4b3","tarball":"https://registry.npmjs.org/@aspiesoft/random-number-js/-/random-number-js-1.3.2.tgz","fileCount":4,"unpackedSize":8264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrCxKCRA9TVsSAnZWagAAB0wP/1zidPHnKgArTngZe6PM\n6NTioh6bnLBUgs7bopslI44UCzcGTU8fT/ynjld7ImSErgtfHQeaIuBlzF0i\njpjZYBSsJkW/4/cX+pUA5kHx50rr7LDoMvHRVHkj4Z2IathaP3jvnqJn1Toz\nRf19ejrJxjpOpHRh4Ync6bqbCHnBHtQSX1NOii7f3u0yMp20+bX2q9ef5sYY\n8OV18DsmdNQ26mfdleeOpP0PRoBXa4zUmIQA6kCtzmP6UAp4EGOvQ1UKA7M5\nTCKQaTtqYUkkU8O5awjcev4w1XhtjUYbZKakdl1RxX3SpwQ5g0Khv2R2NS47\n5H7+ZjRl355qlyekFl7PSlg6L1WCmwAZVpalAKKC89mEQ8OCZtpwzVkA3XMI\nrjQE4EisYXW0uJYbz4YShEtV2i2oco+lVRvurTeFYGBdlFbvyc8Z+VGUoJvZ\nGDgaxMLhYh+E/OTIJ6exwp+DbFhaG2dA7UWjsmNAgFbFDaxkUC6l8YCt+6bi\nt1Ar6nR+bDOZ/G8VOlX2EGWijSLt+HGWjd83ZG9lZGThlLw1JETfB/5LTU8F\ngtcnQRf9tY/yg6ir2TQwOoSFD7xD1erARD2+ucIF1J8L5ID4Ac5kkY4d3x0h\nPngNxedu0uC8UeLsyiXwTJbQRG6kbAnkRQ+2HdNke4Ssg8Z2QHd/XLBBaOnr\n9oGk\r\n=zZcM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHHtUsy/uxyLXizTP9kAAJOXYXV4g/2jF5voskzUMmrLAiAR6L65JWVjDGPjpKD9fPSxrJijOEph044SapbWvC22Hw=="}]},"_npmUser":{"name":"aspiesoft","email":"aspiesoftweb@gmail.com"},"directories":{},"maintainers":[{"name":"aspiesoft","email":"aspiesoftweb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/random-number-js_1.3.2_1605119050249_0.48911948054316357"},"_hasShrinkwrap":false},"1.3.3":{"name":"@aspiesoft/random-number-js","version":"1.3.3","description":"Generate random numbers with more variety.","license":"MIT","author":{"name":"AspieSoft"},"main":"script.min.js","scripts":{"test":"node test.js","build":"node build.js"},"repository":{"type":"git","url":"git://github.com/aspiesoft/random-number-js.git"},"keywords":["random","number","js","javascript","nodejs"],"devDependencies":{"@aspiesoft/miniforge-js":"^1.2.2"},"gitHead":"e60aca3617a9bbbb7e15475fc93801692006c5cf","bugs":{"url":"https://github.com/aspiesoft/random-number-js/issues"},"homepage":"https://github.com/aspiesoft/random-number-js#readme","_id":"@aspiesoft/random-number-js@1.3.3","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-YY8Mf3VveaeZwJJtlWaZO/qiMAWURnoWRhsxG5X7qx3lCSDym1zivoQ5o5Tnyf0vJGTyBxtGJXP4VRZnKD5Mfw==","shasum":"7fb89ddd3f1b8da4ded73d70fd9d0d1e64bb4bfb","tarball":"https://registry.npmjs.org/@aspiesoft/random-number-js/-/random-number-js-1.3.3.tgz","fileCount":4,"unpackedSize":8264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGExtCepi0njjIsvuWevVBZIFXNPAyQ8iULtSO6Jrq3JAiBsccI1icLwGBATQMG4gynrdLpozGep1r7sZxszEBKkHQ=="}]},"_npmUser":{"name":"aspiesoft","email":"aspiesoftweb@gmail.com"},"directories":{},"maintainers":[{"name":"aspiesoft","email":"aspiesoftweb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/random-number-js_1.3.3_1698284420203_0.8485836591344074"},"_hasShrinkwrap":false}},"time":{"created":"2020-10-02T15:02:18.412Z","1.1.0":"2020-10-02T15:02:18.590Z","modified":"2023-10-26T01:40:20.583Z","1.2.0":"2020-10-02T15:11:20.358Z","1.3.0":"2020-11-11T17:59:44.418Z","1.3.2":"2020-11-11T18:24:10.364Z","1.3.3":"2023-10-26T01:40:20.390Z"},"maintainers":[{"name":"aspiesoft","email":"aspiesoftweb@gmail.com"}],"description":"Generate random numbers with more variety.","homepage":"https://github.com/aspiesoft/random-number-js#readme","keywords":["random","number","js","javascript","nodejs"],"repository":{"type":"git","url":"git://github.com/aspiesoft/random-number-js.git"},"author":{"name":"AspieSoft"},"bugs":{"url":"https://github.com/aspiesoft/random-number-js/issues"},"license":"MIT","readme":"# Random Number JS\r\n\r\n![npm version](https://img.shields.io/npm/v/@aspiesoft/random-number-js)\r\n![GitHub top language](https://img.shields.io/github/languages/top/aspiesoft/random-number-js)\r\n![GitHub license](https://img.shields.io/github/license/aspiesoft/random-number-js)\r\n\r\n![npm downloads](https://img.shields.io/npm/dw/@aspiesoft/random-number-js)\r\n![npm downloads](https://img.shields.io/npm/dm/@aspiesoft/random-number-js)\r\n![jsDelivr hits (GitHub)](https://img.shields.io/jsdelivr/gh/hm/aspiesoft/random-number-js)\r\n\r\n[![paypal](https://img.shields.io/badge/buy%20me%20a%20coffee-paypal-blue)](https://buymeacoffee.aspiesoft.com/)\r\n\r\n## Generate random numbers with more variety\r\n\r\nJavaScript's Math.random() function tends to generate the same number at times.\r\nThis random() function has a low chance of returning the same number twice, but still maintains that chance.\r\n\r\nJavaScript's Math.random() returns a decimal, which you would then multiply by 10, 100, 1000, ect and then floor.\r\nThis random() allows you to pass parameters for minimum and maximum number result, and still get a nice and random result.\r\n\r\nThis function also runs fast, and uses the time in milliseconds to help add variety to its random results.\r\nThe function, also (optionally, true by default) keeps track of recent random results, and tries to avoid repeating them, but does so randomly.\r\nThe functions memory for recent random numbers is also cleared on a 1 second interval by default, and can be changed (or disabled) with a function as shown below.\r\n\r\n## Whats New\r\n\r\n- added option to avoid repeat numbers within a radius of each other\r\n- enabling lite mode globally now disables the clear interval automatically\r\n\r\n## Installation\r\n\r\n### node.js\r\n\r\n```shell script\r\n\r\nnpm install @aspiesoft/random-number-js\r\n\r\n```\r\n\r\n### cdn\r\n\r\n```html\r\n\r\n<script src=\"https://cdn.jsdelivr.net/gh/AspieSoft/random-number-js@1.3.2/script.min.js\"></script>\r\n\r\n```\r\n\r\n## Usage\r\n\r\n```JavaScript\r\n\r\n// require only if using node.js\r\nconst random = require('@aspiesoft/random-number-js');\r\n\r\n\r\nrandom(); // output: (25) random number between 0 and 100\r\n\r\nrandom(10, 50); // output: (42) random number between 10 and 50\r\n\r\nrandom(-50, 50, 2); // output: (23.02, -45.53, 2.5) random number between -50 and 50\r\n\r\nrandom(0, 100, -1); // output: random number with a random decimal size between 0 and 10\r\n\r\nrandom(0, 1, 10); // output: random number with a random decimal size between 0 and e^10\r\n\r\n// reduce the chance of numbers being near each other\r\nrandom.setAvoidRadius(10); // default: 0\r\n// will treat numbers within a distance of 10 of any previous number, as if it's a repeated number\r\n// example: if output1 = 5 and output2 = 7, because 7-10 <= 5, output2 counts as a repeat of output1\r\n\r\n// optional enable lite mode (false by default)\r\n// changes the default option, and can be (optionally) overwritten by the function\r\nrandom.setLiteMode(true || false); // default: true (default for function attr, Not for the option)\r\n// be default, the random function remembers past results for 1 second, and avoids repeating them.\r\n// setting lite mode disables this feature, and reduces memory usage.\r\n// the numbers will still often have variety, but with a higher chance of repeats\r\n\r\n// change the interval for clearing previous results\r\nrandom.setClearInterval(1000); // default: 1000 (1000 milliseconds = 1 second)\r\nrandom.setClearInterval(0); // disable interval\r\n\r\nrandom(\r\n  \"<insert minimum value>\", // default: 0\r\n  \"<insert maximum value>\", // default: 100\r\n  \"<insert decimal size>\", // default: 0\r\n  // individually set lite mode for current function (only works if lite mode is globally disabled)\r\n  true || false, // default: null (uses default option)\r\n);\r\n\r\n```\r\n","readmeFilename":"readme.md"}