0.0.2 • Published 13 years ago

word-generator v0.0.2

Weekly downloads
10
License
-
Repository
github
Last release
13 years ago

node-word-generator

Features:

  • Random generate a word or many words which can be used as passwords, keys etc.
  • You can specify your letters to generate words or use default letters(A-Z,a-z,0-9).
  • For each word callback your function to do something, such as to guess or crack passwords ...

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 }

0.0.2

13 years ago

0.0.1

13 years ago