1.1.1 • Published 8 years ago
gen-r v1.1.1
gen-r
Usage
gr[number, type, random, RegExp]
Number - default: 1 - how many characters should a string contain or in case of an array - how many entries
Type - default: array - if null the function will output string. Otherwise place an empty array to create an array. (you can add a number inside that empyt array - it will work as a first number of the array that's going to be created')
Random - default: false - radomizes the output
RegExp - default /0-9/g - you can set your own range of characters being used
Examples
Generate an 0 to 5 array
gr(5)
Generate an 15 to 20 array
gr(5, [15])
Generate a random string of 25 characters
gr(25, '', true, /.+/g)