1.0.3 • Published 8 years ago

random-hexadecimal v1.0.3

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

random-hexadecimal

Return a random hexadecimal number.

MIT License

build:? coverage:?

Install

$ npm install --save random-hexadecimal

Usage

For more use-cases see the tests

var randomHex = require('random-hexadecimal');

// API
// - randomHex([options]);

// options
// - min
// - max

By default it will return an hexadecimal number between 0 and 9007199254740992:

randomHex();
// => '0xaf91'

Can optionally provide min and max:

randomHex({ max: 15 });
// => '0od'

randomHex({ min: 7, max: 15});
// => '0o7ab9'

Note: these min and max are inclusive, so they are included in the range.

Related

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.