Generates unique, pronounceable names, random and seedable
npm install phoneticnpm install phonetic
var phonetic = require('phonetic');
Need a name?
phonetic.generate();
// "Stratulis"
phonetic.generate();
// "Quibapop"
Need a shorter name?
phonetic.generate({ syllables: 2 });
// "Neelam"
Need to generate the same name based on some user info?
phonetic.generate({ seed: '127.0.0.1' })
// "Pokenoop"
phonetic.generate({ seed: '127.0.0.1' })
// "Pokenoop"
Words are generated by transforming the seed using a series of MD5 hashes and
calculations that make it impossible for users to game the system and coerce
out a chosen word. The process is synchronous, but takes mere nanoseconds.
Generated words have an English-leaning format, using phonetics that are more
common in the English language and avoiding more international sounds. This
could be changed by packaging the phonetic sets and replacements into modules
which can be selected through the options at run time. A hint to those who
would like to get involved with the project!
The function call looks like this:
phonetic.generate([options])
#### syllables
Default: 3. The number of syllables to put in the resulting word.
#### seed
Default: (random). A string or number with which to seed the generator.
Using the same seed (with the same other options) will coerce the generator
into producing the same word each time.
#### phoneticSimplicity
Default: 5. The greater this number, the simpler the phonetics. For example,
1 might produce 'str' while 5 might produce 's' for the same syllable. Minimum
is 1.
#### compoundSimplicity
Default: 5. The greater this number, the less likely the resulting word will
sound "compound", such as "ripkuth" instead of "riputh". Minimum is 1.
#### capFirst
Default: true. true to capitalize the first letter of the word; all lowercase
otherwise.