random-hexhash
v1.0.0
Published
Return a random hex hash.
Downloads
10
Maintainers
Readme
random-hexhash
Return a random hex hash.
Install
$ npm install --save random-hexhash
## Usage
```js
var randomHash = require('random-hexhash');
// API
// - randomHash([options]);
// options
// - length
// - casing
By default, the hash is lowercase and 40 hex characters long (same as a git commit hash).
randomHash();
// => 'e5162f27da96ed8e1ae51def1ba643b91d2581d8'
Optionally specify a length:
randomHash({length: 15});
// => 'c28f57cb599ada4'
Optionally specify casing to get a hash with only uppercase letters rather than the default lowercase:
randomHash({casing: 'upper'});
// => '3F2EB3FB85D88984C1EC4F46A3DBE740B5E0E56E'
Related
- random-uuid - Return a random uuid.
- random-identity - Return a random ID.
- random-dx - Return a value equal to the roll of a die.
- random-normal - Return a normally-distributed random variate.
- random-rpg - Return an array of dice values.
- random-file - Return a random file name with random extension.
- random-semver - Return a random version.
Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.