Commit 028aa96b authored by JonApps's avatar JonApps
Browse files

phonetic keys can begin with vowel + added missing \'z\' to consontants

parent 2deda5b6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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() * 2);
  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