diff --git a/lib/key_generators/phonetic.js b/lib/key_generators/phonetic.js index c95be82..011900b 100644 --- a/lib/key_generators/phonetic.js +++ b/lib/key_generators/phonetic.js @@ -6,13 +6,14 @@ var PhoneticKeyGenerator = function(options) { // Generate a phonetic key PhoneticKeyGenerator.prototype.createKey = function(keyLength) { var text = ''; + var start = Math.round(Math.random()); for (var i = 0; i < keyLength; i++) { - text += (i % 2 == 0) ? this.randConsonant() : this.randVowel(); + text += (i % 2 == start) ? this.randConsonant() : this.randVowel(); } return text; }; -PhoneticKeyGenerator.consonants = 'bcdfghjklmnpqrstvwxy'; +PhoneticKeyGenerator.consonants = 'bcdfghjklmnpqrstvwxyz'; PhoneticKeyGenerator.vowels = 'aeiou'; // Get an random vowel