random-strr
Return a random string.
Install
$ npm install --save random-strr
Usage
var randomString = ; // API// - randomString([options]); // options// - pool// - length// - min// - max
By default it will return a string with random length of 5-20
characters and will contain any of the following characters.
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@#$%^&()*_+-={}[]'
Can optionally specify a length and the string will be exactly that length:
;// => 'YN%fG'
Can optionally specify min, max, or both to limit the range.
;// => huepevesik ;// => biwuwkef ;// => omoemowawahteze
Can optionally specify a pool and the string will be generated with characters only from that pool.
;// => 'cccdeeabedebb'
Of course these options can be combined.
; 'cbbdc'
Related
- 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-octal - Return a random octal 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.
Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.