{"_id":"@abhinavkrin/meteor-random","_rev":"1-f9b25f95fe1733d4d971349772a2383e","name":"@abhinavkrin/meteor-random","dist-tags":{"latest":"1.2.4"},"versions":{"1.2.3":{"name":"@abhinavkrin/meteor-random","version":"1.2.3","keywords":["meteor","random","crypt"],"author":{"name":"abhinavkrin"},"license":"MIT","_id":"@abhinavkrin/meteor-random@1.2.3","maintainers":[{"name":"abhinavkrin","email":"abhinav@avitechlab.com"}],"homepage":"https://github.com/abhinavkrin/meteor-random#readme","bugs":{"url":"https://github.com/abhinavkrin/meteor-random/issues"},"dist":{"shasum":"d8787d0f47f8b920a6d85511388ad60f56771ff9","tarball":"https://registry.npmjs.org/@abhinavkrin/meteor-random/-/meteor-random-1.2.3.tgz","fileCount":35,"integrity":"sha512-q2ahxkC1YJU1/SEHufezhfhlVpab2RvA8gitthll4+fwv3glD/22sRucVo1jU0ZbEUhLHShPg6B8OCadYzDKUQ==","signatures":[{"sig":"MEUCIQCGfGScVumuHdDHZfRwaOLFMyndFtAOqouN5hgvuxl6dwIgSgbZhGth83YduF+cZ+Jko/SjAy6wi1gcTAHwY0Z5OQc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31121},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"gitHead":"6380a03553404b61339611993ed672fe9f8d748b","scripts":{"docs":"typedoc","test":"jest --verbose","build":"tsc","clean":"rm -rf ./dist ./docs","predocs":"rm -rf ./docs && mkdir ./docs","test:watch":"jest --watchAll --no-cache"},"_npmUser":{"name":"abhinavkrin","email":"abhinav@avitechlab.com"},"repository":{"url":"git+https://github.com/abhinavkrin/meteor-random.git","type":"git"},"_npmVersion":"10.7.0","description":"NPM version of Meteor's Random","directories":{},"_nodeVersion":"18.20.3","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.1.2","ts-node":"^10.9.2","typedoc":"^0.25.11","typescript":"^5.3.3","@types/jest":"^29.5.12","@types/node":"^20.11.24","@jest/globals":"^29.7.0","@tsconfig/node18":"^18.2.2"},"_npmOperationalInternal":{"tmp":"tmp/meteor-random_1.2.3_1722419390555_0.10799429519339143","host":"s3://npm-registry-packages"}},"1.2.4":{"name":"@abhinavkrin/meteor-random","version":"1.2.4","description":"NPM version of Meteor's Random","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/index.d.ts","scripts":{"build":"npm run build:esm && npm run build:cjs","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","clean":"rm -rf ./dist ./docs","predocs":"rm -rf ./docs && mkdir ./docs","docs":"typedoc","test":"jest --verbose","test:watch":"jest --watchAll --no-cache"},"engines":{"node":">=18"},"license":"MIT","repository":{"url":"git+https://github.com/abhinavkrin/meteor-random.git","type":"git"},"author":{"name":"abhinavkrin"},"keywords":["meteor","random","crypt"],"devDependencies":{"@jest/globals":"^29.7.0","@tsconfig/node18":"^18.2.2","@types/jest":"^29.5.12","@types/node":"^20.11.24","jest":"^29.7.0","ts-jest":"^29.1.2","ts-node":"^10.9.2","typedoc":"^0.25.11","typescript":"^5.3.3"},"packageManager":"yarn@4.3.1+sha512.af78262d7d125afbfeed740602ace8c5e4405cd7f4735c08feb327286b2fdb2390fbca01589bfd1f50b1240548b74806767f5a063c94b67e431aabd0d86f7774","_id":"@abhinavkrin/meteor-random@1.2.4","gitHead":"81caee53bdca48dba4046734e7832676f354c82c","bugs":{"url":"https://github.com/abhinavkrin/meteor-random/issues"},"homepage":"https://github.com/abhinavkrin/meteor-random#readme","_nodeVersion":"18.20.3","_npmVersion":"10.7.0","dist":{"integrity":"sha512-kCpJYa0vRrtPwE2mPq//T7fo7jAAU82o2beyskizW4tBxyaclxH0OUStIuexxnv42Yr3RFK1jGHv932LHUGRFw==","shasum":"1b72fcf9b2d3ad2004bf65c06e0733b1ea05bdb7","tarball":"https://registry.npmjs.org/@abhinavkrin/meteor-random/-/meteor-random-1.2.4.tgz","fileCount":67,"unpackedSize":76065,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHjyxAyybBGLT/wMGvSdox1/fCLsszk9oCJAea71DICsAiBUtwgeDbhoGev2NqeR8nUqm7JgbaxK8lsyBo5maWVmcw=="}]},"_npmUser":{"name":"abhinavkrin","email":"abhinav@avitechlab.com"},"directories":{},"maintainers":[{"name":"abhinavkrin","email":"abhinav@avitechlab.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/meteor-random_1.2.4_1722424482688_0.7134877986497319"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-31T09:49:50.453Z","modified":"2024-07-31T11:14:43.030Z","1.2.3":"2024-07-31T09:49:50.731Z","1.2.4":"2024-07-31T11:14:42.863Z"},"bugs":{"url":"https://github.com/abhinavkrin/meteor-random/issues"},"author":{"name":"abhinavkrin"},"license":"MIT","homepage":"https://github.com/abhinavkrin/meteor-random#readme","keywords":["meteor","random","crypt"],"repository":{"url":"git+https://github.com/abhinavkrin/meteor-random.git","type":"git"},"description":"NPM version of Meteor's Random","maintainers":[{"name":"abhinavkrin","email":"abhinav@avitechlab.com"}],"readme":"# @abhinavkrin/meteor-random\n\nWelcome to the `@abhinavkrin/meteor-random` package! This is a direct TypeScript port of Meteor's `random` package, tailored for server-side usage outside of Meteor code.\n\n## Overview\n\nThe `@abhinavkrin/meteor-random` package provides a suite of functions for generating random numbers and strings. Utilizing a cryptographically strong pseudorandom number generator (when available), this package ensures robust randomness for your applications. On older browsers or servers lacking sufficient entropy, it gracefully degrades to a weaker random number generator.\n\n## Features\n\n### `Random.id([n])`\nGenerate a unique identifier, perfect for ensuring uniqueness across your application.\n- **Usage**: `Random.id([n])`\n- **Example**: `Random.id()` might return `\"Jjwjg6gouWLXhMGKW\"`\n- **Parameter**: `n` (optional) specifies the length of the identifier. Defaults to 17 characters.\n\n### `Random.secret([n])`\nCreate a random string of printable characters, offering 6 bits of entropy per character. Ideal for security-critical secrets intended for machine consumption.\n- **Usage**: `Random.secret([n])`\n- **Example**: `Random.secret()` might return a 43-character string.\n- **Parameter**: `n` (optional) specifies the length of the secret string. Defaults to 43 characters, providing 256 bits of entropy.\n\n### `Random.fraction()`\nObtain a random number between 0 and 1, similar to `Math.random`.\n- **Usage**: `Random.fraction()`\n- **Example**: `Random.fraction()` might return `0.735432843`\n\n### `Random.choice(arrayOrString)`\nSelect a random element from the given array or string.\n- **Usage**: `Random.choice(arrayOrString)`\n- **Example**: `Random.choice(['apple', 'banana', 'cherry'])` might return `\"banana\"`\n\n### `Random.hexString(n)`\nGenerate a random string of `n` hexadecimal digits.\n- **Usage**: `Random.hexString(n)`\n- **Example**: `Random.hexString(8)` might return `\"4f5a1c3b\"`\n- **Parameter**: `n` specifies the length of the hex string.\n\n## Links\n- [Source Code (Released Version)](https://github.com/meteor/meteor/tree/master/packages/random)\n- [Source Code (Development Version)](https://github.com/meteor/meteor/tree/devel/packages/random)\n\nUnleash the power of randomness in your TypeScript projects with `@abhinavkrin/meteor-random`! Whether you need unique identifiers, secure secrets, or simple random numbers, this package has got you covered. Dive into the documentation to learn more and start integrating it into your projects today!\n","readmeFilename":"README.md"}