Skip to content

pseudo-random string generator with an indication of the alphabetical set and the percentage of the appearance of each element

adaptunit/random-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

random-string

pseudo-random string generator with an indication of the alphabetical set and the percentage of the appearance of each element

Using:

$ node random-string.js stringLength inputfile.json

"stringLength" - integer value - how result string is long...

"inputfile.json" must contain JSON like this:

 [ { letter: 'a', chance: 0.2 },
  { letter: 'b', chance: 0.1 },
  { letter: 'c', chance: 0.5 },
  { letter: 'd', chance: 0.2 } ] 
$ node random-string.js 42 inputparams.json 

Output:

abcadcbcccabacddcdcaddacdaccccccdcccabdccc

About

pseudo-random string generator with an indication of the alphabetical set and the percentage of the appearance of each element

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published