word-generator

0.0.2 • Public • Published

node-word-generator

Features:

  • Generate(random or in order) a word or many words which can be used as (guess/crack) passwords, keys etc in nodejs.
  • You can specify your letters to generate words or use default letters(A-Z,a-z,0-9).

Install:

npm install word-generator

Example:

var WG = require('word-generator');

var wg = new WG.WordsGenerator(); wg { width: 10, letters: [ '0','1','2','3','4','5','6','7','8','9', 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z' ] }

wg.generateWord() 'j4AWKwVdni' wg.generateWord() 'xi5UYW8kLj'

wg.getMaxCountCanBeGenerate() 839299365868340200

wg.generateWordsToObject(10); //each key in Object is unique { SCXI05S3xk: true, Aiy71JW6PG: true, td0LUsrAJ6: true, yi8l3M03UV: true, NRLwdPlpJ3: true, W8XQCmicgO: true, ZY3ucczf6u: true, BHYox5GAi2: true, RsUFNStamq: true, aSnkKqYCOY: true }

wg = new WG.WordsGenerator(2,'abc'); wg { width: 2, letters: [ 'a', 'b', 'c' ] }

For each word callback:

var allWords = wg.generateAllWordsToObject(function eachWordCallback(word,index){console.log(index,word)}); 1 'ba' 2 'bb' 3 'cc' 4 'ab' 5 'ac' 6 'bc' 7 'aa' 8 'ca' 9 'cb' allWords { ba: true, bb: true, cc: true, ab: true, ac: true, bc: true, aa: true, ca: true, cb: true }

Dependents (0)

Package Sidebar

Install

npm i word-generator

Weekly Downloads

4

Version

0.0.2

License

none

Last publish

Collaborators

  • andrew_goal