Skip to content

mock-end/random-hexadecimal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Return a random hexadecimal number.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published