Return a random octal number.
$ npm install --save random-octal
For more use-cases see the tests
var randomOctal = require('random-octal');
// API
// - randomOctal([options]);
// options
// - min
// - max
By default it will return an octal number between 0
and 9007199254740992
:
randomOctal();
// => '0o147'
Can optionally provide min
and max
:
randomOctal({ max: 7 });
// => '0o4'
randomOctal({ min: 4, max: 7 });
// => '0o6'
Note: these min
and max
are inclusive, so they are included in the range.
- random-integral - Return a random integer.
- random-natural - Return a random natural number.
- random-decimal - Return a random decimal.
- random-floating - Return a random floating point number.
- random-index - Return a random array-like index.
- random-binary - Return a random binary number.
- random-hexadecimal - Return a random hexadecimal number.
- random-unicode - Return a random unicode.
- random-bool - Return a random boolean (true/false).
- random-char - Return a random char.
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.