1.0.0 • Published 8 years ago

random-hexhash v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

random-hexhash

Return a random hex hash.

MIT License

build:? coverage:?

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

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.