random-hexadecimal

1.0.3 • Public • Published

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.

Package Sidebar

Install

npm i random-hexadecimal

Weekly Downloads

94

Version

1.0.3

License

MIT

Last publish

Collaborators

  • bubkoo