3 // (c) 2013 Victor Quinn
4 // Chance may be freely distributed or modified under the MIT license.
9 var MAX_INT
= 9007199254740992;
10 var MIN_INT
= -MAX_INT
;
11 var NUMBERS
= '0123456789';
12 var CHARS_LOWER
= 'abcdefghijklmnopqrstuvwxyz';
13 var CHARS_UPPER
= CHARS_LOWER
.toUpperCase();
14 var HEX_POOL
= NUMBERS
+ "abcdef";
16 // Cached array helpers
17 var slice
= Array
.prototype.slice
;
20 function Chance (seed
) {
21 if (!(this instanceof Chance
)) {
22 return seed
=== null ? new Chance() : new Chance(seed
);
25 // if user has provided a function, use that as the generator
26 if (typeof seed
=== 'function') {
31 if (arguments
.length
) {
32 // set a starting value of zero so we can add to it
36 // otherwise, leave this.seed blank so that MT will receive a blank
38 for (var i
= 0; i
< arguments
.length
; i
++) {
40 if (Object
.prototype.toString
.call(arguments
[i
]) === '[object String]') {
41 for (var j
= 0; j
< arguments
[i
].length
; j
++) {
42 // create a numeric hash for each argument, add to seedling
44 for (var k
= 0; k
< arguments
[i
].length
; k
++) {
45 hash
= arguments
[i
].charCodeAt(k
) + (hash
<< 6) + (hash
<< 16) - hash
;
50 seedling
= arguments
[i
];
52 this.seed
+= (arguments
.length
- i
) * seedling
;
55 // If no generator function was provided, use our MT
56 this.mt
= this.mersenne_twister(this.seed
);
57 this.bimd5
= this.blueimp_md5();
58 this.random = function () {
59 return this.mt
.random(this.seed
);
65 Chance
.prototype.VERSION
= "1.0.9";
67 // Random helper functions
68 function initOptions(options
, defaults
) {
69 options
= options
|| {};
72 for (var i
in defaults
) {
73 if (typeof options
[i
] === 'undefined') {
74 options
[i
] = defaults
[i
];
82 function testRange(test
, errorMessage
) {
84 throw new RangeError(errorMessage
);
89 * Encode the input string with Base64.
91 var base64 = function() {
92 throw new Error('No Base64 encoder available.');
95 // Select proper Base64 encoder.
96 (function determineBase64Encoder() {
97 if (typeof btoa
=== 'function') {
99 } else if (typeof Buffer
=== 'function') {
100 base64 = function(input
) {
101 return new Buffer(input
).toString('base64');
109 * Return a random bool, either true or false
111 * @param {Object} [options={ likelihood: 50 }] alter the likelihood of
112 * receiving a true or false value back.
113 * @throws {RangeError} if the likelihood is out of bounds
114 * @returns {Bool} either true or false
116 Chance
.prototype.bool = function (options
) {
117 // likelihood of success (true)
118 options
= initOptions(options
, {likelihood
: 50});
120 // Note, we could get some minor perf optimizations by checking range
121 // prior to initializing defaults, but that makes code a bit messier
122 // and the check more complicated as we have to check existence of
123 // the object then existence of the key before checking constraints.
124 // Since the options initialization should be minor computationally,
125 // decision made for code cleanliness intentionally. This is mentioned
126 // here as it's the first occurrence, will not be mentioned again.
128 options
.likelihood
< 0 || options
.likelihood
> 100,
129 "Chance: Likelihood accepts values from 0 to 100."
132 return this.random() * 100 < options
.likelihood
;
136 * Return a random character.
138 * @param {Object} [options={}] can specify a character pool, only alpha,
139 * only symbols, and casing (lower or upper)
140 * @returns {String} a single random character
141 * @throws {RangeError} Can only specify alpha or symbols, not both
143 Chance
.prototype.character = function (options
) {
144 options
= initOptions(options
);
146 options
.alpha
&& options
.symbols
,
147 "Chance: Cannot specify both alpha and symbols."
150 var symbols
= "!@#$%^&*()[]",
153 if (options
.casing
=== 'lower') {
154 letters
= CHARS_LOWER
;
155 } else if (options
.casing
=== 'upper') {
156 letters
= CHARS_UPPER
;
158 letters
= CHARS_LOWER
+ CHARS_UPPER
;
163 } else if (options
.alpha
) {
165 } else if (options
.symbols
) {
168 pool
= letters
+ NUMBERS
+ symbols
;
171 return pool
.charAt(this.natural({max
: (pool
.length
- 1)}));
174 // Note, wanted to use "float" or "double" but those are both JS reserved words.
176 // Note, fixed means N OR LESS digits after the decimal. This because
177 // It could be 14.9000 but in JavaScript, when this is cast as a number,
178 // the trailing zeroes are dropped. Left to the consumer if trailing zeroes are
181 * Return a random floating point number
183 * @param {Object} [options={}] can specify a fixed precision, min, max
184 * @returns {Number} a single floating point number
185 * @throws {RangeError} Can only specify fixed or precision, not both. Also
186 * min cannot be greater than max
188 Chance
.prototype.floating = function (options
) {
189 options
= initOptions(options
, {fixed
: 4});
191 options
.fixed
&& options
.precision
,
192 "Chance: Cannot specify both fixed and precision."
196 var fixed
= Math
.pow(10, options
.fixed
);
198 var max
= MAX_INT
/ fixed
;
202 options
.min
&& options
.fixed
&& options
.min
< min
,
203 "Chance: Min specified is out of range with fixed. Min should be, at least, " + min
206 options
.max
&& options
.fixed
&& options
.max
> max
,
207 "Chance: Max specified is out of range with fixed. Max should be, at most, " + max
210 options
= initOptions(options
, { min
: min
, max
: max
});
212 // Todo - Make this work!
213 // options.precision = (typeof options.precision !== "undefined") ? options.precision : false;
215 num
= this.integer({min
: options
.min
* fixed
, max
: options
.max
* fixed
});
216 var num_fixed
= (num
/ fixed
).toFixed(options
.fixed
);
218 return parseFloat(num_fixed
);
222 * Return a random integer
224 * NOTE the max and min are INCLUDED in the range. So:
225 * chance.integer({min: 1, max: 3});
226 * would return either 1, 2, or 3.
228 * @param {Object} [options={}] can specify a min and/or max
229 * @returns {Number} a single random integer number
230 * @throws {RangeError} min cannot be greater than max
232 Chance
.prototype.integer = function (options
) {
233 // 9007199254740992 (2^53) is the max integer number in JavaScript
234 // See: http://vq.io/132sa2j
235 options
= initOptions(options
, {min
: MIN_INT
, max
: MAX_INT
});
236 testRange(options
.min
> options
.max
, "Chance: Min cannot be greater than Max.");
238 return Math
.floor(this.random() * (options
.max
- options
.min
+ 1) + options
.min
);
242 * Return a random natural
244 * NOTE the max and min are INCLUDED in the range. So:
245 * chance.natural({min: 1, max: 3});
246 * would return either 1, 2, or 3.
248 * @param {Object} [options={}] can specify a min and/or maxm or a numerals count.
249 * @returns {Number} a single random integer number
250 * @throws {RangeError} min cannot be greater than max
252 Chance
.prototype.natural = function (options
) {
253 options
= initOptions(options
, {min
: 0, max
: MAX_INT
});
254 if (typeof options
.numerals
=== 'number'){
255 testRange(options
.numerals
< 1, "Chance: Numerals cannot be less than one.");
256 options
.min
= Math
.pow(10, options
.numerals
- 1);
257 options
.max
= Math
.pow(10, options
.numerals
) - 1;
259 testRange(options
.min
< 0, "Chance: Min cannot be less than zero.");
260 return this.integer(options
);
264 * Return a random hex number as string
266 * NOTE the max and min are INCLUDED in the range. So:
267 * chance.hex({min: '9', max: 'B'});
268 * would return either '9', 'A' or 'B'.
270 * @param {Object} [options={}] can specify a min and/or max and/or casing
271 * @returns {String} a single random string hex number
272 * @throws {RangeError} min cannot be greater than max
274 Chance
.prototype.hex = function (options
) {
275 options
= initOptions(options
, {min
: 0, max
: MAX_INT
, casing
: 'lower'});
276 testRange(options
.min
< 0, "Chance: Min cannot be less than zero.");
277 var integer
= this.natural({min
: options
.min
, max
: options
.max
});
278 if (options
.casing
=== 'upper') {
279 return integer
.toString(16).toUpperCase();
281 return integer
.toString(16);
285 * Return a random string
287 * @param {Object} [options={}] can specify a length
288 * @returns {String} a string of random length
289 * @throws {RangeError} length cannot be less than zero
291 Chance
.prototype.string = function (options
) {
292 options
= initOptions(options
, { length
: this.natural({min
: 5, max
: 20}) });
293 testRange(options
.length
< 0, "Chance: Length cannot be less than zero.");
294 var length
= options
.length
,
295 text
= this.n(this.character
, length
, options
);
297 return text
.join("");
304 Chance
.prototype.capitalize = function (word
) {
305 return word
.charAt(0).toUpperCase() + word
.substr(1);
308 Chance
.prototype.mixin = function (obj
) {
309 for (var func_name
in obj
) {
310 Chance
.prototype[func_name
] = obj
[func_name
];
316 * Given a function that generates something random and a number of items to generate,
317 * return an array of items where none repeat.
319 * @param {Function} fn the function that generates something random
320 * @param {Number} num number of terms to generate
321 * @param {Object} options any options to pass on to the generator function
322 * @returns {Array} an array of length `num` with every item generated by `fn` and unique
324 * There can be more parameters after these. All additional parameters are provided to the given function
326 Chance
.prototype.unique = function(fn
, num
, options
) {
328 typeof fn
!== "function",
329 "Chance: The first argument must be a function."
332 var comparator = function(arr
, val
) { return arr
.indexOf(val
) !== -1; };
335 comparator
= options
.comparator
|| comparator
;
338 var arr
= [], count
= 0, result
, MAX_DUPLICATES
= num
* 50, params
= slice
.call(arguments
, 2);
340 while (arr
.length
< num
) {
341 var clonedParams
= JSON
.parse(JSON
.stringify(params
));
342 result
= fn
.apply(this, clonedParams
);
343 if (!comparator(arr
, result
)) {
345 // reset count when unique found
349 if (++count
> MAX_DUPLICATES
) {
350 throw new RangeError("Chance: num is likely too large for sample set");
357 * Gives an array of n random terms
359 * @param {Function} fn the function that generates something random
360 * @param {Number} n number of terms to generate
361 * @returns {Array} an array of length `n` with items generated by `fn`
363 * There can be more parameters after these. All additional parameters are provided to the given function
365 Chance
.prototype.n = function(fn
, n
) {
367 typeof fn
!== "function",
368 "Chance: The first argument must be a function."
371 if (typeof n
=== 'undefined') {
374 var i
= n
, arr
= [], params
= slice
.call(arguments
, 2);
376 // Providing a negative count should result in a noop.
377 i
= Math
.max( 0, i
);
379 for (null; i
--; null) {
380 arr
.push(fn
.apply(this, params
));
386 // H/T to SO for this one: http://vq.io/OtUrZ5
387 Chance
.prototype.pad = function (number
, width
, pad
) {
388 // Default pad to 0 if none provided
390 // Convert number to a string
391 number
= number
+ '';
392 return number
.length
>= width
? number
: new Array(width
- number
.length
+ 1).join(pad
) + number
;
395 // DEPRECATED on 2015-10-01
396 Chance
.prototype.pick = function (arr
, count
) {
397 if (arr
.length
=== 0) {
398 throw new RangeError("Chance: Cannot pick() from an empty array");
400 if (!count
|| count
=== 1) {
401 return arr
[this.natural({max
: arr
.length
- 1})];
403 return this.shuffle(arr
).slice(0, count
);
407 // Given an array, returns a single random element
408 Chance
.prototype.pickone = function (arr
) {
409 if (arr
.length
=== 0) {
410 throw new RangeError("Chance: Cannot pickone() from an empty array");
412 return arr
[this.natural({max
: arr
.length
- 1})];
415 // Given an array, returns a random set with 'count' elements
416 Chance
.prototype.pickset = function (arr
, count
) {
420 if (arr
.length
=== 0) {
421 throw new RangeError("Chance: Cannot pickset() from an empty array");
424 throw new RangeError("Chance: Count must be a positive number");
426 if (!count
|| count
=== 1) {
427 return [ this.pickone(arr
) ];
429 return this.shuffle(arr
).slice(0, count
);
433 Chance
.prototype.shuffle = function (arr
) {
434 var old_array
= arr
.slice(0),
437 length
= Number(old_array
.length
);
439 for (var i
= 0; i
< length
; i
++) {
440 // Pick a random index from the array
441 j
= this.natural({max
: old_array
.length
- 1});
442 // Add it to the new array
443 new_array
[i
] = old_array
[j
];
444 // Remove that element from the original array
445 old_array
.splice(j
, 1);
451 // Returns a single item from an array with relative weighting of odds
452 Chance
.prototype.weighted = function (arr
, weights
, trim
) {
453 if (arr
.length
!== weights
.length
) {
454 throw new RangeError("Chance: Length of array and weights must match");
457 // scan weights array and sum valid entries
460 for (var weightIndex
= 0; weightIndex
< weights
.length
; ++weightIndex
) {
461 val
= weights
[weightIndex
];
463 throw new RangeError("Chance: All weights must be numbers");
472 throw new RangeError("Chance: No valid entries in array weights");
475 // select a value within range
476 var selected
= this.random() * sum
;
478 // find array entry corresponding to selected value
480 var lastGoodIdx
= -1;
482 for (weightIndex
= 0; weightIndex
< weights
.length
; ++weightIndex
) {
483 val
= weights
[weightIndex
];
486 if (selected
<= total
) {
487 chosenIdx
= weightIndex
;
490 lastGoodIdx
= weightIndex
;
493 // handle any possible rounding error comparison to ensure something is picked
494 if (weightIndex
=== (weights
.length
- 1)) {
495 chosenIdx
= lastGoodIdx
;
499 var chosen
= arr
[chosenIdx
];
500 trim
= (typeof trim
=== 'undefined') ? false : trim
;
502 arr
.splice(chosenIdx
, 1);
503 weights
.splice(chosenIdx
, 1);
513 Chance
.prototype.paragraph = function (options
) {
514 options
= initOptions(options
);
516 var sentences
= options
.sentences
|| this.natural({min
: 3, max
: 7}),
517 sentence_array
= this.n(this.sentence
, sentences
);
519 return sentence_array
.join(' ');
522 // Could get smarter about this than generating random words and
523 // chaining them together. Such as: http://vq.io/1a5ceOh
524 Chance
.prototype.sentence = function (options
) {
525 options
= initOptions(options
);
527 var words
= options
.words
|| this.natural({min
: 12, max
: 18}),
528 punctuation
= options
.punctuation
,
529 text
, word_array
= this.n(this.word
, words
);
531 text
= word_array
.join(' ');
533 // Capitalize first letter of sentence
534 text
= this.capitalize(text
);
536 // Make sure punctuation has a usable value
537 if (punctuation
!== false && !/^[\.\?;!:]$/.test(punctuation
)) {
541 // Add punctuation mark
549 Chance
.prototype.syllable = function (options
) {
550 options
= initOptions(options
);
552 var length
= options
.length
|| this.natural({min
: 2, max
: 3}),
553 consonants
= 'bcdfghjklmnprstvwz', // consonants except hard to speak ones
554 vowels
= 'aeiou', // vowels
555 all
= consonants
+ vowels
, // all
559 // I'm sure there's a more elegant way to do this, but this works
561 for (var i
= 0; i
< length
; i
++) {
563 // First character can be anything
564 chr
= this.character({pool
: all
});
565 } else if (consonants
.indexOf(chr
) === -1) {
566 // Last character was a vowel, now we want a consonant
567 chr
= this.character({pool
: consonants
});
569 // Last character was a consonant, now we want a vowel
570 chr
= this.character({pool
: vowels
});
576 if (options
.capitalize
) {
577 text
= this.capitalize(text
);
583 Chance
.prototype.word = function (options
) {
584 options
= initOptions(options
);
587 options
.syllables
&& options
.length
,
588 "Chance: Cannot specify both syllables AND length."
591 var syllables
= options
.syllables
|| this.natural({min
: 1, max
: 3}),
594 if (options
.length
) {
595 // Either bound word by length
597 text
+= this.syllable();
598 } while (text
.length
< options
.length
);
599 text
= text
.substring(0, options
.length
);
601 // Or by number of syllables
602 for (var i
= 0; i
< syllables
; i
++) {
603 text
+= this.syllable();
607 if (options
.capitalize
) {
608 text
= this.capitalize(text
);
618 Chance
.prototype.age = function (options
) {
619 options
= initOptions(options
);
622 switch (options
.type
) {
624 ageRange
= {min
: 0, max
: 12};
627 ageRange
= {min
: 13, max
: 19};
630 ageRange
= {min
: 18, max
: 65};
633 ageRange
= {min
: 65, max
: 100};
636 ageRange
= {min
: 0, max
: 100};
639 ageRange
= {min
: 18, max
: 65};
643 return this.natural(ageRange
);
646 Chance
.prototype.birthday = function (options
) {
647 var age
= this.age(options
);
648 var currentYear
= new Date().getFullYear();
650 if (options
&& options
.type
) {
651 var min
= new Date();
652 var max
= new Date();
653 min
.setFullYear(currentYear
- age
- 1);
654 max
.setFullYear(currentYear
- age
);
656 options
= initOptions(options
, {
661 options
= initOptions(options
, {
662 year
: currentYear
- age
666 return this.date(options
);
669 // CPF; ID to identify taxpayers in Brazil
670 Chance
.prototype.cpf = function (options
) {
671 options
= initOptions(options
, {
675 var n
= this.n(this.natural
, 9, { max
: 9 });
676 var d1
= n
[8]*2+n
[7]*3+n
[6]*4+n
[5]*5+n
[4]*6+n
[3]*7+n
[2]*8+n
[1]*9+n
[0]*10;
681 var d2
= d1
*2+n
[8]*3+n
[7]*4+n
[6]*5+n
[5]*6+n
[4]*7+n
[3]*8+n
[2]*9+n
[1]*10+n
[0]*11;
686 var cpf
= ''+n
[0]+n
[1]+n
[2]+'.'+n
[3]+n
[4]+n
[5]+'.'+n
[6]+n
[7]+n
[8]+'-'+d1
+d2
;
687 return options
.formatted
? cpf
: cpf
.replace(/\D/g,'');
690 // CNPJ: ID to identify companies in Brazil
691 Chance
.prototype.cnpj = function (options
) {
692 options
= initOptions(options
, {
696 var n
= this.n(this.natural
, 12, { max
: 12 });
697 var d1
= n
[11]*2+n
[10]*3+n
[9]*4+n
[8]*5+n
[7]*6+n
[6]*7+n
[5]*8+n
[4]*9+n
[3]*2+n
[2]*3+n
[1]*4+n
[0]*5;
702 var d2
= d1
*2+n
[11]*3+n
[10]*4+n
[9]*5+n
[8]*6+n
[7]*7+n
[6]*8+n
[5]*9+n
[4]*2+n
[3]*3+n
[2]*4+n
[1]*5+n
[0]*6;
707 var cnpj
= ''+n
[0]+n
[1]+'.'+n
[2]+n
[3]+n
[4]+'.'+n
[5]+n
[6]+n
[7]+'/'+n
[8]+n
[9]+n
[10]+n
[11]+'-'+d1
+d2
;
708 return options
.formatted
? cnpj
: cnpj
.replace(/\D/g,'');
711 Chance
.prototype.first = function (options
) {
712 options
= initOptions(options
, {gender
: this.gender(), nationality
: 'en'});
713 return this.pick(this.get("firstNames")[options
.gender
.toLowerCase()][options
.nationality
.toLowerCase()]);
716 Chance
.prototype.profession = function (options
) {
717 options
= initOptions(options
);
719 return this.pick(['Apprentice ', 'Junior ', 'Senior ', 'Lead ']) + this.pick(this.get("profession"));
721 return this.pick(this.get("profession"));
725 Chance
.prototype.company = function (){
726 return this.pick(this.get("company"));
729 Chance
.prototype.gender = function (options
) {
730 options
= initOptions(options
, {extraGenders
: []});
731 return this.pick(['Male', 'Female'].concat(options
.extraGenders
));
734 Chance
.prototype.last = function (options
) {
735 options
= initOptions(options
, {nationality
: 'en'});
736 return this.pick(this.get("lastNames")[options
.nationality
.toLowerCase()]);
739 Chance
.prototype.israelId=function(){
740 var x
=this.string({pool
: '0123456789',length
:8});
742 for (var i
=0;i
<x
.length
;i
++){
743 var thisDigit
= x
[i
] * (i
/2===parseInt(i/2) ? 1 : 2);
744 thisDigit
=this.pad(thisDigit
,2).toString();
745 thisDigit
=parseInt(thisDigit
[0]) + parseInt(thisDigit
[1]);
748 x
=x
+(10-parseInt(y
.toString().slice(-1))).toString().slice(-1);
752 Chance
.prototype.mrz = function (options
) {
753 var checkDigit = function (input
) {
754 var alpha
= "<ABCDEFGHIJKLMNOPQRSTUVWXYXZ".split(''),
755 multipliers
= [ 7, 3, 1 ],
758 if (typeof input
!== 'string') {
759 input
= input
.toString();
762 input
.split('').forEach(function(character
, idx
) {
763 var pos
= alpha
.indexOf(character
);
766 character
= pos
=== 0 ? 0 : pos
+ 9;
768 character
= parseInt(character
, 10);
770 character
*= multipliers
[idx
% multipliers
.length
];
771 runningTotal
+= character
;
773 return runningTotal
% 10;
775 var generate = function (opts
) {
776 var pad = function (length
) {
777 return new Array(length
+ 1).join('<');
781 opts
.last
.toUpperCase(),
783 opts
.first
.toUpperCase(),
784 pad(39 - (opts
.last
.length
+ opts
.first
.length
+ 2)),
786 checkDigit(opts
.passportNumber
),
789 checkDigit(opts
.dob
),
792 checkDigit(opts
.expiry
),
794 checkDigit(pad(14)) ].join('');
797 (checkDigit(number
.substr(44, 10) +
798 number
.substr(57, 7) +
799 number
.substr(65, 7)));
804 options
= initOptions(options
, {
807 passportNumber
: this.integer({min
: 100000000, max
: 999999999}),
809 var date
= that
.birthday({type
: 'adult'});
810 return [date
.getFullYear().toString().substr(2),
811 that
.pad(date
.getMonth() + 1, 2),
812 that
.pad(date
.getDate(), 2)].join('');
814 expiry
: (function () {
815 var date
= new Date();
816 return [(date
.getFullYear() + 5).toString().substr(2),
817 that
.pad(date
.getMonth() + 1, 2),
818 that
.pad(date
.getDate(), 2)].join('');
820 gender
: this.gender() === 'Female' ? 'F': 'M',
824 return generate (options
);
827 Chance
.prototype.name = function (options
) {
828 options
= initOptions(options
);
830 var first
= this.first(options
),
831 last
= this.last(options
),
834 if (options
.middle
) {
835 name
= first
+ ' ' + this.first(options
) + ' ' + last
;
836 } else if (options
.middle_initial
) {
837 name
= first
+ ' ' + this.character({alpha
: true, casing
: 'upper'}) + '. ' + last
;
839 name
= first
+ ' ' + last
;
842 if (options
.prefix
) {
843 name
= this.prefix(options
) + ' ' + name
;
846 if (options
.suffix
) {
847 name
= name
+ ' ' + this.suffix(options
);
853 // Return the list of available name prefixes based on supplied gender.
854 // @todo introduce internationalization
855 Chance
.prototype.name_prefixes = function (gender
) {
856 gender
= gender
|| "all";
857 gender
= gender
.toLowerCase();
860 { name
: 'Doctor', abbreviation
: 'Dr.' }
863 if (gender
=== "male" || gender
=== "all") {
864 prefixes
.push({ name
: 'Mister', abbreviation
: 'Mr.' });
867 if (gender
=== "female" || gender
=== "all") {
868 prefixes
.push({ name
: 'Miss', abbreviation
: 'Miss' });
869 prefixes
.push({ name
: 'Misses', abbreviation
: 'Mrs.' });
875 // Alias for name_prefix
876 Chance
.prototype.prefix = function (options
) {
877 return this.name_prefix(options
);
880 Chance
.prototype.name_prefix = function (options
) {
881 options
= initOptions(options
, { gender
: "all" });
882 return options
.full
?
883 this.pick(this.name_prefixes(options
.gender
)).name
:
884 this.pick(this.name_prefixes(options
.gender
)).abbreviation
;
886 //Hungarian ID number
887 Chance
.prototype.HIDN= function(){
888 //Hungarian ID nuber structure: XXXXXXYY (X=number,Y=Capital Latin letter)
889 var idn_pool
="0123456789";
890 var idn_chrs
="ABCDEFGHIJKLMNOPQRSTUVWXYXZ";
892 idn
+=this.string({pool
:idn_pool
,length
:6});
893 idn
+=this.string({pool
:idn_chrs
,length
:2});
898 Chance
.prototype.ssn = function (options
) {
899 options
= initOptions(options
, {ssnFour
: false, dashes
: true});
900 var ssn_pool
= "1234567890",
902 dash
= options
.dashes
? '-' : '';
904 if(!options
.ssnFour
) {
905 ssn
= this.string({pool
: ssn_pool
, length
: 3}) + dash
+
906 this.string({pool
: ssn_pool
, length
: 2}) + dash
+
907 this.string({pool
: ssn_pool
, length
: 4});
909 ssn
= this.string({pool
: ssn_pool
, length
: 4});
914 // Return the list of available name suffixes
915 // @todo introduce internationalization
916 Chance
.prototype.name_suffixes = function () {
918 { name
: 'Doctor of Osteopathic Medicine', abbreviation
: 'D.O.' },
919 { name
: 'Doctor of Philosophy', abbreviation
: 'Ph.D.' },
920 { name
: 'Esquire', abbreviation
: 'Esq.' },
921 { name
: 'Junior', abbreviation
: 'Jr.' },
922 { name
: 'Juris Doctor', abbreviation
: 'J.D.' },
923 { name
: 'Master of Arts', abbreviation
: 'M.A.' },
924 { name
: 'Master of Business Administration', abbreviation
: 'M.B.A.' },
925 { name
: 'Master of Science', abbreviation
: 'M.S.' },
926 { name
: 'Medical Doctor', abbreviation
: 'M.D.' },
927 { name
: 'Senior', abbreviation
: 'Sr.' },
928 { name
: 'The Third', abbreviation
: 'III' },
929 { name
: 'The Fourth', abbreviation
: 'IV' },
930 { name
: 'Bachelor of Engineering', abbreviation
: 'B.E' },
931 { name
: 'Bachelor of Technology', abbreviation
: 'B.TECH' }
936 // Alias for name_suffix
937 Chance
.prototype.suffix = function (options
) {
938 return this.name_suffix(options
);
941 Chance
.prototype.name_suffix = function (options
) {
942 options
= initOptions(options
);
943 return options
.full
?
944 this.pick(this.name_suffixes()).name
:
945 this.pick(this.name_suffixes()).abbreviation
;
948 Chance
.prototype.nationalities = function () {
949 return this.get("nationalities");
952 // Generate random nationality based on json list
953 Chance
.prototype.nationality = function () {
954 var nationality
= this.pick(this.nationalities());
955 return nationality
.name
;
961 // Android GCM Registration ID
962 Chance
.prototype.android_id = function () {
963 return "APA91" + this.string({ pool
: "0123456789abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_", length
: 178 });
967 Chance
.prototype.apple_token = function () {
968 return this.string({ pool
: "abcdef1234567890", length
: 64 });
971 // Windows Phone 8 ANID2
972 Chance
.prototype.wp8_anid2 = function () {
973 return base64( this.hash( { length
: 32 } ) );
976 // Windows Phone 7 ANID
977 Chance
.prototype.wp7_anid = function () {
978 return 'A=' + this.guid().replace(/-/g
, '').toUpperCase() + '&E=' + this.hash({ length
:3 }) + '&W=' + this.integer({ min
:0, max
:9 });
981 // BlackBerry Device PIN
982 Chance
.prototype.bb_pin = function () {
983 return this.hash({ length
: 8 });
989 Chance
.prototype.avatar = function (options
) {
991 var URL_BASE
= '//www.gravatar.com/avatar/';
1003 '404': '404', // Return 404 if not found
1004 mm
: 'mm', // Mystery man
1005 identicon
: 'identicon', // Geometric pattern based on hash
1006 monsterid
: 'monsterid', // A generated monster icon
1007 wavatar
: 'wavatar', // A generated face
1008 retro
: 'retro', // 8-bit icon
1009 blank
: 'blank' // A transparent png
1020 fileExtension
: null,
1027 // Set to a random email
1028 opts
.email
= this.email();
1031 else if (typeof options
=== 'string') {
1032 opts
.email
= options
;
1035 else if (typeof options
!== 'object') {
1038 else if (options
.constructor === 'Array') {
1042 opts
= initOptions(options
, opts
);
1045 // Set to a random email
1046 opts
.email
= this.email();
1049 // Safe checking for params
1050 opts
.protocol
= PROTOCOLS
[opts
.protocol
] ? opts
.protocol
+ ':' : '';
1051 opts
.size
= parseInt(opts
.size
, 0) ? opts
.size
: '';
1052 opts
.rating
= RATINGS
[opts
.rating
] ? opts
.rating
: '';
1053 opts
.fallback
= FALLBACKS
[opts
.fallback
] ? opts
.fallback
: '';
1054 opts
.fileExtension
= FILE_TYPES
[opts
.fileExtension
] ? opts
.fileExtension
: '';
1059 this.bimd5
.md5(opts
.email
) +
1060 (opts
.fileExtension
? '.' + opts
.fileExtension
: '') +
1061 (opts
.size
|| opts
.rating
|| opts
.fallback
? '?' : '') +
1062 (opts
.size
? '&s=' + opts
.size
.toString() : '') +
1063 (opts
.rating
? '&r=' + opts
.rating
: '') +
1064 (opts
.fallback
? '&d=' + opts
.fallback
: '')
1072 * ===============================================
1073 * Generate random color value base on color type:
1081 * ===============================================
1082 * * Geerate random hex color
1083 * chance.color() => '#79c157' / 'rgb(110,52,164)' / '0x67ae0b' / '#e2e2e2' / '#29CFA7'
1085 * * Generate Hex based color value
1086 * chance.color({format: 'hex'}) => '#d67118'
1088 * * Generate simple rgb value
1089 * chance.color({format: 'rgb'}) => 'rgb(110,52,164)'
1091 * * Generate Ox based color value
1092 * chance.color({format: '0x'}) => '0x67ae0b'
1094 * * Generate graiscale based value
1095 * chance.color({grayscale: true}) => '#e2e2e2'
1097 * * Return valide color name
1098 * chance.color({format: 'name'}) => 'red'
1100 * * Make color uppercase
1101 * chance.color({casing: 'upper'}) => '#29CFA7'
1103 * * Min Max values for RGBA
1104 * var light_red = chance.color({format: 'hex', min_red: 200, max_red: 255, max_green: 0, max_blue: 0, min_alpha: .2, max_alpha: .3});
1106 * @param [object] options
1107 * @return [string] color value
1109 Chance
.prototype.color = function (options
) {
1110 function gray(value
, delimiter
) {
1111 return [value
, value
, value
].join(delimiter
|| '');
1114 function rgb(hasAlpha
) {
1115 var rgbValue
= (hasAlpha
) ? 'rgba' : 'rgb';
1116 var alphaChannel
= (hasAlpha
) ? (',' + this.floating({min
:min_alpha
, max
:max_alpha
})) : "";
1117 var colorValue
= (isGrayscale
) ? (gray(this.natural({min
: min_rgb
, max
: max_rgb
}), ',')) : (this.natural({min
: min_green
, max
: max_green
}) + ',' + this.natural({min
: min_blue
, max
: max_blue
}) + ',' + this.natural({max
: 255}));
1118 return rgbValue
+ '(' + colorValue
+ alphaChannel
+ ')';
1121 function hex(start
, end
, withHash
) {
1122 var symbol
= (withHash
) ? "#" : "";
1126 hexstring
= gray(this.pad(this.hex({min
: min_rgb
, max
: max_rgb
}), 2));
1127 if (options
.format
=== "shorthex") {
1128 hexstring
= gray(this.hex({min
: 0, max
: 15}));
1132 if (options
.format
=== "shorthex") {
1133 hexstring
= this.pad(this.hex({min
: Math
.floor(min_red
/ 16), max
: Math
.floor(max_red
/ 16)}), 1) + this.pad(this.hex({min
: Math
.floor(min_green
/ 16), max
: Math
.floor(max_green
/ 16)}), 1) + this.pad(this.hex({min
: Math
.floor(min_blue
/ 16), max
: Math
.floor(max_blue
/ 16)}), 1);
1135 else if (min_red
!== undefined || max_red
!== undefined || min_green
!== undefined || max_green
!== undefined || min_blue
!== undefined || max_blue
!== undefined) {
1136 hexstring
= this.pad(this.hex({min
: min_red
, max
: max_red
}), 2) + this.pad(this.hex({min
: min_green
, max
: max_green
}), 2) + this.pad(this.hex({min
: min_blue
, max
: max_blue
}), 2);
1139 hexstring
= this.pad(this.hex({min
: min_rgb
, max
: max_rgb
}), 2) + this.pad(this.hex({min
: min_rgb
, max
: max_rgb
}), 2) + this.pad(this.hex({min
: min_rgb
, max
: max_rgb
}), 2);
1143 return symbol
+ hexstring
;
1146 options
= initOptions(options
, {
1147 format
: this.pick(['hex', 'shorthex', 'rgb', 'rgba', '0x', 'name']),
1154 min_green
: undefined,
1155 max_green
: undefined,
1156 min_blue
: undefined,
1157 max_blue
: undefined,
1162 var isGrayscale
= options
.grayscale
;
1163 var min_rgb
= options
.min
;
1164 var max_rgb
= options
.max
;
1165 var min_red
= options
.min_red
;
1166 var max_red
= options
.max_red
;
1167 var min_green
= options
.min_green
;
1168 var max_green
= options
.max_green
;
1169 var min_blue
= options
.min_blue
;
1170 var max_blue
= options
.max_blue
;
1171 var min_alpha
= options
.min_alpha
;
1172 var max_alpha
= options
.max_alpha
;
1173 if (options
.min_red
=== undefined) { min_red
= min_rgb
; }
1174 if (options
.max_red
=== undefined) { max_red
= max_rgb
; }
1175 if (options
.min_green
=== undefined) { min_green
= min_rgb
; }
1176 if (options
.max_green
=== undefined) { max_green
= max_rgb
; }
1177 if (options
.min_blue
=== undefined) { min_blue
= min_rgb
; }
1178 if (options
.max_blue
=== undefined) { max_blue
= max_rgb
; }
1179 if (options
.min_alpha
=== undefined) { min_alpha
= 0; }
1180 if (options
.max_alpha
=== undefined) { max_alpha
= 1; }
1181 if (isGrayscale
&& min_rgb
=== 0 && max_rgb
=== 255 && min_red
!== undefined && max_red
!== undefined) {
1182 min_rgb
= ((min_red
+ min_green
+ min_blue
) / 3);
1183 max_rgb
= ((max_red
+ max_green
+ max_blue
) / 3);
1187 if (options
.format
=== 'hex') {
1188 colorValue
= hex
.call(this, 2, 6, true);
1190 else if (options
.format
=== 'shorthex') {
1191 colorValue
= hex
.call(this, 1, 3, true);
1193 else if (options
.format
=== 'rgb') {
1194 colorValue
= rgb
.call(this, false);
1196 else if (options
.format
=== 'rgba') {
1197 colorValue
= rgb
.call(this, true);
1199 else if (options
.format
=== '0x') {
1200 colorValue
= '0x' + hex
.call(this, 2, 6);
1202 else if(options
.format
=== 'name') {
1203 return this.pick(this.get("colorNames"));
1206 throw new RangeError('Invalid format provided. Please provide one of "hex", "shorthex", "rgb", "rgba", "0x" or "name".');
1209 if (options
.casing
=== 'upper' ) {
1210 colorValue
= colorValue
.toUpperCase();
1216 Chance
.prototype.domain = function (options
) {
1217 options
= initOptions(options
);
1218 return this.word() + '.' + (options
.tld
|| this.tld());
1221 Chance
.prototype.email = function (options
) {
1222 options
= initOptions(options
);
1223 return this.word({length
: options
.length
}) + '@' + (options
.domain
|| this.domain());
1226 Chance
.prototype.fbid = function () {
1227 return parseInt('10000' + this.natural({max
: 100000000000}), 10);
1230 Chance
.prototype.google_analytics = function () {
1231 var account
= this.pad(this.natural({max
: 999999}), 6);
1232 var property
= this.pad(this.natural({max
: 99}), 2);
1234 return 'UA-' + account
+ '-' + property
;
1237 Chance
.prototype.hashtag = function () {
1238 return '#' + this.word();
1241 Chance
.prototype.ip = function () {
1242 // Todo: This could return some reserved IPs. See http://vq.io/137dgYy
1243 // this should probably be updated to account for that rare as it may be
1244 return this.natural({min
: 1, max
: 254}) + '.' +
1245 this.natural({max
: 255}) + '.' +
1246 this.natural({max
: 255}) + '.' +
1247 this.natural({min
: 1, max
: 254});
1250 Chance
.prototype.ipv6 = function () {
1251 var ip_addr
= this.n(this.hash
, 8, {length
: 4});
1253 return ip_addr
.join(":");
1256 Chance
.prototype.klout = function () {
1257 return this.natural({min
: 1, max
: 99});
1260 Chance
.prototype.semver = function (options
) {
1261 options
= initOptions(options
, { include_prerelease
: true });
1263 var range
= this.pickone(["^", "~", "<", ">", "<=", ">=", "="]);
1264 if (options
.range
) {
1265 range
= options
.range
;
1268 var prerelease
= "";
1269 if (options
.include_prerelease
) {
1270 prerelease
= this.weighted(["", "-dev", "-beta", "-alpha"], [50, 10, 5, 1]);
1272 return range
+ this.rpg('3d10').join('.') + prerelease
;
1275 Chance
.prototype.tlds = function () {
1276 return ['com', 'org', 'edu', 'gov', 'co.uk', 'net', 'io', 'ac', 'ad', 'ae', 'af', 'ag', 'ai', 'al', 'am', 'an', 'ao', 'aq', 'ar', 'as', 'at', 'au', 'aw', 'ax', 'az', 'ba', 'bb', 'bd', 'be', 'bf', 'bg', 'bh', 'bi', 'bj', 'bm', 'bn', 'bo', 'bq', 'br', 'bs', 'bt', 'bv', 'bw', 'by', 'bz', 'ca', 'cc', 'cd', 'cf', 'cg', 'ch', 'ci', 'ck', 'cl', 'cm', 'cn', 'co', 'cr', 'cu', 'cv', 'cw', 'cx', 'cy', 'cz', 'de', 'dj', 'dk', 'dm', 'do', 'dz', 'ec', 'ee', 'eg', 'eh', 'er', 'es', 'et', 'eu', 'fi', 'fj', 'fk', 'fm', 'fo', 'fr', 'ga', 'gb', 'gd', 'ge', 'gf', 'gg', 'gh', 'gi', 'gl', 'gm', 'gn', 'gp', 'gq', 'gr', 'gs', 'gt', 'gu', 'gw', 'gy', 'hk', 'hm', 'hn', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'im', 'in', 'io', 'iq', 'ir', 'is', 'it', 'je', 'jm', 'jo', 'jp', 'ke', 'kg', 'kh', 'ki', 'km', 'kn', 'kp', 'kr', 'kw', 'ky', 'kz', 'la', 'lb', 'lc', 'li', 'lk', 'lr', 'ls', 'lt', 'lu', 'lv', 'ly', 'ma', 'mc', 'md', 'me', 'mg', 'mh', 'mk', 'ml', 'mm', 'mn', 'mo', 'mp', 'mq', 'mr', 'ms', 'mt', 'mu', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'nc', 'ne', 'nf', 'ng', 'ni', 'nl', 'no', 'np', 'nr', 'nu', 'nz', 'om', 'pa', 'pe', 'pf', 'pg', 'ph', 'pk', 'pl', 'pm', 'pn', 'pr', 'ps', 'pt', 'pw', 'py', 'qa', 're', 'ro', 'rs', 'ru', 'rw', 'sa', 'sb', 'sc', 'sd', 'se', 'sg', 'sh', 'si', 'sj', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'ss', 'st', 'su', 'sv', 'sx', 'sy', 'sz', 'tc', 'td', 'tf', 'tg', 'th', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'tp', 'tr', 'tt', 'tv', 'tw', 'tz', 'ua', 'ug', 'uk', 'us', 'uy', 'uz', 'va', 'vc', 've', 'vg', 'vi', 'vn', 'vu', 'wf', 'ws', 'ye', 'yt', 'za', 'zm', 'zw'];
1279 Chance
.prototype.tld = function () {
1280 return this.pick(this.tlds());
1283 Chance
.prototype.twitter = function () {
1284 return '@' + this.word();
1287 Chance
.prototype.url = function (options
) {
1288 options
= initOptions(options
, { protocol
: "http", domain
: this.domain(options
), domain_prefix
: "", path
: this.word(), extensions
: []});
1290 var extension
= options
.extensions
.length
> 0 ? "." + this.pick(options
.extensions
) : "";
1291 var domain
= options
.domain_prefix
? options
.domain_prefix
+ "." + options
.domain
: options
.domain
;
1293 return options
.protocol
+ "://" + domain
+ "/" + options
.path
+ extension
;
1296 Chance
.prototype.port = function() {
1297 return this.integer({min
: 0, max
: 65535});
1300 Chance
.prototype.locale = function (options
) {
1301 options
= initOptions(options
);
1302 if (options
.region
){
1303 return this.pick(this.get("locale_regions"));
1305 return this.pick(this.get("locale_languages"));
1309 Chance
.prototype.locales = function (options
) {
1310 options
= initOptions(options
);
1311 if (options
.region
){
1312 return this.get("locale_regions");
1314 return this.get("locale_languages");
1322 Chance
.prototype.address = function (options
) {
1323 options
= initOptions(options
);
1324 return this.natural({min
: 5, max
: 2000}) + ' ' + this.street(options
);
1327 Chance
.prototype.altitude = function (options
) {
1328 options
= initOptions(options
, {fixed
: 5, min
: 0, max
: 8848});
1329 return this.floating({
1332 fixed
: options
.fixed
1336 Chance
.prototype.areacode = function (options
) {
1337 options
= initOptions(options
, {parens
: true});
1338 // Don't want area codes to start with 1, or have a 9 as the second digit
1339 var areacode
= this.natural({min
: 2, max
: 9}).toString() +
1340 this.natural({min
: 0, max
: 8}).toString() +
1341 this.natural({min
: 0, max
: 9}).toString();
1343 return options
.parens
? '(' + areacode
+ ')' : areacode
;
1346 Chance
.prototype.city = function () {
1347 return this.capitalize(this.word({syllables
: 3}));
1350 Chance
.prototype.coordinates = function (options
) {
1351 return this.latitude(options
) + ', ' + this.longitude(options
);
1354 Chance
.prototype.countries = function () {
1355 return this.get("countries");
1358 Chance
.prototype.country = function (options
) {
1359 options
= initOptions(options
);
1360 var country
= this.pick(this.countries());
1361 return options
.full
? country
.name
: country
.abbreviation
;
1364 Chance
.prototype.depth = function (options
) {
1365 options
= initOptions(options
, {fixed
: 5, min
: -10994, max
: 0});
1366 return this.floating({
1369 fixed
: options
.fixed
1373 Chance
.prototype.geohash = function (options
) {
1374 options
= initOptions(options
, { length
: 7 });
1375 return this.string({ length
: options
.length
, pool
: '0123456789bcdefghjkmnpqrstuvwxyz' });
1378 Chance
.prototype.geojson = function (options
) {
1379 return this.latitude(options
) + ', ' + this.longitude(options
) + ', ' + this.altitude(options
);
1382 Chance
.prototype.latitude = function (options
) {
1383 options
= initOptions(options
, {fixed
: 5, min
: -90, max
: 90});
1384 return this.floating({min
: options
.min
, max
: options
.max
, fixed
: options
.fixed
});
1387 Chance
.prototype.longitude = function (options
) {
1388 options
= initOptions(options
, {fixed
: 5, min
: -180, max
: 180});
1389 return this.floating({min
: options
.min
, max
: options
.max
, fixed
: options
.fixed
});
1392 Chance
.prototype.phone = function (options
) {
1395 ukNum = function (parts
) {
1397 //fills the section part of the phone number with random numbers.
1398 parts
.sections
.forEach(function(n
) {
1399 section
.push(self
.string({ pool
: '0123456789', length
: n
}));
1401 return parts
.area
+ section
.join(' ');
1403 options
= initOptions(options
, {
1408 if (!options
.formatted
) {
1409 options
.parens
= false;
1412 switch (options
.country
) {
1414 if (!options
.mobile
) {
1415 numPick
= this.pick([
1416 // Valid zone and département codes.
1417 '01' + this.pick(['30', '34', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '53', '55', '56', '58', '60', '64', '69', '70', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83']) + self
.string({ pool
: '0123456789', length
: 6}),
1418 '02' + this.pick(['14', '18', '22', '23', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '40', '41', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '56', '57', '61', '62', '69', '72', '76', '77', '78', '85', '90', '96', '97', '98', '99']) + self
.string({ pool
: '0123456789', length
: 6}),
1419 '03' + this.pick(['10', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '39', '44', '45', '51', '52', '54', '55', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90']) + self
.string({ pool
: '0123456789', length
: 6}),
1420 '04' + this.pick(['11', '13', '15', '20', '22', '26', '27', '30', '32', '34', '37', '42', '43', '44', '50', '56', '57', '63', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '88', '89', '90', '91', '92', '93', '94', '95', '97', '98']) + self
.string({ pool
: '0123456789', length
: 6}),
1421 '05' + this.pick(['08', '16', '17', '19', '24', '31', '32', '33', '34', '35', '40', '45', '46', '47', '49', '53', '55', '56', '57', '58', '59', '61', '62', '63', '64', '65', '67', '79', '81', '82', '86', '87', '90', '94']) + self
.string({ pool
: '0123456789', length
: 6}),
1422 '09' + self
.string({ pool
: '0123456789', length
: 8}),
1424 phone
= options
.formatted
? numPick
.match(/../g).join(' ') : numPick
;
1426 numPick
= this.pick(['06', '07']) + self
.string({ pool
: '0123456789', length
: 8});
1427 phone
= options
.formatted
? numPick
.match(/../g).join(' ') : numPick
;
1431 if (!options
.mobile
) {
1432 numPick
= this.pick([
1433 //valid area codes of major cities/counties followed by random numbers in required format.
1435 { area
: '01' + this.character({ pool
: '234569' }) + '1 ', sections
: [3,4] },
1436 { area
: '020 ' + this.character({ pool
: '378' }), sections
: [3,4] },
1437 { area
: '023 ' + this.character({ pool
: '89' }), sections
: [3,4] },
1438 { area
: '024 7', sections
: [3,4] },
1439 { area
: '028 ' + this.pick(['25','28','37','71','82','90','92','95']), sections
: [2,4] },
1440 { area
: '012' + this.pick(['04','08','54','76','97','98']) + ' ', sections
: [6] },
1441 { area
: '013' + this.pick(['63','64','84','86']) + ' ', sections
: [6] },
1442 { area
: '014' + this.pick(['04','20','60','61','80','88']) + ' ', sections
: [6] },
1443 { area
: '015' + this.pick(['24','27','62','66']) + ' ', sections
: [6] },
1444 { area
: '016' + this.pick(['06','29','35','47','59','95']) + ' ', sections
: [6] },
1445 { area
: '017' + this.pick(['26','44','50','68']) + ' ', sections
: [6] },
1446 { area
: '018' + this.pick(['27','37','84','97']) + ' ', sections
: [6] },
1447 { area
: '019' + this.pick(['00','05','35','46','49','63','95']) + ' ', sections
: [6] }
1449 phone
= options
.formatted
? ukNum(numPick
) : ukNum(numPick
).replace(' ', '', 'g');
1451 numPick
= this.pick([
1452 { area
: '07' + this.pick(['4','5','7','8','9']), sections
: [2,6] },
1453 { area
: '07624 ', sections
: [6] }
1455 phone
= options
.formatted
? ukNum(numPick
) : ukNum(numPick
).replace(' ', '');
1459 if (!options
.mobile
) {
1460 numPick
= this.pick([
1461 '01' + this.pick(['0', '1', '2', '3', '4', '5', '6', '7', '8']) + self
.string({ pool
: '0123456789', length
: 7}),
1462 '02' + this.pick(['1', '2', '3', '4', '7', '8']) + self
.string({ pool
: '0123456789', length
: 7}),
1463 '03' + this.pick(['1', '2', '3', '5', '6', '9']) + self
.string({ pool
: '0123456789', length
: 7}),
1464 '04' + this.pick(['1', '2', '3', '4', '5','6','7', '8','9']) + self
.string({ pool
: '0123456789', length
: 7}),
1465 '05' + this.pick(['1', '3', '4', '6', '7', '8']) + self
.string({ pool
: '0123456789', length
: 7}),
1467 phone
= options
.formatted
|| numPick
;
1469 numPick
= this.pick([
1470 '060' + this.pick(['3','4','5','6','7','8','9']) + self
.string({ pool
: '0123456789', length
: 6}),
1471 '061' + this.pick(['0','1','2','3','4','5','8']) + self
.string({ pool
: '0123456789', length
: 6}),
1472 '06' + self
.string({ pool
: '0123456789', length
: 7}),
1473 '071' + this.pick(['0','1','2','3','4','5','6','7','8','9']) + self
.string({ pool
: '0123456789', length
: 6}),
1474 '07' + this.pick(['2','3','4','6','7','8','9']) + self
.string({ pool
: '0123456789', length
: 7}),
1475 '08' + this.pick(['0','1','2','3','4','5']) + self
.string({ pool
: '0123456789', length
: 7}),
1477 phone
= options
.formatted
|| numPick
;
1483 var areacode
= this.areacode(options
).toString();
1484 var exchange
= this.natural({ min
: 2, max
: 9 }).toString() +
1485 this.natural({ min
: 0, max
: 9 }).toString() +
1486 this.natural({ min
: 0, max
: 9 }).toString();
1487 var subscriber
= this.natural({ min
: 1000, max
: 9999 }).toString(); // this could be random [0-9]{4}
1488 phone
= options
.formatted
? areacode
+ ' ' + exchange
+ '-' + subscriber
: areacode
+ exchange
+ subscriber
;
1493 Chance
.prototype.postal = function () {
1495 var pd
= this.character({pool
: "XVTSRPNKLMHJGECBA"});
1496 // Forward Sortation Area (FSA)
1497 var fsa
= pd
+ this.natural({max
: 9}) + this.character({alpha
: true, casing
: "upper"});
1498 // Local Delivery Unut (LDU)
1499 var ldu
= this.natural({max
: 9}) + this.character({alpha
: true, casing
: "upper"}) + this.natural({max
: 9});
1501 return fsa
+ " " + ldu
;
1504 Chance
.prototype.counties = function (options
) {
1505 options
= initOptions(options
, { country
: 'uk' });
1506 return this.get("counties")[options
.country
.toLowerCase()];
1509 Chance
.prototype.county = function (options
) {
1510 return this.pick(this.counties(options
)).name
;
1513 Chance
.prototype.provinces = function (options
) {
1514 options
= initOptions(options
, { country
: 'ca' });
1515 return this.get("provinces")[options
.country
.toLowerCase()];
1518 Chance
.prototype.province = function (options
) {
1519 return (options
&& options
.full
) ?
1520 this.pick(this.provinces(options
)).name
:
1521 this.pick(this.provinces(options
)).abbreviation
;
1524 Chance
.prototype.state = function (options
) {
1525 return (options
&& options
.full
) ?
1526 this.pick(this.states(options
)).name
:
1527 this.pick(this.states(options
)).abbreviation
;
1530 Chance
.prototype.states = function (options
) {
1531 options
= initOptions(options
, { country
: 'us', us_states_and_dc
: true } );
1535 switch (options
.country
.toLowerCase()) {
1537 var us_states_and_dc
= this.get("us_states_and_dc"),
1538 territories
= this.get("territories"),
1539 armed_forces
= this.get("armed_forces");
1543 if (options
.us_states_and_dc
) {
1544 states
= states
.concat(us_states_and_dc
);
1546 if (options
.territories
) {
1547 states
= states
.concat(territories
);
1549 if (options
.armed_forces
) {
1550 states
= states
.concat(armed_forces
);
1554 states
= this.get("country_regions")[options
.country
.toLowerCase()];
1557 states
= this.get("counties")[options
.country
.toLowerCase()];
1564 Chance
.prototype.street = function (options
) {
1565 options
= initOptions(options
, { country
: 'us', syllables
: 2 });
1568 switch (options
.country
.toLowerCase()) {
1570 street
= this.word({ syllables
: options
.syllables
});
1571 street
= this.capitalize(street
);
1573 street
+= options
.short_suffix
?
1574 this.street_suffix(options
).abbreviation
:
1575 this.street_suffix(options
).name
;
1578 street
= this.word({ syllables
: options
.syllables
});
1579 street
= this.capitalize(street
);
1580 street
= (options
.short_suffix
?
1581 this.street_suffix(options
).abbreviation
:
1582 this.street_suffix(options
).name
) + " " + street
;
1588 Chance
.prototype.street_suffix = function (options
) {
1589 options
= initOptions(options
, { country
: 'us' });
1590 return this.pick(this.street_suffixes(options
));
1593 Chance
.prototype.street_suffixes = function (options
) {
1594 options
= initOptions(options
, { country
: 'us' });
1595 // These are the most common suffixes.
1596 return this.get("street_suffixes")[options
.country
.toLowerCase()];
1599 // Note: only returning US zip codes, internationalization will be a whole
1600 // other beast to tackle at some point.
1601 Chance
.prototype.zip = function (options
) {
1602 var zip
= this.n(this.natural
, 5, {max
: 9});
1604 if (options
&& options
.plusfour
=== true) {
1606 zip
= zip
.concat(this.n(this.natural
, 4, {max
: 9}));
1609 return zip
.join("");
1612 // -- End Location --
1616 Chance
.prototype.ampm = function () {
1617 return this.bool() ? 'am' : 'pm';
1620 Chance
.prototype.date = function (options
) {
1621 var date_string
, date
;
1623 // If interval is specified we ignore preset
1624 if(options
&& (options
.min
|| options
.max
)) {
1625 options
= initOptions(options
, {
1629 var min
= typeof options
.min
!== "undefined" ? options
.min
.getTime() : 1;
1630 // 100,000,000 days measured relative to midnight at the beginning of 01 January, 1970 UTC. http://es5.github.io/#x15.9.1.1
1631 var max
= typeof options
.max
!== "undefined" ? options
.max
.getTime() : 8640000000000000;
1633 date
= new Date(this.integer({min
: min
, max
: max
}));
1635 var m
= this.month({raw
: true});
1636 var daysInMonth
= m
.days
;
1638 if(options
&& options
.month
) {
1639 // Mod 12 to allow months outside range of 0-11 (not encouraged, but also not prevented).
1640 daysInMonth
= this.get('months')[((options
.month
% 12) + 12) % 12].days
;
1643 options
= initOptions(options
, {
1644 year
: parseInt(this.year(), 10),
1645 // Necessary to subtract 1 because Date() 0-indexes month but not day or year
1647 month
: m
.numeric
- 1,
1648 day
: this.natural({min
: 1, max
: daysInMonth
}),
1649 hour
: this.hour({twentyfour
: true}),
1650 minute
: this.minute(),
1651 second
: this.second(),
1652 millisecond
: this.millisecond(),
1657 date
= new Date(options
.year
, options
.month
, options
.day
, options
.hour
, options
.minute
, options
.second
, options
.millisecond
);
1660 if (options
.american
) {
1661 // Adding 1 to the month is necessary because Date() 0-indexes
1662 // months but not day for some odd reason.
1663 date_string
= (date
.getMonth() + 1) + '/' + date
.getDate() + '/' + date
.getFullYear();
1665 date_string
= date
.getDate() + '/' + (date
.getMonth() + 1) + '/' + date
.getFullYear();
1668 return options
.string
? date_string
: date
;
1671 Chance
.prototype.hammertime = function (options
) {
1672 return this.date(options
).getTime();
1675 Chance
.prototype.hour = function (options
) {
1676 options
= initOptions(options
, {
1677 min
: options
&& options
.twentyfour
? 0 : 1,
1678 max
: options
&& options
.twentyfour
? 23 : 12
1681 testRange(options
.min
< 0, "Chance: Min cannot be less than 0.");
1682 testRange(options
.twentyfour
&& options
.max
> 23, "Chance: Max cannot be greater than 23 for twentyfour option.");
1683 testRange(!options
.twentyfour
&& options
.max
> 12, "Chance: Max cannot be greater than 12.");
1684 testRange(options
.min
> options
.max
, "Chance: Min cannot be greater than Max.");
1686 return this.natural({min
: options
.min
, max
: options
.max
});
1689 Chance
.prototype.millisecond = function () {
1690 return this.natural({max
: 999});
1693 Chance
.prototype.minute
= Chance
.prototype.second = function (options
) {
1694 options
= initOptions(options
, {min
: 0, max
: 59});
1696 testRange(options
.min
< 0, "Chance: Min cannot be less than 0.");
1697 testRange(options
.max
> 59, "Chance: Max cannot be greater than 59.");
1698 testRange(options
.min
> options
.max
, "Chance: Min cannot be greater than Max.");
1700 return this.natural({min
: options
.min
, max
: options
.max
});
1703 Chance
.prototype.month = function (options
) {
1704 options
= initOptions(options
, {min
: 1, max
: 12});
1706 testRange(options
.min
< 1, "Chance: Min cannot be less than 1.");
1707 testRange(options
.max
> 12, "Chance: Max cannot be greater than 12.");
1708 testRange(options
.min
> options
.max
, "Chance: Min cannot be greater than Max.");
1710 var month
= this.pick(this.months().slice(options
.min
- 1, options
.max
));
1711 return options
.raw
? month
: month
.name
;
1714 Chance
.prototype.months = function () {
1715 return this.get("months");
1718 Chance
.prototype.second = function () {
1719 return this.natural({max
: 59});
1722 Chance
.prototype.timestamp = function () {
1723 return this.natural({min
: 1, max
: parseInt(new Date().getTime() / 1000, 10)});
1726 Chance
.prototype.weekday = function (options
) {
1727 options
= initOptions(options
, {weekday_only
: false});
1728 var weekdays
= ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"];
1729 if (!options
.weekday_only
) {
1730 weekdays
.push("Saturday");
1731 weekdays
.push("Sunday");
1733 return this.pickone(weekdays
);
1736 Chance
.prototype.year = function (options
) {
1737 // Default to current year as min if none specified
1738 options
= initOptions(options
, {min
: new Date().getFullYear()});
1740 // Default to one century after current year as max if none specified
1741 options
.max
= (typeof options
.max
!== "undefined") ? options
.max
: options
.min
+ 100;
1743 return this.natural(options
).toString();
1750 Chance
.prototype.cc = function (options
) {
1751 options
= initOptions(options
);
1753 var type
, number
, to_generate
;
1755 type
= (options
.type
) ?
1756 this.cc_type({ name
: options
.type
, raw
: true }) :
1757 this.cc_type({ raw
: true });
1759 number
= type
.prefix
.split("");
1760 to_generate
= type
.length
- type
.prefix
.length
- 1;
1762 // Generates n - 1 digits
1763 number
= number
.concat(this.n(this.integer
, to_generate
, {min
: 0, max
: 9}));
1765 // Generates the last digit according to Luhn algorithm
1766 number
.push(this.luhn_calculate(number
.join("")));
1768 return number
.join("");
1771 Chance
.prototype.cc_types = function () {
1772 // http://en.wikipedia.org/wiki/Bank_card_number#Issuer_identification_number_.28IIN.29
1773 return this.get("cc_types");
1776 Chance
.prototype.cc_type = function (options
) {
1777 options
= initOptions(options
);
1778 var types
= this.cc_types(),
1782 for (var i
= 0; i
< types
.length
; i
++) {
1783 // Accept either name or short_name to specify card type
1784 if (types
[i
].name
=== options
.name
|| types
[i
].short_name
=== options
.name
) {
1789 if (type
=== null) {
1790 throw new RangeError("Chance: Credit card type '" + options
.name
+ "' is not supported");
1793 type
= this.pick(types
);
1796 return options
.raw
? type
: type
.name
;
1799 // return all world currency by ISO 4217
1800 Chance
.prototype.currency_types = function () {
1801 return this.get("currency_types");
1804 // return random world currency by ISO 4217
1805 Chance
.prototype.currency = function () {
1806 return this.pick(this.currency_types());
1809 // return all timezones available
1810 Chance
.prototype.timezones = function () {
1811 return this.get("timezones");
1814 // return random timezone
1815 Chance
.prototype.timezone = function () {
1816 return this.pick(this.timezones());
1819 //Return random correct currency exchange pair (e.g. EUR/USD) or array of currency code
1820 Chance
.prototype.currency_pair = function (returnAsString
) {
1821 var currencies
= this.unique(this.currency
, 2, {
1822 comparator: function(arr
, val
) {
1824 return arr
.reduce(function(acc
, item
) {
1825 // If a match has been found, short circuit check and just return
1826 return acc
|| (item
.code
=== val
.code
);
1831 if (returnAsString
) {
1832 return currencies
[0].code
+ '/' + currencies
[1].code
;
1838 Chance
.prototype.dollar = function (options
) {
1839 // By default, a somewhat more sane max for dollar than all available numbers
1840 options
= initOptions(options
, {max
: 10000, min
: 0});
1842 var dollar
= this.floating({min
: options
.min
, max
: options
.max
, fixed
: 2}).toString(),
1843 cents
= dollar
.split('.')[1];
1845 if (cents
=== undefined) {
1847 } else if (cents
.length
< 2) {
1848 dollar
= dollar
+ '0';
1852 return '-$' + dollar
.replace('-', '');
1854 return '$' + dollar
;
1858 Chance
.prototype.euro = function (options
) {
1859 return Number(this.dollar(options
).replace("$", "")).toLocaleString() + "€";
1862 Chance
.prototype.exp = function (options
) {
1863 options
= initOptions(options
);
1866 exp
.year
= this.exp_year();
1868 // If the year is this year, need to ensure month is greater than the
1869 // current month or this expiration will not be valid
1870 if (exp
.year
=== (new Date().getFullYear()).toString()) {
1871 exp
.month
= this.exp_month({future
: true});
1873 exp
.month
= this.exp_month();
1876 return options
.raw
? exp
: exp
.month
+ '/' + exp
.year
;
1879 Chance
.prototype.exp_month = function (options
) {
1880 options
= initOptions(options
);
1881 var month
, month_int
,
1882 // Date object months are 0 indexed
1883 curMonth
= new Date().getMonth() + 1;
1885 if (options
.future
&& (curMonth
!== 12)) {
1887 month
= this.month({raw
: true}).numeric
;
1888 month_int
= parseInt(month
, 10);
1889 } while (month_int
<= curMonth
);
1891 month
= this.month({raw
: true}).numeric
;
1897 Chance
.prototype.exp_year = function () {
1898 var curMonth
= new Date().getMonth() + 1,
1899 curYear
= new Date().getFullYear();
1901 return this.year({min
: ((curMonth
=== 12) ? (curYear
+ 1) : curYear
), max
: (curYear
+ 10)});
1904 Chance
.prototype.vat = function (options
) {
1905 options
= initOptions(options
, { country
: 'it' });
1906 switch (options
.country
.toLowerCase()) {
1908 return this.it_vat();
1913 * Generate a string matching IBAN pattern (https://en.wikipedia.org/wiki/International_Bank_Account_Number).
1914 * No country-specific formats support (yet)
1916 Chance
.prototype.iban = function () {
1917 var alpha
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
1918 var alphanum
= alpha
+ '0123456789';
1920 this.string({ length
: 2, pool
: alpha
}) +
1921 this.pad(this.integer({ min
: 0, max
: 99 }), 2) +
1922 this.string({ length
: 4, pool
: alphanum
}) +
1923 this.pad(this.natural(), this.natural({ min
: 6, max
: 26 }));
1931 Chance
.prototype.it_vat = function () {
1932 var it_vat
= this.natural({min
: 1, max
: 1800000});
1934 it_vat
= this.pad(it_vat
, 7) + this.pad(this.pick(this.provinces({ country
: 'it' })).code
, 3);
1935 return it_vat
+ this.luhn_calculate(it_vat
);
1939 * this generator is written following the official algorithm
1940 * all data can be passed explicitely or randomized by calling chance.cf() without options
1941 * the code does not check that the input data is valid (it goes beyond the scope of the generator)
1943 * @param [Object] options = { first: first name,
1945 * gender: female|male,
1946 birthday: JavaScript date object,
1947 city: string(4), 1 letter + 3 numbers
1949 * @return [string] codice fiscale
1952 Chance
.prototype.cf = function (options
) {
1953 options
= options
|| {};
1954 var gender
= !!options
.gender
? options
.gender
: this.gender(),
1955 first
= !!options
.first
? options
.first
: this.first( { gender
: gender
, nationality
: 'it'} ),
1956 last
= !!options
.last
? options
.last
: this.last( { nationality
: 'it'} ),
1957 birthday
= !!options
.birthday
? options
.birthday
: this.birthday(),
1958 city
= !!options
.city
? options
.city
: this.pickone(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'L', 'M', 'Z']) + this.pad(this.natural({max
:999}), 3),
1960 name_generator = function(name
, isLast
) {
1964 if (name
.length
< 3) {
1965 return_value
= name
.split("").concat("XXX".split("")).splice(0,3);
1968 temp
= name
.toUpperCase().split('').map(function(c
){
1969 return ("BCDFGHJKLMNPRSTVWZ".indexOf(c
) !== -1) ? c
: undefined;
1971 if (temp
.length
> 3) {
1973 temp
= temp
.substr(0,3);
1975 temp
= temp
[0] + temp
.substr(2,2);
1978 if (temp
.length
< 3) {
1979 return_value
= temp
;
1980 temp
= name
.toUpperCase().split('').map(function(c
){
1981 return ("AEIOU".indexOf(c
) !== -1) ? c
: undefined;
1982 }).join('').substr(0, 3 - return_value
.length
);
1984 return_value
= return_value
+ temp
;
1987 return return_value
;
1989 date_generator = function(birthday
, gender
, that
) {
1990 var lettermonths
= ['A', 'B', 'C', 'D', 'E', 'H', 'L', 'M', 'P', 'R', 'S', 'T'];
1992 return birthday
.getFullYear().toString().substr(2) +
1993 lettermonths
[birthday
.getMonth()] +
1994 that
.pad(birthday
.getDate() + ((gender
.toLowerCase() === "female") ? 40 : 0), 2);
1996 checkdigit_generator = function(cf
) {
1997 var range1
= "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",
1998 range2
= "ABCDEFGHIJABCDEFGHIJKLMNOPQRSTUVWXYZ",
1999 evens
= "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
2000 odds
= "BAKPLCQDREVOSFTGUHMINJWZYX",
2004 for(var i
= 0; i
< 15; i
++) {
2006 digit
+= evens
.indexOf(range2
[range1
.indexOf(cf
[i
])]);
2009 digit
+= odds
.indexOf(range2
[range1
.indexOf(cf
[i
])]);
2012 return evens
[digit
% 26];
2015 cf
= cf
.concat(name_generator(last
, true), name_generator(first
), date_generator(birthday
, gender
, this), city
.toUpperCase().split("")).join("");
2016 cf
+= checkdigit_generator(cf
.toUpperCase(), this);
2018 return cf
.toUpperCase();
2021 Chance
.prototype.pl_pesel = function () {
2022 var number
= this.natural({min
: 1, max
: 9999999999});
2023 var arr
= this.pad(number
, 10).split('');
2024 for (var i
= 0; i
< arr
.length
; i
++) {
2025 arr
[i
] = parseInt(arr
[i
]);
2028 var controlNumber
= (1 * arr
[0] + 3 * arr
[1] + 7 * arr
[2] + 9 * arr
[3] + 1 * arr
[4] + 3 * arr
[5] + 7 * arr
[6] + 9 * arr
[7] + 1 * arr
[8] + 3 * arr
[9]) % 10;
2029 if(controlNumber
!== 0) {
2030 controlNumber
= 10 - controlNumber
;
2033 return arr
.join('') + controlNumber
;
2036 Chance
.prototype.pl_nip = function () {
2037 var number
= this.natural({min
: 1, max
: 999999999});
2038 var arr
= this.pad(number
, 9).split('');
2039 for (var i
= 0; i
< arr
.length
; i
++) {
2040 arr
[i
] = parseInt(arr
[i
]);
2043 var controlNumber
= (6 * arr
[0] + 5 * arr
[1] + 7 * arr
[2] + 2 * arr
[3] + 3 * arr
[4] + 4 * arr
[5] + 5 * arr
[6] + 6 * arr
[7] + 7 * arr
[8]) % 11;
2044 if(controlNumber
=== 10) {
2045 return this.pl_nip();
2048 return arr
.join('') + controlNumber
;
2051 Chance
.prototype.pl_regon = function () {
2052 var number
= this.natural({min
: 1, max
: 99999999});
2053 var arr
= this.pad(number
, 8).split('');
2054 for (var i
= 0; i
< arr
.length
; i
++) {
2055 arr
[i
] = parseInt(arr
[i
]);
2058 var controlNumber
= (8 * arr
[0] + 9 * arr
[1] + 2 * arr
[2] + 3 * arr
[3] + 4 * arr
[4] + 5 * arr
[5] + 6 * arr
[6] + 7 * arr
[7]) % 11;
2059 if(controlNumber
=== 10) {
2063 return arr
.join('') + controlNumber
;
2068 // -- Miscellaneous --
2070 // Dice - For all the board game geeks out there, myself included ;)
2071 function diceFn (range
) {
2072 return function () {
2073 return this.natural(range
);
2076 Chance
.prototype.d4
= diceFn({min
: 1, max
: 4});
2077 Chance
.prototype.d6
= diceFn({min
: 1, max
: 6});
2078 Chance
.prototype.d8
= diceFn({min
: 1, max
: 8});
2079 Chance
.prototype.d10
= diceFn({min
: 1, max
: 10});
2080 Chance
.prototype.d12
= diceFn({min
: 1, max
: 12});
2081 Chance
.prototype.d20
= diceFn({min
: 1, max
: 20});
2082 Chance
.prototype.d30
= diceFn({min
: 1, max
: 30});
2083 Chance
.prototype.d100
= diceFn({min
: 1, max
: 100});
2085 Chance
.prototype.rpg = function (thrown
, options
) {
2086 options
= initOptions(options
);
2088 throw new RangeError("Chance: A type of die roll must be included");
2090 var bits
= thrown
.toLowerCase().split("d"),
2093 if (bits
.length
!== 2 || !parseInt(bits
[0], 10) || !parseInt(bits
[1], 10)) {
2094 throw new Error("Chance: Invalid format provided. Please provide #d# where the first # is the number of dice to roll, the second # is the max of each die");
2096 for (var i
= bits
[0]; i
> 0; i
--) {
2097 rolls
[i
- 1] = this.natural({min
: 1, max
: bits
[1]});
2099 return (typeof options
.sum
!== 'undefined' && options
.sum
) ? rolls
.reduce(function (p
, c
) { return p
+ c
; }) : rolls
;
2104 Chance
.prototype.guid = function (options
) {
2105 options
= initOptions(options
, { version
: 5 });
2107 var guid_pool
= "abcdef1234567890",
2108 variant_pool
= "ab89",
2109 guid
= this.string({ pool
: guid_pool
, length
: 8 }) + '-' +
2110 this.string({ pool
: guid_pool
, length
: 4 }) + '-' +
2113 this.string({ pool
: guid_pool
, length
: 3 }) + '-' +
2115 this.string({ pool
: variant_pool
, length
: 1 }) +
2116 this.string({ pool
: guid_pool
, length
: 3 }) + '-' +
2117 this.string({ pool
: guid_pool
, length
: 12 });
2122 Chance
.prototype.hash = function (options
) {
2123 options
= initOptions(options
, {length
: 40, casing
: 'lower'});
2124 var pool
= options
.casing
=== 'upper' ? HEX_POOL
.toUpperCase() : HEX_POOL
;
2125 return this.string({pool
: pool
, length
: options
.length
});
2128 Chance
.prototype.luhn_check = function (num
) {
2129 var str
= num
.toString();
2130 var checkDigit
= +str
.substring(str
.length
- 1);
2131 return checkDigit
=== this.luhn_calculate(+str
.substring(0, str
.length
- 1));
2134 Chance
.prototype.luhn_calculate = function (num
) {
2135 var digits
= num
.toString().split("").reverse();
2139 for (var i
= 0, l
= digits
.length
; l
> i
; ++i
) {
2149 return (sum
* 9) % 10;
2153 Chance
.prototype.md5 = function(options
) {
2154 var opts
= { str
: '', key
: null, raw
: false };
2157 opts
.str
= this.string();
2160 else if (typeof options
=== 'string') {
2164 else if (typeof options
!== 'object') {
2167 else if(options
.constructor === 'Array') {
2171 opts
= initOptions(options
, opts
);
2174 throw new Error('A parameter is required to return an md5 hash.');
2177 return this.bimd5
.md5(opts
.str
, opts
.key
, opts
.raw
);
2182 * =====================================================
2183 * Generate random file name with extension
2185 * The argument provide extension type
2191 * If nothing is provided the function return random file name with random
2192 * extension type of any kind
2194 * The user can validate the file name length range
2195 * If nothing provided the generated file name is random
2198 * * Currently the supported extensions are
2199 * -> some of the most popular raster image extensions
2200 * -> some of the most popular vector image extensions
2201 * -> some of the most popular 3d image extensions
2202 * -> some of the most popular document extensions
2205 * =====================================================
2207 * Return random file name with random extension. The file extension
2208 * is provided by a predefined collection of extensions. More about the extension
2209 * pool can be found in #Extension Pool section
2214 * In order to generate a file name with specific length, specify the
2215 * length property and integer value. The extension is going to be random
2217 * chance.file({length : 10})
2220 * In order to generate file with extension from some of the predefined groups
2221 * of the extension pool just specify the extension pool category in fileType property
2223 * chance.file({fileType : 'raster'})
2226 * You can provide specific extension for your files
2227 * chance.file({extension : 'html'})
2230 * Or you could pass custom collection of extensions by array or by object
2231 * chance.file({extensions : [...]})
2234 * chance.file({extensions : { key : [...], key : [...]}})
2237 * @param [collection] options
2241 Chance
.prototype.file = function(options
) {
2243 var fileOptions
= options
|| {};
2244 var poolCollectionKey
= "fileExtension";
2245 var typeRange
= Object
.keys(this.get("fileExtension"));//['raster', 'vector', '3d', 'document'];
2249 // Generate random file name
2250 fileName
= this.word({length
: fileOptions
.length
});
2252 // Generate file by specific extension provided by the user
2253 if(fileOptions
.extension
) {
2255 fileExtension
= fileOptions
.extension
;
2256 return (fileName
+ '.' + fileExtension
);
2259 // Generate file by specific extension collection
2260 if(fileOptions
.extensions
) {
2262 if(Array
.isArray(fileOptions
.extensions
)) {
2264 fileExtension
= this.pickone(fileOptions
.extensions
);
2265 return (fileName
+ '.' + fileExtension
);
2267 else if(fileOptions
.extensions
.constructor === Object
) {
2269 var extensionObjectCollection
= fileOptions
.extensions
;
2270 var keys
= Object
.keys(extensionObjectCollection
);
2272 fileExtension
= this.pickone(extensionObjectCollection
[this.pickone(keys
)]);
2273 return (fileName
+ '.' + fileExtension
);
2276 throw new Error("Chance: Extensions must be an Array or Object");
2279 // Generate file extension based on specific file type
2280 if(fileOptions
.fileType
) {
2282 var fileType
= fileOptions
.fileType
;
2283 if(typeRange
.indexOf(fileType
) !== -1) {
2285 fileExtension
= this.pickone(this.get(poolCollectionKey
)[fileType
]);
2286 return (fileName
+ '.' + fileExtension
);
2289 throw new RangeError("Chance: Expect file type value to be 'raster', 'vector', '3d' or 'document'");
2292 // Generate random file name if no extension options are passed
2293 fileExtension
= this.pickone(this.get(poolCollectionKey
)[this.pickone(typeRange
)]);
2294 return (fileName
+ '.' + fileExtension
);
2301 "en": ["James", "John", "Robert", "Michael", "William", "David", "Richard", "Joseph", "Charles", "Thomas", "Christopher", "Daniel", "Matthew", "George", "Donald", "Anthony", "Paul", "Mark", "Edward", "Steven", "Kenneth", "Andrew", "Brian", "Joshua", "Kevin", "Ronald", "Timothy", "Jason", "Jeffrey", "Frank", "Gary", "Ryan", "Nicholas", "Eric", "Stephen", "Jacob", "Larry", "Jonathan", "Scott", "Raymond", "Justin", "Brandon", "Gregory", "Samuel", "Benjamin", "Patrick", "Jack", "Henry", "Walter", "Dennis", "Jerry", "Alexander", "Peter", "Tyler", "Douglas", "Harold", "Aaron", "Jose", "Adam", "Arthur", "Zachary", "Carl", "Nathan", "Albert", "Kyle", "Lawrence", "Joe", "Willie", "Gerald", "Roger", "Keith", "Jeremy", "Terry", "Harry", "Ralph", "Sean", "Jesse", "Roy", "Louis", "Billy", "Austin", "Bruce", "Eugene", "Christian", "Bryan", "Wayne", "Russell", "Howard", "Fred", "Ethan", "Jordan", "Philip", "Alan", "Juan", "Randy", "Vincent", "Bobby", "Dylan", "Johnny", "Phillip", "Victor", "Clarence", "Ernest", "Martin", "Craig", "Stanley", "Shawn", "Travis", "Bradley", "Leonard", "Earl", "Gabriel", "Jimmy", "Francis", "Todd", "Noah", "Danny", "Dale", "Cody", "Carlos", "Allen", "Frederick", "Logan", "Curtis", "Alex", "Joel", "Luis", "Norman", "Marvin", "Glenn", "Tony", "Nathaniel", "Rodney", "Melvin", "Alfred", "Steve", "Cameron", "Chad", "Edwin", "Caleb", "Evan", "Antonio", "Lee", "Herbert", "Jeffery", "Isaac", "Derek", "Ricky", "Marcus", "Theodore", "Elijah", "Luke", "Jesus", "Eddie", "Troy", "Mike", "Dustin", "Ray", "Adrian", "Bernard", "Leroy", "Angel", "Randall", "Wesley", "Ian", "Jared", "Mason", "Hunter", "Calvin", "Oscar", "Clifford", "Jay", "Shane", "Ronnie", "Barry", "Lucas", "Corey", "Manuel", "Leo", "Tommy", "Warren", "Jackson", "Isaiah", "Connor", "Don", "Dean", "Jon", "Julian", "Miguel", "Bill", "Lloyd", "Charlie", "Mitchell", "Leon", "Jerome", "Darrell", "Jeremiah", "Alvin", "Brett", "Seth", "Floyd", "Jim", "Blake", "Micheal", "Gordon", "Trevor", "Lewis", "Erik", "Edgar", "Vernon", "Devin", "Gavin", "Jayden", "Chris", "Clyde", "Tom", "Derrick", "Mario", "Brent", "Marc", "Herman", "Chase", "Dominic", "Ricardo", "Franklin", "Maurice", "Max", "Aiden", "Owen", "Lester", "Gilbert", "Elmer", "Gene", "Francisco", "Glen", "Cory", "Garrett", "Clayton", "Sam", "Jorge", "Chester", "Alejandro", "Jeff", "Harvey", "Milton", "Cole", "Ivan", "Andre", "Duane", "Landon"],
2302 // Data taken from http://www.dati.gov.it/dataset/comune-di-firenze_0163
2303 "it": ["Adolfo", "Alberto", "Aldo", "Alessandro", "Alessio", "Alfredo", "Alvaro", "Andrea", "Angelo", "Angiolo", "Antonino", "Antonio", "Attilio", "Benito", "Bernardo", "Bruno", "Carlo", "Cesare", "Christian", "Claudio", "Corrado", "Cosimo", "Cristian", "Cristiano", "Daniele", "Dario", "David", "Davide", "Diego", "Dino", "Domenico", "Duccio", "Edoardo", "Elia", "Elio", "Emanuele", "Emiliano", "Emilio", "Enrico", "Enzo", "Ettore", "Fabio", "Fabrizio", "Federico", "Ferdinando", "Fernando", "Filippo", "Francesco", "Franco", "Gabriele", "Giacomo", "Giampaolo", "Giampiero", "Giancarlo", "Gianfranco", "Gianluca", "Gianmarco", "Gianni", "Gino", "Giorgio", "Giovanni", "Giuliano", "Giulio", "Giuseppe", "Graziano", "Gregorio", "Guido", "Iacopo", "Jacopo", "Lapo", "Leonardo", "Lorenzo", "Luca", "Luciano", "Luigi", "Manuel", "Marcello", "Marco", "Marino", "Mario", "Massimiliano", "Massimo", "Matteo", "Mattia", "Maurizio", "Mauro", "Michele", "Mirko", "Mohamed", "Nello", "Neri", "Niccolò", "Nicola", "Osvaldo", "Otello", "Paolo", "Pier Luigi", "Piero", "Pietro", "Raffaele", "Remo", "Renato", "Renzo", "Riccardo", "Roberto", "Rolando", "Romano", "Salvatore", "Samuele", "Sandro", "Sergio", "Silvano", "Simone", "Stefano", "Thomas", "Tommaso", "Ubaldo", "Ugo", "Umberto", "Valerio", "Valter", "Vasco", "Vincenzo", "Vittorio"],
2304 // Data taken from http://www.svbkindernamen.nl/int/nl/kindernamen/index.html
2305 "nl": ["Aaron","Abel","Adam","Adriaan","Albert","Alexander","Ali","Arjen","Arno","Bart","Bas","Bastiaan","Benjamin","Bob", "Boris","Bram","Brent","Cas","Casper","Chris","Christiaan","Cornelis","Daan","Daley","Damian","Dani","Daniel","Daniël","David","Dean","Dirk","Dylan","Egbert","Elijah","Erik","Erwin","Evert","Ezra","Fabian","Fedde","Finn","Florian","Floris","Frank","Frans","Frederik","Freek","Geert","Gerard","Gerben","Gerrit","Gijs","Guus","Hans","Hendrik","Henk","Herman","Hidde","Hugo","Jaap","Jan Jaap","Jan-Willem","Jack","Jacob","Jan","Jason","Jasper","Jayden","Jelle","Jelte","Jens","Jeroen","Jesse","Jim","Job","Joep","Johannes","John","Jonathan","Joris","Joshua","Joël","Julian","Kees","Kevin","Koen","Lars","Laurens","Leendert","Lennard","Lodewijk","Luc","Luca","Lucas","Lukas","Luuk","Maarten","Marcus","Martijn","Martin","Matthijs","Maurits","Max","Mees","Melle","Mick","Mika","Milan","Mohamed","Mohammed","Morris","Muhammed","Nathan","Nick","Nico","Niek","Niels","Noah","Noud","Olivier","Oscar","Owen","Paul","Pepijn","Peter","Pieter","Pim","Quinten","Reinier","Rens","Robin","Ruben","Sam","Samuel","Sander","Sebastiaan","Sem","Sep","Sepp","Siem","Simon","Stan","Stef","Steven","Stijn","Sven","Teun","Thijmen","Thijs","Thomas","Tijn","Tim","Timo","Tobias","Tom","Victor","Vince","Willem","Wim","Wouter","Yusuf"]
2309 "en": ["Mary", "Emma", "Elizabeth", "Minnie", "Margaret", "Ida", "Alice", "Bertha", "Sarah", "Annie", "Clara", "Ella", "Florence", "Cora", "Martha", "Laura", "Nellie", "Grace", "Carrie", "Maude", "Mabel", "Bessie", "Jennie", "Gertrude", "Julia", "Hattie", "Edith", "Mattie", "Rose", "Catherine", "Lillian", "Ada", "Lillie", "Helen", "Jessie", "Louise", "Ethel", "Lula", "Myrtle", "Eva", "Frances", "Lena", "Lucy", "Edna", "Maggie", "Pearl", "Daisy", "Fannie", "Josephine", "Dora", "Rosa", "Katherine", "Agnes", "Marie", "Nora", "May", "Mamie", "Blanche", "Stella", "Ellen", "Nancy", "Effie", "Sallie", "Nettie", "Della", "Lizzie", "Flora", "Susie", "Maud", "Mae", "Etta", "Harriet", "Sadie", "Caroline", "Katie", "Lydia", "Elsie", "Kate", "Susan", "Mollie", "Alma", "Addie", "Georgia", "Eliza", "Lulu", "Nannie", "Lottie", "Amanda", "Belle", "Charlotte", "Rebecca", "Ruth", "Viola", "Olive", "Amelia", "Hannah", "Jane", "Virginia", "Emily", "Matilda", "Irene", "Kathryn", "Esther", "Willie", "Henrietta", "Ollie", "Amy", "Rachel", "Sara", "Estella", "Theresa", "Augusta", "Ora", "Pauline", "Josie", "Lola", "Sophia", "Leona", "Anne", "Mildred", "Ann", "Beulah", "Callie", "Lou", "Delia", "Eleanor", "Barbara", "Iva", "Louisa", "Maria", "Mayme", "Evelyn", "Estelle", "Nina", "Betty", "Marion", "Bettie", "Dorothy", "Luella", "Inez", "Lela", "Rosie", "Allie", "Millie", "Janie", "Cornelia", "Victoria", "Ruby", "Winifred", "Alta", "Celia", "Christine", "Beatrice", "Birdie", "Harriett", "Mable", "Myra", "Sophie", "Tillie", "Isabel", "Sylvia", "Carolyn", "Isabelle", "Leila", "Sally", "Ina", "Essie", "Bertie", "Nell", "Alberta", "Katharine", "Lora", "Rena", "Mina", "Rhoda", "Mathilda", "Abbie", "Eula", "Dollie", "Hettie", "Eunice", "Fanny", "Ola", "Lenora", "Adelaide", "Christina", "Lelia", "Nelle", "Sue", "Johanna", "Lilly", "Lucinda", "Minerva", "Lettie", "Roxie", "Cynthia", "Helena", "Hilda", "Hulda", "Bernice", "Genevieve", "Jean", "Cordelia", "Marian", "Francis", "Jeanette", "Adeline", "Gussie", "Leah", "Lois", "Lura", "Mittie", "Hallie", "Isabella", "Olga", "Phoebe", "Teresa", "Hester", "Lida", "Lina", "Winnie", "Claudia", "Marguerite", "Vera", "Cecelia", "Bess", "Emilie", "Rosetta", "Verna", "Myrtie", "Cecilia", "Elva", "Olivia", "Ophelia", "Georgie", "Elnora", "Violet", "Adele", "Lily", "Linnie", "Loretta", "Madge", "Polly", "Virgie", "Eugenia", "Lucile", "Lucille", "Mabelle", "Rosalie"],
2310 // Data taken from http://www.dati.gov.it/dataset/comune-di-firenze_0162
2311 "it": ["Ada", "Adriana", "Alessandra", "Alessia", "Alice", "Angela", "Anna", "Anna Maria", "Annalisa", "Annita", "Annunziata", "Antonella", "Arianna", "Asia", "Assunta", "Aurora", "Barbara", "Beatrice", "Benedetta", "Bianca", "Bruna", "Camilla", "Carla", "Carlotta", "Carmela", "Carolina", "Caterina", "Catia", "Cecilia", "Chiara", "Cinzia", "Clara", "Claudia", "Costanza", "Cristina", "Daniela", "Debora", "Diletta", "Dina", "Donatella", "Elena", "Eleonora", "Elisa", "Elisabetta", "Emanuela", "Emma", "Eva", "Federica", "Fernanda", "Fiorella", "Fiorenza", "Flora", "Franca", "Francesca", "Gabriella", "Gaia", "Gemma", "Giada", "Gianna", "Gina", "Ginevra", "Giorgia", "Giovanna", "Giulia", "Giuliana", "Giuseppa", "Giuseppina", "Grazia", "Graziella", "Greta", "Ida", "Ilaria", "Ines", "Iolanda", "Irene", "Irma", "Isabella", "Jessica", "Laura", "Lea", "Letizia", "Licia", "Lidia", "Liliana", "Lina", "Linda", "Lisa", "Livia", "Loretta", "Luana", "Lucia", "Luciana", "Lucrezia", "Luisa", "Manuela", "Mara", "Marcella", "Margherita", "Maria", "Maria Cristina", "Maria Grazia", "Maria Luisa", "Maria Pia", "Maria Teresa", "Marina", "Marisa", "Marta", "Martina", "Marzia", "Matilde", "Melissa", "Michela", "Milena", "Mirella", "Monica", "Natalina", "Nella", "Nicoletta", "Noemi", "Olga", "Paola", "Patrizia", "Piera", "Pierina", "Raffaella", "Rebecca", "Renata", "Rina", "Rita", "Roberta", "Rosa", "Rosanna", "Rossana", "Rossella", "Sabrina", "Sandra", "Sara", "Serena", "Silvana", "Silvia", "Simona", "Simonetta", "Sofia", "Sonia", "Stefania", "Susanna", "Teresa", "Tina", "Tiziana", "Tosca", "Valentina", "Valeria", "Vanda", "Vanessa", "Vanna", "Vera", "Veronica", "Vilma", "Viola", "Virginia", "Vittoria"],
2312 // Data taken from http://www.svbkindernamen.nl/int/nl/kindernamen/index.html
2313 "nl": ["Ada", "Arianne", "Afke", "Amanda", "Amber", "Amy", "Aniek", "Anita", "Anja", "Anna", "Anne", "Annelies", "Annemarie", "Annette", "Anouk", "Astrid", "Aukje", "Barbara", "Bianca", "Carla", "Carlijn", "Carolien", "Chantal", "Charlotte", "Claudia", "Daniëlle", "Debora", "Diane", "Dora", "Eline", "Elise", "Ella", "Ellen", "Emma", "Esmee", "Evelien", "Esther", "Erica", "Eva", "Femke", "Fleur", "Floor", "Froukje", "Gea", "Gerda", "Hanna", "Hanneke", "Heleen", "Hilde", "Ilona", "Ina", "Inge", "Ingrid", "Iris", "Isabel", "Isabelle", "Janneke", "Jasmijn", "Jeanine", "Jennifer", "Jessica", "Johanna", "Joke", "Julia", "Julie", "Karen", "Karin", "Katja", "Kim", "Lara", "Laura", "Lena", "Lianne", "Lieke", "Lilian", "Linda", "Lisa", "Lisanne", "Lotte", "Louise", "Maaike", "Manon", "Marga", "Maria", "Marissa", "Marit", "Marjolein", "Martine", "Marleen", "Melissa", "Merel", "Miranda", "Michelle", "Mirjam", "Mirthe", "Naomi", "Natalie", 'Nienke', "Nina", "Noortje", "Olivia", "Patricia", "Paula", "Paulien", "Ramona", "Ria", "Rianne", "Roos", "Rosanne", "Ruth", "Sabrina", "Sandra", "Sanne", "Sara", "Saskia", "Silvia", "Sofia", "Sophie", "Sonja", "Suzanne", "Tamara", "Tess", "Tessa", "Tineke", "Valerie", "Vanessa", "Veerle", "Vera", "Victoria", "Wendy", "Willeke", "Yvonne", "Zoë"]
2318 "en": ['Smith', 'Johnson', 'Williams', 'Jones', 'Brown', 'Davis', 'Miller', 'Wilson', 'Moore', 'Taylor', 'Anderson', 'Thomas', 'Jackson', 'White', 'Harris', 'Martin', 'Thompson', 'Garcia', 'Martinez', 'Robinson', 'Clark', 'Rodriguez', 'Lewis', 'Lee', 'Walker', 'Hall', 'Allen', 'Young', 'Hernandez', 'King', 'Wright', 'Lopez', 'Hill', 'Scott', 'Green', 'Adams', 'Baker', 'Gonzalez', 'Nelson', 'Carter', 'Mitchell', 'Perez', 'Roberts', 'Turner', 'Phillips', 'Campbell', 'Parker', 'Evans', 'Edwards', 'Collins', 'Stewart', 'Sanchez', 'Morris', 'Rogers', 'Reed', 'Cook', 'Morgan', 'Bell', 'Murphy', 'Bailey', 'Rivera', 'Cooper', 'Richardson', 'Cox', 'Howard', 'Ward', 'Torres', 'Peterson', 'Gray', 'Ramirez', 'James', 'Watson', 'Brooks', 'Kelly', 'Sanders', 'Price', 'Bennett', 'Wood', 'Barnes', 'Ross', 'Henderson', 'Coleman', 'Jenkins', 'Perry', 'Powell', 'Long', 'Patterson', 'Hughes', 'Flores', 'Washington', 'Butler', 'Simmons', 'Foster', 'Gonzales', 'Bryant', 'Alexander', 'Russell', 'Griffin', 'Diaz', 'Hayes', 'Myers', 'Ford', 'Hamilton', 'Graham', 'Sullivan', 'Wallace', 'Woods', 'Cole', 'West', 'Jordan', 'Owens', 'Reynolds', 'Fisher', 'Ellis', 'Harrison', 'Gibson', 'McDonald', 'Cruz', 'Marshall', 'Ortiz', 'Gomez', 'Murray', 'Freeman', 'Wells', 'Webb', 'Simpson', 'Stevens', 'Tucker', 'Porter', 'Hunter', 'Hicks', 'Crawford', 'Henry', 'Boyd', 'Mason', 'Morales', 'Kennedy', 'Warren', 'Dixon', 'Ramos', 'Reyes', 'Burns', 'Gordon', 'Shaw', 'Holmes', 'Rice', 'Robertson', 'Hunt', 'Black', 'Daniels', 'Palmer', 'Mills', 'Nichols', 'Grant', 'Knight', 'Ferguson', 'Rose', 'Stone', 'Hawkins', 'Dunn', 'Perkins', 'Hudson', 'Spencer', 'Gardner', 'Stephens', 'Payne', 'Pierce', 'Berry', 'Matthews', 'Arnold', 'Wagner', 'Willis', 'Ray', 'Watkins', 'Olson', 'Carroll', 'Duncan', 'Snyder', 'Hart', 'Cunningham', 'Bradley', 'Lane', 'Andrews', 'Ruiz', 'Harper', 'Fox', 'Riley', 'Armstrong', 'Carpenter', 'Weaver', 'Greene', 'Lawrence', 'Elliott', 'Chavez', 'Sims', 'Austin', 'Peters', 'Kelley', 'Franklin', 'Lawson', 'Fields', 'Gutierrez', 'Ryan', 'Schmidt', 'Carr', 'Vasquez', 'Castillo', 'Wheeler', 'Chapman', 'Oliver', 'Montgomery', 'Richards', 'Williamson', 'Johnston', 'Banks', 'Meyer', 'Bishop', 'McCoy', 'Howell', 'Alvarez', 'Morrison', 'Hansen', 'Fernandez', 'Garza', 'Harvey', 'Little', 'Burton', 'Stanley', 'Nguyen', 'George', 'Jacobs', 'Reid', 'Kim', 'Fuller', 'Lynch', 'Dean', 'Gilbert', 'Garrett', 'Romero', 'Welch', 'Larson', 'Frazier', 'Burke', 'Hanson', 'Day', 'Mendoza', 'Moreno', 'Bowman', 'Medina', 'Fowler', 'Brewer', 'Hoffman', 'Carlson', 'Silva', 'Pearson', 'Holland', 'Douglas', 'Fleming', 'Jensen', 'Vargas', 'Byrd', 'Davidson', 'Hopkins', 'May', 'Terry', 'Herrera', 'Wade', 'Soto', 'Walters', 'Curtis', 'Neal', 'Caldwell', 'Lowe', 'Jennings', 'Barnett', 'Graves', 'Jimenez', 'Horton', 'Shelton', 'Barrett', 'Obrien', 'Castro', 'Sutton', 'Gregory', 'McKinney', 'Lucas', 'Miles', 'Craig', 'Rodriquez', 'Chambers', 'Holt', 'Lambert', 'Fletcher', 'Watts', 'Bates', 'Hale', 'Rhodes', 'Pena', 'Beck', 'Newman', 'Haynes', 'McDaniel', 'Mendez', 'Bush', 'Vaughn', 'Parks', 'Dawson', 'Santiago', 'Norris', 'Hardy', 'Love', 'Steele', 'Curry', 'Powers', 'Schultz', 'Barker', 'Guzman', 'Page', 'Munoz', 'Ball', 'Keller', 'Chandler', 'Weber', 'Leonard', 'Walsh', 'Lyons', 'Ramsey', 'Wolfe', 'Schneider', 'Mullins', 'Benson', 'Sharp', 'Bowen', 'Daniel', 'Barber', 'Cummings', 'Hines', 'Baldwin', 'Griffith', 'Valdez', 'Hubbard', 'Salazar', 'Reeves', 'Warner', 'Stevenson', 'Burgess', 'Santos', 'Tate', 'Cross', 'Garner', 'Mann', 'Mack', 'Moss', 'Thornton', 'Dennis', 'McGee', 'Farmer', 'Delgado', 'Aguilar', 'Vega', 'Glover', 'Manning', 'Cohen', 'Harmon', 'Rodgers', 'Robbins', 'Newton', 'Todd', 'Blair', 'Higgins', 'Ingram', 'Reese', 'Cannon', 'Strickland', 'Townsend', 'Potter', 'Goodwin', 'Walton', 'Rowe', 'Hampton', 'Ortega', 'Patton', 'Swanson', 'Joseph', 'Francis', 'Goodman', 'Maldonado', 'Yates', 'Becker', 'Erickson', 'Hodges', 'Rios', 'Conner', 'Adkins', 'Webster', 'Norman', 'Malone', 'Hammond', 'Flowers', 'Cobb', 'Moody', 'Quinn', 'Blake', 'Maxwell', 'Pope', 'Floyd', 'Osborne', 'Paul', 'McCarthy', 'Guerrero', 'Lindsey', 'Estrada', 'Sandoval', 'Gibbs', 'Tyler', 'Gross', 'Fitzgerald', 'Stokes', 'Doyle', 'Sherman', 'Saunders', 'Wise', 'Colon', 'Gill', 'Alvarado', 'Greer', 'Padilla', 'Simon', 'Waters', 'Nunez', 'Ballard', 'Schwartz', 'McBride', 'Houston', 'Christensen', 'Klein', 'Pratt', 'Briggs', 'Parsons', 'McLaughlin', 'Zimmerman', 'French', 'Buchanan', 'Moran', 'Copeland', 'Roy', 'Pittman', 'Brady', 'McCormick', 'Holloway', 'Brock', 'Poole', 'Frank', 'Logan', 'Owen', 'Bass', 'Marsh', 'Drake', 'Wong', 'Jefferson', 'Park', 'Morton', 'Abbott', 'Sparks', 'Patrick', 'Norton', 'Huff', 'Clayton', 'Massey', 'Lloyd', 'Figueroa', 'Carson', 'Bowers', 'Roberson', 'Barton', 'Tran', 'Lamb', 'Harrington', 'Casey', 'Boone', 'Cortez', 'Clarke', 'Mathis', 'Singleton', 'Wilkins', 'Cain', 'Bryan', 'Underwood', 'Hogan', 'McKenzie', 'Collier', 'Luna', 'Phelps', 'McGuire', 'Allison', 'Bridges', 'Wilkerson', 'Nash', 'Summers', 'Atkins'],
2319 // Data taken from http://www.dati.gov.it/dataset/comune-di-firenze_0164 (first 1000)
2320 "it": ["Acciai", "Aglietti", "Agostini", "Agresti", "Ahmed", "Aiazzi", "Albanese", "Alberti", "Alessi", "Alfani", "Alinari", "Alterini", "Amato", "Ammannati", "Ancillotti", "Andrei", "Andreini", "Andreoni", "Angeli", "Anichini", "Antonelli", "Antonini", "Arena", "Ariani", "Arnetoli", "Arrighi", "Baccani", "Baccetti", "Bacci", "Bacherini", "Badii", "Baggiani", "Baglioni", "Bagni", "Bagnoli", "Baldassini", "Baldi", "Baldini", "Ballerini", "Balli", "Ballini", "Balloni", "Bambi", "Banchi", "Bandinelli", "Bandini", "Bani", "Barbetti", "Barbieri", "Barchielli", "Bardazzi", "Bardelli", "Bardi", "Barducci", "Bargellini", "Bargiacchi", "Barni", "Baroncelli", "Baroncini", "Barone", "Baroni", "Baronti", "Bartalesi", "Bartoletti", "Bartoli", "Bartolini", "Bartoloni", "Bartolozzi", "Basagni", "Basile", "Bassi", "Batacchi", "Battaglia", "Battaglini", "Bausi", "Becagli", "Becattini", "Becchi", "Becucci", "Bellandi", "Bellesi", "Belli", "Bellini", "Bellucci", "Bencini", "Benedetti", "Benelli", "Beni", "Benini", "Bensi", "Benucci", "Benvenuti", "Berlincioni", "Bernacchioni", "Bernardi", "Bernardini", "Berni", "Bernini", "Bertelli", "Berti", "Bertini", "Bessi", "Betti", "Bettini", "Biagi", "Biagini", "Biagioni", "Biagiotti", "Biancalani", "Bianchi", "Bianchini", "Bianco", "Biffoli", "Bigazzi", "Bigi", "Biliotti", "Billi", "Binazzi", "Bindi", "Bini", "Biondi", "Bizzarri", "Bocci", "Bogani", "Bolognesi", "Bonaiuti", "Bonanni", "Bonciani", "Boncinelli", "Bondi", "Bonechi", "Bongini", "Boni", "Bonini", "Borchi", "Boretti", "Borghi", "Borghini", "Borgioli", "Borri", "Borselli", "Boschi", "Bottai", "Bracci", "Braccini", "Brandi", "Braschi", "Bravi", "Brazzini", "Breschi", "Brilli", "Brizzi", "Brogelli", "Brogi", "Brogioni", "Brunelli", "Brunetti", "Bruni", "Bruno", "Brunori", "Bruschi", "Bucci", "Bucciarelli", "Buccioni", "Bucelli", "Bulli", "Burberi", "Burchi", "Burgassi", "Burroni", "Bussotti", "Buti", "Caciolli", "Caiani", "Calabrese", "Calamai", "Calamandrei", "Caldini", "Calo'", "Calonaci", "Calosi", "Calvelli", "Cambi", "Camiciottoli", "Cammelli", "Cammilli", "Campolmi", "Cantini", "Capanni", "Capecchi", "Caponi", "Cappelletti", "Cappelli", "Cappellini", "Cappugi", "Capretti", "Caputo", "Carbone", "Carboni", "Cardini", "Carlesi", "Carletti", "Carli", "Caroti", "Carotti", "Carrai", "Carraresi", "Carta", "Caruso", "Casalini", "Casati", "Caselli", "Casini", "Castagnoli", "Castellani", "Castelli", "Castellucci", "Catalano", "Catarzi", "Catelani", "Cavaciocchi", "Cavallaro", "Cavallini", "Cavicchi", "Cavini", "Ceccarelli", "Ceccatelli", "Ceccherelli", "Ceccherini", "Cecchi", "Cecchini", "Cecconi", "Cei", "Cellai", "Celli", "Cellini", "Cencetti", "Ceni", "Cenni", "Cerbai", "Cesari", "Ceseri", "Checcacci", "Checchi", "Checcucci", "Cheli", "Chellini", "Chen", "Cheng", "Cherici", "Cherubini", "Chiaramonti", "Chiarantini", "Chiarelli", "Chiari", "Chiarini", "Chiarugi", "Chiavacci", "Chiesi", "Chimenti", "Chini", "Chirici", "Chiti", "Ciabatti", "Ciampi", "Cianchi", "Cianfanelli", "Cianferoni", "Ciani", "Ciapetti", "Ciappi", "Ciardi", "Ciatti", "Cicali", "Ciccone", "Cinelli", "Cini", "Ciobanu", "Ciolli", "Cioni", "Cipriani", "Cirillo", "Cirri", "Ciucchi", "Ciuffi", "Ciulli", "Ciullini", "Clemente", "Cocchi", "Cognome", "Coli", "Collini", "Colombo", "Colzi", "Comparini", "Conforti", "Consigli", "Conte", "Conti", "Contini", "Coppini", "Coppola", "Corsi", "Corsini", "Corti", "Cortini", "Cosi", "Costa", "Costantini", "Costantino", "Cozzi", "Cresci", "Crescioli", "Cresti", "Crini", "Curradi", "D'Agostino", "D'Alessandro", "D'Amico", "D'Angelo", "Daddi", "Dainelli", "Dallai", "Danti", "Davitti", "De Angelis", "De Luca", "De Marco", "De Rosa", "De Santis", "De Simone", "De Vita", "Degl'Innocenti", "Degli Innocenti", "Dei", "Del Lungo", "Del Re", "Di Marco", "Di Stefano", "Dini", "Diop", "Dobre", "Dolfi", "Donati", "Dondoli", "Dong", "Donnini", "Ducci", "Dumitru", "Ermini", "Esposito", "Evangelisti", "Fabbri", "Fabbrini", "Fabbrizzi", "Fabbroni", "Fabbrucci", "Fabiani", "Facchini", "Faggi", "Fagioli", "Failli", "Faini", "Falciani", "Falcini", "Falcone", "Fallani", "Falorni", "Falsini", "Falugiani", "Fancelli", "Fanelli", "Fanetti", "Fanfani", "Fani", "Fantappie'", "Fantechi", "Fanti", "Fantini", "Fantoni", "Farina", "Fattori", "Favilli", "Fedi", "Fei", "Ferrante", "Ferrara", "Ferrari", "Ferraro", "Ferretti", "Ferri", "Ferrini", "Ferroni", "Fiaschi", "Fibbi", "Fiesoli", "Filippi", "Filippini", "Fini", "Fioravanti", "Fiore", "Fiorentini", "Fiorini", "Fissi", "Focardi", "Foggi", "Fontana", "Fontanelli", "Fontani", "Forconi", "Formigli", "Forte", "Forti", "Fortini", "Fossati", "Fossi", "Francalanci", "Franceschi", "Franceschini", "Franchi", "Franchini", "Franci", "Francini", "Francioni", "Franco", "Frassineti", "Frati", "Fratini", "Frilli", "Frizzi", "Frosali", "Frosini", "Frullini", "Fusco", "Fusi", "Gabbrielli", "Gabellini", "Gagliardi", "Galanti", "Galardi", "Galeotti", "Galletti", "Galli", "Gallo", "Gallori", "Gambacciani", "Gargani", "Garofalo", "Garuglieri", "Gashi", "Gasperini", "Gatti", "Gelli", "Gensini", "Gentile", "Gentili", "Geri", "Gerini", "Gheri", "Ghini", "Giachetti", "Giachi", "Giacomelli", "Gianassi", "Giani", "Giannelli", "Giannetti", "Gianni", "Giannini", "Giannoni", "Giannotti", "Giannozzi", "Gigli", "Giordano", "Giorgetti", "Giorgi", "Giovacchini", "Giovannelli", "Giovannetti", "Giovannini", "Giovannoni", "Giuliani", "Giunti", "Giuntini", "Giusti", "Gonnelli", "Goretti", "Gori", "Gradi", "Gramigni", "Grassi", "Grasso", "Graziani", "Grazzini", "Greco", "Grifoni", "Grillo", "Grimaldi", "Grossi", "Gualtieri", "Guarducci", "Guarino", "Guarnieri", "Guasti", "Guerra", "Guerri", "Guerrini", "Guidi", "Guidotti", "He", "Hoxha", "Hu", "Huang", "Iandelli", "Ignesti", "Innocenti", "Jin", "La Rosa", "Lai", "Landi", "Landini", "Lanini", "Lapi", "Lapini", "Lari", "Lascialfari", "Lastrucci", "Latini", "Lazzeri", "Lazzerini", "Lelli", "Lenzi", "Leonardi", "Leoncini", "Leone", "Leoni", "Lepri", "Li", "Liao", "Lin", "Linari", "Lippi", "Lisi", "Livi", "Lombardi", "Lombardini", "Lombardo", "Longo", "Lopez", "Lorenzi", "Lorenzini", "Lorini", "Lotti", "Lu", "Lucchesi", "Lucherini", "Lunghi", "Lupi", "Madiai", "Maestrini", "Maffei", "Maggi", "Maggini", "Magherini", "Magini", "Magnani", "Magnelli", "Magni", "Magnolfi", "Magrini", "Malavolti", "Malevolti", "Manca", "Mancini", "Manetti", "Manfredi", "Mangani", "Mannelli", "Manni", "Mannini", "Mannucci", "Manuelli", "Manzini", "Marcelli", "Marchese", "Marchetti", "Marchi", "Marchiani", "Marchionni", "Marconi", "Marcucci", "Margheri", "Mari", "Mariani", "Marilli", "Marinai", "Marinari", "Marinelli", "Marini", "Marino", "Mariotti", "Marsili", "Martelli", "Martinelli", "Martini", "Martino", "Marzi", "Masi", "Masini", "Masoni", "Massai", "Materassi", "Mattei", "Matteini", "Matteucci", "Matteuzzi", "Mattioli", "Mattolini", "Matucci", "Mauro", "Mazzanti", "Mazzei", "Mazzetti", "Mazzi", "Mazzini", "Mazzocchi", "Mazzoli", "Mazzoni", "Mazzuoli", "Meacci", "Mecocci", "Meini", "Melani", "Mele", "Meli", "Mengoni", "Menichetti", "Meoni", "Merlini", "Messeri", "Messina", "Meucci", "Miccinesi", "Miceli", "Micheli", "Michelini", "Michelozzi", "Migliori", "Migliorini", "Milani", "Miniati", "Misuri", "Monaco", "Montagnani", "Montagni", "Montanari", "Montelatici", "Monti", "Montigiani", "Montini", "Morandi", "Morandini", "Morelli", "Moretti", "Morganti", "Mori", "Morini", "Moroni", "Morozzi", "Mugnai", "Mugnaini", "Mustafa", "Naldi", "Naldini", "Nannelli", "Nanni", "Nannini", "Nannucci", "Nardi", "Nardini", "Nardoni", "Natali", "Ndiaye", "Nencetti", "Nencini", "Nencioni", "Neri", "Nesi", "Nesti", "Niccolai", "Niccoli", "Niccolini", "Nigi", "Nistri", "Nocentini", "Noferini", "Novelli", "Nucci", "Nuti", "Nutini", "Oliva", "Olivieri", "Olmi", "Orlandi", "Orlandini", "Orlando", "Orsini", "Ortolani", "Ottanelli", "Pacciani", "Pace", "Paci", "Pacini", "Pagani", "Pagano", "Paggetti", "Pagliai", "Pagni", "Pagnini", "Paladini", "Palagi", "Palchetti", "Palloni", "Palmieri", "Palumbo", "Pampaloni", "Pancani", "Pandolfi", "Pandolfini", "Panerai", "Panichi", "Paoletti", "Paoli", "Paolini", "Papi", "Papini", "Papucci", "Parenti", "Parigi", "Parisi", "Parri", "Parrini", "Pasquini", "Passeri", "Pecchioli", "Pecorini", "Pellegrini", "Pepi", "Perini", "Perrone", "Peruzzi", "Pesci", "Pestelli", "Petri", "Petrini", "Petrucci", "Pettini", "Pezzati", "Pezzatini", "Piani", "Piazza", "Piazzesi", "Piazzini", "Piccardi", "Picchi", "Piccini", "Piccioli", "Pieraccini", "Pieraccioni", "Pieralli", "Pierattini", "Pieri", "Pierini", "Pieroni", "Pietrini", "Pini", "Pinna", "Pinto", "Pinzani", "Pinzauti", "Piras", "Pisani", "Pistolesi", "Poggesi", "Poggi", "Poggiali", "Poggiolini", "Poli", "Pollastri", "Porciani", "Pozzi", "Pratellesi", "Pratesi", "Prosperi", "Pruneti", "Pucci", "Puccini", "Puccioni", "Pugi", "Pugliese", "Puliti", "Querci", "Quercioli", "Raddi", "Radu", "Raffaelli", "Ragazzini", "Ranfagni", "Ranieri", "Rastrelli", "Raugei", "Raveggi", "Renai", "Renzi", "Rettori", "Ricci", "Ricciardi", "Ridi", "Ridolfi", "Rigacci", "Righi", "Righini", "Rinaldi", "Risaliti", "Ristori", "Rizzo", "Rocchi", "Rocchini", "Rogai", "Romagnoli", "Romanelli", "Romani", "Romano", "Romei", "Romeo", "Romiti", "Romoli", "Romolini", "Rontini", "Rosati", "Roselli", "Rosi", "Rossetti", "Rossi", "Rossini", "Rovai", "Ruggeri", "Ruggiero", "Russo", "Sabatini", "Saccardi", "Sacchetti", "Sacchi", "Sacco", "Salerno", "Salimbeni", "Salucci", "Salvadori", "Salvestrini", "Salvi", "Salvini", "Sanesi", "Sani", "Sanna", "Santi", "Santini", "Santoni", "Santoro", "Santucci", "Sardi", "Sarri", "Sarti", "Sassi", "Sbolci", "Scali", "Scarpelli", "Scarselli", "Scopetani", "Secci", "Selvi", "Senatori", "Senesi", "Serafini", "Sereni", "Serra", "Sestini", "Sguanci", "Sieni", "Signorini", "Silvestri", "Simoncini", "Simonetti", "Simoni", "Singh", "Sodi", "Soldi", "Somigli", "Sorbi", "Sorelli", "Sorrentino", "Sottili", "Spina", "Spinelli", "Staccioli", "Staderini", "Stefanelli", "Stefani", "Stefanini", "Stella", "Susini", "Tacchi", "Tacconi", "Taddei", "Tagliaferri", "Tamburini", "Tanganelli", "Tani", "Tanini", "Tapinassi", "Tarchi", "Tarchiani", "Targioni", "Tassi", "Tassini", "Tempesti", "Terzani", "Tesi", "Testa", "Testi", "Tilli", "Tinti", "Tirinnanzi", "Toccafondi", "Tofanari", "Tofani", "Tognaccini", "Tonelli", "Tonini", "Torelli", "Torrini", "Tosi", "Toti", "Tozzi", "Trambusti", "Trapani", "Tucci", "Turchi", "Ugolini", "Ulivi", "Valente", "Valenti", "Valentini", "Vangelisti", "Vanni", "Vannini", "Vannoni", "Vannozzi", "Vannucchi", "Vannucci", "Ventura", "Venturi", "Venturini", "Vestri", "Vettori", "Vichi", "Viciani", "Vieri", "Vigiani", "Vignoli", "Vignolini", "Vignozzi", "Villani", "Vinci", "Visani", "Vitale", "Vitali", "Viti", "Viviani", "Vivoli", "Volpe", "Volpi", "Wang", "Wu", "Xu", "Yang", "Ye", "Zagli", "Zani", "Zanieri", "Zanobini", "Zecchi", "Zetti", "Zhang", "Zheng", "Zhou", "Zhu", "Zingoni", "Zini", "Zoppi"],
2321 // http://www.voornamelijk.nl/meest-voorkomende-achternamen-in-nederland-en-amsterdam/
2322 "nl":["Albers", "Alblas", "Appelman", "Baars", "Baas", "Bakker", "Blank", "Bleeker", "Blok", "Blom", "Boer", "Boers", "Boldewijn", "Boon", "Boot", "Bos", "Bosch", "Bosma", "Bosman", "Bouma", "Bouman", "Bouwman", "Brands", "Brouwer", "Burger", "Buijs", "Buitenhuis", "Ceder", "Cohen", "Dekker", "Dekkers", "Dijkman", "Dijkstra", "Driessen", "Drost", "Engel", "Evers", "Faber", "Franke", "Gerritsen", "Goedhart", "Goossens", "Groen", "Groenenberg", "Groot", "Haan", "Hart", "Heemskerk", "Hendriks", "Hermans", "Hoekstra", "Hofman", "Hopman", "Huisman", "Jacobs", "Jansen", "Janssen", "Jonker", "Jaspers", "Keijzer", "Klaassen", "Klein", "Koek", "Koenders", "Kok", "Kool", "Koopman", "Koopmans", "Koning", "Koster", "Kramer", "Kroon", "Kuijpers", "Kuiper", "Kuipers", "Kurt", "Koster", "Kwakman", "Los", "Lubbers", "Maas", "Markus", "Martens", "Meijer", "Mol", "Molenaar", "Mulder", "Nieuwenhuis", "Peeters", "Peters", "Pengel", "Pieters", "Pool", "Post", "Postma", "Prins", "Pronk", "Reijnders", "Rietveld", "Roest", "Roos", "Sanders", "Schaap", "Scheffer", "Schenk", "Schilder", "Schipper", "Schmidt", "Scholten", "Schouten", "Schut", "Schutte", "Schuurman", "Simons", "Smeets", "Smit", "Smits", "Snel", "Swinkels", "Tas", "Terpstra", "Timmermans", "Tol", "Tromp", "Troost", "Valk", "Veenstra", "Veldkamp", "Verbeek", "Verheul", "Verhoeven", "Vermeer", "Vermeulen", "Verweij", "Vink", "Visser", "Voorn", "Vos", "Wagenaar", "Wiersema", "Willems", "Willemsen", "Witteveen", "Wolff", "Wolters", "Zijlstra", "Zwart", "de Beer", "de Boer", "de Bruijn", "de Bruin", "de Graaf", "de Groot", "de Haan", "de Haas", "de Jager", "de Jong", "de Jonge", "de Koning", "de Lange", "de Leeuw", "de Ridder", "de Rooij", "de Ruiter", "de Vos", "de Vries", "de Waal", "de Wit", "de Zwart", "van Beek", "van Boven", "van Dam", "van Dijk", "van Dongen", "van Doorn", "van Egmond", "van Eijk", "van Es", "van Gelder", "van Gelderen", "van Houten", "van Hulst", "van Kempen", "van Kesteren", "van Leeuwen", "van Loon", "van Mill", "van Noord", "van Ommen", "van Ommeren", "van Oosten", "van Oostveen", "van Rijn", "van Schaik", "van Veen", "van Vliet", "van Wijk", "van Wijngaarden", "van den Poel", "van de Pol", "van den Ploeg", "van de Ven", "van den Berg", "van den Bosch", "van den Brink", "van den Broek", "van den Heuvel", "van der Heijden", "van der Horst", "van der Hulst", "van der Kroon", "van der Laan", "van der Linden", "van der Meer", "van der Meij", "van der Meulen", "van der Molen", "van der Sluis", "van der Spek", "van der Veen", "van der Velde", "van der Velden", "van der Vliet", "van der Wal"]
2325 // Data taken from https://github.com/umpirsky/country-list/blob/master/data/en_US/country.json
2326 countries
: [{"name":"Afghanistan","abbreviation":"AF"},{"name":"Ã…land Islands","abbreviation":"AX"},{"name":"Albania","abbreviation":"AL"},{"name":"Algeria","abbreviation":"DZ"},{"name":"American Samoa","abbreviation":"AS"},{"name":"Andorra","abbreviation":"AD"},{"name":"Angola","abbreviation":"AO"},{"name":"Anguilla","abbreviation":"AI"},{"name":"Antarctica","abbreviation":"AQ"},{"name":"Antigua & Barbuda","abbreviation":"AG"},{"name":"Argentina","abbreviation":"AR"},{"name":"Armenia","abbreviation":"AM"},{"name":"Aruba","abbreviation":"AW"},{"name":"Ascension Island","abbreviation":"AC"},{"name":"Australia","abbreviation":"AU"},{"name":"Austria","abbreviation":"AT"},{"name":"Azerbaijan","abbreviation":"AZ"},{"name":"Bahamas","abbreviation":"BS"},{"name":"Bahrain","abbreviation":"BH"},{"name":"Bangladesh","abbreviation":"BD"},{"name":"Barbados","abbreviation":"BB"},{"name":"Belarus","abbreviation":"BY"},{"name":"Belgium","abbreviation":"BE"},{"name":"Belize","abbreviation":"BZ"},{"name":"Benin","abbreviation":"BJ"},{"name":"Bermuda","abbreviation":"BM"},{"name":"Bhutan","abbreviation":"BT"},{"name":"Bolivia","abbreviation":"BO"},{"name":"Bosnia & Herzegovina","abbreviation":"BA"},{"name":"Botswana","abbreviation":"BW"},{"name":"Brazil","abbreviation":"BR"},{"name":"British Indian Ocean Territory","abbreviation":"IO"},{"name":"British Virgin Islands","abbreviation":"VG"},{"name":"Brunei","abbreviation":"BN"},{"name":"Bulgaria","abbreviation":"BG"},{"name":"Burkina Faso","abbreviation":"BF"},{"name":"Burundi","abbreviation":"BI"},{"name":"Cambodia","abbreviation":"KH"},{"name":"Cameroon","abbreviation":"CM"},{"name":"Canada","abbreviation":"CA"},{"name":"Canary Islands","abbreviation":"IC"},{"name":"Cape Verde","abbreviation":"CV"},{"name":"Caribbean Netherlands","abbreviation":"BQ"},{"name":"Cayman Islands","abbreviation":"KY"},{"name":"Central African Republic","abbreviation":"CF"},{"name":"Ceuta & Melilla","abbreviation":"EA"},{"name":"Chad","abbreviation":"TD"},{"name":"Chile","abbreviation":"CL"},{"name":"China","abbreviation":"CN"},{"name":"Christmas Island","abbreviation":"CX"},{"name":"Cocos (Keeling) Islands","abbreviation":"CC"},{"name":"Colombia","abbreviation":"CO"},{"name":"Comoros","abbreviation":"KM"},{"name":"Congo - Brazzaville","abbreviation":"CG"},{"name":"Congo - Kinshasa","abbreviation":"CD"},{"name":"Cook Islands","abbreviation":"CK"},{"name":"Costa Rica","abbreviation":"CR"},{"name":"Côte d'Ivoire","abbreviation":"CI"},{"name":"Croatia","abbreviation":"HR"},{"name":"Cuba","abbreviation":"CU"},{"name":"Curaçao","abbreviation":"CW"},{"name":"Cyprus","abbreviation":"CY"},{"name":"Czech Republic","abbreviation":"CZ"},{"name":"Denmark","abbreviation":"DK"},{"name":"Diego Garcia","abbreviation":"DG"},{"name":"Djibouti","abbreviation":"DJ"},{"name":"Dominica","abbreviation":"DM"},{"name":"Dominican Republic","abbreviation":"DO"},{"name":"Ecuador","abbreviation":"EC"},{"name":"Egypt","abbreviation":"EG"},{"name":"El Salvador","abbreviation":"SV"},{"name":"Equatorial Guinea","abbreviation":"GQ"},{"name":"Eritrea","abbreviation":"ER"},{"name":"Estonia","abbreviation":"EE"},{"name":"Ethiopia","abbreviation":"ET"},{"name":"Falkland Islands","abbreviation":"FK"},{"name":"Faroe Islands","abbreviation":"FO"},{"name":"Fiji","abbreviation":"FJ"},{"name":"Finland","abbreviation":"FI"},{"name":"France","abbreviation":"FR"},{"name":"French Guiana","abbreviation":"GF"},{"name":"French Polynesia","abbreviation":"PF"},{"name":"French Southern Territories","abbreviation":"TF"},{"name":"Gabon","abbreviation":"GA"},{"name":"Gambia","abbreviation":"GM"},{"name":"Georgia","abbreviation":"GE"},{"name":"Germany","abbreviation":"DE"},{"name":"Ghana","abbreviation":"GH"},{"name":"Gibraltar","abbreviation":"GI"},{"name":"Greece","abbreviation":"GR"},{"name":"Greenland","abbreviation":"GL"},{"name":"Grenada","abbreviation":"GD"},{"name":"Guadeloupe","abbreviation":"GP"},{"name":"Guam","abbreviation":"GU"},{"name":"Guatemala","abbreviation":"GT"},{"name":"Guernsey","abbreviation":"GG"},{"name":"Guinea","abbreviation":"GN"},{"name":"Guinea-Bissau","abbreviation":"GW"},{"name":"Guyana","abbreviation":"GY"},{"name":"Haiti","abbreviation":"HT"},{"name":"Honduras","abbreviation":"HN"},{"name":"Hong Kong SAR China","abbreviation":"HK"},{"name":"Hungary","abbreviation":"HU"},{"name":"Iceland","abbreviation":"IS"},{"name":"India","abbreviation":"IN"},{"name":"Indonesia","abbreviation":"ID"},{"name":"Iran","abbreviation":"IR"},{"name":"Iraq","abbreviation":"IQ"},{"name":"Ireland","abbreviation":"IE"},{"name":"Isle of Man","abbreviation":"IM"},{"name":"Israel","abbreviation":"IL"},{"name":"Italy","abbreviation":"IT"},{"name":"Jamaica","abbreviation":"JM"},{"name":"Japan","abbreviation":"JP"},{"name":"Jersey","abbreviation":"JE"},{"name":"Jordan","abbreviation":"JO"},{"name":"Kazakhstan","abbreviation":"KZ"},{"name":"Kenya","abbreviation":"KE"},{"name":"Kiribati","abbreviation":"KI"},{"name":"Kosovo","abbreviation":"XK"},{"name":"Kuwait","abbreviation":"KW"},{"name":"Kyrgyzstan","abbreviation":"KG"},{"name":"Laos","abbreviation":"LA"},{"name":"Latvia","abbreviation":"LV"},{"name":"Lebanon","abbreviation":"LB"},{"name":"Lesotho","abbreviation":"LS"},{"name":"Liberia","abbreviation":"LR"},{"name":"Libya","abbreviation":"LY"},{"name":"Liechtenstein","abbreviation":"LI"},{"name":"Lithuania","abbreviation":"LT"},{"name":"Luxembourg","abbreviation":"LU"},{"name":"Macau SAR China","abbreviation":"MO"},{"name":"Macedonia","abbreviation":"MK"},{"name":"Madagascar","abbreviation":"MG"},{"name":"Malawi","abbreviation":"MW"},{"name":"Malaysia","abbreviation":"MY"},{"name":"Maldives","abbreviation":"MV"},{"name":"Mali","abbreviation":"ML"},{"name":"Malta","abbreviation":"MT"},{"name":"Marshall Islands","abbreviation":"MH"},{"name":"Martinique","abbreviation":"MQ"},{"name":"Mauritania","abbreviation":"MR"},{"name":"Mauritius","abbreviation":"MU"},{"name":"Mayotte","abbreviation":"YT"},{"name":"Mexico","abbreviation":"MX"},{"name":"Micronesia","abbreviation":"FM"},{"name":"Moldova","abbreviation":"MD"},{"name":"Monaco","abbreviation":"MC"},{"name":"Mongolia","abbreviation":"MN"},{"name":"Montenegro","abbreviation":"ME"},{"name":"Montserrat","abbreviation":"MS"},{"name":"Morocco","abbreviation":"MA"},{"name":"Mozambique","abbreviation":"MZ"},{"name":"Myanmar (Burma)","abbreviation":"MM"},{"name":"Namibia","abbreviation":"NA"},{"name":"Nauru","abbreviation":"NR"},{"name":"Nepal","abbreviation":"NP"},{"name":"Netherlands","abbreviation":"NL"},{"name":"New Caledonia","abbreviation":"NC"},{"name":"New Zealand","abbreviation":"NZ"},{"name":"Nicaragua","abbreviation":"NI"},{"name":"Niger","abbreviation":"NE"},{"name":"Nigeria","abbreviation":"NG"},{"name":"Niue","abbreviation":"NU"},{"name":"Norfolk Island","abbreviation":"NF"},{"name":"North Korea","abbreviation":"KP"},{"name":"Northern Mariana Islands","abbreviation":"MP"},{"name":"Norway","abbreviation":"NO"},{"name":"Oman","abbreviation":"OM"},{"name":"Pakistan","abbreviation":"PK"},{"name":"Palau","abbreviation":"PW"},{"name":"Palestinian Territories","abbreviation":"PS"},{"name":"Panama","abbreviation":"PA"},{"name":"Papua New Guinea","abbreviation":"PG"},{"name":"Paraguay","abbreviation":"PY"},{"name":"Peru","abbreviation":"PE"},{"name":"Philippines","abbreviation":"PH"},{"name":"Pitcairn Islands","abbreviation":"PN"},{"name":"Poland","abbreviation":"PL"},{"name":"Portugal","abbreviation":"PT"},{"name":"Puerto Rico","abbreviation":"PR"},{"name":"Qatar","abbreviation":"QA"},{"name":"Réunion","abbreviation":"RE"},{"name":"Romania","abbreviation":"RO"},{"name":"Russia","abbreviation":"RU"},{"name":"Rwanda","abbreviation":"RW"},{"name":"Samoa","abbreviation":"WS"},{"name":"San Marino","abbreviation":"SM"},{"name":"São Tomé and PrÃncipe","abbreviation":"ST"},{"name":"Saudi Arabia","abbreviation":"SA"},{"name":"Senegal","abbreviation":"SN"},{"name":"Serbia","abbreviation":"RS"},{"name":"Seychelles","abbreviation":"SC"},{"name":"Sierra Leone","abbreviation":"SL"},{"name":"Singapore","abbreviation":"SG"},{"name":"Sint Maarten","abbreviation":"SX"},{"name":"Slovakia","abbreviation":"SK"},{"name":"Slovenia","abbreviation":"SI"},{"name":"Solomon Islands","abbreviation":"SB"},{"name":"Somalia","abbreviation":"SO"},{"name":"South Africa","abbreviation":"ZA"},{"name":"South Georgia & South Sandwich Islands","abbreviation":"GS"},{"name":"South Korea","abbreviation":"KR"},{"name":"South Sudan","abbreviation":"SS"},{"name":"Spain","abbreviation":"ES"},{"name":"Sri Lanka","abbreviation":"LK"},{"name":"St. Barthélemy","abbreviation":"BL"},{"name":"St. Helena","abbreviation":"SH"},{"name":"St. Kitts & Nevis","abbreviation":"KN"},{"name":"St. Lucia","abbreviation":"LC"},{"name":"St. Martin","abbreviation":"MF"},{"name":"St. Pierre & Miquelon","abbreviation":"PM"},{"name":"St. Vincent & Grenadines","abbreviation":"VC"},{"name":"Sudan","abbreviation":"SD"},{"name":"Suriname","abbreviation":"SR"},{"name":"Svalbard & Jan Mayen","abbreviation":"SJ"},{"name":"Swaziland","abbreviation":"SZ"},{"name":"Sweden","abbreviation":"SE"},{"name":"Switzerland","abbreviation":"CH"},{"name":"Syria","abbreviation":"SY"},{"name":"Taiwan","abbreviation":"TW"},{"name":"Tajikistan","abbreviation":"TJ"},{"name":"Tanzania","abbreviation":"TZ"},{"name":"Thailand","abbreviation":"TH"},{"name":"Timor-Leste","abbreviation":"TL"},{"name":"Togo","abbreviation":"TG"},{"name":"Tokelau","abbreviation":"TK"},{"name":"Tonga","abbreviation":"TO"},{"name":"Trinidad & Tobago","abbreviation":"TT"},{"name":"Tristan da Cunha","abbreviation":"TA"},{"name":"Tunisia","abbreviation":"TN"},{"name":"Turkey","abbreviation":"TR"},{"name":"Turkmenistan","abbreviation":"TM"},{"name":"Turks & Caicos Islands","abbreviation":"TC"},{"name":"Tuvalu","abbreviation":"TV"},{"name":"U.S. Outlying Islands","abbreviation":"UM"},{"name":"U.S. Virgin Islands","abbreviation":"VI"},{"name":"Uganda","abbreviation":"UG"},{"name":"Ukraine","abbreviation":"UA"},{"name":"United Arab Emirates","abbreviation":"AE"},{"name":"United Kingdom","abbreviation":"GB"},{"name":"United States","abbreviation":"US"},{"name":"Uruguay","abbreviation":"UY"},{"name":"Uzbekistan","abbreviation":"UZ"},{"name":"Vanuatu","abbreviation":"VU"},{"name":"Vatican City","abbreviation":"VA"},{"name":"Venezuela","abbreviation":"VE"},{"name":"Vietnam","abbreviation":"VN"},{"name":"Wallis & Futuna","abbreviation":"WF"},{"name":"Western Sahara","abbreviation":"EH"},{"name":"Yemen","abbreviation":"YE"},{"name":"Zambia","abbreviation":"ZM"},{"name":"Zimbabwe","abbreviation":"ZW"}],
2329 // Data taken from http://www.downloadexcelfiles.com/gb_en/download-excel-file-list-counties-uk
2331 {name
: 'Bath and North East Somerset'},
2332 {name
: 'Aberdeenshire'},
2336 {name
: 'Blackburn with Darwen'},
2337 {name
: 'Blackpool'},
2338 {name
: 'Bournemouth'},
2339 {name
: 'Bracknell Forest'},
2340 {name
: 'Brighton & Hove'},
2342 {name
: 'Buckinghamshire'},
2343 {name
: 'Cambridgeshire'},
2344 {name
: 'Carmarthenshire'},
2345 {name
: 'Central Bedfordshire'},
2346 {name
: 'Ceredigion'},
2347 {name
: 'Cheshire East'},
2348 {name
: 'Cheshire West and Chester'},
2349 {name
: 'Clackmannanshire'},
2352 {name
: 'County Antrim'},
2353 {name
: 'County Armagh'},
2354 {name
: 'County Down'},
2355 {name
: 'County Durham'},
2356 {name
: 'County Fermanagh'},
2357 {name
: 'County Londonderry'},
2358 {name
: 'County Tyrone'},
2360 {name
: 'Darlington'},
2361 {name
: 'Denbighshire'},
2363 {name
: 'Derbyshire'},
2366 {name
: 'Dumfries and Galloway'},
2368 {name
: 'East Lothian'},
2369 {name
: 'East Riding of Yorkshire'},
2370 {name
: 'East Sussex'},
2371 {name
: 'Edinburgh?'},
2375 {name
: 'Flintshire'},
2376 {name
: 'Gloucestershire'},
2377 {name
: 'Greater London'},
2378 {name
: 'Greater Manchester'},
2382 {name
: 'Hampshire'},
2383 {name
: 'Hartlepool'},
2384 {name
: 'Herefordshire'},
2385 {name
: 'Hertfordshire'},
2386 {name
: 'Highlands'},
2388 {name
: 'Isle of Wight'},
2389 {name
: 'Isles of Scilly'},
2391 {name
: 'Lancashire'},
2392 {name
: 'Leicester'},
2393 {name
: 'Leicestershire'},
2394 {name
: 'Lincolnshire'},
2398 {name
: 'Merseyside'},
2399 {name
: 'Mid Glamorgan'},
2400 {name
: 'Middlesbrough'},
2401 {name
: 'Milton Keynes'},
2402 {name
: 'Monmouthshire'},
2405 {name
: 'North East Lincolnshire'},
2406 {name
: 'North Lincolnshire'},
2407 {name
: 'North Somerset'},
2408 {name
: 'North Yorkshire'},
2409 {name
: 'Northamptonshire'},
2410 {name
: 'Northumberland'},
2411 {name
: 'Nottingham'},
2412 {name
: 'Nottinghamshire'},
2413 {name
: 'Oxfordshire'},
2414 {name
: 'Pembrokeshire'},
2415 {name
: 'Perth and Kinross'},
2416 {name
: 'Peterborough'},
2419 {name
: 'Portsmouth'},
2422 {name
: 'Redcar and Cleveland'},
2424 {name
: 'Scottish Borders'},
2425 {name
: 'Shropshire'},
2428 {name
: 'South Glamorgan'},
2429 {name
: 'South Gloucestershire'},
2430 {name
: 'South Yorkshire'},
2431 {name
: 'Southampton'},
2432 {name
: 'Southend-on-Sea'},
2433 {name
: 'Staffordshire'},
2434 {name
: 'Stirlingshire'},
2435 {name
: 'Stockton-on-Tees'},
2436 {name
: 'Stoke-on-Trent'},
2437 {name
: 'Strathclyde'},
2441 {name
: 'Telford and Wrekin'},
2444 {name
: 'Tyne and Wear'},
2445 {name
: 'Warrington'},
2446 {name
: 'Warwickshire'},
2447 {name
: 'West Berkshire'},
2448 {name
: 'West Glamorgan'},
2449 {name
: 'West Lothian'},
2450 {name
: 'West Midlands'},
2451 {name
: 'West Sussex'},
2452 {name
: 'West Yorkshire'},
2453 {name
: 'Western Isles'},
2454 {name
: 'Wiltshire'},
2455 {name
: 'Windsor and Maidenhead'},
2456 {name
: 'Wokingham'},
2457 {name
: 'Worcestershire'},
2463 {name
: 'Alberta', abbreviation
: 'AB'},
2464 {name
: 'British Columbia', abbreviation
: 'BC'},
2465 {name
: 'Manitoba', abbreviation
: 'MB'},
2466 {name
: 'New Brunswick', abbreviation
: 'NB'},
2467 {name
: 'Newfoundland and Labrador', abbreviation
: 'NL'},
2468 {name
: 'Nova Scotia', abbreviation
: 'NS'},
2469 {name
: 'Ontario', abbreviation
: 'ON'},
2470 {name
: 'Prince Edward Island', abbreviation
: 'PE'},
2471 {name
: 'Quebec', abbreviation
: 'QC'},
2472 {name
: 'Saskatchewan', abbreviation
: 'SK'},
2474 // The case could be made that the following are not actually provinces
2475 // since they are technically considered "territories" however they all
2476 // look the same on an envelope!
2477 {name
: 'Northwest Territories', abbreviation
: 'NT'},
2478 {name
: 'Nunavut', abbreviation
: 'NU'},
2479 {name
: 'Yukon', abbreviation
: 'YT'}
2482 { name
: "Agrigento", abbreviation
: "AG", code
: 84 },
2483 { name
: "Alessandria", abbreviation
: "AL", code
: 6 },
2484 { name
: "Ancona", abbreviation
: "AN", code
: 42 },
2485 { name
: "Aosta", abbreviation
: "AO", code
: 7 },
2486 { name
: "L'Aquila", abbreviation
: "AQ", code
: 66 },
2487 { name
: "Arezzo", abbreviation
: "AR", code
: 51 },
2488 { name
: "Ascoli-Piceno", abbreviation
: "AP", code
: 44 },
2489 { name
: "Asti", abbreviation
: "AT", code
: 5 },
2490 { name
: "Avellino", abbreviation
: "AV", code
: 64 },
2491 { name
: "Bari", abbreviation
: "BA", code
: 72 },
2492 { name
: "Barletta-Andria-Trani", abbreviation
: "BT", code
: 72 },
2493 { name
: "Belluno", abbreviation
: "BL", code
: 25 },
2494 { name
: "Benevento", abbreviation
: "BN", code
: 62 },
2495 { name
: "Bergamo", abbreviation
: "BG", code
: 16 },
2496 { name
: "Biella", abbreviation
: "BI", code
: 96 },
2497 { name
: "Bologna", abbreviation
: "BO", code
: 37 },
2498 { name
: "Bolzano", abbreviation
: "BZ", code
: 21 },
2499 { name
: "Brescia", abbreviation
: "BS", code
: 17 },
2500 { name
: "Brindisi", abbreviation
: "BR", code
: 74 },
2501 { name
: "Cagliari", abbreviation
: "CA", code
: 92 },
2502 { name
: "Caltanissetta", abbreviation
: "CL", code
: 85 },
2503 { name
: "Campobasso", abbreviation
: "CB", code
: 70 },
2504 { name
: "Carbonia Iglesias", abbreviation
: "CI", code
: 70 },
2505 { name
: "Caserta", abbreviation
: "CE", code
: 61 },
2506 { name
: "Catania", abbreviation
: "CT", code
: 87 },
2507 { name
: "Catanzaro", abbreviation
: "CZ", code
: 79 },
2508 { name
: "Chieti", abbreviation
: "CH", code
: 69 },
2509 { name
: "Como", abbreviation
: "CO", code
: 13 },
2510 { name
: "Cosenza", abbreviation
: "CS", code
: 78 },
2511 { name
: "Cremona", abbreviation
: "CR", code
: 19 },
2512 { name
: "Crotone", abbreviation
: "KR", code
: 101 },
2513 { name
: "Cuneo", abbreviation
: "CN", code
: 4 },
2514 { name
: "Enna", abbreviation
: "EN", code
: 86 },
2515 { name
: "Fermo", abbreviation
: "FM", code
: 86 },
2516 { name
: "Ferrara", abbreviation
: "FE", code
: 38 },
2517 { name
: "Firenze", abbreviation
: "FI", code
: 48 },
2518 { name
: "Foggia", abbreviation
: "FG", code
: 71 },
2519 { name
: "Forli-Cesena", abbreviation
: "FC", code
: 71 },
2520 { name
: "Frosinone", abbreviation
: "FR", code
: 60 },
2521 { name
: "Genova", abbreviation
: "GE", code
: 10 },
2522 { name
: "Gorizia", abbreviation
: "GO", code
: 31 },
2523 { name
: "Grosseto", abbreviation
: "GR", code
: 53 },
2524 { name
: "Imperia", abbreviation
: "IM", code
: 8 },
2525 { name
: "Isernia", abbreviation
: "IS", code
: 94 },
2526 { name
: "La-Spezia", abbreviation
: "SP", code
: 66 },
2527 { name
: "Latina", abbreviation
: "LT", code
: 59 },
2528 { name
: "Lecce", abbreviation
: "LE", code
: 75 },
2529 { name
: "Lecco", abbreviation
: "LC", code
: 97 },
2530 { name
: "Livorno", abbreviation
: "LI", code
: 49 },
2531 { name
: "Lodi", abbreviation
: "LO", code
: 98 },
2532 { name
: "Lucca", abbreviation
: "LU", code
: 46 },
2533 { name
: "Macerata", abbreviation
: "MC", code
: 43 },
2534 { name
: "Mantova", abbreviation
: "MN", code
: 20 },
2535 { name
: "Massa-Carrara", abbreviation
: "MS", code
: 45 },
2536 { name
: "Matera", abbreviation
: "MT", code
: 77 },
2537 { name
: "Medio Campidano", abbreviation
: "VS", code
: 77 },
2538 { name
: "Messina", abbreviation
: "ME", code
: 83 },
2539 { name
: "Milano", abbreviation
: "MI", code
: 15 },
2540 { name
: "Modena", abbreviation
: "MO", code
: 36 },
2541 { name
: "Monza-Brianza", abbreviation
: "MB", code
: 36 },
2542 { name
: "Napoli", abbreviation
: "NA", code
: 63 },
2543 { name
: "Novara", abbreviation
: "NO", code
: 3 },
2544 { name
: "Nuoro", abbreviation
: "NU", code
: 91 },
2545 { name
: "Ogliastra", abbreviation
: "OG", code
: 91 },
2546 { name
: "Olbia Tempio", abbreviation
: "OT", code
: 91 },
2547 { name
: "Oristano", abbreviation
: "OR", code
: 95 },
2548 { name
: "Padova", abbreviation
: "PD", code
: 28 },
2549 { name
: "Palermo", abbreviation
: "PA", code
: 82 },
2550 { name
: "Parma", abbreviation
: "PR", code
: 34 },
2551 { name
: "Pavia", abbreviation
: "PV", code
: 18 },
2552 { name
: "Perugia", abbreviation
: "PG", code
: 54 },
2553 { name
: "Pesaro-Urbino", abbreviation
: "PU", code
: 41 },
2554 { name
: "Pescara", abbreviation
: "PE", code
: 68 },
2555 { name
: "Piacenza", abbreviation
: "PC", code
: 33 },
2556 { name
: "Pisa", abbreviation
: "PI", code
: 50 },
2557 { name
: "Pistoia", abbreviation
: "PT", code
: 47 },
2558 { name
: "Pordenone", abbreviation
: "PN", code
: 93 },
2559 { name
: "Potenza", abbreviation
: "PZ", code
: 76 },
2560 { name
: "Prato", abbreviation
: "PO", code
: 100 },
2561 { name
: "Ragusa", abbreviation
: "RG", code
: 88 },
2562 { name
: "Ravenna", abbreviation
: "RA", code
: 39 },
2563 { name
: "Reggio-Calabria", abbreviation
: "RC", code
: 35 },
2564 { name
: "Reggio-Emilia", abbreviation
: "RE", code
: 35 },
2565 { name
: "Rieti", abbreviation
: "RI", code
: 57 },
2566 { name
: "Rimini", abbreviation
: "RN", code
: 99 },
2567 { name
: "Roma", abbreviation
: "Roma", code
: 58 },
2568 { name
: "Rovigo", abbreviation
: "RO", code
: 29 },
2569 { name
: "Salerno", abbreviation
: "SA", code
: 65 },
2570 { name
: "Sassari", abbreviation
: "SS", code
: 90 },
2571 { name
: "Savona", abbreviation
: "SV", code
: 9 },
2572 { name
: "Siena", abbreviation
: "SI", code
: 52 },
2573 { name
: "Siracusa", abbreviation
: "SR", code
: 89 },
2574 { name
: "Sondrio", abbreviation
: "SO", code
: 14 },
2575 { name
: "Taranto", abbreviation
: "TA", code
: 73 },
2576 { name
: "Teramo", abbreviation
: "TE", code
: 67 },
2577 { name
: "Terni", abbreviation
: "TR", code
: 55 },
2578 { name
: "Torino", abbreviation
: "TO", code
: 1 },
2579 { name
: "Trapani", abbreviation
: "TP", code
: 81 },
2580 { name
: "Trento", abbreviation
: "TN", code
: 22 },
2581 { name
: "Treviso", abbreviation
: "TV", code
: 26 },
2582 { name
: "Trieste", abbreviation
: "TS", code
: 32 },
2583 { name
: "Udine", abbreviation
: "UD", code
: 30 },
2584 { name
: "Varese", abbreviation
: "VA", code
: 12 },
2585 { name
: "Venezia", abbreviation
: "VE", code
: 27 },
2586 { name
: "Verbania", abbreviation
: "VB", code
: 27 },
2587 { name
: "Vercelli", abbreviation
: "VC", code
: 2 },
2588 { name
: "Verona", abbreviation
: "VR", code
: 23 },
2589 { name
: "Vibo-Valentia", abbreviation
: "VV", code
: 102 },
2590 { name
: "Vicenza", abbreviation
: "VI", code
: 24 },
2591 { name
: "Viterbo", abbreviation
: "VT", code
: 56 }
2595 // from: https://github.com/samsargent/Useful-Autocomplete-Data/blob/master/data/nationalities.json
2603 {name
: 'Antiguans'},
2604 {name
: 'Argentinean'},
2606 {name
: 'Australian'},
2608 {name
: 'Azerbaijani'},
2611 {name
: 'Bangladeshi'},
2612 {name
: 'Barbadian'},
2613 {name
: 'Barbudans'},
2615 {name
: 'Belarusian'},
2619 {name
: 'Bhutanese'},
2622 {name
: 'Brazilian'},
2625 {name
: 'Bulgarian'},
2626 {name
: 'Burkinabe'},
2628 {name
: 'Burundian'},
2629 {name
: 'Cambodian'},
2630 {name
: 'Cameroonian'},
2632 {name
: 'Cape Verdean'},
2633 {name
: 'Central African'},
2637 {name
: 'Colombian'},
2639 {name
: 'Congolese'},
2640 {name
: 'Costa Rican'},
2647 {name
: 'Dominican'},
2649 {name
: 'East Timorese'},
2650 {name
: 'Ecuadorean'},
2653 {name
: 'Equatorial Guinean'},
2656 {name
: 'Ethiopian'},
2667 {name
: 'Grenadian'},
2668 {name
: 'Guatemalan'},
2669 {name
: 'Guinea-Bissauan'},
2673 {name
: 'Herzegovinian'},
2675 {name
: 'Hungarian'},
2676 {name
: 'I-Kiribati'},
2677 {name
: 'Icelander'},
2679 {name
: 'Indonesian'},
2688 {name
: 'Jordanian'},
2689 {name
: 'Kazakhstani'},
2691 {name
: 'Kittian and Nevisian'},
2699 {name
: 'Liechtensteiner'},
2700 {name
: 'Lithuanian'},
2701 {name
: 'Luxembourger'},
2702 {name
: 'Macedonian'},
2705 {name
: 'Malaysian'},
2709 {name
: 'Marshallese'},
2710 {name
: 'Mauritanian'},
2711 {name
: 'Mauritian'},
2713 {name
: 'Micronesian'},
2716 {name
: 'Mongolian'},
2720 {name
: 'Mozambican'},
2724 {name
: 'New Zealander'},
2725 {name
: 'Nicaraguan'},
2728 {name
: 'North Korean'},
2729 {name
: 'Northern Irish'},
2730 {name
: 'Norwegian'},
2732 {name
: 'Pakistani'},
2734 {name
: 'Panamanian'},
2735 {name
: 'Papua New Guinean'},
2736 {name
: 'Paraguayan'},
2739 {name
: 'Portuguese'},
2744 {name
: 'Saint Lucian'},
2745 {name
: 'Salvadoran'},
2747 {name
: 'San Marinese'},
2748 {name
: 'Sao Tomean'},
2751 {name
: 'Senegalese'},
2753 {name
: 'Seychellois'},
2754 {name
: 'Sierra Leonean'},
2755 {name
: 'Singaporean'},
2756 {name
: 'Slovakian'},
2757 {name
: 'Slovenian'},
2758 {name
: 'Solomon Islander'},
2760 {name
: 'South African'},
2761 {name
: 'South Korean'},
2763 {name
: 'Sri Lankan'},
2765 {name
: 'Surinamer'},
2770 {name
: 'Taiwanese'},
2772 {name
: 'Tanzanian'},
2776 {name
: 'Trinidadian or Tobagonian'},
2781 {name
: 'Ukrainian'},
2783 {name
: 'Uzbekistani'},
2784 {name
: 'Venezuela'},
2785 {name
: 'Vietnamese'},
2791 // http://www.loc.gov/standards/iso639-2/php/code_list.php (ISO-639-1 codes)
2979 // From http://data.okfn.org/data/core/language-codes#resource-language-codes-full (IETF language tags)
3485 {name
: 'Alabama', abbreviation
: 'AL'},
3486 {name
: 'Alaska', abbreviation
: 'AK'},
3487 {name
: 'Arizona', abbreviation
: 'AZ'},
3488 {name
: 'Arkansas', abbreviation
: 'AR'},
3489 {name
: 'California', abbreviation
: 'CA'},
3490 {name
: 'Colorado', abbreviation
: 'CO'},
3491 {name
: 'Connecticut', abbreviation
: 'CT'},
3492 {name
: 'Delaware', abbreviation
: 'DE'},
3493 {name
: 'District of Columbia', abbreviation
: 'DC'},
3494 {name
: 'Florida', abbreviation
: 'FL'},
3495 {name
: 'Georgia', abbreviation
: 'GA'},
3496 {name
: 'Hawaii', abbreviation
: 'HI'},
3497 {name
: 'Idaho', abbreviation
: 'ID'},
3498 {name
: 'Illinois', abbreviation
: 'IL'},
3499 {name
: 'Indiana', abbreviation
: 'IN'},
3500 {name
: 'Iowa', abbreviation
: 'IA'},
3501 {name
: 'Kansas', abbreviation
: 'KS'},
3502 {name
: 'Kentucky', abbreviation
: 'KY'},
3503 {name
: 'Louisiana', abbreviation
: 'LA'},
3504 {name
: 'Maine', abbreviation
: 'ME'},
3505 {name
: 'Maryland', abbreviation
: 'MD'},
3506 {name
: 'Massachusetts', abbreviation
: 'MA'},
3507 {name
: 'Michigan', abbreviation
: 'MI'},
3508 {name
: 'Minnesota', abbreviation
: 'MN'},
3509 {name
: 'Mississippi', abbreviation
: 'MS'},
3510 {name
: 'Missouri', abbreviation
: 'MO'},
3511 {name
: 'Montana', abbreviation
: 'MT'},
3512 {name
: 'Nebraska', abbreviation
: 'NE'},
3513 {name
: 'Nevada', abbreviation
: 'NV'},
3514 {name
: 'New Hampshire', abbreviation
: 'NH'},
3515 {name
: 'New Jersey', abbreviation
: 'NJ'},
3516 {name
: 'New Mexico', abbreviation
: 'NM'},
3517 {name
: 'New York', abbreviation
: 'NY'},
3518 {name
: 'North Carolina', abbreviation
: 'NC'},
3519 {name
: 'North Dakota', abbreviation
: 'ND'},
3520 {name
: 'Ohio', abbreviation
: 'OH'},
3521 {name
: 'Oklahoma', abbreviation
: 'OK'},
3522 {name
: 'Oregon', abbreviation
: 'OR'},
3523 {name
: 'Pennsylvania', abbreviation
: 'PA'},
3524 {name
: 'Rhode Island', abbreviation
: 'RI'},
3525 {name
: 'South Carolina', abbreviation
: 'SC'},
3526 {name
: 'South Dakota', abbreviation
: 'SD'},
3527 {name
: 'Tennessee', abbreviation
: 'TN'},
3528 {name
: 'Texas', abbreviation
: 'TX'},
3529 {name
: 'Utah', abbreviation
: 'UT'},
3530 {name
: 'Vermont', abbreviation
: 'VT'},
3531 {name
: 'Virginia', abbreviation
: 'VA'},
3532 {name
: 'Washington', abbreviation
: 'WA'},
3533 {name
: 'West Virginia', abbreviation
: 'WV'},
3534 {name
: 'Wisconsin', abbreviation
: 'WI'},
3535 {name
: 'Wyoming', abbreviation
: 'WY'}
3539 {name
: 'American Samoa', abbreviation
: 'AS'},
3540 {name
: 'Federated States of Micronesia', abbreviation
: 'FM'},
3541 {name
: 'Guam', abbreviation
: 'GU'},
3542 {name
: 'Marshall Islands', abbreviation
: 'MH'},
3543 {name
: 'Northern Mariana Islands', abbreviation
: 'MP'},
3544 {name
: 'Puerto Rico', abbreviation
: 'PR'},
3545 {name
: 'Virgin Islands, U.S.', abbreviation
: 'VI'}
3549 {name
: 'Armed Forces Europe', abbreviation
: 'AE'},
3550 {name
: 'Armed Forces Pacific', abbreviation
: 'AP'},
3551 {name
: 'Armed Forces the Americas', abbreviation
: 'AA'}
3556 { name
: "Valle d'Aosta", abbreviation
: "VDA" },
3557 { name
: "Piemonte", abbreviation
: "PIE" },
3558 { name
: "Lombardia", abbreviation
: "LOM" },
3559 { name
: "Veneto", abbreviation
: "VEN" },
3560 { name
: "Trentino Alto Adige", abbreviation
: "TAA" },
3561 { name
: "Friuli Venezia Giulia", abbreviation
: "FVG" },
3562 { name
: "Liguria", abbreviation
: "LIG" },
3563 { name
: "Emilia Romagna", abbreviation
: "EMR" },
3564 { name
: "Toscana", abbreviation
: "TOS" },
3565 { name
: "Umbria", abbreviation
: "UMB" },
3566 { name
: "Marche", abbreviation
: "MAR" },
3567 { name
: "Abruzzo", abbreviation
: "ABR" },
3568 { name
: "Lazio", abbreviation
: "LAZ" },
3569 { name
: "Campania", abbreviation
: "CAM" },
3570 { name
: "Puglia", abbreviation
: "PUG" },
3571 { name
: "Basilicata", abbreviation
: "BAS" },
3572 { name
: "Molise", abbreviation
: "MOL" },
3573 { name
: "Calabria", abbreviation
: "CAL" },
3574 { name
: "Sicilia", abbreviation
: "SIC" },
3575 { name
: "Sardegna", abbreviation
: "SAR" }
3581 {name
: 'Avenue', abbreviation
: 'Ave'},
3582 {name
: 'Boulevard', abbreviation
: 'Blvd'},
3583 {name
: 'Center', abbreviation
: 'Ctr'},
3584 {name
: 'Circle', abbreviation
: 'Cir'},
3585 {name
: 'Court', abbreviation
: 'Ct'},
3586 {name
: 'Drive', abbreviation
: 'Dr'},
3587 {name
: 'Extension', abbreviation
: 'Ext'},
3588 {name
: 'Glen', abbreviation
: 'Gln'},
3589 {name
: 'Grove', abbreviation
: 'Grv'},
3590 {name
: 'Heights', abbreviation
: 'Hts'},
3591 {name
: 'Highway', abbreviation
: 'Hwy'},
3592 {name
: 'Junction', abbreviation
: 'Jct'},
3593 {name
: 'Key', abbreviation
: 'Key'},
3594 {name
: 'Lane', abbreviation
: 'Ln'},
3595 {name
: 'Loop', abbreviation
: 'Loop'},
3596 {name
: 'Manor', abbreviation
: 'Mnr'},
3597 {name
: 'Mill', abbreviation
: 'Mill'},
3598 {name
: 'Park', abbreviation
: 'Park'},
3599 {name
: 'Parkway', abbreviation
: 'Pkwy'},
3600 {name
: 'Pass', abbreviation
: 'Pass'},
3601 {name
: 'Path', abbreviation
: 'Path'},
3602 {name
: 'Pike', abbreviation
: 'Pike'},
3603 {name
: 'Place', abbreviation
: 'Pl'},
3604 {name
: 'Plaza', abbreviation
: 'Plz'},
3605 {name
: 'Point', abbreviation
: 'Pt'},
3606 {name
: 'Ridge', abbreviation
: 'Rdg'},
3607 {name
: 'River', abbreviation
: 'Riv'},
3608 {name
: 'Road', abbreviation
: 'Rd'},
3609 {name
: 'Square', abbreviation
: 'Sq'},
3610 {name
: 'Street', abbreviation
: 'St'},
3611 {name
: 'Terrace', abbreviation
: 'Ter'},
3612 {name
: 'Trail', abbreviation
: 'Trl'},
3613 {name
: 'Turnpike', abbreviation
: 'Tpke'},
3614 {name
: 'View', abbreviation
: 'Vw'},
3615 {name
: 'Way', abbreviation
: 'Way'}
3618 { name
: 'Accesso', abbreviation
: 'Acc.' },
3619 { name
: 'Alzaia', abbreviation
: 'Alz.' },
3620 { name
: 'Arco', abbreviation
: 'Arco' },
3621 { name
: 'Archivolto', abbreviation
: 'Acv.' },
3622 { name
: 'Arena', abbreviation
: 'Arena' },
3623 { name
: 'Argine', abbreviation
: 'Argine' },
3624 { name
: 'Bacino', abbreviation
: 'Bacino' },
3625 { name
: 'Banchi', abbreviation
: 'Banchi' },
3626 { name
: 'Banchina', abbreviation
: 'Ban.' },
3627 { name
: 'Bastioni', abbreviation
: 'Bas.' },
3628 { name
: 'Belvedere', abbreviation
: 'Belv.' },
3629 { name
: 'Borgata', abbreviation
: 'B.ta' },
3630 { name
: 'Borgo', abbreviation
: 'B.go' },
3631 { name
: 'Calata', abbreviation
: 'Cal.' },
3632 { name
: 'Calle', abbreviation
: 'Calle' },
3633 { name
: 'Campiello', abbreviation
: 'Cam.' },
3634 { name
: 'Campo', abbreviation
: 'Cam.' },
3635 { name
: 'Canale', abbreviation
: 'Can.' },
3636 { name
: 'Carraia', abbreviation
: 'Carr.' },
3637 { name
: 'Cascina', abbreviation
: 'Cascina' },
3638 { name
: 'Case sparse', abbreviation
: 'c.s.' },
3639 { name
: 'Cavalcavia', abbreviation
: 'Cv.' },
3640 { name
: 'Circonvallazione', abbreviation
: 'Cv.' },
3641 { name
: 'Complanare', abbreviation
: 'C.re' },
3642 { name
: 'Contrada', abbreviation
: 'C.da' },
3643 { name
: 'Corso', abbreviation
: 'C.so' },
3644 { name
: 'Corte', abbreviation
: 'C.te' },
3645 { name
: 'Cortile', abbreviation
: 'C.le' },
3646 { name
: 'Diramazione', abbreviation
: 'Dir.' },
3647 { name
: 'Fondaco', abbreviation
: 'F.co' },
3648 { name
: 'Fondamenta', abbreviation
: 'F.ta' },
3649 { name
: 'Fondo', abbreviation
: 'F.do' },
3650 { name
: 'Frazione', abbreviation
: 'Fr.' },
3651 { name
: 'Isola', abbreviation
: 'Is.' },
3652 { name
: 'Largo', abbreviation
: 'L.go' },
3653 { name
: 'Litoranea', abbreviation
: 'Lit.' },
3654 { name
: 'Lungolago', abbreviation
: 'L.go lago' },
3655 { name
: 'Lungo Po', abbreviation
: 'l.go Po' },
3656 { name
: 'Molo', abbreviation
: 'Molo' },
3657 { name
: 'Mura', abbreviation
: 'Mura' },
3658 { name
: 'Passaggio privato', abbreviation
: 'pass. priv.' },
3659 { name
: 'Passeggiata', abbreviation
: 'Pass.' },
3660 { name
: 'Piazza', abbreviation
: 'P.zza' },
3661 { name
: 'Piazzale', abbreviation
: 'P.le' },
3662 { name
: 'Ponte', abbreviation
: 'P.te' },
3663 { name
: 'Portico', abbreviation
: 'P.co' },
3664 { name
: 'Rampa', abbreviation
: 'Rampa' },
3665 { name
: 'Regione', abbreviation
: 'Reg.' },
3666 { name
: 'Rione', abbreviation
: 'R.ne' },
3667 { name
: 'Rio', abbreviation
: 'Rio' },
3668 { name
: 'Ripa', abbreviation
: 'Ripa' },
3669 { name
: 'Riva', abbreviation
: 'Riva' },
3670 { name
: 'Rondò', abbreviation
: 'Rondò' },
3671 { name
: 'Rotonda', abbreviation
: 'Rot.' },
3672 { name
: 'Sagrato', abbreviation
: 'Sagr.' },
3673 { name
: 'Salita', abbreviation
: 'Sal.' },
3674 { name
: 'Scalinata', abbreviation
: 'Scal.' },
3675 { name
: 'Scalone', abbreviation
: 'Scal.' },
3676 { name
: 'Slargo', abbreviation
: 'Sl.' },
3677 { name
: 'Sottoportico', abbreviation
: 'Sott.' },
3678 { name
: 'Strada', abbreviation
: 'Str.' },
3679 { name
: 'Stradale', abbreviation
: 'Str.le' },
3680 { name
: 'Strettoia', abbreviation
: 'Strett.' },
3681 { name
: 'Traversa', abbreviation
: 'Trav.' },
3682 { name
: 'Via', abbreviation
: 'V.' },
3683 { name
: 'Viale', abbreviation
: 'V.le' },
3684 { name
: 'Vicinale', abbreviation
: 'Vic.le' },
3685 { name
: 'Vicolo', abbreviation
: 'Vic.' }
3688 {name
: 'Avenue', abbreviation
: 'Ave'},
3689 {name
: 'Close', abbreviation
: 'Cl'},
3690 {name
: 'Court', abbreviation
: 'Ct'},
3691 {name
: 'Crescent', abbreviation
: 'Cr'},
3692 {name
: 'Drive', abbreviation
: 'Dr'},
3693 {name
: 'Garden', abbreviation
: 'Gdn'},
3694 {name
: 'Gardens', abbreviation
: 'Gdns'},
3695 {name
: 'Green', abbreviation
: 'Gn'},
3696 {name
: 'Grove', abbreviation
: 'Gr'},
3697 {name
: 'Lane', abbreviation
: 'Ln'},
3698 {name
: 'Mount', abbreviation
: 'Mt'},
3699 {name
: 'Place', abbreviation
: 'Pl'},
3700 {name
: 'Park', abbreviation
: 'Pk'},
3701 {name
: 'Ridge', abbreviation
: 'Rdg'},
3702 {name
: 'Road', abbreviation
: 'Rd'},
3703 {name
: 'Square', abbreviation
: 'Sq'},
3704 {name
: 'Street', abbreviation
: 'St'},
3705 {name
: 'Terrace', abbreviation
: 'Ter'},
3706 {name
: 'Valley', abbreviation
: 'Val'}
3711 {name
: 'January', short_name
: 'Jan', numeric
: '01', days
: 31},
3712 // Not messing with leap years...
3713 {name
: 'February', short_name
: 'Feb', numeric
: '02', days
: 28},
3714 {name
: 'March', short_name
: 'Mar', numeric
: '03', days
: 31},
3715 {name
: 'April', short_name
: 'Apr', numeric
: '04', days
: 30},
3716 {name
: 'May', short_name
: 'May', numeric
: '05', days
: 31},
3717 {name
: 'June', short_name
: 'Jun', numeric
: '06', days
: 30},
3718 {name
: 'July', short_name
: 'Jul', numeric
: '07', days
: 31},
3719 {name
: 'August', short_name
: 'Aug', numeric
: '08', days
: 31},
3720 {name
: 'September', short_name
: 'Sep', numeric
: '09', days
: 30},
3721 {name
: 'October', short_name
: 'Oct', numeric
: '10', days
: 31},
3722 {name
: 'November', short_name
: 'Nov', numeric
: '11', days
: 30},
3723 {name
: 'December', short_name
: 'Dec', numeric
: '12', days
: 31}
3726 // http://en.wikipedia.org/wiki/Bank_card_number#Issuer_identification_number_.28IIN.29
3728 {name
: "American Express", short_name
: 'amex', prefix
: '34', length
: 15},
3729 {name
: "Bankcard", short_name
: 'bankcard', prefix
: '5610', length
: 16},
3730 {name
: "China UnionPay", short_name
: 'chinaunion', prefix
: '62', length
: 16},
3731 {name
: "Diners Club Carte Blanche", short_name
: 'dccarte', prefix
: '300', length
: 14},
3732 {name
: "Diners Club enRoute", short_name
: 'dcenroute', prefix
: '2014', length
: 15},
3733 {name
: "Diners Club International", short_name
: 'dcintl', prefix
: '36', length
: 14},
3734 {name
: "Diners Club United States & Canada", short_name
: 'dcusc', prefix
: '54', length
: 16},
3735 {name
: "Discover Card", short_name
: 'discover', prefix
: '6011', length
: 16},
3736 {name
: "InstaPayment", short_name
: 'instapay', prefix
: '637', length
: 16},
3737 {name
: "JCB", short_name
: 'jcb', prefix
: '3528', length
: 16},
3738 {name
: "Laser", short_name
: 'laser', prefix
: '6304', length
: 16},
3739 {name
: "Maestro", short_name
: 'maestro', prefix
: '5018', length
: 16},
3740 {name
: "Mastercard", short_name
: 'mc', prefix
: '51', length
: 16},
3741 {name
: "Solo", short_name
: 'solo', prefix
: '6334', length
: 16},
3742 {name
: "Switch", short_name
: 'switch', prefix
: '4903', length
: 16},
3743 {name
: "Visa", short_name
: 'visa', prefix
: '4', length
: 16},
3744 {name
: "Visa Electron", short_name
: 'electron', prefix
: '4026', length
: 16}
3747 //return all world currency by ISO 4217
3749 {'code' : 'AED', 'name' : 'United Arab Emirates Dirham'},
3750 {'code' : 'AFN', 'name' : 'Afghanistan Afghani'},
3751 {'code' : 'ALL', 'name' : 'Albania Lek'},
3752 {'code' : 'AMD', 'name' : 'Armenia Dram'},
3753 {'code' : 'ANG', 'name' : 'Netherlands Antilles Guilder'},
3754 {'code' : 'AOA', 'name' : 'Angola Kwanza'},
3755 {'code' : 'ARS', 'name' : 'Argentina Peso'},
3756 {'code' : 'AUD', 'name' : 'Australia Dollar'},
3757 {'code' : 'AWG', 'name' : 'Aruba Guilder'},
3758 {'code' : 'AZN', 'name' : 'Azerbaijan New Manat'},
3759 {'code' : 'BAM', 'name' : 'Bosnia and Herzegovina Convertible Marka'},
3760 {'code' : 'BBD', 'name' : 'Barbados Dollar'},
3761 {'code' : 'BDT', 'name' : 'Bangladesh Taka'},
3762 {'code' : 'BGN', 'name' : 'Bulgaria Lev'},
3763 {'code' : 'BHD', 'name' : 'Bahrain Dinar'},
3764 {'code' : 'BIF', 'name' : 'Burundi Franc'},
3765 {'code' : 'BMD', 'name' : 'Bermuda Dollar'},
3766 {'code' : 'BND', 'name' : 'Brunei Darussalam Dollar'},
3767 {'code' : 'BOB', 'name' : 'Bolivia Boliviano'},
3768 {'code' : 'BRL', 'name' : 'Brazil Real'},
3769 {'code' : 'BSD', 'name' : 'Bahamas Dollar'},
3770 {'code' : 'BTN', 'name' : 'Bhutan Ngultrum'},
3771 {'code' : 'BWP', 'name' : 'Botswana Pula'},
3772 {'code' : 'BYR', 'name' : 'Belarus Ruble'},
3773 {'code' : 'BZD', 'name' : 'Belize Dollar'},
3774 {'code' : 'CAD', 'name' : 'Canada Dollar'},
3775 {'code' : 'CDF', 'name' : 'Congo/Kinshasa Franc'},
3776 {'code' : 'CHF', 'name' : 'Switzerland Franc'},
3777 {'code' : 'CLP', 'name' : 'Chile Peso'},
3778 {'code' : 'CNY', 'name' : 'China Yuan Renminbi'},
3779 {'code' : 'COP', 'name' : 'Colombia Peso'},
3780 {'code' : 'CRC', 'name' : 'Costa Rica Colon'},
3781 {'code' : 'CUC', 'name' : 'Cuba Convertible Peso'},
3782 {'code' : 'CUP', 'name' : 'Cuba Peso'},
3783 {'code' : 'CVE', 'name' : 'Cape Verde Escudo'},
3784 {'code' : 'CZK', 'name' : 'Czech Republic Koruna'},
3785 {'code' : 'DJF', 'name' : 'Djibouti Franc'},
3786 {'code' : 'DKK', 'name' : 'Denmark Krone'},
3787 {'code' : 'DOP', 'name' : 'Dominican Republic Peso'},
3788 {'code' : 'DZD', 'name' : 'Algeria Dinar'},
3789 {'code' : 'EGP', 'name' : 'Egypt Pound'},
3790 {'code' : 'ERN', 'name' : 'Eritrea Nakfa'},
3791 {'code' : 'ETB', 'name' : 'Ethiopia Birr'},
3792 {'code' : 'EUR', 'name' : 'Euro Member Countries'},
3793 {'code' : 'FJD', 'name' : 'Fiji Dollar'},
3794 {'code' : 'FKP', 'name' : 'Falkland Islands (Malvinas) Pound'},
3795 {'code' : 'GBP', 'name' : 'United Kingdom Pound'},
3796 {'code' : 'GEL', 'name' : 'Georgia Lari'},
3797 {'code' : 'GGP', 'name' : 'Guernsey Pound'},
3798 {'code' : 'GHS', 'name' : 'Ghana Cedi'},
3799 {'code' : 'GIP', 'name' : 'Gibraltar Pound'},
3800 {'code' : 'GMD', 'name' : 'Gambia Dalasi'},
3801 {'code' : 'GNF', 'name' : 'Guinea Franc'},
3802 {'code' : 'GTQ', 'name' : 'Guatemala Quetzal'},
3803 {'code' : 'GYD', 'name' : 'Guyana Dollar'},
3804 {'code' : 'HKD', 'name' : 'Hong Kong Dollar'},
3805 {'code' : 'HNL', 'name' : 'Honduras Lempira'},
3806 {'code' : 'HRK', 'name' : 'Croatia Kuna'},
3807 {'code' : 'HTG', 'name' : 'Haiti Gourde'},
3808 {'code' : 'HUF', 'name' : 'Hungary Forint'},
3809 {'code' : 'IDR', 'name' : 'Indonesia Rupiah'},
3810 {'code' : 'ILS', 'name' : 'Israel Shekel'},
3811 {'code' : 'IMP', 'name' : 'Isle of Man Pound'},
3812 {'code' : 'INR', 'name' : 'India Rupee'},
3813 {'code' : 'IQD', 'name' : 'Iraq Dinar'},
3814 {'code' : 'IRR', 'name' : 'Iran Rial'},
3815 {'code' : 'ISK', 'name' : 'Iceland Krona'},
3816 {'code' : 'JEP', 'name' : 'Jersey Pound'},
3817 {'code' : 'JMD', 'name' : 'Jamaica Dollar'},
3818 {'code' : 'JOD', 'name' : 'Jordan Dinar'},
3819 {'code' : 'JPY', 'name' : 'Japan Yen'},
3820 {'code' : 'KES', 'name' : 'Kenya Shilling'},
3821 {'code' : 'KGS', 'name' : 'Kyrgyzstan Som'},
3822 {'code' : 'KHR', 'name' : 'Cambodia Riel'},
3823 {'code' : 'KMF', 'name' : 'Comoros Franc'},
3824 {'code' : 'KPW', 'name' : 'Korea (North) Won'},
3825 {'code' : 'KRW', 'name' : 'Korea (South) Won'},
3826 {'code' : 'KWD', 'name' : 'Kuwait Dinar'},
3827 {'code' : 'KYD', 'name' : 'Cayman Islands Dollar'},
3828 {'code' : 'KZT', 'name' : 'Kazakhstan Tenge'},
3829 {'code' : 'LAK', 'name' : 'Laos Kip'},
3830 {'code' : 'LBP', 'name' : 'Lebanon Pound'},
3831 {'code' : 'LKR', 'name' : 'Sri Lanka Rupee'},
3832 {'code' : 'LRD', 'name' : 'Liberia Dollar'},
3833 {'code' : 'LSL', 'name' : 'Lesotho Loti'},
3834 {'code' : 'LTL', 'name' : 'Lithuania Litas'},
3835 {'code' : 'LYD', 'name' : 'Libya Dinar'},
3836 {'code' : 'MAD', 'name' : 'Morocco Dirham'},
3837 {'code' : 'MDL', 'name' : 'Moldova Leu'},
3838 {'code' : 'MGA', 'name' : 'Madagascar Ariary'},
3839 {'code' : 'MKD', 'name' : 'Macedonia Denar'},
3840 {'code' : 'MMK', 'name' : 'Myanmar (Burma) Kyat'},
3841 {'code' : 'MNT', 'name' : 'Mongolia Tughrik'},
3842 {'code' : 'MOP', 'name' : 'Macau Pataca'},
3843 {'code' : 'MRO', 'name' : 'Mauritania Ouguiya'},
3844 {'code' : 'MUR', 'name' : 'Mauritius Rupee'},
3845 {'code' : 'MVR', 'name' : 'Maldives (Maldive Islands) Rufiyaa'},
3846 {'code' : 'MWK', 'name' : 'Malawi Kwacha'},
3847 {'code' : 'MXN', 'name' : 'Mexico Peso'},
3848 {'code' : 'MYR', 'name' : 'Malaysia Ringgit'},
3849 {'code' : 'MZN', 'name' : 'Mozambique Metical'},
3850 {'code' : 'NAD', 'name' : 'Namibia Dollar'},
3851 {'code' : 'NGN', 'name' : 'Nigeria Naira'},
3852 {'code' : 'NIO', 'name' : 'Nicaragua Cordoba'},
3853 {'code' : 'NOK', 'name' : 'Norway Krone'},
3854 {'code' : 'NPR', 'name' : 'Nepal Rupee'},
3855 {'code' : 'NZD', 'name' : 'New Zealand Dollar'},
3856 {'code' : 'OMR', 'name' : 'Oman Rial'},
3857 {'code' : 'PAB', 'name' : 'Panama Balboa'},
3858 {'code' : 'PEN', 'name' : 'Peru Nuevo Sol'},
3859 {'code' : 'PGK', 'name' : 'Papua New Guinea Kina'},
3860 {'code' : 'PHP', 'name' : 'Philippines Peso'},
3861 {'code' : 'PKR', 'name' : 'Pakistan Rupee'},
3862 {'code' : 'PLN', 'name' : 'Poland Zloty'},
3863 {'code' : 'PYG', 'name' : 'Paraguay Guarani'},
3864 {'code' : 'QAR', 'name' : 'Qatar Riyal'},
3865 {'code' : 'RON', 'name' : 'Romania New Leu'},
3866 {'code' : 'RSD', 'name' : 'Serbia Dinar'},
3867 {'code' : 'RUB', 'name' : 'Russia Ruble'},
3868 {'code' : 'RWF', 'name' : 'Rwanda Franc'},
3869 {'code' : 'SAR', 'name' : 'Saudi Arabia Riyal'},
3870 {'code' : 'SBD', 'name' : 'Solomon Islands Dollar'},
3871 {'code' : 'SCR', 'name' : 'Seychelles Rupee'},
3872 {'code' : 'SDG', 'name' : 'Sudan Pound'},
3873 {'code' : 'SEK', 'name' : 'Sweden Krona'},
3874 {'code' : 'SGD', 'name' : 'Singapore Dollar'},
3875 {'code' : 'SHP', 'name' : 'Saint Helena Pound'},
3876 {'code' : 'SLL', 'name' : 'Sierra Leone Leone'},
3877 {'code' : 'SOS', 'name' : 'Somalia Shilling'},
3878 {'code' : 'SPL', 'name' : 'Seborga Luigino'},
3879 {'code' : 'SRD', 'name' : 'Suriname Dollar'},
3880 {'code' : 'STD', 'name' : 'São Tomé and PrÃncipe Dobra'},
3881 {'code' : 'SVC', 'name' : 'El Salvador Colon'},
3882 {'code' : 'SYP', 'name' : 'Syria Pound'},
3883 {'code' : 'SZL', 'name' : 'Swaziland Lilangeni'},
3884 {'code' : 'THB', 'name' : 'Thailand Baht'},
3885 {'code' : 'TJS', 'name' : 'Tajikistan Somoni'},
3886 {'code' : 'TMT', 'name' : 'Turkmenistan Manat'},
3887 {'code' : 'TND', 'name' : 'Tunisia Dinar'},
3888 {'code' : 'TOP', 'name' : 'Tonga Pa\'anga'},
3889 {'code' : 'TRY', 'name' : 'Turkey Lira'},
3890 {'code' : 'TTD', 'name' : 'Trinidad and Tobago Dollar'},
3891 {'code' : 'TVD', 'name' : 'Tuvalu Dollar'},
3892 {'code' : 'TWD', 'name' : 'Taiwan New Dollar'},
3893 {'code' : 'TZS', 'name' : 'Tanzania Shilling'},
3894 {'code' : 'UAH', 'name' : 'Ukraine Hryvnia'},
3895 {'code' : 'UGX', 'name' : 'Uganda Shilling'},
3896 {'code' : 'USD', 'name' : 'United States Dollar'},
3897 {'code' : 'UYU', 'name' : 'Uruguay Peso'},
3898 {'code' : 'UZS', 'name' : 'Uzbekistan Som'},
3899 {'code' : 'VEF', 'name' : 'Venezuela Bolivar'},
3900 {'code' : 'VND', 'name' : 'Viet Nam Dong'},
3901 {'code' : 'VUV', 'name' : 'Vanuatu Vatu'},
3902 {'code' : 'WST', 'name' : 'Samoa Tala'},
3903 {'code' : 'XAF', 'name' : 'Communauté Financière Africaine (BEAC) CFA Franc BEAC'},
3904 {'code' : 'XCD', 'name' : 'East Caribbean Dollar'},
3905 {'code' : 'XDR', 'name' : 'International Monetary Fund (IMF) Special Drawing Rights'},
3906 {'code' : 'XOF', 'name' : 'Communauté Financière Africaine (BCEAO) Franc'},
3907 {'code' : 'XPF', 'name' : 'Comptoirs Français du Pacifique (CFP) Franc'},
3908 {'code' : 'YER', 'name' : 'Yemen Rial'},
3909 {'code' : 'ZAR', 'name' : 'South Africa Rand'},
3910 {'code' : 'ZMW', 'name' : 'Zambia Kwacha'},
3911 {'code' : 'ZWD', 'name' : 'Zimbabwe Dollar'}
3914 // return the names of all valide colors
3915 colorNames
: [ "AliceBlue", "Black", "Navy", "DarkBlue", "MediumBlue", "Blue", "DarkGreen", "Green", "Teal", "DarkCyan", "DeepSkyBlue", "DarkTurquoise", "MediumSpringGreen", "Lime", "SpringGreen",
3916 "Aqua", "Cyan", "MidnightBlue", "DodgerBlue", "LightSeaGreen", "ForestGreen", "SeaGreen", "DarkSlateGray", "LimeGreen", "MediumSeaGreen", "Turquoise", "RoyalBlue", "SteelBlue", "DarkSlateBlue", "MediumTurquoise",
3917 "Indigo", "DarkOliveGreen", "CadetBlue", "CornflowerBlue", "RebeccaPurple", "MediumAquaMarine", "DimGray", "SlateBlue", "OliveDrab", "SlateGray", "LightSlateGray", "MediumSlateBlue", "LawnGreen", "Chartreuse",
3918 "Aquamarine", "Maroon", "Purple", "Olive", "Gray", "SkyBlue", "LightSkyBlue", "BlueViolet", "DarkRed", "DarkMagenta", "SaddleBrown", "Ivory", "White",
3919 "DarkSeaGreen", "LightGreen", "MediumPurple", "DarkViolet", "PaleGreen", "DarkOrchid", "YellowGreen", "Sienna", "Brown", "DarkGray", "LightBlue", "GreenYellow", "PaleTurquoise", "LightSteelBlue", "PowderBlue",
3920 "FireBrick", "DarkGoldenRod", "MediumOrchid", "RosyBrown", "DarkKhaki", "Silver", "MediumVioletRed", "IndianRed", "Peru", "Chocolate", "Tan", "LightGray", "Thistle", "Orchid", "GoldenRod", "PaleVioletRed",
3921 "Crimson", "Gainsboro", "Plum", "BurlyWood", "LightCyan", "Lavender", "DarkSalmon", "Violet", "PaleGoldenRod", "LightCoral", "Khaki", "AliceBlue", "HoneyDew", "Azure", "SandyBrown", "Wheat", "Beige", "WhiteSmoke",
3922 "MintCream", "GhostWhite", "Salmon", "AntiqueWhite", "Linen", "LightGoldenRodYellow", "OldLace", "Red", "Fuchsia", "Magenta", "DeepPink", "OrangeRed", "Tomato", "HotPink", "Coral", "DarkOrange", "LightSalmon", "Orange",
3923 "LightPink", "Pink", "Gold", "PeachPuff", "NavajoWhite", "Moccasin", "Bisque", "MistyRose", "BlanchedAlmond", "PapayaWhip", "LavenderBlush", "SeaShell", "Cornsilk", "LemonChiffon", "FloralWhite", "Snow", "Yellow", "LightYellow"
3926 // Data taken from https://www.sec.gov/rules/other/4-460list.htm
3927 company
: [ "3Com Corp",
3929 "A.G. Edwards Inc.",
3930 "Abbott Laboratories",
3931 "Abercrombie & Fitch Co.",
3932 "ABM Industries Incorporated",
3933 "Ace Hardware Corporation",
3934 "ACT Manufacturing Inc.",
3936 "Adams Resources & Energy, Inc.",
3937 "ADC Telecommunications, Inc.",
3938 "Adelphia Communications Corporation",
3939 "Administaff, Inc.",
3940 "Adobe Systems Incorporated",
3941 "Adolph Coors Company",
3942 "Advance Auto Parts, Inc.",
3943 "Advanced Micro Devices, Inc.",
3945 "Advantica Restaurant Group, Inc.",
3946 "The AES Corporation",
3948 "Affiliated Computer Services, Inc.",
3949 "AFLAC Incorporated",
3951 "Agilent Technologies, Inc.",
3953 "Apartment Investment and Management Company",
3954 "Air Products and Chemicals, Inc.",
3957 "AK Steel Holding Corporation",
3958 "Alaska Air Group, Inc.",
3959 "Alberto-Culver Company",
3960 "Albertson's, Inc.",
3962 "Alleghany Corporation",
3963 "Allegheny Energy, Inc.",
3964 "Allegheny Technologies Incorporated",
3967 "Alliant Energy Corporation",
3968 "Allied Waste Industries, Inc.",
3969 "Allmerica Financial Corporation",
3970 "The Allstate Corporation",
3971 "ALLTEL Corporation",
3972 "The Alpine Group, Inc.",
3974 "AMC Entertainment Inc.",
3975 "American Power Conversion Corporation",
3976 "Amerada Hess Corporation",
3978 "Ameren Corporation",
3979 "America West Holdings Corporation",
3980 "American Axle & Manufacturing Holdings, Inc.",
3981 "American Eagle Outfitters, Inc.",
3982 "American Electric Power Company, Inc.",
3983 "American Express Company",
3984 "American Financial Group, Inc.",
3985 "American Greetings Corporation",
3986 "American International Group, Inc.",
3987 "American Standard Companies Inc.",
3988 "American Water Works Company, Inc.",
3989 "AmerisourceBergen Corporation",
3990 "Ames Department Stores, Inc.",
3992 "Amkor Technology, Inc.",
3996 "Anadarko Petroleum Corporation",
3997 "Analog Devices, Inc.",
3998 "Anheuser-Busch Companies, Inc.",
3999 "Anixter International Inc.",
4002 "AOL Time Warner Inc.",
4004 "Apache Corporation",
4005 "Apple Computer, Inc.",
4006 "Applera Corporation",
4007 "Applied Industrial Technologies, Inc.",
4008 "Applied Materials, Inc.",
4010 "ARAMARK Corporation",
4012 "Archer Daniels Midland Company",
4013 "Arkansas Best Corporation",
4014 "Armstrong Holdings, Inc.",
4015 "Arrow Electronics, Inc.",
4016 "ArvinMeritor, Inc.",
4018 "Astoria Financial Corporation",
4020 "Atmel Corporation",
4021 "Atmos Energy Corporation",
4022 "Audiovox Corporation",
4024 "Automatic Data Processing, Inc.",
4028 "Avery Dennison Corporation",
4029 "Avista Corporation",
4031 "Avon Products, Inc.",
4032 "Baker Hughes Incorporated",
4034 "Bank of America Corporation",
4035 "The Bank of New York Company, Inc.",
4036 "Bank One Corporation",
4037 "Banknorth Group, Inc.",
4038 "Banta Corporation",
4039 "Barnes & Noble, Inc.",
4040 "Bausch & Lomb Incorporated",
4041 "Baxter International Inc.",
4043 "The Bear Stearns Companies Inc.",
4044 "Beazer Homes USA, Inc.",
4045 "Beckman Coulter, Inc.",
4046 "Becton, Dickinson and Company",
4047 "Bed Bath & Beyond Inc.",
4049 "Bell Microproducts Inc.",
4050 "BellSouth Corporation",
4052 "Bemis Company, Inc.",
4053 "Benchmark Electronics, Inc.",
4054 "Berkshire Hathaway Inc.",
4055 "Best Buy Co., Inc.",
4056 "Bethlehem Steel Corporation",
4057 "Beverly Enterprises, Inc.",
4059 "BJ Services Company",
4060 "BJ's Wholesale Club, Inc.",
4061 "The Black & Decker Corporation",
4062 "Black Hills Corporation",
4063 "BMC Software, Inc.",
4064 "The Boeing Company",
4065 "Boise Cascade Corporation",
4066 "Borders Group, Inc.",
4068 "Boston Scientific Corporation",
4069 "Bowater Incorporated",
4070 "Briggs & Stratton Corporation",
4071 "Brightpoint, Inc.",
4072 "Brinker International, Inc.",
4073 "Bristol-Myers Squibb Company",
4075 "Brown Shoe Company, Inc.",
4076 "Brown-Forman Corporation",
4077 "Brunswick Corporation",
4078 "Budget Group, Inc.",
4079 "Burlington Coat Factory Warehouse Corporation",
4080 "Burlington Industries, Inc.",
4081 "Burlington Northern Santa Fe Corporation",
4082 "Burlington Resources Inc.",
4083 "C. H. Robinson Worldwide Inc.",
4084 "Cablevision Systems Corp",
4086 "Cadence Design Systems, Inc.",
4088 "Campbell Soup Co.",
4089 "Capital One Financial Corp.",
4090 "Cardinal Health Inc.",
4092 "Carlisle Cos. Inc.",
4093 "Carpenter Technology Corp.",
4094 "Casey's General Stores Inc.",
4098 "CDW Computer Centers Inc.",
4101 "Cenex Harvest States Cooperatives",
4105 "CH2M Hill Cos. Ltd.",
4106 "Champion Enterprises Inc.",
4107 "Charles Schwab Corp.",
4108 "Charming Shoppes Inc.",
4109 "Charter Communications Inc.",
4110 "Charter One Financial Inc.",
4111 "ChevronTexaco Corp.",
4112 "Chiquita Brands International Inc.",
4116 "Cincinnati Financial Corp.",
4119 "Circuit City Stores Inc.",
4120 "Cisco Systems Inc.",
4122 "Citizens Communications Co.",
4123 "CKE Restaurants Inc.",
4124 "Clear Channel Communications Inc.",
4130 "Coca-Cola Enterprises Inc.",
4131 "Colgate-Palmolive Co.",
4132 "Collins & Aikman Corp.",
4136 "Comfort Systems USA Inc.",
4137 "Commercial Metals Co.",
4138 "Community Health Systems Inc.",
4139 "Compass Bancshares Inc",
4140 "Computer Associates International Inc.",
4141 "Computer Sciences Corp.",
4143 "Comverse Technology Inc.",
4144 "ConAgra Foods Inc.",
4149 "Consolidated Freightways Corp.",
4150 "Consolidated Edison Inc.",
4151 "Constellation Brands Inc.",
4152 "Constellation Emergy Group Inc.",
4153 "Continental Airlines Inc.",
4155 "Cooper Cameron Corp.",
4156 "Cooper Industries Ltd.",
4157 "Cooper Tire & Rubber Co.",
4158 "Corn Products International Inc.",
4160 "Costco Wholesale Corp.",
4161 "Countrywide Credit Industries Inc.",
4162 "Coventry Health Care Inc.",
4163 "Cox Communications Inc.",
4166 "Crown Cork & Seal Co. Inc.",
4171 "Cytec Industries Inc.",
4172 "D&K Healthcare Resources, Inc.",
4175 "Danaher Corporation",
4176 "Darden Restaurants Inc.",
4178 "Dean Foods Company",
4180 "Del Monte Foods Co",
4181 "Dell Computer Corporation",
4183 "Delta Air Lines Inc.",
4184 "Deluxe Corporation",
4185 "Devon Energy Corporation",
4186 "Di Giorgio Corporation",
4188 "Diebold Incorporated",
4190 "DIMON Incorporated",
4191 "Dole Food Company, Inc.",
4192 "Dollar General Corporation",
4193 "Dollar Tree Stores, Inc.",
4194 "Dominion Resources, Inc.",
4195 "Domino's Pizza LLC",
4196 "Dover Corporation, Inc.",
4197 "Dow Chemical Company",
4198 "Dow Jones & Company, Inc.",
4201 "Dreyer's Grand Ice Cream, Inc.",
4202 "DST Systems, Inc.",
4204 "E.I. Du Pont de Nemours and Company",
4206 "Dun & Bradstreet Inc.",
4207 "DURA Automotive Systems Inc.",
4210 "E*Trade Group, Inc.",
4211 "E.W. Scripps Company",
4213 "Eastman Chemical Company",
4214 "Eastman Kodak Company",
4215 "Eaton Corporation",
4216 "Echostar Communications Corporation",
4218 "Edison International",
4220 "El Paso Corporation",
4221 "Electronic Arts Inc.",
4222 "Electronic Data Systems Corp.",
4223 "Eli Lilly and Company",
4226 "Emerson Electric Co.",
4227 "Encompass Services Corporation",
4228 "Energizer Holdings Inc.",
4229 "Energy East Corporation",
4230 "Engelhard Corporation",
4232 "Entergy Corporation",
4233 "Enterprise Products Partners L.P.",
4234 "EOG Resources, Inc.",
4236 "Equitable Resources Inc.",
4237 "Equity Office Properties Trust",
4238 "Equity Residential Properties Trust",
4239 "Estee Lauder Companies Inc.",
4240 "Exelon Corporation",
4241 "Exide Technologies",
4242 "Expeditors International of Washington Inc.",
4243 "Express Scripts Inc.",
4244 "ExxonMobil Corporation",
4245 "Fairchild Semiconductor International Inc.",
4246 "Family Dollar Stores Inc.",
4247 "Farmland Industries Inc.",
4248 "Federal Mogul Corp.",
4249 "Federated Department Stores Inc.",
4250 "Federal Express Corp.",
4251 "Felcor Lodging Trust Inc.",
4253 "Fidelity National Financial Inc.",
4254 "Fifth Third Bancorp",
4255 "First American Financial Corp.",
4257 "First National of Nebraska Inc.",
4258 "First Tennessee National Corp.",
4259 "FirstEnergy Corp.",
4261 "Fisher Scientific International Inc.",
4262 "FleetBoston Financial Co.",
4263 "Fleetwood Enterprises Inc.",
4264 "Fleming Companies Inc.",
4265 "Flowers Foods Inc.",
4269 "Foamex International Inc",
4273 "Forest Laboratories Inc.",
4274 "Fortune Brands Inc.",
4275 "Foster Wheeler Ltd.",
4277 "Franklin Resources Inc.",
4278 "Freeport McMoran Copper & Gold Inc.",
4279 "Frontier Oil Corp",
4280 "Furniture Brands International Inc.",
4281 "Gannett Co., Inc.",
4285 "Gemstar-TV Guide International Inc.",
4287 "General Cable Corporation",
4288 "General Dynamics Corporation",
4289 "General Electric Company",
4290 "General Mills Inc",
4291 "General Motors Corporation",
4292 "Genesis Health Ventures Inc.",
4294 "Gentiva Health Services Inc.",
4295 "Genuine Parts Company",
4297 "Genzyme Corporation",
4298 "Georgia Gulf Corporation",
4299 "Georgia-Pacific Corporation",
4302 "Golden State Bancorp Inc.",
4303 "Golden West Financial Corporation",
4304 "Goldman Sachs Group Inc.",
4305 "Goodrich Corporation",
4306 "The Goodyear Tire & Rubber Company",
4307 "Granite Construction Incorporated",
4308 "Graybar Electric Company Inc.",
4309 "Great Lakes Chemical Corporation",
4310 "Great Plains Energy Inc.",
4311 "GreenPoint Financial Corp.",
4312 "Greif Bros. Corporation",
4313 "Grey Global Group Inc.",
4314 "Group 1 Automotive Inc.",
4315 "Guidant Corporation",
4317 "H.B. Fuller Company",
4318 "H.J. Heinz Company",
4320 "Harley-Davidson Inc.",
4321 "Harman International Industries Inc.",
4322 "Harrah's Entertainment Inc.",
4325 "Hartford Financial Services Group Inc.",
4327 "Hawaiian Electric Industries Inc.",
4329 "Health Management Associates Inc.",
4332 "Henry Schein Inc.",
4334 "Herman Miller Inc.",
4335 "Hershey Foods Corp.",
4336 "Hewlett-Packard Company",
4338 "Hillenbrand Industries Inc.",
4339 "Hilton Hotels Corp.",
4340 "Hollywood Entertainment Corp.",
4342 "Hon Industries Inc.",
4343 "Honeywell International Inc.",
4344 "Hormel Foods Corp.",
4345 "Host Marriott Corp.",
4346 "Household International Corp.",
4347 "Hovnanian Enterprises Inc.",
4350 "Hughes Supply Inc.",
4352 "Huntington Bancshares Inc.",
4355 "IKON Office Solutions Inc.",
4356 "Illinois Tool Works Inc.",
4358 "Imperial Sugar Company",
4360 "Ingles Market Inc",
4361 "Ingram Micro Inc.",
4362 "Insight Enterprises Inc.",
4363 "Integrated Electrical Services Inc.",
4364 "Intel Corporation",
4365 "International Paper Co.",
4366 "Interpublic Group of Companies Inc.",
4367 "Interstate Bakeries Corporation",
4368 "International Business Machines Corp.",
4369 "International Flavors & Fragrances Inc.",
4370 "International Multifoods Corporation",
4373 "ITT Industries Inc.",
4375 "J.B. Hunt Transport Services Inc.",
4377 "J.P. Morgan Chase & Co.",
4378 "Jabil Circuit Inc.",
4379 "Jack In The Box Inc.",
4380 "Jacobs Engineering Group Inc.",
4381 "JDS Uniphase Corp.",
4382 "Jefferson-Pilot Co.",
4383 "John Hancock Financial Services Inc.",
4384 "Johnson & Johnson",
4385 "Johnson Controls Inc.",
4386 "Jones Apparel Group Inc.",
4390 "Kelly Services Inc.",
4393 "Kerr-McGee Corporation",
4396 "Kimball International Inc.",
4397 "Kimberly-Clark Corporation",
4398 "Kindred Healthcare Inc.",
4399 "KLA-Tencor Corporation",
4401 "Knight-Ridder Inc.",
4403 "KPMG Consulting Inc.",
4405 "L-3 Communications Holdings Inc.",
4406 "Laboratory Corporation of America Holdings",
4407 "Lam Research Corporation",
4408 "LandAmerica Financial Group Inc.",
4410 "Landstar System Inc.",
4414 "Leggett & Platt Inc.",
4415 "Lehman Brothers Holdings Inc.",
4416 "Lennar Corporation",
4417 "Lennox International Inc.",
4418 "Level 3 Communications Inc.",
4419 "Levi Strauss & Co.",
4420 "Lexmark International Inc.",
4422 "Lincoln National Corporation",
4423 "Linens 'n Things Inc.",
4424 "Lithia Motors Inc.",
4425 "Liz Claiborne Inc.",
4426 "Lockheed Martin Corporation",
4427 "Loews Corporation",
4428 "Longs Drug Stores Corporation",
4429 "Louisiana-Pacific Corporation",
4430 "Lowe's Companies Inc.",
4431 "LSI Logic Corporation",
4432 "The LTV Corporation",
4433 "The Lubrizol Corporation",
4434 "Lucent Technologies Inc.",
4435 "Lyondell Chemical Company",
4436 "M & T Bank Corporation",
4437 "Magellan Health Services Inc.",
4439 "Mandalay Resort Group",
4442 "Marathon Oil Corporation",
4443 "Mariner Health Care Inc.",
4444 "Markel Corporation",
4445 "Marriott International Inc.",
4446 "Marsh & McLennan Companies Inc.",
4447 "Marsh Supermarkets Inc.",
4448 "Marshall & Ilsley Corporation",
4449 "Martin Marietta Materials Inc.",
4450 "Masco Corporation",
4451 "Massey Energy Company",
4454 "Maxim Integrated Products Inc.",
4455 "Maxtor Corporation",
4457 "The May Department Stores Company",
4458 "Maytag Corporation",
4460 "McCormick & Company Incorporated",
4461 "McDonald's Corporation",
4462 "The McGraw-Hill Companies Inc.",
4463 "McKesson Corporation",
4464 "McLeodUSA Incorporated",
4465 "M.D.C. Holdings Inc.",
4466 "MDU Resources Group Inc.",
4467 "MeadWestvaco Corporation",
4469 "Mellon Financial Corporation",
4470 "The Men's Wearhouse Inc.",
4471 "Merck & Co., Inc.",
4472 "Mercury General Corporation",
4473 "Merrill Lynch & Co. Inc.",
4474 "Metaldyne Corporation",
4477 "Metris Companies Inc",
4478 "MGIC Investment Corporation",
4480 "Michaels Stores Inc.",
4481 "Micron Technology Inc.",
4482 "Microsoft Corporation",
4484 "Millennium Chemicals Inc.",
4485 "Mirant Corporation",
4486 "Mohawk Industries Inc.",
4487 "Molex Incorporated",
4488 "The MONY Group Inc.",
4489 "Morgan Stanley Dean Witter & Co.",
4492 "Murphy Oil Corporation",
4493 "Nabors Industries Inc",
4494 "Nacco Industries Inc",
4495 "Nash Finch Company",
4496 "National City Corp.",
4497 "National Commerce Financial Corporation",
4498 "National Fuel Gas Company",
4499 "National Oilwell Inc",
4500 "National Rural Utilities Cooperative Finance Corporation",
4501 "National Semiconductor Corporation",
4502 "National Service Industries Inc",
4503 "Navistar International Corporation",
4505 "The Neiman Marcus Group Inc.",
4506 "New Jersey Resources Corporation",
4507 "New York Times Company",
4508 "Newell Rubbermaid Inc",
4509 "Newmont Mining Corporation",
4510 "Nextel Communications Inc",
4516 "Norfolk Southern Corporation",
4518 "North Fork Bancorporation Inc",
4519 "Northeast Utilities System",
4520 "Northern Trust Corporation",
4521 "Northrop Grumman Corporation",
4522 "NorthWestern Corporation",
4523 "Novellus Systems Inc",
4529 "Northwest Airlines Corp",
4530 "Occidental Petroleum Corp",
4532 "Office Depot Inc.",
4535 "Oglethorpe Power Corp.",
4536 "Ohio Casualty Corp.",
4537 "Old Republic International Corp.",
4542 "On Semiconductor Corp",
4545 "Oshkosh Truck Corp",
4546 "Outback Steakhouse Inc.",
4547 "Owens & Minor Inc.",
4549 "Owens-Illinois Inc",
4550 "Oxford Health Plans Inc",
4552 "PacifiCare Health Systems Inc",
4553 "Packaging Corp. of America",
4557 "Park Place Entertainment Corp",
4558 "Parker Hannifin Corp.",
4559 "Pathmark Stores Inc.",
4561 "Payless Shoesource Inc",
4563 "Pennzoil-Quaker State Company",
4565 "Peoples Energy Corp.",
4567 "Pep Boys Manny, Moe & Jack",
4568 "Potomac Electric Power Co.",
4569 "Pepsi Bottling Group Inc.",
4570 "PepsiAmericas Inc.",
4572 "Performance Food Group Co.",
4575 "Perot Systems Corp",
4576 "Petco Animal Supplies Inc.",
4577 "Peter Kiewit Sons', Inc.",
4580 "Pacific Gas & Electric Corp.",
4583 "Phelps Dodge Corp.",
4584 "Philip Morris Companies Inc.",
4585 "Phillips Petroleum Co",
4586 "Phillips Van Heusen Corp.",
4587 "Phoenix Companies Inc",
4588 "Pier 1 Imports Inc.",
4589 "Pilgrim's Pride Corporation",
4590 "Pinnacle West Capital Corp",
4591 "Pioneer-Standard Electronics Inc.",
4592 "Pitney Bowes Inc.",
4593 "Pittston Brinks Group",
4594 "Plains All American Pipeline LP",
4595 "PNC Financial Services Group Inc.",
4596 "PNM Resources Inc",
4597 "Polaris Industries Inc.",
4598 "Polo Ralph Lauren Corp",
4602 "PPG Industries Inc",
4605 "Precision Castparts Corp",
4607 "Pride International Inc",
4609 "Principal Financial Group Inc.",
4610 "Procter & Gamble Co.",
4611 "Pro-Fac Cooperative Inc.",
4612 "Progress Energy Inc",
4613 "Progressive Corporation",
4614 "Protective Life Corp",
4615 "Provident Financial Group",
4616 "Providian Financial Corp.",
4617 "Prudential Financial Inc.",
4618 "PSS World Medical Inc",
4619 "Public Service Enterprise Group Inc.",
4620 "Publix Super Markets Inc.",
4621 "Puget Energy Inc.",
4624 "Quanta Services Inc.",
4626 "Quest Diagnostics Inc.",
4628 "Quintiles Transnational",
4629 "Qwest Communications Intl Inc",
4630 "R.J. Reynolds Tobacco Company",
4631 "R.R. Donnelley & Sons Company",
4632 "Radio Shack Corporation",
4633 "Raymond James Financial Inc.",
4635 "Reader's Digest Association Inc.",
4636 "Reebok International Ltd.",
4637 "Regions Financial Corp.",
4638 "Regis Corporation",
4639 "Reliance Steel & Aluminum Co.",
4640 "Reliant Energy Inc.",
4641 "Rent A Center Inc",
4642 "Republic Services Inc",
4644 "RGS Energy Group Inc",
4646 "Riverwood Holding Inc.",
4648 "Robert Half International Inc.",
4650 "Rockwell Automation Inc",
4651 "Rockwell Collins Inc",
4658 "Ryland Group Inc.",
4659 "Sabre Holdings Corp",
4661 "Safeguard Scientifics Inc.",
4666 "SBC Communications Inc",
4668 "Schering-Plough Corp",
4671 "Science Applications Intl. Inc.",
4672 "Scientific-Atlanta Inc",
4676 "Sears Roebuck & Co",
4679 "Service Corp. International",
4682 "Sherwin-Williams Company",
4683 "Shopko Stores Inc",
4684 "Siebel Systems Inc",
4685 "Sierra Health Services Inc",
4686 "Sierra Pacific Resources",
4687 "Silgan Holdings Inc.",
4688 "Silicon Graphics Inc",
4689 "Simon Property Group Inc",
4691 "Smith International Inc",
4692 "Smithfield Foods Inc",
4693 "Smurfit-Stone Container Corp",
4697 "Sonic Automotive Inc.",
4698 "Sonoco Products Co.",
4700 "Southern Union Company",
4702 "Southwest Airlines Co",
4703 "Southwest Gas Corp",
4704 "Sovereign Bancorp Inc.",
4705 "Spartan Stores Inc",
4707 "Sports Authority Inc",
4710 "St. Jude Medical Inc",
4712 "Staff Leasing Inc.",
4713 "StanCorp Financial Group Inc",
4714 "Standard Pacific Corp.",
4718 "Starwood Hotels & Resorts Worldwide Inc",
4719 "State Street Corp.",
4720 "Stater Bros. Holdings Inc.",
4723 "Stewart & Stevenson Services Inc",
4724 "Stewart Information Services Corp",
4725 "Stilwell Financial Inc",
4726 "Storage Technology Corporation",
4728 "Sun Healthcare Group Inc.",
4729 "Sun Microsystems Inc.",
4730 "SunGard Data Systems Inc.",
4732 "SunTrust Banks Inc",
4734 "Swift Transportation, Co., Inc",
4735 "Symbol Technologies Inc",
4736 "Synovus Financial Corp.",
4740 "Tech Data Corporation",
4742 "Tecumseh Products Company",
4744 "Teleflex Incorporated",
4745 "Telephone & Data Systems Inc",
4747 "Temple-Inland Inc",
4748 "Tenet Healthcare Corporation",
4749 "Tenneco Automotive Inc.",
4752 "Tesoro Petroleum Corp.",
4753 "Texas Industries Inc.",
4754 "Texas Instruments Incorporated",
4756 "Thermo Electron Corporation",
4757 "Thomas & Betts Corporation",
4760 "TJX Companies Inc",
4761 "TMP Worldwide Inc",
4762 "Toll Brothers Inc",
4763 "Torchmark Corporation",
4765 "Tower Automotive Inc.",
4767 "Trans World Entertainment Corp.",
4768 "TransMontaigne Inc",
4770 "TravelCenters of America Inc.",
4771 "Triad Hospitals Inc",
4773 "Trigon Healthcare Inc.",
4774 "Trinity Industries Inc",
4775 "Trump Hotels & Casino Resorts Inc.",
4776 "TruServ Corporation",
4781 "U.S. Industries Inc.",
4784 "Unified Western Grocers Inc",
4785 "Union Pacific Corporation",
4786 "Union Planters Corp",
4787 "Unisource Energy Corp",
4788 "Unisys Corporation",
4789 "United Auto Group Inc",
4790 "United Defense Industries Inc.",
4791 "United Parcel Service Inc",
4792 "United Rentals Inc",
4793 "United Stationers Inc",
4794 "United Technologies Corporation",
4795 "UnitedHealth Group Incorporated",
4797 "Universal Corporation",
4798 "Universal Forest Products Inc",
4799 "Universal Health Services Inc",
4800 "Unocal Corporation",
4802 "UnumProvident Corporation",
4804 "US Airways Group Inc",
4807 "USFreighways Corporation",
4810 "Valero Energy Corporation",
4811 "Valspar Corporation",
4812 "Value City Department Stores Inc",
4813 "Varco International Inc",
4814 "Vectren Corporation",
4815 "Veritas Software Corporation",
4816 "Verizon Communications Inc",
4820 "Viasystems Group Inc",
4821 "Vishay Intertechnology Inc",
4822 "Visteon Corporation",
4823 "Volt Information Sciences Inc",
4824 "Vulcan Materials Company",
4825 "W.R. Berkley Corporation",
4827 "W.W. Grainger Inc",
4828 "Wachovia Corporation",
4829 "Wakenhut Corporation",
4831 "Wallace Computer Services Inc",
4832 "Wal-Mart Stores Inc",
4834 "Walter Industries Inc",
4835 "Washington Mutual Inc",
4836 "Washington Post Co.",
4837 "Waste Management Inc",
4839 "Weatherford International Inc",
4840 "Weis Markets Inc.",
4841 "Wellpoint Health Networks Inc",
4842 "Wells Fargo & Company",
4843 "Wendy's International Inc",
4844 "Werner Enterprises Inc",
4845 "WESCO International Inc",
4846 "Western Digital Inc",
4847 "Western Gas Resources Inc",
4848 "WestPoint Stevens Inc",
4849 "Weyerhauser Company",
4851 "Whirlpool Corporation",
4852 "Whole Foods Market Inc",
4853 "Willamette Industries Inc.",
4854 "Williams Companies Inc",
4855 "Williams Sonoma Inc",
4856 "Winn Dixie Stores Inc",
4857 "Wisconsin Energy Corporation",
4858 "Wm Wrigley Jr Company",
4859 "World Fuel Services Corporation",
4861 "Worthington Industries Inc",
4862 "WPS Resources Corporation",
4864 "Wyndham International Inc",
4868 "XO Communications Inc",
4869 "Yellow Corporation",
4870 "York International Corp",
4873 "Zions Bancorporation"
4877 "raster" : ["bmp", "gif", "gpl", "ico", "jpeg", "psd", "png", "psp", "raw", "tiff"],
4878 "vector" : ["3dv", "amf", "awg", "ai", "cgm", "cdr", "cmx", "dxf", "e2d", "egt", "eps", "fs", "odg", "svg", "xar"],
4879 "3d" : ["3dmf", "3dm", "3mf", "3ds", "an8", "aoi", "blend", "cal3d", "cob", "ctm", "iob", "jas", "max", "mb", "mdx", "obj", "x", "x3d"],
4880 "document" : ["doc", "docx", "dot", "html", "xml", "odt", "odm", "ott", "csv", "rtf", "tex", "xhtml", "xps"]
4883 // Data taken from https://github.com/dmfilipenko/timezones.json/blob/master/timezones.json
4886 "name": "Dateline Standard Time",
4890 "text": "(UTC-12:00) International Date Line West",
4900 "text": "(UTC-11:00) Coordinated Universal Time-11",
4909 "name": "Hawaiian Standard Time",
4913 "text": "(UTC-10:00) Hawaii",
4918 "Pacific/Rarotonga",
4923 "name": "Alaskan Standard Time",
4927 "text": "(UTC-09:00) Alaska",
4929 "America/Anchorage",
4937 "name": "Pacific Standard Time (Mexico)",
4941 "text": "(UTC-08:00) Baja California",
4943 "America/Santa_Isabel"
4947 "name": "Pacific Standard Time",
4951 "text": "(UTC-08:00) Pacific Time (US & Canada)",
4954 "America/Los_Angeles",
4956 "America/Vancouver",
4957 "America/Whitehorse",
4962 "name": "US Mountain Standard Time",
4966 "text": "(UTC-07:00) Arizona",
4969 "America/Dawson_Creek",
4970 "America/Hermosillo",
4976 "name": "Mountain Standard Time (Mexico)",
4980 "text": "(UTC-07:00) Chihuahua, La Paz, Mazatlan",
4982 "America/Chihuahua",
4987 "name": "Mountain Standard Time",
4991 "text": "(UTC-07:00) Mountain Time (US & Canada)",
4994 "America/Cambridge_Bay",
4999 "America/Yellowknife",
5004 "name": "Central America Standard Time",
5008 "text": "(UTC-06:00) Central America",
5011 "America/Costa_Rica",
5012 "America/El_Salvador",
5013 "America/Guatemala",
5015 "America/Tegucigalpa",
5021 "name": "Central Standard Time",
5025 "text": "(UTC-06:00) Central Time (US & Canada)",
5028 "America/Indiana/Knox",
5029 "America/Indiana/Tell_City",
5030 "America/Matamoros",
5031 "America/Menominee",
5032 "America/North_Dakota/Beulah",
5033 "America/North_Dakota/Center",
5034 "America/North_Dakota/New_Salem",
5035 "America/Rainy_River",
5036 "America/Rankin_Inlet",
5043 "name": "Central Standard Time (Mexico)",
5047 "text": "(UTC-06:00) Guadalajara, Mexico City, Monterrey",
5049 "America/Bahia_Banderas",
5052 "America/Mexico_City",
5057 "name": "Canada Central Standard Time",
5061 "text": "(UTC-06:00) Saskatchewan",
5064 "America/Swift_Current"
5068 "name": "SA Pacific Standard Time",
5072 "text": "(UTC-05:00) Bogota, Lima, Quito",
5076 "America/Coral_Harbour",
5078 "America/Guayaquil",
5082 "America/Rio_Branco",
5087 "name": "Eastern Standard Time",
5091 "text": "(UTC-05:00) Eastern Time (US & Canada)",
5095 "America/Indiana/Petersburg",
5096 "America/Indiana/Vincennes",
5097 "America/Indiana/Winamac",
5099 "America/Kentucky/Monticello",
5100 "America/Louisville",
5105 "America/Pangnirtung",
5106 "America/Port-au-Prince",
5107 "America/Thunder_Bay",
5113 "name": "US Eastern Standard Time",
5117 "text": "(UTC-05:00) Indiana (East)",
5119 "America/Indiana/Marengo",
5120 "America/Indiana/Vevay",
5121 "America/Indianapolis"
5125 "name": "Venezuela Standard Time",
5129 "text": "(UTC-04:30) Caracas",
5135 "name": "Paraguay Standard Time",
5139 "text": "(UTC-04:00) Asuncion",
5145 "name": "Atlantic Standard Time",
5149 "text": "(UTC-04:00) Atlantic Time (Canada)",
5151 "America/Glace_Bay",
5152 "America/Goose_Bay",
5160 "name": "Central Brazilian Standard Time",
5164 "text": "(UTC-04:00) Cuiaba",
5166 "America/Campo_Grande",
5171 "name": "SA Western Standard Time",
5175 "text": "(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",
5181 "America/Blanc-Sablon",
5182 "America/Boa_Vista",
5185 "America/Grand_Turk",
5187 "America/Guadeloupe",
5189 "America/Kralendijk",
5191 "America/Lower_Princes",
5194 "America/Martinique",
5195 "America/Montserrat",
5196 "America/Port_of_Spain",
5197 "America/Porto_Velho",
5198 "America/Puerto_Rico",
5199 "America/Santo_Domingo",
5200 "America/St_Barthelemy",
5203 "America/St_Thomas",
5204 "America/St_Vincent",
5210 "name": "Pacific SA Standard Time",
5214 "text": "(UTC-04:00) Santiago",
5221 "name": "Newfoundland Standard Time",
5225 "text": "(UTC-03:30) Newfoundland",
5231 "name": "E. South America Standard Time",
5235 "text": "(UTC-03:00) Brasilia",
5241 "name": "Argentina Standard Time",
5245 "text": "(UTC-03:00) Buenos Aires",
5247 "America/Argentina/La_Rioja",
5248 "America/Argentina/Rio_Gallegos",
5249 "America/Argentina/Salta",
5250 "America/Argentina/San_Juan",
5251 "America/Argentina/San_Luis",
5252 "America/Argentina/Tucuman",
5253 "America/Argentina/Ushuaia",
5254 "America/Buenos_Aires",
5255 "America/Catamarca",
5262 "name": "SA Eastern Standard Time",
5266 "text": "(UTC-03:00) Cayenne, Fortaleza",
5268 "America/Araguaina",
5271 "America/Fortaleza",
5273 "America/Paramaribo",
5276 "Antarctica/Rothera",
5282 "name": "Greenland Standard Time",
5286 "text": "(UTC-03:00) Greenland",
5292 "name": "Montevideo Standard Time",
5296 "text": "(UTC-03:00) Montevideo",
5298 "America/Montevideo"
5302 "name": "Bahia Standard Time",
5306 "text": "(UTC-03:00) Salvador",
5316 "text": "(UTC-02:00) Coordinated Universal Time-02",
5319 "Atlantic/South_Georgia",
5324 "name": "Mid-Atlantic Standard Time",
5328 "text": "(UTC-02:00) Mid-Atlantic - Old"
5331 "name": "Azores Standard Time",
5335 "text": "(UTC-01:00) Azores",
5337 "America/Scoresbysund",
5342 "name": "Cape Verde Standard Time",
5346 "text": "(UTC-01:00) Cape Verde Is.",
5348 "Atlantic/Cape_Verde",
5353 "name": "Morocco Standard Time",
5357 "text": "(UTC) Casablanca",
5359 "Africa/Casablanca",
5368 "text": "(UTC) Coordinated Universal Time",
5370 "America/Danmarkshavn",
5375 "name": "GMT Standard Time",
5379 "text": "(UTC) Dublin, Edinburgh, Lisbon, London",
5386 "Europe/Isle_of_Man",
5393 "name": "Greenwich Standard Time",
5397 "text": "(UTC) Monrovia, Reykjavik",
5409 "Africa/Nouakchott",
5410 "Africa/Ouagadougou",
5412 "Atlantic/Reykjavik",
5413 "Atlantic/St_Helena"
5417 "name": "W. Europe Standard Time",
5421 "text": "(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",
5423 "Arctic/Longyearbyen",
5429 "Europe/Luxembourg",
5434 "Europe/San_Marino",
5443 "name": "Central Europe Standard Time",
5447 "text": "(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",
5450 "Europe/Bratislava",
5459 "name": "Romance Standard Time",
5463 "text": "(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",
5467 "Europe/Copenhagen",
5473 "name": "Central European Standard Time",
5477 "text": "(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",
5486 "name": "W. Central Africa Standard Time",
5490 "text": "(UTC+01:00) West Central Africa",
5494 "Africa/Brazzaville",
5498 "Africa/Libreville",
5503 "Africa/Porto-Novo",
5509 "name": "Namibia Standard Time",
5513 "text": "(UTC+01:00) Windhoek",
5519 "name": "GTB Standard Time",
5523 "text": "(UTC+02:00) Athens, Bucharest",
5532 "name": "Middle East Standard Time",
5536 "text": "(UTC+02:00) Beirut",
5542 "name": "Egypt Standard Time",
5546 "text": "(UTC+02:00) Cairo",
5552 "name": "Syria Standard Time",
5556 "text": "(UTC+02:00) Damascus",
5562 "name": "E. Europe Standard Time",
5566 "text": "(UTC+02:00) E. Europe"
5569 "name": "South Africa Standard Time",
5573 "text": "(UTC+02:00) Harare, Pretoria",
5579 "Africa/Johannesburg",
5581 "Africa/Lubumbashi",
5590 "name": "FLE Standard Time",
5594 "text": "(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",
5608 "name": "Turkey Standard Time",
5612 "text": "(UTC+02:00) Istanbul",
5618 "name": "Israel Standard Time",
5622 "text": "(UTC+02:00) Jerusalem",
5628 "name": "Libya Standard Time",
5632 "text": "(UTC+02:00) Tripoli",
5638 "name": "Jordan Standard Time",
5642 "text": "(UTC+03:00) Amman",
5648 "name": "Arabic Standard Time",
5652 "text": "(UTC+03:00) Baghdad",
5658 "name": "Kaliningrad Standard Time",
5662 "text": "(UTC+03:00) Kaliningrad, Minsk",
5664 "Europe/Kaliningrad",
5669 "name": "Arab Standard Time",
5673 "text": "(UTC+03:00) Kuwait, Riyadh",
5683 "name": "E. Africa Standard Time",
5687 "text": "(UTC+03:00) Nairobi",
5689 "Africa/Addis_Ababa",
5691 "Africa/Dar_es_Salaam",
5700 "Indian/Antananarivo",
5706 "name": "Iran Standard Time",
5710 "text": "(UTC+03:30) Tehran",
5716 "name": "Arabian Standard Time",
5720 "text": "(UTC+04:00) Abu Dhabi, Muscat",
5728 "name": "Azerbaijan Standard Time",
5732 "text": "(UTC+04:00) Baku",
5738 "name": "Russian Standard Time",
5742 "text": "(UTC+04:00) Moscow, St. Petersburg, Volgograd",
5746 "Europe/Simferopol",
5751 "name": "Mauritius Standard Time",
5755 "text": "(UTC+04:00) Port Louis",
5763 "name": "Georgian Standard Time",
5767 "text": "(UTC+04:00) Tbilisi",
5773 "name": "Caucasus Standard Time",
5777 "text": "(UTC+04:00) Yerevan",
5783 "name": "Afghanistan Standard Time",
5787 "text": "(UTC+04:30) Kabul",
5793 "name": "West Asia Standard Time",
5797 "text": "(UTC+05:00) Ashgabat, Tashkent",
5799 "Antarctica/Mawson",
5813 "name": "Pakistan Standard Time",
5817 "text": "(UTC+05:00) Islamabad, Karachi",
5823 "name": "India Standard Time",
5827 "text": "(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",
5833 "name": "Sri Lanka Standard Time",
5837 "text": "(UTC+05:30) Sri Jayawardenepura",
5843 "name": "Nepal Standard Time",
5847 "text": "(UTC+05:45) Kathmandu",
5853 "name": "Central Asia Standard Time",
5857 "text": "(UTC+06:00) Astana",
5859 "Antarctica/Vostok",
5869 "name": "Bangladesh Standard Time",
5873 "text": "(UTC+06:00) Dhaka",
5880 "name": "Ekaterinburg Standard Time",
5884 "text": "(UTC+06:00) Ekaterinburg",
5886 "Asia/Yekaterinburg"
5890 "name": "Myanmar Standard Time",
5894 "text": "(UTC+06:30) Yangon (Rangoon)",
5901 "name": "SE Asia Standard Time",
5905 "text": "(UTC+07:00) Bangkok, Hanoi, Jakarta",
5920 "name": "N. Central Asia Standard Time",
5924 "text": "(UTC+07:00) Novosibirsk",
5926 "Asia/Novokuznetsk",
5932 "name": "China Standard Time",
5936 "text": "(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",
5944 "name": "North Asia Standard Time",
5948 "text": "(UTC+08:00) Krasnoyarsk",
5954 "name": "Singapore Standard Time",
5958 "text": "(UTC+08:00) Kuala Lumpur, Singapore",
5961 "Asia/Kuala_Lumpur",
5970 "name": "W. Australia Standard Time",
5974 "text": "(UTC+08:00) Perth",
5981 "name": "Taipei Standard Time",
5985 "text": "(UTC+08:00) Taipei",
5991 "name": "Ulaanbaatar Standard Time",
5995 "text": "(UTC+08:00) Ulaanbaatar",
6002 "name": "North Asia East Standard Time",
6006 "text": "(UTC+09:00) Irkutsk",
6012 "name": "Tokyo Standard Time",
6016 "text": "(UTC+09:00) Osaka, Sapporo, Tokyo",
6026 "name": "Korea Standard Time",
6030 "text": "(UTC+09:00) Seoul",
6037 "name": "Cen. Australia Standard Time",
6041 "text": "(UTC+09:30) Adelaide",
6043 "Australia/Adelaide",
6044 "Australia/Broken_Hill"
6048 "name": "AUS Central Standard Time",
6052 "text": "(UTC+09:30) Darwin",
6058 "name": "E. Australia Standard Time",
6062 "text": "(UTC+10:00) Brisbane",
6064 "Australia/Brisbane",
6065 "Australia/Lindeman"
6069 "name": "AUS Eastern Standard Time",
6073 "text": "(UTC+10:00) Canberra, Melbourne, Sydney",
6075 "Australia/Melbourne",
6080 "name": "West Pacific Standard Time",
6084 "text": "(UTC+10:00) Guam, Port Moresby",
6086 "Antarctica/DumontDUrville",
6089 "Pacific/Port_Moresby",
6095 "name": "Tasmania Standard Time",
6099 "text": "(UTC+10:00) Hobart",
6106 "name": "Yakutsk Standard Time",
6110 "text": "(UTC+10:00) Yakutsk",
6118 "name": "Central Pacific Standard Time",
6122 "text": "(UTC+11:00) Solomon Is., New Caledonia",
6124 "Antarctica/Macquarie",
6127 "Pacific/Guadalcanal",
6134 "name": "Vladivostok Standard Time",
6138 "text": "(UTC+11:00) Vladivostok",
6146 "name": "New Zealand Standard Time",
6150 "text": "(UTC+12:00) Auckland, Wellington",
6152 "Antarctica/McMurdo",
6161 "text": "(UTC+12:00) Coordinated Universal Time+12",
6165 "Pacific/Kwajalein",
6174 "name": "Fiji Standard Time",
6178 "text": "(UTC+12:00) Fiji",
6184 "name": "Magadan Standard Time",
6188 "text": "(UTC+12:00) Magadan",
6193 "Asia/Srednekolymsk"
6197 "name": "Kamchatka Standard Time",
6201 "text": "(UTC+12:00) Petropavlovsk-Kamchatsky - Old"
6204 "name": "Tonga Standard Time",
6208 "text": "(UTC+13:00) Nuku'alofa",
6211 "Pacific/Enderbury",
6217 "name": "Samoa Standard Time",
6221 "text": "(UTC+13:00) Samoa",
6227 //List source: http://answers.google.com/answers/threadview/id/589312.html
6232 "Account Executive",
6235 "Acquisition Analyst",
6236 "Administrative Asst.",
6237 "Administrative Analyst",
6239 "Advertising Director",
6240 "Aerospace Engineer",
6242 "Agricultural Inspector",
6243 "Agricultural Scientist",
6244 "Air Traffic Controller",
6257 "Bankruptcy Attorney",
6260 "Bio-feedback Specialist",
6261 "Biomedical Engineer",
6262 "Biotechnical Researcher",
6266 "Building Contractor",
6267 "Building Inspector",
6272 "Call Center Manager",
6276 "Chief Executive Officer",
6277 "Chief Operation Officer",
6279 "Chemical Engineer",
6281 "Child Care Manager",
6282 "Chief Medical Officer",
6285 "City Housing Manager",
6289 "Clinical Research Assistant",
6290 "Collections Manager.",
6291 "Compliance Manager",
6294 "Commercial Artist",
6295 "Communications Affairs Director",
6296 "Communications Director",
6297 "Communications Engineer",
6298 "Compensation Analyst",
6299 "Computer Programmer",
6300 "Computer Ops. Manager",
6301 "Computer Engineer",
6302 "Computer Operator",
6303 "Computer Graphics Specialist",
6304 "Construction Engineer",
6305 "Construction Manager",
6307 "Consumer Relations Manager",
6308 "Contract Administrator",
6309 "Copyright Attorney",
6311 "Corporate Planner",
6312 "Corrections Officer",
6316 "Chief Information Officer",
6317 "Chief Technology Officer",
6318 "Customer Service Manager",
6321 "Data Security Manager",
6323 "Day Care Instructor",
6327 "Desktop Publisher",
6329 "Development Officer",
6334 "Distribution Manager",
6335 "Diversity Manager",
6337 "EEO Compliance Manager",
6339 "Education Adminator",
6340 "Electrical Engineer",
6341 "Electro Optical Engineer",
6342 "Electronics Engineer",
6343 "Embassy Management",
6345 "Engineer Technician",
6347 "Environmental Analyst",
6348 "Environmental Attorney",
6349 "Environmental Engineer",
6350 "Environmental Specialist",
6353 "Executive Assistant",
6354 "Executive Director",
6355 "Executive Recruiter",
6356 "Facilities Manager",
6358 "Fashion Events Manager",
6359 "Fashion Merchandiser",
6360 "Fast Food Manager",
6362 "Film Production Assistant",
6363 "Financial Analyst",
6364 "Financial Planner",
6367 "Wildlife Specialist",
6368 "Fitness Consultant",
6372 "Food & Beverage Director",
6373 "Food Service Manager",
6374 "Forestry Technician",
6375 "Franchise Management",
6377 "Fraud Investigator",
6383 "Geriatric Specialist",
6385 "Glamour Photographer",
6386 "Golf Club Manager",
6390 "Hazardous Waste Manager",
6391 "Health Care Manager",
6393 "Health Service Administrator",
6397 "Hospital Administrator",
6399 "Human Resources Manager",
6401 "Industrial Designer",
6402 "Industrial Engineer",
6403 "Information Director",
6405 "Insurance Adjuster",
6406 "Interior Decorator",
6407 "Internal Controls Director",
6408 "International Acct.",
6409 "International Courier",
6410 "International Lawyer",
6413 "Investment Banker",
6414 "Investment Manager",
6416 "IT Project Manager",
6417 "IT Systems Analyst",
6419 "Joint Venture Manager",
6423 "Labor Relations Manager",
6424 "Lab Services Director",
6427 "Landscape Architect",
6428 "Law Enforcement Officer",
6430 "Lead Software Engineer",
6431 "Lead Software Test Engineer",
6435 "Litigation Attorney",
6438 "Logistics Manager",
6439 "Maintenance Manager",
6440 "Management Consultant",
6441 "Managed Care Director",
6443 "Manufacturing Director",
6446 "Market Res. Analyst",
6447 "Marketing Director",
6448 "Materials Manager",
6450 "Membership Chairman",
6452 "Mechanical Engineer",
6455 "Medical Secretary",
6456 "Medical Technician",
6457 "Mental Health Counselor",
6459 "Metallurgical Engineering",
6463 "Motion Picture Director",
6464 "Multimedia Director",
6466 "Network Administrator",
6467 "Network Specialist",
6469 "New Product Manager",
6472 "Nuclear Specialist",
6474 "Nursing Administrator",
6475 "Occupational Therapist",
6478 "Operations Manager",
6479 "Operations Research Director",
6480 "Optical Technician",
6482 "Organizational Development Manager",
6483 "Outplacement Specialist",
6487 "Payroll Specialist",
6488 "Personnel Specialist",
6489 "Petroleum Engineer",
6492 "Physical Therapist",
6494 "Physician Assistant",
6496 "Planning Director",
6498 "Political Analyst",
6499 "Political Scientist",
6501 "Portfolio Manager",
6502 "Preschool Management",
6503 "Preschool Teacher",
6506 "Private Investigator",
6507 "Probation Officer",
6512 "Production Engineer",
6513 "Production Planner",
6514 "Professional Athlete",
6515 "Professional Coach",
6521 "Public Administrator",
6522 "Public Safety Director",
6526 "Publishing Director",
6527 "Quality Assurance Specialist",
6528 "Quality Control Engineer",
6529 "Quality Control Inspector",
6530 "Radiology Manager",
6531 "Railroad Engineer",
6532 "Real Estate Broker",
6533 "Recreational Director",
6535 "Redevelopment Specialist",
6536 "Regulatory Affairs Manager",
6538 "Rehabilitation Counselor",
6539 "Relocation Manager",
6541 "Research Specialist",
6542 "Restaurant Manager",
6543 "Retail Store Manager",
6548 "Sales Promotion Manager",
6549 "Sales Representative",
6552 "Sanitation Engineer",
6553 "Scientific Programmer",
6554 "Scientific Writer",
6555 "Securities Analyst",
6556 "Security Consultant",
6557 "Security Director",
6558 "Seminar Presenter",
6562 "Social Program Planner",
6567 "Software Developer",
6568 "Software Engineer",
6569 "Software Test Engineer",
6571 "Special Events Manager",
6572 "Special Education Teacher",
6573 "Special Projects Director",
6574 "Speech Pathologist",
6576 "Sports Event Manager",
6579 "Strategic Alliance Director",
6580 "Strategic Planning Director",
6581 "Stress Reduction Specialist",
6584 "Structural Engineer",
6586 "Supply Chain Director",
6589 "Systems Programmer",
6590 "System Administrator",
6593 "Technical Support Specialist",
6594 "Technical Illustrator",
6596 "Technology Director",
6599 "Theatrical Director",
6602 "Tour Guide Director",
6604 "Trainer Translator",
6605 "Transportation Manager",
6610 "Union Representative",
6611 "University Administrator",
6615 "Vendor Relations Director",
6621 var o_hasOwnProperty
= Object
.prototype.hasOwnProperty
;
6622 var o_keys
= (Object
.keys
|| function(obj
) {
6624 for (var key
in obj
) {
6625 if (o_hasOwnProperty
.call(obj
, key
)) {
6633 function _copyObject(source
, target
) {
6634 var keys
= o_keys(source
);
6637 for (var i
= 0, l
= keys
.length
; i
< l
; i
++) {
6639 target
[key
] = source
[key
] || target
[key
];
6643 function _copyArray(source
, target
) {
6644 for (var i
= 0, l
= source
.length
; i
< l
; i
++) {
6645 target
[i
] = source
[i
];
6649 function copyObject(source
, _target
) {
6650 var isArray
= Array
.isArray(source
);
6651 var target
= _target
|| (isArray
? new Array(source
.length
) : {});
6654 _copyArray(source
, target
);
6656 _copyObject(source
, target
);
6662 /** Get the data based on key**/
6663 Chance
.prototype.get = function (name
) {
6664 return copyObject(data
[name
]);
6668 Chance
.prototype.mac_address = function(options
){
6669 // typically mac addresses are separated by ":"
6670 // however they can also be separated by "-"
6671 // the network variant uses a dot every fourth byte
6673 options
= initOptions(options
);
6674 if(!options
.separator
) {
6675 options
.separator
= options
.networkVersion
? "." : ":";
6678 var mac_pool
="ABCDEF1234567890",
6680 if(!options
.networkVersion
) {
6681 mac
= this.n(this.string
, 6, { pool
: mac_pool
, length
:2 }).join(options
.separator
);
6683 mac
= this.n(this.string
, 3, { pool
: mac_pool
, length
:4 }).join(options
.separator
);
6689 Chance
.prototype.normal = function (options
) {
6690 options
= initOptions(options
, {mean
: 0, dev
: 1, pool
: []});
6693 options
.pool
.constructor !== Array
,
6694 "Chance: The pool option must be a valid array."
6697 typeof options
.mean
!== 'number',
6698 "Chance: Mean (mean) must be a number"
6701 typeof options
.dev
!== 'number',
6702 "Chance: Standard deviation (dev) must be a number"
6705 // If a pool has been passed, then we are returning an item from that pool,
6706 // using the normal distribution settings that were passed in
6707 if (options
.pool
.length
> 0) {
6708 return this.normal_pool(options
);
6711 // The Marsaglia Polar method
6713 mean
= options
.mean
,
6717 // U and V are from the uniform distribution on (-1, 1)
6718 u
= this.random() * 2 - 1;
6719 v
= this.random() * 2 - 1;
6724 // Compute the standard normal variate
6725 norm
= u
* Math
.sqrt(-2 * Math
.log(s
) / s
);
6728 return dev
* norm
+ mean
;
6731 Chance
.prototype.normal_pool = function(options
) {
6732 var performanceCounter
= 0;
6734 var idx
= Math
.round(this.normal({ mean
: options
.mean
, dev
: options
.dev
}));
6735 if (idx
< options
.pool
.length
&& idx
>= 0) {
6736 return options
.pool
[idx
];
6738 performanceCounter
++;
6740 } while(performanceCounter
< 100);
6742 throw new RangeError("Chance: Your pool is too small for the given mean and standard deviation. Please adjust.");
6745 Chance
.prototype.radio = function (options
) {
6746 // Initial Letter (Typically Designated by Side of Mississippi River)
6747 options
= initOptions(options
, {side
: "?"});
6749 switch (options
.side
.toLowerCase()) {
6759 fl
= this.character({pool
: "KW"});
6763 return fl
+ this.character({alpha
: true, casing
: "upper"}) +
6764 this.character({alpha
: true, casing
: "upper"}) +
6765 this.character({alpha
: true, casing
: "upper"});
6768 // Set the data as key and data or the data map
6769 Chance
.prototype.set = function (name
, values
) {
6770 if (typeof name
=== "string") {
6771 data
[name
] = values
;
6773 data
= copyObject(name
, data
);
6777 Chance
.prototype.tv = function (options
) {
6778 return this.radio(options
);
6781 // ID number for Brazil companies
6782 Chance
.prototype.cnpj = function () {
6783 var n
= this.n(this.natural
, 8, { max
: 9 });
6784 var d1
= 2+n
[7]*6+n
[6]*7+n
[5]*8+n
[4]*9+n
[3]*2+n
[2]*3+n
[1]*4+n
[0]*5;
6785 d1
= 11 - (d1
% 11);
6789 var d2
= d1
*2+3+n
[7]*7+n
[6]*8+n
[5]*9+n
[4]*2+n
[3]*3+n
[2]*4+n
[1]*5+n
[0]*6;
6790 d2
= 11 - (d2
% 11);
6794 return ''+n
[0]+n
[1]+'.'+n
[2]+n
[3]+n
[4]+'.'+n
[5]+n
[6]+n
[7]+'/0001-'+d1
+d2
;
6797 // -- End Miscellaneous --
6799 Chance
.prototype.mersenne_twister = function (seed
) {
6800 return new MersenneTwister(seed
);
6803 Chance
.prototype.blueimp_md5 = function () {
6804 return new BlueImpMD5();
6807 // Mersenne Twister from https://gist.github.com/banksean/300494
6809 A C-program for MT19937, with initialization improved 2002/1/26.
6810 Coded by Takuji Nishimura and Makoto Matsumoto.
6812 Before using, initialize the state by using init_genrand(seed)
6813 or init_by_array(init_key, key_length).
6815 Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
6816 All rights reserved.
6818 Redistribution and use in source and binary forms, with or without
6819 modification, are permitted provided that the following conditions
6822 1. Redistributions of source code must retain the above copyright
6823 notice, this list of conditions and the following disclaimer.
6825 2. Redistributions in binary form must reproduce the above copyright
6826 notice, this list of conditions and the following disclaimer in the
6827 documentation and/or other materials provided with the distribution.
6829 3. The names of its contributors may not be used to endorse or promote
6830 products derived from this software without specific prior written
6833 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6834 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6835 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6836 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
6837 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
6838 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
6839 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
6840 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
6841 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
6842 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
6843 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6846 Any feedback is very welcome.
6847 http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
6848 email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
6850 var MersenneTwister = function (seed
) {
6851 if (seed
=== undefined) {
6852 // kept random number same size as time used previously to ensure no unexpected results downstream
6853 seed
= Math
.floor(Math
.random()*Math
.pow(10,13));
6855 /* Period parameters */
6858 this.MATRIX_A
= 0x9908b0df; /* constant vector a */
6859 this.UPPER_MASK
= 0x80000000; /* most significant w-r bits */
6860 this.LOWER_MASK
= 0x7fffffff; /* least significant r bits */
6862 this.mt
= new Array(this.N
); /* the array for the state vector */
6863 this.mti
= this.N
+ 1; /* mti==N + 1 means mt[N] is not initialized */
6865 this.init_genrand(seed
);
6868 /* initializes mt[N] with a seed */
6869 MersenneTwister
.prototype.init_genrand = function (s
) {
6870 this.mt
[0] = s
>>> 0;
6871 for (this.mti
= 1; this.mti
< this.N
; this.mti
++) {
6872 s
= this.mt
[this.mti
- 1] ^ (this.mt
[this.mti
- 1] >>> 30);
6873 this.mt
[this.mti
] = (((((s
& 0xffff0000) >>> 16) * 1812433253) << 16) + (s
& 0x0000ffff) * 1812433253) + this.mti
;
6874 /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
6875 /* In the previous versions, MSBs of the seed affect */
6876 /* only MSBs of the array mt[]. */
6877 /* 2002/01/09 modified by Makoto Matsumoto */
6878 this.mt
[this.mti
] >>>= 0;
6879 /* for >32 bit machines */
6883 /* initialize by an array with array-length */
6884 /* init_key is the array for initializing keys */
6885 /* key_length is its length */
6886 /* slight change for C++, 2004/2/26 */
6887 MersenneTwister.prototype.init_by_array = function (init_key, key_length) {
6888 var i = 1, j = 0, k, s;
6889 this.init_genrand(19650218);
6890 k = (this.N > key_length ? this.N : key_length);
6892 s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);
6893 this.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1664525) << 16) + ((s & 0x0000ffff) * 1664525))) + init_key[j] + j; /* non linear */
6894 this.mt
[i
] >>>= 0; /* for WORDSIZE > 32 machines */
6897 if (i
>= this.N
) { this.mt
[0] = this.mt
[this.N
- 1]; i
= 1; }
6898 if (j
>= key_length
) { j
= 0; }
6900 for (k
= this.N
- 1; k
; k
--) {
6901 s
= this.mt
[i
- 1] ^ (this.mt
[i
- 1] >>> 30);
6902 this.mt
[i
] = (this.mt
[i
] ^ (((((s
& 0xffff0000) >>> 16) * 1566083941) << 16) + (s
& 0x0000ffff) * 1566083941)) - i
; /* non linear */
6903 this.mt
[i
] >>>= 0; /* for WORDSIZE > 32 machines */
6905 if (i
>= this.N
) { this.mt
[0] = this.mt
[this.N
- 1]; i
= 1; }
6908 this.mt
[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */
6911 /* generates a random number on [0,0xffffffff]-interval */
6912 MersenneTwister
.prototype.genrand_int32 = function () {
6914 var mag01
= new Array(0x0, this.MATRIX_A
);
6915 /* mag01[x] = x * MATRIX_A for x=0,1 */
6917 if (this.mti
>= this.N
) { /* generate N words at one time */
6920 if (this.mti
=== this.N
+ 1) { /* if init_genrand() has not been called, */
6921 this.init_genrand(5489); /* a default initial seed is used */
6923 for (kk
= 0; kk
< this.N
- this.M
; kk
++) {
6924 y
= (this.mt
[kk
]&this.UPPER_MASK
)|(this.mt
[kk
+ 1]&this.LOWER_MASK
);
6925 this.mt
[kk
] = this.mt
[kk
+ this.M
] ^ (y
>>> 1) ^ mag01
[y
& 0x1];
6927 for (;kk
< this.N
- 1; kk
++) {
6928 y
= (this.mt
[kk
]&this.UPPER_MASK
)|(this.mt
[kk
+ 1]&this.LOWER_MASK
);
6929 this.mt
[kk
] = this.mt
[kk
+ (this.M
- this.N
)] ^ (y
>>> 1) ^ mag01
[y
& 0x1];
6931 y
= (this.mt
[this.N
- 1]&this.UPPER_MASK
)|(this.mt
[0]&this.LOWER_MASK
);
6932 this.mt
[this.N
- 1] = this.mt
[this.M
- 1] ^ (y
>>> 1) ^ mag01
[y
& 0x1];
6937 y
= this.mt
[this.mti
++];
6941 y
^= (y
<< 7) & 0x9d2c5680;
6942 y
^= (y
<< 15) & 0xefc60000;
6948 /* generates a random number on [0,0x7fffffff]-interval */
6949 MersenneTwister
.prototype.genrand_int31 = function () {
6950 return (this.genrand_int32() >>> 1);
6953 /* generates a random number on [0,1]-real-interval */
6954 MersenneTwister
.prototype.genrand_real1 = function () {
6955 return this.genrand_int32() * (1.0 / 4294967295.0);
6956 /* divided by 2^32-1 */
6959 /* generates a random number on [0,1)-real-interval */
6960 MersenneTwister
.prototype.random = function () {
6961 return this.genrand_int32() * (1.0 / 4294967296.0);
6962 /* divided by 2^32 */
6965 /* generates a random number on (0,1)-real-interval */
6966 MersenneTwister
.prototype.genrand_real3 = function () {
6967 return (this.genrand_int32() + 0.5) * (1.0 / 4294967296.0);
6968 /* divided by 2^32 */
6971 /* generates a random number on [0,1) with 53-bit resolution*/
6972 MersenneTwister
.prototype.genrand_res53 = function () {
6973 var a
= this.genrand_int32()>>>5, b
= this.genrand_int32()>>>6;
6974 return (a
* 67108864.0 + b
) * (1.0 / 9007199254740992.0);
6977 // BlueImp MD5 hashing algorithm from https://github.com/blueimp/JavaScript-MD5
6978 var BlueImpMD5 = function () {};
6980 BlueImpMD5
.prototype.VERSION
= '1.0.1';
6983 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
6984 * to work around bugs in some JS interpreters.
6986 BlueImpMD5
.prototype.safe_add
= function safe_add(x
, y
) {
6987 var lsw
= (x
& 0xFFFF) + (y
& 0xFFFF),
6988 msw
= (x
>> 16) + (y
>> 16) + (lsw
>> 16);
6989 return (msw
<< 16) | (lsw
& 0xFFFF);
6993 * Bitwise rotate a 32-bit number to the left.
6995 BlueImpMD5
.prototype.bit_roll = function (num
, cnt
) {
6996 return (num
<< cnt
) | (num
>>> (32 - cnt
));
7000 * These functions implement the five basic operations the algorithm uses.
7002 BlueImpMD5
.prototype.md5_cmn = function (q
, a
, b
, x
, s
, t
) {
7003 return this.safe_add(this.bit_roll(this.safe_add(this.safe_add(a
, q
), this.safe_add(x
, t
)), s
), b
);
7005 BlueImpMD5
.prototype.md5_ff = function (a
, b
, c
, d
, x
, s
, t
) {
7006 return this.md5_cmn((b
& c
) | ((~b
) & d
), a
, b
, x
, s
, t
);
7008 BlueImpMD5
.prototype.md5_gg = function (a
, b
, c
, d
, x
, s
, t
) {
7009 return this.md5_cmn((b
& d
) | (c
& (~d
)), a
, b
, x
, s
, t
);
7011 BlueImpMD5
.prototype.md5_hh = function (a
, b
, c
, d
, x
, s
, t
) {
7012 return this.md5_cmn(b
^ c
^ d
, a
, b
, x
, s
, t
);
7014 BlueImpMD5
.prototype.md5_ii = function (a
, b
, c
, d
, x
, s
, t
) {
7015 return this.md5_cmn(c
^ (b
| (~d
)), a
, b
, x
, s
, t
);
7019 * Calculate the MD5 of an array of little-endian words, and a bit length.
7021 BlueImpMD5
.prototype.binl_md5 = function (x
, len
) {
7022 /* append padding */
7023 x
[len
>> 5] |= 0x80 << (len
% 32);
7024 x
[(((len
+ 64) >>> 9) << 4) + 14] = len
;
7026 var i
, olda
, oldb
, oldc
, oldd
,
7032 for (i
= 0; i
< x
.length
; i
+= 16) {
7038 a
= this.md5_ff(a
, b
, c
, d
, x
[i
], 7, -680876936);
7039 d
= this.md5_ff(d
, a
, b
, c
, x
[i
+ 1], 12, -389564586);
7040 c
= this.md5_ff(c
, d
, a
, b
, x
[i
+ 2], 17, 606105819);
7041 b
= this.md5_ff(b
, c
, d
, a
, x
[i
+ 3], 22, -1044525330);
7042 a
= this.md5_ff(a
, b
, c
, d
, x
[i
+ 4], 7, -176418897);
7043 d
= this.md5_ff(d
, a
, b
, c
, x
[i
+ 5], 12, 1200080426);
7044 c
= this.md5_ff(c
, d
, a
, b
, x
[i
+ 6], 17, -1473231341);
7045 b
= this.md5_ff(b
, c
, d
, a
, x
[i
+ 7], 22, -45705983);
7046 a
= this.md5_ff(a
, b
, c
, d
, x
[i
+ 8], 7, 1770035416);
7047 d
= this.md5_ff(d
, a
, b
, c
, x
[i
+ 9], 12, -1958414417);
7048 c
= this.md5_ff(c
, d
, a
, b
, x
[i
+ 10], 17, -42063);
7049 b
= this.md5_ff(b
, c
, d
, a
, x
[i
+ 11], 22, -1990404162);
7050 a
= this.md5_ff(a
, b
, c
, d
, x
[i
+ 12], 7, 1804603682);
7051 d
= this.md5_ff(d
, a
, b
, c
, x
[i
+ 13], 12, -40341101);
7052 c
= this.md5_ff(c
, d
, a
, b
, x
[i
+ 14], 17, -1502002290);
7053 b
= this.md5_ff(b
, c
, d
, a
, x
[i
+ 15], 22, 1236535329);
7055 a
= this.md5_gg(a
, b
, c
, d
, x
[i
+ 1], 5, -165796510);
7056 d
= this.md5_gg(d
, a
, b
, c
, x
[i
+ 6], 9, -1069501632);
7057 c
= this.md5_gg(c
, d
, a
, b
, x
[i
+ 11], 14, 643717713);
7058 b
= this.md5_gg(b
, c
, d
, a
, x
[i
], 20, -373897302);
7059 a
= this.md5_gg(a
, b
, c
, d
, x
[i
+ 5], 5, -701558691);
7060 d
= this.md5_gg(d
, a
, b
, c
, x
[i
+ 10], 9, 38016083);
7061 c
= this.md5_gg(c
, d
, a
, b
, x
[i
+ 15], 14, -660478335);
7062 b
= this.md5_gg(b
, c
, d
, a
, x
[i
+ 4], 20, -405537848);
7063 a
= this.md5_gg(a
, b
, c
, d
, x
[i
+ 9], 5, 568446438);
7064 d
= this.md5_gg(d
, a
, b
, c
, x
[i
+ 14], 9, -1019803690);
7065 c
= this.md5_gg(c
, d
, a
, b
, x
[i
+ 3], 14, -187363961);
7066 b
= this.md5_gg(b
, c
, d
, a
, x
[i
+ 8], 20, 1163531501);
7067 a
= this.md5_gg(a
, b
, c
, d
, x
[i
+ 13], 5, -1444681467);
7068 d
= this.md5_gg(d
, a
, b
, c
, x
[i
+ 2], 9, -51403784);
7069 c
= this.md5_gg(c
, d
, a
, b
, x
[i
+ 7], 14, 1735328473);
7070 b
= this.md5_gg(b
, c
, d
, a
, x
[i
+ 12], 20, -1926607734);
7072 a
= this.md5_hh(a
, b
, c
, d
, x
[i
+ 5], 4, -378558);
7073 d
= this.md5_hh(d
, a
, b
, c
, x
[i
+ 8], 11, -2022574463);
7074 c
= this.md5_hh(c
, d
, a
, b
, x
[i
+ 11], 16, 1839030562);
7075 b
= this.md5_hh(b
, c
, d
, a
, x
[i
+ 14], 23, -35309556);
7076 a
= this.md5_hh(a
, b
, c
, d
, x
[i
+ 1], 4, -1530992060);
7077 d
= this.md5_hh(d
, a
, b
, c
, x
[i
+ 4], 11, 1272893353);
7078 c
= this.md5_hh(c
, d
, a
, b
, x
[i
+ 7], 16, -155497632);
7079 b
= this.md5_hh(b
, c
, d
, a
, x
[i
+ 10], 23, -1094730640);
7080 a
= this.md5_hh(a
, b
, c
, d
, x
[i
+ 13], 4, 681279174);
7081 d
= this.md5_hh(d
, a
, b
, c
, x
[i
], 11, -358537222);
7082 c
= this.md5_hh(c
, d
, a
, b
, x
[i
+ 3], 16, -722521979);
7083 b
= this.md5_hh(b
, c
, d
, a
, x
[i
+ 6], 23, 76029189);
7084 a
= this.md5_hh(a
, b
, c
, d
, x
[i
+ 9], 4, -640364487);
7085 d
= this.md5_hh(d
, a
, b
, c
, x
[i
+ 12], 11, -421815835);
7086 c
= this.md5_hh(c
, d
, a
, b
, x
[i
+ 15], 16, 530742520);
7087 b
= this.md5_hh(b
, c
, d
, a
, x
[i
+ 2], 23, -995338651);
7089 a
= this.md5_ii(a
, b
, c
, d
, x
[i
], 6, -198630844);
7090 d
= this.md5_ii(d
, a
, b
, c
, x
[i
+ 7], 10, 1126891415);
7091 c
= this.md5_ii(c
, d
, a
, b
, x
[i
+ 14], 15, -1416354905);
7092 b
= this.md5_ii(b
, c
, d
, a
, x
[i
+ 5], 21, -57434055);
7093 a
= this.md5_ii(a
, b
, c
, d
, x
[i
+ 12], 6, 1700485571);
7094 d
= this.md5_ii(d
, a
, b
, c
, x
[i
+ 3], 10, -1894986606);
7095 c
= this.md5_ii(c
, d
, a
, b
, x
[i
+ 10], 15, -1051523);
7096 b
= this.md5_ii(b
, c
, d
, a
, x
[i
+ 1], 21, -2054922799);
7097 a
= this.md5_ii(a
, b
, c
, d
, x
[i
+ 8], 6, 1873313359);
7098 d
= this.md5_ii(d
, a
, b
, c
, x
[i
+ 15], 10, -30611744);
7099 c
= this.md5_ii(c
, d
, a
, b
, x
[i
+ 6], 15, -1560198380);
7100 b
= this.md5_ii(b
, c
, d
, a
, x
[i
+ 13], 21, 1309151649);
7101 a
= this.md5_ii(a
, b
, c
, d
, x
[i
+ 4], 6, -145523070);
7102 d
= this.md5_ii(d
, a
, b
, c
, x
[i
+ 11], 10, -1120210379);
7103 c
= this.md5_ii(c
, d
, a
, b
, x
[i
+ 2], 15, 718787259);
7104 b
= this.md5_ii(b
, c
, d
, a
, x
[i
+ 9], 21, -343485551);
7106 a
= this.safe_add(a
, olda
);
7107 b
= this.safe_add(b
, oldb
);
7108 c
= this.safe_add(c
, oldc
);
7109 d
= this.safe_add(d
, oldd
);
7111 return [a
, b
, c
, d
];
7115 * Convert an array of little-endian words to a string
7117 BlueImpMD5
.prototype.binl2rstr = function (input
) {
7120 for (i
= 0; i
< input
.length
* 32; i
+= 8) {
7121 output
+= String
.fromCharCode((input
[i
>> 5] >>> (i
% 32)) & 0xFF);
7127 * Convert a raw string to an array of little-endian words
7128 * Characters >255 have their high-byte silently ignored.
7130 BlueImpMD5
.prototype.rstr2binl = function (input
) {
7133 output
[(input
.length
>> 2) - 1] = undefined;
7134 for (i
= 0; i
< output
.length
; i
+= 1) {
7137 for (i
= 0; i
< input
.length
* 8; i
+= 8) {
7138 output
[i
>> 5] |= (input
.charCodeAt(i
/ 8) & 0xFF) << (i
% 32);
7144 * Calculate the MD5 of a raw string
7146 BlueImpMD5
.prototype.rstr_md5 = function (s
) {
7147 return this.binl2rstr(this.binl_md5(this.rstr2binl(s
), s
.length
* 8));
7151 * Calculate the HMAC-MD5, of a key and some data (raw strings)
7153 BlueImpMD5
.prototype.rstr_hmac_md5 = function (key
, data
) {
7155 bkey
= this.rstr2binl(key
),
7159 ipad
[15] = opad
[15] = undefined;
7160 if (bkey
.length
> 16) {
7161 bkey
= this.binl_md5(bkey
, key
.length
* 8);
7163 for (i
= 0; i
< 16; i
+= 1) {
7164 ipad
[i
] = bkey
[i
] ^ 0x36363636;
7165 opad
[i
] = bkey
[i
] ^ 0x5C5C5C5C;
7167 hash
= this.binl_md5(ipad
.concat(this.rstr2binl(data
)), 512 + data
.length
* 8);
7168 return this.binl2rstr(this.binl_md5(opad
.concat(hash
), 512 + 128));
7172 * Convert a raw string to a hex string
7174 BlueImpMD5
.prototype.rstr2hex = function (input
) {
7175 var hex_tab
= '0123456789abcdef',
7179 for (i
= 0; i
< input
.length
; i
+= 1) {
7180 x
= input
.charCodeAt(i
);
7181 output
+= hex_tab
.charAt((x
>>> 4) & 0x0F) +
7182 hex_tab
.charAt(x
& 0x0F);
7188 * Encode a string as utf-8
7190 BlueImpMD5
.prototype.str2rstr_utf8 = function (input
) {
7191 return unescape(encodeURIComponent(input
));
7195 * Take string arguments and return either raw or hex encoded strings
7197 BlueImpMD5
.prototype.raw_md5 = function (s
) {
7198 return this.rstr_md5(this.str2rstr_utf8(s
));
7200 BlueImpMD5
.prototype.hex_md5 = function (s
) {
7201 return this.rstr2hex(this.raw_md5(s
));
7203 BlueImpMD5
.prototype.raw_hmac_md5 = function (k
, d
) {
7204 return this.rstr_hmac_md5(this.str2rstr_utf8(k
), this.str2rstr_utf8(d
));
7206 BlueImpMD5
.prototype.hex_hmac_md5 = function (k
, d
) {
7207 return this.rstr2hex(this.raw_hmac_md5(k
, d
));
7210 BlueImpMD5
.prototype.md5 = function (string
, key
, raw
) {
7213 return this.hex_md5(string
);
7216 return this.raw_md5(string
);
7220 return this.hex_hmac_md5(key
, string
);
7223 return this.raw_hmac_md5(key
, string
);
7227 if (typeof exports
!== 'undefined') {
7228 if (typeof module
!== 'undefined' && module
.exports
) {
7229 exports
= module
.exports
= Chance
;
7231 exports
.Chance
= Chance
;
7234 // Register as an anonymous AMD module
7235 if (typeof define
=== 'function' && define
.amd
) {
7236 define([], function () {
7241 // if there is a importsScrips object define chance for worker
7242 // allows worker to use full Chance functionality with seed
7243 if (typeof importScripts
!== 'undefined') {
7244 chance
= new Chance();
7245 self
.Chance
= Chance
;
7248 // If there is a window object, that at least has a document property,
7249 // instantiate and define chance on the window
7250 if (typeof window
=== "object" && typeof window
.document
=== "object") {
7251 window
.Chance
= Chance
;
7252 window
.chance
= new Chance();