# meteor-random

> Meteor's Random Package for Straight Node

Latest version **0.0.3** (published 2015-01-11) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install meteor-random
pnpm add meteor-random
yarn add meteor-random
bun add meteor-random
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2015-01-11 |
| First published | 2015-01-10 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Trever Faden |
| Maintainers | trever |
| Keywords | random, meteor, crypto, api, key, generator, api, keys, tokens, UUID |

## Links

- npm: https://www.npmjs.com/package/meteor-random
- Repository: https://github.com/RebelMail/meteor-random
- Issues: https://github.com/RebelMail/meteor-random/issues
- npm.io page: https://npm.io/package/meteor-random

## Dependencies (1)

- [crypto](https://npm.io/package/crypto.md) 0.0.3

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2015-01-11
- 0.0.2 — 2015-01-10
- 0.0.1 — 2015-01-10

## README

# meteor-random
Meteor's Random Package, Stripped for Straight Node

```
  Random = require('meteor-random');
```
The random package provides several functions for generating random numbers. It uses a cryptographically strong pseudorandom number generator when possible, but falls back to a weaker random number generator when cryptographically strong randomness is not available (on older browsers or on servers that don't have enough entropy to seed the cryptographically strong generator).

* `Random.id([n])`
Returns a unique identifier, such as "Jjwjg6gouWLXhMGKW", that is likely to be unique in the whole world. The optional argument n specifies the length of the identifier in characters and defaults to 17.

* `Random.secret([n])`
Returns a random string of printable characters with 6 bits of entropy per character. The optional argument n specifies the length of the secret string and defaults to 43 characters, or 256 bits of entropy. Use Random.secret for security-critical secrets that are intended for machine, rather than human, consumption.

* `Random.fraction()`
Returns a number between 0 and 1, like Math.random.

* `Random.choice(arrayOrString)`
Returns a random element of the given array or string.

* `Random.hexString(n)`
Returns a random string of n hexadecimal digits.


For more information see [Meteor's Random Docs](http://docs.meteor.com/#/full/random)

---
_Source: https://npm.io/package/meteor-random · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
