aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--bip39-standalone.html76381
-rw-r--r--changelog.md80
-rw-r--r--readme.md3
-rw-r--r--src/css/app.css3
-rw-r--r--src/index.html264
-rw-r--r--src/js/bchaddrjs-0.2.1.js9328
-rw-r--r--src/js/bitcoinjs-3.3.2.js15168
-rw-r--r--src/js/bitcoinjs-bip38-2.0.2.js (renamed from src/js/bitcoinjs-3.3.0.js)29208
-rw-r--r--src/js/bitcoinjs-extensions.js1176
-rw-r--r--src/js/index.js1090
-rw-r--r--src/js/jsbip39.js9
-rw-r--r--src/js/segwit-parameters.js154
-rw-r--r--src/js/unorm.js3
-rw-r--r--src/js/wordlist_korean.js2051
-rw-r--r--tests/spec/tests.js1012
16 files changed, 46729 insertions, 89202 deletions
diff --git a/.gitignore b/.gitignore
index 3c3629e..f17d88e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
1node_modules 1node_modules
2bip39-standalone.html
diff --git a/bip39-standalone.html b/bip39-standalone.html
deleted file mode 100644
index d5c207f..0000000
--- a/bip39-standalone.html
+++ /dev/null
@@ -1,76381 +0,0 @@
1<!DOCTYPE html>
2<html>
3 <head lang="en">
4 <meta charset="utf-8" />
5 <title>BIP39 - Mnemonic Code</title>
6 <style>/*!
7 * Bootstrap v3.3.7 (http://getbootstrap.com)
8 * Copyright 2011-2016 Twitter, Inc.
9 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
10 */
11/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
12html {
13 font-family: sans-serif;
14 -webkit-text-size-adjust: 100%;
15 -ms-text-size-adjust: 100%;
16}
17body {
18 margin: 0;
19}
20article,
21aside,
22details,
23figcaption,
24figure,
25footer,
26header,
27hgroup,
28main,
29menu,
30nav,
31section,
32summary {
33 display: block;
34}
35audio,
36canvas,
37progress,
38video {
39 display: inline-block;
40 vertical-align: baseline;
41}
42audio:not([controls]) {
43 display: none;
44 height: 0;
45}
46[hidden],
47template {
48 display: none;
49}
50a {
51 background-color: transparent;
52}
53a:active,
54a:hover {
55 outline: 0;
56}
57abbr[title] {
58 border-bottom: 1px dotted;
59}
60b,
61strong {
62 font-weight: bold;
63}
64dfn {
65 font-style: italic;
66}
67h1 {
68 margin: .67em 0;
69 font-size: 2em;
70}
71mark {
72 color: #000;
73 background: #ff0;
74}
75small {
76 font-size: 80%;
77}
78sub,
79sup {
80 position: relative;
81 font-size: 75%;
82 line-height: 0;
83 vertical-align: baseline;
84}
85sup {
86 top: -.5em;
87}
88sub {
89 bottom: -.25em;
90}
91img {
92 border: 0;
93}
94svg:not(:root) {
95 overflow: hidden;
96}
97figure {
98 margin: 1em 40px;
99}
100hr {
101 height: 0;
102 -webkit-box-sizing: content-box;
103 -moz-box-sizing: content-box;
104 box-sizing: content-box;
105}
106pre {
107 overflow: auto;
108}
109code,
110kbd,
111pre,
112samp {
113 font-family: monospace, monospace;
114 font-size: 1em;
115}
116button,
117input,
118optgroup,
119select,
120textarea {
121 margin: 0;
122 font: inherit;
123 color: inherit;
124}
125button {
126 overflow: visible;
127}
128button,
129select {
130 text-transform: none;
131}
132button,
133html input[type="button"],
134input[type="reset"],
135input[type="submit"] {
136 -webkit-appearance: button;
137 cursor: pointer;
138}
139button[disabled],
140html input[disabled] {
141 cursor: default;
142}
143button::-moz-focus-inner,
144input::-moz-focus-inner {
145 padding: 0;
146 border: 0;
147}
148input {
149 line-height: normal;
150}
151input[type="checkbox"],
152input[type="radio"] {
153 -webkit-box-sizing: border-box;
154 -moz-box-sizing: border-box;
155 box-sizing: border-box;
156 padding: 0;
157}
158input[type="number"]::-webkit-inner-spin-button,
159input[type="number"]::-webkit-outer-spin-button {
160 height: auto;
161}
162input[type="search"] {
163 -webkit-box-sizing: content-box;
164 -moz-box-sizing: content-box;
165 box-sizing: content-box;
166 -webkit-appearance: textfield;
167}
168input[type="search"]::-webkit-search-cancel-button,
169input[type="search"]::-webkit-search-decoration {
170 -webkit-appearance: none;
171}
172fieldset {
173 padding: .35em .625em .75em;
174 margin: 0 2px;
175 border: 1px solid #c0c0c0;
176}
177legend {
178 padding: 0;
179 border: 0;
180}
181textarea {
182 overflow: auto;
183}
184optgroup {
185 font-weight: bold;
186}
187table {
188 border-spacing: 0;
189 border-collapse: collapse;
190}
191td,
192th {
193 padding: 0;
194}
195/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
196@media print {
197 *,
198 *:before,
199 *:after {
200 color: #000 !important;
201 text-shadow: none !important;
202 background: transparent !important;
203 -webkit-box-shadow: none !important;
204 box-shadow: none !important;
205 }
206 a,
207 a:visited {
208 text-decoration: underline;
209 }
210 a[href]:after {
211 content: " (" attr(href) ")";
212 }
213 abbr[title]:after {
214 content: " (" attr(title) ")";
215 }
216 a[href^="#"]:after,
217 a[href^="javascript:"]:after {
218 content: "";
219 }
220 pre,
221 blockquote {
222 border: 1px solid #999;
223
224 page-break-inside: avoid;
225 }
226 thead {
227 display: table-header-group;
228 }
229 tr,
230 img {
231 page-break-inside: avoid;
232 }
233 img {
234 max-width: 100% !important;
235 }
236 p,
237 h2,
238 h3 {
239 orphans: 3;
240 widows: 3;
241 }
242 h2,
243 h3 {
244 page-break-after: avoid;
245 }
246 .navbar {
247 display: none;
248 }
249 .btn > .caret,
250 .dropup > .btn > .caret {
251 border-top-color: #000 !important;
252 }
253 .label {
254 border: 1px solid #000;
255 }
256 .table {
257 border-collapse: collapse !important;
258 }
259 .table td,
260 .table th {
261 background-color: #fff !important;
262 }
263 .table-bordered th,
264 .table-bordered td {
265 border: 1px solid #ddd !important;
266 }
267}
268@font-face {
269 font-family: 'Glyphicons Halflings';
270
271 src: url('../fonts/glyphicons-halflings-regular.eot');
272 src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
273}
274.glyphicon {
275 position: relative;
276 top: 1px;
277 display: inline-block;
278 font-family: 'Glyphicons Halflings';
279 font-style: normal;
280 font-weight: normal;
281 line-height: 1;
282
283 -webkit-font-smoothing: antialiased;
284 -moz-osx-font-smoothing: grayscale;
285}
286.glyphicon-asterisk:before {
287 content: "\002a";
288}
289.glyphicon-plus:before {
290 content: "\002b";
291}
292.glyphicon-euro:before,
293.glyphicon-eur:before {
294 content: "\20ac";
295}
296.glyphicon-minus:before {
297 content: "\2212";
298}
299.glyphicon-cloud:before {
300 content: "\2601";
301}
302.glyphicon-envelope:before {
303 content: "\2709";
304}
305.glyphicon-pencil:before {
306 content: "\270f";
307}
308.glyphicon-glass:before {
309 content: "\e001";
310}
311.glyphicon-music:before {
312 content: "\e002";
313}
314.glyphicon-search:before {
315 content: "\e003";
316}
317.glyphicon-heart:before {
318 content: "\e005";
319}
320.glyphicon-star:before {
321 content: "\e006";
322}
323.glyphicon-star-empty:before {
324 content: "\e007";
325}
326.glyphicon-user:before {
327 content: "\e008";
328}
329.glyphicon-film:before {
330 content: "\e009";
331}
332.glyphicon-th-large:before {
333 content: "\e010";
334}
335.glyphicon-th:before {
336 content: "\e011";
337}
338.glyphicon-th-list:before {
339 content: "\e012";
340}
341.glyphicon-ok:before {
342 content: "\e013";
343}
344.glyphicon-remove:before {
345 content: "\e014";
346}
347.glyphicon-zoom-in:before {
348 content: "\e015";
349}
350.glyphicon-zoom-out:before {
351 content: "\e016";
352}
353.glyphicon-off:before {
354 content: "\e017";
355}
356.glyphicon-signal:before {
357 content: "\e018";
358}
359.glyphicon-cog:before {
360 content: "\e019";
361}
362.glyphicon-trash:before {
363 content: "\e020";
364}
365.glyphicon-home:before {
366 content: "\e021";
367}
368.glyphicon-file:before {
369 content: "\e022";
370}
371.glyphicon-time:before {
372 content: "\e023";
373}
374.glyphicon-road:before {
375 content: "\e024";
376}
377.glyphicon-download-alt:before {
378 content: "\e025";
379}
380.glyphicon-download:before {
381 content: "\e026";
382}
383.glyphicon-upload:before {
384 content: "\e027";
385}
386.glyphicon-inbox:before {
387 content: "\e028";
388}
389.glyphicon-play-circle:before {
390 content: "\e029";
391}
392.glyphicon-repeat:before {
393 content: "\e030";
394}
395.glyphicon-refresh:before {
396 content: "\e031";
397}
398.glyphicon-list-alt:before {
399 content: "\e032";
400}
401.glyphicon-lock:before {
402 content: "\e033";
403}
404.glyphicon-flag:before {
405 content: "\e034";
406}
407.glyphicon-headphones:before {
408 content: "\e035";
409}
410.glyphicon-volume-off:before {
411 content: "\e036";
412}
413.glyphicon-volume-down:before {
414 content: "\e037";
415}
416.glyphicon-volume-up:before {
417 content: "\e038";
418}
419.glyphicon-qrcode:before {
420 content: "\e039";
421}
422.glyphicon-barcode:before {
423 content: "\e040";
424}
425.glyphicon-tag:before {
426 content: "\e041";
427}
428.glyphicon-tags:before {
429 content: "\e042";
430}
431.glyphicon-book:before {
432 content: "\e043";
433}
434.glyphicon-bookmark:before {
435 content: "\e044";
436}
437.glyphicon-print:before {
438 content: "\e045";
439}
440.glyphicon-camera:before {
441 content: "\e046";
442}
443.glyphicon-font:before {
444 content: "\e047";
445}
446.glyphicon-bold:before {
447 content: "\e048";
448}
449.glyphicon-italic:before {
450 content: "\e049";
451}
452.glyphicon-text-height:before {
453 content: "\e050";
454}
455.glyphicon-text-width:before {
456 content: "\e051";
457}
458.glyphicon-align-left:before {
459 content: "\e052";
460}
461.glyphicon-align-center:before {
462 content: "\e053";
463}
464.glyphicon-align-right:before {
465 content: "\e054";
466}
467.glyphicon-align-justify:before {
468 content: "\e055";
469}
470.glyphicon-list:before {
471 content: "\e056";
472}
473.glyphicon-indent-left:before {
474 content: "\e057";
475}
476.glyphicon-indent-right:before {
477 content: "\e058";
478}
479.glyphicon-facetime-video:before {
480 content: "\e059";
481}
482.glyphicon-picture:before {
483 content: "\e060";
484}
485.glyphicon-map-marker:before {
486 content: "\e062";
487}
488.glyphicon-adjust:before {
489 content: "\e063";
490}
491.glyphicon-tint:before {
492 content: "\e064";
493}
494.glyphicon-edit:before {
495 content: "\e065";
496}
497.glyphicon-share:before {
498 content: "\e066";
499}
500.glyphicon-check:before {
501 content: "\e067";
502}
503.glyphicon-move:before {
504 content: "\e068";
505}
506.glyphicon-step-backward:before {
507 content: "\e069";
508}
509.glyphicon-fast-backward:before {
510 content: "\e070";
511}
512.glyphicon-backward:before {
513 content: "\e071";
514}
515.glyphicon-play:before {
516 content: "\e072";
517}
518.glyphicon-pause:before {
519 content: "\e073";
520}
521.glyphicon-stop:before {
522 content: "\e074";
523}
524.glyphicon-forward:before {
525 content: "\e075";
526}
527.glyphicon-fast-forward:before {
528 content: "\e076";
529}
530.glyphicon-step-forward:before {
531 content: "\e077";
532}
533.glyphicon-eject:before {
534 content: "\e078";
535}
536.glyphicon-chevron-left:before {
537 content: "\e079";
538}
539.glyphicon-chevron-right:before {
540 content: "\e080";
541}
542.glyphicon-plus-sign:before {
543 content: "\e081";
544}
545.glyphicon-minus-sign:before {
546 content: "\e082";
547}
548.glyphicon-remove-sign:before {
549 content: "\e083";
550}
551.glyphicon-ok-sign:before {
552 content: "\e084";
553}
554.glyphicon-question-sign:before {
555 content: "\e085";
556}
557.glyphicon-info-sign:before {
558 content: "\e086";
559}
560.glyphicon-screenshot:before {
561 content: "\e087";
562}
563.glyphicon-remove-circle:before {
564 content: "\e088";
565}
566.glyphicon-ok-circle:before {
567 content: "\e089";
568}
569.glyphicon-ban-circle:before {
570 content: "\e090";
571}
572.glyphicon-arrow-left:before {
573 content: "\e091";
574}
575.glyphicon-arrow-right:before {
576 content: "\e092";
577}
578.glyphicon-arrow-up:before {
579 content: "\e093";
580}
581.glyphicon-arrow-down:before {
582 content: "\e094";
583}
584.glyphicon-share-alt:before {
585 content: "\e095";
586}
587.glyphicon-resize-full:before {
588 content: "\e096";
589}
590.glyphicon-resize-small:before {
591 content: "\e097";
592}
593.glyphicon-exclamation-sign:before {
594 content: "\e101";
595}
596.glyphicon-gift:before {
597 content: "\e102";
598}
599.glyphicon-leaf:before {
600 content: "\e103";
601}
602.glyphicon-fire:before {
603 content: "\e104";
604}
605.glyphicon-eye-open:before {
606 content: "\e105";
607}
608.glyphicon-eye-close:before {
609 content: "\e106";
610}
611.glyphicon-warning-sign:before {
612 content: "\e107";
613}
614.glyphicon-plane:before {
615 content: "\e108";
616}
617.glyphicon-calendar:before {
618 content: "\e109";
619}
620.glyphicon-random:before {
621 content: "\e110";
622}
623.glyphicon-comment:before {
624 content: "\e111";
625}
626.glyphicon-magnet:before {
627 content: "\e112";
628}
629.glyphicon-chevron-up:before {
630 content: "\e113";
631}
632.glyphicon-chevron-down:before {
633 content: "\e114";
634}
635.glyphicon-retweet:before {
636 content: "\e115";
637}
638.glyphicon-shopping-cart:before {
639 content: "\e116";
640}
641.glyphicon-folder-close:before {
642 content: "\e117";
643}
644.glyphicon-folder-open:before {
645 content: "\e118";
646}
647.glyphicon-resize-vertical:before {
648 content: "\e119";
649}
650.glyphicon-resize-horizontal:before {
651 content: "\e120";
652}
653.glyphicon-hdd:before {
654 content: "\e121";
655}
656.glyphicon-bullhorn:before {
657 content: "\e122";
658}
659.glyphicon-bell:before {
660 content: "\e123";
661}
662.glyphicon-certificate:before {
663 content: "\e124";
664}
665.glyphicon-thumbs-up:before {
666 content: "\e125";
667}
668.glyphicon-thumbs-down:before {
669 content: "\e126";
670}
671.glyphicon-hand-right:before {
672 content: "\e127";
673}
674.glyphicon-hand-left:before {
675 content: "\e128";
676}
677.glyphicon-hand-up:before {
678 content: "\e129";
679}
680.glyphicon-hand-down:before {
681 content: "\e130";
682}
683.glyphicon-circle-arrow-right:before {
684 content: "\e131";
685}
686.glyphicon-circle-arrow-left:before {
687 content: "\e132";
688}
689.glyphicon-circle-arrow-up:before {
690 content: "\e133";
691}
692.glyphicon-circle-arrow-down:before {
693 content: "\e134";
694}
695.glyphicon-globe:before {
696 content: "\e135";
697}
698.glyphicon-wrench:before {
699 content: "\e136";
700}
701.glyphicon-tasks:before {
702 content: "\e137";
703}
704.glyphicon-filter:before {
705 content: "\e138";
706}
707.glyphicon-briefcase:before {
708 content: "\e139";
709}
710.glyphicon-fullscreen:before {
711 content: "\e140";
712}
713.glyphicon-dashboard:before {
714 content: "\e141";
715}
716.glyphicon-paperclip:before {
717 content: "\e142";
718}
719.glyphicon-heart-empty:before {
720 content: "\e143";
721}
722.glyphicon-link:before {
723 content: "\e144";
724}
725.glyphicon-phone:before {
726 content: "\e145";
727}
728.glyphicon-pushpin:before {
729 content: "\e146";
730}
731.glyphicon-usd:before {
732 content: "\e148";
733}
734.glyphicon-gbp:before {
735 content: "\e149";
736}
737.glyphicon-sort:before {
738 content: "\e150";
739}
740.glyphicon-sort-by-alphabet:before {
741 content: "\e151";
742}
743.glyphicon-sort-by-alphabet-alt:before {
744 content: "\e152";
745}
746.glyphicon-sort-by-order:before {
747 content: "\e153";
748}
749.glyphicon-sort-by-order-alt:before {
750 content: "\e154";
751}
752.glyphicon-sort-by-attributes:before {
753 content: "\e155";
754}
755.glyphicon-sort-by-attributes-alt:before {
756 content: "\e156";
757}
758.glyphicon-unchecked:before {
759 content: "\e157";
760}
761.glyphicon-expand:before {
762 content: "\e158";
763}
764.glyphicon-collapse-down:before {
765 content: "\e159";
766}
767.glyphicon-collapse-up:before {
768 content: "\e160";
769}
770.glyphicon-log-in:before {
771 content: "\e161";
772}
773.glyphicon-flash:before {
774 content: "\e162";
775}
776.glyphicon-log-out:before {
777 content: "\e163";
778}
779.glyphicon-new-window:before {
780 content: "\e164";
781}
782.glyphicon-record:before {
783 content: "\e165";
784}
785.glyphicon-save:before {
786 content: "\e166";
787}
788.glyphicon-open:before {
789 content: "\e167";
790}
791.glyphicon-saved:before {
792 content: "\e168";
793}
794.glyphicon-import:before {
795 content: "\e169";
796}
797.glyphicon-export:before {
798 content: "\e170";
799}
800.glyphicon-send:before {
801 content: "\e171";
802}
803.glyphicon-floppy-disk:before {
804 content: "\e172";
805}
806.glyphicon-floppy-saved:before {
807 content: "\e173";
808}
809.glyphicon-floppy-remove:before {
810 content: "\e174";
811}
812.glyphicon-floppy-save:before {
813 content: "\e175";
814}
815.glyphicon-floppy-open:before {
816 content: "\e176";
817}
818.glyphicon-credit-card:before {
819 content: "\e177";
820}
821.glyphicon-transfer:before {
822 content: "\e178";
823}
824.glyphicon-cutlery:before {
825 content: "\e179";
826}
827.glyphicon-header:before {
828 content: "\e180";
829}
830.glyphicon-compressed:before {
831 content: "\e181";
832}
833.glyphicon-earphone:before {
834 content: "\e182";
835}
836.glyphicon-phone-alt:before {
837 content: "\e183";
838}
839.glyphicon-tower:before {
840 content: "\e184";
841}
842.glyphicon-stats:before {
843 content: "\e185";
844}
845.glyphicon-sd-video:before {
846 content: "\e186";
847}
848.glyphicon-hd-video:before {
849 content: "\e187";
850}
851.glyphicon-subtitles:before {
852 content: "\e188";
853}
854.glyphicon-sound-stereo:before {
855 content: "\e189";
856}
857.glyphicon-sound-dolby:before {
858 content: "\e190";
859}
860.glyphicon-sound-5-1:before {
861 content: "\e191";
862}
863.glyphicon-sound-6-1:before {
864 content: "\e192";
865}
866.glyphicon-sound-7-1:before {
867 content: "\e193";
868}
869.glyphicon-copyright-mark:before {
870 content: "\e194";
871}
872.glyphicon-registration-mark:before {
873 content: "\e195";
874}
875.glyphicon-cloud-download:before {
876 content: "\e197";
877}
878.glyphicon-cloud-upload:before {
879 content: "\e198";
880}
881.glyphicon-tree-conifer:before {
882 content: "\e199";
883}
884.glyphicon-tree-deciduous:before {
885 content: "\e200";
886}
887.glyphicon-cd:before {
888 content: "\e201";
889}
890.glyphicon-save-file:before {
891 content: "\e202";
892}
893.glyphicon-open-file:before {
894 content: "\e203";
895}
896.glyphicon-level-up:before {
897 content: "\e204";
898}
899.glyphicon-copy:before {
900 content: "\e205";
901}
902.glyphicon-paste:before {
903 content: "\e206";
904}
905.glyphicon-alert:before {
906 content: "\e209";
907}
908.glyphicon-equalizer:before {
909 content: "\e210";
910}
911.glyphicon-king:before {
912 content: "\e211";
913}
914.glyphicon-queen:before {
915 content: "\e212";
916}
917.glyphicon-pawn:before {
918 content: "\e213";
919}
920.glyphicon-bishop:before {
921 content: "\e214";
922}
923.glyphicon-knight:before {
924 content: "\e215";
925}
926.glyphicon-baby-formula:before {
927 content: "\e216";
928}
929.glyphicon-tent:before {
930 content: "\26fa";
931}
932.glyphicon-blackboard:before {
933 content: "\e218";
934}
935.glyphicon-bed:before {
936 content: "\e219";
937}
938.glyphicon-apple:before {
939 content: "\f8ff";
940}
941.glyphicon-erase:before {
942 content: "\e221";
943}
944.glyphicon-hourglass:before {
945 content: "\231b";
946}
947.glyphicon-lamp:before {
948 content: "\e223";
949}
950.glyphicon-duplicate:before {
951 content: "\e224";
952}
953.glyphicon-piggy-bank:before {
954 content: "\e225";
955}
956.glyphicon-scissors:before {
957 content: "\e226";
958}
959.glyphicon-bitcoin:before {
960 content: "\e227";
961}
962.glyphicon-btc:before {
963 content: "\e227";
964}
965.glyphicon-xbt:before {
966 content: "\e227";
967}
968.glyphicon-yen:before {
969 content: "\00a5";
970}
971.glyphicon-jpy:before {
972 content: "\00a5";
973}
974.glyphicon-ruble:before {
975 content: "\20bd";
976}
977.glyphicon-rub:before {
978 content: "\20bd";
979}
980.glyphicon-scale:before {
981 content: "\e230";
982}
983.glyphicon-ice-lolly:before {
984 content: "\e231";
985}
986.glyphicon-ice-lolly-tasted:before {
987 content: "\e232";
988}
989.glyphicon-education:before {
990 content: "\e233";
991}
992.glyphicon-option-horizontal:before {
993 content: "\e234";
994}
995.glyphicon-option-vertical:before {
996 content: "\e235";
997}
998.glyphicon-menu-hamburger:before {
999 content: "\e236";
1000}
1001.glyphicon-modal-window:before {
1002 content: "\e237";
1003}
1004.glyphicon-oil:before {
1005 content: "\e238";
1006}
1007.glyphicon-grain:before {
1008 content: "\e239";
1009}
1010.glyphicon-sunglasses:before {
1011 content: "\e240";
1012}
1013.glyphicon-text-size:before {
1014 content: "\e241";
1015}
1016.glyphicon-text-color:before {
1017 content: "\e242";
1018}
1019.glyphicon-text-background:before {
1020 content: "\e243";
1021}
1022.glyphicon-object-align-top:before {
1023 content: "\e244";
1024}
1025.glyphicon-object-align-bottom:before {
1026 content: "\e245";
1027}
1028.glyphicon-object-align-horizontal:before {
1029 content: "\e246";
1030}
1031.glyphicon-object-align-left:before {
1032 content: "\e247";
1033}
1034.glyphicon-object-align-vertical:before {
1035 content: "\e248";
1036}
1037.glyphicon-object-align-right:before {
1038 content: "\e249";
1039}
1040.glyphicon-triangle-right:before {
1041 content: "\e250";
1042}
1043.glyphicon-triangle-left:before {
1044 content: "\e251";
1045}
1046.glyphicon-triangle-bottom:before {
1047 content: "\e252";
1048}
1049.glyphicon-triangle-top:before {
1050 content: "\e253";
1051}
1052.glyphicon-console:before {
1053 content: "\e254";
1054}
1055.glyphicon-superscript:before {
1056 content: "\e255";
1057}
1058.glyphicon-subscript:before {
1059 content: "\e256";
1060}
1061.glyphicon-menu-left:before {
1062 content: "\e257";
1063}
1064.glyphicon-menu-right:before {
1065 content: "\e258";
1066}
1067.glyphicon-menu-down:before {
1068 content: "\e259";
1069}
1070.glyphicon-menu-up:before {
1071 content: "\e260";
1072}
1073* {
1074 -webkit-box-sizing: border-box;
1075 -moz-box-sizing: border-box;
1076 box-sizing: border-box;
1077}
1078*:before,
1079*:after {
1080 -webkit-box-sizing: border-box;
1081 -moz-box-sizing: border-box;
1082 box-sizing: border-box;
1083}
1084html {
1085 font-size: 10px;
1086
1087 -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
1088}
1089body {
1090 font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
1091 font-size: 14px;
1092 line-height: 1.42857143;
1093 color: #333;
1094 background-color: #fff;
1095}
1096input,
1097button,
1098select,
1099textarea {
1100 font-family: inherit;
1101 font-size: inherit;
1102 line-height: inherit;
1103}
1104a {
1105 color: #337ab7;
1106 text-decoration: none;
1107}
1108a:hover,
1109a:focus {
1110 color: #23527c;
1111 text-decoration: underline;
1112}
1113a:focus {
1114 outline: 5px auto -webkit-focus-ring-color;
1115 outline-offset: -2px;
1116}
1117figure {
1118 margin: 0;
1119}
1120img {
1121 vertical-align: middle;
1122}
1123.img-responsive,
1124.thumbnail > img,
1125.thumbnail a > img,
1126.carousel-inner > .item > img,
1127.carousel-inner > .item > a > img {
1128 display: block;
1129 max-width: 100%;
1130 height: auto;
1131}
1132.img-rounded {
1133 border-radius: 6px;
1134}
1135.img-thumbnail {
1136 display: inline-block;
1137 max-width: 100%;
1138 height: auto;
1139 padding: 4px;
1140 line-height: 1.42857143;
1141 background-color: #fff;
1142 border: 1px solid #ddd;
1143 border-radius: 4px;
1144 -webkit-transition: all .2s ease-in-out;
1145 -o-transition: all .2s ease-in-out;
1146 transition: all .2s ease-in-out;
1147}
1148.img-circle {
1149 border-radius: 50%;
1150}
1151hr {
1152 margin-top: 20px;
1153 margin-bottom: 20px;
1154 border: 0;
1155 border-top: 1px solid #eee;
1156}
1157.sr-only {
1158 position: absolute;
1159 width: 1px;
1160 height: 1px;
1161 padding: 0;
1162 margin: -1px;
1163 overflow: hidden;
1164 clip: rect(0, 0, 0, 0);
1165 border: 0;
1166}
1167.sr-only-focusable:active,
1168.sr-only-focusable:focus {
1169 position: static;
1170 width: auto;
1171 height: auto;
1172 margin: 0;
1173 overflow: visible;
1174 clip: auto;
1175}
1176[role="button"] {
1177 cursor: pointer;
1178}
1179h1,
1180h2,
1181h3,
1182h4,
1183h5,
1184h6,
1185.h1,
1186.h2,
1187.h3,
1188.h4,
1189.h5,
1190.h6 {
1191 font-family: inherit;
1192 font-weight: 500;
1193 line-height: 1.1;
1194 color: inherit;
1195}
1196h1 small,
1197h2 small,
1198h3 small,
1199h4 small,
1200h5 small,
1201h6 small,
1202.h1 small,
1203.h2 small,
1204.h3 small,
1205.h4 small,
1206.h5 small,
1207.h6 small,
1208h1 .small,
1209h2 .small,
1210h3 .small,
1211h4 .small,
1212h5 .small,
1213h6 .small,
1214.h1 .small,
1215.h2 .small,
1216.h3 .small,
1217.h4 .small,
1218.h5 .small,
1219.h6 .small {
1220 font-weight: normal;
1221 line-height: 1;
1222 color: #777;
1223}
1224h1,
1225.h1,
1226h2,
1227.h2,
1228h3,
1229.h3 {
1230 margin-top: 20px;
1231 margin-bottom: 10px;
1232}
1233h1 small,
1234.h1 small,
1235h2 small,
1236.h2 small,
1237h3 small,
1238.h3 small,
1239h1 .small,
1240.h1 .small,
1241h2 .small,
1242.h2 .small,
1243h3 .small,
1244.h3 .small {
1245 font-size: 65%;
1246}
1247h4,
1248.h4,
1249h5,
1250.h5,
1251h6,
1252.h6 {
1253 margin-top: 10px;
1254 margin-bottom: 10px;
1255}
1256h4 small,
1257.h4 small,
1258h5 small,
1259.h5 small,
1260h6 small,
1261.h6 small,
1262h4 .small,
1263.h4 .small,
1264h5 .small,
1265.h5 .small,
1266h6 .small,
1267.h6 .small {
1268 font-size: 75%;
1269}
1270h1,
1271.h1 {
1272 font-size: 36px;
1273}
1274h2,
1275.h2 {
1276 font-size: 30px;
1277}
1278h3,
1279.h3 {
1280 font-size: 24px;
1281}
1282h4,
1283.h4 {
1284 font-size: 18px;
1285}
1286h5,
1287.h5 {
1288 font-size: 14px;
1289}
1290h6,
1291.h6 {
1292 font-size: 12px;
1293}
1294p {
1295 margin: 0 0 10px;
1296}
1297.lead {
1298 margin-bottom: 20px;
1299 font-size: 16px;
1300 font-weight: 300;
1301 line-height: 1.4;
1302}
1303@media (min-width: 768px) {
1304 .lead {
1305 font-size: 21px;
1306 }
1307}
1308small,
1309.small {
1310 font-size: 85%;
1311}
1312mark,
1313.mark {
1314 padding: .2em;
1315 background-color: #fcf8e3;
1316}
1317.text-left {
1318 text-align: left;
1319}
1320.text-right {
1321 text-align: right;
1322}
1323.text-center {
1324 text-align: center;
1325}
1326.text-justify {
1327 text-align: justify;
1328}
1329.text-nowrap {
1330 white-space: nowrap;
1331}
1332.text-lowercase {
1333 text-transform: lowercase;
1334}
1335.text-uppercase {
1336 text-transform: uppercase;
1337}
1338.text-capitalize {
1339 text-transform: capitalize;
1340}
1341.text-muted {
1342 color: #777;
1343}
1344.text-primary {
1345 color: #337ab7;
1346}
1347a.text-primary:hover,
1348a.text-primary:focus {
1349 color: #286090;
1350}
1351.text-success {
1352 color: #3c763d;
1353}
1354a.text-success:hover,
1355a.text-success:focus {
1356 color: #2b542c;
1357}
1358.text-info {
1359 color: #31708f;
1360}
1361a.text-info:hover,
1362a.text-info:focus {
1363 color: #245269;
1364}
1365.text-warning {
1366 color: #8a6d3b;
1367}
1368a.text-warning:hover,
1369a.text-warning:focus {
1370 color: #66512c;
1371}
1372.text-danger {
1373 color: #a94442;
1374}
1375a.text-danger:hover,
1376a.text-danger:focus {
1377 color: #843534;
1378}
1379.bg-primary {
1380 color: #fff;
1381 background-color: #337ab7;
1382}
1383a.bg-primary:hover,
1384a.bg-primary:focus {
1385 background-color: #286090;
1386}
1387.bg-success {
1388 background-color: #dff0d8;
1389}
1390a.bg-success:hover,
1391a.bg-success:focus {
1392 background-color: #c1e2b3;
1393}
1394.bg-info {
1395 background-color: #d9edf7;
1396}
1397a.bg-info:hover,
1398a.bg-info:focus {
1399 background-color: #afd9ee;
1400}
1401.bg-warning {
1402 background-color: #fcf8e3;
1403}
1404a.bg-warning:hover,
1405a.bg-warning:focus {
1406 background-color: #f7ecb5;
1407}
1408.bg-danger {
1409 background-color: #f2dede;
1410}
1411a.bg-danger:hover,
1412a.bg-danger:focus {
1413 background-color: #e4b9b9;
1414}
1415.page-header {
1416 padding-bottom: 9px;
1417 margin: 40px 0 20px;
1418 border-bottom: 1px solid #eee;
1419}
1420ul,
1421ol {
1422 margin-top: 0;
1423 margin-bottom: 10px;
1424}
1425ul ul,
1426ol ul,
1427ul ol,
1428ol ol {
1429 margin-bottom: 0;
1430}
1431.list-unstyled {
1432 padding-left: 0;
1433 list-style: none;
1434}
1435.list-inline {
1436 padding-left: 0;
1437 margin-left: -5px;
1438 list-style: none;
1439}
1440.list-inline > li {
1441 display: inline-block;
1442 padding-right: 5px;
1443 padding-left: 5px;
1444}
1445dl {
1446 margin-top: 0;
1447 margin-bottom: 20px;
1448}
1449dt,
1450dd {
1451 line-height: 1.42857143;
1452}
1453dt {
1454 font-weight: bold;
1455}
1456dd {
1457 margin-left: 0;
1458}
1459@media (min-width: 768px) {
1460 .dl-horizontal dt {
1461 float: left;
1462 width: 160px;
1463 overflow: hidden;
1464 clear: left;
1465 text-align: right;
1466 text-overflow: ellipsis;
1467 white-space: nowrap;
1468 }
1469 .dl-horizontal dd {
1470 margin-left: 180px;
1471 }
1472}
1473abbr[title],
1474abbr[data-original-title] {
1475 cursor: help;
1476 border-bottom: 1px dotted #777;
1477}
1478.initialism {
1479 font-size: 90%;
1480 text-transform: uppercase;
1481}
1482blockquote {
1483 padding: 10px 20px;
1484 margin: 0 0 20px;
1485 font-size: 17.5px;
1486 border-left: 5px solid #eee;
1487}
1488blockquote p:last-child,
1489blockquote ul:last-child,
1490blockquote ol:last-child {
1491 margin-bottom: 0;
1492}
1493blockquote footer,
1494blockquote small,
1495blockquote .small {
1496 display: block;
1497 font-size: 80%;
1498 line-height: 1.42857143;
1499 color: #777;
1500}
1501blockquote footer:before,
1502blockquote small:before,
1503blockquote .small:before {
1504 content: '\2014 \00A0';
1505}
1506.blockquote-reverse,
1507blockquote.pull-right {
1508 padding-right: 15px;
1509 padding-left: 0;
1510 text-align: right;
1511 border-right: 5px solid #eee;
1512 border-left: 0;
1513}
1514.blockquote-reverse footer:before,
1515blockquote.pull-right footer:before,
1516.blockquote-reverse small:before,
1517blockquote.pull-right small:before,
1518.blockquote-reverse .small:before,
1519blockquote.pull-right .small:before {
1520 content: '';
1521}
1522.blockquote-reverse footer:after,
1523blockquote.pull-right footer:after,
1524.blockquote-reverse small:after,
1525blockquote.pull-right small:after,
1526.blockquote-reverse .small:after,
1527blockquote.pull-right .small:after {
1528 content: '\00A0 \2014';
1529}
1530address {
1531 margin-bottom: 20px;
1532 font-style: normal;
1533 line-height: 1.42857143;
1534}
1535code,
1536kbd,
1537pre,
1538samp {
1539 font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
1540}
1541code {
1542 padding: 2px 4px;
1543 font-size: 90%;
1544 color: #c7254e;
1545 background-color: #f9f2f4;
1546 border-radius: 4px;
1547}
1548kbd {
1549 padding: 2px 4px;
1550 font-size: 90%;
1551 color: #fff;
1552 background-color: #333;
1553 border-radius: 3px;
1554 -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
1555 box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
1556}
1557kbd kbd {
1558 padding: 0;
1559 font-size: 100%;
1560 font-weight: bold;
1561 -webkit-box-shadow: none;
1562 box-shadow: none;
1563}
1564pre {
1565 display: block;
1566 padding: 9.5px;
1567 margin: 0 0 10px;
1568 font-size: 13px;
1569 line-height: 1.42857143;
1570 color: #333;
1571 word-break: break-all;
1572 word-wrap: break-word;
1573 background-color: #f5f5f5;
1574 border: 1px solid #ccc;
1575 border-radius: 4px;
1576}
1577pre code {
1578 padding: 0;
1579 font-size: inherit;
1580 color: inherit;
1581 white-space: pre-wrap;
1582 background-color: transparent;
1583 border-radius: 0;
1584}
1585.pre-scrollable {
1586 max-height: 340px;
1587 overflow-y: scroll;
1588}
1589.container {
1590 padding-right: 15px;
1591 padding-left: 15px;
1592 margin-right: auto;
1593 margin-left: auto;
1594}
1595@media (min-width: 768px) {
1596 .container {
1597 width: 750px;
1598 }
1599}
1600@media (min-width: 992px) {
1601 .container {
1602 width: 970px;
1603 }
1604}
1605@media (min-width: 1200px) {
1606 .container {
1607 width: 1170px;
1608 }
1609}
1610.container-fluid {
1611 padding-right: 15px;
1612 padding-left: 15px;
1613 margin-right: auto;
1614 margin-left: auto;
1615}
1616.row {
1617 margin-right: -15px;
1618 margin-left: -15px;
1619}
1620.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
1621 position: relative;
1622 min-height: 1px;
1623 padding-right: 15px;
1624 padding-left: 15px;
1625}
1626.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
1627 float: left;
1628}
1629.col-xs-12 {
1630 width: 100%;
1631}
1632.col-xs-11 {
1633 width: 91.66666667%;
1634}
1635.col-xs-10 {
1636 width: 83.33333333%;
1637}
1638.col-xs-9 {
1639 width: 75%;
1640}
1641.col-xs-8 {
1642 width: 66.66666667%;
1643}
1644.col-xs-7 {
1645 width: 58.33333333%;
1646}
1647.col-xs-6 {
1648 width: 50%;
1649}
1650.col-xs-5 {
1651 width: 41.66666667%;
1652}
1653.col-xs-4 {
1654 width: 33.33333333%;
1655}
1656.col-xs-3 {
1657 width: 25%;
1658}
1659.col-xs-2 {
1660 width: 16.66666667%;
1661}
1662.col-xs-1 {
1663 width: 8.33333333%;
1664}
1665.col-xs-pull-12 {
1666 right: 100%;
1667}
1668.col-xs-pull-11 {
1669 right: 91.66666667%;
1670}
1671.col-xs-pull-10 {
1672 right: 83.33333333%;
1673}
1674.col-xs-pull-9 {
1675 right: 75%;
1676}
1677.col-xs-pull-8 {
1678 right: 66.66666667%;
1679}
1680.col-xs-pull-7 {
1681 right: 58.33333333%;
1682}
1683.col-xs-pull-6 {
1684 right: 50%;
1685}
1686.col-xs-pull-5 {
1687 right: 41.66666667%;
1688}
1689.col-xs-pull-4 {
1690 right: 33.33333333%;
1691}
1692.col-xs-pull-3 {
1693 right: 25%;
1694}
1695.col-xs-pull-2 {
1696 right: 16.66666667%;
1697}
1698.col-xs-pull-1 {
1699 right: 8.33333333%;
1700}
1701.col-xs-pull-0 {
1702 right: auto;
1703}
1704.col-xs-push-12 {
1705 left: 100%;
1706}
1707.col-xs-push-11 {
1708 left: 91.66666667%;
1709}
1710.col-xs-push-10 {
1711 left: 83.33333333%;
1712}
1713.col-xs-push-9 {
1714 left: 75%;
1715}
1716.col-xs-push-8 {
1717 left: 66.66666667%;
1718}
1719.col-xs-push-7 {
1720 left: 58.33333333%;
1721}
1722.col-xs-push-6 {
1723 left: 50%;
1724}
1725.col-xs-push-5 {
1726 left: 41.66666667%;
1727}
1728.col-xs-push-4 {
1729 left: 33.33333333%;
1730}
1731.col-xs-push-3 {
1732 left: 25%;
1733}
1734.col-xs-push-2 {
1735 left: 16.66666667%;
1736}
1737.col-xs-push-1 {
1738 left: 8.33333333%;
1739}
1740.col-xs-push-0 {
1741 left: auto;
1742}
1743.col-xs-offset-12 {
1744 margin-left: 100%;
1745}
1746.col-xs-offset-11 {
1747 margin-left: 91.66666667%;
1748}
1749.col-xs-offset-10 {
1750 margin-left: 83.33333333%;
1751}
1752.col-xs-offset-9 {
1753 margin-left: 75%;
1754}
1755.col-xs-offset-8 {
1756 margin-left: 66.66666667%;
1757}
1758.col-xs-offset-7 {
1759 margin-left: 58.33333333%;
1760}
1761.col-xs-offset-6 {
1762 margin-left: 50%;
1763}
1764.col-xs-offset-5 {
1765 margin-left: 41.66666667%;
1766}
1767.col-xs-offset-4 {
1768 margin-left: 33.33333333%;
1769}
1770.col-xs-offset-3 {
1771 margin-left: 25%;
1772}
1773.col-xs-offset-2 {
1774 margin-left: 16.66666667%;
1775}
1776.col-xs-offset-1 {
1777 margin-left: 8.33333333%;
1778}
1779.col-xs-offset-0 {
1780 margin-left: 0;
1781}
1782@media (min-width: 768px) {
1783 .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
1784 float: left;
1785 }
1786 .col-sm-12 {
1787 width: 100%;
1788 }
1789 .col-sm-11 {
1790 width: 91.66666667%;
1791 }
1792 .col-sm-10 {
1793 width: 83.33333333%;
1794 }
1795 .col-sm-9 {
1796 width: 75%;
1797 }
1798 .col-sm-8 {
1799 width: 66.66666667%;
1800 }
1801 .col-sm-7 {
1802 width: 58.33333333%;
1803 }
1804 .col-sm-6 {
1805 width: 50%;
1806 }
1807 .col-sm-5 {
1808 width: 41.66666667%;
1809 }
1810 .col-sm-4 {
1811 width: 33.33333333%;
1812 }
1813 .col-sm-3 {
1814 width: 25%;
1815 }
1816 .col-sm-2 {
1817 width: 16.66666667%;
1818 }
1819 .col-sm-1 {
1820 width: 8.33333333%;
1821 }
1822 .col-sm-pull-12 {
1823 right: 100%;
1824 }
1825 .col-sm-pull-11 {
1826 right: 91.66666667%;
1827 }
1828 .col-sm-pull-10 {
1829 right: 83.33333333%;
1830 }
1831 .col-sm-pull-9 {
1832 right: 75%;
1833 }
1834 .col-sm-pull-8 {
1835 right: 66.66666667%;
1836 }
1837 .col-sm-pull-7 {
1838 right: 58.33333333%;
1839 }
1840 .col-sm-pull-6 {
1841 right: 50%;
1842 }
1843 .col-sm-pull-5 {
1844 right: 41.66666667%;
1845 }
1846 .col-sm-pull-4 {
1847 right: 33.33333333%;
1848 }
1849 .col-sm-pull-3 {
1850 right: 25%;
1851 }
1852 .col-sm-pull-2 {
1853 right: 16.66666667%;
1854 }
1855 .col-sm-pull-1 {
1856 right: 8.33333333%;
1857 }
1858 .col-sm-pull-0 {
1859 right: auto;
1860 }
1861 .col-sm-push-12 {
1862 left: 100%;
1863 }
1864 .col-sm-push-11 {
1865 left: 91.66666667%;
1866 }
1867 .col-sm-push-10 {
1868 left: 83.33333333%;
1869 }
1870 .col-sm-push-9 {
1871 left: 75%;
1872 }
1873 .col-sm-push-8 {
1874 left: 66.66666667%;
1875 }
1876 .col-sm-push-7 {
1877 left: 58.33333333%;
1878 }
1879 .col-sm-push-6 {
1880 left: 50%;
1881 }
1882 .col-sm-push-5 {
1883 left: 41.66666667%;
1884 }
1885 .col-sm-push-4 {
1886 left: 33.33333333%;
1887 }
1888 .col-sm-push-3 {
1889 left: 25%;
1890 }
1891 .col-sm-push-2 {
1892 left: 16.66666667%;
1893 }
1894 .col-sm-push-1 {
1895 left: 8.33333333%;
1896 }
1897 .col-sm-push-0 {
1898 left: auto;
1899 }
1900 .col-sm-offset-12 {
1901 margin-left: 100%;
1902 }
1903 .col-sm-offset-11 {
1904 margin-left: 91.66666667%;
1905 }
1906 .col-sm-offset-10 {
1907 margin-left: 83.33333333%;
1908 }
1909 .col-sm-offset-9 {
1910 margin-left: 75%;
1911 }
1912 .col-sm-offset-8 {
1913 margin-left: 66.66666667%;
1914 }
1915 .col-sm-offset-7 {
1916 margin-left: 58.33333333%;
1917 }
1918 .col-sm-offset-6 {
1919 margin-left: 50%;
1920 }
1921 .col-sm-offset-5 {
1922 margin-left: 41.66666667%;
1923 }
1924 .col-sm-offset-4 {
1925 margin-left: 33.33333333%;
1926 }
1927 .col-sm-offset-3 {
1928 margin-left: 25%;
1929 }
1930 .col-sm-offset-2 {
1931 margin-left: 16.66666667%;
1932 }
1933 .col-sm-offset-1 {
1934 margin-left: 8.33333333%;
1935 }
1936 .col-sm-offset-0 {
1937 margin-left: 0;
1938 }
1939}
1940@media (min-width: 992px) {
1941 .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
1942 float: left;
1943 }
1944 .col-md-12 {
1945 width: 100%;
1946 }
1947 .col-md-11 {
1948 width: 91.66666667%;
1949 }
1950 .col-md-10 {
1951 width: 83.33333333%;
1952 }
1953 .col-md-9 {
1954 width: 75%;
1955 }
1956 .col-md-8 {
1957 width: 66.66666667%;
1958 }
1959 .col-md-7 {
1960 width: 58.33333333%;
1961 }
1962 .col-md-6 {
1963 width: 50%;
1964 }
1965 .col-md-5 {
1966 width: 41.66666667%;
1967 }
1968 .col-md-4 {
1969 width: 33.33333333%;
1970 }
1971 .col-md-3 {
1972 width: 25%;
1973 }
1974 .col-md-2 {
1975 width: 16.66666667%;
1976 }
1977 .col-md-1 {
1978 width: 8.33333333%;
1979 }
1980 .col-md-pull-12 {
1981 right: 100%;
1982 }
1983 .col-md-pull-11 {
1984 right: 91.66666667%;
1985 }
1986 .col-md-pull-10 {
1987 right: 83.33333333%;
1988 }
1989 .col-md-pull-9 {
1990 right: 75%;
1991 }
1992 .col-md-pull-8 {
1993 right: 66.66666667%;
1994 }
1995 .col-md-pull-7 {
1996 right: 58.33333333%;
1997 }
1998 .col-md-pull-6 {
1999 right: 50%;
2000 }
2001 .col-md-pull-5 {
2002 right: 41.66666667%;
2003 }
2004 .col-md-pull-4 {
2005 right: 33.33333333%;
2006 }
2007 .col-md-pull-3 {
2008 right: 25%;
2009 }
2010 .col-md-pull-2 {
2011 right: 16.66666667%;
2012 }
2013 .col-md-pull-1 {
2014 right: 8.33333333%;
2015 }
2016 .col-md-pull-0 {
2017 right: auto;
2018 }
2019 .col-md-push-12 {
2020 left: 100%;
2021 }
2022 .col-md-push-11 {
2023 left: 91.66666667%;
2024 }
2025 .col-md-push-10 {
2026 left: 83.33333333%;
2027 }
2028 .col-md-push-9 {
2029 left: 75%;
2030 }
2031 .col-md-push-8 {
2032 left: 66.66666667%;
2033 }
2034 .col-md-push-7 {
2035 left: 58.33333333%;
2036 }
2037 .col-md-push-6 {
2038 left: 50%;
2039 }
2040 .col-md-push-5 {
2041 left: 41.66666667%;
2042 }
2043 .col-md-push-4 {
2044 left: 33.33333333%;
2045 }
2046 .col-md-push-3 {
2047 left: 25%;
2048 }
2049 .col-md-push-2 {
2050 left: 16.66666667%;
2051 }
2052 .col-md-push-1 {
2053 left: 8.33333333%;
2054 }
2055 .col-md-push-0 {
2056 left: auto;
2057 }
2058 .col-md-offset-12 {
2059 margin-left: 100%;
2060 }
2061 .col-md-offset-11 {
2062 margin-left: 91.66666667%;
2063 }
2064 .col-md-offset-10 {
2065 margin-left: 83.33333333%;
2066 }
2067 .col-md-offset-9 {
2068 margin-left: 75%;
2069 }
2070 .col-md-offset-8 {
2071 margin-left: 66.66666667%;
2072 }
2073 .col-md-offset-7 {
2074 margin-left: 58.33333333%;
2075 }
2076 .col-md-offset-6 {
2077 margin-left: 50%;
2078 }
2079 .col-md-offset-5 {
2080 margin-left: 41.66666667%;
2081 }
2082 .col-md-offset-4 {
2083 margin-left: 33.33333333%;
2084 }
2085 .col-md-offset-3 {
2086 margin-left: 25%;
2087 }
2088 .col-md-offset-2 {
2089 margin-left: 16.66666667%;
2090 }
2091 .col-md-offset-1 {
2092 margin-left: 8.33333333%;
2093 }
2094 .col-md-offset-0 {
2095 margin-left: 0;
2096 }
2097}
2098@media (min-width: 1200px) {
2099 .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
2100 float: left;
2101 }
2102 .col-lg-12 {
2103 width: 100%;
2104 }
2105 .col-lg-11 {
2106 width: 91.66666667%;
2107 }
2108 .col-lg-10 {
2109 width: 83.33333333%;
2110 }
2111 .col-lg-9 {
2112 width: 75%;
2113 }
2114 .col-lg-8 {
2115 width: 66.66666667%;
2116 }
2117 .col-lg-7 {
2118 width: 58.33333333%;
2119 }
2120 .col-lg-6 {
2121 width: 50%;
2122 }
2123 .col-lg-5 {
2124 width: 41.66666667%;
2125 }
2126 .col-lg-4 {
2127 width: 33.33333333%;
2128 }
2129 .col-lg-3 {
2130 width: 25%;
2131 }
2132 .col-lg-2 {
2133 width: 16.66666667%;
2134 }
2135 .col-lg-1 {
2136 width: 8.33333333%;
2137 }
2138 .col-lg-pull-12 {
2139 right: 100%;
2140 }
2141 .col-lg-pull-11 {
2142 right: 91.66666667%;
2143 }
2144 .col-lg-pull-10 {
2145 right: 83.33333333%;
2146 }
2147 .col-lg-pull-9 {
2148 right: 75%;
2149 }
2150 .col-lg-pull-8 {
2151 right: 66.66666667%;
2152 }
2153 .col-lg-pull-7 {
2154 right: 58.33333333%;
2155 }
2156 .col-lg-pull-6 {
2157 right: 50%;
2158 }
2159 .col-lg-pull-5 {
2160 right: 41.66666667%;
2161 }
2162 .col-lg-pull-4 {
2163 right: 33.33333333%;
2164 }
2165 .col-lg-pull-3 {
2166 right: 25%;
2167 }
2168 .col-lg-pull-2 {
2169 right: 16.66666667%;
2170 }
2171 .col-lg-pull-1 {
2172 right: 8.33333333%;
2173 }
2174 .col-lg-pull-0 {
2175 right: auto;
2176 }
2177 .col-lg-push-12 {
2178 left: 100%;
2179 }
2180 .col-lg-push-11 {
2181 left: 91.66666667%;
2182 }
2183 .col-lg-push-10 {
2184 left: 83.33333333%;
2185 }
2186 .col-lg-push-9 {
2187 left: 75%;
2188 }
2189 .col-lg-push-8 {
2190 left: 66.66666667%;
2191 }
2192 .col-lg-push-7 {
2193 left: 58.33333333%;
2194 }
2195 .col-lg-push-6 {
2196 left: 50%;
2197 }
2198 .col-lg-push-5 {
2199 left: 41.66666667%;
2200 }
2201 .col-lg-push-4 {
2202 left: 33.33333333%;
2203 }
2204 .col-lg-push-3 {
2205 left: 25%;
2206 }
2207 .col-lg-push-2 {
2208 left: 16.66666667%;
2209 }
2210 .col-lg-push-1 {
2211 left: 8.33333333%;
2212 }
2213 .col-lg-push-0 {
2214 left: auto;
2215 }
2216 .col-lg-offset-12 {
2217 margin-left: 100%;
2218 }
2219 .col-lg-offset-11 {
2220 margin-left: 91.66666667%;
2221 }
2222 .col-lg-offset-10 {
2223 margin-left: 83.33333333%;
2224 }
2225 .col-lg-offset-9 {
2226 margin-left: 75%;
2227 }
2228 .col-lg-offset-8 {
2229 margin-left: 66.66666667%;
2230 }
2231 .col-lg-offset-7 {
2232 margin-left: 58.33333333%;
2233 }
2234 .col-lg-offset-6 {
2235 margin-left: 50%;
2236 }
2237 .col-lg-offset-5 {
2238 margin-left: 41.66666667%;
2239 }
2240 .col-lg-offset-4 {
2241 margin-left: 33.33333333%;
2242 }
2243 .col-lg-offset-3 {
2244 margin-left: 25%;
2245 }
2246 .col-lg-offset-2 {
2247 margin-left: 16.66666667%;
2248 }
2249 .col-lg-offset-1 {
2250 margin-left: 8.33333333%;
2251 }
2252 .col-lg-offset-0 {
2253 margin-left: 0;
2254 }
2255}
2256table {
2257 background-color: transparent;
2258}
2259caption {
2260 padding-top: 8px;
2261 padding-bottom: 8px;
2262 color: #777;
2263 text-align: left;
2264}
2265th {
2266 text-align: left;
2267}
2268.table {
2269 width: 100%;
2270 max-width: 100%;
2271 margin-bottom: 20px;
2272}
2273.table > thead > tr > th,
2274.table > tbody > tr > th,
2275.table > tfoot > tr > th,
2276.table > thead > tr > td,
2277.table > tbody > tr > td,
2278.table > tfoot > tr > td {
2279 padding: 8px;
2280 line-height: 1.42857143;
2281 vertical-align: top;
2282 border-top: 1px solid #ddd;
2283}
2284.table > thead > tr > th {
2285 vertical-align: bottom;
2286 border-bottom: 2px solid #ddd;
2287}
2288.table > caption + thead > tr:first-child > th,
2289.table > colgroup + thead > tr:first-child > th,
2290.table > thead:first-child > tr:first-child > th,
2291.table > caption + thead > tr:first-child > td,
2292.table > colgroup + thead > tr:first-child > td,
2293.table > thead:first-child > tr:first-child > td {
2294 border-top: 0;
2295}
2296.table > tbody + tbody {
2297 border-top: 2px solid #ddd;
2298}
2299.table .table {
2300 background-color: #fff;
2301}
2302.table-condensed > thead > tr > th,
2303.table-condensed > tbody > tr > th,
2304.table-condensed > tfoot > tr > th,
2305.table-condensed > thead > tr > td,
2306.table-condensed > tbody > tr > td,
2307.table-condensed > tfoot > tr > td {
2308 padding: 5px;
2309}
2310.table-bordered {
2311 border: 1px solid #ddd;
2312}
2313.table-bordered > thead > tr > th,
2314.table-bordered > tbody > tr > th,
2315.table-bordered > tfoot > tr > th,
2316.table-bordered > thead > tr > td,
2317.table-bordered > tbody > tr > td,
2318.table-bordered > tfoot > tr > td {
2319 border: 1px solid #ddd;
2320}
2321.table-bordered > thead > tr > th,
2322.table-bordered > thead > tr > td {
2323 border-bottom-width: 2px;
2324}
2325.table-striped > tbody > tr:nth-of-type(odd) {
2326 background-color: #f9f9f9;
2327}
2328.table-hover > tbody > tr:hover {
2329 background-color: #f5f5f5;
2330}
2331table col[class*="col-"] {
2332 position: static;
2333 display: table-column;
2334 float: none;
2335}
2336table td[class*="col-"],
2337table th[class*="col-"] {
2338 position: static;
2339 display: table-cell;
2340 float: none;
2341}
2342.table > thead > tr > td.active,
2343.table > tbody > tr > td.active,
2344.table > tfoot > tr > td.active,
2345.table > thead > tr > th.active,
2346.table > tbody > tr > th.active,
2347.table > tfoot > tr > th.active,
2348.table > thead > tr.active > td,
2349.table > tbody > tr.active > td,
2350.table > tfoot > tr.active > td,
2351.table > thead > tr.active > th,
2352.table > tbody > tr.active > th,
2353.table > tfoot > tr.active > th {
2354 background-color: #f5f5f5;
2355}
2356.table-hover > tbody > tr > td.active:hover,
2357.table-hover > tbody > tr > th.active:hover,
2358.table-hover > tbody > tr.active:hover > td,
2359.table-hover > tbody > tr:hover > .active,
2360.table-hover > tbody > tr.active:hover > th {
2361 background-color: #e8e8e8;
2362}
2363.table > thead > tr > td.success,
2364.table > tbody > tr > td.success,
2365.table > tfoot > tr > td.success,
2366.table > thead > tr > th.success,
2367.table > tbody > tr > th.success,
2368.table > tfoot > tr > th.success,
2369.table > thead > tr.success > td,
2370.table > tbody > tr.success > td,
2371.table > tfoot > tr.success > td,
2372.table > thead > tr.success > th,
2373.table > tbody > tr.success > th,
2374.table > tfoot > tr.success > th {
2375 background-color: #dff0d8;
2376}
2377.table-hover > tbody > tr > td.success:hover,
2378.table-hover > tbody > tr > th.success:hover,
2379.table-hover > tbody > tr.success:hover > td,
2380.table-hover > tbody > tr:hover > .success,
2381.table-hover > tbody > tr.success:hover > th {
2382 background-color: #d0e9c6;
2383}
2384.table > thead > tr > td.info,
2385.table > tbody > tr > td.info,
2386.table > tfoot > tr > td.info,
2387.table > thead > tr > th.info,
2388.table > tbody > tr > th.info,
2389.table > tfoot > tr > th.info,
2390.table > thead > tr.info > td,
2391.table > tbody > tr.info > td,
2392.table > tfoot > tr.info > td,
2393.table > thead > tr.info > th,
2394.table > tbody > tr.info > th,
2395.table > tfoot > tr.info > th {
2396 background-color: #d9edf7;
2397}
2398.table-hover > tbody > tr > td.info:hover,
2399.table-hover > tbody > tr > th.info:hover,
2400.table-hover > tbody > tr.info:hover > td,
2401.table-hover > tbody > tr:hover > .info,
2402.table-hover > tbody > tr.info:hover > th {
2403 background-color: #c4e3f3;
2404}
2405.table > thead > tr > td.warning,
2406.table > tbody > tr > td.warning,
2407.table > tfoot > tr > td.warning,
2408.table > thead > tr > th.warning,
2409.table > tbody > tr > th.warning,
2410.table > tfoot > tr > th.warning,
2411.table > thead > tr.warning > td,
2412.table > tbody > tr.warning > td,
2413.table > tfoot > tr.warning > td,
2414.table > thead > tr.warning > th,
2415.table > tbody > tr.warning > th,
2416.table > tfoot > tr.warning > th {
2417 background-color: #fcf8e3;
2418}
2419.table-hover > tbody > tr > td.warning:hover,
2420.table-hover > tbody > tr > th.warning:hover,
2421.table-hover > tbody > tr.warning:hover > td,
2422.table-hover > tbody > tr:hover > .warning,
2423.table-hover > tbody > tr.warning:hover > th {
2424 background-color: #faf2cc;
2425}
2426.table > thead > tr > td.danger,
2427.table > tbody > tr > td.danger,
2428.table > tfoot > tr > td.danger,
2429.table > thead > tr > th.danger,
2430.table > tbody > tr > th.danger,
2431.table > tfoot > tr > th.danger,
2432.table > thead > tr.danger > td,
2433.table > tbody > tr.danger > td,
2434.table > tfoot > tr.danger > td,
2435.table > thead > tr.danger > th,
2436.table > tbody > tr.danger > th,
2437.table > tfoot > tr.danger > th {
2438 background-color: #f2dede;
2439}
2440.table-hover > tbody > tr > td.danger:hover,
2441.table-hover > tbody > tr > th.danger:hover,
2442.table-hover > tbody > tr.danger:hover > td,
2443.table-hover > tbody > tr:hover > .danger,
2444.table-hover > tbody > tr.danger:hover > th {
2445 background-color: #ebcccc;
2446}
2447.table-responsive {
2448 min-height: .01%;
2449 overflow-x: auto;
2450}
2451@media screen and (max-width: 767px) {
2452 .table-responsive {
2453 width: 100%;
2454 margin-bottom: 15px;
2455 overflow-y: hidden;
2456 -ms-overflow-style: -ms-autohiding-scrollbar;
2457 border: 1px solid #ddd;
2458 }
2459 .table-responsive > .table {
2460 margin-bottom: 0;
2461 }
2462 .table-responsive > .table > thead > tr > th,
2463 .table-responsive > .table > tbody > tr > th,
2464 .table-responsive > .table > tfoot > tr > th,
2465 .table-responsive > .table > thead > tr > td,
2466 .table-responsive > .table > tbody > tr > td,
2467 .table-responsive > .table > tfoot > tr > td {
2468 white-space: nowrap;
2469 }
2470 .table-responsive > .table-bordered {
2471 border: 0;
2472 }
2473 .table-responsive > .table-bordered > thead > tr > th:first-child,
2474 .table-responsive > .table-bordered > tbody > tr > th:first-child,
2475 .table-responsive > .table-bordered > tfoot > tr > th:first-child,
2476 .table-responsive > .table-bordered > thead > tr > td:first-child,
2477 .table-responsive > .table-bordered > tbody > tr > td:first-child,
2478 .table-responsive > .table-bordered > tfoot > tr > td:first-child {
2479 border-left: 0;
2480 }
2481 .table-responsive > .table-bordered > thead > tr > th:last-child,
2482 .table-responsive > .table-bordered > tbody > tr > th:last-child,
2483 .table-responsive > .table-bordered > tfoot > tr > th:last-child,
2484 .table-responsive > .table-bordered > thead > tr > td:last-child,
2485 .table-responsive > .table-bordered > tbody > tr > td:last-child,
2486 .table-responsive > .table-bordered > tfoot > tr > td:last-child {
2487 border-right: 0;
2488 }
2489 .table-responsive > .table-bordered > tbody > tr:last-child > th,
2490 .table-responsive > .table-bordered > tfoot > tr:last-child > th,
2491 .table-responsive > .table-bordered > tbody > tr:last-child > td,
2492 .table-responsive > .table-bordered > tfoot > tr:last-child > td {
2493 border-bottom: 0;
2494 }
2495}
2496fieldset {
2497 min-width: 0;
2498 padding: 0;
2499 margin: 0;
2500 border: 0;
2501}
2502legend {
2503 display: block;
2504 width: 100%;
2505 padding: 0;
2506 margin-bottom: 20px;
2507 font-size: 21px;
2508 line-height: inherit;
2509 color: #333;
2510 border: 0;
2511 border-bottom: 1px solid #e5e5e5;
2512}
2513label {
2514 display: inline-block;
2515 max-width: 100%;
2516 margin-bottom: 5px;
2517 font-weight: bold;
2518}
2519input[type="search"] {
2520 -webkit-box-sizing: border-box;
2521 -moz-box-sizing: border-box;
2522 box-sizing: border-box;
2523}
2524input[type="radio"],
2525input[type="checkbox"] {
2526 margin: 4px 0 0;
2527 margin-top: 1px \9;
2528 line-height: normal;
2529}
2530input[type="file"] {
2531 display: block;
2532}
2533input[type="range"] {
2534 display: block;
2535 width: 100%;
2536}
2537select[multiple],
2538select[size] {
2539 height: auto;
2540}
2541input[type="file"]:focus,
2542input[type="radio"]:focus,
2543input[type="checkbox"]:focus {
2544 outline: 5px auto -webkit-focus-ring-color;
2545 outline-offset: -2px;
2546}
2547output {
2548 display: block;
2549 padding-top: 7px;
2550 font-size: 14px;
2551 line-height: 1.42857143;
2552 color: #555;
2553}
2554.form-control {
2555 display: block;
2556 width: 100%;
2557 height: 34px;
2558 padding: 6px 12px;
2559 font-size: 14px;
2560 line-height: 1.42857143;
2561 color: #555;
2562 background-color: #fff;
2563 background-image: none;
2564 border: 1px solid #ccc;
2565 border-radius: 4px;
2566 -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
2567 box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
2568 -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
2569 -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
2570 transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
2571}
2572.form-control:focus {
2573 border-color: #66afe9;
2574 outline: 0;
2575 -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
2576 box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
2577}
2578.form-control::-moz-placeholder {
2579 color: #999;
2580 opacity: 1;
2581}
2582.form-control:-ms-input-placeholder {
2583 color: #999;
2584}
2585.form-control::-webkit-input-placeholder {
2586 color: #999;
2587}
2588.form-control::-ms-expand {
2589 background-color: transparent;
2590 border: 0;
2591}
2592.form-control[disabled],
2593.form-control[readonly],
2594fieldset[disabled] .form-control {
2595 background-color: #eee;
2596 opacity: 1;
2597}
2598.form-control[disabled],
2599fieldset[disabled] .form-control {
2600 cursor: not-allowed;
2601}
2602textarea.form-control {
2603 height: auto;
2604}
2605input[type="search"] {
2606 -webkit-appearance: none;
2607}
2608@media screen and (-webkit-min-device-pixel-ratio: 0) {
2609 input[type="date"].form-control,
2610 input[type="time"].form-control,
2611 input[type="datetime-local"].form-control,
2612 input[type="month"].form-control {
2613 line-height: 34px;
2614 }
2615 input[type="date"].input-sm,
2616 input[type="time"].input-sm,
2617 input[type="datetime-local"].input-sm,
2618 input[type="month"].input-sm,
2619 .input-group-sm input[type="date"],
2620 .input-group-sm input[type="time"],
2621 .input-group-sm input[type="datetime-local"],
2622 .input-group-sm input[type="month"] {
2623 line-height: 30px;
2624 }
2625 input[type="date"].input-lg,
2626 input[type="time"].input-lg,
2627 input[type="datetime-local"].input-lg,
2628 input[type="month"].input-lg,
2629 .input-group-lg input[type="date"],
2630 .input-group-lg input[type="time"],
2631 .input-group-lg input[type="datetime-local"],
2632 .input-group-lg input[type="month"] {
2633 line-height: 46px;
2634 }
2635}
2636.form-group {
2637 margin-bottom: 15px;
2638}
2639.radio,
2640.checkbox {
2641 position: relative;
2642 display: block;
2643 margin-top: 10px;
2644 margin-bottom: 10px;
2645}
2646.radio label,
2647.checkbox label {
2648 min-height: 20px;
2649 padding-left: 20px;
2650 margin-bottom: 0;
2651 font-weight: normal;
2652 cursor: pointer;
2653}
2654.radio input[type="radio"],
2655.radio-inline input[type="radio"],
2656.checkbox input[type="checkbox"],
2657.checkbox-inline input[type="checkbox"] {
2658 position: absolute;
2659 margin-top: 4px \9;
2660 margin-left: -20px;
2661}
2662.radio + .radio,
2663.checkbox + .checkbox {
2664 margin-top: -5px;
2665}
2666.radio-inline,
2667.checkbox-inline {
2668 position: relative;
2669 display: inline-block;
2670 padding-left: 20px;
2671 margin-bottom: 0;
2672 font-weight: normal;
2673 vertical-align: middle;
2674 cursor: pointer;
2675}
2676.radio-inline + .radio-inline,
2677.checkbox-inline + .checkbox-inline {
2678 margin-top: 0;
2679 margin-left: 10px;
2680}
2681input[type="radio"][disabled],
2682input[type="checkbox"][disabled],
2683input[type="radio"].disabled,
2684input[type="checkbox"].disabled,
2685fieldset[disabled] input[type="radio"],
2686fieldset[disabled] input[type="checkbox"] {
2687 cursor: not-allowed;
2688}
2689.radio-inline.disabled,
2690.checkbox-inline.disabled,
2691fieldset[disabled] .radio-inline,
2692fieldset[disabled] .checkbox-inline {
2693 cursor: not-allowed;
2694}
2695.radio.disabled label,
2696.checkbox.disabled label,
2697fieldset[disabled] .radio label,
2698fieldset[disabled] .checkbox label {
2699 cursor: not-allowed;
2700}
2701.form-control-static {
2702 min-height: 34px;
2703 padding-top: 7px;
2704 padding-bottom: 7px;
2705 margin-bottom: 0;
2706}
2707.form-control-static.input-lg,
2708.form-control-static.input-sm {
2709 padding-right: 0;
2710 padding-left: 0;
2711}
2712.input-sm {
2713 height: 30px;
2714 padding: 5px 10px;
2715 font-size: 12px;
2716 line-height: 1.5;
2717 border-radius: 3px;
2718}
2719select.input-sm {
2720 height: 30px;
2721 line-height: 30px;
2722}
2723textarea.input-sm,
2724select[multiple].input-sm {
2725 height: auto;
2726}
2727.form-group-sm .form-control {
2728 height: 30px;
2729 padding: 5px 10px;
2730 font-size: 12px;
2731 line-height: 1.5;
2732 border-radius: 3px;
2733}
2734.form-group-sm select.form-control {
2735 height: 30px;
2736 line-height: 30px;
2737}
2738.form-group-sm textarea.form-control,
2739.form-group-sm select[multiple].form-control {
2740 height: auto;
2741}
2742.form-group-sm .form-control-static {
2743 height: 30px;
2744 min-height: 32px;
2745 padding: 6px 10px;
2746 font-size: 12px;
2747 line-height: 1.5;
2748}
2749.input-lg {
2750 height: 46px;
2751 padding: 10px 16px;
2752 font-size: 18px;
2753 line-height: 1.3333333;
2754 border-radius: 6px;
2755}
2756select.input-lg {
2757 height: 46px;
2758 line-height: 46px;
2759}
2760textarea.input-lg,
2761select[multiple].input-lg {
2762 height: auto;
2763}
2764.form-group-lg .form-control {
2765 height: 46px;
2766 padding: 10px 16px;
2767 font-size: 18px;
2768 line-height: 1.3333333;
2769 border-radius: 6px;
2770}
2771.form-group-lg select.form-control {
2772 height: 46px;
2773 line-height: 46px;
2774}
2775.form-group-lg textarea.form-control,
2776.form-group-lg select[multiple].form-control {
2777 height: auto;
2778}
2779.form-group-lg .form-control-static {
2780 height: 46px;
2781 min-height: 38px;
2782 padding: 11px 16px;
2783 font-size: 18px;
2784 line-height: 1.3333333;
2785}
2786.has-feedback {
2787 position: relative;
2788}
2789.has-feedback .form-control {
2790 padding-right: 42.5px;
2791}
2792.form-control-feedback {
2793 position: absolute;
2794 top: 0;
2795 right: 0;
2796 z-index: 2;
2797 display: block;
2798 width: 34px;
2799 height: 34px;
2800 line-height: 34px;
2801 text-align: center;
2802 pointer-events: none;
2803}
2804.input-lg + .form-control-feedback,
2805.input-group-lg + .form-control-feedback,
2806.form-group-lg .form-control + .form-control-feedback {
2807 width: 46px;
2808 height: 46px;
2809 line-height: 46px;
2810}
2811.input-sm + .form-control-feedback,
2812.input-group-sm + .form-control-feedback,
2813.form-group-sm .form-control + .form-control-feedback {
2814 width: 30px;
2815 height: 30px;
2816 line-height: 30px;
2817}
2818.has-success .help-block,
2819.has-success .control-label,
2820.has-success .radio,
2821.has-success .checkbox,
2822.has-success .radio-inline,
2823.has-success .checkbox-inline,
2824.has-success.radio label,
2825.has-success.checkbox label,
2826.has-success.radio-inline label,
2827.has-success.checkbox-inline label {
2828 color: #3c763d;
2829}
2830.has-success .form-control {
2831 border-color: #3c763d;
2832 -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
2833 box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
2834}
2835.has-success .form-control:focus {
2836 border-color: #2b542c;
2837 -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
2838 box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
2839}
2840.has-success .input-group-addon {
2841 color: #3c763d;
2842 background-color: #dff0d8;
2843 border-color: #3c763d;
2844}
2845.has-success .form-control-feedback {
2846 color: #3c763d;
2847}
2848.has-warning .help-block,
2849.has-warning .control-label,
2850.has-warning .radio,
2851.has-warning .checkbox,
2852.has-warning .radio-inline,
2853.has-warning .checkbox-inline,
2854.has-warning.radio label,
2855.has-warning.checkbox label,
2856.has-warning.radio-inline label,
2857.has-warning.checkbox-inline label {
2858 color: #8a6d3b;
2859}
2860.has-warning .form-control {
2861 border-color: #8a6d3b;
2862 -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
2863 box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
2864}
2865.has-warning .form-control:focus {
2866 border-color: #66512c;
2867 -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
2868 box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
2869}
2870.has-warning .input-group-addon {
2871 color: #8a6d3b;
2872 background-color: #fcf8e3;
2873 border-color: #8a6d3b;
2874}
2875.has-warning .form-control-feedback {
2876 color: #8a6d3b;
2877}
2878.has-error .help-block,
2879.has-error .control-label,
2880.has-error .radio,
2881.has-error .checkbox,
2882.has-error .radio-inline,
2883.has-error .checkbox-inline,
2884.has-error.radio label,
2885.has-error.checkbox label,
2886.has-error.radio-inline label,
2887.has-error.checkbox-inline label {
2888 color: #a94442;
2889}
2890.has-error .form-control {
2891 border-color: #a94442;
2892 -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
2893 box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
2894}
2895.has-error .form-control:focus {
2896 border-color: #843534;
2897 -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
2898 box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
2899}
2900.has-error .input-group-addon {
2901 color: #a94442;
2902 background-color: #f2dede;
2903 border-color: #a94442;
2904}
2905.has-error .form-control-feedback {
2906 color: #a94442;
2907}
2908.has-feedback label ~ .form-control-feedback {
2909 top: 25px;
2910}
2911.has-feedback label.sr-only ~ .form-control-feedback {
2912 top: 0;
2913}
2914.help-block {
2915 display: block;
2916 margin-top: 5px;
2917 margin-bottom: 10px;
2918 color: #737373;
2919}
2920@media (min-width: 768px) {
2921 .form-inline .form-group {
2922 display: inline-block;
2923 margin-bottom: 0;
2924 vertical-align: middle;
2925 }
2926 .form-inline .form-control {
2927 display: inline-block;
2928 width: auto;
2929 vertical-align: middle;
2930 }
2931 .form-inline .form-control-static {
2932 display: inline-block;
2933 }
2934 .form-inline .input-group {
2935 display: inline-table;
2936 vertical-align: middle;
2937 }
2938 .form-inline .input-group .input-group-addon,
2939 .form-inline .input-group .input-group-btn,
2940 .form-inline .input-group .form-control {
2941 width: auto;
2942 }
2943 .form-inline .input-group > .form-control {
2944 width: 100%;
2945 }
2946 .form-inline .control-label {
2947 margin-bottom: 0;
2948 vertical-align: middle;
2949 }
2950 .form-inline .radio,
2951 .form-inline .checkbox {
2952 display: inline-block;
2953 margin-top: 0;
2954 margin-bottom: 0;
2955 vertical-align: middle;
2956 }
2957 .form-inline .radio label,
2958 .form-inline .checkbox label {
2959 padding-left: 0;
2960 }
2961 .form-inline .radio input[type="radio"],
2962 .form-inline .checkbox input[type="checkbox"] {
2963 position: relative;
2964 margin-left: 0;
2965 }
2966 .form-inline .has-feedback .form-control-feedback {
2967 top: 0;
2968 }
2969}
2970.form-horizontal .radio,
2971.form-horizontal .checkbox,
2972.form-horizontal .radio-inline,
2973.form-horizontal .checkbox-inline {
2974 padding-top: 7px;
2975 margin-top: 0;
2976 margin-bottom: 0;
2977}
2978.form-horizontal .radio,
2979.form-horizontal .checkbox {
2980 min-height: 27px;
2981}
2982.form-horizontal .form-group {
2983 margin-right: -15px;
2984 margin-left: -15px;
2985}
2986@media (min-width: 768px) {
2987 .form-horizontal .control-label {
2988 padding-top: 7px;
2989 margin-bottom: 0;
2990 text-align: right;
2991 }
2992}
2993.form-horizontal .has-feedback .form-control-feedback {
2994 right: 15px;
2995}
2996@media (min-width: 768px) {
2997 .form-horizontal .form-group-lg .control-label {
2998 padding-top: 11px;
2999 font-size: 18px;
3000 }
3001}
3002@media (min-width: 768px) {
3003 .form-horizontal .form-group-sm .control-label {
3004 padding-top: 6px;
3005 font-size: 12px;
3006 }
3007}
3008.btn {
3009 display: inline-block;
3010 padding: 6px 12px;
3011 margin-bottom: 0;
3012 font-size: 14px;
3013 font-weight: normal;
3014 line-height: 1.42857143;
3015 text-align: center;
3016 white-space: nowrap;
3017 vertical-align: middle;
3018 -ms-touch-action: manipulation;
3019 touch-action: manipulation;
3020 cursor: pointer;
3021 -webkit-user-select: none;
3022 -moz-user-select: none;
3023 -ms-user-select: none;
3024 user-select: none;
3025 background-image: none;
3026 border: 1px solid transparent;
3027 border-radius: 4px;
3028}
3029.btn:focus,
3030.btn:active:focus,
3031.btn.active:focus,
3032.btn.focus,
3033.btn:active.focus,
3034.btn.active.focus {
3035 outline: 5px auto -webkit-focus-ring-color;
3036 outline-offset: -2px;
3037}
3038.btn:hover,
3039.btn:focus,
3040.btn.focus {
3041 color: #333;
3042 text-decoration: none;
3043}
3044.btn:active,
3045.btn.active {
3046 background-image: none;
3047 outline: 0;
3048 -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
3049 box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
3050}
3051.btn.disabled,
3052.btn[disabled],
3053fieldset[disabled] .btn {
3054 cursor: not-allowed;
3055 filter: alpha(opacity=65);
3056 -webkit-box-shadow: none;
3057 box-shadow: none;
3058 opacity: .65;
3059}
3060a.btn.disabled,
3061fieldset[disabled] a.btn {
3062 pointer-events: none;
3063}
3064.btn-default {
3065 color: #333;
3066 background-color: #fff;
3067 border-color: #ccc;
3068}
3069.btn-default:focus,
3070.btn-default.focus {
3071 color: #333;
3072 background-color: #e6e6e6;
3073 border-color: #8c8c8c;
3074}
3075.btn-default:hover {
3076 color: #333;
3077 background-color: #e6e6e6;
3078 border-color: #adadad;
3079}
3080.btn-default:active,
3081.btn-default.active,
3082.open > .dropdown-toggle.btn-default {
3083 color: #333;
3084 background-color: #e6e6e6;
3085 border-color: #adadad;
3086}
3087.btn-default:active:hover,
3088.btn-default.active:hover,
3089.open > .dropdown-toggle.btn-default:hover,
3090.btn-default:active:focus,
3091.btn-default.active:focus,
3092.open > .dropdown-toggle.btn-default:focus,
3093.btn-default:active.focus,
3094.btn-default.active.focus,
3095.open > .dropdown-toggle.btn-default.focus {
3096 color: #333;
3097 background-color: #d4d4d4;
3098 border-color: #8c8c8c;
3099}
3100.btn-default:active,
3101.btn-default.active,
3102.open > .dropdown-toggle.btn-default {
3103 background-image: none;
3104}
3105.btn-default.disabled:hover,
3106.btn-default[disabled]:hover,
3107fieldset[disabled] .btn-default:hover,
3108.btn-default.disabled:focus,
3109.btn-default[disabled]:focus,
3110fieldset[disabled] .btn-default:focus,
3111.btn-default.disabled.focus,
3112.btn-default[disabled].focus,
3113fieldset[disabled] .btn-default.focus {
3114 background-color: #fff;
3115 border-color: #ccc;
3116}
3117.btn-default .badge {
3118 color: #fff;
3119 background-color: #333;
3120}
3121.btn-primary {
3122 color: #fff;
3123 background-color: #337ab7;
3124 border-color: #2e6da4;
3125}
3126.btn-primary:focus,
3127.btn-primary.focus {
3128 color: #fff;
3129 background-color: #286090;
3130 border-color: #122b40;
3131}
3132.btn-primary:hover {
3133 color: #fff;
3134 background-color: #286090;
3135 border-color: #204d74;
3136}
3137.btn-primary:active,
3138.btn-primary.active,
3139.open > .dropdown-toggle.btn-primary {
3140 color: #fff;
3141 background-color: #286090;
3142 border-color: #204d74;
3143}
3144.btn-primary:active:hover,
3145.btn-primary.active:hover,
3146.open > .dropdown-toggle.btn-primary:hover,
3147.btn-primary:active:focus,
3148.btn-primary.active:focus,
3149.open > .dropdown-toggle.btn-primary:focus,
3150.btn-primary:active.focus,
3151.btn-primary.active.focus,
3152.open > .dropdown-toggle.btn-primary.focus {
3153 color: #fff;
3154 background-color: #204d74;
3155 border-color: #122b40;
3156}
3157.btn-primary:active,
3158.btn-primary.active,
3159.open > .dropdown-toggle.btn-primary {
3160 background-image: none;
3161}
3162.btn-primary.disabled:hover,
3163.btn-primary[disabled]:hover,
3164fieldset[disabled] .btn-primary:hover,
3165.btn-primary.disabled:focus,
3166.btn-primary[disabled]:focus,
3167fieldset[disabled] .btn-primary:focus,
3168.btn-primary.disabled.focus,
3169.btn-primary[disabled].focus,
3170fieldset[disabled] .btn-primary.focus {
3171 background-color: #337ab7;
3172 border-color: #2e6da4;
3173}
3174.btn-primary .badge {
3175 color: #337ab7;
3176 background-color: #fff;
3177}
3178.btn-success {
3179 color: #fff;
3180 background-color: #5cb85c;
3181 border-color: #4cae4c;
3182}
3183.btn-success:focus,
3184.btn-success.focus {
3185 color: #fff;
3186 background-color: #449d44;
3187 border-color: #255625;
3188}
3189.btn-success:hover {
3190 color: #fff;
3191 background-color: #449d44;
3192 border-color: #398439;
3193}
3194.btn-success:active,
3195.btn-success.active,
3196.open > .dropdown-toggle.btn-success {
3197 color: #fff;
3198 background-color: #449d44;
3199 border-color: #398439;
3200}
3201.btn-success:active:hover,
3202.btn-success.active:hover,
3203.open > .dropdown-toggle.btn-success:hover,
3204.btn-success:active:focus,
3205.btn-success.active:focus,
3206.open > .dropdown-toggle.btn-success:focus,
3207.btn-success:active.focus,
3208.btn-success.active.focus,
3209.open > .dropdown-toggle.btn-success.focus {
3210 color: #fff;
3211 background-color: #398439;
3212 border-color: #255625;
3213}
3214.btn-success:active,
3215.btn-success.active,
3216.open > .dropdown-toggle.btn-success {
3217 background-image: none;
3218}
3219.btn-success.disabled:hover,
3220.btn-success[disabled]:hover,
3221fieldset[disabled] .btn-success:hover,
3222.btn-success.disabled:focus,
3223.btn-success[disabled]:focus,
3224fieldset[disabled] .btn-success:focus,
3225.btn-success.disabled.focus,
3226.btn-success[disabled].focus,
3227fieldset[disabled] .btn-success.focus {
3228 background-color: #5cb85c;
3229 border-color: #4cae4c;
3230}
3231.btn-success .badge {
3232 color: #5cb85c;
3233 background-color: #fff;
3234}
3235.btn-info {
3236 color: #fff;
3237 background-color: #5bc0de;
3238 border-color: #46b8da;
3239}
3240.btn-info:focus,
3241.btn-info.focus {
3242 color: #fff;
3243 background-color: #31b0d5;
3244 border-color: #1b6d85;
3245}
3246.btn-info:hover {
3247 color: #fff;
3248 background-color: #31b0d5;
3249 border-color: #269abc;
3250}
3251.btn-info:active,
3252.btn-info.active,
3253.open > .dropdown-toggle.btn-info {
3254 color: #fff;
3255 background-color: #31b0d5;
3256 border-color: #269abc;
3257}
3258.btn-info:active:hover,
3259.btn-info.active:hover,
3260.open > .dropdown-toggle.btn-info:hover,
3261.btn-info:active:focus,
3262.btn-info.active:focus,
3263.open > .dropdown-toggle.btn-info:focus,
3264.btn-info:active.focus,
3265.btn-info.active.focus,
3266.open > .dropdown-toggle.btn-info.focus {
3267 color: #fff;
3268 background-color: #269abc;
3269 border-color: #1b6d85;
3270}
3271.btn-info:active,
3272.btn-info.active,
3273.open > .dropdown-toggle.btn-info {
3274 background-image: none;
3275}
3276.btn-info.disabled:hover,
3277.btn-info[disabled]:hover,
3278fieldset[disabled] .btn-info:hover,
3279.btn-info.disabled:focus,
3280.btn-info[disabled]:focus,
3281fieldset[disabled] .btn-info:focus,
3282.btn-info.disabled.focus,
3283.btn-info[disabled].focus,
3284fieldset[disabled] .btn-info.focus {
3285 background-color: #5bc0de;
3286 border-color: #46b8da;
3287}
3288.btn-info .badge {
3289 color: #5bc0de;
3290 background-color: #fff;
3291}
3292.btn-warning {
3293 color: #fff;
3294 background-color: #f0ad4e;
3295 border-color: #eea236;
3296}
3297.btn-warning:focus,
3298.btn-warning.focus {
3299 color: #fff;
3300 background-color: #ec971f;
3301 border-color: #985f0d;
3302}
3303.btn-warning:hover {
3304 color: #fff;
3305 background-color: #ec971f;
3306 border-color: #d58512;
3307}
3308.btn-warning:active,
3309.btn-warning.active,
3310.open > .dropdown-toggle.btn-warning {
3311 color: #fff;
3312 background-color: #ec971f;
3313 border-color: #d58512;
3314}
3315.btn-warning:active:hover,
3316.btn-warning.active:hover,
3317.open > .dropdown-toggle.btn-warning:hover,
3318.btn-warning:active:focus,
3319.btn-warning.active:focus,
3320.open > .dropdown-toggle.btn-warning:focus,
3321.btn-warning:active.focus,
3322.btn-warning.active.focus,
3323.open > .dropdown-toggle.btn-warning.focus {
3324 color: #fff;
3325 background-color: #d58512;
3326 border-color: #985f0d;
3327}
3328.btn-warning:active,
3329.btn-warning.active,
3330.open > .dropdown-toggle.btn-warning {
3331 background-image: none;
3332}
3333.btn-warning.disabled:hover,
3334.btn-warning[disabled]:hover,
3335fieldset[disabled] .btn-warning:hover,
3336.btn-warning.disabled:focus,
3337.btn-warning[disabled]:focus,
3338fieldset[disabled] .btn-warning:focus,
3339.btn-warning.disabled.focus,
3340.btn-warning[disabled].focus,
3341fieldset[disabled] .btn-warning.focus {
3342 background-color: #f0ad4e;
3343 border-color: #eea236;
3344}
3345.btn-warning .badge {
3346 color: #f0ad4e;
3347 background-color: #fff;
3348}
3349.btn-danger {
3350 color: #fff;
3351 background-color: #d9534f;
3352 border-color: #d43f3a;
3353}
3354.btn-danger:focus,
3355.btn-danger.focus {
3356 color: #fff;
3357 background-color: #c9302c;
3358 border-color: #761c19;
3359}
3360.btn-danger:hover {
3361 color: #fff;
3362 background-color: #c9302c;
3363 border-color: #ac2925;
3364}
3365.btn-danger:active,
3366.btn-danger.active,
3367.open > .dropdown-toggle.btn-danger {
3368 color: #fff;
3369 background-color: #c9302c;
3370 border-color: #ac2925;
3371}
3372.btn-danger:active:hover,
3373.btn-danger.active:hover,
3374.open > .dropdown-toggle.btn-danger:hover,
3375.btn-danger:active:focus,
3376.btn-danger.active:focus,
3377.open > .dropdown-toggle.btn-danger:focus,
3378.btn-danger:active.focus,
3379.btn-danger.active.focus,
3380.open > .dropdown-toggle.btn-danger.focus {
3381 color: #fff;
3382 background-color: #ac2925;
3383 border-color: #761c19;
3384}
3385.btn-danger:active,
3386.btn-danger.active,
3387.open > .dropdown-toggle.btn-danger {
3388 background-image: none;
3389}
3390.btn-danger.disabled:hover,
3391.btn-danger[disabled]:hover,
3392fieldset[disabled] .btn-danger:hover,
3393.btn-danger.disabled:focus,
3394.btn-danger[disabled]:focus,
3395fieldset[disabled] .btn-danger:focus,
3396.btn-danger.disabled.focus,
3397.btn-danger[disabled].focus,
3398fieldset[disabled] .btn-danger.focus {
3399 background-color: #d9534f;
3400 border-color: #d43f3a;
3401}
3402.btn-danger .badge {
3403 color: #d9534f;
3404 background-color: #fff;
3405}
3406.btn-link {
3407 font-weight: normal;
3408 color: #337ab7;
3409 border-radius: 0;
3410}
3411.btn-link,
3412.btn-link:active,
3413.btn-link.active,
3414.btn-link[disabled],
3415fieldset[disabled] .btn-link {
3416 background-color: transparent;
3417 -webkit-box-shadow: none;
3418 box-shadow: none;
3419}
3420.btn-link,
3421.btn-link:hover,
3422.btn-link:focus,
3423.btn-link:active {
3424 border-color: transparent;
3425}
3426.btn-link:hover,
3427.btn-link:focus {
3428 color: #23527c;
3429 text-decoration: underline;
3430 background-color: transparent;
3431}
3432.btn-link[disabled]:hover,
3433fieldset[disabled] .btn-link:hover,
3434.btn-link[disabled]:focus,
3435fieldset[disabled] .btn-link:focus {
3436 color: #777;
3437 text-decoration: none;
3438}
3439.btn-lg,
3440.btn-group-lg > .btn {
3441 padding: 10px 16px;
3442 font-size: 18px;
3443 line-height: 1.3333333;
3444 border-radius: 6px;
3445}
3446.btn-sm,
3447.btn-group-sm > .btn {
3448 padding: 5px 10px;
3449 font-size: 12px;
3450 line-height: 1.5;
3451 border-radius: 3px;
3452}
3453.btn-xs,
3454.btn-group-xs > .btn {
3455 padding: 1px 5px;
3456 font-size: 12px;
3457 line-height: 1.5;
3458 border-radius: 3px;
3459}
3460.btn-block {
3461 display: block;
3462 width: 100%;
3463}
3464.btn-block + .btn-block {
3465 margin-top: 5px;
3466}
3467input[type="submit"].btn-block,
3468input[type="reset"].btn-block,
3469input[type="button"].btn-block {
3470 width: 100%;
3471}
3472.fade {
3473 opacity: 0;
3474 -webkit-transition: opacity .15s linear;
3475 -o-transition: opacity .15s linear;
3476 transition: opacity .15s linear;
3477}
3478.fade.in {
3479 opacity: 1;
3480}
3481.collapse {
3482 display: none;
3483}
3484.collapse.in {
3485 display: block;
3486}
3487tr.collapse.in {
3488 display: table-row;
3489}
3490tbody.collapse.in {
3491 display: table-row-group;
3492}
3493.collapsing {
3494 position: relative;
3495 height: 0;
3496 overflow: hidden;
3497 -webkit-transition-timing-function: ease;
3498 -o-transition-timing-function: ease;
3499 transition-timing-function: ease;
3500 -webkit-transition-duration: .35s;
3501 -o-transition-duration: .35s;
3502 transition-duration: .35s;
3503 -webkit-transition-property: height, visibility;
3504 -o-transition-property: height, visibility;
3505 transition-property: height, visibility;
3506}
3507.caret {
3508 display: inline-block;
3509 width: 0;
3510 height: 0;
3511 margin-left: 2px;
3512 vertical-align: middle;
3513 border-top: 4px dashed;
3514 border-top: 4px solid \9;
3515 border-right: 4px solid transparent;
3516 border-left: 4px solid transparent;
3517}
3518.dropup,
3519.dropdown {
3520 position: relative;
3521}
3522.dropdown-toggle:focus {
3523 outline: 0;
3524}
3525.dropdown-menu {
3526 position: absolute;
3527 top: 100%;
3528 left: 0;
3529 z-index: 1000;
3530 display: none;
3531 float: left;
3532 min-width: 160px;
3533 padding: 5px 0;
3534 margin: 2px 0 0;
3535 font-size: 14px;
3536 text-align: left;
3537 list-style: none;
3538 background-color: #fff;
3539 -webkit-background-clip: padding-box;
3540 background-clip: padding-box;
3541 border: 1px solid #ccc;
3542 border: 1px solid rgba(0, 0, 0, .15);
3543 border-radius: 4px;
3544 -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
3545 box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
3546}
3547.dropdown-menu.pull-right {
3548 right: 0;
3549 left: auto;
3550}
3551.dropdown-menu .divider {
3552 height: 1px;
3553 margin: 9px 0;
3554 overflow: hidden;
3555 background-color: #e5e5e5;
3556}
3557.dropdown-menu > li > a {
3558 display: block;
3559 padding: 3px 20px;
3560 clear: both;
3561 font-weight: normal;
3562 line-height: 1.42857143;
3563 color: #333;
3564 white-space: nowrap;
3565}
3566.dropdown-menu > li > a:hover,
3567.dropdown-menu > li > a:focus {
3568 color: #262626;
3569 text-decoration: none;
3570 background-color: #f5f5f5;
3571}
3572.dropdown-menu > .active > a,
3573.dropdown-menu > .active > a:hover,
3574.dropdown-menu > .active > a:focus {
3575 color: #fff;
3576 text-decoration: none;
3577 background-color: #337ab7;
3578 outline: 0;
3579}
3580.dropdown-menu > .disabled > a,
3581.dropdown-menu > .disabled > a:hover,
3582.dropdown-menu > .disabled > a:focus {
3583 color: #777;
3584}
3585.dropdown-menu > .disabled > a:hover,
3586.dropdown-menu > .disabled > a:focus {
3587 text-decoration: none;
3588 cursor: not-allowed;
3589 background-color: transparent;
3590 background-image: none;
3591 filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
3592}
3593.open > .dropdown-menu {
3594 display: block;
3595}
3596.open > a {
3597 outline: 0;
3598}
3599.dropdown-menu-right {
3600 right: 0;
3601 left: auto;
3602}
3603.dropdown-menu-left {
3604 right: auto;
3605 left: 0;
3606}
3607.dropdown-header {
3608 display: block;
3609 padding: 3px 20px;
3610 font-size: 12px;
3611 line-height: 1.42857143;
3612 color: #777;
3613 white-space: nowrap;
3614}
3615.dropdown-backdrop {
3616 position: fixed;
3617 top: 0;
3618 right: 0;
3619 bottom: 0;
3620 left: 0;
3621 z-index: 990;
3622}
3623.pull-right > .dropdown-menu {
3624 right: 0;
3625 left: auto;
3626}
3627.dropup .caret,
3628.navbar-fixed-bottom .dropdown .caret {
3629 content: "";
3630 border-top: 0;
3631 border-bottom: 4px dashed;
3632 border-bottom: 4px solid \9;
3633}
3634.dropup .dropdown-menu,
3635.navbar-fixed-bottom .dropdown .dropdown-menu {
3636 top: auto;
3637 bottom: 100%;
3638 margin-bottom: 2px;
3639}
3640@media (min-width: 768px) {
3641 .navbar-right .dropdown-menu {
3642 right: 0;
3643 left: auto;
3644 }
3645 .navbar-right .dropdown-menu-left {
3646 right: auto;
3647 left: 0;
3648 }
3649}
3650.btn-group,
3651.btn-group-vertical {
3652 position: relative;
3653 display: inline-block;
3654 vertical-align: middle;
3655}
3656.btn-group > .btn,
3657.btn-group-vertical > .btn {
3658 position: relative;
3659 float: left;
3660}
3661.btn-group > .btn:hover,
3662.btn-group-vertical > .btn:hover,
3663.btn-group > .btn:focus,
3664.btn-group-vertical > .btn:focus,
3665.btn-group > .btn:active,
3666.btn-group-vertical > .btn:active,
3667.btn-group > .btn.active,
3668.btn-group-vertical > .btn.active {
3669 z-index: 2;
3670}
3671.btn-group .btn + .btn,
3672.btn-group .btn + .btn-group,
3673.btn-group .btn-group + .btn,
3674.btn-group .btn-group + .btn-group {
3675 margin-left: -1px;
3676}
3677.btn-toolbar {
3678 margin-left: -5px;
3679}
3680.btn-toolbar .btn,
3681.btn-toolbar .btn-group,
3682.btn-toolbar .input-group {
3683 float: left;
3684}
3685.btn-toolbar > .btn,
3686.btn-toolbar > .btn-group,
3687.btn-toolbar > .input-group {
3688 margin-left: 5px;
3689}
3690.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
3691 border-radius: 0;
3692}
3693.btn-group > .btn:first-child {
3694 margin-left: 0;
3695}
3696.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
3697 border-top-right-radius: 0;
3698 border-bottom-right-radius: 0;
3699}
3700.btn-group > .btn:last-child:not(:first-child),
3701.btn-group > .dropdown-toggle:not(:first-child) {
3702 border-top-left-radius: 0;
3703 border-bottom-left-radius: 0;
3704}
3705.btn-group > .btn-group {
3706 float: left;
3707}
3708.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
3709 border-radius: 0;
3710}
3711.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,
3712.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
3713 border-top-right-radius: 0;
3714 border-bottom-right-radius: 0;
3715}
3716.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
3717 border-top-left-radius: 0;
3718 border-bottom-left-radius: 0;
3719}
3720.btn-group .dropdown-toggle:active,
3721.btn-group.open .dropdown-toggle {
3722 outline: 0;
3723}
3724.btn-group > .btn + .dropdown-toggle {
3725 padding-right: 8px;
3726 padding-left: 8px;
3727}
3728.btn-group > .btn-lg + .dropdown-toggle {
3729 padding-right: 12px;
3730 padding-left: 12px;
3731}
3732.btn-group.open .dropdown-toggle {
3733 -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
3734 box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
3735}
3736.btn-group.open .dropdown-toggle.btn-link {
3737 -webkit-box-shadow: none;
3738 box-shadow: none;
3739}
3740.btn .caret {
3741 margin-left: 0;
3742}
3743.btn-lg .caret {
3744 border-width: 5px 5px 0;
3745 border-bottom-width: 0;
3746}
3747.dropup .btn-lg .caret {
3748 border-width: 0 5px 5px;
3749}
3750.btn-group-vertical > .btn,
3751.btn-group-vertical > .btn-group,
3752.btn-group-vertical > .btn-group > .btn {
3753 display: block;
3754 float: none;
3755 width: 100%;
3756 max-width: 100%;
3757}
3758.btn-group-vertical > .btn-group > .btn {
3759 float: none;
3760}
3761.btn-group-vertical > .btn + .btn,
3762.btn-group-vertical > .btn + .btn-group,
3763.btn-group-vertical > .btn-group + .btn,
3764.btn-group-vertical > .btn-group + .btn-group {
3765 margin-top: -1px;
3766 margin-left: 0;
3767}
3768.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
3769 border-radius: 0;
3770}
3771.btn-group-vertical > .btn:first-child:not(:last-child) {
3772 border-top-left-radius: 4px;
3773 border-top-right-radius: 4px;
3774 border-bottom-right-radius: 0;
3775 border-bottom-left-radius: 0;
3776}
3777.btn-group-vertical > .btn:last-child:not(:first-child) {
3778 border-top-left-radius: 0;
3779 border-top-right-radius: 0;
3780 border-bottom-right-radius: 4px;
3781 border-bottom-left-radius: 4px;
3782}
3783.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
3784 border-radius: 0;
3785}
3786.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
3787.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
3788 border-bottom-right-radius: 0;
3789 border-bottom-left-radius: 0;
3790}
3791.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
3792 border-top-left-radius: 0;
3793 border-top-right-radius: 0;
3794}
3795.btn-group-justified {
3796 display: table;
3797 width: 100%;
3798 table-layout: fixed;
3799 border-collapse: separate;
3800}
3801.btn-group-justified > .btn,
3802.btn-group-justified > .btn-group {
3803 display: table-cell;
3804 float: none;
3805 width: 1%;
3806}
3807.btn-group-justified > .btn-group .btn {
3808 width: 100%;
3809}
3810.btn-group-justified > .btn-group .dropdown-menu {
3811 left: auto;
3812}
3813[data-toggle="buttons"] > .btn input[type="radio"],
3814[data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
3815[data-toggle="buttons"] > .btn input[type="checkbox"],
3816[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
3817 position: absolute;
3818 clip: rect(0, 0, 0, 0);
3819 pointer-events: none;
3820}
3821.input-group {
3822 position: relative;
3823 display: table;
3824 border-collapse: separate;
3825}
3826.input-group[class*="col-"] {
3827 float: none;
3828 padding-right: 0;
3829 padding-left: 0;
3830}
3831.input-group .form-control {
3832 position: relative;
3833 z-index: 2;
3834 float: left;
3835 width: 100%;
3836 margin-bottom: 0;
3837}
3838.input-group .form-control:focus {
3839 z-index: 3;
3840}
3841.input-group-lg > .form-control,
3842.input-group-lg > .input-group-addon,
3843.input-group-lg > .input-group-btn > .btn {
3844 height: 46px;
3845 padding: 10px 16px;
3846 font-size: 18px;
3847 line-height: 1.3333333;
3848 border-radius: 6px;
3849}
3850select.input-group-lg > .form-control,
3851select.input-group-lg > .input-group-addon,
3852select.input-group-lg > .input-group-btn > .btn {
3853 height: 46px;
3854 line-height: 46px;
3855}
3856textarea.input-group-lg > .form-control,
3857textarea.input-group-lg > .input-group-addon,
3858textarea.input-group-lg > .input-group-btn > .btn,
3859select[multiple].input-group-lg > .form-control,
3860select[multiple].input-group-lg > .input-group-addon,
3861select[multiple].input-group-lg > .input-group-btn > .btn {
3862 height: auto;
3863}
3864.input-group-sm > .form-control,
3865.input-group-sm > .input-group-addon,
3866.input-group-sm > .input-group-btn > .btn {
3867 height: 30px;
3868 padding: 5px 10px;
3869 font-size: 12px;
3870 line-height: 1.5;
3871 border-radius: 3px;
3872}
3873select.input-group-sm > .form-control,
3874select.input-group-sm > .input-group-addon,
3875select.input-group-sm > .input-group-btn > .btn {
3876 height: 30px;
3877 line-height: 30px;
3878}
3879textarea.input-group-sm > .form-control,
3880textarea.input-group-sm > .input-group-addon,
3881textarea.input-group-sm > .input-group-btn > .btn,
3882select[multiple].input-group-sm > .form-control,
3883select[multiple].input-group-sm > .input-group-addon,
3884select[multiple].input-group-sm > .input-group-btn > .btn {
3885 height: auto;
3886}
3887.input-group-addon,
3888.input-group-btn,
3889.input-group .form-control {
3890 display: table-cell;
3891}
3892.input-group-addon:not(:first-child):not(:last-child),
3893.input-group-btn:not(:first-child):not(:last-child),
3894.input-group .form-control:not(:first-child):not(:last-child) {
3895 border-radius: 0;
3896}
3897.input-group-addon,
3898.input-group-btn {
3899 width: 1%;
3900 white-space: nowrap;
3901 vertical-align: middle;
3902}
3903.input-group-addon {
3904 padding: 6px 12px;
3905 font-size: 14px;
3906 font-weight: normal;
3907 line-height: 1;
3908 color: #555;
3909 text-align: center;
3910 background-color: #eee;
3911 border: 1px solid #ccc;
3912 border-radius: 4px;
3913}
3914.input-group-addon.input-sm {
3915 padding: 5px 10px;
3916 font-size: 12px;
3917 border-radius: 3px;
3918}
3919.input-group-addon.input-lg {
3920 padding: 10px 16px;
3921 font-size: 18px;
3922 border-radius: 6px;
3923}
3924.input-group-addon input[type="radio"],
3925.input-group-addon input[type="checkbox"] {
3926 margin-top: 0;
3927}
3928.input-group .form-control:first-child,
3929.input-group-addon:first-child,
3930.input-group-btn:first-child > .btn,
3931.input-group-btn:first-child > .btn-group > .btn,
3932.input-group-btn:first-child > .dropdown-toggle,
3933.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
3934.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
3935 border-top-right-radius: 0;
3936 border-bottom-right-radius: 0;
3937}
3938.input-group-addon:first-child {
3939 border-right: 0;
3940}
3941.input-group .form-control:last-child,
3942.input-group-addon:last-child,
3943.input-group-btn:last-child > .btn,
3944.input-group-btn:last-child > .btn-group > .btn,
3945.input-group-btn:last-child > .dropdown-toggle,
3946.input-group-btn:first-child > .btn:not(:first-child),
3947.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
3948 border-top-left-radius: 0;
3949 border-bottom-left-radius: 0;
3950}
3951.input-group-addon:last-child {
3952 border-left: 0;
3953}
3954.input-group-btn {
3955 position: relative;
3956 font-size: 0;
3957 white-space: nowrap;
3958}
3959.input-group-btn > .btn {
3960 position: relative;
3961}
3962.input-group-btn > .btn + .btn {
3963 margin-left: -1px;
3964}
3965.input-group-btn > .btn:hover,
3966.input-group-btn > .btn:focus,
3967.input-group-btn > .btn:active {
3968 z-index: 2;
3969}
3970.input-group-btn:first-child > .btn,
3971.input-group-btn:first-child > .btn-group {
3972 margin-right: -1px;
3973}
3974.input-group-btn:last-child > .btn,
3975.input-group-btn:last-child > .btn-group {
3976 z-index: 2;
3977 margin-left: -1px;
3978}
3979.nav {
3980 padding-left: 0;
3981 margin-bottom: 0;
3982 list-style: none;
3983}
3984.nav > li {
3985 position: relative;
3986 display: block;
3987}
3988.nav > li > a {
3989 position: relative;
3990 display: block;
3991 padding: 10px 15px;
3992}
3993.nav > li > a:hover,
3994.nav > li > a:focus {
3995 text-decoration: none;
3996 background-color: #eee;
3997}
3998.nav > li.disabled > a {
3999 color: #777;
4000}
4001.nav > li.disabled > a:hover,
4002.nav > li.disabled > a:focus {
4003 color: #777;
4004 text-decoration: none;
4005 cursor: not-allowed;
4006 background-color: transparent;
4007}
4008.nav .open > a,
4009.nav .open > a:hover,
4010.nav .open > a:focus {
4011 background-color: #eee;
4012 border-color: #337ab7;
4013}
4014.nav .nav-divider {
4015 height: 1px;
4016 margin: 9px 0;
4017 overflow: hidden;
4018 background-color: #e5e5e5;
4019}
4020.nav > li > a > img {
4021 max-width: none;
4022}
4023.nav-tabs {
4024 border-bottom: 1px solid #ddd;
4025}
4026.nav-tabs > li {
4027 float: left;
4028 margin-bottom: -1px;
4029}
4030.nav-tabs > li > a {
4031 margin-right: 2px;
4032 line-height: 1.42857143;
4033 border: 1px solid transparent;
4034 border-radius: 4px 4px 0 0;
4035}
4036.nav-tabs > li > a:hover {
4037 border-color: #eee #eee #ddd;
4038}
4039.nav-tabs > li.active > a,
4040.nav-tabs > li.active > a:hover,
4041.nav-tabs > li.active > a:focus {
4042 color: #555;
4043 cursor: default;
4044 background-color: #fff;
4045 border: 1px solid #ddd;
4046 border-bottom-color: transparent;
4047}
4048.nav-tabs.nav-justified {
4049 width: 100%;
4050 border-bottom: 0;
4051}
4052.nav-tabs.nav-justified > li {
4053 float: none;
4054}
4055.nav-tabs.nav-justified > li > a {
4056 margin-bottom: 5px;
4057 text-align: center;
4058}
4059.nav-tabs.nav-justified > .dropdown .dropdown-menu {
4060 top: auto;
4061 left: auto;
4062}
4063@media (min-width: 768px) {
4064 .nav-tabs.nav-justified > li {
4065 display: table-cell;
4066 width: 1%;
4067 }
4068 .nav-tabs.nav-justified > li > a {
4069 margin-bottom: 0;
4070 }
4071}
4072.nav-tabs.nav-justified > li > a {
4073 margin-right: 0;
4074 border-radius: 4px;
4075}
4076.nav-tabs.nav-justified > .active > a,
4077.nav-tabs.nav-justified > .active > a:hover,
4078.nav-tabs.nav-justified > .active > a:focus {
4079 border: 1px solid #ddd;
4080}
4081@media (min-width: 768px) {
4082 .nav-tabs.nav-justified > li > a {
4083 border-bottom: 1px solid #ddd;
4084 border-radius: 4px 4px 0 0;
4085 }
4086 .nav-tabs.nav-justified > .active > a,
4087 .nav-tabs.nav-justified > .active > a:hover,
4088 .nav-tabs.nav-justified > .active > a:focus {
4089 border-bottom-color: #fff;
4090 }
4091}
4092.nav-pills > li {
4093 float: left;
4094}
4095.nav-pills > li > a {
4096 border-radius: 4px;
4097}
4098.nav-pills > li + li {
4099 margin-left: 2px;
4100}
4101.nav-pills > li.active > a,
4102.nav-pills > li.active > a:hover,
4103.nav-pills > li.active > a:focus {
4104 color: #fff;
4105 background-color: #337ab7;
4106}
4107.nav-stacked > li {
4108 float: none;
4109}
4110.nav-stacked > li + li {
4111 margin-top: 2px;
4112 margin-left: 0;
4113}
4114.nav-justified {
4115 width: 100%;
4116}
4117.nav-justified > li {
4118 float: none;
4119}
4120.nav-justified > li > a {
4121 margin-bottom: 5px;
4122 text-align: center;
4123}
4124.nav-justified > .dropdown .dropdown-menu {
4125 top: auto;
4126 left: auto;
4127}
4128@media (min-width: 768px) {
4129 .nav-justified > li {
4130 display: table-cell;
4131 width: 1%;
4132 }
4133 .nav-justified > li > a {
4134 margin-bottom: 0;
4135 }
4136}
4137.nav-tabs-justified {
4138 border-bottom: 0;
4139}
4140.nav-tabs-justified > li > a {
4141 margin-right: 0;
4142 border-radius: 4px;
4143}
4144.nav-tabs-justified > .active > a,
4145.nav-tabs-justified > .active > a:hover,
4146.nav-tabs-justified > .active > a:focus {
4147 border: 1px solid #ddd;
4148}
4149@media (min-width: 768px) {
4150 .nav-tabs-justified > li > a {
4151 border-bottom: 1px solid #ddd;
4152 border-radius: 4px 4px 0 0;
4153 }
4154 .nav-tabs-justified > .active > a,
4155 .nav-tabs-justified > .active > a:hover,
4156 .nav-tabs-justified > .active > a:focus {
4157 border-bottom-color: #fff;
4158 }
4159}
4160.tab-content > .tab-pane {
4161 display: none;
4162}
4163.tab-content > .active {
4164 display: block;
4165}
4166.nav-tabs .dropdown-menu {
4167 margin-top: -1px;
4168 border-top-left-radius: 0;
4169 border-top-right-radius: 0;
4170}
4171.navbar {
4172 position: relative;
4173 min-height: 50px;
4174 margin-bottom: 20px;
4175 border: 1px solid transparent;
4176}
4177@media (min-width: 768px) {
4178 .navbar {
4179 border-radius: 4px;
4180 }
4181}
4182@media (min-width: 768px) {
4183 .navbar-header {
4184 float: left;
4185 }
4186}
4187.navbar-collapse {
4188 padding-right: 15px;
4189 padding-left: 15px;
4190 overflow-x: visible;
4191 -webkit-overflow-scrolling: touch;
4192 border-top: 1px solid transparent;
4193 -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
4194 box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
4195}
4196.navbar-collapse.in {
4197 overflow-y: auto;
4198}
4199@media (min-width: 768px) {
4200 .navbar-collapse {
4201 width: auto;
4202 border-top: 0;
4203 -webkit-box-shadow: none;
4204 box-shadow: none;
4205 }
4206 .navbar-collapse.collapse {
4207 display: block !important;
4208 height: auto !important;
4209 padding-bottom: 0;
4210 overflow: visible !important;
4211 }
4212 .navbar-collapse.in {
4213 overflow-y: visible;
4214 }
4215 .navbar-fixed-top .navbar-collapse,
4216 .navbar-static-top .navbar-collapse,
4217 .navbar-fixed-bottom .navbar-collapse {
4218 padding-right: 0;
4219 padding-left: 0;
4220 }
4221}
4222.navbar-fixed-top .navbar-collapse,
4223.navbar-fixed-bottom .navbar-collapse {
4224 max-height: 340px;
4225}
4226@media (max-device-width: 480px) and (orientation: landscape) {
4227 .navbar-fixed-top .navbar-collapse,
4228 .navbar-fixed-bottom .navbar-collapse {
4229 max-height: 200px;
4230 }
4231}
4232.container > .navbar-header,
4233.container-fluid > .navbar-header,
4234.container > .navbar-collapse,
4235.container-fluid > .navbar-collapse {
4236 margin-right: -15px;
4237 margin-left: -15px;
4238}
4239@media (min-width: 768px) {
4240 .container > .navbar-header,
4241 .container-fluid > .navbar-header,
4242 .container > .navbar-collapse,
4243 .container-fluid > .navbar-collapse {
4244 margin-right: 0;
4245 margin-left: 0;
4246 }
4247}
4248.navbar-static-top {
4249 z-index: 1000;
4250 border-width: 0 0 1px;
4251}
4252@media (min-width: 768px) {
4253 .navbar-static-top {
4254 border-radius: 0;
4255 }
4256}
4257.navbar-fixed-top,
4258.navbar-fixed-bottom {
4259 position: fixed;
4260 right: 0;
4261 left: 0;
4262 z-index: 1030;
4263}
4264@media (min-width: 768px) {
4265 .navbar-fixed-top,
4266 .navbar-fixed-bottom {
4267 border-radius: 0;
4268 }
4269}
4270.navbar-fixed-top {
4271 top: 0;
4272 border-width: 0 0 1px;
4273}
4274.navbar-fixed-bottom {
4275 bottom: 0;
4276 margin-bottom: 0;
4277 border-width: 1px 0 0;
4278}
4279.navbar-brand {
4280 float: left;
4281 height: 50px;
4282 padding: 15px 15px;
4283 font-size: 18px;
4284 line-height: 20px;
4285}
4286.navbar-brand:hover,
4287.navbar-brand:focus {
4288 text-decoration: none;
4289}
4290.navbar-brand > img {
4291 display: block;
4292}
4293@media (min-width: 768px) {
4294 .navbar > .container .navbar-brand,
4295 .navbar > .container-fluid .navbar-brand {
4296 margin-left: -15px;
4297 }
4298}
4299.navbar-toggle {
4300 position: relative;
4301 float: right;
4302 padding: 9px 10px;
4303 margin-top: 8px;
4304 margin-right: 15px;
4305 margin-bottom: 8px;
4306 background-color: transparent;
4307 background-image: none;
4308 border: 1px solid transparent;
4309 border-radius: 4px;
4310}
4311.navbar-toggle:focus {
4312 outline: 0;
4313}
4314.navbar-toggle .icon-bar {
4315 display: block;
4316 width: 22px;
4317 height: 2px;
4318 border-radius: 1px;
4319}
4320.navbar-toggle .icon-bar + .icon-bar {
4321 margin-top: 4px;
4322}
4323@media (min-width: 768px) {
4324 .navbar-toggle {
4325 display: none;
4326 }
4327}
4328.navbar-nav {
4329 margin: 7.5px -15px;
4330}
4331.navbar-nav > li > a {
4332 padding-top: 10px;
4333 padding-bottom: 10px;
4334 line-height: 20px;
4335}
4336@media (max-width: 767px) {
4337 .navbar-nav .open .dropdown-menu {
4338 position: static;
4339 float: none;
4340 width: auto;
4341 margin-top: 0;
4342 background-color: transparent;
4343 border: 0;
4344 -webkit-box-shadow: none;
4345 box-shadow: none;
4346 }
4347 .navbar-nav .open .dropdown-menu > li > a,
4348 .navbar-nav .open .dropdown-menu .dropdown-header {
4349 padding: 5px 15px 5px 25px;
4350 }
4351 .navbar-nav .open .dropdown-menu > li > a {
4352 line-height: 20px;
4353 }
4354 .navbar-nav .open .dropdown-menu > li > a:hover,
4355 .navbar-nav .open .dropdown-menu > li > a:focus {
4356 background-image: none;
4357 }
4358}
4359@media (min-width: 768px) {
4360 .navbar-nav {
4361 float: left;
4362 margin: 0;
4363 }
4364 .navbar-nav > li {
4365 float: left;
4366 }
4367 .navbar-nav > li > a {
4368 padding-top: 15px;
4369 padding-bottom: 15px;
4370 }
4371}
4372.navbar-form {
4373 padding: 10px 15px;
4374 margin-top: 8px;
4375 margin-right: -15px;
4376 margin-bottom: 8px;
4377 margin-left: -15px;
4378 border-top: 1px solid transparent;
4379 border-bottom: 1px solid transparent;
4380 -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
4381 box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
4382}
4383@media (min-width: 768px) {
4384 .navbar-form .form-group {
4385 display: inline-block;
4386 margin-bottom: 0;
4387 vertical-align: middle;
4388 }
4389 .navbar-form .form-control {
4390 display: inline-block;
4391 width: auto;
4392 vertical-align: middle;
4393 }
4394 .navbar-form .form-control-static {
4395 display: inline-block;
4396 }
4397 .navbar-form .input-group {
4398 display: inline-table;
4399 vertical-align: middle;
4400 }
4401 .navbar-form .input-group .input-group-addon,
4402 .navbar-form .input-group .input-group-btn,
4403 .navbar-form .input-group .form-control {
4404 width: auto;
4405 }
4406 .navbar-form .input-group > .form-control {
4407 width: 100%;
4408 }
4409 .navbar-form .control-label {
4410 margin-bottom: 0;
4411 vertical-align: middle;
4412 }
4413 .navbar-form .radio,
4414 .navbar-form .checkbox {
4415 display: inline-block;
4416 margin-top: 0;
4417 margin-bottom: 0;
4418 vertical-align: middle;
4419 }
4420 .navbar-form .radio label,
4421 .navbar-form .checkbox label {
4422 padding-left: 0;
4423 }
4424 .navbar-form .radio input[type="radio"],
4425 .navbar-form .checkbox input[type="checkbox"] {
4426 position: relative;
4427 margin-left: 0;
4428 }
4429 .navbar-form .has-feedback .form-control-feedback {
4430 top: 0;
4431 }
4432}
4433@media (max-width: 767px) {
4434 .navbar-form .form-group {
4435 margin-bottom: 5px;
4436 }
4437 .navbar-form .form-group:last-child {
4438 margin-bottom: 0;
4439 }
4440}
4441@media (min-width: 768px) {
4442 .navbar-form {
4443 width: auto;
4444 padding-top: 0;
4445 padding-bottom: 0;
4446 margin-right: 0;
4447 margin-left: 0;
4448 border: 0;
4449 -webkit-box-shadow: none;
4450 box-shadow: none;
4451 }
4452}
4453.navbar-nav > li > .dropdown-menu {
4454 margin-top: 0;
4455 border-top-left-radius: 0;
4456 border-top-right-radius: 0;
4457}
4458.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
4459 margin-bottom: 0;
4460 border-top-left-radius: 4px;
4461 border-top-right-radius: 4px;
4462 border-bottom-right-radius: 0;
4463 border-bottom-left-radius: 0;
4464}
4465.navbar-btn {
4466 margin-top: 8px;
4467 margin-bottom: 8px;
4468}
4469.navbar-btn.btn-sm {
4470 margin-top: 10px;
4471 margin-bottom: 10px;
4472}
4473.navbar-btn.btn-xs {
4474 margin-top: 14px;
4475 margin-bottom: 14px;
4476}
4477.navbar-text {
4478 margin-top: 15px;
4479 margin-bottom: 15px;
4480}
4481@media (min-width: 768px) {
4482 .navbar-text {
4483 float: left;
4484 margin-right: 15px;
4485 margin-left: 15px;
4486 }
4487}
4488@media (min-width: 768px) {
4489 .navbar-left {
4490 float: left !important;
4491 }
4492 .navbar-right {
4493 float: right !important;
4494 margin-right: -15px;
4495 }
4496 .navbar-right ~ .navbar-right {
4497 margin-right: 0;
4498 }
4499}
4500.navbar-default {
4501 background-color: #f8f8f8;
4502 border-color: #e7e7e7;
4503}
4504.navbar-default .navbar-brand {
4505 color: #777;
4506}
4507.navbar-default .navbar-brand:hover,
4508.navbar-default .navbar-brand:focus {
4509 color: #5e5e5e;
4510 background-color: transparent;
4511}
4512.navbar-default .navbar-text {
4513 color: #777;
4514}
4515.navbar-default .navbar-nav > li > a {
4516 color: #777;
4517}
4518.navbar-default .navbar-nav > li > a:hover,
4519.navbar-default .navbar-nav > li > a:focus {
4520 color: #333;
4521 background-color: transparent;
4522}
4523.navbar-default .navbar-nav > .active > a,
4524.navbar-default .navbar-nav > .active > a:hover,
4525.navbar-default .navbar-nav > .active > a:focus {
4526 color: #555;
4527 background-color: #e7e7e7;
4528}
4529.navbar-default .navbar-nav > .disabled > a,
4530.navbar-default .navbar-nav > .disabled > a:hover,
4531.navbar-default .navbar-nav > .disabled > a:focus {
4532 color: #ccc;
4533 background-color: transparent;
4534}
4535.navbar-default .navbar-toggle {
4536 border-color: #ddd;
4537}
4538.navbar-default .navbar-toggle:hover,
4539.navbar-default .navbar-toggle:focus {
4540 background-color: #ddd;
4541}
4542.navbar-default .navbar-toggle .icon-bar {
4543 background-color: #888;
4544}
4545.navbar-default .navbar-collapse,
4546.navbar-default .navbar-form {
4547 border-color: #e7e7e7;
4548}
4549.navbar-default .navbar-nav > .open > a,
4550.navbar-default .navbar-nav > .open > a:hover,
4551.navbar-default .navbar-nav > .open > a:focus {
4552 color: #555;
4553 background-color: #e7e7e7;
4554}
4555@media (max-width: 767px) {
4556 .navbar-default .navbar-nav .open .dropdown-menu > li > a {
4557 color: #777;
4558 }
4559 .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
4560 .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
4561 color: #333;
4562 background-color: transparent;
4563 }
4564 .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
4565 .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
4566 .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
4567 color: #555;
4568 background-color: #e7e7e7;
4569 }
4570 .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
4571 .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
4572 .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
4573 color: #ccc;
4574 background-color: transparent;
4575 }
4576}
4577.navbar-default .navbar-link {
4578 color: #777;
4579}
4580.navbar-default .navbar-link:hover {
4581 color: #333;
4582}
4583.navbar-default .btn-link {
4584 color: #777;
4585}
4586.navbar-default .btn-link:hover,
4587.navbar-default .btn-link:focus {
4588 color: #333;
4589}
4590.navbar-default .btn-link[disabled]:hover,
4591fieldset[disabled] .navbar-default .btn-link:hover,
4592.navbar-default .btn-link[disabled]:focus,
4593fieldset[disabled] .navbar-default .btn-link:focus {
4594 color: #ccc;
4595}
4596.navbar-inverse {
4597 background-color: #222;
4598 border-color: #080808;
4599}
4600.navbar-inverse .navbar-brand {
4601 color: #9d9d9d;
4602}
4603.navbar-inverse .navbar-brand:hover,
4604.navbar-inverse .navbar-brand:focus {
4605 color: #fff;
4606 background-color: transparent;
4607}
4608.navbar-inverse .navbar-text {
4609 color: #9d9d9d;
4610}
4611.navbar-inverse .navbar-nav > li > a {
4612 color: #9d9d9d;
4613}
4614.navbar-inverse .navbar-nav > li > a:hover,
4615.navbar-inverse .navbar-nav > li > a:focus {
4616 color: #fff;
4617 background-color: transparent;
4618}
4619.navbar-inverse .navbar-nav > .active > a,
4620.navbar-inverse .navbar-nav > .active > a:hover,
4621.navbar-inverse .navbar-nav > .active > a:focus {
4622 color: #fff;
4623 background-color: #080808;
4624}
4625.navbar-inverse .navbar-nav > .disabled > a,
4626.navbar-inverse .navbar-nav > .disabled > a:hover,
4627.navbar-inverse .navbar-nav > .disabled > a:focus {
4628 color: #444;
4629 background-color: transparent;
4630}
4631.navbar-inverse .navbar-toggle {
4632 border-color: #333;
4633}
4634.navbar-inverse .navbar-toggle:hover,
4635.navbar-inverse .navbar-toggle:focus {
4636 background-color: #333;
4637}
4638.navbar-inverse .navbar-toggle .icon-bar {
4639 background-color: #fff;
4640}
4641.navbar-inverse .navbar-collapse,
4642.navbar-inverse .navbar-form {
4643 border-color: #101010;
4644}
4645.navbar-inverse .navbar-nav > .open > a,
4646.navbar-inverse .navbar-nav > .open > a:hover,
4647.navbar-inverse .navbar-nav > .open > a:focus {
4648 color: #fff;
4649 background-color: #080808;
4650}
4651@media (max-width: 767px) {
4652 .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
4653 border-color: #080808;
4654 }
4655 .navbar-inverse .navbar-nav .open .dropdown-menu .divider {
4656 background-color: #080808;
4657 }
4658 .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
4659 color: #9d9d9d;
4660 }
4661 .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
4662 .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
4663 color: #fff;
4664 background-color: transparent;
4665 }
4666 .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
4667 .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
4668 .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
4669 color: #fff;
4670 background-color: #080808;
4671 }
4672 .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
4673 .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
4674 .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
4675 color: #444;
4676 background-color: transparent;
4677 }
4678}
4679.navbar-inverse .navbar-link {
4680 color: #9d9d9d;
4681}
4682.navbar-inverse .navbar-link:hover {
4683 color: #fff;
4684}
4685.navbar-inverse .btn-link {
4686 color: #9d9d9d;
4687}
4688.navbar-inverse .btn-link:hover,
4689.navbar-inverse .btn-link:focus {
4690 color: #fff;
4691}
4692.navbar-inverse .btn-link[disabled]:hover,
4693fieldset[disabled] .navbar-inverse .btn-link:hover,
4694.navbar-inverse .btn-link[disabled]:focus,
4695fieldset[disabled] .navbar-inverse .btn-link:focus {
4696 color: #444;
4697}
4698.breadcrumb {
4699 padding: 8px 15px;
4700 margin-bottom: 20px;
4701 list-style: none;
4702 background-color: #f5f5f5;
4703 border-radius: 4px;
4704}
4705.breadcrumb > li {
4706 display: inline-block;
4707}
4708.breadcrumb > li + li:before {
4709 padding: 0 5px;
4710 color: #ccc;
4711 content: "/\00a0";
4712}
4713.breadcrumb > .active {
4714 color: #777;
4715}
4716.pagination {
4717 display: inline-block;
4718 padding-left: 0;
4719 margin: 20px 0;
4720 border-radius: 4px;
4721}
4722.pagination > li {
4723 display: inline;
4724}
4725.pagination > li > a,
4726.pagination > li > span {
4727 position: relative;
4728 float: left;
4729 padding: 6px 12px;
4730 margin-left: -1px;
4731 line-height: 1.42857143;
4732 color: #337ab7;
4733 text-decoration: none;
4734 background-color: #fff;
4735 border: 1px solid #ddd;
4736}
4737.pagination > li:first-child > a,
4738.pagination > li:first-child > span {
4739 margin-left: 0;
4740 border-top-left-radius: 4px;
4741 border-bottom-left-radius: 4px;
4742}
4743.pagination > li:last-child > a,
4744.pagination > li:last-child > span {
4745 border-top-right-radius: 4px;
4746 border-bottom-right-radius: 4px;
4747}
4748.pagination > li > a:hover,
4749.pagination > li > span:hover,
4750.pagination > li > a:focus,
4751.pagination > li > span:focus {
4752 z-index: 2;
4753 color: #23527c;
4754 background-color: #eee;
4755 border-color: #ddd;
4756}
4757.pagination > .active > a,
4758.pagination > .active > span,
4759.pagination > .active > a:hover,
4760.pagination > .active > span:hover,
4761.pagination > .active > a:focus,
4762.pagination > .active > span:focus {
4763 z-index: 3;
4764 color: #fff;
4765 cursor: default;
4766 background-color: #337ab7;
4767 border-color: #337ab7;
4768}
4769.pagination > .disabled > span,
4770.pagination > .disabled > span:hover,
4771.pagination > .disabled > span:focus,
4772.pagination > .disabled > a,
4773.pagination > .disabled > a:hover,
4774.pagination > .disabled > a:focus {
4775 color: #777;
4776 cursor: not-allowed;
4777 background-color: #fff;
4778 border-color: #ddd;
4779}
4780.pagination-lg > li > a,
4781.pagination-lg > li > span {
4782 padding: 10px 16px;
4783 font-size: 18px;
4784 line-height: 1.3333333;
4785}
4786.pagination-lg > li:first-child > a,
4787.pagination-lg > li:first-child > span {
4788 border-top-left-radius: 6px;
4789 border-bottom-left-radius: 6px;
4790}
4791.pagination-lg > li:last-child > a,
4792.pagination-lg > li:last-child > span {
4793 border-top-right-radius: 6px;
4794 border-bottom-right-radius: 6px;
4795}
4796.pagination-sm > li > a,
4797.pagination-sm > li > span {
4798 padding: 5px 10px;
4799 font-size: 12px;
4800 line-height: 1.5;
4801}
4802.pagination-sm > li:first-child > a,
4803.pagination-sm > li:first-child > span {
4804 border-top-left-radius: 3px;
4805 border-bottom-left-radius: 3px;
4806}
4807.pagination-sm > li:last-child > a,
4808.pagination-sm > li:last-child > span {
4809 border-top-right-radius: 3px;
4810 border-bottom-right-radius: 3px;
4811}
4812.pager {
4813 padding-left: 0;
4814 margin: 20px 0;
4815 text-align: center;
4816 list-style: none;
4817}
4818.pager li {
4819 display: inline;
4820}
4821.pager li > a,
4822.pager li > span {
4823 display: inline-block;
4824 padding: 5px 14px;
4825 background-color: #fff;
4826 border: 1px solid #ddd;
4827 border-radius: 15px;
4828}
4829.pager li > a:hover,
4830.pager li > a:focus {
4831 text-decoration: none;
4832 background-color: #eee;
4833}
4834.pager .next > a,
4835.pager .next > span {
4836 float: right;
4837}
4838.pager .previous > a,
4839.pager .previous > span {
4840 float: left;
4841}
4842.pager .disabled > a,
4843.pager .disabled > a:hover,
4844.pager .disabled > a:focus,
4845.pager .disabled > span {
4846 color: #777;
4847 cursor: not-allowed;
4848 background-color: #fff;
4849}
4850.label {
4851 display: inline;
4852 padding: .2em .6em .3em;
4853 font-size: 75%;
4854 font-weight: bold;
4855 line-height: 1;
4856 color: #fff;
4857 text-align: center;
4858 white-space: nowrap;
4859 vertical-align: baseline;
4860 border-radius: .25em;
4861}
4862a.label:hover,
4863a.label:focus {
4864 color: #fff;
4865 text-decoration: none;
4866 cursor: pointer;
4867}
4868.label:empty {
4869 display: none;
4870}
4871.btn .label {
4872 position: relative;
4873 top: -1px;
4874}
4875.label-default {
4876 background-color: #777;
4877}
4878.label-default[href]:hover,
4879.label-default[href]:focus {
4880 background-color: #5e5e5e;
4881}
4882.label-primary {
4883 background-color: #337ab7;
4884}
4885.label-primary[href]:hover,
4886.label-primary[href]:focus {
4887 background-color: #286090;
4888}
4889.label-success {
4890 background-color: #5cb85c;
4891}
4892.label-success[href]:hover,
4893.label-success[href]:focus {
4894 background-color: #449d44;
4895}
4896.label-info {
4897 background-color: #5bc0de;
4898}
4899.label-info[href]:hover,
4900.label-info[href]:focus {
4901 background-color: #31b0d5;
4902}
4903.label-warning {
4904 background-color: #f0ad4e;
4905}
4906.label-warning[href]:hover,
4907.label-warning[href]:focus {
4908 background-color: #ec971f;
4909}
4910.label-danger {
4911 background-color: #d9534f;
4912}
4913.label-danger[href]:hover,
4914.label-danger[href]:focus {
4915 background-color: #c9302c;
4916}
4917.badge {
4918 display: inline-block;
4919 min-width: 10px;
4920 padding: 3px 7px;
4921 font-size: 12px;
4922 font-weight: bold;
4923 line-height: 1;
4924 color: #fff;
4925 text-align: center;
4926 white-space: nowrap;
4927 vertical-align: middle;
4928 background-color: #777;
4929 border-radius: 10px;
4930}
4931.badge:empty {
4932 display: none;
4933}
4934.btn .badge {
4935 position: relative;
4936 top: -1px;
4937}
4938.btn-xs .badge,
4939.btn-group-xs > .btn .badge {
4940 top: 0;
4941 padding: 1px 5px;
4942}
4943a.badge:hover,
4944a.badge:focus {
4945 color: #fff;
4946 text-decoration: none;
4947 cursor: pointer;
4948}
4949.list-group-item.active > .badge,
4950.nav-pills > .active > a > .badge {
4951 color: #337ab7;
4952 background-color: #fff;
4953}
4954.list-group-item > .badge {
4955 float: right;
4956}
4957.list-group-item > .badge + .badge {
4958 margin-right: 5px;
4959}
4960.nav-pills > li > a > .badge {
4961 margin-left: 3px;
4962}
4963.jumbotron {
4964 padding-top: 30px;
4965 padding-bottom: 30px;
4966 margin-bottom: 30px;
4967 color: inherit;
4968 background-color: #eee;
4969}
4970.jumbotron h1,
4971.jumbotron .h1 {
4972 color: inherit;
4973}
4974.jumbotron p {
4975 margin-bottom: 15px;
4976 font-size: 21px;
4977 font-weight: 200;
4978}
4979.jumbotron > hr {
4980 border-top-color: #d5d5d5;
4981}
4982.container .jumbotron,
4983.container-fluid .jumbotron {
4984 padding-right: 15px;
4985 padding-left: 15px;
4986 border-radius: 6px;
4987}
4988.jumbotron .container {
4989 max-width: 100%;
4990}
4991@media screen and (min-width: 768px) {
4992 .jumbotron {
4993 padding-top: 48px;
4994 padding-bottom: 48px;
4995 }
4996 .container .jumbotron,
4997 .container-fluid .jumbotron {
4998 padding-right: 60px;
4999 padding-left: 60px;
5000 }
5001 .jumbotron h1,
5002 .jumbotron .h1 {
5003 font-size: 63px;
5004 }
5005}
5006.thumbnail {
5007 display: block;
5008 padding: 4px;
5009 margin-bottom: 20px;
5010 line-height: 1.42857143;
5011 background-color: #fff;
5012 border: 1px solid #ddd;
5013 border-radius: 4px;
5014 -webkit-transition: border .2s ease-in-out;
5015 -o-transition: border .2s ease-in-out;
5016 transition: border .2s ease-in-out;
5017}
5018.thumbnail > img,
5019.thumbnail a > img {
5020 margin-right: auto;
5021 margin-left: auto;
5022}
5023a.thumbnail:hover,
5024a.thumbnail:focus,
5025a.thumbnail.active {
5026 border-color: #337ab7;
5027}
5028.thumbnail .caption {
5029 padding: 9px;
5030 color: #333;
5031}
5032.alert {
5033 padding: 15px;
5034 margin-bottom: 20px;
5035 border: 1px solid transparent;
5036 border-radius: 4px;
5037}
5038.alert h4 {
5039 margin-top: 0;
5040 color: inherit;
5041}
5042.alert .alert-link {
5043 font-weight: bold;
5044}
5045.alert > p,
5046.alert > ul {
5047 margin-bottom: 0;
5048}
5049.alert > p + p {
5050 margin-top: 5px;
5051}
5052.alert-dismissable,
5053.alert-dismissible {
5054 padding-right: 35px;
5055}
5056.alert-dismissable .close,
5057.alert-dismissible .close {
5058 position: relative;
5059 top: -2px;
5060 right: -21px;
5061 color: inherit;
5062}
5063.alert-success {
5064 color: #3c763d;
5065 background-color: #dff0d8;
5066 border-color: #d6e9c6;
5067}
5068.alert-success hr {
5069 border-top-color: #c9e2b3;
5070}
5071.alert-success .alert-link {
5072 color: #2b542c;
5073}
5074.alert-info {
5075 color: #31708f;
5076 background-color: #d9edf7;
5077 border-color: #bce8f1;
5078}
5079.alert-info hr {
5080 border-top-color: #a6e1ec;
5081}
5082.alert-info .alert-link {
5083 color: #245269;
5084}
5085.alert-warning {
5086 color: #8a6d3b;
5087 background-color: #fcf8e3;
5088 border-color: #faebcc;
5089}
5090.alert-warning hr {
5091 border-top-color: #f7e1b5;
5092}
5093.alert-warning .alert-link {
5094 color: #66512c;
5095}
5096.alert-danger {
5097 color: #a94442;
5098 background-color: #f2dede;
5099 border-color: #ebccd1;
5100}
5101.alert-danger hr {
5102 border-top-color: #e4b9c0;
5103}
5104.alert-danger .alert-link {
5105 color: #843534;
5106}
5107@-webkit-keyframes progress-bar-stripes {
5108 from {
5109 background-position: 40px 0;
5110 }
5111 to {
5112 background-position: 0 0;
5113 }
5114}
5115@-o-keyframes progress-bar-stripes {
5116 from {
5117 background-position: 40px 0;
5118 }
5119 to {
5120 background-position: 0 0;
5121 }
5122}
5123@keyframes progress-bar-stripes {
5124 from {
5125 background-position: 40px 0;
5126 }
5127 to {
5128 background-position: 0 0;
5129 }
5130}
5131.progress {
5132 height: 20px;
5133 margin-bottom: 20px;
5134 overflow: hidden;
5135 background-color: #f5f5f5;
5136 border-radius: 4px;
5137 -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
5138 box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
5139}
5140.progress-bar {
5141 float: left;
5142 width: 0;
5143 height: 100%;
5144 font-size: 12px;
5145 line-height: 20px;
5146 color: #fff;
5147 text-align: center;
5148 background-color: #337ab7;
5149 -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
5150 box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
5151 -webkit-transition: width .6s ease;
5152 -o-transition: width .6s ease;
5153 transition: width .6s ease;
5154}
5155.progress-striped .progress-bar,
5156.progress-bar-striped {
5157 background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5158 background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5159 background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5160 -webkit-background-size: 40px 40px;
5161 background-size: 40px 40px;
5162}
5163.progress.active .progress-bar,
5164.progress-bar.active {
5165 -webkit-animation: progress-bar-stripes 2s linear infinite;
5166 -o-animation: progress-bar-stripes 2s linear infinite;
5167 animation: progress-bar-stripes 2s linear infinite;
5168}
5169.progress-bar-success {
5170 background-color: #5cb85c;
5171}
5172.progress-striped .progress-bar-success {
5173 background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5174 background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5175 background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5176}
5177.progress-bar-info {
5178 background-color: #5bc0de;
5179}
5180.progress-striped .progress-bar-info {
5181 background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5182 background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5183 background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5184}
5185.progress-bar-warning {
5186 background-color: #f0ad4e;
5187}
5188.progress-striped .progress-bar-warning {
5189 background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5190 background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5191 background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5192}
5193.progress-bar-danger {
5194 background-color: #d9534f;
5195}
5196.progress-striped .progress-bar-danger {
5197 background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5198 background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5199 background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
5200}
5201.media {
5202 margin-top: 15px;
5203}
5204.media:first-child {
5205 margin-top: 0;
5206}
5207.media,
5208.media-body {
5209 overflow: hidden;
5210 zoom: 1;
5211}
5212.media-body {
5213 width: 10000px;
5214}
5215.media-object {
5216 display: block;
5217}
5218.media-object.img-thumbnail {
5219 max-width: none;
5220}
5221.media-right,
5222.media > .pull-right {
5223 padding-left: 10px;
5224}
5225.media-left,
5226.media > .pull-left {
5227 padding-right: 10px;
5228}
5229.media-left,
5230.media-right,
5231.media-body {
5232 display: table-cell;
5233 vertical-align: top;
5234}
5235.media-middle {
5236 vertical-align: middle;
5237}
5238.media-bottom {
5239 vertical-align: bottom;
5240}
5241.media-heading {
5242 margin-top: 0;
5243 margin-bottom: 5px;
5244}
5245.media-list {
5246 padding-left: 0;
5247 list-style: none;
5248}
5249.list-group {
5250 padding-left: 0;
5251 margin-bottom: 20px;
5252}
5253.list-group-item {
5254 position: relative;
5255 display: block;
5256 padding: 10px 15px;
5257 margin-bottom: -1px;
5258 background-color: #fff;
5259 border: 1px solid #ddd;
5260}
5261.list-group-item:first-child {
5262 border-top-left-radius: 4px;
5263 border-top-right-radius: 4px;
5264}
5265.list-group-item:last-child {
5266 margin-bottom: 0;
5267 border-bottom-right-radius: 4px;
5268 border-bottom-left-radius: 4px;
5269}
5270a.list-group-item,
5271button.list-group-item {
5272 color: #555;
5273}
5274a.list-group-item .list-group-item-heading,
5275button.list-group-item .list-group-item-heading {
5276 color: #333;
5277}
5278a.list-group-item:hover,
5279button.list-group-item:hover,
5280a.list-group-item:focus,
5281button.list-group-item:focus {
5282 color: #555;
5283 text-decoration: none;
5284 background-color: #f5f5f5;
5285}
5286button.list-group-item {
5287 width: 100%;
5288 text-align: left;
5289}
5290.list-group-item.disabled,
5291.list-group-item.disabled:hover,
5292.list-group-item.disabled:focus {
5293 color: #777;
5294 cursor: not-allowed;
5295 background-color: #eee;
5296}
5297.list-group-item.disabled .list-group-item-heading,
5298.list-group-item.disabled:hover .list-group-item-heading,
5299.list-group-item.disabled:focus .list-group-item-heading {
5300 color: inherit;
5301}
5302.list-group-item.disabled .list-group-item-text,
5303.list-group-item.disabled:hover .list-group-item-text,
5304.list-group-item.disabled:focus .list-group-item-text {
5305 color: #777;
5306}
5307.list-group-item.active,
5308.list-group-item.active:hover,
5309.list-group-item.active:focus {
5310 z-index: 2;
5311 color: #fff;
5312 background-color: #337ab7;
5313 border-color: #337ab7;
5314}
5315.list-group-item.active .list-group-item-heading,
5316.list-group-item.active:hover .list-group-item-heading,
5317.list-group-item.active:focus .list-group-item-heading,
5318.list-group-item.active .list-group-item-heading > small,
5319.list-group-item.active:hover .list-group-item-heading > small,
5320.list-group-item.active:focus .list-group-item-heading > small,
5321.list-group-item.active .list-group-item-heading > .small,
5322.list-group-item.active:hover .list-group-item-heading > .small,
5323.list-group-item.active:focus .list-group-item-heading > .small {
5324 color: inherit;
5325}
5326.list-group-item.active .list-group-item-text,
5327.list-group-item.active:hover .list-group-item-text,
5328.list-group-item.active:focus .list-group-item-text {
5329 color: #c7ddef;
5330}
5331.list-group-item-success {
5332 color: #3c763d;
5333 background-color: #dff0d8;
5334}
5335a.list-group-item-success,
5336button.list-group-item-success {
5337 color: #3c763d;
5338}
5339a.list-group-item-success .list-group-item-heading,
5340button.list-group-item-success .list-group-item-heading {
5341 color: inherit;
5342}
5343a.list-group-item-success:hover,
5344button.list-group-item-success:hover,
5345a.list-group-item-success:focus,
5346button.list-group-item-success:focus {
5347 color: #3c763d;
5348 background-color: #d0e9c6;
5349}
5350a.list-group-item-success.active,
5351button.list-group-item-success.active,
5352a.list-group-item-success.active:hover,
5353button.list-group-item-success.active:hover,
5354a.list-group-item-success.active:focus,
5355button.list-group-item-success.active:focus {
5356 color: #fff;
5357 background-color: #3c763d;
5358 border-color: #3c763d;
5359}
5360.list-group-item-info {
5361 color: #31708f;
5362 background-color: #d9edf7;
5363}
5364a.list-group-item-info,
5365button.list-group-item-info {
5366 color: #31708f;
5367}
5368a.list-group-item-info .list-group-item-heading,
5369button.list-group-item-info .list-group-item-heading {
5370 color: inherit;
5371}
5372a.list-group-item-info:hover,
5373button.list-group-item-info:hover,
5374a.list-group-item-info:focus,
5375button.list-group-item-info:focus {
5376 color: #31708f;
5377 background-color: #c4e3f3;
5378}
5379a.list-group-item-info.active,
5380button.list-group-item-info.active,
5381a.list-group-item-info.active:hover,
5382button.list-group-item-info.active:hover,
5383a.list-group-item-info.active:focus,
5384button.list-group-item-info.active:focus {
5385 color: #fff;
5386 background-color: #31708f;
5387 border-color: #31708f;
5388}
5389.list-group-item-warning {
5390 color: #8a6d3b;
5391 background-color: #fcf8e3;
5392}
5393a.list-group-item-warning,
5394button.list-group-item-warning {
5395 color: #8a6d3b;
5396}
5397a.list-group-item-warning .list-group-item-heading,
5398button.list-group-item-warning .list-group-item-heading {
5399 color: inherit;
5400}
5401a.list-group-item-warning:hover,
5402button.list-group-item-warning:hover,
5403a.list-group-item-warning:focus,
5404button.list-group-item-warning:focus {
5405 color: #8a6d3b;
5406 background-color: #faf2cc;
5407}
5408a.list-group-item-warning.active,
5409button.list-group-item-warning.active,
5410a.list-group-item-warning.active:hover,
5411button.list-group-item-warning.active:hover,
5412a.list-group-item-warning.active:focus,
5413button.list-group-item-warning.active:focus {
5414 color: #fff;
5415 background-color: #8a6d3b;
5416 border-color: #8a6d3b;
5417}
5418.list-group-item-danger {
5419 color: #a94442;
5420 background-color: #f2dede;
5421}
5422a.list-group-item-danger,
5423button.list-group-item-danger {
5424 color: #a94442;
5425}
5426a.list-group-item-danger .list-group-item-heading,
5427button.list-group-item-danger .list-group-item-heading {
5428 color: inherit;
5429}
5430a.list-group-item-danger:hover,
5431button.list-group-item-danger:hover,
5432a.list-group-item-danger:focus,
5433button.list-group-item-danger:focus {
5434 color: #a94442;
5435 background-color: #ebcccc;
5436}
5437a.list-group-item-danger.active,
5438button.list-group-item-danger.active,
5439a.list-group-item-danger.active:hover,
5440button.list-group-item-danger.active:hover,
5441a.list-group-item-danger.active:focus,
5442button.list-group-item-danger.active:focus {
5443 color: #fff;
5444 background-color: #a94442;
5445 border-color: #a94442;
5446}
5447.list-group-item-heading {
5448 margin-top: 0;
5449 margin-bottom: 5px;
5450}
5451.list-group-item-text {
5452 margin-bottom: 0;
5453 line-height: 1.3;
5454}
5455.panel {
5456 margin-bottom: 20px;
5457 background-color: #fff;
5458 border: 1px solid transparent;
5459 border-radius: 4px;
5460 -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
5461 box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
5462}
5463.panel-body {
5464 padding: 15px;
5465}
5466.panel-heading {
5467 padding: 10px 15px;
5468 border-bottom: 1px solid transparent;
5469 border-top-left-radius: 3px;
5470 border-top-right-radius: 3px;
5471}
5472.panel-heading > .dropdown .dropdown-toggle {
5473 color: inherit;
5474}
5475.panel-title {
5476 margin-top: 0;
5477 margin-bottom: 0;
5478 font-size: 16px;
5479 color: inherit;
5480}
5481.panel-title > a,
5482.panel-title > small,
5483.panel-title > .small,
5484.panel-title > small > a,
5485.panel-title > .small > a {
5486 color: inherit;
5487}
5488.panel-footer {
5489 padding: 10px 15px;
5490 background-color: #f5f5f5;
5491 border-top: 1px solid #ddd;
5492 border-bottom-right-radius: 3px;
5493 border-bottom-left-radius: 3px;
5494}
5495.panel > .list-group,
5496.panel > .panel-collapse > .list-group {
5497 margin-bottom: 0;
5498}
5499.panel > .list-group .list-group-item,
5500.panel > .panel-collapse > .list-group .list-group-item {
5501 border-width: 1px 0;
5502 border-radius: 0;
5503}
5504.panel > .list-group:first-child .list-group-item:first-child,
5505.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
5506 border-top: 0;
5507 border-top-left-radius: 3px;
5508 border-top-right-radius: 3px;
5509}
5510.panel > .list-group:last-child .list-group-item:last-child,
5511.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
5512 border-bottom: 0;
5513 border-bottom-right-radius: 3px;
5514 border-bottom-left-radius: 3px;
5515}
5516.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {
5517 border-top-left-radius: 0;
5518 border-top-right-radius: 0;
5519}
5520.panel-heading + .list-group .list-group-item:first-child {
5521 border-top-width: 0;
5522}
5523.list-group + .panel-footer {
5524 border-top-width: 0;
5525}
5526.panel > .table,
5527.panel > .table-responsive > .table,
5528.panel > .panel-collapse > .table {
5529 margin-bottom: 0;
5530}
5531.panel > .table caption,
5532.panel > .table-responsive > .table caption,
5533.panel > .panel-collapse > .table caption {
5534 padding-right: 15px;
5535 padding-left: 15px;
5536}
5537.panel > .table:first-child,
5538.panel > .table-responsive:first-child > .table:first-child {
5539 border-top-left-radius: 3px;
5540 border-top-right-radius: 3px;
5541}
5542.panel > .table:first-child > thead:first-child > tr:first-child,
5543.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,
5544.panel > .table:first-child > tbody:first-child > tr:first-child,
5545.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {
5546 border-top-left-radius: 3px;
5547 border-top-right-radius: 3px;
5548}
5549.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
5550.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
5551.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
5552.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,
5553.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,
5554.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,
5555.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,
5556.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
5557 border-top-left-radius: 3px;
5558}
5559.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,
5560.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,
5561.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,
5562.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,
5563.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,
5564.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,
5565.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,
5566.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
5567 border-top-right-radius: 3px;
5568}
5569.panel > .table:last-child,
5570.panel > .table-responsive:last-child > .table:last-child {
5571 border-bottom-right-radius: 3px;
5572 border-bottom-left-radius: 3px;
5573}
5574.panel > .table:last-child > tbody:last-child > tr:last-child,
5575.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,
5576.panel > .table:last-child > tfoot:last-child > tr:last-child,
5577.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {
5578 border-bottom-right-radius: 3px;
5579 border-bottom-left-radius: 3px;
5580}
5581.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
5582.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
5583.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
5584.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
5585.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,
5586.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,
5587.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,
5588.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
5589 border-bottom-left-radius: 3px;
5590}
5591.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,
5592.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,
5593.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
5594.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
5595.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,
5596.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,
5597.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,
5598.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
5599 border-bottom-right-radius: 3px;
5600}
5601.panel > .panel-body + .table,
5602.panel > .panel-body + .table-responsive,
5603.panel > .table + .panel-body,
5604.panel > .table-responsive + .panel-body {
5605 border-top: 1px solid #ddd;
5606}
5607.panel > .table > tbody:first-child > tr:first-child th,
5608.panel > .table > tbody:first-child > tr:first-child td {
5609 border-top: 0;
5610}
5611.panel > .table-bordered,
5612.panel > .table-responsive > .table-bordered {
5613 border: 0;
5614}
5615.panel > .table-bordered > thead > tr > th:first-child,
5616.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
5617.panel > .table-bordered > tbody > tr > th:first-child,
5618.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
5619.panel > .table-bordered > tfoot > tr > th:first-child,
5620.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
5621.panel > .table-bordered > thead > tr > td:first-child,
5622.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
5623.panel > .table-bordered > tbody > tr > td:first-child,
5624.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
5625.panel > .table-bordered > tfoot > tr > td:first-child,
5626.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
5627 border-left: 0;
5628}
5629.panel > .table-bordered > thead > tr > th:last-child,
5630.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
5631.panel > .table-bordered > tbody > tr > th:last-child,
5632.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
5633.panel > .table-bordered > tfoot > tr > th:last-child,
5634.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
5635.panel > .table-bordered > thead > tr > td:last-child,
5636.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
5637.panel > .table-bordered > tbody > tr > td:last-child,
5638.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
5639.panel > .table-bordered > tfoot > tr > td:last-child,
5640.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
5641 border-right: 0;
5642}
5643.panel > .table-bordered > thead > tr:first-child > td,
5644.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,
5645.panel > .table-bordered > tbody > tr:first-child > td,
5646.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,
5647.panel > .table-bordered > thead > tr:first-child > th,
5648.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,
5649.panel > .table-bordered > tbody > tr:first-child > th,
5650.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {
5651 border-bottom: 0;
5652}
5653.panel > .table-bordered > tbody > tr:last-child > td,
5654.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
5655.panel > .table-bordered > tfoot > tr:last-child > td,
5656.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,
5657.panel > .table-bordered > tbody > tr:last-child > th,
5658.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
5659.panel > .table-bordered > tfoot > tr:last-child > th,
5660.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
5661 border-bottom: 0;
5662}
5663.panel > .table-responsive {
5664 margin-bottom: 0;
5665 border: 0;
5666}
5667.panel-group {
5668 margin-bottom: 20px;
5669}
5670.panel-group .panel {
5671 margin-bottom: 0;
5672 border-radius: 4px;
5673}
5674.panel-group .panel + .panel {
5675 margin-top: 5px;
5676}
5677.panel-group .panel-heading {
5678 border-bottom: 0;
5679}
5680.panel-group .panel-heading + .panel-collapse > .panel-body,
5681.panel-group .panel-heading + .panel-collapse > .list-group {
5682 border-top: 1px solid #ddd;
5683}
5684.panel-group .panel-footer {
5685 border-top: 0;
5686}
5687.panel-group .panel-footer + .panel-collapse .panel-body {
5688 border-bottom: 1px solid #ddd;
5689}
5690.panel-default {
5691 border-color: #ddd;
5692}
5693.panel-default > .panel-heading {
5694 color: #333;
5695 background-color: #f5f5f5;
5696 border-color: #ddd;
5697}
5698.panel-default > .panel-heading + .panel-collapse > .panel-body {
5699 border-top-color: #ddd;
5700}
5701.panel-default > .panel-heading .badge {
5702 color: #f5f5f5;
5703 background-color: #333;
5704}
5705.panel-default > .panel-footer + .panel-collapse > .panel-body {
5706 border-bottom-color: #ddd;
5707}
5708.panel-primary {
5709 border-color: #337ab7;
5710}
5711.panel-primary > .panel-heading {
5712 color: #fff;
5713 background-color: #337ab7;
5714 border-color: #337ab7;
5715}
5716.panel-primary > .panel-heading + .panel-collapse > .panel-body {
5717 border-top-color: #337ab7;
5718}
5719.panel-primary > .panel-heading .badge {
5720 color: #337ab7;
5721 background-color: #fff;
5722}
5723.panel-primary > .panel-footer + .panel-collapse > .panel-body {
5724 border-bottom-color: #337ab7;
5725}
5726.panel-success {
5727 border-color: #d6e9c6;
5728}
5729.panel-success > .panel-heading {
5730 color: #3c763d;
5731 background-color: #dff0d8;
5732 border-color: #d6e9c6;
5733}
5734.panel-success > .panel-heading + .panel-collapse > .panel-body {
5735 border-top-color: #d6e9c6;
5736}
5737.panel-success > .panel-heading .badge {
5738 color: #dff0d8;
5739 background-color: #3c763d;
5740}
5741.panel-success > .panel-footer + .panel-collapse > .panel-body {
5742 border-bottom-color: #d6e9c6;
5743}
5744.panel-info {
5745 border-color: #bce8f1;
5746}
5747.panel-info > .panel-heading {
5748 color: #31708f;
5749 background-color: #d9edf7;
5750 border-color: #bce8f1;
5751}
5752.panel-info > .panel-heading + .panel-collapse > .panel-body {
5753 border-top-color: #bce8f1;
5754}
5755.panel-info > .panel-heading .badge {
5756 color: #d9edf7;
5757 background-color: #31708f;
5758}
5759.panel-info > .panel-footer + .panel-collapse > .panel-body {
5760 border-bottom-color: #bce8f1;
5761}
5762.panel-warning {
5763 border-color: #faebcc;
5764}
5765.panel-warning > .panel-heading {
5766 color: #8a6d3b;
5767 background-color: #fcf8e3;
5768 border-color: #faebcc;
5769}
5770.panel-warning > .panel-heading + .panel-collapse > .panel-body {
5771 border-top-color: #faebcc;
5772}
5773.panel-warning > .panel-heading .badge {
5774 color: #fcf8e3;
5775 background-color: #8a6d3b;
5776}
5777.panel-warning > .panel-footer + .panel-collapse > .panel-body {
5778 border-bottom-color: #faebcc;
5779}
5780.panel-danger {
5781 border-color: #ebccd1;
5782}
5783.panel-danger > .panel-heading {
5784 color: #a94442;
5785 background-color: #f2dede;
5786 border-color: #ebccd1;
5787}
5788.panel-danger > .panel-heading + .panel-collapse > .panel-body {
5789 border-top-color: #ebccd1;
5790}
5791.panel-danger > .panel-heading .badge {
5792 color: #f2dede;
5793 background-color: #a94442;
5794}
5795.panel-danger > .panel-footer + .panel-collapse > .panel-body {
5796 border-bottom-color: #ebccd1;
5797}
5798.embed-responsive {
5799 position: relative;
5800 display: block;
5801 height: 0;
5802 padding: 0;
5803 overflow: hidden;
5804}
5805.embed-responsive .embed-responsive-item,
5806.embed-responsive iframe,
5807.embed-responsive embed,
5808.embed-responsive object,
5809.embed-responsive video {
5810 position: absolute;
5811 top: 0;
5812 bottom: 0;
5813 left: 0;
5814 width: 100%;
5815 height: 100%;
5816 border: 0;
5817}
5818.embed-responsive-16by9 {
5819 padding-bottom: 56.25%;
5820}
5821.embed-responsive-4by3 {
5822 padding-bottom: 75%;
5823}
5824.well {
5825 min-height: 20px;
5826 padding: 19px;
5827 margin-bottom: 20px;
5828 background-color: #f5f5f5;
5829 border: 1px solid #e3e3e3;
5830 border-radius: 4px;
5831 -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
5832 box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
5833}
5834.well blockquote {
5835 border-color: #ddd;
5836 border-color: rgba(0, 0, 0, .15);
5837}
5838.well-lg {
5839 padding: 24px;
5840 border-radius: 6px;
5841}
5842.well-sm {
5843 padding: 9px;
5844 border-radius: 3px;
5845}
5846.close {
5847 float: right;
5848 font-size: 21px;
5849 font-weight: bold;
5850 line-height: 1;
5851 color: #000;
5852 text-shadow: 0 1px 0 #fff;
5853 filter: alpha(opacity=20);
5854 opacity: .2;
5855}
5856.close:hover,
5857.close:focus {
5858 color: #000;
5859 text-decoration: none;
5860 cursor: pointer;
5861 filter: alpha(opacity=50);
5862 opacity: .5;
5863}
5864button.close {
5865 -webkit-appearance: none;
5866 padding: 0;
5867 cursor: pointer;
5868 background: transparent;
5869 border: 0;
5870}
5871.modal-open {
5872 overflow: hidden;
5873}
5874.modal {
5875 position: fixed;
5876 top: 0;
5877 right: 0;
5878 bottom: 0;
5879 left: 0;
5880 z-index: 1050;
5881 display: none;
5882 overflow: hidden;
5883 -webkit-overflow-scrolling: touch;
5884 outline: 0;
5885}
5886.modal.fade .modal-dialog {
5887 -webkit-transition: -webkit-transform .3s ease-out;
5888 -o-transition: -o-transform .3s ease-out;
5889 transition: transform .3s ease-out;
5890 -webkit-transform: translate(0, -25%);
5891 -ms-transform: translate(0, -25%);
5892 -o-transform: translate(0, -25%);
5893 transform: translate(0, -25%);
5894}
5895.modal.in .modal-dialog {
5896 -webkit-transform: translate(0, 0);
5897 -ms-transform: translate(0, 0);
5898 -o-transform: translate(0, 0);
5899 transform: translate(0, 0);
5900}
5901.modal-open .modal {
5902 overflow-x: hidden;
5903 overflow-y: auto;
5904}
5905.modal-dialog {
5906 position: relative;
5907 width: auto;
5908 margin: 10px;
5909}
5910.modal-content {
5911 position: relative;
5912 background-color: #fff;
5913 -webkit-background-clip: padding-box;
5914 background-clip: padding-box;
5915 border: 1px solid #999;
5916 border: 1px solid rgba(0, 0, 0, .2);
5917 border-radius: 6px;
5918 outline: 0;
5919 -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
5920 box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
5921}
5922.modal-backdrop {
5923 position: fixed;
5924 top: 0;
5925 right: 0;
5926 bottom: 0;
5927 left: 0;
5928 z-index: 1040;
5929 background-color: #000;
5930}
5931.modal-backdrop.fade {
5932 filter: alpha(opacity=0);
5933 opacity: 0;
5934}
5935.modal-backdrop.in {
5936 filter: alpha(opacity=50);
5937 opacity: .5;
5938}
5939.modal-header {
5940 padding: 15px;
5941 border-bottom: 1px solid #e5e5e5;
5942}
5943.modal-header .close {
5944 margin-top: -2px;
5945}
5946.modal-title {
5947 margin: 0;
5948 line-height: 1.42857143;
5949}
5950.modal-body {
5951 position: relative;
5952 padding: 15px;
5953}
5954.modal-footer {
5955 padding: 15px;
5956 text-align: right;
5957 border-top: 1px solid #e5e5e5;
5958}
5959.modal-footer .btn + .btn {
5960 margin-bottom: 0;
5961 margin-left: 5px;
5962}
5963.modal-footer .btn-group .btn + .btn {
5964 margin-left: -1px;
5965}
5966.modal-footer .btn-block + .btn-block {
5967 margin-left: 0;
5968}
5969.modal-scrollbar-measure {
5970 position: absolute;
5971 top: -9999px;
5972 width: 50px;
5973 height: 50px;
5974 overflow: scroll;
5975}
5976@media (min-width: 768px) {
5977 .modal-dialog {
5978 width: 600px;
5979 margin: 30px auto;
5980 }
5981 .modal-content {
5982 -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
5983 box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
5984 }
5985 .modal-sm {
5986 width: 300px;
5987 }
5988}
5989@media (min-width: 992px) {
5990 .modal-lg {
5991 width: 900px;
5992 }
5993}
5994.tooltip {
5995 position: absolute;
5996 z-index: 1070;
5997 display: block;
5998 font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
5999 font-size: 12px;
6000 font-style: normal;
6001 font-weight: normal;
6002 line-height: 1.42857143;
6003 text-align: left;
6004 text-align: start;
6005 text-decoration: none;
6006 text-shadow: none;
6007 text-transform: none;
6008 letter-spacing: normal;
6009 word-break: normal;
6010 word-spacing: normal;
6011 word-wrap: normal;
6012 white-space: normal;
6013 filter: alpha(opacity=0);
6014 opacity: 0;
6015
6016 line-break: auto;
6017}
6018.tooltip.in {
6019 filter: alpha(opacity=90);
6020 opacity: .9;
6021}
6022.tooltip.top {
6023 padding: 5px 0;
6024 margin-top: -3px;
6025}
6026.tooltip.right {
6027 padding: 0 5px;
6028 margin-left: 3px;
6029}
6030.tooltip.bottom {
6031 padding: 5px 0;
6032 margin-top: 3px;
6033}
6034.tooltip.left {
6035 padding: 0 5px;
6036 margin-left: -3px;
6037}
6038.tooltip-inner {
6039 max-width: 200px;
6040 padding: 3px 8px;
6041 color: #fff;
6042 text-align: center;
6043 background-color: #000;
6044 border-radius: 4px;
6045}
6046.tooltip-arrow {
6047 position: absolute;
6048 width: 0;
6049 height: 0;
6050 border-color: transparent;
6051 border-style: solid;
6052}
6053.tooltip.top .tooltip-arrow {
6054 bottom: 0;
6055 left: 50%;
6056 margin-left: -5px;
6057 border-width: 5px 5px 0;
6058 border-top-color: #000;
6059}
6060.tooltip.top-left .tooltip-arrow {
6061 right: 5px;
6062 bottom: 0;
6063 margin-bottom: -5px;
6064 border-width: 5px 5px 0;
6065 border-top-color: #000;
6066}
6067.tooltip.top-right .tooltip-arrow {
6068 bottom: 0;
6069 left: 5px;
6070 margin-bottom: -5px;
6071 border-width: 5px 5px 0;
6072 border-top-color: #000;
6073}
6074.tooltip.right .tooltip-arrow {
6075 top: 50%;
6076 left: 0;
6077 margin-top: -5px;
6078 border-width: 5px 5px 5px 0;
6079 border-right-color: #000;
6080}
6081.tooltip.left .tooltip-arrow {
6082 top: 50%;
6083 right: 0;
6084 margin-top: -5px;
6085 border-width: 5px 0 5px 5px;
6086 border-left-color: #000;
6087}
6088.tooltip.bottom .tooltip-arrow {
6089 top: 0;
6090 left: 50%;
6091 margin-left: -5px;
6092 border-width: 0 5px 5px;
6093 border-bottom-color: #000;
6094}
6095.tooltip.bottom-left .tooltip-arrow {
6096 top: 0;
6097 right: 5px;
6098 margin-top: -5px;
6099 border-width: 0 5px 5px;
6100 border-bottom-color: #000;
6101}
6102.tooltip.bottom-right .tooltip-arrow {
6103 top: 0;
6104 left: 5px;
6105 margin-top: -5px;
6106 border-width: 0 5px 5px;
6107 border-bottom-color: #000;
6108}
6109.popover {
6110 position: absolute;
6111 top: 0;
6112 left: 0;
6113 z-index: 1060;
6114 display: none;
6115 max-width: 276px;
6116 padding: 1px;
6117 font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
6118 font-size: 14px;
6119 font-style: normal;
6120 font-weight: normal;
6121 line-height: 1.42857143;
6122 text-align: left;
6123 text-align: start;
6124 text-decoration: none;
6125 text-shadow: none;
6126 text-transform: none;
6127 letter-spacing: normal;
6128 word-break: normal;
6129 word-spacing: normal;
6130 word-wrap: normal;
6131 white-space: normal;
6132 background-color: #fff;
6133 -webkit-background-clip: padding-box;
6134 background-clip: padding-box;
6135 border: 1px solid #ccc;
6136 border: 1px solid rgba(0, 0, 0, .2);
6137 border-radius: 6px;
6138 -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
6139 box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
6140
6141 line-break: auto;
6142}
6143.popover.top {
6144 margin-top: -10px;
6145}
6146.popover.right {
6147 margin-left: 10px;
6148}
6149.popover.bottom {
6150 margin-top: 10px;
6151}
6152.popover.left {
6153 margin-left: -10px;
6154}
6155.popover-title {
6156 padding: 8px 14px;
6157 margin: 0;
6158 font-size: 14px;
6159 background-color: #f7f7f7;
6160 border-bottom: 1px solid #ebebeb;
6161 border-radius: 5px 5px 0 0;
6162}
6163.popover-content {
6164 padding: 9px 14px;
6165}
6166.popover > .arrow,
6167.popover > .arrow:after {
6168 position: absolute;
6169 display: block;
6170 width: 0;
6171 height: 0;
6172 border-color: transparent;
6173 border-style: solid;
6174}
6175.popover > .arrow {
6176 border-width: 11px;
6177}
6178.popover > .arrow:after {
6179 content: "";
6180 border-width: 10px;
6181}
6182.popover.top > .arrow {
6183 bottom: -11px;
6184 left: 50%;
6185 margin-left: -11px;
6186 border-top-color: #999;
6187 border-top-color: rgba(0, 0, 0, .25);
6188 border-bottom-width: 0;
6189}
6190.popover.top > .arrow:after {
6191 bottom: 1px;
6192 margin-left: -10px;
6193 content: " ";
6194 border-top-color: #fff;
6195 border-bottom-width: 0;
6196}
6197.popover.right > .arrow {
6198 top: 50%;
6199 left: -11px;
6200 margin-top: -11px;
6201 border-right-color: #999;
6202 border-right-color: rgba(0, 0, 0, .25);
6203 border-left-width: 0;
6204}
6205.popover.right > .arrow:after {
6206 bottom: -10px;
6207 left: 1px;
6208 content: " ";
6209 border-right-color: #fff;
6210 border-left-width: 0;
6211}
6212.popover.bottom > .arrow {
6213 top: -11px;
6214 left: 50%;
6215 margin-left: -11px;
6216 border-top-width: 0;
6217 border-bottom-color: #999;
6218 border-bottom-color: rgba(0, 0, 0, .25);
6219}
6220.popover.bottom > .arrow:after {
6221 top: 1px;
6222 margin-left: -10px;
6223 content: " ";
6224 border-top-width: 0;
6225 border-bottom-color: #fff;
6226}
6227.popover.left > .arrow {
6228 top: 50%;
6229 right: -11px;
6230 margin-top: -11px;
6231 border-right-width: 0;
6232 border-left-color: #999;
6233 border-left-color: rgba(0, 0, 0, .25);
6234}
6235.popover.left > .arrow:after {
6236 right: 1px;
6237 bottom: -10px;
6238 content: " ";
6239 border-right-width: 0;
6240 border-left-color: #fff;
6241}
6242.carousel {
6243 position: relative;
6244}
6245.carousel-inner {
6246 position: relative;
6247 width: 100%;
6248 overflow: hidden;
6249}
6250.carousel-inner > .item {
6251 position: relative;
6252 display: none;
6253 -webkit-transition: .6s ease-in-out left;
6254 -o-transition: .6s ease-in-out left;
6255 transition: .6s ease-in-out left;
6256}
6257.carousel-inner > .item > img,
6258.carousel-inner > .item > a > img {
6259 line-height: 1;
6260}
6261@media all and (transform-3d), (-webkit-transform-3d) {
6262 .carousel-inner > .item {
6263 -webkit-transition: -webkit-transform .6s ease-in-out;
6264 -o-transition: -o-transform .6s ease-in-out;
6265 transition: transform .6s ease-in-out;
6266
6267 -webkit-backface-visibility: hidden;
6268 backface-visibility: hidden;
6269 -webkit-perspective: 1000px;
6270 perspective: 1000px;
6271 }
6272 .carousel-inner > .item.next,
6273 .carousel-inner > .item.active.right {
6274 left: 0;
6275 -webkit-transform: translate3d(100%, 0, 0);
6276 transform: translate3d(100%, 0, 0);
6277 }
6278 .carousel-inner > .item.prev,
6279 .carousel-inner > .item.active.left {
6280 left: 0;
6281 -webkit-transform: translate3d(-100%, 0, 0);
6282 transform: translate3d(-100%, 0, 0);
6283 }
6284 .carousel-inner > .item.next.left,
6285 .carousel-inner > .item.prev.right,
6286 .carousel-inner > .item.active {
6287 left: 0;
6288 -webkit-transform: translate3d(0, 0, 0);
6289 transform: translate3d(0, 0, 0);
6290 }
6291}
6292.carousel-inner > .active,
6293.carousel-inner > .next,
6294.carousel-inner > .prev {
6295 display: block;
6296}
6297.carousel-inner > .active {
6298 left: 0;
6299}
6300.carousel-inner > .next,
6301.carousel-inner > .prev {
6302 position: absolute;
6303 top: 0;
6304 width: 100%;
6305}
6306.carousel-inner > .next {
6307 left: 100%;
6308}
6309.carousel-inner > .prev {
6310 left: -100%;
6311}
6312.carousel-inner > .next.left,
6313.carousel-inner > .prev.right {
6314 left: 0;
6315}
6316.carousel-inner > .active.left {
6317 left: -100%;
6318}
6319.carousel-inner > .active.right {
6320 left: 100%;
6321}
6322.carousel-control {
6323 position: absolute;
6324 top: 0;
6325 bottom: 0;
6326 left: 0;
6327 width: 15%;
6328 font-size: 20px;
6329 color: #fff;
6330 text-align: center;
6331 text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
6332 background-color: rgba(0, 0, 0, 0);
6333 filter: alpha(opacity=50);
6334 opacity: .5;
6335}
6336.carousel-control.left {
6337 background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
6338 background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
6339 background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001)));
6340 background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
6341 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
6342 background-repeat: repeat-x;
6343}
6344.carousel-control.right {
6345 right: 0;
6346 left: auto;
6347 background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
6348 background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
6349 background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5)));
6350 background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
6351 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
6352 background-repeat: repeat-x;
6353}
6354.carousel-control:hover,
6355.carousel-control:focus {
6356 color: #fff;
6357 text-decoration: none;
6358 filter: alpha(opacity=90);
6359 outline: 0;
6360 opacity: .9;
6361}
6362.carousel-control .icon-prev,
6363.carousel-control .icon-next,
6364.carousel-control .glyphicon-chevron-left,
6365.carousel-control .glyphicon-chevron-right {
6366 position: absolute;
6367 top: 50%;
6368 z-index: 5;
6369 display: inline-block;
6370 margin-top: -10px;
6371}
6372.carousel-control .icon-prev,
6373.carousel-control .glyphicon-chevron-left {
6374 left: 50%;
6375 margin-left: -10px;
6376}
6377.carousel-control .icon-next,
6378.carousel-control .glyphicon-chevron-right {
6379 right: 50%;
6380 margin-right: -10px;
6381}
6382.carousel-control .icon-prev,
6383.carousel-control .icon-next {
6384 width: 20px;
6385 height: 20px;
6386 font-family: serif;
6387 line-height: 1;
6388}
6389.carousel-control .icon-prev:before {
6390 content: '\2039';
6391}
6392.carousel-control .icon-next:before {
6393 content: '\203a';
6394}
6395.carousel-indicators {
6396 position: absolute;
6397 bottom: 10px;
6398 left: 50%;
6399 z-index: 15;
6400 width: 60%;
6401 padding-left: 0;
6402 margin-left: -30%;
6403 text-align: center;
6404 list-style: none;
6405}
6406.carousel-indicators li {
6407 display: inline-block;
6408 width: 10px;
6409 height: 10px;
6410 margin: 1px;
6411 text-indent: -999px;
6412 cursor: pointer;
6413 background-color: #000 \9;
6414 background-color: rgba(0, 0, 0, 0);
6415 border: 1px solid #fff;
6416 border-radius: 10px;
6417}
6418.carousel-indicators .active {
6419 width: 12px;
6420 height: 12px;
6421 margin: 0;
6422 background-color: #fff;
6423}
6424.carousel-caption {
6425 position: absolute;
6426 right: 15%;
6427 bottom: 20px;
6428 left: 15%;
6429 z-index: 10;
6430 padding-top: 20px;
6431 padding-bottom: 20px;
6432 color: #fff;
6433 text-align: center;
6434 text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
6435}
6436.carousel-caption .btn {
6437 text-shadow: none;
6438}
6439@media screen and (min-width: 768px) {
6440 .carousel-control .glyphicon-chevron-left,
6441 .carousel-control .glyphicon-chevron-right,
6442 .carousel-control .icon-prev,
6443 .carousel-control .icon-next {
6444 width: 30px;
6445 height: 30px;
6446 margin-top: -10px;
6447 font-size: 30px;
6448 }
6449 .carousel-control .glyphicon-chevron-left,
6450 .carousel-control .icon-prev {
6451 margin-left: -10px;
6452 }
6453 .carousel-control .glyphicon-chevron-right,
6454 .carousel-control .icon-next {
6455 margin-right: -10px;
6456 }
6457 .carousel-caption {
6458 right: 20%;
6459 left: 20%;
6460 padding-bottom: 30px;
6461 }
6462 .carousel-indicators {
6463 bottom: 20px;
6464 }
6465}
6466.clearfix:before,
6467.clearfix:after,
6468.dl-horizontal dd:before,
6469.dl-horizontal dd:after,
6470.container:before,
6471.container:after,
6472.container-fluid:before,
6473.container-fluid:after,
6474.row:before,
6475.row:after,
6476.form-horizontal .form-group:before,
6477.form-horizontal .form-group:after,
6478.btn-toolbar:before,
6479.btn-toolbar:after,
6480.btn-group-vertical > .btn-group:before,
6481.btn-group-vertical > .btn-group:after,
6482.nav:before,
6483.nav:after,
6484.navbar:before,
6485.navbar:after,
6486.navbar-header:before,
6487.navbar-header:after,
6488.navbar-collapse:before,
6489.navbar-collapse:after,
6490.pager:before,
6491.pager:after,
6492.panel-body:before,
6493.panel-body:after,
6494.modal-header:before,
6495.modal-header:after,
6496.modal-footer:before,
6497.modal-footer:after {
6498 display: table;
6499 content: " ";
6500}
6501.clearfix:after,
6502.dl-horizontal dd:after,
6503.container:after,
6504.container-fluid:after,
6505.row:after,
6506.form-horizontal .form-group:after,
6507.btn-toolbar:after,
6508.btn-group-vertical > .btn-group:after,
6509.nav:after,
6510.navbar:after,
6511.navbar-header:after,
6512.navbar-collapse:after,
6513.pager:after,
6514.panel-body:after,
6515.modal-header:after,
6516.modal-footer:after {
6517 clear: both;
6518}
6519.center-block {
6520 display: block;
6521 margin-right: auto;
6522 margin-left: auto;
6523}
6524.pull-right {
6525 float: right !important;
6526}
6527.pull-left {
6528 float: left !important;
6529}
6530.hide {
6531 display: none !important;
6532}
6533.show {
6534 display: block !important;
6535}
6536.invisible {
6537 visibility: hidden;
6538}
6539.text-hide {
6540 font: 0/0 a;
6541 color: transparent;
6542 text-shadow: none;
6543 background-color: transparent;
6544 border: 0;
6545}
6546.hidden {
6547 display: none !important;
6548}
6549.affix {
6550 position: fixed;
6551}
6552@-ms-viewport {
6553 width: device-width;
6554}
6555.visible-xs,
6556.visible-sm,
6557.visible-md,
6558.visible-lg {
6559 display: none !important;
6560}
6561.visible-xs-block,
6562.visible-xs-inline,
6563.visible-xs-inline-block,
6564.visible-sm-block,
6565.visible-sm-inline,
6566.visible-sm-inline-block,
6567.visible-md-block,
6568.visible-md-inline,
6569.visible-md-inline-block,
6570.visible-lg-block,
6571.visible-lg-inline,
6572.visible-lg-inline-block {
6573 display: none !important;
6574}
6575@media (max-width: 767px) {
6576 .visible-xs {
6577 display: block !important;
6578 }
6579 table.visible-xs {
6580 display: table !important;
6581 }
6582 tr.visible-xs {
6583 display: table-row !important;
6584 }
6585 th.visible-xs,
6586 td.visible-xs {
6587 display: table-cell !important;
6588 }
6589}
6590@media (max-width: 767px) {
6591 .visible-xs-block {
6592 display: block !important;
6593 }
6594}
6595@media (max-width: 767px) {
6596 .visible-xs-inline {
6597 display: inline !important;
6598 }
6599}
6600@media (max-width: 767px) {
6601 .visible-xs-inline-block {
6602 display: inline-block !important;
6603 }
6604}
6605@media (min-width: 768px) and (max-width: 991px) {
6606 .visible-sm {
6607 display: block !important;
6608 }
6609 table.visible-sm {
6610 display: table !important;
6611 }
6612 tr.visible-sm {
6613 display: table-row !important;
6614 }
6615 th.visible-sm,
6616 td.visible-sm {
6617 display: table-cell !important;
6618 }
6619}
6620@media (min-width: 768px) and (max-width: 991px) {
6621 .visible-sm-block {
6622 display: block !important;
6623 }
6624}
6625@media (min-width: 768px) and (max-width: 991px) {
6626 .visible-sm-inline {
6627 display: inline !important;
6628 }
6629}
6630@media (min-width: 768px) and (max-width: 991px) {
6631 .visible-sm-inline-block {
6632 display: inline-block !important;
6633 }
6634}
6635@media (min-width: 992px) and (max-width: 1199px) {
6636 .visible-md {
6637 display: block !important;
6638 }
6639 table.visible-md {
6640 display: table !important;
6641 }
6642 tr.visible-md {
6643 display: table-row !important;
6644 }
6645 th.visible-md,
6646 td.visible-md {
6647 display: table-cell !important;
6648 }
6649}
6650@media (min-width: 992px) and (max-width: 1199px) {
6651 .visible-md-block {
6652 display: block !important;
6653 }
6654}
6655@media (min-width: 992px) and (max-width: 1199px) {
6656 .visible-md-inline {
6657 display: inline !important;
6658 }
6659}
6660@media (min-width: 992px) and (max-width: 1199px) {
6661 .visible-md-inline-block {
6662 display: inline-block !important;
6663 }
6664}
6665@media (min-width: 1200px) {
6666 .visible-lg {
6667 display: block !important;
6668 }
6669 table.visible-lg {
6670 display: table !important;
6671 }
6672 tr.visible-lg {
6673 display: table-row !important;
6674 }
6675 th.visible-lg,
6676 td.visible-lg {
6677 display: table-cell !important;
6678 }
6679}
6680@media (min-width: 1200px) {
6681 .visible-lg-block {
6682 display: block !important;
6683 }
6684}
6685@media (min-width: 1200px) {
6686 .visible-lg-inline {
6687 display: inline !important;
6688 }
6689}
6690@media (min-width: 1200px) {
6691 .visible-lg-inline-block {
6692 display: inline-block !important;
6693 }
6694}
6695@media (max-width: 767px) {
6696 .hidden-xs {
6697 display: none !important;
6698 }
6699}
6700@media (min-width: 768px) and (max-width: 991px) {
6701 .hidden-sm {
6702 display: none !important;
6703 }
6704}
6705@media (min-width: 992px) and (max-width: 1199px) {
6706 .hidden-md {
6707 display: none !important;
6708 }
6709}
6710@media (min-width: 1200px) {
6711 .hidden-lg {
6712 display: none !important;
6713 }
6714}
6715.visible-print {
6716 display: none !important;
6717}
6718@media print {
6719 .visible-print {
6720 display: block !important;
6721 }
6722 table.visible-print {
6723 display: table !important;
6724 }
6725 tr.visible-print {
6726 display: table-row !important;
6727 }
6728 th.visible-print,
6729 td.visible-print {
6730 display: table-cell !important;
6731 }
6732}
6733.visible-print-block {
6734 display: none !important;
6735}
6736@media print {
6737 .visible-print-block {
6738 display: block !important;
6739 }
6740}
6741.visible-print-inline {
6742 display: none !important;
6743}
6744@media print {
6745 .visible-print-inline {
6746 display: inline !important;
6747 }
6748}
6749.visible-print-inline-block {
6750 display: none !important;
6751}
6752@media print {
6753 .visible-print-inline-block {
6754 display: inline-block !important;
6755 }
6756}
6757@media print {
6758 .hidden-print {
6759 display: none !important;
6760 }
6761}
6762/*# sourceMappingURL=bootstrap.css.map */
6763</style>
6764 <style>body {
6765 padding-bottom: 32px;
6766}
6767.form-control[readonly] {
6768 cursor: text;
6769}
6770.feedback-container {
6771 position: fixed;
6772 top: 0;
6773 width: 100%;
6774 text-align: center;
6775 z-index: 4;
6776}
6777.feedback {
6778 display: table;
6779 padding: 0.5em 1em;
6780 background-color: orange;
6781 margin: 0 auto;
6782 font-size: 2em;
6783 color: #444;
6784 border: 2px solid #555;
6785 border-top: 0;
6786 border-bottom-left-radius: 20px 20px;
6787 border-bottom-right-radius: 20px 20px;
6788}
6789.no-border {
6790 border: 0;
6791 box-shadow: inset 0 1px 1px rgba(0,0,0,.0);
6792 -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.0);
6793}
6794.phrase {
6795 word-break: keep-all;
6796}
6797.generate-container .strength {
6798 /* override mobile width from bootstrap */
6799 width: auto!important;
6800 display: inline-block;
6801}
6802.languages a {
6803 padding-left: 10px;
6804}
6805.languages a:nth-of-type(1) {
6806 margin-left: -12px;
6807 padding-left: 0;
6808}
6809.monospace {
6810 font-family: monospace;
6811}
6812.entropy-container .filtered,
6813.entropy-container .binary {
6814 word-wrap: break-word;
6815}
6816.entropy-container li {
6817 padding-bottom: 5px;
6818}
6819.card-suit {
6820 font-size: 19px;
6821 line-height: 0;
6822}
6823.card-suit.club {
6824 color: #009F00;
6825}
6826.card-suit.diamond {
6827 color: #3D5DC4;
6828}
6829.card-suit.heart {
6830 color: #F00;
6831}
6832.card-suit.spade {
6833 color: #000;
6834}
6835.qr-container {
6836 position: fixed;
6837 top: 0;
6838 right: 0;
6839 text-align: center;
6840 background-color: #FFF;
6841 border: 1px solid #CCC;
6842}
6843.qr-image {
6844 margin: 5px;
6845}
6846.qr-hint,
6847.qr-warning {
6848 padding: 2px;
6849 max-width: 320px;
6850}
6851.more-info {
6852 cursor: help;
6853 border-bottom: 1px dashed #000;
6854 text-decoration: none;
6855}
6856.version {
6857 position: absolute;
6858 top: 5px;
6859 right: 5px;
6860}
6861.csv {
6862 margin-top: 20px;
6863 margin-bottom: 20px;
6864 white-space: pre;
6865 overflow-wrap: normal;
6866 overflow-x: scroll;
6867 font-family: monospace;
6868}
6869</style>
6870 <meta content="Mnemonic code for generating deterministic keys" name="description"/>
6871 <meta content="width=device-width, initial-scale=1.0" name="viewport" />
6872 <meta content="bitcoin mnemonic converter" name="description" />
6873 <meta content="Ian Coleman" name="author" />
6874 <link type="image/x-icon" rel="icon" href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=" />
6875 </head>
6876 <body>
6877 <div class="container">
6878
6879 <h1 class="text-center">Mnemonic Code Converter</h1>
6880 <p class="version">v0.3.2</p>
6881 <hr>
6882 <div class="row">
6883 <div class="col-md-12">
6884 <h2>Mnemonic</h2>
6885 <form class="form-horizontal" role="form">
6886 <div class="form-group">
6887 <div class="col-sm-2"></div>
6888 <div class="col-sm-10">
6889 <p>You can enter an existing BIP39 mnemonic, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word is a checksum).</p>
6890 <p>
6891 For more info see the
6892 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a>.
6893 </p>
6894 </div>
6895 </div>
6896 <div class="form-group generate-container">
6897 <label class="col-sm-2 control-label"></label>
6898 <div class="col-sm-10">
6899 <div class="form-inline">
6900 <div class="input-group-inline">
6901 <span>Generate a random mnemonic, or enter your own below</span>:
6902 <button class="btn generate">Generate</button>
6903 <select id="strength" class="strength form-control">
6904 <option value="3">3</option>
6905 <option value="6">6</option>
6906 <option value="9">9</option>
6907 <option value="12">12</option>
6908 <option value="15" selected>15</option>
6909 <option value="18">18</option>
6910 <option value="21">21</option>
6911 <option value="24">24</option>
6912 </select>
6913 <span>words</span>
6914 </div>
6915 </div>
6916 </div>
6917 </div>
6918 <div class="entropy-container hidden">
6919 <div class="form-group text-danger">
6920 <label class="col-sm-2 control-label">Warning</label>
6921 <div class="col-sm-10 form-control-static">
6922 <span>Entropy is an advanced feature. Your mnemonic may be insecure if this feature is used incorrectly.</span>
6923 <a href="#entropy-notes">Read more</a>
6924 </div>
6925 </div>
6926 <div class="form-group">
6927 <label for="entropy" class="col-sm-2 control-label">Entropy</label>
6928 <div class="col-sm-7">
6929 <textarea id="entropy" rows="2" class="entropy form-control" placeholder="Accepts either binary, base 6, 6-sided dice, base 10, hexadecimal or cards"></textarea>
6930 <div class="row filter-warning text-danger hidden">
6931 <p class="col-sm-12">
6932 <strong>
6933 Some characters have been discarded
6934 </strong>
6935 </p>
6936 </div>
6937 <div class="row">
6938 <label class="col-sm-3 control-label"><span class="more-info" title="Based on estimates from zxcvbn using Filtered Entropy">Time To Crack</span></label>
6939 <div class="crack-time col-sm-3 form-control-static"></div>
6940 <label class="col-sm-3 control-label">Event Count</label>
6941 <div class="event-count col-sm-3 form-control-static"></div>
6942 </div>
6943 <div class="row">
6944 <label class="col-sm-3 control-label">Entropy Type</label>
6945 <div class="type col-sm-3 form-control-static"></div>
6946 <label class="col-sm-3 control-label">Bits Per Event</label>
6947 <div class="bits-per-event col-sm-3 form-control-static"></div>
6948 </div>
6949 <div class="row">
6950 <label class="col-sm-3 control-label">Raw Entropy Words</label>
6951 <div class="word-count col-sm-3 form-control-static"></div>
6952 <label class="col-sm-3 control-label"><span class="more-info" title="Total bits of entropy may be less than indicated if any entropy event uses a weak source.">Total Bits</span></label>
6953 <div class="bits col-sm-3 form-control-static"></div>
6954 </div>
6955 <label class="col-sm-3 control-label">Filtered Entropy</label>
6956 <div class="filtered col-sm-9 form-control-static"></div>
6957 <label class="col-sm-3 control-label">Raw Binary</label>
6958 <div class="binary col-sm-9 form-control-static"></div>
6959 <label class="col-sm-3 control-label">Word Indexes</label>
6960 <div class="word-indexes col-sm-9 form-control-static">&nbsp;</div>
6961 <label class="col-sm-3 control-label">Mnemonic Length</label>
6962 <div class="col-sm-9">
6963 <select class="mnemonic-length form-control">
6964 <option value="raw" selected>Use Raw Entropy (3 words per 32 bits)</option>
6965 <option value="12">12 <span>Words</span></option>
6966 <option value="15">15 <span>Words</option>
6967 <option value="18">18 <span>Words</span></option>
6968 <option value="21">21 <span>Words</span></option>
6969 <option value="24">24 <span>Words</span></option>
6970 </select>
6971 </div>
6972 </div>
6973 <div class="col-sm-3">
6974 <p>Valid entropy values include:</p>
6975 <ul>
6976 <li><strong>Binary</strong> [0-1]<br>101010011</li>
6977 <li><strong>Base 6</strong> [0-5]<br>123434014</li>
6978 <li><strong>Dice</strong> [1-6]<br>62535634</li>
6979 <li><strong>Base 10</strong> [0-9]<br>90834528</li>
6980 <li><strong>Hex</strong> [0-9A-F]<br>4187a8bfd9</li>
6981 <li><strong>Card</strong> [A2-9TJQK][CDHS]<br>ahqs9dtc</li>
6982 </ul>
6983 </div>
6984 </div>
6985 </div>
6986 <div class="form-group">
6987 <div class="col-sm-2"></div>
6988 <div class="col-sm-10 checkbox">
6989 <label>
6990 <input type="checkbox" class="use-entropy">
6991 <span>Show entropy details</span>
6992 </label>
6993 </div>
6994 </div>
6995 <div class="form-group">
6996 <label class="col-sm-2 control-label">Mnemonic Language</label>
6997 <div class="col-sm-10 languages">
6998 <div class="form-control no-border">
6999 <a href="#english">English</a>
7000 <a href="#japanese" title="Japanese">日本語</a>
7001 <a href="#spanish" title="Spanish">Español</a>
7002 <a href="#chinese_simplified" title="Chinese (Simplified)">中文(简体)</a>
7003 <a href="#chinese_traditional" title="Chinese (Traditional)">中文(繁體)</a>
7004 <a href="#french" title="French">Français</a>
7005 <a href="#italian" title="Italian">Italiano</a>
7006 </div>
7007 </div>
7008 </div>
7009 <div class="form-group">
7010 <label for="phrase" class="col-sm-2 control-label">BIP39 Mnemonic</label>
7011 <div class="col-sm-10">
7012 <textarea id="phrase" class="phrase form-control" data-show-qr></textarea>
7013 </div>
7014 </div>
7015 <div class="form-group">
7016 <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label>
7017 <div class="col-sm-10">
7018 <textarea id="passphrase" class="passphrase form-control"></textarea>
7019 </div>
7020 </div>
7021 <div class="form-group">
7022 <label for="seed" class="col-sm-2 control-label">BIP39 Seed</label>
7023 <div class="col-sm-10">
7024 <textarea id="seed" class="seed form-control" readonly="readonly" data-show-qr></textarea>
7025 </div>
7026 </div>
7027 <div class="form-group">
7028 <label for="network-phrase" class="col-sm-2 control-label">Coin</label>
7029 <div class="col-sm-10">
7030 <select id="network-phrase" class="network form-control">
7031 <!-- populated by javascript -->
7032 </select>
7033 </div>
7034 </div>
7035 <div class="form-group">
7036 <label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label>
7037 <div class="col-sm-10">
7038 <textarea id="root-key" class="root-key form-control" data-show-qr></textarea>
7039 </div>
7040 </div>
7041 <div class="form-group litecoin-ltub-container hidden">
7042 <label for="litecoin-use-ltub" class="col-sm-2 control-label">Prefixes</label>
7043 <div class="col-sm-10 checkbox">
7044 <label>
7045 <input type="checkbox" id="litecoin-use-ltub" class="litecoin-use-ltub" checked="checked">
7046 Use <code>Ltpv / Ltub</code> instead of <code>xprv / xpub</code>
7047 </label>
7048 </div>
7049 </div>
7050 </form>
7051 </div>
7052 </div>
7053
7054 <hr>
7055
7056 <div class="row">
7057 <div class="col-md-12">
7058 <h2>Derivation Path</h2>
7059 <ul class="derivation-type nav nav-tabs" role="tablist">
7060 <li id="bip32-tab">
7061 <a href="#bip32" role="tab" data-toggle="tab">BIP32</a>
7062 </li>
7063 <li id="bip44-tab" class="active">
7064 <a href="#bip44" role="tab" data-toggle="tab">BIP44</a>
7065 </li>
7066 <li id="bip49-tab">
7067 <a href="#bip49" role="tab" data-toggle="tab">BIP49</a>
7068 </li>
7069 <li id="bip84-tab">
7070 <a href="#bip84" role="tab" data-toggle="tab">BIP84</a>
7071 </li>
7072 <li id="bip141-tab">
7073 <a href="#bip141" role="tab" data-toggle="tab">BIP141</a>
7074 </li>
7075 </ul>
7076 <div class="derivation-type tab-content">
7077 <div id="bip44" class="tab-pane active">
7078 <form class="form-horizontal" role="form">
7079 <br>
7080 <div class="col-sm-2"></div>
7081 <div class="col-sm-10">
7082 <p>
7083 For more info see the
7084 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">BIP44 spec</a>.
7085 </p>
7086 </div>
7087 <div class="form-group">
7088 <label for="purpose" class="col-sm-2 control-label">
7089 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a>
7090 </label>
7091 <div class="col-sm-10">
7092 <input id="purpose" type="text" class="purpose form-control" value="44" readonly>
7093 </div>
7094 </div>
7095 <div class="form-group">
7096 <label for="coin" class="col-sm-2 control-label">
7097 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a>
7098 </label>
7099 <div class="col-sm-10">
7100 <input id="coin" type="text" class="coin form-control" value="0" readonly>
7101 </div>
7102 </div>
7103 <div class="form-group">
7104 <label for="account" class="col-sm-2 control-label">
7105 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a>
7106 </label>
7107 <div class="col-sm-10">
7108 <input id="account" type="text" class="account form-control" value="0">
7109 </div>
7110 </div>
7111 <div class="form-group">
7112 <label for="change" class="col-sm-2 control-label">
7113 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
7114 </label>
7115 <div class="col-sm-10">
7116 <input id="change" type="text" class="change form-control" value="0">
7117 </div>
7118 </div>
7119 <div class="form-group">
7120 <label class="col-sm-2 control-label">
7121 </label>
7122 <div class="col-sm-10">
7123 <p>The account extended keys can be used for importing to most BIP44 compatible wallets, such as mycelium or electrum.</p>
7124 </div>
7125 </div>
7126 <div class="form-group">
7127 <label for="account-xprv" class="col-sm-2 control-label">
7128 <span>Account Extended Private Key</span>
7129 </label>
7130 <div class="col-sm-10">
7131 <textarea id="account-xprv" type="text" class="account-xprv form-control" readonly data-show-qr></textarea>
7132 </div>
7133 </div>
7134 <div class="form-group">
7135 <label for="account-xpub" class="col-sm-2 control-label">
7136 <span>Account Extended Public Key</span>
7137 </label>
7138 <div class="col-sm-10">
7139 <textarea id="account-xpub" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
7140 </div>
7141 </div>
7142 <div class="form-group">
7143 <label class="col-sm-2 control-label">
7144 </label>
7145 <div class="col-sm-10">
7146 <p>The BIP32 derivation path and extended keys are the basis for the derived addresses.</p>
7147 </div>
7148 </div>
7149 <div class="form-group">
7150 <label for="bip44-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
7151 <div class="col-sm-10">
7152 <input id="bip44-path" type="text" class="path form-control" value="m/44'/0'/0'/0" readonly="readonly">
7153 </div>
7154 </div>
7155 </form>
7156 </div>
7157 <div id="bip32" class="tab-pane">
7158 <form class="form-horizontal" role="form">
7159 <br>
7160 <div class="col-sm-2"></div>
7161 <div class="col-sm-10">
7162 <p>
7163 For more info see the
7164 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">BIP32 spec</a>
7165 </p>
7166 </div>
7167 <div class="form-group">
7168 <label for="bip32-client" class="col-sm-2 control-label">Client</label>
7169 <div class="col-sm-10">
7170 <select id="bip32-client" class="client form-control">
7171 <option value="custom">Custom derivation path</option>
7172 <!-- populated by javascript -->
7173 </select>
7174 </div>
7175 </div>
7176 <div class="form-group">
7177 <label for="bip32-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
7178 <div class="col-sm-10">
7179 <input id="bip32-path" type="text" class="path form-control" value="m/0">
7180 </div>
7181 </div>
7182 <div class="form-group">
7183 <div class="col-sm-2"></div>
7184 <label class="col-sm-10">
7185 <input class="hardened-addresses" type="checkbox">
7186 <span>Use hardened addresses</span>
7187 </label>
7188 </div>
7189 <div class="form-group">
7190 <label for="core-path" class="col-sm-2 control-label">Bitcoin Core</label>
7191 <div class="col-sm-10">
7192 <p class="form-control no-border">
7193 Use path <code>m/0'/0'</code> with hardened addresses.
7194 </p>
7195 <p class="form-control no-border">
7196 For more info see the
7197 <a href="https://github.com/bitcoin/bitcoin/pull/8035" target="_blank">Bitcoin Core BIP32 implementation</a>
7198 </p>
7199 </div>
7200 </div>
7201 <div class="form-group">
7202 <label for="core-path" class="col-sm-2 control-label">Multibit</label>
7203 <div class="col-sm-10">
7204 <p class="form-control no-border">
7205 <span>Use path <code>m/0'/0</code>.</span>
7206 </p>
7207 <p class="form-control no-border">
7208 <span>For more info see</span>
7209 <a href="https://multibit.org/" target="_blank">MultiBit HD</a>
7210 </p>
7211 </div>
7212 </div>
7213 <div class="form-group">
7214 <label class="col-sm-2 control-label">Block Explorers</label>
7215 <div class="col-sm-10">
7216 <p class="form-control no-border">
7217 <span>Use path <code>m/44'/0'/0'</code>.</span>
7218 <span>Only enter the <code>xpub</code> extended key into block explorer search fields, never the <code>xprv</code> key.</span>
7219 </p>
7220 <p class="form-control no-border">
7221 <span>Can be used with</span>:
7222 <a href="https://blockchain.info/" target="_blank">blockchain.info</a>
7223 </p>
7224 </div>
7225 </div>
7226 </form>
7227 </div>
7228 <div id="bip49" class="tab-pane">
7229 <form class="form-horizontal" role="form">
7230 <br>
7231 <div class="unavailable hidden">
7232 <div class="form-group">
7233 <div class="col-sm-2"></div>
7234 <div class="col-sm-10">
7235 <p>BIP49 is unavailable for this coin.</p>
7236 </div>
7237 </div>
7238 </div>
7239 <div class="available">
7240 <div class="col-sm-2"></div>
7241 <div class="col-sm-10">
7242 <p>
7243 For more info see the
7244 <a href="https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki" target="_blank">BIP49 spec</a>.
7245 </p>
7246 </div>
7247 <div class="form-group">
7248 <label for="purpose" class="col-sm-2 control-label">
7249 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a>
7250 </label>
7251 <div class="col-sm-10">
7252 <input id="purpose" type="text" class="purpose form-control" value="49" readonly>
7253 </div>
7254 </div>
7255 <div class="form-group">
7256 <label for="coin" class="col-sm-2 control-label">
7257 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a>
7258 </label>
7259 <div class="col-sm-10">
7260 <input id="coin" type="text" class="coin form-control" value="0" readonly>
7261 </div>
7262 </div>
7263 <div class="form-group">
7264 <label for="account" class="col-sm-2 control-label">
7265 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a>
7266 </label>
7267 <div class="col-sm-10">
7268 <input id="account" type="text" class="account form-control" value="0">
7269 </div>
7270 </div>
7271 <div class="form-group">
7272 <label for="change" class="col-sm-2 control-label">
7273 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
7274 </label>
7275 <div class="col-sm-10">
7276 <input id="change" type="text" class="change form-control" value="0">
7277 </div>
7278 </div>
7279 <div class="form-group">
7280 <label class="col-sm-2 control-label">
7281 </label>
7282 <div class="col-sm-10">
7283 <p>The account extended keys can be used for importing to most BIP49 compatible wallets.</p>
7284 </div>
7285 </div>
7286 <div class="form-group">
7287 <label for="account-xprv" class="col-sm-2 control-label">
7288 <span>Account Extended Private Key</span>
7289 </label>
7290 <div class="col-sm-10">
7291 <textarea id="account-xprv" type="text" class="account-xprv form-control" readonly data-show-qr></textarea>
7292 </div>
7293 </div>
7294 <div class="form-group">
7295 <label for="account-xpub" class="col-sm-2 control-label">
7296 <span>Account Extended Public Key</span>
7297 </label>
7298 <div class="col-sm-10">
7299 <textarea id="account-xpub" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
7300 </div>
7301 </div>
7302 <div class="form-group">
7303 <label class="col-sm-2 control-label">
7304 </label>
7305 <div class="col-sm-10">
7306 <p>The BIP32 derivation path and extended keys are the basis for the derived addresses.</p>
7307 </div>
7308 </div>
7309 <div class="form-group">
7310 <label for="bip49-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
7311 <div class="col-sm-10">
7312 <input id="bip49-path" type="text" class="path form-control" value="m/49'/0'/0'/0" readonly="readonly">
7313 </div>
7314 </div>
7315 </div>
7316 </form>
7317 </div>
7318 <div id="bip141" class="tab-pane">
7319 <form class="form-horizontal" role="form">
7320 <br>
7321 <div class="unavailable hidden">
7322 <div class="form-group">
7323 <div class="col-sm-2"></div>
7324 <div class="col-sm-10">
7325 <p>BIP141 is unavailable for this coin.</p>
7326 </div>
7327 </div>
7328 </div>
7329 <div class="available">
7330 <div class="col-sm-2"></div>
7331 <div class="col-sm-10">
7332 <p>
7333 For more info see the
7334 <a href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki" target="_blank">BIP141 spec</a>
7335 </p>
7336 </div>
7337 <div class="form-group">
7338 <label for="bip141-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
7339 <div class="col-sm-10">
7340 <input id="bip141-path" type="text" class="bip141-path form-control" value="m/0">
7341 </div>
7342 </div>
7343 <div class="form-group">
7344 <label class="col-sm-2 control-label">Script Semantics</label>
7345 <div class="col-sm-10">
7346 <select class="form-control bip141-semantics">
7347 <option value="p2wpkh">P2WPKH</option>
7348 <option value="p2wpkh-p2sh" selected>P2WPKH nested in P2SH</option>
7349 </select>
7350 </div>
7351 </div>
7352 </div>
7353 </form>
7354 </div>
7355 <div id="bip84" class="tab-pane">
7356 <form class="form-horizontal" role="form">
7357 <br>
7358 <div class="col-sm-2"></div>
7359 <div class="col-sm-10">
7360 <p>
7361 For more info see the
7362 <a href="https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki" target="_blank">BIP84 spec</a>.
7363 </p>
7364 </div>
7365 <div class="form-group">
7366 <label for="purpose" class="col-sm-2 control-label">
7367 Purpose
7368 </label>
7369 <div class="col-sm-10">
7370 <input id="purpose" type="text" class="purpose form-control" value="84" readonly>
7371 </div>
7372 </div>
7373 <div class="form-group">
7374 <label for="coin" class="col-sm-2 control-label">
7375 Coin
7376 </label>
7377 <div class="col-sm-10">
7378 <input id="coin" type="text" class="coin form-control" value="0" readonly>
7379 </div>
7380 </div>
7381 <div class="form-group">
7382 <label for="account" class="col-sm-2 control-label">
7383 Account
7384 </label>
7385 <div class="col-sm-10">
7386 <input id="account" type="text" class="account form-control" value="0">
7387 </div>
7388 </div>
7389 <div class="form-group">
7390 <label for="change" class="col-sm-2 control-label">
7391 External / Internal
7392 </label>
7393 <div class="col-sm-10">
7394 <input id="change" type="text" class="change form-control" value="0">
7395 </div>
7396 </div>
7397 <div class="form-group">
7398 <label class="col-sm-2 control-label">
7399 </label>
7400 <div class="col-sm-10">
7401 <p>The account extended keys can be used for importing to most BIP84 compatible wallets.</p>
7402 </div>
7403 </div>
7404 <div class="form-group">
7405 <label for="account-xprv" class="col-sm-2 control-label">
7406 <span>Account Extended Private Key</span>
7407 </label>
7408 <div class="col-sm-10">
7409 <textarea id="account-xprv" type="text" class="account-xprv form-control" readonly data-show-qr></textarea>
7410 </div>
7411 </div>
7412 <div class="form-group">
7413 <label for="account-xpub" class="col-sm-2 control-label">
7414 <span>Account Extended Public Key</span>
7415 </label>
7416 <div class="col-sm-10">
7417 <textarea id="account-xpub" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
7418 </div>
7419 </div>
7420 <div class="form-group">
7421 <label class="col-sm-2 control-label">
7422 </label>
7423 <div class="col-sm-10">
7424 <p>The BIP32 derivation path and extended keys are the basis for the derived addresses.</p>
7425 </div>
7426 </div>
7427 <div class="form-group">
7428 <label for="bip84-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
7429 <div class="col-sm-10">
7430 <input id="bip84-path" type="text" class="path form-control" value="m/84'/0'/0'/0" readonly="readonly">
7431 </div>
7432 </div>
7433 </form>
7434 </div>
7435 </div>
7436 <form class="form-horizontal" role="form">
7437 <div class="form-group">
7438 <label for="extended-priv-key" class="col-sm-2 control-label">BIP32 Extended Private Key</label>
7439 <div class="col-sm-10">
7440 <textarea id="extended-priv-key" class="extended-priv-key form-control" readonly="readonly" data-show-qr></textarea>
7441 </div>
7442 </div>
7443 <div class="form-group">
7444 <label for="extended-pub-key" class="col-sm-2 control-label">BIP32 Extended Public Key</label>
7445 <div class="col-sm-10">
7446 <textarea id="extended-pub-key" class="extended-pub-key form-control" readonly="readonly" data-show-qr></textarea>
7447 </div>
7448 </div>
7449 </form>
7450 </div>
7451 </div>
7452
7453 <hr>
7454
7455 <div class="row">
7456 <div class="col-md-12">
7457 <h2>Derived Addresses</h2>
7458 <p>Note these addresses are derived from the BIP32 Extended Key</p>
7459 </div>
7460 <div class="col-md-12 use-bitpay-addresses-container hidden">
7461 <div class="checkbox">
7462 <label>
7463 <input type="checkbox" class="use-bitpay-addresses">
7464 <span>Use BitPay-style addresses for Bitcoin Cash (ie starting with 'C' instead of '1')</span>
7465 </label>
7466 </div>
7467 </div>
7468 <ul class="addresses-type nav nav-tabs" role="tablist">
7469 <li id="table-tab" class="active">
7470 <a href="#table" role="tab" data-toggle="tab">Table</a>
7471 </li>
7472 <li id="csv-tab">
7473 <a href="#csv" role="tab" data-toggle="tab">CSV</a>
7474 </li>
7475 </ul>
7476 <div class="addresses-type tab-content">
7477 <div id="table" class="tab-pane active">
7478 <div class="col-md-12">
7479 <table class="table table-striped">
7480 <thead>
7481 <th>
7482 <div class="input-group">
7483 <span>Path</span>&nbsp;&nbsp;
7484 <button class="index-toggle">Toggle</button>
7485 </div>
7486 </th>
7487 <th>
7488 <div class="input-group">
7489 <span>Address</span>&nbsp;&nbsp;
7490 <button class="address-toggle">Toggle</button>
7491 </div>
7492 </th>
7493 <th>
7494 <div class="input-group">
7495 <span>Public Key</span>&nbsp;&nbsp;
7496 <button class="public-key-toggle">Toggle</button>
7497 </div>
7498 </th>
7499 <th>
7500 <div class="input-group">
7501 <span>Private Key</span>&nbsp;&nbsp;
7502 <button class="private-key-toggle">Toggle</button>
7503 </div>
7504 </th>
7505 </thead>
7506 <tbody class="addresses monospace">
7507 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
7508 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
7509 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
7510 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
7511 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
7512 </tbody>
7513 </table>
7514 </div>
7515 </div>
7516 <div id="csv" class="tab-pane">
7517 <div class="col-md-12">
7518 <textarea class="csv form-control" rows="25" readonly></textarea>
7519 </div>
7520 </div>
7521 </div>
7522 </div>
7523 <span>Show</span>
7524 <input type="number" class="rows-to-add" value="20">
7525 <button class="more">more rows</button>
7526 <span>starting from index</span>
7527 <input type="number" class="more-rows-start-index">
7528 <span>(leave blank to generate from next index)</span>
7529
7530 <hr>
7531
7532 <div class="row">
7533 <div class="col-md-12">
7534 <h2>More info</h2>
7535 <h3>BIP39 <span class="small">Mnemonic code for generating deterministic keys</span></h3>
7536 <p>
7537 Read more at the
7538 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">official BIP39 spec</a>
7539 </p>
7540 <h3>BIP32 <span class="small">Hierarchical Deterministic Wallets</span></h3>
7541 <p>
7542 Read more at the
7543 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">official BIP32 spec</a>
7544 </p>
7545 <p>
7546 See the demo at
7547 <a href="http://bip32.org/" target="_blank">bip32.org</a>
7548 </p>
7549 <h3>BIP44 <span class="small">Multi-Account Hierarchy for Deterministic Wallets</span></h3>
7550 <p>
7551 Read more at the
7552 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">official BIP44 spec</a>
7553 </p>
7554 <h3>BIP49 <span class="small">Derivation scheme for P2WPKH-nested-in-P2SH based accounts</span></h3>
7555 <p>
7556 Read more at the
7557 <a href="https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki" target="_blank">official BIP49 spec</a>
7558 </p>
7559 <h3>Private Keys</h3>
7560 <p>
7561 <span>
7562 Use private keys at
7563 <a href="https://web.archive.org/web/20150707020924/https://brainwallet.org/" target="_blank">brainwallet.org</a>.
7564 </span>
7565 <span>Be careful - it can be easy to make mistakes if you don't know what you're doing.</span>
7566 </p>
7567 <h3 id="entropy-notes">Entropy</h3>
7568 <p>
7569 <span>
7570 Entropy values must be sourced from a
7571 <a href="https://en.wikipedia.org/wiki/Random_number_generation" target="_blank">strong source of randomness</a>.
7572 </span>
7573 <span>This means flipping a fair coin, rolling a fair dice, noise measurements etc.</span>
7574 <span>
7575 Do <strong>NOT</strong> use phrases from books, lyrics from songs, your birthday or street address,
7576 keyboard mashing, or anything you <i>think</i> is random, because chances are overwhelming it isn't
7577 random enough for the needs of this tool.
7578 </span>
7579 </p>
7580 <p>
7581 <strong><span>Do not store entropy.</span></strong>
7582 </p>
7583 <p>
7584 <span>Storing entropy (such as keeping a deck of cards in a specific shuffled order) is unreliable compared to storing a mnemonic.</span>
7585 <span>Instead of storing entropy, store the mnemonic generated from the entropy.</span>
7586 <span><a href="https://en.wikipedia.org/wiki/Steganography#Physical" target="_blank">Steganography</a> may be beneficial when storing the mnemonic.</span>
7587 </p>
7588 <p>
7589 <span>
7590 The random mnemonic generator on this page uses a
7591 <a href="https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues" target="_blank">cryptographically secure random number generator</a>.
7592 </span>
7593 <span>The built in random generator can generally be trusted more than your own intuition about randomness.</span>
7594 <span>If cryptographic randomness isn't available in your browser, this page will show a warning and the generate button will not work.</span>
7595 <span>In that case you might choose to use your own source of entropy.</span>
7596 </p>
7597 <p>
7598 <a href="https://bitcointalk.org/index.php?topic=311000.msg3345309#msg3345309" target="_blank">You are not a good source of entropy.</a>
7599 </p>
7600 <h3>License</h3>
7601 <p>
7602 <span>Please refer to <a href="https://github.com/iancoleman/bip39/blob/master/LICENSE" target="_blank">the software license</a> for more detail.
7603 </span>
7604 </p>
7605 <p>The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.</p>
7606 </div>
7607 </div>
7608
7609 <hr>
7610
7611 <div class="row">
7612 <div class="col-md-12">
7613 <h2>Alternative Tools</h2>
7614 <p>This tool is interoperable with any BIP39 wallet.</p>
7615 <p>Some similar tools to this one (ie not consumer wallets) are</p>
7616 <p>
7617 <a href="https://bip32jp.github.io/english/">
7618 https://bip32jp.github.io/english/
7619 </a>
7620 </p>
7621 </div>
7622 </div>
7623
7624 <hr>
7625
7626 <div class="row">
7627 <div class="col-md-12">
7628
7629 <h2>Offline Usage</h2>
7630
7631 <p>
7632 You can use this tool without having to be online.
7633 </p>
7634 <p>
7635 In your browser, select file save-as, and save this page
7636 as a file.
7637 </p>
7638 <p>
7639 Double-click that file to open it in a browser
7640 on any offline computer.
7641 </p>
7642 <p>
7643 <span>Alternatively, download the file from the repository</span>
7644 -
7645 <a href="https://github.com/iancoleman/bip39">https://github.com/iancoleman/bip39</a>
7646 </p>
7647
7648 </div>
7649 </div>
7650
7651 <hr>
7652
7653 <div class="row">
7654 <div class="col-md-12">
7655
7656 <h2>This project is 100% open-source code</h2>
7657
7658 <p>
7659 <span>Get the source code from the repository</span>
7660 -
7661 <a href="https://github.com/iancoleman/bip39" target="_blank">
7662 https://github.com/iancoleman/bip39
7663 </a>
7664 </p>
7665
7666 <h3>Libraries</h3>
7667
7668 <p>
7669 <span>BitcoinJS - </span>
7670 <a href="https://github.com/bitcoinjs/bitcoinjs-lib" target="_blank">
7671 https://github.com/bitcoinjs/bitcoinjs-lib
7672 </a>
7673 </p>
7674
7675 <p>
7676 <span>jsBIP39 - </span>
7677 <a href="https://github.com/iancoleman/jsbip39" target="_blank">
7678 https://github.com/iancoleman/jsbip39
7679 </a>
7680 </p>
7681
7682 <p>
7683 <span>sjcl - </span>
7684 <a href="https://github.com/bitwiseshiftleft/sjcl" target="_blank">
7685 https://github.com/bitwiseshiftleft/sjcl
7686 </a>
7687 </p>
7688
7689 <p>
7690 <span>jQuery - </span>
7691 <a href="https://jquery.com/" target="_blank">
7692 https://jquery.com/
7693 </a>
7694 </p>
7695
7696 <p>
7697 <span>Twitter Bootstrap - </span>
7698 <a href="http://getbootstrap.com/" target="_blank">
7699 http://getbootstrap.com/
7700 </a>
7701 </p>
7702
7703 </div>
7704 </div>
7705
7706 </div>
7707
7708 <div class="qr-container hidden">
7709 <div class="qr-hint bg-primary hidden">Click field to hide QR</div>
7710 <div class="qr-hint bg-primary">Click field to show QR</div>
7711 <div class="qr-hider hidden">
7712 <div class="qr-image"></div>
7713 <div class="qr-warning bg-primary">Caution: Scanner may keep history</div>
7714 </div>
7715 </div>
7716
7717 <div class="feedback-container">
7718 <div class="feedback">Loading...</div>
7719 </div>
7720
7721 <script type="text/template" id="address-row-template">
7722 <tr>
7723 <td class="index"><span></span></td>
7724 <td class="address"><span data-show-qr></span></td>
7725 <td class="pubkey"><span data-show-qr></span></td>
7726 <td class="privkey"><span data-show-qr></span></td>
7727 </tr>
7728 </script>
7729 <script>// From
7730// https://raw.githubusercontent.com/inexorabletash/polyfill/a6bc6ced78160c994f76a909b6ff6bbbab3d43de/es6.js
7731// Required for ethereumjs-utils.js when run in phantomjs-2.1.1
7732// but is not required in any modern browsers.
7733// For more information, see
7734// https://www.bountysource.com/issues/38485709-error-rendering-plot-with-phantomjs
7735
7736//----------------------------------------------------------------------
7737//
7738// ECMAScript 2015 Polyfills
7739//
7740//----------------------------------------------------------------------
7741
7742(function (global) {
7743 "use strict";
7744
7745 // Set this to always override native implementations, for testing
7746 // the polyfill in browsers with partial/full ES2015 support.
7747 var OVERRIDE_NATIVE_FOR_TESTING = false;
7748
7749 var undefined = (void 0); // Paranoia
7750
7751 // Helpers
7752
7753 function strict(o) {
7754 return o === global ? undefined : o;
7755 }
7756
7757 function hook(o, p, f) {
7758 var op = o[p];
7759 console.assert(typeof op === 'function', 'Hooking a non-function');
7760 o[p] = function() {
7761 var o = strict(this);
7762 var r = f.apply(o, arguments);
7763 return r !== undefined ? r : op.apply(o, arguments);
7764 };
7765 }
7766
7767 function isSymbol(s) {
7768 return (typeof s === 'symbol') || ('Symbol' in global && s instanceof global.Symbol);
7769 }
7770
7771 function getPropertyDescriptor(target, name) {
7772 var desc = Object.getOwnPropertyDescriptor(target, name);
7773 var proto = Object.getPrototypeOf(target);
7774 while (!desc && proto) {
7775 desc = Object.getOwnPropertyDescriptor(proto, name);
7776 proto = Object.getPrototypeOf(proto);
7777 }
7778 return desc;
7779 }
7780
7781 var enqueue = (function(nativePromise, nativeSetImmediate) {
7782 if (nativePromise)
7783 return function(job) { nativePromise.resolve().then(function() { job(); }); };
7784 if (nativeSetImmediate)
7785 return function(job) { nativeSetImmediate(job); };
7786 return function(job) { setTimeout(job, 0); };
7787 }(global['Promise'], global['setImmediate']));
7788
7789 function define(o, p, v, override) {
7790 if (p in o && !override && !OVERRIDE_NATIVE_FOR_TESTING)
7791 return;
7792
7793 if (typeof v === 'function') {
7794 // Sanity check that functions are appropriately named (where possible)
7795 console.assert(isSymbol(p) || !('name' in v) || v.name === p || v.name === p + '_', 'Expected function name "' + p.toString() + '", was "' + v.name + '"');
7796 Object.defineProperty(o, p, {
7797 value: v,
7798 configurable: true,
7799 enumerable: false,
7800 writable: true
7801 });
7802 } else {
7803 Object.defineProperty(o, p, {
7804 value: v,
7805 configurable: false,
7806 enumerable: false,
7807 writable: false
7808 });
7809 }
7810 }
7811
7812 function set_internal(o, p, v) {
7813 Object.defineProperty(o, p, {
7814 value: v,
7815 configurable: false,
7816 enumerable: false,
7817 writable: true
7818 });
7819 }
7820
7821 // Snapshot intrinsic functions
7822 var $isNaN = global.isNaN,
7823 $parseInt = global.parseInt,
7824 $parseFloat = global.parseFloat;
7825
7826 var E = Math.E,
7827 LOG10E = Math.LOG10E,
7828 LOG2E = Math.LOG2E,
7829 abs = Math.abs,
7830 ceil = Math.ceil,
7831 exp = Math.exp,
7832 floor = Math.floor,
7833 log = Math.log,
7834 max = Math.max,
7835 min = Math.min,
7836 pow = Math.pow,
7837 random = Math.random,
7838 sqrt = Math.sqrt;
7839
7840 var orig_match = String.prototype.match,
7841 orig_replace = String.prototype.replace,
7842 orig_search = String.prototype.search,
7843 orig_split = String.prototype.split;
7844
7845 // These are used for implementing the polyfills, but not exported.
7846
7847 // Inspired by https://gist.github.com/1638059
7848 /** @constructor */
7849 function EphemeronTable() {
7850 var secretKey = ObjectCreate(null);
7851
7852 function conceal(o) {
7853 var oValueOf = o.valueOf, secrets = ObjectCreate(null);
7854 Object.defineProperty(o, 'valueOf', {
7855 value: (function(secretKey) {
7856 return function (k) {
7857 return (k === secretKey) ? secrets : oValueOf.apply(o, arguments);
7858 };
7859 }(secretKey)),
7860 configurable: true,
7861 writeable: true,
7862 enumerable: false
7863 });
7864 return secrets;
7865 }
7866
7867 function reveal(o) {
7868 var v = typeof o.valueOf === 'function' && o.valueOf(secretKey);
7869 return v === o ? null : v;
7870 }
7871
7872 return {
7873 clear: function() {
7874 secretKey = ObjectCreate(null);
7875 },
7876 remove: function(key) {
7877 var secrets = reveal(key);
7878 if (secrets && HasOwnProperty(secrets, 'value')) {
7879 delete secrets.value;
7880 return true;
7881 }
7882 return false;
7883 },
7884 get: function(key, defaultValue) {
7885 var secrets = reveal(key);
7886 return (secrets && HasOwnProperty(secrets, 'value')) ? secrets.value : defaultValue;
7887 },
7888 has: function(key) {
7889 var secrets = reveal(key);
7890 return Boolean(secrets && HasOwnProperty(secrets, 'value'));
7891 },
7892 set: function(key, value) {
7893 var secrets = reveal(key) || conceal(key);
7894 secrets.value = value;
7895 }
7896 };
7897 }
7898
7899 var empty = Object.create(null);
7900
7901 //----------------------------------------------------------------------
7902 //
7903 // ECMAScript 2015
7904 // http://www.ecma-international.org/ecma-262/6.0/
7905 //
7906 //----------------------------------------------------------------------
7907
7908 // ---------------------------------------
7909 // 19.4 Symbol Objects
7910 // ---------------------------------------
7911
7912 // NOTE: Symbols are defined here - out of spec order - since we need the
7913 // properties and prototype to be populated for other polyfills.
7914
7915 // NOTE: Not secure, nor is obj[$$symbol] hidden from Object.keys()
7916
7917 var symbolForKey;
7918 (function() {
7919 var secret = Object.create(null);
7920 var symbolMap = {};
7921 symbolForKey = function(k) {
7922 return symbolMap[k];
7923 };
7924
7925 var GlobalSymbolRegistry = [];
7926
7927 function unique(bits) {
7928 return Array(bits + 1).join('x').replace(/x/g, function() {
7929 return random() < 0.5 ? '\u200C' : '\u200D'; // JWNJ / ZWJ
7930 });
7931 }
7932
7933 // 19.4.1 The Symbol Constructor
7934 // 19.4.1.1 Symbol ( description=undefined )
7935 function Symbol(description) {
7936 if (!(this instanceof Symbol)) return new Symbol(description, secret);
7937 if (this instanceof Symbol && arguments[1] !== secret) throw TypeError();
7938
7939 var descString = description === undefined ? undefined : String(description);
7940
7941 set_internal(this, '[[SymbolData]]', unique(128));
7942 set_internal(this, '[[Description]]', descString);
7943
7944 symbolMap[this] = this;
7945 return this;
7946 }
7947
7948 if (!('Symbol' in global) || OVERRIDE_NATIVE_FOR_TESTING)
7949 global.Symbol = Symbol;
7950
7951 // 19.4.2 Properties of the Symbol Constructor
7952
7953 // 19.4.2.1 Symbol.for (key)
7954 define(Symbol, 'for', function for_(key) {
7955 var stringKey = String(key);
7956 for (var i = 0; i < GlobalSymbolRegistry.length; ++i) {
7957 var e = GlobalSymbolRegistry[i];
7958 if (SameValue(e['[[key]]'], stringKey)) return e['[[symbol]]'];
7959 }
7960 var newSymbol = Symbol(key);
7961 GlobalSymbolRegistry.push({'[[key]]': stringKey, '[[symbol]]': newSymbol});
7962 return newSymbol;
7963 });
7964
7965 // 19.4.2.2 Symbol.hasInstance
7966 // 19.4.2.3 Symbol.isConcatSpreadable
7967
7968 // 19.4.2.4 Symbol.iterator
7969 define(global.Symbol, 'iterator', global.Symbol('Symbol.iterator'));
7970
7971 // 19.4.2.5 Symbol.keyFor (sym)
7972 define(Symbol, 'keyFor', function keyFor(sym) {
7973 if (!(sym instanceof Symbol)) throw TypeError();
7974 for (var i = 0; i < GlobalSymbolRegistry.length; ++i) {
7975 var e = GlobalSymbolRegistry[i];
7976 if (SameValue(e['[[symbol]]'], sym)) return e['[[key]]'];
7977 }
7978 return undefined;
7979 });
7980
7981 // 19.4.2.6 Symbol.match
7982 define(global.Symbol, 'match', global.Symbol('Symbol.match'));
7983
7984 // 19.4.2.7 Symbol.prototype
7985
7986 // 19.4.2.8 Symbol.replace
7987 define(global.Symbol, 'replace', global.Symbol('Symbol.replace'));
7988
7989 // 19.4.2.9 Symbol.search
7990 define(global.Symbol, 'search', global.Symbol('Symbol.search'));
7991
7992 // 19.4.2.10 Symbol.species
7993
7994 // 19.4.2.11 Symbol.search
7995 define(global.Symbol, 'split', global.Symbol('Symbol.split'));
7996
7997 // 19.4.2.12 Symbol.toPrimitive
7998
7999 // 19.4.2.13 Symbol.toStringTag
8000 define(global.Symbol, 'toStringTag', global.Symbol('Symbol.toStringTag'));
8001
8002 // 19.4.2.14 Symbol.unscopables
8003
8004 // 19.4.3 Properties of the Symbol Prototype Object
8005 // 19.4.3.1 Symbol.prototype.constructor
8006
8007 // 19.4.3.2 Symbol.prototype.toString ( )
8008 Object.defineProperty(Symbol.prototype, 'toString', {
8009 value: function toString() {
8010 var s = strict(this);
8011 var desc = s['[[Description]]'];
8012 return 'Symbol(' + (desc === undefined ? '' : desc) + s['[[SymbolData]]'] + ')';
8013 },
8014 configurable: true, writeable: true, enumerable: false });
8015
8016 // 19.4.3.3 Symbol.prototype.valueOf ( )
8017 Object.defineProperty(Symbol.prototype, 'valueOf', {
8018 value: function valueOf() {
8019 // To prevent automatic string conversion:
8020 throw TypeError();
8021
8022 // Spec has approximately the following:
8023 //var s = strict(this);
8024 //if (Type(s) === 'symbol') return s;
8025 //if (Type(s) !== 'object') throw TypeError();
8026 //if (!('[[SymbolData]]' in s)) throw TypeError();
8027 //return s['[[SymbolData]]'];
8028 },
8029 configurable: true, writeable: true, enumerable: false });
8030
8031 // 19.4.3.4 Symbol.prototype [ @@toStringTag ]
8032 // (Done later to polyfill partial implementations)
8033
8034 // 19.4.4 Properties of Symbol Instances
8035 }());
8036
8037 console.assert(typeof global.Symbol() === 'symbol' || symbolForKey(String(global.Symbol('x'))));
8038
8039 // Defined here so that other prototypes can reference it
8040 // 25.1.2 The %IteratorPrototype% Object
8041 var $IteratorPrototype$ = {};
8042
8043 //----------------------------------------
8044 // 6 ECMAScript Data Types and Values
8045 //----------------------------------------
8046
8047 // 6.1 ECMAScript Language Types
8048
8049 // "Type(x)" is used as shorthand for "the type of x"...
8050 function Type(v) {
8051 switch (typeof v) {
8052 case 'undefined': return 'undefined';
8053 case 'boolean': return 'boolean';
8054 case 'number': return 'number';
8055 case 'string': return 'string';
8056 case 'symbol': return 'symbol';
8057 default:
8058 if (v === null) return 'null';
8059 if (v instanceof global.Symbol) return 'symbol';
8060 return 'object';
8061 }
8062 }
8063
8064 // 6.1.5.1 Well-Known Symbols
8065 var $$iterator = global.Symbol.iterator,
8066 $$match = global.Symbol.match,
8067 $$replace = global.Symbol.replace,
8068 $$search = global.Symbol.search,
8069 $$split = global.Symbol.split,
8070 $$toStringTag = global.Symbol.toStringTag;
8071
8072 //----------------------------------------
8073 // 7 Abstract Operations
8074 //----------------------------------------
8075
8076 //----------------------------------------
8077 // 7.1 Type Conversion
8078 //----------------------------------------
8079
8080 // 7.1.1 ToPrimitive ( input [, PreferredType] )
8081 // just use valueOf()
8082
8083 // 7.1.2 ToBoolean ( argument )
8084 // just use Boolean()
8085
8086 // 7.1.3 ToNumber ( argument )
8087 // just use Number()
8088
8089 // 7.1.4 ToInteger ( argument )
8090 function ToInteger(n) {
8091 n = Number(n);
8092 if ($isNaN(n)) return 0;
8093 if (n === 0 || n === Infinity || n === -Infinity) return n;
8094 return ((n < 0) ? -1 : 1) * floor(abs(n));
8095 }
8096
8097 // 7.1.5 ToInt32 ( argument )
8098 function ToInt32(v) { return v >> 0; }
8099
8100 // 7.1.6 ToUint32 ( argument )
8101 function ToUint32(v) { return v >>> 0; }
8102
8103 // 7.1.7 ToInt16 ( argument )
8104 function ToInt16(v) { return (v << 16) >> 16; }
8105
8106 // 7.1.8 ToUint16 ( argument )
8107 function ToUint16(v) { return v & 0xFFFF; }
8108
8109 // 7.1.9 ToInt8 ( argument )
8110 function ToInt8(v) { return (v << 24) >> 24; }
8111
8112 // 7.1.10 ToUint8 ( argument )
8113 function ToUint8(v) { return v & 0xFF; }
8114
8115 // 7.1.11 ToUint8Clamp ( argument )
8116 function ToUint8Clamp(argument) {
8117 var number = Number(argument);
8118 if ($isNaN(number)) return 0;
8119 if (number <= 0) return 0;
8120 if (number >= 255) return 255;
8121 var f = floor(number);
8122 if ((f + 0.5) < number) return f + 1;
8123 if (number < (f + 0.5)) return f;
8124 if (f % 2) return f + 1;
8125 return f;
8126 }
8127
8128 // 7.1.12 ToString ( argument )
8129 // just use String()
8130
8131 // 7.1.13 ToObject ( argument )
8132 function ToObject(v) {
8133 if (v === null || v === undefined) throw TypeError();
8134 return Object(v);
8135 }
8136
8137 // 7.1.14 ToPropertyKey ( argument )
8138 function ToPropertyKey(v) {
8139 return String(v);
8140 }
8141
8142 // 7.1.15 ToLength ( argument )
8143 function ToLength(v) {
8144 var len = ToInteger(v);
8145 if (len <= 0) return 0;
8146 if (len === Infinity) return 0x20000000000000 - 1; // 2^53-1
8147 return min(len, 0x20000000000000 - 1); // 2^53-1
8148 }
8149
8150 // 7.1.16 CanonicalNumericIndexString ( argument )
8151
8152 //----------------------------------------
8153 // 7.2 Testing and Comparison Operations
8154 //----------------------------------------
8155
8156 // 7.2.1 RequireObjectCoercible ( argument )
8157 // 7.2.2 IsArray ( argument )
8158
8159 // 7.2.3 IsCallable ( argument )
8160 function IsCallable(o) { return typeof o === 'function'; }
8161
8162 // 7.2.4 IsConstructor ( argument )
8163 function IsConstructor(o) {
8164 // Hacks for Safari 7 TypedArray XXXConstructor objects
8165 if (/Constructor/.test(Object.prototype.toString.call(o))) return true;
8166 if (/Function/.test(Object.prototype.toString.call(o))) return true;
8167 // TODO: Can this be improved on?
8168 return typeof o === 'function';
8169 }
8170
8171 // 7.2.5 IsExtensible (O)
8172 // 7.2.6 IsInteger ( argument )
8173
8174 // 7.2.7 IsPropertyKey ( argument )
8175 function IsPropertyKey(argument) {
8176 if (Type(argument) === 'string') return true;
8177 if (Type(argument) === 'symbol') return true;
8178 return false;
8179 }
8180
8181 // 7.2.8 IsRegExp ( argument )
8182 // 7.2.5 IsConstructor ( argument )
8183
8184 // 7.2.9 SameValue(x, y)
8185 function SameValue(x, y) {
8186 if (typeof x !== typeof y) return false;
8187 switch (typeof x) {
8188 case 'undefined':
8189 return true;
8190 case 'number':
8191 if (x !== x && y !== y) return true;
8192 if (x === 0 && y === 0) return 1/x === 1/y;
8193 return x === y;
8194 case 'boolean':
8195 case 'string':
8196 case 'object':
8197 default:
8198 return x === y;
8199 }
8200 }
8201
8202 // 7.2.10 SameValueZero(x, y)
8203 function SameValueZero(x, y) {
8204 if (typeof x !== typeof y) return false;
8205 switch (typeof x) {
8206 case 'undefined':
8207 return true;
8208 case 'number':
8209 if (x !== x && y !== y) return true;
8210 return x === y;
8211 case 'boolean':
8212 case 'string':
8213 case 'object':
8214 default:
8215 return x === y;
8216 }
8217 }
8218
8219 //----------------------------------------
8220 // 7.3 Operations on Objects
8221 //----------------------------------------
8222
8223 // 7.3.1 Get (O, P)
8224 // - just use o.p or o[p]
8225
8226 // 7.3.2 GetV (V, P)
8227 function GetV(v, p) {
8228 var o = ToObject(v);
8229 return o[p];
8230 }
8231
8232 // 7.3.3 Set (O, P, V, Throw)
8233 // - just use o.p = v or o[p] = v
8234
8235
8236
8237
8238 // 7.3.9 GetMethod (O, P)
8239 function GetMethod(o, p) {
8240 var func = GetV(o, p);
8241 if (func === undefined || func === null) return undefined;
8242 if (!IsCallable(func)) throw TypeError();
8243 return func;
8244 }
8245
8246 // 7.3.10 HasProperty (O, P)
8247 function HasProperty(o, p) {
8248 while (o) {
8249 if (Object.prototype.hasOwnProperty.call(o, p)) return true;
8250 if (Type(o) !== 'object') return false;
8251 o = Object.getPrototypeOf(o);
8252 }
8253 return false;
8254 }
8255
8256 // 7.3.11 HasOwnProperty (O, P)
8257 function HasOwnProperty(o, p) {
8258 return Object.prototype.hasOwnProperty.call(o, p);
8259 }
8260
8261 //----------------------------------------
8262 // 7.4 Operations on Iterator Objects
8263 //----------------------------------------
8264
8265 // 7.4.1 GetIterator ( obj, method )
8266 function GetIterator(obj, method) {
8267 if (arguments.length < 2)
8268 method = GetMethod(obj, $$iterator);
8269 var iterator = method.call(obj);
8270 if (Type(iterator) !== 'object') throw TypeError();
8271 return iterator;
8272 }
8273
8274 // 7.4.2 IteratorNext ( iterator, value )
8275 function IteratorNext(iterator, value) {
8276 if (arguments.length < 2)
8277 var result = iterator.next();
8278 else
8279 result = iterator.next(value);
8280 if (Type(result) !== 'object') throw TypeError();
8281 return result;
8282 }
8283
8284 // 7.4.3 IteratorComplete ( iterResult )
8285 function IteratorComplete(iterResult) {
8286 console.assert(Type(iterResult) === 'object');
8287 return Boolean(iterResult.done);
8288 }
8289
8290 // 7.4.4 IteratorValue ( iterResult )
8291 function IteratorValue(iterResult) {
8292 console.assert(Type(iterResult) === 'object');
8293 return iterResult.value;
8294 }
8295
8296 // 7.4.5 IteratorStep ( iterator )
8297 function IteratorStep( iterator, value ) {
8298 var result = IteratorNext(iterator, value);
8299 var done = result['done'];
8300 if (Boolean(done) === true) return false;
8301 return result;
8302 }
8303
8304 // 7.4.6 IteratorClose( iterator, completion )
8305 function IteratorClose( iterator, completion ) {
8306 console.assert(Type(iterator) === 'object');
8307 var _return = GetMethod(iterator, 'return');
8308 if (_return === undefined) return completion;
8309 try {
8310 var innerResult = _return[iterator]();
8311 } catch (result) {
8312 // TODO: If completion.[[type]] is throw, return completion
8313 return result;
8314 }
8315 if (Type(innerResult) !== 'object') throw TypeError();
8316 return completion;
8317 }
8318
8319 // 7.4.7 CreateIterResultObject (value, done)
8320 function CreateIterResultObject(value, done) {
8321 console.assert(Type(done) === 'boolean');
8322 var obj = {};
8323 obj["value"] = value;
8324 obj["done"] = done;
8325 return obj;
8326 }
8327
8328 // 7.4.8 CreateListIterator (list)
8329 // 7.4.8.1 ListIterator next( )
8330 // 7.4.9 CreateCompoundIterator ( iterator1, iterator2 )
8331 // 7.4.9.1 CompoundIterator next( )
8332
8333 //----------------------------------------
8334 // 8 Executable Code and Execution Contexts
8335 //----------------------------------------
8336
8337 //----------------------------------------
8338 // 8.4 Jobs and Job Queues
8339 //----------------------------------------
8340
8341 // 8.4.1 EnqueueJob ( queueName, job, arguments)
8342 function EnqueueJob(queueName, job, args) {
8343 var fn = function() { job.apply(undefined, args); };
8344 enqueue(fn);
8345 }
8346
8347 // 8.4.2 NextJob result
8348 function NextJob(result) {
8349 // no-op
8350 }
8351
8352 //----------------------------------------
8353 // 9 Ordinary and Exotic Objects Behaviors
8354 //----------------------------------------
8355
8356 // 9.1.11 [[Enumerate]] ()
8357 function Enumerate(obj) {
8358 var e = [];
8359 if (Object(obj) !== obj) return e;
8360 var visited = new Set;
8361 while (obj !== null) {
8362 Object.getOwnPropertyNames(obj).forEach(function(name) {
8363 if (!visited.has(name)) {
8364 var desc = Object.getOwnPropertyDescriptor(obj, name);
8365 if (desc) {
8366 visited.add(name);
8367 if (desc.enumerable) e.push(name);
8368 }
8369 }
8370 });
8371 obj = Object.getPrototypeOf(obj);
8372 }
8373 return e[$$iterator]();
8374 }
8375
8376 // 9.1.12 [[OwnPropertyKeys]] ( )
8377 function OwnPropertyKeys(o) {
8378 return Object.getOwnPropertyNames(o);
8379 }
8380
8381 // 9.1.13 ObjectCreate(proto, internalSlotsList)
8382 function ObjectCreate(proto, internalSlotsList) {
8383 return Object.create(proto, internalSlotsList);
8384 }
8385
8386 // ---------------------------------------
8387 // 19 Fundamental Objects
8388 // ---------------------------------------
8389
8390 // ---------------------------------------
8391 // 19.1 Object Objects
8392 // ---------------------------------------
8393
8394 // 19.1.1 The Object Constructor
8395 // 19.1.1.1 Object ( [ value ] )
8396 // 19.1.2 Properties of the Object Constructor
8397 // 19.1.2.1 Object.assign ( target, ...sources )
8398 define(
8399 Object, 'assign',
8400 function assign(target, /*...*/sources) {
8401 var to = ToObject(target);
8402 if (arguments.length < 2) return to;
8403
8404 var sourcesIndex = 1;
8405 while (sourcesIndex < arguments.length) {
8406 var nextSource = arguments[sourcesIndex++];
8407 if (nextSource === undefined || nextSource === null) {
8408 var keys = [];
8409 } else {
8410 var from = ToObject(nextSource);
8411 keys = OwnPropertyKeys(from);
8412 }
8413 for (var keysIndex = 0; keysIndex < keys.length; ++keysIndex) {
8414 var nextKey = keys[keysIndex];
8415 var desc = Object.getOwnPropertyDescriptor(from, nextKey);
8416 if (desc !== undefined && desc.enumerable) {
8417 var propValue = from[nextKey];
8418 to[nextKey] = propValue;
8419 }
8420 }
8421 }
8422 return to;
8423 });
8424
8425 // 19.1.2.2 Object.create ( O [ , Properties ] )
8426 // 19.1.2.3 Object.defineProperties ( O, Properties )
8427 // 19.1.2.4 Object.defineProperty ( O, P, Attributes )
8428 // 19.1.2.5 Object.freeze ( O )
8429 // 19.1.2.6 Object.getOwnPropertyDescriptor ( O, P )
8430
8431 (function() {
8432 var nativeSymbols = (typeof global.Symbol() === 'symbol'),
8433 $getOwnPropertyNames = Object.getOwnPropertyNames,
8434 $keys = Object.keys,
8435 $window_names = (typeof window === 'object' ? $getOwnPropertyNames(window) : []);
8436
8437 function isStringKey(k) { return !symbolForKey(k); }
8438
8439 // 19.1.2.7 Object.getOwnPropertyNames ( O )
8440 define(
8441 Object, 'getOwnPropertyNames',
8442 function getOwnPropertyNames(o) {
8443 if (Object.prototype.toString.call(o) === '[object Window]') {
8444 // Workaround for cross-realm calling by IE itself.
8445 // https://github.com/inexorabletash/polyfill/issues/96
8446 try {
8447 return $getOwnPropertyNames(o).filter(isStringKey);
8448 } catch (_) {
8449 return $window_names.slice();
8450 }
8451 }
8452 return $getOwnPropertyNames(o).filter(isStringKey);
8453 }, !nativeSymbols);
8454
8455 // 19.1.2.8 Object.getOwnPropertySymbols ( O )
8456 define(
8457 Object, 'getOwnPropertySymbols',
8458 function getOwnPropertySymbols(o) {
8459 return $getOwnPropertyNames(o).filter(symbolForKey).map(symbolForKey);
8460 }, !nativeSymbols);
8461
8462 // 19.1.2.14 Object.keys ( O )
8463 define(
8464 Object, 'keys',
8465 function keys(o) {
8466 return $keys(o).filter(isStringKey);
8467 }, !nativeSymbols);
8468 }());
8469
8470 // 19.1.2.9 Object.getPrototypeOf ( O )
8471 // 19.1.2.10 Object.is ( value1, value2 )
8472 define(
8473 Object, 'is',
8474 function is(value1, value2) {
8475 return SameValue(value1, value2);
8476 });
8477
8478 // 19.1.2.11 Object.isExtensible ( O )
8479 // 19.1.2.12 Object.isFrozen ( O )
8480 // 19.1.2.13 Object.isSealed ( O )
8481
8482 // 19.1.2.14 Object.keys ( O )
8483 // see above
8484
8485 // 19.1.2.15 Object.preventExtensions ( O )
8486 // 19.1.2.16 Object.prototype
8487 // 19.1.2.17 Object.seal ( O )
8488
8489 // 19.1.2.18 Object.setPrototypeOf ( O, proto )
8490 define(
8491 Object, 'setPrototypeOf',
8492 function setPrototypeOf(o, proto) {
8493 if (Type(o) !== 'object') throw TypeError();
8494 if (Type(proto) !== 'object' && Type(proto) !== 'null') throw TypeError();
8495 o.__proto__ = proto;
8496 return o;
8497 }
8498 );
8499
8500 // 19.1.3 Properties of the Object Prototype Object
8501 // 19.1.3.1 Object.prototype.constructor
8502 // 19.1.3.2 Object.prototype.hasOwnProperty ( V )
8503 // 19.1.3.3 Object.prototype.isPrototypeOf ( V )
8504 // 19.1.3.4 Object.prototype.propertyIsEnumerable ( V )
8505 // 19.1.3.5 Object.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )
8506 // 19.1.3.6 Object.prototype.toString ( )
8507 hook(Object.prototype, 'toString',
8508 function() {
8509 var o = strict(this);
8510 if (o === Object(o) && $$toStringTag in o) {
8511 return '[object ' + o[$$toStringTag] + ']';
8512 }
8513 return undefined;
8514 });
8515
8516 // 19.1.3.7 Object.prototype.valueOf ( )
8517 // 19.1.4 Properties of Object Instances
8518
8519 // ---------------------------------------
8520 // 19.2 Function Objects
8521 // ---------------------------------------
8522
8523 // 19.2.1 The Function Constructor
8524 // 19.2.1.1 Function ( p1, p2, … , pn, body )
8525 // 19.2.2 Properties of the Function Constructor
8526 // 19.2.2.1 Function.length
8527 // 19.2.2.2 Function.prototype
8528 // 19.2.3 Properties of the Function Prototype Object
8529 // 19.2.3.1 Function.prototype.apply ( thisArg, argArray )
8530 // 19.2.3.2 Function.prototype.bind ( thisArg , ...args)
8531 // 19.2.3.3 Function.prototype.call (thisArg , ...args)
8532 // 19.2.3.4 Function.prototype.constructor
8533 // 19.2.3.5 Function.prototype.toString ( )
8534 // 19.2.3.6 Function.prototype[@@hasInstance] ( V )
8535 // 19.2.4 Function Instances
8536 // 19.2.4.1 length
8537 // 19.2.4.2 name
8538 // 19.2.4.3 prototype
8539
8540 // (No polyfillable changes from ES5)
8541
8542 // ---------------------------------------
8543 // 19.3 Boolean Objects
8544 // ---------------------------------------
8545
8546 // 19.3.1 The Boolean Constructor
8547 // 19.3.1.1 Boolean ( value )
8548 // 19.3.2 Properties of the Boolean Constructor
8549 // 19.3.2.1 Boolean.prototype
8550 // 19.3.3 Properties of the Boolean Prototype Object
8551 // 19.3.3.1 Boolean.prototype.constructor
8552 // 19.3.3.2 Boolean.prototype.toString ( )
8553 // 19.3.3.3 Boolean.prototype.valueOf ( )
8554 // 19.3.4 Properties of Boolean Instances
8555
8556 // (No polyfillable changes from ES5)
8557
8558 // ---------------------------------------
8559 // 19.4 Symbol Objects
8560 // ---------------------------------------
8561
8562 // Moved earlier in this script, so that other polyfills can depend on them.
8563
8564 // 19.4.3.4 Symbol.prototype [ @@toStringTag ]
8565 define(global.Symbol.prototype, global.Symbol.toStringTag, 'Symbol');
8566
8567 // ---------------------------------------
8568 // 19.5 Error Objects
8569 // ---------------------------------------
8570
8571 // 19.5.1 The Error Constructor
8572 // 19.5.1.1 Error ( message )
8573 // 19.5.1.2 new Error( ...argumentsList )
8574 // 19.5.2 Properties of the Error Constructor
8575 // 19.5.2.1 Error.prototype
8576 // 19.5.3 Properties of the Error Prototype Object
8577 // 19.5.3.1 Error.prototype.constructor
8578 // 19.5.3.2 Error.prototype.message
8579 // 19.5.3.3 Error.prototype.name
8580 // 19.5.3.4 Error.prototype.toString ( )
8581 // 19.5.4 Properties of Error Instances
8582 // 19.5.5 Native Error Types Used in This Standard
8583 // 19.5.5.1 EvalError
8584 // 19.5.5.2 RangeError
8585 // 19.5.5.3 ReferenceError
8586 // 19.5.5.4 SyntaxError
8587 // 19.5.5.5 TypeError
8588 // 19.5.5.6 URIError
8589 // 19.5.6 NativeError Object Structure
8590 // 19.5.6.1 NativeError Constructors
8591 // 19.5.6.1.1 NativeError ( message )
8592 // 19.5.6.1.2 new NativeError ( ...argumentsList )
8593 // 19.5.6.2 Properties of the NativeError Constructors
8594 // 19.5.6.2.1 NativeError.prototype
8595 // 19.5.6.3 Properties of the NativeError Prototype Objects
8596 // 19.5.6.4 Properties of NativeError Instances
8597
8598 // (No polyfillable changes from ES5)
8599
8600 // ---------------------------------------
8601 // 20 Numbers and Dates
8602 // ---------------------------------------
8603
8604 // ---------------------------------------
8605 // 20.1 Number Objects
8606 // ---------------------------------------
8607
8608 // 20.1.1 The Number Constructor
8609 // 20.1.1.1 Number ( [ value ] )
8610 // 20.1.1.2 new Number ( ...argumentsList )
8611 // 20.1.2 Properties of the Number Constructor
8612
8613 // 20.1.2.1 Number.EPSILON
8614 define(
8615 Number, 'EPSILON',
8616 (function () {
8617 var next, result;
8618 for (next = 1; 1 + next !== 1; next = next / 2)
8619 result = next;
8620 return result;
8621 }()));
8622
8623 // 20.1.2.2 Number.isFinite ( number )
8624 define(
8625 Number, 'isFinite',
8626 function isFinite(number) {
8627 if (Type(number) !== 'number') return false;
8628 if (number !== number || number === +Infinity || number === -Infinity) return false;
8629 return true;
8630 });
8631
8632 // 20.1.2.3 Number.isInteger ( number )
8633 define(
8634 Number, 'isInteger',
8635 function isInteger(number) {
8636 if (Type(number) !== 'number') return false;
8637 if (number !== number || number === +Infinity || number === -Infinity) return false;
8638 var integer = ToInteger(number);
8639 if (integer !== number) return false;
8640 return true;
8641 });
8642
8643 // 20.1.2.4 Number.isNaN ( number )
8644 define(
8645 Number, 'isNaN',
8646 function isNaN(number) {
8647 if (Type(number) !== 'number') return false;
8648 if (number !== number) return true;
8649 return false;
8650 });
8651
8652 // 20.1.2.5 Number.isSafeInteger ( number )
8653 define(
8654 Number, 'isSafeInteger',
8655 function isSafeInteger(number) {
8656 if (Type(number) !== 'number') return false;
8657 if (number !== number || number === +Infinity || number === -Infinity) return false;
8658 var integer = ToInteger(number);
8659 if (integer !== number) return false;
8660 if (abs(integer) <= (0x20000000000000 - 1)) // 2^53-1
8661 return true;
8662 return false;
8663 });
8664
8665 // 20.1.2.6 Number.MAX_SAFE_INTEGER
8666 define(
8667 Number, 'MAX_SAFE_INTEGER',
8668 9007199254740991); // 2^53-1
8669
8670 // 20.1.2.7 Number.MAX_VALUE
8671
8672 // 20.1.2.8 Number.MIN_SAFE_INTEGER
8673 define(
8674 Number, 'MIN_SAFE_INTEGER',
8675 -9007199254740991); // -2^53+1
8676
8677 // 20.1.2.9 Number.MIN_VALUE
8678 // 20.1.2.10 Number.NaN
8679 // 20.1.2.11 Number.NEGATIVE_INFINITY
8680
8681 // 20.1.2.12 Number.parseFloat ( string )
8682 define(Number, 'parseFloat', $parseFloat);
8683
8684 // 20.1.2.13 Number.parseInt ( string, radix )
8685 define(Number, 'parseInt', $parseInt);
8686
8687 // 20.1.2.14 Number.POSITIVE_INFINITY
8688 // 20.1.2.15 Number.prototype
8689
8690 // 20.1.3 Properties of the Number Prototype Object
8691 // 20.1.3.1 Number.prototype.constructor
8692 // 20.1.3.2 Number.prototype.toExponential ( fractionDigits )
8693 // 20.1.3.3 Number.prototype.toFixed ( fractionDigits )
8694 // 20.1.3.4 Number.prototype.toLocaleString( [ reserved1 [ , reserved2 ] ])
8695 // 20.1.3.5 Number.prototype.toPrecision ( precision )
8696 // 20.1.3.6 Number.prototype.toString ( [ radix ] )
8697 // 20.1.3.7 Number.prototype.valueOf ( )
8698 // 20.1.4 Properties of Number Instances
8699
8700 // ---------------------------------------
8701 // 20.2 The Math Object
8702 // ---------------------------------------
8703
8704 // 20.2.1 Value Properties of the Math Object
8705 // 20.2.1.1 Math.E
8706 // 20.2.1.2 Math.LN10
8707 // 20.2.1.3 Math.LN2
8708 // 20.2.1.4 Math.LOG10E
8709 // 20.2.1.5 Math.LOG2E
8710 // 20.2.1.6 Math.PI
8711 // 20.2.1.7 Math.SQRT1_2
8712 // 20.2.1.8 Math.SQRT2
8713
8714 // 20.2.1.9 Math [ @@toStringTag ]
8715 define(Math, $$toStringTag, 'Math');
8716
8717 // 20.2.2 Function Properties of the Math Object
8718 // 20.2.2.1 Math.abs ( x )
8719 // 20.2.2.2 Math.acos ( x )
8720
8721 // 20.2.2.3 Math.acosh(x)
8722 define(
8723 Math, 'acosh',
8724 function acosh(x) {
8725 x = Number(x);
8726 return log(x + sqrt(x * x - 1));
8727 });
8728
8729 // 20.2.2.4 Math.asin ( x )
8730
8731 // 20.2.2.5 Math.asinh( x )
8732 define(
8733 Math, 'asinh',
8734 function asinh(x) {
8735 x = Number(x);
8736 if (SameValue(x, -0)) {
8737 return x;
8738 }
8739 var s = sqrt(x * x + 1);
8740 return (s === -x) ? log(0) : log(x + s);
8741 });
8742
8743 // 20.2.2.6 Math.atan ( x )
8744
8745 // 20.2.2.7 Math.atanh( x )
8746 define(
8747 Math, 'atanh',
8748 function atanh(x) {
8749 x = Number(x);
8750 return (x === 0) ? x : log((1 + x) / (1 - x)) / 2;
8751 });
8752
8753 // 20.2.2.8 Math.atan2 ( y, x )
8754
8755 // 20.2.2.9 Math.cbrt ( x )
8756 define(
8757 Math, 'cbrt',
8758 function cbrt(x) {
8759 x = Number(x);
8760 if ($isNaN(x/x)) {
8761 return x;
8762 }
8763 var r = pow(abs(x), 1/3);
8764 var t = x/r/r;
8765 return r + (r * (t-r) / (2*r + t));
8766 });
8767
8768 // 20.2.2.10 Math.ceil ( x )
8769
8770 // 20.2.2.11 Math.clz32 ( x )
8771 define(
8772 Math, 'clz32',
8773 function clz32(x) {
8774 function clz8(x) {
8775 return (x & 0xf0) ? (x & 0x80 ? 0 : x & 0x40 ? 1 : x & 0x20 ? 2 : 3) :
8776 (x & 0x08 ? 4 : x & 0x04 ? 5 : x & 0x02 ? 6 : x & 0x01 ? 7 : 8);
8777 }
8778 x = ToUint32(x);
8779 return x & 0xff000000 ? clz8(x >> 24) :
8780 x & 0xff0000 ? clz8(x >> 16) + 8 :
8781 x & 0xff00 ? clz8(x >> 8) + 16 : clz8(x) + 24;
8782 });
8783
8784
8785
8786 // 20.2.2.12 Math.cos ( x )
8787
8788 // 20.2.2.13 Math.cosh ( x )
8789 define(
8790 Math, 'cosh',
8791 function cosh(x) {
8792 x = Number(x);
8793 return (pow(E, x) + pow(E, -x)) / 2;
8794 });
8795
8796 // 20.2.2.14 Math.exp ( x )
8797
8798 // 20.2.2.15 Math.expm1 ( x )
8799 define(
8800 Math, 'expm1',
8801 function expm1(x) {
8802 x = Number(x);
8803 // from: http://www.johndcook.com/cpp_log1p.html
8804 if (SameValue(x, -0)) {
8805 return -0;
8806 } else if (abs(x) < 1e-5) {
8807 return x + 0.5 * x * x; // two terms of Taylor expansion
8808 } else {
8809 return exp(x) - 1;
8810 }
8811 });
8812
8813 // 20.2.2.16 Math.floor ( x )
8814
8815 // 20.2.2.17 Math.fround ( x )
8816 define(
8817 Math, 'fround',
8818 function fround(x) {
8819 if ($isNaN(x)) {
8820 return NaN;
8821 }
8822 if (1/x === +Infinity || 1/x === -Infinity || x === +Infinity || x === -Infinity) {
8823 return x;
8824 }
8825 return (new Float32Array([x]))[0];
8826 });
8827
8828 // 20.2.2.18 Math.hypot ( value1 [, value2 [ ... ] ] )
8829 define(
8830 Math, 'hypot',
8831 function hypot() {
8832 var values = [];
8833 var m = 0, sawNaN = false;
8834 for (var i = 0; i < arguments.length; ++i) {
8835 var n = abs(Number(arguments[i]));
8836 if (n === Infinity) return n;
8837 if (n !== n) sawNaN = true;
8838 if (n > m) m = n;
8839 values[i] = n;
8840 }
8841 if (sawNaN) return NaN;
8842 if (m === 0) return +0;
8843 var sum = +0;
8844 for (i = 0; i < values.length; ++i) {
8845 var r = values[i] / m;
8846 sum = sum + r * r;
8847 }
8848 return m * sqrt(sum);
8849 });
8850
8851 // 20.2.2.19 Math.imul ( x, y )
8852 define(
8853 Math, 'imul',
8854 function imul(x, y) {
8855 var a = ToUint32(x);
8856 var b = ToUint32(y);
8857 // (slow but accurate)
8858 var ah = (a >>> 16) & 0xffff;
8859 var al = a & 0xffff;
8860 var bh = (b >>> 16) & 0xffff;
8861 var bl = b & 0xffff;
8862 return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0);
8863 }, ('imul' in Math && Math.imul(1, 0x80000000) === 0) // Safari 7 bug
8864 );
8865
8866 // 20.2.2.20 Math.log ( x )
8867
8868 // 20.2.2.21 Math.log1p ( x )
8869 define(
8870 Math, 'log1p',
8871 function log1p(x) {
8872 x = Number(x);
8873 // from: http://www.johndcook.com/cpp_expm1.html
8874 if (x < -1) {
8875 return NaN;
8876 } else if (SameValue(x, -0)) {
8877 return -0;
8878 } else if (abs(x) > 1e-4) {
8879 return log(1 + x);
8880 } else {
8881 return (-0.5 * x + 1) * x;
8882 }
8883 });
8884
8885 // 20.2.2.22 Math.log10 ( x )
8886 define(
8887 Math, 'log10',
8888 function log10(x) {
8889 x = Number(x);
8890 return log(x) * LOG10E;
8891 });
8892
8893 // 20.2.2.23 Math.log2 ( x )
8894 define(
8895 Math, 'log2',
8896 function log2(x) {
8897 x = Number(x);
8898 return log(x) * LOG2E;
8899 });
8900
8901 // 20.2.2.24 Math.max ( value1, value2 , ...values )
8902 // 20.2.2.25 Math.min ( value1, value2 , ...values )
8903 // 20.2.2.26 Math.pow ( x, y )
8904 // 20.2.2.27 Math.random ( )
8905 // 20.2.2.28 Math.round ( x )
8906
8907 // 20.2.2.29 Math.sign(x)
8908 define(
8909 Math, 'sign',
8910 function sign(x) {
8911 x = Number(x);
8912 return x < 0 ? -1 : x > 0 ? 1 : x;
8913 });
8914
8915 // 20.2.2.30 Math.sin ( x )
8916
8917 // 20.2.2.31 Math.sinh( x )
8918 define(
8919 Math, 'sinh',
8920 function sinh(x) {
8921 x = Number(x);
8922 return SameValue(x, -0) ? x : (pow(E, x) - pow(E, -x)) / 2;
8923 });
8924
8925 // 20.2.2.32 Math.sqrt ( x )
8926 // 20.2.2.33 Math.tan ( x )
8927
8928 // 20.2.2.34 Math.tanh ( x )
8929 define(
8930 Math, 'tanh',
8931 function tanh(x) {
8932 x = Number(x);
8933 var n = pow(E, 2 * x) - 1,
8934 d = pow(E, 2 * x) + 1;
8935 if (SameValue(x, -0))
8936 return x;
8937 return (n === d) ? 1 : n / d; // Handle Infinity/Infinity
8938 });
8939
8940 // 20.2.2.35 Math.trunc ( x )
8941 define(
8942 Math, 'trunc',
8943 function trunc(x) {
8944 x = Number(x);
8945 return $isNaN(x) ? NaN :
8946 x < 0 ? ceil(x) : floor(x);
8947 });
8948
8949 // ---------------------------------------
8950 // 20.3 Date Objects
8951 // ---------------------------------------
8952
8953 // 20.3.1 Overview of Date Objects and Definitions of Abstract Operations
8954 // 20.3.1.1 Time Values and Time Range
8955 // 20.3.1.2 Day Number and Time within Day
8956 // 20.3.1.3 Year Number
8957 // 20.3.1.4 Month Number
8958 // 20.3.1.5 Date Number
8959 // 20.3.1.6 Week Day
8960 // 20.3.1.7 Local Time Zone Adjustment
8961 // 20.3.1.8 Daylight Saving Time Adjustment
8962 // 20.3.1.9 Local Time
8963 // 20.3.1.10 Hours, Minutes, Second, and Milliseconds
8964 // 20.3.1.11 MakeTime (hour, min, sec, ms)
8965 // 20.3.1.12 MakeDay (year, month, date)
8966 // 20.3.1.13 MakeDate (day, time)
8967 // 20.3.1.14 TimeClip (time)
8968 // 20.3.1.15 Date Time String Format
8969 // 20.3.1.15.1 Extended years
8970 // 20.3.2 The Date Constructor
8971 // 20.3.2.1 Date ( year, month [, date [ , hours [ , minutes [ , seconds [ , ms ] ] ] ] ] )
8972 // 20.3.2.2 Date ( value )
8973 // 20.3.2.3 Date ( )
8974 // 20.3.3 Properties of the Date Constructor
8975 // 20.3.3.1 Date.now ( )
8976 // 20.3.3.2 Date.parse (string)
8977 // 20.3.3.3 Date.prototype
8978 // 20.3.3.4 Date.UTC ( year, month [ , date [ , hours [ , minutes [ , seconds [ , ms ] ] ] ] ] )
8979 // 20.3.4 Properties of the Date Prototype Object
8980 // 20.3.4.1 Date.prototype.constructor
8981 // 20.3.4.2 Date.prototype.getDate ( )
8982 // 20.3.4.3 Date.prototype.getDay ( )
8983 // 20.3.4.4 Date.prototype.getFullYear ( )
8984 // 20.3.4.5 Date.prototype.getHours ( )
8985 // 20.3.4.6 Date.prototype.getMilliseconds ( )
8986 // 20.3.4.7 Date.prototype.getMinutes ( )
8987 // 20.3.4.8 Date.prototype.getMonth ( )
8988 // 20.3.4.9 Date.prototype.getSeconds ( )
8989 // 20.3.4.10 Date.prototype.getTime ( )
8990 // 20.3.4.11 Date.prototype.getTimezoneOffset ( )
8991 // 20.3.4.12 Date.prototype.getUTCDate ( )
8992 // 20.3.4.13 Date.prototype.getUTCDay ( )
8993 // 20.3.4.14 Date.prototype.getUTCFullYear ( )
8994 // 20.3.4.15 Date.prototype.getUTCHours ( )
8995 // 20.3.4.16 Date.prototype.getUTCMilliseconds ( )
8996 // 20.3.4.17 Date.prototype.getUTCMinutes ( )
8997 // 20.3.4.18 Date.prototype.getUTCMonth ( )
8998 // 20.3.4.19 Date.prototype.getUTCSeconds ( )
8999 // 20.3.4.20 Date.prototype.setDate ( date )
9000 // 20.3.4.21 Date.prototype.setFullYear ( year [ , month [ , date ] ] )
9001 // 20.3.4.22 Date.prototype.setHours ( hour [ , min [ , sec [ , ms ] ] ] )
9002 // 20.3.4.23 Date.prototype.setMilliseconds ( ms )
9003 // 20.3.4.24 Date.prototype.setMinutes ( min [ , sec [ , ms ] ] )
9004 // 20.3.4.25 Date.prototype.setMonth ( month [ , date ] )
9005 // 20.3.4.26 Date.prototype.setSeconds ( sec [ , ms ] )
9006 // 20.3.4.27 Date.prototype.setTime ( time )
9007 // 20.3.4.28 Date.prototype.setUTCDate ( date )
9008 // 20.3.4.29 Date.prototype.setUTCFullYear ( year [ , month [ , date ] ] )
9009 // 20.3.4.30 Date.prototype.setUTCHours ( hour [ , min [ , sec [ , ms ] ] ] )
9010 // 20.3.4.31 Date.prototype.setUTCMilliseconds ( ms )
9011 // 20.3.4.32 Date.prototype.setUTCMinutes ( min [ , sec [, ms ] ] )
9012 // 20.3.4.33 Date.prototype.setUTCMonth ( month [ , date ] )
9013 // 20.3.4.34 Date.prototype.setUTCSeconds ( sec [ , ms ] )
9014 // 20.3.4.35 Date.prototype.toDateString ( )
9015 // 20.3.4.36 Date.prototype.toISOString ( )
9016 // 20.3.4.37 Date.prototype.toJSON ( key )
9017 // 20.3.4.38 Date.prototype.toLocaleDateString ( [ reserved1 [ , reserved2 ] ] )
9018 // 20.3.4.39 Date.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )
9019 // 20.3.4.40 Date.prototype.toLocaleTimeString ( [ reserved1 [ , reserved2 ] ] )
9020 // 20.3.4.41 Date.prototype.toString ( )
9021 // 20.3.4.42 Date.prototype.toTimeString ( )
9022 // 20.3.4.43 Date.prototype.toUTCString ( )
9023 // 20.3.4.44 Date.prototype.valueOf ( )
9024 // 20.3.4.45 Date.prototype [ @@toPrimitive ] ( hint )
9025 // 20.3.5 Properties of Date Instances
9026
9027 // (No polyfillable changes from ES5)
9028
9029 // ---------------------------------------
9030 // 21 Text Processing
9031 // ---------------------------------------
9032
9033 var string_regexp_dispatch = (function() {
9034 var faux = {}, secret = Symbol();
9035 faux[Symbol.match] = function() { return secret; };
9036 return ("").match(faux) === secret;
9037 }());
9038
9039 // 21.1 String Objects
9040 // 21.1.1 The String Constructor
9041 // 21.1.1.1 String ( value )
9042 // 21.1.2 Properties of the String Constructor
9043 // 21.1.2.1 String.fromCharCode ( ...codeUnits )
9044
9045 // 21.1.2.2 String.fromCodePoint ( ...codePoints )
9046 define(
9047 String, 'fromCodePoint',
9048 function fromCodePoint(/*...codePoints*/) {
9049 var codePoints = arguments,
9050 length = codePoints.length,
9051 elements = [],
9052 nextIndex = 0;
9053 while (nextIndex < length) {
9054 var next = codePoints[nextIndex];
9055 var nextCP = Number(next);
9056 if (!SameValue(nextCP, ToInteger(nextCP)) ||
9057 nextCP < 0 || nextCP > 0x10FFFF) {
9058 throw RangeError('Invalid code point ' + nextCP);
9059 }
9060 if (nextCP < 0x10000) {
9061 elements.push(String.fromCharCode(nextCP));
9062 } else {
9063 nextCP -= 0x10000;
9064 elements.push(String.fromCharCode((nextCP >> 10) + 0xD800));
9065 elements.push(String.fromCharCode((nextCP % 0x400) + 0xDC00));
9066 }
9067 nextIndex += 1;
9068 }
9069 return elements.join('');
9070 });
9071
9072 // 21.1.2.3 String.prototype
9073
9074 // 21.1.2.4 String.raw ( template , ...substitutions )
9075 define(
9076 String, 'raw',
9077 function raw(template /*, ...substitutions*/) {
9078 var substitutions = [].slice.call(arguments, 1);
9079
9080 var cooked = Object(template);
9081 var rawValue = cooked['raw'];
9082 var raw = Object(rawValue);
9083 var len = raw['length'];
9084 var literalSegments = ToLength(len);
9085 if (literalSegments <= 0) return '';
9086 var stringElements = [];
9087 var nextIndex = 0;
9088 while (true) {
9089 var next = raw[nextIndex];
9090 var nextSeg = String(next);
9091 stringElements.push(nextSeg);
9092 if (nextIndex + 1 === literalSegments)
9093 return stringElements.join('');
9094 next = substitutions[nextIndex];
9095 var nextSub = String(next);
9096 stringElements.push(nextSub);
9097 nextIndex = nextIndex + 1;
9098 }
9099 });
9100
9101 // See https://githib.com/inexorabletash/uate for a more useful version.
9102
9103 // 21.1.3 Properties of the String Prototype Object
9104 // 21.1.3.1 String.prototype.charAt ( pos )
9105 // 21.1.3.2 String.prototype.charCodeAt ( pos )
9106
9107 // 21.1.3.3 String.prototype.codePointAt ( pos )
9108 define(
9109 String.prototype, 'codePointAt',
9110 function codePointAt(pos) {
9111 var o = strict(this);
9112 var s = String(o);
9113 var position = ToInteger(pos);
9114 var size = s.length;
9115 if (position < 0 || position >= size) return undefined;
9116 var first = s.charCodeAt(position);
9117 if (first < 0xD800 || first > 0xDBFF || position + 1 === size) return first;
9118 var second = s.charCodeAt(position + 1);
9119 if (second < 0xDC00 || second > 0xDFFF) return first;
9120 return ((first - 0xD800) * 1024) + (second - 0xDC00) + 0x10000;
9121 });
9122
9123 // 21.1.3.4 String.prototype.concat ( ...args )
9124 // 21.1.3.5 String.prototype.constructor
9125
9126 // 21.1.3.6 String.prototype.endsWith ( searchString [ , endPosition] )
9127 define(
9128 String.prototype, 'endsWith',
9129 function endsWith(searchString) {
9130 var endPosition = arguments[1];
9131
9132 var o = strict(this);
9133 var s = String(o);
9134 var searchStr = String(searchString);
9135 var len = s.length;
9136 var pos = (endPosition === undefined) ? len : ToInteger(endPosition);
9137 var end = min(max(pos, 0), len);
9138 var searchLength = searchStr.length;
9139 var start = end - searchLength;
9140 if (start < 0) return false;
9141 if (s.substring(start, start + searchLength) === searchStr) return true;
9142 return false;
9143 });
9144
9145 // 21.1.3.7 String.prototype.includes ( searchString [ , position ] )
9146 define(
9147 String.prototype, 'includes',
9148 function includes(searchString) {
9149 var position = arguments[1];
9150
9151 var o = strict(this);
9152 var s = String(o);
9153 var searchStr = String(searchString);
9154 var pos = ToInteger(position);
9155 var len = s.length;
9156 var start = min(max(pos, 0), len);
9157 return s.indexOf(searchStr, start) !== -1;
9158 });
9159
9160 // 21.1.3.8 String.prototype.indexOf ( searchString [ , position ] )
9161 // 21.1.3.9 String.prototype.lastIndexOf ( searchString [ , position ] )
9162 // 21.1.3.10 String.prototype.localeCompare ( that [, reserved1 [ , reserved2 ] ] )
9163 // 21.1.3.11 String.prototype.match ( regexp )
9164 define(
9165 String.prototype, 'match',
9166 function match(regexp) {
9167 var o = strict(this);
9168 var s = String(o);
9169 if (HasProperty(regexp, $$match)) var rx = regexp;
9170 else rx = new RegExp(regexp);
9171 return rx[$$match](s);
9172 }, !string_regexp_dispatch);
9173
9174 // 21.1.3.12 String.prototype.normalize ( [ form ] )
9175
9176 // Not practical due to table sizes; if needed, pull in:
9177 // https://github.com/walling/unorm/
9178
9179 // 21.1.3.13 String.prototype.repeat ( count )
9180 define(
9181 String.prototype, 'repeat',
9182 function repeat(count) {
9183 var o = strict(this);
9184 var s = String(o);
9185 var n = ToInteger(count);
9186 if (n < 0) throw RangeError();
9187 if (n === Infinity) throw RangeError();
9188 var t = new Array(n + 1).join(s);
9189 return t;
9190 });
9191
9192 // 21.1.3.14 String.prototype.replace (searchValue, replaceValue )
9193 define(
9194 String.prototype, 'replace',
9195 function replace(searchValue, replaceValue) {
9196 var o = strict(this);
9197 if (HasProperty(searchValue, $$replace))
9198 return searchValue[$$replace](o, replaceValue);
9199 return orig_replace.call(o, searchValue, replaceValue);
9200 }, !string_regexp_dispatch);
9201
9202 // 21.1.3.15 String.prototype.search ( regexp )
9203 define(
9204 String.prototype, 'search',
9205 function search(regexp) {
9206 var o = strict(this);
9207 var string = String(o);
9208 if (HasProperty(regexp, $$search)) var rx = regexp;
9209 else rx = new RegExp(regexp);
9210 return rx[$$search](string);
9211 }, !string_regexp_dispatch);
9212
9213 // 21.1.3.16 String.prototype.slice ( start, end )
9214 // 21.1.3.17 String.prototype.split ( separator, limit )
9215 define(
9216 String.prototype, 'split',
9217 function split(separator, limit) {
9218 var o = strict(this);
9219 if (HasProperty(separator, $$split))
9220 return separator[$$split](o, limit);
9221 return orig_split.call(o, separator, limit);
9222 }, !string_regexp_dispatch);
9223
9224 // 21.1.3.18 String.prototype.startsWith ( searchString [, position ] )
9225 define(
9226 String.prototype, 'startsWith',
9227 function startsWith(searchString) {
9228 var position = arguments[1];
9229
9230 var o = strict(this);
9231 var s = String(o);
9232 var searchStr = String(searchString);
9233 var pos = ToInteger(position);
9234 var len = s.length;
9235 var start = min(max(pos, 0), len);
9236 var searchLength = searchStr.length;
9237 if (searchLength + start > len) return false;
9238 if (s.substring(start, start + searchLength) === searchStr) return true;
9239 return false;
9240 });
9241
9242 // 21.1.3.19 String.prototype.substring ( start, end )
9243 // 21.1.3.20 String.prototype.toLocaleLowerCase ( [ reserved1 [ , reserved2 ] ] )
9244 // 21.1.3.21 String.prototype.toLocaleUpperCase ([ reserved1 [ , reserved2 ] ] )
9245 // 21.1.3.22 String.prototype.toLowerCase ( )
9246 // 21.1.3.23 String.prototype.toString ( )
9247 // 21.1.3.24 String.prototype.toUpperCase ( )
9248 // 21.1.3.25 String.prototype.trim ( )
9249 // 21.1.3.26 String.prototype.valueOf ( )
9250
9251 // 21.1.3.27 String.prototype [ @@iterator ]( )
9252 define(
9253 String.prototype, $$iterator,
9254 function entries() {
9255 return CreateStringIterator(this, 'value');
9256 });
9257
9258 // 21.1.4 Properties of String Instances
9259 // 21.1.4.1 length
9260
9261 // 21.1.5 String Iterator Objects
9262 /** @constructor */
9263 function StringIterator() {}
9264
9265 // 21.1.5.1 CreateStringIterator Abstract Operation
9266 function CreateStringIterator(string, kind) {
9267 var s = String(string);
9268 var iterator = new StringIterator;
9269 set_internal(iterator, '[[IteratedString]]', s);
9270 set_internal(iterator, '[[StringIteratorNextIndex]]', 0);
9271 set_internal(iterator, '[[StringIterationKind]]', kind);
9272 return iterator;
9273 }
9274
9275 // 21.1.5.2 The %StringIteratorPrototype% Object
9276 var $StringIteratorPrototype$ = Object.create($IteratorPrototype$);
9277 StringIterator.prototype = $StringIteratorPrototype$;
9278
9279 // 21.1.5.2.1 %StringIteratorPrototype%.next ( )
9280 define(
9281 $StringIteratorPrototype$, 'next',
9282 function next() {
9283 var o = ToObject(this);
9284 var s = String(o['[[IteratedString]]']),
9285 index = o['[[StringIteratorNextIndex]]'],
9286 len = s.length;
9287 if (index >= len) {
9288 set_internal(o, '[[StringIteratorNextIndex]]', Infinity);
9289 return CreateIterResultObject(undefined, true);
9290 }
9291 var cp = s.codePointAt(index);
9292 set_internal(o, '[[StringIteratorNextIndex]]', index + (cp > 0xFFFF ? 2 : 1));
9293 return CreateIterResultObject(String.fromCodePoint(cp), false);
9294 });
9295
9296 // 21.1.5.2.2 %StringIteratorPrototype% [ @@toStringTag ]
9297 define($StringIteratorPrototype$, $$toStringTag, 'String Iterator');
9298
9299 // 21.1.5.3 Properties of String Iterator Instances
9300
9301 // ---------------------------------------
9302 // 21.2 RegExp (Regular Expression) Objects
9303 // ---------------------------------------
9304
9305 // 21.2.1 Patterns
9306 // 21.2.2 Pattern Semantics
9307 // 21.2.2.1 Notation
9308 // 21.2.2.2 Pattern
9309 // 21.2.2.3 Disjunction
9310 // 21.2.2.4 Alternative
9311 // 21.2.2.5 Term
9312 // 21.2.2.6 Assertion
9313 // 21.2.2.7 Quantifier
9314 // 21.2.2.8 Atom
9315 // 21.2.2.9 AtomEscape
9316 // 21.2.2.10 CharacterEscape
9317 // 21.2.2.11 DecimalEscape
9318 // 21.2.2.12 CharacterClassEscape
9319 // 21.2.2.13 CharacterClass
9320 // 21.2.2.14 ClassRanges
9321 // 21.2.2.15 NonemptyClassRanges
9322 // 21.2.2.16 NonemptyClassRangesNoDash
9323 // 21.2.2.17 ClassAtom
9324 // 21.2.2.18 ClassAtomNoDash
9325 // 21.2.2.19 ClassEscape
9326 // 21.2.3 The RegExp Constructor
9327 // 21.2.3.1 RegExp ( pattern, flags )
9328 // 21.2.3.2 new RegExp( ...argumentsList )
9329 // 21.2.3.3 Abstract Operations for the RegExp Constructor
9330 // 21.2.4 Properties of the RegExp Constructor
9331 // 21.2.4.1 RegExp.prototype
9332 // 21.2.5 Properties of the RegExp Prototype Object
9333 // 21.2.5.1 RegExp.prototype.constructor
9334 // 21.2.5.2 RegExp.prototype.exec ( string )
9335
9336 // 21.2.5.3 get RegExp.prototype.flags
9337 if (!('flags' in RegExp.prototype)) {
9338 Object.defineProperty(
9339 RegExp.prototype, 'flags', {
9340 get: function() {
9341 var s = String(this);
9342 return s.substring(s.lastIndexOf('/') + 1);
9343 }
9344 });
9345 }
9346
9347 // 21.2.5.4 get RegExp.prototype.global
9348 // 21.2.5.5 get RegExp.prototype.ignoreCase
9349
9350 // 21.2.5.6 RegExp.prototype [ @@match ] ( string )
9351 define(RegExp.prototype, $$match, function(string) {
9352 var o = strict(this);
9353 return orig_match.call(string, o);
9354 });
9355
9356 // 21.2.5.7 get RegExp.prototype.multiline
9357
9358 // 21.2.5.8 RegExp.prototype [ @@replace ] ( string, replaceValue )
9359 define(RegExp.prototype, $$replace, function(string, replaceValue) {
9360 var o = strict(this);
9361 return orig_replace.call(string, o, replaceValue);
9362 });
9363
9364 // 21.2.5.9 RegExp.prototype [ @@search ] ( string )
9365 define(RegExp.prototype, $$search, function(string) {
9366 var o = strict(this);
9367 return orig_search.call(string, o);
9368 });
9369
9370 // 21.2.5.10 get RegExp.prototype.source
9371
9372 // 21.2.5.11 RegExp.prototype [ @@split ] ( string, limit )
9373 define(RegExp.prototype, $$split, function(string, limit) {
9374 var o = strict(this);
9375 return orig_split.call(string, o, limit);
9376 });
9377
9378 // 21.2.5.12 get RegExp.prototype.sticky
9379 // 21.2.5.13 RegExp.prototype.test( S )
9380 // 21.2.5.14 RegExp.prototype.toString ( )
9381 // 21.2.5.15 get RegExp.prototype.unicode
9382
9383 // 21.2.6 Properties of RegExp Instances
9384 // 21.2.6.1 lastIndex
9385
9386 // (No polyfillable changes from ES5)
9387
9388 // ---------------------------------------
9389 // 22 Indexed Collections
9390 // ---------------------------------------
9391
9392 // ---------------------------------------
9393 // 22.1 Array Objects
9394 // ---------------------------------------
9395
9396 // 22.1.1 The Array Constructor
9397 // 22.1.1.1 Array ( )
9398 // 22.1.1.2 Array (len)
9399 // 22.1.1.3 Array (...items )
9400
9401 // 22.1.2 Properties of the Array Constructor
9402
9403 // 22.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] )
9404 define(
9405 Array, 'from',
9406 function from(items) {
9407 var mapfn = arguments[1];
9408 var thisArg = arguments[2];
9409
9410 var c = strict(this);
9411 if (mapfn === undefined) {
9412 var mapping = false;
9413 } else {
9414 if (!IsCallable(mapfn)) throw TypeError();
9415 var t = thisArg;
9416 mapping = true;
9417 }
9418 var usingIterator = GetMethod(items, $$iterator);
9419 if (usingIterator !== undefined) {
9420 if (IsConstructor(c)) {
9421 var a = new c();
9422 } else {
9423 a = new Array(0);
9424 }
9425 var iterator = GetIterator(items, usingIterator);
9426 var k = 0;
9427 while (true) {
9428 var next = IteratorStep(iterator);
9429 if (next === false) {
9430 a.length = k;
9431 return a;
9432 }
9433 var nextValue = IteratorValue(next);
9434 if (mapping)
9435 var mappedValue = mapfn.call(t, nextValue);
9436 else
9437 mappedValue = nextValue;
9438 a[k] = mappedValue;
9439 k += 1;
9440 }
9441 }
9442 var arrayLike = ToObject(items);
9443 var lenValue = arrayLike.length;
9444 var len = ToLength(lenValue);
9445 if (IsConstructor(c)) {
9446 a = new c(len);
9447 } else {
9448 a = new Array(len);
9449 }
9450 k = 0;
9451 while (k < len) {
9452 var kValue = arrayLike[k];
9453 if (mapping)
9454 mappedValue = mapfn.call(t, kValue, k);
9455 else
9456 mappedValue = kValue;
9457 a[k] = mappedValue;
9458 k += 1;
9459 }
9460 a.length = len;
9461 return a;
9462 });
9463
9464 // 22.1.2.2 Array.isArray ( arg )
9465
9466 // 22.1.2.3 Array.of ( ...items )
9467 define(
9468 Array, 'of',
9469 function of() {
9470 var items = arguments;
9471
9472 var lenValue = items.length;
9473 var len = ToUint32(lenValue);
9474 var c = strict(this), a;
9475 if (IsConstructor(c)) {
9476 a = new c(len);
9477 a = ToObject(a);
9478 } else {
9479 a = new Array(len);
9480 }
9481 var k = 0;
9482 while (k < len) {
9483 a[k] = items[k];
9484 k += 1;
9485 }
9486 a.length = len;
9487 return a;
9488 });
9489
9490 // 22.1.2.4 Array.prototype
9491 // 22.1.2.5 get Array [ @@species ]
9492 // 22.1.3 Properties of the Array Prototype Object
9493 // 22.1.3.1 Array.prototype.concat ( ...arguments )
9494 // 22.1.3.1.1 Runtime Semantics: IsConcatSpreadable ( O )
9495 // 22.1.3.2 Array.prototype.constructor
9496 // 22.1.3.3 Array.prototype.copyWithin (target, start [ , end ] )
9497 define(
9498 Array.prototype, 'copyWithin',
9499 function copyWithin(target, start/*, end*/) {
9500 var end = arguments[2];
9501
9502 var o = ToObject(this);
9503 var lenVal = o.length;
9504 var len = ToLength(lenVal);
9505 len = max(len, 0);
9506 var relativeTarget = ToInteger(target);
9507 var to;
9508 if (relativeTarget < 0)
9509 to = max(len + relativeTarget, 0);
9510 else
9511 to = min(relativeTarget, len);
9512 var relativeStart = ToInteger(start);
9513 var from;
9514 if (relativeStart < 0)
9515 from = max(len + relativeStart, 0);
9516 else
9517 from = min(relativeStart, len);
9518 var relativeEnd;
9519 if (end === undefined)
9520 relativeEnd = len;
9521 else
9522 relativeEnd = ToInteger(end);
9523 var final;
9524 if (relativeEnd < 0)
9525 final = max(len + relativeEnd, 0);
9526 else
9527 final = min(relativeEnd, len);
9528 var count = min(final - from, len - to);
9529 var direction;
9530 if (from < to && to < from + count) {
9531 direction = -1;
9532 from = from + count - 1;
9533 to = to + count - 1;
9534 } else {
9535 direction = 1;
9536 }
9537 while (count > 0) {
9538 var fromKey = String(from);
9539 var toKey = String(to);
9540 var fromPresent = HasProperty(o, fromKey);
9541 if (fromPresent) {
9542 var fromVal = o[fromKey];
9543 o[toKey] = fromVal;
9544 } else {
9545 delete o[toKey];
9546 }
9547 from = from + direction;
9548 to = to + direction;
9549 count = count - 1;
9550 }
9551 return o;
9552 });
9553
9554 // 22.1.3.4 Array.prototype.entries ( )
9555 var nativeArrayIteratorMethods =
9556 ('entries' in Array.prototype && 'next' in [].entries());
9557
9558 define(
9559 Array.prototype, 'entries',
9560 function entries() {
9561 return CreateArrayIterator(this, 'key+value');
9562 }, !nativeArrayIteratorMethods);
9563
9564 // 22.1.3.5 Array.prototype.every ( callbackfn [ , thisArg] )
9565
9566 // 22.1.3.6 Array.prototype.fill (value [ , start [ , end ] ] )
9567 define(
9568 Array.prototype, 'fill',
9569 function fill(value/*, start, end*/) {
9570 var start = arguments[1],
9571 end = arguments[2];
9572
9573 var o = ToObject(this);
9574 var lenVal = o.length;
9575 var len = ToLength(lenVal);
9576 len = max(len, 0);
9577 var relativeStart = ToInteger(start);
9578 var k;
9579 if (relativeStart < 0)
9580 k = max((len + relativeStart), 0);
9581 else
9582 k = min(relativeStart, len);
9583 var relativeEnd;
9584 if (end === undefined)
9585 relativeEnd = len;
9586 else
9587 relativeEnd = ToInteger(end);
9588 var final;
9589 if (relativeEnd < 0)
9590 final = max((len + relativeEnd), 0);
9591 else
9592 final = min(relativeEnd, len);
9593 while (k < final) {
9594 var pk = String(k);
9595 o[pk] = value;
9596 k += 1;
9597 }
9598 return o;
9599 });
9600
9601 // 22.1.3.7 Array.prototype.filter ( callbackfn [ , thisArg ] )
9602
9603 // 22.1.3.8 Array.prototype.find ( predicate [ , thisArg ] )
9604 define(
9605 Array.prototype, 'find',
9606 function find(predicate) {
9607 var o = ToObject(this);
9608 var lenValue = o.length;
9609 var len = ToInteger(lenValue);
9610 if (!IsCallable(predicate)) throw TypeError();
9611 var t = arguments.length > 1 ? arguments[1] : undefined;
9612 var k = 0;
9613 while (k < len) {
9614 var pk = String(k);
9615 var kPresent = HasProperty(o, pk);
9616 if (kPresent) {
9617 var kValue = o[pk];
9618 var testResult = predicate.call(t, kValue, k, o);
9619 if (Boolean(testResult)) {
9620 return kValue;
9621 }
9622 }
9623 ++k;
9624 }
9625 return undefined;
9626 });
9627
9628 // 22.1.3.9 Array.prototype.findIndex ( predicate [ , thisArg ] )
9629 define(
9630 Array.prototype, 'findIndex',
9631 function findIndex(predicate) {
9632 var o = ToObject(this);
9633 var lenValue = o.length;
9634 var len = ToLength(lenValue);
9635 if (!IsCallable(predicate)) throw TypeError();
9636 var t = arguments.length > 1 ? arguments[1] : undefined;
9637 var k = 0;
9638 while (k < len) {
9639 var pk = String(k);
9640 var kPresent = HasProperty(o, pk);
9641 if (kPresent) {
9642 var kValue = o[pk];
9643 var testResult = predicate.call(t, kValue, k, o);
9644 if (Boolean(testResult)) {
9645 return k;
9646 }
9647 }
9648 ++k;
9649 }
9650 return -1;
9651 });
9652
9653 // 22.1.3.10 Array.prototype.forEach ( callbackfn [ , thisArg ] )
9654 // 22.1.3.11 Array.prototype.indexOf ( searchElement [ , fromIndex ] )
9655 // 22.1.3.12 Array.prototype.join (separator)
9656
9657 // 22.1.3.13 Array.prototype.keys ( )
9658 define(
9659 Array.prototype, 'keys',
9660 function keys() {
9661 return CreateArrayIterator(this, 'key');
9662 }, !nativeArrayIteratorMethods);
9663
9664 // 22.1.3.14 Array.prototype.lastIndexOf ( searchElement [ , fromIndex ] )
9665 // 22.1.3.15 Array.prototype.map ( callbackfn [ , thisArg ] )
9666 // 22.1.3.16 Array.prototype.pop ( )
9667 // 22.1.3.17 Array.prototype.push ( ...items )
9668 // 22.1.3.18 Array.prototype.reduce ( callbackfn [ , initialValue ] )
9669 // 22.1.3.19 Array.prototype.reduceRight ( callbackfn [ , initialValue ] )
9670 // 22.1.3.20 Array.prototype.reverse ( )
9671 // 22.1.3.21 Array.prototype.shift ( )
9672 // 22.1.3.22 Array.prototype.slice (start, end)
9673 // 22.1.3.23 Array.prototype.some ( callbackfn [ , thisArg ] )
9674 // 22.1.3.24 Array.prototype.sort (comparefn)
9675 // 22.1.3.25 Array.prototype.splice (start, deleteCount , ...items )
9676 // 22.1.3.26 Array.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )
9677 // 22.1.3.27 Array.prototype.toString ( )
9678 // 22.1.3.28 Array.prototype.unshift ( ...items )
9679
9680 // 22.1.3.29 Array.prototype.values ( )
9681 define(
9682 Array.prototype, 'values',
9683 function values() {
9684 return CreateArrayIterator(this, 'value');
9685 }, !nativeArrayIteratorMethods);
9686
9687 // 22.1.3.30 Array.prototype [ @@iterator ] ( )
9688 define(
9689 Array.prototype, $$iterator,
9690 Array.prototype.values
9691 );
9692
9693 // 22.1.3.31 Array.prototype [ @@unscopables ]
9694 // 22.1.4 Properties of Array Instances
9695 // 22.1.4.1 length
9696
9697 // 22.1.5 Array Iterator Objects
9698 function ArrayIterator() {}
9699
9700 // 22.1.5.1 CreateArrayIterator Abstract Operation
9701 function CreateArrayIterator(array, kind) {
9702 var o = ToObject(array);
9703 var iterator = new ArrayIterator;
9704 set_internal(iterator, '[[IteratedObject]]', o);
9705 set_internal(iterator, '[[ArrayIteratorNextIndex]]', 0);
9706 set_internal(iterator, '[[ArrayIterationKind]]', kind);
9707 return iterator;
9708 }
9709
9710 // 22.1.5.2 The %ArrayIteratorPrototype% Object
9711 var $ArrayIteratorPrototype$ = Object.create($IteratorPrototype$);
9712 ArrayIterator.prototype = $ArrayIteratorPrototype$;
9713
9714 // 22.1.5.2.1 %ArrayIteratorPrototype%. next( )
9715 define(
9716 $ArrayIteratorPrototype$, 'next',
9717 function next() {
9718 var o = strict(this);
9719 if (Type(o) !== 'object') throw TypeError();
9720 var a = o['[[IteratedObject]]'],
9721 index = o['[[ArrayIteratorNextIndex]]'],
9722 itemKind = o['[[ArrayIterationKind]]'],
9723 lenValue = a.length,
9724 len = ToUint32(lenValue),
9725 elementKey,
9726 elementValue;
9727 if (itemKind.indexOf('sparse') !== -1) {
9728 var found = false;
9729 while (!found && index < len) {
9730 elementKey = String(index);
9731 found = HasProperty(a, elementKey);
9732 if (!found) {
9733 index += 1;
9734 }
9735 }
9736 }
9737 if (index >= len) {
9738 set_internal(o, '[[ArrayIteratorNextIndex]]', Infinity);
9739 return CreateIterResultObject(undefined, true);
9740 }
9741 elementKey = index;
9742 set_internal(o, '[[ArrayIteratorNextIndex]]', index + 1);
9743 if (itemKind.indexOf('value') !== -1)
9744 elementValue = a[elementKey];
9745 if (itemKind.indexOf('key+value') !== -1)
9746 return CreateIterResultObject([elementKey, elementValue], false);
9747 if (itemKind.indexOf('key') !== -1)
9748 return CreateIterResultObject(elementKey, false);
9749 if (itemKind === 'value')
9750 return CreateIterResultObject(elementValue, false);
9751 throw Error('Internal error');
9752 });
9753
9754 // 22.1.5.2.2 %ArrayIteratorPrototype% [ @@toStringTag ]
9755 define($ArrayIteratorPrototype$, $$toStringTag, 'Array Iterator');
9756
9757 // 22.1.5.3 Properties of Array Iterator Instances
9758
9759
9760 // ---------------------------------------
9761 // 22.2 TypedArray Objects
9762 // ---------------------------------------
9763
9764 // See typedarray.js for TypedArray polyfill
9765
9766 ['Int8Array', 'Uint8Array', 'Uint8ClampedArray',
9767 'Int16Array', 'Uint16Array',
9768 'Int32Array', 'Uint32Array',
9769 'Float32Array', 'Float64Array'].forEach(function ($TypedArrayName$) {
9770 if (!($TypedArrayName$ in global))
9771 return;
9772 var $TypedArray$ = global[$TypedArrayName$];
9773
9774 // 22.2.1 The %TypedArray% Intrinsic Object
9775 // 22.2.1.1 %TypedArray% ( length )
9776 // 22.2.1.2 %TypedArray% ( typedArray )
9777 // 22.2.1.3 %TypedArray% ( object )
9778 // 22.2.1.4 %TypedArray% ( buffer [ , byteOffset [ , length ] ] )
9779 // 22.2.1.5 %TypedArray% ( all other argument combinations )
9780 // 22.2.2 Properties of the %TypedArray% Intrinsic Object
9781
9782 // 22.2.2.1 %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] )
9783 define(
9784 $TypedArray$, 'from',
9785 function from(source) {
9786 var mapfn = arguments[1];
9787 var thisArg = arguments[2];
9788
9789 var c = strict(this);
9790 if (!IsConstructor(c)) throw TypeError();
9791 if (mapfn === undefined) {
9792 var mapping = false;
9793 } else {
9794 if (IsCallable(mapfn)) throw TypeError();
9795 var t = thisArg;
9796 mapping = true;
9797 }
9798 var usingIterator = GetMethod(source, $$iterator);
9799 if (usingIterator !== undefined) {
9800 var iterator = GetIterator(source, usingIterator);
9801 var values = [];
9802 var next = true;
9803 while (next !== false) {
9804 next = IteratorStep(iterator);
9805 if (next !== false) {
9806 var nextValue = IteratorValue(next);
9807 values.push(nextValue);
9808 }
9809 }
9810 var len = values.length;
9811 var newObj = new c(len);
9812 var k = 0;
9813 while (k < len) {
9814 var kValue = values.shift();
9815 if (mapping) {
9816 var mappedValue = mapfn.call(t, kValue);
9817 } else {
9818 mappedValue = kValue;
9819 }
9820 newObj[k] = mappedValue;
9821 ++k;
9822 }
9823 console.assert(values.length === 0);
9824 return newObj;
9825 }
9826 var arrayLike = ToObject(source);
9827 var lenValue = arrayLike.length;
9828 len = ToLength(lenValue);
9829 newObj = new c(len);
9830 k = 0;
9831 while (k < len) {
9832 kValue = arrayLike[k];
9833 if (mapping) {
9834 mappedValue = mapfn.call(t, kValue, k);
9835 } else {
9836 mappedValue = kValue;
9837 }
9838 newObj[k] = mappedValue;
9839 ++k;
9840 }
9841 return newObj;
9842 });
9843
9844 // 22.2.2.2 %TypedArray%.of ( ...items )
9845 define(
9846 $TypedArray$, 'of',
9847 function of() {
9848 var items = arguments;
9849
9850 var len = items.length;
9851 var c = strict(this);
9852 var newObj = new c(len);
9853 var k = 0;
9854 while (k < len) {
9855 newObj[k] = items[k];
9856 ++k;
9857 }
9858 return newObj;
9859 });
9860
9861 // 22.2.2.3 %TypedArray%.prototype
9862 // 22.2.2.4 get %TypedArray% [ @@species ]
9863 // 22.2.3 Properties of the %TypedArrayPrototype% Object
9864 // 22.2.3.1 get %TypedArray%.prototype.buffer
9865 // 22.2.3.2 get %TypedArray%.prototype.byteLength
9866 // 22.2.3.3 get %TypedArray%.prototype.byteOffset
9867 // 22.2.3.4 %TypedArray%.prototype.constructor
9868
9869 // 22.2.3.5 %TypedArray%.prototype.copyWithin (target, start [, end ] )
9870 define($TypedArray$.prototype, 'copyWithin', Array.prototype.copyWithin);
9871
9872 // 22.2.3.6 %TypedArray%.prototype.entries ( )
9873 define($TypedArray$.prototype, 'entries', Array.prototype.entries);
9874
9875 // 22.2.3.7 %TypedArray%.prototype.every ( callbackfn [ , thisArg ] )
9876 define($TypedArray$.prototype, 'every', Array.prototype.every);
9877
9878 // 22.2.3.8 %TypedArray%.prototype.fill (value [ , start [ , end ] ] )
9879 define(
9880 $TypedArray$.prototype, 'fill',
9881 //Array.prototype.fill // Doesn't work in Safari 7
9882 function fill(value/*, start, end*/) {
9883 var start = arguments[1],
9884 end = arguments[2];
9885
9886 var o = ToObject(this);
9887 var lenVal = o.length;
9888 var len = ToLength(lenVal);
9889 len = max(len, 0);
9890 var relativeStart = ToInteger(start);
9891 var k;
9892 if (relativeStart < 0) k = max((len + relativeStart), 0);
9893 else k = min(relativeStart, len);
9894 var relativeEnd;
9895 if (end === undefined) relativeEnd = len;
9896 else relativeEnd = ToInteger(end);
9897 var final;
9898 if (relativeEnd < 0) final = max((len + relativeEnd), 0);
9899 else final = min(relativeEnd, len);
9900 while (k < final) {
9901 var pk = String(k);
9902 o[pk] = value;
9903 k += 1;
9904 }
9905 return o;
9906 });
9907
9908 // 22.2.3.9 %TypedArray%.prototype.filter ( callbackfn [ , thisArg ] )
9909 define(
9910 $TypedArray$.prototype, 'filter',
9911 function filter(callbackfn) {
9912 var thisArg = arguments[1];
9913
9914 var o = ToObject(this);
9915 var lenVal = o.length;
9916 var len = ToLength(lenVal);
9917 if (!IsCallable(callbackfn)) throw TypeError();
9918 var t = thisArg;
9919 var c = o.constructor;
9920 var kept = [];
9921 var k = 0;
9922 var captured = 0;
9923 while (k < len) {
9924 var kValue = o[k];
9925 var selected = callbackfn.call(t, kValue, k, o);
9926 if (selected) {
9927 kept.push(kValue);
9928 ++captured;
9929 }
9930 ++k;
9931 }
9932 var a = new c(captured);
9933 var n = 0;
9934 for (var i = 0; i < kept.length; ++i) {
9935 var e = kept[i];
9936 a[n] = e;
9937 ++n;
9938 }
9939 return a;
9940 });
9941
9942 // 22.2.3.10 %TypedArray%.prototype.find (predicate [ , thisArg ] )
9943 define($TypedArray$.prototype, 'find', Array.prototype.find);
9944
9945 // 22.2.3.11 %TypedArray%.prototype.findIndex ( predicate [ , thisArg ] )
9946 define($TypedArray$.prototype, 'findIndex', Array.prototype.findIndex);
9947
9948 // 22.2.3.12 %TypedArray%.prototype.forEach ( callbackfn [ , thisArg ] )
9949 define($TypedArray$.prototype, 'forEach', Array.prototype.forEach);
9950
9951 // 22.2.3.13 %TypedArray%.prototype.indexOf (searchElement [ , fromIndex ] )
9952 define($TypedArray$.prototype, 'indexOf', Array.prototype.indexOf);
9953
9954 // 22.2.3.14 %TypedArray%.prototype.join ( separator )
9955 define($TypedArray$.prototype, 'join', Array.prototype.join);
9956
9957 // 22.2.3.15 %TypedArray%.prototype.keys ( )
9958 define($TypedArray$.prototype, 'keys', Array.prototype.keys);
9959
9960 // 22.2.3.16 %TypedArray%.prototype.lastIndexOf ( searchElement [ , fromIndex ] )
9961 define($TypedArray$.prototype, 'lastIndexOf', Array.prototype.lastIndexOf);
9962
9963 // 22.2.3.17 get %TypedArray%.prototype.length
9964
9965 // 22.2.3.18 %TypedArray%.prototype.map ( callbackfn [ , thisArg ] )
9966 define(
9967 $TypedArray$.prototype, 'map',
9968 function map(callbackfn) {
9969 var thisArg = arguments[1];
9970
9971 var o = ToObject(this);
9972 var lenValue = o.length;
9973 var len = ToLength(lenValue);
9974 if (!IsCallable(callbackfn)) throw TypeError();
9975 var t = thisArg;
9976 var a = undefined;
9977 var c = o.constructor;
9978 if (IsConstructor(c))
9979 a = new c(len);
9980 if (a === undefined)
9981 a = new Array(len);
9982 var k = 0;
9983 while (k < len) {
9984 var kPresent = HasProperty(o, k);
9985 if (kPresent) {
9986 var kValue = o[k];
9987 var mappedValue = callbackfn.call(t, kValue, k, o);
9988 a[k] = mappedValue;
9989 }
9990 ++k;
9991 }
9992 return a;
9993 });
9994
9995 // 22.2.3.19 %TypedArray%.prototype.reduce ( callbackfn [, initialValue] )
9996 define($TypedArray$.prototype, 'reduce', Array.prototype.reduce);
9997
9998 // 22.2.3.20 %TypedArray%.prototype.reduceRight ( callbackfn [, initialValue] )
9999 define($TypedArray$.prototype, 'reduceRight', Array.prototype.reduceRight);
10000
10001 // 22.2.3.21 %TypedArray%.prototype.reverse ( )
10002 define($TypedArray$.prototype, 'reverse', Array.prototype.reverse);
10003
10004 // 22.2.3.22 %TypedArray%.prototype.set ( overloaded [ , offset ])
10005 // 22.2.3.22.1 %TypedArray%.prototype.set (array [ , offset ] )
10006 // 22.2.3.22.2 %TypedArray%.prototype.set(typedArray [, offset ] )
10007
10008 // 22.2.3.23 %TypedArray%.prototype.slice ( start, end )
10009 define(
10010 $TypedArray$.prototype, 'slice',
10011 function slice(start, end) {
10012 var o = ToObject(this);
10013 var lenVal = o.length;
10014 var len = ToLength(lenVal);
10015 var relativeStart = ToInteger(start);
10016 var k = (relativeStart < 0) ? max(len + relativeStart, 0) : min(relativeStart, len);
10017 var relativeEnd = (end === undefined) ? len : ToInteger(end);
10018 var final = (relativeEnd < 0) ? max(len + relativeEnd, 0) : min(relativeEnd, len);
10019 var count = final - k;
10020 var c = o.constructor;
10021 if (IsConstructor(c)) {
10022 var a = new c(count);
10023 } else {
10024 throw TypeError();
10025 }
10026 var n = 0;
10027 while (k < final) {
10028 var kValue = o[k];
10029 a[n] = kValue;
10030 ++k;
10031 ++n;
10032 }
10033 return a;
10034 });
10035
10036 // 22.2.3.24 %TypedArray%.prototype.some ( callbackfn [ , thisArg ] )
10037 define($TypedArray$.prototype, 'some', Array.prototype.some);
10038
10039 // 22.2.3.25 %TypedArray%.prototype.sort ( comparefn )
10040 define(
10041 $TypedArray$.prototype, 'sort',
10042 function sort() {
10043 var comparefn = arguments[0];
10044
10045 function sortCompare(x, y) {
10046 console.assert(Type(x) === 'number' && Type(y) === 'number');
10047 if (x !== x && y !== y) return +0;
10048 if (x !== x) return 1;
10049 if (y !== y) return -1;
10050 if (comparefn !== undefined) {
10051 return comparefn(x, y);
10052 }
10053 if (x < y) return -1;
10054 if (x > y) return 1;
10055 return +0;
10056 }
10057 return Array.prototype.sort.call(this, sortCompare);
10058 });
10059
10060 // 22.2.3.26 %TypedArray%.prototype.subarray( [ begin [ , end ] ] )
10061 // 22.2.3.27 %TypedArray%.prototype.toLocaleString ([ reserved1 [ , reserved2 ] ])
10062 // 22.2.3.28 %TypedArray%.prototype.toString ( )
10063
10064 // 22.2.3.29 %TypedArray%.prototype.values ( )
10065 define($TypedArray$.prototype, 'values', Array.prototype.values);
10066
10067 // 22.2.3.30 %TypedArray%.prototype [ @@iterator ] ( )
10068 define(
10069 $TypedArray$.prototype, $$iterator,
10070 $TypedArray$.prototype.values
10071 );
10072
10073 // 22.2.3.31 get %TypedArray%.prototype [ @@toStringTag ]
10074 define($TypedArray$.prototype, $$toStringTag, $TypedArrayName$);
10075
10076 // 22.2.4 The TypedArray Constructors
10077 // 22.2.4.1TypedArray( ... argumentsList)
10078 // 22.2.5 Properties of the TypedArray Constructors
10079 // 22.2.5.1 TypedArray.BYTES_PER_ELEMENT
10080 // 22.2.5.2 TypedArray.prototype
10081 // 22.2.6 Properties of TypedArray Prototype Objects
10082 // 22.2.6.1 TypedArray.prototype.BYTES_PER_ELEMENT
10083 // 22.2.6.2 TypedArray.prototype.constructor
10084 // 22.2.7 Properties of TypedArray Instances
10085 });
10086
10087 // ---------------------------------------
10088 // 23 Keyed Collection
10089 // ---------------------------------------
10090
10091 // ---------------------------------------
10092 // 23.1 Map Objects
10093 // ---------------------------------------
10094
10095 (function() {
10096 // 23.1.1 The Map Constructor
10097
10098 // 23.1.1.1 Map ( [ iterable ] )
10099 /** @constructor */
10100 function Map(/*iterable*/) {
10101 var map = strict(this);
10102 var iterable = arguments[0];
10103
10104 if (Type(map) !== 'object') throw TypeError();
10105 if ('[[MapData]]' in map) throw TypeError();
10106
10107 if (iterable !== undefined) {
10108 var adder = map['set'];
10109 if (!IsCallable(adder)) throw TypeError();
10110 var iter = GetIterator(ToObject(iterable));
10111 }
10112 set_internal(map, '[[MapData]]', { keys: [], values: [] });
10113 if (iter === undefined) return map;
10114 while (true) {
10115 var next = IteratorStep(iter);
10116 if (next === false)
10117 return map;
10118 var nextItem = IteratorValue(next);
10119 if (Type(nextItem) !== 'object') throw TypeError();
10120 var k = nextItem[0];
10121 var v = nextItem[1];
10122 adder.call(map, k, v);
10123 }
10124
10125 return map;
10126 }
10127
10128 if (!('Map' in global) || OVERRIDE_NATIVE_FOR_TESTING ||
10129 (function() { try { new global.Map([]); return false; } catch (_) { return true; } }()) ||
10130 (function() { try { return !new global.Map().entries().next; } catch (_) { return true; } }()) ||
10131 (new global.Map([['a', 1]]).size !== 1))
10132 global.Map = Map;
10133
10134
10135 function MapDataIndexOf(mapData, key) {
10136 var i;
10137 if (key === key) return mapData.keys.indexOf(key);
10138 // Slow case for NaN
10139 for (i = 0; i < mapData.keys.length; i += 1)
10140 if (SameValueZero(mapData.keys[i], key)) return i;
10141 return -1;
10142 }
10143
10144 // 23.1.1.2 new Map ( ... argumentsList )
10145 // 23.1.2 Properties of the Map Constructor
10146 // 23.1.2.1 Map.prototype
10147 var $MapPrototype$ = {};
10148 Map.prototype = $MapPrototype$;
10149
10150 // 23.1.2.2 get Map [ @@species ]
10151
10152 // 23.1.3 Properties of the Map Prototype Object
10153 // 23.1.3.1 Map.prototype.clear ()
10154 define(
10155 Map.prototype, 'clear',
10156 function clear() {
10157 var m = strict(this);
10158 if (Type(m) !== 'object') throw TypeError();
10159 if (!('[[MapData]]' in m)) throw TypeError();
10160 if (m['[[MapData]]'] === undefined) throw TypeError();
10161 var entries = m['[[MapData]]'];
10162 entries.keys.length = 0;
10163 entries.values.length = 0;
10164 return undefined;
10165 });
10166
10167 // 23.1.3.2 Map.prototype.constructor
10168
10169 // 23.1.3.3 Map.prototype.delete ( key )
10170 define(
10171 Map.prototype, 'delete',
10172 function delete_(key) {
10173 var m = strict(this);
10174 if (Type(m) !== 'object') throw TypeError();
10175 if (!('[[MapData]]' in m)) throw TypeError();
10176 if (m['[[MapData]]'] === undefined) throw TypeError();
10177 var entries = m['[[MapData]]'];
10178 var i = MapDataIndexOf(entries, key);
10179 if (i < 0) return false;
10180 entries.keys[i] = empty;
10181 entries.values[i] = empty;
10182 return true;
10183 });
10184
10185 // 23.1.3.4 Map.prototype.entries ( )
10186 define(
10187 Map.prototype, 'entries',
10188 function entries() {
10189 var m = strict(this);
10190 if (Type(m) !== 'object') throw TypeError();
10191 return CreateMapIterator(m, 'key+value');
10192 });
10193
10194 // 23.1.3.5 Map.prototype.forEach ( callbackfn [ , thisArg ] )
10195 define(
10196 Map.prototype, 'forEach',
10197 function forEach(callbackfn /*, thisArg*/) {
10198 var thisArg = arguments[1];
10199
10200 var m = strict(this);
10201 if (Type(m) !== 'object') throw TypeError();
10202 if (!('[[MapData]]' in m)) throw TypeError();
10203 if (m['[[MapData]]'] === undefined) throw TypeError();
10204 var entries = m['[[MapData]]'];
10205
10206 if (!IsCallable(callbackfn)) {
10207 throw TypeError('First argument to forEach is not callable.');
10208 }
10209 for (var i = 0; i < entries.keys.length; ++i) {
10210 if (entries.keys[i] !== empty) {
10211 callbackfn.call(thisArg, entries.values[i], entries.keys[i], m);
10212 }
10213 }
10214 return undefined;
10215 });
10216
10217 // 23.1.3.6 Map.prototype.get ( key )
10218 define(
10219 Map.prototype, 'get',
10220 function get(key) {
10221 var m = strict(this);
10222 if (Type(m) !== 'object') throw TypeError();
10223 if (!('[[MapData]]' in m)) throw TypeError();
10224 if (m['[[MapData]]'] === undefined) throw TypeError();
10225 var entries = m['[[MapData]]'];
10226 var i = MapDataIndexOf(entries, key);
10227 if (i >= 0) return entries.values[i];
10228 return undefined;
10229 });
10230
10231 // 23.1.3.7 Map.prototype.has ( key )
10232 define(
10233 Map.prototype, 'has',
10234 function has(key) {
10235 var m = strict(this);
10236 if (Type(m) !== 'object') throw TypeError();
10237 if (!('[[MapData]]' in m)) throw TypeError();
10238 if (m['[[MapData]]'] === undefined) throw TypeError();
10239 var entries = m['[[MapData]]'];
10240 if (MapDataIndexOf(entries, key) >= 0) return true;
10241 return false;
10242 });
10243
10244 // 23.1.3.8 Map.prototype.keys ( )
10245 define(
10246 Map.prototype, 'keys',
10247 function keys() {
10248 var m = strict(this);
10249 if (Type(m) !== 'object') throw TypeError();
10250 return CreateMapIterator(m, 'key');
10251 });
10252
10253 // 23.1.3.9 Map.prototype.set ( key , value )
10254 define(
10255 Map.prototype, 'set',
10256 function set(key, value) {
10257 var m = strict(this);
10258 if (Type(m) !== 'object') throw TypeError();
10259 if (!('[[MapData]]' in m)) throw TypeError();
10260 if (m['[[MapData]]'] === undefined) throw TypeError();
10261 var entries = m['[[MapData]]'];
10262 var i = MapDataIndexOf(entries, key);
10263 if (i < 0) i = entries.keys.length;
10264 if (SameValue(key, -0)) key = 0;
10265 entries.keys[i] = key;
10266 entries.values[i] = value;
10267 return m;
10268 });
10269
10270 // 23.1.3.10 get Map.prototype.size
10271 Object.defineProperty(
10272 Map.prototype, 'size', {
10273 get: function() {
10274 var m = strict(this);
10275 if (Type(m) !== 'object') throw TypeError();
10276 if (!('[[MapData]]' in m)) throw TypeError();
10277 if (m['[[MapData]]'] === undefined) throw TypeError();
10278 var entries = m['[[MapData]]'];
10279 var count = 0;
10280 for (var i = 0; i < entries.keys.length; ++i) {
10281 if (entries.keys[i] !== empty)
10282 count = count + 1;
10283 }
10284 return count;
10285 }
10286 });
10287
10288 // 23.1.3.11 Map.prototype.values ( )
10289 define(
10290 Map.prototype, 'values',
10291 function values() {
10292 var m = strict(this);
10293 if (Type(m) !== 'object') throw TypeError();
10294 return CreateMapIterator(m, 'value');
10295 });
10296
10297 // 23.1.3.12 Map.prototype [ @@iterator ]( )
10298 define(
10299 Map.prototype, $$iterator,
10300 function() {
10301 var m = strict(this);
10302 if (Type(m) !== 'object') throw TypeError();
10303 return CreateMapIterator(m, 'key+value');
10304 });
10305
10306 // 23.1.3.13 Map.prototype [ @@toStringTag ]
10307 define(global.Map.prototype, $$toStringTag, 'Map');
10308
10309 // 23.1.4 Properties of Map Instances
10310 // 23.1.5 Map Iterator Objects
10311
10312 /** @constructor */
10313 function MapIterator() {}
10314
10315 // 23.1.5.1 CreateMapIterator Abstract Operation
10316 function CreateMapIterator(map, kind) {
10317 if (Type(map) !== 'object') throw TypeError();
10318 if (!('[[MapData]]' in map)) throw TypeError();
10319 if (map['[[MapData]]'] === undefined) throw TypeError();
10320 var iterator = new MapIterator;
10321 set_internal(iterator, '[[Map]]', map);
10322 set_internal(iterator, '[[MapNextIndex]]', 0);
10323 set_internal(iterator, '[[MapIterationKind]]', kind);
10324 return iterator;
10325 }
10326
10327 // 23.1.5.2 The %MapIteratorPrototype% Object
10328 var $MapIteratorPrototype$ = Object.create($IteratorPrototype$);
10329 MapIterator.prototype = $MapIteratorPrototype$;
10330
10331 // 23.1.5.2.1 %MapIteratorPrototype%.next ( )
10332 define(
10333 $MapIteratorPrototype$, 'next',
10334 function next() {
10335 var o = strict(this);
10336 if (Type(o) !== 'object') throw TypeError();
10337 var m = o['[[Map]]'],
10338 index = o['[[MapNextIndex]]'],
10339 itemKind = o['[[MapIterationKind]]'],
10340 entries = m['[[MapData]]'];
10341 while (index < entries.keys.length) {
10342 var e = {key: entries.keys[index], value: entries.values[index]};
10343 index = index += 1;
10344 set_internal(o, '[[MapNextIndex]]', index);
10345 if (e.key !== empty) {
10346 if (itemKind === 'key') {
10347 return CreateIterResultObject(e.key, false);
10348 } else if (itemKind === 'value') {
10349 return CreateIterResultObject(e.value, false);
10350 } else {
10351 return CreateIterResultObject([e.key, e.value], false);
10352 }
10353 }
10354 }
10355 return CreateIterResultObject(undefined, true);
10356 });
10357
10358 // 23.1.5.2.2 %MapIteratorPrototype% [ @@toStringTag ]
10359 define($MapIteratorPrototype$, $$toStringTag, 'Map Iterator');
10360
10361 // 23.1.5.3 Properties of Map Iterator Instances
10362 }());
10363
10364 // ---------------------------------------
10365 // 23.2 Set Objects
10366 // ---------------------------------------
10367
10368 (function() {
10369 // 23.2.1 The Set Constructor
10370 // 23.2.1.1 Set ( [ iterable ] )
10371
10372 /** @constructor */
10373 function Set(/*iterable*/) {
10374 var set = strict(this);
10375 var iterable = arguments[0];
10376
10377 if (Type(set) !== 'object') throw TypeError();
10378 if ('[[SetData]]' in set) throw TypeError();
10379
10380 if (iterable !== undefined) {
10381 var adder = set['add'];
10382 if (!IsCallable(adder)) throw TypeError();
10383 var iter = GetIterator(ToObject(iterable));
10384 }
10385 set_internal(set, '[[SetData]]', []);
10386 if (iter === undefined) return set;
10387 while (true) {
10388 var next = IteratorStep(iter);
10389 if (next === false)
10390 return set;
10391 var nextValue = IteratorValue(next);
10392 adder.call(set, nextValue);
10393 }
10394
10395 return set;
10396 }
10397
10398 if (!('Set' in global) || OVERRIDE_NATIVE_FOR_TESTING ||
10399 (function() { try { return !new global.Set().entries().next; } catch (_) { return true; } }()) ||
10400 (new global.Set([1]).size !== 1))
10401 global.Set = Set;
10402
10403 function SetDataIndexOf(setData, key) {
10404 var i;
10405 if (key === key)
10406 return setData.indexOf(key);
10407 // Slow case for NaN
10408 for (i = 0; i < setData.length; i += 1)
10409 if (SameValueZero(setData[i], key)) return i;
10410 return -1;
10411 }
10412
10413 // 23.2.1.2 new Set ( ...argumentsList )
10414 // 23.2.2 Properties of the Set Constructor
10415
10416 // 23.2.2.1 Set.prototype
10417 var $SetPrototype$ = {};
10418 Set.prototype = $SetPrototype$;
10419
10420 // 23.2.2.2 get Set [ @@species ]
10421 // 23.2.3 Properties of the Set Prototype Object
10422
10423 // 23.2.3.1 Set.prototype.add (value )
10424 define(
10425 Set.prototype, 'add',
10426 function add(value) {
10427 var s = strict(this);
10428 if (Type(s) !== 'object') throw TypeError();
10429 if (!('[[SetData]]' in s)) throw TypeError();
10430 if (s['[[SetData]]'] === undefined) throw TypeError();
10431 if (SameValue(value, -0)) value = 0;
10432 var entries = s['[[SetData]]'];
10433 var i = SetDataIndexOf(entries, value);
10434 if (i < 0) i = s['[[SetData]]'].length;
10435 s['[[SetData]]'][i] = value;
10436
10437 return s;
10438 });
10439
10440 // 23.2.3.2 Set.prototype.clear ()
10441 define(
10442 Set.prototype, 'clear',
10443 function clear() {
10444 var s = strict(this);
10445 if (Type(s) !== 'object') throw TypeError();
10446 if (!('[[SetData]]' in s)) throw TypeError();
10447 if (s['[[SetData]]'] === undefined) throw TypeError();
10448 var entries = s['[[SetData]]'];
10449 entries.length = 0;
10450 return undefined;
10451 });
10452
10453 // 23.2.3.3 Set.prototype.constructor
10454 // 23.2.3.4 Set.prototype.delete ( value )
10455 define(
10456 Set.prototype, 'delete',
10457 function delete_(value) {
10458 var s = strict(this);
10459 if (Type(s) !== 'object') throw TypeError();
10460 if (!('[[SetData]]' in s)) throw TypeError();
10461 if (s['[[SetData]]'] === undefined) throw TypeError();
10462 var entries = s['[[SetData]]'];
10463 var i = SetDataIndexOf(entries, value);
10464 if (i < 0) return false;
10465 entries[i] = empty;
10466 return true;
10467 });
10468
10469 // 23.2.3.5 Set.prototype.entries ( )
10470 define(
10471 Set.prototype, 'entries',
10472 function entries() {
10473 var s = strict(this);
10474 if (Type(s) !== 'object') throw TypeError();
10475 return CreateSetIterator(s, 'key+value');
10476 });
10477
10478 // 23.2.3.6 Set.prototype.forEach ( callbackfn [ , thisArg ] )
10479 define(
10480 Set.prototype, 'forEach',
10481 function forEach(callbackfn/*, thisArg*/) {
10482 var thisArg = arguments[1];
10483
10484 var s = strict(this);
10485 if (Type(s) !== 'object') throw TypeError();
10486 if (!('[[SetData]]' in s)) throw TypeError();
10487 if (s['[[SetData]]'] === undefined) throw TypeError();
10488 var entries = s['[[SetData]]'];
10489
10490 if (!IsCallable(callbackfn)) {
10491 throw TypeError('First argument to forEach is not callable.');
10492 }
10493 for (var i = 0; i < entries.length; ++i) {
10494 if (entries[i] !== empty) {
10495 callbackfn.call(thisArg, entries[i], entries[i], s);
10496 }
10497 }
10498 });
10499
10500 // 23.2.3.7 Set.prototype.has ( value )
10501 define(
10502 Set.prototype, 'has',
10503 function has(key) {
10504 var s = strict(this);
10505 if (Type(s) !== 'object') throw TypeError();
10506 if (!('[[SetData]]' in s)) throw TypeError();
10507 if (s['[[SetData]]'] === undefined) throw TypeError();
10508 var entries = s['[[SetData]]'];
10509 return SetDataIndexOf(entries, key) !== -1;
10510 });
10511
10512 // 23.2.3.8 Set.prototype.keys ( )
10513 // See Set.prototype.values
10514
10515 // 23.2.3.9 get Set.prototype.size
10516 Object.defineProperty(
10517 Set.prototype, 'size', {
10518 get: function() {
10519 var s = strict(this);
10520 if (Type(s) !== 'object') throw TypeError();
10521 if (!('[[SetData]]' in s)) throw TypeError();
10522 if (s['[[SetData]]'] === undefined) throw TypeError();
10523 var entries = s['[[SetData]]'];
10524 var count = 0;
10525 for (var i = 0; i < entries.length; ++i) {
10526 if (entries[i] !== empty)
10527 count = count + 1;
10528 }
10529 return count;
10530 }
10531 });
10532
10533 // 23.2.3.10 Set.prototype.values ( )
10534 define(
10535 Set.prototype, 'values',
10536 function values() {
10537 var s = strict(this);
10538 if (Type(s) !== 'object') throw TypeError();
10539 return CreateSetIterator(s, 'value');
10540 });
10541 // NOTE: function name is still 'values':
10542 Set.prototype.keys = Set.prototype.values;
10543
10544 // 23.2.3.11 Set.prototype [@@iterator ] ( )
10545 define(
10546 Set.prototype, $$iterator,
10547 function() {
10548 var s = strict(this);
10549 if (Type(s) !== 'object') throw TypeError();
10550 return CreateSetIterator(s);
10551 });
10552
10553 // 23.2.3.12 Set.prototype [ @@toStringTag ]
10554 define(global.Set.prototype, $$toStringTag, 'Set');
10555
10556 // 23.2.4 Properties of Set Instances
10557 // 23.2.5 Set Iterator Objects
10558 /** @constructor */
10559 function SetIterator() {}
10560
10561 // 23.2.5.1 CreateSetIterator Abstract Operation
10562 function CreateSetIterator(set, kind) {
10563 if (Type(set) !== 'object') throw TypeError();
10564 if (!('[[SetData]]' in set)) throw TypeError();
10565 if (set['[[SetData]]'] === undefined) throw TypeError();
10566 var iterator = new SetIterator;
10567 set_internal(iterator, '[[IteratedSet]]', set);
10568 set_internal(iterator, '[[SetNextIndex]]', 0);
10569 set_internal(iterator, '[[SetIterationKind]]', kind);
10570 return iterator;
10571 }
10572
10573 // 23.2.5.2 The %SetIteratorPrototype% Object
10574 var $SetIteratorPrototype$ = Object.create($IteratorPrototype$);
10575 SetIterator.prototype = $SetIteratorPrototype$;
10576
10577 // 23.2.5.2.1 %SetIteratorPrototype%.next( )
10578 define(
10579 $SetIteratorPrototype$, 'next',
10580 function next() {
10581 var o = strict(this);
10582 if (Type(o) !== 'object') throw TypeError();
10583 var s = o['[[IteratedSet]]'],
10584 index = o['[[SetNextIndex]]'],
10585 itemKind = o['[[SetIterationKind]]'],
10586 entries = s['[[SetData]]'];
10587 while (index < entries.length) {
10588 var e = entries[index];
10589 index = index += 1;
10590 set_internal(o, '[[SetNextIndex]]', index);
10591 if (e !== empty) {
10592 if (itemKind === 'key+value')
10593 return CreateIterResultObject([e, e], false);
10594 return CreateIterResultObject(e, false);
10595 }
10596 }
10597 return CreateIterResultObject(undefined, true);
10598 });
10599
10600 // 23.2.5.2.2 %SetIteratorPrototype% [ @@toStringTag ]
10601 define($SetIteratorPrototype$, $$toStringTag, 'Set Iterator');
10602
10603 // 23.2.5.3 Properties of Set Iterator Instances
10604
10605 }());
10606
10607 // ---------------------------------------
10608 // 23.3 WeakMap Objects
10609 // ---------------------------------------
10610
10611 (function() {
10612 // 23.3.1 The WeakMap Constructor
10613 // 23.3.1.1 WeakMap ( [ iterable ] )
10614 /** @constructor */
10615 function WeakMap(/*iterable*/) {
10616 var map = strict(this);
10617 var iterable = arguments[0];
10618
10619 if (Type(map) !== 'object') throw TypeError();
10620 if ('[[WeakMapData]]' in map) throw TypeError();
10621
10622 if (iterable !== undefined) {
10623 var adder = map['set'];
10624 if (!IsCallable(adder)) throw TypeError();
10625 var iter = GetIterator(ToObject(iterable));
10626 }
10627 set_internal(map, '[[WeakMapData]]', new EphemeronTable);
10628 if (iter === undefined) return map;
10629 while (true) {
10630 var next = IteratorStep(iter);
10631 if (next === false)
10632 return map;
10633 var nextValue = IteratorValue(next);
10634 if (Type(nextValue) !== 'object') throw TypeError();
10635 var k = nextValue[0];
10636 var v = nextValue[1];
10637 adder.call(map, k, v);
10638 }
10639
10640 return map;
10641 }
10642
10643 if (!('WeakMap' in global) || OVERRIDE_NATIVE_FOR_TESTING)
10644 global.WeakMap = WeakMap;
10645
10646 // 23.3.2 Properties of the WeakMap Constructor
10647 // 23.3.2.1 WeakMap.prototype
10648 var $WeakMapPrototype$ = {};
10649 WeakMap.prototype = $WeakMapPrototype$;
10650
10651
10652
10653 // 23.3.2.2 WeakMap[ @@create ] ( )
10654 // 23.3.3 Properties of the WeakMap Prototype Object
10655
10656 // 23.3.3.1 WeakMap.prototype.constructor
10657
10658 // 23.3.3.2 WeakMap.prototype.delete ( key )
10659 define(
10660 WeakMap.prototype, 'delete',
10661 function delete_(key) {
10662 var M = strict(this);
10663 if (Type(M) !== 'object') throw TypeError();
10664 if (M['[[WeakMapData]]'] === undefined) throw TypeError();
10665 if (Type(key) !== 'object') throw TypeError('Expected object');
10666 return M['[[WeakMapData]]'].remove(key);
10667 });
10668
10669 // 23.3.3.3 WeakMap.prototype.get ( key )
10670 define(
10671 WeakMap.prototype, 'get',
10672 function get(key, defaultValue) {
10673 var M = strict(this);
10674 if (Type(M) !== 'object') throw TypeError();
10675 if (M['[[WeakMapData]]'] === undefined) throw TypeError();
10676 if (Type(key) !== 'object') throw TypeError('Expected object');
10677 return M['[[WeakMapData]]'].get(key, defaultValue);
10678 });
10679
10680 // 23.3.3.4 WeakMap.prototype.has ( key )
10681 define(
10682 WeakMap.prototype, 'has',
10683 function has(key) {
10684 var M = strict(this);
10685 if (Type(M) !== 'object') throw TypeError();
10686 if (M['[[WeakMapData]]'] === undefined) throw TypeError();
10687 if (Type(key) !== 'object') throw TypeError('Expected object');
10688 return M['[[WeakMapData]]'].has(key);
10689 });
10690
10691 // 23.3.3.5 WeakMap.prototype.set ( key , value )
10692 define(
10693 WeakMap.prototype, 'set',
10694 function set(key, value) {
10695 var M = strict(this);
10696 if (Type(M) !== 'object') throw TypeError();
10697 if (M['[[WeakMapData]]'] === undefined) throw TypeError();
10698 if (Type(key) !== 'object') throw TypeError('Expected object');
10699 M['[[WeakMapData]]'].set(key, value);
10700 return M;
10701 });
10702
10703 // 23.3.3.6 WeakMap.prototype [ @@toStringTag ]
10704 define(global.WeakMap.prototype, $$toStringTag, 'WeakMap');
10705
10706 // 23.3.4 Properties of WeakMap Instances
10707
10708 // Polyfills for incomplete native implementations:
10709 (function() {
10710 var wm = new global.WeakMap();
10711 var orig = global.WeakMap.prototype.set;
10712 define(global.WeakMap.prototype, 'set', function set() {
10713 orig.apply(this, arguments);
10714 return this;
10715 }, wm.set({}, 0) !== wm);
10716 }());
10717 }());
10718
10719 // ---------------------------------------
10720 // 23.4 WeakSet Objects
10721 // ---------------------------------------
10722
10723 (function() {
10724 // 23.4.1 The WeakSet Constructor
10725 // 23.4.1.1 WeakSet ( [ iterable ] )
10726 /** @constructor */
10727 function WeakSet(/*iterable*/) {
10728 var set = strict(this);
10729 var iterable = arguments[0];
10730
10731 if (Type(set) !== 'object') throw TypeError();
10732 if ('[[WeakSetData]]' in set) throw TypeError();
10733
10734 if (iterable !== undefined) {
10735 var adder = set['add'];
10736 if (!IsCallable(adder)) throw TypeError();
10737 var iter = GetIterator(ToObject(iterable));
10738 }
10739 set_internal(set, '[[WeakSetData]]', new EphemeronTable);
10740 if (iter === undefined) return set;
10741 while (true) {
10742 var next = IteratorStep(iter);
10743 if (next === false)
10744 return set;
10745 var nextValue = IteratorValue(next);
10746 adder.call(set, nextValue);
10747 }
10748
10749 return set;
10750 }
10751
10752 if (!('WeakSet' in global) || OVERRIDE_NATIVE_FOR_TESTING)
10753 global.WeakSet = WeakSet;
10754
10755 // 23.4.2 Properties of the WeakSet Constructor
10756 // 23.4.2.1 WeakSet.prototype
10757 var $WeakSetPrototype$ = {};
10758 WeakSet.prototype = $WeakSetPrototype$;
10759
10760 // 23.4.3 Properties of the WeakSet Prototype Object
10761 // 23.4.3.1 WeakSet.prototype.add (value )
10762 define(
10763 WeakSet.prototype, 'add',
10764 function add(value) {
10765 var S = strict(this);
10766 if (Type(S) !== 'object') throw TypeError();
10767 if (S['[[WeakSetData]]'] === undefined) throw TypeError();
10768 if (Type(value) !== 'object') throw TypeError('Expected object');
10769 S['[[WeakSetData]]'].set(value, true);
10770 return S;
10771 });
10772
10773 // 23.4.3.2 WeakSet.prototype.constructor
10774 // 23.4.3.3 WeakSet.prototype.delete ( value )
10775 define(
10776 WeakSet.prototype, 'delete',
10777 function delete_(value) {
10778 var S = strict(this);
10779 if (Type(S) !== 'object') throw TypeError();
10780 if (S['[[WeakSetData]]'] === undefined) throw TypeError();
10781 if (Type(value) !== 'object') throw TypeError('Expected object');
10782 return S['[[WeakSetData]]'].remove(value);
10783 });
10784
10785 // 23.4.3.4 WeakSet.prototype.has ( value )
10786 define(
10787 WeakSet.prototype, 'has',
10788 function has(key) {
10789 var S = strict(this);
10790 if (Type(S) !== 'object') throw TypeError();
10791 if (S['[[WeakSetData]]'] === undefined) throw TypeError();
10792 if (Type(key) !== 'object') throw TypeError('Expected object');
10793 return S['[[WeakSetData]]'].has(key);
10794 });
10795
10796 // 23.4.3.5 WeakSet.prototype [ @@toStringTag ]
10797 define(global.WeakSet.prototype, $$toStringTag, 'WeakSet');
10798
10799 // 23.4.4 Properties of WeakSet Instances
10800
10801 // Polyfills for incomplete native implementations:
10802 (function() {
10803 var ws = new global.WeakSet();
10804 var orig = global.WeakSet.prototype.add;
10805 define(global.WeakSet.prototype, 'add', function add() {
10806 orig.apply(this, arguments);
10807 return this;
10808 }, ws.add({}) !== ws);
10809 }());
10810 }());
10811
10812 // ---------------------------------------
10813 // 24 Structured Data
10814 // ---------------------------------------
10815
10816 // ---------------------------------------
10817 // 24.1 ArrayBuffer Objects
10818 // ---------------------------------------
10819
10820 // See typedarray.js for TypedArray polyfill
10821
10822 (function() {
10823 if (!('ArrayBuffer' in global))
10824 return;
10825
10826 // 24.1.1 Abstract Operations For ArrayBuffer Objects
10827 // 24.1.1.1 AllocateArrayBuffer( constructor, byteLength )
10828 // 24.1.1.2 IsDetachedBuffer( arrayBuffer )
10829 // 24.1.1.3 DetachArrayBuffer( arrayBuffer )
10830 // 24.1.1.4 CloneArrayBuffer( srcBuffer, srcByteOffset [, cloneConstructor] )
10831 // 24.1.1.5 GetValueFromBuffer ( arrayBuffer, byteIndex, type, isLittleEndian )
10832 // 24.1.1.6 SetValueInBuffer ( arrayBuffer, byteIndex, type, value, isLittleEndian )
10833 // 24.1.2 The ArrayBuffer Constructor
10834 // 24.1.2.1 ArrayBuffer( length )
10835 // 24.1.3 Properties of the ArrayBuffer Constructor
10836
10837 // 24.1.3.1 ArrayBuffer.isView ( arg )
10838 define(
10839 ArrayBuffer, 'isView',
10840 function isView(arg) {
10841 if (Type(arg) !== 'object') return false;
10842 if ('buffer' in arg && arg.buffer instanceof ArrayBuffer) return true;
10843 return false;
10844 });
10845
10846 // 24.1.3.2 ArrayBuffer.prototype
10847 // 24.1.3.3 get ArrayBuffer [ @@species ]
10848 // 24.1.4 Properties of the ArrayBuffer Prototype Object
10849 // 24.1.4.1 get ArrayBuffer.prototype.byteLength
10850 // 24.1.4.2 ArrayBuffer.prototype.constructor
10851 // 24.1.4.3 ArrayBuffer.prototype.slice ( start , end)
10852
10853 // 24.1.4.4 ArrayBuffer.prototype [ @@toStringTag ]
10854 define(ArrayBuffer.prototype, $$toStringTag, 'ArrayBuffer');
10855
10856 // 24.1.5 Properties of the ArrayBuffer Instances
10857 }());
10858
10859 // ---------------------------------------
10860 // 24.2 DataView Objects
10861 // ---------------------------------------
10862
10863 // See typedarray.js for TypedArray polyfill
10864
10865 (function() {
10866 if (!('DataView' in global))
10867 return;
10868
10869 // 24.2.1 Abstract Operations For DataView Objects
10870 // 24.2.1.1 GetViewValue(view, requestIndex, isLittleEndian, type)
10871 // 24.2.1.2 SetViewValue(view, requestIndex, isLittleEndian, type, value)
10872 // 24.2.2 The DataView Constructor
10873 // 24.2.2.1 DataView (buffer [ , byteOffset [ , byteLength ] ] )
10874 // 24.2.3 Properties of the DataView Constructor
10875 // 24.2.3.1 DataView.prototype
10876 // 24.2.4 Properties of the DataView Prototype Object
10877 // 24.2.4.1 get DataView.prototype.buffer
10878 // 24.2.4.2 get DataView.prototype.byteLength
10879 // 24.2.4.3 get DataView.prototype.byteOffset
10880 // 24.2.4.4 DataView.prototype.constructor
10881 // 24.2.4.5 DataView.prototype.getFloat32 ( byteOffset [ , littleEndian ] )
10882 // 24.2.4.6 DataView.prototype.getFloat64 ( byteOffset [ , littleEndian ] )
10883 // 24.2.4.7 DataView.prototype.getInt8 ( byteOffset )
10884 // 24.2.4.8 DataView.prototype.getInt16 ( byteOffset [ , littleEndian ] )
10885 // 24.2.4.9 DataView.prototype.getInt32 ( byteOffset [ , littleEndian ] )
10886 // 24.2.4.10 DataView.prototype.getUint8 ( byteOffset )
10887 // 24.2.4.11 DataView.prototype.getUint16 ( byteOffset [ , littleEndian ] )
10888 // 24.2.4.12 DataView.prototype.getUint32 ( byteOffset [ , littleEndian ] )
10889 // 24.2.4.13 DataView.prototype.setFloat32 ( byteOffset, value [ , littleEndian ] )
10890 // 24.2.4.14 DataView.prototype.setFloat64 ( byteOffset, value [ , littleEndian ] )
10891 // 24.2.4.15 DataView.prototype.setInt8 ( byteOffset, value )
10892 // 24.2.4.16 DataView.prototype.setInt16 ( byteOffset, value [ , littleEndian ] )
10893 // 24.2.4.17 DataView.prototype.setInt32 ( byteOffset, value [ , littleEndian ] )
10894 // 24.2.4.18 DataView.prototype.setUint8 ( byteOffset, value )
10895 // 24.2.4.19 DataView.prototype.setUint16 ( byteOffset, value [ , littleEndian ] )
10896 // 24.2.4.20 DataView.prototype.setUint32 ( byteOffset, value [ , littleEndian ] )
10897
10898 // 24.2.4.21 DataView.prototype[ @@toStringTag ]
10899 define(DataView.prototype, $$toStringTag, 'DataView');
10900
10901 // 24.2.5 Properties of DataView Instances
10902 }());
10903
10904 // ---------------------------------------
10905 // 24.3 The JSON Object
10906 // ---------------------------------------
10907
10908 // 24.3.1 JSON.parse ( text [ , reviver ] )
10909 // 24.3.2 JSON.stringify ( value [ , replacer [ , space ] ] )
10910 // 24.3.3 JSON [ @@toStringTag ]
10911 define(JSON, $$toStringTag, 'JSON');
10912
10913 // ---------------------------------------
10914 // 25.1 Iteration
10915 // ---------------------------------------
10916
10917 // 25.1.1 Common Iteration Interfaces
10918 // 25.1.1.1 The Iterable Interface
10919 // 25.1.1.2 The Iterator Interface
10920 // 25.1.1.3 The IteratorResult Interface
10921
10922 // 25.1.2 The %IteratorPrototype% Object
10923 // Defined earlier, so other prototypes can reference it.
10924 // 25.1.2.1 %IteratorPrototype% [ @@iterator ] ( )
10925 define($IteratorPrototype$, $$iterator, function() {
10926 return this;
10927 });
10928
10929
10930 // ---------------------------------------
10931 // 25.4 Promise Objects
10932 // ---------------------------------------
10933
10934 (function() {
10935 // 25.4 Promise Objects
10936
10937 // 25.4.1 Promise Abstract Operations
10938
10939 // 25.4.1.1 PromiseCapability Records
10940 // 25.4.1.1.1 IfAbruptRejectPromise ( value, capability )
10941
10942 function IfAbruptRejectPromise(value, capability) {
10943 var rejectResult = capability['[[Reject]]'].call(undefined, value);
10944 return capability['[[Promise]]'];
10945 }
10946
10947 // 25.4.1.2 PromiseReaction Records
10948
10949 // 25.4.1.3 CreateResolvingFunctions ( promise )
10950
10951 function CreateResolvingFunctions(promise) {
10952 var alreadyResolved = {'[[value]]': false};
10953 var resolve = PromiseResolveFunction();
10954 set_internal(resolve, '[[Promise]]', promise);
10955 set_internal(resolve, '[[AlreadyResolved]]', alreadyResolved);
10956 var reject = PromiseRejectFunction();
10957 set_internal(reject, '[[Promise]]', promise);
10958 set_internal(reject, '[[AlreadyResolved]]', alreadyResolved);
10959 return { '[[Resolve]]': resolve, '[[Reject]]': reject};
10960 }
10961
10962 // 25.4.1.3.1 Promise Reject Functions
10963
10964 function PromiseRejectFunction() {
10965 var F = function(reason) {
10966 console.assert(Type(F['[[Promise]]']) === 'object');
10967 var promise = F['[[Promise]]'];
10968 var alreadyResolved = F['[[AlreadyResolved]]'];
10969 if (alreadyResolved['[[value]]']) return undefined;
10970 set_internal(alreadyResolved, '[[value]]', true);
10971 return RejectPromise(promise, reason);
10972 };
10973 return F;
10974 }
10975
10976 // 25.4.1.3.2 Promise Resolve Functions
10977
10978 function PromiseResolveFunction() {
10979 var F = function(resolution) {
10980 console.assert(Type(F['[[Promise]]']) === 'object');
10981 var promise = F['[[Promise]]'];
10982 var alreadyResolved = F['[[AlreadyResolved]]'];
10983 if (alreadyResolved['[[value]]']) return undefined;
10984 set_internal(alreadyResolved, '[[value]]', true);
10985
10986 if (SameValue(resolution, promise)) {
10987 var selfResolutionError = TypeError();
10988 return RejectPromise(promise, selfResolutionError);
10989 }
10990 if (Type(resolution) !== 'object')
10991 return FulfillPromise(promise, resolution);
10992 try {
10993 var then = resolution['then'];
10994 } catch(then) {
10995 return RejectPromise(promise, then);
10996 }
10997 if (!IsCallable(then))
10998 return FulfillPromise(promise, resolution);
10999 EnqueueJob('PromiseJobs', PromiseResolveThenableJob, [promise, resolution, then]);
11000 return undefined;
11001 };
11002 return F;
11003 }
11004
11005 // 25.4.1.4 FulfillPromise ( promise, value )
11006
11007 function FulfillPromise(promise, value) {
11008 console.assert(promise['[[PromiseState]]'] === 'pending');
11009 var reactions = promise['[[PromiseFulfillReactions]]'];
11010 set_internal(promise, '[[PromiseResult]]', value);
11011 set_internal(promise, '[[PromiseFulfillReactions]]', undefined);
11012 set_internal(promise, '[[PromiseRejectReactions]]', undefined);
11013 set_internal(promise, '[[PromiseState]]', 'fulfilled');
11014 return TriggerPromiseReactions(reactions, value);
11015 }
11016
11017 // 25.4.1.5 NewPromiseCapability ( C )
11018
11019 function NewPromiseCapability(c) {
11020 // To keep Promise hermetic, this doesn't look much like the spec.
11021 return CreatePromiseCapabilityRecord(undefined, c);
11022 }
11023
11024 // 25.4.1.5.1 CreatePromiseCapabilityRecord ( promise, constructor )
11025
11026 function CreatePromiseCapabilityRecord(promise, constructor) {
11027 // To keep Promise hermetic, this doesn't look much like the spec.
11028 console.assert(IsConstructor(constructor));
11029 var promiseCapability = {};
11030 set_internal(promiseCapability, '[[Promise]]', promise);
11031 set_internal(promiseCapability, '[[Resolve]]', undefined);
11032 set_internal(promiseCapability, '[[Reject]]', undefined);
11033 var executor = GetCapabilitiesExecutor();
11034 set_internal(executor, '[[Capability]]', promiseCapability);
11035
11036 // NOTE: Differs from spec; object is constructed here
11037 var constructorResult = promise = new constructor(executor);
11038 set_internal(promiseCapability, '[[Promise]]', promise);
11039
11040 if (!IsCallable(promiseCapability['[[Resolve]]'])) throw TypeError();
11041 if (!IsCallable(promiseCapability['[[Reject]]'])) throw TypeError();
11042 if (Type(constructorResult) === 'object' && !SameValue(promise, constructorResult)) throw TypeError();
11043 return promiseCapability;
11044 }
11045
11046 // 25.4.1.5.2 GetCapabilitiesExecutor Functions
11047
11048 function GetCapabilitiesExecutor() {
11049 var F = function(resolve, reject) {
11050 console.assert(F['[[Capability]]']);
11051 var promiseCapability = F['[[Capability]]'];
11052 if (promiseCapability['[[Resolve]]'] !== undefined) throw TypeError();
11053 if (promiseCapability['[[Reject]]'] !== undefined) throw TypeError();
11054 set_internal(promiseCapability, '[[Resolve]]', resolve);
11055 set_internal(promiseCapability, '[[Reject]]', reject);
11056 return undefined;
11057 };
11058 return F;
11059 }
11060
11061 // 25.4.1.6 IsPromise ( x )
11062
11063 function IsPromise(x) {
11064 if (Type(x) !== 'object') return false;
11065 if (!('[[PromiseState]]' in x)) return false;
11066 if (x['[[PromiseState]]'] === undefined) return false;
11067 return true;
11068 }
11069
11070 // 25.4.1.7 RejectPromise ( promise, reason )
11071
11072 function RejectPromise(promise, reason) {
11073 console.assert(promise['[[PromiseState]]'] === 'pending');
11074 var reactions = promise['[[PromiseRejectReactions]]'];
11075 set_internal(promise, '[[PromiseResult]]', reason);
11076 set_internal(promise, '[[PromiseFulfillReactions]]', undefined);
11077 set_internal(promise, '[[PromiseRejectReactions]]', undefined);
11078 set_internal(promise, '[[PromiseState]]', 'rejected');
11079 return TriggerPromiseReactions(reactions, reason);
11080 }
11081
11082 // 25.4.1.8 TriggerPromiseReactions ( reactions, argument )
11083
11084 function TriggerPromiseReactions(reactions, argument) {
11085 for (var i = 0, len = reactions.length; i < len; ++i)
11086 EnqueueJob('PromiseJobs', PromiseReactionJob, [reactions[i], argument]);
11087 return undefined;
11088 }
11089
11090 // 25.4.2 Promise Jobs
11091
11092 // 25.4.2.1 PromiseReactionJob ( reaction, argument )
11093
11094 function PromiseReactionJob(reaction, argument) {
11095 var promiseCapability = reaction['[[Capabilities]]'];
11096 var handler = reaction['[[Handler]]'];
11097 var handlerResult, status;
11098 try {
11099 if (handler === 'Identity') handlerResult = argument;
11100 else if (handler === 'Thrower') throw argument;
11101 else handlerResult = handler.call(undefined, argument);
11102 } catch (handlerResult) {
11103 status = promiseCapability['[[Reject]]'].call(undefined, handlerResult);
11104 NextJob(status); return;
11105 }
11106 status = promiseCapability['[[Resolve]]'].call(undefined, handlerResult);
11107 NextJob(status);
11108 }
11109
11110 // 25.4.2.2 PromiseResolveThenableJob ( promiseToResolve, thenable, then)
11111
11112 function PromiseResolveThenableJob(promiseToResolve, thenable, then) {
11113 // SPEC BUG: promise vs. promiseToResolve
11114 var resolvingFunctions = CreateResolvingFunctions(promiseToResolve);
11115 try {
11116 var thenCallResult = then.call(thenable, resolvingFunctions['[[Resolve]]'],
11117 resolvingFunctions['[[Reject]]']);
11118 } catch (thenCallResult) {
11119 var status = resolvingFunctions['[[Reject]]'].call(undefined, thenCallResult);
11120 NextJob(status); return;
11121 }
11122 NextJob(thenCallResult);
11123 }
11124
11125 // 25.4.3 The Promise Constructor
11126
11127 // 25.4.3.1 Promise ( executor )
11128
11129 function Promise(executor) {
11130 var config = { configurable: false, enumerable: false, writable: true, value: undefined };
11131 Object.defineProperty(this, '[[PromiseState]]', config);
11132 Object.defineProperty(this, '[[PromiseConstructor]]', config);
11133 Object.defineProperty(this, '[[PromiseResult]]', config);
11134 Object.defineProperty(this, '[[PromiseFulfillReactions]]', config);
11135 Object.defineProperty(this, '[[PromiseRejectReactions]]', config);
11136
11137 var promise = this;
11138 if (Type(promise) !== 'object') throw new TypeError();
11139 if (!('[[PromiseState]]' in promise)) throw TypeError();
11140 if (promise['[[PromiseState]]'] !== undefined) throw TypeError();
11141 if (!IsCallable(executor)) throw TypeError();
11142
11143 set_internal(promise, '[[PromiseConstructor]]', Promise);
11144
11145 return InitializePromise(promise, executor);
11146 }
11147
11148 // 25.4.3.1.1 InitializePromise ( promise, executor )
11149
11150 function InitializePromise(promise, executor) {
11151 console.assert('[[PromiseState]]' in promise);
11152 console.assert(IsCallable(executor));
11153 set_internal(promise, '[[PromiseState]]', 'pending');
11154 set_internal(promise, '[[PromiseFulfillReactions]]', []);
11155 set_internal(promise, '[[PromiseRejectReactions]]', []);
11156 var resolvingFunctions = CreateResolvingFunctions(promise);
11157 try {
11158 var completion = executor.call(undefined, resolvingFunctions['[[Resolve]]'],
11159 resolvingFunctions['[[Reject]]']);
11160 } catch (completion) {
11161 var status = resolvingFunctions['[[Reject]]'].call(undefined, completion);
11162 }
11163 return promise;
11164 }
11165
11166 // 25.4.4 Properties of the Promise Constructor
11167 // 25.4.4.1 Promise.all ( iterable )
11168
11169 define(Promise, 'all', function all(iterable) {
11170 var c = strict(this);
11171 var promiseCapability = NewPromiseCapability(c);
11172 try {
11173 var iterator = GetIterator(iterable);
11174 } catch (value) {
11175 promiseCapability['[[Reject]]'].call(undefined, value);
11176 return promiseCapability['[[Promise]]'];
11177 }
11178 var values = [];
11179 var remainingElementsCount = { value: 1 };
11180 var index = 0;
11181 while (true) {
11182 try {
11183 var next = IteratorStep(iterator);
11184 } catch (value) {
11185 promiseCapability['[[Reject]]'].call(undefined, value);
11186 return promiseCapability['[[Promise]]'];
11187 }
11188 if (!next) {
11189 remainingElementsCount.value -= 1;
11190 if (remainingElementsCount.value === 0) {
11191 var resolveResult = promiseCapability['[[Resolve]]'].apply(undefined, values);
11192
11193
11194 }
11195 return promiseCapability['[[Promise]]'];
11196 }
11197 try {
11198 var nextValue = IteratorValue(next);
11199 } catch (value) {
11200 promiseCapability['[[Reject]]'].call(undefined, value);
11201 return promiseCapability['[[Promise]]'];
11202 }
11203 try {
11204 var nextPromise = c.resolve(nextValue);
11205 } catch (value) {
11206 promiseCapability['[[Reject]]'].call(undefined, value);
11207 return promiseCapability['[[Promise]]'];
11208 }
11209 var resolveElement = PromiseAllResolveElementFunction();
11210 set_internal(resolveElement, '[[AlreadyCalled]]', { value: false });
11211 set_internal(resolveElement, '[[Index]]', index);
11212 set_internal(resolveElement, '[[Values]]', values);
11213 set_internal(resolveElement, '[[Capabilities]]', promiseCapability);
11214 set_internal(resolveElement, '[[RemainingElements]]', remainingElementsCount);
11215 remainingElementsCount.value += 1;
11216 try {
11217 var result = nextPromise.then(resolveElement, promiseCapability['[[Reject]]']);
11218 } catch (value) {
11219 promiseCapability['[[Reject]]'].call(undefined, value);
11220 return promiseCapability['[[Promise]]'];
11221 }
11222 index += 1;
11223 }
11224 });
11225
11226 // 25.4.4.1.1 Promise.all Resolve Element Functions
11227
11228 function PromiseAllResolveElementFunction() {
11229 var F = function(x) {
11230 var alreadyCalled = F['[[AlreadyCalled]]'];
11231 if (alreadyCalled.value) return undefined;
11232 alreadyCalled.value = true;
11233 var index = F['[[Index]]'];
11234 var values = F['[[Values]]'];
11235 var promiseCapability = F['[[Capabilities]]'];
11236 var remainingElementsCount = F['[[RemainingElements]]'];
11237 try {
11238 values[index] = x;
11239 } catch (result) {
11240 promiseCapability['[[Reject]]'].call(undefined, result);
11241 return promiseCapability['[[Promise]]'];
11242 }
11243 remainingElementsCount.value -= 1;
11244 if (remainingElementsCount.value === 0)
11245 return promiseCapability['[[Resolve]]'].call(undefined, values);
11246 return undefined;
11247 };
11248 return F;
11249 }
11250
11251 // 25.4.4.2 Promise.prototype
11252
11253 Promise.prototype = {};
11254
11255 // 25.4.4.3 Promise.race ( iterable )
11256
11257 define(Promise, 'race', function race(iterable) {
11258 var c = strict(this);
11259 var promiseCapability = NewPromiseCapability(c);
11260 try {
11261 var iterator = GetIterator(iterable);
11262 } catch (value) {
11263 promiseCapability['[[Reject]]'].call(undefined, value);
11264 return promiseCapability['[[Promise]]'];
11265 }
11266 while (true) {
11267 try {
11268 var next = IteratorStep(iterator);
11269 } catch (value) {
11270 promiseCapability['[[Reject]]'].call(undefined, value);
11271 return promiseCapability['[[Promise]]'];
11272 }
11273 if (!next) return promiseCapability['[[Promise]]'];
11274 try {
11275 var nextValue = IteratorValue(next);
11276 } catch (value) {
11277 promiseCapability['[[Reject]]'].call(undefined, value);
11278 return promiseCapability['[[Promise]]'];
11279 }
11280 try {
11281 var nextPromise = c.resolve(nextValue);
11282 } catch (value) {
11283 promiseCapability['[[Reject]]'].call(undefined, value);
11284 return promiseCapability['[[Promise]]'];
11285 }
11286 try {
11287 nextPromise.then(promiseCapability['[[Resolve]]'], promiseCapability['[[Reject]]']);
11288 } catch (value) {
11289 promiseCapability['[[Reject]]'].call(undefined, value);
11290 return promiseCapability['[[Promise]]'];
11291 }
11292 }
11293 });
11294
11295 // 25.4.4.4 Promise.reject ( r )
11296
11297 define(Promise, 'reject', function reject(r) {
11298 var c = strict(this);
11299 var promiseCapability = NewPromiseCapability(c);
11300 var rejectResult = promiseCapability['[[Reject]]'].call(undefined, r);
11301 return promiseCapability['[[Promise]]'];
11302 });
11303
11304 // 25.4.4.5 Promise.resolve ( x )
11305
11306 define(Promise, 'resolve', function resolve(x) {
11307 var c = strict(this);
11308 if (IsPromise(x)) {
11309 var constructor = x['[[PromiseConstructor]]'];
11310 if (SameValue(constructor, c)) return x;
11311 }
11312 var promiseCapability = NewPromiseCapability(c);
11313 var resolveResult = promiseCapability['[[Resolve]]'].call(undefined, x);
11314 return promiseCapability['[[Promise]]'];
11315 });
11316
11317 // 25.4.4.6 Promise [ @@create ] ( )
11318 // 25.4.4.6.1 AllocatePromise ( constructor )
11319 // 25.4.5 Properties of the Promise Prototype Object
11320 // 25.4.5.1 Promise.prototype.catch ( onRejected )
11321
11322 define(Promise.prototype, 'catch', function catch_(onRejected) {
11323 var promise = this;
11324 return promise.then(undefined, onRejected);
11325 });
11326
11327 // 25.4.5.2 Promise.prototype.constructor
11328
11329 Promise.prototype.constructor = Promise;
11330
11331 // 25.4.5.3 Promise.prototype.then ( onFulfilled , onRejected )
11332
11333 define(Promise.prototype, 'then', function then(onFulfilled, onRejected) {
11334 var promise = this;
11335 if (!IsPromise(promise)) throw TypeError();
11336 if (!IsCallable(onFulfilled)) onFulfilled = 'Identity';
11337 if (!IsCallable(onRejected)) onRejected = 'Thrower';
11338 var c = promise.constructor;
11339 var promiseCapability = NewPromiseCapability(c);
11340 var fulfillReaction = { '[[Capabilities]]': promiseCapability,
11341 '[[Handler]]': onFulfilled };
11342 var rejectReaction = { '[[Capabilities]]': promiseCapability,
11343 '[[Handler]]': onRejected };
11344 if (promise['[[PromiseState]]'] === 'pending') {
11345 promise['[[PromiseFulfillReactions]]'].push(fulfillReaction);
11346 promise['[[PromiseRejectReactions]]'].push(rejectReaction);
11347 } else if (promise['[[PromiseState]]'] === 'fulfilled') {
11348 var value = promise['[[PromiseResult]]'];
11349 EnqueueJob('PromiseJobs', PromiseReactionJob, [fulfillReaction, value]);
11350 } else if (promise['[[PromiseState]]'] === 'rejected') {
11351 var reason = promise['[[PromiseResult]]'];
11352 EnqueueJob('PromiseJobs', PromiseReactionJob, [rejectReaction, reason]);
11353 }
11354 return promiseCapability['[[Promise]]'];
11355 });
11356
11357 // 25.4.6 Properties of Promise Instances
11358
11359 if (!('Promise' in global) || OVERRIDE_NATIVE_FOR_TESTING)
11360 global.Promise = Promise;
11361
11362 // Patch early Promise.cast vs. Promise.resolve implementations
11363 if ('cast' in global.Promise) global.Promise.resolve = global.Promise.cast;
11364 }());
11365
11366 // 25.4.5.1 Promise.prototype [ @@toStringTag ]
11367 define(Promise.prototype, $$toStringTag, 'Promise');
11368
11369 // ---------------------------------------
11370 // 26 Reflection
11371 // ---------------------------------------
11372
11373 (function() {
11374 // 26.1 The Reflect Object
11375 if (!('Reflect' in global) || OVERRIDE_NATIVE_FOR_TESTING)
11376 global.Reflect = {};
11377
11378 // 26.1.1 Reflect.apply ( target, thisArgument, argumentsList )
11379 define(
11380 Reflect, 'apply',
11381 function apply(target, thisArgument, argumentsList) {
11382 if (!IsCallable(target)) throw TypeError();
11383 return Function.prototype.apply.call(target, thisArgument, argumentsList);
11384 });
11385
11386 // 26.1.2 Reflect.construct ( target, argumentsList [, newTarget] )
11387 define(
11388 Reflect, 'construct',
11389 function construct(target, argumentsList) {
11390 return __cons(target, argumentsList);
11391 });
11392
11393 // 26.1.3 Reflect.defineProperty ( target, propertyKey, attributes )
11394 define(
11395 Reflect, 'defineProperty',
11396 function defineProperty(target, propertyKey, attributes) {
11397 try {
11398 Object.defineProperty(target, propertyKey, attributes);
11399 return true;
11400 } catch (_) {
11401 return false;
11402 }
11403 });
11404
11405 // 26.1.4 Reflect.deleteProperty ( target, propertyKey )
11406 define(
11407 Reflect, 'deleteProperty',
11408 function deleteProperty(target,name) {
11409 try {
11410 delete target[name];
11411 return !HasOwnProperty(target, name);
11412 } catch (_) {
11413 return false;
11414 }
11415 });
11416
11417 // 26.1.5 Reflect.enumerate ( target )
11418 define(
11419 Reflect, 'enumerate',
11420 function enumerate(target) {
11421 target = ToObject(target);
11422 var iterator = Enumerate(target);
11423 return iterator;
11424 });
11425
11426 // 26.1.6 Reflect.get ( target, propertyKey [ , receiver ])
11427 define(
11428 Reflect, 'get',
11429 function get(target, name, receiver) {
11430 target = ToObject(target);
11431 name = String(name);
11432 receiver = (receiver === undefined) ? target : ToObject(receiver);
11433 var desc = getPropertyDescriptor(target, name);
11434 if (desc && 'get' in desc)
11435 return Function.prototype.call.call(desc['get'], receiver);
11436 return target[name];
11437 });
11438
11439 // 26.1.7 Reflect.getOwnPropertyDescriptor ( target, propertyKey )
11440 define(
11441 Reflect, 'getOwnPropertyDescriptor',
11442 Object.getOwnPropertyDescriptor);
11443
11444 // 26.1.8 Reflect.getPrototypeOf ( target )
11445 define(
11446 Reflect, 'getPrototypeOf',
11447 Object.getPrototypeOf);
11448
11449 // 26.1.9 Reflect.has ( target, propertyKey )
11450 define(
11451 Reflect, 'has',
11452 function has(target,name) {
11453 return String(name) in ToObject(target);
11454 });
11455
11456 // 26.1.10 Reflect.isExtensible (target)
11457 define(
11458 Reflect, 'isExtensible',
11459 Object.isExtensible);
11460
11461 // 26.1.11 Reflect.ownKeys ( target )
11462 define(
11463 Reflect, 'ownKeys',
11464 function ownKeys(target) {
11465 var obj = ToObject(target);
11466 return Object.getOwnPropertyNames(obj);
11467 });
11468
11469 // 26.1.12 Reflect.preventExtensions ( target )
11470 define(
11471 Reflect, 'preventExtensions',
11472 function preventExtensions(target) {
11473 try { Object.preventExtensions(target); return true; } catch (_) { return false; }
11474 });
11475
11476 // 26.1.13 Reflect.set ( target, propertyKey, V [ , receiver ] )
11477 define(
11478 Reflect, 'set',
11479 function set(target, name, value, receiver) {
11480 target = ToObject(target);
11481 name = String(name);
11482 receiver = (receiver === undefined) ? target : ToObject(receiver);
11483 var desc = getPropertyDescriptor(target, name);
11484 try {
11485 if (desc && 'set' in desc)
11486 Function.prototype.call.call(desc['set'], receiver, value);
11487 else
11488 target[name] = value;
11489 return true;
11490 } catch (_) {
11491 return false;
11492 }
11493 });
11494
11495 // 26.1.14 Reflect.setPrototypeOf ( target, proto )
11496 define(
11497 Reflect, 'setPrototypeOf',
11498 function setPrototypeOf(target, proto) {
11499 try {
11500 target.__proto__ = proto;
11501 return Reflect.getPrototypeOf(target) === proto;
11502 } catch(_) {
11503 return false;
11504 }
11505 });
11506
11507 }());
11508
11509 // ---------------------------------------
11510 // 26.2 Proxy Objects
11511 // ---------------------------------------
11512
11513 // Not polyfillable.
11514
11515}(self));
11516
11517// This helper is defined outside the main scope so that the use of
11518// 'eval' does not taint the scope for minifiers.
11519function __cons(t, a) {
11520 return eval('new t(' + a.map(function(_, i) { return 'a[' + i + ']'; }).join(',') + ')');
11521}
11522</script>
11523 <script>(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.foo = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
11524'use strict'
11525
11526exports.byteLength = byteLength
11527exports.toByteArray = toByteArray
11528exports.fromByteArray = fromByteArray
11529
11530var lookup = []
11531var revLookup = []
11532var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
11533
11534var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
11535for (var i = 0, len = code.length; i < len; ++i) {
11536 lookup[i] = code[i]
11537 revLookup[code.charCodeAt(i)] = i
11538}
11539
11540revLookup['-'.charCodeAt(0)] = 62
11541revLookup['_'.charCodeAt(0)] = 63
11542
11543function placeHoldersCount (b64) {
11544 var len = b64.length
11545 if (len % 4 > 0) {
11546 throw new Error('Invalid string. Length must be a multiple of 4')
11547 }
11548
11549 // the number of equal signs (place holders)
11550 // if there are two placeholders, than the two characters before it
11551 // represent one byte
11552 // if there is only one, then the three characters before it represent 2 bytes
11553 // this is just a cheap hack to not do indexOf twice
11554 return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
11555}
11556
11557function byteLength (b64) {
11558 // base64 is 4/3 + up to two characters of the original data
11559 return b64.length * 3 / 4 - placeHoldersCount(b64)
11560}
11561
11562function toByteArray (b64) {
11563 var i, j, l, tmp, placeHolders, arr
11564 var len = b64.length
11565 placeHolders = placeHoldersCount(b64)
11566
11567 arr = new Arr(len * 3 / 4 - placeHolders)
11568
11569 // if there are placeholders, only get up to the last complete 4 chars
11570 l = placeHolders > 0 ? len - 4 : len
11571
11572 var L = 0
11573
11574 for (i = 0, j = 0; i < l; i += 4, j += 3) {
11575 tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
11576 arr[L++] = (tmp >> 16) & 0xFF
11577 arr[L++] = (tmp >> 8) & 0xFF
11578 arr[L++] = tmp & 0xFF
11579 }
11580
11581 if (placeHolders === 2) {
11582 tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
11583 arr[L++] = tmp & 0xFF
11584 } else if (placeHolders === 1) {
11585 tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
11586 arr[L++] = (tmp >> 8) & 0xFF
11587 arr[L++] = tmp & 0xFF
11588 }
11589
11590 return arr
11591}
11592
11593function tripletToBase64 (num) {
11594 return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
11595}
11596
11597function encodeChunk (uint8, start, end) {
11598 var tmp
11599 var output = []
11600 for (var i = start; i < end; i += 3) {
11601 tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
11602 output.push(tripletToBase64(tmp))
11603 }
11604 return output.join('')
11605}
11606
11607function fromByteArray (uint8) {
11608 var tmp
11609 var len = uint8.length
11610 var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
11611 var output = ''
11612 var parts = []
11613 var maxChunkLength = 16383 // must be multiple of 3
11614
11615 // go through the array every three bytes, we'll deal with trailing stuff later
11616 for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
11617 parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
11618 }
11619
11620 // pad the end with zeros, but make sure to not forget the extra bytes
11621 if (extraBytes === 1) {
11622 tmp = uint8[len - 1]
11623 output += lookup[tmp >> 2]
11624 output += lookup[(tmp << 4) & 0x3F]
11625 output += '=='
11626 } else if (extraBytes === 2) {
11627 tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
11628 output += lookup[tmp >> 10]
11629 output += lookup[(tmp >> 4) & 0x3F]
11630 output += lookup[(tmp << 2) & 0x3F]
11631 output += '='
11632 }
11633
11634 parts.push(output)
11635
11636 return parts.join('')
11637}
11638
11639},{}],2:[function(require,module,exports){
11640/*!
11641 * The buffer module from node.js, for the browser.
11642 *
11643 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
11644 * @license MIT
11645 */
11646/* eslint-disable no-proto */
11647
11648'use strict'
11649
11650var base64 = require('base64-js')
11651var ieee754 = require('ieee754')
11652
11653exports.Buffer = Buffer
11654exports.SlowBuffer = SlowBuffer
11655exports.INSPECT_MAX_BYTES = 50
11656
11657var K_MAX_LENGTH = 0x7fffffff
11658exports.kMaxLength = K_MAX_LENGTH
11659
11660/**
11661 * If `Buffer.TYPED_ARRAY_SUPPORT`:
11662 * === true Use Uint8Array implementation (fastest)
11663 * === false Print warning and recommend using `buffer` v4.x which has an Object
11664 * implementation (most compatible, even IE6)
11665 *
11666 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
11667 * Opera 11.6+, iOS 4.2+.
11668 *
11669 * We report that the browser does not support typed arrays if the are not subclassable
11670 * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
11671 * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
11672 * for __proto__ and has a buggy typed array implementation.
11673 */
11674Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
11675
11676if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
11677 typeof console.error === 'function') {
11678 console.error(
11679 'This browser lacks typed array (Uint8Array) support which is required by ' +
11680 '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
11681 )
11682}
11683
11684function typedArraySupport () {
11685 // Can typed array instances can be augmented?
11686 try {
11687 var arr = new Uint8Array(1)
11688 arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
11689 return arr.foo() === 42
11690 } catch (e) {
11691 return false
11692 }
11693}
11694
11695function createBuffer (length) {
11696 if (length > K_MAX_LENGTH) {
11697 throw new RangeError('Invalid typed array length')
11698 }
11699 // Return an augmented `Uint8Array` instance
11700 var buf = new Uint8Array(length)
11701 buf.__proto__ = Buffer.prototype
11702 return buf
11703}
11704
11705/**
11706 * The Buffer constructor returns instances of `Uint8Array` that have their
11707 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
11708 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
11709 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
11710 * returns a single octet.
11711 *
11712 * The `Uint8Array` prototype remains unmodified.
11713 */
11714
11715function Buffer (arg, encodingOrOffset, length) {
11716 // Common case.
11717 if (typeof arg === 'number') {
11718 if (typeof encodingOrOffset === 'string') {
11719 throw new Error(
11720 'If encoding is specified then the first argument must be a string'
11721 )
11722 }
11723 return allocUnsafe(arg)
11724 }
11725 return from(arg, encodingOrOffset, length)
11726}
11727
11728// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
11729if (typeof Symbol !== 'undefined' && Symbol.species &&
11730 Buffer[Symbol.species] === Buffer) {
11731 Object.defineProperty(Buffer, Symbol.species, {
11732 value: null,
11733 configurable: true,
11734 enumerable: false,
11735 writable: false
11736 })
11737}
11738
11739Buffer.poolSize = 8192 // not used by this implementation
11740
11741function from (value, encodingOrOffset, length) {
11742 if (typeof value === 'number') {
11743 throw new TypeError('"value" argument must not be a number')
11744 }
11745
11746 if (value instanceof ArrayBuffer) {
11747 return fromArrayBuffer(value, encodingOrOffset, length)
11748 }
11749
11750 if (typeof value === 'string') {
11751 return fromString(value, encodingOrOffset)
11752 }
11753
11754 return fromObject(value)
11755}
11756
11757/**
11758 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
11759 * if value is a number.
11760 * Buffer.from(str[, encoding])
11761 * Buffer.from(array)
11762 * Buffer.from(buffer)
11763 * Buffer.from(arrayBuffer[, byteOffset[, length]])
11764 **/
11765Buffer.from = function (value, encodingOrOffset, length) {
11766 return from(value, encodingOrOffset, length)
11767}
11768
11769// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
11770// https://github.com/feross/buffer/pull/148
11771Buffer.prototype.__proto__ = Uint8Array.prototype
11772Buffer.__proto__ = Uint8Array
11773
11774function assertSize (size) {
11775 if (typeof size !== 'number') {
11776 throw new TypeError('"size" argument must be a number')
11777 } else if (size < 0) {
11778 throw new RangeError('"size" argument must not be negative')
11779 }
11780}
11781
11782function alloc (size, fill, encoding) {
11783 assertSize(size)
11784 if (size <= 0) {
11785 return createBuffer(size)
11786 }
11787 if (fill !== undefined) {
11788 // Only pay attention to encoding if it's a string. This
11789 // prevents accidentally sending in a number that would
11790 // be interpretted as a start offset.
11791 return typeof encoding === 'string'
11792 ? createBuffer(size).fill(fill, encoding)
11793 : createBuffer(size).fill(fill)
11794 }
11795 return createBuffer(size)
11796}
11797
11798/**
11799 * Creates a new filled Buffer instance.
11800 * alloc(size[, fill[, encoding]])
11801 **/
11802Buffer.alloc = function (size, fill, encoding) {
11803 return alloc(size, fill, encoding)
11804}
11805
11806function allocUnsafe (size) {
11807 assertSize(size)
11808 return createBuffer(size < 0 ? 0 : checked(size) | 0)
11809}
11810
11811/**
11812 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
11813 * */
11814Buffer.allocUnsafe = function (size) {
11815 return allocUnsafe(size)
11816}
11817/**
11818 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
11819 */
11820Buffer.allocUnsafeSlow = function (size) {
11821 return allocUnsafe(size)
11822}
11823
11824function fromString (string, encoding) {
11825 if (typeof encoding !== 'string' || encoding === '') {
11826 encoding = 'utf8'
11827 }
11828
11829 if (!Buffer.isEncoding(encoding)) {
11830 throw new TypeError('"encoding" must be a valid string encoding')
11831 }
11832
11833 var length = byteLength(string, encoding) | 0
11834 var buf = createBuffer(length)
11835
11836 var actual = buf.write(string, encoding)
11837
11838 if (actual !== length) {
11839 // Writing a hex string, for example, that contains invalid characters will
11840 // cause everything after the first invalid character to be ignored. (e.g.
11841 // 'abxxcd' will be treated as 'ab')
11842 buf = buf.slice(0, actual)
11843 }
11844
11845 return buf
11846}
11847
11848function fromArrayLike (array) {
11849 var length = array.length < 0 ? 0 : checked(array.length) | 0
11850 var buf = createBuffer(length)
11851 for (var i = 0; i < length; i += 1) {
11852 buf[i] = array[i] & 255
11853 }
11854 return buf
11855}
11856
11857function fromArrayBuffer (array, byteOffset, length) {
11858 if (byteOffset < 0 || array.byteLength < byteOffset) {
11859 throw new RangeError('\'offset\' is out of bounds')
11860 }
11861
11862 if (array.byteLength < byteOffset + (length || 0)) {
11863 throw new RangeError('\'length\' is out of bounds')
11864 }
11865
11866 var buf
11867 if (byteOffset === undefined && length === undefined) {
11868 buf = new Uint8Array(array)
11869 } else if (length === undefined) {
11870 buf = new Uint8Array(array, byteOffset)
11871 } else {
11872 buf = new Uint8Array(array, byteOffset, length)
11873 }
11874
11875 // Return an augmented `Uint8Array` instance
11876 buf.__proto__ = Buffer.prototype
11877 return buf
11878}
11879
11880function fromObject (obj) {
11881 if (Buffer.isBuffer(obj)) {
11882 var len = checked(obj.length) | 0
11883 var buf = createBuffer(len)
11884
11885 if (buf.length === 0) {
11886 return buf
11887 }
11888
11889 obj.copy(buf, 0, 0, len)
11890 return buf
11891 }
11892
11893 if (obj) {
11894 if (isArrayBufferView(obj) || 'length' in obj) {
11895 if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
11896 return createBuffer(0)
11897 }
11898 return fromArrayLike(obj)
11899 }
11900
11901 if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
11902 return fromArrayLike(obj.data)
11903 }
11904 }
11905
11906 throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
11907}
11908
11909function checked (length) {
11910 // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
11911 // length is NaN (which is otherwise coerced to zero.)
11912 if (length >= K_MAX_LENGTH) {
11913 throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
11914 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
11915 }
11916 return length | 0
11917}
11918
11919function SlowBuffer (length) {
11920 if (+length != length) { // eslint-disable-line eqeqeq
11921 length = 0
11922 }
11923 return Buffer.alloc(+length)
11924}
11925
11926Buffer.isBuffer = function isBuffer (b) {
11927 return b != null && b._isBuffer === true
11928}
11929
11930Buffer.compare = function compare (a, b) {
11931 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
11932 throw new TypeError('Arguments must be Buffers')
11933 }
11934
11935 if (a === b) return 0
11936
11937 var x = a.length
11938 var y = b.length
11939
11940 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
11941 if (a[i] !== b[i]) {
11942 x = a[i]
11943 y = b[i]
11944 break
11945 }
11946 }
11947
11948 if (x < y) return -1
11949 if (y < x) return 1
11950 return 0
11951}
11952
11953Buffer.isEncoding = function isEncoding (encoding) {
11954 switch (String(encoding).toLowerCase()) {
11955 case 'hex':
11956 case 'utf8':
11957 case 'utf-8':
11958 case 'ascii':
11959 case 'latin1':
11960 case 'binary':
11961 case 'base64':
11962 case 'ucs2':
11963 case 'ucs-2':
11964 case 'utf16le':
11965 case 'utf-16le':
11966 return true
11967 default:
11968 return false
11969 }
11970}
11971
11972Buffer.concat = function concat (list, length) {
11973 if (!Array.isArray(list)) {
11974 throw new TypeError('"list" argument must be an Array of Buffers')
11975 }
11976
11977 if (list.length === 0) {
11978 return Buffer.alloc(0)
11979 }
11980
11981 var i
11982 if (length === undefined) {
11983 length = 0
11984 for (i = 0; i < list.length; ++i) {
11985 length += list[i].length
11986 }
11987 }
11988
11989 var buffer = Buffer.allocUnsafe(length)
11990 var pos = 0
11991 for (i = 0; i < list.length; ++i) {
11992 var buf = list[i]
11993 if (!Buffer.isBuffer(buf)) {
11994 throw new TypeError('"list" argument must be an Array of Buffers')
11995 }
11996 buf.copy(buffer, pos)
11997 pos += buf.length
11998 }
11999 return buffer
12000}
12001
12002function byteLength (string, encoding) {
12003 if (Buffer.isBuffer(string)) {
12004 return string.length
12005 }
12006 if (isArrayBufferView(string) || string instanceof ArrayBuffer) {
12007 return string.byteLength
12008 }
12009 if (typeof string !== 'string') {
12010 string = '' + string
12011 }
12012
12013 var len = string.length
12014 if (len === 0) return 0
12015
12016 // Use a for loop to avoid recursion
12017 var loweredCase = false
12018 for (;;) {
12019 switch (encoding) {
12020 case 'ascii':
12021 case 'latin1':
12022 case 'binary':
12023 return len
12024 case 'utf8':
12025 case 'utf-8':
12026 case undefined:
12027 return utf8ToBytes(string).length
12028 case 'ucs2':
12029 case 'ucs-2':
12030 case 'utf16le':
12031 case 'utf-16le':
12032 return len * 2
12033 case 'hex':
12034 return len >>> 1
12035 case 'base64':
12036 return base64ToBytes(string).length
12037 default:
12038 if (loweredCase) return utf8ToBytes(string).length // assume utf8
12039 encoding = ('' + encoding).toLowerCase()
12040 loweredCase = true
12041 }
12042 }
12043}
12044Buffer.byteLength = byteLength
12045
12046function slowToString (encoding, start, end) {
12047 var loweredCase = false
12048
12049 // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
12050 // property of a typed array.
12051
12052 // This behaves neither like String nor Uint8Array in that we set start/end
12053 // to their upper/lower bounds if the value passed is out of range.
12054 // undefined is handled specially as per ECMA-262 6th Edition,
12055 // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
12056 if (start === undefined || start < 0) {
12057 start = 0
12058 }
12059 // Return early if start > this.length. Done here to prevent potential uint32
12060 // coercion fail below.
12061 if (start > this.length) {
12062 return ''
12063 }
12064
12065 if (end === undefined || end > this.length) {
12066 end = this.length
12067 }
12068
12069 if (end <= 0) {
12070 return ''
12071 }
12072
12073 // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
12074 end >>>= 0
12075 start >>>= 0
12076
12077 if (end <= start) {
12078 return ''
12079 }
12080
12081 if (!encoding) encoding = 'utf8'
12082
12083 while (true) {
12084 switch (encoding) {
12085 case 'hex':
12086 return hexSlice(this, start, end)
12087
12088 case 'utf8':
12089 case 'utf-8':
12090 return utf8Slice(this, start, end)
12091
12092 case 'ascii':
12093 return asciiSlice(this, start, end)
12094
12095 case 'latin1':
12096 case 'binary':
12097 return latin1Slice(this, start, end)
12098
12099 case 'base64':
12100 return base64Slice(this, start, end)
12101
12102 case 'ucs2':
12103 case 'ucs-2':
12104 case 'utf16le':
12105 case 'utf-16le':
12106 return utf16leSlice(this, start, end)
12107
12108 default:
12109 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
12110 encoding = (encoding + '').toLowerCase()
12111 loweredCase = true
12112 }
12113 }
12114}
12115
12116// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
12117// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
12118// reliably in a browserify context because there could be multiple different
12119// copies of the 'buffer' package in use. This method works even for Buffer
12120// instances that were created from another copy of the `buffer` package.
12121// See: https://github.com/feross/buffer/issues/154
12122Buffer.prototype._isBuffer = true
12123
12124function swap (b, n, m) {
12125 var i = b[n]
12126 b[n] = b[m]
12127 b[m] = i
12128}
12129
12130Buffer.prototype.swap16 = function swap16 () {
12131 var len = this.length
12132 if (len % 2 !== 0) {
12133 throw new RangeError('Buffer size must be a multiple of 16-bits')
12134 }
12135 for (var i = 0; i < len; i += 2) {
12136 swap(this, i, i + 1)
12137 }
12138 return this
12139}
12140
12141Buffer.prototype.swap32 = function swap32 () {
12142 var len = this.length
12143 if (len % 4 !== 0) {
12144 throw new RangeError('Buffer size must be a multiple of 32-bits')
12145 }
12146 for (var i = 0; i < len; i += 4) {
12147 swap(this, i, i + 3)
12148 swap(this, i + 1, i + 2)
12149 }
12150 return this
12151}
12152
12153Buffer.prototype.swap64 = function swap64 () {
12154 var len = this.length
12155 if (len % 8 !== 0) {
12156 throw new RangeError('Buffer size must be a multiple of 64-bits')
12157 }
12158 for (var i = 0; i < len; i += 8) {
12159 swap(this, i, i + 7)
12160 swap(this, i + 1, i + 6)
12161 swap(this, i + 2, i + 5)
12162 swap(this, i + 3, i + 4)
12163 }
12164 return this
12165}
12166
12167Buffer.prototype.toString = function toString () {
12168 var length = this.length
12169 if (length === 0) return ''
12170 if (arguments.length === 0) return utf8Slice(this, 0, length)
12171 return slowToString.apply(this, arguments)
12172}
12173
12174Buffer.prototype.equals = function equals (b) {
12175 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
12176 if (this === b) return true
12177 return Buffer.compare(this, b) === 0
12178}
12179
12180Buffer.prototype.inspect = function inspect () {
12181 var str = ''
12182 var max = exports.INSPECT_MAX_BYTES
12183 if (this.length > 0) {
12184 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
12185 if (this.length > max) str += ' ... '
12186 }
12187 return '<Buffer ' + str + '>'
12188}
12189
12190Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
12191 if (!Buffer.isBuffer(target)) {
12192 throw new TypeError('Argument must be a Buffer')
12193 }
12194
12195 if (start === undefined) {
12196 start = 0
12197 }
12198 if (end === undefined) {
12199 end = target ? target.length : 0
12200 }
12201 if (thisStart === undefined) {
12202 thisStart = 0
12203 }
12204 if (thisEnd === undefined) {
12205 thisEnd = this.length
12206 }
12207
12208 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
12209 throw new RangeError('out of range index')
12210 }
12211
12212 if (thisStart >= thisEnd && start >= end) {
12213 return 0
12214 }
12215 if (thisStart >= thisEnd) {
12216 return -1
12217 }
12218 if (start >= end) {
12219 return 1
12220 }
12221
12222 start >>>= 0
12223 end >>>= 0
12224 thisStart >>>= 0
12225 thisEnd >>>= 0
12226
12227 if (this === target) return 0
12228
12229 var x = thisEnd - thisStart
12230 var y = end - start
12231 var len = Math.min(x, y)
12232
12233 var thisCopy = this.slice(thisStart, thisEnd)
12234 var targetCopy = target.slice(start, end)
12235
12236 for (var i = 0; i < len; ++i) {
12237 if (thisCopy[i] !== targetCopy[i]) {
12238 x = thisCopy[i]
12239 y = targetCopy[i]
12240 break
12241 }
12242 }
12243
12244 if (x < y) return -1
12245 if (y < x) return 1
12246 return 0
12247}
12248
12249// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
12250// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
12251//
12252// Arguments:
12253// - buffer - a Buffer to search
12254// - val - a string, Buffer, or number
12255// - byteOffset - an index into `buffer`; will be clamped to an int32
12256// - encoding - an optional encoding, relevant is val is a string
12257// - dir - true for indexOf, false for lastIndexOf
12258function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
12259 // Empty buffer means no match
12260 if (buffer.length === 0) return -1
12261
12262 // Normalize byteOffset
12263 if (typeof byteOffset === 'string') {
12264 encoding = byteOffset
12265 byteOffset = 0
12266 } else if (byteOffset > 0x7fffffff) {
12267 byteOffset = 0x7fffffff
12268 } else if (byteOffset < -0x80000000) {
12269 byteOffset = -0x80000000
12270 }
12271 byteOffset = +byteOffset // Coerce to Number.
12272 if (numberIsNaN(byteOffset)) {
12273 // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
12274 byteOffset = dir ? 0 : (buffer.length - 1)
12275 }
12276
12277 // Normalize byteOffset: negative offsets start from the end of the buffer
12278 if (byteOffset < 0) byteOffset = buffer.length + byteOffset
12279 if (byteOffset >= buffer.length) {
12280 if (dir) return -1
12281 else byteOffset = buffer.length - 1
12282 } else if (byteOffset < 0) {
12283 if (dir) byteOffset = 0
12284 else return -1
12285 }
12286
12287 // Normalize val
12288 if (typeof val === 'string') {
12289 val = Buffer.from(val, encoding)
12290 }
12291
12292 // Finally, search either indexOf (if dir is true) or lastIndexOf
12293 if (Buffer.isBuffer(val)) {
12294 // Special case: looking for empty string/buffer always fails
12295 if (val.length === 0) {
12296 return -1
12297 }
12298 return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
12299 } else if (typeof val === 'number') {
12300 val = val & 0xFF // Search for a byte value [0-255]
12301 if (typeof Uint8Array.prototype.indexOf === 'function') {
12302 if (dir) {
12303 return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
12304 } else {
12305 return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
12306 }
12307 }
12308 return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
12309 }
12310
12311 throw new TypeError('val must be string, number or Buffer')
12312}
12313
12314function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
12315 var indexSize = 1
12316 var arrLength = arr.length
12317 var valLength = val.length
12318
12319 if (encoding !== undefined) {
12320 encoding = String(encoding).toLowerCase()
12321 if (encoding === 'ucs2' || encoding === 'ucs-2' ||
12322 encoding === 'utf16le' || encoding === 'utf-16le') {
12323 if (arr.length < 2 || val.length < 2) {
12324 return -1
12325 }
12326 indexSize = 2
12327 arrLength /= 2
12328 valLength /= 2
12329 byteOffset /= 2
12330 }
12331 }
12332
12333 function read (buf, i) {
12334 if (indexSize === 1) {
12335 return buf[i]
12336 } else {
12337 return buf.readUInt16BE(i * indexSize)
12338 }
12339 }
12340
12341 var i
12342 if (dir) {
12343 var foundIndex = -1
12344 for (i = byteOffset; i < arrLength; i++) {
12345 if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
12346 if (foundIndex === -1) foundIndex = i
12347 if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
12348 } else {
12349 if (foundIndex !== -1) i -= i - foundIndex
12350 foundIndex = -1
12351 }
12352 }
12353 } else {
12354 if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
12355 for (i = byteOffset; i >= 0; i--) {
12356 var found = true
12357 for (var j = 0; j < valLength; j++) {
12358 if (read(arr, i + j) !== read(val, j)) {
12359 found = false
12360 break
12361 }
12362 }
12363 if (found) return i
12364 }
12365 }
12366
12367 return -1
12368}
12369
12370Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
12371 return this.indexOf(val, byteOffset, encoding) !== -1
12372}
12373
12374Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
12375 return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
12376}
12377
12378Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
12379 return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
12380}
12381
12382function hexWrite (buf, string, offset, length) {
12383 offset = Number(offset) || 0
12384 var remaining = buf.length - offset
12385 if (!length) {
12386 length = remaining
12387 } else {
12388 length = Number(length)
12389 if (length > remaining) {
12390 length = remaining
12391 }
12392 }
12393
12394 // must be an even number of digits
12395 var strLen = string.length
12396 if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
12397
12398 if (length > strLen / 2) {
12399 length = strLen / 2
12400 }
12401 for (var i = 0; i < length; ++i) {
12402 var parsed = parseInt(string.substr(i * 2, 2), 16)
12403 if (numberIsNaN(parsed)) return i
12404 buf[offset + i] = parsed
12405 }
12406 return i
12407}
12408
12409function utf8Write (buf, string, offset, length) {
12410 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
12411}
12412
12413function asciiWrite (buf, string, offset, length) {
12414 return blitBuffer(asciiToBytes(string), buf, offset, length)
12415}
12416
12417function latin1Write (buf, string, offset, length) {
12418 return asciiWrite(buf, string, offset, length)
12419}
12420
12421function base64Write (buf, string, offset, length) {
12422 return blitBuffer(base64ToBytes(string), buf, offset, length)
12423}
12424
12425function ucs2Write (buf, string, offset, length) {
12426 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
12427}
12428
12429Buffer.prototype.write = function write (string, offset, length, encoding) {
12430 // Buffer#write(string)
12431 if (offset === undefined) {
12432 encoding = 'utf8'
12433 length = this.length
12434 offset = 0
12435 // Buffer#write(string, encoding)
12436 } else if (length === undefined && typeof offset === 'string') {
12437 encoding = offset
12438 length = this.length
12439 offset = 0
12440 // Buffer#write(string, offset[, length][, encoding])
12441 } else if (isFinite(offset)) {
12442 offset = offset >>> 0
12443 if (isFinite(length)) {
12444 length = length >>> 0
12445 if (encoding === undefined) encoding = 'utf8'
12446 } else {
12447 encoding = length
12448 length = undefined
12449 }
12450 } else {
12451 throw new Error(
12452 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
12453 )
12454 }
12455
12456 var remaining = this.length - offset
12457 if (length === undefined || length > remaining) length = remaining
12458
12459 if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
12460 throw new RangeError('Attempt to write outside buffer bounds')
12461 }
12462
12463 if (!encoding) encoding = 'utf8'
12464
12465 var loweredCase = false
12466 for (;;) {
12467 switch (encoding) {
12468 case 'hex':
12469 return hexWrite(this, string, offset, length)
12470
12471 case 'utf8':
12472 case 'utf-8':
12473 return utf8Write(this, string, offset, length)
12474
12475 case 'ascii':
12476 return asciiWrite(this, string, offset, length)
12477
12478 case 'latin1':
12479 case 'binary':
12480 return latin1Write(this, string, offset, length)
12481
12482 case 'base64':
12483 // Warning: maxLength not taken into account in base64Write
12484 return base64Write(this, string, offset, length)
12485
12486 case 'ucs2':
12487 case 'ucs-2':
12488 case 'utf16le':
12489 case 'utf-16le':
12490 return ucs2Write(this, string, offset, length)
12491
12492 default:
12493 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
12494 encoding = ('' + encoding).toLowerCase()
12495 loweredCase = true
12496 }
12497 }
12498}
12499
12500Buffer.prototype.toJSON = function toJSON () {
12501 return {
12502 type: 'Buffer',
12503 data: Array.prototype.slice.call(this._arr || this, 0)
12504 }
12505}
12506
12507function base64Slice (buf, start, end) {
12508 if (start === 0 && end === buf.length) {
12509 return base64.fromByteArray(buf)
12510 } else {
12511 return base64.fromByteArray(buf.slice(start, end))
12512 }
12513}
12514
12515function utf8Slice (buf, start, end) {
12516 end = Math.min(buf.length, end)
12517 var res = []
12518
12519 var i = start
12520 while (i < end) {
12521 var firstByte = buf[i]
12522 var codePoint = null
12523 var bytesPerSequence = (firstByte > 0xEF) ? 4
12524 : (firstByte > 0xDF) ? 3
12525 : (firstByte > 0xBF) ? 2
12526 : 1
12527
12528 if (i + bytesPerSequence <= end) {
12529 var secondByte, thirdByte, fourthByte, tempCodePoint
12530
12531 switch (bytesPerSequence) {
12532 case 1:
12533 if (firstByte < 0x80) {
12534 codePoint = firstByte
12535 }
12536 break
12537 case 2:
12538 secondByte = buf[i + 1]
12539 if ((secondByte & 0xC0) === 0x80) {
12540 tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
12541 if (tempCodePoint > 0x7F) {
12542 codePoint = tempCodePoint
12543 }
12544 }
12545 break
12546 case 3:
12547 secondByte = buf[i + 1]
12548 thirdByte = buf[i + 2]
12549 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
12550 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
12551 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
12552 codePoint = tempCodePoint
12553 }
12554 }
12555 break
12556 case 4:
12557 secondByte = buf[i + 1]
12558 thirdByte = buf[i + 2]
12559 fourthByte = buf[i + 3]
12560 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
12561 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
12562 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
12563 codePoint = tempCodePoint
12564 }
12565 }
12566 }
12567 }
12568
12569 if (codePoint === null) {
12570 // we did not generate a valid codePoint so insert a
12571 // replacement char (U+FFFD) and advance only 1 byte
12572 codePoint = 0xFFFD
12573 bytesPerSequence = 1
12574 } else if (codePoint > 0xFFFF) {
12575 // encode to utf16 (surrogate pair dance)
12576 codePoint -= 0x10000
12577 res.push(codePoint >>> 10 & 0x3FF | 0xD800)
12578 codePoint = 0xDC00 | codePoint & 0x3FF
12579 }
12580
12581 res.push(codePoint)
12582 i += bytesPerSequence
12583 }
12584
12585 return decodeCodePointsArray(res)
12586}
12587
12588// Based on http://stackoverflow.com/a/22747272/680742, the browser with
12589// the lowest limit is Chrome, with 0x10000 args.
12590// We go 1 magnitude less, for safety
12591var MAX_ARGUMENTS_LENGTH = 0x1000
12592
12593function decodeCodePointsArray (codePoints) {
12594 var len = codePoints.length
12595 if (len <= MAX_ARGUMENTS_LENGTH) {
12596 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
12597 }
12598
12599 // Decode in chunks to avoid "call stack size exceeded".
12600 var res = ''
12601 var i = 0
12602 while (i < len) {
12603 res += String.fromCharCode.apply(
12604 String,
12605 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
12606 )
12607 }
12608 return res
12609}
12610
12611function asciiSlice (buf, start, end) {
12612 var ret = ''
12613 end = Math.min(buf.length, end)
12614
12615 for (var i = start; i < end; ++i) {
12616 ret += String.fromCharCode(buf[i] & 0x7F)
12617 }
12618 return ret
12619}
12620
12621function latin1Slice (buf, start, end) {
12622 var ret = ''
12623 end = Math.min(buf.length, end)
12624
12625 for (var i = start; i < end; ++i) {
12626 ret += String.fromCharCode(buf[i])
12627 }
12628 return ret
12629}
12630
12631function hexSlice (buf, start, end) {
12632 var len = buf.length
12633
12634 if (!start || start < 0) start = 0
12635 if (!end || end < 0 || end > len) end = len
12636
12637 var out = ''
12638 for (var i = start; i < end; ++i) {
12639 out += toHex(buf[i])
12640 }
12641 return out
12642}
12643
12644function utf16leSlice (buf, start, end) {
12645 var bytes = buf.slice(start, end)
12646 var res = ''
12647 for (var i = 0; i < bytes.length; i += 2) {
12648 res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
12649 }
12650 return res
12651}
12652
12653Buffer.prototype.slice = function slice (start, end) {
12654 var len = this.length
12655 start = ~~start
12656 end = end === undefined ? len : ~~end
12657
12658 if (start < 0) {
12659 start += len
12660 if (start < 0) start = 0
12661 } else if (start > len) {
12662 start = len
12663 }
12664
12665 if (end < 0) {
12666 end += len
12667 if (end < 0) end = 0
12668 } else if (end > len) {
12669 end = len
12670 }
12671
12672 if (end < start) end = start
12673
12674 var newBuf = this.subarray(start, end)
12675 // Return an augmented `Uint8Array` instance
12676 newBuf.__proto__ = Buffer.prototype
12677 return newBuf
12678}
12679
12680/*
12681 * Need to make sure that buffer isn't trying to write out of bounds.
12682 */
12683function checkOffset (offset, ext, length) {
12684 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
12685 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
12686}
12687
12688Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
12689 offset = offset >>> 0
12690 byteLength = byteLength >>> 0
12691 if (!noAssert) checkOffset(offset, byteLength, this.length)
12692
12693 var val = this[offset]
12694 var mul = 1
12695 var i = 0
12696 while (++i < byteLength && (mul *= 0x100)) {
12697 val += this[offset + i] * mul
12698 }
12699
12700 return val
12701}
12702
12703Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
12704 offset = offset >>> 0
12705 byteLength = byteLength >>> 0
12706 if (!noAssert) {
12707 checkOffset(offset, byteLength, this.length)
12708 }
12709
12710 var val = this[offset + --byteLength]
12711 var mul = 1
12712 while (byteLength > 0 && (mul *= 0x100)) {
12713 val += this[offset + --byteLength] * mul
12714 }
12715
12716 return val
12717}
12718
12719Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
12720 offset = offset >>> 0
12721 if (!noAssert) checkOffset(offset, 1, this.length)
12722 return this[offset]
12723}
12724
12725Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
12726 offset = offset >>> 0
12727 if (!noAssert) checkOffset(offset, 2, this.length)
12728 return this[offset] | (this[offset + 1] << 8)
12729}
12730
12731Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
12732 offset = offset >>> 0
12733 if (!noAssert) checkOffset(offset, 2, this.length)
12734 return (this[offset] << 8) | this[offset + 1]
12735}
12736
12737Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
12738 offset = offset >>> 0
12739 if (!noAssert) checkOffset(offset, 4, this.length)
12740
12741 return ((this[offset]) |
12742 (this[offset + 1] << 8) |
12743 (this[offset + 2] << 16)) +
12744 (this[offset + 3] * 0x1000000)
12745}
12746
12747Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
12748 offset = offset >>> 0
12749 if (!noAssert) checkOffset(offset, 4, this.length)
12750
12751 return (this[offset] * 0x1000000) +
12752 ((this[offset + 1] << 16) |
12753 (this[offset + 2] << 8) |
12754 this[offset + 3])
12755}
12756
12757Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
12758 offset = offset >>> 0
12759 byteLength = byteLength >>> 0
12760 if (!noAssert) checkOffset(offset, byteLength, this.length)
12761
12762 var val = this[offset]
12763 var mul = 1
12764 var i = 0
12765 while (++i < byteLength && (mul *= 0x100)) {
12766 val += this[offset + i] * mul
12767 }
12768 mul *= 0x80
12769
12770 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
12771
12772 return val
12773}
12774
12775Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
12776 offset = offset >>> 0
12777 byteLength = byteLength >>> 0
12778 if (!noAssert) checkOffset(offset, byteLength, this.length)
12779
12780 var i = byteLength
12781 var mul = 1
12782 var val = this[offset + --i]
12783 while (i > 0 && (mul *= 0x100)) {
12784 val += this[offset + --i] * mul
12785 }
12786 mul *= 0x80
12787
12788 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
12789
12790 return val
12791}
12792
12793Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
12794 offset = offset >>> 0
12795 if (!noAssert) checkOffset(offset, 1, this.length)
12796 if (!(this[offset] & 0x80)) return (this[offset])
12797 return ((0xff - this[offset] + 1) * -1)
12798}
12799
12800Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
12801 offset = offset >>> 0
12802 if (!noAssert) checkOffset(offset, 2, this.length)
12803 var val = this[offset] | (this[offset + 1] << 8)
12804 return (val & 0x8000) ? val | 0xFFFF0000 : val
12805}
12806
12807Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
12808 offset = offset >>> 0
12809 if (!noAssert) checkOffset(offset, 2, this.length)
12810 var val = this[offset + 1] | (this[offset] << 8)
12811 return (val & 0x8000) ? val | 0xFFFF0000 : val
12812}
12813
12814Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
12815 offset = offset >>> 0
12816 if (!noAssert) checkOffset(offset, 4, this.length)
12817
12818 return (this[offset]) |
12819 (this[offset + 1] << 8) |
12820 (this[offset + 2] << 16) |
12821 (this[offset + 3] << 24)
12822}
12823
12824Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
12825 offset = offset >>> 0
12826 if (!noAssert) checkOffset(offset, 4, this.length)
12827
12828 return (this[offset] << 24) |
12829 (this[offset + 1] << 16) |
12830 (this[offset + 2] << 8) |
12831 (this[offset + 3])
12832}
12833
12834Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
12835 offset = offset >>> 0
12836 if (!noAssert) checkOffset(offset, 4, this.length)
12837 return ieee754.read(this, offset, true, 23, 4)
12838}
12839
12840Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
12841 offset = offset >>> 0
12842 if (!noAssert) checkOffset(offset, 4, this.length)
12843 return ieee754.read(this, offset, false, 23, 4)
12844}
12845
12846Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
12847 offset = offset >>> 0
12848 if (!noAssert) checkOffset(offset, 8, this.length)
12849 return ieee754.read(this, offset, true, 52, 8)
12850}
12851
12852Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
12853 offset = offset >>> 0
12854 if (!noAssert) checkOffset(offset, 8, this.length)
12855 return ieee754.read(this, offset, false, 52, 8)
12856}
12857
12858function checkInt (buf, value, offset, ext, max, min) {
12859 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
12860 if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
12861 if (offset + ext > buf.length) throw new RangeError('Index out of range')
12862}
12863
12864Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
12865 value = +value
12866 offset = offset >>> 0
12867 byteLength = byteLength >>> 0
12868 if (!noAssert) {
12869 var maxBytes = Math.pow(2, 8 * byteLength) - 1
12870 checkInt(this, value, offset, byteLength, maxBytes, 0)
12871 }
12872
12873 var mul = 1
12874 var i = 0
12875 this[offset] = value & 0xFF
12876 while (++i < byteLength && (mul *= 0x100)) {
12877 this[offset + i] = (value / mul) & 0xFF
12878 }
12879
12880 return offset + byteLength
12881}
12882
12883Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
12884 value = +value
12885 offset = offset >>> 0
12886 byteLength = byteLength >>> 0
12887 if (!noAssert) {
12888 var maxBytes = Math.pow(2, 8 * byteLength) - 1
12889 checkInt(this, value, offset, byteLength, maxBytes, 0)
12890 }
12891
12892 var i = byteLength - 1
12893 var mul = 1
12894 this[offset + i] = value & 0xFF
12895 while (--i >= 0 && (mul *= 0x100)) {
12896 this[offset + i] = (value / mul) & 0xFF
12897 }
12898
12899 return offset + byteLength
12900}
12901
12902Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
12903 value = +value
12904 offset = offset >>> 0
12905 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
12906 this[offset] = (value & 0xff)
12907 return offset + 1
12908}
12909
12910Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
12911 value = +value
12912 offset = offset >>> 0
12913 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
12914 this[offset] = (value & 0xff)
12915 this[offset + 1] = (value >>> 8)
12916 return offset + 2
12917}
12918
12919Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
12920 value = +value
12921 offset = offset >>> 0
12922 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
12923 this[offset] = (value >>> 8)
12924 this[offset + 1] = (value & 0xff)
12925 return offset + 2
12926}
12927
12928Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
12929 value = +value
12930 offset = offset >>> 0
12931 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
12932 this[offset + 3] = (value >>> 24)
12933 this[offset + 2] = (value >>> 16)
12934 this[offset + 1] = (value >>> 8)
12935 this[offset] = (value & 0xff)
12936 return offset + 4
12937}
12938
12939Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
12940 value = +value
12941 offset = offset >>> 0
12942 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
12943 this[offset] = (value >>> 24)
12944 this[offset + 1] = (value >>> 16)
12945 this[offset + 2] = (value >>> 8)
12946 this[offset + 3] = (value & 0xff)
12947 return offset + 4
12948}
12949
12950Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
12951 value = +value
12952 offset = offset >>> 0
12953 if (!noAssert) {
12954 var limit = Math.pow(2, (8 * byteLength) - 1)
12955
12956 checkInt(this, value, offset, byteLength, limit - 1, -limit)
12957 }
12958
12959 var i = 0
12960 var mul = 1
12961 var sub = 0
12962 this[offset] = value & 0xFF
12963 while (++i < byteLength && (mul *= 0x100)) {
12964 if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
12965 sub = 1
12966 }
12967 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
12968 }
12969
12970 return offset + byteLength
12971}
12972
12973Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
12974 value = +value
12975 offset = offset >>> 0
12976 if (!noAssert) {
12977 var limit = Math.pow(2, (8 * byteLength) - 1)
12978
12979 checkInt(this, value, offset, byteLength, limit - 1, -limit)
12980 }
12981
12982 var i = byteLength - 1
12983 var mul = 1
12984 var sub = 0
12985 this[offset + i] = value & 0xFF
12986 while (--i >= 0 && (mul *= 0x100)) {
12987 if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
12988 sub = 1
12989 }
12990 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
12991 }
12992
12993 return offset + byteLength
12994}
12995
12996Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
12997 value = +value
12998 offset = offset >>> 0
12999 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
13000 if (value < 0) value = 0xff + value + 1
13001 this[offset] = (value & 0xff)
13002 return offset + 1
13003}
13004
13005Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
13006 value = +value
13007 offset = offset >>> 0
13008 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
13009 this[offset] = (value & 0xff)
13010 this[offset + 1] = (value >>> 8)
13011 return offset + 2
13012}
13013
13014Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
13015 value = +value
13016 offset = offset >>> 0
13017 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
13018 this[offset] = (value >>> 8)
13019 this[offset + 1] = (value & 0xff)
13020 return offset + 2
13021}
13022
13023Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
13024 value = +value
13025 offset = offset >>> 0
13026 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
13027 this[offset] = (value & 0xff)
13028 this[offset + 1] = (value >>> 8)
13029 this[offset + 2] = (value >>> 16)
13030 this[offset + 3] = (value >>> 24)
13031 return offset + 4
13032}
13033
13034Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
13035 value = +value
13036 offset = offset >>> 0
13037 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
13038 if (value < 0) value = 0xffffffff + value + 1
13039 this[offset] = (value >>> 24)
13040 this[offset + 1] = (value >>> 16)
13041 this[offset + 2] = (value >>> 8)
13042 this[offset + 3] = (value & 0xff)
13043 return offset + 4
13044}
13045
13046function checkIEEE754 (buf, value, offset, ext, max, min) {
13047 if (offset + ext > buf.length) throw new RangeError('Index out of range')
13048 if (offset < 0) throw new RangeError('Index out of range')
13049}
13050
13051function writeFloat (buf, value, offset, littleEndian, noAssert) {
13052 value = +value
13053 offset = offset >>> 0
13054 if (!noAssert) {
13055 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
13056 }
13057 ieee754.write(buf, value, offset, littleEndian, 23, 4)
13058 return offset + 4
13059}
13060
13061Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
13062 return writeFloat(this, value, offset, true, noAssert)
13063}
13064
13065Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
13066 return writeFloat(this, value, offset, false, noAssert)
13067}
13068
13069function writeDouble (buf, value, offset, littleEndian, noAssert) {
13070 value = +value
13071 offset = offset >>> 0
13072 if (!noAssert) {
13073 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
13074 }
13075 ieee754.write(buf, value, offset, littleEndian, 52, 8)
13076 return offset + 8
13077}
13078
13079Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
13080 return writeDouble(this, value, offset, true, noAssert)
13081}
13082
13083Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
13084 return writeDouble(this, value, offset, false, noAssert)
13085}
13086
13087// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
13088Buffer.prototype.copy = function copy (target, targetStart, start, end) {
13089 if (!start) start = 0
13090 if (!end && end !== 0) end = this.length
13091 if (targetStart >= target.length) targetStart = target.length
13092 if (!targetStart) targetStart = 0
13093 if (end > 0 && end < start) end = start
13094
13095 // Copy 0 bytes; we're done
13096 if (end === start) return 0
13097 if (target.length === 0 || this.length === 0) return 0
13098
13099 // Fatal error conditions
13100 if (targetStart < 0) {
13101 throw new RangeError('targetStart out of bounds')
13102 }
13103 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
13104 if (end < 0) throw new RangeError('sourceEnd out of bounds')
13105
13106 // Are we oob?
13107 if (end > this.length) end = this.length
13108 if (target.length - targetStart < end - start) {
13109 end = target.length - targetStart + start
13110 }
13111
13112 var len = end - start
13113 var i
13114
13115 if (this === target && start < targetStart && targetStart < end) {
13116 // descending copy from end
13117 for (i = len - 1; i >= 0; --i) {
13118 target[i + targetStart] = this[i + start]
13119 }
13120 } else if (len < 1000) {
13121 // ascending copy from start
13122 for (i = 0; i < len; ++i) {
13123 target[i + targetStart] = this[i + start]
13124 }
13125 } else {
13126 Uint8Array.prototype.set.call(
13127 target,
13128 this.subarray(start, start + len),
13129 targetStart
13130 )
13131 }
13132
13133 return len
13134}
13135
13136// Usage:
13137// buffer.fill(number[, offset[, end]])
13138// buffer.fill(buffer[, offset[, end]])
13139// buffer.fill(string[, offset[, end]][, encoding])
13140Buffer.prototype.fill = function fill (val, start, end, encoding) {
13141 // Handle string cases:
13142 if (typeof val === 'string') {
13143 if (typeof start === 'string') {
13144 encoding = start
13145 start = 0
13146 end = this.length
13147 } else if (typeof end === 'string') {
13148 encoding = end
13149 end = this.length
13150 }
13151 if (val.length === 1) {
13152 var code = val.charCodeAt(0)
13153 if (code < 256) {
13154 val = code
13155 }
13156 }
13157 if (encoding !== undefined && typeof encoding !== 'string') {
13158 throw new TypeError('encoding must be a string')
13159 }
13160 if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
13161 throw new TypeError('Unknown encoding: ' + encoding)
13162 }
13163 } else if (typeof val === 'number') {
13164 val = val & 255
13165 }
13166
13167 // Invalid ranges are not set to a default, so can range check early.
13168 if (start < 0 || this.length < start || this.length < end) {
13169 throw new RangeError('Out of range index')
13170 }
13171
13172 if (end <= start) {
13173 return this
13174 }
13175
13176 start = start >>> 0
13177 end = end === undefined ? this.length : end >>> 0
13178
13179 if (!val) val = 0
13180
13181 var i
13182 if (typeof val === 'number') {
13183 for (i = start; i < end; ++i) {
13184 this[i] = val
13185 }
13186 } else {
13187 var bytes = Buffer.isBuffer(val)
13188 ? val
13189 : new Buffer(val, encoding)
13190 var len = bytes.length
13191 for (i = 0; i < end - start; ++i) {
13192 this[i + start] = bytes[i % len]
13193 }
13194 }
13195
13196 return this
13197}
13198
13199// HELPER FUNCTIONS
13200// ================
13201
13202var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
13203
13204function base64clean (str) {
13205 // Node strips out invalid characters like \n and \t from the string, base64-js does not
13206 str = str.trim().replace(INVALID_BASE64_RE, '')
13207 // Node converts strings with length < 2 to ''
13208 if (str.length < 2) return ''
13209 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
13210 while (str.length % 4 !== 0) {
13211 str = str + '='
13212 }
13213 return str
13214}
13215
13216function toHex (n) {
13217 if (n < 16) return '0' + n.toString(16)
13218 return n.toString(16)
13219}
13220
13221function utf8ToBytes (string, units) {
13222 units = units || Infinity
13223 var codePoint
13224 var length = string.length
13225 var leadSurrogate = null
13226 var bytes = []
13227
13228 for (var i = 0; i < length; ++i) {
13229 codePoint = string.charCodeAt(i)
13230
13231 // is surrogate component
13232 if (codePoint > 0xD7FF && codePoint < 0xE000) {
13233 // last char was a lead
13234 if (!leadSurrogate) {
13235 // no lead yet
13236 if (codePoint > 0xDBFF) {
13237 // unexpected trail
13238 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
13239 continue
13240 } else if (i + 1 === length) {
13241 // unpaired lead
13242 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
13243 continue
13244 }
13245
13246 // valid lead
13247 leadSurrogate = codePoint
13248
13249 continue
13250 }
13251
13252 // 2 leads in a row
13253 if (codePoint < 0xDC00) {
13254 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
13255 leadSurrogate = codePoint
13256 continue
13257 }
13258
13259 // valid surrogate pair
13260 codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
13261 } else if (leadSurrogate) {
13262 // valid bmp char, but last char was a lead
13263 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
13264 }
13265
13266 leadSurrogate = null
13267
13268 // encode utf8
13269 if (codePoint < 0x80) {
13270 if ((units -= 1) < 0) break
13271 bytes.push(codePoint)
13272 } else if (codePoint < 0x800) {
13273 if ((units -= 2) < 0) break
13274 bytes.push(
13275 codePoint >> 0x6 | 0xC0,
13276 codePoint & 0x3F | 0x80
13277 )
13278 } else if (codePoint < 0x10000) {
13279 if ((units -= 3) < 0) break
13280 bytes.push(
13281 codePoint >> 0xC | 0xE0,
13282 codePoint >> 0x6 & 0x3F | 0x80,
13283 codePoint & 0x3F | 0x80
13284 )
13285 } else if (codePoint < 0x110000) {
13286 if ((units -= 4) < 0) break
13287 bytes.push(
13288 codePoint >> 0x12 | 0xF0,
13289 codePoint >> 0xC & 0x3F | 0x80,
13290 codePoint >> 0x6 & 0x3F | 0x80,
13291 codePoint & 0x3F | 0x80
13292 )
13293 } else {
13294 throw new Error('Invalid code point')
13295 }
13296 }
13297
13298 return bytes
13299}
13300
13301function asciiToBytes (str) {
13302 var byteArray = []
13303 for (var i = 0; i < str.length; ++i) {
13304 // Node's code seems to be doing this and not & 0x7F..
13305 byteArray.push(str.charCodeAt(i) & 0xFF)
13306 }
13307 return byteArray
13308}
13309
13310function utf16leToBytes (str, units) {
13311 var c, hi, lo
13312 var byteArray = []
13313 for (var i = 0; i < str.length; ++i) {
13314 if ((units -= 2) < 0) break
13315
13316 c = str.charCodeAt(i)
13317 hi = c >> 8
13318 lo = c % 256
13319 byteArray.push(lo)
13320 byteArray.push(hi)
13321 }
13322
13323 return byteArray
13324}
13325
13326function base64ToBytes (str) {
13327 return base64.toByteArray(base64clean(str))
13328}
13329
13330function blitBuffer (src, dst, offset, length) {
13331 for (var i = 0; i < length; ++i) {
13332 if ((i + offset >= dst.length) || (i >= src.length)) break
13333 dst[i + offset] = src[i]
13334 }
13335 return i
13336}
13337
13338// Node 0.10 supports `ArrayBuffer` but lacks `ArrayBuffer.isView`
13339function isArrayBufferView (obj) {
13340 return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)
13341}
13342
13343function numberIsNaN (obj) {
13344 return obj !== obj // eslint-disable-line no-self-compare
13345}
13346
13347},{"base64-js":1,"ieee754":3}],3:[function(require,module,exports){
13348exports.read = function (buffer, offset, isLE, mLen, nBytes) {
13349 var e, m
13350 var eLen = nBytes * 8 - mLen - 1
13351 var eMax = (1 << eLen) - 1
13352 var eBias = eMax >> 1
13353 var nBits = -7
13354 var i = isLE ? (nBytes - 1) : 0
13355 var d = isLE ? -1 : 1
13356 var s = buffer[offset + i]
13357
13358 i += d
13359
13360 e = s & ((1 << (-nBits)) - 1)
13361 s >>= (-nBits)
13362 nBits += eLen
13363 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
13364
13365 m = e & ((1 << (-nBits)) - 1)
13366 e >>= (-nBits)
13367 nBits += mLen
13368 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
13369
13370 if (e === 0) {
13371 e = 1 - eBias
13372 } else if (e === eMax) {
13373 return m ? NaN : ((s ? -1 : 1) * Infinity)
13374 } else {
13375 m = m + Math.pow(2, mLen)
13376 e = e - eBias
13377 }
13378 return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
13379}
13380
13381exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
13382 var e, m, c
13383 var eLen = nBytes * 8 - mLen - 1
13384 var eMax = (1 << eLen) - 1
13385 var eBias = eMax >> 1
13386 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
13387 var i = isLE ? 0 : (nBytes - 1)
13388 var d = isLE ? 1 : -1
13389 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
13390
13391 value = Math.abs(value)
13392
13393 if (isNaN(value) || value === Infinity) {
13394 m = isNaN(value) ? 1 : 0
13395 e = eMax
13396 } else {
13397 e = Math.floor(Math.log(value) / Math.LN2)
13398 if (value * (c = Math.pow(2, -e)) < 1) {
13399 e--
13400 c *= 2
13401 }
13402 if (e + eBias >= 1) {
13403 value += rt / c
13404 } else {
13405 value += rt * Math.pow(2, 1 - eBias)
13406 }
13407 if (value * c >= 2) {
13408 e++
13409 c /= 2
13410 }
13411
13412 if (e + eBias >= eMax) {
13413 m = 0
13414 e = eMax
13415 } else if (e + eBias >= 1) {
13416 m = (value * c - 1) * Math.pow(2, mLen)
13417 e = e + eBias
13418 } else {
13419 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
13420 e = 0
13421 }
13422 }
13423
13424 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
13425
13426 e = (e << mLen) | m
13427 eLen += mLen
13428 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
13429
13430 buffer[offset + i - d] |= s * 128
13431}
13432
13433},{}],4:[function(require,module,exports){
13434window.basex = require('base-x')
13435},{"base-x":5}],5:[function(require,module,exports){
13436// base-x encoding
13437// Forked from https://github.com/cryptocoinjs/bs58
13438// Originally written by Mike Hearn for BitcoinJ
13439// Copyright (c) 2011 Google Inc
13440// Ported to JavaScript by Stefan Thomas
13441// Merged Buffer refactorings from base58-native by Stephen Pair
13442// Copyright (c) 2013 BitPay Inc
13443
13444var Buffer = require('safe-buffer').Buffer
13445
13446module.exports = function base (ALPHABET) {
13447 var ALPHABET_MAP = {}
13448 var BASE = ALPHABET.length
13449 var LEADER = ALPHABET.charAt(0)
13450
13451 // pre-compute lookup table
13452 for (var z = 0; z < ALPHABET.length; z++) {
13453 var x = ALPHABET.charAt(z)
13454
13455 if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')
13456 ALPHABET_MAP[x] = z
13457 }
13458
13459 function encode (source) {
13460 if (source.length === 0) return ''
13461
13462 var digits = [0]
13463 for (var i = 0; i < source.length; ++i) {
13464 for (var j = 0, carry = source[i]; j < digits.length; ++j) {
13465 carry += digits[j] << 8
13466 digits[j] = carry % BASE
13467 carry = (carry / BASE) | 0
13468 }
13469
13470 while (carry > 0) {
13471 digits.push(carry % BASE)
13472 carry = (carry / BASE) | 0
13473 }
13474 }
13475
13476 var string = ''
13477
13478 // deal with leading zeros
13479 for (var k = 0; source[k] === 0 && k < source.length - 1; ++k) string += ALPHABET[0]
13480 // convert digits to a string
13481 for (var q = digits.length - 1; q >= 0; --q) string += ALPHABET[digits[q]]
13482
13483 return string
13484 }
13485
13486 function decodeUnsafe (string) {
13487 if (string.length === 0) return Buffer.allocUnsafe(0)
13488
13489 var bytes = [0]
13490 for (var i = 0; i < string.length; i++) {
13491 var value = ALPHABET_MAP[string[i]]
13492 if (value === undefined) return
13493
13494 for (var j = 0, carry = value; j < bytes.length; ++j) {
13495 carry += bytes[j] * BASE
13496 bytes[j] = carry & 0xff
13497 carry >>= 8
13498 }
13499
13500 while (carry > 0) {
13501 bytes.push(carry & 0xff)
13502 carry >>= 8
13503 }
13504 }
13505
13506 // deal with leading zeros
13507 for (var k = 0; string[k] === LEADER && k < string.length - 1; ++k) {
13508 bytes.push(0)
13509 }
13510
13511 return Buffer.from(bytes.reverse())
13512 }
13513
13514 function decode (string) {
13515 var buffer = decodeUnsafe(string)
13516 if (buffer) return buffer
13517
13518 throw new Error('Non-base' + BASE + ' character')
13519 }
13520
13521 return {
13522 encode: encode,
13523 decodeUnsafe: decodeUnsafe,
13524 decode: decode
13525 }
13526}
13527
13528},{"safe-buffer":6}],6:[function(require,module,exports){
13529module.exports = require('buffer')
13530
13531},{"buffer":2}]},{},[4])(4)
13532});</script>
13533 <script>(function (root) {
13534 "use strict";
13535
13536/***** unorm.js *****/
13537
13538/*
13539 * UnicodeNormalizer 1.0.0
13540 * Copyright (c) 2008 Matsuza
13541 * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
13542 * $Date: 2008-06-05 16:44:17 +0200 (Thu, 05 Jun 2008) $
13543 * $Rev: 13309 $
13544 */
13545
13546 var DEFAULT_FEATURE = [null, 0, {}];
13547 var CACHE_THRESHOLD = 10;
13548 var SBase = 0xAC00, LBase = 0x1100, VBase = 0x1161, TBase = 0x11A7, LCount = 19, VCount = 21, TCount = 28;
13549 var NCount = VCount * TCount; // 588
13550 var SCount = LCount * NCount; // 11172
13551
13552 var UChar = function(cp, feature){
13553 this.codepoint = cp;
13554 this.feature = feature;
13555 };
13556
13557 // Strategies
13558 var cache = {};
13559 var cacheCounter = [];
13560 for (var i = 0; i <= 0xFF; ++i){
13561 cacheCounter[i] = 0;
13562 }
13563
13564 function fromCache(next, cp, needFeature){
13565 var ret = cache[cp];
13566 if(!ret){
13567 ret = next(cp, needFeature);
13568 if(!!ret.feature && ++cacheCounter[(cp >> 8) & 0xFF] > CACHE_THRESHOLD){
13569 cache[cp] = ret;
13570 }
13571 }
13572 return ret;
13573 }
13574
13575 function fromData(next, cp, needFeature){
13576 var hash = cp & 0xFF00;
13577 var dunit = UChar.udata[hash] || {};
13578 var f = dunit[cp];
13579 return f ? new UChar(cp, f) : new UChar(cp, DEFAULT_FEATURE);
13580 }
13581 function fromCpOnly(next, cp, needFeature){
13582 return !!needFeature ? next(cp, needFeature) : new UChar(cp, null);
13583 }
13584 function fromRuleBasedJamo(next, cp, needFeature){
13585 var j;
13586 if(cp < LBase || (LBase + LCount <= cp && cp < SBase) || (SBase + SCount < cp)){
13587 return next(cp, needFeature);
13588 }
13589 if(LBase <= cp && cp < LBase + LCount){
13590 var c = {};
13591 var base = (cp - LBase) * VCount;
13592 for (j = 0; j < VCount; ++j){
13593 c[VBase + j] = SBase + TCount * (j + base);
13594 }
13595 return new UChar(cp, [,,c]);
13596 }
13597
13598 var SIndex = cp - SBase;
13599 var TIndex = SIndex % TCount;
13600 var feature = [];
13601 if(TIndex !== 0){
13602 feature[0] = [SBase + SIndex - TIndex, TBase + TIndex];
13603 } else {
13604 feature[0] = [LBase + Math.floor(SIndex / NCount), VBase + Math.floor((SIndex % NCount) / TCount)];
13605 feature[2] = {};
13606 for (j = 1; j < TCount; ++j){
13607 feature[2][TBase + j] = cp + j;
13608 }
13609 }
13610 return new UChar(cp, feature);
13611 }
13612 function fromCpFilter(next, cp, needFeature){
13613 return cp < 60 || 13311 < cp && cp < 42607 ? new UChar(cp, DEFAULT_FEATURE) : next(cp, needFeature);
13614 }
13615
13616 var strategies = [fromCpFilter, fromCache, fromCpOnly, fromRuleBasedJamo, fromData];
13617
13618 UChar.fromCharCode = strategies.reduceRight(function (next, strategy) {
13619 return function (cp, needFeature) {
13620 return strategy(next, cp, needFeature);
13621 };
13622 }, null);
13623
13624 UChar.isHighSurrogate = function(cp){
13625 return cp >= 0xD800 && cp <= 0xDBFF;
13626 };
13627 UChar.isLowSurrogate = function(cp){
13628 return cp >= 0xDC00 && cp <= 0xDFFF;
13629 };
13630
13631 UChar.prototype.prepFeature = function(){
13632 if(!this.feature){
13633 this.feature = UChar.fromCharCode(this.codepoint, true).feature;
13634 }
13635 };
13636
13637 UChar.prototype.toString = function(){
13638 if(this.codepoint < 0x10000){
13639 return String.fromCharCode(this.codepoint);
13640 } else {
13641 var x = this.codepoint - 0x10000;
13642 return String.fromCharCode(Math.floor(x / 0x400) + 0xD800, x % 0x400 + 0xDC00);
13643 }
13644 };
13645
13646 UChar.prototype.getDecomp = function(){
13647 this.prepFeature();
13648 return this.feature[0] || null;
13649 };
13650
13651 UChar.prototype.isCompatibility = function(){
13652 this.prepFeature();
13653 return !!this.feature[1] && (this.feature[1] & (1 << 8));
13654 };
13655 UChar.prototype.isExclude = function(){
13656 this.prepFeature();
13657 return !!this.feature[1] && (this.feature[1] & (1 << 9));
13658 };
13659 UChar.prototype.getCanonicalClass = function(){
13660 this.prepFeature();
13661 return !!this.feature[1] ? (this.feature[1] & 0xff) : 0;
13662 };
13663 UChar.prototype.getComposite = function(following){
13664 this.prepFeature();
13665 if(!this.feature[2]){
13666 return null;
13667 }
13668 var cp = this.feature[2][following.codepoint];
13669 return cp ? UChar.fromCharCode(cp) : null;
13670 };
13671
13672 var UCharIterator = function(str){
13673 this.str = str;
13674 this.cursor = 0;
13675 };
13676 UCharIterator.prototype.next = function(){
13677 if(!!this.str && this.cursor < this.str.length){
13678 var cp = this.str.charCodeAt(this.cursor++);
13679 var d;
13680 if(UChar.isHighSurrogate(cp) && this.cursor < this.str.length && UChar.isLowSurrogate((d = this.str.charCodeAt(this.cursor)))){
13681 cp = (cp - 0xD800) * 0x400 + (d -0xDC00) + 0x10000;
13682 ++this.cursor;
13683 }
13684 return UChar.fromCharCode(cp);
13685 } else {
13686 this.str = null;
13687 return null;
13688 }
13689 };
13690
13691 var RecursDecompIterator = function(it, cano){
13692 this.it = it;
13693 this.canonical = cano;
13694 this.resBuf = [];
13695 };
13696
13697 RecursDecompIterator.prototype.next = function(){
13698 function recursiveDecomp(cano, uchar){
13699 var decomp = uchar.getDecomp();
13700 if(!!decomp && !(cano && uchar.isCompatibility())){
13701 var ret = [];
13702 for(var i = 0; i < decomp.length; ++i){
13703 var a = recursiveDecomp(cano, UChar.fromCharCode(decomp[i]));
13704 ret = ret.concat(a);
13705 }
13706 return ret;
13707 } else {
13708 return [uchar];
13709 }
13710 }
13711 if(this.resBuf.length === 0){
13712 var uchar = this.it.next();
13713 if(!uchar){
13714 return null;
13715 }
13716 this.resBuf = recursiveDecomp(this.canonical, uchar);
13717 }
13718 return this.resBuf.shift();
13719 };
13720
13721 var DecompIterator = function(it){
13722 this.it = it;
13723 this.resBuf = [];
13724 };
13725
13726 DecompIterator.prototype.next = function(){
13727 var cc;
13728 if(this.resBuf.length === 0){
13729 do{
13730 var uchar = this.it.next();
13731 if(!uchar){
13732 break;
13733 }
13734 cc = uchar.getCanonicalClass();
13735 var inspt = this.resBuf.length;
13736 if(cc !== 0){
13737 for(; inspt > 0; --inspt){
13738 var uchar2 = this.resBuf[inspt - 1];
13739 var cc2 = uchar2.getCanonicalClass();
13740 if(cc2 <= cc){
13741 break;
13742 }
13743 }
13744 }
13745 this.resBuf.splice(inspt, 0, uchar);
13746 } while(cc !== 0);
13747 }
13748 return this.resBuf.shift();
13749 };
13750
13751 var CompIterator = function(it){
13752 this.it = it;
13753 this.procBuf = [];
13754 this.resBuf = [];
13755 this.lastClass = null;
13756 };
13757
13758 CompIterator.prototype.next = function(){
13759 while(this.resBuf.length === 0){
13760 var uchar = this.it.next();
13761 if(!uchar){
13762 this.resBuf = this.procBuf;
13763 this.procBuf = [];
13764 break;
13765 }
13766 if(this.procBuf.length === 0){
13767 this.lastClass = uchar.getCanonicalClass();
13768 this.procBuf.push(uchar);
13769 } else {
13770 var starter = this.procBuf[0];
13771 var composite = starter.getComposite(uchar);
13772 var cc = uchar.getCanonicalClass();
13773 if(!!composite && (this.lastClass < cc || this.lastClass === 0)){
13774 this.procBuf[0] = composite;
13775 } else {
13776 if(cc === 0){
13777 this.resBuf = this.procBuf;
13778 this.procBuf = [];
13779 }
13780 this.lastClass = cc;
13781 this.procBuf.push(uchar);
13782 }
13783 }
13784 }
13785 return this.resBuf.shift();
13786 };
13787
13788 var createIterator = function(mode, str){
13789 switch(mode){
13790 case "NFD":
13791 return new DecompIterator(new RecursDecompIterator(new UCharIterator(str), true));
13792 case "NFKD":
13793 return new DecompIterator(new RecursDecompIterator(new UCharIterator(str), false));
13794 case "NFC":
13795 return new CompIterator(new DecompIterator(new RecursDecompIterator(new UCharIterator(str), true)));
13796 case "NFKC":
13797 return new CompIterator(new DecompIterator(new RecursDecompIterator(new UCharIterator(str), false)));
13798 }
13799 throw mode + " is invalid";
13800 };
13801 var normalize = function(mode, str){
13802 var it = createIterator(mode, str);
13803 var ret = "";
13804 var uchar;
13805 while(!!(uchar = it.next())){
13806 ret += uchar.toString();
13807 }
13808 return ret;
13809 };
13810
13811 /* API functions */
13812 function nfd(str){
13813 return normalize("NFD", str);
13814 }
13815
13816 function nfkd(str){
13817 return normalize("NFKD", str);
13818 }
13819
13820 function nfc(str){
13821 return normalize("NFC", str);
13822 }
13823
13824 function nfkc(str){
13825 return normalize("NFKC", str);
13826 }
13827
13828/* Unicode data */
13829UChar.udata={
138300:{60:[,,{824:8814}],61:[,,{824:8800}],62:[,,{824:8815}],65:[,,{768:192,769:193,770:194,771:195,772:256,774:258,775:550,776:196,777:7842,778:197,780:461,783:512,785:514,803:7840,805:7680,808:260}],66:[,,{775:7682,803:7684,817:7686}],67:[,,{769:262,770:264,775:266,780:268,807:199}],68:[,,{775:7690,780:270,803:7692,807:7696,813:7698,817:7694}],69:[,,{768:200,769:201,770:202,771:7868,772:274,774:276,775:278,776:203,777:7866,780:282,783:516,785:518,803:7864,807:552,808:280,813:7704,816:7706}],70:[,,{775:7710}],71:[,,{769:500,770:284,772:7712,774:286,775:288,780:486,807:290}],72:[,,{770:292,775:7714,776:7718,780:542,803:7716,807:7720,814:7722}],73:[,,{768:204,769:205,770:206,771:296,772:298,774:300,775:304,776:207,777:7880,780:463,783:520,785:522,803:7882,808:302,816:7724}],74:[,,{770:308}],75:[,,{769:7728,780:488,803:7730,807:310,817:7732}],76:[,,{769:313,780:317,803:7734,807:315,813:7740,817:7738}],77:[,,{769:7742,775:7744,803:7746}],78:[,,{768:504,769:323,771:209,775:7748,780:327,803:7750,807:325,813:7754,817:7752}],79:[,,{768:210,769:211,770:212,771:213,772:332,774:334,775:558,776:214,777:7886,779:336,780:465,783:524,785:526,795:416,803:7884,808:490}],80:[,,{769:7764,775:7766}],82:[,,{769:340,775:7768,780:344,783:528,785:530,803:7770,807:342,817:7774}],83:[,,{769:346,770:348,775:7776,780:352,803:7778,806:536,807:350}],84:[,,{775:7786,780:356,803:7788,806:538,807:354,813:7792,817:7790}],85:[,,{768:217,769:218,770:219,771:360,772:362,774:364,776:220,777:7910,778:366,779:368,780:467,783:532,785:534,795:431,803:7908,804:7794,808:370,813:7798,816:7796}],86:[,,{771:7804,803:7806}],87:[,,{768:7808,769:7810,770:372,775:7814,776:7812,803:7816}],88:[,,{775:7818,776:7820}],89:[,,{768:7922,769:221,770:374,771:7928,772:562,775:7822,776:376,777:7926,803:7924}],90:[,,{769:377,770:7824,775:379,780:381,803:7826,817:7828}],97:[,,{768:224,769:225,770:226,771:227,772:257,774:259,775:551,776:228,777:7843,778:229,780:462,783:513,785:515,803:7841,805:7681,808:261}],98:[,,{775:7683,803:7685,817:7687}],99:[,,{769:263,770:265,775:267,780:269,807:231}],100:[,,{775:7691,780:271,803:7693,807:7697,813:7699,817:7695}],101:[,,{768:232,769:233,770:234,771:7869,772:275,774:277,775:279,776:235,777:7867,780:283,783:517,785:519,803:7865,807:553,808:281,813:7705,816:7707}],102:[,,{775:7711}],103:[,,{769:501,770:285,772:7713,774:287,775:289,780:487,807:291}],104:[,,{770:293,775:7715,776:7719,780:543,803:7717,807:7721,814:7723,817:7830}],105:[,,{768:236,769:237,770:238,771:297,772:299,774:301,776:239,777:7881,780:464,783:521,785:523,803:7883,808:303,816:7725}],106:[,,{770:309,780:496}],107:[,,{769:7729,780:489,803:7731,807:311,817:7733}],108:[,,{769:314,780:318,803:7735,807:316,813:7741,817:7739}],109:[,,{769:7743,775:7745,803:7747}],110:[,,{768:505,769:324,771:241,775:7749,780:328,803:7751,807:326,813:7755,817:7753}],111:[,,{768:242,769:243,770:244,771:245,772:333,774:335,775:559,776:246,777:7887,779:337,780:466,783:525,785:527,795:417,803:7885,808:491}],112:[,,{769:7765,775:7767}],114:[,,{769:341,775:7769,780:345,783:529,785:531,803:7771,807:343,817:7775}],115:[,,{769:347,770:349,775:7777,780:353,803:7779,806:537,807:351}],116:[,,{775:7787,776:7831,780:357,803:7789,806:539,807:355,813:7793,817:7791}],117:[,,{768:249,769:250,770:251,771:361,772:363,774:365,776:252,777:7911,778:367,779:369,780:468,783:533,785:535,795:432,803:7909,804:7795,808:371,813:7799,816:7797}],118:[,,{771:7805,803:7807}],119:[,,{768:7809,769:7811,770:373,775:7815,776:7813,778:7832,803:7817}],120:[,,{775:7819,776:7821}],121:[,,{768:7923,769:253,770:375,771:7929,772:563,775:7823,776:255,777:7927,778:7833,803:7925}],122:[,,{769:378,770:7825,775:380,780:382,803:7827,817:7829}],160:[[32],256],168:[[32,776],256,{768:8173,769:901,834:8129}],170:[[97],256],175:[[32,772],256],178:[[50],256],179:[[51],256],180:[[32,769],256],181:[[956],256],184:[[32,807],256],185:[[49],256],186:[[111],256],188:[[49,8260,52],256],189:[[49,8260,50],256],190:[[51,8260,52],256],192:[[65,768]],193:[[65,769]],194:[[65,770],,{768:7846,769:7844,771:7850,777:7848}],195:[[65,771]],196:[[65,776],,{772:478}],197:[[65,778],,{769:506}],198:[,,{769:508,772:482}],199:[[67,807],,{769:7688}],200:[[69,768]],201:[[69,769]],202:[[69,770],,{768:7872,769:7870,771:7876,777:7874}],203:[[69,776]],204:[[73,768]],205:[[73,769]],206:[[73,770]],207:[[73,776],,{769:7726}],209:[[78,771]],210:[[79,768]],211:[[79,769]],212:[[79,770],,{768:7890,769:7888,771:7894,777:7892}],213:[[79,771],,{769:7756,772:556,776:7758}],214:[[79,776],,{772:554}],216:[,,{769:510}],217:[[85,768]],218:[[85,769]],219:[[85,770]],220:[[85,776],,{768:475,769:471,772:469,780:473}],221:[[89,769]],224:[[97,768]],225:[[97,769]],226:[[97,770],,{768:7847,769:7845,771:7851,777:7849}],227:[[97,771]],228:[[97,776],,{772:479}],229:[[97,778],,{769:507}],230:[,,{769:509,772:483}],231:[[99,807],,{769:7689}],232:[[101,768]],233:[[101,769]],234:[[101,770],,{768:7873,769:7871,771:7877,777:7875}],235:[[101,776]],236:[[105,768]],237:[[105,769]],238:[[105,770]],239:[[105,776],,{769:7727}],241:[[110,771]],242:[[111,768]],243:[[111,769]],244:[[111,770],,{768:7891,769:7889,771:7895,777:7893}],245:[[111,771],,{769:7757,772:557,776:7759}],246:[[111,776],,{772:555}],248:[,,{769:511}],249:[[117,768]],250:[[117,769]],251:[[117,770]],252:[[117,776],,{768:476,769:472,772:470,780:474}],253:[[121,769]],255:[[121,776]]},
13831256:{256:[[65,772]],257:[[97,772]],258:[[65,774],,{768:7856,769:7854,771:7860,777:7858}],259:[[97,774],,{768:7857,769:7855,771:7861,777:7859}],260:[[65,808]],261:[[97,808]],262:[[67,769]],263:[[99,769]],264:[[67,770]],265:[[99,770]],266:[[67,775]],267:[[99,775]],268:[[67,780]],269:[[99,780]],270:[[68,780]],271:[[100,780]],274:[[69,772],,{768:7700,769:7702}],275:[[101,772],,{768:7701,769:7703}],276:[[69,774]],277:[[101,774]],278:[[69,775]],279:[[101,775]],280:[[69,808]],281:[[101,808]],282:[[69,780]],283:[[101,780]],284:[[71,770]],285:[[103,770]],286:[[71,774]],287:[[103,774]],288:[[71,775]],289:[[103,775]],290:[[71,807]],291:[[103,807]],292:[[72,770]],293:[[104,770]],296:[[73,771]],297:[[105,771]],298:[[73,772]],299:[[105,772]],300:[[73,774]],301:[[105,774]],302:[[73,808]],303:[[105,808]],304:[[73,775]],306:[[73,74],256],307:[[105,106],256],308:[[74,770]],309:[[106,770]],310:[[75,807]],311:[[107,807]],313:[[76,769]],314:[[108,769]],315:[[76,807]],316:[[108,807]],317:[[76,780]],318:[[108,780]],319:[[76,183],256],320:[[108,183],256],323:[[78,769]],324:[[110,769]],325:[[78,807]],326:[[110,807]],327:[[78,780]],328:[[110,780]],329:[[700,110],256],332:[[79,772],,{768:7760,769:7762}],333:[[111,772],,{768:7761,769:7763}],334:[[79,774]],335:[[111,774]],336:[[79,779]],337:[[111,779]],340:[[82,769]],341:[[114,769]],342:[[82,807]],343:[[114,807]],344:[[82,780]],345:[[114,780]],346:[[83,769],,{775:7780}],347:[[115,769],,{775:7781}],348:[[83,770]],349:[[115,770]],350:[[83,807]],351:[[115,807]],352:[[83,780],,{775:7782}],353:[[115,780],,{775:7783}],354:[[84,807]],355:[[116,807]],356:[[84,780]],357:[[116,780]],360:[[85,771],,{769:7800}],361:[[117,771],,{769:7801}],362:[[85,772],,{776:7802}],363:[[117,772],,{776:7803}],364:[[85,774]],365:[[117,774]],366:[[85,778]],367:[[117,778]],368:[[85,779]],369:[[117,779]],370:[[85,808]],371:[[117,808]],372:[[87,770]],373:[[119,770]],374:[[89,770]],375:[[121,770]],376:[[89,776]],377:[[90,769]],378:[[122,769]],379:[[90,775]],380:[[122,775]],381:[[90,780]],382:[[122,780]],383:[[115],256,{775:7835}],416:[[79,795],,{768:7900,769:7898,771:7904,777:7902,803:7906}],417:[[111,795],,{768:7901,769:7899,771:7905,777:7903,803:7907}],431:[[85,795],,{768:7914,769:7912,771:7918,777:7916,803:7920}],432:[[117,795],,{768:7915,769:7913,771:7919,777:7917,803:7921}],439:[,,{780:494}],452:[[68,381],256],453:[[68,382],256],454:[[100,382],256],455:[[76,74],256],456:[[76,106],256],457:[[108,106],256],458:[[78,74],256],459:[[78,106],256],460:[[110,106],256],461:[[65,780]],462:[[97,780]],463:[[73,780]],464:[[105,780]],465:[[79,780]],466:[[111,780]],467:[[85,780]],468:[[117,780]],469:[[220,772]],470:[[252,772]],471:[[220,769]],472:[[252,769]],473:[[220,780]],474:[[252,780]],475:[[220,768]],476:[[252,768]],478:[[196,772]],479:[[228,772]],480:[[550,772]],481:[[551,772]],482:[[198,772]],483:[[230,772]],486:[[71,780]],487:[[103,780]],488:[[75,780]],489:[[107,780]],490:[[79,808],,{772:492}],491:[[111,808],,{772:493}],492:[[490,772]],493:[[491,772]],494:[[439,780]],495:[[658,780]],496:[[106,780]],497:[[68,90],256],498:[[68,122],256],499:[[100,122],256],500:[[71,769]],501:[[103,769]],504:[[78,768]],505:[[110,768]],506:[[197,769]],507:[[229,769]],508:[[198,769]],509:[[230,769]],510:[[216,769]],511:[[248,769]],66045:[,220]},
13832512:{512:[[65,783]],513:[[97,783]],514:[[65,785]],515:[[97,785]],516:[[69,783]],517:[[101,783]],518:[[69,785]],519:[[101,785]],520:[[73,783]],521:[[105,783]],522:[[73,785]],523:[[105,785]],524:[[79,783]],525:[[111,783]],526:[[79,785]],527:[[111,785]],528:[[82,783]],529:[[114,783]],530:[[82,785]],531:[[114,785]],532:[[85,783]],533:[[117,783]],534:[[85,785]],535:[[117,785]],536:[[83,806]],537:[[115,806]],538:[[84,806]],539:[[116,806]],542:[[72,780]],543:[[104,780]],550:[[65,775],,{772:480}],551:[[97,775],,{772:481}],552:[[69,807],,{774:7708}],553:[[101,807],,{774:7709}],554:[[214,772]],555:[[246,772]],556:[[213,772]],557:[[245,772]],558:[[79,775],,{772:560}],559:[[111,775],,{772:561}],560:[[558,772]],561:[[559,772]],562:[[89,772]],563:[[121,772]],658:[,,{780:495}],688:[[104],256],689:[[614],256],690:[[106],256],691:[[114],256],692:[[633],256],693:[[635],256],694:[[641],256],695:[[119],256],696:[[121],256],728:[[32,774],256],729:[[32,775],256],730:[[32,778],256],731:[[32,808],256],732:[[32,771],256],733:[[32,779],256],736:[[611],256],737:[[108],256],738:[[115],256],739:[[120],256],740:[[661],256],66272:[,220]},
13833768:{768:[,230],769:[,230],770:[,230],771:[,230],772:[,230],773:[,230],774:[,230],775:[,230],776:[,230,{769:836}],777:[,230],778:[,230],779:[,230],780:[,230],781:[,230],782:[,230],783:[,230],784:[,230],785:[,230],786:[,230],787:[,230],788:[,230],789:[,232],790:[,220],791:[,220],792:[,220],793:[,220],794:[,232],795:[,216],796:[,220],797:[,220],798:[,220],799:[,220],800:[,220],801:[,202],802:[,202],803:[,220],804:[,220],805:[,220],806:[,220],807:[,202],808:[,202],809:[,220],810:[,220],811:[,220],812:[,220],813:[,220],814:[,220],815:[,220],816:[,220],817:[,220],818:[,220],819:[,220],820:[,1],821:[,1],822:[,1],823:[,1],824:[,1],825:[,220],826:[,220],827:[,220],828:[,220],829:[,230],830:[,230],831:[,230],832:[[768],230],833:[[769],230],834:[,230],835:[[787],230],836:[[776,769],230],837:[,240],838:[,230],839:[,220],840:[,220],841:[,220],842:[,230],843:[,230],844:[,230],845:[,220],846:[,220],848:[,230],849:[,230],850:[,230],851:[,220],852:[,220],853:[,220],854:[,220],855:[,230],856:[,232],857:[,220],858:[,220],859:[,230],860:[,233],861:[,234],862:[,234],863:[,233],864:[,234],865:[,234],866:[,233],867:[,230],868:[,230],869:[,230],870:[,230],871:[,230],872:[,230],873:[,230],874:[,230],875:[,230],876:[,230],877:[,230],878:[,230],879:[,230],884:[[697]],890:[[32,837],256],894:[[59]],900:[[32,769],256],901:[[168,769]],902:[[913,769]],903:[[183]],904:[[917,769]],905:[[919,769]],906:[[921,769]],908:[[927,769]],910:[[933,769]],911:[[937,769]],912:[[970,769]],913:[,,{768:8122,769:902,772:8121,774:8120,787:7944,788:7945,837:8124}],917:[,,{768:8136,769:904,787:7960,788:7961}],919:[,,{768:8138,769:905,787:7976,788:7977,837:8140}],921:[,,{768:8154,769:906,772:8153,774:8152,776:938,787:7992,788:7993}],927:[,,{768:8184,769:908,787:8008,788:8009}],929:[,,{788:8172}],933:[,,{768:8170,769:910,772:8169,774:8168,776:939,788:8025}],937:[,,{768:8186,769:911,787:8040,788:8041,837:8188}],938:[[921,776]],939:[[933,776]],940:[[945,769],,{837:8116}],941:[[949,769]],942:[[951,769],,{837:8132}],943:[[953,769]],944:[[971,769]],945:[,,{768:8048,769:940,772:8113,774:8112,787:7936,788:7937,834:8118,837:8115}],949:[,,{768:8050,769:941,787:7952,788:7953}],951:[,,{768:8052,769:942,787:7968,788:7969,834:8134,837:8131}],953:[,,{768:8054,769:943,772:8145,774:8144,776:970,787:7984,788:7985,834:8150}],959:[,,{768:8056,769:972,787:8000,788:8001}],961:[,,{787:8164,788:8165}],965:[,,{768:8058,769:973,772:8161,774:8160,776:971,787:8016,788:8017,834:8166}],969:[,,{768:8060,769:974,787:8032,788:8033,834:8182,837:8179}],970:[[953,776],,{768:8146,769:912,834:8151}],971:[[965,776],,{768:8162,769:944,834:8167}],972:[[959,769]],973:[[965,769]],974:[[969,769],,{837:8180}],976:[[946],256],977:[[952],256],978:[[933],256,{769:979,776:980}],979:[[978,769]],980:[[978,776]],981:[[966],256],982:[[960],256],1008:[[954],256],1009:[[961],256],1010:[[962],256],1012:[[920],256],1013:[[949],256],1017:[[931],256],66422:[,230],66423:[,230],66424:[,230],66425:[,230],66426:[,230]},
138341024:{1024:[[1045,768]],1025:[[1045,776]],1027:[[1043,769]],1030:[,,{776:1031}],1031:[[1030,776]],1036:[[1050,769]],1037:[[1048,768]],1038:[[1059,774]],1040:[,,{774:1232,776:1234}],1043:[,,{769:1027}],1045:[,,{768:1024,774:1238,776:1025}],1046:[,,{774:1217,776:1244}],1047:[,,{776:1246}],1048:[,,{768:1037,772:1250,774:1049,776:1252}],1049:[[1048,774]],1050:[,,{769:1036}],1054:[,,{776:1254}],1059:[,,{772:1262,774:1038,776:1264,779:1266}],1063:[,,{776:1268}],1067:[,,{776:1272}],1069:[,,{776:1260}],1072:[,,{774:1233,776:1235}],1075:[,,{769:1107}],1077:[,,{768:1104,774:1239,776:1105}],1078:[,,{774:1218,776:1245}],1079:[,,{776:1247}],1080:[,,{768:1117,772:1251,774:1081,776:1253}],1081:[[1080,774]],1082:[,,{769:1116}],1086:[,,{776:1255}],1091:[,,{772:1263,774:1118,776:1265,779:1267}],1095:[,,{776:1269}],1099:[,,{776:1273}],1101:[,,{776:1261}],1104:[[1077,768]],1105:[[1077,776]],1107:[[1075,769]],1110:[,,{776:1111}],1111:[[1110,776]],1116:[[1082,769]],1117:[[1080,768]],1118:[[1091,774]],1140:[,,{783:1142}],1141:[,,{783:1143}],1142:[[1140,783]],1143:[[1141,783]],1155:[,230],1156:[,230],1157:[,230],1158:[,230],1159:[,230],1217:[[1046,774]],1218:[[1078,774]],1232:[[1040,774]],1233:[[1072,774]],1234:[[1040,776]],1235:[[1072,776]],1238:[[1045,774]],1239:[[1077,774]],1240:[,,{776:1242}],1241:[,,{776:1243}],1242:[[1240,776]],1243:[[1241,776]],1244:[[1046,776]],1245:[[1078,776]],1246:[[1047,776]],1247:[[1079,776]],1250:[[1048,772]],1251:[[1080,772]],1252:[[1048,776]],1253:[[1080,776]],1254:[[1054,776]],1255:[[1086,776]],1256:[,,{776:1258}],1257:[,,{776:1259}],1258:[[1256,776]],1259:[[1257,776]],1260:[[1069,776]],1261:[[1101,776]],1262:[[1059,772]],1263:[[1091,772]],1264:[[1059,776]],1265:[[1091,776]],1266:[[1059,779]],1267:[[1091,779]],1268:[[1063,776]],1269:[[1095,776]],1272:[[1067,776]],1273:[[1099,776]]},
138351280:{1415:[[1381,1410],256],1425:[,220],1426:[,230],1427:[,230],1428:[,230],1429:[,230],1430:[,220],1431:[,230],1432:[,230],1433:[,230],1434:[,222],1435:[,220],1436:[,230],1437:[,230],1438:[,230],1439:[,230],1440:[,230],1441:[,230],1442:[,220],1443:[,220],1444:[,220],1445:[,220],1446:[,220],1447:[,220],1448:[,230],1449:[,230],1450:[,220],1451:[,230],1452:[,230],1453:[,222],1454:[,228],1455:[,230],1456:[,10],1457:[,11],1458:[,12],1459:[,13],1460:[,14],1461:[,15],1462:[,16],1463:[,17],1464:[,18],1465:[,19],1466:[,19],1467:[,20],1468:[,21],1469:[,22],1471:[,23],1473:[,24],1474:[,25],1476:[,230],1477:[,220],1479:[,18]},
138361536:{1552:[,230],1553:[,230],1554:[,230],1555:[,230],1556:[,230],1557:[,230],1558:[,230],1559:[,230],1560:[,30],1561:[,31],1562:[,32],1570:[[1575,1619]],1571:[[1575,1620]],1572:[[1608,1620]],1573:[[1575,1621]],1574:[[1610,1620]],1575:[,,{1619:1570,1620:1571,1621:1573}],1608:[,,{1620:1572}],1610:[,,{1620:1574}],1611:[,27],1612:[,28],1613:[,29],1614:[,30],1615:[,31],1616:[,32],1617:[,33],1618:[,34],1619:[,230],1620:[,230],1621:[,220],1622:[,220],1623:[,230],1624:[,230],1625:[,230],1626:[,230],1627:[,230],1628:[,220],1629:[,230],1630:[,230],1631:[,220],1648:[,35],1653:[[1575,1652],256],1654:[[1608,1652],256],1655:[[1735,1652],256],1656:[[1610,1652],256],1728:[[1749,1620]],1729:[,,{1620:1730}],1730:[[1729,1620]],1746:[,,{1620:1747}],1747:[[1746,1620]],1749:[,,{1620:1728}],1750:[,230],1751:[,230],1752:[,230],1753:[,230],1754:[,230],1755:[,230],1756:[,230],1759:[,230],1760:[,230],1761:[,230],1762:[,230],1763:[,220],1764:[,230],1767:[,230],1768:[,230],1770:[,220],1771:[,230],1772:[,230],1773:[,220]},
138371792:{1809:[,36],1840:[,230],1841:[,220],1842:[,230],1843:[,230],1844:[,220],1845:[,230],1846:[,230],1847:[,220],1848:[,220],1849:[,220],1850:[,230],1851:[,220],1852:[,220],1853:[,230],1854:[,220],1855:[,230],1856:[,230],1857:[,230],1858:[,220],1859:[,230],1860:[,220],1861:[,230],1862:[,220],1863:[,230],1864:[,220],1865:[,230],1866:[,230],2027:[,230],2028:[,230],2029:[,230],2030:[,230],2031:[,230],2032:[,230],2033:[,230],2034:[,220],2035:[,230]},
138382048:{2070:[,230],2071:[,230],2072:[,230],2073:[,230],2075:[,230],2076:[,230],2077:[,230],2078:[,230],2079:[,230],2080:[,230],2081:[,230],2082:[,230],2083:[,230],2085:[,230],2086:[,230],2087:[,230],2089:[,230],2090:[,230],2091:[,230],2092:[,230],2093:[,230],2137:[,220],2138:[,220],2139:[,220],2276:[,230],2277:[,230],2278:[,220],2279:[,230],2280:[,230],2281:[,220],2282:[,230],2283:[,230],2284:[,230],2285:[,220],2286:[,220],2287:[,220],2288:[,27],2289:[,28],2290:[,29],2291:[,230],2292:[,230],2293:[,230],2294:[,220],2295:[,230],2296:[,230],2297:[,220],2298:[,220],2299:[,230],2300:[,230],2301:[,230],2302:[,230],2303:[,230]},
138392304:{2344:[,,{2364:2345}],2345:[[2344,2364]],2352:[,,{2364:2353}],2353:[[2352,2364]],2355:[,,{2364:2356}],2356:[[2355,2364]],2364:[,7],2381:[,9],2385:[,230],2386:[,220],2387:[,230],2388:[,230],2392:[[2325,2364],512],2393:[[2326,2364],512],2394:[[2327,2364],512],2395:[[2332,2364],512],2396:[[2337,2364],512],2397:[[2338,2364],512],2398:[[2347,2364],512],2399:[[2351,2364],512],2492:[,7],2503:[,,{2494:2507,2519:2508}],2507:[[2503,2494]],2508:[[2503,2519]],2509:[,9],2524:[[2465,2492],512],2525:[[2466,2492],512],2527:[[2479,2492],512]},
138402560:{2611:[[2610,2620],512],2614:[[2616,2620],512],2620:[,7],2637:[,9],2649:[[2582,2620],512],2650:[[2583,2620],512],2651:[[2588,2620],512],2654:[[2603,2620],512],2748:[,7],2765:[,9],68109:[,220],68111:[,230],68152:[,230],68153:[,1],68154:[,220],68159:[,9],68325:[,230],68326:[,220]},
138412816:{2876:[,7],2887:[,,{2878:2891,2902:2888,2903:2892}],2888:[[2887,2902]],2891:[[2887,2878]],2892:[[2887,2903]],2893:[,9],2908:[[2849,2876],512],2909:[[2850,2876],512],2962:[,,{3031:2964}],2964:[[2962,3031]],3014:[,,{3006:3018,3031:3020}],3015:[,,{3006:3019}],3018:[[3014,3006]],3019:[[3015,3006]],3020:[[3014,3031]],3021:[,9]},
138423072:{3142:[,,{3158:3144}],3144:[[3142,3158]],3149:[,9],3157:[,84],3158:[,91],3260:[,7],3263:[,,{3285:3264}],3264:[[3263,3285]],3270:[,,{3266:3274,3285:3271,3286:3272}],3271:[[3270,3285]],3272:[[3270,3286]],3274:[[3270,3266],,{3285:3275}],3275:[[3274,3285]],3277:[,9]},
138433328:{3398:[,,{3390:3402,3415:3404}],3399:[,,{3390:3403}],3402:[[3398,3390]],3403:[[3399,3390]],3404:[[3398,3415]],3405:[,9],3530:[,9],3545:[,,{3530:3546,3535:3548,3551:3550}],3546:[[3545,3530]],3548:[[3545,3535],,{3530:3549}],3549:[[3548,3530]],3550:[[3545,3551]]},
138443584:{3635:[[3661,3634],256],3640:[,103],3641:[,103],3642:[,9],3656:[,107],3657:[,107],3658:[,107],3659:[,107],3763:[[3789,3762],256],3768:[,118],3769:[,118],3784:[,122],3785:[,122],3786:[,122],3787:[,122],3804:[[3755,3737],256],3805:[[3755,3745],256]},
138453840:{3852:[[3851],256],3864:[,220],3865:[,220],3893:[,220],3895:[,220],3897:[,216],3907:[[3906,4023],512],3917:[[3916,4023],512],3922:[[3921,4023],512],3927:[[3926,4023],512],3932:[[3931,4023],512],3945:[[3904,4021],512],3953:[,129],3954:[,130],3955:[[3953,3954],512],3956:[,132],3957:[[3953,3956],512],3958:[[4018,3968],512],3959:[[4018,3969],256],3960:[[4019,3968],512],3961:[[4019,3969],256],3962:[,130],3963:[,130],3964:[,130],3965:[,130],3968:[,130],3969:[[3953,3968],512],3970:[,230],3971:[,230],3972:[,9],3974:[,230],3975:[,230],3987:[[3986,4023],512],3997:[[3996,4023],512],4002:[[4001,4023],512],4007:[[4006,4023],512],4012:[[4011,4023],512],4025:[[3984,4021],512],4038:[,220]},
138464096:{4133:[,,{4142:4134}],4134:[[4133,4142]],4151:[,7],4153:[,9],4154:[,9],4237:[,220],4348:[[4316],256],69702:[,9],69759:[,9],69785:[,,{69818:69786}],69786:[[69785,69818]],69787:[,,{69818:69788}],69788:[[69787,69818]],69797:[,,{69818:69803}],69803:[[69797,69818]],69817:[,9],69818:[,7]},
138474352:{69888:[,230],69889:[,230],69890:[,230],69934:[[69937,69927]],69935:[[69938,69927]],69937:[,,{69927:69934}],69938:[,,{69927:69935}],69939:[,9],69940:[,9],70003:[,7],70080:[,9]},
138484608:{70197:[,9],70198:[,7],70377:[,7],70378:[,9]},
138494864:{4957:[,230],4958:[,230],4959:[,230],70460:[,7],70471:[,,{70462:70475,70487:70476}],70475:[[70471,70462]],70476:[[70471,70487]],70477:[,9],70502:[,230],70503:[,230],70504:[,230],70505:[,230],70506:[,230],70507:[,230],70508:[,230],70512:[,230],70513:[,230],70514:[,230],70515:[,230],70516:[,230]},
138505120:{70841:[,,{70832:70844,70842:70843,70845:70846}],70843:[[70841,70842]],70844:[[70841,70832]],70846:[[70841,70845]],70850:[,9],70851:[,7]},
138515376:{71096:[,,{71087:71098}],71097:[,,{71087:71099}],71098:[[71096,71087]],71099:[[71097,71087]],71103:[,9],71104:[,7]},
138525632:{71231:[,9],71350:[,9],71351:[,7]},
138535888:{5908:[,9],5940:[,9],6098:[,9],6109:[,230]},
138546144:{6313:[,228]},
138556400:{6457:[,222],6458:[,230],6459:[,220]},
138566656:{6679:[,230],6680:[,220],6752:[,9],6773:[,230],6774:[,230],6775:[,230],6776:[,230],6777:[,230],6778:[,230],6779:[,230],6780:[,230],6783:[,220],6832:[,230],6833:[,230],6834:[,230],6835:[,230],6836:[,230],6837:[,220],6838:[,220],6839:[,220],6840:[,220],6841:[,220],6842:[,220],6843:[,230],6844:[,230],6845:[,220]},
138576912:{6917:[,,{6965:6918}],6918:[[6917,6965]],6919:[,,{6965:6920}],6920:[[6919,6965]],6921:[,,{6965:6922}],6922:[[6921,6965]],6923:[,,{6965:6924}],6924:[[6923,6965]],6925:[,,{6965:6926}],6926:[[6925,6965]],6929:[,,{6965:6930}],6930:[[6929,6965]],6964:[,7],6970:[,,{6965:6971}],6971:[[6970,6965]],6972:[,,{6965:6973}],6973:[[6972,6965]],6974:[,,{6965:6976}],6975:[,,{6965:6977}],6976:[[6974,6965]],6977:[[6975,6965]],6978:[,,{6965:6979}],6979:[[6978,6965]],6980:[,9],7019:[,230],7020:[,220],7021:[,230],7022:[,230],7023:[,230],7024:[,230],7025:[,230],7026:[,230],7027:[,230],7082:[,9],7083:[,9],7142:[,7],7154:[,9],7155:[,9]},
138587168:{7223:[,7],7376:[,230],7377:[,230],7378:[,230],7380:[,1],7381:[,220],7382:[,220],7383:[,220],7384:[,220],7385:[,220],7386:[,230],7387:[,230],7388:[,220],7389:[,220],7390:[,220],7391:[,220],7392:[,230],7394:[,1],7395:[,1],7396:[,1],7397:[,1],7398:[,1],7399:[,1],7400:[,1],7405:[,220],7412:[,230],7416:[,230],7417:[,230]},
138597424:{7468:[[65],256],7469:[[198],256],7470:[[66],256],7472:[[68],256],7473:[[69],256],7474:[[398],256],7475:[[71],256],7476:[[72],256],7477:[[73],256],7478:[[74],256],7479:[[75],256],7480:[[76],256],7481:[[77],256],7482:[[78],256],7484:[[79],256],7485:[[546],256],7486:[[80],256],7487:[[82],256],7488:[[84],256],7489:[[85],256],7490:[[87],256],7491:[[97],256],7492:[[592],256],7493:[[593],256],7494:[[7426],256],7495:[[98],256],7496:[[100],256],7497:[[101],256],7498:[[601],256],7499:[[603],256],7500:[[604],256],7501:[[103],256],7503:[[107],256],7504:[[109],256],7505:[[331],256],7506:[[111],256],7507:[[596],256],7508:[[7446],256],7509:[[7447],256],7510:[[112],256],7511:[[116],256],7512:[[117],256],7513:[[7453],256],7514:[[623],256],7515:[[118],256],7516:[[7461],256],7517:[[946],256],7518:[[947],256],7519:[[948],256],7520:[[966],256],7521:[[967],256],7522:[[105],256],7523:[[114],256],7524:[[117],256],7525:[[118],256],7526:[[946],256],7527:[[947],256],7528:[[961],256],7529:[[966],256],7530:[[967],256],7544:[[1085],256],7579:[[594],256],7580:[[99],256],7581:[[597],256],7582:[[240],256],7583:[[604],256],7584:[[102],256],7585:[[607],256],7586:[[609],256],7587:[[613],256],7588:[[616],256],7589:[[617],256],7590:[[618],256],7591:[[7547],256],7592:[[669],256],7593:[[621],256],7594:[[7557],256],7595:[[671],256],7596:[[625],256],7597:[[624],256],7598:[[626],256],7599:[[627],256],7600:[[628],256],7601:[[629],256],7602:[[632],256],7603:[[642],256],7604:[[643],256],7605:[[427],256],7606:[[649],256],7607:[[650],256],7608:[[7452],256],7609:[[651],256],7610:[[652],256],7611:[[122],256],7612:[[656],256],7613:[[657],256],7614:[[658],256],7615:[[952],256],7616:[,230],7617:[,230],7618:[,220],7619:[,230],7620:[,230],7621:[,230],7622:[,230],7623:[,230],7624:[,230],7625:[,230],7626:[,220],7627:[,230],7628:[,230],7629:[,234],7630:[,214],7631:[,220],7632:[,202],7633:[,230],7634:[,230],7635:[,230],7636:[,230],7637:[,230],7638:[,230],7639:[,230],7640:[,230],7641:[,230],7642:[,230],7643:[,230],7644:[,230],7645:[,230],7646:[,230],7647:[,230],7648:[,230],7649:[,230],7650:[,230],7651:[,230],7652:[,230],7653:[,230],7654:[,230],7655:[,230],7656:[,230],7657:[,230],7658:[,230],7659:[,230],7660:[,230],7661:[,230],7662:[,230],7663:[,230],7664:[,230],7665:[,230],7666:[,230],7667:[,230],7668:[,230],7669:[,230],7676:[,233],7677:[,220],7678:[,230],7679:[,220]},
138607680:{7680:[[65,805]],7681:[[97,805]],7682:[[66,775]],7683:[[98,775]],7684:[[66,803]],7685:[[98,803]],7686:[[66,817]],7687:[[98,817]],7688:[[199,769]],7689:[[231,769]],7690:[[68,775]],7691:[[100,775]],7692:[[68,803]],7693:[[100,803]],7694:[[68,817]],7695:[[100,817]],7696:[[68,807]],7697:[[100,807]],7698:[[68,813]],7699:[[100,813]],7700:[[274,768]],7701:[[275,768]],7702:[[274,769]],7703:[[275,769]],7704:[[69,813]],7705:[[101,813]],7706:[[69,816]],7707:[[101,816]],7708:[[552,774]],7709:[[553,774]],7710:[[70,775]],7711:[[102,775]],7712:[[71,772]],7713:[[103,772]],7714:[[72,775]],7715:[[104,775]],7716:[[72,803]],7717:[[104,803]],7718:[[72,776]],7719:[[104,776]],7720:[[72,807]],7721:[[104,807]],7722:[[72,814]],7723:[[104,814]],7724:[[73,816]],7725:[[105,816]],7726:[[207,769]],7727:[[239,769]],7728:[[75,769]],7729:[[107,769]],7730:[[75,803]],7731:[[107,803]],7732:[[75,817]],7733:[[107,817]],7734:[[76,803],,{772:7736}],7735:[[108,803],,{772:7737}],7736:[[7734,772]],7737:[[7735,772]],7738:[[76,817]],7739:[[108,817]],7740:[[76,813]],7741:[[108,813]],7742:[[77,769]],7743:[[109,769]],7744:[[77,775]],7745:[[109,775]],7746:[[77,803]],7747:[[109,803]],7748:[[78,775]],7749:[[110,775]],7750:[[78,803]],7751:[[110,803]],7752:[[78,817]],7753:[[110,817]],7754:[[78,813]],7755:[[110,813]],7756:[[213,769]],7757:[[245,769]],7758:[[213,776]],7759:[[245,776]],7760:[[332,768]],7761:[[333,768]],7762:[[332,769]],7763:[[333,769]],7764:[[80,769]],7765:[[112,769]],7766:[[80,775]],7767:[[112,775]],7768:[[82,775]],7769:[[114,775]],7770:[[82,803],,{772:7772}],7771:[[114,803],,{772:7773}],7772:[[7770,772]],7773:[[7771,772]],7774:[[82,817]],7775:[[114,817]],7776:[[83,775]],7777:[[115,775]],7778:[[83,803],,{775:7784}],7779:[[115,803],,{775:7785}],7780:[[346,775]],7781:[[347,775]],7782:[[352,775]],7783:[[353,775]],7784:[[7778,775]],7785:[[7779,775]],7786:[[84,775]],7787:[[116,775]],7788:[[84,803]],7789:[[116,803]],7790:[[84,817]],7791:[[116,817]],7792:[[84,813]],7793:[[116,813]],7794:[[85,804]],7795:[[117,804]],7796:[[85,816]],7797:[[117,816]],7798:[[85,813]],7799:[[117,813]],7800:[[360,769]],7801:[[361,769]],7802:[[362,776]],7803:[[363,776]],7804:[[86,771]],7805:[[118,771]],7806:[[86,803]],7807:[[118,803]],7808:[[87,768]],7809:[[119,768]],7810:[[87,769]],7811:[[119,769]],7812:[[87,776]],7813:[[119,776]],7814:[[87,775]],7815:[[119,775]],7816:[[87,803]],7817:[[119,803]],7818:[[88,775]],7819:[[120,775]],7820:[[88,776]],7821:[[120,776]],7822:[[89,775]],7823:[[121,775]],7824:[[90,770]],7825:[[122,770]],7826:[[90,803]],7827:[[122,803]],7828:[[90,817]],7829:[[122,817]],7830:[[104,817]],7831:[[116,776]],7832:[[119,778]],7833:[[121,778]],7834:[[97,702],256],7835:[[383,775]],7840:[[65,803],,{770:7852,774:7862}],7841:[[97,803],,{770:7853,774:7863}],7842:[[65,777]],7843:[[97,777]],7844:[[194,769]],7845:[[226,769]],7846:[[194,768]],7847:[[226,768]],7848:[[194,777]],7849:[[226,777]],7850:[[194,771]],7851:[[226,771]],7852:[[7840,770]],7853:[[7841,770]],7854:[[258,769]],7855:[[259,769]],7856:[[258,768]],7857:[[259,768]],7858:[[258,777]],7859:[[259,777]],7860:[[258,771]],7861:[[259,771]],7862:[[7840,774]],7863:[[7841,774]],7864:[[69,803],,{770:7878}],7865:[[101,803],,{770:7879}],7866:[[69,777]],7867:[[101,777]],7868:[[69,771]],7869:[[101,771]],7870:[[202,769]],7871:[[234,769]],7872:[[202,768]],7873:[[234,768]],7874:[[202,777]],7875:[[234,777]],7876:[[202,771]],7877:[[234,771]],7878:[[7864,770]],7879:[[7865,770]],7880:[[73,777]],7881:[[105,777]],7882:[[73,803]],7883:[[105,803]],7884:[[79,803],,{770:7896}],7885:[[111,803],,{770:7897}],7886:[[79,777]],7887:[[111,777]],7888:[[212,769]],7889:[[244,769]],7890:[[212,768]],7891:[[244,768]],7892:[[212,777]],7893:[[244,777]],7894:[[212,771]],7895:[[244,771]],7896:[[7884,770]],7897:[[7885,770]],7898:[[416,769]],7899:[[417,769]],7900:[[416,768]],7901:[[417,768]],7902:[[416,777]],7903:[[417,777]],7904:[[416,771]],7905:[[417,771]],7906:[[416,803]],7907:[[417,803]],7908:[[85,803]],7909:[[117,803]],7910:[[85,777]],7911:[[117,777]],7912:[[431,769]],7913:[[432,769]],7914:[[431,768]],7915:[[432,768]],7916:[[431,777]],7917:[[432,777]],7918:[[431,771]],7919:[[432,771]],7920:[[431,803]],7921:[[432,803]],7922:[[89,768]],7923:[[121,768]],7924:[[89,803]],7925:[[121,803]],7926:[[89,777]],7927:[[121,777]],7928:[[89,771]],7929:[[121,771]]},
138617936:{7936:[[945,787],,{768:7938,769:7940,834:7942,837:8064}],7937:[[945,788],,{768:7939,769:7941,834:7943,837:8065}],7938:[[7936,768],,{837:8066}],7939:[[7937,768],,{837:8067}],7940:[[7936,769],,{837:8068}],7941:[[7937,769],,{837:8069}],7942:[[7936,834],,{837:8070}],7943:[[7937,834],,{837:8071}],7944:[[913,787],,{768:7946,769:7948,834:7950,837:8072}],7945:[[913,788],,{768:7947,769:7949,834:7951,837:8073}],7946:[[7944,768],,{837:8074}],7947:[[7945,768],,{837:8075}],7948:[[7944,769],,{837:8076}],7949:[[7945,769],,{837:8077}],7950:[[7944,834],,{837:8078}],7951:[[7945,834],,{837:8079}],7952:[[949,787],,{768:7954,769:7956}],7953:[[949,788],,{768:7955,769:7957}],7954:[[7952,768]],7955:[[7953,768]],7956:[[7952,769]],7957:[[7953,769]],7960:[[917,787],,{768:7962,769:7964}],7961:[[917,788],,{768:7963,769:7965}],7962:[[7960,768]],7963:[[7961,768]],7964:[[7960,769]],7965:[[7961,769]],7968:[[951,787],,{768:7970,769:7972,834:7974,837:8080}],7969:[[951,788],,{768:7971,769:7973,834:7975,837:8081}],7970:[[7968,768],,{837:8082}],7971:[[7969,768],,{837:8083}],7972:[[7968,769],,{837:8084}],7973:[[7969,769],,{837:8085}],7974:[[7968,834],,{837:8086}],7975:[[7969,834],,{837:8087}],7976:[[919,787],,{768:7978,769:7980,834:7982,837:8088}],7977:[[919,788],,{768:7979,769:7981,834:7983,837:8089}],7978:[[7976,768],,{837:8090}],7979:[[7977,768],,{837:8091}],7980:[[7976,769],,{837:8092}],7981:[[7977,769],,{837:8093}],7982:[[7976,834],,{837:8094}],7983:[[7977,834],,{837:8095}],7984:[[953,787],,{768:7986,769:7988,834:7990}],7985:[[953,788],,{768:7987,769:7989,834:7991}],7986:[[7984,768]],7987:[[7985,768]],7988:[[7984,769]],7989:[[7985,769]],7990:[[7984,834]],7991:[[7985,834]],7992:[[921,787],,{768:7994,769:7996,834:7998}],7993:[[921,788],,{768:7995,769:7997,834:7999}],7994:[[7992,768]],7995:[[7993,768]],7996:[[7992,769]],7997:[[7993,769]],7998:[[7992,834]],7999:[[7993,834]],8000:[[959,787],,{768:8002,769:8004}],8001:[[959,788],,{768:8003,769:8005}],8002:[[8000,768]],8003:[[8001,768]],8004:[[8000,769]],8005:[[8001,769]],8008:[[927,787],,{768:8010,769:8012}],8009:[[927,788],,{768:8011,769:8013}],8010:[[8008,768]],8011:[[8009,768]],8012:[[8008,769]],8013:[[8009,769]],8016:[[965,787],,{768:8018,769:8020,834:8022}],8017:[[965,788],,{768:8019,769:8021,834:8023}],8018:[[8016,768]],8019:[[8017,768]],8020:[[8016,769]],8021:[[8017,769]],8022:[[8016,834]],8023:[[8017,834]],8025:[[933,788],,{768:8027,769:8029,834:8031}],8027:[[8025,768]],8029:[[8025,769]],8031:[[8025,834]],8032:[[969,787],,{768:8034,769:8036,834:8038,837:8096}],8033:[[969,788],,{768:8035,769:8037,834:8039,837:8097}],8034:[[8032,768],,{837:8098}],8035:[[8033,768],,{837:8099}],8036:[[8032,769],,{837:8100}],8037:[[8033,769],,{837:8101}],8038:[[8032,834],,{837:8102}],8039:[[8033,834],,{837:8103}],8040:[[937,787],,{768:8042,769:8044,834:8046,837:8104}],8041:[[937,788],,{768:8043,769:8045,834:8047,837:8105}],8042:[[8040,768],,{837:8106}],8043:[[8041,768],,{837:8107}],8044:[[8040,769],,{837:8108}],8045:[[8041,769],,{837:8109}],8046:[[8040,834],,{837:8110}],8047:[[8041,834],,{837:8111}],8048:[[945,768],,{837:8114}],8049:[[940]],8050:[[949,768]],8051:[[941]],8052:[[951,768],,{837:8130}],8053:[[942]],8054:[[953,768]],8055:[[943]],8056:[[959,768]],8057:[[972]],8058:[[965,768]],8059:[[973]],8060:[[969,768],,{837:8178}],8061:[[974]],8064:[[7936,837]],8065:[[7937,837]],8066:[[7938,837]],8067:[[7939,837]],8068:[[7940,837]],8069:[[7941,837]],8070:[[7942,837]],8071:[[7943,837]],8072:[[7944,837]],8073:[[7945,837]],8074:[[7946,837]],8075:[[7947,837]],8076:[[7948,837]],8077:[[7949,837]],8078:[[7950,837]],8079:[[7951,837]],8080:[[7968,837]],8081:[[7969,837]],8082:[[7970,837]],8083:[[7971,837]],8084:[[7972,837]],8085:[[7973,837]],8086:[[7974,837]],8087:[[7975,837]],8088:[[7976,837]],8089:[[7977,837]],8090:[[7978,837]],8091:[[7979,837]],8092:[[7980,837]],8093:[[7981,837]],8094:[[7982,837]],8095:[[7983,837]],8096:[[8032,837]],8097:[[8033,837]],8098:[[8034,837]],8099:[[8035,837]],8100:[[8036,837]],8101:[[8037,837]],8102:[[8038,837]],8103:[[8039,837]],8104:[[8040,837]],8105:[[8041,837]],8106:[[8042,837]],8107:[[8043,837]],8108:[[8044,837]],8109:[[8045,837]],8110:[[8046,837]],8111:[[8047,837]],8112:[[945,774]],8113:[[945,772]],8114:[[8048,837]],8115:[[945,837]],8116:[[940,837]],8118:[[945,834],,{837:8119}],8119:[[8118,837]],8120:[[913,774]],8121:[[913,772]],8122:[[913,768]],8123:[[902]],8124:[[913,837]],8125:[[32,787],256],8126:[[953]],8127:[[32,787],256,{768:8141,769:8142,834:8143}],8128:[[32,834],256],8129:[[168,834]],8130:[[8052,837]],8131:[[951,837]],8132:[[942,837]],8134:[[951,834],,{837:8135}],8135:[[8134,837]],8136:[[917,768]],8137:[[904]],8138:[[919,768]],8139:[[905]],8140:[[919,837]],8141:[[8127,768]],8142:[[8127,769]],8143:[[8127,834]],8144:[[953,774]],8145:[[953,772]],8146:[[970,768]],8147:[[912]],8150:[[953,834]],8151:[[970,834]],8152:[[921,774]],8153:[[921,772]],8154:[[921,768]],8155:[[906]],8157:[[8190,768]],8158:[[8190,769]],8159:[[8190,834]],8160:[[965,774]],8161:[[965,772]],8162:[[971,768]],8163:[[944]],8164:[[961,787]],8165:[[961,788]],8166:[[965,834]],8167:[[971,834]],8168:[[933,774]],8169:[[933,772]],8170:[[933,768]],8171:[[910]],8172:[[929,788]],8173:[[168,768]],8174:[[901]],8175:[[96]],8178:[[8060,837]],8179:[[969,837]],8180:[[974,837]],8182:[[969,834],,{837:8183}],8183:[[8182,837]],8184:[[927,768]],8185:[[908]],8186:[[937,768]],8187:[[911]],8188:[[937,837]],8189:[[180]],8190:[[32,788],256,{768:8157,769:8158,834:8159}]},
138628192:{8192:[[8194]],8193:[[8195]],8194:[[32],256],8195:[[32],256],8196:[[32],256],8197:[[32],256],8198:[[32],256],8199:[[32],256],8200:[[32],256],8201:[[32],256],8202:[[32],256],8209:[[8208],256],8215:[[32,819],256],8228:[[46],256],8229:[[46,46],256],8230:[[46,46,46],256],8239:[[32],256],8243:[[8242,8242],256],8244:[[8242,8242,8242],256],8246:[[8245,8245],256],8247:[[8245,8245,8245],256],8252:[[33,33],256],8254:[[32,773],256],8263:[[63,63],256],8264:[[63,33],256],8265:[[33,63],256],8279:[[8242,8242,8242,8242],256],8287:[[32],256],8304:[[48],256],8305:[[105],256],8308:[[52],256],8309:[[53],256],8310:[[54],256],8311:[[55],256],8312:[[56],256],8313:[[57],256],8314:[[43],256],8315:[[8722],256],8316:[[61],256],8317:[[40],256],8318:[[41],256],8319:[[110],256],8320:[[48],256],8321:[[49],256],8322:[[50],256],8323:[[51],256],8324:[[52],256],8325:[[53],256],8326:[[54],256],8327:[[55],256],8328:[[56],256],8329:[[57],256],8330:[[43],256],8331:[[8722],256],8332:[[61],256],8333:[[40],256],8334:[[41],256],8336:[[97],256],8337:[[101],256],8338:[[111],256],8339:[[120],256],8340:[[601],256],8341:[[104],256],8342:[[107],256],8343:[[108],256],8344:[[109],256],8345:[[110],256],8346:[[112],256],8347:[[115],256],8348:[[116],256],8360:[[82,115],256],8400:[,230],8401:[,230],8402:[,1],8403:[,1],8404:[,230],8405:[,230],8406:[,230],8407:[,230],8408:[,1],8409:[,1],8410:[,1],8411:[,230],8412:[,230],8417:[,230],8421:[,1],8422:[,1],8423:[,230],8424:[,220],8425:[,230],8426:[,1],8427:[,1],8428:[,220],8429:[,220],8430:[,220],8431:[,220],8432:[,230]},
138638448:{8448:[[97,47,99],256],8449:[[97,47,115],256],8450:[[67],256],8451:[[176,67],256],8453:[[99,47,111],256],8454:[[99,47,117],256],8455:[[400],256],8457:[[176,70],256],8458:[[103],256],8459:[[72],256],8460:[[72],256],8461:[[72],256],8462:[[104],256],8463:[[295],256],8464:[[73],256],8465:[[73],256],8466:[[76],256],8467:[[108],256],8469:[[78],256],8470:[[78,111],256],8473:[[80],256],8474:[[81],256],8475:[[82],256],8476:[[82],256],8477:[[82],256],8480:[[83,77],256],8481:[[84,69,76],256],8482:[[84,77],256],8484:[[90],256],8486:[[937]],8488:[[90],256],8490:[[75]],8491:[[197]],8492:[[66],256],8493:[[67],256],8495:[[101],256],8496:[[69],256],8497:[[70],256],8499:[[77],256],8500:[[111],256],8501:[[1488],256],8502:[[1489],256],8503:[[1490],256],8504:[[1491],256],8505:[[105],256],8507:[[70,65,88],256],8508:[[960],256],8509:[[947],256],8510:[[915],256],8511:[[928],256],8512:[[8721],256],8517:[[68],256],8518:[[100],256],8519:[[101],256],8520:[[105],256],8521:[[106],256],8528:[[49,8260,55],256],8529:[[49,8260,57],256],8530:[[49,8260,49,48],256],8531:[[49,8260,51],256],8532:[[50,8260,51],256],8533:[[49,8260,53],256],8534:[[50,8260,53],256],8535:[[51,8260,53],256],8536:[[52,8260,53],256],8537:[[49,8260,54],256],8538:[[53,8260,54],256],8539:[[49,8260,56],256],8540:[[51,8260,56],256],8541:[[53,8260,56],256],8542:[[55,8260,56],256],8543:[[49,8260],256],8544:[[73],256],8545:[[73,73],256],8546:[[73,73,73],256],8547:[[73,86],256],8548:[[86],256],8549:[[86,73],256],8550:[[86,73,73],256],8551:[[86,73,73,73],256],8552:[[73,88],256],8553:[[88],256],8554:[[88,73],256],8555:[[88,73,73],256],8556:[[76],256],8557:[[67],256],8558:[[68],256],8559:[[77],256],8560:[[105],256],8561:[[105,105],256],8562:[[105,105,105],256],8563:[[105,118],256],8564:[[118],256],8565:[[118,105],256],8566:[[118,105,105],256],8567:[[118,105,105,105],256],8568:[[105,120],256],8569:[[120],256],8570:[[120,105],256],8571:[[120,105,105],256],8572:[[108],256],8573:[[99],256],8574:[[100],256],8575:[[109],256],8585:[[48,8260,51],256],8592:[,,{824:8602}],8594:[,,{824:8603}],8596:[,,{824:8622}],8602:[[8592,824]],8603:[[8594,824]],8622:[[8596,824]],8653:[[8656,824]],8654:[[8660,824]],8655:[[8658,824]],8656:[,,{824:8653}],8658:[,,{824:8655}],8660:[,,{824:8654}]},
138648704:{8707:[,,{824:8708}],8708:[[8707,824]],8712:[,,{824:8713}],8713:[[8712,824]],8715:[,,{824:8716}],8716:[[8715,824]],8739:[,,{824:8740}],8740:[[8739,824]],8741:[,,{824:8742}],8742:[[8741,824]],8748:[[8747,8747],256],8749:[[8747,8747,8747],256],8751:[[8750,8750],256],8752:[[8750,8750,8750],256],8764:[,,{824:8769}],8769:[[8764,824]],8771:[,,{824:8772}],8772:[[8771,824]],8773:[,,{824:8775}],8775:[[8773,824]],8776:[,,{824:8777}],8777:[[8776,824]],8781:[,,{824:8813}],8800:[[61,824]],8801:[,,{824:8802}],8802:[[8801,824]],8804:[,,{824:8816}],8805:[,,{824:8817}],8813:[[8781,824]],8814:[[60,824]],8815:[[62,824]],8816:[[8804,824]],8817:[[8805,824]],8818:[,,{824:8820}],8819:[,,{824:8821}],8820:[[8818,824]],8821:[[8819,824]],8822:[,,{824:8824}],8823:[,,{824:8825}],8824:[[8822,824]],8825:[[8823,824]],8826:[,,{824:8832}],8827:[,,{824:8833}],8828:[,,{824:8928}],8829:[,,{824:8929}],8832:[[8826,824]],8833:[[8827,824]],8834:[,,{824:8836}],8835:[,,{824:8837}],8836:[[8834,824]],8837:[[8835,824]],8838:[,,{824:8840}],8839:[,,{824:8841}],8840:[[8838,824]],8841:[[8839,824]],8849:[,,{824:8930}],8850:[,,{824:8931}],8866:[,,{824:8876}],8872:[,,{824:8877}],8873:[,,{824:8878}],8875:[,,{824:8879}],8876:[[8866,824]],8877:[[8872,824]],8878:[[8873,824]],8879:[[8875,824]],8882:[,,{824:8938}],8883:[,,{824:8939}],8884:[,,{824:8940}],8885:[,,{824:8941}],8928:[[8828,824]],8929:[[8829,824]],8930:[[8849,824]],8931:[[8850,824]],8938:[[8882,824]],8939:[[8883,824]],8940:[[8884,824]],8941:[[8885,824]]},
138658960:{9001:[[12296]],9002:[[12297]]},
138669216:{9312:[[49],256],9313:[[50],256],9314:[[51],256],9315:[[52],256],9316:[[53],256],9317:[[54],256],9318:[[55],256],9319:[[56],256],9320:[[57],256],9321:[[49,48],256],9322:[[49,49],256],9323:[[49,50],256],9324:[[49,51],256],9325:[[49,52],256],9326:[[49,53],256],9327:[[49,54],256],9328:[[49,55],256],9329:[[49,56],256],9330:[[49,57],256],9331:[[50,48],256],9332:[[40,49,41],256],9333:[[40,50,41],256],9334:[[40,51,41],256],9335:[[40,52,41],256],9336:[[40,53,41],256],9337:[[40,54,41],256],9338:[[40,55,41],256],9339:[[40,56,41],256],9340:[[40,57,41],256],9341:[[40,49,48,41],256],9342:[[40,49,49,41],256],9343:[[40,49,50,41],256],9344:[[40,49,51,41],256],9345:[[40,49,52,41],256],9346:[[40,49,53,41],256],9347:[[40,49,54,41],256],9348:[[40,49,55,41],256],9349:[[40,49,56,41],256],9350:[[40,49,57,41],256],9351:[[40,50,48,41],256],9352:[[49,46],256],9353:[[50,46],256],9354:[[51,46],256],9355:[[52,46],256],9356:[[53,46],256],9357:[[54,46],256],9358:[[55,46],256],9359:[[56,46],256],9360:[[57,46],256],9361:[[49,48,46],256],9362:[[49,49,46],256],9363:[[49,50,46],256],9364:[[49,51,46],256],9365:[[49,52,46],256],9366:[[49,53,46],256],9367:[[49,54,46],256],9368:[[49,55,46],256],9369:[[49,56,46],256],9370:[[49,57,46],256],9371:[[50,48,46],256],9372:[[40,97,41],256],9373:[[40,98,41],256],9374:[[40,99,41],256],9375:[[40,100,41],256],9376:[[40,101,41],256],9377:[[40,102,41],256],9378:[[40,103,41],256],9379:[[40,104,41],256],9380:[[40,105,41],256],9381:[[40,106,41],256],9382:[[40,107,41],256],9383:[[40,108,41],256],9384:[[40,109,41],256],9385:[[40,110,41],256],9386:[[40,111,41],256],9387:[[40,112,41],256],9388:[[40,113,41],256],9389:[[40,114,41],256],9390:[[40,115,41],256],9391:[[40,116,41],256],9392:[[40,117,41],256],9393:[[40,118,41],256],9394:[[40,119,41],256],9395:[[40,120,41],256],9396:[[40,121,41],256],9397:[[40,122,41],256],9398:[[65],256],9399:[[66],256],9400:[[67],256],9401:[[68],256],9402:[[69],256],9403:[[70],256],9404:[[71],256],9405:[[72],256],9406:[[73],256],9407:[[74],256],9408:[[75],256],9409:[[76],256],9410:[[77],256],9411:[[78],256],9412:[[79],256],9413:[[80],256],9414:[[81],256],9415:[[82],256],9416:[[83],256],9417:[[84],256],9418:[[85],256],9419:[[86],256],9420:[[87],256],9421:[[88],256],9422:[[89],256],9423:[[90],256],9424:[[97],256],9425:[[98],256],9426:[[99],256],9427:[[100],256],9428:[[101],256],9429:[[102],256],9430:[[103],256],9431:[[104],256],9432:[[105],256],9433:[[106],256],9434:[[107],256],9435:[[108],256],9436:[[109],256],9437:[[110],256],9438:[[111],256],9439:[[112],256],9440:[[113],256],9441:[[114],256],9442:[[115],256],9443:[[116],256],9444:[[117],256],9445:[[118],256],9446:[[119],256],9447:[[120],256],9448:[[121],256],9449:[[122],256],9450:[[48],256]},
1386710752:{10764:[[8747,8747,8747,8747],256],10868:[[58,58,61],256],10869:[[61,61],256],10870:[[61,61,61],256],10972:[[10973,824],512]},
1386811264:{11388:[[106],256],11389:[[86],256],11503:[,230],11504:[,230],11505:[,230]},
1386911520:{11631:[[11617],256],11647:[,9],11744:[,230],11745:[,230],11746:[,230],11747:[,230],11748:[,230],11749:[,230],11750:[,230],11751:[,230],11752:[,230],11753:[,230],11754:[,230],11755:[,230],11756:[,230],11757:[,230],11758:[,230],11759:[,230],11760:[,230],11761:[,230],11762:[,230],11763:[,230],11764:[,230],11765:[,230],11766:[,230],11767:[,230],11768:[,230],11769:[,230],11770:[,230],11771:[,230],11772:[,230],11773:[,230],11774:[,230],11775:[,230]},
1387011776:{11935:[[27597],256],12019:[[40863],256]},
1387112032:{12032:[[19968],256],12033:[[20008],256],12034:[[20022],256],12035:[[20031],256],12036:[[20057],256],12037:[[20101],256],12038:[[20108],256],12039:[[20128],256],12040:[[20154],256],12041:[[20799],256],12042:[[20837],256],12043:[[20843],256],12044:[[20866],256],12045:[[20886],256],12046:[[20907],256],12047:[[20960],256],12048:[[20981],256],12049:[[20992],256],12050:[[21147],256],12051:[[21241],256],12052:[[21269],256],12053:[[21274],256],12054:[[21304],256],12055:[[21313],256],12056:[[21340],256],12057:[[21353],256],12058:[[21378],256],12059:[[21430],256],12060:[[21448],256],12061:[[21475],256],12062:[[22231],256],12063:[[22303],256],12064:[[22763],256],12065:[[22786],256],12066:[[22794],256],12067:[[22805],256],12068:[[22823],256],12069:[[22899],256],12070:[[23376],256],12071:[[23424],256],12072:[[23544],256],12073:[[23567],256],12074:[[23586],256],12075:[[23608],256],12076:[[23662],256],12077:[[23665],256],12078:[[24027],256],12079:[[24037],256],12080:[[24049],256],12081:[[24062],256],12082:[[24178],256],12083:[[24186],256],12084:[[24191],256],12085:[[24308],256],12086:[[24318],256],12087:[[24331],256],12088:[[24339],256],12089:[[24400],256],12090:[[24417],256],12091:[[24435],256],12092:[[24515],256],12093:[[25096],256],12094:[[25142],256],12095:[[25163],256],12096:[[25903],256],12097:[[25908],256],12098:[[25991],256],12099:[[26007],256],12100:[[26020],256],12101:[[26041],256],12102:[[26080],256],12103:[[26085],256],12104:[[26352],256],12105:[[26376],256],12106:[[26408],256],12107:[[27424],256],12108:[[27490],256],12109:[[27513],256],12110:[[27571],256],12111:[[27595],256],12112:[[27604],256],12113:[[27611],256],12114:[[27663],256],12115:[[27668],256],12116:[[27700],256],12117:[[28779],256],12118:[[29226],256],12119:[[29238],256],12120:[[29243],256],12121:[[29247],256],12122:[[29255],256],12123:[[29273],256],12124:[[29275],256],12125:[[29356],256],12126:[[29572],256],12127:[[29577],256],12128:[[29916],256],12129:[[29926],256],12130:[[29976],256],12131:[[29983],256],12132:[[29992],256],12133:[[30000],256],12134:[[30091],256],12135:[[30098],256],12136:[[30326],256],12137:[[30333],256],12138:[[30382],256],12139:[[30399],256],12140:[[30446],256],12141:[[30683],256],12142:[[30690],256],12143:[[30707],256],12144:[[31034],256],12145:[[31160],256],12146:[[31166],256],12147:[[31348],256],12148:[[31435],256],12149:[[31481],256],12150:[[31859],256],12151:[[31992],256],12152:[[32566],256],12153:[[32593],256],12154:[[32650],256],12155:[[32701],256],12156:[[32769],256],12157:[[32780],256],12158:[[32786],256],12159:[[32819],256],12160:[[32895],256],12161:[[32905],256],12162:[[33251],256],12163:[[33258],256],12164:[[33267],256],12165:[[33276],256],12166:[[33292],256],12167:[[33307],256],12168:[[33311],256],12169:[[33390],256],12170:[[33394],256],12171:[[33400],256],12172:[[34381],256],12173:[[34411],256],12174:[[34880],256],12175:[[34892],256],12176:[[34915],256],12177:[[35198],256],12178:[[35211],256],12179:[[35282],256],12180:[[35328],256],12181:[[35895],256],12182:[[35910],256],12183:[[35925],256],12184:[[35960],256],12185:[[35997],256],12186:[[36196],256],12187:[[36208],256],12188:[[36275],256],12189:[[36523],256],12190:[[36554],256],12191:[[36763],256],12192:[[36784],256],12193:[[36789],256],12194:[[37009],256],12195:[[37193],256],12196:[[37318],256],12197:[[37324],256],12198:[[37329],256],12199:[[38263],256],12200:[[38272],256],12201:[[38428],256],12202:[[38582],256],12203:[[38585],256],12204:[[38632],256],12205:[[38737],256],12206:[[38750],256],12207:[[38754],256],12208:[[38761],256],12209:[[38859],256],12210:[[38893],256],12211:[[38899],256],12212:[[38913],256],12213:[[39080],256],12214:[[39131],256],12215:[[39135],256],12216:[[39318],256],12217:[[39321],256],12218:[[39340],256],12219:[[39592],256],12220:[[39640],256],12221:[[39647],256],12222:[[39717],256],12223:[[39727],256],12224:[[39730],256],12225:[[39740],256],12226:[[39770],256],12227:[[40165],256],12228:[[40565],256],12229:[[40575],256],12230:[[40613],256],12231:[[40635],256],12232:[[40643],256],12233:[[40653],256],12234:[[40657],256],12235:[[40697],256],12236:[[40701],256],12237:[[40718],256],12238:[[40723],256],12239:[[40736],256],12240:[[40763],256],12241:[[40778],256],12242:[[40786],256],12243:[[40845],256],12244:[[40860],256],12245:[[40864],256]},
1387212288:{12288:[[32],256],12330:[,218],12331:[,228],12332:[,232],12333:[,222],12334:[,224],12335:[,224],12342:[[12306],256],12344:[[21313],256],12345:[[21316],256],12346:[[21317],256],12358:[,,{12441:12436}],12363:[,,{12441:12364}],12364:[[12363,12441]],12365:[,,{12441:12366}],12366:[[12365,12441]],12367:[,,{12441:12368}],12368:[[12367,12441]],12369:[,,{12441:12370}],12370:[[12369,12441]],12371:[,,{12441:12372}],12372:[[12371,12441]],12373:[,,{12441:12374}],12374:[[12373,12441]],12375:[,,{12441:12376}],12376:[[12375,12441]],12377:[,,{12441:12378}],12378:[[12377,12441]],12379:[,,{12441:12380}],12380:[[12379,12441]],12381:[,,{12441:12382}],12382:[[12381,12441]],12383:[,,{12441:12384}],12384:[[12383,12441]],12385:[,,{12441:12386}],12386:[[12385,12441]],12388:[,,{12441:12389}],12389:[[12388,12441]],12390:[,,{12441:12391}],12391:[[12390,12441]],12392:[,,{12441:12393}],12393:[[12392,12441]],12399:[,,{12441:12400,12442:12401}],12400:[[12399,12441]],12401:[[12399,12442]],12402:[,,{12441:12403,12442:12404}],12403:[[12402,12441]],12404:[[12402,12442]],12405:[,,{12441:12406,12442:12407}],12406:[[12405,12441]],12407:[[12405,12442]],12408:[,,{12441:12409,12442:12410}],12409:[[12408,12441]],12410:[[12408,12442]],12411:[,,{12441:12412,12442:12413}],12412:[[12411,12441]],12413:[[12411,12442]],12436:[[12358,12441]],12441:[,8],12442:[,8],12443:[[32,12441],256],12444:[[32,12442],256],12445:[,,{12441:12446}],12446:[[12445,12441]],12447:[[12424,12426],256],12454:[,,{12441:12532}],12459:[,,{12441:12460}],12460:[[12459,12441]],12461:[,,{12441:12462}],12462:[[12461,12441]],12463:[,,{12441:12464}],12464:[[12463,12441]],12465:[,,{12441:12466}],12466:[[12465,12441]],12467:[,,{12441:12468}],12468:[[12467,12441]],12469:[,,{12441:12470}],12470:[[12469,12441]],12471:[,,{12441:12472}],12472:[[12471,12441]],12473:[,,{12441:12474}],12474:[[12473,12441]],12475:[,,{12441:12476}],12476:[[12475,12441]],12477:[,,{12441:12478}],12478:[[12477,12441]],12479:[,,{12441:12480}],12480:[[12479,12441]],12481:[,,{12441:12482}],12482:[[12481,12441]],12484:[,,{12441:12485}],12485:[[12484,12441]],12486:[,,{12441:12487}],12487:[[12486,12441]],12488:[,,{12441:12489}],12489:[[12488,12441]],12495:[,,{12441:12496,12442:12497}],12496:[[12495,12441]],12497:[[12495,12442]],12498:[,,{12441:12499,12442:12500}],12499:[[12498,12441]],12500:[[12498,12442]],12501:[,,{12441:12502,12442:12503}],12502:[[12501,12441]],12503:[[12501,12442]],12504:[,,{12441:12505,12442:12506}],12505:[[12504,12441]],12506:[[12504,12442]],12507:[,,{12441:12508,12442:12509}],12508:[[12507,12441]],12509:[[12507,12442]],12527:[,,{12441:12535}],12528:[,,{12441:12536}],12529:[,,{12441:12537}],12530:[,,{12441:12538}],12532:[[12454,12441]],12535:[[12527,12441]],12536:[[12528,12441]],12537:[[12529,12441]],12538:[[12530,12441]],12541:[,,{12441:12542}],12542:[[12541,12441]],12543:[[12467,12488],256]},
1387312544:{12593:[[4352],256],12594:[[4353],256],12595:[[4522],256],12596:[[4354],256],12597:[[4524],256],12598:[[4525],256],12599:[[4355],256],12600:[[4356],256],12601:[[4357],256],12602:[[4528],256],12603:[[4529],256],12604:[[4530],256],12605:[[4531],256],12606:[[4532],256],12607:[[4533],256],12608:[[4378],256],12609:[[4358],256],12610:[[4359],256],12611:[[4360],256],12612:[[4385],256],12613:[[4361],256],12614:[[4362],256],12615:[[4363],256],12616:[[4364],256],12617:[[4365],256],12618:[[4366],256],12619:[[4367],256],12620:[[4368],256],12621:[[4369],256],12622:[[4370],256],12623:[[4449],256],12624:[[4450],256],12625:[[4451],256],12626:[[4452],256],12627:[[4453],256],12628:[[4454],256],12629:[[4455],256],12630:[[4456],256],12631:[[4457],256],12632:[[4458],256],12633:[[4459],256],12634:[[4460],256],12635:[[4461],256],12636:[[4462],256],12637:[[4463],256],12638:[[4464],256],12639:[[4465],256],12640:[[4466],256],12641:[[4467],256],12642:[[4468],256],12643:[[4469],256],12644:[[4448],256],12645:[[4372],256],12646:[[4373],256],12647:[[4551],256],12648:[[4552],256],12649:[[4556],256],12650:[[4558],256],12651:[[4563],256],12652:[[4567],256],12653:[[4569],256],12654:[[4380],256],12655:[[4573],256],12656:[[4575],256],12657:[[4381],256],12658:[[4382],256],12659:[[4384],256],12660:[[4386],256],12661:[[4387],256],12662:[[4391],256],12663:[[4393],256],12664:[[4395],256],12665:[[4396],256],12666:[[4397],256],12667:[[4398],256],12668:[[4399],256],12669:[[4402],256],12670:[[4406],256],12671:[[4416],256],12672:[[4423],256],12673:[[4428],256],12674:[[4593],256],12675:[[4594],256],12676:[[4439],256],12677:[[4440],256],12678:[[4441],256],12679:[[4484],256],12680:[[4485],256],12681:[[4488],256],12682:[[4497],256],12683:[[4498],256],12684:[[4500],256],12685:[[4510],256],12686:[[4513],256],12690:[[19968],256],12691:[[20108],256],12692:[[19977],256],12693:[[22235],256],12694:[[19978],256],12695:[[20013],256],12696:[[19979],256],12697:[[30002],256],12698:[[20057],256],12699:[[19993],256],12700:[[19969],256],12701:[[22825],256],12702:[[22320],256],12703:[[20154],256]},
1387412800:{12800:[[40,4352,41],256],12801:[[40,4354,41],256],12802:[[40,4355,41],256],12803:[[40,4357,41],256],12804:[[40,4358,41],256],12805:[[40,4359,41],256],12806:[[40,4361,41],256],12807:[[40,4363,41],256],12808:[[40,4364,41],256],12809:[[40,4366,41],256],12810:[[40,4367,41],256],12811:[[40,4368,41],256],12812:[[40,4369,41],256],12813:[[40,4370,41],256],12814:[[40,4352,4449,41],256],12815:[[40,4354,4449,41],256],12816:[[40,4355,4449,41],256],12817:[[40,4357,4449,41],256],12818:[[40,4358,4449,41],256],12819:[[40,4359,4449,41],256],12820:[[40,4361,4449,41],256],12821:[[40,4363,4449,41],256],12822:[[40,4364,4449,41],256],12823:[[40,4366,4449,41],256],12824:[[40,4367,4449,41],256],12825:[[40,4368,4449,41],256],12826:[[40,4369,4449,41],256],12827:[[40,4370,4449,41],256],12828:[[40,4364,4462,41],256],12829:[[40,4363,4457,4364,4453,4523,41],256],12830:[[40,4363,4457,4370,4462,41],256],12832:[[40,19968,41],256],12833:[[40,20108,41],256],12834:[[40,19977,41],256],12835:[[40,22235,41],256],12836:[[40,20116,41],256],12837:[[40,20845,41],256],12838:[[40,19971,41],256],12839:[[40,20843,41],256],12840:[[40,20061,41],256],12841:[[40,21313,41],256],12842:[[40,26376,41],256],12843:[[40,28779,41],256],12844:[[40,27700,41],256],12845:[[40,26408,41],256],12846:[[40,37329,41],256],12847:[[40,22303,41],256],12848:[[40,26085,41],256],12849:[[40,26666,41],256],12850:[[40,26377,41],256],12851:[[40,31038,41],256],12852:[[40,21517,41],256],12853:[[40,29305,41],256],12854:[[40,36001,41],256],12855:[[40,31069,41],256],12856:[[40,21172,41],256],12857:[[40,20195,41],256],12858:[[40,21628,41],256],12859:[[40,23398,41],256],12860:[[40,30435,41],256],12861:[[40,20225,41],256],12862:[[40,36039,41],256],12863:[[40,21332,41],256],12864:[[40,31085,41],256],12865:[[40,20241,41],256],12866:[[40,33258,41],256],12867:[[40,33267,41],256],12868:[[21839],256],12869:[[24188],256],12870:[[25991],256],12871:[[31631],256],12880:[[80,84,69],256],12881:[[50,49],256],12882:[[50,50],256],12883:[[50,51],256],12884:[[50,52],256],12885:[[50,53],256],12886:[[50,54],256],12887:[[50,55],256],12888:[[50,56],256],12889:[[50,57],256],12890:[[51,48],256],12891:[[51,49],256],12892:[[51,50],256],12893:[[51,51],256],12894:[[51,52],256],12895:[[51,53],256],12896:[[4352],256],12897:[[4354],256],12898:[[4355],256],12899:[[4357],256],12900:[[4358],256],12901:[[4359],256],12902:[[4361],256],12903:[[4363],256],12904:[[4364],256],12905:[[4366],256],12906:[[4367],256],12907:[[4368],256],12908:[[4369],256],12909:[[4370],256],12910:[[4352,4449],256],12911:[[4354,4449],256],12912:[[4355,4449],256],12913:[[4357,4449],256],12914:[[4358,4449],256],12915:[[4359,4449],256],12916:[[4361,4449],256],12917:[[4363,4449],256],12918:[[4364,4449],256],12919:[[4366,4449],256],12920:[[4367,4449],256],12921:[[4368,4449],256],12922:[[4369,4449],256],12923:[[4370,4449],256],12924:[[4366,4449,4535,4352,4457],256],12925:[[4364,4462,4363,4468],256],12926:[[4363,4462],256],12928:[[19968],256],12929:[[20108],256],12930:[[19977],256],12931:[[22235],256],12932:[[20116],256],12933:[[20845],256],12934:[[19971],256],12935:[[20843],256],12936:[[20061],256],12937:[[21313],256],12938:[[26376],256],12939:[[28779],256],12940:[[27700],256],12941:[[26408],256],12942:[[37329],256],12943:[[22303],256],12944:[[26085],256],12945:[[26666],256],12946:[[26377],256],12947:[[31038],256],12948:[[21517],256],12949:[[29305],256],12950:[[36001],256],12951:[[31069],256],12952:[[21172],256],12953:[[31192],256],12954:[[30007],256],12955:[[22899],256],12956:[[36969],256],12957:[[20778],256],12958:[[21360],256],12959:[[27880],256],12960:[[38917],256],12961:[[20241],256],12962:[[20889],256],12963:[[27491],256],12964:[[19978],256],12965:[[20013],256],12966:[[19979],256],12967:[[24038],256],12968:[[21491],256],12969:[[21307],256],12970:[[23447],256],12971:[[23398],256],12972:[[30435],256],12973:[[20225],256],12974:[[36039],256],12975:[[21332],256],12976:[[22812],256],12977:[[51,54],256],12978:[[51,55],256],12979:[[51,56],256],12980:[[51,57],256],12981:[[52,48],256],12982:[[52,49],256],12983:[[52,50],256],12984:[[52,51],256],12985:[[52,52],256],12986:[[52,53],256],12987:[[52,54],256],12988:[[52,55],256],12989:[[52,56],256],12990:[[52,57],256],12991:[[53,48],256],12992:[[49,26376],256],12993:[[50,26376],256],12994:[[51,26376],256],12995:[[52,26376],256],12996:[[53,26376],256],12997:[[54,26376],256],12998:[[55,26376],256],12999:[[56,26376],256],13000:[[57,26376],256],13001:[[49,48,26376],256],13002:[[49,49,26376],256],13003:[[49,50,26376],256],13004:[[72,103],256],13005:[[101,114,103],256],13006:[[101,86],256],13007:[[76,84,68],256],13008:[[12450],256],13009:[[12452],256],13010:[[12454],256],13011:[[12456],256],13012:[[12458],256],13013:[[12459],256],13014:[[12461],256],13015:[[12463],256],13016:[[12465],256],13017:[[12467],256],13018:[[12469],256],13019:[[12471],256],13020:[[12473],256],13021:[[12475],256],13022:[[12477],256],13023:[[12479],256],13024:[[12481],256],13025:[[12484],256],13026:[[12486],256],13027:[[12488],256],13028:[[12490],256],13029:[[12491],256],13030:[[12492],256],13031:[[12493],256],13032:[[12494],256],13033:[[12495],256],13034:[[12498],256],13035:[[12501],256],13036:[[12504],256],13037:[[12507],256],13038:[[12510],256],13039:[[12511],256],13040:[[12512],256],13041:[[12513],256],13042:[[12514],256],13043:[[12516],256],13044:[[12518],256],13045:[[12520],256],13046:[[12521],256],13047:[[12522],256],13048:[[12523],256],13049:[[12524],256],13050:[[12525],256],13051:[[12527],256],13052:[[12528],256],13053:[[12529],256],13054:[[12530],256]},
1387513056:{13056:[[12450,12497,12540,12488],256],13057:[[12450,12523,12501,12449],256],13058:[[12450,12531,12506,12450],256],13059:[[12450,12540,12523],256],13060:[[12452,12491,12531,12464],256],13061:[[12452,12531,12481],256],13062:[[12454,12457,12531],256],13063:[[12456,12473,12463,12540,12489],256],13064:[[12456,12540,12459,12540],256],13065:[[12458,12531,12473],256],13066:[[12458,12540,12512],256],13067:[[12459,12452,12522],256],13068:[[12459,12521,12483,12488],256],13069:[[12459,12525,12522,12540],256],13070:[[12460,12525,12531],256],13071:[[12460,12531,12510],256],13072:[[12462,12460],256],13073:[[12462,12491,12540],256],13074:[[12461,12517,12522,12540],256],13075:[[12462,12523,12480,12540],256],13076:[[12461,12525],256],13077:[[12461,12525,12464,12521,12512],256],13078:[[12461,12525,12513,12540,12488,12523],256],13079:[[12461,12525,12527,12483,12488],256],13080:[[12464,12521,12512],256],13081:[[12464,12521,12512,12488,12531],256],13082:[[12463,12523,12476,12452,12525],256],13083:[[12463,12525,12540,12493],256],13084:[[12465,12540,12473],256],13085:[[12467,12523,12490],256],13086:[[12467,12540,12509],256],13087:[[12469,12452,12463,12523],256],13088:[[12469,12531,12481,12540,12512],256],13089:[[12471,12522,12531,12464],256],13090:[[12475,12531,12481],256],13091:[[12475,12531,12488],256],13092:[[12480,12540,12473],256],13093:[[12487,12471],256],13094:[[12489,12523],256],13095:[[12488,12531],256],13096:[[12490,12494],256],13097:[[12494,12483,12488],256],13098:[[12495,12452,12484],256],13099:[[12497,12540,12475,12531,12488],256],13100:[[12497,12540,12484],256],13101:[[12496,12540,12524,12523],256],13102:[[12500,12450,12473,12488,12523],256],13103:[[12500,12463,12523],256],13104:[[12500,12467],256],13105:[[12499,12523],256],13106:[[12501,12449,12521,12483,12489],256],13107:[[12501,12451,12540,12488],256],13108:[[12502,12483,12471,12455,12523],256],13109:[[12501,12521,12531],256],13110:[[12504,12463,12479,12540,12523],256],13111:[[12506,12477],256],13112:[[12506,12491,12498],256],13113:[[12504,12523,12484],256],13114:[[12506,12531,12473],256],13115:[[12506,12540,12472],256],13116:[[12505,12540,12479],256],13117:[[12509,12452,12531,12488],256],13118:[[12508,12523,12488],256],13119:[[12507,12531],256],13120:[[12509,12531,12489],256],13121:[[12507,12540,12523],256],13122:[[12507,12540,12531],256],13123:[[12510,12452,12463,12525],256],13124:[[12510,12452,12523],256],13125:[[12510,12483,12495],256],13126:[[12510,12523,12463],256],13127:[[12510,12531,12471,12519,12531],256],13128:[[12511,12463,12525,12531],256],13129:[[12511,12522],256],13130:[[12511,12522,12496,12540,12523],256],13131:[[12513,12460],256],13132:[[12513,12460,12488,12531],256],13133:[[12513,12540,12488,12523],256],13134:[[12516,12540,12489],256],13135:[[12516,12540,12523],256],13136:[[12518,12450,12531],256],13137:[[12522,12483,12488,12523],256],13138:[[12522,12521],256],13139:[[12523,12500,12540],256],13140:[[12523,12540,12502,12523],256],13141:[[12524,12512],256],13142:[[12524,12531,12488,12466,12531],256],13143:[[12527,12483,12488],256],13144:[[48,28857],256],13145:[[49,28857],256],13146:[[50,28857],256],13147:[[51,28857],256],13148:[[52,28857],256],13149:[[53,28857],256],13150:[[54,28857],256],13151:[[55,28857],256],13152:[[56,28857],256],13153:[[57,28857],256],13154:[[49,48,28857],256],13155:[[49,49,28857],256],13156:[[49,50,28857],256],13157:[[49,51,28857],256],13158:[[49,52,28857],256],13159:[[49,53,28857],256],13160:[[49,54,28857],256],13161:[[49,55,28857],256],13162:[[49,56,28857],256],13163:[[49,57,28857],256],13164:[[50,48,28857],256],13165:[[50,49,28857],256],13166:[[50,50,28857],256],13167:[[50,51,28857],256],13168:[[50,52,28857],256],13169:[[104,80,97],256],13170:[[100,97],256],13171:[[65,85],256],13172:[[98,97,114],256],13173:[[111,86],256],13174:[[112,99],256],13175:[[100,109],256],13176:[[100,109,178],256],13177:[[100,109,179],256],13178:[[73,85],256],13179:[[24179,25104],256],13180:[[26157,21644],256],13181:[[22823,27491],256],13182:[[26126,27835],256],13183:[[26666,24335,20250,31038],256],13184:[[112,65],256],13185:[[110,65],256],13186:[[956,65],256],13187:[[109,65],256],13188:[[107,65],256],13189:[[75,66],256],13190:[[77,66],256],13191:[[71,66],256],13192:[[99,97,108],256],13193:[[107,99,97,108],256],13194:[[112,70],256],13195:[[110,70],256],13196:[[956,70],256],13197:[[956,103],256],13198:[[109,103],256],13199:[[107,103],256],13200:[[72,122],256],13201:[[107,72,122],256],13202:[[77,72,122],256],13203:[[71,72,122],256],13204:[[84,72,122],256],13205:[[956,8467],256],13206:[[109,8467],256],13207:[[100,8467],256],13208:[[107,8467],256],13209:[[102,109],256],13210:[[110,109],256],13211:[[956,109],256],13212:[[109,109],256],13213:[[99,109],256],13214:[[107,109],256],13215:[[109,109,178],256],13216:[[99,109,178],256],13217:[[109,178],256],13218:[[107,109,178],256],13219:[[109,109,179],256],13220:[[99,109,179],256],13221:[[109,179],256],13222:[[107,109,179],256],13223:[[109,8725,115],256],13224:[[109,8725,115,178],256],13225:[[80,97],256],13226:[[107,80,97],256],13227:[[77,80,97],256],13228:[[71,80,97],256],13229:[[114,97,100],256],13230:[[114,97,100,8725,115],256],13231:[[114,97,100,8725,115,178],256],13232:[[112,115],256],13233:[[110,115],256],13234:[[956,115],256],13235:[[109,115],256],13236:[[112,86],256],13237:[[110,86],256],13238:[[956,86],256],13239:[[109,86],256],13240:[[107,86],256],13241:[[77,86],256],13242:[[112,87],256],13243:[[110,87],256],13244:[[956,87],256],13245:[[109,87],256],13246:[[107,87],256],13247:[[77,87],256],13248:[[107,937],256],13249:[[77,937],256],13250:[[97,46,109,46],256],13251:[[66,113],256],13252:[[99,99],256],13253:[[99,100],256],13254:[[67,8725,107,103],256],13255:[[67,111,46],256],13256:[[100,66],256],13257:[[71,121],256],13258:[[104,97],256],13259:[[72,80],256],13260:[[105,110],256],13261:[[75,75],256],13262:[[75,77],256],13263:[[107,116],256],13264:[[108,109],256],13265:[[108,110],256],13266:[[108,111,103],256],13267:[[108,120],256],13268:[[109,98],256],13269:[[109,105,108],256],13270:[[109,111,108],256],13271:[[80,72],256],13272:[[112,46,109,46],256],13273:[[80,80,77],256],13274:[[80,82],256],13275:[[115,114],256],13276:[[83,118],256],13277:[[87,98],256],13278:[[86,8725,109],256],13279:[[65,8725,109],256],13280:[[49,26085],256],13281:[[50,26085],256],13282:[[51,26085],256],13283:[[52,26085],256],13284:[[53,26085],256],13285:[[54,26085],256],13286:[[55,26085],256],13287:[[56,26085],256],13288:[[57,26085],256],13289:[[49,48,26085],256],13290:[[49,49,26085],256],13291:[[49,50,26085],256],13292:[[49,51,26085],256],13293:[[49,52,26085],256],13294:[[49,53,26085],256],13295:[[49,54,26085],256],13296:[[49,55,26085],256],13297:[[49,56,26085],256],13298:[[49,57,26085],256],13299:[[50,48,26085],256],13300:[[50,49,26085],256],13301:[[50,50,26085],256],13302:[[50,51,26085],256],13303:[[50,52,26085],256],13304:[[50,53,26085],256],13305:[[50,54,26085],256],13306:[[50,55,26085],256],13307:[[50,56,26085],256],13308:[[50,57,26085],256],13309:[[51,48,26085],256],13310:[[51,49,26085],256],13311:[[103,97,108],256]},
1387627136:{92912:[,1],92913:[,1],92914:[,1],92915:[,1],92916:[,1]},
1387727392:{92976:[,230],92977:[,230],92978:[,230],92979:[,230],92980:[,230],92981:[,230],92982:[,230]},
1387842496:{42607:[,230],42612:[,230],42613:[,230],42614:[,230],42615:[,230],42616:[,230],42617:[,230],42618:[,230],42619:[,230],42620:[,230],42621:[,230],42652:[[1098],256],42653:[[1100],256],42655:[,230],42736:[,230],42737:[,230]},
1387942752:{42864:[[42863],256],43000:[[294],256],43001:[[339],256]},
1388043008:{43014:[,9],43204:[,9],43232:[,230],43233:[,230],43234:[,230],43235:[,230],43236:[,230],43237:[,230],43238:[,230],43239:[,230],43240:[,230],43241:[,230],43242:[,230],43243:[,230],43244:[,230],43245:[,230],43246:[,230],43247:[,230],43248:[,230],43249:[,230]},
1388143264:{43307:[,220],43308:[,220],43309:[,220],43347:[,9],43443:[,7],43456:[,9]},
1388243520:{43696:[,230],43698:[,230],43699:[,230],43700:[,220],43703:[,230],43704:[,230],43710:[,230],43711:[,230],43713:[,230],43766:[,9]},
1388343776:{43868:[[42791],256],43869:[[43831],256],43870:[[619],256],43871:[[43858],256],44013:[,9]},
1388448128:{113822:[,1]},
1388553504:{119134:[[119127,119141],512],119135:[[119128,119141],512],119136:[[119135,119150],512],119137:[[119135,119151],512],119138:[[119135,119152],512],119139:[[119135,119153],512],119140:[[119135,119154],512],119141:[,216],119142:[,216],119143:[,1],119144:[,1],119145:[,1],119149:[,226],119150:[,216],119151:[,216],119152:[,216],119153:[,216],119154:[,216],119163:[,220],119164:[,220],119165:[,220],119166:[,220],119167:[,220],119168:[,220],119169:[,220],119170:[,220],119173:[,230],119174:[,230],119175:[,230],119176:[,230],119177:[,230],119178:[,220],119179:[,220],119210:[,230],119211:[,230],119212:[,230],119213:[,230],119227:[[119225,119141],512],119228:[[119226,119141],512],119229:[[119227,119150],512],119230:[[119228,119150],512],119231:[[119227,119151],512],119232:[[119228,119151],512]},
1388653760:{119362:[,230],119363:[,230],119364:[,230]},
1388754272:{119808:[[65],256],119809:[[66],256],119810:[[67],256],119811:[[68],256],119812:[[69],256],119813:[[70],256],119814:[[71],256],119815:[[72],256],119816:[[73],256],119817:[[74],256],119818:[[75],256],119819:[[76],256],119820:[[77],256],119821:[[78],256],119822:[[79],256],119823:[[80],256],119824:[[81],256],119825:[[82],256],119826:[[83],256],119827:[[84],256],119828:[[85],256],119829:[[86],256],119830:[[87],256],119831:[[88],256],119832:[[89],256],119833:[[90],256],119834:[[97],256],119835:[[98],256],119836:[[99],256],119837:[[100],256],119838:[[101],256],119839:[[102],256],119840:[[103],256],119841:[[104],256],119842:[[105],256],119843:[[106],256],119844:[[107],256],119845:[[108],256],119846:[[109],256],119847:[[110],256],119848:[[111],256],119849:[[112],256],119850:[[113],256],119851:[[114],256],119852:[[115],256],119853:[[116],256],119854:[[117],256],119855:[[118],256],119856:[[119],256],119857:[[120],256],119858:[[121],256],119859:[[122],256],119860:[[65],256],119861:[[66],256],119862:[[67],256],119863:[[68],256],119864:[[69],256],119865:[[70],256],119866:[[71],256],119867:[[72],256],119868:[[73],256],119869:[[74],256],119870:[[75],256],119871:[[76],256],119872:[[77],256],119873:[[78],256],119874:[[79],256],119875:[[80],256],119876:[[81],256],119877:[[82],256],119878:[[83],256],119879:[[84],256],119880:[[85],256],119881:[[86],256],119882:[[87],256],119883:[[88],256],119884:[[89],256],119885:[[90],256],119886:[[97],256],119887:[[98],256],119888:[[99],256],119889:[[100],256],119890:[[101],256],119891:[[102],256],119892:[[103],256],119894:[[105],256],119895:[[106],256],119896:[[107],256],119897:[[108],256],119898:[[109],256],119899:[[110],256],119900:[[111],256],119901:[[112],256],119902:[[113],256],119903:[[114],256],119904:[[115],256],119905:[[116],256],119906:[[117],256],119907:[[118],256],119908:[[119],256],119909:[[120],256],119910:[[121],256],119911:[[122],256],119912:[[65],256],119913:[[66],256],119914:[[67],256],119915:[[68],256],119916:[[69],256],119917:[[70],256],119918:[[71],256],119919:[[72],256],119920:[[73],256],119921:[[74],256],119922:[[75],256],119923:[[76],256],119924:[[77],256],119925:[[78],256],119926:[[79],256],119927:[[80],256],119928:[[81],256],119929:[[82],256],119930:[[83],256],119931:[[84],256],119932:[[85],256],119933:[[86],256],119934:[[87],256],119935:[[88],256],119936:[[89],256],119937:[[90],256],119938:[[97],256],119939:[[98],256],119940:[[99],256],119941:[[100],256],119942:[[101],256],119943:[[102],256],119944:[[103],256],119945:[[104],256],119946:[[105],256],119947:[[106],256],119948:[[107],256],119949:[[108],256],119950:[[109],256],119951:[[110],256],119952:[[111],256],119953:[[112],256],119954:[[113],256],119955:[[114],256],119956:[[115],256],119957:[[116],256],119958:[[117],256],119959:[[118],256],119960:[[119],256],119961:[[120],256],119962:[[121],256],119963:[[122],256],119964:[[65],256],119966:[[67],256],119967:[[68],256],119970:[[71],256],119973:[[74],256],119974:[[75],256],119977:[[78],256],119978:[[79],256],119979:[[80],256],119980:[[81],256],119982:[[83],256],119983:[[84],256],119984:[[85],256],119985:[[86],256],119986:[[87],256],119987:[[88],256],119988:[[89],256],119989:[[90],256],119990:[[97],256],119991:[[98],256],119992:[[99],256],119993:[[100],256],119995:[[102],256],119997:[[104],256],119998:[[105],256],119999:[[106],256],120000:[[107],256],120001:[[108],256],120002:[[109],256],120003:[[110],256],120005:[[112],256],120006:[[113],256],120007:[[114],256],120008:[[115],256],120009:[[116],256],120010:[[117],256],120011:[[118],256],120012:[[119],256],120013:[[120],256],120014:[[121],256],120015:[[122],256],120016:[[65],256],120017:[[66],256],120018:[[67],256],120019:[[68],256],120020:[[69],256],120021:[[70],256],120022:[[71],256],120023:[[72],256],120024:[[73],256],120025:[[74],256],120026:[[75],256],120027:[[76],256],120028:[[77],256],120029:[[78],256],120030:[[79],256],120031:[[80],256],120032:[[81],256],120033:[[82],256],120034:[[83],256],120035:[[84],256],120036:[[85],256],120037:[[86],256],120038:[[87],256],120039:[[88],256],120040:[[89],256],120041:[[90],256],120042:[[97],256],120043:[[98],256],120044:[[99],256],120045:[[100],256],120046:[[101],256],120047:[[102],256],120048:[[103],256],120049:[[104],256],120050:[[105],256],120051:[[106],256],120052:[[107],256],120053:[[108],256],120054:[[109],256],120055:[[110],256],120056:[[111],256],120057:[[112],256],120058:[[113],256],120059:[[114],256],120060:[[115],256],120061:[[116],256],120062:[[117],256],120063:[[118],256]},
1388854528:{120064:[[119],256],120065:[[120],256],120066:[[121],256],120067:[[122],256],120068:[[65],256],120069:[[66],256],120071:[[68],256],120072:[[69],256],120073:[[70],256],120074:[[71],256],120077:[[74],256],120078:[[75],256],120079:[[76],256],120080:[[77],256],120081:[[78],256],120082:[[79],256],120083:[[80],256],120084:[[81],256],120086:[[83],256],120087:[[84],256],120088:[[85],256],120089:[[86],256],120090:[[87],256],120091:[[88],256],120092:[[89],256],120094:[[97],256],120095:[[98],256],120096:[[99],256],120097:[[100],256],120098:[[101],256],120099:[[102],256],120100:[[103],256],120101:[[104],256],120102:[[105],256],120103:[[106],256],120104:[[107],256],120105:[[108],256],120106:[[109],256],120107:[[110],256],120108:[[111],256],120109:[[112],256],120110:[[113],256],120111:[[114],256],120112:[[115],256],120113:[[116],256],120114:[[117],256],120115:[[118],256],120116:[[119],256],120117:[[120],256],120118:[[121],256],120119:[[122],256],120120:[[65],256],120121:[[66],256],120123:[[68],256],120124:[[69],256],120125:[[70],256],120126:[[71],256],120128:[[73],256],120129:[[74],256],120130:[[75],256],120131:[[76],256],120132:[[77],256],120134:[[79],256],120138:[[83],256],120139:[[84],256],120140:[[85],256],120141:[[86],256],120142:[[87],256],120143:[[88],256],120144:[[89],256],120146:[[97],256],120147:[[98],256],120148:[[99],256],120149:[[100],256],120150:[[101],256],120151:[[102],256],120152:[[103],256],120153:[[104],256],120154:[[105],256],120155:[[106],256],120156:[[107],256],120157:[[108],256],120158:[[109],256],120159:[[110],256],120160:[[111],256],120161:[[112],256],120162:[[113],256],120163:[[114],256],120164:[[115],256],120165:[[116],256],120166:[[117],256],120167:[[118],256],120168:[[119],256],120169:[[120],256],120170:[[121],256],120171:[[122],256],120172:[[65],256],120173:[[66],256],120174:[[67],256],120175:[[68],256],120176:[[69],256],120177:[[70],256],120178:[[71],256],120179:[[72],256],120180:[[73],256],120181:[[74],256],120182:[[75],256],120183:[[76],256],120184:[[77],256],120185:[[78],256],120186:[[79],256],120187:[[80],256],120188:[[81],256],120189:[[82],256],120190:[[83],256],120191:[[84],256],120192:[[85],256],120193:[[86],256],120194:[[87],256],120195:[[88],256],120196:[[89],256],120197:[[90],256],120198:[[97],256],120199:[[98],256],120200:[[99],256],120201:[[100],256],120202:[[101],256],120203:[[102],256],120204:[[103],256],120205:[[104],256],120206:[[105],256],120207:[[106],256],120208:[[107],256],120209:[[108],256],120210:[[109],256],120211:[[110],256],120212:[[111],256],120213:[[112],256],120214:[[113],256],120215:[[114],256],120216:[[115],256],120217:[[116],256],120218:[[117],256],120219:[[118],256],120220:[[119],256],120221:[[120],256],120222:[[121],256],120223:[[122],256],120224:[[65],256],120225:[[66],256],120226:[[67],256],120227:[[68],256],120228:[[69],256],120229:[[70],256],120230:[[71],256],120231:[[72],256],120232:[[73],256],120233:[[74],256],120234:[[75],256],120235:[[76],256],120236:[[77],256],120237:[[78],256],120238:[[79],256],120239:[[80],256],120240:[[81],256],120241:[[82],256],120242:[[83],256],120243:[[84],256],120244:[[85],256],120245:[[86],256],120246:[[87],256],120247:[[88],256],120248:[[89],256],120249:[[90],256],120250:[[97],256],120251:[[98],256],120252:[[99],256],120253:[[100],256],120254:[[101],256],120255:[[102],256],120256:[[103],256],120257:[[104],256],120258:[[105],256],120259:[[106],256],120260:[[107],256],120261:[[108],256],120262:[[109],256],120263:[[110],256],120264:[[111],256],120265:[[112],256],120266:[[113],256],120267:[[114],256],120268:[[115],256],120269:[[116],256],120270:[[117],256],120271:[[118],256],120272:[[119],256],120273:[[120],256],120274:[[121],256],120275:[[122],256],120276:[[65],256],120277:[[66],256],120278:[[67],256],120279:[[68],256],120280:[[69],256],120281:[[70],256],120282:[[71],256],120283:[[72],256],120284:[[73],256],120285:[[74],256],120286:[[75],256],120287:[[76],256],120288:[[77],256],120289:[[78],256],120290:[[79],256],120291:[[80],256],120292:[[81],256],120293:[[82],256],120294:[[83],256],120295:[[84],256],120296:[[85],256],120297:[[86],256],120298:[[87],256],120299:[[88],256],120300:[[89],256],120301:[[90],256],120302:[[97],256],120303:[[98],256],120304:[[99],256],120305:[[100],256],120306:[[101],256],120307:[[102],256],120308:[[103],256],120309:[[104],256],120310:[[105],256],120311:[[106],256],120312:[[107],256],120313:[[108],256],120314:[[109],256],120315:[[110],256],120316:[[111],256],120317:[[112],256],120318:[[113],256],120319:[[114],256]},
1388954784:{120320:[[115],256],120321:[[116],256],120322:[[117],256],120323:[[118],256],120324:[[119],256],120325:[[120],256],120326:[[121],256],120327:[[122],256],120328:[[65],256],120329:[[66],256],120330:[[67],256],120331:[[68],256],120332:[[69],256],120333:[[70],256],120334:[[71],256],120335:[[72],256],120336:[[73],256],120337:[[74],256],120338:[[75],256],120339:[[76],256],120340:[[77],256],120341:[[78],256],120342:[[79],256],120343:[[80],256],120344:[[81],256],120345:[[82],256],120346:[[83],256],120347:[[84],256],120348:[[85],256],120349:[[86],256],120350:[[87],256],120351:[[88],256],120352:[[89],256],120353:[[90],256],120354:[[97],256],120355:[[98],256],120356:[[99],256],120357:[[100],256],120358:[[101],256],120359:[[102],256],120360:[[103],256],120361:[[104],256],120362:[[105],256],120363:[[106],256],120364:[[107],256],120365:[[108],256],120366:[[109],256],120367:[[110],256],120368:[[111],256],120369:[[112],256],120370:[[113],256],120371:[[114],256],120372:[[115],256],120373:[[116],256],120374:[[117],256],120375:[[118],256],120376:[[119],256],120377:[[120],256],120378:[[121],256],120379:[[122],256],120380:[[65],256],120381:[[66],256],120382:[[67],256],120383:[[68],256],120384:[[69],256],120385:[[70],256],120386:[[71],256],120387:[[72],256],120388:[[73],256],120389:[[74],256],120390:[[75],256],120391:[[76],256],120392:[[77],256],120393:[[78],256],120394:[[79],256],120395:[[80],256],120396:[[81],256],120397:[[82],256],120398:[[83],256],120399:[[84],256],120400:[[85],256],120401:[[86],256],120402:[[87],256],120403:[[88],256],120404:[[89],256],120405:[[90],256],120406:[[97],256],120407:[[98],256],120408:[[99],256],120409:[[100],256],120410:[[101],256],120411:[[102],256],120412:[[103],256],120413:[[104],256],120414:[[105],256],120415:[[106],256],120416:[[107],256],120417:[[108],256],120418:[[109],256],120419:[[110],256],120420:[[111],256],120421:[[112],256],120422:[[113],256],120423:[[114],256],120424:[[115],256],120425:[[116],256],120426:[[117],256],120427:[[118],256],120428:[[119],256],120429:[[120],256],120430:[[121],256],120431:[[122],256],120432:[[65],256],120433:[[66],256],120434:[[67],256],120435:[[68],256],120436:[[69],256],120437:[[70],256],120438:[[71],256],120439:[[72],256],120440:[[73],256],120441:[[74],256],120442:[[75],256],120443:[[76],256],120444:[[77],256],120445:[[78],256],120446:[[79],256],120447:[[80],256],120448:[[81],256],120449:[[82],256],120450:[[83],256],120451:[[84],256],120452:[[85],256],120453:[[86],256],120454:[[87],256],120455:[[88],256],120456:[[89],256],120457:[[90],256],120458:[[97],256],120459:[[98],256],120460:[[99],256],120461:[[100],256],120462:[[101],256],120463:[[102],256],120464:[[103],256],120465:[[104],256],120466:[[105],256],120467:[[106],256],120468:[[107],256],120469:[[108],256],120470:[[109],256],120471:[[110],256],120472:[[111],256],120473:[[112],256],120474:[[113],256],120475:[[114],256],120476:[[115],256],120477:[[116],256],120478:[[117],256],120479:[[118],256],120480:[[119],256],120481:[[120],256],120482:[[121],256],120483:[[122],256],120484:[[305],256],120485:[[567],256],120488:[[913],256],120489:[[914],256],120490:[[915],256],120491:[[916],256],120492:[[917],256],120493:[[918],256],120494:[[919],256],120495:[[920],256],120496:[[921],256],120497:[[922],256],120498:[[923],256],120499:[[924],256],120500:[[925],256],120501:[[926],256],120502:[[927],256],120503:[[928],256],120504:[[929],256],120505:[[1012],256],120506:[[931],256],120507:[[932],256],120508:[[933],256],120509:[[934],256],120510:[[935],256],120511:[[936],256],120512:[[937],256],120513:[[8711],256],120514:[[945],256],120515:[[946],256],120516:[[947],256],120517:[[948],256],120518:[[949],256],120519:[[950],256],120520:[[951],256],120521:[[952],256],120522:[[953],256],120523:[[954],256],120524:[[955],256],120525:[[956],256],120526:[[957],256],120527:[[958],256],120528:[[959],256],120529:[[960],256],120530:[[961],256],120531:[[962],256],120532:[[963],256],120533:[[964],256],120534:[[965],256],120535:[[966],256],120536:[[967],256],120537:[[968],256],120538:[[969],256],120539:[[8706],256],120540:[[1013],256],120541:[[977],256],120542:[[1008],256],120543:[[981],256],120544:[[1009],256],120545:[[982],256],120546:[[913],256],120547:[[914],256],120548:[[915],256],120549:[[916],256],120550:[[917],256],120551:[[918],256],120552:[[919],256],120553:[[920],256],120554:[[921],256],120555:[[922],256],120556:[[923],256],120557:[[924],256],120558:[[925],256],120559:[[926],256],120560:[[927],256],120561:[[928],256],120562:[[929],256],120563:[[1012],256],120564:[[931],256],120565:[[932],256],120566:[[933],256],120567:[[934],256],120568:[[935],256],120569:[[936],256],120570:[[937],256],120571:[[8711],256],120572:[[945],256],120573:[[946],256],120574:[[947],256],120575:[[948],256]},
1389055040:{120576:[[949],256],120577:[[950],256],120578:[[951],256],120579:[[952],256],120580:[[953],256],120581:[[954],256],120582:[[955],256],120583:[[956],256],120584:[[957],256],120585:[[958],256],120586:[[959],256],120587:[[960],256],120588:[[961],256],120589:[[962],256],120590:[[963],256],120591:[[964],256],120592:[[965],256],120593:[[966],256],120594:[[967],256],120595:[[968],256],120596:[[969],256],120597:[[8706],256],120598:[[1013],256],120599:[[977],256],120600:[[1008],256],120601:[[981],256],120602:[[1009],256],120603:[[982],256],120604:[[913],256],120605:[[914],256],120606:[[915],256],120607:[[916],256],120608:[[917],256],120609:[[918],256],120610:[[919],256],120611:[[920],256],120612:[[921],256],120613:[[922],256],120614:[[923],256],120615:[[924],256],120616:[[925],256],120617:[[926],256],120618:[[927],256],120619:[[928],256],120620:[[929],256],120621:[[1012],256],120622:[[931],256],120623:[[932],256],120624:[[933],256],120625:[[934],256],120626:[[935],256],120627:[[936],256],120628:[[937],256],120629:[[8711],256],120630:[[945],256],120631:[[946],256],120632:[[947],256],120633:[[948],256],120634:[[949],256],120635:[[950],256],120636:[[951],256],120637:[[952],256],120638:[[953],256],120639:[[954],256],120640:[[955],256],120641:[[956],256],120642:[[957],256],120643:[[958],256],120644:[[959],256],120645:[[960],256],120646:[[961],256],120647:[[962],256],120648:[[963],256],120649:[[964],256],120650:[[965],256],120651:[[966],256],120652:[[967],256],120653:[[968],256],120654:[[969],256],120655:[[8706],256],120656:[[1013],256],120657:[[977],256],120658:[[1008],256],120659:[[981],256],120660:[[1009],256],120661:[[982],256],120662:[[913],256],120663:[[914],256],120664:[[915],256],120665:[[916],256],120666:[[917],256],120667:[[918],256],120668:[[919],256],120669:[[920],256],120670:[[921],256],120671:[[922],256],120672:[[923],256],120673:[[924],256],120674:[[925],256],120675:[[926],256],120676:[[927],256],120677:[[928],256],120678:[[929],256],120679:[[1012],256],120680:[[931],256],120681:[[932],256],120682:[[933],256],120683:[[934],256],120684:[[935],256],120685:[[936],256],120686:[[937],256],120687:[[8711],256],120688:[[945],256],120689:[[946],256],120690:[[947],256],120691:[[948],256],120692:[[949],256],120693:[[950],256],120694:[[951],256],120695:[[952],256],120696:[[953],256],120697:[[954],256],120698:[[955],256],120699:[[956],256],120700:[[957],256],120701:[[958],256],120702:[[959],256],120703:[[960],256],120704:[[961],256],120705:[[962],256],120706:[[963],256],120707:[[964],256],120708:[[965],256],120709:[[966],256],120710:[[967],256],120711:[[968],256],120712:[[969],256],120713:[[8706],256],120714:[[1013],256],120715:[[977],256],120716:[[1008],256],120717:[[981],256],120718:[[1009],256],120719:[[982],256],120720:[[913],256],120721:[[914],256],120722:[[915],256],120723:[[916],256],120724:[[917],256],120725:[[918],256],120726:[[919],256],120727:[[920],256],120728:[[921],256],120729:[[922],256],120730:[[923],256],120731:[[924],256],120732:[[925],256],120733:[[926],256],120734:[[927],256],120735:[[928],256],120736:[[929],256],120737:[[1012],256],120738:[[931],256],120739:[[932],256],120740:[[933],256],120741:[[934],256],120742:[[935],256],120743:[[936],256],120744:[[937],256],120745:[[8711],256],120746:[[945],256],120747:[[946],256],120748:[[947],256],120749:[[948],256],120750:[[949],256],120751:[[950],256],120752:[[951],256],120753:[[952],256],120754:[[953],256],120755:[[954],256],120756:[[955],256],120757:[[956],256],120758:[[957],256],120759:[[958],256],120760:[[959],256],120761:[[960],256],120762:[[961],256],120763:[[962],256],120764:[[963],256],120765:[[964],256],120766:[[965],256],120767:[[966],256],120768:[[967],256],120769:[[968],256],120770:[[969],256],120771:[[8706],256],120772:[[1013],256],120773:[[977],256],120774:[[1008],256],120775:[[981],256],120776:[[1009],256],120777:[[982],256],120778:[[988],256],120779:[[989],256],120782:[[48],256],120783:[[49],256],120784:[[50],256],120785:[[51],256],120786:[[52],256],120787:[[53],256],120788:[[54],256],120789:[[55],256],120790:[[56],256],120791:[[57],256],120792:[[48],256],120793:[[49],256],120794:[[50],256],120795:[[51],256],120796:[[52],256],120797:[[53],256],120798:[[54],256],120799:[[55],256],120800:[[56],256],120801:[[57],256],120802:[[48],256],120803:[[49],256],120804:[[50],256],120805:[[51],256],120806:[[52],256],120807:[[53],256],120808:[[54],256],120809:[[55],256],120810:[[56],256],120811:[[57],256],120812:[[48],256],120813:[[49],256],120814:[[50],256],120815:[[51],256],120816:[[52],256],120817:[[53],256],120818:[[54],256],120819:[[55],256],120820:[[56],256],120821:[[57],256],120822:[[48],256],120823:[[49],256],120824:[[50],256],120825:[[51],256],120826:[[52],256],120827:[[53],256],120828:[[54],256],120829:[[55],256],120830:[[56],256],120831:[[57],256]},
1389159392:{125136:[,220],125137:[,220],125138:[,220],125139:[,220],125140:[,220],125141:[,220],125142:[,220]},
1389260928:{126464:[[1575],256],126465:[[1576],256],126466:[[1580],256],126467:[[1583],256],126469:[[1608],256],126470:[[1586],256],126471:[[1581],256],126472:[[1591],256],126473:[[1610],256],126474:[[1603],256],126475:[[1604],256],126476:[[1605],256],126477:[[1606],256],126478:[[1587],256],126479:[[1593],256],126480:[[1601],256],126481:[[1589],256],126482:[[1602],256],126483:[[1585],256],126484:[[1588],256],126485:[[1578],256],126486:[[1579],256],126487:[[1582],256],126488:[[1584],256],126489:[[1590],256],126490:[[1592],256],126491:[[1594],256],126492:[[1646],256],126493:[[1722],256],126494:[[1697],256],126495:[[1647],256],126497:[[1576],256],126498:[[1580],256],126500:[[1607],256],126503:[[1581],256],126505:[[1610],256],126506:[[1603],256],126507:[[1604],256],126508:[[1605],256],126509:[[1606],256],126510:[[1587],256],126511:[[1593],256],126512:[[1601],256],126513:[[1589],256],126514:[[1602],256],126516:[[1588],256],126517:[[1578],256],126518:[[1579],256],126519:[[1582],256],126521:[[1590],256],126523:[[1594],256],126530:[[1580],256],126535:[[1581],256],126537:[[1610],256],126539:[[1604],256],126541:[[1606],256],126542:[[1587],256],126543:[[1593],256],126545:[[1589],256],126546:[[1602],256],126548:[[1588],256],126551:[[1582],256],126553:[[1590],256],126555:[[1594],256],126557:[[1722],256],126559:[[1647],256],126561:[[1576],256],126562:[[1580],256],126564:[[1607],256],126567:[[1581],256],126568:[[1591],256],126569:[[1610],256],126570:[[1603],256],126572:[[1605],256],126573:[[1606],256],126574:[[1587],256],126575:[[1593],256],126576:[[1601],256],126577:[[1589],256],126578:[[1602],256],126580:[[1588],256],126581:[[1578],256],126582:[[1579],256],126583:[[1582],256],126585:[[1590],256],126586:[[1592],256],126587:[[1594],256],126588:[[1646],256],126590:[[1697],256],126592:[[1575],256],126593:[[1576],256],126594:[[1580],256],126595:[[1583],256],126596:[[1607],256],126597:[[1608],256],126598:[[1586],256],126599:[[1581],256],126600:[[1591],256],126601:[[1610],256],126603:[[1604],256],126604:[[1605],256],126605:[[1606],256],126606:[[1587],256],126607:[[1593],256],126608:[[1601],256],126609:[[1589],256],126610:[[1602],256],126611:[[1585],256],126612:[[1588],256],126613:[[1578],256],126614:[[1579],256],126615:[[1582],256],126616:[[1584],256],126617:[[1590],256],126618:[[1592],256],126619:[[1594],256],126625:[[1576],256],126626:[[1580],256],126627:[[1583],256],126629:[[1608],256],126630:[[1586],256],126631:[[1581],256],126632:[[1591],256],126633:[[1610],256],126635:[[1604],256],126636:[[1605],256],126637:[[1606],256],126638:[[1587],256],126639:[[1593],256],126640:[[1601],256],126641:[[1589],256],126642:[[1602],256],126643:[[1585],256],126644:[[1588],256],126645:[[1578],256],126646:[[1579],256],126647:[[1582],256],126648:[[1584],256],126649:[[1590],256],126650:[[1592],256],126651:[[1594],256]},
1389361696:{127232:[[48,46],256],127233:[[48,44],256],127234:[[49,44],256],127235:[[50,44],256],127236:[[51,44],256],127237:[[52,44],256],127238:[[53,44],256],127239:[[54,44],256],127240:[[55,44],256],127241:[[56,44],256],127242:[[57,44],256],127248:[[40,65,41],256],127249:[[40,66,41],256],127250:[[40,67,41],256],127251:[[40,68,41],256],127252:[[40,69,41],256],127253:[[40,70,41],256],127254:[[40,71,41],256],127255:[[40,72,41],256],127256:[[40,73,41],256],127257:[[40,74,41],256],127258:[[40,75,41],256],127259:[[40,76,41],256],127260:[[40,77,41],256],127261:[[40,78,41],256],127262:[[40,79,41],256],127263:[[40,80,41],256],127264:[[40,81,41],256],127265:[[40,82,41],256],127266:[[40,83,41],256],127267:[[40,84,41],256],127268:[[40,85,41],256],127269:[[40,86,41],256],127270:[[40,87,41],256],127271:[[40,88,41],256],127272:[[40,89,41],256],127273:[[40,90,41],256],127274:[[12308,83,12309],256],127275:[[67],256],127276:[[82],256],127277:[[67,68],256],127278:[[87,90],256],127280:[[65],256],127281:[[66],256],127282:[[67],256],127283:[[68],256],127284:[[69],256],127285:[[70],256],127286:[[71],256],127287:[[72],256],127288:[[73],256],127289:[[74],256],127290:[[75],256],127291:[[76],256],127292:[[77],256],127293:[[78],256],127294:[[79],256],127295:[[80],256],127296:[[81],256],127297:[[82],256],127298:[[83],256],127299:[[84],256],127300:[[85],256],127301:[[86],256],127302:[[87],256],127303:[[88],256],127304:[[89],256],127305:[[90],256],127306:[[72,86],256],127307:[[77,86],256],127308:[[83,68],256],127309:[[83,83],256],127310:[[80,80,86],256],127311:[[87,67],256],127338:[[77,67],256],127339:[[77,68],256],127376:[[68,74],256]},
1389461952:{127488:[[12411,12363],256],127489:[[12467,12467],256],127490:[[12469],256],127504:[[25163],256],127505:[[23383],256],127506:[[21452],256],127507:[[12487],256],127508:[[20108],256],127509:[[22810],256],127510:[[35299],256],127511:[[22825],256],127512:[[20132],256],127513:[[26144],256],127514:[[28961],256],127515:[[26009],256],127516:[[21069],256],127517:[[24460],256],127518:[[20877],256],127519:[[26032],256],127520:[[21021],256],127521:[[32066],256],127522:[[29983],256],127523:[[36009],256],127524:[[22768],256],127525:[[21561],256],127526:[[28436],256],127527:[[25237],256],127528:[[25429],256],127529:[[19968],256],127530:[[19977],256],127531:[[36938],256],127532:[[24038],256],127533:[[20013],256],127534:[[21491],256],127535:[[25351],256],127536:[[36208],256],127537:[[25171],256],127538:[[31105],256],127539:[[31354],256],127540:[[21512],256],127541:[[28288],256],127542:[[26377],256],127543:[[26376],256],127544:[[30003],256],127545:[[21106],256],127546:[[21942],256],127552:[[12308,26412,12309],256],127553:[[12308,19977,12309],256],127554:[[12308,20108,12309],256],127555:[[12308,23433,12309],256],127556:[[12308,28857,12309],256],127557:[[12308,25171,12309],256],127558:[[12308,30423,12309],256],127559:[[12308,21213,12309],256],127560:[[12308,25943,12309],256],127568:[[24471],256],127569:[[21487],256]},
1389563488:{194560:[[20029]],194561:[[20024]],194562:[[20033]],194563:[[131362]],194564:[[20320]],194565:[[20398]],194566:[[20411]],194567:[[20482]],194568:[[20602]],194569:[[20633]],194570:[[20711]],194571:[[20687]],194572:[[13470]],194573:[[132666]],194574:[[20813]],194575:[[20820]],194576:[[20836]],194577:[[20855]],194578:[[132380]],194579:[[13497]],194580:[[20839]],194581:[[20877]],194582:[[132427]],194583:[[20887]],194584:[[20900]],194585:[[20172]],194586:[[20908]],194587:[[20917]],194588:[[168415]],194589:[[20981]],194590:[[20995]],194591:[[13535]],194592:[[21051]],194593:[[21062]],194594:[[21106]],194595:[[21111]],194596:[[13589]],194597:[[21191]],194598:[[21193]],194599:[[21220]],194600:[[21242]],194601:[[21253]],194602:[[21254]],194603:[[21271]],194604:[[21321]],194605:[[21329]],194606:[[21338]],194607:[[21363]],194608:[[21373]],194609:[[21375]],194610:[[21375]],194611:[[21375]],194612:[[133676]],194613:[[28784]],194614:[[21450]],194615:[[21471]],194616:[[133987]],194617:[[21483]],194618:[[21489]],194619:[[21510]],194620:[[21662]],194621:[[21560]],194622:[[21576]],194623:[[21608]],194624:[[21666]],194625:[[21750]],194626:[[21776]],194627:[[21843]],194628:[[21859]],194629:[[21892]],194630:[[21892]],194631:[[21913]],194632:[[21931]],194633:[[21939]],194634:[[21954]],194635:[[22294]],194636:[[22022]],194637:[[22295]],194638:[[22097]],194639:[[22132]],194640:[[20999]],194641:[[22766]],194642:[[22478]],194643:[[22516]],194644:[[22541]],194645:[[22411]],194646:[[22578]],194647:[[22577]],194648:[[22700]],194649:[[136420]],194650:[[22770]],194651:[[22775]],194652:[[22790]],194653:[[22810]],194654:[[22818]],194655:[[22882]],194656:[[136872]],194657:[[136938]],194658:[[23020]],194659:[[23067]],194660:[[23079]],194661:[[23000]],194662:[[23142]],194663:[[14062]],194664:[[14076]],194665:[[23304]],194666:[[23358]],194667:[[23358]],194668:[[137672]],194669:[[23491]],194670:[[23512]],194671:[[23527]],194672:[[23539]],194673:[[138008]],194674:[[23551]],194675:[[23558]],194676:[[24403]],194677:[[23586]],194678:[[14209]],194679:[[23648]],194680:[[23662]],194681:[[23744]],194682:[[23693]],194683:[[138724]],194684:[[23875]],194685:[[138726]],194686:[[23918]],194687:[[23915]],194688:[[23932]],194689:[[24033]],194690:[[24034]],194691:[[14383]],194692:[[24061]],194693:[[24104]],194694:[[24125]],194695:[[24169]],194696:[[14434]],194697:[[139651]],194698:[[14460]],194699:[[24240]],194700:[[24243]],194701:[[24246]],194702:[[24266]],194703:[[172946]],194704:[[24318]],194705:[[140081]],194706:[[140081]],194707:[[33281]],194708:[[24354]],194709:[[24354]],194710:[[14535]],194711:[[144056]],194712:[[156122]],194713:[[24418]],194714:[[24427]],194715:[[14563]],194716:[[24474]],194717:[[24525]],194718:[[24535]],194719:[[24569]],194720:[[24705]],194721:[[14650]],194722:[[14620]],194723:[[24724]],194724:[[141012]],194725:[[24775]],194726:[[24904]],194727:[[24908]],194728:[[24910]],194729:[[24908]],194730:[[24954]],194731:[[24974]],194732:[[25010]],194733:[[24996]],194734:[[25007]],194735:[[25054]],194736:[[25074]],194737:[[25078]],194738:[[25104]],194739:[[25115]],194740:[[25181]],194741:[[25265]],194742:[[25300]],194743:[[25424]],194744:[[142092]],194745:[[25405]],194746:[[25340]],194747:[[25448]],194748:[[25475]],194749:[[25572]],194750:[[142321]],194751:[[25634]],194752:[[25541]],194753:[[25513]],194754:[[14894]],194755:[[25705]],194756:[[25726]],194757:[[25757]],194758:[[25719]],194759:[[14956]],194760:[[25935]],194761:[[25964]],194762:[[143370]],194763:[[26083]],194764:[[26360]],194765:[[26185]],194766:[[15129]],194767:[[26257]],194768:[[15112]],194769:[[15076]],194770:[[20882]],194771:[[20885]],194772:[[26368]],194773:[[26268]],194774:[[32941]],194775:[[17369]],194776:[[26391]],194777:[[26395]],194778:[[26401]],194779:[[26462]],194780:[[26451]],194781:[[144323]],194782:[[15177]],194783:[[26618]],194784:[[26501]],194785:[[26706]],194786:[[26757]],194787:[[144493]],194788:[[26766]],194789:[[26655]],194790:[[26900]],194791:[[15261]],194792:[[26946]],194793:[[27043]],194794:[[27114]],194795:[[27304]],194796:[[145059]],194797:[[27355]],194798:[[15384]],194799:[[27425]],194800:[[145575]],194801:[[27476]],194802:[[15438]],194803:[[27506]],194804:[[27551]],194805:[[27578]],194806:[[27579]],194807:[[146061]],194808:[[138507]],194809:[[146170]],194810:[[27726]],194811:[[146620]],194812:[[27839]],194813:[[27853]],194814:[[27751]],194815:[[27926]]},
1389663744:{63744:[[35912]],63745:[[26356]],63746:[[36554]],63747:[[36040]],63748:[[28369]],63749:[[20018]],63750:[[21477]],63751:[[40860]],63752:[[40860]],63753:[[22865]],63754:[[37329]],63755:[[21895]],63756:[[22856]],63757:[[25078]],63758:[[30313]],63759:[[32645]],63760:[[34367]],63761:[[34746]],63762:[[35064]],63763:[[37007]],63764:[[27138]],63765:[[27931]],63766:[[28889]],63767:[[29662]],63768:[[33853]],63769:[[37226]],63770:[[39409]],63771:[[20098]],63772:[[21365]],63773:[[27396]],63774:[[29211]],63775:[[34349]],63776:[[40478]],63777:[[23888]],63778:[[28651]],63779:[[34253]],63780:[[35172]],63781:[[25289]],63782:[[33240]],63783:[[34847]],63784:[[24266]],63785:[[26391]],63786:[[28010]],63787:[[29436]],63788:[[37070]],63789:[[20358]],63790:[[20919]],63791:[[21214]],63792:[[25796]],63793:[[27347]],63794:[[29200]],63795:[[30439]],63796:[[32769]],63797:[[34310]],63798:[[34396]],63799:[[36335]],63800:[[38706]],63801:[[39791]],63802:[[40442]],63803:[[30860]],63804:[[31103]],63805:[[32160]],63806:[[33737]],63807:[[37636]],63808:[[40575]],63809:[[35542]],63810:[[22751]],63811:[[24324]],63812:[[31840]],63813:[[32894]],63814:[[29282]],63815:[[30922]],63816:[[36034]],63817:[[38647]],63818:[[22744]],63819:[[23650]],63820:[[27155]],63821:[[28122]],63822:[[28431]],63823:[[32047]],63824:[[32311]],63825:[[38475]],63826:[[21202]],63827:[[32907]],63828:[[20956]],63829:[[20940]],63830:[[31260]],63831:[[32190]],63832:[[33777]],63833:[[38517]],63834:[[35712]],63835:[[25295]],63836:[[27138]],63837:[[35582]],63838:[[20025]],63839:[[23527]],63840:[[24594]],63841:[[29575]],63842:[[30064]],63843:[[21271]],63844:[[30971]],63845:[[20415]],63846:[[24489]],63847:[[19981]],63848:[[27852]],63849:[[25976]],63850:[[32034]],63851:[[21443]],63852:[[22622]],63853:[[30465]],63854:[[33865]],63855:[[35498]],63856:[[27578]],63857:[[36784]],63858:[[27784]],63859:[[25342]],63860:[[33509]],63861:[[25504]],63862:[[30053]],63863:[[20142]],63864:[[20841]],63865:[[20937]],63866:[[26753]],63867:[[31975]],63868:[[33391]],63869:[[35538]],63870:[[37327]],63871:[[21237]],63872:[[21570]],63873:[[22899]],63874:[[24300]],63875:[[26053]],63876:[[28670]],63877:[[31018]],63878:[[38317]],63879:[[39530]],63880:[[40599]],63881:[[40654]],63882:[[21147]],63883:[[26310]],63884:[[27511]],63885:[[36706]],63886:[[24180]],63887:[[24976]],63888:[[25088]],63889:[[25754]],63890:[[28451]],63891:[[29001]],63892:[[29833]],63893:[[31178]],63894:[[32244]],63895:[[32879]],63896:[[36646]],63897:[[34030]],63898:[[36899]],63899:[[37706]],63900:[[21015]],63901:[[21155]],63902:[[21693]],63903:[[28872]],63904:[[35010]],63905:[[35498]],63906:[[24265]],63907:[[24565]],63908:[[25467]],63909:[[27566]],63910:[[31806]],63911:[[29557]],63912:[[20196]],63913:[[22265]],63914:[[23527]],63915:[[23994]],63916:[[24604]],63917:[[29618]],63918:[[29801]],63919:[[32666]],63920:[[32838]],63921:[[37428]],63922:[[38646]],63923:[[38728]],63924:[[38936]],63925:[[20363]],63926:[[31150]],63927:[[37300]],63928:[[38584]],63929:[[24801]],63930:[[20102]],63931:[[20698]],63932:[[23534]],63933:[[23615]],63934:[[26009]],63935:[[27138]],63936:[[29134]],63937:[[30274]],63938:[[34044]],63939:[[36988]],63940:[[40845]],63941:[[26248]],63942:[[38446]],63943:[[21129]],63944:[[26491]],63945:[[26611]],63946:[[27969]],63947:[[28316]],63948:[[29705]],63949:[[30041]],63950:[[30827]],63951:[[32016]],63952:[[39006]],63953:[[20845]],63954:[[25134]],63955:[[38520]],63956:[[20523]],63957:[[23833]],63958:[[28138]],63959:[[36650]],63960:[[24459]],63961:[[24900]],63962:[[26647]],63963:[[29575]],63964:[[38534]],63965:[[21033]],63966:[[21519]],63967:[[23653]],63968:[[26131]],63969:[[26446]],63970:[[26792]],63971:[[27877]],63972:[[29702]],63973:[[30178]],63974:[[32633]],63975:[[35023]],63976:[[35041]],63977:[[37324]],63978:[[38626]],63979:[[21311]],63980:[[28346]],63981:[[21533]],63982:[[29136]],63983:[[29848]],63984:[[34298]],63985:[[38563]],63986:[[40023]],63987:[[40607]],63988:[[26519]],63989:[[28107]],63990:[[33256]],63991:[[31435]],63992:[[31520]],63993:[[31890]],63994:[[29376]],63995:[[28825]],63996:[[35672]],63997:[[20160]],63998:[[33590]],63999:[[21050]],194816:[[27966]],194817:[[28023]],194818:[[27969]],194819:[[28009]],194820:[[28024]],194821:[[28037]],194822:[[146718]],194823:[[27956]],194824:[[28207]],194825:[[28270]],194826:[[15667]],194827:[[28363]],194828:[[28359]],194829:[[147153]],194830:[[28153]],194831:[[28526]],194832:[[147294]],194833:[[147342]],194834:[[28614]],194835:[[28729]],194836:[[28702]],194837:[[28699]],194838:[[15766]],194839:[[28746]],194840:[[28797]],194841:[[28791]],194842:[[28845]],194843:[[132389]],194844:[[28997]],194845:[[148067]],194846:[[29084]],194847:[[148395]],194848:[[29224]],194849:[[29237]],194850:[[29264]],194851:[[149000]],194852:[[29312]],194853:[[29333]],194854:[[149301]],194855:[[149524]],194856:[[29562]],194857:[[29579]],194858:[[16044]],194859:[[29605]],194860:[[16056]],194861:[[16056]],194862:[[29767]],194863:[[29788]],194864:[[29809]],194865:[[29829]],194866:[[29898]],194867:[[16155]],194868:[[29988]],194869:[[150582]],194870:[[30014]],194871:[[150674]],194872:[[30064]],194873:[[139679]],194874:[[30224]],194875:[[151457]],194876:[[151480]],194877:[[151620]],194878:[[16380]],194879:[[16392]],194880:[[30452]],194881:[[151795]],194882:[[151794]],194883:[[151833]],194884:[[151859]],194885:[[30494]],194886:[[30495]],194887:[[30495]],194888:[[30538]],194889:[[16441]],194890:[[30603]],194891:[[16454]],194892:[[16534]],194893:[[152605]],194894:[[30798]],194895:[[30860]],194896:[[30924]],194897:[[16611]],194898:[[153126]],194899:[[31062]],194900:[[153242]],194901:[[153285]],194902:[[31119]],194903:[[31211]],194904:[[16687]],194905:[[31296]],194906:[[31306]],194907:[[31311]],194908:[[153980]],194909:[[154279]],194910:[[154279]],194911:[[31470]],194912:[[16898]],194913:[[154539]],194914:[[31686]],194915:[[31689]],194916:[[16935]],194917:[[154752]],194918:[[31954]],194919:[[17056]],194920:[[31976]],194921:[[31971]],194922:[[32000]],194923:[[155526]],194924:[[32099]],194925:[[17153]],194926:[[32199]],194927:[[32258]],194928:[[32325]],194929:[[17204]],194930:[[156200]],194931:[[156231]],194932:[[17241]],194933:[[156377]],194934:[[32634]],194935:[[156478]],194936:[[32661]],194937:[[32762]],194938:[[32773]],194939:[[156890]],194940:[[156963]],194941:[[32864]],194942:[[157096]],194943:[[32880]],194944:[[144223]],194945:[[17365]],194946:[[32946]],194947:[[33027]],194948:[[17419]],194949:[[33086]],194950:[[23221]],194951:[[157607]],194952:[[157621]],194953:[[144275]],194954:[[144284]],194955:[[33281]],194956:[[33284]],194957:[[36766]],194958:[[17515]],194959:[[33425]],194960:[[33419]],194961:[[33437]],194962:[[21171]],194963:[[33457]],194964:[[33459]],194965:[[33469]],194966:[[33510]],194967:[[158524]],194968:[[33509]],194969:[[33565]],194970:[[33635]],194971:[[33709]],194972:[[33571]],194973:[[33725]],194974:[[33767]],194975:[[33879]],194976:[[33619]],194977:[[33738]],194978:[[33740]],194979:[[33756]],194980:[[158774]],194981:[[159083]],194982:[[158933]],194983:[[17707]],194984:[[34033]],194985:[[34035]],194986:[[34070]],194987:[[160714]],194988:[[34148]],194989:[[159532]],194990:[[17757]],194991:[[17761]],194992:[[159665]],194993:[[159954]],194994:[[17771]],194995:[[34384]],194996:[[34396]],194997:[[34407]],194998:[[34409]],194999:[[34473]],195000:[[34440]],195001:[[34574]],195002:[[34530]],195003:[[34681]],195004:[[34600]],195005:[[34667]],195006:[[34694]],195007:[[17879]],195008:[[34785]],195009:[[34817]],195010:[[17913]],195011:[[34912]],195012:[[34915]],195013:[[161383]],195014:[[35031]],195015:[[35038]],195016:[[17973]],195017:[[35066]],195018:[[13499]],195019:[[161966]],195020:[[162150]],195021:[[18110]],195022:[[18119]],195023:[[35488]],195024:[[35565]],195025:[[35722]],195026:[[35925]],195027:[[162984]],195028:[[36011]],195029:[[36033]],195030:[[36123]],195031:[[36215]],195032:[[163631]],195033:[[133124]],195034:[[36299]],195035:[[36284]],195036:[[36336]],195037:[[133342]],195038:[[36564]],195039:[[36664]],195040:[[165330]],195041:[[165357]],195042:[[37012]],195043:[[37105]],195044:[[37137]],195045:[[165678]],195046:[[37147]],195047:[[37432]],195048:[[37591]],195049:[[37592]],195050:[[37500]],195051:[[37881]],195052:[[37909]],195053:[[166906]],195054:[[38283]],195055:[[18837]],195056:[[38327]],195057:[[167287]],195058:[[18918]],195059:[[38595]],195060:[[23986]],195061:[[38691]],195062:[[168261]],195063:[[168474]],195064:[[19054]],195065:[[19062]],195066:[[38880]],195067:[[168970]],195068:[[19122]],195069:[[169110]],195070:[[38923]],195071:[[38923]]},
1389764000:{64000:[[20999]],64001:[[24230]],64002:[[25299]],64003:[[31958]],64004:[[23429]],64005:[[27934]],64006:[[26292]],64007:[[36667]],64008:[[34892]],64009:[[38477]],64010:[[35211]],64011:[[24275]],64012:[[20800]],64013:[[21952]],64016:[[22618]],64018:[[26228]],64021:[[20958]],64022:[[29482]],64023:[[30410]],64024:[[31036]],64025:[[31070]],64026:[[31077]],64027:[[31119]],64028:[[38742]],64029:[[31934]],64030:[[32701]],64032:[[34322]],64034:[[35576]],64037:[[36920]],64038:[[37117]],64042:[[39151]],64043:[[39164]],64044:[[39208]],64045:[[40372]],64046:[[37086]],64047:[[38583]],64048:[[20398]],64049:[[20711]],64050:[[20813]],64051:[[21193]],64052:[[21220]],64053:[[21329]],64054:[[21917]],64055:[[22022]],64056:[[22120]],64057:[[22592]],64058:[[22696]],64059:[[23652]],64060:[[23662]],64061:[[24724]],64062:[[24936]],64063:[[24974]],64064:[[25074]],64065:[[25935]],64066:[[26082]],64067:[[26257]],64068:[[26757]],64069:[[28023]],64070:[[28186]],64071:[[28450]],64072:[[29038]],64073:[[29227]],64074:[[29730]],64075:[[30865]],64076:[[31038]],64077:[[31049]],64078:[[31048]],64079:[[31056]],64080:[[31062]],64081:[[31069]],64082:[[31117]],64083:[[31118]],64084:[[31296]],64085:[[31361]],64086:[[31680]],64087:[[32244]],64088:[[32265]],64089:[[32321]],64090:[[32626]],64091:[[32773]],64092:[[33261]],64093:[[33401]],64094:[[33401]],64095:[[33879]],64096:[[35088]],64097:[[35222]],64098:[[35585]],64099:[[35641]],64100:[[36051]],64101:[[36104]],64102:[[36790]],64103:[[36920]],64104:[[38627]],64105:[[38911]],64106:[[38971]],64107:[[24693]],64108:[[148206]],64109:[[33304]],64112:[[20006]],64113:[[20917]],64114:[[20840]],64115:[[20352]],64116:[[20805]],64117:[[20864]],64118:[[21191]],64119:[[21242]],64120:[[21917]],64121:[[21845]],64122:[[21913]],64123:[[21986]],64124:[[22618]],64125:[[22707]],64126:[[22852]],64127:[[22868]],64128:[[23138]],64129:[[23336]],64130:[[24274]],64131:[[24281]],64132:[[24425]],64133:[[24493]],64134:[[24792]],64135:[[24910]],64136:[[24840]],64137:[[24974]],64138:[[24928]],64139:[[25074]],64140:[[25140]],64141:[[25540]],64142:[[25628]],64143:[[25682]],64144:[[25942]],64145:[[26228]],64146:[[26391]],64147:[[26395]],64148:[[26454]],64149:[[27513]],64150:[[27578]],64151:[[27969]],64152:[[28379]],64153:[[28363]],64154:[[28450]],64155:[[28702]],64156:[[29038]],64157:[[30631]],64158:[[29237]],64159:[[29359]],64160:[[29482]],64161:[[29809]],64162:[[29958]],64163:[[30011]],64164:[[30237]],64165:[[30239]],64166:[[30410]],64167:[[30427]],64168:[[30452]],64169:[[30538]],64170:[[30528]],64171:[[30924]],64172:[[31409]],64173:[[31680]],64174:[[31867]],64175:[[32091]],64176:[[32244]],64177:[[32574]],64178:[[32773]],64179:[[33618]],64180:[[33775]],64181:[[34681]],64182:[[35137]],64183:[[35206]],64184:[[35222]],64185:[[35519]],64186:[[35576]],64187:[[35531]],64188:[[35585]],64189:[[35582]],64190:[[35565]],64191:[[35641]],64192:[[35722]],64193:[[36104]],64194:[[36664]],64195:[[36978]],64196:[[37273]],64197:[[37494]],64198:[[38524]],64199:[[38627]],64200:[[38742]],64201:[[38875]],64202:[[38911]],64203:[[38923]],64204:[[38971]],64205:[[39698]],64206:[[40860]],64207:[[141386]],64208:[[141380]],64209:[[144341]],64210:[[15261]],64211:[[16408]],64212:[[16441]],64213:[[152137]],64214:[[154832]],64215:[[163539]],64216:[[40771]],64217:[[40846]],195072:[[38953]],195073:[[169398]],195074:[[39138]],195075:[[19251]],195076:[[39209]],195077:[[39335]],195078:[[39362]],195079:[[39422]],195080:[[19406]],195081:[[170800]],195082:[[39698]],195083:[[40000]],195084:[[40189]],195085:[[19662]],195086:[[19693]],195087:[[40295]],195088:[[172238]],195089:[[19704]],195090:[[172293]],195091:[[172558]],195092:[[172689]],195093:[[40635]],195094:[[19798]],195095:[[40697]],195096:[[40702]],195097:[[40709]],195098:[[40719]],195099:[[40726]],195100:[[40763]],195101:[[173568]]},
1389864256:{64256:[[102,102],256],64257:[[102,105],256],64258:[[102,108],256],64259:[[102,102,105],256],64260:[[102,102,108],256],64261:[[383,116],256],64262:[[115,116],256],64275:[[1396,1398],256],64276:[[1396,1381],256],64277:[[1396,1387],256],64278:[[1406,1398],256],64279:[[1396,1389],256],64285:[[1497,1460],512],64286:[,26],64287:[[1522,1463],512],64288:[[1506],256],64289:[[1488],256],64290:[[1491],256],64291:[[1492],256],64292:[[1499],256],64293:[[1500],256],64294:[[1501],256],64295:[[1512],256],64296:[[1514],256],64297:[[43],256],64298:[[1513,1473],512],64299:[[1513,1474],512],64300:[[64329,1473],512],64301:[[64329,1474],512],64302:[[1488,1463],512],64303:[[1488,1464],512],64304:[[1488,1468],512],64305:[[1489,1468],512],64306:[[1490,1468],512],64307:[[1491,1468],512],64308:[[1492,1468],512],64309:[[1493,1468],512],64310:[[1494,1468],512],64312:[[1496,1468],512],64313:[[1497,1468],512],64314:[[1498,1468],512],64315:[[1499,1468],512],64316:[[1500,1468],512],64318:[[1502,1468],512],64320:[[1504,1468],512],64321:[[1505,1468],512],64323:[[1507,1468],512],64324:[[1508,1468],512],64326:[[1510,1468],512],64327:[[1511,1468],512],64328:[[1512,1468],512],64329:[[1513,1468],512],64330:[[1514,1468],512],64331:[[1493,1465],512],64332:[[1489,1471],512],64333:[[1499,1471],512],64334:[[1508,1471],512],64335:[[1488,1500],256],64336:[[1649],256],64337:[[1649],256],64338:[[1659],256],64339:[[1659],256],64340:[[1659],256],64341:[[1659],256],64342:[[1662],256],64343:[[1662],256],64344:[[1662],256],64345:[[1662],256],64346:[[1664],256],64347:[[1664],256],64348:[[1664],256],64349:[[1664],256],64350:[[1658],256],64351:[[1658],256],64352:[[1658],256],64353:[[1658],256],64354:[[1663],256],64355:[[1663],256],64356:[[1663],256],64357:[[1663],256],64358:[[1657],256],64359:[[1657],256],64360:[[1657],256],64361:[[1657],256],64362:[[1700],256],64363:[[1700],256],64364:[[1700],256],64365:[[1700],256],64366:[[1702],256],64367:[[1702],256],64368:[[1702],256],64369:[[1702],256],64370:[[1668],256],64371:[[1668],256],64372:[[1668],256],64373:[[1668],256],64374:[[1667],256],64375:[[1667],256],64376:[[1667],256],64377:[[1667],256],64378:[[1670],256],64379:[[1670],256],64380:[[1670],256],64381:[[1670],256],64382:[[1671],256],64383:[[1671],256],64384:[[1671],256],64385:[[1671],256],64386:[[1677],256],64387:[[1677],256],64388:[[1676],256],64389:[[1676],256],64390:[[1678],256],64391:[[1678],256],64392:[[1672],256],64393:[[1672],256],64394:[[1688],256],64395:[[1688],256],64396:[[1681],256],64397:[[1681],256],64398:[[1705],256],64399:[[1705],256],64400:[[1705],256],64401:[[1705],256],64402:[[1711],256],64403:[[1711],256],64404:[[1711],256],64405:[[1711],256],64406:[[1715],256],64407:[[1715],256],64408:[[1715],256],64409:[[1715],256],64410:[[1713],256],64411:[[1713],256],64412:[[1713],256],64413:[[1713],256],64414:[[1722],256],64415:[[1722],256],64416:[[1723],256],64417:[[1723],256],64418:[[1723],256],64419:[[1723],256],64420:[[1728],256],64421:[[1728],256],64422:[[1729],256],64423:[[1729],256],64424:[[1729],256],64425:[[1729],256],64426:[[1726],256],64427:[[1726],256],64428:[[1726],256],64429:[[1726],256],64430:[[1746],256],64431:[[1746],256],64432:[[1747],256],64433:[[1747],256],64467:[[1709],256],64468:[[1709],256],64469:[[1709],256],64470:[[1709],256],64471:[[1735],256],64472:[[1735],256],64473:[[1734],256],64474:[[1734],256],64475:[[1736],256],64476:[[1736],256],64477:[[1655],256],64478:[[1739],256],64479:[[1739],256],64480:[[1733],256],64481:[[1733],256],64482:[[1737],256],64483:[[1737],256],64484:[[1744],256],64485:[[1744],256],64486:[[1744],256],64487:[[1744],256],64488:[[1609],256],64489:[[1609],256],64490:[[1574,1575],256],64491:[[1574,1575],256],64492:[[1574,1749],256],64493:[[1574,1749],256],64494:[[1574,1608],256],64495:[[1574,1608],256],64496:[[1574,1735],256],64497:[[1574,1735],256],64498:[[1574,1734],256],64499:[[1574,1734],256],64500:[[1574,1736],256],64501:[[1574,1736],256],64502:[[1574,1744],256],64503:[[1574,1744],256],64504:[[1574,1744],256],64505:[[1574,1609],256],64506:[[1574,1609],256],64507:[[1574,1609],256],64508:[[1740],256],64509:[[1740],256],64510:[[1740],256],64511:[[1740],256]},
1389964512:{64512:[[1574,1580],256],64513:[[1574,1581],256],64514:[[1574,1605],256],64515:[[1574,1609],256],64516:[[1574,1610],256],64517:[[1576,1580],256],64518:[[1576,1581],256],64519:[[1576,1582],256],64520:[[1576,1605],256],64521:[[1576,1609],256],64522:[[1576,1610],256],64523:[[1578,1580],256],64524:[[1578,1581],256],64525:[[1578,1582],256],64526:[[1578,1605],256],64527:[[1578,1609],256],64528:[[1578,1610],256],64529:[[1579,1580],256],64530:[[1579,1605],256],64531:[[1579,1609],256],64532:[[1579,1610],256],64533:[[1580,1581],256],64534:[[1580,1605],256],64535:[[1581,1580],256],64536:[[1581,1605],256],64537:[[1582,1580],256],64538:[[1582,1581],256],64539:[[1582,1605],256],64540:[[1587,1580],256],64541:[[1587,1581],256],64542:[[1587,1582],256],64543:[[1587,1605],256],64544:[[1589,1581],256],64545:[[1589,1605],256],64546:[[1590,1580],256],64547:[[1590,1581],256],64548:[[1590,1582],256],64549:[[1590,1605],256],64550:[[1591,1581],256],64551:[[1591,1605],256],64552:[[1592,1605],256],64553:[[1593,1580],256],64554:[[1593,1605],256],64555:[[1594,1580],256],64556:[[1594,1605],256],64557:[[1601,1580],256],64558:[[1601,1581],256],64559:[[1601,1582],256],64560:[[1601,1605],256],64561:[[1601,1609],256],64562:[[1601,1610],256],64563:[[1602,1581],256],64564:[[1602,1605],256],64565:[[1602,1609],256],64566:[[1602,1610],256],64567:[[1603,1575],256],64568:[[1603,1580],256],64569:[[1603,1581],256],64570:[[1603,1582],256],64571:[[1603,1604],256],64572:[[1603,1605],256],64573:[[1603,1609],256],64574:[[1603,1610],256],64575:[[1604,1580],256],64576:[[1604,1581],256],64577:[[1604,1582],256],64578:[[1604,1605],256],64579:[[1604,1609],256],64580:[[1604,1610],256],64581:[[1605,1580],256],64582:[[1605,1581],256],64583:[[1605,1582],256],64584:[[1605,1605],256],64585:[[1605,1609],256],64586:[[1605,1610],256],64587:[[1606,1580],256],64588:[[1606,1581],256],64589:[[1606,1582],256],64590:[[1606,1605],256],64591:[[1606,1609],256],64592:[[1606,1610],256],64593:[[1607,1580],256],64594:[[1607,1605],256],64595:[[1607,1609],256],64596:[[1607,1610],256],64597:[[1610,1580],256],64598:[[1610,1581],256],64599:[[1610,1582],256],64600:[[1610,1605],256],64601:[[1610,1609],256],64602:[[1610,1610],256],64603:[[1584,1648],256],64604:[[1585,1648],256],64605:[[1609,1648],256],64606:[[32,1612,1617],256],64607:[[32,1613,1617],256],64608:[[32,1614,1617],256],64609:[[32,1615,1617],256],64610:[[32,1616,1617],256],64611:[[32,1617,1648],256],64612:[[1574,1585],256],64613:[[1574,1586],256],64614:[[1574,1605],256],64615:[[1574,1606],256],64616:[[1574,1609],256],64617:[[1574,1610],256],64618:[[1576,1585],256],64619:[[1576,1586],256],64620:[[1576,1605],256],64621:[[1576,1606],256],64622:[[1576,1609],256],64623:[[1576,1610],256],64624:[[1578,1585],256],64625:[[1578,1586],256],64626:[[1578,1605],256],64627:[[1578,1606],256],64628:[[1578,1609],256],64629:[[1578,1610],256],64630:[[1579,1585],256],64631:[[1579,1586],256],64632:[[1579,1605],256],64633:[[1579,1606],256],64634:[[1579,1609],256],64635:[[1579,1610],256],64636:[[1601,1609],256],64637:[[1601,1610],256],64638:[[1602,1609],256],64639:[[1602,1610],256],64640:[[1603,1575],256],64641:[[1603,1604],256],64642:[[1603,1605],256],64643:[[1603,1609],256],64644:[[1603,1610],256],64645:[[1604,1605],256],64646:[[1604,1609],256],64647:[[1604,1610],256],64648:[[1605,1575],256],64649:[[1605,1605],256],64650:[[1606,1585],256],64651:[[1606,1586],256],64652:[[1606,1605],256],64653:[[1606,1606],256],64654:[[1606,1609],256],64655:[[1606,1610],256],64656:[[1609,1648],256],64657:[[1610,1585],256],64658:[[1610,1586],256],64659:[[1610,1605],256],64660:[[1610,1606],256],64661:[[1610,1609],256],64662:[[1610,1610],256],64663:[[1574,1580],256],64664:[[1574,1581],256],64665:[[1574,1582],256],64666:[[1574,1605],256],64667:[[1574,1607],256],64668:[[1576,1580],256],64669:[[1576,1581],256],64670:[[1576,1582],256],64671:[[1576,1605],256],64672:[[1576,1607],256],64673:[[1578,1580],256],64674:[[1578,1581],256],64675:[[1578,1582],256],64676:[[1578,1605],256],64677:[[1578,1607],256],64678:[[1579,1605],256],64679:[[1580,1581],256],64680:[[1580,1605],256],64681:[[1581,1580],256],64682:[[1581,1605],256],64683:[[1582,1580],256],64684:[[1582,1605],256],64685:[[1587,1580],256],64686:[[1587,1581],256],64687:[[1587,1582],256],64688:[[1587,1605],256],64689:[[1589,1581],256],64690:[[1589,1582],256],64691:[[1589,1605],256],64692:[[1590,1580],256],64693:[[1590,1581],256],64694:[[1590,1582],256],64695:[[1590,1605],256],64696:[[1591,1581],256],64697:[[1592,1605],256],64698:[[1593,1580],256],64699:[[1593,1605],256],64700:[[1594,1580],256],64701:[[1594,1605],256],64702:[[1601,1580],256],64703:[[1601,1581],256],64704:[[1601,1582],256],64705:[[1601,1605],256],64706:[[1602,1581],256],64707:[[1602,1605],256],64708:[[1603,1580],256],64709:[[1603,1581],256],64710:[[1603,1582],256],64711:[[1603,1604],256],64712:[[1603,1605],256],64713:[[1604,1580],256],64714:[[1604,1581],256],64715:[[1604,1582],256],64716:[[1604,1605],256],64717:[[1604,1607],256],64718:[[1605,1580],256],64719:[[1605,1581],256],64720:[[1605,1582],256],64721:[[1605,1605],256],64722:[[1606,1580],256],64723:[[1606,1581],256],64724:[[1606,1582],256],64725:[[1606,1605],256],64726:[[1606,1607],256],64727:[[1607,1580],256],64728:[[1607,1605],256],64729:[[1607,1648],256],64730:[[1610,1580],256],64731:[[1610,1581],256],64732:[[1610,1582],256],64733:[[1610,1605],256],64734:[[1610,1607],256],64735:[[1574,1605],256],64736:[[1574,1607],256],64737:[[1576,1605],256],64738:[[1576,1607],256],64739:[[1578,1605],256],64740:[[1578,1607],256],64741:[[1579,1605],256],64742:[[1579,1607],256],64743:[[1587,1605],256],64744:[[1587,1607],256],64745:[[1588,1605],256],64746:[[1588,1607],256],64747:[[1603,1604],256],64748:[[1603,1605],256],64749:[[1604,1605],256],64750:[[1606,1605],256],64751:[[1606,1607],256],64752:[[1610,1605],256],64753:[[1610,1607],256],64754:[[1600,1614,1617],256],64755:[[1600,1615,1617],256],64756:[[1600,1616,1617],256],64757:[[1591,1609],256],64758:[[1591,1610],256],64759:[[1593,1609],256],64760:[[1593,1610],256],64761:[[1594,1609],256],64762:[[1594,1610],256],64763:[[1587,1609],256],64764:[[1587,1610],256],64765:[[1588,1609],256],64766:[[1588,1610],256],64767:[[1581,1609],256]},
1390064768:{64768:[[1581,1610],256],64769:[[1580,1609],256],64770:[[1580,1610],256],64771:[[1582,1609],256],64772:[[1582,1610],256],64773:[[1589,1609],256],64774:[[1589,1610],256],64775:[[1590,1609],256],64776:[[1590,1610],256],64777:[[1588,1580],256],64778:[[1588,1581],256],64779:[[1588,1582],256],64780:[[1588,1605],256],64781:[[1588,1585],256],64782:[[1587,1585],256],64783:[[1589,1585],256],64784:[[1590,1585],256],64785:[[1591,1609],256],64786:[[1591,1610],256],64787:[[1593,1609],256],64788:[[1593,1610],256],64789:[[1594,1609],256],64790:[[1594,1610],256],64791:[[1587,1609],256],64792:[[1587,1610],256],64793:[[1588,1609],256],64794:[[1588,1610],256],64795:[[1581,1609],256],64796:[[1581,1610],256],64797:[[1580,1609],256],64798:[[1580,1610],256],64799:[[1582,1609],256],64800:[[1582,1610],256],64801:[[1589,1609],256],64802:[[1589,1610],256],64803:[[1590,1609],256],64804:[[1590,1610],256],64805:[[1588,1580],256],64806:[[1588,1581],256],64807:[[1588,1582],256],64808:[[1588,1605],256],64809:[[1588,1585],256],64810:[[1587,1585],256],64811:[[1589,1585],256],64812:[[1590,1585],256],64813:[[1588,1580],256],64814:[[1588,1581],256],64815:[[1588,1582],256],64816:[[1588,1605],256],64817:[[1587,1607],256],64818:[[1588,1607],256],64819:[[1591,1605],256],64820:[[1587,1580],256],64821:[[1587,1581],256],64822:[[1587,1582],256],64823:[[1588,1580],256],64824:[[1588,1581],256],64825:[[1588,1582],256],64826:[[1591,1605],256],64827:[[1592,1605],256],64828:[[1575,1611],256],64829:[[1575,1611],256],64848:[[1578,1580,1605],256],64849:[[1578,1581,1580],256],64850:[[1578,1581,1580],256],64851:[[1578,1581,1605],256],64852:[[1578,1582,1605],256],64853:[[1578,1605,1580],256],64854:[[1578,1605,1581],256],64855:[[1578,1605,1582],256],64856:[[1580,1605,1581],256],64857:[[1580,1605,1581],256],64858:[[1581,1605,1610],256],64859:[[1581,1605,1609],256],64860:[[1587,1581,1580],256],64861:[[1587,1580,1581],256],64862:[[1587,1580,1609],256],64863:[[1587,1605,1581],256],64864:[[1587,1605,1581],256],64865:[[1587,1605,1580],256],64866:[[1587,1605,1605],256],64867:[[1587,1605,1605],256],64868:[[1589,1581,1581],256],64869:[[1589,1581,1581],256],64870:[[1589,1605,1605],256],64871:[[1588,1581,1605],256],64872:[[1588,1581,1605],256],64873:[[1588,1580,1610],256],64874:[[1588,1605,1582],256],64875:[[1588,1605,1582],256],64876:[[1588,1605,1605],256],64877:[[1588,1605,1605],256],64878:[[1590,1581,1609],256],64879:[[1590,1582,1605],256],64880:[[1590,1582,1605],256],64881:[[1591,1605,1581],256],64882:[[1591,1605,1581],256],64883:[[1591,1605,1605],256],64884:[[1591,1605,1610],256],64885:[[1593,1580,1605],256],64886:[[1593,1605,1605],256],64887:[[1593,1605,1605],256],64888:[[1593,1605,1609],256],64889:[[1594,1605,1605],256],64890:[[1594,1605,1610],256],64891:[[1594,1605,1609],256],64892:[[1601,1582,1605],256],64893:[[1601,1582,1605],256],64894:[[1602,1605,1581],256],64895:[[1602,1605,1605],256],64896:[[1604,1581,1605],256],64897:[[1604,1581,1610],256],64898:[[1604,1581,1609],256],64899:[[1604,1580,1580],256],64900:[[1604,1580,1580],256],64901:[[1604,1582,1605],256],64902:[[1604,1582,1605],256],64903:[[1604,1605,1581],256],64904:[[1604,1605,1581],256],64905:[[1605,1581,1580],256],64906:[[1605,1581,1605],256],64907:[[1605,1581,1610],256],64908:[[1605,1580,1581],256],64909:[[1605,1580,1605],256],64910:[[1605,1582,1580],256],64911:[[1605,1582,1605],256],64914:[[1605,1580,1582],256],64915:[[1607,1605,1580],256],64916:[[1607,1605,1605],256],64917:[[1606,1581,1605],256],64918:[[1606,1581,1609],256],64919:[[1606,1580,1605],256],64920:[[1606,1580,1605],256],64921:[[1606,1580,1609],256],64922:[[1606,1605,1610],256],64923:[[1606,1605,1609],256],64924:[[1610,1605,1605],256],64925:[[1610,1605,1605],256],64926:[[1576,1582,1610],256],64927:[[1578,1580,1610],256],64928:[[1578,1580,1609],256],64929:[[1578,1582,1610],256],64930:[[1578,1582,1609],256],64931:[[1578,1605,1610],256],64932:[[1578,1605,1609],256],64933:[[1580,1605,1610],256],64934:[[1580,1581,1609],256],64935:[[1580,1605,1609],256],64936:[[1587,1582,1609],256],64937:[[1589,1581,1610],256],64938:[[1588,1581,1610],256],64939:[[1590,1581,1610],256],64940:[[1604,1580,1610],256],64941:[[1604,1605,1610],256],64942:[[1610,1581,1610],256],64943:[[1610,1580,1610],256],64944:[[1610,1605,1610],256],64945:[[1605,1605,1610],256],64946:[[1602,1605,1610],256],64947:[[1606,1581,1610],256],64948:[[1602,1605,1581],256],64949:[[1604,1581,1605],256],64950:[[1593,1605,1610],256],64951:[[1603,1605,1610],256],64952:[[1606,1580,1581],256],64953:[[1605,1582,1610],256],64954:[[1604,1580,1605],256],64955:[[1603,1605,1605],256],64956:[[1604,1580,1605],256],64957:[[1606,1580,1581],256],64958:[[1580,1581,1610],256],64959:[[1581,1580,1610],256],64960:[[1605,1580,1610],256],64961:[[1601,1605,1610],256],64962:[[1576,1581,1610],256],64963:[[1603,1605,1605],256],64964:[[1593,1580,1605],256],64965:[[1589,1605,1605],256],64966:[[1587,1582,1610],256],64967:[[1606,1580,1610],256],65008:[[1589,1604,1746],256],65009:[[1602,1604,1746],256],65010:[[1575,1604,1604,1607],256],65011:[[1575,1603,1576,1585],256],65012:[[1605,1581,1605,1583],256],65013:[[1589,1604,1593,1605],256],65014:[[1585,1587,1608,1604],256],65015:[[1593,1604,1610,1607],256],65016:[[1608,1587,1604,1605],256],65017:[[1589,1604,1609],256],65018:[[1589,1604,1609,32,1575,1604,1604,1607,32,1593,1604,1610,1607,32,1608,1587,1604,1605],256],65019:[[1580,1604,32,1580,1604,1575,1604,1607],256],65020:[[1585,1740,1575,1604],256]},
1390165024:{65040:[[44],256],65041:[[12289],256],65042:[[12290],256],65043:[[58],256],65044:[[59],256],65045:[[33],256],65046:[[63],256],65047:[[12310],256],65048:[[12311],256],65049:[[8230],256],65056:[,230],65057:[,230],65058:[,230],65059:[,230],65060:[,230],65061:[,230],65062:[,230],65063:[,220],65064:[,220],65065:[,220],65066:[,220],65067:[,220],65068:[,220],65069:[,220],65072:[[8229],256],65073:[[8212],256],65074:[[8211],256],65075:[[95],256],65076:[[95],256],65077:[[40],256],65078:[[41],256],65079:[[123],256],65080:[[125],256],65081:[[12308],256],65082:[[12309],256],65083:[[12304],256],65084:[[12305],256],65085:[[12298],256],65086:[[12299],256],65087:[[12296],256],65088:[[12297],256],65089:[[12300],256],65090:[[12301],256],65091:[[12302],256],65092:[[12303],256],65095:[[91],256],65096:[[93],256],65097:[[8254],256],65098:[[8254],256],65099:[[8254],256],65100:[[8254],256],65101:[[95],256],65102:[[95],256],65103:[[95],256],65104:[[44],256],65105:[[12289],256],65106:[[46],256],65108:[[59],256],65109:[[58],256],65110:[[63],256],65111:[[33],256],65112:[[8212],256],65113:[[40],256],65114:[[41],256],65115:[[123],256],65116:[[125],256],65117:[[12308],256],65118:[[12309],256],65119:[[35],256],65120:[[38],256],65121:[[42],256],65122:[[43],256],65123:[[45],256],65124:[[60],256],65125:[[62],256],65126:[[61],256],65128:[[92],256],65129:[[36],256],65130:[[37],256],65131:[[64],256],65136:[[32,1611],256],65137:[[1600,1611],256],65138:[[32,1612],256],65140:[[32,1613],256],65142:[[32,1614],256],65143:[[1600,1614],256],65144:[[32,1615],256],65145:[[1600,1615],256],65146:[[32,1616],256],65147:[[1600,1616],256],65148:[[32,1617],256],65149:[[1600,1617],256],65150:[[32,1618],256],65151:[[1600,1618],256],65152:[[1569],256],65153:[[1570],256],65154:[[1570],256],65155:[[1571],256],65156:[[1571],256],65157:[[1572],256],65158:[[1572],256],65159:[[1573],256],65160:[[1573],256],65161:[[1574],256],65162:[[1574],256],65163:[[1574],256],65164:[[1574],256],65165:[[1575],256],65166:[[1575],256],65167:[[1576],256],65168:[[1576],256],65169:[[1576],256],65170:[[1576],256],65171:[[1577],256],65172:[[1577],256],65173:[[1578],256],65174:[[1578],256],65175:[[1578],256],65176:[[1578],256],65177:[[1579],256],65178:[[1579],256],65179:[[1579],256],65180:[[1579],256],65181:[[1580],256],65182:[[1580],256],65183:[[1580],256],65184:[[1580],256],65185:[[1581],256],65186:[[1581],256],65187:[[1581],256],65188:[[1581],256],65189:[[1582],256],65190:[[1582],256],65191:[[1582],256],65192:[[1582],256],65193:[[1583],256],65194:[[1583],256],65195:[[1584],256],65196:[[1584],256],65197:[[1585],256],65198:[[1585],256],65199:[[1586],256],65200:[[1586],256],65201:[[1587],256],65202:[[1587],256],65203:[[1587],256],65204:[[1587],256],65205:[[1588],256],65206:[[1588],256],65207:[[1588],256],65208:[[1588],256],65209:[[1589],256],65210:[[1589],256],65211:[[1589],256],65212:[[1589],256],65213:[[1590],256],65214:[[1590],256],65215:[[1590],256],65216:[[1590],256],65217:[[1591],256],65218:[[1591],256],65219:[[1591],256],65220:[[1591],256],65221:[[1592],256],65222:[[1592],256],65223:[[1592],256],65224:[[1592],256],65225:[[1593],256],65226:[[1593],256],65227:[[1593],256],65228:[[1593],256],65229:[[1594],256],65230:[[1594],256],65231:[[1594],256],65232:[[1594],256],65233:[[1601],256],65234:[[1601],256],65235:[[1601],256],65236:[[1601],256],65237:[[1602],256],65238:[[1602],256],65239:[[1602],256],65240:[[1602],256],65241:[[1603],256],65242:[[1603],256],65243:[[1603],256],65244:[[1603],256],65245:[[1604],256],65246:[[1604],256],65247:[[1604],256],65248:[[1604],256],65249:[[1605],256],65250:[[1605],256],65251:[[1605],256],65252:[[1605],256],65253:[[1606],256],65254:[[1606],256],65255:[[1606],256],65256:[[1606],256],65257:[[1607],256],65258:[[1607],256],65259:[[1607],256],65260:[[1607],256],65261:[[1608],256],65262:[[1608],256],65263:[[1609],256],65264:[[1609],256],65265:[[1610],256],65266:[[1610],256],65267:[[1610],256],65268:[[1610],256],65269:[[1604,1570],256],65270:[[1604,1570],256],65271:[[1604,1571],256],65272:[[1604,1571],256],65273:[[1604,1573],256],65274:[[1604,1573],256],65275:[[1604,1575],256],65276:[[1604,1575],256]},
1390265280:{65281:[[33],256],65282:[[34],256],65283:[[35],256],65284:[[36],256],65285:[[37],256],65286:[[38],256],65287:[[39],256],65288:[[40],256],65289:[[41],256],65290:[[42],256],65291:[[43],256],65292:[[44],256],65293:[[45],256],65294:[[46],256],65295:[[47],256],65296:[[48],256],65297:[[49],256],65298:[[50],256],65299:[[51],256],65300:[[52],256],65301:[[53],256],65302:[[54],256],65303:[[55],256],65304:[[56],256],65305:[[57],256],65306:[[58],256],65307:[[59],256],65308:[[60],256],65309:[[61],256],65310:[[62],256],65311:[[63],256],65312:[[64],256],65313:[[65],256],65314:[[66],256],65315:[[67],256],65316:[[68],256],65317:[[69],256],65318:[[70],256],65319:[[71],256],65320:[[72],256],65321:[[73],256],65322:[[74],256],65323:[[75],256],65324:[[76],256],65325:[[77],256],65326:[[78],256],65327:[[79],256],65328:[[80],256],65329:[[81],256],65330:[[82],256],65331:[[83],256],65332:[[84],256],65333:[[85],256],65334:[[86],256],65335:[[87],256],65336:[[88],256],65337:[[89],256],65338:[[90],256],65339:[[91],256],65340:[[92],256],65341:[[93],256],65342:[[94],256],65343:[[95],256],65344:[[96],256],65345:[[97],256],65346:[[98],256],65347:[[99],256],65348:[[100],256],65349:[[101],256],65350:[[102],256],65351:[[103],256],65352:[[104],256],65353:[[105],256],65354:[[106],256],65355:[[107],256],65356:[[108],256],65357:[[109],256],65358:[[110],256],65359:[[111],256],65360:[[112],256],65361:[[113],256],65362:[[114],256],65363:[[115],256],65364:[[116],256],65365:[[117],256],65366:[[118],256],65367:[[119],256],65368:[[120],256],65369:[[121],256],65370:[[122],256],65371:[[123],256],65372:[[124],256],65373:[[125],256],65374:[[126],256],65375:[[10629],256],65376:[[10630],256],65377:[[12290],256],65378:[[12300],256],65379:[[12301],256],65380:[[12289],256],65381:[[12539],256],65382:[[12530],256],65383:[[12449],256],65384:[[12451],256],65385:[[12453],256],65386:[[12455],256],65387:[[12457],256],65388:[[12515],256],65389:[[12517],256],65390:[[12519],256],65391:[[12483],256],65392:[[12540],256],65393:[[12450],256],65394:[[12452],256],65395:[[12454],256],65396:[[12456],256],65397:[[12458],256],65398:[[12459],256],65399:[[12461],256],65400:[[12463],256],65401:[[12465],256],65402:[[12467],256],65403:[[12469],256],65404:[[12471],256],65405:[[12473],256],65406:[[12475],256],65407:[[12477],256],65408:[[12479],256],65409:[[12481],256],65410:[[12484],256],65411:[[12486],256],65412:[[12488],256],65413:[[12490],256],65414:[[12491],256],65415:[[12492],256],65416:[[12493],256],65417:[[12494],256],65418:[[12495],256],65419:[[12498],256],65420:[[12501],256],65421:[[12504],256],65422:[[12507],256],65423:[[12510],256],65424:[[12511],256],65425:[[12512],256],65426:[[12513],256],65427:[[12514],256],65428:[[12516],256],65429:[[12518],256],65430:[[12520],256],65431:[[12521],256],65432:[[12522],256],65433:[[12523],256],65434:[[12524],256],65435:[[12525],256],65436:[[12527],256],65437:[[12531],256],65438:[[12441],256],65439:[[12442],256],65440:[[12644],256],65441:[[12593],256],65442:[[12594],256],65443:[[12595],256],65444:[[12596],256],65445:[[12597],256],65446:[[12598],256],65447:[[12599],256],65448:[[12600],256],65449:[[12601],256],65450:[[12602],256],65451:[[12603],256],65452:[[12604],256],65453:[[12605],256],65454:[[12606],256],65455:[[12607],256],65456:[[12608],256],65457:[[12609],256],65458:[[12610],256],65459:[[12611],256],65460:[[12612],256],65461:[[12613],256],65462:[[12614],256],65463:[[12615],256],65464:[[12616],256],65465:[[12617],256],65466:[[12618],256],65467:[[12619],256],65468:[[12620],256],65469:[[12621],256],65470:[[12622],256],65474:[[12623],256],65475:[[12624],256],65476:[[12625],256],65477:[[12626],256],65478:[[12627],256],65479:[[12628],256],65482:[[12629],256],65483:[[12630],256],65484:[[12631],256],65485:[[12632],256],65486:[[12633],256],65487:[[12634],256],65490:[[12635],256],65491:[[12636],256],65492:[[12637],256],65493:[[12638],256],65494:[[12639],256],65495:[[12640],256],65498:[[12641],256],65499:[[12642],256],65500:[[12643],256],65504:[[162],256],65505:[[163],256],65506:[[172],256],65507:[[175],256],65508:[[166],256],65509:[[165],256],65510:[[8361],256],65512:[[9474],256],65513:[[8592],256],65514:[[8593],256],65515:[[8594],256],65516:[[8595],256],65517:[[9632],256],65518:[[9675],256]}
13903
13904};
13905
13906 /***** Module to export */
13907 var unorm = {
13908 nfc: nfc,
13909 nfd: nfd,
13910 nfkc: nfkc,
13911 nfkd: nfkd
13912 };
13913
13914 /*globals module:true,define:true*/
13915
13916 // CommonJS
13917 if (typeof module === "object") {
13918 module.exports = unorm;
13919
13920 // AMD
13921 } else if (typeof define === "function" && define.amd) {
13922 define("unorm", function () {
13923 return unorm;
13924 });
13925
13926 // Global
13927 } else {
13928 root.unorm = unorm;
13929 }
13930
13931 /***** Export as shim for String::normalize method *****/
13932 /*
13933 http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#november_8_2013_draft_rev_21
13934
13935 21.1.3.12 String.prototype.normalize(form="NFC")
13936 When the normalize method is called with one argument form, the following steps are taken:
13937
13938 1. Let O be CheckObjectCoercible(this value).
13939 2. Let S be ToString(O).
13940 3. ReturnIfAbrupt(S).
13941 4. If form is not provided or undefined let form be "NFC".
13942 5. Let f be ToString(form).
13943 6. ReturnIfAbrupt(f).
13944 7. If f is not one of "NFC", "NFD", "NFKC", or "NFKD", then throw a RangeError Exception.
13945 8. Let ns be the String value is the result of normalizing S into the normalization form named by f as specified in Unicode Standard Annex #15, UnicodeNormalizatoin Forms.
13946 9. Return ns.
13947
13948 The length property of the normalize method is 0.
13949
13950 *NOTE* The normalize function is intentionally generic; it does not require that its this value be a String object. Therefore it can be transferred to other kinds of objects for use as a method.
13951 */
13952 unorm.shimApplied = false;
13953
13954 if (!String.prototype.normalize) {
13955 String.prototype.normalize = function(form) {
13956 var str = "" + this;
13957 form = form === undefined ? "NFC" : form;
13958
13959 if (form === "NFC") {
13960 return unorm.nfc(str);
13961 } else if (form === "NFD") {
13962 return unorm.nfd(str);
13963 } else if (form === "NFKC") {
13964 return unorm.nfkc(str);
13965 } else if (form === "NFKD") {
13966 return unorm.nfkd(str);
13967 } else {
13968 throw new RangeError("Invalid normalization form: " + form);
13969 }
13970 };
13971
13972 unorm.shimApplied = true;
13973 }
13974}(this));
13975</script>
13976 <script>/*!
13977 * jQuery JavaScript Library v3.2.1
13978 * https://jquery.com/
13979 *
13980 * Includes Sizzle.js
13981 * https://sizzlejs.com/
13982 *
13983 * Copyright JS Foundation and other contributors
13984 * Released under the MIT license
13985 * https://jquery.org/license
13986 *
13987 * Date: 2017-03-20T18:59Z
13988 */
13989( function( global, factory ) {
13990
13991 "use strict";
13992
13993 if ( typeof module === "object" && typeof module.exports === "object" ) {
13994
13995 // For CommonJS and CommonJS-like environments where a proper `window`
13996 // is present, execute the factory and get jQuery.
13997 // For environments that do not have a `window` with a `document`
13998 // (such as Node.js), expose a factory as module.exports.
13999 // This accentuates the need for the creation of a real `window`.
14000 // e.g. var jQuery = require("jquery")(window);
14001 // See ticket #14549 for more info.
14002 module.exports = global.document ?
14003 factory( global, true ) :
14004 function( w ) {
14005 if ( !w.document ) {
14006 throw new Error( "jQuery requires a window with a document" );
14007 }
14008 return factory( w );
14009 };
14010 } else {
14011 factory( global );
14012 }
14013
14014// Pass this if window is not defined yet
14015} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
14016
14017// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
14018// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
14019// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
14020// enough that all such attempts are guarded in a try block.
14021"use strict";
14022
14023var arr = [];
14024
14025var document = window.document;
14026
14027var getProto = Object.getPrototypeOf;
14028
14029var slice = arr.slice;
14030
14031var concat = arr.concat;
14032
14033var push = arr.push;
14034
14035var indexOf = arr.indexOf;
14036
14037var class2type = {};
14038
14039var toString = class2type.toString;
14040
14041var hasOwn = class2type.hasOwnProperty;
14042
14043var fnToString = hasOwn.toString;
14044
14045var ObjectFunctionString = fnToString.call( Object );
14046
14047var support = {};
14048
14049
14050
14051 function DOMEval( code, doc ) {
14052 doc = doc || document;
14053
14054 var script = doc.createElement( "script" );
14055
14056 script.text = code;
14057 doc.head.appendChild( script ).parentNode.removeChild( script );
14058 }
14059/* global Symbol */
14060// Defining this global in .eslintrc.json would create a danger of using the global
14061// unguarded in another place, it seems safer to define global only for this module
14062
14063
14064
14065var
14066 version = "3.2.1",
14067
14068 // Define a local copy of jQuery
14069 jQuery = function( selector, context ) {
14070
14071 // The jQuery object is actually just the init constructor 'enhanced'
14072 // Need init if jQuery is called (just allow error to be thrown if not included)
14073 return new jQuery.fn.init( selector, context );
14074 },
14075
14076 // Support: Android <=4.0 only
14077 // Make sure we trim BOM and NBSP
14078 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
14079
14080 // Matches dashed string for camelizing
14081 rmsPrefix = /^-ms-/,
14082 rdashAlpha = /-([a-z])/g,
14083
14084 // Used by jQuery.camelCase as callback to replace()
14085 fcamelCase = function( all, letter ) {
14086 return letter.toUpperCase();
14087 };
14088
14089jQuery.fn = jQuery.prototype = {
14090
14091 // The current version of jQuery being used
14092 jquery: version,
14093
14094 constructor: jQuery,
14095
14096 // The default length of a jQuery object is 0
14097 length: 0,
14098
14099 toArray: function() {
14100 return slice.call( this );
14101 },
14102
14103 // Get the Nth element in the matched element set OR
14104 // Get the whole matched element set as a clean array
14105 get: function( num ) {
14106
14107 // Return all the elements in a clean array
14108 if ( num == null ) {
14109 return slice.call( this );
14110 }
14111
14112 // Return just the one element from the set
14113 return num < 0 ? this[ num + this.length ] : this[ num ];
14114 },
14115
14116 // Take an array of elements and push it onto the stack
14117 // (returning the new matched element set)
14118 pushStack: function( elems ) {
14119
14120 // Build a new jQuery matched element set
14121 var ret = jQuery.merge( this.constructor(), elems );
14122
14123 // Add the old object onto the stack (as a reference)
14124 ret.prevObject = this;
14125
14126 // Return the newly-formed element set
14127 return ret;
14128 },
14129
14130 // Execute a callback for every element in the matched set.
14131 each: function( callback ) {
14132 return jQuery.each( this, callback );
14133 },
14134
14135 map: function( callback ) {
14136 return this.pushStack( jQuery.map( this, function( elem, i ) {
14137 return callback.call( elem, i, elem );
14138 } ) );
14139 },
14140
14141 slice: function() {
14142 return this.pushStack( slice.apply( this, arguments ) );
14143 },
14144
14145 first: function() {
14146 return this.eq( 0 );
14147 },
14148
14149 last: function() {
14150 return this.eq( -1 );
14151 },
14152
14153 eq: function( i ) {
14154 var len = this.length,
14155 j = +i + ( i < 0 ? len : 0 );
14156 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
14157 },
14158
14159 end: function() {
14160 return this.prevObject || this.constructor();
14161 },
14162
14163 // For internal use only.
14164 // Behaves like an Array's method, not like a jQuery method.
14165 push: push,
14166 sort: arr.sort,
14167 splice: arr.splice
14168};
14169
14170jQuery.extend = jQuery.fn.extend = function() {
14171 var options, name, src, copy, copyIsArray, clone,
14172 target = arguments[ 0 ] || {},
14173 i = 1,
14174 length = arguments.length,
14175 deep = false;
14176
14177 // Handle a deep copy situation
14178 if ( typeof target === "boolean" ) {
14179 deep = target;
14180
14181 // Skip the boolean and the target
14182 target = arguments[ i ] || {};
14183 i++;
14184 }
14185
14186 // Handle case when target is a string or something (possible in deep copy)
14187 if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
14188 target = {};
14189 }
14190
14191 // Extend jQuery itself if only one argument is passed
14192 if ( i === length ) {
14193 target = this;
14194 i--;
14195 }
14196
14197 for ( ; i < length; i++ ) {
14198
14199 // Only deal with non-null/undefined values
14200 if ( ( options = arguments[ i ] ) != null ) {
14201
14202 // Extend the base object
14203 for ( name in options ) {
14204 src = target[ name ];
14205 copy = options[ name ];
14206
14207 // Prevent never-ending loop
14208 if ( target === copy ) {
14209 continue;
14210 }
14211
14212 // Recurse if we're merging plain objects or arrays
14213 if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
14214 ( copyIsArray = Array.isArray( copy ) ) ) ) {
14215
14216 if ( copyIsArray ) {
14217 copyIsArray = false;
14218 clone = src && Array.isArray( src ) ? src : [];
14219
14220 } else {
14221 clone = src && jQuery.isPlainObject( src ) ? src : {};
14222 }
14223
14224 // Never move original objects, clone them
14225 target[ name ] = jQuery.extend( deep, clone, copy );
14226
14227 // Don't bring in undefined values
14228 } else if ( copy !== undefined ) {
14229 target[ name ] = copy;
14230 }
14231 }
14232 }
14233 }
14234
14235 // Return the modified object
14236 return target;
14237};
14238
14239jQuery.extend( {
14240
14241 // Unique for each copy of jQuery on the page
14242 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
14243
14244 // Assume jQuery is ready without the ready module
14245 isReady: true,
14246
14247 error: function( msg ) {
14248 throw new Error( msg );
14249 },
14250
14251 noop: function() {},
14252
14253 isFunction: function( obj ) {
14254 return jQuery.type( obj ) === "function";
14255 },
14256
14257 isWindow: function( obj ) {
14258 return obj != null && obj === obj.window;
14259 },
14260
14261 isNumeric: function( obj ) {
14262
14263 // As of jQuery 3.0, isNumeric is limited to
14264 // strings and numbers (primitives or objects)
14265 // that can be coerced to finite numbers (gh-2662)
14266 var type = jQuery.type( obj );
14267 return ( type === "number" || type === "string" ) &&
14268
14269 // parseFloat NaNs numeric-cast false positives ("")
14270 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
14271 // subtraction forces infinities to NaN
14272 !isNaN( obj - parseFloat( obj ) );
14273 },
14274
14275 isPlainObject: function( obj ) {
14276 var proto, Ctor;
14277
14278 // Detect obvious negatives
14279 // Use toString instead of jQuery.type to catch host objects
14280 if ( !obj || toString.call( obj ) !== "[object Object]" ) {
14281 return false;
14282 }
14283
14284 proto = getProto( obj );
14285
14286 // Objects with no prototype (e.g., `Object.create( null )`) are plain
14287 if ( !proto ) {
14288 return true;
14289 }
14290
14291 // Objects with prototype are plain iff they were constructed by a global Object function
14292 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
14293 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
14294 },
14295
14296 isEmptyObject: function( obj ) {
14297
14298 /* eslint-disable no-unused-vars */
14299 // See https://github.com/eslint/eslint/issues/6125
14300 var name;
14301
14302 for ( name in obj ) {
14303 return false;
14304 }
14305 return true;
14306 },
14307
14308 type: function( obj ) {
14309 if ( obj == null ) {
14310 return obj + "";
14311 }
14312
14313 // Support: Android <=2.3 only (functionish RegExp)
14314 return typeof obj === "object" || typeof obj === "function" ?
14315 class2type[ toString.call( obj ) ] || "object" :
14316 typeof obj;
14317 },
14318
14319 // Evaluates a script in a global context
14320 globalEval: function( code ) {
14321 DOMEval( code );
14322 },
14323
14324 // Convert dashed to camelCase; used by the css and data modules
14325 // Support: IE <=9 - 11, Edge 12 - 13
14326 // Microsoft forgot to hump their vendor prefix (#9572)
14327 camelCase: function( string ) {
14328 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
14329 },
14330
14331 each: function( obj, callback ) {
14332 var length, i = 0;
14333
14334 if ( isArrayLike( obj ) ) {
14335 length = obj.length;
14336 for ( ; i < length; i++ ) {
14337 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
14338 break;
14339 }
14340 }
14341 } else {
14342 for ( i in obj ) {
14343 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
14344 break;
14345 }
14346 }
14347 }
14348
14349 return obj;
14350 },
14351
14352 // Support: Android <=4.0 only
14353 trim: function( text ) {
14354 return text == null ?
14355 "" :
14356 ( text + "" ).replace( rtrim, "" );
14357 },
14358
14359 // results is for internal usage only
14360 makeArray: function( arr, results ) {
14361 var ret = results || [];
14362
14363 if ( arr != null ) {
14364 if ( isArrayLike( Object( arr ) ) ) {
14365 jQuery.merge( ret,
14366 typeof arr === "string" ?
14367 [ arr ] : arr
14368 );
14369 } else {
14370 push.call( ret, arr );
14371 }
14372 }
14373
14374 return ret;
14375 },
14376
14377 inArray: function( elem, arr, i ) {
14378 return arr == null ? -1 : indexOf.call( arr, elem, i );
14379 },
14380
14381 // Support: Android <=4.0 only, PhantomJS 1 only
14382 // push.apply(_, arraylike) throws on ancient WebKit
14383 merge: function( first, second ) {
14384 var len = +second.length,
14385 j = 0,
14386 i = first.length;
14387
14388 for ( ; j < len; j++ ) {
14389 first[ i++ ] = second[ j ];
14390 }
14391
14392 first.length = i;
14393
14394 return first;
14395 },
14396
14397 grep: function( elems, callback, invert ) {
14398 var callbackInverse,
14399 matches = [],
14400 i = 0,
14401 length = elems.length,
14402 callbackExpect = !invert;
14403
14404 // Go through the array, only saving the items
14405 // that pass the validator function
14406 for ( ; i < length; i++ ) {
14407 callbackInverse = !callback( elems[ i ], i );
14408 if ( callbackInverse !== callbackExpect ) {
14409 matches.push( elems[ i ] );
14410 }
14411 }
14412
14413 return matches;
14414 },
14415
14416 // arg is for internal usage only
14417 map: function( elems, callback, arg ) {
14418 var length, value,
14419 i = 0,
14420 ret = [];
14421
14422 // Go through the array, translating each of the items to their new values
14423 if ( isArrayLike( elems ) ) {
14424 length = elems.length;
14425 for ( ; i < length; i++ ) {
14426 value = callback( elems[ i ], i, arg );
14427
14428 if ( value != null ) {
14429 ret.push( value );
14430 }
14431 }
14432
14433 // Go through every key on the object,
14434 } else {
14435 for ( i in elems ) {
14436 value = callback( elems[ i ], i, arg );
14437
14438 if ( value != null ) {
14439 ret.push( value );
14440 }
14441 }
14442 }
14443
14444 // Flatten any nested arrays
14445 return concat.apply( [], ret );
14446 },
14447
14448 // A global GUID counter for objects
14449 guid: 1,
14450
14451 // Bind a function to a context, optionally partially applying any
14452 // arguments.
14453 proxy: function( fn, context ) {
14454 var tmp, args, proxy;
14455
14456 if ( typeof context === "string" ) {
14457 tmp = fn[ context ];
14458 context = fn;
14459 fn = tmp;
14460 }
14461
14462 // Quick check to determine if target is callable, in the spec
14463 // this throws a TypeError, but we will just return undefined.
14464 if ( !jQuery.isFunction( fn ) ) {
14465 return undefined;
14466 }
14467
14468 // Simulated bind
14469 args = slice.call( arguments, 2 );
14470 proxy = function() {
14471 return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
14472 };
14473
14474 // Set the guid of unique handler to the same of original handler, so it can be removed
14475 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
14476
14477 return proxy;
14478 },
14479
14480 now: Date.now,
14481
14482 // jQuery.support is not used in Core but other projects attach their
14483 // properties to it so it needs to exist.
14484 support: support
14485} );
14486
14487if ( typeof Symbol === "function" ) {
14488 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
14489}
14490
14491// Populate the class2type map
14492jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
14493function( i, name ) {
14494 class2type[ "[object " + name + "]" ] = name.toLowerCase();
14495} );
14496
14497function isArrayLike( obj ) {
14498
14499 // Support: real iOS 8.2 only (not reproducible in simulator)
14500 // `in` check used to prevent JIT error (gh-2145)
14501 // hasOwn isn't used here due to false negatives
14502 // regarding Nodelist length in IE
14503 var length = !!obj && "length" in obj && obj.length,
14504 type = jQuery.type( obj );
14505
14506 if ( type === "function" || jQuery.isWindow( obj ) ) {
14507 return false;
14508 }
14509
14510 return type === "array" || length === 0 ||
14511 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
14512}
14513var Sizzle =
14514/*!
14515 * Sizzle CSS Selector Engine v2.3.3
14516 * https://sizzlejs.com/
14517 *
14518 * Copyright jQuery Foundation and other contributors
14519 * Released under the MIT license
14520 * http://jquery.org/license
14521 *
14522 * Date: 2016-08-08
14523 */
14524(function( window ) {
14525
14526var i,
14527 support,
14528 Expr,
14529 getText,
14530 isXML,
14531 tokenize,
14532 compile,
14533 select,
14534 outermostContext,
14535 sortInput,
14536 hasDuplicate,
14537
14538 // Local document vars
14539 setDocument,
14540 document,
14541 docElem,
14542 documentIsHTML,
14543 rbuggyQSA,
14544 rbuggyMatches,
14545 matches,
14546 contains,
14547
14548 // Instance-specific data
14549 expando = "sizzle" + 1 * new Date(),
14550 preferredDoc = window.document,
14551 dirruns = 0,
14552 done = 0,
14553 classCache = createCache(),
14554 tokenCache = createCache(),
14555 compilerCache = createCache(),
14556 sortOrder = function( a, b ) {
14557 if ( a === b ) {
14558 hasDuplicate = true;
14559 }
14560 return 0;
14561 },
14562
14563 // Instance methods
14564 hasOwn = ({}).hasOwnProperty,
14565 arr = [],
14566 pop = arr.pop,
14567 push_native = arr.push,
14568 push = arr.push,
14569 slice = arr.slice,
14570 // Use a stripped-down indexOf as it's faster than native
14571 // https://jsperf.com/thor-indexof-vs-for/5
14572 indexOf = function( list, elem ) {
14573 var i = 0,
14574 len = list.length;
14575 for ( ; i < len; i++ ) {
14576 if ( list[i] === elem ) {
14577 return i;
14578 }
14579 }
14580 return -1;
14581 },
14582
14583 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
14584
14585 // Regular expressions
14586
14587 // http://www.w3.org/TR/css3-selectors/#whitespace
14588 whitespace = "[\\x20\\t\\r\\n\\f]",
14589
14590 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
14591 identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
14592
14593 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
14594 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
14595 // Operator (capture 2)
14596 "*([*^$|!~]?=)" + whitespace +
14597 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
14598 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
14599 "*\\]",
14600
14601 pseudos = ":(" + identifier + ")(?:\\((" +
14602 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
14603 // 1. quoted (capture 3; capture 4 or capture 5)
14604 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
14605 // 2. simple (capture 6)
14606 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
14607 // 3. anything else (capture 2)
14608 ".*" +
14609 ")\\)|)",
14610
14611 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
14612 rwhitespace = new RegExp( whitespace + "+", "g" ),
14613 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
14614
14615 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
14616 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
14617
14618 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
14619
14620 rpseudo = new RegExp( pseudos ),
14621 ridentifier = new RegExp( "^" + identifier + "$" ),
14622
14623 matchExpr = {
14624 "ID": new RegExp( "^#(" + identifier + ")" ),
14625 "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
14626 "TAG": new RegExp( "^(" + identifier + "|[*])" ),
14627 "ATTR": new RegExp( "^" + attributes ),
14628 "PSEUDO": new RegExp( "^" + pseudos ),
14629 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
14630 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
14631 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
14632 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
14633 // For use in libraries implementing .is()
14634 // We use this for POS matching in `select`
14635 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
14636 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
14637 },
14638
14639 rinputs = /^(?:input|select|textarea|button)$/i,
14640 rheader = /^h\d$/i,
14641
14642 rnative = /^[^{]+\{\s*\[native \w/,
14643
14644 // Easily-parseable/retrievable ID or TAG or CLASS selectors
14645 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
14646
14647 rsibling = /[+~]/,
14648
14649 // CSS escapes
14650 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
14651 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
14652 funescape = function( _, escaped, escapedWhitespace ) {
14653 var high = "0x" + escaped - 0x10000;
14654 // NaN means non-codepoint
14655 // Support: Firefox<24
14656 // Workaround erroneous numeric interpretation of +"0x"
14657 return high !== high || escapedWhitespace ?
14658 escaped :
14659 high < 0 ?
14660 // BMP codepoint
14661 String.fromCharCode( high + 0x10000 ) :
14662 // Supplemental Plane codepoint (surrogate pair)
14663 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
14664 },
14665
14666 // CSS string/identifier serialization
14667 // https://drafts.csswg.org/cssom/#common-serializing-idioms
14668 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
14669 fcssescape = function( ch, asCodePoint ) {
14670 if ( asCodePoint ) {
14671
14672 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
14673 if ( ch === "\0" ) {
14674 return "\uFFFD";
14675 }
14676
14677 // Control characters and (dependent upon position) numbers get escaped as code points
14678 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
14679 }
14680
14681 // Other potentially-special ASCII characters get backslash-escaped
14682 return "\\" + ch;
14683 },
14684
14685 // Used for iframes
14686 // See setDocument()
14687 // Removing the function wrapper causes a "Permission Denied"
14688 // error in IE
14689 unloadHandler = function() {
14690 setDocument();
14691 },
14692
14693 disabledAncestor = addCombinator(
14694 function( elem ) {
14695 return elem.disabled === true && ("form" in elem || "label" in elem);
14696 },
14697 { dir: "parentNode", next: "legend" }
14698 );
14699
14700// Optimize for push.apply( _, NodeList )
14701try {
14702 push.apply(
14703 (arr = slice.call( preferredDoc.childNodes )),
14704 preferredDoc.childNodes
14705 );
14706 // Support: Android<4.0
14707 // Detect silently failing push.apply
14708 arr[ preferredDoc.childNodes.length ].nodeType;
14709} catch ( e ) {
14710 push = { apply: arr.length ?
14711
14712 // Leverage slice if possible
14713 function( target, els ) {
14714 push_native.apply( target, slice.call(els) );
14715 } :
14716
14717 // Support: IE<9
14718 // Otherwise append directly
14719 function( target, els ) {
14720 var j = target.length,
14721 i = 0;
14722 // Can't trust NodeList.length
14723 while ( (target[j++] = els[i++]) ) {}
14724 target.length = j - 1;
14725 }
14726 };
14727}
14728
14729function Sizzle( selector, context, results, seed ) {
14730 var m, i, elem, nid, match, groups, newSelector,
14731 newContext = context && context.ownerDocument,
14732
14733 // nodeType defaults to 9, since context defaults to document
14734 nodeType = context ? context.nodeType : 9;
14735
14736 results = results || [];
14737
14738 // Return early from calls with invalid selector or context
14739 if ( typeof selector !== "string" || !selector ||
14740 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
14741
14742 return results;
14743 }
14744
14745 // Try to shortcut find operations (as opposed to filters) in HTML documents
14746 if ( !seed ) {
14747
14748 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
14749 setDocument( context );
14750 }
14751 context = context || document;
14752
14753 if ( documentIsHTML ) {
14754
14755 // If the selector is sufficiently simple, try using a "get*By*" DOM method
14756 // (excepting DocumentFragment context, where the methods don't exist)
14757 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
14758
14759 // ID selector
14760 if ( (m = match[1]) ) {
14761
14762 // Document context
14763 if ( nodeType === 9 ) {
14764 if ( (elem = context.getElementById( m )) ) {
14765
14766 // Support: IE, Opera, Webkit
14767 // TODO: identify versions
14768 // getElementById can match elements by name instead of ID
14769 if ( elem.id === m ) {
14770 results.push( elem );
14771 return results;
14772 }
14773 } else {
14774 return results;
14775 }
14776
14777 // Element context
14778 } else {
14779
14780 // Support: IE, Opera, Webkit
14781 // TODO: identify versions
14782 // getElementById can match elements by name instead of ID
14783 if ( newContext && (elem = newContext.getElementById( m )) &&
14784 contains( context, elem ) &&
14785 elem.id === m ) {
14786
14787 results.push( elem );
14788 return results;
14789 }
14790 }
14791
14792 // Type selector
14793 } else if ( match[2] ) {
14794 push.apply( results, context.getElementsByTagName( selector ) );
14795 return results;
14796
14797 // Class selector
14798 } else if ( (m = match[3]) && support.getElementsByClassName &&
14799 context.getElementsByClassName ) {
14800
14801 push.apply( results, context.getElementsByClassName( m ) );
14802 return results;
14803 }
14804 }
14805
14806 // Take advantage of querySelectorAll
14807 if ( support.qsa &&
14808 !compilerCache[ selector + " " ] &&
14809 (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
14810
14811 if ( nodeType !== 1 ) {
14812 newContext = context;
14813 newSelector = selector;
14814
14815 // qSA looks outside Element context, which is not what we want
14816 // Thanks to Andrew Dupont for this workaround technique
14817 // Support: IE <=8
14818 // Exclude object elements
14819 } else if ( context.nodeName.toLowerCase() !== "object" ) {
14820
14821 // Capture the context ID, setting it first if necessary
14822 if ( (nid = context.getAttribute( "id" )) ) {
14823 nid = nid.replace( rcssescape, fcssescape );
14824 } else {
14825 context.setAttribute( "id", (nid = expando) );
14826 }
14827
14828 // Prefix every selector in the list
14829 groups = tokenize( selector );
14830 i = groups.length;
14831 while ( i-- ) {
14832 groups[i] = "#" + nid + " " + toSelector( groups[i] );
14833 }
14834 newSelector = groups.join( "," );
14835
14836 // Expand context for sibling selectors
14837 newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
14838 context;
14839 }
14840
14841 if ( newSelector ) {
14842 try {
14843 push.apply( results,
14844 newContext.querySelectorAll( newSelector )
14845 );
14846 return results;
14847 } catch ( qsaError ) {
14848 } finally {
14849 if ( nid === expando ) {
14850 context.removeAttribute( "id" );
14851 }
14852 }
14853 }
14854 }
14855 }
14856 }
14857
14858 // All others
14859 return select( selector.replace( rtrim, "$1" ), context, results, seed );
14860}
14861
14862/**
14863 * Create key-value caches of limited size
14864 * @returns {function(string, object)} Returns the Object data after storing it on itself with
14865 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
14866 * deleting the oldest entry
14867 */
14868function createCache() {
14869 var keys = [];
14870
14871 function cache( key, value ) {
14872 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
14873 if ( keys.push( key + " " ) > Expr.cacheLength ) {
14874 // Only keep the most recent entries
14875 delete cache[ keys.shift() ];
14876 }
14877 return (cache[ key + " " ] = value);
14878 }
14879 return cache;
14880}
14881
14882/**
14883 * Mark a function for special use by Sizzle
14884 * @param {Function} fn The function to mark
14885 */
14886function markFunction( fn ) {
14887 fn[ expando ] = true;
14888 return fn;
14889}
14890
14891/**
14892 * Support testing using an element
14893 * @param {Function} fn Passed the created element and returns a boolean result
14894 */
14895function assert( fn ) {
14896 var el = document.createElement("fieldset");
14897
14898 try {
14899 return !!fn( el );
14900 } catch (e) {
14901 return false;
14902 } finally {
14903 // Remove from its parent by default
14904 if ( el.parentNode ) {
14905 el.parentNode.removeChild( el );
14906 }
14907 // release memory in IE
14908 el = null;
14909 }
14910}
14911
14912/**
14913 * Adds the same handler for all of the specified attrs
14914 * @param {String} attrs Pipe-separated list of attributes
14915 * @param {Function} handler The method that will be applied
14916 */
14917function addHandle( attrs, handler ) {
14918 var arr = attrs.split("|"),
14919 i = arr.length;
14920
14921 while ( i-- ) {
14922 Expr.attrHandle[ arr[i] ] = handler;
14923 }
14924}
14925
14926/**
14927 * Checks document order of two siblings
14928 * @param {Element} a
14929 * @param {Element} b
14930 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
14931 */
14932function siblingCheck( a, b ) {
14933 var cur = b && a,
14934 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
14935 a.sourceIndex - b.sourceIndex;
14936
14937 // Use IE sourceIndex if available on both nodes
14938 if ( diff ) {
14939 return diff;
14940 }
14941
14942 // Check if b follows a
14943 if ( cur ) {
14944 while ( (cur = cur.nextSibling) ) {
14945 if ( cur === b ) {
14946 return -1;
14947 }
14948 }
14949 }
14950
14951 return a ? 1 : -1;
14952}
14953
14954/**
14955 * Returns a function to use in pseudos for input types
14956 * @param {String} type
14957 */
14958function createInputPseudo( type ) {
14959 return function( elem ) {
14960 var name = elem.nodeName.toLowerCase();
14961 return name === "input" && elem.type === type;
14962 };
14963}
14964
14965/**
14966 * Returns a function to use in pseudos for buttons
14967 * @param {String} type
14968 */
14969function createButtonPseudo( type ) {
14970 return function( elem ) {
14971 var name = elem.nodeName.toLowerCase();
14972 return (name === "input" || name === "button") && elem.type === type;
14973 };
14974}
14975
14976/**
14977 * Returns a function to use in pseudos for :enabled/:disabled
14978 * @param {Boolean} disabled true for :disabled; false for :enabled
14979 */
14980function createDisabledPseudo( disabled ) {
14981
14982 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
14983 return function( elem ) {
14984
14985 // Only certain elements can match :enabled or :disabled
14986 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
14987 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
14988 if ( "form" in elem ) {
14989
14990 // Check for inherited disabledness on relevant non-disabled elements:
14991 // * listed form-associated elements in a disabled fieldset
14992 // https://html.spec.whatwg.org/multipage/forms.html#category-listed
14993 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
14994 // * option elements in a disabled optgroup
14995 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
14996 // All such elements have a "form" property.
14997 if ( elem.parentNode && elem.disabled === false ) {
14998
14999 // Option elements defer to a parent optgroup if present
15000 if ( "label" in elem ) {
15001 if ( "label" in elem.parentNode ) {
15002 return elem.parentNode.disabled === disabled;
15003 } else {
15004 return elem.disabled === disabled;
15005 }
15006 }
15007
15008 // Support: IE 6 - 11
15009 // Use the isDisabled shortcut property to check for disabled fieldset ancestors
15010 return elem.isDisabled === disabled ||
15011
15012 // Where there is no isDisabled, check manually
15013 /* jshint -W018 */
15014 elem.isDisabled !== !disabled &&
15015 disabledAncestor( elem ) === disabled;
15016 }
15017
15018 return elem.disabled === disabled;
15019
15020 // Try to winnow out elements that can't be disabled before trusting the disabled property.
15021 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
15022 // even exist on them, let alone have a boolean value.
15023 } else if ( "label" in elem ) {
15024 return elem.disabled === disabled;
15025 }
15026
15027 // Remaining elements are neither :enabled nor :disabled
15028 return false;
15029 };
15030}
15031
15032/**
15033 * Returns a function to use in pseudos for positionals
15034 * @param {Function} fn
15035 */
15036function createPositionalPseudo( fn ) {
15037 return markFunction(function( argument ) {
15038 argument = +argument;
15039 return markFunction(function( seed, matches ) {
15040 var j,
15041 matchIndexes = fn( [], seed.length, argument ),
15042 i = matchIndexes.length;
15043
15044 // Match elements found at the specified indexes
15045 while ( i-- ) {
15046 if ( seed[ (j = matchIndexes[i]) ] ) {
15047 seed[j] = !(matches[j] = seed[j]);
15048 }
15049 }
15050 });
15051 });
15052}
15053
15054/**
15055 * Checks a node for validity as a Sizzle context
15056 * @param {Element|Object=} context
15057 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
15058 */
15059function testContext( context ) {
15060 return context && typeof context.getElementsByTagName !== "undefined" && context;
15061}
15062
15063// Expose support vars for convenience
15064support = Sizzle.support = {};
15065
15066/**
15067 * Detects XML nodes
15068 * @param {Element|Object} elem An element or a document
15069 * @returns {Boolean} True iff elem is a non-HTML XML node
15070 */
15071isXML = Sizzle.isXML = function( elem ) {
15072 // documentElement is verified for cases where it doesn't yet exist
15073 // (such as loading iframes in IE - #4833)
15074 var documentElement = elem && (elem.ownerDocument || elem).documentElement;
15075 return documentElement ? documentElement.nodeName !== "HTML" : false;
15076};
15077
15078/**
15079 * Sets document-related variables once based on the current document
15080 * @param {Element|Object} [doc] An element or document object to use to set the document
15081 * @returns {Object} Returns the current document
15082 */
15083setDocument = Sizzle.setDocument = function( node ) {
15084 var hasCompare, subWindow,
15085 doc = node ? node.ownerDocument || node : preferredDoc;
15086
15087 // Return early if doc is invalid or already selected
15088 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
15089 return document;
15090 }
15091
15092 // Update global variables
15093 document = doc;
15094 docElem = document.documentElement;
15095 documentIsHTML = !isXML( document );
15096
15097 // Support: IE 9-11, Edge
15098 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
15099 if ( preferredDoc !== document &&
15100 (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
15101
15102 // Support: IE 11, Edge
15103 if ( subWindow.addEventListener ) {
15104 subWindow.addEventListener( "unload", unloadHandler, false );
15105
15106 // Support: IE 9 - 10 only
15107 } else if ( subWindow.attachEvent ) {
15108 subWindow.attachEvent( "onunload", unloadHandler );
15109 }
15110 }
15111
15112 /* Attributes
15113 ---------------------------------------------------------------------- */
15114
15115 // Support: IE<8
15116 // Verify that getAttribute really returns attributes and not properties
15117 // (excepting IE8 booleans)
15118 support.attributes = assert(function( el ) {
15119 el.className = "i";
15120 return !el.getAttribute("className");
15121 });
15122
15123 /* getElement(s)By*
15124 ---------------------------------------------------------------------- */
15125
15126 // Check if getElementsByTagName("*") returns only elements
15127 support.getElementsByTagName = assert(function( el ) {
15128 el.appendChild( document.createComment("") );
15129 return !el.getElementsByTagName("*").length;
15130 });
15131
15132 // Support: IE<9
15133 support.getElementsByClassName = rnative.test( document.getElementsByClassName );
15134
15135 // Support: IE<10
15136 // Check if getElementById returns elements by name
15137 // The broken getElementById methods don't pick up programmatically-set names,
15138 // so use a roundabout getElementsByName test
15139 support.getById = assert(function( el ) {
15140 docElem.appendChild( el ).id = expando;
15141 return !document.getElementsByName || !document.getElementsByName( expando ).length;
15142 });
15143
15144 // ID filter and find
15145 if ( support.getById ) {
15146 Expr.filter["ID"] = function( id ) {
15147 var attrId = id.replace( runescape, funescape );
15148 return function( elem ) {
15149 return elem.getAttribute("id") === attrId;
15150 };
15151 };
15152 Expr.find["ID"] = function( id, context ) {
15153 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
15154 var elem = context.getElementById( id );
15155 return elem ? [ elem ] : [];
15156 }
15157 };
15158 } else {
15159 Expr.filter["ID"] = function( id ) {
15160 var attrId = id.replace( runescape, funescape );
15161 return function( elem ) {
15162 var node = typeof elem.getAttributeNode !== "undefined" &&
15163 elem.getAttributeNode("id");
15164 return node && node.value === attrId;
15165 };
15166 };
15167
15168 // Support: IE 6 - 7 only
15169 // getElementById is not reliable as a find shortcut
15170 Expr.find["ID"] = function( id, context ) {
15171 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
15172 var node, i, elems,
15173 elem = context.getElementById( id );
15174
15175 if ( elem ) {
15176
15177 // Verify the id attribute
15178 node = elem.getAttributeNode("id");
15179 if ( node && node.value === id ) {
15180 return [ elem ];
15181 }
15182
15183 // Fall back on getElementsByName
15184 elems = context.getElementsByName( id );
15185 i = 0;
15186 while ( (elem = elems[i++]) ) {
15187 node = elem.getAttributeNode("id");
15188 if ( node && node.value === id ) {
15189 return [ elem ];
15190 }
15191 }
15192 }
15193
15194 return [];
15195 }
15196 };
15197 }
15198
15199 // Tag
15200 Expr.find["TAG"] = support.getElementsByTagName ?
15201 function( tag, context ) {
15202 if ( typeof context.getElementsByTagName !== "undefined" ) {
15203 return context.getElementsByTagName( tag );
15204
15205 // DocumentFragment nodes don't have gEBTN
15206 } else if ( support.qsa ) {
15207 return context.querySelectorAll( tag );
15208 }
15209 } :
15210
15211 function( tag, context ) {
15212 var elem,
15213 tmp = [],
15214 i = 0,
15215 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
15216 results = context.getElementsByTagName( tag );
15217
15218 // Filter out possible comments
15219 if ( tag === "*" ) {
15220 while ( (elem = results[i++]) ) {
15221 if ( elem.nodeType === 1 ) {
15222 tmp.push( elem );
15223 }
15224 }
15225
15226 return tmp;
15227 }
15228 return results;
15229 };
15230
15231 // Class
15232 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
15233 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
15234 return context.getElementsByClassName( className );
15235 }
15236 };
15237
15238 /* QSA/matchesSelector
15239 ---------------------------------------------------------------------- */
15240
15241 // QSA and matchesSelector support
15242
15243 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
15244 rbuggyMatches = [];
15245
15246 // qSa(:focus) reports false when true (Chrome 21)
15247 // We allow this because of a bug in IE8/9 that throws an error
15248 // whenever `document.activeElement` is accessed on an iframe
15249 // So, we allow :focus to pass through QSA all the time to avoid the IE error
15250 // See https://bugs.jquery.com/ticket/13378
15251 rbuggyQSA = [];
15252
15253 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
15254 // Build QSA regex
15255 // Regex strategy adopted from Diego Perini
15256 assert(function( el ) {
15257 // Select is set to empty string on purpose
15258 // This is to test IE's treatment of not explicitly
15259 // setting a boolean content attribute,
15260 // since its presence should be enough
15261 // https://bugs.jquery.com/ticket/12359
15262 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
15263 "<select id='" + expando + "-\r\\' msallowcapture=''>" +
15264 "<option selected=''></option></select>";
15265
15266 // Support: IE8, Opera 11-12.16
15267 // Nothing should be selected when empty strings follow ^= or $= or *=
15268 // The test attribute must be unknown in Opera but "safe" for WinRT
15269 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
15270 if ( el.querySelectorAll("[msallowcapture^='']").length ) {
15271 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
15272 }
15273
15274 // Support: IE8
15275 // Boolean attributes and "value" are not treated correctly
15276 if ( !el.querySelectorAll("[selected]").length ) {
15277 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
15278 }
15279
15280 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
15281 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
15282 rbuggyQSA.push("~=");
15283 }
15284
15285 // Webkit/Opera - :checked should return selected option elements
15286 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
15287 // IE8 throws error here and will not see later tests
15288 if ( !el.querySelectorAll(":checked").length ) {
15289 rbuggyQSA.push(":checked");
15290 }
15291
15292 // Support: Safari 8+, iOS 8+
15293 // https://bugs.webkit.org/show_bug.cgi?id=136851
15294 // In-page `selector#id sibling-combinator selector` fails
15295 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
15296 rbuggyQSA.push(".#.+[+~]");
15297 }
15298 });
15299
15300 assert(function( el ) {
15301 el.innerHTML = "<a href='' disabled='disabled'></a>" +
15302 "<select disabled='disabled'><option/></select>";
15303
15304 // Support: Windows 8 Native Apps
15305 // The type and name attributes are restricted during .innerHTML assignment
15306 var input = document.createElement("input");
15307 input.setAttribute( "type", "hidden" );
15308 el.appendChild( input ).setAttribute( "name", "D" );
15309
15310 // Support: IE8
15311 // Enforce case-sensitivity of name attribute
15312 if ( el.querySelectorAll("[name=d]").length ) {
15313 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
15314 }
15315
15316 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
15317 // IE8 throws error here and will not see later tests
15318 if ( el.querySelectorAll(":enabled").length !== 2 ) {
15319 rbuggyQSA.push( ":enabled", ":disabled" );
15320 }
15321
15322 // Support: IE9-11+
15323 // IE's :disabled selector does not pick up the children of disabled fieldsets
15324 docElem.appendChild( el ).disabled = true;
15325 if ( el.querySelectorAll(":disabled").length !== 2 ) {
15326 rbuggyQSA.push( ":enabled", ":disabled" );
15327 }
15328
15329 // Opera 10-11 does not throw on post-comma invalid pseudos
15330 el.querySelectorAll("*,:x");
15331 rbuggyQSA.push(",.*:");
15332 });
15333 }
15334
15335 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
15336 docElem.webkitMatchesSelector ||
15337 docElem.mozMatchesSelector ||
15338 docElem.oMatchesSelector ||
15339 docElem.msMatchesSelector) )) ) {
15340
15341 assert(function( el ) {
15342 // Check to see if it's possible to do matchesSelector
15343 // on a disconnected node (IE 9)
15344 support.disconnectedMatch = matches.call( el, "*" );
15345
15346 // This should fail with an exception
15347 // Gecko does not error, returns false instead
15348 matches.call( el, "[s!='']:x" );
15349 rbuggyMatches.push( "!=", pseudos );
15350 });
15351 }
15352
15353 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
15354 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
15355
15356 /* Contains
15357 ---------------------------------------------------------------------- */
15358 hasCompare = rnative.test( docElem.compareDocumentPosition );
15359
15360 // Element contains another
15361 // Purposefully self-exclusive
15362 // As in, an element does not contain itself
15363 contains = hasCompare || rnative.test( docElem.contains ) ?
15364 function( a, b ) {
15365 var adown = a.nodeType === 9 ? a.documentElement : a,
15366 bup = b && b.parentNode;
15367 return a === bup || !!( bup && bup.nodeType === 1 && (
15368 adown.contains ?
15369 adown.contains( bup ) :
15370 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
15371 ));
15372 } :
15373 function( a, b ) {
15374 if ( b ) {
15375 while ( (b = b.parentNode) ) {
15376 if ( b === a ) {
15377 return true;
15378 }
15379 }
15380 }
15381 return false;
15382 };
15383
15384 /* Sorting
15385 ---------------------------------------------------------------------- */
15386
15387 // Document order sorting
15388 sortOrder = hasCompare ?
15389 function( a, b ) {
15390
15391 // Flag for duplicate removal
15392 if ( a === b ) {
15393 hasDuplicate = true;
15394 return 0;
15395 }
15396
15397 // Sort on method existence if only one input has compareDocumentPosition
15398 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
15399 if ( compare ) {
15400 return compare;
15401 }
15402
15403 // Calculate position if both inputs belong to the same document
15404 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
15405 a.compareDocumentPosition( b ) :
15406
15407 // Otherwise we know they are disconnected
15408 1;
15409
15410 // Disconnected nodes
15411 if ( compare & 1 ||
15412 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
15413
15414 // Choose the first element that is related to our preferred document
15415 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
15416 return -1;
15417 }
15418 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
15419 return 1;
15420 }
15421
15422 // Maintain original order
15423 return sortInput ?
15424 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
15425 0;
15426 }
15427
15428 return compare & 4 ? -1 : 1;
15429 } :
15430 function( a, b ) {
15431 // Exit early if the nodes are identical
15432 if ( a === b ) {
15433 hasDuplicate = true;
15434 return 0;
15435 }
15436
15437 var cur,
15438 i = 0,
15439 aup = a.parentNode,
15440 bup = b.parentNode,
15441 ap = [ a ],
15442 bp = [ b ];
15443
15444 // Parentless nodes are either documents or disconnected
15445 if ( !aup || !bup ) {
15446 return a === document ? -1 :
15447 b === document ? 1 :
15448 aup ? -1 :
15449 bup ? 1 :
15450 sortInput ?
15451 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
15452 0;
15453
15454 // If the nodes are siblings, we can do a quick check
15455 } else if ( aup === bup ) {
15456 return siblingCheck( a, b );
15457 }
15458
15459 // Otherwise we need full lists of their ancestors for comparison
15460 cur = a;
15461 while ( (cur = cur.parentNode) ) {
15462 ap.unshift( cur );
15463 }
15464 cur = b;
15465 while ( (cur = cur.parentNode) ) {
15466 bp.unshift( cur );
15467 }
15468
15469 // Walk down the tree looking for a discrepancy
15470 while ( ap[i] === bp[i] ) {
15471 i++;
15472 }
15473
15474 return i ?
15475 // Do a sibling check if the nodes have a common ancestor
15476 siblingCheck( ap[i], bp[i] ) :
15477
15478 // Otherwise nodes in our document sort first
15479 ap[i] === preferredDoc ? -1 :
15480 bp[i] === preferredDoc ? 1 :
15481 0;
15482 };
15483
15484 return document;
15485};
15486
15487Sizzle.matches = function( expr, elements ) {
15488 return Sizzle( expr, null, null, elements );
15489};
15490
15491Sizzle.matchesSelector = function( elem, expr ) {
15492 // Set document vars if needed
15493 if ( ( elem.ownerDocument || elem ) !== document ) {
15494 setDocument( elem );
15495 }
15496
15497 // Make sure that attribute selectors are quoted
15498 expr = expr.replace( rattributeQuotes, "='$1']" );
15499
15500 if ( support.matchesSelector && documentIsHTML &&
15501 !compilerCache[ expr + " " ] &&
15502 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
15503 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
15504
15505 try {
15506 var ret = matches.call( elem, expr );
15507
15508 // IE 9's matchesSelector returns false on disconnected nodes
15509 if ( ret || support.disconnectedMatch ||
15510 // As well, disconnected nodes are said to be in a document
15511 // fragment in IE 9
15512 elem.document && elem.document.nodeType !== 11 ) {
15513 return ret;
15514 }
15515 } catch (e) {}
15516 }
15517
15518 return Sizzle( expr, document, null, [ elem ] ).length > 0;
15519};
15520
15521Sizzle.contains = function( context, elem ) {
15522 // Set document vars if needed
15523 if ( ( context.ownerDocument || context ) !== document ) {
15524 setDocument( context );
15525 }
15526 return contains( context, elem );
15527};
15528
15529Sizzle.attr = function( elem, name ) {
15530 // Set document vars if needed
15531 if ( ( elem.ownerDocument || elem ) !== document ) {
15532 setDocument( elem );
15533 }
15534
15535 var fn = Expr.attrHandle[ name.toLowerCase() ],
15536 // Don't get fooled by Object.prototype properties (jQuery #13807)
15537 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
15538 fn( elem, name, !documentIsHTML ) :
15539 undefined;
15540
15541 return val !== undefined ?
15542 val :
15543 support.attributes || !documentIsHTML ?
15544 elem.getAttribute( name ) :
15545 (val = elem.getAttributeNode(name)) && val.specified ?
15546 val.value :
15547 null;
15548};
15549
15550Sizzle.escape = function( sel ) {
15551 return (sel + "").replace( rcssescape, fcssescape );
15552};
15553
15554Sizzle.error = function( msg ) {
15555 throw new Error( "Syntax error, unrecognized expression: " + msg );
15556};
15557
15558/**
15559 * Document sorting and removing duplicates
15560 * @param {ArrayLike} results
15561 */
15562Sizzle.uniqueSort = function( results ) {
15563 var elem,
15564 duplicates = [],
15565 j = 0,
15566 i = 0;
15567
15568 // Unless we *know* we can detect duplicates, assume their presence
15569 hasDuplicate = !support.detectDuplicates;
15570 sortInput = !support.sortStable && results.slice( 0 );
15571 results.sort( sortOrder );
15572
15573 if ( hasDuplicate ) {
15574 while ( (elem = results[i++]) ) {
15575 if ( elem === results[ i ] ) {
15576 j = duplicates.push( i );
15577 }
15578 }
15579 while ( j-- ) {
15580 results.splice( duplicates[ j ], 1 );
15581 }
15582 }
15583
15584 // Clear input after sorting to release objects
15585 // See https://github.com/jquery/sizzle/pull/225
15586 sortInput = null;
15587
15588 return results;
15589};
15590
15591/**
15592 * Utility function for retrieving the text value of an array of DOM nodes
15593 * @param {Array|Element} elem
15594 */
15595getText = Sizzle.getText = function( elem ) {
15596 var node,
15597 ret = "",
15598 i = 0,
15599 nodeType = elem.nodeType;
15600
15601 if ( !nodeType ) {
15602 // If no nodeType, this is expected to be an array
15603 while ( (node = elem[i++]) ) {
15604 // Do not traverse comment nodes
15605 ret += getText( node );
15606 }
15607 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
15608 // Use textContent for elements
15609 // innerText usage removed for consistency of new lines (jQuery #11153)
15610 if ( typeof elem.textContent === "string" ) {
15611 return elem.textContent;
15612 } else {
15613 // Traverse its children
15614 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
15615 ret += getText( elem );
15616 }
15617 }
15618 } else if ( nodeType === 3 || nodeType === 4 ) {
15619 return elem.nodeValue;
15620 }
15621 // Do not include comment or processing instruction nodes
15622
15623 return ret;
15624};
15625
15626Expr = Sizzle.selectors = {
15627
15628 // Can be adjusted by the user
15629 cacheLength: 50,
15630
15631 createPseudo: markFunction,
15632
15633 match: matchExpr,
15634
15635 attrHandle: {},
15636
15637 find: {},
15638
15639 relative: {
15640 ">": { dir: "parentNode", first: true },
15641 " ": { dir: "parentNode" },
15642 "+": { dir: "previousSibling", first: true },
15643 "~": { dir: "previousSibling" }
15644 },
15645
15646 preFilter: {
15647 "ATTR": function( match ) {
15648 match[1] = match[1].replace( runescape, funescape );
15649
15650 // Move the given value to match[3] whether quoted or unquoted
15651 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
15652
15653 if ( match[2] === "~=" ) {
15654 match[3] = " " + match[3] + " ";
15655 }
15656
15657 return match.slice( 0, 4 );
15658 },
15659
15660 "CHILD": function( match ) {
15661 /* matches from matchExpr["CHILD"]
15662 1 type (only|nth|...)
15663 2 what (child|of-type)
15664 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
15665 4 xn-component of xn+y argument ([+-]?\d*n|)
15666 5 sign of xn-component
15667 6 x of xn-component
15668 7 sign of y-component
15669 8 y of y-component
15670 */
15671 match[1] = match[1].toLowerCase();
15672
15673 if ( match[1].slice( 0, 3 ) === "nth" ) {
15674 // nth-* requires argument
15675 if ( !match[3] ) {
15676 Sizzle.error( match[0] );
15677 }
15678
15679 // numeric x and y parameters for Expr.filter.CHILD
15680 // remember that false/true cast respectively to 0/1
15681 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
15682 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
15683
15684 // other types prohibit arguments
15685 } else if ( match[3] ) {
15686 Sizzle.error( match[0] );
15687 }
15688
15689 return match;
15690 },
15691
15692 "PSEUDO": function( match ) {
15693 var excess,
15694 unquoted = !match[6] && match[2];
15695
15696 if ( matchExpr["CHILD"].test( match[0] ) ) {
15697 return null;
15698 }
15699
15700 // Accept quoted arguments as-is
15701 if ( match[3] ) {
15702 match[2] = match[4] || match[5] || "";
15703
15704 // Strip excess characters from unquoted arguments
15705 } else if ( unquoted && rpseudo.test( unquoted ) &&
15706 // Get excess from tokenize (recursively)
15707 (excess = tokenize( unquoted, true )) &&
15708 // advance to the next closing parenthesis
15709 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
15710
15711 // excess is a negative index
15712 match[0] = match[0].slice( 0, excess );
15713 match[2] = unquoted.slice( 0, excess );
15714 }
15715
15716 // Return only captures needed by the pseudo filter method (type and argument)
15717 return match.slice( 0, 3 );
15718 }
15719 },
15720
15721 filter: {
15722
15723 "TAG": function( nodeNameSelector ) {
15724 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
15725 return nodeNameSelector === "*" ?
15726 function() { return true; } :
15727 function( elem ) {
15728 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
15729 };
15730 },
15731
15732 "CLASS": function( className ) {
15733 var pattern = classCache[ className + " " ];
15734
15735 return pattern ||
15736 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
15737 classCache( className, function( elem ) {
15738 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
15739 });
15740 },
15741
15742 "ATTR": function( name, operator, check ) {
15743 return function( elem ) {
15744 var result = Sizzle.attr( elem, name );
15745
15746 if ( result == null ) {
15747 return operator === "!=";
15748 }
15749 if ( !operator ) {
15750 return true;
15751 }
15752
15753 result += "";
15754
15755 return operator === "=" ? result === check :
15756 operator === "!=" ? result !== check :
15757 operator === "^=" ? check && result.indexOf( check ) === 0 :
15758 operator === "*=" ? check && result.indexOf( check ) > -1 :
15759 operator === "$=" ? check && result.slice( -check.length ) === check :
15760 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
15761 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
15762 false;
15763 };
15764 },
15765
15766 "CHILD": function( type, what, argument, first, last ) {
15767 var simple = type.slice( 0, 3 ) !== "nth",
15768 forward = type.slice( -4 ) !== "last",
15769 ofType = what === "of-type";
15770
15771 return first === 1 && last === 0 ?
15772
15773 // Shortcut for :nth-*(n)
15774 function( elem ) {
15775 return !!elem.parentNode;
15776 } :
15777
15778 function( elem, context, xml ) {
15779 var cache, uniqueCache, outerCache, node, nodeIndex, start,
15780 dir = simple !== forward ? "nextSibling" : "previousSibling",
15781 parent = elem.parentNode,
15782 name = ofType && elem.nodeName.toLowerCase(),
15783 useCache = !xml && !ofType,
15784 diff = false;
15785
15786 if ( parent ) {
15787
15788 // :(first|last|only)-(child|of-type)
15789 if ( simple ) {
15790 while ( dir ) {
15791 node = elem;
15792 while ( (node = node[ dir ]) ) {
15793 if ( ofType ?
15794 node.nodeName.toLowerCase() === name :
15795 node.nodeType === 1 ) {
15796
15797 return false;
15798 }
15799 }
15800 // Reverse direction for :only-* (if we haven't yet done so)
15801 start = dir = type === "only" && !start && "nextSibling";
15802 }
15803 return true;
15804 }
15805
15806 start = [ forward ? parent.firstChild : parent.lastChild ];
15807
15808 // non-xml :nth-child(...) stores cache data on `parent`
15809 if ( forward && useCache ) {
15810
15811 // Seek `elem` from a previously-cached index
15812
15813 // ...in a gzip-friendly way
15814 node = parent;
15815 outerCache = node[ expando ] || (node[ expando ] = {});
15816
15817 // Support: IE <9 only
15818 // Defend against cloned attroperties (jQuery gh-1709)
15819 uniqueCache = outerCache[ node.uniqueID ] ||
15820 (outerCache[ node.uniqueID ] = {});
15821
15822 cache = uniqueCache[ type ] || [];
15823 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
15824 diff = nodeIndex && cache[ 2 ];
15825 node = nodeIndex && parent.childNodes[ nodeIndex ];
15826
15827 while ( (node = ++nodeIndex && node && node[ dir ] ||
15828
15829 // Fallback to seeking `elem` from the start
15830 (diff = nodeIndex = 0) || start.pop()) ) {
15831
15832 // When found, cache indexes on `parent` and break
15833 if ( node.nodeType === 1 && ++diff && node === elem ) {
15834 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
15835 break;
15836 }
15837 }
15838
15839 } else {
15840 // Use previously-cached element index if available
15841 if ( useCache ) {
15842 // ...in a gzip-friendly way
15843 node = elem;
15844 outerCache = node[ expando ] || (node[ expando ] = {});
15845
15846 // Support: IE <9 only
15847 // Defend against cloned attroperties (jQuery gh-1709)
15848 uniqueCache = outerCache[ node.uniqueID ] ||
15849 (outerCache[ node.uniqueID ] = {});
15850
15851 cache = uniqueCache[ type ] || [];
15852 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
15853 diff = nodeIndex;
15854 }
15855
15856 // xml :nth-child(...)
15857 // or :nth-last-child(...) or :nth(-last)?-of-type(...)
15858 if ( diff === false ) {
15859 // Use the same loop as above to seek `elem` from the start
15860 while ( (node = ++nodeIndex && node && node[ dir ] ||
15861 (diff = nodeIndex = 0) || start.pop()) ) {
15862
15863 if ( ( ofType ?
15864 node.nodeName.toLowerCase() === name :
15865 node.nodeType === 1 ) &&
15866 ++diff ) {
15867
15868 // Cache the index of each encountered element
15869 if ( useCache ) {
15870 outerCache = node[ expando ] || (node[ expando ] = {});
15871
15872 // Support: IE <9 only
15873 // Defend against cloned attroperties (jQuery gh-1709)
15874 uniqueCache = outerCache[ node.uniqueID ] ||
15875 (outerCache[ node.uniqueID ] = {});
15876
15877 uniqueCache[ type ] = [ dirruns, diff ];
15878 }
15879
15880 if ( node === elem ) {
15881 break;
15882 }
15883 }
15884 }
15885 }
15886 }
15887
15888 // Incorporate the offset, then check against cycle size
15889 diff -= last;
15890 return diff === first || ( diff % first === 0 && diff / first >= 0 );
15891 }
15892 };
15893 },
15894
15895 "PSEUDO": function( pseudo, argument ) {
15896 // pseudo-class names are case-insensitive
15897 // http://www.w3.org/TR/selectors/#pseudo-classes
15898 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
15899 // Remember that setFilters inherits from pseudos
15900 var args,
15901 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
15902 Sizzle.error( "unsupported pseudo: " + pseudo );
15903
15904 // The user may use createPseudo to indicate that
15905 // arguments are needed to create the filter function
15906 // just as Sizzle does
15907 if ( fn[ expando ] ) {
15908 return fn( argument );
15909 }
15910
15911 // But maintain support for old signatures
15912 if ( fn.length > 1 ) {
15913 args = [ pseudo, pseudo, "", argument ];
15914 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
15915 markFunction(function( seed, matches ) {
15916 var idx,
15917 matched = fn( seed, argument ),
15918 i = matched.length;
15919 while ( i-- ) {
15920 idx = indexOf( seed, matched[i] );
15921 seed[ idx ] = !( matches[ idx ] = matched[i] );
15922 }
15923 }) :
15924 function( elem ) {
15925 return fn( elem, 0, args );
15926 };
15927 }
15928
15929 return fn;
15930 }
15931 },
15932
15933 pseudos: {
15934 // Potentially complex pseudos
15935 "not": markFunction(function( selector ) {
15936 // Trim the selector passed to compile
15937 // to avoid treating leading and trailing
15938 // spaces as combinators
15939 var input = [],
15940 results = [],
15941 matcher = compile( selector.replace( rtrim, "$1" ) );
15942
15943 return matcher[ expando ] ?
15944 markFunction(function( seed, matches, context, xml ) {
15945 var elem,
15946 unmatched = matcher( seed, null, xml, [] ),
15947 i = seed.length;
15948
15949 // Match elements unmatched by `matcher`
15950 while ( i-- ) {
15951 if ( (elem = unmatched[i]) ) {
15952 seed[i] = !(matches[i] = elem);
15953 }
15954 }
15955 }) :
15956 function( elem, context, xml ) {
15957 input[0] = elem;
15958 matcher( input, null, xml, results );
15959 // Don't keep the element (issue #299)
15960 input[0] = null;
15961 return !results.pop();
15962 };
15963 }),
15964
15965 "has": markFunction(function( selector ) {
15966 return function( elem ) {
15967 return Sizzle( selector, elem ).length > 0;
15968 };
15969 }),
15970
15971 "contains": markFunction(function( text ) {
15972 text = text.replace( runescape, funescape );
15973 return function( elem ) {
15974 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
15975 };
15976 }),
15977
15978 // "Whether an element is represented by a :lang() selector
15979 // is based solely on the element's language value
15980 // being equal to the identifier C,
15981 // or beginning with the identifier C immediately followed by "-".
15982 // The matching of C against the element's language value is performed case-insensitively.
15983 // The identifier C does not have to be a valid language name."
15984 // http://www.w3.org/TR/selectors/#lang-pseudo
15985 "lang": markFunction( function( lang ) {
15986 // lang value must be a valid identifier
15987 if ( !ridentifier.test(lang || "") ) {
15988 Sizzle.error( "unsupported lang: " + lang );
15989 }
15990 lang = lang.replace( runescape, funescape ).toLowerCase();
15991 return function( elem ) {
15992 var elemLang;
15993 do {
15994 if ( (elemLang = documentIsHTML ?
15995 elem.lang :
15996 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
15997
15998 elemLang = elemLang.toLowerCase();
15999 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
16000 }
16001 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
16002 return false;
16003 };
16004 }),
16005
16006 // Miscellaneous
16007 "target": function( elem ) {
16008 var hash = window.location && window.location.hash;
16009 return hash && hash.slice( 1 ) === elem.id;
16010 },
16011
16012 "root": function( elem ) {
16013 return elem === docElem;
16014 },
16015
16016 "focus": function( elem ) {
16017 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
16018 },
16019
16020 // Boolean properties
16021 "enabled": createDisabledPseudo( false ),
16022 "disabled": createDisabledPseudo( true ),
16023
16024 "checked": function( elem ) {
16025 // In CSS3, :checked should return both checked and selected elements
16026 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
16027 var nodeName = elem.nodeName.toLowerCase();
16028 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
16029 },
16030
16031 "selected": function( elem ) {
16032 // Accessing this property makes selected-by-default
16033 // options in Safari work properly
16034 if ( elem.parentNode ) {
16035 elem.parentNode.selectedIndex;
16036 }
16037
16038 return elem.selected === true;
16039 },
16040
16041 // Contents
16042 "empty": function( elem ) {
16043 // http://www.w3.org/TR/selectors/#empty-pseudo
16044 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
16045 // but not by others (comment: 8; processing instruction: 7; etc.)
16046 // nodeType < 6 works because attributes (2) do not appear as children
16047 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
16048 if ( elem.nodeType < 6 ) {
16049 return false;
16050 }
16051 }
16052 return true;
16053 },
16054
16055 "parent": function( elem ) {
16056 return !Expr.pseudos["empty"]( elem );
16057 },
16058
16059 // Element/input types
16060 "header": function( elem ) {
16061 return rheader.test( elem.nodeName );
16062 },
16063
16064 "input": function( elem ) {
16065 return rinputs.test( elem.nodeName );
16066 },
16067
16068 "button": function( elem ) {
16069 var name = elem.nodeName.toLowerCase();
16070 return name === "input" && elem.type === "button" || name === "button";
16071 },
16072
16073 "text": function( elem ) {
16074 var attr;
16075 return elem.nodeName.toLowerCase() === "input" &&
16076 elem.type === "text" &&
16077
16078 // Support: IE<8
16079 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
16080 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
16081 },
16082
16083 // Position-in-collection
16084 "first": createPositionalPseudo(function() {
16085 return [ 0 ];
16086 }),
16087
16088 "last": createPositionalPseudo(function( matchIndexes, length ) {
16089 return [ length - 1 ];
16090 }),
16091
16092 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
16093 return [ argument < 0 ? argument + length : argument ];
16094 }),
16095
16096 "even": createPositionalPseudo(function( matchIndexes, length ) {
16097 var i = 0;
16098 for ( ; i < length; i += 2 ) {
16099 matchIndexes.push( i );
16100 }
16101 return matchIndexes;
16102 }),
16103
16104 "odd": createPositionalPseudo(function( matchIndexes, length ) {
16105 var i = 1;
16106 for ( ; i < length; i += 2 ) {
16107 matchIndexes.push( i );
16108 }
16109 return matchIndexes;
16110 }),
16111
16112 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
16113 var i = argument < 0 ? argument + length : argument;
16114 for ( ; --i >= 0; ) {
16115 matchIndexes.push( i );
16116 }
16117 return matchIndexes;
16118 }),
16119
16120 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
16121 var i = argument < 0 ? argument + length : argument;
16122 for ( ; ++i < length; ) {
16123 matchIndexes.push( i );
16124 }
16125 return matchIndexes;
16126 })
16127 }
16128};
16129
16130Expr.pseudos["nth"] = Expr.pseudos["eq"];
16131
16132// Add button/input type pseudos
16133for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
16134 Expr.pseudos[ i ] = createInputPseudo( i );
16135}
16136for ( i in { submit: true, reset: true } ) {
16137 Expr.pseudos[ i ] = createButtonPseudo( i );
16138}
16139
16140// Easy API for creating new setFilters
16141function setFilters() {}
16142setFilters.prototype = Expr.filters = Expr.pseudos;
16143Expr.setFilters = new setFilters();
16144
16145tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
16146 var matched, match, tokens, type,
16147 soFar, groups, preFilters,
16148 cached = tokenCache[ selector + " " ];
16149
16150 if ( cached ) {
16151 return parseOnly ? 0 : cached.slice( 0 );
16152 }
16153
16154 soFar = selector;
16155 groups = [];
16156 preFilters = Expr.preFilter;
16157
16158 while ( soFar ) {
16159
16160 // Comma and first run
16161 if ( !matched || (match = rcomma.exec( soFar )) ) {
16162 if ( match ) {
16163 // Don't consume trailing commas as valid
16164 soFar = soFar.slice( match[0].length ) || soFar;
16165 }
16166 groups.push( (tokens = []) );
16167 }
16168
16169 matched = false;
16170
16171 // Combinators
16172 if ( (match = rcombinators.exec( soFar )) ) {
16173 matched = match.shift();
16174 tokens.push({
16175 value: matched,
16176 // Cast descendant combinators to space
16177 type: match[0].replace( rtrim, " " )
16178 });
16179 soFar = soFar.slice( matched.length );
16180 }
16181
16182 // Filters
16183 for ( type in Expr.filter ) {
16184 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
16185 (match = preFilters[ type ]( match ))) ) {
16186 matched = match.shift();
16187 tokens.push({
16188 value: matched,
16189 type: type,
16190 matches: match
16191 });
16192 soFar = soFar.slice( matched.length );
16193 }
16194 }
16195
16196 if ( !matched ) {
16197 break;
16198 }
16199 }
16200
16201 // Return the length of the invalid excess
16202 // if we're just parsing
16203 // Otherwise, throw an error or return tokens
16204 return parseOnly ?
16205 soFar.length :
16206 soFar ?
16207 Sizzle.error( selector ) :
16208 // Cache the tokens
16209 tokenCache( selector, groups ).slice( 0 );
16210};
16211
16212function toSelector( tokens ) {
16213 var i = 0,
16214 len = tokens.length,
16215 selector = "";
16216 for ( ; i < len; i++ ) {
16217 selector += tokens[i].value;
16218 }
16219 return selector;
16220}
16221
16222function addCombinator( matcher, combinator, base ) {
16223 var dir = combinator.dir,
16224 skip = combinator.next,
16225 key = skip || dir,
16226 checkNonElements = base && key === "parentNode",
16227 doneName = done++;
16228
16229 return combinator.first ?
16230 // Check against closest ancestor/preceding element
16231 function( elem, context, xml ) {
16232 while ( (elem = elem[ dir ]) ) {
16233 if ( elem.nodeType === 1 || checkNonElements ) {
16234 return matcher( elem, context, xml );
16235 }
16236 }
16237 return false;
16238 } :
16239
16240 // Check against all ancestor/preceding elements
16241 function( elem, context, xml ) {
16242 var oldCache, uniqueCache, outerCache,
16243 newCache = [ dirruns, doneName ];
16244
16245 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
16246 if ( xml ) {
16247 while ( (elem = elem[ dir ]) ) {
16248 if ( elem.nodeType === 1 || checkNonElements ) {
16249 if ( matcher( elem, context, xml ) ) {
16250 return true;
16251 }
16252 }
16253 }
16254 } else {
16255 while ( (elem = elem[ dir ]) ) {
16256 if ( elem.nodeType === 1 || checkNonElements ) {
16257 outerCache = elem[ expando ] || (elem[ expando ] = {});
16258
16259 // Support: IE <9 only
16260 // Defend against cloned attroperties (jQuery gh-1709)
16261 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
16262
16263 if ( skip && skip === elem.nodeName.toLowerCase() ) {
16264 elem = elem[ dir ] || elem;
16265 } else if ( (oldCache = uniqueCache[ key ]) &&
16266 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
16267
16268 // Assign to newCache so results back-propagate to previous elements
16269 return (newCache[ 2 ] = oldCache[ 2 ]);
16270 } else {
16271 // Reuse newcache so results back-propagate to previous elements
16272 uniqueCache[ key ] = newCache;
16273
16274 // A match means we're done; a fail means we have to keep checking
16275 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
16276 return true;
16277 }
16278 }
16279 }
16280 }
16281 }
16282 return false;
16283 };
16284}
16285
16286function elementMatcher( matchers ) {
16287 return matchers.length > 1 ?
16288 function( elem, context, xml ) {
16289 var i = matchers.length;
16290 while ( i-- ) {
16291 if ( !matchers[i]( elem, context, xml ) ) {
16292 return false;
16293 }
16294 }
16295 return true;
16296 } :
16297 matchers[0];
16298}
16299
16300function multipleContexts( selector, contexts, results ) {
16301 var i = 0,
16302 len = contexts.length;
16303 for ( ; i < len; i++ ) {
16304 Sizzle( selector, contexts[i], results );
16305 }
16306 return results;
16307}
16308
16309function condense( unmatched, map, filter, context, xml ) {
16310 var elem,
16311 newUnmatched = [],
16312 i = 0,
16313 len = unmatched.length,
16314 mapped = map != null;
16315
16316 for ( ; i < len; i++ ) {
16317 if ( (elem = unmatched[i]) ) {
16318 if ( !filter || filter( elem, context, xml ) ) {
16319 newUnmatched.push( elem );
16320 if ( mapped ) {
16321 map.push( i );
16322 }
16323 }
16324 }
16325 }
16326
16327 return newUnmatched;
16328}
16329
16330function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
16331 if ( postFilter && !postFilter[ expando ] ) {
16332 postFilter = setMatcher( postFilter );
16333 }
16334 if ( postFinder && !postFinder[ expando ] ) {
16335 postFinder = setMatcher( postFinder, postSelector );
16336 }
16337 return markFunction(function( seed, results, context, xml ) {
16338 var temp, i, elem,
16339 preMap = [],
16340 postMap = [],
16341 preexisting = results.length,
16342
16343 // Get initial elements from seed or context
16344 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
16345
16346 // Prefilter to get matcher input, preserving a map for seed-results synchronization
16347 matcherIn = preFilter && ( seed || !selector ) ?
16348 condense( elems, preMap, preFilter, context, xml ) :
16349 elems,
16350
16351 matcherOut = matcher ?
16352 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
16353 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
16354
16355 // ...intermediate processing is necessary
16356 [] :
16357
16358 // ...otherwise use results directly
16359 results :
16360 matcherIn;
16361
16362 // Find primary matches
16363 if ( matcher ) {
16364 matcher( matcherIn, matcherOut, context, xml );
16365 }
16366
16367 // Apply postFilter
16368 if ( postFilter ) {
16369 temp = condense( matcherOut, postMap );
16370 postFilter( temp, [], context, xml );
16371
16372 // Un-match failing elements by moving them back to matcherIn
16373 i = temp.length;
16374 while ( i-- ) {
16375 if ( (elem = temp[i]) ) {
16376 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
16377 }
16378 }
16379 }
16380
16381 if ( seed ) {
16382 if ( postFinder || preFilter ) {
16383 if ( postFinder ) {
16384 // Get the final matcherOut by condensing this intermediate into postFinder contexts
16385 temp = [];
16386 i = matcherOut.length;
16387 while ( i-- ) {
16388 if ( (elem = matcherOut[i]) ) {
16389 // Restore matcherIn since elem is not yet a final match
16390 temp.push( (matcherIn[i] = elem) );
16391 }
16392 }
16393 postFinder( null, (matcherOut = []), temp, xml );
16394 }
16395
16396 // Move matched elements from seed to results to keep them synchronized
16397 i = matcherOut.length;
16398 while ( i-- ) {
16399 if ( (elem = matcherOut[i]) &&
16400 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
16401
16402 seed[temp] = !(results[temp] = elem);
16403 }
16404 }
16405 }
16406
16407 // Add elements to results, through postFinder if defined
16408 } else {
16409 matcherOut = condense(
16410 matcherOut === results ?
16411 matcherOut.splice( preexisting, matcherOut.length ) :
16412 matcherOut
16413 );
16414 if ( postFinder ) {
16415 postFinder( null, results, matcherOut, xml );
16416 } else {
16417 push.apply( results, matcherOut );
16418 }
16419 }
16420 });
16421}
16422
16423function matcherFromTokens( tokens ) {
16424 var checkContext, matcher, j,
16425 len = tokens.length,
16426 leadingRelative = Expr.relative[ tokens[0].type ],
16427 implicitRelative = leadingRelative || Expr.relative[" "],
16428 i = leadingRelative ? 1 : 0,
16429
16430 // The foundational matcher ensures that elements are reachable from top-level context(s)
16431 matchContext = addCombinator( function( elem ) {
16432 return elem === checkContext;
16433 }, implicitRelative, true ),
16434 matchAnyContext = addCombinator( function( elem ) {
16435 return indexOf( checkContext, elem ) > -1;
16436 }, implicitRelative, true ),
16437 matchers = [ function( elem, context, xml ) {
16438 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
16439 (checkContext = context).nodeType ?
16440 matchContext( elem, context, xml ) :
16441 matchAnyContext( elem, context, xml ) );
16442 // Avoid hanging onto element (issue #299)
16443 checkContext = null;
16444 return ret;
16445 } ];
16446
16447 for ( ; i < len; i++ ) {
16448 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
16449 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
16450 } else {
16451 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
16452
16453 // Return special upon seeing a positional matcher
16454 if ( matcher[ expando ] ) {
16455 // Find the next relative operator (if any) for proper handling
16456 j = ++i;
16457 for ( ; j < len; j++ ) {
16458 if ( Expr.relative[ tokens[j].type ] ) {
16459 break;
16460 }
16461 }
16462 return setMatcher(
16463 i > 1 && elementMatcher( matchers ),
16464 i > 1 && toSelector(
16465 // If the preceding token was a descendant combinator, insert an implicit any-element `*`
16466 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
16467 ).replace( rtrim, "$1" ),
16468 matcher,
16469 i < j && matcherFromTokens( tokens.slice( i, j ) ),
16470 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
16471 j < len && toSelector( tokens )
16472 );
16473 }
16474 matchers.push( matcher );
16475 }
16476 }
16477
16478 return elementMatcher( matchers );
16479}
16480
16481function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
16482 var bySet = setMatchers.length > 0,
16483 byElement = elementMatchers.length > 0,
16484 superMatcher = function( seed, context, xml, results, outermost ) {
16485 var elem, j, matcher,
16486 matchedCount = 0,
16487 i = "0",
16488 unmatched = seed && [],
16489 setMatched = [],
16490 contextBackup = outermostContext,
16491 // We must always have either seed elements or outermost context
16492 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
16493 // Use integer dirruns iff this is the outermost matcher
16494 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
16495 len = elems.length;
16496
16497 if ( outermost ) {
16498 outermostContext = context === document || context || outermost;
16499 }
16500
16501 // Add elements passing elementMatchers directly to results
16502 // Support: IE<9, Safari
16503 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
16504 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
16505 if ( byElement && elem ) {
16506 j = 0;
16507 if ( !context && elem.ownerDocument !== document ) {
16508 setDocument( elem );
16509 xml = !documentIsHTML;
16510 }
16511 while ( (matcher = elementMatchers[j++]) ) {
16512 if ( matcher( elem, context || document, xml) ) {
16513 results.push( elem );
16514 break;
16515 }
16516 }
16517 if ( outermost ) {
16518 dirruns = dirrunsUnique;
16519 }
16520 }
16521
16522 // Track unmatched elements for set filters
16523 if ( bySet ) {
16524 // They will have gone through all possible matchers
16525 if ( (elem = !matcher && elem) ) {
16526 matchedCount--;
16527 }
16528
16529 // Lengthen the array for every element, matched or not
16530 if ( seed ) {
16531 unmatched.push( elem );
16532 }
16533 }
16534 }
16535
16536 // `i` is now the count of elements visited above, and adding it to `matchedCount`
16537 // makes the latter nonnegative.
16538 matchedCount += i;
16539
16540 // Apply set filters to unmatched elements
16541 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
16542 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
16543 // no element matchers and no seed.
16544 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
16545 // case, which will result in a "00" `matchedCount` that differs from `i` but is also
16546 // numerically zero.
16547 if ( bySet && i !== matchedCount ) {
16548 j = 0;
16549 while ( (matcher = setMatchers[j++]) ) {
16550 matcher( unmatched, setMatched, context, xml );
16551 }
16552
16553 if ( seed ) {
16554 // Reintegrate element matches to eliminate the need for sorting
16555 if ( matchedCount > 0 ) {
16556 while ( i-- ) {
16557 if ( !(unmatched[i] || setMatched[i]) ) {
16558 setMatched[i] = pop.call( results );
16559 }
16560 }
16561 }
16562
16563 // Discard index placeholder values to get only actual matches
16564 setMatched = condense( setMatched );
16565 }
16566
16567 // Add matches to results
16568 push.apply( results, setMatched );
16569
16570 // Seedless set matches succeeding multiple successful matchers stipulate sorting
16571 if ( outermost && !seed && setMatched.length > 0 &&
16572 ( matchedCount + setMatchers.length ) > 1 ) {
16573
16574 Sizzle.uniqueSort( results );
16575 }
16576 }
16577
16578 // Override manipulation of globals by nested matchers
16579 if ( outermost ) {
16580 dirruns = dirrunsUnique;
16581 outermostContext = contextBackup;
16582 }
16583
16584 return unmatched;
16585 };
16586
16587 return bySet ?
16588 markFunction( superMatcher ) :
16589 superMatcher;
16590}
16591
16592compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
16593 var i,
16594 setMatchers = [],
16595 elementMatchers = [],
16596 cached = compilerCache[ selector + " " ];
16597
16598 if ( !cached ) {
16599 // Generate a function of recursive functions that can be used to check each element
16600 if ( !match ) {
16601 match = tokenize( selector );
16602 }
16603 i = match.length;
16604 while ( i-- ) {
16605 cached = matcherFromTokens( match[i] );
16606 if ( cached[ expando ] ) {
16607 setMatchers.push( cached );
16608 } else {
16609 elementMatchers.push( cached );
16610 }
16611 }
16612
16613 // Cache the compiled function
16614 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
16615
16616 // Save selector and tokenization
16617 cached.selector = selector;
16618 }
16619 return cached;
16620};
16621
16622/**
16623 * A low-level selection function that works with Sizzle's compiled
16624 * selector functions
16625 * @param {String|Function} selector A selector or a pre-compiled
16626 * selector function built with Sizzle.compile
16627 * @param {Element} context
16628 * @param {Array} [results]
16629 * @param {Array} [seed] A set of elements to match against
16630 */
16631select = Sizzle.select = function( selector, context, results, seed ) {
16632 var i, tokens, token, type, find,
16633 compiled = typeof selector === "function" && selector,
16634 match = !seed && tokenize( (selector = compiled.selector || selector) );
16635
16636 results = results || [];
16637
16638 // Try to minimize operations if there is only one selector in the list and no seed
16639 // (the latter of which guarantees us context)
16640 if ( match.length === 1 ) {
16641
16642 // Reduce context if the leading compound selector is an ID
16643 tokens = match[0] = match[0].slice( 0 );
16644 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
16645 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
16646
16647 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
16648 if ( !context ) {
16649 return results;
16650
16651 // Precompiled matchers will still verify ancestry, so step up a level
16652 } else if ( compiled ) {
16653 context = context.parentNode;
16654 }
16655
16656 selector = selector.slice( tokens.shift().value.length );
16657 }
16658
16659 // Fetch a seed set for right-to-left matching
16660 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
16661 while ( i-- ) {
16662 token = tokens[i];
16663
16664 // Abort if we hit a combinator
16665 if ( Expr.relative[ (type = token.type) ] ) {
16666 break;
16667 }
16668 if ( (find = Expr.find[ type ]) ) {
16669 // Search, expanding context for leading sibling combinators
16670 if ( (seed = find(
16671 token.matches[0].replace( runescape, funescape ),
16672 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
16673 )) ) {
16674
16675 // If seed is empty or no tokens remain, we can return early
16676 tokens.splice( i, 1 );
16677 selector = seed.length && toSelector( tokens );
16678 if ( !selector ) {
16679 push.apply( results, seed );
16680 return results;
16681 }
16682
16683 break;
16684 }
16685 }
16686 }
16687 }
16688
16689 // Compile and execute a filtering function if one is not provided
16690 // Provide `match` to avoid retokenization if we modified the selector above
16691 ( compiled || compile( selector, match ) )(
16692 seed,
16693 context,
16694 !documentIsHTML,
16695 results,
16696 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
16697 );
16698 return results;
16699};
16700
16701// One-time assignments
16702
16703// Sort stability
16704support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
16705
16706// Support: Chrome 14-35+
16707// Always assume duplicates if they aren't passed to the comparison function
16708support.detectDuplicates = !!hasDuplicate;
16709
16710// Initialize against the default document
16711setDocument();
16712
16713// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
16714// Detached nodes confoundingly follow *each other*
16715support.sortDetached = assert(function( el ) {
16716 // Should return 1, but returns 4 (following)
16717 return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
16718});
16719
16720// Support: IE<8
16721// Prevent attribute/property "interpolation"
16722// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
16723if ( !assert(function( el ) {
16724 el.innerHTML = "<a href='#'></a>";
16725 return el.firstChild.getAttribute("href") === "#" ;
16726}) ) {
16727 addHandle( "type|href|height|width", function( elem, name, isXML ) {
16728 if ( !isXML ) {
16729 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
16730 }
16731 });
16732}
16733
16734// Support: IE<9
16735// Use defaultValue in place of getAttribute("value")
16736if ( !support.attributes || !assert(function( el ) {
16737 el.innerHTML = "<input/>";
16738 el.firstChild.setAttribute( "value", "" );
16739 return el.firstChild.getAttribute( "value" ) === "";
16740}) ) {
16741 addHandle( "value", function( elem, name, isXML ) {
16742 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
16743 return elem.defaultValue;
16744 }
16745 });
16746}
16747
16748// Support: IE<9
16749// Use getAttributeNode to fetch booleans when getAttribute lies
16750if ( !assert(function( el ) {
16751 return el.getAttribute("disabled") == null;
16752}) ) {
16753 addHandle( booleans, function( elem, name, isXML ) {
16754 var val;
16755 if ( !isXML ) {
16756 return elem[ name ] === true ? name.toLowerCase() :
16757 (val = elem.getAttributeNode( name )) && val.specified ?
16758 val.value :
16759 null;
16760 }
16761 });
16762}
16763
16764return Sizzle;
16765
16766})( window );
16767
16768
16769
16770jQuery.find = Sizzle;
16771jQuery.expr = Sizzle.selectors;
16772
16773// Deprecated
16774jQuery.expr[ ":" ] = jQuery.expr.pseudos;
16775jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
16776jQuery.text = Sizzle.getText;
16777jQuery.isXMLDoc = Sizzle.isXML;
16778jQuery.contains = Sizzle.contains;
16779jQuery.escapeSelector = Sizzle.escape;
16780
16781
16782
16783
16784var dir = function( elem, dir, until ) {
16785 var matched = [],
16786 truncate = until !== undefined;
16787
16788 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
16789 if ( elem.nodeType === 1 ) {
16790 if ( truncate && jQuery( elem ).is( until ) ) {
16791 break;
16792 }
16793 matched.push( elem );
16794 }
16795 }
16796 return matched;
16797};
16798
16799
16800var siblings = function( n, elem ) {
16801 var matched = [];
16802
16803 for ( ; n; n = n.nextSibling ) {
16804 if ( n.nodeType === 1 && n !== elem ) {
16805 matched.push( n );
16806 }
16807 }
16808
16809 return matched;
16810};
16811
16812
16813var rneedsContext = jQuery.expr.match.needsContext;
16814
16815
16816
16817function nodeName( elem, name ) {
16818
16819 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
16820
16821};
16822var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
16823
16824
16825
16826var risSimple = /^.[^:#\[\.,]*$/;
16827
16828// Implement the identical functionality for filter and not
16829function winnow( elements, qualifier, not ) {
16830 if ( jQuery.isFunction( qualifier ) ) {
16831 return jQuery.grep( elements, function( elem, i ) {
16832 return !!qualifier.call( elem, i, elem ) !== not;
16833 } );
16834 }
16835
16836 // Single element
16837 if ( qualifier.nodeType ) {
16838 return jQuery.grep( elements, function( elem ) {
16839 return ( elem === qualifier ) !== not;
16840 } );
16841 }
16842
16843 // Arraylike of elements (jQuery, arguments, Array)
16844 if ( typeof qualifier !== "string" ) {
16845 return jQuery.grep( elements, function( elem ) {
16846 return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
16847 } );
16848 }
16849
16850 // Simple selector that can be filtered directly, removing non-Elements
16851 if ( risSimple.test( qualifier ) ) {
16852 return jQuery.filter( qualifier, elements, not );
16853 }
16854
16855 // Complex selector, compare the two sets, removing non-Elements
16856 qualifier = jQuery.filter( qualifier, elements );
16857 return jQuery.grep( elements, function( elem ) {
16858 return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
16859 } );
16860}
16861
16862jQuery.filter = function( expr, elems, not ) {
16863 var elem = elems[ 0 ];
16864
16865 if ( not ) {
16866 expr = ":not(" + expr + ")";
16867 }
16868
16869 if ( elems.length === 1 && elem.nodeType === 1 ) {
16870 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
16871 }
16872
16873 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
16874 return elem.nodeType === 1;
16875 } ) );
16876};
16877
16878jQuery.fn.extend( {
16879 find: function( selector ) {
16880 var i, ret,
16881 len = this.length,
16882 self = this;
16883
16884 if ( typeof selector !== "string" ) {
16885 return this.pushStack( jQuery( selector ).filter( function() {
16886 for ( i = 0; i < len; i++ ) {
16887 if ( jQuery.contains( self[ i ], this ) ) {
16888 return true;
16889 }
16890 }
16891 } ) );
16892 }
16893
16894 ret = this.pushStack( [] );
16895
16896 for ( i = 0; i < len; i++ ) {
16897 jQuery.find( selector, self[ i ], ret );
16898 }
16899
16900 return len > 1 ? jQuery.uniqueSort( ret ) : ret;
16901 },
16902 filter: function( selector ) {
16903 return this.pushStack( winnow( this, selector || [], false ) );
16904 },
16905 not: function( selector ) {
16906 return this.pushStack( winnow( this, selector || [], true ) );
16907 },
16908 is: function( selector ) {
16909 return !!winnow(
16910 this,
16911
16912 // If this is a positional/relative selector, check membership in the returned set
16913 // so $("p:first").is("p:last") won't return true for a doc with two "p".
16914 typeof selector === "string" && rneedsContext.test( selector ) ?
16915 jQuery( selector ) :
16916 selector || [],
16917 false
16918 ).length;
16919 }
16920} );
16921
16922
16923// Initialize a jQuery object
16924
16925
16926// A central reference to the root jQuery(document)
16927var rootjQuery,
16928
16929 // A simple way to check for HTML strings
16930 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
16931 // Strict HTML recognition (#11290: must start with <)
16932 // Shortcut simple #id case for speed
16933 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
16934
16935 init = jQuery.fn.init = function( selector, context, root ) {
16936 var match, elem;
16937
16938 // HANDLE: $(""), $(null), $(undefined), $(false)
16939 if ( !selector ) {
16940 return this;
16941 }
16942
16943 // Method init() accepts an alternate rootjQuery
16944 // so migrate can support jQuery.sub (gh-2101)
16945 root = root || rootjQuery;
16946
16947 // Handle HTML strings
16948 if ( typeof selector === "string" ) {
16949 if ( selector[ 0 ] === "<" &&
16950 selector[ selector.length - 1 ] === ">" &&
16951 selector.length >= 3 ) {
16952
16953 // Assume that strings that start and end with <> are HTML and skip the regex check
16954 match = [ null, selector, null ];
16955
16956 } else {
16957 match = rquickExpr.exec( selector );
16958 }
16959
16960 // Match html or make sure no context is specified for #id
16961 if ( match && ( match[ 1 ] || !context ) ) {
16962
16963 // HANDLE: $(html) -> $(array)
16964 if ( match[ 1 ] ) {
16965 context = context instanceof jQuery ? context[ 0 ] : context;
16966
16967 // Option to run scripts is true for back-compat
16968 // Intentionally let the error be thrown if parseHTML is not present
16969 jQuery.merge( this, jQuery.parseHTML(
16970 match[ 1 ],
16971 context && context.nodeType ? context.ownerDocument || context : document,
16972 true
16973 ) );
16974
16975 // HANDLE: $(html, props)
16976 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
16977 for ( match in context ) {
16978
16979 // Properties of context are called as methods if possible
16980 if ( jQuery.isFunction( this[ match ] ) ) {
16981 this[ match ]( context[ match ] );
16982
16983 // ...and otherwise set as attributes
16984 } else {
16985 this.attr( match, context[ match ] );
16986 }
16987 }
16988 }
16989
16990 return this;
16991
16992 // HANDLE: $(#id)
16993 } else {
16994 elem = document.getElementById( match[ 2 ] );
16995
16996 if ( elem ) {
16997
16998 // Inject the element directly into the jQuery object
16999 this[ 0 ] = elem;
17000 this.length = 1;
17001 }
17002 return this;
17003 }
17004
17005 // HANDLE: $(expr, $(...))
17006 } else if ( !context || context.jquery ) {
17007 return ( context || root ).find( selector );
17008
17009 // HANDLE: $(expr, context)
17010 // (which is just equivalent to: $(context).find(expr)
17011 } else {
17012 return this.constructor( context ).find( selector );
17013 }
17014
17015 // HANDLE: $(DOMElement)
17016 } else if ( selector.nodeType ) {
17017 this[ 0 ] = selector;
17018 this.length = 1;
17019 return this;
17020
17021 // HANDLE: $(function)
17022 // Shortcut for document ready
17023 } else if ( jQuery.isFunction( selector ) ) {
17024 return root.ready !== undefined ?
17025 root.ready( selector ) :
17026
17027 // Execute immediately if ready is not present
17028 selector( jQuery );
17029 }
17030
17031 return jQuery.makeArray( selector, this );
17032 };
17033
17034// Give the init function the jQuery prototype for later instantiation
17035init.prototype = jQuery.fn;
17036
17037// Initialize central reference
17038rootjQuery = jQuery( document );
17039
17040
17041var rparentsprev = /^(?:parents|prev(?:Until|All))/,
17042
17043 // Methods guaranteed to produce a unique set when starting from a unique set
17044 guaranteedUnique = {
17045 children: true,
17046 contents: true,
17047 next: true,
17048 prev: true
17049 };
17050
17051jQuery.fn.extend( {
17052 has: function( target ) {
17053 var targets = jQuery( target, this ),
17054 l = targets.length;
17055
17056 return this.filter( function() {
17057 var i = 0;
17058 for ( ; i < l; i++ ) {
17059 if ( jQuery.contains( this, targets[ i ] ) ) {
17060 return true;
17061 }
17062 }
17063 } );
17064 },
17065
17066 closest: function( selectors, context ) {
17067 var cur,
17068 i = 0,
17069 l = this.length,
17070 matched = [],
17071 targets = typeof selectors !== "string" && jQuery( selectors );
17072
17073 // Positional selectors never match, since there's no _selection_ context
17074 if ( !rneedsContext.test( selectors ) ) {
17075 for ( ; i < l; i++ ) {
17076 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
17077
17078 // Always skip document fragments
17079 if ( cur.nodeType < 11 && ( targets ?
17080 targets.index( cur ) > -1 :
17081
17082 // Don't pass non-elements to Sizzle
17083 cur.nodeType === 1 &&
17084 jQuery.find.matchesSelector( cur, selectors ) ) ) {
17085
17086 matched.push( cur );
17087 break;
17088 }
17089 }
17090 }
17091 }
17092
17093 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
17094 },
17095
17096 // Determine the position of an element within the set
17097 index: function( elem ) {
17098
17099 // No argument, return index in parent
17100 if ( !elem ) {
17101 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
17102 }
17103
17104 // Index in selector
17105 if ( typeof elem === "string" ) {
17106 return indexOf.call( jQuery( elem ), this[ 0 ] );
17107 }
17108
17109 // Locate the position of the desired element
17110 return indexOf.call( this,
17111
17112 // If it receives a jQuery object, the first element is used
17113 elem.jquery ? elem[ 0 ] : elem
17114 );
17115 },
17116
17117 add: function( selector, context ) {
17118 return this.pushStack(
17119 jQuery.uniqueSort(
17120 jQuery.merge( this.get(), jQuery( selector, context ) )
17121 )
17122 );
17123 },
17124
17125 addBack: function( selector ) {
17126 return this.add( selector == null ?
17127 this.prevObject : this.prevObject.filter( selector )
17128 );
17129 }
17130} );
17131
17132function sibling( cur, dir ) {
17133 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
17134 return cur;
17135}
17136
17137jQuery.each( {
17138 parent: function( elem ) {
17139 var parent = elem.parentNode;
17140 return parent && parent.nodeType !== 11 ? parent : null;
17141 },
17142 parents: function( elem ) {
17143 return dir( elem, "parentNode" );
17144 },
17145 parentsUntil: function( elem, i, until ) {
17146 return dir( elem, "parentNode", until );
17147 },
17148 next: function( elem ) {
17149 return sibling( elem, "nextSibling" );
17150 },
17151 prev: function( elem ) {
17152 return sibling( elem, "previousSibling" );
17153 },
17154 nextAll: function( elem ) {
17155 return dir( elem, "nextSibling" );
17156 },
17157 prevAll: function( elem ) {
17158 return dir( elem, "previousSibling" );
17159 },
17160 nextUntil: function( elem, i, until ) {
17161 return dir( elem, "nextSibling", until );
17162 },
17163 prevUntil: function( elem, i, until ) {
17164 return dir( elem, "previousSibling", until );
17165 },
17166 siblings: function( elem ) {
17167 return siblings( ( elem.parentNode || {} ).firstChild, elem );
17168 },
17169 children: function( elem ) {
17170 return siblings( elem.firstChild );
17171 },
17172 contents: function( elem ) {
17173 if ( nodeName( elem, "iframe" ) ) {
17174 return elem.contentDocument;
17175 }
17176
17177 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
17178 // Treat the template element as a regular one in browsers that
17179 // don't support it.
17180 if ( nodeName( elem, "template" ) ) {
17181 elem = elem.content || elem;
17182 }
17183
17184 return jQuery.merge( [], elem.childNodes );
17185 }
17186}, function( name, fn ) {
17187 jQuery.fn[ name ] = function( until, selector ) {
17188 var matched = jQuery.map( this, fn, until );
17189
17190 if ( name.slice( -5 ) !== "Until" ) {
17191 selector = until;
17192 }
17193
17194 if ( selector && typeof selector === "string" ) {
17195 matched = jQuery.filter( selector, matched );
17196 }
17197
17198 if ( this.length > 1 ) {
17199
17200 // Remove duplicates
17201 if ( !guaranteedUnique[ name ] ) {
17202 jQuery.uniqueSort( matched );
17203 }
17204
17205 // Reverse order for parents* and prev-derivatives
17206 if ( rparentsprev.test( name ) ) {
17207 matched.reverse();
17208 }
17209 }
17210
17211 return this.pushStack( matched );
17212 };
17213} );
17214var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
17215
17216
17217
17218// Convert String-formatted options into Object-formatted ones
17219function createOptions( options ) {
17220 var object = {};
17221 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
17222 object[ flag ] = true;
17223 } );
17224 return object;
17225}
17226
17227/*
17228 * Create a callback list using the following parameters:
17229 *
17230 * options: an optional list of space-separated options that will change how
17231 * the callback list behaves or a more traditional option object
17232 *
17233 * By default a callback list will act like an event callback list and can be
17234 * "fired" multiple times.
17235 *
17236 * Possible options:
17237 *
17238 * once: will ensure the callback list can only be fired once (like a Deferred)
17239 *
17240 * memory: will keep track of previous values and will call any callback added
17241 * after the list has been fired right away with the latest "memorized"
17242 * values (like a Deferred)
17243 *
17244 * unique: will ensure a callback can only be added once (no duplicate in the list)
17245 *
17246 * stopOnFalse: interrupt callings when a callback returns false
17247 *
17248 */
17249jQuery.Callbacks = function( options ) {
17250
17251 // Convert options from String-formatted to Object-formatted if needed
17252 // (we check in cache first)
17253 options = typeof options === "string" ?
17254 createOptions( options ) :
17255 jQuery.extend( {}, options );
17256
17257 var // Flag to know if list is currently firing
17258 firing,
17259
17260 // Last fire value for non-forgettable lists
17261 memory,
17262
17263 // Flag to know if list was already fired
17264 fired,
17265
17266 // Flag to prevent firing
17267 locked,
17268
17269 // Actual callback list
17270 list = [],
17271
17272 // Queue of execution data for repeatable lists
17273 queue = [],
17274
17275 // Index of currently firing callback (modified by add/remove as needed)
17276 firingIndex = -1,
17277
17278 // Fire callbacks
17279 fire = function() {
17280
17281 // Enforce single-firing
17282 locked = locked || options.once;
17283
17284 // Execute callbacks for all pending executions,
17285 // respecting firingIndex overrides and runtime changes
17286 fired = firing = true;
17287 for ( ; queue.length; firingIndex = -1 ) {
17288 memory = queue.shift();
17289 while ( ++firingIndex < list.length ) {
17290
17291 // Run callback and check for early termination
17292 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
17293 options.stopOnFalse ) {
17294
17295 // Jump to end and forget the data so .add doesn't re-fire
17296 firingIndex = list.length;
17297 memory = false;
17298 }
17299 }
17300 }
17301
17302 // Forget the data if we're done with it
17303 if ( !options.memory ) {
17304 memory = false;
17305 }
17306
17307 firing = false;
17308
17309 // Clean up if we're done firing for good
17310 if ( locked ) {
17311
17312 // Keep an empty list if we have data for future add calls
17313 if ( memory ) {
17314 list = [];
17315
17316 // Otherwise, this object is spent
17317 } else {
17318 list = "";
17319 }
17320 }
17321 },
17322
17323 // Actual Callbacks object
17324 self = {
17325
17326 // Add a callback or a collection of callbacks to the list
17327 add: function() {
17328 if ( list ) {
17329
17330 // If we have memory from a past run, we should fire after adding
17331 if ( memory && !firing ) {
17332 firingIndex = list.length - 1;
17333 queue.push( memory );
17334 }
17335
17336 ( function add( args ) {
17337 jQuery.each( args, function( _, arg ) {
17338 if ( jQuery.isFunction( arg ) ) {
17339 if ( !options.unique || !self.has( arg ) ) {
17340 list.push( arg );
17341 }
17342 } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
17343
17344 // Inspect recursively
17345 add( arg );
17346 }
17347 } );
17348 } )( arguments );
17349
17350 if ( memory && !firing ) {
17351 fire();
17352 }
17353 }
17354 return this;
17355 },
17356
17357 // Remove a callback from the list
17358 remove: function() {
17359 jQuery.each( arguments, function( _, arg ) {
17360 var index;
17361 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
17362 list.splice( index, 1 );
17363
17364 // Handle firing indexes
17365 if ( index <= firingIndex ) {
17366 firingIndex--;
17367 }
17368 }
17369 } );
17370 return this;
17371 },
17372
17373 // Check if a given callback is in the list.
17374 // If no argument is given, return whether or not list has callbacks attached.
17375 has: function( fn ) {
17376 return fn ?
17377 jQuery.inArray( fn, list ) > -1 :
17378 list.length > 0;
17379 },
17380
17381 // Remove all callbacks from the list
17382 empty: function() {
17383 if ( list ) {
17384 list = [];
17385 }
17386 return this;
17387 },
17388
17389 // Disable .fire and .add
17390 // Abort any current/pending executions
17391 // Clear all callbacks and values
17392 disable: function() {
17393 locked = queue = [];
17394 list = memory = "";
17395 return this;
17396 },
17397 disabled: function() {
17398 return !list;
17399 },
17400
17401 // Disable .fire
17402 // Also disable .add unless we have memory (since it would have no effect)
17403 // Abort any pending executions
17404 lock: function() {
17405 locked = queue = [];
17406 if ( !memory && !firing ) {
17407 list = memory = "";
17408 }
17409 return this;
17410 },
17411 locked: function() {
17412 return !!locked;
17413 },
17414
17415 // Call all callbacks with the given context and arguments
17416 fireWith: function( context, args ) {
17417 if ( !locked ) {
17418 args = args || [];
17419 args = [ context, args.slice ? args.slice() : args ];
17420 queue.push( args );
17421 if ( !firing ) {
17422 fire();
17423 }
17424 }
17425 return this;
17426 },
17427
17428 // Call all the callbacks with the given arguments
17429 fire: function() {
17430 self.fireWith( this, arguments );
17431 return this;
17432 },
17433
17434 // To know if the callbacks have already been called at least once
17435 fired: function() {
17436 return !!fired;
17437 }
17438 };
17439
17440 return self;
17441};
17442
17443
17444function Identity( v ) {
17445 return v;
17446}
17447function Thrower( ex ) {
17448 throw ex;
17449}
17450
17451function adoptValue( value, resolve, reject, noValue ) {
17452 var method;
17453
17454 try {
17455
17456 // Check for promise aspect first to privilege synchronous behavior
17457 if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
17458 method.call( value ).done( resolve ).fail( reject );
17459
17460 // Other thenables
17461 } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
17462 method.call( value, resolve, reject );
17463
17464 // Other non-thenables
17465 } else {
17466
17467 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
17468 // * false: [ value ].slice( 0 ) => resolve( value )
17469 // * true: [ value ].slice( 1 ) => resolve()
17470 resolve.apply( undefined, [ value ].slice( noValue ) );
17471 }
17472
17473 // For Promises/A+, convert exceptions into rejections
17474 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
17475 // Deferred#then to conditionally suppress rejection.
17476 } catch ( value ) {
17477
17478 // Support: Android 4.0 only
17479 // Strict mode functions invoked without .call/.apply get global-object context
17480 reject.apply( undefined, [ value ] );
17481 }
17482}
17483
17484jQuery.extend( {
17485
17486 Deferred: function( func ) {
17487 var tuples = [
17488
17489 // action, add listener, callbacks,
17490 // ... .then handlers, argument index, [final state]
17491 [ "notify", "progress", jQuery.Callbacks( "memory" ),
17492 jQuery.Callbacks( "memory" ), 2 ],
17493 [ "resolve", "done", jQuery.Callbacks( "once memory" ),
17494 jQuery.Callbacks( "once memory" ), 0, "resolved" ],
17495 [ "reject", "fail", jQuery.Callbacks( "once memory" ),
17496 jQuery.Callbacks( "once memory" ), 1, "rejected" ]
17497 ],
17498 state = "pending",
17499 promise = {
17500 state: function() {
17501 return state;
17502 },
17503 always: function() {
17504 deferred.done( arguments ).fail( arguments );
17505 return this;
17506 },
17507 "catch": function( fn ) {
17508 return promise.then( null, fn );
17509 },
17510
17511 // Keep pipe for back-compat
17512 pipe: function( /* fnDone, fnFail, fnProgress */ ) {
17513 var fns = arguments;
17514
17515 return jQuery.Deferred( function( newDefer ) {
17516 jQuery.each( tuples, function( i, tuple ) {
17517
17518 // Map tuples (progress, done, fail) to arguments (done, fail, progress)
17519 var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
17520
17521 // deferred.progress(function() { bind to newDefer or newDefer.notify })
17522 // deferred.done(function() { bind to newDefer or newDefer.resolve })
17523 // deferred.fail(function() { bind to newDefer or newDefer.reject })
17524 deferred[ tuple[ 1 ] ]( function() {
17525 var returned = fn && fn.apply( this, arguments );
17526 if ( returned && jQuery.isFunction( returned.promise ) ) {
17527 returned.promise()
17528 .progress( newDefer.notify )
17529 .done( newDefer.resolve )
17530 .fail( newDefer.reject );
17531 } else {
17532 newDefer[ tuple[ 0 ] + "With" ](
17533 this,
17534 fn ? [ returned ] : arguments
17535 );
17536 }
17537 } );
17538 } );
17539 fns = null;
17540 } ).promise();
17541 },
17542 then: function( onFulfilled, onRejected, onProgress ) {
17543 var maxDepth = 0;
17544 function resolve( depth, deferred, handler, special ) {
17545 return function() {
17546 var that = this,
17547 args = arguments,
17548 mightThrow = function() {
17549 var returned, then;
17550
17551 // Support: Promises/A+ section 2.3.3.3.3
17552 // https://promisesaplus.com/#point-59
17553 // Ignore double-resolution attempts
17554 if ( depth < maxDepth ) {
17555 return;
17556 }
17557
17558 returned = handler.apply( that, args );
17559
17560 // Support: Promises/A+ section 2.3.1
17561 // https://promisesaplus.com/#point-48
17562 if ( returned === deferred.promise() ) {
17563 throw new TypeError( "Thenable self-resolution" );
17564 }
17565
17566 // Support: Promises/A+ sections 2.3.3.1, 3.5
17567 // https://promisesaplus.com/#point-54
17568 // https://promisesaplus.com/#point-75
17569 // Retrieve `then` only once
17570 then = returned &&
17571
17572 // Support: Promises/A+ section 2.3.4
17573 // https://promisesaplus.com/#point-64
17574 // Only check objects and functions for thenability
17575 ( typeof returned === "object" ||
17576 typeof returned === "function" ) &&
17577 returned.then;
17578
17579 // Handle a returned thenable
17580 if ( jQuery.isFunction( then ) ) {
17581
17582 // Special processors (notify) just wait for resolution
17583 if ( special ) {
17584 then.call(
17585 returned,
17586 resolve( maxDepth, deferred, Identity, special ),
17587 resolve( maxDepth, deferred, Thrower, special )
17588 );
17589
17590 // Normal processors (resolve) also hook into progress
17591 } else {
17592
17593 // ...and disregard older resolution values
17594 maxDepth++;
17595
17596 then.call(
17597 returned,
17598 resolve( maxDepth, deferred, Identity, special ),
17599 resolve( maxDepth, deferred, Thrower, special ),
17600 resolve( maxDepth, deferred, Identity,
17601 deferred.notifyWith )
17602 );
17603 }
17604
17605 // Handle all other returned values
17606 } else {
17607
17608 // Only substitute handlers pass on context
17609 // and multiple values (non-spec behavior)
17610 if ( handler !== Identity ) {
17611 that = undefined;
17612 args = [ returned ];
17613 }
17614
17615 // Process the value(s)
17616 // Default process is resolve
17617 ( special || deferred.resolveWith )( that, args );
17618 }
17619 },
17620
17621 // Only normal processors (resolve) catch and reject exceptions
17622 process = special ?
17623 mightThrow :
17624 function() {
17625 try {
17626 mightThrow();
17627 } catch ( e ) {
17628
17629 if ( jQuery.Deferred.exceptionHook ) {
17630 jQuery.Deferred.exceptionHook( e,
17631 process.stackTrace );
17632 }
17633
17634 // Support: Promises/A+ section 2.3.3.3.4.1
17635 // https://promisesaplus.com/#point-61
17636 // Ignore post-resolution exceptions
17637 if ( depth + 1 >= maxDepth ) {
17638
17639 // Only substitute handlers pass on context
17640 // and multiple values (non-spec behavior)
17641 if ( handler !== Thrower ) {
17642 that = undefined;
17643 args = [ e ];
17644 }
17645
17646 deferred.rejectWith( that, args );
17647 }
17648 }
17649 };
17650
17651 // Support: Promises/A+ section 2.3.3.3.1
17652 // https://promisesaplus.com/#point-57
17653 // Re-resolve promises immediately to dodge false rejection from
17654 // subsequent errors
17655 if ( depth ) {
17656 process();
17657 } else {
17658
17659 // Call an optional hook to record the stack, in case of exception
17660 // since it's otherwise lost when execution goes async
17661 if ( jQuery.Deferred.getStackHook ) {
17662 process.stackTrace = jQuery.Deferred.getStackHook();
17663 }
17664 window.setTimeout( process );
17665 }
17666 };
17667 }
17668
17669 return jQuery.Deferred( function( newDefer ) {
17670
17671 // progress_handlers.add( ... )
17672 tuples[ 0 ][ 3 ].add(
17673 resolve(
17674 0,
17675 newDefer,
17676 jQuery.isFunction( onProgress ) ?
17677 onProgress :
17678 Identity,
17679 newDefer.notifyWith
17680 )
17681 );
17682
17683 // fulfilled_handlers.add( ... )
17684 tuples[ 1 ][ 3 ].add(
17685 resolve(
17686 0,
17687 newDefer,
17688 jQuery.isFunction( onFulfilled ) ?
17689 onFulfilled :
17690 Identity
17691 )
17692 );
17693
17694 // rejected_handlers.add( ... )
17695 tuples[ 2 ][ 3 ].add(
17696 resolve(
17697 0,
17698 newDefer,
17699 jQuery.isFunction( onRejected ) ?
17700 onRejected :
17701 Thrower
17702 )
17703 );
17704 } ).promise();
17705 },
17706
17707 // Get a promise for this deferred
17708 // If obj is provided, the promise aspect is added to the object
17709 promise: function( obj ) {
17710 return obj != null ? jQuery.extend( obj, promise ) : promise;
17711 }
17712 },
17713 deferred = {};
17714
17715 // Add list-specific methods
17716 jQuery.each( tuples, function( i, tuple ) {
17717 var list = tuple[ 2 ],
17718 stateString = tuple[ 5 ];
17719
17720 // promise.progress = list.add
17721 // promise.done = list.add
17722 // promise.fail = list.add
17723 promise[ tuple[ 1 ] ] = list.add;
17724
17725 // Handle state
17726 if ( stateString ) {
17727 list.add(
17728 function() {
17729
17730 // state = "resolved" (i.e., fulfilled)
17731 // state = "rejected"
17732 state = stateString;
17733 },
17734
17735 // rejected_callbacks.disable
17736 // fulfilled_callbacks.disable
17737 tuples[ 3 - i ][ 2 ].disable,
17738
17739 // progress_callbacks.lock
17740 tuples[ 0 ][ 2 ].lock
17741 );
17742 }
17743
17744 // progress_handlers.fire
17745 // fulfilled_handlers.fire
17746 // rejected_handlers.fire
17747 list.add( tuple[ 3 ].fire );
17748
17749 // deferred.notify = function() { deferred.notifyWith(...) }
17750 // deferred.resolve = function() { deferred.resolveWith(...) }
17751 // deferred.reject = function() { deferred.rejectWith(...) }
17752 deferred[ tuple[ 0 ] ] = function() {
17753 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
17754 return this;
17755 };
17756
17757 // deferred.notifyWith = list.fireWith
17758 // deferred.resolveWith = list.fireWith
17759 // deferred.rejectWith = list.fireWith
17760 deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
17761 } );
17762
17763 // Make the deferred a promise
17764 promise.promise( deferred );
17765
17766 // Call given func if any
17767 if ( func ) {
17768 func.call( deferred, deferred );
17769 }
17770
17771 // All done!
17772 return deferred;
17773 },
17774
17775 // Deferred helper
17776 when: function( singleValue ) {
17777 var
17778
17779 // count of uncompleted subordinates
17780 remaining = arguments.length,
17781
17782 // count of unprocessed arguments
17783 i = remaining,
17784
17785 // subordinate fulfillment data
17786 resolveContexts = Array( i ),
17787 resolveValues = slice.call( arguments ),
17788
17789 // the master Deferred
17790 master = jQuery.Deferred(),
17791
17792 // subordinate callback factory
17793 updateFunc = function( i ) {
17794 return function( value ) {
17795 resolveContexts[ i ] = this;
17796 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
17797 if ( !( --remaining ) ) {
17798 master.resolveWith( resolveContexts, resolveValues );
17799 }
17800 };
17801 };
17802
17803 // Single- and empty arguments are adopted like Promise.resolve
17804 if ( remaining <= 1 ) {
17805 adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
17806 !remaining );
17807
17808 // Use .then() to unwrap secondary thenables (cf. gh-3000)
17809 if ( master.state() === "pending" ||
17810 jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
17811
17812 return master.then();
17813 }
17814 }
17815
17816 // Multiple arguments are aggregated like Promise.all array elements
17817 while ( i-- ) {
17818 adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
17819 }
17820
17821 return master.promise();
17822 }
17823} );
17824
17825
17826// These usually indicate a programmer mistake during development,
17827// warn about them ASAP rather than swallowing them by default.
17828var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
17829
17830jQuery.Deferred.exceptionHook = function( error, stack ) {
17831
17832 // Support: IE 8 - 9 only
17833 // Console exists when dev tools are open, which can happen at any time
17834 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
17835 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
17836 }
17837};
17838
17839
17840
17841
17842jQuery.readyException = function( error ) {
17843 window.setTimeout( function() {
17844 throw error;
17845 } );
17846};
17847
17848
17849
17850
17851// The deferred used on DOM ready
17852var readyList = jQuery.Deferred();
17853
17854jQuery.fn.ready = function( fn ) {
17855
17856 readyList
17857 .then( fn )
17858
17859 // Wrap jQuery.readyException in a function so that the lookup
17860 // happens at the time of error handling instead of callback
17861 // registration.
17862 .catch( function( error ) {
17863 jQuery.readyException( error );
17864 } );
17865
17866 return this;
17867};
17868
17869jQuery.extend( {
17870
17871 // Is the DOM ready to be used? Set to true once it occurs.
17872 isReady: false,
17873
17874 // A counter to track how many items to wait for before
17875 // the ready event fires. See #6781
17876 readyWait: 1,
17877
17878 // Handle when the DOM is ready
17879 ready: function( wait ) {
17880
17881 // Abort if there are pending holds or we're already ready
17882 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
17883 return;
17884 }
17885
17886 // Remember that the DOM is ready
17887 jQuery.isReady = true;
17888
17889 // If a normal DOM Ready event fired, decrement, and wait if need be
17890 if ( wait !== true && --jQuery.readyWait > 0 ) {
17891 return;
17892 }
17893
17894 // If there are functions bound, to execute
17895 readyList.resolveWith( document, [ jQuery ] );
17896 }
17897} );
17898
17899jQuery.ready.then = readyList.then;
17900
17901// The ready event handler and self cleanup method
17902function completed() {
17903 document.removeEventListener( "DOMContentLoaded", completed );
17904 window.removeEventListener( "load", completed );
17905 jQuery.ready();
17906}
17907
17908// Catch cases where $(document).ready() is called
17909// after the browser event has already occurred.
17910// Support: IE <=9 - 10 only
17911// Older IE sometimes signals "interactive" too soon
17912if ( document.readyState === "complete" ||
17913 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
17914
17915 // Handle it asynchronously to allow scripts the opportunity to delay ready
17916 window.setTimeout( jQuery.ready );
17917
17918} else {
17919
17920 // Use the handy event callback
17921 document.addEventListener( "DOMContentLoaded", completed );
17922
17923 // A fallback to window.onload, that will always work
17924 window.addEventListener( "load", completed );
17925}
17926
17927
17928
17929
17930// Multifunctional method to get and set values of a collection
17931// The value/s can optionally be executed if it's a function
17932var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
17933 var i = 0,
17934 len = elems.length,
17935 bulk = key == null;
17936
17937 // Sets many values
17938 if ( jQuery.type( key ) === "object" ) {
17939 chainable = true;
17940 for ( i in key ) {
17941 access( elems, fn, i, key[ i ], true, emptyGet, raw );
17942 }
17943
17944 // Sets one value
17945 } else if ( value !== undefined ) {
17946 chainable = true;
17947
17948 if ( !jQuery.isFunction( value ) ) {
17949 raw = true;
17950 }
17951
17952 if ( bulk ) {
17953
17954 // Bulk operations run against the entire set
17955 if ( raw ) {
17956 fn.call( elems, value );
17957 fn = null;
17958
17959 // ...except when executing function values
17960 } else {
17961 bulk = fn;
17962 fn = function( elem, key, value ) {
17963 return bulk.call( jQuery( elem ), value );
17964 };
17965 }
17966 }
17967
17968 if ( fn ) {
17969 for ( ; i < len; i++ ) {
17970 fn(
17971 elems[ i ], key, raw ?
17972 value :
17973 value.call( elems[ i ], i, fn( elems[ i ], key ) )
17974 );
17975 }
17976 }
17977 }
17978
17979 if ( chainable ) {
17980 return elems;
17981 }
17982
17983 // Gets
17984 if ( bulk ) {
17985 return fn.call( elems );
17986 }
17987
17988 return len ? fn( elems[ 0 ], key ) : emptyGet;
17989};
17990var acceptData = function( owner ) {
17991
17992 // Accepts only:
17993 // - Node
17994 // - Node.ELEMENT_NODE
17995 // - Node.DOCUMENT_NODE
17996 // - Object
17997 // - Any
17998 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
17999};
18000
18001
18002
18003
18004function Data() {
18005 this.expando = jQuery.expando + Data.uid++;
18006}
18007
18008Data.uid = 1;
18009
18010Data.prototype = {
18011
18012 cache: function( owner ) {
18013
18014 // Check if the owner object already has a cache
18015 var value = owner[ this.expando ];
18016
18017 // If not, create one
18018 if ( !value ) {
18019 value = {};
18020
18021 // We can accept data for non-element nodes in modern browsers,
18022 // but we should not, see #8335.
18023 // Always return an empty object.
18024 if ( acceptData( owner ) ) {
18025
18026 // If it is a node unlikely to be stringify-ed or looped over
18027 // use plain assignment
18028 if ( owner.nodeType ) {
18029 owner[ this.expando ] = value;
18030
18031 // Otherwise secure it in a non-enumerable property
18032 // configurable must be true to allow the property to be
18033 // deleted when data is removed
18034 } else {
18035 Object.defineProperty( owner, this.expando, {
18036 value: value,
18037 configurable: true
18038 } );
18039 }
18040 }
18041 }
18042
18043 return value;
18044 },
18045 set: function( owner, data, value ) {
18046 var prop,
18047 cache = this.cache( owner );
18048
18049 // Handle: [ owner, key, value ] args
18050 // Always use camelCase key (gh-2257)
18051 if ( typeof data === "string" ) {
18052 cache[ jQuery.camelCase( data ) ] = value;
18053
18054 // Handle: [ owner, { properties } ] args
18055 } else {
18056
18057 // Copy the properties one-by-one to the cache object
18058 for ( prop in data ) {
18059 cache[ jQuery.camelCase( prop ) ] = data[ prop ];
18060 }
18061 }
18062 return cache;
18063 },
18064 get: function( owner, key ) {
18065 return key === undefined ?
18066 this.cache( owner ) :
18067
18068 // Always use camelCase key (gh-2257)
18069 owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
18070 },
18071 access: function( owner, key, value ) {
18072
18073 // In cases where either:
18074 //
18075 // 1. No key was specified
18076 // 2. A string key was specified, but no value provided
18077 //
18078 // Take the "read" path and allow the get method to determine
18079 // which value to return, respectively either:
18080 //
18081 // 1. The entire cache object
18082 // 2. The data stored at the key
18083 //
18084 if ( key === undefined ||
18085 ( ( key && typeof key === "string" ) && value === undefined ) ) {
18086
18087 return this.get( owner, key );
18088 }
18089
18090 // When the key is not a string, or both a key and value
18091 // are specified, set or extend (existing objects) with either:
18092 //
18093 // 1. An object of properties
18094 // 2. A key and value
18095 //
18096 this.set( owner, key, value );
18097
18098 // Since the "set" path can have two possible entry points
18099 // return the expected data based on which path was taken[*]
18100 return value !== undefined ? value : key;
18101 },
18102 remove: function( owner, key ) {
18103 var i,
18104 cache = owner[ this.expando ];
18105
18106 if ( cache === undefined ) {
18107 return;
18108 }
18109
18110 if ( key !== undefined ) {
18111
18112 // Support array or space separated string of keys
18113 if ( Array.isArray( key ) ) {
18114
18115 // If key is an array of keys...
18116 // We always set camelCase keys, so remove that.
18117 key = key.map( jQuery.camelCase );
18118 } else {
18119 key = jQuery.camelCase( key );
18120
18121 // If a key with the spaces exists, use it.
18122 // Otherwise, create an array by matching non-whitespace
18123 key = key in cache ?
18124 [ key ] :
18125 ( key.match( rnothtmlwhite ) || [] );
18126 }
18127
18128 i = key.length;
18129
18130 while ( i-- ) {
18131 delete cache[ key[ i ] ];
18132 }
18133 }
18134
18135 // Remove the expando if there's no more data
18136 if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
18137
18138 // Support: Chrome <=35 - 45
18139 // Webkit & Blink performance suffers when deleting properties
18140 // from DOM nodes, so set to undefined instead
18141 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
18142 if ( owner.nodeType ) {
18143 owner[ this.expando ] = undefined;
18144 } else {
18145 delete owner[ this.expando ];
18146 }
18147 }
18148 },
18149 hasData: function( owner ) {
18150 var cache = owner[ this.expando ];
18151 return cache !== undefined && !jQuery.isEmptyObject( cache );
18152 }
18153};
18154var dataPriv = new Data();
18155
18156var dataUser = new Data();
18157
18158
18159
18160// Implementation Summary
18161//
18162// 1. Enforce API surface and semantic compatibility with 1.9.x branch
18163// 2. Improve the module's maintainability by reducing the storage
18164// paths to a single mechanism.
18165// 3. Use the same single mechanism to support "private" and "user" data.
18166// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
18167// 5. Avoid exposing implementation details on user objects (eg. expando properties)
18168// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
18169
18170var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
18171 rmultiDash = /[A-Z]/g;
18172
18173function getData( data ) {
18174 if ( data === "true" ) {
18175 return true;
18176 }
18177
18178 if ( data === "false" ) {
18179 return false;
18180 }
18181
18182 if ( data === "null" ) {
18183 return null;
18184 }
18185
18186 // Only convert to a number if it doesn't change the string
18187 if ( data === +data + "" ) {
18188 return +data;
18189 }
18190
18191 if ( rbrace.test( data ) ) {
18192 return JSON.parse( data );
18193 }
18194
18195 return data;
18196}
18197
18198function dataAttr( elem, key, data ) {
18199 var name;
18200
18201 // If nothing was found internally, try to fetch any
18202 // data from the HTML5 data-* attribute
18203 if ( data === undefined && elem.nodeType === 1 ) {
18204 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
18205 data = elem.getAttribute( name );
18206
18207 if ( typeof data === "string" ) {
18208 try {
18209 data = getData( data );
18210 } catch ( e ) {}
18211
18212 // Make sure we set the data so it isn't changed later
18213 dataUser.set( elem, key, data );
18214 } else {
18215 data = undefined;
18216 }
18217 }
18218 return data;
18219}
18220
18221jQuery.extend( {
18222 hasData: function( elem ) {
18223 return dataUser.hasData( elem ) || dataPriv.hasData( elem );
18224 },
18225
18226 data: function( elem, name, data ) {
18227 return dataUser.access( elem, name, data );
18228 },
18229
18230 removeData: function( elem, name ) {
18231 dataUser.remove( elem, name );
18232 },
18233
18234 // TODO: Now that all calls to _data and _removeData have been replaced
18235 // with direct calls to dataPriv methods, these can be deprecated.
18236 _data: function( elem, name, data ) {
18237 return dataPriv.access( elem, name, data );
18238 },
18239
18240 _removeData: function( elem, name ) {
18241 dataPriv.remove( elem, name );
18242 }
18243} );
18244
18245jQuery.fn.extend( {
18246 data: function( key, value ) {
18247 var i, name, data,
18248 elem = this[ 0 ],
18249 attrs = elem && elem.attributes;
18250
18251 // Gets all values
18252 if ( key === undefined ) {
18253 if ( this.length ) {
18254 data = dataUser.get( elem );
18255
18256 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
18257 i = attrs.length;
18258 while ( i-- ) {
18259
18260 // Support: IE 11 only
18261 // The attrs elements can be null (#14894)
18262 if ( attrs[ i ] ) {
18263 name = attrs[ i ].name;
18264 if ( name.indexOf( "data-" ) === 0 ) {
18265 name = jQuery.camelCase( name.slice( 5 ) );
18266 dataAttr( elem, name, data[ name ] );
18267 }
18268 }
18269 }
18270 dataPriv.set( elem, "hasDataAttrs", true );
18271 }
18272 }
18273
18274 return data;
18275 }
18276
18277 // Sets multiple values
18278 if ( typeof key === "object" ) {
18279 return this.each( function() {
18280 dataUser.set( this, key );
18281 } );
18282 }
18283
18284 return access( this, function( value ) {
18285 var data;
18286
18287 // The calling jQuery object (element matches) is not empty
18288 // (and therefore has an element appears at this[ 0 ]) and the
18289 // `value` parameter was not undefined. An empty jQuery object
18290 // will result in `undefined` for elem = this[ 0 ] which will
18291 // throw an exception if an attempt to read a data cache is made.
18292 if ( elem && value === undefined ) {
18293
18294 // Attempt to get data from the cache
18295 // The key will always be camelCased in Data
18296 data = dataUser.get( elem, key );
18297 if ( data !== undefined ) {
18298 return data;
18299 }
18300
18301 // Attempt to "discover" the data in
18302 // HTML5 custom data-* attrs
18303 data = dataAttr( elem, key );
18304 if ( data !== undefined ) {
18305 return data;
18306 }
18307
18308 // We tried really hard, but the data doesn't exist.
18309 return;
18310 }
18311
18312 // Set the data...
18313 this.each( function() {
18314
18315 // We always store the camelCased key
18316 dataUser.set( this, key, value );
18317 } );
18318 }, null, value, arguments.length > 1, null, true );
18319 },
18320
18321 removeData: function( key ) {
18322 return this.each( function() {
18323 dataUser.remove( this, key );
18324 } );
18325 }
18326} );
18327
18328
18329jQuery.extend( {
18330 queue: function( elem, type, data ) {
18331 var queue;
18332
18333 if ( elem ) {
18334 type = ( type || "fx" ) + "queue";
18335 queue = dataPriv.get( elem, type );
18336
18337 // Speed up dequeue by getting out quickly if this is just a lookup
18338 if ( data ) {
18339 if ( !queue || Array.isArray( data ) ) {
18340 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
18341 } else {
18342 queue.push( data );
18343 }
18344 }
18345 return queue || [];
18346 }
18347 },
18348
18349 dequeue: function( elem, type ) {
18350 type = type || "fx";
18351
18352 var queue = jQuery.queue( elem, type ),
18353 startLength = queue.length,
18354 fn = queue.shift(),
18355 hooks = jQuery._queueHooks( elem, type ),
18356 next = function() {
18357 jQuery.dequeue( elem, type );
18358 };
18359
18360 // If the fx queue is dequeued, always remove the progress sentinel
18361 if ( fn === "inprogress" ) {
18362 fn = queue.shift();
18363 startLength--;
18364 }
18365
18366 if ( fn ) {
18367
18368 // Add a progress sentinel to prevent the fx queue from being
18369 // automatically dequeued
18370 if ( type === "fx" ) {
18371 queue.unshift( "inprogress" );
18372 }
18373
18374 // Clear up the last queue stop function
18375 delete hooks.stop;
18376 fn.call( elem, next, hooks );
18377 }
18378
18379 if ( !startLength && hooks ) {
18380 hooks.empty.fire();
18381 }
18382 },
18383
18384 // Not public - generate a queueHooks object, or return the current one
18385 _queueHooks: function( elem, type ) {
18386 var key = type + "queueHooks";
18387 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
18388 empty: jQuery.Callbacks( "once memory" ).add( function() {
18389 dataPriv.remove( elem, [ type + "queue", key ] );
18390 } )
18391 } );
18392 }
18393} );
18394
18395jQuery.fn.extend( {
18396 queue: function( type, data ) {
18397 var setter = 2;
18398
18399 if ( typeof type !== "string" ) {
18400 data = type;
18401 type = "fx";
18402 setter--;
18403 }
18404
18405 if ( arguments.length < setter ) {
18406 return jQuery.queue( this[ 0 ], type );
18407 }
18408
18409 return data === undefined ?
18410 this :
18411 this.each( function() {
18412 var queue = jQuery.queue( this, type, data );
18413
18414 // Ensure a hooks for this queue
18415 jQuery._queueHooks( this, type );
18416
18417 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
18418 jQuery.dequeue( this, type );
18419 }
18420 } );
18421 },
18422 dequeue: function( type ) {
18423 return this.each( function() {
18424 jQuery.dequeue( this, type );
18425 } );
18426 },
18427 clearQueue: function( type ) {
18428 return this.queue( type || "fx", [] );
18429 },
18430
18431 // Get a promise resolved when queues of a certain type
18432 // are emptied (fx is the type by default)
18433 promise: function( type, obj ) {
18434 var tmp,
18435 count = 1,
18436 defer = jQuery.Deferred(),
18437 elements = this,
18438 i = this.length,
18439 resolve = function() {
18440 if ( !( --count ) ) {
18441 defer.resolveWith( elements, [ elements ] );
18442 }
18443 };
18444
18445 if ( typeof type !== "string" ) {
18446 obj = type;
18447 type = undefined;
18448 }
18449 type = type || "fx";
18450
18451 while ( i-- ) {
18452 tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
18453 if ( tmp && tmp.empty ) {
18454 count++;
18455 tmp.empty.add( resolve );
18456 }
18457 }
18458 resolve();
18459 return defer.promise( obj );
18460 }
18461} );
18462var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
18463
18464var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
18465
18466
18467var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
18468
18469var isHiddenWithinTree = function( elem, el ) {
18470
18471 // isHiddenWithinTree might be called from jQuery#filter function;
18472 // in that case, element will be second argument
18473 elem = el || elem;
18474
18475 // Inline style trumps all
18476 return elem.style.display === "none" ||
18477 elem.style.display === "" &&
18478
18479 // Otherwise, check computed style
18480 // Support: Firefox <=43 - 45
18481 // Disconnected elements can have computed display: none, so first confirm that elem is
18482 // in the document.
18483 jQuery.contains( elem.ownerDocument, elem ) &&
18484
18485 jQuery.css( elem, "display" ) === "none";
18486 };
18487
18488var swap = function( elem, options, callback, args ) {
18489 var ret, name,
18490 old = {};
18491
18492 // Remember the old values, and insert the new ones
18493 for ( name in options ) {
18494 old[ name ] = elem.style[ name ];
18495 elem.style[ name ] = options[ name ];
18496 }
18497
18498 ret = callback.apply( elem, args || [] );
18499
18500 // Revert the old values
18501 for ( name in options ) {
18502 elem.style[ name ] = old[ name ];
18503 }
18504
18505 return ret;
18506};
18507
18508
18509
18510
18511function adjustCSS( elem, prop, valueParts, tween ) {
18512 var adjusted,
18513 scale = 1,
18514 maxIterations = 20,
18515 currentValue = tween ?
18516 function() {
18517 return tween.cur();
18518 } :
18519 function() {
18520 return jQuery.css( elem, prop, "" );
18521 },
18522 initial = currentValue(),
18523 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
18524
18525 // Starting value computation is required for potential unit mismatches
18526 initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
18527 rcssNum.exec( jQuery.css( elem, prop ) );
18528
18529 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
18530
18531 // Trust units reported by jQuery.css
18532 unit = unit || initialInUnit[ 3 ];
18533
18534 // Make sure we update the tween properties later on
18535 valueParts = valueParts || [];
18536
18537 // Iteratively approximate from a nonzero starting point
18538 initialInUnit = +initial || 1;
18539
18540 do {
18541
18542 // If previous iteration zeroed out, double until we get *something*.
18543 // Use string for doubling so we don't accidentally see scale as unchanged below
18544 scale = scale || ".5";
18545
18546 // Adjust and apply
18547 initialInUnit = initialInUnit / scale;
18548 jQuery.style( elem, prop, initialInUnit + unit );
18549
18550 // Update scale, tolerating zero or NaN from tween.cur()
18551 // Break the loop if scale is unchanged or perfect, or if we've just had enough.
18552 } while (
18553 scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
18554 );
18555 }
18556
18557 if ( valueParts ) {
18558 initialInUnit = +initialInUnit || +initial || 0;
18559
18560 // Apply relative offset (+=/-=) if specified
18561 adjusted = valueParts[ 1 ] ?
18562 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
18563 +valueParts[ 2 ];
18564 if ( tween ) {
18565 tween.unit = unit;
18566 tween.start = initialInUnit;
18567 tween.end = adjusted;
18568 }
18569 }
18570 return adjusted;
18571}
18572
18573
18574var defaultDisplayMap = {};
18575
18576function getDefaultDisplay( elem ) {
18577 var temp,
18578 doc = elem.ownerDocument,
18579 nodeName = elem.nodeName,
18580 display = defaultDisplayMap[ nodeName ];
18581
18582 if ( display ) {
18583 return display;
18584 }
18585
18586 temp = doc.body.appendChild( doc.createElement( nodeName ) );
18587 display = jQuery.css( temp, "display" );
18588
18589 temp.parentNode.removeChild( temp );
18590
18591 if ( display === "none" ) {
18592 display = "block";
18593 }
18594 defaultDisplayMap[ nodeName ] = display;
18595
18596 return display;
18597}
18598
18599function showHide( elements, show ) {
18600 var display, elem,
18601 values = [],
18602 index = 0,
18603 length = elements.length;
18604
18605 // Determine new display value for elements that need to change
18606 for ( ; index < length; index++ ) {
18607 elem = elements[ index ];
18608 if ( !elem.style ) {
18609 continue;
18610 }
18611
18612 display = elem.style.display;
18613 if ( show ) {
18614
18615 // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
18616 // check is required in this first loop unless we have a nonempty display value (either
18617 // inline or about-to-be-restored)
18618 if ( display === "none" ) {
18619 values[ index ] = dataPriv.get( elem, "display" ) || null;
18620 if ( !values[ index ] ) {
18621 elem.style.display = "";
18622 }
18623 }
18624 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
18625 values[ index ] = getDefaultDisplay( elem );
18626 }
18627 } else {
18628 if ( display !== "none" ) {
18629 values[ index ] = "none";
18630
18631 // Remember what we're overwriting
18632 dataPriv.set( elem, "display", display );
18633 }
18634 }
18635 }
18636
18637 // Set the display of the elements in a second loop to avoid constant reflow
18638 for ( index = 0; index < length; index++ ) {
18639 if ( values[ index ] != null ) {
18640 elements[ index ].style.display = values[ index ];
18641 }
18642 }
18643
18644 return elements;
18645}
18646
18647jQuery.fn.extend( {
18648 show: function() {
18649 return showHide( this, true );
18650 },
18651 hide: function() {
18652 return showHide( this );
18653 },
18654 toggle: function( state ) {
18655 if ( typeof state === "boolean" ) {
18656 return state ? this.show() : this.hide();
18657 }
18658
18659 return this.each( function() {
18660 if ( isHiddenWithinTree( this ) ) {
18661 jQuery( this ).show();
18662 } else {
18663 jQuery( this ).hide();
18664 }
18665 } );
18666 }
18667} );
18668var rcheckableType = ( /^(?:checkbox|radio)$/i );
18669
18670var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
18671
18672var rscriptType = ( /^$|\/(?:java|ecma)script/i );
18673
18674
18675
18676// We have to close these tags to support XHTML (#13200)
18677var wrapMap = {
18678
18679 // Support: IE <=9 only
18680 option: [ 1, "<select multiple='multiple'>", "</select>" ],
18681
18682 // XHTML parsers do not magically insert elements in the
18683 // same way that tag soup parsers do. So we cannot shorten
18684 // this by omitting <tbody> or other required elements.
18685 thead: [ 1, "<table>", "</table>" ],
18686 col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
18687 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
18688 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
18689
18690 _default: [ 0, "", "" ]
18691};
18692
18693// Support: IE <=9 only
18694wrapMap.optgroup = wrapMap.option;
18695
18696wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
18697wrapMap.th = wrapMap.td;
18698
18699
18700function getAll( context, tag ) {
18701
18702 // Support: IE <=9 - 11 only
18703 // Use typeof to avoid zero-argument method invocation on host objects (#15151)
18704 var ret;
18705
18706 if ( typeof context.getElementsByTagName !== "undefined" ) {
18707 ret = context.getElementsByTagName( tag || "*" );
18708
18709 } else if ( typeof context.querySelectorAll !== "undefined" ) {
18710 ret = context.querySelectorAll( tag || "*" );
18711
18712 } else {
18713 ret = [];
18714 }
18715
18716 if ( tag === undefined || tag && nodeName( context, tag ) ) {
18717 return jQuery.merge( [ context ], ret );
18718 }
18719
18720 return ret;
18721}
18722
18723
18724// Mark scripts as having already been evaluated
18725function setGlobalEval( elems, refElements ) {
18726 var i = 0,
18727 l = elems.length;
18728
18729 for ( ; i < l; i++ ) {
18730 dataPriv.set(
18731 elems[ i ],
18732 "globalEval",
18733 !refElements || dataPriv.get( refElements[ i ], "globalEval" )
18734 );
18735 }
18736}
18737
18738
18739var rhtml = /<|&#?\w+;/;
18740
18741function buildFragment( elems, context, scripts, selection, ignored ) {
18742 var elem, tmp, tag, wrap, contains, j,
18743 fragment = context.createDocumentFragment(),
18744 nodes = [],
18745 i = 0,
18746 l = elems.length;
18747
18748 for ( ; i < l; i++ ) {
18749 elem = elems[ i ];
18750
18751 if ( elem || elem === 0 ) {
18752
18753 // Add nodes directly
18754 if ( jQuery.type( elem ) === "object" ) {
18755
18756 // Support: Android <=4.0 only, PhantomJS 1 only
18757 // push.apply(_, arraylike) throws on ancient WebKit
18758 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
18759
18760 // Convert non-html into a text node
18761 } else if ( !rhtml.test( elem ) ) {
18762 nodes.push( context.createTextNode( elem ) );
18763
18764 // Convert html into DOM nodes
18765 } else {
18766 tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
18767
18768 // Deserialize a standard representation
18769 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
18770 wrap = wrapMap[ tag ] || wrapMap._default;
18771 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
18772
18773 // Descend through wrappers to the right content
18774 j = wrap[ 0 ];
18775 while ( j-- ) {
18776 tmp = tmp.lastChild;
18777 }
18778
18779 // Support: Android <=4.0 only, PhantomJS 1 only
18780 // push.apply(_, arraylike) throws on ancient WebKit
18781 jQuery.merge( nodes, tmp.childNodes );
18782
18783 // Remember the top-level container
18784 tmp = fragment.firstChild;
18785
18786 // Ensure the created nodes are orphaned (#12392)
18787 tmp.textContent = "";
18788 }
18789 }
18790 }
18791
18792 // Remove wrapper from fragment
18793 fragment.textContent = "";
18794
18795 i = 0;
18796 while ( ( elem = nodes[ i++ ] ) ) {
18797
18798 // Skip elements already in the context collection (trac-4087)
18799 if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
18800 if ( ignored ) {
18801 ignored.push( elem );
18802 }
18803 continue;
18804 }
18805
18806 contains = jQuery.contains( elem.ownerDocument, elem );
18807
18808 // Append to fragment
18809 tmp = getAll( fragment.appendChild( elem ), "script" );
18810
18811 // Preserve script evaluation history
18812 if ( contains ) {
18813 setGlobalEval( tmp );
18814 }
18815
18816 // Capture executables
18817 if ( scripts ) {
18818 j = 0;
18819 while ( ( elem = tmp[ j++ ] ) ) {
18820 if ( rscriptType.test( elem.type || "" ) ) {
18821 scripts.push( elem );
18822 }
18823 }
18824 }
18825 }
18826
18827 return fragment;
18828}
18829
18830
18831( function() {
18832 var fragment = document.createDocumentFragment(),
18833 div = fragment.appendChild( document.createElement( "div" ) ),
18834 input = document.createElement( "input" );
18835
18836 // Support: Android 4.0 - 4.3 only
18837 // Check state lost if the name is set (#11217)
18838 // Support: Windows Web Apps (WWA)
18839 // `name` and `type` must use .setAttribute for WWA (#14901)
18840 input.setAttribute( "type", "radio" );
18841 input.setAttribute( "checked", "checked" );
18842 input.setAttribute( "name", "t" );
18843
18844 div.appendChild( input );
18845
18846 // Support: Android <=4.1 only
18847 // Older WebKit doesn't clone checked state correctly in fragments
18848 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
18849
18850 // Support: IE <=11 only
18851 // Make sure textarea (and checkbox) defaultValue is properly cloned
18852 div.innerHTML = "<textarea>x</textarea>";
18853 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
18854} )();
18855var documentElement = document.documentElement;
18856
18857
18858
18859var
18860 rkeyEvent = /^key/,
18861 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
18862 rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
18863
18864function returnTrue() {
18865 return true;
18866}
18867
18868function returnFalse() {
18869 return false;
18870}
18871
18872// Support: IE <=9 only
18873// See #13393 for more info
18874function safeActiveElement() {
18875 try {
18876 return document.activeElement;
18877 } catch ( err ) { }
18878}
18879
18880function on( elem, types, selector, data, fn, one ) {
18881 var origFn, type;
18882
18883 // Types can be a map of types/handlers
18884 if ( typeof types === "object" ) {
18885
18886 // ( types-Object, selector, data )
18887 if ( typeof selector !== "string" ) {
18888
18889 // ( types-Object, data )
18890 data = data || selector;
18891 selector = undefined;
18892 }
18893 for ( type in types ) {
18894 on( elem, type, selector, data, types[ type ], one );
18895 }
18896 return elem;
18897 }
18898
18899 if ( data == null && fn == null ) {
18900
18901 // ( types, fn )
18902 fn = selector;
18903 data = selector = undefined;
18904 } else if ( fn == null ) {
18905 if ( typeof selector === "string" ) {
18906
18907 // ( types, selector, fn )
18908 fn = data;
18909 data = undefined;
18910 } else {
18911
18912 // ( types, data, fn )
18913 fn = data;
18914 data = selector;
18915 selector = undefined;
18916 }
18917 }
18918 if ( fn === false ) {
18919 fn = returnFalse;
18920 } else if ( !fn ) {
18921 return elem;
18922 }
18923
18924 if ( one === 1 ) {
18925 origFn = fn;
18926 fn = function( event ) {
18927
18928 // Can use an empty set, since event contains the info
18929 jQuery().off( event );
18930 return origFn.apply( this, arguments );
18931 };
18932
18933 // Use same guid so caller can remove using origFn
18934 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
18935 }
18936 return elem.each( function() {
18937 jQuery.event.add( this, types, fn, data, selector );
18938 } );
18939}
18940
18941/*
18942 * Helper functions for managing events -- not part of the public interface.
18943 * Props to Dean Edwards' addEvent library for many of the ideas.
18944 */
18945jQuery.event = {
18946
18947 global: {},
18948
18949 add: function( elem, types, handler, data, selector ) {
18950
18951 var handleObjIn, eventHandle, tmp,
18952 events, t, handleObj,
18953 special, handlers, type, namespaces, origType,
18954 elemData = dataPriv.get( elem );
18955
18956 // Don't attach events to noData or text/comment nodes (but allow plain objects)
18957 if ( !elemData ) {
18958 return;
18959 }
18960
18961 // Caller can pass in an object of custom data in lieu of the handler
18962 if ( handler.handler ) {
18963 handleObjIn = handler;
18964 handler = handleObjIn.handler;
18965 selector = handleObjIn.selector;
18966 }
18967
18968 // Ensure that invalid selectors throw exceptions at attach time
18969 // Evaluate against documentElement in case elem is a non-element node (e.g., document)
18970 if ( selector ) {
18971 jQuery.find.matchesSelector( documentElement, selector );
18972 }
18973
18974 // Make sure that the handler has a unique ID, used to find/remove it later
18975 if ( !handler.guid ) {
18976 handler.guid = jQuery.guid++;
18977 }
18978
18979 // Init the element's event structure and main handler, if this is the first
18980 if ( !( events = elemData.events ) ) {
18981 events = elemData.events = {};
18982 }
18983 if ( !( eventHandle = elemData.handle ) ) {
18984 eventHandle = elemData.handle = function( e ) {
18985
18986 // Discard the second event of a jQuery.event.trigger() and
18987 // when an event is called after a page has unloaded
18988 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
18989 jQuery.event.dispatch.apply( elem, arguments ) : undefined;
18990 };
18991 }
18992
18993 // Handle multiple events separated by a space
18994 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
18995 t = types.length;
18996 while ( t-- ) {
18997 tmp = rtypenamespace.exec( types[ t ] ) || [];
18998 type = origType = tmp[ 1 ];
18999 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
19000
19001 // There *must* be a type, no attaching namespace-only handlers
19002 if ( !type ) {
19003 continue;
19004 }
19005
19006 // If event changes its type, use the special event handlers for the changed type
19007 special = jQuery.event.special[ type ] || {};
19008
19009 // If selector defined, determine special event api type, otherwise given type
19010 type = ( selector ? special.delegateType : special.bindType ) || type;
19011
19012 // Update special based on newly reset type
19013 special = jQuery.event.special[ type ] || {};
19014
19015 // handleObj is passed to all event handlers
19016 handleObj = jQuery.extend( {
19017 type: type,
19018 origType: origType,
19019 data: data,
19020 handler: handler,
19021 guid: handler.guid,
19022 selector: selector,
19023 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
19024 namespace: namespaces.join( "." )
19025 }, handleObjIn );
19026
19027 // Init the event handler queue if we're the first
19028 if ( !( handlers = events[ type ] ) ) {
19029 handlers = events[ type ] = [];
19030 handlers.delegateCount = 0;
19031
19032 // Only use addEventListener if the special events handler returns false
19033 if ( !special.setup ||
19034 special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
19035
19036 if ( elem.addEventListener ) {
19037 elem.addEventListener( type, eventHandle );
19038 }
19039 }
19040 }
19041
19042 if ( special.add ) {
19043 special.add.call( elem, handleObj );
19044
19045 if ( !handleObj.handler.guid ) {
19046 handleObj.handler.guid = handler.guid;
19047 }
19048 }
19049
19050 // Add to the element's handler list, delegates in front
19051 if ( selector ) {
19052 handlers.splice( handlers.delegateCount++, 0, handleObj );
19053 } else {
19054 handlers.push( handleObj );
19055 }
19056
19057 // Keep track of which events have ever been used, for event optimization
19058 jQuery.event.global[ type ] = true;
19059 }
19060
19061 },
19062
19063 // Detach an event or set of events from an element
19064 remove: function( elem, types, handler, selector, mappedTypes ) {
19065
19066 var j, origCount, tmp,
19067 events, t, handleObj,
19068 special, handlers, type, namespaces, origType,
19069 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
19070
19071 if ( !elemData || !( events = elemData.events ) ) {
19072 return;
19073 }
19074
19075 // Once for each type.namespace in types; type may be omitted
19076 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
19077 t = types.length;
19078 while ( t-- ) {
19079 tmp = rtypenamespace.exec( types[ t ] ) || [];
19080 type = origType = tmp[ 1 ];
19081 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
19082
19083 // Unbind all events (on this namespace, if provided) for the element
19084 if ( !type ) {
19085 for ( type in events ) {
19086 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
19087 }
19088 continue;
19089 }
19090
19091 special = jQuery.event.special[ type ] || {};
19092 type = ( selector ? special.delegateType : special.bindType ) || type;
19093 handlers = events[ type ] || [];
19094 tmp = tmp[ 2 ] &&
19095 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
19096
19097 // Remove matching events
19098 origCount = j = handlers.length;
19099 while ( j-- ) {
19100 handleObj = handlers[ j ];
19101
19102 if ( ( mappedTypes || origType === handleObj.origType ) &&
19103 ( !handler || handler.guid === handleObj.guid ) &&
19104 ( !tmp || tmp.test( handleObj.namespace ) ) &&
19105 ( !selector || selector === handleObj.selector ||
19106 selector === "**" && handleObj.selector ) ) {
19107 handlers.splice( j, 1 );
19108
19109 if ( handleObj.selector ) {
19110 handlers.delegateCount--;
19111 }
19112 if ( special.remove ) {
19113 special.remove.call( elem, handleObj );
19114 }
19115 }
19116 }
19117
19118 // Remove generic event handler if we removed something and no more handlers exist
19119 // (avoids potential for endless recursion during removal of special event handlers)
19120 if ( origCount && !handlers.length ) {
19121 if ( !special.teardown ||
19122 special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
19123
19124 jQuery.removeEvent( elem, type, elemData.handle );
19125 }
19126
19127 delete events[ type ];
19128 }
19129 }
19130
19131 // Remove data and the expando if it's no longer used
19132 if ( jQuery.isEmptyObject( events ) ) {
19133 dataPriv.remove( elem, "handle events" );
19134 }
19135 },
19136
19137 dispatch: function( nativeEvent ) {
19138
19139 // Make a writable jQuery.Event from the native event object
19140 var event = jQuery.event.fix( nativeEvent );
19141
19142 var i, j, ret, matched, handleObj, handlerQueue,
19143 args = new Array( arguments.length ),
19144 handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
19145 special = jQuery.event.special[ event.type ] || {};
19146
19147 // Use the fix-ed jQuery.Event rather than the (read-only) native event
19148 args[ 0 ] = event;
19149
19150 for ( i = 1; i < arguments.length; i++ ) {
19151 args[ i ] = arguments[ i ];
19152 }
19153
19154 event.delegateTarget = this;
19155
19156 // Call the preDispatch hook for the mapped type, and let it bail if desired
19157 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
19158 return;
19159 }
19160
19161 // Determine handlers
19162 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
19163
19164 // Run delegates first; they may want to stop propagation beneath us
19165 i = 0;
19166 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
19167 event.currentTarget = matched.elem;
19168
19169 j = 0;
19170 while ( ( handleObj = matched.handlers[ j++ ] ) &&
19171 !event.isImmediatePropagationStopped() ) {
19172
19173 // Triggered event must either 1) have no namespace, or 2) have namespace(s)
19174 // a subset or equal to those in the bound event (both can have no namespace).
19175 if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
19176
19177 event.handleObj = handleObj;
19178 event.data = handleObj.data;
19179
19180 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
19181 handleObj.handler ).apply( matched.elem, args );
19182
19183 if ( ret !== undefined ) {
19184 if ( ( event.result = ret ) === false ) {
19185 event.preventDefault();
19186 event.stopPropagation();
19187 }
19188 }
19189 }
19190 }
19191 }
19192
19193 // Call the postDispatch hook for the mapped type
19194 if ( special.postDispatch ) {
19195 special.postDispatch.call( this, event );
19196 }
19197
19198 return event.result;
19199 },
19200
19201 handlers: function( event, handlers ) {
19202 var i, handleObj, sel, matchedHandlers, matchedSelectors,
19203 handlerQueue = [],
19204 delegateCount = handlers.delegateCount,
19205 cur = event.target;
19206
19207 // Find delegate handlers
19208 if ( delegateCount &&
19209
19210 // Support: IE <=9
19211 // Black-hole SVG <use> instance trees (trac-13180)
19212 cur.nodeType &&
19213
19214 // Support: Firefox <=42
19215 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
19216 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
19217 // Support: IE 11 only
19218 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
19219 !( event.type === "click" && event.button >= 1 ) ) {
19220
19221 for ( ; cur !== this; cur = cur.parentNode || this ) {
19222
19223 // Don't check non-elements (#13208)
19224 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
19225 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
19226 matchedHandlers = [];
19227 matchedSelectors = {};
19228 for ( i = 0; i < delegateCount; i++ ) {
19229 handleObj = handlers[ i ];
19230
19231 // Don't conflict with Object.prototype properties (#13203)
19232 sel = handleObj.selector + " ";
19233
19234 if ( matchedSelectors[ sel ] === undefined ) {
19235 matchedSelectors[ sel ] = handleObj.needsContext ?
19236 jQuery( sel, this ).index( cur ) > -1 :
19237 jQuery.find( sel, this, null, [ cur ] ).length;
19238 }
19239 if ( matchedSelectors[ sel ] ) {
19240 matchedHandlers.push( handleObj );
19241 }
19242 }
19243 if ( matchedHandlers.length ) {
19244 handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
19245 }
19246 }
19247 }
19248 }
19249
19250 // Add the remaining (directly-bound) handlers
19251 cur = this;
19252 if ( delegateCount < handlers.length ) {
19253 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
19254 }
19255
19256 return handlerQueue;
19257 },
19258
19259 addProp: function( name, hook ) {
19260 Object.defineProperty( jQuery.Event.prototype, name, {
19261 enumerable: true,
19262 configurable: true,
19263
19264 get: jQuery.isFunction( hook ) ?
19265 function() {
19266 if ( this.originalEvent ) {
19267 return hook( this.originalEvent );
19268 }
19269 } :
19270 function() {
19271 if ( this.originalEvent ) {
19272 return this.originalEvent[ name ];
19273 }
19274 },
19275
19276 set: function( value ) {
19277 Object.defineProperty( this, name, {
19278 enumerable: true,
19279 configurable: true,
19280 writable: true,
19281 value: value
19282 } );
19283 }
19284 } );
19285 },
19286
19287 fix: function( originalEvent ) {
19288 return originalEvent[ jQuery.expando ] ?
19289 originalEvent :
19290 new jQuery.Event( originalEvent );
19291 },
19292
19293 special: {
19294 load: {
19295
19296 // Prevent triggered image.load events from bubbling to window.load
19297 noBubble: true
19298 },
19299 focus: {
19300
19301 // Fire native event if possible so blur/focus sequence is correct
19302 trigger: function() {
19303 if ( this !== safeActiveElement() && this.focus ) {
19304 this.focus();
19305 return false;
19306 }
19307 },
19308 delegateType: "focusin"
19309 },
19310 blur: {
19311 trigger: function() {
19312 if ( this === safeActiveElement() && this.blur ) {
19313 this.blur();
19314 return false;
19315 }
19316 },
19317 delegateType: "focusout"
19318 },
19319 click: {
19320
19321 // For checkbox, fire native event so checked state will be right
19322 trigger: function() {
19323 if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) {
19324 this.click();
19325 return false;
19326 }
19327 },
19328
19329 // For cross-browser consistency, don't fire native .click() on links
19330 _default: function( event ) {
19331 return nodeName( event.target, "a" );
19332 }
19333 },
19334
19335 beforeunload: {
19336 postDispatch: function( event ) {
19337
19338 // Support: Firefox 20+
19339 // Firefox doesn't alert if the returnValue field is not set.
19340 if ( event.result !== undefined && event.originalEvent ) {
19341 event.originalEvent.returnValue = event.result;
19342 }
19343 }
19344 }
19345 }
19346};
19347
19348jQuery.removeEvent = function( elem, type, handle ) {
19349
19350 // This "if" is needed for plain objects
19351 if ( elem.removeEventListener ) {
19352 elem.removeEventListener( type, handle );
19353 }
19354};
19355
19356jQuery.Event = function( src, props ) {
19357
19358 // Allow instantiation without the 'new' keyword
19359 if ( !( this instanceof jQuery.Event ) ) {
19360 return new jQuery.Event( src, props );
19361 }
19362
19363 // Event object
19364 if ( src && src.type ) {
19365 this.originalEvent = src;
19366 this.type = src.type;
19367
19368 // Events bubbling up the document may have been marked as prevented
19369 // by a handler lower down the tree; reflect the correct value.
19370 this.isDefaultPrevented = src.defaultPrevented ||
19371 src.defaultPrevented === undefined &&
19372
19373 // Support: Android <=2.3 only
19374 src.returnValue === false ?
19375 returnTrue :
19376 returnFalse;
19377
19378 // Create target properties
19379 // Support: Safari <=6 - 7 only
19380 // Target should not be a text node (#504, #13143)
19381 this.target = ( src.target && src.target.nodeType === 3 ) ?
19382 src.target.parentNode :
19383 src.target;
19384
19385 this.currentTarget = src.currentTarget;
19386 this.relatedTarget = src.relatedTarget;
19387
19388 // Event type
19389 } else {
19390 this.type = src;
19391 }
19392
19393 // Put explicitly provided properties onto the event object
19394 if ( props ) {
19395 jQuery.extend( this, props );
19396 }
19397
19398 // Create a timestamp if incoming event doesn't have one
19399 this.timeStamp = src && src.timeStamp || jQuery.now();
19400
19401 // Mark it as fixed
19402 this[ jQuery.expando ] = true;
19403};
19404
19405// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
19406// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
19407jQuery.Event.prototype = {
19408 constructor: jQuery.Event,
19409 isDefaultPrevented: returnFalse,
19410 isPropagationStopped: returnFalse,
19411 isImmediatePropagationStopped: returnFalse,
19412 isSimulated: false,
19413
19414 preventDefault: function() {
19415 var e = this.originalEvent;
19416
19417 this.isDefaultPrevented = returnTrue;
19418
19419 if ( e && !this.isSimulated ) {
19420 e.preventDefault();
19421 }
19422 },
19423 stopPropagation: function() {
19424 var e = this.originalEvent;
19425
19426 this.isPropagationStopped = returnTrue;
19427
19428 if ( e && !this.isSimulated ) {
19429 e.stopPropagation();
19430 }
19431 },
19432 stopImmediatePropagation: function() {
19433 var e = this.originalEvent;
19434
19435 this.isImmediatePropagationStopped = returnTrue;
19436
19437 if ( e && !this.isSimulated ) {
19438 e.stopImmediatePropagation();
19439 }
19440
19441 this.stopPropagation();
19442 }
19443};
19444
19445// Includes all common event props including KeyEvent and MouseEvent specific props
19446jQuery.each( {
19447 altKey: true,
19448 bubbles: true,
19449 cancelable: true,
19450 changedTouches: true,
19451 ctrlKey: true,
19452 detail: true,
19453 eventPhase: true,
19454 metaKey: true,
19455 pageX: true,
19456 pageY: true,
19457 shiftKey: true,
19458 view: true,
19459 "char": true,
19460 charCode: true,
19461 key: true,
19462 keyCode: true,
19463 button: true,
19464 buttons: true,
19465 clientX: true,
19466 clientY: true,
19467 offsetX: true,
19468 offsetY: true,
19469 pointerId: true,
19470 pointerType: true,
19471 screenX: true,
19472 screenY: true,
19473 targetTouches: true,
19474 toElement: true,
19475 touches: true,
19476
19477 which: function( event ) {
19478 var button = event.button;
19479
19480 // Add which for key events
19481 if ( event.which == null && rkeyEvent.test( event.type ) ) {
19482 return event.charCode != null ? event.charCode : event.keyCode;
19483 }
19484
19485 // Add which for click: 1 === left; 2 === middle; 3 === right
19486 if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
19487 if ( button & 1 ) {
19488 return 1;
19489 }
19490
19491 if ( button & 2 ) {
19492 return 3;
19493 }
19494
19495 if ( button & 4 ) {
19496 return 2;
19497 }
19498
19499 return 0;
19500 }
19501
19502 return event.which;
19503 }
19504}, jQuery.event.addProp );
19505
19506// Create mouseenter/leave events using mouseover/out and event-time checks
19507// so that event delegation works in jQuery.
19508// Do the same for pointerenter/pointerleave and pointerover/pointerout
19509//
19510// Support: Safari 7 only
19511// Safari sends mouseenter too often; see:
19512// https://bugs.chromium.org/p/chromium/issues/detail?id=470258
19513// for the description of the bug (it existed in older Chrome versions as well).
19514jQuery.each( {
19515 mouseenter: "mouseover",
19516 mouseleave: "mouseout",
19517 pointerenter: "pointerover",
19518 pointerleave: "pointerout"
19519}, function( orig, fix ) {
19520 jQuery.event.special[ orig ] = {
19521 delegateType: fix,
19522 bindType: fix,
19523
19524 handle: function( event ) {
19525 var ret,
19526 target = this,
19527 related = event.relatedTarget,
19528 handleObj = event.handleObj;
19529
19530 // For mouseenter/leave call the handler if related is outside the target.
19531 // NB: No relatedTarget if the mouse left/entered the browser window
19532 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
19533 event.type = handleObj.origType;
19534 ret = handleObj.handler.apply( this, arguments );
19535 event.type = fix;
19536 }
19537 return ret;
19538 }
19539 };
19540} );
19541
19542jQuery.fn.extend( {
19543
19544 on: function( types, selector, data, fn ) {
19545 return on( this, types, selector, data, fn );
19546 },
19547 one: function( types, selector, data, fn ) {
19548 return on( this, types, selector, data, fn, 1 );
19549 },
19550 off: function( types, selector, fn ) {
19551 var handleObj, type;
19552 if ( types && types.preventDefault && types.handleObj ) {
19553
19554 // ( event ) dispatched jQuery.Event
19555 handleObj = types.handleObj;
19556 jQuery( types.delegateTarget ).off(
19557 handleObj.namespace ?
19558 handleObj.origType + "." + handleObj.namespace :
19559 handleObj.origType,
19560 handleObj.selector,
19561 handleObj.handler
19562 );
19563 return this;
19564 }
19565 if ( typeof types === "object" ) {
19566
19567 // ( types-object [, selector] )
19568 for ( type in types ) {
19569 this.off( type, selector, types[ type ] );
19570 }
19571 return this;
19572 }
19573 if ( selector === false || typeof selector === "function" ) {
19574
19575 // ( types [, fn] )
19576 fn = selector;
19577 selector = undefined;
19578 }
19579 if ( fn === false ) {
19580 fn = returnFalse;
19581 }
19582 return this.each( function() {
19583 jQuery.event.remove( this, types, fn, selector );
19584 } );
19585 }
19586} );
19587
19588
19589var
19590
19591 /* eslint-disable max-len */
19592
19593 // See https://github.com/eslint/eslint/issues/3229
19594 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
19595
19596 /* eslint-enable */
19597
19598 // Support: IE <=10 - 11, Edge 12 - 13
19599 // In IE/Edge using regex groups here causes severe slowdowns.
19600 // See https://connect.microsoft.com/IE/feedback/details/1736512/
19601 rnoInnerhtml = /<script|<style|<link/i,
19602
19603 // checked="checked" or checked
19604 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
19605 rscriptTypeMasked = /^true\/(.*)/,
19606 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
19607
19608// Prefer a tbody over its parent table for containing new rows
19609function manipulationTarget( elem, content ) {
19610 if ( nodeName( elem, "table" ) &&
19611 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
19612
19613 return jQuery( ">tbody", elem )[ 0 ] || elem;
19614 }
19615
19616 return elem;
19617}
19618
19619// Replace/restore the type attribute of script elements for safe DOM manipulation
19620function disableScript( elem ) {
19621 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
19622 return elem;
19623}
19624function restoreScript( elem ) {
19625 var match = rscriptTypeMasked.exec( elem.type );
19626
19627 if ( match ) {
19628 elem.type = match[ 1 ];
19629 } else {
19630 elem.removeAttribute( "type" );
19631 }
19632
19633 return elem;
19634}
19635
19636function cloneCopyEvent( src, dest ) {
19637 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
19638
19639 if ( dest.nodeType !== 1 ) {
19640 return;
19641 }
19642
19643 // 1. Copy private data: events, handlers, etc.
19644 if ( dataPriv.hasData( src ) ) {
19645 pdataOld = dataPriv.access( src );
19646 pdataCur = dataPriv.set( dest, pdataOld );
19647 events = pdataOld.events;
19648
19649 if ( events ) {
19650 delete pdataCur.handle;
19651 pdataCur.events = {};
19652
19653 for ( type in events ) {
19654 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
19655 jQuery.event.add( dest, type, events[ type ][ i ] );
19656 }
19657 }
19658 }
19659 }
19660
19661 // 2. Copy user data
19662 if ( dataUser.hasData( src ) ) {
19663 udataOld = dataUser.access( src );
19664 udataCur = jQuery.extend( {}, udataOld );
19665
19666 dataUser.set( dest, udataCur );
19667 }
19668}
19669
19670// Fix IE bugs, see support tests
19671function fixInput( src, dest ) {
19672 var nodeName = dest.nodeName.toLowerCase();
19673
19674 // Fails to persist the checked state of a cloned checkbox or radio button.
19675 if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
19676 dest.checked = src.checked;
19677
19678 // Fails to return the selected option to the default selected state when cloning options
19679 } else if ( nodeName === "input" || nodeName === "textarea" ) {
19680 dest.defaultValue = src.defaultValue;
19681 }
19682}
19683
19684function domManip( collection, args, callback, ignored ) {
19685
19686 // Flatten any nested arrays
19687 args = concat.apply( [], args );
19688
19689 var fragment, first, scripts, hasScripts, node, doc,
19690 i = 0,
19691 l = collection.length,
19692 iNoClone = l - 1,
19693 value = args[ 0 ],
19694 isFunction = jQuery.isFunction( value );
19695
19696 // We can't cloneNode fragments that contain checked, in WebKit
19697 if ( isFunction ||
19698 ( l > 1 && typeof value === "string" &&
19699 !support.checkClone && rchecked.test( value ) ) ) {
19700 return collection.each( function( index ) {
19701 var self = collection.eq( index );
19702 if ( isFunction ) {
19703 args[ 0 ] = value.call( this, index, self.html() );
19704 }
19705 domManip( self, args, callback, ignored );
19706 } );
19707 }
19708
19709 if ( l ) {
19710 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
19711 first = fragment.firstChild;
19712
19713 if ( fragment.childNodes.length === 1 ) {
19714 fragment = first;
19715 }
19716
19717 // Require either new content or an interest in ignored elements to invoke the callback
19718 if ( first || ignored ) {
19719 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
19720 hasScripts = scripts.length;
19721
19722 // Use the original fragment for the last item
19723 // instead of the first because it can end up
19724 // being emptied incorrectly in certain situations (#8070).
19725 for ( ; i < l; i++ ) {
19726 node = fragment;
19727
19728 if ( i !== iNoClone ) {
19729 node = jQuery.clone( node, true, true );
19730
19731 // Keep references to cloned scripts for later restoration
19732 if ( hasScripts ) {
19733
19734 // Support: Android <=4.0 only, PhantomJS 1 only
19735 // push.apply(_, arraylike) throws on ancient WebKit
19736 jQuery.merge( scripts, getAll( node, "script" ) );
19737 }
19738 }
19739
19740 callback.call( collection[ i ], node, i );
19741 }
19742
19743 if ( hasScripts ) {
19744 doc = scripts[ scripts.length - 1 ].ownerDocument;
19745
19746 // Reenable scripts
19747 jQuery.map( scripts, restoreScript );
19748
19749 // Evaluate executable scripts on first document insertion
19750 for ( i = 0; i < hasScripts; i++ ) {
19751 node = scripts[ i ];
19752 if ( rscriptType.test( node.type || "" ) &&
19753 !dataPriv.access( node, "globalEval" ) &&
19754 jQuery.contains( doc, node ) ) {
19755
19756 if ( node.src ) {
19757
19758 // Optional AJAX dependency, but won't run scripts if not present
19759 if ( jQuery._evalUrl ) {
19760 jQuery._evalUrl( node.src );
19761 }
19762 } else {
19763 DOMEval( node.textContent.replace( rcleanScript, "" ), doc );
19764 }
19765 }
19766 }
19767 }
19768 }
19769 }
19770
19771 return collection;
19772}
19773
19774function remove( elem, selector, keepData ) {
19775 var node,
19776 nodes = selector ? jQuery.filter( selector, elem ) : elem,
19777 i = 0;
19778
19779 for ( ; ( node = nodes[ i ] ) != null; i++ ) {
19780 if ( !keepData && node.nodeType === 1 ) {
19781 jQuery.cleanData( getAll( node ) );
19782 }
19783
19784 if ( node.parentNode ) {
19785 if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
19786 setGlobalEval( getAll( node, "script" ) );
19787 }
19788 node.parentNode.removeChild( node );
19789 }
19790 }
19791
19792 return elem;
19793}
19794
19795jQuery.extend( {
19796 htmlPrefilter: function( html ) {
19797 return html.replace( rxhtmlTag, "<$1></$2>" );
19798 },
19799
19800 clone: function( elem, dataAndEvents, deepDataAndEvents ) {
19801 var i, l, srcElements, destElements,
19802 clone = elem.cloneNode( true ),
19803 inPage = jQuery.contains( elem.ownerDocument, elem );
19804
19805 // Fix IE cloning issues
19806 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
19807 !jQuery.isXMLDoc( elem ) ) {
19808
19809 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
19810 destElements = getAll( clone );
19811 srcElements = getAll( elem );
19812
19813 for ( i = 0, l = srcElements.length; i < l; i++ ) {
19814 fixInput( srcElements[ i ], destElements[ i ] );
19815 }
19816 }
19817
19818 // Copy the events from the original to the clone
19819 if ( dataAndEvents ) {
19820 if ( deepDataAndEvents ) {
19821 srcElements = srcElements || getAll( elem );
19822 destElements = destElements || getAll( clone );
19823
19824 for ( i = 0, l = srcElements.length; i < l; i++ ) {
19825 cloneCopyEvent( srcElements[ i ], destElements[ i ] );
19826 }
19827 } else {
19828 cloneCopyEvent( elem, clone );
19829 }
19830 }
19831
19832 // Preserve script evaluation history
19833 destElements = getAll( clone, "script" );
19834 if ( destElements.length > 0 ) {
19835 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
19836 }
19837
19838 // Return the cloned set
19839 return clone;
19840 },
19841
19842 cleanData: function( elems ) {
19843 var data, elem, type,
19844 special = jQuery.event.special,
19845 i = 0;
19846
19847 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
19848 if ( acceptData( elem ) ) {
19849 if ( ( data = elem[ dataPriv.expando ] ) ) {
19850 if ( data.events ) {
19851 for ( type in data.events ) {
19852 if ( special[ type ] ) {
19853 jQuery.event.remove( elem, type );
19854
19855 // This is a shortcut to avoid jQuery.event.remove's overhead
19856 } else {
19857 jQuery.removeEvent( elem, type, data.handle );
19858 }
19859 }
19860 }
19861
19862 // Support: Chrome <=35 - 45+
19863 // Assign undefined instead of using delete, see Data#remove
19864 elem[ dataPriv.expando ] = undefined;
19865 }
19866 if ( elem[ dataUser.expando ] ) {
19867
19868 // Support: Chrome <=35 - 45+
19869 // Assign undefined instead of using delete, see Data#remove
19870 elem[ dataUser.expando ] = undefined;
19871 }
19872 }
19873 }
19874 }
19875} );
19876
19877jQuery.fn.extend( {
19878 detach: function( selector ) {
19879 return remove( this, selector, true );
19880 },
19881
19882 remove: function( selector ) {
19883 return remove( this, selector );
19884 },
19885
19886 text: function( value ) {
19887 return access( this, function( value ) {
19888 return value === undefined ?
19889 jQuery.text( this ) :
19890 this.empty().each( function() {
19891 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
19892 this.textContent = value;
19893 }
19894 } );
19895 }, null, value, arguments.length );
19896 },
19897
19898 append: function() {
19899 return domManip( this, arguments, function( elem ) {
19900 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
19901 var target = manipulationTarget( this, elem );
19902 target.appendChild( elem );
19903 }
19904 } );
19905 },
19906
19907 prepend: function() {
19908 return domManip( this, arguments, function( elem ) {
19909 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
19910 var target = manipulationTarget( this, elem );
19911 target.insertBefore( elem, target.firstChild );
19912 }
19913 } );
19914 },
19915
19916 before: function() {
19917 return domManip( this, arguments, function( elem ) {
19918 if ( this.parentNode ) {
19919 this.parentNode.insertBefore( elem, this );
19920 }
19921 } );
19922 },
19923
19924 after: function() {
19925 return domManip( this, arguments, function( elem ) {
19926 if ( this.parentNode ) {
19927 this.parentNode.insertBefore( elem, this.nextSibling );
19928 }
19929 } );
19930 },
19931
19932 empty: function() {
19933 var elem,
19934 i = 0;
19935
19936 for ( ; ( elem = this[ i ] ) != null; i++ ) {
19937 if ( elem.nodeType === 1 ) {
19938
19939 // Prevent memory leaks
19940 jQuery.cleanData( getAll( elem, false ) );
19941
19942 // Remove any remaining nodes
19943 elem.textContent = "";
19944 }
19945 }
19946
19947 return this;
19948 },
19949
19950 clone: function( dataAndEvents, deepDataAndEvents ) {
19951 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
19952 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
19953
19954 return this.map( function() {
19955 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
19956 } );
19957 },
19958
19959 html: function( value ) {
19960 return access( this, function( value ) {
19961 var elem = this[ 0 ] || {},
19962 i = 0,
19963 l = this.length;
19964
19965 if ( value === undefined && elem.nodeType === 1 ) {
19966 return elem.innerHTML;
19967 }
19968
19969 // See if we can take a shortcut and just use innerHTML
19970 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
19971 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
19972
19973 value = jQuery.htmlPrefilter( value );
19974
19975 try {
19976 for ( ; i < l; i++ ) {
19977 elem = this[ i ] || {};
19978
19979 // Remove element nodes and prevent memory leaks
19980 if ( elem.nodeType === 1 ) {
19981 jQuery.cleanData( getAll( elem, false ) );
19982 elem.innerHTML = value;
19983 }
19984 }
19985
19986 elem = 0;
19987
19988 // If using innerHTML throws an exception, use the fallback method
19989 } catch ( e ) {}
19990 }
19991
19992 if ( elem ) {
19993 this.empty().append( value );
19994 }
19995 }, null, value, arguments.length );
19996 },
19997
19998 replaceWith: function() {
19999 var ignored = [];
20000
20001 // Make the changes, replacing each non-ignored context element with the new content
20002 return domManip( this, arguments, function( elem ) {
20003 var parent = this.parentNode;
20004
20005 if ( jQuery.inArray( this, ignored ) < 0 ) {
20006 jQuery.cleanData( getAll( this ) );
20007 if ( parent ) {
20008 parent.replaceChild( elem, this );
20009 }
20010 }
20011
20012 // Force callback invocation
20013 }, ignored );
20014 }
20015} );
20016
20017jQuery.each( {
20018 appendTo: "append",
20019 prependTo: "prepend",
20020 insertBefore: "before",
20021 insertAfter: "after",
20022 replaceAll: "replaceWith"
20023}, function( name, original ) {
20024 jQuery.fn[ name ] = function( selector ) {
20025 var elems,
20026 ret = [],
20027 insert = jQuery( selector ),
20028 last = insert.length - 1,
20029 i = 0;
20030
20031 for ( ; i <= last; i++ ) {
20032 elems = i === last ? this : this.clone( true );
20033 jQuery( insert[ i ] )[ original ]( elems );
20034
20035 // Support: Android <=4.0 only, PhantomJS 1 only
20036 // .get() because push.apply(_, arraylike) throws on ancient WebKit
20037 push.apply( ret, elems.get() );
20038 }
20039
20040 return this.pushStack( ret );
20041 };
20042} );
20043var rmargin = ( /^margin/ );
20044
20045var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
20046
20047var getStyles = function( elem ) {
20048
20049 // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
20050 // IE throws on elements created in popups
20051 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
20052 var view = elem.ownerDocument.defaultView;
20053
20054 if ( !view || !view.opener ) {
20055 view = window;
20056 }
20057
20058 return view.getComputedStyle( elem );
20059 };
20060
20061
20062
20063( function() {
20064
20065 // Executing both pixelPosition & boxSizingReliable tests require only one layout
20066 // so they're executed at the same time to save the second computation.
20067 function computeStyleTests() {
20068
20069 // This is a singleton, we need to execute it only once
20070 if ( !div ) {
20071 return;
20072 }
20073
20074 div.style.cssText =
20075 "box-sizing:border-box;" +
20076 "position:relative;display:block;" +
20077 "margin:auto;border:1px;padding:1px;" +
20078 "top:1%;width:50%";
20079 div.innerHTML = "";
20080 documentElement.appendChild( container );
20081
20082 var divStyle = window.getComputedStyle( div );
20083 pixelPositionVal = divStyle.top !== "1%";
20084
20085 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
20086 reliableMarginLeftVal = divStyle.marginLeft === "2px";
20087 boxSizingReliableVal = divStyle.width === "4px";
20088
20089 // Support: Android 4.0 - 4.3 only
20090 // Some styles come back with percentage values, even though they shouldn't
20091 div.style.marginRight = "50%";
20092 pixelMarginRightVal = divStyle.marginRight === "4px";
20093
20094 documentElement.removeChild( container );
20095
20096 // Nullify the div so it wouldn't be stored in the memory and
20097 // it will also be a sign that checks already performed
20098 div = null;
20099 }
20100
20101 var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
20102 container = document.createElement( "div" ),
20103 div = document.createElement( "div" );
20104
20105 // Finish early in limited (non-browser) environments
20106 if ( !div.style ) {
20107 return;
20108 }
20109
20110 // Support: IE <=9 - 11 only
20111 // Style of cloned element affects source element cloned (#8908)
20112 div.style.backgroundClip = "content-box";
20113 div.cloneNode( true ).style.backgroundClip = "";
20114 support.clearCloneStyle = div.style.backgroundClip === "content-box";
20115
20116 container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
20117 "padding:0;margin-top:1px;position:absolute";
20118 container.appendChild( div );
20119
20120 jQuery.extend( support, {
20121 pixelPosition: function() {
20122 computeStyleTests();
20123 return pixelPositionVal;
20124 },
20125 boxSizingReliable: function() {
20126 computeStyleTests();
20127 return boxSizingReliableVal;
20128 },
20129 pixelMarginRight: function() {
20130 computeStyleTests();
20131 return pixelMarginRightVal;
20132 },
20133 reliableMarginLeft: function() {
20134 computeStyleTests();
20135 return reliableMarginLeftVal;
20136 }
20137 } );
20138} )();
20139
20140
20141function curCSS( elem, name, computed ) {
20142 var width, minWidth, maxWidth, ret,
20143
20144 // Support: Firefox 51+
20145 // Retrieving style before computed somehow
20146 // fixes an issue with getting wrong values
20147 // on detached elements
20148 style = elem.style;
20149
20150 computed = computed || getStyles( elem );
20151
20152 // getPropertyValue is needed for:
20153 // .css('filter') (IE 9 only, #12537)
20154 // .css('--customProperty) (#3144)
20155 if ( computed ) {
20156 ret = computed.getPropertyValue( name ) || computed[ name ];
20157
20158 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
20159 ret = jQuery.style( elem, name );
20160 }
20161
20162 // A tribute to the "awesome hack by Dean Edwards"
20163 // Android Browser returns percentage for some values,
20164 // but width seems to be reliably pixels.
20165 // This is against the CSSOM draft spec:
20166 // https://drafts.csswg.org/cssom/#resolved-values
20167 if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
20168
20169 // Remember the original values
20170 width = style.width;
20171 minWidth = style.minWidth;
20172 maxWidth = style.maxWidth;
20173
20174 // Put in the new values to get a computed value out
20175 style.minWidth = style.maxWidth = style.width = ret;
20176 ret = computed.width;
20177
20178 // Revert the changed values
20179 style.width = width;
20180 style.minWidth = minWidth;
20181 style.maxWidth = maxWidth;
20182 }
20183 }
20184
20185 return ret !== undefined ?
20186
20187 // Support: IE <=9 - 11 only
20188 // IE returns zIndex value as an integer.
20189 ret + "" :
20190 ret;
20191}
20192
20193
20194function addGetHookIf( conditionFn, hookFn ) {
20195
20196 // Define the hook, we'll check on the first run if it's really needed.
20197 return {
20198 get: function() {
20199 if ( conditionFn() ) {
20200
20201 // Hook not needed (or it's not possible to use it due
20202 // to missing dependency), remove it.
20203 delete this.get;
20204 return;
20205 }
20206
20207 // Hook needed; redefine it so that the support test is not executed again.
20208 return ( this.get = hookFn ).apply( this, arguments );
20209 }
20210 };
20211}
20212
20213
20214var
20215
20216 // Swappable if display is none or starts with table
20217 // except "table", "table-cell", or "table-caption"
20218 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
20219 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
20220 rcustomProp = /^--/,
20221 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
20222 cssNormalTransform = {
20223 letterSpacing: "0",
20224 fontWeight: "400"
20225 },
20226
20227 cssPrefixes = [ "Webkit", "Moz", "ms" ],
20228 emptyStyle = document.createElement( "div" ).style;
20229
20230// Return a css property mapped to a potentially vendor prefixed property
20231function vendorPropName( name ) {
20232
20233 // Shortcut for names that are not vendor prefixed
20234 if ( name in emptyStyle ) {
20235 return name;
20236 }
20237
20238 // Check for vendor prefixed names
20239 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
20240 i = cssPrefixes.length;
20241
20242 while ( i-- ) {
20243 name = cssPrefixes[ i ] + capName;
20244 if ( name in emptyStyle ) {
20245 return name;
20246 }
20247 }
20248}
20249
20250// Return a property mapped along what jQuery.cssProps suggests or to
20251// a vendor prefixed property.
20252function finalPropName( name ) {
20253 var ret = jQuery.cssProps[ name ];
20254 if ( !ret ) {
20255 ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;
20256 }
20257 return ret;
20258}
20259
20260function setPositiveNumber( elem, value, subtract ) {
20261
20262 // Any relative (+/-) values have already been
20263 // normalized at this point
20264 var matches = rcssNum.exec( value );
20265 return matches ?
20266
20267 // Guard against undefined "subtract", e.g., when used as in cssHooks
20268 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
20269 value;
20270}
20271
20272function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
20273 var i,
20274 val = 0;
20275
20276 // If we already have the right measurement, avoid augmentation
20277 if ( extra === ( isBorderBox ? "border" : "content" ) ) {
20278 i = 4;
20279
20280 // Otherwise initialize for horizontal or vertical properties
20281 } else {
20282 i = name === "width" ? 1 : 0;
20283 }
20284
20285 for ( ; i < 4; i += 2 ) {
20286
20287 // Both box models exclude margin, so add it if we want it
20288 if ( extra === "margin" ) {
20289 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
20290 }
20291
20292 if ( isBorderBox ) {
20293
20294 // border-box includes padding, so remove it if we want content
20295 if ( extra === "content" ) {
20296 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
20297 }
20298
20299 // At this point, extra isn't border nor margin, so remove border
20300 if ( extra !== "margin" ) {
20301 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
20302 }
20303 } else {
20304
20305 // At this point, extra isn't content, so add padding
20306 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
20307
20308 // At this point, extra isn't content nor padding, so add border
20309 if ( extra !== "padding" ) {
20310 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
20311 }
20312 }
20313 }
20314
20315 return val;
20316}
20317
20318function getWidthOrHeight( elem, name, extra ) {
20319
20320 // Start with computed style
20321 var valueIsBorderBox,
20322 styles = getStyles( elem ),
20323 val = curCSS( elem, name, styles ),
20324 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
20325
20326 // Computed unit is not pixels. Stop here and return.
20327 if ( rnumnonpx.test( val ) ) {
20328 return val;
20329 }
20330
20331 // Check for style in case a browser which returns unreliable values
20332 // for getComputedStyle silently falls back to the reliable elem.style
20333 valueIsBorderBox = isBorderBox &&
20334 ( support.boxSizingReliable() || val === elem.style[ name ] );
20335
20336 // Fall back to offsetWidth/Height when value is "auto"
20337 // This happens for inline elements with no explicit setting (gh-3571)
20338 if ( val === "auto" ) {
20339 val = elem[ "offset" + name[ 0 ].toUpperCase() + name.slice( 1 ) ];
20340 }
20341
20342 // Normalize "", auto, and prepare for extra
20343 val = parseFloat( val ) || 0;
20344
20345 // Use the active box-sizing model to add/subtract irrelevant styles
20346 return ( val +
20347 augmentWidthOrHeight(
20348 elem,
20349 name,
20350 extra || ( isBorderBox ? "border" : "content" ),
20351 valueIsBorderBox,
20352 styles
20353 )
20354 ) + "px";
20355}
20356
20357jQuery.extend( {
20358
20359 // Add in style property hooks for overriding the default
20360 // behavior of getting and setting a style property
20361 cssHooks: {
20362 opacity: {
20363 get: function( elem, computed ) {
20364 if ( computed ) {
20365
20366 // We should always get a number back from opacity
20367 var ret = curCSS( elem, "opacity" );
20368 return ret === "" ? "1" : ret;
20369 }
20370 }
20371 }
20372 },
20373
20374 // Don't automatically add "px" to these possibly-unitless properties
20375 cssNumber: {
20376 "animationIterationCount": true,
20377 "columnCount": true,
20378 "fillOpacity": true,
20379 "flexGrow": true,
20380 "flexShrink": true,
20381 "fontWeight": true,
20382 "lineHeight": true,
20383 "opacity": true,
20384 "order": true,
20385 "orphans": true,
20386 "widows": true,
20387 "zIndex": true,
20388 "zoom": true
20389 },
20390
20391 // Add in properties whose names you wish to fix before
20392 // setting or getting the value
20393 cssProps: {
20394 "float": "cssFloat"
20395 },
20396
20397 // Get and set the style property on a DOM Node
20398 style: function( elem, name, value, extra ) {
20399
20400 // Don't set styles on text and comment nodes
20401 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
20402 return;
20403 }
20404
20405 // Make sure that we're working with the right name
20406 var ret, type, hooks,
20407 origName = jQuery.camelCase( name ),
20408 isCustomProp = rcustomProp.test( name ),
20409 style = elem.style;
20410
20411 // Make sure that we're working with the right name. We don't
20412 // want to query the value if it is a CSS custom property
20413 // since they are user-defined.
20414 if ( !isCustomProp ) {
20415 name = finalPropName( origName );
20416 }
20417
20418 // Gets hook for the prefixed version, then unprefixed version
20419 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
20420
20421 // Check if we're setting a value
20422 if ( value !== undefined ) {
20423 type = typeof value;
20424
20425 // Convert "+=" or "-=" to relative numbers (#7345)
20426 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
20427 value = adjustCSS( elem, name, ret );
20428
20429 // Fixes bug #9237
20430 type = "number";
20431 }
20432
20433 // Make sure that null and NaN values aren't set (#7116)
20434 if ( value == null || value !== value ) {
20435 return;
20436 }
20437
20438 // If a number was passed in, add the unit (except for certain CSS properties)
20439 if ( type === "number" ) {
20440 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
20441 }
20442
20443 // background-* props affect original clone's values
20444 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
20445 style[ name ] = "inherit";
20446 }
20447
20448 // If a hook was provided, use that value, otherwise just set the specified value
20449 if ( !hooks || !( "set" in hooks ) ||
20450 ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
20451
20452 if ( isCustomProp ) {
20453 style.setProperty( name, value );
20454 } else {
20455 style[ name ] = value;
20456 }
20457 }
20458
20459 } else {
20460
20461 // If a hook was provided get the non-computed value from there
20462 if ( hooks && "get" in hooks &&
20463 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
20464
20465 return ret;
20466 }
20467
20468 // Otherwise just get the value from the style object
20469 return style[ name ];
20470 }
20471 },
20472
20473 css: function( elem, name, extra, styles ) {
20474 var val, num, hooks,
20475 origName = jQuery.camelCase( name ),
20476 isCustomProp = rcustomProp.test( name );
20477
20478 // Make sure that we're working with the right name. We don't
20479 // want to modify the value if it is a CSS custom property
20480 // since they are user-defined.
20481 if ( !isCustomProp ) {
20482 name = finalPropName( origName );
20483 }
20484
20485 // Try prefixed name followed by the unprefixed name
20486 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
20487
20488 // If a hook was provided get the computed value from there
20489 if ( hooks && "get" in hooks ) {
20490 val = hooks.get( elem, true, extra );
20491 }
20492
20493 // Otherwise, if a way to get the computed value exists, use that
20494 if ( val === undefined ) {
20495 val = curCSS( elem, name, styles );
20496 }
20497
20498 // Convert "normal" to computed value
20499 if ( val === "normal" && name in cssNormalTransform ) {
20500 val = cssNormalTransform[ name ];
20501 }
20502
20503 // Make numeric if forced or a qualifier was provided and val looks numeric
20504 if ( extra === "" || extra ) {
20505 num = parseFloat( val );
20506 return extra === true || isFinite( num ) ? num || 0 : val;
20507 }
20508
20509 return val;
20510 }
20511} );
20512
20513jQuery.each( [ "height", "width" ], function( i, name ) {
20514 jQuery.cssHooks[ name ] = {
20515 get: function( elem, computed, extra ) {
20516 if ( computed ) {
20517
20518 // Certain elements can have dimension info if we invisibly show them
20519 // but it must have a current display style that would benefit
20520 return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
20521
20522 // Support: Safari 8+
20523 // Table columns in Safari have non-zero offsetWidth & zero
20524 // getBoundingClientRect().width unless display is changed.
20525 // Support: IE <=11 only
20526 // Running getBoundingClientRect on a disconnected node
20527 // in IE throws an error.
20528 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
20529 swap( elem, cssShow, function() {
20530 return getWidthOrHeight( elem, name, extra );
20531 } ) :
20532 getWidthOrHeight( elem, name, extra );
20533 }
20534 },
20535
20536 set: function( elem, value, extra ) {
20537 var matches,
20538 styles = extra && getStyles( elem ),
20539 subtract = extra && augmentWidthOrHeight(
20540 elem,
20541 name,
20542 extra,
20543 jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
20544 styles
20545 );
20546
20547 // Convert to pixels if value adjustment is needed
20548 if ( subtract && ( matches = rcssNum.exec( value ) ) &&
20549 ( matches[ 3 ] || "px" ) !== "px" ) {
20550
20551 elem.style[ name ] = value;
20552 value = jQuery.css( elem, name );
20553 }
20554
20555 return setPositiveNumber( elem, value, subtract );
20556 }
20557 };
20558} );
20559
20560jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
20561 function( elem, computed ) {
20562 if ( computed ) {
20563 return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
20564 elem.getBoundingClientRect().left -
20565 swap( elem, { marginLeft: 0 }, function() {
20566 return elem.getBoundingClientRect().left;
20567 } )
20568 ) + "px";
20569 }
20570 }
20571);
20572
20573// These hooks are used by animate to expand properties
20574jQuery.each( {
20575 margin: "",
20576 padding: "",
20577 border: "Width"
20578}, function( prefix, suffix ) {
20579 jQuery.cssHooks[ prefix + suffix ] = {
20580 expand: function( value ) {
20581 var i = 0,
20582 expanded = {},
20583
20584 // Assumes a single number if not a string
20585 parts = typeof value === "string" ? value.split( " " ) : [ value ];
20586
20587 for ( ; i < 4; i++ ) {
20588 expanded[ prefix + cssExpand[ i ] + suffix ] =
20589 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
20590 }
20591
20592 return expanded;
20593 }
20594 };
20595
20596 if ( !rmargin.test( prefix ) ) {
20597 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
20598 }
20599} );
20600
20601jQuery.fn.extend( {
20602 css: function( name, value ) {
20603 return access( this, function( elem, name, value ) {
20604 var styles, len,
20605 map = {},
20606 i = 0;
20607
20608 if ( Array.isArray( name ) ) {
20609 styles = getStyles( elem );
20610 len = name.length;
20611
20612 for ( ; i < len; i++ ) {
20613 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
20614 }
20615
20616 return map;
20617 }
20618
20619 return value !== undefined ?
20620 jQuery.style( elem, name, value ) :
20621 jQuery.css( elem, name );
20622 }, name, value, arguments.length > 1 );
20623 }
20624} );
20625
20626
20627function Tween( elem, options, prop, end, easing ) {
20628 return new Tween.prototype.init( elem, options, prop, end, easing );
20629}
20630jQuery.Tween = Tween;
20631
20632Tween.prototype = {
20633 constructor: Tween,
20634 init: function( elem, options, prop, end, easing, unit ) {
20635 this.elem = elem;
20636 this.prop = prop;
20637 this.easing = easing || jQuery.easing._default;
20638 this.options = options;
20639 this.start = this.now = this.cur();
20640 this.end = end;
20641 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
20642 },
20643 cur: function() {
20644 var hooks = Tween.propHooks[ this.prop ];
20645
20646 return hooks && hooks.get ?
20647 hooks.get( this ) :
20648 Tween.propHooks._default.get( this );
20649 },
20650 run: function( percent ) {
20651 var eased,
20652 hooks = Tween.propHooks[ this.prop ];
20653
20654 if ( this.options.duration ) {
20655 this.pos = eased = jQuery.easing[ this.easing ](
20656 percent, this.options.duration * percent, 0, 1, this.options.duration
20657 );
20658 } else {
20659 this.pos = eased = percent;
20660 }
20661 this.now = ( this.end - this.start ) * eased + this.start;
20662
20663 if ( this.options.step ) {
20664 this.options.step.call( this.elem, this.now, this );
20665 }
20666
20667 if ( hooks && hooks.set ) {
20668 hooks.set( this );
20669 } else {
20670 Tween.propHooks._default.set( this );
20671 }
20672 return this;
20673 }
20674};
20675
20676Tween.prototype.init.prototype = Tween.prototype;
20677
20678Tween.propHooks = {
20679 _default: {
20680 get: function( tween ) {
20681 var result;
20682
20683 // Use a property on the element directly when it is not a DOM element,
20684 // or when there is no matching style property that exists.
20685 if ( tween.elem.nodeType !== 1 ||
20686 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
20687 return tween.elem[ tween.prop ];
20688 }
20689
20690 // Passing an empty string as a 3rd parameter to .css will automatically
20691 // attempt a parseFloat and fallback to a string if the parse fails.
20692 // Simple values such as "10px" are parsed to Float;
20693 // complex values such as "rotate(1rad)" are returned as-is.
20694 result = jQuery.css( tween.elem, tween.prop, "" );
20695
20696 // Empty strings, null, undefined and "auto" are converted to 0.
20697 return !result || result === "auto" ? 0 : result;
20698 },
20699 set: function( tween ) {
20700
20701 // Use step hook for back compat.
20702 // Use cssHook if its there.
20703 // Use .style if available and use plain properties where available.
20704 if ( jQuery.fx.step[ tween.prop ] ) {
20705 jQuery.fx.step[ tween.prop ]( tween );
20706 } else if ( tween.elem.nodeType === 1 &&
20707 ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
20708 jQuery.cssHooks[ tween.prop ] ) ) {
20709 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
20710 } else {
20711 tween.elem[ tween.prop ] = tween.now;
20712 }
20713 }
20714 }
20715};
20716
20717// Support: IE <=9 only
20718// Panic based approach to setting things on disconnected nodes
20719Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
20720 set: function( tween ) {
20721 if ( tween.elem.nodeType && tween.elem.parentNode ) {
20722 tween.elem[ tween.prop ] = tween.now;
20723 }
20724 }
20725};
20726
20727jQuery.easing = {
20728 linear: function( p ) {
20729 return p;
20730 },
20731 swing: function( p ) {
20732 return 0.5 - Math.cos( p * Math.PI ) / 2;
20733 },
20734 _default: "swing"
20735};
20736
20737jQuery.fx = Tween.prototype.init;
20738
20739// Back compat <1.8 extension point
20740jQuery.fx.step = {};
20741
20742
20743
20744
20745var
20746 fxNow, inProgress,
20747 rfxtypes = /^(?:toggle|show|hide)$/,
20748 rrun = /queueHooks$/;
20749
20750function schedule() {
20751 if ( inProgress ) {
20752 if ( document.hidden === false && window.requestAnimationFrame ) {
20753 window.requestAnimationFrame( schedule );
20754 } else {
20755 window.setTimeout( schedule, jQuery.fx.interval );
20756 }
20757
20758 jQuery.fx.tick();
20759 }
20760}
20761
20762// Animations created synchronously will run synchronously
20763function createFxNow() {
20764 window.setTimeout( function() {
20765 fxNow = undefined;
20766 } );
20767 return ( fxNow = jQuery.now() );
20768}
20769
20770// Generate parameters to create a standard animation
20771function genFx( type, includeWidth ) {
20772 var which,
20773 i = 0,
20774 attrs = { height: type };
20775
20776 // If we include width, step value is 1 to do all cssExpand values,
20777 // otherwise step value is 2 to skip over Left and Right
20778 includeWidth = includeWidth ? 1 : 0;
20779 for ( ; i < 4; i += 2 - includeWidth ) {
20780 which = cssExpand[ i ];
20781 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
20782 }
20783
20784 if ( includeWidth ) {
20785 attrs.opacity = attrs.width = type;
20786 }
20787
20788 return attrs;
20789}
20790
20791function createTween( value, prop, animation ) {
20792 var tween,
20793 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
20794 index = 0,
20795 length = collection.length;
20796 for ( ; index < length; index++ ) {
20797 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
20798
20799 // We're done with this property
20800 return tween;
20801 }
20802 }
20803}
20804
20805function defaultPrefilter( elem, props, opts ) {
20806 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
20807 isBox = "width" in props || "height" in props,
20808 anim = this,
20809 orig = {},
20810 style = elem.style,
20811 hidden = elem.nodeType && isHiddenWithinTree( elem ),
20812 dataShow = dataPriv.get( elem, "fxshow" );
20813
20814 // Queue-skipping animations hijack the fx hooks
20815 if ( !opts.queue ) {
20816 hooks = jQuery._queueHooks( elem, "fx" );
20817 if ( hooks.unqueued == null ) {
20818 hooks.unqueued = 0;
20819 oldfire = hooks.empty.fire;
20820 hooks.empty.fire = function() {
20821 if ( !hooks.unqueued ) {
20822 oldfire();
20823 }
20824 };
20825 }
20826 hooks.unqueued++;
20827
20828 anim.always( function() {
20829
20830 // Ensure the complete handler is called before this completes
20831 anim.always( function() {
20832 hooks.unqueued--;
20833 if ( !jQuery.queue( elem, "fx" ).length ) {
20834 hooks.empty.fire();
20835 }
20836 } );
20837 } );
20838 }
20839
20840 // Detect show/hide animations
20841 for ( prop in props ) {
20842 value = props[ prop ];
20843 if ( rfxtypes.test( value ) ) {
20844 delete props[ prop ];
20845 toggle = toggle || value === "toggle";
20846 if ( value === ( hidden ? "hide" : "show" ) ) {
20847
20848 // Pretend to be hidden if this is a "show" and
20849 // there is still data from a stopped show/hide
20850 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
20851 hidden = true;
20852
20853 // Ignore all other no-op show/hide data
20854 } else {
20855 continue;
20856 }
20857 }
20858 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
20859 }
20860 }
20861
20862 // Bail out if this is a no-op like .hide().hide()
20863 propTween = !jQuery.isEmptyObject( props );
20864 if ( !propTween && jQuery.isEmptyObject( orig ) ) {
20865 return;
20866 }
20867
20868 // Restrict "overflow" and "display" styles during box animations
20869 if ( isBox && elem.nodeType === 1 ) {
20870
20871 // Support: IE <=9 - 11, Edge 12 - 13
20872 // Record all 3 overflow attributes because IE does not infer the shorthand
20873 // from identically-valued overflowX and overflowY
20874 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
20875
20876 // Identify a display type, preferring old show/hide data over the CSS cascade
20877 restoreDisplay = dataShow && dataShow.display;
20878 if ( restoreDisplay == null ) {
20879 restoreDisplay = dataPriv.get( elem, "display" );
20880 }
20881 display = jQuery.css( elem, "display" );
20882 if ( display === "none" ) {
20883 if ( restoreDisplay ) {
20884 display = restoreDisplay;
20885 } else {
20886
20887 // Get nonempty value(s) by temporarily forcing visibility
20888 showHide( [ elem ], true );
20889 restoreDisplay = elem.style.display || restoreDisplay;
20890 display = jQuery.css( elem, "display" );
20891 showHide( [ elem ] );
20892 }
20893 }
20894
20895 // Animate inline elements as inline-block
20896 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
20897 if ( jQuery.css( elem, "float" ) === "none" ) {
20898
20899 // Restore the original display value at the end of pure show/hide animations
20900 if ( !propTween ) {
20901 anim.done( function() {
20902 style.display = restoreDisplay;
20903 } );
20904 if ( restoreDisplay == null ) {
20905 display = style.display;
20906 restoreDisplay = display === "none" ? "" : display;
20907 }
20908 }
20909 style.display = "inline-block";
20910 }
20911 }
20912 }
20913
20914 if ( opts.overflow ) {
20915 style.overflow = "hidden";
20916 anim.always( function() {
20917 style.overflow = opts.overflow[ 0 ];
20918 style.overflowX = opts.overflow[ 1 ];
20919 style.overflowY = opts.overflow[ 2 ];
20920 } );
20921 }
20922
20923 // Implement show/hide animations
20924 propTween = false;
20925 for ( prop in orig ) {
20926
20927 // General show/hide setup for this element animation
20928 if ( !propTween ) {
20929 if ( dataShow ) {
20930 if ( "hidden" in dataShow ) {
20931 hidden = dataShow.hidden;
20932 }
20933 } else {
20934 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
20935 }
20936
20937 // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
20938 if ( toggle ) {
20939 dataShow.hidden = !hidden;
20940 }
20941
20942 // Show elements before animating them
20943 if ( hidden ) {
20944 showHide( [ elem ], true );
20945 }
20946
20947 /* eslint-disable no-loop-func */
20948
20949 anim.done( function() {
20950
20951 /* eslint-enable no-loop-func */
20952
20953 // The final step of a "hide" animation is actually hiding the element
20954 if ( !hidden ) {
20955 showHide( [ elem ] );
20956 }
20957 dataPriv.remove( elem, "fxshow" );
20958 for ( prop in orig ) {
20959 jQuery.style( elem, prop, orig[ prop ] );
20960 }
20961 } );
20962 }
20963
20964 // Per-property setup
20965 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
20966 if ( !( prop in dataShow ) ) {
20967 dataShow[ prop ] = propTween.start;
20968 if ( hidden ) {
20969 propTween.end = propTween.start;
20970 propTween.start = 0;
20971 }
20972 }
20973 }
20974}
20975
20976function propFilter( props, specialEasing ) {
20977 var index, name, easing, value, hooks;
20978
20979 // camelCase, specialEasing and expand cssHook pass
20980 for ( index in props ) {
20981 name = jQuery.camelCase( index );
20982 easing = specialEasing[ name ];
20983 value = props[ index ];
20984 if ( Array.isArray( value ) ) {
20985 easing = value[ 1 ];
20986 value = props[ index ] = value[ 0 ];
20987 }
20988
20989 if ( index !== name ) {
20990 props[ name ] = value;
20991 delete props[ index ];
20992 }
20993
20994 hooks = jQuery.cssHooks[ name ];
20995 if ( hooks && "expand" in hooks ) {
20996 value = hooks.expand( value );
20997 delete props[ name ];
20998
20999 // Not quite $.extend, this won't overwrite existing keys.
21000 // Reusing 'index' because we have the correct "name"
21001 for ( index in value ) {
21002 if ( !( index in props ) ) {
21003 props[ index ] = value[ index ];
21004 specialEasing[ index ] = easing;
21005 }
21006 }
21007 } else {
21008 specialEasing[ name ] = easing;
21009 }
21010 }
21011}
21012
21013function Animation( elem, properties, options ) {
21014 var result,
21015 stopped,
21016 index = 0,
21017 length = Animation.prefilters.length,
21018 deferred = jQuery.Deferred().always( function() {
21019
21020 // Don't match elem in the :animated selector
21021 delete tick.elem;
21022 } ),
21023 tick = function() {
21024 if ( stopped ) {
21025 return false;
21026 }
21027 var currentTime = fxNow || createFxNow(),
21028 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
21029
21030 // Support: Android 2.3 only
21031 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
21032 temp = remaining / animation.duration || 0,
21033 percent = 1 - temp,
21034 index = 0,
21035 length = animation.tweens.length;
21036
21037 for ( ; index < length; index++ ) {
21038 animation.tweens[ index ].run( percent );
21039 }
21040
21041 deferred.notifyWith( elem, [ animation, percent, remaining ] );
21042
21043 // If there's more to do, yield
21044 if ( percent < 1 && length ) {
21045 return remaining;
21046 }
21047
21048 // If this was an empty animation, synthesize a final progress notification
21049 if ( !length ) {
21050 deferred.notifyWith( elem, [ animation, 1, 0 ] );
21051 }
21052
21053 // Resolve the animation and report its conclusion
21054 deferred.resolveWith( elem, [ animation ] );
21055 return false;
21056 },
21057 animation = deferred.promise( {
21058 elem: elem,
21059 props: jQuery.extend( {}, properties ),
21060 opts: jQuery.extend( true, {
21061 specialEasing: {},
21062 easing: jQuery.easing._default
21063 }, options ),
21064 originalProperties: properties,
21065 originalOptions: options,
21066 startTime: fxNow || createFxNow(),
21067 duration: options.duration,
21068 tweens: [],
21069 createTween: function( prop, end ) {
21070 var tween = jQuery.Tween( elem, animation.opts, prop, end,
21071 animation.opts.specialEasing[ prop ] || animation.opts.easing );
21072 animation.tweens.push( tween );
21073 return tween;
21074 },
21075 stop: function( gotoEnd ) {
21076 var index = 0,
21077
21078 // If we are going to the end, we want to run all the tweens
21079 // otherwise we skip this part
21080 length = gotoEnd ? animation.tweens.length : 0;
21081 if ( stopped ) {
21082 return this;
21083 }
21084 stopped = true;
21085 for ( ; index < length; index++ ) {
21086 animation.tweens[ index ].run( 1 );
21087 }
21088
21089 // Resolve when we played the last frame; otherwise, reject
21090 if ( gotoEnd ) {
21091 deferred.notifyWith( elem, [ animation, 1, 0 ] );
21092 deferred.resolveWith( elem, [ animation, gotoEnd ] );
21093 } else {
21094 deferred.rejectWith( elem, [ animation, gotoEnd ] );
21095 }
21096 return this;
21097 }
21098 } ),
21099 props = animation.props;
21100
21101 propFilter( props, animation.opts.specialEasing );
21102
21103 for ( ; index < length; index++ ) {
21104 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
21105 if ( result ) {
21106 if ( jQuery.isFunction( result.stop ) ) {
21107 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
21108 jQuery.proxy( result.stop, result );
21109 }
21110 return result;
21111 }
21112 }
21113
21114 jQuery.map( props, createTween, animation );
21115
21116 if ( jQuery.isFunction( animation.opts.start ) ) {
21117 animation.opts.start.call( elem, animation );
21118 }
21119
21120 // Attach callbacks from options
21121 animation
21122 .progress( animation.opts.progress )
21123 .done( animation.opts.done, animation.opts.complete )
21124 .fail( animation.opts.fail )
21125 .always( animation.opts.always );
21126
21127 jQuery.fx.timer(
21128 jQuery.extend( tick, {
21129 elem: elem,
21130 anim: animation,
21131 queue: animation.opts.queue
21132 } )
21133 );
21134
21135 return animation;
21136}
21137
21138jQuery.Animation = jQuery.extend( Animation, {
21139
21140 tweeners: {
21141 "*": [ function( prop, value ) {
21142 var tween = this.createTween( prop, value );
21143 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
21144 return tween;
21145 } ]
21146 },
21147
21148 tweener: function( props, callback ) {
21149 if ( jQuery.isFunction( props ) ) {
21150 callback = props;
21151 props = [ "*" ];
21152 } else {
21153 props = props.match( rnothtmlwhite );
21154 }
21155
21156 var prop,
21157 index = 0,
21158 length = props.length;
21159
21160 for ( ; index < length; index++ ) {
21161 prop = props[ index ];
21162 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
21163 Animation.tweeners[ prop ].unshift( callback );
21164 }
21165 },
21166
21167 prefilters: [ defaultPrefilter ],
21168
21169 prefilter: function( callback, prepend ) {
21170 if ( prepend ) {
21171 Animation.prefilters.unshift( callback );
21172 } else {
21173 Animation.prefilters.push( callback );
21174 }
21175 }
21176} );
21177
21178jQuery.speed = function( speed, easing, fn ) {
21179 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
21180 complete: fn || !fn && easing ||
21181 jQuery.isFunction( speed ) && speed,
21182 duration: speed,
21183 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
21184 };
21185
21186 // Go to the end state if fx are off
21187 if ( jQuery.fx.off ) {
21188 opt.duration = 0;
21189
21190 } else {
21191 if ( typeof opt.duration !== "number" ) {
21192 if ( opt.duration in jQuery.fx.speeds ) {
21193 opt.duration = jQuery.fx.speeds[ opt.duration ];
21194
21195 } else {
21196 opt.duration = jQuery.fx.speeds._default;
21197 }
21198 }
21199 }
21200
21201 // Normalize opt.queue - true/undefined/null -> "fx"
21202 if ( opt.queue == null || opt.queue === true ) {
21203 opt.queue = "fx";
21204 }
21205
21206 // Queueing
21207 opt.old = opt.complete;
21208
21209 opt.complete = function() {
21210 if ( jQuery.isFunction( opt.old ) ) {
21211 opt.old.call( this );
21212 }
21213
21214 if ( opt.queue ) {
21215 jQuery.dequeue( this, opt.queue );
21216 }
21217 };
21218
21219 return opt;
21220};
21221
21222jQuery.fn.extend( {
21223 fadeTo: function( speed, to, easing, callback ) {
21224
21225 // Show any hidden elements after setting opacity to 0
21226 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
21227
21228 // Animate to the value specified
21229 .end().animate( { opacity: to }, speed, easing, callback );
21230 },
21231 animate: function( prop, speed, easing, callback ) {
21232 var empty = jQuery.isEmptyObject( prop ),
21233 optall = jQuery.speed( speed, easing, callback ),
21234 doAnimation = function() {
21235
21236 // Operate on a copy of prop so per-property easing won't be lost
21237 var anim = Animation( this, jQuery.extend( {}, prop ), optall );
21238
21239 // Empty animations, or finishing resolves immediately
21240 if ( empty || dataPriv.get( this, "finish" ) ) {
21241 anim.stop( true );
21242 }
21243 };
21244 doAnimation.finish = doAnimation;
21245
21246 return empty || optall.queue === false ?
21247 this.each( doAnimation ) :
21248 this.queue( optall.queue, doAnimation );
21249 },
21250 stop: function( type, clearQueue, gotoEnd ) {
21251 var stopQueue = function( hooks ) {
21252 var stop = hooks.stop;
21253 delete hooks.stop;
21254 stop( gotoEnd );
21255 };
21256
21257 if ( typeof type !== "string" ) {
21258 gotoEnd = clearQueue;
21259 clearQueue = type;
21260 type = undefined;
21261 }
21262 if ( clearQueue && type !== false ) {
21263 this.queue( type || "fx", [] );
21264 }
21265
21266 return this.each( function() {
21267 var dequeue = true,
21268 index = type != null && type + "queueHooks",
21269 timers = jQuery.timers,
21270 data = dataPriv.get( this );
21271
21272 if ( index ) {
21273 if ( data[ index ] && data[ index ].stop ) {
21274 stopQueue( data[ index ] );
21275 }
21276 } else {
21277 for ( index in data ) {
21278 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
21279 stopQueue( data[ index ] );
21280 }
21281 }
21282 }
21283
21284 for ( index = timers.length; index--; ) {
21285 if ( timers[ index ].elem === this &&
21286 ( type == null || timers[ index ].queue === type ) ) {
21287
21288 timers[ index ].anim.stop( gotoEnd );
21289 dequeue = false;
21290 timers.splice( index, 1 );
21291 }
21292 }
21293
21294 // Start the next in the queue if the last step wasn't forced.
21295 // Timers currently will call their complete callbacks, which
21296 // will dequeue but only if they were gotoEnd.
21297 if ( dequeue || !gotoEnd ) {
21298 jQuery.dequeue( this, type );
21299 }
21300 } );
21301 },
21302 finish: function( type ) {
21303 if ( type !== false ) {
21304 type = type || "fx";
21305 }
21306 return this.each( function() {
21307 var index,
21308 data = dataPriv.get( this ),
21309 queue = data[ type + "queue" ],
21310 hooks = data[ type + "queueHooks" ],
21311 timers = jQuery.timers,
21312 length = queue ? queue.length : 0;
21313
21314 // Enable finishing flag on private data
21315 data.finish = true;
21316
21317 // Empty the queue first
21318 jQuery.queue( this, type, [] );
21319
21320 if ( hooks && hooks.stop ) {
21321 hooks.stop.call( this, true );
21322 }
21323
21324 // Look for any active animations, and finish them
21325 for ( index = timers.length; index--; ) {
21326 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
21327 timers[ index ].anim.stop( true );
21328 timers.splice( index, 1 );
21329 }
21330 }
21331
21332 // Look for any animations in the old queue and finish them
21333 for ( index = 0; index < length; index++ ) {
21334 if ( queue[ index ] && queue[ index ].finish ) {
21335 queue[ index ].finish.call( this );
21336 }
21337 }
21338
21339 // Turn off finishing flag
21340 delete data.finish;
21341 } );
21342 }
21343} );
21344
21345jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
21346 var cssFn = jQuery.fn[ name ];
21347 jQuery.fn[ name ] = function( speed, easing, callback ) {
21348 return speed == null || typeof speed === "boolean" ?
21349 cssFn.apply( this, arguments ) :
21350 this.animate( genFx( name, true ), speed, easing, callback );
21351 };
21352} );
21353
21354// Generate shortcuts for custom animations
21355jQuery.each( {
21356 slideDown: genFx( "show" ),
21357 slideUp: genFx( "hide" ),
21358 slideToggle: genFx( "toggle" ),
21359 fadeIn: { opacity: "show" },
21360 fadeOut: { opacity: "hide" },
21361 fadeToggle: { opacity: "toggle" }
21362}, function( name, props ) {
21363 jQuery.fn[ name ] = function( speed, easing, callback ) {
21364 return this.animate( props, speed, easing, callback );
21365 };
21366} );
21367
21368jQuery.timers = [];
21369jQuery.fx.tick = function() {
21370 var timer,
21371 i = 0,
21372 timers = jQuery.timers;
21373
21374 fxNow = jQuery.now();
21375
21376 for ( ; i < timers.length; i++ ) {
21377 timer = timers[ i ];
21378
21379 // Run the timer and safely remove it when done (allowing for external removal)
21380 if ( !timer() && timers[ i ] === timer ) {
21381 timers.splice( i--, 1 );
21382 }
21383 }
21384
21385 if ( !timers.length ) {
21386 jQuery.fx.stop();
21387 }
21388 fxNow = undefined;
21389};
21390
21391jQuery.fx.timer = function( timer ) {
21392 jQuery.timers.push( timer );
21393 jQuery.fx.start();
21394};
21395
21396jQuery.fx.interval = 13;
21397jQuery.fx.start = function() {
21398 if ( inProgress ) {
21399 return;
21400 }
21401
21402 inProgress = true;
21403 schedule();
21404};
21405
21406jQuery.fx.stop = function() {
21407 inProgress = null;
21408};
21409
21410jQuery.fx.speeds = {
21411 slow: 600,
21412 fast: 200,
21413
21414 // Default speed
21415 _default: 400
21416};
21417
21418
21419// Based off of the plugin by Clint Helfers, with permission.
21420// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
21421jQuery.fn.delay = function( time, type ) {
21422 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
21423 type = type || "fx";
21424
21425 return this.queue( type, function( next, hooks ) {
21426 var timeout = window.setTimeout( next, time );
21427 hooks.stop = function() {
21428 window.clearTimeout( timeout );
21429 };
21430 } );
21431};
21432
21433
21434( function() {
21435 var input = document.createElement( "input" ),
21436 select = document.createElement( "select" ),
21437 opt = select.appendChild( document.createElement( "option" ) );
21438
21439 input.type = "checkbox";
21440
21441 // Support: Android <=4.3 only
21442 // Default value for a checkbox should be "on"
21443 support.checkOn = input.value !== "";
21444
21445 // Support: IE <=11 only
21446 // Must access selectedIndex to make default options select
21447 support.optSelected = opt.selected;
21448
21449 // Support: IE <=11 only
21450 // An input loses its value after becoming a radio
21451 input = document.createElement( "input" );
21452 input.value = "t";
21453 input.type = "radio";
21454 support.radioValue = input.value === "t";
21455} )();
21456
21457
21458var boolHook,
21459 attrHandle = jQuery.expr.attrHandle;
21460
21461jQuery.fn.extend( {
21462 attr: function( name, value ) {
21463 return access( this, jQuery.attr, name, value, arguments.length > 1 );
21464 },
21465
21466 removeAttr: function( name ) {
21467 return this.each( function() {
21468 jQuery.removeAttr( this, name );
21469 } );
21470 }
21471} );
21472
21473jQuery.extend( {
21474 attr: function( elem, name, value ) {
21475 var ret, hooks,
21476 nType = elem.nodeType;
21477
21478 // Don't get/set attributes on text, comment and attribute nodes
21479 if ( nType === 3 || nType === 8 || nType === 2 ) {
21480 return;
21481 }
21482
21483 // Fallback to prop when attributes are not supported
21484 if ( typeof elem.getAttribute === "undefined" ) {
21485 return jQuery.prop( elem, name, value );
21486 }
21487
21488 // Attribute hooks are determined by the lowercase version
21489 // Grab necessary hook if one is defined
21490 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
21491 hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
21492 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
21493 }
21494
21495 if ( value !== undefined ) {
21496 if ( value === null ) {
21497 jQuery.removeAttr( elem, name );
21498 return;
21499 }
21500
21501 if ( hooks && "set" in hooks &&
21502 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
21503 return ret;
21504 }
21505
21506 elem.setAttribute( name, value + "" );
21507 return value;
21508 }
21509
21510 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
21511 return ret;
21512 }
21513
21514 ret = jQuery.find.attr( elem, name );
21515
21516 // Non-existent attributes return null, we normalize to undefined
21517 return ret == null ? undefined : ret;
21518 },
21519
21520 attrHooks: {
21521 type: {
21522 set: function( elem, value ) {
21523 if ( !support.radioValue && value === "radio" &&
21524 nodeName( elem, "input" ) ) {
21525 var val = elem.value;
21526 elem.setAttribute( "type", value );
21527 if ( val ) {
21528 elem.value = val;
21529 }
21530 return value;
21531 }
21532 }
21533 }
21534 },
21535
21536 removeAttr: function( elem, value ) {
21537 var name,
21538 i = 0,
21539
21540 // Attribute names can contain non-HTML whitespace characters
21541 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
21542 attrNames = value && value.match( rnothtmlwhite );
21543
21544 if ( attrNames && elem.nodeType === 1 ) {
21545 while ( ( name = attrNames[ i++ ] ) ) {
21546 elem.removeAttribute( name );
21547 }
21548 }
21549 }
21550} );
21551
21552// Hooks for boolean attributes
21553boolHook = {
21554 set: function( elem, value, name ) {
21555 if ( value === false ) {
21556
21557 // Remove boolean attributes when set to false
21558 jQuery.removeAttr( elem, name );
21559 } else {
21560 elem.setAttribute( name, name );
21561 }
21562 return name;
21563 }
21564};
21565
21566jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
21567 var getter = attrHandle[ name ] || jQuery.find.attr;
21568
21569 attrHandle[ name ] = function( elem, name, isXML ) {
21570 var ret, handle,
21571 lowercaseName = name.toLowerCase();
21572
21573 if ( !isXML ) {
21574
21575 // Avoid an infinite loop by temporarily removing this function from the getter
21576 handle = attrHandle[ lowercaseName ];
21577 attrHandle[ lowercaseName ] = ret;
21578 ret = getter( elem, name, isXML ) != null ?
21579 lowercaseName :
21580 null;
21581 attrHandle[ lowercaseName ] = handle;
21582 }
21583 return ret;
21584 };
21585} );
21586
21587
21588
21589
21590var rfocusable = /^(?:input|select|textarea|button)$/i,
21591 rclickable = /^(?:a|area)$/i;
21592
21593jQuery.fn.extend( {
21594 prop: function( name, value ) {
21595 return access( this, jQuery.prop, name, value, arguments.length > 1 );
21596 },
21597
21598 removeProp: function( name ) {
21599 return this.each( function() {
21600 delete this[ jQuery.propFix[ name ] || name ];
21601 } );
21602 }
21603} );
21604
21605jQuery.extend( {
21606 prop: function( elem, name, value ) {
21607 var ret, hooks,
21608 nType = elem.nodeType;
21609
21610 // Don't get/set properties on text, comment and attribute nodes
21611 if ( nType === 3 || nType === 8 || nType === 2 ) {
21612 return;
21613 }
21614
21615 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
21616
21617 // Fix name and attach hooks
21618 name = jQuery.propFix[ name ] || name;
21619 hooks = jQuery.propHooks[ name ];
21620 }
21621
21622 if ( value !== undefined ) {
21623 if ( hooks && "set" in hooks &&
21624 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
21625 return ret;
21626 }
21627
21628 return ( elem[ name ] = value );
21629 }
21630
21631 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
21632 return ret;
21633 }
21634
21635 return elem[ name ];
21636 },
21637
21638 propHooks: {
21639 tabIndex: {
21640 get: function( elem ) {
21641
21642 // Support: IE <=9 - 11 only
21643 // elem.tabIndex doesn't always return the
21644 // correct value when it hasn't been explicitly set
21645 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
21646 // Use proper attribute retrieval(#12072)
21647 var tabindex = jQuery.find.attr( elem, "tabindex" );
21648
21649 if ( tabindex ) {
21650 return parseInt( tabindex, 10 );
21651 }
21652
21653 if (
21654 rfocusable.test( elem.nodeName ) ||
21655 rclickable.test( elem.nodeName ) &&
21656 elem.href
21657 ) {
21658 return 0;
21659 }
21660
21661 return -1;
21662 }
21663 }
21664 },
21665
21666 propFix: {
21667 "for": "htmlFor",
21668 "class": "className"
21669 }
21670} );
21671
21672// Support: IE <=11 only
21673// Accessing the selectedIndex property
21674// forces the browser to respect setting selected
21675// on the option
21676// The getter ensures a default option is selected
21677// when in an optgroup
21678// eslint rule "no-unused-expressions" is disabled for this code
21679// since it considers such accessions noop
21680if ( !support.optSelected ) {
21681 jQuery.propHooks.selected = {
21682 get: function( elem ) {
21683
21684 /* eslint no-unused-expressions: "off" */
21685
21686 var parent = elem.parentNode;
21687 if ( parent && parent.parentNode ) {
21688 parent.parentNode.selectedIndex;
21689 }
21690 return null;
21691 },
21692 set: function( elem ) {
21693
21694 /* eslint no-unused-expressions: "off" */
21695
21696 var parent = elem.parentNode;
21697 if ( parent ) {
21698 parent.selectedIndex;
21699
21700 if ( parent.parentNode ) {
21701 parent.parentNode.selectedIndex;
21702 }
21703 }
21704 }
21705 };
21706}
21707
21708jQuery.each( [
21709 "tabIndex",
21710 "readOnly",
21711 "maxLength",
21712 "cellSpacing",
21713 "cellPadding",
21714 "rowSpan",
21715 "colSpan",
21716 "useMap",
21717 "frameBorder",
21718 "contentEditable"
21719], function() {
21720 jQuery.propFix[ this.toLowerCase() ] = this;
21721} );
21722
21723
21724
21725
21726 // Strip and collapse whitespace according to HTML spec
21727 // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace
21728 function stripAndCollapse( value ) {
21729 var tokens = value.match( rnothtmlwhite ) || [];
21730 return tokens.join( " " );
21731 }
21732
21733
21734function getClass( elem ) {
21735 return elem.getAttribute && elem.getAttribute( "class" ) || "";
21736}
21737
21738jQuery.fn.extend( {
21739 addClass: function( value ) {
21740 var classes, elem, cur, curValue, clazz, j, finalValue,
21741 i = 0;
21742
21743 if ( jQuery.isFunction( value ) ) {
21744 return this.each( function( j ) {
21745 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
21746 } );
21747 }
21748
21749 if ( typeof value === "string" && value ) {
21750 classes = value.match( rnothtmlwhite ) || [];
21751
21752 while ( ( elem = this[ i++ ] ) ) {
21753 curValue = getClass( elem );
21754 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
21755
21756 if ( cur ) {
21757 j = 0;
21758 while ( ( clazz = classes[ j++ ] ) ) {
21759 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
21760 cur += clazz + " ";
21761 }
21762 }
21763
21764 // Only assign if different to avoid unneeded rendering.
21765 finalValue = stripAndCollapse( cur );
21766 if ( curValue !== finalValue ) {
21767 elem.setAttribute( "class", finalValue );
21768 }
21769 }
21770 }
21771 }
21772
21773 return this;
21774 },
21775
21776 removeClass: function( value ) {
21777 var classes, elem, cur, curValue, clazz, j, finalValue,
21778 i = 0;
21779
21780 if ( jQuery.isFunction( value ) ) {
21781 return this.each( function( j ) {
21782 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
21783 } );
21784 }
21785
21786 if ( !arguments.length ) {
21787 return this.attr( "class", "" );
21788 }
21789
21790 if ( typeof value === "string" && value ) {
21791 classes = value.match( rnothtmlwhite ) || [];
21792
21793 while ( ( elem = this[ i++ ] ) ) {
21794 curValue = getClass( elem );
21795
21796 // This expression is here for better compressibility (see addClass)
21797 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
21798
21799 if ( cur ) {
21800 j = 0;
21801 while ( ( clazz = classes[ j++ ] ) ) {
21802
21803 // Remove *all* instances
21804 while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
21805 cur = cur.replace( " " + clazz + " ", " " );
21806 }
21807 }
21808
21809 // Only assign if different to avoid unneeded rendering.
21810 finalValue = stripAndCollapse( cur );
21811 if ( curValue !== finalValue ) {
21812 elem.setAttribute( "class", finalValue );
21813 }
21814 }
21815 }
21816 }
21817
21818 return this;
21819 },
21820
21821 toggleClass: function( value, stateVal ) {
21822 var type = typeof value;
21823
21824 if ( typeof stateVal === "boolean" && type === "string" ) {
21825 return stateVal ? this.addClass( value ) : this.removeClass( value );
21826 }
21827
21828 if ( jQuery.isFunction( value ) ) {
21829 return this.each( function( i ) {
21830 jQuery( this ).toggleClass(
21831 value.call( this, i, getClass( this ), stateVal ),
21832 stateVal
21833 );
21834 } );
21835 }
21836
21837 return this.each( function() {
21838 var className, i, self, classNames;
21839
21840 if ( type === "string" ) {
21841
21842 // Toggle individual class names
21843 i = 0;
21844 self = jQuery( this );
21845 classNames = value.match( rnothtmlwhite ) || [];
21846
21847 while ( ( className = classNames[ i++ ] ) ) {
21848
21849 // Check each className given, space separated list
21850 if ( self.hasClass( className ) ) {
21851 self.removeClass( className );
21852 } else {
21853 self.addClass( className );
21854 }
21855 }
21856
21857 // Toggle whole class name
21858 } else if ( value === undefined || type === "boolean" ) {
21859 className = getClass( this );
21860 if ( className ) {
21861
21862 // Store className if set
21863 dataPriv.set( this, "__className__", className );
21864 }
21865
21866 // If the element has a class name or if we're passed `false`,
21867 // then remove the whole classname (if there was one, the above saved it).
21868 // Otherwise bring back whatever was previously saved (if anything),
21869 // falling back to the empty string if nothing was stored.
21870 if ( this.setAttribute ) {
21871 this.setAttribute( "class",
21872 className || value === false ?
21873 "" :
21874 dataPriv.get( this, "__className__" ) || ""
21875 );
21876 }
21877 }
21878 } );
21879 },
21880
21881 hasClass: function( selector ) {
21882 var className, elem,
21883 i = 0;
21884
21885 className = " " + selector + " ";
21886 while ( ( elem = this[ i++ ] ) ) {
21887 if ( elem.nodeType === 1 &&
21888 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
21889 return true;
21890 }
21891 }
21892
21893 return false;
21894 }
21895} );
21896
21897
21898
21899
21900var rreturn = /\r/g;
21901
21902jQuery.fn.extend( {
21903 val: function( value ) {
21904 var hooks, ret, isFunction,
21905 elem = this[ 0 ];
21906
21907 if ( !arguments.length ) {
21908 if ( elem ) {
21909 hooks = jQuery.valHooks[ elem.type ] ||
21910 jQuery.valHooks[ elem.nodeName.toLowerCase() ];
21911
21912 if ( hooks &&
21913 "get" in hooks &&
21914 ( ret = hooks.get( elem, "value" ) ) !== undefined
21915 ) {
21916 return ret;
21917 }
21918
21919 ret = elem.value;
21920
21921 // Handle most common string cases
21922 if ( typeof ret === "string" ) {
21923 return ret.replace( rreturn, "" );
21924 }
21925
21926 // Handle cases where value is null/undef or number
21927 return ret == null ? "" : ret;
21928 }
21929
21930 return;
21931 }
21932
21933 isFunction = jQuery.isFunction( value );
21934
21935 return this.each( function( i ) {
21936 var val;
21937
21938 if ( this.nodeType !== 1 ) {
21939 return;
21940 }
21941
21942 if ( isFunction ) {
21943 val = value.call( this, i, jQuery( this ).val() );
21944 } else {
21945 val = value;
21946 }
21947
21948 // Treat null/undefined as ""; convert numbers to string
21949 if ( val == null ) {
21950 val = "";
21951
21952 } else if ( typeof val === "number" ) {
21953 val += "";
21954
21955 } else if ( Array.isArray( val ) ) {
21956 val = jQuery.map( val, function( value ) {
21957 return value == null ? "" : value + "";
21958 } );
21959 }
21960
21961 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
21962
21963 // If set returns undefined, fall back to normal setting
21964 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
21965 this.value = val;
21966 }
21967 } );
21968 }
21969} );
21970
21971jQuery.extend( {
21972 valHooks: {
21973 option: {
21974 get: function( elem ) {
21975
21976 var val = jQuery.find.attr( elem, "value" );
21977 return val != null ?
21978 val :
21979
21980 // Support: IE <=10 - 11 only
21981 // option.text throws exceptions (#14686, #14858)
21982 // Strip and collapse whitespace
21983 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
21984 stripAndCollapse( jQuery.text( elem ) );
21985 }
21986 },
21987 select: {
21988 get: function( elem ) {
21989 var value, option, i,
21990 options = elem.options,
21991 index = elem.selectedIndex,
21992 one = elem.type === "select-one",
21993 values = one ? null : [],
21994 max = one ? index + 1 : options.length;
21995
21996 if ( index < 0 ) {
21997 i = max;
21998
21999 } else {
22000 i = one ? index : 0;
22001 }
22002
22003 // Loop through all the selected options
22004 for ( ; i < max; i++ ) {
22005 option = options[ i ];
22006
22007 // Support: IE <=9 only
22008 // IE8-9 doesn't update selected after form reset (#2551)
22009 if ( ( option.selected || i === index ) &&
22010
22011 // Don't return options that are disabled or in a disabled optgroup
22012 !option.disabled &&
22013 ( !option.parentNode.disabled ||
22014 !nodeName( option.parentNode, "optgroup" ) ) ) {
22015
22016 // Get the specific value for the option
22017 value = jQuery( option ).val();
22018
22019 // We don't need an array for one selects
22020 if ( one ) {
22021 return value;
22022 }
22023
22024 // Multi-Selects return an array
22025 values.push( value );
22026 }
22027 }
22028
22029 return values;
22030 },
22031
22032 set: function( elem, value ) {
22033 var optionSet, option,
22034 options = elem.options,
22035 values = jQuery.makeArray( value ),
22036 i = options.length;
22037
22038 while ( i-- ) {
22039 option = options[ i ];
22040
22041 /* eslint-disable no-cond-assign */
22042
22043 if ( option.selected =
22044 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
22045 ) {
22046 optionSet = true;
22047 }
22048
22049 /* eslint-enable no-cond-assign */
22050 }
22051
22052 // Force browsers to behave consistently when non-matching value is set
22053 if ( !optionSet ) {
22054 elem.selectedIndex = -1;
22055 }
22056 return values;
22057 }
22058 }
22059 }
22060} );
22061
22062// Radios and checkboxes getter/setter
22063jQuery.each( [ "radio", "checkbox" ], function() {
22064 jQuery.valHooks[ this ] = {
22065 set: function( elem, value ) {
22066 if ( Array.isArray( value ) ) {
22067 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
22068 }
22069 }
22070 };
22071 if ( !support.checkOn ) {
22072 jQuery.valHooks[ this ].get = function( elem ) {
22073 return elem.getAttribute( "value" ) === null ? "on" : elem.value;
22074 };
22075 }
22076} );
22077
22078
22079
22080
22081// Return jQuery for attributes-only inclusion
22082
22083
22084var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
22085
22086jQuery.extend( jQuery.event, {
22087
22088 trigger: function( event, data, elem, onlyHandlers ) {
22089
22090 var i, cur, tmp, bubbleType, ontype, handle, special,
22091 eventPath = [ elem || document ],
22092 type = hasOwn.call( event, "type" ) ? event.type : event,
22093 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
22094
22095 cur = tmp = elem = elem || document;
22096
22097 // Don't do events on text and comment nodes
22098 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
22099 return;
22100 }
22101
22102 // focus/blur morphs to focusin/out; ensure we're not firing them right now
22103 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
22104 return;
22105 }
22106
22107 if ( type.indexOf( "." ) > -1 ) {
22108
22109 // Namespaced trigger; create a regexp to match event type in handle()
22110 namespaces = type.split( "." );
22111 type = namespaces.shift();
22112 namespaces.sort();
22113 }
22114 ontype = type.indexOf( ":" ) < 0 && "on" + type;
22115
22116 // Caller can pass in a jQuery.Event object, Object, or just an event type string
22117 event = event[ jQuery.expando ] ?
22118 event :
22119 new jQuery.Event( type, typeof event === "object" && event );
22120
22121 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
22122 event.isTrigger = onlyHandlers ? 2 : 3;
22123 event.namespace = namespaces.join( "." );
22124 event.rnamespace = event.namespace ?
22125 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
22126 null;
22127
22128 // Clean up the event in case it is being reused
22129 event.result = undefined;
22130 if ( !event.target ) {
22131 event.target = elem;
22132 }
22133
22134 // Clone any incoming data and prepend the event, creating the handler arg list
22135 data = data == null ?
22136 [ event ] :
22137 jQuery.makeArray( data, [ event ] );
22138
22139 // Allow special events to draw outside the lines
22140 special = jQuery.event.special[ type ] || {};
22141 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
22142 return;
22143 }
22144
22145 // Determine event propagation path in advance, per W3C events spec (#9951)
22146 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
22147 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
22148
22149 bubbleType = special.delegateType || type;
22150 if ( !rfocusMorph.test( bubbleType + type ) ) {
22151 cur = cur.parentNode;
22152 }
22153 for ( ; cur; cur = cur.parentNode ) {
22154 eventPath.push( cur );
22155 tmp = cur;
22156 }
22157
22158 // Only add window if we got to document (e.g., not plain obj or detached DOM)
22159 if ( tmp === ( elem.ownerDocument || document ) ) {
22160 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
22161 }
22162 }
22163
22164 // Fire handlers on the event path
22165 i = 0;
22166 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
22167
22168 event.type = i > 1 ?
22169 bubbleType :
22170 special.bindType || type;
22171
22172 // jQuery handler
22173 handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
22174 dataPriv.get( cur, "handle" );
22175 if ( handle ) {
22176 handle.apply( cur, data );
22177 }
22178
22179 // Native handler
22180 handle = ontype && cur[ ontype ];
22181 if ( handle && handle.apply && acceptData( cur ) ) {
22182 event.result = handle.apply( cur, data );
22183 if ( event.result === false ) {
22184 event.preventDefault();
22185 }
22186 }
22187 }
22188 event.type = type;
22189
22190 // If nobody prevented the default action, do it now
22191 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
22192
22193 if ( ( !special._default ||
22194 special._default.apply( eventPath.pop(), data ) === false ) &&
22195 acceptData( elem ) ) {
22196
22197 // Call a native DOM method on the target with the same name as the event.
22198 // Don't do default actions on window, that's where global variables be (#6170)
22199 if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
22200
22201 // Don't re-trigger an onFOO event when we call its FOO() method
22202 tmp = elem[ ontype ];
22203
22204 if ( tmp ) {
22205 elem[ ontype ] = null;
22206 }
22207
22208 // Prevent re-triggering of the same event, since we already bubbled it above
22209 jQuery.event.triggered = type;
22210 elem[ type ]();
22211 jQuery.event.triggered = undefined;
22212
22213 if ( tmp ) {
22214 elem[ ontype ] = tmp;
22215 }
22216 }
22217 }
22218 }
22219
22220 return event.result;
22221 },
22222
22223 // Piggyback on a donor event to simulate a different one
22224 // Used only for `focus(in | out)` events
22225 simulate: function( type, elem, event ) {
22226 var e = jQuery.extend(
22227 new jQuery.Event(),
22228 event,
22229 {
22230 type: type,
22231 isSimulated: true
22232 }
22233 );
22234
22235 jQuery.event.trigger( e, null, elem );
22236 }
22237
22238} );
22239
22240jQuery.fn.extend( {
22241
22242 trigger: function( type, data ) {
22243 return this.each( function() {
22244 jQuery.event.trigger( type, data, this );
22245 } );
22246 },
22247 triggerHandler: function( type, data ) {
22248 var elem = this[ 0 ];
22249 if ( elem ) {
22250 return jQuery.event.trigger( type, data, elem, true );
22251 }
22252 }
22253} );
22254
22255
22256jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
22257 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
22258 "change select submit keydown keypress keyup contextmenu" ).split( " " ),
22259 function( i, name ) {
22260
22261 // Handle event binding
22262 jQuery.fn[ name ] = function( data, fn ) {
22263 return arguments.length > 0 ?
22264 this.on( name, null, data, fn ) :
22265 this.trigger( name );
22266 };
22267} );
22268
22269jQuery.fn.extend( {
22270 hover: function( fnOver, fnOut ) {
22271 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
22272 }
22273} );
22274
22275
22276
22277
22278support.focusin = "onfocusin" in window;
22279
22280
22281// Support: Firefox <=44
22282// Firefox doesn't have focus(in | out) events
22283// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
22284//
22285// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
22286// focus(in | out) events fire after focus & blur events,
22287// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
22288// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
22289if ( !support.focusin ) {
22290 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
22291
22292 // Attach a single capturing handler on the document while someone wants focusin/focusout
22293 var handler = function( event ) {
22294 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
22295 };
22296
22297 jQuery.event.special[ fix ] = {
22298 setup: function() {
22299 var doc = this.ownerDocument || this,
22300 attaches = dataPriv.access( doc, fix );
22301
22302 if ( !attaches ) {
22303 doc.addEventListener( orig, handler, true );
22304 }
22305 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
22306 },
22307 teardown: function() {
22308 var doc = this.ownerDocument || this,
22309 attaches = dataPriv.access( doc, fix ) - 1;
22310
22311 if ( !attaches ) {
22312 doc.removeEventListener( orig, handler, true );
22313 dataPriv.remove( doc, fix );
22314
22315 } else {
22316 dataPriv.access( doc, fix, attaches );
22317 }
22318 }
22319 };
22320 } );
22321}
22322var location = window.location;
22323
22324var nonce = jQuery.now();
22325
22326var rquery = ( /\?/ );
22327
22328
22329
22330// Cross-browser xml parsing
22331jQuery.parseXML = function( data ) {
22332 var xml;
22333 if ( !data || typeof data !== "string" ) {
22334 return null;
22335 }
22336
22337 // Support: IE 9 - 11 only
22338 // IE throws on parseFromString with invalid input.
22339 try {
22340 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
22341 } catch ( e ) {
22342 xml = undefined;
22343 }
22344
22345 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
22346 jQuery.error( "Invalid XML: " + data );
22347 }
22348 return xml;
22349};
22350
22351
22352var
22353 rbracket = /\[\]$/,
22354 rCRLF = /\r?\n/g,
22355 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
22356 rsubmittable = /^(?:input|select|textarea|keygen)/i;
22357
22358function buildParams( prefix, obj, traditional, add ) {
22359 var name;
22360
22361 if ( Array.isArray( obj ) ) {
22362
22363 // Serialize array item.
22364 jQuery.each( obj, function( i, v ) {
22365 if ( traditional || rbracket.test( prefix ) ) {
22366
22367 // Treat each array item as a scalar.
22368 add( prefix, v );
22369
22370 } else {
22371
22372 // Item is non-scalar (array or object), encode its numeric index.
22373 buildParams(
22374 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
22375 v,
22376 traditional,
22377 add
22378 );
22379 }
22380 } );
22381
22382 } else if ( !traditional && jQuery.type( obj ) === "object" ) {
22383
22384 // Serialize object item.
22385 for ( name in obj ) {
22386 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
22387 }
22388
22389 } else {
22390
22391 // Serialize scalar item.
22392 add( prefix, obj );
22393 }
22394}
22395
22396// Serialize an array of form elements or a set of
22397// key/values into a query string
22398jQuery.param = function( a, traditional ) {
22399 var prefix,
22400 s = [],
22401 add = function( key, valueOrFunction ) {
22402
22403 // If value is a function, invoke it and use its return value
22404 var value = jQuery.isFunction( valueOrFunction ) ?
22405 valueOrFunction() :
22406 valueOrFunction;
22407
22408 s[ s.length ] = encodeURIComponent( key ) + "=" +
22409 encodeURIComponent( value == null ? "" : value );
22410 };
22411
22412 // If an array was passed in, assume that it is an array of form elements.
22413 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
22414
22415 // Serialize the form elements
22416 jQuery.each( a, function() {
22417 add( this.name, this.value );
22418 } );
22419
22420 } else {
22421
22422 // If traditional, encode the "old" way (the way 1.3.2 or older
22423 // did it), otherwise encode params recursively.
22424 for ( prefix in a ) {
22425 buildParams( prefix, a[ prefix ], traditional, add );
22426 }
22427 }
22428
22429 // Return the resulting serialization
22430 return s.join( "&" );
22431};
22432
22433jQuery.fn.extend( {
22434 serialize: function() {
22435 return jQuery.param( this.serializeArray() );
22436 },
22437 serializeArray: function() {
22438 return this.map( function() {
22439
22440 // Can add propHook for "elements" to filter or add form elements
22441 var elements = jQuery.prop( this, "elements" );
22442 return elements ? jQuery.makeArray( elements ) : this;
22443 } )
22444 .filter( function() {
22445 var type = this.type;
22446
22447 // Use .is( ":disabled" ) so that fieldset[disabled] works
22448 return this.name && !jQuery( this ).is( ":disabled" ) &&
22449 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
22450 ( this.checked || !rcheckableType.test( type ) );
22451 } )
22452 .map( function( i, elem ) {
22453 var val = jQuery( this ).val();
22454
22455 if ( val == null ) {
22456 return null;
22457 }
22458
22459 if ( Array.isArray( val ) ) {
22460 return jQuery.map( val, function( val ) {
22461 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
22462 } );
22463 }
22464
22465 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
22466 } ).get();
22467 }
22468} );
22469
22470
22471var
22472 r20 = /%20/g,
22473 rhash = /#.*$/,
22474 rantiCache = /([?&])_=[^&]*/,
22475 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
22476
22477 // #7653, #8125, #8152: local protocol detection
22478 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
22479 rnoContent = /^(?:GET|HEAD)$/,
22480 rprotocol = /^\/\//,
22481
22482 /* Prefilters
22483 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
22484 * 2) These are called:
22485 * - BEFORE asking for a transport
22486 * - AFTER param serialization (s.data is a string if s.processData is true)
22487 * 3) key is the dataType
22488 * 4) the catchall symbol "*" can be used
22489 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
22490 */
22491 prefilters = {},
22492
22493 /* Transports bindings
22494 * 1) key is the dataType
22495 * 2) the catchall symbol "*" can be used
22496 * 3) selection will start with transport dataType and THEN go to "*" if needed
22497 */
22498 transports = {},
22499
22500 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
22501 allTypes = "*/".concat( "*" ),
22502
22503 // Anchor tag for parsing the document origin
22504 originAnchor = document.createElement( "a" );
22505 originAnchor.href = location.href;
22506
22507// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
22508function addToPrefiltersOrTransports( structure ) {
22509
22510 // dataTypeExpression is optional and defaults to "*"
22511 return function( dataTypeExpression, func ) {
22512
22513 if ( typeof dataTypeExpression !== "string" ) {
22514 func = dataTypeExpression;
22515 dataTypeExpression = "*";
22516 }
22517
22518 var dataType,
22519 i = 0,
22520 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
22521
22522 if ( jQuery.isFunction( func ) ) {
22523
22524 // For each dataType in the dataTypeExpression
22525 while ( ( dataType = dataTypes[ i++ ] ) ) {
22526
22527 // Prepend if requested
22528 if ( dataType[ 0 ] === "+" ) {
22529 dataType = dataType.slice( 1 ) || "*";
22530 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
22531
22532 // Otherwise append
22533 } else {
22534 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
22535 }
22536 }
22537 }
22538 };
22539}
22540
22541// Base inspection function for prefilters and transports
22542function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
22543
22544 var inspected = {},
22545 seekingTransport = ( structure === transports );
22546
22547 function inspect( dataType ) {
22548 var selected;
22549 inspected[ dataType ] = true;
22550 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
22551 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
22552 if ( typeof dataTypeOrTransport === "string" &&
22553 !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
22554
22555 options.dataTypes.unshift( dataTypeOrTransport );
22556 inspect( dataTypeOrTransport );
22557 return false;
22558 } else if ( seekingTransport ) {
22559 return !( selected = dataTypeOrTransport );
22560 }
22561 } );
22562 return selected;
22563 }
22564
22565 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
22566}
22567
22568// A special extend for ajax options
22569// that takes "flat" options (not to be deep extended)
22570// Fixes #9887
22571function ajaxExtend( target, src ) {
22572 var key, deep,
22573 flatOptions = jQuery.ajaxSettings.flatOptions || {};
22574
22575 for ( key in src ) {
22576 if ( src[ key ] !== undefined ) {
22577 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
22578 }
22579 }
22580 if ( deep ) {
22581 jQuery.extend( true, target, deep );
22582 }
22583
22584 return target;
22585}
22586
22587/* Handles responses to an ajax request:
22588 * - finds the right dataType (mediates between content-type and expected dataType)
22589 * - returns the corresponding response
22590 */
22591function ajaxHandleResponses( s, jqXHR, responses ) {
22592
22593 var ct, type, finalDataType, firstDataType,
22594 contents = s.contents,
22595 dataTypes = s.dataTypes;
22596
22597 // Remove auto dataType and get content-type in the process
22598 while ( dataTypes[ 0 ] === "*" ) {
22599 dataTypes.shift();
22600 if ( ct === undefined ) {
22601 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
22602 }
22603 }
22604
22605 // Check if we're dealing with a known content-type
22606 if ( ct ) {
22607 for ( type in contents ) {
22608 if ( contents[ type ] && contents[ type ].test( ct ) ) {
22609 dataTypes.unshift( type );
22610 break;
22611 }
22612 }
22613 }
22614
22615 // Check to see if we have a response for the expected dataType
22616 if ( dataTypes[ 0 ] in responses ) {
22617 finalDataType = dataTypes[ 0 ];
22618 } else {
22619
22620 // Try convertible dataTypes
22621 for ( type in responses ) {
22622 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
22623 finalDataType = type;
22624 break;
22625 }
22626 if ( !firstDataType ) {
22627 firstDataType = type;
22628 }
22629 }
22630
22631 // Or just use first one
22632 finalDataType = finalDataType || firstDataType;
22633 }
22634
22635 // If we found a dataType
22636 // We add the dataType to the list if needed
22637 // and return the corresponding response
22638 if ( finalDataType ) {
22639 if ( finalDataType !== dataTypes[ 0 ] ) {
22640 dataTypes.unshift( finalDataType );
22641 }
22642 return responses[ finalDataType ];
22643 }
22644}
22645
22646/* Chain conversions given the request and the original response
22647 * Also sets the responseXXX fields on the jqXHR instance
22648 */
22649function ajaxConvert( s, response, jqXHR, isSuccess ) {
22650 var conv2, current, conv, tmp, prev,
22651 converters = {},
22652
22653 // Work with a copy of dataTypes in case we need to modify it for conversion
22654 dataTypes = s.dataTypes.slice();
22655
22656 // Create converters map with lowercased keys
22657 if ( dataTypes[ 1 ] ) {
22658 for ( conv in s.converters ) {
22659 converters[ conv.toLowerCase() ] = s.converters[ conv ];
22660 }
22661 }
22662
22663 current = dataTypes.shift();
22664
22665 // Convert to each sequential dataType
22666 while ( current ) {
22667
22668 if ( s.responseFields[ current ] ) {
22669 jqXHR[ s.responseFields[ current ] ] = response;
22670 }
22671
22672 // Apply the dataFilter if provided
22673 if ( !prev && isSuccess && s.dataFilter ) {
22674 response = s.dataFilter( response, s.dataType );
22675 }
22676
22677 prev = current;
22678 current = dataTypes.shift();
22679
22680 if ( current ) {
22681
22682 // There's only work to do if current dataType is non-auto
22683 if ( current === "*" ) {
22684
22685 current = prev;
22686
22687 // Convert response if prev dataType is non-auto and differs from current
22688 } else if ( prev !== "*" && prev !== current ) {
22689
22690 // Seek a direct converter
22691 conv = converters[ prev + " " + current ] || converters[ "* " + current ];
22692
22693 // If none found, seek a pair
22694 if ( !conv ) {
22695 for ( conv2 in converters ) {
22696
22697 // If conv2 outputs current
22698 tmp = conv2.split( " " );
22699 if ( tmp[ 1 ] === current ) {
22700
22701 // If prev can be converted to accepted input
22702 conv = converters[ prev + " " + tmp[ 0 ] ] ||
22703 converters[ "* " + tmp[ 0 ] ];
22704 if ( conv ) {
22705
22706 // Condense equivalence converters
22707 if ( conv === true ) {
22708 conv = converters[ conv2 ];
22709
22710 // Otherwise, insert the intermediate dataType
22711 } else if ( converters[ conv2 ] !== true ) {
22712 current = tmp[ 0 ];
22713 dataTypes.unshift( tmp[ 1 ] );
22714 }
22715 break;
22716 }
22717 }
22718 }
22719 }
22720
22721 // Apply converter (if not an equivalence)
22722 if ( conv !== true ) {
22723
22724 // Unless errors are allowed to bubble, catch and return them
22725 if ( conv && s.throws ) {
22726 response = conv( response );
22727 } else {
22728 try {
22729 response = conv( response );
22730 } catch ( e ) {
22731 return {
22732 state: "parsererror",
22733 error: conv ? e : "No conversion from " + prev + " to " + current
22734 };
22735 }
22736 }
22737 }
22738 }
22739 }
22740 }
22741
22742 return { state: "success", data: response };
22743}
22744
22745jQuery.extend( {
22746
22747 // Counter for holding the number of active queries
22748 active: 0,
22749
22750 // Last-Modified header cache for next request
22751 lastModified: {},
22752 etag: {},
22753
22754 ajaxSettings: {
22755 url: location.href,
22756 type: "GET",
22757 isLocal: rlocalProtocol.test( location.protocol ),
22758 global: true,
22759 processData: true,
22760 async: true,
22761 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
22762
22763 /*
22764 timeout: 0,
22765 data: null,
22766 dataType: null,
22767 username: null,
22768 password: null,
22769 cache: null,
22770 throws: false,
22771 traditional: false,
22772 headers: {},
22773 */
22774
22775 accepts: {
22776 "*": allTypes,
22777 text: "text/plain",
22778 html: "text/html",
22779 xml: "application/xml, text/xml",
22780 json: "application/json, text/javascript"
22781 },
22782
22783 contents: {
22784 xml: /\bxml\b/,
22785 html: /\bhtml/,
22786 json: /\bjson\b/
22787 },
22788
22789 responseFields: {
22790 xml: "responseXML",
22791 text: "responseText",
22792 json: "responseJSON"
22793 },
22794
22795 // Data converters
22796 // Keys separate source (or catchall "*") and destination types with a single space
22797 converters: {
22798
22799 // Convert anything to text
22800 "* text": String,
22801
22802 // Text to html (true = no transformation)
22803 "text html": true,
22804
22805 // Evaluate text as a json expression
22806 "text json": JSON.parse,
22807
22808 // Parse text as xml
22809 "text xml": jQuery.parseXML
22810 },
22811
22812 // For options that shouldn't be deep extended:
22813 // you can add your own custom options here if
22814 // and when you create one that shouldn't be
22815 // deep extended (see ajaxExtend)
22816 flatOptions: {
22817 url: true,
22818 context: true
22819 }
22820 },
22821
22822 // Creates a full fledged settings object into target
22823 // with both ajaxSettings and settings fields.
22824 // If target is omitted, writes into ajaxSettings.
22825 ajaxSetup: function( target, settings ) {
22826 return settings ?
22827
22828 // Building a settings object
22829 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
22830
22831 // Extending ajaxSettings
22832 ajaxExtend( jQuery.ajaxSettings, target );
22833 },
22834
22835 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
22836 ajaxTransport: addToPrefiltersOrTransports( transports ),
22837
22838 // Main method
22839 ajax: function( url, options ) {
22840
22841 // If url is an object, simulate pre-1.5 signature
22842 if ( typeof url === "object" ) {
22843 options = url;
22844 url = undefined;
22845 }
22846
22847 // Force options to be an object
22848 options = options || {};
22849
22850 var transport,
22851
22852 // URL without anti-cache param
22853 cacheURL,
22854
22855 // Response headers
22856 responseHeadersString,
22857 responseHeaders,
22858
22859 // timeout handle
22860 timeoutTimer,
22861
22862 // Url cleanup var
22863 urlAnchor,
22864
22865 // Request state (becomes false upon send and true upon completion)
22866 completed,
22867
22868 // To know if global events are to be dispatched
22869 fireGlobals,
22870
22871 // Loop variable
22872 i,
22873
22874 // uncached part of the url
22875 uncached,
22876
22877 // Create the final options object
22878 s = jQuery.ajaxSetup( {}, options ),
22879
22880 // Callbacks context
22881 callbackContext = s.context || s,
22882
22883 // Context for global events is callbackContext if it is a DOM node or jQuery collection
22884 globalEventContext = s.context &&
22885 ( callbackContext.nodeType || callbackContext.jquery ) ?
22886 jQuery( callbackContext ) :
22887 jQuery.event,
22888
22889 // Deferreds
22890 deferred = jQuery.Deferred(),
22891 completeDeferred = jQuery.Callbacks( "once memory" ),
22892
22893 // Status-dependent callbacks
22894 statusCode = s.statusCode || {},
22895
22896 // Headers (they are sent all at once)
22897 requestHeaders = {},
22898 requestHeadersNames = {},
22899
22900 // Default abort message
22901 strAbort = "canceled",
22902
22903 // Fake xhr
22904 jqXHR = {
22905 readyState: 0,
22906
22907 // Builds headers hashtable if needed
22908 getResponseHeader: function( key ) {
22909 var match;
22910 if ( completed ) {
22911 if ( !responseHeaders ) {
22912 responseHeaders = {};
22913 while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
22914 responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
22915 }
22916 }
22917 match = responseHeaders[ key.toLowerCase() ];
22918 }
22919 return match == null ? null : match;
22920 },
22921
22922 // Raw string
22923 getAllResponseHeaders: function() {
22924 return completed ? responseHeadersString : null;
22925 },
22926
22927 // Caches the header
22928 setRequestHeader: function( name, value ) {
22929 if ( completed == null ) {
22930 name = requestHeadersNames[ name.toLowerCase() ] =
22931 requestHeadersNames[ name.toLowerCase() ] || name;
22932 requestHeaders[ name ] = value;
22933 }
22934 return this;
22935 },
22936
22937 // Overrides response content-type header
22938 overrideMimeType: function( type ) {
22939 if ( completed == null ) {
22940 s.mimeType = type;
22941 }
22942 return this;
22943 },
22944
22945 // Status-dependent callbacks
22946 statusCode: function( map ) {
22947 var code;
22948 if ( map ) {
22949 if ( completed ) {
22950
22951 // Execute the appropriate callbacks
22952 jqXHR.always( map[ jqXHR.status ] );
22953 } else {
22954
22955 // Lazy-add the new callbacks in a way that preserves old ones
22956 for ( code in map ) {
22957 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
22958 }
22959 }
22960 }
22961 return this;
22962 },
22963
22964 // Cancel the request
22965 abort: function( statusText ) {
22966 var finalText = statusText || strAbort;
22967 if ( transport ) {
22968 transport.abort( finalText );
22969 }
22970 done( 0, finalText );
22971 return this;
22972 }
22973 };
22974
22975 // Attach deferreds
22976 deferred.promise( jqXHR );
22977
22978 // Add protocol if not provided (prefilters might expect it)
22979 // Handle falsy url in the settings object (#10093: consistency with old signature)
22980 // We also use the url parameter if available
22981 s.url = ( ( url || s.url || location.href ) + "" )
22982 .replace( rprotocol, location.protocol + "//" );
22983
22984 // Alias method option to type as per ticket #12004
22985 s.type = options.method || options.type || s.method || s.type;
22986
22987 // Extract dataTypes list
22988 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
22989
22990 // A cross-domain request is in order when the origin doesn't match the current origin.
22991 if ( s.crossDomain == null ) {
22992 urlAnchor = document.createElement( "a" );
22993
22994 // Support: IE <=8 - 11, Edge 12 - 13
22995 // IE throws exception on accessing the href property if url is malformed,
22996 // e.g. http://example.com:80x/
22997 try {
22998 urlAnchor.href = s.url;
22999
23000 // Support: IE <=8 - 11 only
23001 // Anchor's host property isn't correctly set when s.url is relative
23002 urlAnchor.href = urlAnchor.href;
23003 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
23004 urlAnchor.protocol + "//" + urlAnchor.host;
23005 } catch ( e ) {
23006
23007 // If there is an error parsing the URL, assume it is crossDomain,
23008 // it can be rejected by the transport if it is invalid
23009 s.crossDomain = true;
23010 }
23011 }
23012
23013 // Convert data if not already a string
23014 if ( s.data && s.processData && typeof s.data !== "string" ) {
23015 s.data = jQuery.param( s.data, s.traditional );
23016 }
23017
23018 // Apply prefilters
23019 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
23020
23021 // If request was aborted inside a prefilter, stop there
23022 if ( completed ) {
23023 return jqXHR;
23024 }
23025
23026 // We can fire global events as of now if asked to
23027 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
23028 fireGlobals = jQuery.event && s.global;
23029
23030 // Watch for a new set of requests
23031 if ( fireGlobals && jQuery.active++ === 0 ) {
23032 jQuery.event.trigger( "ajaxStart" );
23033 }
23034
23035 // Uppercase the type
23036 s.type = s.type.toUpperCase();
23037
23038 // Determine if request has content
23039 s.hasContent = !rnoContent.test( s.type );
23040
23041 // Save the URL in case we're toying with the If-Modified-Since
23042 // and/or If-None-Match header later on
23043 // Remove hash to simplify url manipulation
23044 cacheURL = s.url.replace( rhash, "" );
23045
23046 // More options handling for requests with no content
23047 if ( !s.hasContent ) {
23048
23049 // Remember the hash so we can put it back
23050 uncached = s.url.slice( cacheURL.length );
23051
23052 // If data is available, append data to url
23053 if ( s.data ) {
23054 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
23055
23056 // #9682: remove data so that it's not used in an eventual retry
23057 delete s.data;
23058 }
23059
23060 // Add or update anti-cache param if needed
23061 if ( s.cache === false ) {
23062 cacheURL = cacheURL.replace( rantiCache, "$1" );
23063 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
23064 }
23065
23066 // Put hash and anti-cache on the URL that will be requested (gh-1732)
23067 s.url = cacheURL + uncached;
23068
23069 // Change '%20' to '+' if this is encoded form body content (gh-2658)
23070 } else if ( s.data && s.processData &&
23071 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
23072 s.data = s.data.replace( r20, "+" );
23073 }
23074
23075 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
23076 if ( s.ifModified ) {
23077 if ( jQuery.lastModified[ cacheURL ] ) {
23078 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
23079 }
23080 if ( jQuery.etag[ cacheURL ] ) {
23081 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
23082 }
23083 }
23084
23085 // Set the correct header, if data is being sent
23086 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
23087 jqXHR.setRequestHeader( "Content-Type", s.contentType );
23088 }
23089
23090 // Set the Accepts header for the server, depending on the dataType
23091 jqXHR.setRequestHeader(
23092 "Accept",
23093 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
23094 s.accepts[ s.dataTypes[ 0 ] ] +
23095 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
23096 s.accepts[ "*" ]
23097 );
23098
23099 // Check for headers option
23100 for ( i in s.headers ) {
23101 jqXHR.setRequestHeader( i, s.headers[ i ] );
23102 }
23103
23104 // Allow custom headers/mimetypes and early abort
23105 if ( s.beforeSend &&
23106 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
23107
23108 // Abort if not done already and return
23109 return jqXHR.abort();
23110 }
23111
23112 // Aborting is no longer a cancellation
23113 strAbort = "abort";
23114
23115 // Install callbacks on deferreds
23116 completeDeferred.add( s.complete );
23117 jqXHR.done( s.success );
23118 jqXHR.fail( s.error );
23119
23120 // Get transport
23121 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
23122
23123 // If no transport, we auto-abort
23124 if ( !transport ) {
23125 done( -1, "No Transport" );
23126 } else {
23127 jqXHR.readyState = 1;
23128
23129 // Send global event
23130 if ( fireGlobals ) {
23131 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
23132 }
23133
23134 // If request was aborted inside ajaxSend, stop there
23135 if ( completed ) {
23136 return jqXHR;
23137 }
23138
23139 // Timeout
23140 if ( s.async && s.timeout > 0 ) {
23141 timeoutTimer = window.setTimeout( function() {
23142 jqXHR.abort( "timeout" );
23143 }, s.timeout );
23144 }
23145
23146 try {
23147 completed = false;
23148 transport.send( requestHeaders, done );
23149 } catch ( e ) {
23150
23151 // Rethrow post-completion exceptions
23152 if ( completed ) {
23153 throw e;
23154 }
23155
23156 // Propagate others as results
23157 done( -1, e );
23158 }
23159 }
23160
23161 // Callback for when everything is done
23162 function done( status, nativeStatusText, responses, headers ) {
23163 var isSuccess, success, error, response, modified,
23164 statusText = nativeStatusText;
23165
23166 // Ignore repeat invocations
23167 if ( completed ) {
23168 return;
23169 }
23170
23171 completed = true;
23172
23173 // Clear timeout if it exists
23174 if ( timeoutTimer ) {
23175 window.clearTimeout( timeoutTimer );
23176 }
23177
23178 // Dereference transport for early garbage collection
23179 // (no matter how long the jqXHR object will be used)
23180 transport = undefined;
23181
23182 // Cache response headers
23183 responseHeadersString = headers || "";
23184
23185 // Set readyState
23186 jqXHR.readyState = status > 0 ? 4 : 0;
23187
23188 // Determine if successful
23189 isSuccess = status >= 200 && status < 300 || status === 304;
23190
23191 // Get response data
23192 if ( responses ) {
23193 response = ajaxHandleResponses( s, jqXHR, responses );
23194 }
23195
23196 // Convert no matter what (that way responseXXX fields are always set)
23197 response = ajaxConvert( s, response, jqXHR, isSuccess );
23198
23199 // If successful, handle type chaining
23200 if ( isSuccess ) {
23201
23202 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
23203 if ( s.ifModified ) {
23204 modified = jqXHR.getResponseHeader( "Last-Modified" );
23205 if ( modified ) {
23206 jQuery.lastModified[ cacheURL ] = modified;
23207 }
23208 modified = jqXHR.getResponseHeader( "etag" );
23209 if ( modified ) {
23210 jQuery.etag[ cacheURL ] = modified;
23211 }
23212 }
23213
23214 // if no content
23215 if ( status === 204 || s.type === "HEAD" ) {
23216 statusText = "nocontent";
23217
23218 // if not modified
23219 } else if ( status === 304 ) {
23220 statusText = "notmodified";
23221
23222 // If we have data, let's convert it
23223 } else {
23224 statusText = response.state;
23225 success = response.data;
23226 error = response.error;
23227 isSuccess = !error;
23228 }
23229 } else {
23230
23231 // Extract error from statusText and normalize for non-aborts
23232 error = statusText;
23233 if ( status || !statusText ) {
23234 statusText = "error";
23235 if ( status < 0 ) {
23236 status = 0;
23237 }
23238 }
23239 }
23240
23241 // Set data for the fake xhr object
23242 jqXHR.status = status;
23243 jqXHR.statusText = ( nativeStatusText || statusText ) + "";
23244
23245 // Success/Error
23246 if ( isSuccess ) {
23247 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
23248 } else {
23249 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
23250 }
23251
23252 // Status-dependent callbacks
23253 jqXHR.statusCode( statusCode );
23254 statusCode = undefined;
23255
23256 if ( fireGlobals ) {
23257 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
23258 [ jqXHR, s, isSuccess ? success : error ] );
23259 }
23260
23261 // Complete
23262 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
23263
23264 if ( fireGlobals ) {
23265 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
23266
23267 // Handle the global AJAX counter
23268 if ( !( --jQuery.active ) ) {
23269 jQuery.event.trigger( "ajaxStop" );
23270 }
23271 }
23272 }
23273
23274 return jqXHR;
23275 },
23276
23277 getJSON: function( url, data, callback ) {
23278 return jQuery.get( url, data, callback, "json" );
23279 },
23280
23281 getScript: function( url, callback ) {
23282 return jQuery.get( url, undefined, callback, "script" );
23283 }
23284} );
23285
23286jQuery.each( [ "get", "post" ], function( i, method ) {
23287 jQuery[ method ] = function( url, data, callback, type ) {
23288
23289 // Shift arguments if data argument was omitted
23290 if ( jQuery.isFunction( data ) ) {
23291 type = type || callback;
23292 callback = data;
23293 data = undefined;
23294 }
23295
23296 // The url can be an options object (which then must have .url)
23297 return jQuery.ajax( jQuery.extend( {
23298 url: url,
23299 type: method,
23300 dataType: type,
23301 data: data,
23302 success: callback
23303 }, jQuery.isPlainObject( url ) && url ) );
23304 };
23305} );
23306
23307
23308jQuery._evalUrl = function( url ) {
23309 return jQuery.ajax( {
23310 url: url,
23311
23312 // Make this explicit, since user can override this through ajaxSetup (#11264)
23313 type: "GET",
23314 dataType: "script",
23315 cache: true,
23316 async: false,
23317 global: false,
23318 "throws": true
23319 } );
23320};
23321
23322
23323jQuery.fn.extend( {
23324 wrapAll: function( html ) {
23325 var wrap;
23326
23327 if ( this[ 0 ] ) {
23328 if ( jQuery.isFunction( html ) ) {
23329 html = html.call( this[ 0 ] );
23330 }
23331
23332 // The elements to wrap the target around
23333 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
23334
23335 if ( this[ 0 ].parentNode ) {
23336 wrap.insertBefore( this[ 0 ] );
23337 }
23338
23339 wrap.map( function() {
23340 var elem = this;
23341
23342 while ( elem.firstElementChild ) {
23343 elem = elem.firstElementChild;
23344 }
23345
23346 return elem;
23347 } ).append( this );
23348 }
23349
23350 return this;
23351 },
23352
23353 wrapInner: function( html ) {
23354 if ( jQuery.isFunction( html ) ) {
23355 return this.each( function( i ) {
23356 jQuery( this ).wrapInner( html.call( this, i ) );
23357 } );
23358 }
23359
23360 return this.each( function() {
23361 var self = jQuery( this ),
23362 contents = self.contents();
23363
23364 if ( contents.length ) {
23365 contents.wrapAll( html );
23366
23367 } else {
23368 self.append( html );
23369 }
23370 } );
23371 },
23372
23373 wrap: function( html ) {
23374 var isFunction = jQuery.isFunction( html );
23375
23376 return this.each( function( i ) {
23377 jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
23378 } );
23379 },
23380
23381 unwrap: function( selector ) {
23382 this.parent( selector ).not( "body" ).each( function() {
23383 jQuery( this ).replaceWith( this.childNodes );
23384 } );
23385 return this;
23386 }
23387} );
23388
23389
23390jQuery.expr.pseudos.hidden = function( elem ) {
23391 return !jQuery.expr.pseudos.visible( elem );
23392};
23393jQuery.expr.pseudos.visible = function( elem ) {
23394 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
23395};
23396
23397
23398
23399
23400jQuery.ajaxSettings.xhr = function() {
23401 try {
23402 return new window.XMLHttpRequest();
23403 } catch ( e ) {}
23404};
23405
23406var xhrSuccessStatus = {
23407
23408 // File protocol always yields status code 0, assume 200
23409 0: 200,
23410
23411 // Support: IE <=9 only
23412 // #1450: sometimes IE returns 1223 when it should be 204
23413 1223: 204
23414 },
23415 xhrSupported = jQuery.ajaxSettings.xhr();
23416
23417support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
23418support.ajax = xhrSupported = !!xhrSupported;
23419
23420jQuery.ajaxTransport( function( options ) {
23421 var callback, errorCallback;
23422
23423 // Cross domain only allowed if supported through XMLHttpRequest
23424 if ( support.cors || xhrSupported && !options.crossDomain ) {
23425 return {
23426 send: function( headers, complete ) {
23427 var i,
23428 xhr = options.xhr();
23429
23430 xhr.open(
23431 options.type,
23432 options.url,
23433 options.async,
23434 options.username,
23435 options.password
23436 );
23437
23438 // Apply custom fields if provided
23439 if ( options.xhrFields ) {
23440 for ( i in options.xhrFields ) {
23441 xhr[ i ] = options.xhrFields[ i ];
23442 }
23443 }
23444
23445 // Override mime type if needed
23446 if ( options.mimeType && xhr.overrideMimeType ) {
23447 xhr.overrideMimeType( options.mimeType );
23448 }
23449
23450 // X-Requested-With header
23451 // For cross-domain requests, seeing as conditions for a preflight are
23452 // akin to a jigsaw puzzle, we simply never set it to be sure.
23453 // (it can always be set on a per-request basis or even using ajaxSetup)
23454 // For same-domain requests, won't change header if already provided.
23455 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
23456 headers[ "X-Requested-With" ] = "XMLHttpRequest";
23457 }
23458
23459 // Set headers
23460 for ( i in headers ) {
23461 xhr.setRequestHeader( i, headers[ i ] );
23462 }
23463
23464 // Callback
23465 callback = function( type ) {
23466 return function() {
23467 if ( callback ) {
23468 callback = errorCallback = xhr.onload =
23469 xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
23470
23471 if ( type === "abort" ) {
23472 xhr.abort();
23473 } else if ( type === "error" ) {
23474
23475 // Support: IE <=9 only
23476 // On a manual native abort, IE9 throws
23477 // errors on any property access that is not readyState
23478 if ( typeof xhr.status !== "number" ) {
23479 complete( 0, "error" );
23480 } else {
23481 complete(
23482
23483 // File: protocol always yields status 0; see #8605, #14207
23484 xhr.status,
23485 xhr.statusText
23486 );
23487 }
23488 } else {
23489 complete(
23490 xhrSuccessStatus[ xhr.status ] || xhr.status,
23491 xhr.statusText,
23492
23493 // Support: IE <=9 only
23494 // IE9 has no XHR2 but throws on binary (trac-11426)
23495 // For XHR2 non-text, let the caller handle it (gh-2498)
23496 ( xhr.responseType || "text" ) !== "text" ||
23497 typeof xhr.responseText !== "string" ?
23498 { binary: xhr.response } :
23499 { text: xhr.responseText },
23500 xhr.getAllResponseHeaders()
23501 );
23502 }
23503 }
23504 };
23505 };
23506
23507 // Listen to events
23508 xhr.onload = callback();
23509 errorCallback = xhr.onerror = callback( "error" );
23510
23511 // Support: IE 9 only
23512 // Use onreadystatechange to replace onabort
23513 // to handle uncaught aborts
23514 if ( xhr.onabort !== undefined ) {
23515 xhr.onabort = errorCallback;
23516 } else {
23517 xhr.onreadystatechange = function() {
23518
23519 // Check readyState before timeout as it changes
23520 if ( xhr.readyState === 4 ) {
23521
23522 // Allow onerror to be called first,
23523 // but that will not handle a native abort
23524 // Also, save errorCallback to a variable
23525 // as xhr.onerror cannot be accessed
23526 window.setTimeout( function() {
23527 if ( callback ) {
23528 errorCallback();
23529 }
23530 } );
23531 }
23532 };
23533 }
23534
23535 // Create the abort callback
23536 callback = callback( "abort" );
23537
23538 try {
23539
23540 // Do send the request (this may raise an exception)
23541 xhr.send( options.hasContent && options.data || null );
23542 } catch ( e ) {
23543
23544 // #14683: Only rethrow if this hasn't been notified as an error yet
23545 if ( callback ) {
23546 throw e;
23547 }
23548 }
23549 },
23550
23551 abort: function() {
23552 if ( callback ) {
23553 callback();
23554 }
23555 }
23556 };
23557 }
23558} );
23559
23560
23561
23562
23563// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
23564jQuery.ajaxPrefilter( function( s ) {
23565 if ( s.crossDomain ) {
23566 s.contents.script = false;
23567 }
23568} );
23569
23570// Install script dataType
23571jQuery.ajaxSetup( {
23572 accepts: {
23573 script: "text/javascript, application/javascript, " +
23574 "application/ecmascript, application/x-ecmascript"
23575 },
23576 contents: {
23577 script: /\b(?:java|ecma)script\b/
23578 },
23579 converters: {
23580 "text script": function( text ) {
23581 jQuery.globalEval( text );
23582 return text;
23583 }
23584 }
23585} );
23586
23587// Handle cache's special case and crossDomain
23588jQuery.ajaxPrefilter( "script", function( s ) {
23589 if ( s.cache === undefined ) {
23590 s.cache = false;
23591 }
23592 if ( s.crossDomain ) {
23593 s.type = "GET";
23594 }
23595} );
23596
23597// Bind script tag hack transport
23598jQuery.ajaxTransport( "script", function( s ) {
23599
23600 // This transport only deals with cross domain requests
23601 if ( s.crossDomain ) {
23602 var script, callback;
23603 return {
23604 send: function( _, complete ) {
23605 script = jQuery( "<script>" ).prop( {
23606 charset: s.scriptCharset,
23607 src: s.url
23608 } ).on(
23609 "load error",
23610 callback = function( evt ) {
23611 script.remove();
23612 callback = null;
23613 if ( evt ) {
23614 complete( evt.type === "error" ? 404 : 200, evt.type );
23615 }
23616 }
23617 );
23618
23619 // Use native DOM manipulation to avoid our domManip AJAX trickery
23620 document.head.appendChild( script[ 0 ] );
23621 },
23622 abort: function() {
23623 if ( callback ) {
23624 callback();
23625 }
23626 }
23627 };
23628 }
23629} );
23630
23631
23632
23633
23634var oldCallbacks = [],
23635 rjsonp = /(=)\?(?=&|$)|\?\?/;
23636
23637// Default jsonp settings
23638jQuery.ajaxSetup( {
23639 jsonp: "callback",
23640 jsonpCallback: function() {
23641 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
23642 this[ callback ] = true;
23643 return callback;
23644 }
23645} );
23646
23647// Detect, normalize options and install callbacks for jsonp requests
23648jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
23649
23650 var callbackName, overwritten, responseContainer,
23651 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
23652 "url" :
23653 typeof s.data === "string" &&
23654 ( s.contentType || "" )
23655 .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
23656 rjsonp.test( s.data ) && "data"
23657 );
23658
23659 // Handle iff the expected data type is "jsonp" or we have a parameter to set
23660 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
23661
23662 // Get callback name, remembering preexisting value associated with it
23663 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
23664 s.jsonpCallback() :
23665 s.jsonpCallback;
23666
23667 // Insert callback into url or form data
23668 if ( jsonProp ) {
23669 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
23670 } else if ( s.jsonp !== false ) {
23671 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
23672 }
23673
23674 // Use data converter to retrieve json after script execution
23675 s.converters[ "script json" ] = function() {
23676 if ( !responseContainer ) {
23677 jQuery.error( callbackName + " was not called" );
23678 }
23679 return responseContainer[ 0 ];
23680 };
23681
23682 // Force json dataType
23683 s.dataTypes[ 0 ] = "json";
23684
23685 // Install callback
23686 overwritten = window[ callbackName ];
23687 window[ callbackName ] = function() {
23688 responseContainer = arguments;
23689 };
23690
23691 // Clean-up function (fires after converters)
23692 jqXHR.always( function() {
23693
23694 // If previous value didn't exist - remove it
23695 if ( overwritten === undefined ) {
23696 jQuery( window ).removeProp( callbackName );
23697
23698 // Otherwise restore preexisting value
23699 } else {
23700 window[ callbackName ] = overwritten;
23701 }
23702
23703 // Save back as free
23704 if ( s[ callbackName ] ) {
23705
23706 // Make sure that re-using the options doesn't screw things around
23707 s.jsonpCallback = originalSettings.jsonpCallback;
23708
23709 // Save the callback name for future use
23710 oldCallbacks.push( callbackName );
23711 }
23712
23713 // Call if it was a function and we have a response
23714 if ( responseContainer && jQuery.isFunction( overwritten ) ) {
23715 overwritten( responseContainer[ 0 ] );
23716 }
23717
23718 responseContainer = overwritten = undefined;
23719 } );
23720
23721 // Delegate to script
23722 return "script";
23723 }
23724} );
23725
23726
23727
23728
23729// Support: Safari 8 only
23730// In Safari 8 documents created via document.implementation.createHTMLDocument
23731// collapse sibling forms: the second one becomes a child of the first one.
23732// Because of that, this security measure has to be disabled in Safari 8.
23733// https://bugs.webkit.org/show_bug.cgi?id=137337
23734support.createHTMLDocument = ( function() {
23735 var body = document.implementation.createHTMLDocument( "" ).body;
23736 body.innerHTML = "<form></form><form></form>";
23737 return body.childNodes.length === 2;
23738} )();
23739
23740
23741// Argument "data" should be string of html
23742// context (optional): If specified, the fragment will be created in this context,
23743// defaults to document
23744// keepScripts (optional): If true, will include scripts passed in the html string
23745jQuery.parseHTML = function( data, context, keepScripts ) {
23746 if ( typeof data !== "string" ) {
23747 return [];
23748 }
23749 if ( typeof context === "boolean" ) {
23750 keepScripts = context;
23751 context = false;
23752 }
23753
23754 var base, parsed, scripts;
23755
23756 if ( !context ) {
23757
23758 // Stop scripts or inline event handlers from being executed immediately
23759 // by using document.implementation
23760 if ( support.createHTMLDocument ) {
23761 context = document.implementation.createHTMLDocument( "" );
23762
23763 // Set the base href for the created document
23764 // so any parsed elements with URLs
23765 // are based on the document's URL (gh-2965)
23766 base = context.createElement( "base" );
23767 base.href = document.location.href;
23768 context.head.appendChild( base );
23769 } else {
23770 context = document;
23771 }
23772 }
23773
23774 parsed = rsingleTag.exec( data );
23775 scripts = !keepScripts && [];
23776
23777 // Single tag
23778 if ( parsed ) {
23779 return [ context.createElement( parsed[ 1 ] ) ];
23780 }
23781
23782 parsed = buildFragment( [ data ], context, scripts );
23783
23784 if ( scripts && scripts.length ) {
23785 jQuery( scripts ).remove();
23786 }
23787
23788 return jQuery.merge( [], parsed.childNodes );
23789};
23790
23791
23792/**
23793 * Load a url into a page
23794 */
23795jQuery.fn.load = function( url, params, callback ) {
23796 var selector, type, response,
23797 self = this,
23798 off = url.indexOf( " " );
23799
23800 if ( off > -1 ) {
23801 selector = stripAndCollapse( url.slice( off ) );
23802 url = url.slice( 0, off );
23803 }
23804
23805 // If it's a function
23806 if ( jQuery.isFunction( params ) ) {
23807
23808 // We assume that it's the callback
23809 callback = params;
23810 params = undefined;
23811
23812 // Otherwise, build a param string
23813 } else if ( params && typeof params === "object" ) {
23814 type = "POST";
23815 }
23816
23817 // If we have elements to modify, make the request
23818 if ( self.length > 0 ) {
23819 jQuery.ajax( {
23820 url: url,
23821
23822 // If "type" variable is undefined, then "GET" method will be used.
23823 // Make value of this field explicit since
23824 // user can override it through ajaxSetup method
23825 type: type || "GET",
23826 dataType: "html",
23827 data: params
23828 } ).done( function( responseText ) {
23829
23830 // Save response for use in complete callback
23831 response = arguments;
23832
23833 self.html( selector ?
23834
23835 // If a selector was specified, locate the right elements in a dummy div
23836 // Exclude scripts to avoid IE 'Permission Denied' errors
23837 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
23838
23839 // Otherwise use the full result
23840 responseText );
23841
23842 // If the request succeeds, this function gets "data", "status", "jqXHR"
23843 // but they are ignored because response was set above.
23844 // If it fails, this function gets "jqXHR", "status", "error"
23845 } ).always( callback && function( jqXHR, status ) {
23846 self.each( function() {
23847 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
23848 } );
23849 } );
23850 }
23851
23852 return this;
23853};
23854
23855
23856
23857
23858// Attach a bunch of functions for handling common AJAX events
23859jQuery.each( [
23860 "ajaxStart",
23861 "ajaxStop",
23862 "ajaxComplete",
23863 "ajaxError",
23864 "ajaxSuccess",
23865 "ajaxSend"
23866], function( i, type ) {
23867 jQuery.fn[ type ] = function( fn ) {
23868 return this.on( type, fn );
23869 };
23870} );
23871
23872
23873
23874
23875jQuery.expr.pseudos.animated = function( elem ) {
23876 return jQuery.grep( jQuery.timers, function( fn ) {
23877 return elem === fn.elem;
23878 } ).length;
23879};
23880
23881
23882
23883
23884jQuery.offset = {
23885 setOffset: function( elem, options, i ) {
23886 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
23887 position = jQuery.css( elem, "position" ),
23888 curElem = jQuery( elem ),
23889 props = {};
23890
23891 // Set position first, in-case top/left are set even on static elem
23892 if ( position === "static" ) {
23893 elem.style.position = "relative";
23894 }
23895
23896 curOffset = curElem.offset();
23897 curCSSTop = jQuery.css( elem, "top" );
23898 curCSSLeft = jQuery.css( elem, "left" );
23899 calculatePosition = ( position === "absolute" || position === "fixed" ) &&
23900 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
23901
23902 // Need to be able to calculate position if either
23903 // top or left is auto and position is either absolute or fixed
23904 if ( calculatePosition ) {
23905 curPosition = curElem.position();
23906 curTop = curPosition.top;
23907 curLeft = curPosition.left;
23908
23909 } else {
23910 curTop = parseFloat( curCSSTop ) || 0;
23911 curLeft = parseFloat( curCSSLeft ) || 0;
23912 }
23913
23914 if ( jQuery.isFunction( options ) ) {
23915
23916 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
23917 options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
23918 }
23919
23920 if ( options.top != null ) {
23921 props.top = ( options.top - curOffset.top ) + curTop;
23922 }
23923 if ( options.left != null ) {
23924 props.left = ( options.left - curOffset.left ) + curLeft;
23925 }
23926
23927 if ( "using" in options ) {
23928 options.using.call( elem, props );
23929
23930 } else {
23931 curElem.css( props );
23932 }
23933 }
23934};
23935
23936jQuery.fn.extend( {
23937 offset: function( options ) {
23938
23939 // Preserve chaining for setter
23940 if ( arguments.length ) {
23941 return options === undefined ?
23942 this :
23943 this.each( function( i ) {
23944 jQuery.offset.setOffset( this, options, i );
23945 } );
23946 }
23947
23948 var doc, docElem, rect, win,
23949 elem = this[ 0 ];
23950
23951 if ( !elem ) {
23952 return;
23953 }
23954
23955 // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
23956 // Support: IE <=11 only
23957 // Running getBoundingClientRect on a
23958 // disconnected node in IE throws an error
23959 if ( !elem.getClientRects().length ) {
23960 return { top: 0, left: 0 };
23961 }
23962
23963 rect = elem.getBoundingClientRect();
23964
23965 doc = elem.ownerDocument;
23966 docElem = doc.documentElement;
23967 win = doc.defaultView;
23968
23969 return {
23970 top: rect.top + win.pageYOffset - docElem.clientTop,
23971 left: rect.left + win.pageXOffset - docElem.clientLeft
23972 };
23973 },
23974
23975 position: function() {
23976 if ( !this[ 0 ] ) {
23977 return;
23978 }
23979
23980 var offsetParent, offset,
23981 elem = this[ 0 ],
23982 parentOffset = { top: 0, left: 0 };
23983
23984 // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
23985 // because it is its only offset parent
23986 if ( jQuery.css( elem, "position" ) === "fixed" ) {
23987
23988 // Assume getBoundingClientRect is there when computed position is fixed
23989 offset = elem.getBoundingClientRect();
23990
23991 } else {
23992
23993 // Get *real* offsetParent
23994 offsetParent = this.offsetParent();
23995
23996 // Get correct offsets
23997 offset = this.offset();
23998 if ( !nodeName( offsetParent[ 0 ], "html" ) ) {
23999 parentOffset = offsetParent.offset();
24000 }
24001
24002 // Add offsetParent borders
24003 parentOffset = {
24004 top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ),
24005 left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true )
24006 };
24007 }
24008
24009 // Subtract parent offsets and element margins
24010 return {
24011 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
24012 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
24013 };
24014 },
24015
24016 // This method will return documentElement in the following cases:
24017 // 1) For the element inside the iframe without offsetParent, this method will return
24018 // documentElement of the parent window
24019 // 2) For the hidden or detached element
24020 // 3) For body or html element, i.e. in case of the html node - it will return itself
24021 //
24022 // but those exceptions were never presented as a real life use-cases
24023 // and might be considered as more preferable results.
24024 //
24025 // This logic, however, is not guaranteed and can change at any point in the future
24026 offsetParent: function() {
24027 return this.map( function() {
24028 var offsetParent = this.offsetParent;
24029
24030 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
24031 offsetParent = offsetParent.offsetParent;
24032 }
24033
24034 return offsetParent || documentElement;
24035 } );
24036 }
24037} );
24038
24039// Create scrollLeft and scrollTop methods
24040jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
24041 var top = "pageYOffset" === prop;
24042
24043 jQuery.fn[ method ] = function( val ) {
24044 return access( this, function( elem, method, val ) {
24045
24046 // Coalesce documents and windows
24047 var win;
24048 if ( jQuery.isWindow( elem ) ) {
24049 win = elem;
24050 } else if ( elem.nodeType === 9 ) {
24051 win = elem.defaultView;
24052 }
24053
24054 if ( val === undefined ) {
24055 return win ? win[ prop ] : elem[ method ];
24056 }
24057
24058 if ( win ) {
24059 win.scrollTo(
24060 !top ? val : win.pageXOffset,
24061 top ? val : win.pageYOffset
24062 );
24063
24064 } else {
24065 elem[ method ] = val;
24066 }
24067 }, method, val, arguments.length );
24068 };
24069} );
24070
24071// Support: Safari <=7 - 9.1, Chrome <=37 - 49
24072// Add the top/left cssHooks using jQuery.fn.position
24073// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
24074// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
24075// getComputedStyle returns percent when specified for top/left/bottom/right;
24076// rather than make the css module depend on the offset module, just check for it here
24077jQuery.each( [ "top", "left" ], function( i, prop ) {
24078 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
24079 function( elem, computed ) {
24080 if ( computed ) {
24081 computed = curCSS( elem, prop );
24082
24083 // If curCSS returns percentage, fallback to offset
24084 return rnumnonpx.test( computed ) ?
24085 jQuery( elem ).position()[ prop ] + "px" :
24086 computed;
24087 }
24088 }
24089 );
24090} );
24091
24092
24093// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
24094jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
24095 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
24096 function( defaultExtra, funcName ) {
24097
24098 // Margin is only for outerHeight, outerWidth
24099 jQuery.fn[ funcName ] = function( margin, value ) {
24100 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
24101 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
24102
24103 return access( this, function( elem, type, value ) {
24104 var doc;
24105
24106 if ( jQuery.isWindow( elem ) ) {
24107
24108 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
24109 return funcName.indexOf( "outer" ) === 0 ?
24110 elem[ "inner" + name ] :
24111 elem.document.documentElement[ "client" + name ];
24112 }
24113
24114 // Get document width or height
24115 if ( elem.nodeType === 9 ) {
24116 doc = elem.documentElement;
24117
24118 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
24119 // whichever is greatest
24120 return Math.max(
24121 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
24122 elem.body[ "offset" + name ], doc[ "offset" + name ],
24123 doc[ "client" + name ]
24124 );
24125 }
24126
24127 return value === undefined ?
24128
24129 // Get width or height on the element, requesting but not forcing parseFloat
24130 jQuery.css( elem, type, extra ) :
24131
24132 // Set width or height on the element
24133 jQuery.style( elem, type, value, extra );
24134 }, type, chainable ? margin : undefined, chainable );
24135 };
24136 } );
24137} );
24138
24139
24140jQuery.fn.extend( {
24141
24142 bind: function( types, data, fn ) {
24143 return this.on( types, null, data, fn );
24144 },
24145 unbind: function( types, fn ) {
24146 return this.off( types, null, fn );
24147 },
24148
24149 delegate: function( selector, types, data, fn ) {
24150 return this.on( types, selector, data, fn );
24151 },
24152 undelegate: function( selector, types, fn ) {
24153
24154 // ( namespace ) or ( selector, types [, fn] )
24155 return arguments.length === 1 ?
24156 this.off( selector, "**" ) :
24157 this.off( types, selector || "**", fn );
24158 }
24159} );
24160
24161jQuery.holdReady = function( hold ) {
24162 if ( hold ) {
24163 jQuery.readyWait++;
24164 } else {
24165 jQuery.ready( true );
24166 }
24167};
24168jQuery.isArray = Array.isArray;
24169jQuery.parseJSON = JSON.parse;
24170jQuery.nodeName = nodeName;
24171
24172
24173
24174
24175// Register as a named AMD module, since jQuery can be concatenated with other
24176// files that may use define, but not via a proper concatenation script that
24177// understands anonymous AMD modules. A named AMD is safest and most robust
24178// way to register. Lowercase jquery is used because AMD module names are
24179// derived from file names, and jQuery is normally delivered in a lowercase
24180// file name. Do this after creating the global so that if an AMD module wants
24181// to call noConflict to hide this version of jQuery, it will work.
24182
24183// Note that for maximum portability, libraries that are not jQuery should
24184// declare themselves as anonymous modules, and avoid setting a global if an
24185// AMD loader is present. jQuery is a special case. For more information, see
24186// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
24187
24188if ( typeof define === "function" && define.amd ) {
24189 define( "jquery", [], function() {
24190 return jQuery;
24191 } );
24192}
24193
24194
24195
24196
24197var
24198
24199 // Map over jQuery in case of overwrite
24200 _jQuery = window.jQuery,
24201
24202 // Map over the $ in case of overwrite
24203 _$ = window.$;
24204
24205jQuery.noConflict = function( deep ) {
24206 if ( window.$ === jQuery ) {
24207 window.$ = _$;
24208 }
24209
24210 if ( deep && window.jQuery === jQuery ) {
24211 window.jQuery = _jQuery;
24212 }
24213
24214 return jQuery;
24215};
24216
24217// Expose jQuery and $ identifiers, even in AMD
24218// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
24219// and CommonJS for browser emulators (#13566)
24220if ( !noGlobal ) {
24221 window.jQuery = window.$ = jQuery;
24222}
24223
24224
24225
24226
24227return jQuery;
24228} );
24229</script>
24230 <script>/*!
24231 * Bootstrap v3.3.7 (http://getbootstrap.com)
24232 * Copyright 2011-2016 Twitter, Inc.
24233 * Licensed under the MIT license
24234 */
24235
24236if (typeof jQuery === 'undefined') {
24237 throw new Error('Bootstrap\'s JavaScript requires jQuery')
24238}
24239
24240+function ($) {
24241 'use strict';
24242 var version = $.fn.jquery.split(' ')[0].split('.')
24243 if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {
24244 throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')
24245 }
24246}(jQuery);
24247
24248/* ========================================================================
24249 * Bootstrap: transition.js v3.3.7
24250 * http://getbootstrap.com/javascript/#transitions
24251 * ========================================================================
24252 * Copyright 2011-2016 Twitter, Inc.
24253 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
24254 * ======================================================================== */
24255
24256
24257+function ($) {
24258 'use strict';
24259
24260 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
24261 // ============================================================
24262
24263 function transitionEnd() {
24264 var el = document.createElement('bootstrap')
24265
24266 var transEndEventNames = {
24267 WebkitTransition : 'webkitTransitionEnd',
24268 MozTransition : 'transitionend',
24269 OTransition : 'oTransitionEnd otransitionend',
24270 transition : 'transitionend'
24271 }
24272
24273 for (var name in transEndEventNames) {
24274 if (el.style[name] !== undefined) {
24275 return { end: transEndEventNames[name] }
24276 }
24277 }
24278
24279 return false // explicit for ie8 ( ._.)
24280 }
24281
24282 // http://blog.alexmaccaw.com/css-transitions
24283 $.fn.emulateTransitionEnd = function (duration) {
24284 var called = false
24285 var $el = this
24286 $(this).one('bsTransitionEnd', function () { called = true })
24287 var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
24288 setTimeout(callback, duration)
24289 return this
24290 }
24291
24292 $(function () {
24293 $.support.transition = transitionEnd()
24294
24295 if (!$.support.transition) return
24296
24297 $.event.special.bsTransitionEnd = {
24298 bindType: $.support.transition.end,
24299 delegateType: $.support.transition.end,
24300 handle: function (e) {
24301 if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
24302 }
24303 }
24304 })
24305
24306}(jQuery);
24307
24308/* ========================================================================
24309 * Bootstrap: alert.js v3.3.7
24310 * http://getbootstrap.com/javascript/#alerts
24311 * ========================================================================
24312 * Copyright 2011-2016 Twitter, Inc.
24313 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
24314 * ======================================================================== */
24315
24316
24317+function ($) {
24318 'use strict';
24319
24320 // ALERT CLASS DEFINITION
24321 // ======================
24322
24323 var dismiss = '[data-dismiss="alert"]'
24324 var Alert = function (el) {
24325 $(el).on('click', dismiss, this.close)
24326 }
24327
24328 Alert.VERSION = '3.3.7'
24329
24330 Alert.TRANSITION_DURATION = 150
24331
24332 Alert.prototype.close = function (e) {
24333 var $this = $(this)
24334 var selector = $this.attr('data-target')
24335
24336 if (!selector) {
24337 selector = $this.attr('href')
24338 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
24339 }
24340
24341 var $parent = $(selector === '#' ? [] : selector)
24342
24343 if (e) e.preventDefault()
24344
24345 if (!$parent.length) {
24346 $parent = $this.closest('.alert')
24347 }
24348
24349 $parent.trigger(e = $.Event('close.bs.alert'))
24350
24351 if (e.isDefaultPrevented()) return
24352
24353 $parent.removeClass('in')
24354
24355 function removeElement() {
24356 // detach from parent, fire event then clean up data
24357 $parent.detach().trigger('closed.bs.alert').remove()
24358 }
24359
24360 $.support.transition && $parent.hasClass('fade') ?
24361 $parent
24362 .one('bsTransitionEnd', removeElement)
24363 .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
24364 removeElement()
24365 }
24366
24367
24368 // ALERT PLUGIN DEFINITION
24369 // =======================
24370
24371 function Plugin(option) {
24372 return this.each(function () {
24373 var $this = $(this)
24374 var data = $this.data('bs.alert')
24375
24376 if (!data) $this.data('bs.alert', (data = new Alert(this)))
24377 if (typeof option == 'string') data[option].call($this)
24378 })
24379 }
24380
24381 var old = $.fn.alert
24382
24383 $.fn.alert = Plugin
24384 $.fn.alert.Constructor = Alert
24385
24386
24387 // ALERT NO CONFLICT
24388 // =================
24389
24390 $.fn.alert.noConflict = function () {
24391 $.fn.alert = old
24392 return this
24393 }
24394
24395
24396 // ALERT DATA-API
24397 // ==============
24398
24399 $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
24400
24401}(jQuery);
24402
24403/* ========================================================================
24404 * Bootstrap: button.js v3.3.7
24405 * http://getbootstrap.com/javascript/#buttons
24406 * ========================================================================
24407 * Copyright 2011-2016 Twitter, Inc.
24408 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
24409 * ======================================================================== */
24410
24411
24412+function ($) {
24413 'use strict';
24414
24415 // BUTTON PUBLIC CLASS DEFINITION
24416 // ==============================
24417
24418 var Button = function (element, options) {
24419 this.$element = $(element)
24420 this.options = $.extend({}, Button.DEFAULTS, options)
24421 this.isLoading = false
24422 }
24423
24424 Button.VERSION = '3.3.7'
24425
24426 Button.DEFAULTS = {
24427 loadingText: 'loading...'
24428 }
24429
24430 Button.prototype.setState = function (state) {
24431 var d = 'disabled'
24432 var $el = this.$element
24433 var val = $el.is('input') ? 'val' : 'html'
24434 var data = $el.data()
24435
24436 state += 'Text'
24437
24438 if (data.resetText == null) $el.data('resetText', $el[val]())
24439
24440 // push to event loop to allow forms to submit
24441 setTimeout($.proxy(function () {
24442 $el[val](data[state] == null ? this.options[state] : data[state])
24443
24444 if (state == 'loadingText') {
24445 this.isLoading = true
24446 $el.addClass(d).attr(d, d).prop(d, true)
24447 } else if (this.isLoading) {
24448 this.isLoading = false
24449 $el.removeClass(d).removeAttr(d).prop(d, false)
24450 }
24451 }, this), 0)
24452 }
24453
24454 Button.prototype.toggle = function () {
24455 var changed = true
24456 var $parent = this.$element.closest('[data-toggle="buttons"]')
24457
24458 if ($parent.length) {
24459 var $input = this.$element.find('input')
24460 if ($input.prop('type') == 'radio') {
24461 if ($input.prop('checked')) changed = false
24462 $parent.find('.active').removeClass('active')
24463 this.$element.addClass('active')
24464 } else if ($input.prop('type') == 'checkbox') {
24465 if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
24466 this.$element.toggleClass('active')
24467 }
24468 $input.prop('checked', this.$element.hasClass('active'))
24469 if (changed) $input.trigger('change')
24470 } else {
24471 this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
24472 this.$element.toggleClass('active')
24473 }
24474 }
24475
24476
24477 // BUTTON PLUGIN DEFINITION
24478 // ========================
24479
24480 function Plugin(option) {
24481 return this.each(function () {
24482 var $this = $(this)
24483 var data = $this.data('bs.button')
24484 var options = typeof option == 'object' && option
24485
24486 if (!data) $this.data('bs.button', (data = new Button(this, options)))
24487
24488 if (option == 'toggle') data.toggle()
24489 else if (option) data.setState(option)
24490 })
24491 }
24492
24493 var old = $.fn.button
24494
24495 $.fn.button = Plugin
24496 $.fn.button.Constructor = Button
24497
24498
24499 // BUTTON NO CONFLICT
24500 // ==================
24501
24502 $.fn.button.noConflict = function () {
24503 $.fn.button = old
24504 return this
24505 }
24506
24507
24508 // BUTTON DATA-API
24509 // ===============
24510
24511 $(document)
24512 .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
24513 var $btn = $(e.target).closest('.btn')
24514 Plugin.call($btn, 'toggle')
24515 if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) {
24516 // Prevent double click on radios, and the double selections (so cancellation) on checkboxes
24517 e.preventDefault()
24518 // The target component still receive the focus
24519 if ($btn.is('input,button')) $btn.trigger('focus')
24520 else $btn.find('input:visible,button:visible').first().trigger('focus')
24521 }
24522 })
24523 .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
24524 $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
24525 })
24526
24527}(jQuery);
24528
24529/* ========================================================================
24530 * Bootstrap: carousel.js v3.3.7
24531 * http://getbootstrap.com/javascript/#carousel
24532 * ========================================================================
24533 * Copyright 2011-2016 Twitter, Inc.
24534 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
24535 * ======================================================================== */
24536
24537
24538+function ($) {
24539 'use strict';
24540
24541 // CAROUSEL CLASS DEFINITION
24542 // =========================
24543
24544 var Carousel = function (element, options) {
24545 this.$element = $(element)
24546 this.$indicators = this.$element.find('.carousel-indicators')
24547 this.options = options
24548 this.paused = null
24549 this.sliding = null
24550 this.interval = null
24551 this.$active = null
24552 this.$items = null
24553
24554 this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
24555
24556 this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
24557 .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
24558 .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
24559 }
24560
24561 Carousel.VERSION = '3.3.7'
24562
24563 Carousel.TRANSITION_DURATION = 600
24564
24565 Carousel.DEFAULTS = {
24566 interval: 5000,
24567 pause: 'hover',
24568 wrap: true,
24569 keyboard: true
24570 }
24571
24572 Carousel.prototype.keydown = function (e) {
24573 if (/input|textarea/i.test(e.target.tagName)) return
24574 switch (e.which) {
24575 case 37: this.prev(); break
24576 case 39: this.next(); break
24577 default: return
24578 }
24579
24580 e.preventDefault()
24581 }
24582
24583 Carousel.prototype.cycle = function (e) {
24584 e || (this.paused = false)
24585
24586 this.interval && clearInterval(this.interval)
24587
24588 this.options.interval
24589 && !this.paused
24590 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
24591
24592 return this
24593 }
24594
24595 Carousel.prototype.getItemIndex = function (item) {
24596 this.$items = item.parent().children('.item')
24597 return this.$items.index(item || this.$active)
24598 }
24599
24600 Carousel.prototype.getItemForDirection = function (direction, active) {
24601 var activeIndex = this.getItemIndex(active)
24602 var willWrap = (direction == 'prev' && activeIndex === 0)
24603 || (direction == 'next' && activeIndex == (this.$items.length - 1))
24604 if (willWrap && !this.options.wrap) return active
24605 var delta = direction == 'prev' ? -1 : 1
24606 var itemIndex = (activeIndex + delta) % this.$items.length
24607 return this.$items.eq(itemIndex)
24608 }
24609
24610 Carousel.prototype.to = function (pos) {
24611 var that = this
24612 var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
24613
24614 if (pos > (this.$items.length - 1) || pos < 0) return
24615
24616 if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
24617 if (activeIndex == pos) return this.pause().cycle()
24618
24619 return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
24620 }
24621
24622 Carousel.prototype.pause = function (e) {
24623 e || (this.paused = true)
24624
24625 if (this.$element.find('.next, .prev').length && $.support.transition) {
24626 this.$element.trigger($.support.transition.end)
24627 this.cycle(true)
24628 }
24629
24630 this.interval = clearInterval(this.interval)
24631
24632 return this
24633 }
24634
24635 Carousel.prototype.next = function () {
24636 if (this.sliding) return
24637 return this.slide('next')
24638 }
24639
24640 Carousel.prototype.prev = function () {
24641 if (this.sliding) return
24642 return this.slide('prev')
24643 }
24644
24645 Carousel.prototype.slide = function (type, next) {
24646 var $active = this.$element.find('.item.active')
24647 var $next = next || this.getItemForDirection(type, $active)
24648 var isCycling = this.interval
24649 var direction = type == 'next' ? 'left' : 'right'
24650 var that = this
24651
24652 if ($next.hasClass('active')) return (this.sliding = false)
24653
24654 var relatedTarget = $next[0]
24655 var slideEvent = $.Event('slide.bs.carousel', {
24656 relatedTarget: relatedTarget,
24657 direction: direction
24658 })
24659 this.$element.trigger(slideEvent)
24660 if (slideEvent.isDefaultPrevented()) return
24661
24662 this.sliding = true
24663
24664 isCycling && this.pause()
24665
24666 if (this.$indicators.length) {
24667 this.$indicators.find('.active').removeClass('active')
24668 var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
24669 $nextIndicator && $nextIndicator.addClass('active')
24670 }
24671
24672 var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
24673 if ($.support.transition && this.$element.hasClass('slide')) {
24674 $next.addClass(type)
24675 $next[0].offsetWidth // force reflow
24676 $active.addClass(direction)
24677 $next.addClass(direction)
24678 $active
24679 .one('bsTransitionEnd', function () {
24680 $next.removeClass([type, direction].join(' ')).addClass('active')
24681 $active.removeClass(['active', direction].join(' '))
24682 that.sliding = false
24683 setTimeout(function () {
24684 that.$element.trigger(slidEvent)
24685 }, 0)
24686 })
24687 .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
24688 } else {
24689 $active.removeClass('active')
24690 $next.addClass('active')
24691 this.sliding = false
24692 this.$element.trigger(slidEvent)
24693 }
24694
24695 isCycling && this.cycle()
24696
24697 return this
24698 }
24699
24700
24701 // CAROUSEL PLUGIN DEFINITION
24702 // ==========================
24703
24704 function Plugin(option) {
24705 return this.each(function () {
24706 var $this = $(this)
24707 var data = $this.data('bs.carousel')
24708 var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
24709 var action = typeof option == 'string' ? option : options.slide
24710
24711 if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
24712 if (typeof option == 'number') data.to(option)
24713 else if (action) data[action]()
24714 else if (options.interval) data.pause().cycle()
24715 })
24716 }
24717
24718 var old = $.fn.carousel
24719
24720 $.fn.carousel = Plugin
24721 $.fn.carousel.Constructor = Carousel
24722
24723
24724 // CAROUSEL NO CONFLICT
24725 // ====================
24726
24727 $.fn.carousel.noConflict = function () {
24728 $.fn.carousel = old
24729 return this
24730 }
24731
24732
24733 // CAROUSEL DATA-API
24734 // =================
24735
24736 var clickHandler = function (e) {
24737 var href
24738 var $this = $(this)
24739 var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
24740 if (!$target.hasClass('carousel')) return
24741 var options = $.extend({}, $target.data(), $this.data())
24742 var slideIndex = $this.attr('data-slide-to')
24743 if (slideIndex) options.interval = false
24744
24745 Plugin.call($target, options)
24746
24747 if (slideIndex) {
24748 $target.data('bs.carousel').to(slideIndex)
24749 }
24750
24751 e.preventDefault()
24752 }
24753
24754 $(document)
24755 .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
24756 .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
24757
24758 $(window).on('load', function () {
24759 $('[data-ride="carousel"]').each(function () {
24760 var $carousel = $(this)
24761 Plugin.call($carousel, $carousel.data())
24762 })
24763 })
24764
24765}(jQuery);
24766
24767/* ========================================================================
24768 * Bootstrap: collapse.js v3.3.7
24769 * http://getbootstrap.com/javascript/#collapse
24770 * ========================================================================
24771 * Copyright 2011-2016 Twitter, Inc.
24772 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
24773 * ======================================================================== */
24774
24775/* jshint latedef: false */
24776
24777+function ($) {
24778 'use strict';
24779
24780 // COLLAPSE PUBLIC CLASS DEFINITION
24781 // ================================
24782
24783 var Collapse = function (element, options) {
24784 this.$element = $(element)
24785 this.options = $.extend({}, Collapse.DEFAULTS, options)
24786 this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
24787 '[data-toggle="collapse"][data-target="#' + element.id + '"]')
24788 this.transitioning = null
24789
24790 if (this.options.parent) {
24791 this.$parent = this.getParent()
24792 } else {
24793 this.addAriaAndCollapsedClass(this.$element, this.$trigger)
24794 }
24795
24796 if (this.options.toggle) this.toggle()
24797 }
24798
24799 Collapse.VERSION = '3.3.7'
24800
24801 Collapse.TRANSITION_DURATION = 350
24802
24803 Collapse.DEFAULTS = {
24804 toggle: true
24805 }
24806
24807 Collapse.prototype.dimension = function () {
24808 var hasWidth = this.$element.hasClass('width')
24809 return hasWidth ? 'width' : 'height'
24810 }
24811
24812 Collapse.prototype.show = function () {
24813 if (this.transitioning || this.$element.hasClass('in')) return
24814
24815 var activesData
24816 var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
24817
24818 if (actives && actives.length) {
24819 activesData = actives.data('bs.collapse')
24820 if (activesData && activesData.transitioning) return
24821 }
24822
24823 var startEvent = $.Event('show.bs.collapse')
24824 this.$element.trigger(startEvent)
24825 if (startEvent.isDefaultPrevented()) return
24826
24827 if (actives && actives.length) {
24828 Plugin.call(actives, 'hide')
24829 activesData || actives.data('bs.collapse', null)
24830 }
24831
24832 var dimension = this.dimension()
24833
24834 this.$element
24835 .removeClass('collapse')
24836 .addClass('collapsing')[dimension](0)
24837 .attr('aria-expanded', true)
24838
24839 this.$trigger
24840 .removeClass('collapsed')
24841 .attr('aria-expanded', true)
24842
24843 this.transitioning = 1
24844
24845 var complete = function () {
24846 this.$element
24847 .removeClass('collapsing')
24848 .addClass('collapse in')[dimension]('')
24849 this.transitioning = 0
24850 this.$element
24851 .trigger('shown.bs.collapse')
24852 }
24853
24854 if (!$.support.transition) return complete.call(this)
24855
24856 var scrollSize = $.camelCase(['scroll', dimension].join('-'))
24857
24858 this.$element
24859 .one('bsTransitionEnd', $.proxy(complete, this))
24860 .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
24861 }
24862
24863 Collapse.prototype.hide = function () {
24864 if (this.transitioning || !this.$element.hasClass('in')) return
24865
24866 var startEvent = $.Event('hide.bs.collapse')
24867 this.$element.trigger(startEvent)
24868 if (startEvent.isDefaultPrevented()) return
24869
24870 var dimension = this.dimension()
24871
24872 this.$element[dimension](this.$element[dimension]())[0].offsetHeight
24873
24874 this.$element
24875 .addClass('collapsing')
24876 .removeClass('collapse in')
24877 .attr('aria-expanded', false)
24878
24879 this.$trigger
24880 .addClass('collapsed')
24881 .attr('aria-expanded', false)
24882
24883 this.transitioning = 1
24884
24885 var complete = function () {
24886 this.transitioning = 0
24887 this.$element
24888 .removeClass('collapsing')
24889 .addClass('collapse')
24890 .trigger('hidden.bs.collapse')
24891 }
24892
24893 if (!$.support.transition) return complete.call(this)
24894
24895 this.$element
24896 [dimension](0)
24897 .one('bsTransitionEnd', $.proxy(complete, this))
24898 .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
24899 }
24900
24901 Collapse.prototype.toggle = function () {
24902 this[this.$element.hasClass('in') ? 'hide' : 'show']()
24903 }
24904
24905 Collapse.prototype.getParent = function () {
24906 return $(this.options.parent)
24907 .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
24908 .each($.proxy(function (i, element) {
24909 var $element = $(element)
24910 this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
24911 }, this))
24912 .end()
24913 }
24914
24915 Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
24916 var isOpen = $element.hasClass('in')
24917
24918 $element.attr('aria-expanded', isOpen)
24919 $trigger
24920 .toggleClass('collapsed', !isOpen)
24921 .attr('aria-expanded', isOpen)
24922 }
24923
24924 function getTargetFromTrigger($trigger) {
24925 var href
24926 var target = $trigger.attr('data-target')
24927 || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
24928
24929 return $(target)
24930 }
24931
24932
24933 // COLLAPSE PLUGIN DEFINITION
24934 // ==========================
24935
24936 function Plugin(option) {
24937 return this.each(function () {
24938 var $this = $(this)
24939 var data = $this.data('bs.collapse')
24940 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
24941
24942 if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
24943 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
24944 if (typeof option == 'string') data[option]()
24945 })
24946 }
24947
24948 var old = $.fn.collapse
24949
24950 $.fn.collapse = Plugin
24951 $.fn.collapse.Constructor = Collapse
24952
24953
24954 // COLLAPSE NO CONFLICT
24955 // ====================
24956
24957 $.fn.collapse.noConflict = function () {
24958 $.fn.collapse = old
24959 return this
24960 }
24961
24962
24963 // COLLAPSE DATA-API
24964 // =================
24965
24966 $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
24967 var $this = $(this)
24968
24969 if (!$this.attr('data-target')) e.preventDefault()
24970
24971 var $target = getTargetFromTrigger($this)
24972 var data = $target.data('bs.collapse')
24973 var option = data ? 'toggle' : $this.data()
24974
24975 Plugin.call($target, option)
24976 })
24977
24978}(jQuery);
24979
24980/* ========================================================================
24981 * Bootstrap: dropdown.js v3.3.7
24982 * http://getbootstrap.com/javascript/#dropdowns
24983 * ========================================================================
24984 * Copyright 2011-2016 Twitter, Inc.
24985 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
24986 * ======================================================================== */
24987
24988
24989+function ($) {
24990 'use strict';
24991
24992 // DROPDOWN CLASS DEFINITION
24993 // =========================
24994
24995 var backdrop = '.dropdown-backdrop'
24996 var toggle = '[data-toggle="dropdown"]'
24997 var Dropdown = function (element) {
24998 $(element).on('click.bs.dropdown', this.toggle)
24999 }
25000
25001 Dropdown.VERSION = '3.3.7'
25002
25003 function getParent($this) {
25004 var selector = $this.attr('data-target')
25005
25006 if (!selector) {
25007 selector = $this.attr('href')
25008 selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
25009 }
25010
25011 var $parent = selector && $(selector)
25012
25013 return $parent && $parent.length ? $parent : $this.parent()
25014 }
25015
25016 function clearMenus(e) {
25017 if (e && e.which === 3) return
25018 $(backdrop).remove()
25019 $(toggle).each(function () {
25020 var $this = $(this)
25021 var $parent = getParent($this)
25022 var relatedTarget = { relatedTarget: this }
25023
25024 if (!$parent.hasClass('open')) return
25025
25026 if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
25027
25028 $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
25029
25030 if (e.isDefaultPrevented()) return
25031
25032 $this.attr('aria-expanded', 'false')
25033 $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
25034 })
25035 }
25036
25037 Dropdown.prototype.toggle = function (e) {
25038 var $this = $(this)
25039
25040 if ($this.is('.disabled, :disabled')) return
25041
25042 var $parent = getParent($this)
25043 var isActive = $parent.hasClass('open')
25044
25045 clearMenus()
25046
25047 if (!isActive) {
25048 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
25049 // if mobile we use a backdrop because click events don't delegate
25050 $(document.createElement('div'))
25051 .addClass('dropdown-backdrop')
25052 .insertAfter($(this))
25053 .on('click', clearMenus)
25054 }
25055
25056 var relatedTarget = { relatedTarget: this }
25057 $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
25058
25059 if (e.isDefaultPrevented()) return
25060
25061 $this
25062 .trigger('focus')
25063 .attr('aria-expanded', 'true')
25064
25065 $parent
25066 .toggleClass('open')
25067 .trigger($.Event('shown.bs.dropdown', relatedTarget))
25068 }
25069
25070 return false
25071 }
25072
25073 Dropdown.prototype.keydown = function (e) {
25074 if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
25075
25076 var $this = $(this)
25077
25078 e.preventDefault()
25079 e.stopPropagation()
25080
25081 if ($this.is('.disabled, :disabled')) return
25082
25083 var $parent = getParent($this)
25084 var isActive = $parent.hasClass('open')
25085
25086 if (!isActive && e.which != 27 || isActive && e.which == 27) {
25087 if (e.which == 27) $parent.find(toggle).trigger('focus')
25088 return $this.trigger('click')
25089 }
25090
25091 var desc = ' li:not(.disabled):visible a'
25092 var $items = $parent.find('.dropdown-menu' + desc)
25093
25094 if (!$items.length) return
25095
25096 var index = $items.index(e.target)
25097
25098 if (e.which == 38 && index > 0) index-- // up
25099 if (e.which == 40 && index < $items.length - 1) index++ // down
25100 if (!~index) index = 0
25101
25102 $items.eq(index).trigger('focus')
25103 }
25104
25105
25106 // DROPDOWN PLUGIN DEFINITION
25107 // ==========================
25108
25109 function Plugin(option) {
25110 return this.each(function () {
25111 var $this = $(this)
25112 var data = $this.data('bs.dropdown')
25113
25114 if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
25115 if (typeof option == 'string') data[option].call($this)
25116 })
25117 }
25118
25119 var old = $.fn.dropdown
25120
25121 $.fn.dropdown = Plugin
25122 $.fn.dropdown.Constructor = Dropdown
25123
25124
25125 // DROPDOWN NO CONFLICT
25126 // ====================
25127
25128 $.fn.dropdown.noConflict = function () {
25129 $.fn.dropdown = old
25130 return this
25131 }
25132
25133
25134 // APPLY TO STANDARD DROPDOWN ELEMENTS
25135 // ===================================
25136
25137 $(document)
25138 .on('click.bs.dropdown.data-api', clearMenus)
25139 .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
25140 .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
25141 .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
25142 .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
25143
25144}(jQuery);
25145
25146/* ========================================================================
25147 * Bootstrap: modal.js v3.3.7
25148 * http://getbootstrap.com/javascript/#modals
25149 * ========================================================================
25150 * Copyright 2011-2016 Twitter, Inc.
25151 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
25152 * ======================================================================== */
25153
25154
25155+function ($) {
25156 'use strict';
25157
25158 // MODAL CLASS DEFINITION
25159 // ======================
25160
25161 var Modal = function (element, options) {
25162 this.options = options
25163 this.$body = $(document.body)
25164 this.$element = $(element)
25165 this.$dialog = this.$element.find('.modal-dialog')
25166 this.$backdrop = null
25167 this.isShown = null
25168 this.originalBodyPad = null
25169 this.scrollbarWidth = 0
25170 this.ignoreBackdropClick = false
25171
25172 if (this.options.remote) {
25173 this.$element
25174 .find('.modal-content')
25175 .load(this.options.remote, $.proxy(function () {
25176 this.$element.trigger('loaded.bs.modal')
25177 }, this))
25178 }
25179 }
25180
25181 Modal.VERSION = '3.3.7'
25182
25183 Modal.TRANSITION_DURATION = 300
25184 Modal.BACKDROP_TRANSITION_DURATION = 150
25185
25186 Modal.DEFAULTS = {
25187 backdrop: true,
25188 keyboard: true,
25189 show: true
25190 }
25191
25192 Modal.prototype.toggle = function (_relatedTarget) {
25193 return this.isShown ? this.hide() : this.show(_relatedTarget)
25194 }
25195
25196 Modal.prototype.show = function (_relatedTarget) {
25197 var that = this
25198 var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
25199
25200 this.$element.trigger(e)
25201
25202 if (this.isShown || e.isDefaultPrevented()) return
25203
25204 this.isShown = true
25205
25206 this.checkScrollbar()
25207 this.setScrollbar()
25208 this.$body.addClass('modal-open')
25209
25210 this.escape()
25211 this.resize()
25212
25213 this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
25214
25215 this.$dialog.on('mousedown.dismiss.bs.modal', function () {
25216 that.$element.one('mouseup.dismiss.bs.modal', function (e) {
25217 if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
25218 })
25219 })
25220
25221 this.backdrop(function () {
25222 var transition = $.support.transition && that.$element.hasClass('fade')
25223
25224 if (!that.$element.parent().length) {
25225 that.$element.appendTo(that.$body) // don't move modals dom position
25226 }
25227
25228 that.$element
25229 .show()
25230 .scrollTop(0)
25231
25232 that.adjustDialog()
25233
25234 if (transition) {
25235 that.$element[0].offsetWidth // force reflow
25236 }
25237
25238 that.$element.addClass('in')
25239
25240 that.enforceFocus()
25241
25242 var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
25243
25244 transition ?
25245 that.$dialog // wait for modal to slide in
25246 .one('bsTransitionEnd', function () {
25247 that.$element.trigger('focus').trigger(e)
25248 })
25249 .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
25250 that.$element.trigger('focus').trigger(e)
25251 })
25252 }
25253
25254 Modal.prototype.hide = function (e) {
25255 if (e) e.preventDefault()
25256
25257 e = $.Event('hide.bs.modal')
25258
25259 this.$element.trigger(e)
25260
25261 if (!this.isShown || e.isDefaultPrevented()) return
25262
25263 this.isShown = false
25264
25265 this.escape()
25266 this.resize()
25267
25268 $(document).off('focusin.bs.modal')
25269
25270 this.$element
25271 .removeClass('in')
25272 .off('click.dismiss.bs.modal')
25273 .off('mouseup.dismiss.bs.modal')
25274
25275 this.$dialog.off('mousedown.dismiss.bs.modal')
25276
25277 $.support.transition && this.$element.hasClass('fade') ?
25278 this.$element
25279 .one('bsTransitionEnd', $.proxy(this.hideModal, this))
25280 .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
25281 this.hideModal()
25282 }
25283
25284 Modal.prototype.enforceFocus = function () {
25285 $(document)
25286 .off('focusin.bs.modal') // guard against infinite focus loop
25287 .on('focusin.bs.modal', $.proxy(function (e) {
25288 if (document !== e.target &&
25289 this.$element[0] !== e.target &&
25290 !this.$element.has(e.target).length) {
25291 this.$element.trigger('focus')
25292 }
25293 }, this))
25294 }
25295
25296 Modal.prototype.escape = function () {
25297 if (this.isShown && this.options.keyboard) {
25298 this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
25299 e.which == 27 && this.hide()
25300 }, this))
25301 } else if (!this.isShown) {
25302 this.$element.off('keydown.dismiss.bs.modal')
25303 }
25304 }
25305
25306 Modal.prototype.resize = function () {
25307 if (this.isShown) {
25308 $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
25309 } else {
25310 $(window).off('resize.bs.modal')
25311 }
25312 }
25313
25314 Modal.prototype.hideModal = function () {
25315 var that = this
25316 this.$element.hide()
25317 this.backdrop(function () {
25318 that.$body.removeClass('modal-open')
25319 that.resetAdjustments()
25320 that.resetScrollbar()
25321 that.$element.trigger('hidden.bs.modal')
25322 })
25323 }
25324
25325 Modal.prototype.removeBackdrop = function () {
25326 this.$backdrop && this.$backdrop.remove()
25327 this.$backdrop = null
25328 }
25329
25330 Modal.prototype.backdrop = function (callback) {
25331 var that = this
25332 var animate = this.$element.hasClass('fade') ? 'fade' : ''
25333
25334 if (this.isShown && this.options.backdrop) {
25335 var doAnimate = $.support.transition && animate
25336
25337 this.$backdrop = $(document.createElement('div'))
25338 .addClass('modal-backdrop ' + animate)
25339 .appendTo(this.$body)
25340
25341 this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
25342 if (this.ignoreBackdropClick) {
25343 this.ignoreBackdropClick = false
25344 return
25345 }
25346 if (e.target !== e.currentTarget) return
25347 this.options.backdrop == 'static'
25348 ? this.$element[0].focus()
25349 : this.hide()
25350 }, this))
25351
25352 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
25353
25354 this.$backdrop.addClass('in')
25355
25356 if (!callback) return
25357
25358 doAnimate ?
25359 this.$backdrop
25360 .one('bsTransitionEnd', callback)
25361 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
25362 callback()
25363
25364 } else if (!this.isShown && this.$backdrop) {
25365 this.$backdrop.removeClass('in')
25366
25367 var callbackRemove = function () {
25368 that.removeBackdrop()
25369 callback && callback()
25370 }
25371 $.support.transition && this.$element.hasClass('fade') ?
25372 this.$backdrop
25373 .one('bsTransitionEnd', callbackRemove)
25374 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
25375 callbackRemove()
25376
25377 } else if (callback) {
25378 callback()
25379 }
25380 }
25381
25382 // these following methods are used to handle overflowing modals
25383
25384 Modal.prototype.handleUpdate = function () {
25385 this.adjustDialog()
25386 }
25387
25388 Modal.prototype.adjustDialog = function () {
25389 var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
25390
25391 this.$element.css({
25392 paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
25393 paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
25394 })
25395 }
25396
25397 Modal.prototype.resetAdjustments = function () {
25398 this.$element.css({
25399 paddingLeft: '',
25400 paddingRight: ''
25401 })
25402 }
25403
25404 Modal.prototype.checkScrollbar = function () {
25405 var fullWindowWidth = window.innerWidth
25406 if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
25407 var documentElementRect = document.documentElement.getBoundingClientRect()
25408 fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
25409 }
25410 this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
25411 this.scrollbarWidth = this.measureScrollbar()
25412 }
25413
25414 Modal.prototype.setScrollbar = function () {
25415 var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
25416 this.originalBodyPad = document.body.style.paddingRight || ''
25417 if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
25418 }
25419
25420 Modal.prototype.resetScrollbar = function () {
25421 this.$body.css('padding-right', this.originalBodyPad)
25422 }
25423
25424 Modal.prototype.measureScrollbar = function () { // thx walsh
25425 var scrollDiv = document.createElement('div')
25426 scrollDiv.className = 'modal-scrollbar-measure'
25427 this.$body.append(scrollDiv)
25428 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
25429 this.$body[0].removeChild(scrollDiv)
25430 return scrollbarWidth
25431 }
25432
25433
25434 // MODAL PLUGIN DEFINITION
25435 // =======================
25436
25437 function Plugin(option, _relatedTarget) {
25438 return this.each(function () {
25439 var $this = $(this)
25440 var data = $this.data('bs.modal')
25441 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
25442
25443 if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
25444 if (typeof option == 'string') data[option](_relatedTarget)
25445 else if (options.show) data.show(_relatedTarget)
25446 })
25447 }
25448
25449 var old = $.fn.modal
25450
25451 $.fn.modal = Plugin
25452 $.fn.modal.Constructor = Modal
25453
25454
25455 // MODAL NO CONFLICT
25456 // =================
25457
25458 $.fn.modal.noConflict = function () {
25459 $.fn.modal = old
25460 return this
25461 }
25462
25463
25464 // MODAL DATA-API
25465 // ==============
25466
25467 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
25468 var $this = $(this)
25469 var href = $this.attr('href')
25470 var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
25471 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
25472
25473 if ($this.is('a')) e.preventDefault()
25474
25475 $target.one('show.bs.modal', function (showEvent) {
25476 if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
25477 $target.one('hidden.bs.modal', function () {
25478 $this.is(':visible') && $this.trigger('focus')
25479 })
25480 })
25481 Plugin.call($target, option, this)
25482 })
25483
25484}(jQuery);
25485
25486/* ========================================================================
25487 * Bootstrap: tooltip.js v3.3.7
25488 * http://getbootstrap.com/javascript/#tooltip
25489 * Inspired by the original jQuery.tipsy by Jason Frame
25490 * ========================================================================
25491 * Copyright 2011-2016 Twitter, Inc.
25492 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
25493 * ======================================================================== */
25494
25495
25496+function ($) {
25497 'use strict';
25498
25499 // TOOLTIP PUBLIC CLASS DEFINITION
25500 // ===============================
25501
25502 var Tooltip = function (element, options) {
25503 this.type = null
25504 this.options = null
25505 this.enabled = null
25506 this.timeout = null
25507 this.hoverState = null
25508 this.$element = null
25509 this.inState = null
25510
25511 this.init('tooltip', element, options)
25512 }
25513
25514 Tooltip.VERSION = '3.3.7'
25515
25516 Tooltip.TRANSITION_DURATION = 150
25517
25518 Tooltip.DEFAULTS = {
25519 animation: true,
25520 placement: 'top',
25521 selector: false,
25522 template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
25523 trigger: 'hover focus',
25524 title: '',
25525 delay: 0,
25526 html: false,
25527 container: false,
25528 viewport: {
25529 selector: 'body',
25530 padding: 0
25531 }
25532 }
25533
25534 Tooltip.prototype.init = function (type, element, options) {
25535 this.enabled = true
25536 this.type = type
25537 this.$element = $(element)
25538 this.options = this.getOptions(options)
25539 this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
25540 this.inState = { click: false, hover: false, focus: false }
25541
25542 if (this.$element[0] instanceof document.constructor && !this.options.selector) {
25543 throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
25544 }
25545
25546 var triggers = this.options.trigger.split(' ')
25547
25548 for (var i = triggers.length; i--;) {
25549 var trigger = triggers[i]
25550
25551 if (trigger == 'click') {
25552 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
25553 } else if (trigger != 'manual') {
25554 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
25555 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
25556
25557 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
25558 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
25559 }
25560 }
25561
25562 this.options.selector ?
25563 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
25564 this.fixTitle()
25565 }
25566
25567 Tooltip.prototype.getDefaults = function () {
25568 return Tooltip.DEFAULTS
25569 }
25570
25571 Tooltip.prototype.getOptions = function (options) {
25572 options = $.extend({}, this.getDefaults(), this.$element.data(), options)
25573
25574 if (options.delay && typeof options.delay == 'number') {
25575 options.delay = {
25576 show: options.delay,
25577 hide: options.delay
25578 }
25579 }
25580
25581 return options
25582 }
25583
25584 Tooltip.prototype.getDelegateOptions = function () {
25585 var options = {}
25586 var defaults = this.getDefaults()
25587
25588 this._options && $.each(this._options, function (key, value) {
25589 if (defaults[key] != value) options[key] = value
25590 })
25591
25592 return options
25593 }
25594
25595 Tooltip.prototype.enter = function (obj) {
25596 var self = obj instanceof this.constructor ?
25597 obj : $(obj.currentTarget).data('bs.' + this.type)
25598
25599 if (!self) {
25600 self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
25601 $(obj.currentTarget).data('bs.' + this.type, self)
25602 }
25603
25604 if (obj instanceof $.Event) {
25605 self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
25606 }
25607
25608 if (self.tip().hasClass('in') || self.hoverState == 'in') {
25609 self.hoverState = 'in'
25610 return
25611 }
25612
25613 clearTimeout(self.timeout)
25614
25615 self.hoverState = 'in'
25616
25617 if (!self.options.delay || !self.options.delay.show) return self.show()
25618
25619 self.timeout = setTimeout(function () {
25620 if (self.hoverState == 'in') self.show()
25621 }, self.options.delay.show)
25622 }
25623
25624 Tooltip.prototype.isInStateTrue = function () {
25625 for (var key in this.inState) {
25626 if (this.inState[key]) return true
25627 }
25628
25629 return false
25630 }
25631
25632 Tooltip.prototype.leave = function (obj) {
25633 var self = obj instanceof this.constructor ?
25634 obj : $(obj.currentTarget).data('bs.' + this.type)
25635
25636 if (!self) {
25637 self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
25638 $(obj.currentTarget).data('bs.' + this.type, self)
25639 }
25640
25641 if (obj instanceof $.Event) {
25642 self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
25643 }
25644
25645 if (self.isInStateTrue()) return
25646
25647 clearTimeout(self.timeout)
25648
25649 self.hoverState = 'out'
25650
25651 if (!self.options.delay || !self.options.delay.hide) return self.hide()
25652
25653 self.timeout = setTimeout(function () {
25654 if (self.hoverState == 'out') self.hide()
25655 }, self.options.delay.hide)
25656 }
25657
25658 Tooltip.prototype.show = function () {
25659 var e = $.Event('show.bs.' + this.type)
25660
25661 if (this.hasContent() && this.enabled) {
25662 this.$element.trigger(e)
25663
25664 var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
25665 if (e.isDefaultPrevented() || !inDom) return
25666 var that = this
25667
25668 var $tip = this.tip()
25669
25670 var tipId = this.getUID(this.type)
25671
25672 this.setContent()
25673 $tip.attr('id', tipId)
25674 this.$element.attr('aria-describedby', tipId)
25675
25676 if (this.options.animation) $tip.addClass('fade')
25677
25678 var placement = typeof this.options.placement == 'function' ?
25679 this.options.placement.call(this, $tip[0], this.$element[0]) :
25680 this.options.placement
25681
25682 var autoToken = /\s?auto?\s?/i
25683 var autoPlace = autoToken.test(placement)
25684 if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
25685
25686 $tip
25687 .detach()
25688 .css({ top: 0, left: 0, display: 'block' })
25689 .addClass(placement)
25690 .data('bs.' + this.type, this)
25691
25692 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
25693 this.$element.trigger('inserted.bs.' + this.type)
25694
25695 var pos = this.getPosition()
25696 var actualWidth = $tip[0].offsetWidth
25697 var actualHeight = $tip[0].offsetHeight
25698
25699 if (autoPlace) {
25700 var orgPlacement = placement
25701 var viewportDim = this.getPosition(this.$viewport)
25702
25703 placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :
25704 placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :
25705 placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :
25706 placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :
25707 placement
25708
25709 $tip
25710 .removeClass(orgPlacement)
25711 .addClass(placement)
25712 }
25713
25714 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
25715
25716 this.applyPlacement(calculatedOffset, placement)
25717
25718 var complete = function () {
25719 var prevHoverState = that.hoverState
25720 that.$element.trigger('shown.bs.' + that.type)
25721 that.hoverState = null
25722
25723 if (prevHoverState == 'out') that.leave(that)
25724 }
25725
25726 $.support.transition && this.$tip.hasClass('fade') ?
25727 $tip
25728 .one('bsTransitionEnd', complete)
25729 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
25730 complete()
25731 }
25732 }
25733
25734 Tooltip.prototype.applyPlacement = function (offset, placement) {
25735 var $tip = this.tip()
25736 var width = $tip[0].offsetWidth
25737 var height = $tip[0].offsetHeight
25738
25739 // manually read margins because getBoundingClientRect includes difference
25740 var marginTop = parseInt($tip.css('margin-top'), 10)
25741 var marginLeft = parseInt($tip.css('margin-left'), 10)
25742
25743 // we must check for NaN for ie 8/9
25744 if (isNaN(marginTop)) marginTop = 0
25745 if (isNaN(marginLeft)) marginLeft = 0
25746
25747 offset.top += marginTop
25748 offset.left += marginLeft
25749
25750 // $.fn.offset doesn't round pixel values
25751 // so we use setOffset directly with our own function B-0
25752 $.offset.setOffset($tip[0], $.extend({
25753 using: function (props) {
25754 $tip.css({
25755 top: Math.round(props.top),
25756 left: Math.round(props.left)
25757 })
25758 }
25759 }, offset), 0)
25760
25761 $tip.addClass('in')
25762
25763 // check to see if placing tip in new offset caused the tip to resize itself
25764 var actualWidth = $tip[0].offsetWidth
25765 var actualHeight = $tip[0].offsetHeight
25766
25767 if (placement == 'top' && actualHeight != height) {
25768 offset.top = offset.top + height - actualHeight
25769 }
25770
25771 var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
25772
25773 if (delta.left) offset.left += delta.left
25774 else offset.top += delta.top
25775
25776 var isVertical = /top|bottom/.test(placement)
25777 var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
25778 var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
25779
25780 $tip.offset(offset)
25781 this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
25782 }
25783
25784 Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
25785 this.arrow()
25786 .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
25787 .css(isVertical ? 'top' : 'left', '')
25788 }
25789
25790 Tooltip.prototype.setContent = function () {
25791 var $tip = this.tip()
25792 var title = this.getTitle()
25793
25794 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
25795 $tip.removeClass('fade in top bottom left right')
25796 }
25797
25798 Tooltip.prototype.hide = function (callback) {
25799 var that = this
25800 var $tip = $(this.$tip)
25801 var e = $.Event('hide.bs.' + this.type)
25802
25803 function complete() {
25804 if (that.hoverState != 'in') $tip.detach()
25805 if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
25806 that.$element
25807 .removeAttr('aria-describedby')
25808 .trigger('hidden.bs.' + that.type)
25809 }
25810 callback && callback()
25811 }
25812
25813 this.$element.trigger(e)
25814
25815 if (e.isDefaultPrevented()) return
25816
25817 $tip.removeClass('in')
25818
25819 $.support.transition && $tip.hasClass('fade') ?
25820 $tip
25821 .one('bsTransitionEnd', complete)
25822 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
25823 complete()
25824
25825 this.hoverState = null
25826
25827 return this
25828 }
25829
25830 Tooltip.prototype.fixTitle = function () {
25831 var $e = this.$element
25832 if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
25833 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
25834 }
25835 }
25836
25837 Tooltip.prototype.hasContent = function () {
25838 return this.getTitle()
25839 }
25840
25841 Tooltip.prototype.getPosition = function ($element) {
25842 $element = $element || this.$element
25843
25844 var el = $element[0]
25845 var isBody = el.tagName == 'BODY'
25846
25847 var elRect = el.getBoundingClientRect()
25848 if (elRect.width == null) {
25849 // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
25850 elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
25851 }
25852 var isSvg = window.SVGElement && el instanceof window.SVGElement
25853 // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
25854 // See https://github.com/twbs/bootstrap/issues/20280
25855 var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
25856 var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
25857 var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
25858
25859 return $.extend({}, elRect, scroll, outerDims, elOffset)
25860 }
25861
25862 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
25863 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
25864 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
25865 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
25866 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
25867
25868 }
25869
25870 Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
25871 var delta = { top: 0, left: 0 }
25872 if (!this.$viewport) return delta
25873
25874 var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
25875 var viewportDimensions = this.getPosition(this.$viewport)
25876
25877 if (/right|left/.test(placement)) {
25878 var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
25879 var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
25880 if (topEdgeOffset < viewportDimensions.top) { // top overflow
25881 delta.top = viewportDimensions.top - topEdgeOffset
25882 } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
25883 delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
25884 }
25885 } else {
25886 var leftEdgeOffset = pos.left - viewportPadding
25887 var rightEdgeOffset = pos.left + viewportPadding + actualWidth
25888 if (leftEdgeOffset < viewportDimensions.left) { // left overflow
25889 delta.left = viewportDimensions.left - leftEdgeOffset
25890 } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
25891 delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
25892 }
25893 }
25894
25895 return delta
25896 }
25897
25898 Tooltip.prototype.getTitle = function () {
25899 var title
25900 var $e = this.$element
25901 var o = this.options
25902
25903 title = $e.attr('data-original-title')
25904 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
25905
25906 return title
25907 }
25908
25909 Tooltip.prototype.getUID = function (prefix) {
25910 do prefix += ~~(Math.random() * 1000000)
25911 while (document.getElementById(prefix))
25912 return prefix
25913 }
25914
25915 Tooltip.prototype.tip = function () {
25916 if (!this.$tip) {
25917 this.$tip = $(this.options.template)
25918 if (this.$tip.length != 1) {
25919 throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
25920 }
25921 }
25922 return this.$tip
25923 }
25924
25925 Tooltip.prototype.arrow = function () {
25926 return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
25927 }
25928
25929 Tooltip.prototype.enable = function () {
25930 this.enabled = true
25931 }
25932
25933 Tooltip.prototype.disable = function () {
25934 this.enabled = false
25935 }
25936
25937 Tooltip.prototype.toggleEnabled = function () {
25938 this.enabled = !this.enabled
25939 }
25940
25941 Tooltip.prototype.toggle = function (e) {
25942 var self = this
25943 if (e) {
25944 self = $(e.currentTarget).data('bs.' + this.type)
25945 if (!self) {
25946 self = new this.constructor(e.currentTarget, this.getDelegateOptions())
25947 $(e.currentTarget).data('bs.' + this.type, self)
25948 }
25949 }
25950
25951 if (e) {
25952 self.inState.click = !self.inState.click
25953 if (self.isInStateTrue()) self.enter(self)
25954 else self.leave(self)
25955 } else {
25956 self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
25957 }
25958 }
25959
25960 Tooltip.prototype.destroy = function () {
25961 var that = this
25962 clearTimeout(this.timeout)
25963 this.hide(function () {
25964 that.$element.off('.' + that.type).removeData('bs.' + that.type)
25965 if (that.$tip) {
25966 that.$tip.detach()
25967 }
25968 that.$tip = null
25969 that.$arrow = null
25970 that.$viewport = null
25971 that.$element = null
25972 })
25973 }
25974
25975
25976 // TOOLTIP PLUGIN DEFINITION
25977 // =========================
25978
25979 function Plugin(option) {
25980 return this.each(function () {
25981 var $this = $(this)
25982 var data = $this.data('bs.tooltip')
25983 var options = typeof option == 'object' && option
25984
25985 if (!data && /destroy|hide/.test(option)) return
25986 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
25987 if (typeof option == 'string') data[option]()
25988 })
25989 }
25990
25991 var old = $.fn.tooltip
25992
25993 $.fn.tooltip = Plugin
25994 $.fn.tooltip.Constructor = Tooltip
25995
25996
25997 // TOOLTIP NO CONFLICT
25998 // ===================
25999
26000 $.fn.tooltip.noConflict = function () {
26001 $.fn.tooltip = old
26002 return this
26003 }
26004
26005}(jQuery);
26006
26007/* ========================================================================
26008 * Bootstrap: popover.js v3.3.7
26009 * http://getbootstrap.com/javascript/#popovers
26010 * ========================================================================
26011 * Copyright 2011-2016 Twitter, Inc.
26012 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
26013 * ======================================================================== */
26014
26015
26016+function ($) {
26017 'use strict';
26018
26019 // POPOVER PUBLIC CLASS DEFINITION
26020 // ===============================
26021
26022 var Popover = function (element, options) {
26023 this.init('popover', element, options)
26024 }
26025
26026 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
26027
26028 Popover.VERSION = '3.3.7'
26029
26030 Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
26031 placement: 'right',
26032 trigger: 'click',
26033 content: '',
26034 template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
26035 })
26036
26037
26038 // NOTE: POPOVER EXTENDS tooltip.js
26039 // ================================
26040
26041 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
26042
26043 Popover.prototype.constructor = Popover
26044
26045 Popover.prototype.getDefaults = function () {
26046 return Popover.DEFAULTS
26047 }
26048
26049 Popover.prototype.setContent = function () {
26050 var $tip = this.tip()
26051 var title = this.getTitle()
26052 var content = this.getContent()
26053
26054 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
26055 $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
26056 this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
26057 ](content)
26058
26059 $tip.removeClass('fade top bottom left right in')
26060
26061 // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
26062 // this manually by checking the contents.
26063 if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
26064 }
26065
26066 Popover.prototype.hasContent = function () {
26067 return this.getTitle() || this.getContent()
26068 }
26069
26070 Popover.prototype.getContent = function () {
26071 var $e = this.$element
26072 var o = this.options
26073
26074 return $e.attr('data-content')
26075 || (typeof o.content == 'function' ?
26076 o.content.call($e[0]) :
26077 o.content)
26078 }
26079
26080 Popover.prototype.arrow = function () {
26081 return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
26082 }
26083
26084
26085 // POPOVER PLUGIN DEFINITION
26086 // =========================
26087
26088 function Plugin(option) {
26089 return this.each(function () {
26090 var $this = $(this)
26091 var data = $this.data('bs.popover')
26092 var options = typeof option == 'object' && option
26093
26094 if (!data && /destroy|hide/.test(option)) return
26095 if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
26096 if (typeof option == 'string') data[option]()
26097 })
26098 }
26099
26100 var old = $.fn.popover
26101
26102 $.fn.popover = Plugin
26103 $.fn.popover.Constructor = Popover
26104
26105
26106 // POPOVER NO CONFLICT
26107 // ===================
26108
26109 $.fn.popover.noConflict = function () {
26110 $.fn.popover = old
26111 return this
26112 }
26113
26114}(jQuery);
26115
26116/* ========================================================================
26117 * Bootstrap: scrollspy.js v3.3.7
26118 * http://getbootstrap.com/javascript/#scrollspy
26119 * ========================================================================
26120 * Copyright 2011-2016 Twitter, Inc.
26121 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
26122 * ======================================================================== */
26123
26124
26125+function ($) {
26126 'use strict';
26127
26128 // SCROLLSPY CLASS DEFINITION
26129 // ==========================
26130
26131 function ScrollSpy(element, options) {
26132 this.$body = $(document.body)
26133 this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
26134 this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
26135 this.selector = (this.options.target || '') + ' .nav li > a'
26136 this.offsets = []
26137 this.targets = []
26138 this.activeTarget = null
26139 this.scrollHeight = 0
26140
26141 this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
26142 this.refresh()
26143 this.process()
26144 }
26145
26146 ScrollSpy.VERSION = '3.3.7'
26147
26148 ScrollSpy.DEFAULTS = {
26149 offset: 10
26150 }
26151
26152 ScrollSpy.prototype.getScrollHeight = function () {
26153 return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
26154 }
26155
26156 ScrollSpy.prototype.refresh = function () {
26157 var that = this
26158 var offsetMethod = 'offset'
26159 var offsetBase = 0
26160
26161 this.offsets = []
26162 this.targets = []
26163 this.scrollHeight = this.getScrollHeight()
26164
26165 if (!$.isWindow(this.$scrollElement[0])) {
26166 offsetMethod = 'position'
26167 offsetBase = this.$scrollElement.scrollTop()
26168 }
26169
26170 this.$body
26171 .find(this.selector)
26172 .map(function () {
26173 var $el = $(this)
26174 var href = $el.data('target') || $el.attr('href')
26175 var $href = /^#./.test(href) && $(href)
26176
26177 return ($href
26178 && $href.length
26179 && $href.is(':visible')
26180 && [[$href[offsetMethod]().top + offsetBase, href]]) || null
26181 })
26182 .sort(function (a, b) { return a[0] - b[0] })
26183 .each(function () {
26184 that.offsets.push(this[0])
26185 that.targets.push(this[1])
26186 })
26187 }
26188
26189 ScrollSpy.prototype.process = function () {
26190 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
26191 var scrollHeight = this.getScrollHeight()
26192 var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
26193 var offsets = this.offsets
26194 var targets = this.targets
26195 var activeTarget = this.activeTarget
26196 var i
26197
26198 if (this.scrollHeight != scrollHeight) {
26199 this.refresh()
26200 }
26201
26202 if (scrollTop >= maxScroll) {
26203 return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
26204 }
26205
26206 if (activeTarget && scrollTop < offsets[0]) {
26207 this.activeTarget = null
26208 return this.clear()
26209 }
26210
26211 for (i = offsets.length; i--;) {
26212 activeTarget != targets[i]
26213 && scrollTop >= offsets[i]
26214 && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
26215 && this.activate(targets[i])
26216 }
26217 }
26218
26219 ScrollSpy.prototype.activate = function (target) {
26220 this.activeTarget = target
26221
26222 this.clear()
26223
26224 var selector = this.selector +
26225 '[data-target="' + target + '"],' +
26226 this.selector + '[href="' + target + '"]'
26227
26228 var active = $(selector)
26229 .parents('li')
26230 .addClass('active')
26231
26232 if (active.parent('.dropdown-menu').length) {
26233 active = active
26234 .closest('li.dropdown')
26235 .addClass('active')
26236 }
26237
26238 active.trigger('activate.bs.scrollspy')
26239 }
26240
26241 ScrollSpy.prototype.clear = function () {
26242 $(this.selector)
26243 .parentsUntil(this.options.target, '.active')
26244 .removeClass('active')
26245 }
26246
26247
26248 // SCROLLSPY PLUGIN DEFINITION
26249 // ===========================
26250
26251 function Plugin(option) {
26252 return this.each(function () {
26253 var $this = $(this)
26254 var data = $this.data('bs.scrollspy')
26255 var options = typeof option == 'object' && option
26256
26257 if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
26258 if (typeof option == 'string') data[option]()
26259 })
26260 }
26261
26262 var old = $.fn.scrollspy
26263
26264 $.fn.scrollspy = Plugin
26265 $.fn.scrollspy.Constructor = ScrollSpy
26266
26267
26268 // SCROLLSPY NO CONFLICT
26269 // =====================
26270
26271 $.fn.scrollspy.noConflict = function () {
26272 $.fn.scrollspy = old
26273 return this
26274 }
26275
26276
26277 // SCROLLSPY DATA-API
26278 // ==================
26279
26280 $(window).on('load.bs.scrollspy.data-api', function () {
26281 $('[data-spy="scroll"]').each(function () {
26282 var $spy = $(this)
26283 Plugin.call($spy, $spy.data())
26284 })
26285 })
26286
26287}(jQuery);
26288
26289/* ========================================================================
26290 * Bootstrap: tab.js v3.3.7
26291 * http://getbootstrap.com/javascript/#tabs
26292 * ========================================================================
26293 * Copyright 2011-2016 Twitter, Inc.
26294 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
26295 * ======================================================================== */
26296
26297
26298+function ($) {
26299 'use strict';
26300
26301 // TAB CLASS DEFINITION
26302 // ====================
26303
26304 var Tab = function (element) {
26305 // jscs:disable requireDollarBeforejQueryAssignment
26306 this.element = $(element)
26307 // jscs:enable requireDollarBeforejQueryAssignment
26308 }
26309
26310 Tab.VERSION = '3.3.7'
26311
26312 Tab.TRANSITION_DURATION = 150
26313
26314 Tab.prototype.show = function () {
26315 var $this = this.element
26316 var $ul = $this.closest('ul:not(.dropdown-menu)')
26317 var selector = $this.data('target')
26318
26319 if (!selector) {
26320 selector = $this.attr('href')
26321 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
26322 }
26323
26324 if ($this.parent('li').hasClass('active')) return
26325
26326 var $previous = $ul.find('.active:last a')
26327 var hideEvent = $.Event('hide.bs.tab', {
26328 relatedTarget: $this[0]
26329 })
26330 var showEvent = $.Event('show.bs.tab', {
26331 relatedTarget: $previous[0]
26332 })
26333
26334 $previous.trigger(hideEvent)
26335 $this.trigger(showEvent)
26336
26337 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
26338
26339 var $target = $(selector)
26340
26341 this.activate($this.closest('li'), $ul)
26342 this.activate($target, $target.parent(), function () {
26343 $previous.trigger({
26344 type: 'hidden.bs.tab',
26345 relatedTarget: $this[0]
26346 })
26347 $this.trigger({
26348 type: 'shown.bs.tab',
26349 relatedTarget: $previous[0]
26350 })
26351 })
26352 }
26353
26354 Tab.prototype.activate = function (element, container, callback) {
26355 var $active = container.find('> .active')
26356 var transition = callback
26357 && $.support.transition
26358 && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
26359
26360 function next() {
26361 $active
26362 .removeClass('active')
26363 .find('> .dropdown-menu > .active')
26364 .removeClass('active')
26365 .end()
26366 .find('[data-toggle="tab"]')
26367 .attr('aria-expanded', false)
26368
26369 element
26370 .addClass('active')
26371 .find('[data-toggle="tab"]')
26372 .attr('aria-expanded', true)
26373
26374 if (transition) {
26375 element[0].offsetWidth // reflow for transition
26376 element.addClass('in')
26377 } else {
26378 element.removeClass('fade')
26379 }
26380
26381 if (element.parent('.dropdown-menu').length) {
26382 element
26383 .closest('li.dropdown')
26384 .addClass('active')
26385 .end()
26386 .find('[data-toggle="tab"]')
26387 .attr('aria-expanded', true)
26388 }
26389
26390 callback && callback()
26391 }
26392
26393 $active.length && transition ?
26394 $active
26395 .one('bsTransitionEnd', next)
26396 .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
26397 next()
26398
26399 $active.removeClass('in')
26400 }
26401
26402
26403 // TAB PLUGIN DEFINITION
26404 // =====================
26405
26406 function Plugin(option) {
26407 return this.each(function () {
26408 var $this = $(this)
26409 var data = $this.data('bs.tab')
26410
26411 if (!data) $this.data('bs.tab', (data = new Tab(this)))
26412 if (typeof option == 'string') data[option]()
26413 })
26414 }
26415
26416 var old = $.fn.tab
26417
26418 $.fn.tab = Plugin
26419 $.fn.tab.Constructor = Tab
26420
26421
26422 // TAB NO CONFLICT
26423 // ===============
26424
26425 $.fn.tab.noConflict = function () {
26426 $.fn.tab = old
26427 return this
26428 }
26429
26430
26431 // TAB DATA-API
26432 // ============
26433
26434 var clickHandler = function (e) {
26435 e.preventDefault()
26436 Plugin.call($(this), 'show')
26437 }
26438
26439 $(document)
26440 .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
26441 .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
26442
26443}(jQuery);
26444
26445/* ========================================================================
26446 * Bootstrap: affix.js v3.3.7
26447 * http://getbootstrap.com/javascript/#affix
26448 * ========================================================================
26449 * Copyright 2011-2016 Twitter, Inc.
26450 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
26451 * ======================================================================== */
26452
26453
26454+function ($) {
26455 'use strict';
26456
26457 // AFFIX CLASS DEFINITION
26458 // ======================
26459
26460 var Affix = function (element, options) {
26461 this.options = $.extend({}, Affix.DEFAULTS, options)
26462
26463 this.$target = $(this.options.target)
26464 .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
26465 .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
26466
26467 this.$element = $(element)
26468 this.affixed = null
26469 this.unpin = null
26470 this.pinnedOffset = null
26471
26472 this.checkPosition()
26473 }
26474
26475 Affix.VERSION = '3.3.7'
26476
26477 Affix.RESET = 'affix affix-top affix-bottom'
26478
26479 Affix.DEFAULTS = {
26480 offset: 0,
26481 target: window
26482 }
26483
26484 Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
26485 var scrollTop = this.$target.scrollTop()
26486 var position = this.$element.offset()
26487 var targetHeight = this.$target.height()
26488
26489 if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
26490
26491 if (this.affixed == 'bottom') {
26492 if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
26493 return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
26494 }
26495
26496 var initializing = this.affixed == null
26497 var colliderTop = initializing ? scrollTop : position.top
26498 var colliderHeight = initializing ? targetHeight : height
26499
26500 if (offsetTop != null && scrollTop <= offsetTop) return 'top'
26501 if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
26502
26503 return false
26504 }
26505
26506 Affix.prototype.getPinnedOffset = function () {
26507 if (this.pinnedOffset) return this.pinnedOffset
26508 this.$element.removeClass(Affix.RESET).addClass('affix')
26509 var scrollTop = this.$target.scrollTop()
26510 var position = this.$element.offset()
26511 return (this.pinnedOffset = position.top - scrollTop)
26512 }
26513
26514 Affix.prototype.checkPositionWithEventLoop = function () {
26515 setTimeout($.proxy(this.checkPosition, this), 1)
26516 }
26517
26518 Affix.prototype.checkPosition = function () {
26519 if (!this.$element.is(':visible')) return
26520
26521 var height = this.$element.height()
26522 var offset = this.options.offset
26523 var offsetTop = offset.top
26524 var offsetBottom = offset.bottom
26525 var scrollHeight = Math.max($(document).height(), $(document.body).height())
26526
26527 if (typeof offset != 'object') offsetBottom = offsetTop = offset
26528 if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
26529 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
26530
26531 var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
26532
26533 if (this.affixed != affix) {
26534 if (this.unpin != null) this.$element.css('top', '')
26535
26536 var affixType = 'affix' + (affix ? '-' + affix : '')
26537 var e = $.Event(affixType + '.bs.affix')
26538
26539 this.$element.trigger(e)
26540
26541 if (e.isDefaultPrevented()) return
26542
26543 this.affixed = affix
26544 this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
26545
26546 this.$element
26547 .removeClass(Affix.RESET)
26548 .addClass(affixType)
26549 .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
26550 }
26551
26552 if (affix == 'bottom') {
26553 this.$element.offset({
26554 top: scrollHeight - height - offsetBottom
26555 })
26556 }
26557 }
26558
26559
26560 // AFFIX PLUGIN DEFINITION
26561 // =======================
26562
26563 function Plugin(option) {
26564 return this.each(function () {
26565 var $this = $(this)
26566 var data = $this.data('bs.affix')
26567 var options = typeof option == 'object' && option
26568
26569 if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
26570 if (typeof option == 'string') data[option]()
26571 })
26572 }
26573
26574 var old = $.fn.affix
26575
26576 $.fn.affix = Plugin
26577 $.fn.affix.Constructor = Affix
26578
26579
26580 // AFFIX NO CONFLICT
26581 // =================
26582
26583 $.fn.affix.noConflict = function () {
26584 $.fn.affix = old
26585 return this
26586 }
26587
26588
26589 // AFFIX DATA-API
26590 // ==============
26591
26592 $(window).on('load', function () {
26593 $('[data-spy="affix"]').each(function () {
26594 var $spy = $(this)
26595 var data = $spy.data()
26596
26597 data.offset = data.offset || {}
26598
26599 if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
26600 if (data.offsetTop != null) data.offset.top = data.offsetTop
26601
26602 Plugin.call($spy, data)
26603 })
26604 })
26605
26606}(jQuery);
26607</script>
26608 <script>(function() {
26609 'use strict';
26610
26611 /**
26612 * Extend an Object with another Object's properties.
26613 *
26614 * The source objects are specified as additional arguments.
26615 *
26616 * @param dst Object the object to extend.
26617 *
26618 * @return Object the final object.
26619 */
26620 var _extend = function(dst) {
26621 var sources = Array.prototype.slice.call(arguments, 1);
26622 for (var i=0; i<sources.length; ++i) {
26623 var src = sources[i];
26624 for (var p in src) {
26625 if (src.hasOwnProperty(p)) dst[p] = src[p];
26626 }
26627 }
26628 return dst;
26629 };
26630
26631
26632 /**
26633 * Defer execution of given function.
26634 * @param {Function} func
26635 */
26636 var _defer = function(func) {
26637 if (typeof setImmediate === 'function') {
26638 return setImmediate(func);
26639 } else {
26640 return setTimeout(func, 0);
26641 }
26642 };
26643
26644 /**
26645 * Based on the algorithm at http://en.wikipedia.org/wiki/Levenshtein_distance.
26646 */
26647 var Levenshtein = {
26648 /**
26649 * Calculate levenshtein distance of the two strings.
26650 *
26651 * @param str1 String the first string.
26652 * @param str2 String the second string.
26653 * @return Integer the levenshtein distance (0 and above).
26654 */
26655 get: function(str1, str2) {
26656 // base cases
26657 if (str1 === str2) return 0;
26658 if (str1.length === 0) return str2.length;
26659 if (str2.length === 0) return str1.length;
26660
26661 // two rows
26662 var prevRow = new Array(str2.length + 1),
26663 curCol, nextCol, i, j, tmp;
26664
26665 // initialise previous row
26666 for (i=0; i<prevRow.length; ++i) {
26667 prevRow[i] = i;
26668 }
26669
26670 // calculate current row distance from previous row
26671 for (i=0; i<str1.length; ++i) {
26672 nextCol = i + 1;
26673
26674 for (j=0; j<str2.length; ++j) {
26675 curCol = nextCol;
26676
26677 // substution
26678 nextCol = prevRow[j] + ( (str1.charAt(i) === str2.charAt(j)) ? 0 : 1 );
26679 // insertion
26680 tmp = curCol + 1;
26681 if (nextCol > tmp) {
26682 nextCol = tmp;
26683 }
26684 // deletion
26685 tmp = prevRow[j + 1] + 1;
26686 if (nextCol > tmp) {
26687 nextCol = tmp;
26688 }
26689
26690 // copy current col value into previous (in preparation for next iteration)
26691 prevRow[j] = curCol;
26692 }
26693
26694 // copy last col value into previous (in preparation for next iteration)
26695 prevRow[j] = nextCol;
26696 }
26697
26698 return nextCol;
26699 },
26700
26701 /**
26702 * Asynchronously calculate levenshtein distance of the two strings.
26703 *
26704 * @param str1 String the first string.
26705 * @param str2 String the second string.
26706 * @param cb Function callback function with signature: function(Error err, int distance)
26707 * @param [options] Object additional options.
26708 * @param [options.progress] Function progress callback with signature: function(percentComplete)
26709 */
26710 getAsync: function(str1, str2, cb, options) {
26711 options = _extend({}, {
26712 progress: null
26713 }, options);
26714
26715 // base cases
26716 if (str1 === str2) return cb(null, 0);
26717 if (str1.length === 0) return cb(null, str2.length);
26718 if (str2.length === 0) return cb(null, str1.length);
26719
26720 // two rows
26721 var prevRow = new Array(str2.length + 1),
26722 curCol, nextCol,
26723 i, j, tmp,
26724 startTime, currentTime;
26725
26726 // initialise previous row
26727 for (i=0; i<prevRow.length; ++i) {
26728 prevRow[i] = i;
26729 }
26730
26731 nextCol = 1;
26732 i = 0;
26733 j = -1;
26734
26735 var __calculate = function() {
26736 // reset timer
26737 startTime = new Date().valueOf();
26738 currentTime = startTime;
26739
26740 // keep going until one second has elapsed
26741 while (currentTime - startTime < 1000) {
26742 // reached end of current row?
26743 if (str2.length <= (++j)) {
26744 // copy current into previous (in preparation for next iteration)
26745 prevRow[j] = nextCol;
26746
26747 // if already done all chars
26748 if (str1.length <= (++i)) {
26749 return cb(null, nextCol);
26750 }
26751 // else if we have more left to do
26752 else {
26753 nextCol = i + 1;
26754 j = 0;
26755 }
26756 }
26757
26758 // calculation
26759 curCol = nextCol;
26760
26761 // substution
26762 nextCol = prevRow[j] + ( (str1.charAt(i) === str2.charAt(j)) ? 0 : 1 );
26763 // insertion
26764 tmp = curCol + 1;
26765 if (nextCol > tmp) {
26766 nextCol = tmp;
26767 }
26768 // deletion
26769 tmp = prevRow[j + 1] + 1;
26770 if (nextCol > tmp) {
26771 nextCol = tmp;
26772 }
26773
26774 // copy current into previous (in preparation for next iteration)
26775 prevRow[j] = curCol;
26776
26777 // get current time
26778 currentTime = new Date().valueOf();
26779 }
26780
26781 // send a progress update?
26782 if (null !== options.progress) {
26783 try {
26784 options.progress.call(null, (i * 100.0/ str1.length));
26785 } catch (err) {
26786 return cb('Progress callback: ' + err.toString());
26787 }
26788 }
26789
26790 // next iteration
26791 _defer(__calculate);
26792 };
26793
26794 __calculate();
26795 }
26796
26797 };
26798
26799 // amd
26800 if (typeof define !== "undefined" && define !== null && define.amd) {
26801 define(function() {
26802 return Levenshtein;
26803 });
26804 }
26805 // commonjs
26806 else if (typeof module !== "undefined" && module !== null && typeof exports !== "undefined" && module.exports === exports) {
26807 module.exports = Levenshtein;
26808 }
26809 // web worker
26810 else if (typeof self !== "undefined" && typeof self.postMessage === 'function' && typeof self.importScripts === 'function') {
26811 self.Levenshtein = Levenshtein;
26812 }
26813 // browser main thread
26814 else if (typeof window !== "undefined" && window !== null) {
26815 window.Levenshtein = Levenshtein;
26816 }
26817}());
26818
26819</script>
26820 <script>/*! kjua v0.1.1 - https://larsjung.de/kjua/ */
26821!function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.kjua=t():r.kjua=t()}(this,function(){return function(r){function t(n){if(e[n])return e[n].exports;var o=e[n]={exports:{},id:n,loaded:!1};return r[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var e={};return t.m=r,t.c=e,t.p="",t(0)}([function(r,t,e){"use strict";var n=e(1),o=n.createCanvas,i=n.canvasToImg,a=n.dpr,u=e(2),f=e(3),c=e(4);r.exports=function(r){var t=Object.assign({},u,r),e=f(t.text,t.ecLevel,t.minVersion,t.quiet),n=t.ratio||a,l=o(t.size,n),s=l.getContext("2d");return s.scale(n,n),c(e,s,t),"image"===t.render?i(l):l}},function(r,t){"use strict";var e=window,n=e.document,o=e.devicePixelRatio||1,i=function(r){return n.createElement(r)},a=function(r,t){return r.getAttribute(t)},u=function(r,t,e){return r.setAttribute(t,e)},f=function(r,t){var e=i("canvas");return u(e,"width",r*t),u(e,"height",r*t),e.style.width=r+"px",e.style.height=r+"px",e},c=function(r){var t=i("img");return u(t,"crossorigin","anonymous"),u(t,"src",r.toDataURL("image/png")),u(t,"width",a(r,"width")),u(t,"height",a(r,"height")),t.style.width=r.style.width,t.style.height=r.style.height,t};r.exports={createCanvas:f,canvasToImg:c,dpr:o}},function(r,t){"use strict";r.exports={render:"image",crisp:!0,minVersion:1,ecLevel:"L",size:200,ratio:null,fill:"#333",back:"#fff",text:"no text",rounded:0,quiet:0,mode:"plain",mSize:30,mPosX:50,mPosY:50,label:"no label",fontname:"sans",fontcolor:"#333",image:null}},function(r,t){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol?"symbol":typeof r},n=/code length overflow/i,o=function(){var e=function(){function r(t,e){if("undefined"==typeof t.length)throw new Error(t.length+"/"+e);var n=function(){for(var r=0;r<t.length&&0==t[r];)r+=1;for(var n=new Array(t.length-r+e),o=0;o<t.length-r;o+=1)n[o]=t[o+r];return n}(),o={};return o.getAt=function(r){return n[r]},o.getLength=function(){return n.length},o.multiply=function(t){for(var e=new Array(o.getLength()+t.getLength()-1),n=0;n<o.getLength();n+=1)for(var i=0;i<t.getLength();i+=1)e[n+i]^=a.gexp(a.glog(o.getAt(n))+a.glog(t.getAt(i)));return r(e,0)},o.mod=function(t){if(o.getLength()-t.getLength()<0)return o;for(var e=a.glog(o.getAt(0))-a.glog(t.getAt(0)),n=new Array(o.getLength()),i=0;i<o.getLength();i+=1)n[i]=o.getAt(i);for(var i=0;i<t.getLength();i+=1)n[i]^=a.gexp(a.glog(t.getAt(i))+e);return r(n,0).mod(t)},o}var t=function(t,e){var o=236,a=17,l=t,s=n[e],g=null,h=0,d=null,w=new Array,y={},p=function(r,t){h=4*l+17,g=function(r){for(var t=new Array(r),e=0;r>e;e+=1){t[e]=new Array(r);for(var n=0;r>n;n+=1)t[e][n]=null}return t}(h),m(0,0),m(h-7,0),m(0,h-7),E(),B(),M(r,t),l>=7&&T(r),null==d&&(d=x(l,s,w)),k(d,t)},m=function(r,t){for(var e=-1;7>=e;e+=1)if(!(-1>=r+e||r+e>=h))for(var n=-1;7>=n;n+=1)-1>=t+n||t+n>=h||(e>=0&&6>=e&&(0==n||6==n)||n>=0&&6>=n&&(0==e||6==e)||e>=2&&4>=e&&n>=2&&4>=n?g[r+e][t+n]=!0:g[r+e][t+n]=!1)},A=function(){for(var r=0,t=0,e=0;8>e;e+=1){p(!0,e);var n=i.getLostPoint(y);(0==e||r>n)&&(r=n,t=e)}return t},B=function(){for(var r=8;h-8>r;r+=1)null==g[r][6]&&(g[r][6]=r%2==0);for(var t=8;h-8>t;t+=1)null==g[6][t]&&(g[6][t]=t%2==0)},E=function(){for(var r=i.getPatternPosition(l),t=0;t<r.length;t+=1)for(var e=0;e<r.length;e+=1){var n=r[t],o=r[e];if(null==g[n][o])for(var a=-2;2>=a;a+=1)for(var u=-2;2>=u;u+=1)-2==a||2==a||-2==u||2==u||0==a&&0==u?g[n+a][o+u]=!0:g[n+a][o+u]=!1}},T=function(r){for(var t=i.getBCHTypeNumber(l),e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);g[Math.floor(e/3)][e%3+h-8-3]=n}for(var e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);g[e%3+h-8-3][Math.floor(e/3)]=n}},M=function(r,t){for(var e=s<<3|t,n=i.getBCHTypeInfo(e),o=0;15>o;o+=1){var a=!r&&1==(n>>o&1);6>o?g[o][8]=a:8>o?g[o+1][8]=a:g[h-15+o][8]=a}for(var o=0;15>o;o+=1){var a=!r&&1==(n>>o&1);8>o?g[8][h-o-1]=a:9>o?g[8][15-o-1+1]=a:g[8][15-o-1]=a}g[h-8][8]=!r},k=function(r,t){for(var e=-1,n=h-1,o=7,a=0,u=i.getMaskFunction(t),f=h-1;f>0;f-=2)for(6==f&&(f-=1);;){for(var c=0;2>c;c+=1)if(null==g[n][f-c]){var l=!1;a<r.length&&(l=1==(r[a]>>>o&1));var s=u(n,f-c);s&&(l=!l),g[n][f-c]=l,o-=1,-1==o&&(a+=1,o=7)}if(n+=e,0>n||n>=h){n-=e,e=-e;break}}},b=function(t,e){for(var n=0,o=0,a=0,u=new Array(e.length),f=new Array(e.length),c=0;c<e.length;c+=1){var l=e[c].dataCount,s=e[c].totalCount-l;o=Math.max(o,l),a=Math.max(a,s),u[c]=new Array(l);for(var g=0;g<u[c].length;g+=1)u[c][g]=255&t.getBuffer()[g+n];n+=l;var h=i.getErrorCorrectPolynomial(s),v=r(u[c],h.getLength()-1),d=v.mod(h);f[c]=new Array(h.getLength()-1);for(var g=0;g<f[c].length;g+=1){var w=g+d.getLength()-f[c].length;f[c][g]=w>=0?d.getAt(w):0}}for(var y=0,g=0;g<e.length;g+=1)y+=e[g].totalCount;for(var p=new Array(y),m=0,g=0;o>g;g+=1)for(var c=0;c<e.length;c+=1)g<u[c].length&&(p[m]=u[c][g],m+=1);for(var g=0;a>g;g+=1)for(var c=0;c<e.length;c+=1)g<f[c].length&&(p[m]=f[c][g],m+=1);return p},x=function(r,t,e){for(var n=u.getRSBlocks(r,t),c=f(),l=0;l<e.length;l+=1){var s=e[l];c.put(s.getMode(),4),c.put(s.getLength(),i.getLengthInBits(s.getMode(),r)),s.write(c)}for(var g=0,l=0;l<n.length;l+=1)g+=n[l].dataCount;if(c.getLengthInBits()>8*g)throw new Error("code length overflow. ("+c.getLengthInBits()+">"+8*g+")");for(c.getLengthInBits()+4<=8*g&&c.put(0,4);c.getLengthInBits()%8!=0;)c.putBit(!1);for(;;){if(c.getLengthInBits()>=8*g)break;if(c.put(o,8),c.getLengthInBits()>=8*g)break;c.put(a,8)}return b(c,n)};return y.addData=function(r){var t=c(r);w.push(t),d=null},y.isDark=function(r,t){if(0>r||r>=h||0>t||t>=h)throw new Error(r+","+t);return g[r][t]},y.getModuleCount=function(){return h},y.make=function(){p(!1,A())},y.createTableTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e="";e+='<table style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: "+t+"px;",e+='">',e+="<tbody>";for(var n=0;n<y.getModuleCount();n+=1){e+="<tr>";for(var o=0;o<y.getModuleCount();o+=1)e+='<td style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: 0px;",e+=" width: "+r+"px;",e+=" height: "+r+"px;",e+=" background-color: ",e+=y.isDark(n,o)?"#000000":"#ffffff",e+=";",e+='"/>';e+="</tr>"}return e+="</tbody>",e+="</table>"},y.createImgTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e=y.getModuleCount()*r+2*t,n=t,o=e-t;return v(e,e,function(t,e){if(t>=n&&o>t&&e>=n&&o>e){var i=Math.floor((t-n)/r),a=Math.floor((e-n)/r);return y.isDark(a,i)?0:1}return 1})},y};t.stringToBytes=function(r){for(var t=new Array,e=0;e<r.length;e+=1){var n=r.charCodeAt(e);t.push(255&n)}return t},t.createStringToBytes=function(r,t){var e=function(){for(var e=g(r),n=function(){var r=e.read();if(-1==r)throw new Error;return r},o=0,i={};;){var a=e.read();if(-1==a)break;var u=n(),f=n(),c=n(),l=String.fromCharCode(a<<8|u),s=f<<8|c;i[l]=s,o+=1}if(o!=t)throw new Error(o+" != "+t);return i}(),n="?".charCodeAt(0);return function(r){for(var t=new Array,o=0;o<r.length;o+=1){var i=r.charCodeAt(o);if(128>i)t.push(i);else{var a=e[r.charAt(o)];"number"==typeof a?(255&a)==a?t.push(a):(t.push(a>>>8),t.push(255&a)):t.push(n)}}return t}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},i=function(){var t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,i=7973,u=21522,f={},c=function(r){for(var t=0;0!=r;)t+=1,r>>>=1;return t};return f.getBCHTypeInfo=function(r){for(var t=r<<10;c(t)-c(n)>=0;)t^=n<<c(t)-c(n);return(r<<10|t)^u},f.getBCHTypeNumber=function(r){for(var t=r<<12;c(t)-c(i)>=0;)t^=i<<c(t)-c(i);return r<<12|t},f.getPatternPosition=function(r){return t[r-1]},f.getMaskFunction=function(r){switch(r){case o.PATTERN000:return function(r,t){return(r+t)%2==0};case o.PATTERN001:return function(r,t){return r%2==0};case o.PATTERN010:return function(r,t){return t%3==0};case o.PATTERN011:return function(r,t){return(r+t)%3==0};case o.PATTERN100:return function(r,t){return(Math.floor(r/2)+Math.floor(t/3))%2==0};case o.PATTERN101:return function(r,t){return r*t%2+r*t%3==0};case o.PATTERN110:return function(r,t){return(r*t%2+r*t%3)%2==0};case o.PATTERN111:return function(r,t){return(r*t%3+(r+t)%2)%2==0};default:throw new Error("bad maskPattern:"+r)}},f.getErrorCorrectPolynomial=function(t){for(var e=r([1],0),n=0;t>n;n+=1)e=e.multiply(r([1,a.gexp(n)],0));return e},f.getLengthInBits=function(r,t){if(t>=1&&10>t)switch(r){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+r)}else if(27>t)switch(r){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+r)}else{if(!(41>t))throw new Error("type:"+t);switch(r){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+r)}}},f.getLostPoint=function(r){for(var t=r.getModuleCount(),e=0,n=0;t>n;n+=1)for(var o=0;t>o;o+=1){for(var i=0,a=r.isDark(n,o),u=-1;1>=u;u+=1)if(!(0>n+u||n+u>=t))for(var f=-1;1>=f;f+=1)0>o+f||o+f>=t||0==u&&0==f||a==r.isDark(n+u,o+f)&&(i+=1);i>5&&(e+=3+i-5)}for(var n=0;t-1>n;n+=1)for(var o=0;t-1>o;o+=1){var c=0;r.isDark(n,o)&&(c+=1),r.isDark(n+1,o)&&(c+=1),r.isDark(n,o+1)&&(c+=1),r.isDark(n+1,o+1)&&(c+=1),0!=c&&4!=c||(e+=3)}for(var n=0;t>n;n+=1)for(var o=0;t-6>o;o+=1)r.isDark(n,o)&&!r.isDark(n,o+1)&&r.isDark(n,o+2)&&r.isDark(n,o+3)&&r.isDark(n,o+4)&&!r.isDark(n,o+5)&&r.isDark(n,o+6)&&(e+=40);for(var o=0;t>o;o+=1)for(var n=0;t-6>n;n+=1)r.isDark(n,o)&&!r.isDark(n+1,o)&&r.isDark(n+2,o)&&r.isDark(n+3,o)&&r.isDark(n+4,o)&&!r.isDark(n+5,o)&&r.isDark(n+6,o)&&(e+=40);for(var l=0,o=0;t>o;o+=1)for(var n=0;t>n;n+=1)r.isDark(n,o)&&(l+=1);var s=Math.abs(100*l/t/t-50)/5;return e+=10*s},f}(),a=function(){for(var r=new Array(256),t=new Array(256),e=0;8>e;e+=1)r[e]=1<<e;for(var e=8;256>e;e+=1)r[e]=r[e-4]^r[e-5]^r[e-6]^r[e-8];for(var e=0;255>e;e+=1)t[r[e]]=e;var n={};return n.glog=function(r){if(1>r)throw new Error("glog("+r+")");return t[r]},n.gexp=function(t){for(;0>t;)t+=255;for(;t>=256;)t-=255;return r[t]},n}(),u=function(){var r=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(r,t){var e={};return e.totalCount=r,e.dataCount=t,e},e={},o=function(t,e){switch(e){case n.L:return r[4*(t-1)+0];case n.M:return r[4*(t-1)+1];case n.Q:return r[4*(t-1)+2];case n.H:return r[4*(t-1)+3];default:return}};return e.getRSBlocks=function(r,e){var n=o(r,e);if("undefined"==typeof n)throw new Error("bad rs block @ typeNumber:"+r+"/errorCorrectLevel:"+e);for(var i=n.length/3,a=new Array,u=0;i>u;u+=1)for(var f=n[3*u+0],c=n[3*u+1],l=n[3*u+2],s=0;f>s;s+=1)a.push(t(c,l));return a},e}(),f=function(){var r=new Array,t=0,e={};return e.getBuffer=function(){return r},e.getAt=function(t){var e=Math.floor(t/8);return 1==(r[e]>>>7-t%8&1)},e.put=function(r,t){for(var n=0;t>n;n+=1)e.putBit(1==(r>>>t-n-1&1))},e.getLengthInBits=function(){return t},e.putBit=function(e){var n=Math.floor(t/8);r.length<=n&&r.push(0),e&&(r[n]|=128>>>t%8),t+=1},e},c=function(r){var n=e.MODE_8BIT_BYTE,o=t.stringToBytes(r),i={};return i.getMode=function(){return n},i.getLength=function(r){return o.length},i.write=function(r){for(var t=0;t<o.length;t+=1)r.put(o[t],8)},i},l=function(){var r=new Array,t={};return t.writeByte=function(t){r.push(255&t)},t.writeShort=function(r){t.writeByte(r),t.writeByte(r>>>8)},t.writeBytes=function(r,e,n){e=e||0,n=n||r.length;for(var o=0;n>o;o+=1)t.writeByte(r[o+e])},t.writeString=function(r){for(var e=0;e<r.length;e+=1)t.writeByte(r.charCodeAt(e))},t.toByteArray=function(){return r},t.toString=function(){var t="";t+="[";for(var e=0;e<r.length;e+=1)e>0&&(t+=","),t+=r[e];return t+="]"},t},s=function(){var r=0,t=0,e=0,n="",o={},i=function(r){n+=String.fromCharCode(a(63&r))},a=function(r){if(0>r);else{if(26>r)return 65+r;if(52>r)return 97+(r-26);if(62>r)return 48+(r-52);if(62==r)return 43;if(63==r)return 47}throw new Error("n:"+r)};return o.writeByte=function(n){for(r=r<<8|255&n,t+=8,e+=1;t>=6;)i(r>>>t-6),t-=6},o.flush=function(){if(t>0&&(i(r<<6-t),r=0,t=0),e%3!=0)for(var o=3-e%3,a=0;o>a;a+=1)n+="="},o.toString=function(){return n},o},g=function(r){var t=r,e=0,n=0,o=0,i={};i.read=function(){for(;8>o;){if(e>=t.length){if(0==o)return-1;throw new Error("unexpected end of file./"+o)}var r=t.charAt(e);if(e+=1,"="==r)return o=0,-1;r.match(/^\s$/)||(n=n<<6|a(r.charCodeAt(0)),o+=6)}var i=n>>>o-8&255;return o-=8,i};var a=function(r){if(r>=65&&90>=r)return r-65;if(r>=97&&122>=r)return r-97+26;if(r>=48&&57>=r)return r-48+52;if(43==r)return 62;if(47==r)return 63;throw new Error("c:"+r)};return i},h=function(r,t){var e=r,n=t,o=new Array(r*t),i={};i.setPixel=function(r,t,n){o[t*e+r]=n},i.write=function(r){r.writeString("GIF87a"),r.writeShort(e),r.writeShort(n),r.writeByte(128),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(255),r.writeByte(255),r.writeByte(255),r.writeString(","),r.writeShort(0),r.writeShort(0),r.writeShort(e),r.writeShort(n),r.writeByte(0);var t=2,o=u(t);r.writeByte(t);for(var i=0;o.length-i>255;)r.writeByte(255),r.writeBytes(o,i,255),i+=255;r.writeByte(o.length-i),r.writeBytes(o,i,o.length-i),r.writeByte(0),r.writeString(";")};var a=function(r){var t=r,e=0,n=0,o={};return o.write=function(r,o){if(r>>>o!=0)throw new Error("length over");for(;e+o>=8;)t.writeByte(255&(r<<e|n)),o-=8-e,r>>>=8-e,n=0,e=0;n=r<<e|n,e+=o},o.flush=function(){e>0&&t.writeByte(n)},o},u=function(r){for(var t=1<<r,e=(1<<r)+1,n=r+1,i=f(),u=0;t>u;u+=1)i.add(String.fromCharCode(u));i.add(String.fromCharCode(t)),i.add(String.fromCharCode(e));var c=l(),s=a(c);s.write(t,n);var g=0,h=String.fromCharCode(o[g]);for(g+=1;g<o.length;){var v=String.fromCharCode(o[g]);g+=1,i.contains(h+v)?h+=v:(s.write(i.indexOf(h),n),i.size()<4095&&(i.size()==1<<n&&(n+=1),i.add(h+v)),h=v)}return s.write(i.indexOf(h),n),s.write(e,n),s.flush(),c.toByteArray()},f=function(){var r={},t=0,e={};return e.add=function(n){if(e.contains(n))throw new Error("dup key:"+n);r[n]=t,t+=1},e.size=function(){return t},e.indexOf=function(t){return r[t]},e.contains=function(t){return"undefined"!=typeof r[t]},e};return i},v=function(r,t,e,n){for(var o=h(r,t),i=0;t>i;i+=1)for(var a=0;r>a;a+=1)o.setPixel(a,i,e(a,i));var u=l();o.write(u);for(var f=s(),c=u.toByteArray(),g=0;g<c.length;g+=1)f.writeByte(c[g]);f.flush();var v="";return v+="<img",v+=' src="',v+="data:image/gif;base64,",v+=f,v+='"',v+=' width="',v+=r,v+='"',v+=' height="',v+=t,v+='"',n&&(v+=' alt="',v+=n,v+='"'),v+="/>"};return t}();return function(e){"function"==typeof define&&define.amd?define([],e):"object"==typeof t&&(r.exports=e())}(function(){return e}),!function(r){r.stringToBytes=function(r){function t(r){for(var t=[],e=0;e<r.length;e++){var n=r.charCodeAt(e);128>n?t.push(n):2048>n?t.push(192|n>>6,128|63&n):55296>n||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(e++,n=65536+((1023&n)<<10|1023&r.charCodeAt(e)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}return t(r)}}(e),e}(),i=function(r,t){var i=arguments.length<=2||void 0===arguments[2]?1:arguments[2];i=Math.max(1,i);for(var a=i;40>=a;a+=1)try{var u=function(){var e=o(a,t);e.addData(r),e.make();var n=e.getModuleCount(),i=function(r,t){return r>=0&&n>r&&t>=0&&n>t&&e.isDark(r,t)};return{v:{text:r,level:t,version:a,moduleCount:n,isDark:i}}}();if("object"===("undefined"==typeof u?"undefined":e(u)))return u.v}catch(f){if(!n.test(f.message))throw f}return null},a=function(){var r=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=arguments.length<=1||void 0===arguments[1]?"L":arguments[1],e=arguments.length<=2||void 0===arguments[2]?1:arguments[2],n=arguments.length<=3||void 0===arguments[3]?0:arguments[3],o=i(r,t,e);return o&&!function(){var r=o.isDark;o.moduleCount+=2*n,o.isDark=function(t,e){return r(t-n,e-n)}}(),o};r.exports=a},function(r,t,e){"use strict";var n=e(5),o=e(6),i=function(r,t){r.fillStyle=t.back,r.fillRect(0,0,t.size,t.size)},a=function(r,t,e,n,o,i){r.isDark(o,i)&&t.rect(i*n,o*n,n,n)},u=function(r,t,e){if(r){var o=e.rounded>0&&e.rounded<=100?n:a,i=r.moduleCount,u=e.size/i,f=0;e.crisp&&(u=Math.floor(u),f=Math.floor((e.size-u*i)/2)),t.translate(f,f),t.beginPath();for(var c=0;i>c;c+=1)for(var l=0;i>l;l+=1)o(r,t,e,u,c,l);t.fillStyle=e.fill,t.fill(),t.translate(-f,-f)}},f=function(r,t,e){i(t,e),u(r,t,e),o(t,e)};r.exports=f},function(r,t){"use strict";var e=function(r){return{c:r,m:function(){var r;return(r=this.c).moveTo.apply(r,arguments),this},l:function(){var r;return(r=this.c).lineTo.apply(r,arguments),this},a:function(){var r;return(r=this.c).arcTo.apply(r,arguments),this}}},n=function(r,t,e,n,o,i,a,u,f,c){a?r.m(t+i,e):r.m(t,e),u?r.l(n-i,e).a(n,e,n,o,i):r.l(n,e),f?r.l(n,o-i).a(n,o,t,o,i):r.l(n,o),c?r.l(t+i,o).a(t,o,t,e,i):r.l(t,o),a?r.l(t,e+i).a(t,e,n,e,i):r.l(t,e)},o=function(r,t,e,n,o,i,a,u,f,c){a&&r.m(t+i,e).l(t,e).l(t,e+i).a(t,e,t+i,e,i),u&&r.m(n-i,e).l(n,e).l(n,e+i).a(n,e,n-i,e,i),f&&r.m(n-i,o).l(n,o).l(n,o-i).a(n,o,n-i,o,i),c&&r.m(t+i,o).l(t,o).l(t,o-i).a(t,o,t+i,o,i)},i=function(r,t,i,a,u,f){var c=f*a,l=u*a,s=c+a,g=l+a,h=.005*i.rounded*a,v=r.isDark,d=u-1,w=u+1,y=f-1,p=f+1,m=v(u,f),A=v(d,y),B=v(d,f),E=v(d,p),T=v(u,p),M=v(w,p),k=v(w,f),b=v(w,y),x=v(u,y),D=e(t);m?n(D,c,l,s,g,h,!B&&!x,!B&&!T,!k&&!T,!k&&!x):o(D,c,l,s,g,h,B&&x&&A,B&&T&&E,k&&T&&M,k&&x&&b)};r.exports=i},function(r,t){"use strict";var e=function(r,t){var e=t.size,n="bold "+.01*t.mSize*e+"px "+t.fontname;r.strokeStyle=t.back,r.lineWidth=.01*t.mSize*e*.1,r.fillStyle=t.fontcolor,r.font=n;var o=r.measureText(t.label).width,i=.01*t.mSize,a=o/e,u=(1-a)*t.mPosX*.01,f=(1-i)*t.mPosY*.01,c=u*e,l=f*e+.75*t.mSize*.01*e;r.strokeText(t.label,c,l),r.fillText(t.label,c,l)},n=function(r,t){var e=t.size,n=t.image.naturalWidth||1,o=t.image.naturalHeight||1,i=.01*t.mSize,a=i*n/o,u=(1-a)*t.mPosX*.01,f=(1-i)*t.mPosY*.01,c=u*e,l=f*e,s=a*e,g=i*e;r.drawImage(t.image,c,l,s,g)},o=function(r,t){var o=t.mode;"label"===o?e(r,t):"image"===o&&n(r,t)};r.exports=o}])});</script>
26822 <script>(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.bitcoinjs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
26823(function (global){
26824'use strict';
26825
26826// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
26827// original notice:
26828
26829/*!
26830 * The buffer module from node.js, for the browser.
26831 *
26832 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
26833 * @license MIT
26834 */
26835function compare(a, b) {
26836 if (a === b) {
26837 return 0;
26838 }
26839
26840 var x = a.length;
26841 var y = b.length;
26842
26843 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
26844 if (a[i] !== b[i]) {
26845 x = a[i];
26846 y = b[i];
26847 break;
26848 }
26849 }
26850
26851 if (x < y) {
26852 return -1;
26853 }
26854 if (y < x) {
26855 return 1;
26856 }
26857 return 0;
26858}
26859function isBuffer(b) {
26860 if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {
26861 return global.Buffer.isBuffer(b);
26862 }
26863 return !!(b != null && b._isBuffer);
26864}
26865
26866// based on node assert, original notice:
26867
26868// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
26869//
26870// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
26871//
26872// Originally from narwhal.js (http://narwhaljs.org)
26873// Copyright (c) 2009 Thomas Robinson <280north.com>
26874//
26875// Permission is hereby granted, free of charge, to any person obtaining a copy
26876// of this software and associated documentation files (the 'Software'), to
26877// deal in the Software without restriction, including without limitation the
26878// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
26879// sell copies of the Software, and to permit persons to whom the Software is
26880// furnished to do so, subject to the following conditions:
26881//
26882// The above copyright notice and this permission notice shall be included in
26883// all copies or substantial portions of the Software.
26884//
26885// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26886// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26887// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26888// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
26889// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26890// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26891
26892var util = require('util/');
26893var hasOwn = Object.prototype.hasOwnProperty;
26894var pSlice = Array.prototype.slice;
26895var functionsHaveNames = (function () {
26896 return function foo() {}.name === 'foo';
26897}());
26898function pToString (obj) {
26899 return Object.prototype.toString.call(obj);
26900}
26901function isView(arrbuf) {
26902 if (isBuffer(arrbuf)) {
26903 return false;
26904 }
26905 if (typeof global.ArrayBuffer !== 'function') {
26906 return false;
26907 }
26908 if (typeof ArrayBuffer.isView === 'function') {
26909 return ArrayBuffer.isView(arrbuf);
26910 }
26911 if (!arrbuf) {
26912 return false;
26913 }
26914 if (arrbuf instanceof DataView) {
26915 return true;
26916 }
26917 if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
26918 return true;
26919 }
26920 return false;
26921}
26922// 1. The assert module provides functions that throw
26923// AssertionError's when particular conditions are not met. The
26924// assert module must conform to the following interface.
26925
26926var assert = module.exports = ok;
26927
26928// 2. The AssertionError is defined in assert.
26929// new assert.AssertionError({ message: message,
26930// actual: actual,
26931// expected: expected })
26932
26933var regex = /\s*function\s+([^\(\s]*)\s*/;
26934// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js
26935function getName(func) {
26936 if (!util.isFunction(func)) {
26937 return;
26938 }
26939 if (functionsHaveNames) {
26940 return func.name;
26941 }
26942 var str = func.toString();
26943 var match = str.match(regex);
26944 return match && match[1];
26945}
26946assert.AssertionError = function AssertionError(options) {
26947 this.name = 'AssertionError';
26948 this.actual = options.actual;
26949 this.expected = options.expected;
26950 this.operator = options.operator;
26951 if (options.message) {
26952 this.message = options.message;
26953 this.generatedMessage = false;
26954 } else {
26955 this.message = getMessage(this);
26956 this.generatedMessage = true;
26957 }
26958 var stackStartFunction = options.stackStartFunction || fail;
26959 if (Error.captureStackTrace) {
26960 Error.captureStackTrace(this, stackStartFunction);
26961 } else {
26962 // non v8 browsers so we can have a stacktrace
26963 var err = new Error();
26964 if (err.stack) {
26965 var out = err.stack;
26966
26967 // try to strip useless frames
26968 var fn_name = getName(stackStartFunction);
26969 var idx = out.indexOf('\n' + fn_name);
26970 if (idx >= 0) {
26971 // once we have located the function frame
26972 // we need to strip out everything before it (and its line)
26973 var next_line = out.indexOf('\n', idx + 1);
26974 out = out.substring(next_line + 1);
26975 }
26976
26977 this.stack = out;
26978 }
26979 }
26980};
26981
26982// assert.AssertionError instanceof Error
26983util.inherits(assert.AssertionError, Error);
26984
26985function truncate(s, n) {
26986 if (typeof s === 'string') {
26987 return s.length < n ? s : s.slice(0, n);
26988 } else {
26989 return s;
26990 }
26991}
26992function inspect(something) {
26993 if (functionsHaveNames || !util.isFunction(something)) {
26994 return util.inspect(something);
26995 }
26996 var rawname = getName(something);
26997 var name = rawname ? ': ' + rawname : '';
26998 return '[Function' + name + ']';
26999}
27000function getMessage(self) {
27001 return truncate(inspect(self.actual), 128) + ' ' +
27002 self.operator + ' ' +
27003 truncate(inspect(self.expected), 128);
27004}
27005
27006// At present only the three keys mentioned above are used and
27007// understood by the spec. Implementations or sub modules can pass
27008// other keys to the AssertionError's constructor - they will be
27009// ignored.
27010
27011// 3. All of the following functions must throw an AssertionError
27012// when a corresponding condition is not met, with a message that
27013// may be undefined if not provided. All assertion methods provide
27014// both the actual and expected values to the assertion error for
27015// display purposes.
27016
27017function fail(actual, expected, message, operator, stackStartFunction) {
27018 throw new assert.AssertionError({
27019 message: message,
27020 actual: actual,
27021 expected: expected,
27022 operator: operator,
27023 stackStartFunction: stackStartFunction
27024 });
27025}
27026
27027// EXTENSION! allows for well behaved errors defined elsewhere.
27028assert.fail = fail;
27029
27030// 4. Pure assertion tests whether a value is truthy, as determined
27031// by !!guard.
27032// assert.ok(guard, message_opt);
27033// This statement is equivalent to assert.equal(true, !!guard,
27034// message_opt);. To test strictly for the value true, use
27035// assert.strictEqual(true, guard, message_opt);.
27036
27037function ok(value, message) {
27038 if (!value) fail(value, true, message, '==', assert.ok);
27039}
27040assert.ok = ok;
27041
27042// 5. The equality assertion tests shallow, coercive equality with
27043// ==.
27044// assert.equal(actual, expected, message_opt);
27045
27046assert.equal = function equal(actual, expected, message) {
27047 if (actual != expected) fail(actual, expected, message, '==', assert.equal);
27048};
27049
27050// 6. The non-equality assertion tests for whether two objects are not equal
27051// with != assert.notEqual(actual, expected, message_opt);
27052
27053assert.notEqual = function notEqual(actual, expected, message) {
27054 if (actual == expected) {
27055 fail(actual, expected, message, '!=', assert.notEqual);
27056 }
27057};
27058
27059// 7. The equivalence assertion tests a deep equality relation.
27060// assert.deepEqual(actual, expected, message_opt);
27061
27062assert.deepEqual = function deepEqual(actual, expected, message) {
27063 if (!_deepEqual(actual, expected, false)) {
27064 fail(actual, expected, message, 'deepEqual', assert.deepEqual);
27065 }
27066};
27067
27068assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
27069 if (!_deepEqual(actual, expected, true)) {
27070 fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
27071 }
27072};
27073
27074function _deepEqual(actual, expected, strict, memos) {
27075 // 7.1. All identical values are equivalent, as determined by ===.
27076 if (actual === expected) {
27077 return true;
27078 } else if (isBuffer(actual) && isBuffer(expected)) {
27079 return compare(actual, expected) === 0;
27080
27081 // 7.2. If the expected value is a Date object, the actual value is
27082 // equivalent if it is also a Date object that refers to the same time.
27083 } else if (util.isDate(actual) && util.isDate(expected)) {
27084 return actual.getTime() === expected.getTime();
27085
27086 // 7.3 If the expected value is a RegExp object, the actual value is
27087 // equivalent if it is also a RegExp object with the same source and
27088 // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
27089 } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
27090 return actual.source === expected.source &&
27091 actual.global === expected.global &&
27092 actual.multiline === expected.multiline &&
27093 actual.lastIndex === expected.lastIndex &&
27094 actual.ignoreCase === expected.ignoreCase;
27095
27096 // 7.4. Other pairs that do not both pass typeof value == 'object',
27097 // equivalence is determined by ==.
27098 } else if ((actual === null || typeof actual !== 'object') &&
27099 (expected === null || typeof expected !== 'object')) {
27100 return strict ? actual === expected : actual == expected;
27101
27102 // If both values are instances of typed arrays, wrap their underlying
27103 // ArrayBuffers in a Buffer each to increase performance
27104 // This optimization requires the arrays to have the same type as checked by
27105 // Object.prototype.toString (aka pToString). Never perform binary
27106 // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
27107 // bit patterns are not identical.
27108 } else if (isView(actual) && isView(expected) &&
27109 pToString(actual) === pToString(expected) &&
27110 !(actual instanceof Float32Array ||
27111 actual instanceof Float64Array)) {
27112 return compare(new Uint8Array(actual.buffer),
27113 new Uint8Array(expected.buffer)) === 0;
27114
27115 // 7.5 For all other Object pairs, including Array objects, equivalence is
27116 // determined by having the same number of owned properties (as verified
27117 // with Object.prototype.hasOwnProperty.call), the same set of keys
27118 // (although not necessarily the same order), equivalent values for every
27119 // corresponding key, and an identical 'prototype' property. Note: this
27120 // accounts for both named and indexed properties on Arrays.
27121 } else if (isBuffer(actual) !== isBuffer(expected)) {
27122 return false;
27123 } else {
27124 memos = memos || {actual: [], expected: []};
27125
27126 var actualIndex = memos.actual.indexOf(actual);
27127 if (actualIndex !== -1) {
27128 if (actualIndex === memos.expected.indexOf(expected)) {
27129 return true;
27130 }
27131 }
27132
27133 memos.actual.push(actual);
27134 memos.expected.push(expected);
27135
27136 return objEquiv(actual, expected, strict, memos);
27137 }
27138}
27139
27140function isArguments(object) {
27141 return Object.prototype.toString.call(object) == '[object Arguments]';
27142}
27143
27144function objEquiv(a, b, strict, actualVisitedObjects) {
27145 if (a === null || a === undefined || b === null || b === undefined)
27146 return false;
27147 // if one is a primitive, the other must be same
27148 if (util.isPrimitive(a) || util.isPrimitive(b))
27149 return a === b;
27150 if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
27151 return false;
27152 var aIsArgs = isArguments(a);
27153 var bIsArgs = isArguments(b);
27154 if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
27155 return false;
27156 if (aIsArgs) {
27157 a = pSlice.call(a);
27158 b = pSlice.call(b);
27159 return _deepEqual(a, b, strict);
27160 }
27161 var ka = objectKeys(a);
27162 var kb = objectKeys(b);
27163 var key, i;
27164 // having the same number of owned properties (keys incorporates
27165 // hasOwnProperty)
27166 if (ka.length !== kb.length)
27167 return false;
27168 //the same set of keys (although not necessarily the same order),
27169 ka.sort();
27170 kb.sort();
27171 //~~~cheap key test
27172 for (i = ka.length - 1; i >= 0; i--) {
27173 if (ka[i] !== kb[i])
27174 return false;
27175 }
27176 //equivalent values for every corresponding key, and
27177 //~~~possibly expensive deep test
27178 for (i = ka.length - 1; i >= 0; i--) {
27179 key = ka[i];
27180 if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))
27181 return false;
27182 }
27183 return true;
27184}
27185
27186// 8. The non-equivalence assertion tests for any deep inequality.
27187// assert.notDeepEqual(actual, expected, message_opt);
27188
27189assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
27190 if (_deepEqual(actual, expected, false)) {
27191 fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
27192 }
27193};
27194
27195assert.notDeepStrictEqual = notDeepStrictEqual;
27196function notDeepStrictEqual(actual, expected, message) {
27197 if (_deepEqual(actual, expected, true)) {
27198 fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
27199 }
27200}
27201
27202
27203// 9. The strict equality assertion tests strict equality, as determined by ===.
27204// assert.strictEqual(actual, expected, message_opt);
27205
27206assert.strictEqual = function strictEqual(actual, expected, message) {
27207 if (actual !== expected) {
27208 fail(actual, expected, message, '===', assert.strictEqual);
27209 }
27210};
27211
27212// 10. The strict non-equality assertion tests for strict inequality, as
27213// determined by !==. assert.notStrictEqual(actual, expected, message_opt);
27214
27215assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
27216 if (actual === expected) {
27217 fail(actual, expected, message, '!==', assert.notStrictEqual);
27218 }
27219};
27220
27221function expectedException(actual, expected) {
27222 if (!actual || !expected) {
27223 return false;
27224 }
27225
27226 if (Object.prototype.toString.call(expected) == '[object RegExp]') {
27227 return expected.test(actual);
27228 }
27229
27230 try {
27231 if (actual instanceof expected) {
27232 return true;
27233 }
27234 } catch (e) {
27235 // Ignore. The instanceof check doesn't work for arrow functions.
27236 }
27237
27238 if (Error.isPrototypeOf(expected)) {
27239 return false;
27240 }
27241
27242 return expected.call({}, actual) === true;
27243}
27244
27245function _tryBlock(block) {
27246 var error;
27247 try {
27248 block();
27249 } catch (e) {
27250 error = e;
27251 }
27252 return error;
27253}
27254
27255function _throws(shouldThrow, block, expected, message) {
27256 var actual;
27257
27258 if (typeof block !== 'function') {
27259 throw new TypeError('"block" argument must be a function');
27260 }
27261
27262 if (typeof expected === 'string') {
27263 message = expected;
27264 expected = null;
27265 }
27266
27267 actual = _tryBlock(block);
27268
27269 message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
27270 (message ? ' ' + message : '.');
27271
27272 if (shouldThrow && !actual) {
27273 fail(actual, expected, 'Missing expected exception' + message);
27274 }
27275
27276 var userProvidedMessage = typeof message === 'string';
27277 var isUnwantedException = !shouldThrow && util.isError(actual);
27278 var isUnexpectedException = !shouldThrow && actual && !expected;
27279
27280 if ((isUnwantedException &&
27281 userProvidedMessage &&
27282 expectedException(actual, expected)) ||
27283 isUnexpectedException) {
27284 fail(actual, expected, 'Got unwanted exception' + message);
27285 }
27286
27287 if ((shouldThrow && actual && expected &&
27288 !expectedException(actual, expected)) || (!shouldThrow && actual)) {
27289 throw actual;
27290 }
27291}
27292
27293// 11. Expected to throw an error:
27294// assert.throws(block, Error_opt, message_opt);
27295
27296assert.throws = function(block, /*optional*/error, /*optional*/message) {
27297 _throws(true, block, error, message);
27298};
27299
27300// EXTENSION! This is annoying to write outside this module.
27301assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
27302 _throws(false, block, error, message);
27303};
27304
27305assert.ifError = function(err) { if (err) throw err; };
27306
27307var objectKeys = Object.keys || function (obj) {
27308 var keys = [];
27309 for (var key in obj) {
27310 if (hasOwn.call(obj, key)) keys.push(key);
27311 }
27312 return keys;
27313};
27314
27315}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
27316},{"util/":33}],2:[function(require,module,exports){
27317'use strict'
27318
27319exports.byteLength = byteLength
27320exports.toByteArray = toByteArray
27321exports.fromByteArray = fromByteArray
27322
27323var lookup = []
27324var revLookup = []
27325var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
27326
27327var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
27328for (var i = 0, len = code.length; i < len; ++i) {
27329 lookup[i] = code[i]
27330 revLookup[code.charCodeAt(i)] = i
27331}
27332
27333revLookup['-'.charCodeAt(0)] = 62
27334revLookup['_'.charCodeAt(0)] = 63
27335
27336function placeHoldersCount (b64) {
27337 var len = b64.length
27338 if (len % 4 > 0) {
27339 throw new Error('Invalid string. Length must be a multiple of 4')
27340 }
27341
27342 // the number of equal signs (place holders)
27343 // if there are two placeholders, than the two characters before it
27344 // represent one byte
27345 // if there is only one, then the three characters before it represent 2 bytes
27346 // this is just a cheap hack to not do indexOf twice
27347 return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
27348}
27349
27350function byteLength (b64) {
27351 // base64 is 4/3 + up to two characters of the original data
27352 return b64.length * 3 / 4 - placeHoldersCount(b64)
27353}
27354
27355function toByteArray (b64) {
27356 var i, j, l, tmp, placeHolders, arr
27357 var len = b64.length
27358 placeHolders = placeHoldersCount(b64)
27359
27360 arr = new Arr(len * 3 / 4 - placeHolders)
27361
27362 // if there are placeholders, only get up to the last complete 4 chars
27363 l = placeHolders > 0 ? len - 4 : len
27364
27365 var L = 0
27366
27367 for (i = 0, j = 0; i < l; i += 4, j += 3) {
27368 tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
27369 arr[L++] = (tmp >> 16) & 0xFF
27370 arr[L++] = (tmp >> 8) & 0xFF
27371 arr[L++] = tmp & 0xFF
27372 }
27373
27374 if (placeHolders === 2) {
27375 tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
27376 arr[L++] = tmp & 0xFF
27377 } else if (placeHolders === 1) {
27378 tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
27379 arr[L++] = (tmp >> 8) & 0xFF
27380 arr[L++] = tmp & 0xFF
27381 }
27382
27383 return arr
27384}
27385
27386function tripletToBase64 (num) {
27387 return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
27388}
27389
27390function encodeChunk (uint8, start, end) {
27391 var tmp
27392 var output = []
27393 for (var i = start; i < end; i += 3) {
27394 tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
27395 output.push(tripletToBase64(tmp))
27396 }
27397 return output.join('')
27398}
27399
27400function fromByteArray (uint8) {
27401 var tmp
27402 var len = uint8.length
27403 var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
27404 var output = ''
27405 var parts = []
27406 var maxChunkLength = 16383 // must be multiple of 3
27407
27408 // go through the array every three bytes, we'll deal with trailing stuff later
27409 for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
27410 parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
27411 }
27412
27413 // pad the end with zeros, but make sure to not forget the extra bytes
27414 if (extraBytes === 1) {
27415 tmp = uint8[len - 1]
27416 output += lookup[tmp >> 2]
27417 output += lookup[(tmp << 4) & 0x3F]
27418 output += '=='
27419 } else if (extraBytes === 2) {
27420 tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
27421 output += lookup[tmp >> 10]
27422 output += lookup[(tmp >> 4) & 0x3F]
27423 output += lookup[(tmp << 2) & 0x3F]
27424 output += '='
27425 }
27426
27427 parts.push(output)
27428
27429 return parts.join('')
27430}
27431
27432},{}],3:[function(require,module,exports){
27433
27434},{}],4:[function(require,module,exports){
27435(function (global){
27436'use strict';
27437
27438var buffer = require('buffer');
27439var Buffer = buffer.Buffer;
27440var SlowBuffer = buffer.SlowBuffer;
27441var MAX_LEN = buffer.kMaxLength || 2147483647;
27442exports.alloc = function alloc(size, fill, encoding) {
27443 if (typeof Buffer.alloc === 'function') {
27444 return Buffer.alloc(size, fill, encoding);
27445 }
27446 if (typeof encoding === 'number') {
27447 throw new TypeError('encoding must not be number');
27448 }
27449 if (typeof size !== 'number') {
27450 throw new TypeError('size must be a number');
27451 }
27452 if (size > MAX_LEN) {
27453 throw new RangeError('size is too large');
27454 }
27455 var enc = encoding;
27456 var _fill = fill;
27457 if (_fill === undefined) {
27458 enc = undefined;
27459 _fill = 0;
27460 }
27461 var buf = new Buffer(size);
27462 if (typeof _fill === 'string') {
27463 var fillBuf = new Buffer(_fill, enc);
27464 var flen = fillBuf.length;
27465 var i = -1;
27466 while (++i < size) {
27467 buf[i] = fillBuf[i % flen];
27468 }
27469 } else {
27470 buf.fill(_fill);
27471 }
27472 return buf;
27473}
27474exports.allocUnsafe = function allocUnsafe(size) {
27475 if (typeof Buffer.allocUnsafe === 'function') {
27476 return Buffer.allocUnsafe(size);
27477 }
27478 if (typeof size !== 'number') {
27479 throw new TypeError('size must be a number');
27480 }
27481 if (size > MAX_LEN) {
27482 throw new RangeError('size is too large');
27483 }
27484 return new Buffer(size);
27485}
27486exports.from = function from(value, encodingOrOffset, length) {
27487 if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {
27488 return Buffer.from(value, encodingOrOffset, length);
27489 }
27490 if (typeof value === 'number') {
27491 throw new TypeError('"value" argument must not be a number');
27492 }
27493 if (typeof value === 'string') {
27494 return new Buffer(value, encodingOrOffset);
27495 }
27496 if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
27497 var offset = encodingOrOffset;
27498 if (arguments.length === 1) {
27499 return new Buffer(value);
27500 }
27501 if (typeof offset === 'undefined') {
27502 offset = 0;
27503 }
27504 var len = length;
27505 if (typeof len === 'undefined') {
27506 len = value.byteLength - offset;
27507 }
27508 if (offset >= value.byteLength) {
27509 throw new RangeError('\'offset\' is out of bounds');
27510 }
27511 if (len > value.byteLength - offset) {
27512 throw new RangeError('\'length\' is out of bounds');
27513 }
27514 return new Buffer(value.slice(offset, offset + len));
27515 }
27516 if (Buffer.isBuffer(value)) {
27517 var out = new Buffer(value.length);
27518 value.copy(out, 0, 0, value.length);
27519 return out;
27520 }
27521 if (value) {
27522 if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) {
27523 return new Buffer(value);
27524 }
27525 if (value.type === 'Buffer' && Array.isArray(value.data)) {
27526 return new Buffer(value.data);
27527 }
27528 }
27529
27530 throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');
27531}
27532exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
27533 if (typeof Buffer.allocUnsafeSlow === 'function') {
27534 return Buffer.allocUnsafeSlow(size);
27535 }
27536 if (typeof size !== 'number') {
27537 throw new TypeError('size must be a number');
27538 }
27539 if (size >= MAX_LEN) {
27540 throw new RangeError('size is too large');
27541 }
27542 return new SlowBuffer(size);
27543}
27544
27545}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
27546},{"buffer":5}],5:[function(require,module,exports){
27547/*!
27548 * The buffer module from node.js, for the browser.
27549 *
27550 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
27551 * @license MIT
27552 */
27553/* eslint-disable no-proto */
27554
27555'use strict'
27556
27557var base64 = require('base64-js')
27558var ieee754 = require('ieee754')
27559
27560exports.Buffer = Buffer
27561exports.SlowBuffer = SlowBuffer
27562exports.INSPECT_MAX_BYTES = 50
27563
27564var K_MAX_LENGTH = 0x7fffffff
27565exports.kMaxLength = K_MAX_LENGTH
27566
27567/**
27568 * If `Buffer.TYPED_ARRAY_SUPPORT`:
27569 * === true Use Uint8Array implementation (fastest)
27570 * === false Print warning and recommend using `buffer` v4.x which has an Object
27571 * implementation (most compatible, even IE6)
27572 *
27573 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
27574 * Opera 11.6+, iOS 4.2+.
27575 *
27576 * We report that the browser does not support typed arrays if the are not subclassable
27577 * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
27578 * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
27579 * for __proto__ and has a buggy typed array implementation.
27580 */
27581Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
27582
27583if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
27584 typeof console.error === 'function') {
27585 console.error(
27586 'This browser lacks typed array (Uint8Array) support which is required by ' +
27587 '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
27588 )
27589}
27590
27591function typedArraySupport () {
27592 // Can typed array instances can be augmented?
27593 try {
27594 var arr = new Uint8Array(1)
27595 arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
27596 return arr.foo() === 42
27597 } catch (e) {
27598 return false
27599 }
27600}
27601
27602function createBuffer (length) {
27603 if (length > K_MAX_LENGTH) {
27604 throw new RangeError('Invalid typed array length')
27605 }
27606 // Return an augmented `Uint8Array` instance
27607 var buf = new Uint8Array(length)
27608 buf.__proto__ = Buffer.prototype
27609 return buf
27610}
27611
27612/**
27613 * The Buffer constructor returns instances of `Uint8Array` that have their
27614 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
27615 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
27616 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
27617 * returns a single octet.
27618 *
27619 * The `Uint8Array` prototype remains unmodified.
27620 */
27621
27622function Buffer (arg, encodingOrOffset, length) {
27623 // Common case.
27624 if (typeof arg === 'number') {
27625 if (typeof encodingOrOffset === 'string') {
27626 throw new Error(
27627 'If encoding is specified then the first argument must be a string'
27628 )
27629 }
27630 return allocUnsafe(arg)
27631 }
27632 return from(arg, encodingOrOffset, length)
27633}
27634
27635// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
27636if (typeof Symbol !== 'undefined' && Symbol.species &&
27637 Buffer[Symbol.species] === Buffer) {
27638 Object.defineProperty(Buffer, Symbol.species, {
27639 value: null,
27640 configurable: true,
27641 enumerable: false,
27642 writable: false
27643 })
27644}
27645
27646Buffer.poolSize = 8192 // not used by this implementation
27647
27648function from (value, encodingOrOffset, length) {
27649 if (typeof value === 'number') {
27650 throw new TypeError('"value" argument must not be a number')
27651 }
27652
27653 if (value instanceof ArrayBuffer) {
27654 return fromArrayBuffer(value, encodingOrOffset, length)
27655 }
27656
27657 if (typeof value === 'string') {
27658 return fromString(value, encodingOrOffset)
27659 }
27660
27661 return fromObject(value)
27662}
27663
27664/**
27665 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
27666 * if value is a number.
27667 * Buffer.from(str[, encoding])
27668 * Buffer.from(array)
27669 * Buffer.from(buffer)
27670 * Buffer.from(arrayBuffer[, byteOffset[, length]])
27671 **/
27672Buffer.from = function (value, encodingOrOffset, length) {
27673 return from(value, encodingOrOffset, length)
27674}
27675
27676// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
27677// https://github.com/feross/buffer/pull/148
27678Buffer.prototype.__proto__ = Uint8Array.prototype
27679Buffer.__proto__ = Uint8Array
27680
27681function assertSize (size) {
27682 if (typeof size !== 'number') {
27683 throw new TypeError('"size" argument must be a number')
27684 } else if (size < 0) {
27685 throw new RangeError('"size" argument must not be negative')
27686 }
27687}
27688
27689function alloc (size, fill, encoding) {
27690 assertSize(size)
27691 if (size <= 0) {
27692 return createBuffer(size)
27693 }
27694 if (fill !== undefined) {
27695 // Only pay attention to encoding if it's a string. This
27696 // prevents accidentally sending in a number that would
27697 // be interpretted as a start offset.
27698 return typeof encoding === 'string'
27699 ? createBuffer(size).fill(fill, encoding)
27700 : createBuffer(size).fill(fill)
27701 }
27702 return createBuffer(size)
27703}
27704
27705/**
27706 * Creates a new filled Buffer instance.
27707 * alloc(size[, fill[, encoding]])
27708 **/
27709Buffer.alloc = function (size, fill, encoding) {
27710 return alloc(size, fill, encoding)
27711}
27712
27713function allocUnsafe (size) {
27714 assertSize(size)
27715 return createBuffer(size < 0 ? 0 : checked(size) | 0)
27716}
27717
27718/**
27719 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
27720 * */
27721Buffer.allocUnsafe = function (size) {
27722 return allocUnsafe(size)
27723}
27724/**
27725 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
27726 */
27727Buffer.allocUnsafeSlow = function (size) {
27728 return allocUnsafe(size)
27729}
27730
27731function fromString (string, encoding) {
27732 if (typeof encoding !== 'string' || encoding === '') {
27733 encoding = 'utf8'
27734 }
27735
27736 if (!Buffer.isEncoding(encoding)) {
27737 throw new TypeError('"encoding" must be a valid string encoding')
27738 }
27739
27740 var length = byteLength(string, encoding) | 0
27741 var buf = createBuffer(length)
27742
27743 var actual = buf.write(string, encoding)
27744
27745 if (actual !== length) {
27746 // Writing a hex string, for example, that contains invalid characters will
27747 // cause everything after the first invalid character to be ignored. (e.g.
27748 // 'abxxcd' will be treated as 'ab')
27749 buf = buf.slice(0, actual)
27750 }
27751
27752 return buf
27753}
27754
27755function fromArrayLike (array) {
27756 var length = array.length < 0 ? 0 : checked(array.length) | 0
27757 var buf = createBuffer(length)
27758 for (var i = 0; i < length; i += 1) {
27759 buf[i] = array[i] & 255
27760 }
27761 return buf
27762}
27763
27764function fromArrayBuffer (array, byteOffset, length) {
27765 if (byteOffset < 0 || array.byteLength < byteOffset) {
27766 throw new RangeError('\'offset\' is out of bounds')
27767 }
27768
27769 if (array.byteLength < byteOffset + (length || 0)) {
27770 throw new RangeError('\'length\' is out of bounds')
27771 }
27772
27773 var buf
27774 if (byteOffset === undefined && length === undefined) {
27775 buf = new Uint8Array(array)
27776 } else if (length === undefined) {
27777 buf = new Uint8Array(array, byteOffset)
27778 } else {
27779 buf = new Uint8Array(array, byteOffset, length)
27780 }
27781
27782 // Return an augmented `Uint8Array` instance
27783 buf.__proto__ = Buffer.prototype
27784 return buf
27785}
27786
27787function fromObject (obj) {
27788 if (Buffer.isBuffer(obj)) {
27789 var len = checked(obj.length) | 0
27790 var buf = createBuffer(len)
27791
27792 if (buf.length === 0) {
27793 return buf
27794 }
27795
27796 obj.copy(buf, 0, 0, len)
27797 return buf
27798 }
27799
27800 if (obj) {
27801 if (isArrayBufferView(obj) || 'length' in obj) {
27802 if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
27803 return createBuffer(0)
27804 }
27805 return fromArrayLike(obj)
27806 }
27807
27808 if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
27809 return fromArrayLike(obj.data)
27810 }
27811 }
27812
27813 throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
27814}
27815
27816function checked (length) {
27817 // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
27818 // length is NaN (which is otherwise coerced to zero.)
27819 if (length >= K_MAX_LENGTH) {
27820 throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
27821 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
27822 }
27823 return length | 0
27824}
27825
27826function SlowBuffer (length) {
27827 if (+length != length) { // eslint-disable-line eqeqeq
27828 length = 0
27829 }
27830 return Buffer.alloc(+length)
27831}
27832
27833Buffer.isBuffer = function isBuffer (b) {
27834 return b != null && b._isBuffer === true
27835}
27836
27837Buffer.compare = function compare (a, b) {
27838 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
27839 throw new TypeError('Arguments must be Buffers')
27840 }
27841
27842 if (a === b) return 0
27843
27844 var x = a.length
27845 var y = b.length
27846
27847 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
27848 if (a[i] !== b[i]) {
27849 x = a[i]
27850 y = b[i]
27851 break
27852 }
27853 }
27854
27855 if (x < y) return -1
27856 if (y < x) return 1
27857 return 0
27858}
27859
27860Buffer.isEncoding = function isEncoding (encoding) {
27861 switch (String(encoding).toLowerCase()) {
27862 case 'hex':
27863 case 'utf8':
27864 case 'utf-8':
27865 case 'ascii':
27866 case 'latin1':
27867 case 'binary':
27868 case 'base64':
27869 case 'ucs2':
27870 case 'ucs-2':
27871 case 'utf16le':
27872 case 'utf-16le':
27873 return true
27874 default:
27875 return false
27876 }
27877}
27878
27879Buffer.concat = function concat (list, length) {
27880 if (!Array.isArray(list)) {
27881 throw new TypeError('"list" argument must be an Array of Buffers')
27882 }
27883
27884 if (list.length === 0) {
27885 return Buffer.alloc(0)
27886 }
27887
27888 var i
27889 if (length === undefined) {
27890 length = 0
27891 for (i = 0; i < list.length; ++i) {
27892 length += list[i].length
27893 }
27894 }
27895
27896 var buffer = Buffer.allocUnsafe(length)
27897 var pos = 0
27898 for (i = 0; i < list.length; ++i) {
27899 var buf = list[i]
27900 if (!Buffer.isBuffer(buf)) {
27901 throw new TypeError('"list" argument must be an Array of Buffers')
27902 }
27903 buf.copy(buffer, pos)
27904 pos += buf.length
27905 }
27906 return buffer
27907}
27908
27909function byteLength (string, encoding) {
27910 if (Buffer.isBuffer(string)) {
27911 return string.length
27912 }
27913 if (isArrayBufferView(string) || string instanceof ArrayBuffer) {
27914 return string.byteLength
27915 }
27916 if (typeof string !== 'string') {
27917 string = '' + string
27918 }
27919
27920 var len = string.length
27921 if (len === 0) return 0
27922
27923 // Use a for loop to avoid recursion
27924 var loweredCase = false
27925 for (;;) {
27926 switch (encoding) {
27927 case 'ascii':
27928 case 'latin1':
27929 case 'binary':
27930 return len
27931 case 'utf8':
27932 case 'utf-8':
27933 case undefined:
27934 return utf8ToBytes(string).length
27935 case 'ucs2':
27936 case 'ucs-2':
27937 case 'utf16le':
27938 case 'utf-16le':
27939 return len * 2
27940 case 'hex':
27941 return len >>> 1
27942 case 'base64':
27943 return base64ToBytes(string).length
27944 default:
27945 if (loweredCase) return utf8ToBytes(string).length // assume utf8
27946 encoding = ('' + encoding).toLowerCase()
27947 loweredCase = true
27948 }
27949 }
27950}
27951Buffer.byteLength = byteLength
27952
27953function slowToString (encoding, start, end) {
27954 var loweredCase = false
27955
27956 // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
27957 // property of a typed array.
27958
27959 // This behaves neither like String nor Uint8Array in that we set start/end
27960 // to their upper/lower bounds if the value passed is out of range.
27961 // undefined is handled specially as per ECMA-262 6th Edition,
27962 // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
27963 if (start === undefined || start < 0) {
27964 start = 0
27965 }
27966 // Return early if start > this.length. Done here to prevent potential uint32
27967 // coercion fail below.
27968 if (start > this.length) {
27969 return ''
27970 }
27971
27972 if (end === undefined || end > this.length) {
27973 end = this.length
27974 }
27975
27976 if (end <= 0) {
27977 return ''
27978 }
27979
27980 // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
27981 end >>>= 0
27982 start >>>= 0
27983
27984 if (end <= start) {
27985 return ''
27986 }
27987
27988 if (!encoding) encoding = 'utf8'
27989
27990 while (true) {
27991 switch (encoding) {
27992 case 'hex':
27993 return hexSlice(this, start, end)
27994
27995 case 'utf8':
27996 case 'utf-8':
27997 return utf8Slice(this, start, end)
27998
27999 case 'ascii':
28000 return asciiSlice(this, start, end)
28001
28002 case 'latin1':
28003 case 'binary':
28004 return latin1Slice(this, start, end)
28005
28006 case 'base64':
28007 return base64Slice(this, start, end)
28008
28009 case 'ucs2':
28010 case 'ucs-2':
28011 case 'utf16le':
28012 case 'utf-16le':
28013 return utf16leSlice(this, start, end)
28014
28015 default:
28016 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
28017 encoding = (encoding + '').toLowerCase()
28018 loweredCase = true
28019 }
28020 }
28021}
28022
28023// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
28024// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
28025// reliably in a browserify context because there could be multiple different
28026// copies of the 'buffer' package in use. This method works even for Buffer
28027// instances that were created from another copy of the `buffer` package.
28028// See: https://github.com/feross/buffer/issues/154
28029Buffer.prototype._isBuffer = true
28030
28031function swap (b, n, m) {
28032 var i = b[n]
28033 b[n] = b[m]
28034 b[m] = i
28035}
28036
28037Buffer.prototype.swap16 = function swap16 () {
28038 var len = this.length
28039 if (len % 2 !== 0) {
28040 throw new RangeError('Buffer size must be a multiple of 16-bits')
28041 }
28042 for (var i = 0; i < len; i += 2) {
28043 swap(this, i, i + 1)
28044 }
28045 return this
28046}
28047
28048Buffer.prototype.swap32 = function swap32 () {
28049 var len = this.length
28050 if (len % 4 !== 0) {
28051 throw new RangeError('Buffer size must be a multiple of 32-bits')
28052 }
28053 for (var i = 0; i < len; i += 4) {
28054 swap(this, i, i + 3)
28055 swap(this, i + 1, i + 2)
28056 }
28057 return this
28058}
28059
28060Buffer.prototype.swap64 = function swap64 () {
28061 var len = this.length
28062 if (len % 8 !== 0) {
28063 throw new RangeError('Buffer size must be a multiple of 64-bits')
28064 }
28065 for (var i = 0; i < len; i += 8) {
28066 swap(this, i, i + 7)
28067 swap(this, i + 1, i + 6)
28068 swap(this, i + 2, i + 5)
28069 swap(this, i + 3, i + 4)
28070 }
28071 return this
28072}
28073
28074Buffer.prototype.toString = function toString () {
28075 var length = this.length
28076 if (length === 0) return ''
28077 if (arguments.length === 0) return utf8Slice(this, 0, length)
28078 return slowToString.apply(this, arguments)
28079}
28080
28081Buffer.prototype.equals = function equals (b) {
28082 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
28083 if (this === b) return true
28084 return Buffer.compare(this, b) === 0
28085}
28086
28087Buffer.prototype.inspect = function inspect () {
28088 var str = ''
28089 var max = exports.INSPECT_MAX_BYTES
28090 if (this.length > 0) {
28091 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
28092 if (this.length > max) str += ' ... '
28093 }
28094 return '<Buffer ' + str + '>'
28095}
28096
28097Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
28098 if (!Buffer.isBuffer(target)) {
28099 throw new TypeError('Argument must be a Buffer')
28100 }
28101
28102 if (start === undefined) {
28103 start = 0
28104 }
28105 if (end === undefined) {
28106 end = target ? target.length : 0
28107 }
28108 if (thisStart === undefined) {
28109 thisStart = 0
28110 }
28111 if (thisEnd === undefined) {
28112 thisEnd = this.length
28113 }
28114
28115 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
28116 throw new RangeError('out of range index')
28117 }
28118
28119 if (thisStart >= thisEnd && start >= end) {
28120 return 0
28121 }
28122 if (thisStart >= thisEnd) {
28123 return -1
28124 }
28125 if (start >= end) {
28126 return 1
28127 }
28128
28129 start >>>= 0
28130 end >>>= 0
28131 thisStart >>>= 0
28132 thisEnd >>>= 0
28133
28134 if (this === target) return 0
28135
28136 var x = thisEnd - thisStart
28137 var y = end - start
28138 var len = Math.min(x, y)
28139
28140 var thisCopy = this.slice(thisStart, thisEnd)
28141 var targetCopy = target.slice(start, end)
28142
28143 for (var i = 0; i < len; ++i) {
28144 if (thisCopy[i] !== targetCopy[i]) {
28145 x = thisCopy[i]
28146 y = targetCopy[i]
28147 break
28148 }
28149 }
28150
28151 if (x < y) return -1
28152 if (y < x) return 1
28153 return 0
28154}
28155
28156// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
28157// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
28158//
28159// Arguments:
28160// - buffer - a Buffer to search
28161// - val - a string, Buffer, or number
28162// - byteOffset - an index into `buffer`; will be clamped to an int32
28163// - encoding - an optional encoding, relevant is val is a string
28164// - dir - true for indexOf, false for lastIndexOf
28165function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
28166 // Empty buffer means no match
28167 if (buffer.length === 0) return -1
28168
28169 // Normalize byteOffset
28170 if (typeof byteOffset === 'string') {
28171 encoding = byteOffset
28172 byteOffset = 0
28173 } else if (byteOffset > 0x7fffffff) {
28174 byteOffset = 0x7fffffff
28175 } else if (byteOffset < -0x80000000) {
28176 byteOffset = -0x80000000
28177 }
28178 byteOffset = +byteOffset // Coerce to Number.
28179 if (numberIsNaN(byteOffset)) {
28180 // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
28181 byteOffset = dir ? 0 : (buffer.length - 1)
28182 }
28183
28184 // Normalize byteOffset: negative offsets start from the end of the buffer
28185 if (byteOffset < 0) byteOffset = buffer.length + byteOffset
28186 if (byteOffset >= buffer.length) {
28187 if (dir) return -1
28188 else byteOffset = buffer.length - 1
28189 } else if (byteOffset < 0) {
28190 if (dir) byteOffset = 0
28191 else return -1
28192 }
28193
28194 // Normalize val
28195 if (typeof val === 'string') {
28196 val = Buffer.from(val, encoding)
28197 }
28198
28199 // Finally, search either indexOf (if dir is true) or lastIndexOf
28200 if (Buffer.isBuffer(val)) {
28201 // Special case: looking for empty string/buffer always fails
28202 if (val.length === 0) {
28203 return -1
28204 }
28205 return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
28206 } else if (typeof val === 'number') {
28207 val = val & 0xFF // Search for a byte value [0-255]
28208 if (typeof Uint8Array.prototype.indexOf === 'function') {
28209 if (dir) {
28210 return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
28211 } else {
28212 return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
28213 }
28214 }
28215 return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
28216 }
28217
28218 throw new TypeError('val must be string, number or Buffer')
28219}
28220
28221function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
28222 var indexSize = 1
28223 var arrLength = arr.length
28224 var valLength = val.length
28225
28226 if (encoding !== undefined) {
28227 encoding = String(encoding).toLowerCase()
28228 if (encoding === 'ucs2' || encoding === 'ucs-2' ||
28229 encoding === 'utf16le' || encoding === 'utf-16le') {
28230 if (arr.length < 2 || val.length < 2) {
28231 return -1
28232 }
28233 indexSize = 2
28234 arrLength /= 2
28235 valLength /= 2
28236 byteOffset /= 2
28237 }
28238 }
28239
28240 function read (buf, i) {
28241 if (indexSize === 1) {
28242 return buf[i]
28243 } else {
28244 return buf.readUInt16BE(i * indexSize)
28245 }
28246 }
28247
28248 var i
28249 if (dir) {
28250 var foundIndex = -1
28251 for (i = byteOffset; i < arrLength; i++) {
28252 if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
28253 if (foundIndex === -1) foundIndex = i
28254 if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
28255 } else {
28256 if (foundIndex !== -1) i -= i - foundIndex
28257 foundIndex = -1
28258 }
28259 }
28260 } else {
28261 if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
28262 for (i = byteOffset; i >= 0; i--) {
28263 var found = true
28264 for (var j = 0; j < valLength; j++) {
28265 if (read(arr, i + j) !== read(val, j)) {
28266 found = false
28267 break
28268 }
28269 }
28270 if (found) return i
28271 }
28272 }
28273
28274 return -1
28275}
28276
28277Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
28278 return this.indexOf(val, byteOffset, encoding) !== -1
28279}
28280
28281Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
28282 return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
28283}
28284
28285Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
28286 return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
28287}
28288
28289function hexWrite (buf, string, offset, length) {
28290 offset = Number(offset) || 0
28291 var remaining = buf.length - offset
28292 if (!length) {
28293 length = remaining
28294 } else {
28295 length = Number(length)
28296 if (length > remaining) {
28297 length = remaining
28298 }
28299 }
28300
28301 // must be an even number of digits
28302 var strLen = string.length
28303 if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
28304
28305 if (length > strLen / 2) {
28306 length = strLen / 2
28307 }
28308 for (var i = 0; i < length; ++i) {
28309 var parsed = parseInt(string.substr(i * 2, 2), 16)
28310 if (numberIsNaN(parsed)) return i
28311 buf[offset + i] = parsed
28312 }
28313 return i
28314}
28315
28316function utf8Write (buf, string, offset, length) {
28317 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
28318}
28319
28320function asciiWrite (buf, string, offset, length) {
28321 return blitBuffer(asciiToBytes(string), buf, offset, length)
28322}
28323
28324function latin1Write (buf, string, offset, length) {
28325 return asciiWrite(buf, string, offset, length)
28326}
28327
28328function base64Write (buf, string, offset, length) {
28329 return blitBuffer(base64ToBytes(string), buf, offset, length)
28330}
28331
28332function ucs2Write (buf, string, offset, length) {
28333 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
28334}
28335
28336Buffer.prototype.write = function write (string, offset, length, encoding) {
28337 // Buffer#write(string)
28338 if (offset === undefined) {
28339 encoding = 'utf8'
28340 length = this.length
28341 offset = 0
28342 // Buffer#write(string, encoding)
28343 } else if (length === undefined && typeof offset === 'string') {
28344 encoding = offset
28345 length = this.length
28346 offset = 0
28347 // Buffer#write(string, offset[, length][, encoding])
28348 } else if (isFinite(offset)) {
28349 offset = offset >>> 0
28350 if (isFinite(length)) {
28351 length = length >>> 0
28352 if (encoding === undefined) encoding = 'utf8'
28353 } else {
28354 encoding = length
28355 length = undefined
28356 }
28357 } else {
28358 throw new Error(
28359 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
28360 )
28361 }
28362
28363 var remaining = this.length - offset
28364 if (length === undefined || length > remaining) length = remaining
28365
28366 if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
28367 throw new RangeError('Attempt to write outside buffer bounds')
28368 }
28369
28370 if (!encoding) encoding = 'utf8'
28371
28372 var loweredCase = false
28373 for (;;) {
28374 switch (encoding) {
28375 case 'hex':
28376 return hexWrite(this, string, offset, length)
28377
28378 case 'utf8':
28379 case 'utf-8':
28380 return utf8Write(this, string, offset, length)
28381
28382 case 'ascii':
28383 return asciiWrite(this, string, offset, length)
28384
28385 case 'latin1':
28386 case 'binary':
28387 return latin1Write(this, string, offset, length)
28388
28389 case 'base64':
28390 // Warning: maxLength not taken into account in base64Write
28391 return base64Write(this, string, offset, length)
28392
28393 case 'ucs2':
28394 case 'ucs-2':
28395 case 'utf16le':
28396 case 'utf-16le':
28397 return ucs2Write(this, string, offset, length)
28398
28399 default:
28400 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
28401 encoding = ('' + encoding).toLowerCase()
28402 loweredCase = true
28403 }
28404 }
28405}
28406
28407Buffer.prototype.toJSON = function toJSON () {
28408 return {
28409 type: 'Buffer',
28410 data: Array.prototype.slice.call(this._arr || this, 0)
28411 }
28412}
28413
28414function base64Slice (buf, start, end) {
28415 if (start === 0 && end === buf.length) {
28416 return base64.fromByteArray(buf)
28417 } else {
28418 return base64.fromByteArray(buf.slice(start, end))
28419 }
28420}
28421
28422function utf8Slice (buf, start, end) {
28423 end = Math.min(buf.length, end)
28424 var res = []
28425
28426 var i = start
28427 while (i < end) {
28428 var firstByte = buf[i]
28429 var codePoint = null
28430 var bytesPerSequence = (firstByte > 0xEF) ? 4
28431 : (firstByte > 0xDF) ? 3
28432 : (firstByte > 0xBF) ? 2
28433 : 1
28434
28435 if (i + bytesPerSequence <= end) {
28436 var secondByte, thirdByte, fourthByte, tempCodePoint
28437
28438 switch (bytesPerSequence) {
28439 case 1:
28440 if (firstByte < 0x80) {
28441 codePoint = firstByte
28442 }
28443 break
28444 case 2:
28445 secondByte = buf[i + 1]
28446 if ((secondByte & 0xC0) === 0x80) {
28447 tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
28448 if (tempCodePoint > 0x7F) {
28449 codePoint = tempCodePoint
28450 }
28451 }
28452 break
28453 case 3:
28454 secondByte = buf[i + 1]
28455 thirdByte = buf[i + 2]
28456 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
28457 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
28458 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
28459 codePoint = tempCodePoint
28460 }
28461 }
28462 break
28463 case 4:
28464 secondByte = buf[i + 1]
28465 thirdByte = buf[i + 2]
28466 fourthByte = buf[i + 3]
28467 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
28468 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
28469 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
28470 codePoint = tempCodePoint
28471 }
28472 }
28473 }
28474 }
28475
28476 if (codePoint === null) {
28477 // we did not generate a valid codePoint so insert a
28478 // replacement char (U+FFFD) and advance only 1 byte
28479 codePoint = 0xFFFD
28480 bytesPerSequence = 1
28481 } else if (codePoint > 0xFFFF) {
28482 // encode to utf16 (surrogate pair dance)
28483 codePoint -= 0x10000
28484 res.push(codePoint >>> 10 & 0x3FF | 0xD800)
28485 codePoint = 0xDC00 | codePoint & 0x3FF
28486 }
28487
28488 res.push(codePoint)
28489 i += bytesPerSequence
28490 }
28491
28492 return decodeCodePointsArray(res)
28493}
28494
28495// Based on http://stackoverflow.com/a/22747272/680742, the browser with
28496// the lowest limit is Chrome, with 0x10000 args.
28497// We go 1 magnitude less, for safety
28498var MAX_ARGUMENTS_LENGTH = 0x1000
28499
28500function decodeCodePointsArray (codePoints) {
28501 var len = codePoints.length
28502 if (len <= MAX_ARGUMENTS_LENGTH) {
28503 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
28504 }
28505
28506 // Decode in chunks to avoid "call stack size exceeded".
28507 var res = ''
28508 var i = 0
28509 while (i < len) {
28510 res += String.fromCharCode.apply(
28511 String,
28512 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
28513 )
28514 }
28515 return res
28516}
28517
28518function asciiSlice (buf, start, end) {
28519 var ret = ''
28520 end = Math.min(buf.length, end)
28521
28522 for (var i = start; i < end; ++i) {
28523 ret += String.fromCharCode(buf[i] & 0x7F)
28524 }
28525 return ret
28526}
28527
28528function latin1Slice (buf, start, end) {
28529 var ret = ''
28530 end = Math.min(buf.length, end)
28531
28532 for (var i = start; i < end; ++i) {
28533 ret += String.fromCharCode(buf[i])
28534 }
28535 return ret
28536}
28537
28538function hexSlice (buf, start, end) {
28539 var len = buf.length
28540
28541 if (!start || start < 0) start = 0
28542 if (!end || end < 0 || end > len) end = len
28543
28544 var out = ''
28545 for (var i = start; i < end; ++i) {
28546 out += toHex(buf[i])
28547 }
28548 return out
28549}
28550
28551function utf16leSlice (buf, start, end) {
28552 var bytes = buf.slice(start, end)
28553 var res = ''
28554 for (var i = 0; i < bytes.length; i += 2) {
28555 res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
28556 }
28557 return res
28558}
28559
28560Buffer.prototype.slice = function slice (start, end) {
28561 var len = this.length
28562 start = ~~start
28563 end = end === undefined ? len : ~~end
28564
28565 if (start < 0) {
28566 start += len
28567 if (start < 0) start = 0
28568 } else if (start > len) {
28569 start = len
28570 }
28571
28572 if (end < 0) {
28573 end += len
28574 if (end < 0) end = 0
28575 } else if (end > len) {
28576 end = len
28577 }
28578
28579 if (end < start) end = start
28580
28581 var newBuf = this.subarray(start, end)
28582 // Return an augmented `Uint8Array` instance
28583 newBuf.__proto__ = Buffer.prototype
28584 return newBuf
28585}
28586
28587/*
28588 * Need to make sure that buffer isn't trying to write out of bounds.
28589 */
28590function checkOffset (offset, ext, length) {
28591 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
28592 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
28593}
28594
28595Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
28596 offset = offset >>> 0
28597 byteLength = byteLength >>> 0
28598 if (!noAssert) checkOffset(offset, byteLength, this.length)
28599
28600 var val = this[offset]
28601 var mul = 1
28602 var i = 0
28603 while (++i < byteLength && (mul *= 0x100)) {
28604 val += this[offset + i] * mul
28605 }
28606
28607 return val
28608}
28609
28610Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
28611 offset = offset >>> 0
28612 byteLength = byteLength >>> 0
28613 if (!noAssert) {
28614 checkOffset(offset, byteLength, this.length)
28615 }
28616
28617 var val = this[offset + --byteLength]
28618 var mul = 1
28619 while (byteLength > 0 && (mul *= 0x100)) {
28620 val += this[offset + --byteLength] * mul
28621 }
28622
28623 return val
28624}
28625
28626Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
28627 offset = offset >>> 0
28628 if (!noAssert) checkOffset(offset, 1, this.length)
28629 return this[offset]
28630}
28631
28632Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
28633 offset = offset >>> 0
28634 if (!noAssert) checkOffset(offset, 2, this.length)
28635 return this[offset] | (this[offset + 1] << 8)
28636}
28637
28638Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
28639 offset = offset >>> 0
28640 if (!noAssert) checkOffset(offset, 2, this.length)
28641 return (this[offset] << 8) | this[offset + 1]
28642}
28643
28644Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
28645 offset = offset >>> 0
28646 if (!noAssert) checkOffset(offset, 4, this.length)
28647
28648 return ((this[offset]) |
28649 (this[offset + 1] << 8) |
28650 (this[offset + 2] << 16)) +
28651 (this[offset + 3] * 0x1000000)
28652}
28653
28654Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
28655 offset = offset >>> 0
28656 if (!noAssert) checkOffset(offset, 4, this.length)
28657
28658 return (this[offset] * 0x1000000) +
28659 ((this[offset + 1] << 16) |
28660 (this[offset + 2] << 8) |
28661 this[offset + 3])
28662}
28663
28664Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
28665 offset = offset >>> 0
28666 byteLength = byteLength >>> 0
28667 if (!noAssert) checkOffset(offset, byteLength, this.length)
28668
28669 var val = this[offset]
28670 var mul = 1
28671 var i = 0
28672 while (++i < byteLength && (mul *= 0x100)) {
28673 val += this[offset + i] * mul
28674 }
28675 mul *= 0x80
28676
28677 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
28678
28679 return val
28680}
28681
28682Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
28683 offset = offset >>> 0
28684 byteLength = byteLength >>> 0
28685 if (!noAssert) checkOffset(offset, byteLength, this.length)
28686
28687 var i = byteLength
28688 var mul = 1
28689 var val = this[offset + --i]
28690 while (i > 0 && (mul *= 0x100)) {
28691 val += this[offset + --i] * mul
28692 }
28693 mul *= 0x80
28694
28695 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
28696
28697 return val
28698}
28699
28700Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
28701 offset = offset >>> 0
28702 if (!noAssert) checkOffset(offset, 1, this.length)
28703 if (!(this[offset] & 0x80)) return (this[offset])
28704 return ((0xff - this[offset] + 1) * -1)
28705}
28706
28707Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
28708 offset = offset >>> 0
28709 if (!noAssert) checkOffset(offset, 2, this.length)
28710 var val = this[offset] | (this[offset + 1] << 8)
28711 return (val & 0x8000) ? val | 0xFFFF0000 : val
28712}
28713
28714Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
28715 offset = offset >>> 0
28716 if (!noAssert) checkOffset(offset, 2, this.length)
28717 var val = this[offset + 1] | (this[offset] << 8)
28718 return (val & 0x8000) ? val | 0xFFFF0000 : val
28719}
28720
28721Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
28722 offset = offset >>> 0
28723 if (!noAssert) checkOffset(offset, 4, this.length)
28724
28725 return (this[offset]) |
28726 (this[offset + 1] << 8) |
28727 (this[offset + 2] << 16) |
28728 (this[offset + 3] << 24)
28729}
28730
28731Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
28732 offset = offset >>> 0
28733 if (!noAssert) checkOffset(offset, 4, this.length)
28734
28735 return (this[offset] << 24) |
28736 (this[offset + 1] << 16) |
28737 (this[offset + 2] << 8) |
28738 (this[offset + 3])
28739}
28740
28741Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
28742 offset = offset >>> 0
28743 if (!noAssert) checkOffset(offset, 4, this.length)
28744 return ieee754.read(this, offset, true, 23, 4)
28745}
28746
28747Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
28748 offset = offset >>> 0
28749 if (!noAssert) checkOffset(offset, 4, this.length)
28750 return ieee754.read(this, offset, false, 23, 4)
28751}
28752
28753Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
28754 offset = offset >>> 0
28755 if (!noAssert) checkOffset(offset, 8, this.length)
28756 return ieee754.read(this, offset, true, 52, 8)
28757}
28758
28759Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
28760 offset = offset >>> 0
28761 if (!noAssert) checkOffset(offset, 8, this.length)
28762 return ieee754.read(this, offset, false, 52, 8)
28763}
28764
28765function checkInt (buf, value, offset, ext, max, min) {
28766 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
28767 if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
28768 if (offset + ext > buf.length) throw new RangeError('Index out of range')
28769}
28770
28771Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
28772 value = +value
28773 offset = offset >>> 0
28774 byteLength = byteLength >>> 0
28775 if (!noAssert) {
28776 var maxBytes = Math.pow(2, 8 * byteLength) - 1
28777 checkInt(this, value, offset, byteLength, maxBytes, 0)
28778 }
28779
28780 var mul = 1
28781 var i = 0
28782 this[offset] = value & 0xFF
28783 while (++i < byteLength && (mul *= 0x100)) {
28784 this[offset + i] = (value / mul) & 0xFF
28785 }
28786
28787 return offset + byteLength
28788}
28789
28790Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
28791 value = +value
28792 offset = offset >>> 0
28793 byteLength = byteLength >>> 0
28794 if (!noAssert) {
28795 var maxBytes = Math.pow(2, 8 * byteLength) - 1
28796 checkInt(this, value, offset, byteLength, maxBytes, 0)
28797 }
28798
28799 var i = byteLength - 1
28800 var mul = 1
28801 this[offset + i] = value & 0xFF
28802 while (--i >= 0 && (mul *= 0x100)) {
28803 this[offset + i] = (value / mul) & 0xFF
28804 }
28805
28806 return offset + byteLength
28807}
28808
28809Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
28810 value = +value
28811 offset = offset >>> 0
28812 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
28813 this[offset] = (value & 0xff)
28814 return offset + 1
28815}
28816
28817Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
28818 value = +value
28819 offset = offset >>> 0
28820 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
28821 this[offset] = (value & 0xff)
28822 this[offset + 1] = (value >>> 8)
28823 return offset + 2
28824}
28825
28826Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
28827 value = +value
28828 offset = offset >>> 0
28829 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
28830 this[offset] = (value >>> 8)
28831 this[offset + 1] = (value & 0xff)
28832 return offset + 2
28833}
28834
28835Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
28836 value = +value
28837 offset = offset >>> 0
28838 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
28839 this[offset + 3] = (value >>> 24)
28840 this[offset + 2] = (value >>> 16)
28841 this[offset + 1] = (value >>> 8)
28842 this[offset] = (value & 0xff)
28843 return offset + 4
28844}
28845
28846Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
28847 value = +value
28848 offset = offset >>> 0
28849 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
28850 this[offset] = (value >>> 24)
28851 this[offset + 1] = (value >>> 16)
28852 this[offset + 2] = (value >>> 8)
28853 this[offset + 3] = (value & 0xff)
28854 return offset + 4
28855}
28856
28857Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
28858 value = +value
28859 offset = offset >>> 0
28860 if (!noAssert) {
28861 var limit = Math.pow(2, (8 * byteLength) - 1)
28862
28863 checkInt(this, value, offset, byteLength, limit - 1, -limit)
28864 }
28865
28866 var i = 0
28867 var mul = 1
28868 var sub = 0
28869 this[offset] = value & 0xFF
28870 while (++i < byteLength && (mul *= 0x100)) {
28871 if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
28872 sub = 1
28873 }
28874 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
28875 }
28876
28877 return offset + byteLength
28878}
28879
28880Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
28881 value = +value
28882 offset = offset >>> 0
28883 if (!noAssert) {
28884 var limit = Math.pow(2, (8 * byteLength) - 1)
28885
28886 checkInt(this, value, offset, byteLength, limit - 1, -limit)
28887 }
28888
28889 var i = byteLength - 1
28890 var mul = 1
28891 var sub = 0
28892 this[offset + i] = value & 0xFF
28893 while (--i >= 0 && (mul *= 0x100)) {
28894 if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
28895 sub = 1
28896 }
28897 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
28898 }
28899
28900 return offset + byteLength
28901}
28902
28903Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
28904 value = +value
28905 offset = offset >>> 0
28906 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
28907 if (value < 0) value = 0xff + value + 1
28908 this[offset] = (value & 0xff)
28909 return offset + 1
28910}
28911
28912Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
28913 value = +value
28914 offset = offset >>> 0
28915 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
28916 this[offset] = (value & 0xff)
28917 this[offset + 1] = (value >>> 8)
28918 return offset + 2
28919}
28920
28921Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
28922 value = +value
28923 offset = offset >>> 0
28924 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
28925 this[offset] = (value >>> 8)
28926 this[offset + 1] = (value & 0xff)
28927 return offset + 2
28928}
28929
28930Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
28931 value = +value
28932 offset = offset >>> 0
28933 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
28934 this[offset] = (value & 0xff)
28935 this[offset + 1] = (value >>> 8)
28936 this[offset + 2] = (value >>> 16)
28937 this[offset + 3] = (value >>> 24)
28938 return offset + 4
28939}
28940
28941Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
28942 value = +value
28943 offset = offset >>> 0
28944 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
28945 if (value < 0) value = 0xffffffff + value + 1
28946 this[offset] = (value >>> 24)
28947 this[offset + 1] = (value >>> 16)
28948 this[offset + 2] = (value >>> 8)
28949 this[offset + 3] = (value & 0xff)
28950 return offset + 4
28951}
28952
28953function checkIEEE754 (buf, value, offset, ext, max, min) {
28954 if (offset + ext > buf.length) throw new RangeError('Index out of range')
28955 if (offset < 0) throw new RangeError('Index out of range')
28956}
28957
28958function writeFloat (buf, value, offset, littleEndian, noAssert) {
28959 value = +value
28960 offset = offset >>> 0
28961 if (!noAssert) {
28962 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
28963 }
28964 ieee754.write(buf, value, offset, littleEndian, 23, 4)
28965 return offset + 4
28966}
28967
28968Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
28969 return writeFloat(this, value, offset, true, noAssert)
28970}
28971
28972Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
28973 return writeFloat(this, value, offset, false, noAssert)
28974}
28975
28976function writeDouble (buf, value, offset, littleEndian, noAssert) {
28977 value = +value
28978 offset = offset >>> 0
28979 if (!noAssert) {
28980 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
28981 }
28982 ieee754.write(buf, value, offset, littleEndian, 52, 8)
28983 return offset + 8
28984}
28985
28986Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
28987 return writeDouble(this, value, offset, true, noAssert)
28988}
28989
28990Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
28991 return writeDouble(this, value, offset, false, noAssert)
28992}
28993
28994// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
28995Buffer.prototype.copy = function copy (target, targetStart, start, end) {
28996 if (!start) start = 0
28997 if (!end && end !== 0) end = this.length
28998 if (targetStart >= target.length) targetStart = target.length
28999 if (!targetStart) targetStart = 0
29000 if (end > 0 && end < start) end = start
29001
29002 // Copy 0 bytes; we're done
29003 if (end === start) return 0
29004 if (target.length === 0 || this.length === 0) return 0
29005
29006 // Fatal error conditions
29007 if (targetStart < 0) {
29008 throw new RangeError('targetStart out of bounds')
29009 }
29010 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
29011 if (end < 0) throw new RangeError('sourceEnd out of bounds')
29012
29013 // Are we oob?
29014 if (end > this.length) end = this.length
29015 if (target.length - targetStart < end - start) {
29016 end = target.length - targetStart + start
29017 }
29018
29019 var len = end - start
29020 var i
29021
29022 if (this === target && start < targetStart && targetStart < end) {
29023 // descending copy from end
29024 for (i = len - 1; i >= 0; --i) {
29025 target[i + targetStart] = this[i + start]
29026 }
29027 } else if (len < 1000) {
29028 // ascending copy from start
29029 for (i = 0; i < len; ++i) {
29030 target[i + targetStart] = this[i + start]
29031 }
29032 } else {
29033 Uint8Array.prototype.set.call(
29034 target,
29035 this.subarray(start, start + len),
29036 targetStart
29037 )
29038 }
29039
29040 return len
29041}
29042
29043// Usage:
29044// buffer.fill(number[, offset[, end]])
29045// buffer.fill(buffer[, offset[, end]])
29046// buffer.fill(string[, offset[, end]][, encoding])
29047Buffer.prototype.fill = function fill (val, start, end, encoding) {
29048 // Handle string cases:
29049 if (typeof val === 'string') {
29050 if (typeof start === 'string') {
29051 encoding = start
29052 start = 0
29053 end = this.length
29054 } else if (typeof end === 'string') {
29055 encoding = end
29056 end = this.length
29057 }
29058 if (val.length === 1) {
29059 var code = val.charCodeAt(0)
29060 if (code < 256) {
29061 val = code
29062 }
29063 }
29064 if (encoding !== undefined && typeof encoding !== 'string') {
29065 throw new TypeError('encoding must be a string')
29066 }
29067 if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
29068 throw new TypeError('Unknown encoding: ' + encoding)
29069 }
29070 } else if (typeof val === 'number') {
29071 val = val & 255
29072 }
29073
29074 // Invalid ranges are not set to a default, so can range check early.
29075 if (start < 0 || this.length < start || this.length < end) {
29076 throw new RangeError('Out of range index')
29077 }
29078
29079 if (end <= start) {
29080 return this
29081 }
29082
29083 start = start >>> 0
29084 end = end === undefined ? this.length : end >>> 0
29085
29086 if (!val) val = 0
29087
29088 var i
29089 if (typeof val === 'number') {
29090 for (i = start; i < end; ++i) {
29091 this[i] = val
29092 }
29093 } else {
29094 var bytes = Buffer.isBuffer(val)
29095 ? val
29096 : new Buffer(val, encoding)
29097 var len = bytes.length
29098 for (i = 0; i < end - start; ++i) {
29099 this[i + start] = bytes[i % len]
29100 }
29101 }
29102
29103 return this
29104}
29105
29106// HELPER FUNCTIONS
29107// ================
29108
29109var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
29110
29111function base64clean (str) {
29112 // Node strips out invalid characters like \n and \t from the string, base64-js does not
29113 str = str.trim().replace(INVALID_BASE64_RE, '')
29114 // Node converts strings with length < 2 to ''
29115 if (str.length < 2) return ''
29116 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
29117 while (str.length % 4 !== 0) {
29118 str = str + '='
29119 }
29120 return str
29121}
29122
29123function toHex (n) {
29124 if (n < 16) return '0' + n.toString(16)
29125 return n.toString(16)
29126}
29127
29128function utf8ToBytes (string, units) {
29129 units = units || Infinity
29130 var codePoint
29131 var length = string.length
29132 var leadSurrogate = null
29133 var bytes = []
29134
29135 for (var i = 0; i < length; ++i) {
29136 codePoint = string.charCodeAt(i)
29137
29138 // is surrogate component
29139 if (codePoint > 0xD7FF && codePoint < 0xE000) {
29140 // last char was a lead
29141 if (!leadSurrogate) {
29142 // no lead yet
29143 if (codePoint > 0xDBFF) {
29144 // unexpected trail
29145 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
29146 continue
29147 } else if (i + 1 === length) {
29148 // unpaired lead
29149 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
29150 continue
29151 }
29152
29153 // valid lead
29154 leadSurrogate = codePoint
29155
29156 continue
29157 }
29158
29159 // 2 leads in a row
29160 if (codePoint < 0xDC00) {
29161 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
29162 leadSurrogate = codePoint
29163 continue
29164 }
29165
29166 // valid surrogate pair
29167 codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
29168 } else if (leadSurrogate) {
29169 // valid bmp char, but last char was a lead
29170 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
29171 }
29172
29173 leadSurrogate = null
29174
29175 // encode utf8
29176 if (codePoint < 0x80) {
29177 if ((units -= 1) < 0) break
29178 bytes.push(codePoint)
29179 } else if (codePoint < 0x800) {
29180 if ((units -= 2) < 0) break
29181 bytes.push(
29182 codePoint >> 0x6 | 0xC0,
29183 codePoint & 0x3F | 0x80
29184 )
29185 } else if (codePoint < 0x10000) {
29186 if ((units -= 3) < 0) break
29187 bytes.push(
29188 codePoint >> 0xC | 0xE0,
29189 codePoint >> 0x6 & 0x3F | 0x80,
29190 codePoint & 0x3F | 0x80
29191 )
29192 } else if (codePoint < 0x110000) {
29193 if ((units -= 4) < 0) break
29194 bytes.push(
29195 codePoint >> 0x12 | 0xF0,
29196 codePoint >> 0xC & 0x3F | 0x80,
29197 codePoint >> 0x6 & 0x3F | 0x80,
29198 codePoint & 0x3F | 0x80
29199 )
29200 } else {
29201 throw new Error('Invalid code point')
29202 }
29203 }
29204
29205 return bytes
29206}
29207
29208function asciiToBytes (str) {
29209 var byteArray = []
29210 for (var i = 0; i < str.length; ++i) {
29211 // Node's code seems to be doing this and not & 0x7F..
29212 byteArray.push(str.charCodeAt(i) & 0xFF)
29213 }
29214 return byteArray
29215}
29216
29217function utf16leToBytes (str, units) {
29218 var c, hi, lo
29219 var byteArray = []
29220 for (var i = 0; i < str.length; ++i) {
29221 if ((units -= 2) < 0) break
29222
29223 c = str.charCodeAt(i)
29224 hi = c >> 8
29225 lo = c % 256
29226 byteArray.push(lo)
29227 byteArray.push(hi)
29228 }
29229
29230 return byteArray
29231}
29232
29233function base64ToBytes (str) {
29234 return base64.toByteArray(base64clean(str))
29235}
29236
29237function blitBuffer (src, dst, offset, length) {
29238 for (var i = 0; i < length; ++i) {
29239 if ((i + offset >= dst.length) || (i >= src.length)) break
29240 dst[i + offset] = src[i]
29241 }
29242 return i
29243}
29244
29245// Node 0.10 supports `ArrayBuffer` but lacks `ArrayBuffer.isView`
29246function isArrayBufferView (obj) {
29247 return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)
29248}
29249
29250function numberIsNaN (obj) {
29251 return obj !== obj // eslint-disable-line no-self-compare
29252}
29253
29254},{"base64-js":2,"ieee754":8}],6:[function(require,module,exports){
29255(function (Buffer){
29256// Copyright Joyent, Inc. and other Node contributors.
29257//
29258// Permission is hereby granted, free of charge, to any person obtaining a
29259// copy of this software and associated documentation files (the
29260// "Software"), to deal in the Software without restriction, including
29261// without limitation the rights to use, copy, modify, merge, publish,
29262// distribute, sublicense, and/or sell copies of the Software, and to permit
29263// persons to whom the Software is furnished to do so, subject to the
29264// following conditions:
29265//
29266// The above copyright notice and this permission notice shall be included
29267// in all copies or substantial portions of the Software.
29268//
29269// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
29270// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29271// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
29272// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
29273// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
29274// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
29275// USE OR OTHER DEALINGS IN THE SOFTWARE.
29276
29277// NOTE: These type checking functions intentionally don't use `instanceof`
29278// because it is fragile and can be easily faked with `Object.create()`.
29279
29280function isArray(arg) {
29281 if (Array.isArray) {
29282 return Array.isArray(arg);
29283 }
29284 return objectToString(arg) === '[object Array]';
29285}
29286exports.isArray = isArray;
29287
29288function isBoolean(arg) {
29289 return typeof arg === 'boolean';
29290}
29291exports.isBoolean = isBoolean;
29292
29293function isNull(arg) {
29294 return arg === null;
29295}
29296exports.isNull = isNull;
29297
29298function isNullOrUndefined(arg) {
29299 return arg == null;
29300}
29301exports.isNullOrUndefined = isNullOrUndefined;
29302
29303function isNumber(arg) {
29304 return typeof arg === 'number';
29305}
29306exports.isNumber = isNumber;
29307
29308function isString(arg) {
29309 return typeof arg === 'string';
29310}
29311exports.isString = isString;
29312
29313function isSymbol(arg) {
29314 return typeof arg === 'symbol';
29315}
29316exports.isSymbol = isSymbol;
29317
29318function isUndefined(arg) {
29319 return arg === void 0;
29320}
29321exports.isUndefined = isUndefined;
29322
29323function isRegExp(re) {
29324 return objectToString(re) === '[object RegExp]';
29325}
29326exports.isRegExp = isRegExp;
29327
29328function isObject(arg) {
29329 return typeof arg === 'object' && arg !== null;
29330}
29331exports.isObject = isObject;
29332
29333function isDate(d) {
29334 return objectToString(d) === '[object Date]';
29335}
29336exports.isDate = isDate;
29337
29338function isError(e) {
29339 return (objectToString(e) === '[object Error]' || e instanceof Error);
29340}
29341exports.isError = isError;
29342
29343function isFunction(arg) {
29344 return typeof arg === 'function';
29345}
29346exports.isFunction = isFunction;
29347
29348function isPrimitive(arg) {
29349 return arg === null ||
29350 typeof arg === 'boolean' ||
29351 typeof arg === 'number' ||
29352 typeof arg === 'string' ||
29353 typeof arg === 'symbol' || // ES6 symbol
29354 typeof arg === 'undefined';
29355}
29356exports.isPrimitive = isPrimitive;
29357
29358exports.isBuffer = Buffer.isBuffer;
29359
29360function objectToString(o) {
29361 return Object.prototype.toString.call(o);
29362}
29363
29364}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
29365},{"../../is-buffer/index.js":10}],7:[function(require,module,exports){
29366// Copyright Joyent, Inc. and other Node contributors.
29367//
29368// Permission is hereby granted, free of charge, to any person obtaining a
29369// copy of this software and associated documentation files (the
29370// "Software"), to deal in the Software without restriction, including
29371// without limitation the rights to use, copy, modify, merge, publish,
29372// distribute, sublicense, and/or sell copies of the Software, and to permit
29373// persons to whom the Software is furnished to do so, subject to the
29374// following conditions:
29375//
29376// The above copyright notice and this permission notice shall be included
29377// in all copies or substantial portions of the Software.
29378//
29379// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
29380// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29381// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
29382// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
29383// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
29384// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
29385// USE OR OTHER DEALINGS IN THE SOFTWARE.
29386
29387function EventEmitter() {
29388 this._events = this._events || {};
29389 this._maxListeners = this._maxListeners || undefined;
29390}
29391module.exports = EventEmitter;
29392
29393// Backwards-compat with node 0.10.x
29394EventEmitter.EventEmitter = EventEmitter;
29395
29396EventEmitter.prototype._events = undefined;
29397EventEmitter.prototype._maxListeners = undefined;
29398
29399// By default EventEmitters will print a warning if more than 10 listeners are
29400// added to it. This is a useful default which helps finding memory leaks.
29401EventEmitter.defaultMaxListeners = 10;
29402
29403// Obviously not all Emitters should be limited to 10. This function allows
29404// that to be increased. Set to zero for unlimited.
29405EventEmitter.prototype.setMaxListeners = function(n) {
29406 if (!isNumber(n) || n < 0 || isNaN(n))
29407 throw TypeError('n must be a positive number');
29408 this._maxListeners = n;
29409 return this;
29410};
29411
29412EventEmitter.prototype.emit = function(type) {
29413 var er, handler, len, args, i, listeners;
29414
29415 if (!this._events)
29416 this._events = {};
29417
29418 // If there is no 'error' event listener then throw.
29419 if (type === 'error') {
29420 if (!this._events.error ||
29421 (isObject(this._events.error) && !this._events.error.length)) {
29422 er = arguments[1];
29423 if (er instanceof Error) {
29424 throw er; // Unhandled 'error' event
29425 } else {
29426 // At least give some kind of context to the user
29427 var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
29428 err.context = er;
29429 throw err;
29430 }
29431 }
29432 }
29433
29434 handler = this._events[type];
29435
29436 if (isUndefined(handler))
29437 return false;
29438
29439 if (isFunction(handler)) {
29440 switch (arguments.length) {
29441 // fast cases
29442 case 1:
29443 handler.call(this);
29444 break;
29445 case 2:
29446 handler.call(this, arguments[1]);
29447 break;
29448 case 3:
29449 handler.call(this, arguments[1], arguments[2]);
29450 break;
29451 // slower
29452 default:
29453 args = Array.prototype.slice.call(arguments, 1);
29454 handler.apply(this, args);
29455 }
29456 } else if (isObject(handler)) {
29457 args = Array.prototype.slice.call(arguments, 1);
29458 listeners = handler.slice();
29459 len = listeners.length;
29460 for (i = 0; i < len; i++)
29461 listeners[i].apply(this, args);
29462 }
29463
29464 return true;
29465};
29466
29467EventEmitter.prototype.addListener = function(type, listener) {
29468 var m;
29469
29470 if (!isFunction(listener))
29471 throw TypeError('listener must be a function');
29472
29473 if (!this._events)
29474 this._events = {};
29475
29476 // To avoid recursion in the case that type === "newListener"! Before
29477 // adding it to the listeners, first emit "newListener".
29478 if (this._events.newListener)
29479 this.emit('newListener', type,
29480 isFunction(listener.listener) ?
29481 listener.listener : listener);
29482
29483 if (!this._events[type])
29484 // Optimize the case of one listener. Don't need the extra array object.
29485 this._events[type] = listener;
29486 else if (isObject(this._events[type]))
29487 // If we've already got an array, just append.
29488 this._events[type].push(listener);
29489 else
29490 // Adding the second element, need to change to array.
29491 this._events[type] = [this._events[type], listener];
29492
29493 // Check for listener leak
29494 if (isObject(this._events[type]) && !this._events[type].warned) {
29495 if (!isUndefined(this._maxListeners)) {
29496 m = this._maxListeners;
29497 } else {
29498 m = EventEmitter.defaultMaxListeners;
29499 }
29500
29501 if (m && m > 0 && this._events[type].length > m) {
29502 this._events[type].warned = true;
29503 console.error('(node) warning: possible EventEmitter memory ' +
29504 'leak detected. %d listeners added. ' +
29505 'Use emitter.setMaxListeners() to increase limit.',
29506 this._events[type].length);
29507 if (typeof console.trace === 'function') {
29508 // not supported in IE 10
29509 console.trace();
29510 }
29511 }
29512 }
29513
29514 return this;
29515};
29516
29517EventEmitter.prototype.on = EventEmitter.prototype.addListener;
29518
29519EventEmitter.prototype.once = function(type, listener) {
29520 if (!isFunction(listener))
29521 throw TypeError('listener must be a function');
29522
29523 var fired = false;
29524
29525 function g() {
29526 this.removeListener(type, g);
29527
29528 if (!fired) {
29529 fired = true;
29530 listener.apply(this, arguments);
29531 }
29532 }
29533
29534 g.listener = listener;
29535 this.on(type, g);
29536
29537 return this;
29538};
29539
29540// emits a 'removeListener' event iff the listener was removed
29541EventEmitter.prototype.removeListener = function(type, listener) {
29542 var list, position, length, i;
29543
29544 if (!isFunction(listener))
29545 throw TypeError('listener must be a function');
29546
29547 if (!this._events || !this._events[type])
29548 return this;
29549
29550 list = this._events[type];
29551 length = list.length;
29552 position = -1;
29553
29554 if (list === listener ||
29555 (isFunction(list.listener) && list.listener === listener)) {
29556 delete this._events[type];
29557 if (this._events.removeListener)
29558 this.emit('removeListener', type, listener);
29559
29560 } else if (isObject(list)) {
29561 for (i = length; i-- > 0;) {
29562 if (list[i] === listener ||
29563 (list[i].listener && list[i].listener === listener)) {
29564 position = i;
29565 break;
29566 }
29567 }
29568
29569 if (position < 0)
29570 return this;
29571
29572 if (list.length === 1) {
29573 list.length = 0;
29574 delete this._events[type];
29575 } else {
29576 list.splice(position, 1);
29577 }
29578
29579 if (this._events.removeListener)
29580 this.emit('removeListener', type, listener);
29581 }
29582
29583 return this;
29584};
29585
29586EventEmitter.prototype.removeAllListeners = function(type) {
29587 var key, listeners;
29588
29589 if (!this._events)
29590 return this;
29591
29592 // not listening for removeListener, no need to emit
29593 if (!this._events.removeListener) {
29594 if (arguments.length === 0)
29595 this._events = {};
29596 else if (this._events[type])
29597 delete this._events[type];
29598 return this;
29599 }
29600
29601 // emit removeListener for all listeners on all events
29602 if (arguments.length === 0) {
29603 for (key in this._events) {
29604 if (key === 'removeListener') continue;
29605 this.removeAllListeners(key);
29606 }
29607 this.removeAllListeners('removeListener');
29608 this._events = {};
29609 return this;
29610 }
29611
29612 listeners = this._events[type];
29613
29614 if (isFunction(listeners)) {
29615 this.removeListener(type, listeners);
29616 } else if (listeners) {
29617 // LIFO order
29618 while (listeners.length)
29619 this.removeListener(type, listeners[listeners.length - 1]);
29620 }
29621 delete this._events[type];
29622
29623 return this;
29624};
29625
29626EventEmitter.prototype.listeners = function(type) {
29627 var ret;
29628 if (!this._events || !this._events[type])
29629 ret = [];
29630 else if (isFunction(this._events[type]))
29631 ret = [this._events[type]];
29632 else
29633 ret = this._events[type].slice();
29634 return ret;
29635};
29636
29637EventEmitter.prototype.listenerCount = function(type) {
29638 if (this._events) {
29639 var evlistener = this._events[type];
29640
29641 if (isFunction(evlistener))
29642 return 1;
29643 else if (evlistener)
29644 return evlistener.length;
29645 }
29646 return 0;
29647};
29648
29649EventEmitter.listenerCount = function(emitter, type) {
29650 return emitter.listenerCount(type);
29651};
29652
29653function isFunction(arg) {
29654 return typeof arg === 'function';
29655}
29656
29657function isNumber(arg) {
29658 return typeof arg === 'number';
29659}
29660
29661function isObject(arg) {
29662 return typeof arg === 'object' && arg !== null;
29663}
29664
29665function isUndefined(arg) {
29666 return arg === void 0;
29667}
29668
29669},{}],8:[function(require,module,exports){
29670exports.read = function (buffer, offset, isLE, mLen, nBytes) {
29671 var e, m
29672 var eLen = nBytes * 8 - mLen - 1
29673 var eMax = (1 << eLen) - 1
29674 var eBias = eMax >> 1
29675 var nBits = -7
29676 var i = isLE ? (nBytes - 1) : 0
29677 var d = isLE ? -1 : 1
29678 var s = buffer[offset + i]
29679
29680 i += d
29681
29682 e = s & ((1 << (-nBits)) - 1)
29683 s >>= (-nBits)
29684 nBits += eLen
29685 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
29686
29687 m = e & ((1 << (-nBits)) - 1)
29688 e >>= (-nBits)
29689 nBits += mLen
29690 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
29691
29692 if (e === 0) {
29693 e = 1 - eBias
29694 } else if (e === eMax) {
29695 return m ? NaN : ((s ? -1 : 1) * Infinity)
29696 } else {
29697 m = m + Math.pow(2, mLen)
29698 e = e - eBias
29699 }
29700 return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
29701}
29702
29703exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
29704 var e, m, c
29705 var eLen = nBytes * 8 - mLen - 1
29706 var eMax = (1 << eLen) - 1
29707 var eBias = eMax >> 1
29708 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
29709 var i = isLE ? 0 : (nBytes - 1)
29710 var d = isLE ? 1 : -1
29711 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
29712
29713 value = Math.abs(value)
29714
29715 if (isNaN(value) || value === Infinity) {
29716 m = isNaN(value) ? 1 : 0
29717 e = eMax
29718 } else {
29719 e = Math.floor(Math.log(value) / Math.LN2)
29720 if (value * (c = Math.pow(2, -e)) < 1) {
29721 e--
29722 c *= 2
29723 }
29724 if (e + eBias >= 1) {
29725 value += rt / c
29726 } else {
29727 value += rt * Math.pow(2, 1 - eBias)
29728 }
29729 if (value * c >= 2) {
29730 e++
29731 c /= 2
29732 }
29733
29734 if (e + eBias >= eMax) {
29735 m = 0
29736 e = eMax
29737 } else if (e + eBias >= 1) {
29738 m = (value * c - 1) * Math.pow(2, mLen)
29739 e = e + eBias
29740 } else {
29741 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
29742 e = 0
29743 }
29744 }
29745
29746 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
29747
29748 e = (e << mLen) | m
29749 eLen += mLen
29750 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
29751
29752 buffer[offset + i - d] |= s * 128
29753}
29754
29755},{}],9:[function(require,module,exports){
29756if (typeof Object.create === 'function') {
29757 // implementation from standard node.js 'util' module
29758 module.exports = function inherits(ctor, superCtor) {
29759 ctor.super_ = superCtor
29760 ctor.prototype = Object.create(superCtor.prototype, {
29761 constructor: {
29762 value: ctor,
29763 enumerable: false,
29764 writable: true,
29765 configurable: true
29766 }
29767 });
29768 };
29769} else {
29770 // old school shim for old browsers
29771 module.exports = function inherits(ctor, superCtor) {
29772 ctor.super_ = superCtor
29773 var TempCtor = function () {}
29774 TempCtor.prototype = superCtor.prototype
29775 ctor.prototype = new TempCtor()
29776 ctor.prototype.constructor = ctor
29777 }
29778}
29779
29780},{}],10:[function(require,module,exports){
29781/*!
29782 * Determine if an object is a Buffer
29783 *
29784 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
29785 * @license MIT
29786 */
29787
29788// The _isBuffer check is for Safari 5-7 support, because it's missing
29789// Object.prototype.constructor. Remove this eventually
29790module.exports = function (obj) {
29791 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
29792}
29793
29794function isBuffer (obj) {
29795 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
29796}
29797
29798// For Node v0.10 support. Remove this eventually.
29799function isSlowBuffer (obj) {
29800 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
29801}
29802
29803},{}],11:[function(require,module,exports){
29804var toString = {}.toString;
29805
29806module.exports = Array.isArray || function (arr) {
29807 return toString.call(arr) == '[object Array]';
29808};
29809
29810},{}],12:[function(require,module,exports){
29811(function (process){
29812'use strict';
29813
29814if (!process.version ||
29815 process.version.indexOf('v0.') === 0 ||
29816 process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
29817 module.exports = nextTick;
29818} else {
29819 module.exports = process.nextTick;
29820}
29821
29822function nextTick(fn, arg1, arg2, arg3) {
29823 if (typeof fn !== 'function') {
29824 throw new TypeError('"callback" argument must be a function');
29825 }
29826 var len = arguments.length;
29827 var args, i;
29828 switch (len) {
29829 case 0:
29830 case 1:
29831 return process.nextTick(fn);
29832 case 2:
29833 return process.nextTick(function afterTickOne() {
29834 fn.call(null, arg1);
29835 });
29836 case 3:
29837 return process.nextTick(function afterTickTwo() {
29838 fn.call(null, arg1, arg2);
29839 });
29840 case 4:
29841 return process.nextTick(function afterTickThree() {
29842 fn.call(null, arg1, arg2, arg3);
29843 });
29844 default:
29845 args = new Array(len - 1);
29846 i = 0;
29847 while (i < args.length) {
29848 args[i++] = arguments[i];
29849 }
29850 return process.nextTick(function afterTick() {
29851 fn.apply(null, args);
29852 });
29853 }
29854}
29855
29856}).call(this,require('_process'))
29857},{"_process":13}],13:[function(require,module,exports){
29858// shim for using process in browser
29859var process = module.exports = {};
29860
29861// cached from whatever global is present so that test runners that stub it
29862// don't break things. But we need to wrap it in a try catch in case it is
29863// wrapped in strict mode code which doesn't define any globals. It's inside a
29864// function because try/catches deoptimize in certain engines.
29865
29866var cachedSetTimeout;
29867var cachedClearTimeout;
29868
29869function defaultSetTimout() {
29870 throw new Error('setTimeout has not been defined');
29871}
29872function defaultClearTimeout () {
29873 throw new Error('clearTimeout has not been defined');
29874}
29875(function () {
29876 try {
29877 if (typeof setTimeout === 'function') {
29878 cachedSetTimeout = setTimeout;
29879 } else {
29880 cachedSetTimeout = defaultSetTimout;
29881 }
29882 } catch (e) {
29883 cachedSetTimeout = defaultSetTimout;
29884 }
29885 try {
29886 if (typeof clearTimeout === 'function') {
29887 cachedClearTimeout = clearTimeout;
29888 } else {
29889 cachedClearTimeout = defaultClearTimeout;
29890 }
29891 } catch (e) {
29892 cachedClearTimeout = defaultClearTimeout;
29893 }
29894} ())
29895function runTimeout(fun) {
29896 if (cachedSetTimeout === setTimeout) {
29897 //normal enviroments in sane situations
29898 return setTimeout(fun, 0);
29899 }
29900 // if setTimeout wasn't available but was latter defined
29901 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
29902 cachedSetTimeout = setTimeout;
29903 return setTimeout(fun, 0);
29904 }
29905 try {
29906 // when when somebody has screwed with setTimeout but no I.E. maddness
29907 return cachedSetTimeout(fun, 0);
29908 } catch(e){
29909 try {
29910 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
29911 return cachedSetTimeout.call(null, fun, 0);
29912 } catch(e){
29913 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
29914 return cachedSetTimeout.call(this, fun, 0);
29915 }
29916 }
29917
29918
29919}
29920function runClearTimeout(marker) {
29921 if (cachedClearTimeout === clearTimeout) {
29922 //normal enviroments in sane situations
29923 return clearTimeout(marker);
29924 }
29925 // if clearTimeout wasn't available but was latter defined
29926 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
29927 cachedClearTimeout = clearTimeout;
29928 return clearTimeout(marker);
29929 }
29930 try {
29931 // when when somebody has screwed with setTimeout but no I.E. maddness
29932 return cachedClearTimeout(marker);
29933 } catch (e){
29934 try {
29935 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
29936 return cachedClearTimeout.call(null, marker);
29937 } catch (e){
29938 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
29939 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
29940 return cachedClearTimeout.call(this, marker);
29941 }
29942 }
29943
29944
29945
29946}
29947var queue = [];
29948var draining = false;
29949var currentQueue;
29950var queueIndex = -1;
29951
29952function cleanUpNextTick() {
29953 if (!draining || !currentQueue) {
29954 return;
29955 }
29956 draining = false;
29957 if (currentQueue.length) {
29958 queue = currentQueue.concat(queue);
29959 } else {
29960 queueIndex = -1;
29961 }
29962 if (queue.length) {
29963 drainQueue();
29964 }
29965}
29966
29967function drainQueue() {
29968 if (draining) {
29969 return;
29970 }
29971 var timeout = runTimeout(cleanUpNextTick);
29972 draining = true;
29973
29974 var len = queue.length;
29975 while(len) {
29976 currentQueue = queue;
29977 queue = [];
29978 while (++queueIndex < len) {
29979 if (currentQueue) {
29980 currentQueue[queueIndex].run();
29981 }
29982 }
29983 queueIndex = -1;
29984 len = queue.length;
29985 }
29986 currentQueue = null;
29987 draining = false;
29988 runClearTimeout(timeout);
29989}
29990
29991process.nextTick = function (fun) {
29992 var args = new Array(arguments.length - 1);
29993 if (arguments.length > 1) {
29994 for (var i = 1; i < arguments.length; i++) {
29995 args[i - 1] = arguments[i];
29996 }
29997 }
29998 queue.push(new Item(fun, args));
29999 if (queue.length === 1 && !draining) {
30000 runTimeout(drainQueue);
30001 }
30002};
30003
30004// v8 likes predictible objects
30005function Item(fun, array) {
30006 this.fun = fun;
30007 this.array = array;
30008}
30009Item.prototype.run = function () {
30010 this.fun.apply(null, this.array);
30011};
30012process.title = 'browser';
30013process.browser = true;
30014process.env = {};
30015process.argv = [];
30016process.version = ''; // empty string to avoid regexp issues
30017process.versions = {};
30018
30019function noop() {}
30020
30021process.on = noop;
30022process.addListener = noop;
30023process.once = noop;
30024process.off = noop;
30025process.removeListener = noop;
30026process.removeAllListeners = noop;
30027process.emit = noop;
30028process.prependListener = noop;
30029process.prependOnceListener = noop;
30030
30031process.listeners = function (name) { return [] }
30032
30033process.binding = function (name) {
30034 throw new Error('process.binding is not supported');
30035};
30036
30037process.cwd = function () { return '/' };
30038process.chdir = function (dir) {
30039 throw new Error('process.chdir is not supported');
30040};
30041process.umask = function() { return 0; };
30042
30043},{}],14:[function(require,module,exports){
30044module.exports = require('./lib/_stream_duplex.js');
30045
30046},{"./lib/_stream_duplex.js":15}],15:[function(require,module,exports){
30047// a duplex stream is just a stream that is both readable and writable.
30048// Since JS doesn't have multiple prototypal inheritance, this class
30049// prototypally inherits from Readable, and then parasitically from
30050// Writable.
30051
30052'use strict';
30053
30054/*<replacement>*/
30055
30056var objectKeys = Object.keys || function (obj) {
30057 var keys = [];
30058 for (var key in obj) {
30059 keys.push(key);
30060 }return keys;
30061};
30062/*</replacement>*/
30063
30064module.exports = Duplex;
30065
30066/*<replacement>*/
30067var processNextTick = require('process-nextick-args');
30068/*</replacement>*/
30069
30070/*<replacement>*/
30071var util = require('core-util-is');
30072util.inherits = require('inherits');
30073/*</replacement>*/
30074
30075var Readable = require('./_stream_readable');
30076var Writable = require('./_stream_writable');
30077
30078util.inherits(Duplex, Readable);
30079
30080var keys = objectKeys(Writable.prototype);
30081for (var v = 0; v < keys.length; v++) {
30082 var method = keys[v];
30083 if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
30084}
30085
30086function Duplex(options) {
30087 if (!(this instanceof Duplex)) return new Duplex(options);
30088
30089 Readable.call(this, options);
30090 Writable.call(this, options);
30091
30092 if (options && options.readable === false) this.readable = false;
30093
30094 if (options && options.writable === false) this.writable = false;
30095
30096 this.allowHalfOpen = true;
30097 if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
30098
30099 this.once('end', onend);
30100}
30101
30102// the no-half-open enforcer
30103function onend() {
30104 // if we allow half-open state, or if the writable side ended,
30105 // then we're ok.
30106 if (this.allowHalfOpen || this._writableState.ended) return;
30107
30108 // no more data can be written.
30109 // But allow more writes to happen in this tick.
30110 processNextTick(onEndNT, this);
30111}
30112
30113function onEndNT(self) {
30114 self.end();
30115}
30116
30117function forEach(xs, f) {
30118 for (var i = 0, l = xs.length; i < l; i++) {
30119 f(xs[i], i);
30120 }
30121}
30122},{"./_stream_readable":17,"./_stream_writable":19,"core-util-is":6,"inherits":9,"process-nextick-args":12}],16:[function(require,module,exports){
30123// a passthrough stream.
30124// basically just the most minimal sort of Transform stream.
30125// Every written chunk gets output as-is.
30126
30127'use strict';
30128
30129module.exports = PassThrough;
30130
30131var Transform = require('./_stream_transform');
30132
30133/*<replacement>*/
30134var util = require('core-util-is');
30135util.inherits = require('inherits');
30136/*</replacement>*/
30137
30138util.inherits(PassThrough, Transform);
30139
30140function PassThrough(options) {
30141 if (!(this instanceof PassThrough)) return new PassThrough(options);
30142
30143 Transform.call(this, options);
30144}
30145
30146PassThrough.prototype._transform = function (chunk, encoding, cb) {
30147 cb(null, chunk);
30148};
30149},{"./_stream_transform":18,"core-util-is":6,"inherits":9}],17:[function(require,module,exports){
30150(function (process){
30151'use strict';
30152
30153module.exports = Readable;
30154
30155/*<replacement>*/
30156var processNextTick = require('process-nextick-args');
30157/*</replacement>*/
30158
30159/*<replacement>*/
30160var isArray = require('isarray');
30161/*</replacement>*/
30162
30163/*<replacement>*/
30164var Duplex;
30165/*</replacement>*/
30166
30167Readable.ReadableState = ReadableState;
30168
30169/*<replacement>*/
30170var EE = require('events').EventEmitter;
30171
30172var EElistenerCount = function (emitter, type) {
30173 return emitter.listeners(type).length;
30174};
30175/*</replacement>*/
30176
30177/*<replacement>*/
30178var Stream = require('./internal/streams/stream');
30179/*</replacement>*/
30180
30181var Buffer = require('buffer').Buffer;
30182/*<replacement>*/
30183var bufferShim = require('buffer-shims');
30184/*</replacement>*/
30185
30186/*<replacement>*/
30187var util = require('core-util-is');
30188util.inherits = require('inherits');
30189/*</replacement>*/
30190
30191/*<replacement>*/
30192var debugUtil = require('util');
30193var debug = void 0;
30194if (debugUtil && debugUtil.debuglog) {
30195 debug = debugUtil.debuglog('stream');
30196} else {
30197 debug = function () {};
30198}
30199/*</replacement>*/
30200
30201var BufferList = require('./internal/streams/BufferList');
30202var StringDecoder;
30203
30204util.inherits(Readable, Stream);
30205
30206var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
30207
30208function prependListener(emitter, event, fn) {
30209 // Sadly this is not cacheable as some libraries bundle their own
30210 // event emitter implementation with them.
30211 if (typeof emitter.prependListener === 'function') {
30212 return emitter.prependListener(event, fn);
30213 } else {
30214 // This is a hack to make sure that our error handler is attached before any
30215 // userland ones. NEVER DO THIS. This is here only because this code needs
30216 // to continue to work with older versions of Node.js that do not include
30217 // the prependListener() method. The goal is to eventually remove this hack.
30218 if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
30219 }
30220}
30221
30222function ReadableState(options, stream) {
30223 Duplex = Duplex || require('./_stream_duplex');
30224
30225 options = options || {};
30226
30227 // object stream flag. Used to make read(n) ignore n and to
30228 // make all the buffer merging and length checks go away
30229 this.objectMode = !!options.objectMode;
30230
30231 if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
30232
30233 // the point at which it stops calling _read() to fill the buffer
30234 // Note: 0 is a valid value, means "don't call _read preemptively ever"
30235 var hwm = options.highWaterMark;
30236 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
30237 this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
30238
30239 // cast to ints.
30240 this.highWaterMark = ~~this.highWaterMark;
30241
30242 // A linked list is used to store data chunks instead of an array because the
30243 // linked list can remove elements from the beginning faster than
30244 // array.shift()
30245 this.buffer = new BufferList();
30246 this.length = 0;
30247 this.pipes = null;
30248 this.pipesCount = 0;
30249 this.flowing = null;
30250 this.ended = false;
30251 this.endEmitted = false;
30252 this.reading = false;
30253
30254 // a flag to be able to tell if the onwrite cb is called immediately,
30255 // or on a later tick. We set this to true at first, because any
30256 // actions that shouldn't happen until "later" should generally also
30257 // not happen before the first write call.
30258 this.sync = true;
30259
30260 // whenever we return null, then we set a flag to say
30261 // that we're awaiting a 'readable' event emission.
30262 this.needReadable = false;
30263 this.emittedReadable = false;
30264 this.readableListening = false;
30265 this.resumeScheduled = false;
30266
30267 // Crypto is kind of old and crusty. Historically, its default string
30268 // encoding is 'binary' so we have to make this configurable.
30269 // Everything else in the universe uses 'utf8', though.
30270 this.defaultEncoding = options.defaultEncoding || 'utf8';
30271
30272 // when piping, we only care about 'readable' events that happen
30273 // after read()ing all the bytes and not getting any pushback.
30274 this.ranOut = false;
30275
30276 // the number of writers that are awaiting a drain event in .pipe()s
30277 this.awaitDrain = 0;
30278
30279 // if true, a maybeReadMore has been scheduled
30280 this.readingMore = false;
30281
30282 this.decoder = null;
30283 this.encoding = null;
30284 if (options.encoding) {
30285 if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
30286 this.decoder = new StringDecoder(options.encoding);
30287 this.encoding = options.encoding;
30288 }
30289}
30290
30291function Readable(options) {
30292 Duplex = Duplex || require('./_stream_duplex');
30293
30294 if (!(this instanceof Readable)) return new Readable(options);
30295
30296 this._readableState = new ReadableState(options, this);
30297
30298 // legacy
30299 this.readable = true;
30300
30301 if (options && typeof options.read === 'function') this._read = options.read;
30302
30303 Stream.call(this);
30304}
30305
30306// Manually shove something into the read() buffer.
30307// This returns true if the highWaterMark has not been hit yet,
30308// similar to how Writable.write() returns true if you should
30309// write() some more.
30310Readable.prototype.push = function (chunk, encoding) {
30311 var state = this._readableState;
30312
30313 if (!state.objectMode && typeof chunk === 'string') {
30314 encoding = encoding || state.defaultEncoding;
30315 if (encoding !== state.encoding) {
30316 chunk = bufferShim.from(chunk, encoding);
30317 encoding = '';
30318 }
30319 }
30320
30321 return readableAddChunk(this, state, chunk, encoding, false);
30322};
30323
30324// Unshift should *always* be something directly out of read()
30325Readable.prototype.unshift = function (chunk) {
30326 var state = this._readableState;
30327 return readableAddChunk(this, state, chunk, '', true);
30328};
30329
30330Readable.prototype.isPaused = function () {
30331 return this._readableState.flowing === false;
30332};
30333
30334function readableAddChunk(stream, state, chunk, encoding, addToFront) {
30335 var er = chunkInvalid(state, chunk);
30336 if (er) {
30337 stream.emit('error', er);
30338 } else if (chunk === null) {
30339 state.reading = false;
30340 onEofChunk(stream, state);
30341 } else if (state.objectMode || chunk && chunk.length > 0) {
30342 if (state.ended && !addToFront) {
30343 var e = new Error('stream.push() after EOF');
30344 stream.emit('error', e);
30345 } else if (state.endEmitted && addToFront) {
30346 var _e = new Error('stream.unshift() after end event');
30347 stream.emit('error', _e);
30348 } else {
30349 var skipAdd;
30350 if (state.decoder && !addToFront && !encoding) {
30351 chunk = state.decoder.write(chunk);
30352 skipAdd = !state.objectMode && chunk.length === 0;
30353 }
30354
30355 if (!addToFront) state.reading = false;
30356
30357 // Don't add to the buffer if we've decoded to an empty string chunk and
30358 // we're not in object mode
30359 if (!skipAdd) {
30360 // if we want the data now, just emit it.
30361 if (state.flowing && state.length === 0 && !state.sync) {
30362 stream.emit('data', chunk);
30363 stream.read(0);
30364 } else {
30365 // update the buffer info.
30366 state.length += state.objectMode ? 1 : chunk.length;
30367 if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
30368
30369 if (state.needReadable) emitReadable(stream);
30370 }
30371 }
30372
30373 maybeReadMore(stream, state);
30374 }
30375 } else if (!addToFront) {
30376 state.reading = false;
30377 }
30378
30379 return needMoreData(state);
30380}
30381
30382// if it's past the high water mark, we can push in some more.
30383// Also, if we have no data yet, we can stand some
30384// more bytes. This is to work around cases where hwm=0,
30385// such as the repl. Also, if the push() triggered a
30386// readable event, and the user called read(largeNumber) such that
30387// needReadable was set, then we ought to push more, so that another
30388// 'readable' event will be triggered.
30389function needMoreData(state) {
30390 return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
30391}
30392
30393// backwards compatibility.
30394Readable.prototype.setEncoding = function (enc) {
30395 if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
30396 this._readableState.decoder = new StringDecoder(enc);
30397 this._readableState.encoding = enc;
30398 return this;
30399};
30400
30401// Don't raise the hwm > 8MB
30402var MAX_HWM = 0x800000;
30403function computeNewHighWaterMark(n) {
30404 if (n >= MAX_HWM) {
30405 n = MAX_HWM;
30406 } else {
30407 // Get the next highest power of 2 to prevent increasing hwm excessively in
30408 // tiny amounts
30409 n--;
30410 n |= n >>> 1;
30411 n |= n >>> 2;
30412 n |= n >>> 4;
30413 n |= n >>> 8;
30414 n |= n >>> 16;
30415 n++;
30416 }
30417 return n;
30418}
30419
30420// This function is designed to be inlinable, so please take care when making
30421// changes to the function body.
30422function howMuchToRead(n, state) {
30423 if (n <= 0 || state.length === 0 && state.ended) return 0;
30424 if (state.objectMode) return 1;
30425 if (n !== n) {
30426 // Only flow one buffer at a time
30427 if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
30428 }
30429 // If we're asking for more than the current hwm, then raise the hwm.
30430 if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
30431 if (n <= state.length) return n;
30432 // Don't have enough
30433 if (!state.ended) {
30434 state.needReadable = true;
30435 return 0;
30436 }
30437 return state.length;
30438}
30439
30440// you can override either this method, or the async _read(n) below.
30441Readable.prototype.read = function (n) {
30442 debug('read', n);
30443 n = parseInt(n, 10);
30444 var state = this._readableState;
30445 var nOrig = n;
30446
30447 if (n !== 0) state.emittedReadable = false;
30448
30449 // if we're doing read(0) to trigger a readable event, but we
30450 // already have a bunch of data in the buffer, then just trigger
30451 // the 'readable' event and move on.
30452 if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
30453 debug('read: emitReadable', state.length, state.ended);
30454 if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
30455 return null;
30456 }
30457
30458 n = howMuchToRead(n, state);
30459
30460 // if we've ended, and we're now clear, then finish it up.
30461 if (n === 0 && state.ended) {
30462 if (state.length === 0) endReadable(this);
30463 return null;
30464 }
30465
30466 // All the actual chunk generation logic needs to be
30467 // *below* the call to _read. The reason is that in certain
30468 // synthetic stream cases, such as passthrough streams, _read
30469 // may be a completely synchronous operation which may change
30470 // the state of the read buffer, providing enough data when
30471 // before there was *not* enough.
30472 //
30473 // So, the steps are:
30474 // 1. Figure out what the state of things will be after we do
30475 // a read from the buffer.
30476 //
30477 // 2. If that resulting state will trigger a _read, then call _read.
30478 // Note that this may be asynchronous, or synchronous. Yes, it is
30479 // deeply ugly to write APIs this way, but that still doesn't mean
30480 // that the Readable class should behave improperly, as streams are
30481 // designed to be sync/async agnostic.
30482 // Take note if the _read call is sync or async (ie, if the read call
30483 // has returned yet), so that we know whether or not it's safe to emit
30484 // 'readable' etc.
30485 //
30486 // 3. Actually pull the requested chunks out of the buffer and return.
30487
30488 // if we need a readable event, then we need to do some reading.
30489 var doRead = state.needReadable;
30490 debug('need readable', doRead);
30491
30492 // if we currently have less than the highWaterMark, then also read some
30493 if (state.length === 0 || state.length - n < state.highWaterMark) {
30494 doRead = true;
30495 debug('length less than watermark', doRead);
30496 }
30497
30498 // however, if we've ended, then there's no point, and if we're already
30499 // reading, then it's unnecessary.
30500 if (state.ended || state.reading) {
30501 doRead = false;
30502 debug('reading or ended', doRead);
30503 } else if (doRead) {
30504 debug('do read');
30505 state.reading = true;
30506 state.sync = true;
30507 // if the length is currently zero, then we *need* a readable event.
30508 if (state.length === 0) state.needReadable = true;
30509 // call internal read method
30510 this._read(state.highWaterMark);
30511 state.sync = false;
30512 // If _read pushed data synchronously, then `reading` will be false,
30513 // and we need to re-evaluate how much data we can return to the user.
30514 if (!state.reading) n = howMuchToRead(nOrig, state);
30515 }
30516
30517 var ret;
30518 if (n > 0) ret = fromList(n, state);else ret = null;
30519
30520 if (ret === null) {
30521 state.needReadable = true;
30522 n = 0;
30523 } else {
30524 state.length -= n;
30525 }
30526
30527 if (state.length === 0) {
30528 // If we have nothing in the buffer, then we want to know
30529 // as soon as we *do* get something into the buffer.
30530 if (!state.ended) state.needReadable = true;
30531
30532 // If we tried to read() past the EOF, then emit end on the next tick.
30533 if (nOrig !== n && state.ended) endReadable(this);
30534 }
30535
30536 if (ret !== null) this.emit('data', ret);
30537
30538 return ret;
30539};
30540
30541function chunkInvalid(state, chunk) {
30542 var er = null;
30543 if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
30544 er = new TypeError('Invalid non-string/buffer chunk');
30545 }
30546 return er;
30547}
30548
30549function onEofChunk(stream, state) {
30550 if (state.ended) return;
30551 if (state.decoder) {
30552 var chunk = state.decoder.end();
30553 if (chunk && chunk.length) {
30554 state.buffer.push(chunk);
30555 state.length += state.objectMode ? 1 : chunk.length;
30556 }
30557 }
30558 state.ended = true;
30559
30560 // emit 'readable' now to make sure it gets picked up.
30561 emitReadable(stream);
30562}
30563
30564// Don't emit readable right away in sync mode, because this can trigger
30565// another read() call => stack overflow. This way, it might trigger
30566// a nextTick recursion warning, but that's not so bad.
30567function emitReadable(stream) {
30568 var state = stream._readableState;
30569 state.needReadable = false;
30570 if (!state.emittedReadable) {
30571 debug('emitReadable', state.flowing);
30572 state.emittedReadable = true;
30573 if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
30574 }
30575}
30576
30577function emitReadable_(stream) {
30578 debug('emit readable');
30579 stream.emit('readable');
30580 flow(stream);
30581}
30582
30583// at this point, the user has presumably seen the 'readable' event,
30584// and called read() to consume some data. that may have triggered
30585// in turn another _read(n) call, in which case reading = true if
30586// it's in progress.
30587// However, if we're not ended, or reading, and the length < hwm,
30588// then go ahead and try to read some more preemptively.
30589function maybeReadMore(stream, state) {
30590 if (!state.readingMore) {
30591 state.readingMore = true;
30592 processNextTick(maybeReadMore_, stream, state);
30593 }
30594}
30595
30596function maybeReadMore_(stream, state) {
30597 var len = state.length;
30598 while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
30599 debug('maybeReadMore read 0');
30600 stream.read(0);
30601 if (len === state.length)
30602 // didn't get any data, stop spinning.
30603 break;else len = state.length;
30604 }
30605 state.readingMore = false;
30606}
30607
30608// abstract method. to be overridden in specific implementation classes.
30609// call cb(er, data) where data is <= n in length.
30610// for virtual (non-string, non-buffer) streams, "length" is somewhat
30611// arbitrary, and perhaps not very meaningful.
30612Readable.prototype._read = function (n) {
30613 this.emit('error', new Error('_read() is not implemented'));
30614};
30615
30616Readable.prototype.pipe = function (dest, pipeOpts) {
30617 var src = this;
30618 var state = this._readableState;
30619
30620 switch (state.pipesCount) {
30621 case 0:
30622 state.pipes = dest;
30623 break;
30624 case 1:
30625 state.pipes = [state.pipes, dest];
30626 break;
30627 default:
30628 state.pipes.push(dest);
30629 break;
30630 }
30631 state.pipesCount += 1;
30632 debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
30633
30634 var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
30635
30636 var endFn = doEnd ? onend : cleanup;
30637 if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
30638
30639 dest.on('unpipe', onunpipe);
30640 function onunpipe(readable) {
30641 debug('onunpipe');
30642 if (readable === src) {
30643 cleanup();
30644 }
30645 }
30646
30647 function onend() {
30648 debug('onend');
30649 dest.end();
30650 }
30651
30652 // when the dest drains, it reduces the awaitDrain counter
30653 // on the source. This would be more elegant with a .once()
30654 // handler in flow(), but adding and removing repeatedly is
30655 // too slow.
30656 var ondrain = pipeOnDrain(src);
30657 dest.on('drain', ondrain);
30658
30659 var cleanedUp = false;
30660 function cleanup() {
30661 debug('cleanup');
30662 // cleanup event handlers once the pipe is broken
30663 dest.removeListener('close', onclose);
30664 dest.removeListener('finish', onfinish);
30665 dest.removeListener('drain', ondrain);
30666 dest.removeListener('error', onerror);
30667 dest.removeListener('unpipe', onunpipe);
30668 src.removeListener('end', onend);
30669 src.removeListener('end', cleanup);
30670 src.removeListener('data', ondata);
30671
30672 cleanedUp = true;
30673
30674 // if the reader is waiting for a drain event from this
30675 // specific writer, then it would cause it to never start
30676 // flowing again.
30677 // So, if this is awaiting a drain, then we just call it now.
30678 // If we don't know, then assume that we are waiting for one.
30679 if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
30680 }
30681
30682 // If the user pushes more data while we're writing to dest then we'll end up
30683 // in ondata again. However, we only want to increase awaitDrain once because
30684 // dest will only emit one 'drain' event for the multiple writes.
30685 // => Introduce a guard on increasing awaitDrain.
30686 var increasedAwaitDrain = false;
30687 src.on('data', ondata);
30688 function ondata(chunk) {
30689 debug('ondata');
30690 increasedAwaitDrain = false;
30691 var ret = dest.write(chunk);
30692 if (false === ret && !increasedAwaitDrain) {
30693 // If the user unpiped during `dest.write()`, it is possible
30694 // to get stuck in a permanently paused state if that write
30695 // also returned false.
30696 // => Check whether `dest` is still a piping destination.
30697 if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
30698 debug('false write response, pause', src._readableState.awaitDrain);
30699 src._readableState.awaitDrain++;
30700 increasedAwaitDrain = true;
30701 }
30702 src.pause();
30703 }
30704 }
30705
30706 // if the dest has an error, then stop piping into it.
30707 // however, don't suppress the throwing behavior for this.
30708 function onerror(er) {
30709 debug('onerror', er);
30710 unpipe();
30711 dest.removeListener('error', onerror);
30712 if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
30713 }
30714
30715 // Make sure our error handler is attached before userland ones.
30716 prependListener(dest, 'error', onerror);
30717
30718 // Both close and finish should trigger unpipe, but only once.
30719 function onclose() {
30720 dest.removeListener('finish', onfinish);
30721 unpipe();
30722 }
30723 dest.once('close', onclose);
30724 function onfinish() {
30725 debug('onfinish');
30726 dest.removeListener('close', onclose);
30727 unpipe();
30728 }
30729 dest.once('finish', onfinish);
30730
30731 function unpipe() {
30732 debug('unpipe');
30733 src.unpipe(dest);
30734 }
30735
30736 // tell the dest that it's being piped to
30737 dest.emit('pipe', src);
30738
30739 // start the flow if it hasn't been started already.
30740 if (!state.flowing) {
30741 debug('pipe resume');
30742 src.resume();
30743 }
30744
30745 return dest;
30746};
30747
30748function pipeOnDrain(src) {
30749 return function () {
30750 var state = src._readableState;
30751 debug('pipeOnDrain', state.awaitDrain);
30752 if (state.awaitDrain) state.awaitDrain--;
30753 if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
30754 state.flowing = true;
30755 flow(src);
30756 }
30757 };
30758}
30759
30760Readable.prototype.unpipe = function (dest) {
30761 var state = this._readableState;
30762
30763 // if we're not piping anywhere, then do nothing.
30764 if (state.pipesCount === 0) return this;
30765
30766 // just one destination. most common case.
30767 if (state.pipesCount === 1) {
30768 // passed in one, but it's not the right one.
30769 if (dest && dest !== state.pipes) return this;
30770
30771 if (!dest) dest = state.pipes;
30772
30773 // got a match.
30774 state.pipes = null;
30775 state.pipesCount = 0;
30776 state.flowing = false;
30777 if (dest) dest.emit('unpipe', this);
30778 return this;
30779 }
30780
30781 // slow case. multiple pipe destinations.
30782
30783 if (!dest) {
30784 // remove all.
30785 var dests = state.pipes;
30786 var len = state.pipesCount;
30787 state.pipes = null;
30788 state.pipesCount = 0;
30789 state.flowing = false;
30790
30791 for (var i = 0; i < len; i++) {
30792 dests[i].emit('unpipe', this);
30793 }return this;
30794 }
30795
30796 // try to find the right one.
30797 var index = indexOf(state.pipes, dest);
30798 if (index === -1) return this;
30799
30800 state.pipes.splice(index, 1);
30801 state.pipesCount -= 1;
30802 if (state.pipesCount === 1) state.pipes = state.pipes[0];
30803
30804 dest.emit('unpipe', this);
30805
30806 return this;
30807};
30808
30809// set up data events if they are asked for
30810// Ensure readable listeners eventually get something
30811Readable.prototype.on = function (ev, fn) {
30812 var res = Stream.prototype.on.call(this, ev, fn);
30813
30814 if (ev === 'data') {
30815 // Start flowing on next tick if stream isn't explicitly paused
30816 if (this._readableState.flowing !== false) this.resume();
30817 } else if (ev === 'readable') {
30818 var state = this._readableState;
30819 if (!state.endEmitted && !state.readableListening) {
30820 state.readableListening = state.needReadable = true;
30821 state.emittedReadable = false;
30822 if (!state.reading) {
30823 processNextTick(nReadingNextTick, this);
30824 } else if (state.length) {
30825 emitReadable(this, state);
30826 }
30827 }
30828 }
30829
30830 return res;
30831};
30832Readable.prototype.addListener = Readable.prototype.on;
30833
30834function nReadingNextTick(self) {
30835 debug('readable nexttick read 0');
30836 self.read(0);
30837}
30838
30839// pause() and resume() are remnants of the legacy readable stream API
30840// If the user uses them, then switch into old mode.
30841Readable.prototype.resume = function () {
30842 var state = this._readableState;
30843 if (!state.flowing) {
30844 debug('resume');
30845 state.flowing = true;
30846 resume(this, state);
30847 }
30848 return this;
30849};
30850
30851function resume(stream, state) {
30852 if (!state.resumeScheduled) {
30853 state.resumeScheduled = true;
30854 processNextTick(resume_, stream, state);
30855 }
30856}
30857
30858function resume_(stream, state) {
30859 if (!state.reading) {
30860 debug('resume read 0');
30861 stream.read(0);
30862 }
30863
30864 state.resumeScheduled = false;
30865 state.awaitDrain = 0;
30866 stream.emit('resume');
30867 flow(stream);
30868 if (state.flowing && !state.reading) stream.read(0);
30869}
30870
30871Readable.prototype.pause = function () {
30872 debug('call pause flowing=%j', this._readableState.flowing);
30873 if (false !== this._readableState.flowing) {
30874 debug('pause');
30875 this._readableState.flowing = false;
30876 this.emit('pause');
30877 }
30878 return this;
30879};
30880
30881function flow(stream) {
30882 var state = stream._readableState;
30883 debug('flow', state.flowing);
30884 while (state.flowing && stream.read() !== null) {}
30885}
30886
30887// wrap an old-style stream as the async data source.
30888// This is *not* part of the readable stream interface.
30889// It is an ugly unfortunate mess of history.
30890Readable.prototype.wrap = function (stream) {
30891 var state = this._readableState;
30892 var paused = false;
30893
30894 var self = this;
30895 stream.on('end', function () {
30896 debug('wrapped end');
30897 if (state.decoder && !state.ended) {
30898 var chunk = state.decoder.end();
30899 if (chunk && chunk.length) self.push(chunk);
30900 }
30901
30902 self.push(null);
30903 });
30904
30905 stream.on('data', function (chunk) {
30906 debug('wrapped data');
30907 if (state.decoder) chunk = state.decoder.write(chunk);
30908
30909 // don't skip over falsy values in objectMode
30910 if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
30911
30912 var ret = self.push(chunk);
30913 if (!ret) {
30914 paused = true;
30915 stream.pause();
30916 }
30917 });
30918
30919 // proxy all the other methods.
30920 // important when wrapping filters and duplexes.
30921 for (var i in stream) {
30922 if (this[i] === undefined && typeof stream[i] === 'function') {
30923 this[i] = function (method) {
30924 return function () {
30925 return stream[method].apply(stream, arguments);
30926 };
30927 }(i);
30928 }
30929 }
30930
30931 // proxy certain important events.
30932 for (var n = 0; n < kProxyEvents.length; n++) {
30933 stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n]));
30934 }
30935
30936 // when we try to consume some more bytes, simply unpause the
30937 // underlying stream.
30938 self._read = function (n) {
30939 debug('wrapped _read', n);
30940 if (paused) {
30941 paused = false;
30942 stream.resume();
30943 }
30944 };
30945
30946 return self;
30947};
30948
30949// exposed for testing purposes only.
30950Readable._fromList = fromList;
30951
30952// Pluck off n bytes from an array of buffers.
30953// Length is the combined lengths of all the buffers in the list.
30954// This function is designed to be inlinable, so please take care when making
30955// changes to the function body.
30956function fromList(n, state) {
30957 // nothing buffered
30958 if (state.length === 0) return null;
30959
30960 var ret;
30961 if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
30962 // read it all, truncate the list
30963 if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
30964 state.buffer.clear();
30965 } else {
30966 // read part of list
30967 ret = fromListPartial(n, state.buffer, state.decoder);
30968 }
30969
30970 return ret;
30971}
30972
30973// Extracts only enough buffered data to satisfy the amount requested.
30974// This function is designed to be inlinable, so please take care when making
30975// changes to the function body.
30976function fromListPartial(n, list, hasStrings) {
30977 var ret;
30978 if (n < list.head.data.length) {
30979 // slice is the same for buffers and strings
30980 ret = list.head.data.slice(0, n);
30981 list.head.data = list.head.data.slice(n);
30982 } else if (n === list.head.data.length) {
30983 // first chunk is a perfect match
30984 ret = list.shift();
30985 } else {
30986 // result spans more than one buffer
30987 ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
30988 }
30989 return ret;
30990}
30991
30992// Copies a specified amount of characters from the list of buffered data
30993// chunks.
30994// This function is designed to be inlinable, so please take care when making
30995// changes to the function body.
30996function copyFromBufferString(n, list) {
30997 var p = list.head;
30998 var c = 1;
30999 var ret = p.data;
31000 n -= ret.length;
31001 while (p = p.next) {
31002 var str = p.data;
31003 var nb = n > str.length ? str.length : n;
31004 if (nb === str.length) ret += str;else ret += str.slice(0, n);
31005 n -= nb;
31006 if (n === 0) {
31007 if (nb === str.length) {
31008 ++c;
31009 if (p.next) list.head = p.next;else list.head = list.tail = null;
31010 } else {
31011 list.head = p;
31012 p.data = str.slice(nb);
31013 }
31014 break;
31015 }
31016 ++c;
31017 }
31018 list.length -= c;
31019 return ret;
31020}
31021
31022// Copies a specified amount of bytes from the list of buffered data chunks.
31023// This function is designed to be inlinable, so please take care when making
31024// changes to the function body.
31025function copyFromBuffer(n, list) {
31026 var ret = bufferShim.allocUnsafe(n);
31027 var p = list.head;
31028 var c = 1;
31029 p.data.copy(ret);
31030 n -= p.data.length;
31031 while (p = p.next) {
31032 var buf = p.data;
31033 var nb = n > buf.length ? buf.length : n;
31034 buf.copy(ret, ret.length - n, 0, nb);
31035 n -= nb;
31036 if (n === 0) {
31037 if (nb === buf.length) {
31038 ++c;
31039 if (p.next) list.head = p.next;else list.head = list.tail = null;
31040 } else {
31041 list.head = p;
31042 p.data = buf.slice(nb);
31043 }
31044 break;
31045 }
31046 ++c;
31047 }
31048 list.length -= c;
31049 return ret;
31050}
31051
31052function endReadable(stream) {
31053 var state = stream._readableState;
31054
31055 // If we get here before consuming all the bytes, then that is a
31056 // bug in node. Should never happen.
31057 if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
31058
31059 if (!state.endEmitted) {
31060 state.ended = true;
31061 processNextTick(endReadableNT, state, stream);
31062 }
31063}
31064
31065function endReadableNT(state, stream) {
31066 // Check that we didn't get one last unshift.
31067 if (!state.endEmitted && state.length === 0) {
31068 state.endEmitted = true;
31069 stream.readable = false;
31070 stream.emit('end');
31071 }
31072}
31073
31074function forEach(xs, f) {
31075 for (var i = 0, l = xs.length; i < l; i++) {
31076 f(xs[i], i);
31077 }
31078}
31079
31080function indexOf(xs, x) {
31081 for (var i = 0, l = xs.length; i < l; i++) {
31082 if (xs[i] === x) return i;
31083 }
31084 return -1;
31085}
31086}).call(this,require('_process'))
31087},{"./_stream_duplex":15,"./internal/streams/BufferList":20,"./internal/streams/stream":21,"_process":13,"buffer":5,"buffer-shims":4,"core-util-is":6,"events":7,"inherits":9,"isarray":11,"process-nextick-args":12,"string_decoder/":22,"util":3}],18:[function(require,module,exports){
31088// a transform stream is a readable/writable stream where you do
31089// something with the data. Sometimes it's called a "filter",
31090// but that's not a great name for it, since that implies a thing where
31091// some bits pass through, and others are simply ignored. (That would
31092// be a valid example of a transform, of course.)
31093//
31094// While the output is causally related to the input, it's not a
31095// necessarily symmetric or synchronous transformation. For example,
31096// a zlib stream might take multiple plain-text writes(), and then
31097// emit a single compressed chunk some time in the future.
31098//
31099// Here's how this works:
31100//
31101// The Transform stream has all the aspects of the readable and writable
31102// stream classes. When you write(chunk), that calls _write(chunk,cb)
31103// internally, and returns false if there's a lot of pending writes
31104// buffered up. When you call read(), that calls _read(n) until
31105// there's enough pending readable data buffered up.
31106//
31107// In a transform stream, the written data is placed in a buffer. When
31108// _read(n) is called, it transforms the queued up data, calling the
31109// buffered _write cb's as it consumes chunks. If consuming a single
31110// written chunk would result in multiple output chunks, then the first
31111// outputted bit calls the readcb, and subsequent chunks just go into
31112// the read buffer, and will cause it to emit 'readable' if necessary.
31113//
31114// This way, back-pressure is actually determined by the reading side,
31115// since _read has to be called to start processing a new chunk. However,
31116// a pathological inflate type of transform can cause excessive buffering
31117// here. For example, imagine a stream where every byte of input is
31118// interpreted as an integer from 0-255, and then results in that many
31119// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
31120// 1kb of data being output. In this case, you could write a very small
31121// amount of input, and end up with a very large amount of output. In
31122// such a pathological inflating mechanism, there'd be no way to tell
31123// the system to stop doing the transform. A single 4MB write could
31124// cause the system to run out of memory.
31125//
31126// However, even in such a pathological case, only a single written chunk
31127// would be consumed, and then the rest would wait (un-transformed) until
31128// the results of the previous transformed chunk were consumed.
31129
31130'use strict';
31131
31132module.exports = Transform;
31133
31134var Duplex = require('./_stream_duplex');
31135
31136/*<replacement>*/
31137var util = require('core-util-is');
31138util.inherits = require('inherits');
31139/*</replacement>*/
31140
31141util.inherits(Transform, Duplex);
31142
31143function TransformState(stream) {
31144 this.afterTransform = function (er, data) {
31145 return afterTransform(stream, er, data);
31146 };
31147
31148 this.needTransform = false;
31149 this.transforming = false;
31150 this.writecb = null;
31151 this.writechunk = null;
31152 this.writeencoding = null;
31153}
31154
31155function afterTransform(stream, er, data) {
31156 var ts = stream._transformState;
31157 ts.transforming = false;
31158
31159 var cb = ts.writecb;
31160
31161 if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));
31162
31163 ts.writechunk = null;
31164 ts.writecb = null;
31165
31166 if (data !== null && data !== undefined) stream.push(data);
31167
31168 cb(er);
31169
31170 var rs = stream._readableState;
31171 rs.reading = false;
31172 if (rs.needReadable || rs.length < rs.highWaterMark) {
31173 stream._read(rs.highWaterMark);
31174 }
31175}
31176
31177function Transform(options) {
31178 if (!(this instanceof Transform)) return new Transform(options);
31179
31180 Duplex.call(this, options);
31181
31182 this._transformState = new TransformState(this);
31183
31184 var stream = this;
31185
31186 // start out asking for a readable event once data is transformed.
31187 this._readableState.needReadable = true;
31188
31189 // we have implemented the _read method, and done the other things
31190 // that Readable wants before the first _read call, so unset the
31191 // sync guard flag.
31192 this._readableState.sync = false;
31193
31194 if (options) {
31195 if (typeof options.transform === 'function') this._transform = options.transform;
31196
31197 if (typeof options.flush === 'function') this._flush = options.flush;
31198 }
31199
31200 // When the writable side finishes, then flush out anything remaining.
31201 this.once('prefinish', function () {
31202 if (typeof this._flush === 'function') this._flush(function (er, data) {
31203 done(stream, er, data);
31204 });else done(stream);
31205 });
31206}
31207
31208Transform.prototype.push = function (chunk, encoding) {
31209 this._transformState.needTransform = false;
31210 return Duplex.prototype.push.call(this, chunk, encoding);
31211};
31212
31213// This is the part where you do stuff!
31214// override this function in implementation classes.
31215// 'chunk' is an input chunk.
31216//
31217// Call `push(newChunk)` to pass along transformed output
31218// to the readable side. You may call 'push' zero or more times.
31219//
31220// Call `cb(err)` when you are done with this chunk. If you pass
31221// an error, then that'll put the hurt on the whole operation. If you
31222// never call cb(), then you'll never get another chunk.
31223Transform.prototype._transform = function (chunk, encoding, cb) {
31224 throw new Error('_transform() is not implemented');
31225};
31226
31227Transform.prototype._write = function (chunk, encoding, cb) {
31228 var ts = this._transformState;
31229 ts.writecb = cb;
31230 ts.writechunk = chunk;
31231 ts.writeencoding = encoding;
31232 if (!ts.transforming) {
31233 var rs = this._readableState;
31234 if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
31235 }
31236};
31237
31238// Doesn't matter what the args are here.
31239// _transform does all the work.
31240// That we got here means that the readable side wants more data.
31241Transform.prototype._read = function (n) {
31242 var ts = this._transformState;
31243
31244 if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
31245 ts.transforming = true;
31246 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
31247 } else {
31248 // mark that we need a transform, so that any data that comes in
31249 // will get processed, now that we've asked for it.
31250 ts.needTransform = true;
31251 }
31252};
31253
31254function done(stream, er, data) {
31255 if (er) return stream.emit('error', er);
31256
31257 if (data !== null && data !== undefined) stream.push(data);
31258
31259 // if there's nothing in the write buffer, then that means
31260 // that nothing more will ever be provided
31261 var ws = stream._writableState;
31262 var ts = stream._transformState;
31263
31264 if (ws.length) throw new Error('Calling transform done when ws.length != 0');
31265
31266 if (ts.transforming) throw new Error('Calling transform done when still transforming');
31267
31268 return stream.push(null);
31269}
31270},{"./_stream_duplex":15,"core-util-is":6,"inherits":9}],19:[function(require,module,exports){
31271(function (process){
31272// A bit simpler than readable streams.
31273// Implement an async ._write(chunk, encoding, cb), and it'll handle all
31274// the drain event emission and buffering.
31275
31276'use strict';
31277
31278module.exports = Writable;
31279
31280/*<replacement>*/
31281var processNextTick = require('process-nextick-args');
31282/*</replacement>*/
31283
31284/*<replacement>*/
31285var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
31286/*</replacement>*/
31287
31288/*<replacement>*/
31289var Duplex;
31290/*</replacement>*/
31291
31292Writable.WritableState = WritableState;
31293
31294/*<replacement>*/
31295var util = require('core-util-is');
31296util.inherits = require('inherits');
31297/*</replacement>*/
31298
31299/*<replacement>*/
31300var internalUtil = {
31301 deprecate: require('util-deprecate')
31302};
31303/*</replacement>*/
31304
31305/*<replacement>*/
31306var Stream = require('./internal/streams/stream');
31307/*</replacement>*/
31308
31309var Buffer = require('buffer').Buffer;
31310/*<replacement>*/
31311var bufferShim = require('buffer-shims');
31312/*</replacement>*/
31313
31314util.inherits(Writable, Stream);
31315
31316function nop() {}
31317
31318function WriteReq(chunk, encoding, cb) {
31319 this.chunk = chunk;
31320 this.encoding = encoding;
31321 this.callback = cb;
31322 this.next = null;
31323}
31324
31325function WritableState(options, stream) {
31326 Duplex = Duplex || require('./_stream_duplex');
31327
31328 options = options || {};
31329
31330 // object stream flag to indicate whether or not this stream
31331 // contains buffers or objects.
31332 this.objectMode = !!options.objectMode;
31333
31334 if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
31335
31336 // the point at which write() starts returning false
31337 // Note: 0 is a valid value, means that we always return false if
31338 // the entire buffer is not flushed immediately on write()
31339 var hwm = options.highWaterMark;
31340 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
31341 this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
31342
31343 // cast to ints.
31344 this.highWaterMark = ~~this.highWaterMark;
31345
31346 // drain event flag.
31347 this.needDrain = false;
31348 // at the start of calling end()
31349 this.ending = false;
31350 // when end() has been called, and returned
31351 this.ended = false;
31352 // when 'finish' is emitted
31353 this.finished = false;
31354
31355 // should we decode strings into buffers before passing to _write?
31356 // this is here so that some node-core streams can optimize string
31357 // handling at a lower level.
31358 var noDecode = options.decodeStrings === false;
31359 this.decodeStrings = !noDecode;
31360
31361 // Crypto is kind of old and crusty. Historically, its default string
31362 // encoding is 'binary' so we have to make this configurable.
31363 // Everything else in the universe uses 'utf8', though.
31364 this.defaultEncoding = options.defaultEncoding || 'utf8';
31365
31366 // not an actual buffer we keep track of, but a measurement
31367 // of how much we're waiting to get pushed to some underlying
31368 // socket or file.
31369 this.length = 0;
31370
31371 // a flag to see when we're in the middle of a write.
31372 this.writing = false;
31373
31374 // when true all writes will be buffered until .uncork() call
31375 this.corked = 0;
31376
31377 // a flag to be able to tell if the onwrite cb is called immediately,
31378 // or on a later tick. We set this to true at first, because any
31379 // actions that shouldn't happen until "later" should generally also
31380 // not happen before the first write call.
31381 this.sync = true;
31382
31383 // a flag to know if we're processing previously buffered items, which
31384 // may call the _write() callback in the same tick, so that we don't
31385 // end up in an overlapped onwrite situation.
31386 this.bufferProcessing = false;
31387
31388 // the callback that's passed to _write(chunk,cb)
31389 this.onwrite = function (er) {
31390 onwrite(stream, er);
31391 };
31392
31393 // the callback that the user supplies to write(chunk,encoding,cb)
31394 this.writecb = null;
31395
31396 // the amount that is being written when _write is called.
31397 this.writelen = 0;
31398
31399 this.bufferedRequest = null;
31400 this.lastBufferedRequest = null;
31401
31402 // number of pending user-supplied write callbacks
31403 // this must be 0 before 'finish' can be emitted
31404 this.pendingcb = 0;
31405
31406 // emit prefinish if the only thing we're waiting for is _write cbs
31407 // This is relevant for synchronous Transform streams
31408 this.prefinished = false;
31409
31410 // True if the error was already emitted and should not be thrown again
31411 this.errorEmitted = false;
31412
31413 // count buffered requests
31414 this.bufferedRequestCount = 0;
31415
31416 // allocate the first CorkedRequest, there is always
31417 // one allocated and free to use, and we maintain at most two
31418 this.corkedRequestsFree = new CorkedRequest(this);
31419}
31420
31421WritableState.prototype.getBuffer = function getBuffer() {
31422 var current = this.bufferedRequest;
31423 var out = [];
31424 while (current) {
31425 out.push(current);
31426 current = current.next;
31427 }
31428 return out;
31429};
31430
31431(function () {
31432 try {
31433 Object.defineProperty(WritableState.prototype, 'buffer', {
31434 get: internalUtil.deprecate(function () {
31435 return this.getBuffer();
31436 }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
31437 });
31438 } catch (_) {}
31439})();
31440
31441// Test _writableState for inheritance to account for Duplex streams,
31442// whose prototype chain only points to Readable.
31443var realHasInstance;
31444if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
31445 realHasInstance = Function.prototype[Symbol.hasInstance];
31446 Object.defineProperty(Writable, Symbol.hasInstance, {
31447 value: function (object) {
31448 if (realHasInstance.call(this, object)) return true;
31449
31450 return object && object._writableState instanceof WritableState;
31451 }
31452 });
31453} else {
31454 realHasInstance = function (object) {
31455 return object instanceof this;
31456 };
31457}
31458
31459function Writable(options) {
31460 Duplex = Duplex || require('./_stream_duplex');
31461
31462 // Writable ctor is applied to Duplexes, too.
31463 // `realHasInstance` is necessary because using plain `instanceof`
31464 // would return false, as no `_writableState` property is attached.
31465
31466 // Trying to use the custom `instanceof` for Writable here will also break the
31467 // Node.js LazyTransform implementation, which has a non-trivial getter for
31468 // `_writableState` that would lead to infinite recursion.
31469 if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
31470 return new Writable(options);
31471 }
31472
31473 this._writableState = new WritableState(options, this);
31474
31475 // legacy.
31476 this.writable = true;
31477
31478 if (options) {
31479 if (typeof options.write === 'function') this._write = options.write;
31480
31481 if (typeof options.writev === 'function') this._writev = options.writev;
31482 }
31483
31484 Stream.call(this);
31485}
31486
31487// Otherwise people can pipe Writable streams, which is just wrong.
31488Writable.prototype.pipe = function () {
31489 this.emit('error', new Error('Cannot pipe, not readable'));
31490};
31491
31492function writeAfterEnd(stream, cb) {
31493 var er = new Error('write after end');
31494 // TODO: defer error events consistently everywhere, not just the cb
31495 stream.emit('error', er);
31496 processNextTick(cb, er);
31497}
31498
31499// Checks that a user-supplied chunk is valid, especially for the particular
31500// mode the stream is in. Currently this means that `null` is never accepted
31501// and undefined/non-string values are only allowed in object mode.
31502function validChunk(stream, state, chunk, cb) {
31503 var valid = true;
31504 var er = false;
31505
31506 if (chunk === null) {
31507 er = new TypeError('May not write null values to stream');
31508 } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
31509 er = new TypeError('Invalid non-string/buffer chunk');
31510 }
31511 if (er) {
31512 stream.emit('error', er);
31513 processNextTick(cb, er);
31514 valid = false;
31515 }
31516 return valid;
31517}
31518
31519Writable.prototype.write = function (chunk, encoding, cb) {
31520 var state = this._writableState;
31521 var ret = false;
31522 var isBuf = Buffer.isBuffer(chunk);
31523
31524 if (typeof encoding === 'function') {
31525 cb = encoding;
31526 encoding = null;
31527 }
31528
31529 if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
31530
31531 if (typeof cb !== 'function') cb = nop;
31532
31533 if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
31534 state.pendingcb++;
31535 ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
31536 }
31537
31538 return ret;
31539};
31540
31541Writable.prototype.cork = function () {
31542 var state = this._writableState;
31543
31544 state.corked++;
31545};
31546
31547Writable.prototype.uncork = function () {
31548 var state = this._writableState;
31549
31550 if (state.corked) {
31551 state.corked--;
31552
31553 if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
31554 }
31555};
31556
31557Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
31558 // node::ParseEncoding() requires lower case.
31559 if (typeof encoding === 'string') encoding = encoding.toLowerCase();
31560 if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
31561 this._writableState.defaultEncoding = encoding;
31562 return this;
31563};
31564
31565function decodeChunk(state, chunk, encoding) {
31566 if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
31567 chunk = bufferShim.from(chunk, encoding);
31568 }
31569 return chunk;
31570}
31571
31572// if we're already writing something, then just put this
31573// in the queue, and wait our turn. Otherwise, call _write
31574// If we return false, then we need a drain event, so set that flag.
31575function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
31576 if (!isBuf) {
31577 chunk = decodeChunk(state, chunk, encoding);
31578 if (Buffer.isBuffer(chunk)) encoding = 'buffer';
31579 }
31580 var len = state.objectMode ? 1 : chunk.length;
31581
31582 state.length += len;
31583
31584 var ret = state.length < state.highWaterMark;
31585 // we must ensure that previous needDrain will not be reset to false.
31586 if (!ret) state.needDrain = true;
31587
31588 if (state.writing || state.corked) {
31589 var last = state.lastBufferedRequest;
31590 state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
31591 if (last) {
31592 last.next = state.lastBufferedRequest;
31593 } else {
31594 state.bufferedRequest = state.lastBufferedRequest;
31595 }
31596 state.bufferedRequestCount += 1;
31597 } else {
31598 doWrite(stream, state, false, len, chunk, encoding, cb);
31599 }
31600
31601 return ret;
31602}
31603
31604function doWrite(stream, state, writev, len, chunk, encoding, cb) {
31605 state.writelen = len;
31606 state.writecb = cb;
31607 state.writing = true;
31608 state.sync = true;
31609 if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
31610 state.sync = false;
31611}
31612
31613function onwriteError(stream, state, sync, er, cb) {
31614 --state.pendingcb;
31615 if (sync) processNextTick(cb, er);else cb(er);
31616
31617 stream._writableState.errorEmitted = true;
31618 stream.emit('error', er);
31619}
31620
31621function onwriteStateUpdate(state) {
31622 state.writing = false;
31623 state.writecb = null;
31624 state.length -= state.writelen;
31625 state.writelen = 0;
31626}
31627
31628function onwrite(stream, er) {
31629 var state = stream._writableState;
31630 var sync = state.sync;
31631 var cb = state.writecb;
31632
31633 onwriteStateUpdate(state);
31634
31635 if (er) onwriteError(stream, state, sync, er, cb);else {
31636 // Check if we're actually ready to finish, but don't emit yet
31637 var finished = needFinish(state);
31638
31639 if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
31640 clearBuffer(stream, state);
31641 }
31642
31643 if (sync) {
31644 /*<replacement>*/
31645 asyncWrite(afterWrite, stream, state, finished, cb);
31646 /*</replacement>*/
31647 } else {
31648 afterWrite(stream, state, finished, cb);
31649 }
31650 }
31651}
31652
31653function afterWrite(stream, state, finished, cb) {
31654 if (!finished) onwriteDrain(stream, state);
31655 state.pendingcb--;
31656 cb();
31657 finishMaybe(stream, state);
31658}
31659
31660// Must force callback to be called on nextTick, so that we don't
31661// emit 'drain' before the write() consumer gets the 'false' return
31662// value, and has a chance to attach a 'drain' listener.
31663function onwriteDrain(stream, state) {
31664 if (state.length === 0 && state.needDrain) {
31665 state.needDrain = false;
31666 stream.emit('drain');
31667 }
31668}
31669
31670// if there's something in the buffer waiting, then process it
31671function clearBuffer(stream, state) {
31672 state.bufferProcessing = true;
31673 var entry = state.bufferedRequest;
31674
31675 if (stream._writev && entry && entry.next) {
31676 // Fast case, write everything using _writev()
31677 var l = state.bufferedRequestCount;
31678 var buffer = new Array(l);
31679 var holder = state.corkedRequestsFree;
31680 holder.entry = entry;
31681
31682 var count = 0;
31683 while (entry) {
31684 buffer[count] = entry;
31685 entry = entry.next;
31686 count += 1;
31687 }
31688
31689 doWrite(stream, state, true, state.length, buffer, '', holder.finish);
31690
31691 // doWrite is almost always async, defer these to save a bit of time
31692 // as the hot path ends with doWrite
31693 state.pendingcb++;
31694 state.lastBufferedRequest = null;
31695 if (holder.next) {
31696 state.corkedRequestsFree = holder.next;
31697 holder.next = null;
31698 } else {
31699 state.corkedRequestsFree = new CorkedRequest(state);
31700 }
31701 } else {
31702 // Slow case, write chunks one-by-one
31703 while (entry) {
31704 var chunk = entry.chunk;
31705 var encoding = entry.encoding;
31706 var cb = entry.callback;
31707 var len = state.objectMode ? 1 : chunk.length;
31708
31709 doWrite(stream, state, false, len, chunk, encoding, cb);
31710 entry = entry.next;
31711 // if we didn't call the onwrite immediately, then
31712 // it means that we need to wait until it does.
31713 // also, that means that the chunk and cb are currently
31714 // being processed, so move the buffer counter past them.
31715 if (state.writing) {
31716 break;
31717 }
31718 }
31719
31720 if (entry === null) state.lastBufferedRequest = null;
31721 }
31722
31723 state.bufferedRequestCount = 0;
31724 state.bufferedRequest = entry;
31725 state.bufferProcessing = false;
31726}
31727
31728Writable.prototype._write = function (chunk, encoding, cb) {
31729 cb(new Error('_write() is not implemented'));
31730};
31731
31732Writable.prototype._writev = null;
31733
31734Writable.prototype.end = function (chunk, encoding, cb) {
31735 var state = this._writableState;
31736
31737 if (typeof chunk === 'function') {
31738 cb = chunk;
31739 chunk = null;
31740 encoding = null;
31741 } else if (typeof encoding === 'function') {
31742 cb = encoding;
31743 encoding = null;
31744 }
31745
31746 if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
31747
31748 // .end() fully uncorks
31749 if (state.corked) {
31750 state.corked = 1;
31751 this.uncork();
31752 }
31753
31754 // ignore unnecessary end() calls.
31755 if (!state.ending && !state.finished) endWritable(this, state, cb);
31756};
31757
31758function needFinish(state) {
31759 return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
31760}
31761
31762function prefinish(stream, state) {
31763 if (!state.prefinished) {
31764 state.prefinished = true;
31765 stream.emit('prefinish');
31766 }
31767}
31768
31769function finishMaybe(stream, state) {
31770 var need = needFinish(state);
31771 if (need) {
31772 if (state.pendingcb === 0) {
31773 prefinish(stream, state);
31774 state.finished = true;
31775 stream.emit('finish');
31776 } else {
31777 prefinish(stream, state);
31778 }
31779 }
31780 return need;
31781}
31782
31783function endWritable(stream, state, cb) {
31784 state.ending = true;
31785 finishMaybe(stream, state);
31786 if (cb) {
31787 if (state.finished) processNextTick(cb);else stream.once('finish', cb);
31788 }
31789 state.ended = true;
31790 stream.writable = false;
31791}
31792
31793// It seems a linked list but it is not
31794// there will be only 2 of these for each stream
31795function CorkedRequest(state) {
31796 var _this = this;
31797
31798 this.next = null;
31799 this.entry = null;
31800 this.finish = function (err) {
31801 var entry = _this.entry;
31802 _this.entry = null;
31803 while (entry) {
31804 var cb = entry.callback;
31805 state.pendingcb--;
31806 cb(err);
31807 entry = entry.next;
31808 }
31809 if (state.corkedRequestsFree) {
31810 state.corkedRequestsFree.next = _this;
31811 } else {
31812 state.corkedRequestsFree = _this;
31813 }
31814 };
31815}
31816}).call(this,require('_process'))
31817},{"./_stream_duplex":15,"./internal/streams/stream":21,"_process":13,"buffer":5,"buffer-shims":4,"core-util-is":6,"inherits":9,"process-nextick-args":12,"util-deprecate":30}],20:[function(require,module,exports){
31818'use strict';
31819
31820var Buffer = require('buffer').Buffer;
31821/*<replacement>*/
31822var bufferShim = require('buffer-shims');
31823/*</replacement>*/
31824
31825module.exports = BufferList;
31826
31827function BufferList() {
31828 this.head = null;
31829 this.tail = null;
31830 this.length = 0;
31831}
31832
31833BufferList.prototype.push = function (v) {
31834 var entry = { data: v, next: null };
31835 if (this.length > 0) this.tail.next = entry;else this.head = entry;
31836 this.tail = entry;
31837 ++this.length;
31838};
31839
31840BufferList.prototype.unshift = function (v) {
31841 var entry = { data: v, next: this.head };
31842 if (this.length === 0) this.tail = entry;
31843 this.head = entry;
31844 ++this.length;
31845};
31846
31847BufferList.prototype.shift = function () {
31848 if (this.length === 0) return;
31849 var ret = this.head.data;
31850 if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
31851 --this.length;
31852 return ret;
31853};
31854
31855BufferList.prototype.clear = function () {
31856 this.head = this.tail = null;
31857 this.length = 0;
31858};
31859
31860BufferList.prototype.join = function (s) {
31861 if (this.length === 0) return '';
31862 var p = this.head;
31863 var ret = '' + p.data;
31864 while (p = p.next) {
31865 ret += s + p.data;
31866 }return ret;
31867};
31868
31869BufferList.prototype.concat = function (n) {
31870 if (this.length === 0) return bufferShim.alloc(0);
31871 if (this.length === 1) return this.head.data;
31872 var ret = bufferShim.allocUnsafe(n >>> 0);
31873 var p = this.head;
31874 var i = 0;
31875 while (p) {
31876 p.data.copy(ret, i);
31877 i += p.data.length;
31878 p = p.next;
31879 }
31880 return ret;
31881};
31882},{"buffer":5,"buffer-shims":4}],21:[function(require,module,exports){
31883module.exports = require('events').EventEmitter;
31884
31885},{"events":7}],22:[function(require,module,exports){
31886'use strict';
31887
31888var Buffer = require('safe-buffer').Buffer;
31889
31890var isEncoding = Buffer.isEncoding || function (encoding) {
31891 encoding = '' + encoding;
31892 switch (encoding && encoding.toLowerCase()) {
31893 case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
31894 return true;
31895 default:
31896 return false;
31897 }
31898};
31899
31900function _normalizeEncoding(enc) {
31901 if (!enc) return 'utf8';
31902 var retried;
31903 while (true) {
31904 switch (enc) {
31905 case 'utf8':
31906 case 'utf-8':
31907 return 'utf8';
31908 case 'ucs2':
31909 case 'ucs-2':
31910 case 'utf16le':
31911 case 'utf-16le':
31912 return 'utf16le';
31913 case 'latin1':
31914 case 'binary':
31915 return 'latin1';
31916 case 'base64':
31917 case 'ascii':
31918 case 'hex':
31919 return enc;
31920 default:
31921 if (retried) return; // undefined
31922 enc = ('' + enc).toLowerCase();
31923 retried = true;
31924 }
31925 }
31926};
31927
31928// Do not cache `Buffer.isEncoding` when checking encoding names as some
31929// modules monkey-patch it to support additional encodings
31930function normalizeEncoding(enc) {
31931 var nenc = _normalizeEncoding(enc);
31932 if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
31933 return nenc || enc;
31934}
31935
31936// StringDecoder provides an interface for efficiently splitting a series of
31937// buffers into a series of JS strings without breaking apart multi-byte
31938// characters.
31939exports.StringDecoder = StringDecoder;
31940function StringDecoder(encoding) {
31941 this.encoding = normalizeEncoding(encoding);
31942 var nb;
31943 switch (this.encoding) {
31944 case 'utf16le':
31945 this.text = utf16Text;
31946 this.end = utf16End;
31947 nb = 4;
31948 break;
31949 case 'utf8':
31950 this.fillLast = utf8FillLast;
31951 nb = 4;
31952 break;
31953 case 'base64':
31954 this.text = base64Text;
31955 this.end = base64End;
31956 nb = 3;
31957 break;
31958 default:
31959 this.write = simpleWrite;
31960 this.end = simpleEnd;
31961 return;
31962 }
31963 this.lastNeed = 0;
31964 this.lastTotal = 0;
31965 this.lastChar = Buffer.allocUnsafe(nb);
31966}
31967
31968StringDecoder.prototype.write = function (buf) {
31969 if (buf.length === 0) return '';
31970 var r;
31971 var i;
31972 if (this.lastNeed) {
31973 r = this.fillLast(buf);
31974 if (r === undefined) return '';
31975 i = this.lastNeed;
31976 this.lastNeed = 0;
31977 } else {
31978 i = 0;
31979 }
31980 if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
31981 return r || '';
31982};
31983
31984StringDecoder.prototype.end = utf8End;
31985
31986// Returns only complete characters in a Buffer
31987StringDecoder.prototype.text = utf8Text;
31988
31989// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
31990StringDecoder.prototype.fillLast = function (buf) {
31991 if (this.lastNeed <= buf.length) {
31992 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
31993 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
31994 }
31995 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
31996 this.lastNeed -= buf.length;
31997};
31998
31999// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
32000// continuation byte.
32001function utf8CheckByte(byte) {
32002 if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
32003 return -1;
32004}
32005
32006// Checks at most 3 bytes at the end of a Buffer in order to detect an
32007// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
32008// needed to complete the UTF-8 character (if applicable) are returned.
32009function utf8CheckIncomplete(self, buf, i) {
32010 var j = buf.length - 1;
32011 if (j < i) return 0;
32012 var nb = utf8CheckByte(buf[j]);
32013 if (nb >= 0) {
32014 if (nb > 0) self.lastNeed = nb - 1;
32015 return nb;
32016 }
32017 if (--j < i) return 0;
32018 nb = utf8CheckByte(buf[j]);
32019 if (nb >= 0) {
32020 if (nb > 0) self.lastNeed = nb - 2;
32021 return nb;
32022 }
32023 if (--j < i) return 0;
32024 nb = utf8CheckByte(buf[j]);
32025 if (nb >= 0) {
32026 if (nb > 0) {
32027 if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
32028 }
32029 return nb;
32030 }
32031 return 0;
32032}
32033
32034// Validates as many continuation bytes for a multi-byte UTF-8 character as
32035// needed or are available. If we see a non-continuation byte where we expect
32036// one, we "replace" the validated continuation bytes we've seen so far with
32037// UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding
32038// behavior. The continuation byte check is included three times in the case
32039// where all of the continuation bytes for a character exist in the same buffer.
32040// It is also done this way as a slight performance increase instead of using a
32041// loop.
32042function utf8CheckExtraBytes(self, buf, p) {
32043 if ((buf[0] & 0xC0) !== 0x80) {
32044 self.lastNeed = 0;
32045 return '\ufffd'.repeat(p);
32046 }
32047 if (self.lastNeed > 1 && buf.length > 1) {
32048 if ((buf[1] & 0xC0) !== 0x80) {
32049 self.lastNeed = 1;
32050 return '\ufffd'.repeat(p + 1);
32051 }
32052 if (self.lastNeed > 2 && buf.length > 2) {
32053 if ((buf[2] & 0xC0) !== 0x80) {
32054 self.lastNeed = 2;
32055 return '\ufffd'.repeat(p + 2);
32056 }
32057 }
32058 }
32059}
32060
32061// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
32062function utf8FillLast(buf) {
32063 var p = this.lastTotal - this.lastNeed;
32064 var r = utf8CheckExtraBytes(this, buf, p);
32065 if (r !== undefined) return r;
32066 if (this.lastNeed <= buf.length) {
32067 buf.copy(this.lastChar, p, 0, this.lastNeed);
32068 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
32069 }
32070 buf.copy(this.lastChar, p, 0, buf.length);
32071 this.lastNeed -= buf.length;
32072}
32073
32074// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
32075// partial character, the character's bytes are buffered until the required
32076// number of bytes are available.
32077function utf8Text(buf, i) {
32078 var total = utf8CheckIncomplete(this, buf, i);
32079 if (!this.lastNeed) return buf.toString('utf8', i);
32080 this.lastTotal = total;
32081 var end = buf.length - (total - this.lastNeed);
32082 buf.copy(this.lastChar, 0, end);
32083 return buf.toString('utf8', i, end);
32084}
32085
32086// For UTF-8, a replacement character for each buffered byte of a (partial)
32087// character needs to be added to the output.
32088function utf8End(buf) {
32089 var r = buf && buf.length ? this.write(buf) : '';
32090 if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed);
32091 return r;
32092}
32093
32094// UTF-16LE typically needs two bytes per character, but even if we have an even
32095// number of bytes available, we need to check if we end on a leading/high
32096// surrogate. In that case, we need to wait for the next two bytes in order to
32097// decode the last character properly.
32098function utf16Text(buf, i) {
32099 if ((buf.length - i) % 2 === 0) {
32100 var r = buf.toString('utf16le', i);
32101 if (r) {
32102 var c = r.charCodeAt(r.length - 1);
32103 if (c >= 0xD800 && c <= 0xDBFF) {
32104 this.lastNeed = 2;
32105 this.lastTotal = 4;
32106 this.lastChar[0] = buf[buf.length - 2];
32107 this.lastChar[1] = buf[buf.length - 1];
32108 return r.slice(0, -1);
32109 }
32110 }
32111 return r;
32112 }
32113 this.lastNeed = 1;
32114 this.lastTotal = 2;
32115 this.lastChar[0] = buf[buf.length - 1];
32116 return buf.toString('utf16le', i, buf.length - 1);
32117}
32118
32119// For UTF-16LE we do not explicitly append special replacement characters if we
32120// end on a partial character, we simply let v8 handle that.
32121function utf16End(buf) {
32122 var r = buf && buf.length ? this.write(buf) : '';
32123 if (this.lastNeed) {
32124 var end = this.lastTotal - this.lastNeed;
32125 return r + this.lastChar.toString('utf16le', 0, end);
32126 }
32127 return r;
32128}
32129
32130function base64Text(buf, i) {
32131 var n = (buf.length - i) % 3;
32132 if (n === 0) return buf.toString('base64', i);
32133 this.lastNeed = 3 - n;
32134 this.lastTotal = 3;
32135 if (n === 1) {
32136 this.lastChar[0] = buf[buf.length - 1];
32137 } else {
32138 this.lastChar[0] = buf[buf.length - 2];
32139 this.lastChar[1] = buf[buf.length - 1];
32140 }
32141 return buf.toString('base64', i, buf.length - n);
32142}
32143
32144function base64End(buf) {
32145 var r = buf && buf.length ? this.write(buf) : '';
32146 if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
32147 return r;
32148}
32149
32150// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
32151function simpleWrite(buf) {
32152 return buf.toString(this.encoding);
32153}
32154
32155function simpleEnd(buf) {
32156 return buf && buf.length ? this.write(buf) : '';
32157}
32158},{"safe-buffer":27}],23:[function(require,module,exports){
32159module.exports = require('./readable').PassThrough
32160
32161},{"./readable":24}],24:[function(require,module,exports){
32162exports = module.exports = require('./lib/_stream_readable.js');
32163exports.Stream = exports;
32164exports.Readable = exports;
32165exports.Writable = require('./lib/_stream_writable.js');
32166exports.Duplex = require('./lib/_stream_duplex.js');
32167exports.Transform = require('./lib/_stream_transform.js');
32168exports.PassThrough = require('./lib/_stream_passthrough.js');
32169
32170},{"./lib/_stream_duplex.js":15,"./lib/_stream_passthrough.js":16,"./lib/_stream_readable.js":17,"./lib/_stream_transform.js":18,"./lib/_stream_writable.js":19}],25:[function(require,module,exports){
32171module.exports = require('./readable').Transform
32172
32173},{"./readable":24}],26:[function(require,module,exports){
32174module.exports = require('./lib/_stream_writable.js');
32175
32176},{"./lib/_stream_writable.js":19}],27:[function(require,module,exports){
32177module.exports = require('buffer')
32178
32179},{"buffer":5}],28:[function(require,module,exports){
32180// Copyright Joyent, Inc. and other Node contributors.
32181//
32182// Permission is hereby granted, free of charge, to any person obtaining a
32183// copy of this software and associated documentation files (the
32184// "Software"), to deal in the Software without restriction, including
32185// without limitation the rights to use, copy, modify, merge, publish,
32186// distribute, sublicense, and/or sell copies of the Software, and to permit
32187// persons to whom the Software is furnished to do so, subject to the
32188// following conditions:
32189//
32190// The above copyright notice and this permission notice shall be included
32191// in all copies or substantial portions of the Software.
32192//
32193// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
32194// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32195// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
32196// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
32197// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
32198// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
32199// USE OR OTHER DEALINGS IN THE SOFTWARE.
32200
32201module.exports = Stream;
32202
32203var EE = require('events').EventEmitter;
32204var inherits = require('inherits');
32205
32206inherits(Stream, EE);
32207Stream.Readable = require('readable-stream/readable.js');
32208Stream.Writable = require('readable-stream/writable.js');
32209Stream.Duplex = require('readable-stream/duplex.js');
32210Stream.Transform = require('readable-stream/transform.js');
32211Stream.PassThrough = require('readable-stream/passthrough.js');
32212
32213// Backwards-compat with node 0.4.x
32214Stream.Stream = Stream;
32215
32216
32217
32218// old-style streams. Note that the pipe method (the only relevant
32219// part of this class) is overridden in the Readable class.
32220
32221function Stream() {
32222 EE.call(this);
32223}
32224
32225Stream.prototype.pipe = function(dest, options) {
32226 var source = this;
32227
32228 function ondata(chunk) {
32229 if (dest.writable) {
32230 if (false === dest.write(chunk) && source.pause) {
32231 source.pause();
32232 }
32233 }
32234 }
32235
32236 source.on('data', ondata);
32237
32238 function ondrain() {
32239 if (source.readable && source.resume) {
32240 source.resume();
32241 }
32242 }
32243
32244 dest.on('drain', ondrain);
32245
32246 // If the 'end' option is not supplied, dest.end() will be called when
32247 // source gets the 'end' or 'close' events. Only dest.end() once.
32248 if (!dest._isStdio && (!options || options.end !== false)) {
32249 source.on('end', onend);
32250 source.on('close', onclose);
32251 }
32252
32253 var didOnEnd = false;
32254 function onend() {
32255 if (didOnEnd) return;
32256 didOnEnd = true;
32257
32258 dest.end();
32259 }
32260
32261
32262 function onclose() {
32263 if (didOnEnd) return;
32264 didOnEnd = true;
32265
32266 if (typeof dest.destroy === 'function') dest.destroy();
32267 }
32268
32269 // don't leave dangling pipes when there are errors.
32270 function onerror(er) {
32271 cleanup();
32272 if (EE.listenerCount(this, 'error') === 0) {
32273 throw er; // Unhandled stream error in pipe.
32274 }
32275 }
32276
32277 source.on('error', onerror);
32278 dest.on('error', onerror);
32279
32280 // remove all the event listeners that were added.
32281 function cleanup() {
32282 source.removeListener('data', ondata);
32283 dest.removeListener('drain', ondrain);
32284
32285 source.removeListener('end', onend);
32286 source.removeListener('close', onclose);
32287
32288 source.removeListener('error', onerror);
32289 dest.removeListener('error', onerror);
32290
32291 source.removeListener('end', cleanup);
32292 source.removeListener('close', cleanup);
32293
32294 dest.removeListener('close', cleanup);
32295 }
32296
32297 source.on('end', cleanup);
32298 source.on('close', cleanup);
32299
32300 dest.on('close', cleanup);
32301
32302 dest.emit('pipe', source);
32303
32304 // Allow for unix-like usage: A.pipe(B).pipe(C)
32305 return dest;
32306};
32307
32308},{"events":7,"inherits":9,"readable-stream/duplex.js":14,"readable-stream/passthrough.js":23,"readable-stream/readable.js":24,"readable-stream/transform.js":25,"readable-stream/writable.js":26}],29:[function(require,module,exports){
32309// Copyright Joyent, Inc. and other Node contributors.
32310//
32311// Permission is hereby granted, free of charge, to any person obtaining a
32312// copy of this software and associated documentation files (the
32313// "Software"), to deal in the Software without restriction, including
32314// without limitation the rights to use, copy, modify, merge, publish,
32315// distribute, sublicense, and/or sell copies of the Software, and to permit
32316// persons to whom the Software is furnished to do so, subject to the
32317// following conditions:
32318//
32319// The above copyright notice and this permission notice shall be included
32320// in all copies or substantial portions of the Software.
32321//
32322// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
32323// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32324// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
32325// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
32326// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
32327// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
32328// USE OR OTHER DEALINGS IN THE SOFTWARE.
32329
32330var Buffer = require('buffer').Buffer;
32331
32332var isBufferEncoding = Buffer.isEncoding
32333 || function(encoding) {
32334 switch (encoding && encoding.toLowerCase()) {
32335 case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
32336 default: return false;
32337 }
32338 }
32339
32340
32341function assertEncoding(encoding) {
32342 if (encoding && !isBufferEncoding(encoding)) {
32343 throw new Error('Unknown encoding: ' + encoding);
32344 }
32345}
32346
32347// StringDecoder provides an interface for efficiently splitting a series of
32348// buffers into a series of JS strings without breaking apart multi-byte
32349// characters. CESU-8 is handled as part of the UTF-8 encoding.
32350//
32351// @TODO Handling all encodings inside a single object makes it very difficult
32352// to reason about this code, so it should be split up in the future.
32353// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
32354// points as used by CESU-8.
32355var StringDecoder = exports.StringDecoder = function(encoding) {
32356 this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
32357 assertEncoding(encoding);
32358 switch (this.encoding) {
32359 case 'utf8':
32360 // CESU-8 represents each of Surrogate Pair by 3-bytes
32361 this.surrogateSize = 3;
32362 break;
32363 case 'ucs2':
32364 case 'utf16le':
32365 // UTF-16 represents each of Surrogate Pair by 2-bytes
32366 this.surrogateSize = 2;
32367 this.detectIncompleteChar = utf16DetectIncompleteChar;
32368 break;
32369 case 'base64':
32370 // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
32371 this.surrogateSize = 3;
32372 this.detectIncompleteChar = base64DetectIncompleteChar;
32373 break;
32374 default:
32375 this.write = passThroughWrite;
32376 return;
32377 }
32378
32379 // Enough space to store all bytes of a single character. UTF-8 needs 4
32380 // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
32381 this.charBuffer = new Buffer(6);
32382 // Number of bytes received for the current incomplete multi-byte character.
32383 this.charReceived = 0;
32384 // Number of bytes expected for the current incomplete multi-byte character.
32385 this.charLength = 0;
32386};
32387
32388
32389// write decodes the given buffer and returns it as JS string that is
32390// guaranteed to not contain any partial multi-byte characters. Any partial
32391// character found at the end of the buffer is buffered up, and will be
32392// returned when calling write again with the remaining bytes.
32393//
32394// Note: Converting a Buffer containing an orphan surrogate to a String
32395// currently works, but converting a String to a Buffer (via `new Buffer`, or
32396// Buffer#write) will replace incomplete surrogates with the unicode
32397// replacement character. See https://codereview.chromium.org/121173009/ .
32398StringDecoder.prototype.write = function(buffer) {
32399 var charStr = '';
32400 // if our last write ended with an incomplete multibyte character
32401 while (this.charLength) {
32402 // determine how many remaining bytes this buffer has to offer for this char
32403 var available = (buffer.length >= this.charLength - this.charReceived) ?
32404 this.charLength - this.charReceived :
32405 buffer.length;
32406
32407 // add the new bytes to the char buffer
32408 buffer.copy(this.charBuffer, this.charReceived, 0, available);
32409 this.charReceived += available;
32410
32411 if (this.charReceived < this.charLength) {
32412 // still not enough chars in this buffer? wait for more ...
32413 return '';
32414 }
32415
32416 // remove bytes belonging to the current character from the buffer
32417 buffer = buffer.slice(available, buffer.length);
32418
32419 // get the character that was split
32420 charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
32421
32422 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
32423 var charCode = charStr.charCodeAt(charStr.length - 1);
32424 if (charCode >= 0xD800 && charCode <= 0xDBFF) {
32425 this.charLength += this.surrogateSize;
32426 charStr = '';
32427 continue;
32428 }
32429 this.charReceived = this.charLength = 0;
32430
32431 // if there are no more bytes in this buffer, just emit our char
32432 if (buffer.length === 0) {
32433 return charStr;
32434 }
32435 break;
32436 }
32437
32438 // determine and set charLength / charReceived
32439 this.detectIncompleteChar(buffer);
32440
32441 var end = buffer.length;
32442 if (this.charLength) {
32443 // buffer the incomplete character bytes we got
32444 buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
32445 end -= this.charReceived;
32446 }
32447
32448 charStr += buffer.toString(this.encoding, 0, end);
32449
32450 var end = charStr.length - 1;
32451 var charCode = charStr.charCodeAt(end);
32452 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
32453 if (charCode >= 0xD800 && charCode <= 0xDBFF) {
32454 var size = this.surrogateSize;
32455 this.charLength += size;
32456 this.charReceived += size;
32457 this.charBuffer.copy(this.charBuffer, size, 0, size);
32458 buffer.copy(this.charBuffer, 0, 0, size);
32459 return charStr.substring(0, end);
32460 }
32461
32462 // or just emit the charStr
32463 return charStr;
32464};
32465
32466// detectIncompleteChar determines if there is an incomplete UTF-8 character at
32467// the end of the given buffer. If so, it sets this.charLength to the byte
32468// length that character, and sets this.charReceived to the number of bytes
32469// that are available for this character.
32470StringDecoder.prototype.detectIncompleteChar = function(buffer) {
32471 // determine how many bytes we have to check at the end of this buffer
32472 var i = (buffer.length >= 3) ? 3 : buffer.length;
32473
32474 // Figure out if one of the last i bytes of our buffer announces an
32475 // incomplete char.
32476 for (; i > 0; i--) {
32477 var c = buffer[buffer.length - i];
32478
32479 // See http://en.wikipedia.org/wiki/UTF-8#Description
32480
32481 // 110XXXXX
32482 if (i == 1 && c >> 5 == 0x06) {
32483 this.charLength = 2;
32484 break;
32485 }
32486
32487 // 1110XXXX
32488 if (i <= 2 && c >> 4 == 0x0E) {
32489 this.charLength = 3;
32490 break;
32491 }
32492
32493 // 11110XXX
32494 if (i <= 3 && c >> 3 == 0x1E) {
32495 this.charLength = 4;
32496 break;
32497 }
32498 }
32499 this.charReceived = i;
32500};
32501
32502StringDecoder.prototype.end = function(buffer) {
32503 var res = '';
32504 if (buffer && buffer.length)
32505 res = this.write(buffer);
32506
32507 if (this.charReceived) {
32508 var cr = this.charReceived;
32509 var buf = this.charBuffer;
32510 var enc = this.encoding;
32511 res += buf.slice(0, cr).toString(enc);
32512 }
32513
32514 return res;
32515};
32516
32517function passThroughWrite(buffer) {
32518 return buffer.toString(this.encoding);
32519}
32520
32521function utf16DetectIncompleteChar(buffer) {
32522 this.charReceived = buffer.length % 2;
32523 this.charLength = this.charReceived ? 2 : 0;
32524}
32525
32526function base64DetectIncompleteChar(buffer) {
32527 this.charReceived = buffer.length % 3;
32528 this.charLength = this.charReceived ? 3 : 0;
32529}
32530
32531},{"buffer":5}],30:[function(require,module,exports){
32532(function (global){
32533
32534/**
32535 * Module exports.
32536 */
32537
32538module.exports = deprecate;
32539
32540/**
32541 * Mark that a method should not be used.
32542 * Returns a modified function which warns once by default.
32543 *
32544 * If `localStorage.noDeprecation = true` is set, then it is a no-op.
32545 *
32546 * If `localStorage.throwDeprecation = true` is set, then deprecated functions
32547 * will throw an Error when invoked.
32548 *
32549 * If `localStorage.traceDeprecation = true` is set, then deprecated functions
32550 * will invoke `console.trace()` instead of `console.error()`.
32551 *
32552 * @param {Function} fn - the function to deprecate
32553 * @param {String} msg - the string to print to the console when `fn` is invoked
32554 * @returns {Function} a new "deprecated" version of `fn`
32555 * @api public
32556 */
32557
32558function deprecate (fn, msg) {
32559 if (config('noDeprecation')) {
32560 return fn;
32561 }
32562
32563 var warned = false;
32564 function deprecated() {
32565 if (!warned) {
32566 if (config('throwDeprecation')) {
32567 throw new Error(msg);
32568 } else if (config('traceDeprecation')) {
32569 console.trace(msg);
32570 } else {
32571 console.warn(msg);
32572 }
32573 warned = true;
32574 }
32575 return fn.apply(this, arguments);
32576 }
32577
32578 return deprecated;
32579}
32580
32581/**
32582 * Checks `localStorage` for boolean values for the given `name`.
32583 *
32584 * @param {String} name
32585 * @returns {Boolean}
32586 * @api private
32587 */
32588
32589function config (name) {
32590 // accessing global.localStorage can trigger a DOMException in sandboxed iframes
32591 try {
32592 if (!global.localStorage) return false;
32593 } catch (_) {
32594 return false;
32595 }
32596 var val = global.localStorage[name];
32597 if (null == val) return false;
32598 return String(val).toLowerCase() === 'true';
32599}
32600
32601}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
32602},{}],31:[function(require,module,exports){
32603arguments[4][9][0].apply(exports,arguments)
32604},{"dup":9}],32:[function(require,module,exports){
32605module.exports = function isBuffer(arg) {
32606 return arg && typeof arg === 'object'
32607 && typeof arg.copy === 'function'
32608 && typeof arg.fill === 'function'
32609 && typeof arg.readUInt8 === 'function';
32610}
32611},{}],33:[function(require,module,exports){
32612(function (process,global){
32613// Copyright Joyent, Inc. and other Node contributors.
32614//
32615// Permission is hereby granted, free of charge, to any person obtaining a
32616// copy of this software and associated documentation files (the
32617// "Software"), to deal in the Software without restriction, including
32618// without limitation the rights to use, copy, modify, merge, publish,
32619// distribute, sublicense, and/or sell copies of the Software, and to permit
32620// persons to whom the Software is furnished to do so, subject to the
32621// following conditions:
32622//
32623// The above copyright notice and this permission notice shall be included
32624// in all copies or substantial portions of the Software.
32625//
32626// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
32627// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32628// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
32629// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
32630// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
32631// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
32632// USE OR OTHER DEALINGS IN THE SOFTWARE.
32633
32634var formatRegExp = /%[sdj%]/g;
32635exports.format = function(f) {
32636 if (!isString(f)) {
32637 var objects = [];
32638 for (var i = 0; i < arguments.length; i++) {
32639 objects.push(inspect(arguments[i]));
32640 }
32641 return objects.join(' ');
32642 }
32643
32644 var i = 1;
32645 var args = arguments;
32646 var len = args.length;
32647 var str = String(f).replace(formatRegExp, function(x) {
32648 if (x === '%%') return '%';
32649 if (i >= len) return x;
32650 switch (x) {
32651 case '%s': return String(args[i++]);
32652 case '%d': return Number(args[i++]);
32653 case '%j':
32654 try {
32655 return JSON.stringify(args[i++]);
32656 } catch (_) {
32657 return '[Circular]';
32658 }
32659 default:
32660 return x;
32661 }
32662 });
32663 for (var x = args[i]; i < len; x = args[++i]) {
32664 if (isNull(x) || !isObject(x)) {
32665 str += ' ' + x;
32666 } else {
32667 str += ' ' + inspect(x);
32668 }
32669 }
32670 return str;
32671};
32672
32673
32674// Mark that a method should not be used.
32675// Returns a modified function which warns once by default.
32676// If --no-deprecation is set, then it is a no-op.
32677exports.deprecate = function(fn, msg) {
32678 // Allow for deprecating things in the process of starting up.
32679 if (isUndefined(global.process)) {
32680 return function() {
32681 return exports.deprecate(fn, msg).apply(this, arguments);
32682 };
32683 }
32684
32685 if (process.noDeprecation === true) {
32686 return fn;
32687 }
32688
32689 var warned = false;
32690 function deprecated() {
32691 if (!warned) {
32692 if (process.throwDeprecation) {
32693 throw new Error(msg);
32694 } else if (process.traceDeprecation) {
32695 console.trace(msg);
32696 } else {
32697 console.error(msg);
32698 }
32699 warned = true;
32700 }
32701 return fn.apply(this, arguments);
32702 }
32703
32704 return deprecated;
32705};
32706
32707
32708var debugs = {};
32709var debugEnviron;
32710exports.debuglog = function(set) {
32711 if (isUndefined(debugEnviron))
32712 debugEnviron = process.env.NODE_DEBUG || '';
32713 set = set.toUpperCase();
32714 if (!debugs[set]) {
32715 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
32716 var pid = process.pid;
32717 debugs[set] = function() {
32718 var msg = exports.format.apply(exports, arguments);
32719 console.error('%s %d: %s', set, pid, msg);
32720 };
32721 } else {
32722 debugs[set] = function() {};
32723 }
32724 }
32725 return debugs[set];
32726};
32727
32728
32729/**
32730 * Echos the value of a value. Trys to print the value out
32731 * in the best way possible given the different types.
32732 *
32733 * @param {Object} obj The object to print out.
32734 * @param {Object} opts Optional options object that alters the output.
32735 */
32736/* legacy: obj, showHidden, depth, colors*/
32737function inspect(obj, opts) {
32738 // default options
32739 var ctx = {
32740 seen: [],
32741 stylize: stylizeNoColor
32742 };
32743 // legacy...
32744 if (arguments.length >= 3) ctx.depth = arguments[2];
32745 if (arguments.length >= 4) ctx.colors = arguments[3];
32746 if (isBoolean(opts)) {
32747 // legacy...
32748 ctx.showHidden = opts;
32749 } else if (opts) {
32750 // got an "options" object
32751 exports._extend(ctx, opts);
32752 }
32753 // set default options
32754 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
32755 if (isUndefined(ctx.depth)) ctx.depth = 2;
32756 if (isUndefined(ctx.colors)) ctx.colors = false;
32757 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
32758 if (ctx.colors) ctx.stylize = stylizeWithColor;
32759 return formatValue(ctx, obj, ctx.depth);
32760}
32761exports.inspect = inspect;
32762
32763
32764// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
32765inspect.colors = {
32766 'bold' : [1, 22],
32767 'italic' : [3, 23],
32768 'underline' : [4, 24],
32769 'inverse' : [7, 27],
32770 'white' : [37, 39],
32771 'grey' : [90, 39],
32772 'black' : [30, 39],
32773 'blue' : [34, 39],
32774 'cyan' : [36, 39],
32775 'green' : [32, 39],
32776 'magenta' : [35, 39],
32777 'red' : [31, 39],
32778 'yellow' : [33, 39]
32779};
32780
32781// Don't use 'blue' not visible on cmd.exe
32782inspect.styles = {
32783 'special': 'cyan',
32784 'number': 'yellow',
32785 'boolean': 'yellow',
32786 'undefined': 'grey',
32787 'null': 'bold',
32788 'string': 'green',
32789 'date': 'magenta',
32790 // "name": intentionally not styling
32791 'regexp': 'red'
32792};
32793
32794
32795function stylizeWithColor(str, styleType) {
32796 var style = inspect.styles[styleType];
32797
32798 if (style) {
32799 return '\u001b[' + inspect.colors[style][0] + 'm' + str +
32800 '\u001b[' + inspect.colors[style][1] + 'm';
32801 } else {
32802 return str;
32803 }
32804}
32805
32806
32807function stylizeNoColor(str, styleType) {
32808 return str;
32809}
32810
32811
32812function arrayToHash(array) {
32813 var hash = {};
32814
32815 array.forEach(function(val, idx) {
32816 hash[val] = true;
32817 });
32818
32819 return hash;
32820}
32821
32822
32823function formatValue(ctx, value, recurseTimes) {
32824 // Provide a hook for user-specified inspect functions.
32825 // Check that value is an object with an inspect function on it
32826 if (ctx.customInspect &&
32827 value &&
32828 isFunction(value.inspect) &&
32829 // Filter out the util module, it's inspect function is special
32830 value.inspect !== exports.inspect &&
32831 // Also filter out any prototype objects using the circular check.
32832 !(value.constructor && value.constructor.prototype === value)) {
32833 var ret = value.inspect(recurseTimes, ctx);
32834 if (!isString(ret)) {
32835 ret = formatValue(ctx, ret, recurseTimes);
32836 }
32837 return ret;
32838 }
32839
32840 // Primitive types cannot have properties
32841 var primitive = formatPrimitive(ctx, value);
32842 if (primitive) {
32843 return primitive;
32844 }
32845
32846 // Look up the keys of the object.
32847 var keys = Object.keys(value);
32848 var visibleKeys = arrayToHash(keys);
32849
32850 if (ctx.showHidden) {
32851 keys = Object.getOwnPropertyNames(value);
32852 }
32853
32854 // IE doesn't make error fields non-enumerable
32855 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
32856 if (isError(value)
32857 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
32858 return formatError(value);
32859 }
32860
32861 // Some type of object without properties can be shortcutted.
32862 if (keys.length === 0) {
32863 if (isFunction(value)) {
32864 var name = value.name ? ': ' + value.name : '';
32865 return ctx.stylize('[Function' + name + ']', 'special');
32866 }
32867 if (isRegExp(value)) {
32868 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
32869 }
32870 if (isDate(value)) {
32871 return ctx.stylize(Date.prototype.toString.call(value), 'date');
32872 }
32873 if (isError(value)) {
32874 return formatError(value);
32875 }
32876 }
32877
32878 var base = '', array = false, braces = ['{', '}'];
32879
32880 // Make Array say that they are Array
32881 if (isArray(value)) {
32882 array = true;
32883 braces = ['[', ']'];
32884 }
32885
32886 // Make functions say that they are functions
32887 if (isFunction(value)) {
32888 var n = value.name ? ': ' + value.name : '';
32889 base = ' [Function' + n + ']';
32890 }
32891
32892 // Make RegExps say that they are RegExps
32893 if (isRegExp(value)) {
32894 base = ' ' + RegExp.prototype.toString.call(value);
32895 }
32896
32897 // Make dates with properties first say the date
32898 if (isDate(value)) {
32899 base = ' ' + Date.prototype.toUTCString.call(value);
32900 }
32901
32902 // Make error with message first say the error
32903 if (isError(value)) {
32904 base = ' ' + formatError(value);
32905 }
32906
32907 if (keys.length === 0 && (!array || value.length == 0)) {
32908 return braces[0] + base + braces[1];
32909 }
32910
32911 if (recurseTimes < 0) {
32912 if (isRegExp(value)) {
32913 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
32914 } else {
32915 return ctx.stylize('[Object]', 'special');
32916 }
32917 }
32918
32919 ctx.seen.push(value);
32920
32921 var output;
32922 if (array) {
32923 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
32924 } else {
32925 output = keys.map(function(key) {
32926 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
32927 });
32928 }
32929
32930 ctx.seen.pop();
32931
32932 return reduceToSingleString(output, base, braces);
32933}
32934
32935
32936function formatPrimitive(ctx, value) {
32937 if (isUndefined(value))
32938 return ctx.stylize('undefined', 'undefined');
32939 if (isString(value)) {
32940 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
32941 .replace(/'/g, "\\'")
32942 .replace(/\\"/g, '"') + '\'';
32943 return ctx.stylize(simple, 'string');
32944 }
32945 if (isNumber(value))
32946 return ctx.stylize('' + value, 'number');
32947 if (isBoolean(value))
32948 return ctx.stylize('' + value, 'boolean');
32949 // For some reason typeof null is "object", so special case here.
32950 if (isNull(value))
32951 return ctx.stylize('null', 'null');
32952}
32953
32954
32955function formatError(value) {
32956 return '[' + Error.prototype.toString.call(value) + ']';
32957}
32958
32959
32960function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
32961 var output = [];
32962 for (var i = 0, l = value.length; i < l; ++i) {
32963 if (hasOwnProperty(value, String(i))) {
32964 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
32965 String(i), true));
32966 } else {
32967 output.push('');
32968 }
32969 }
32970 keys.forEach(function(key) {
32971 if (!key.match(/^\d+$/)) {
32972 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
32973 key, true));
32974 }
32975 });
32976 return output;
32977}
32978
32979
32980function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
32981 var name, str, desc;
32982 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
32983 if (desc.get) {
32984 if (desc.set) {
32985 str = ctx.stylize('[Getter/Setter]', 'special');
32986 } else {
32987 str = ctx.stylize('[Getter]', 'special');
32988 }
32989 } else {
32990 if (desc.set) {
32991 str = ctx.stylize('[Setter]', 'special');
32992 }
32993 }
32994 if (!hasOwnProperty(visibleKeys, key)) {
32995 name = '[' + key + ']';
32996 }
32997 if (!str) {
32998 if (ctx.seen.indexOf(desc.value) < 0) {
32999 if (isNull(recurseTimes)) {
33000 str = formatValue(ctx, desc.value, null);
33001 } else {
33002 str = formatValue(ctx, desc.value, recurseTimes - 1);
33003 }
33004 if (str.indexOf('\n') > -1) {
33005 if (array) {
33006 str = str.split('\n').map(function(line) {
33007 return ' ' + line;
33008 }).join('\n').substr(2);
33009 } else {
33010 str = '\n' + str.split('\n').map(function(line) {
33011 return ' ' + line;
33012 }).join('\n');
33013 }
33014 }
33015 } else {
33016 str = ctx.stylize('[Circular]', 'special');
33017 }
33018 }
33019 if (isUndefined(name)) {
33020 if (array && key.match(/^\d+$/)) {
33021 return str;
33022 }
33023 name = JSON.stringify('' + key);
33024 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
33025 name = name.substr(1, name.length - 2);
33026 name = ctx.stylize(name, 'name');
33027 } else {
33028 name = name.replace(/'/g, "\\'")
33029 .replace(/\\"/g, '"')
33030 .replace(/(^"|"$)/g, "'");
33031 name = ctx.stylize(name, 'string');
33032 }
33033 }
33034
33035 return name + ': ' + str;
33036}
33037
33038
33039function reduceToSingleString(output, base, braces) {
33040 var numLinesEst = 0;
33041 var length = output.reduce(function(prev, cur) {
33042 numLinesEst++;
33043 if (cur.indexOf('\n') >= 0) numLinesEst++;
33044 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
33045 }, 0);
33046
33047 if (length > 60) {
33048 return braces[0] +
33049 (base === '' ? '' : base + '\n ') +
33050 ' ' +
33051 output.join(',\n ') +
33052 ' ' +
33053 braces[1];
33054 }
33055
33056 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
33057}
33058
33059
33060// NOTE: These type checking functions intentionally don't use `instanceof`
33061// because it is fragile and can be easily faked with `Object.create()`.
33062function isArray(ar) {
33063 return Array.isArray(ar);
33064}
33065exports.isArray = isArray;
33066
33067function isBoolean(arg) {
33068 return typeof arg === 'boolean';
33069}
33070exports.isBoolean = isBoolean;
33071
33072function isNull(arg) {
33073 return arg === null;
33074}
33075exports.isNull = isNull;
33076
33077function isNullOrUndefined(arg) {
33078 return arg == null;
33079}
33080exports.isNullOrUndefined = isNullOrUndefined;
33081
33082function isNumber(arg) {
33083 return typeof arg === 'number';
33084}
33085exports.isNumber = isNumber;
33086
33087function isString(arg) {
33088 return typeof arg === 'string';
33089}
33090exports.isString = isString;
33091
33092function isSymbol(arg) {
33093 return typeof arg === 'symbol';
33094}
33095exports.isSymbol = isSymbol;
33096
33097function isUndefined(arg) {
33098 return arg === void 0;
33099}
33100exports.isUndefined = isUndefined;
33101
33102function isRegExp(re) {
33103 return isObject(re) && objectToString(re) === '[object RegExp]';
33104}
33105exports.isRegExp = isRegExp;
33106
33107function isObject(arg) {
33108 return typeof arg === 'object' && arg !== null;
33109}
33110exports.isObject = isObject;
33111
33112function isDate(d) {
33113 return isObject(d) && objectToString(d) === '[object Date]';
33114}
33115exports.isDate = isDate;
33116
33117function isError(e) {
33118 return isObject(e) &&
33119 (objectToString(e) === '[object Error]' || e instanceof Error);
33120}
33121exports.isError = isError;
33122
33123function isFunction(arg) {
33124 return typeof arg === 'function';
33125}
33126exports.isFunction = isFunction;
33127
33128function isPrimitive(arg) {
33129 return arg === null ||
33130 typeof arg === 'boolean' ||
33131 typeof arg === 'number' ||
33132 typeof arg === 'string' ||
33133 typeof arg === 'symbol' || // ES6 symbol
33134 typeof arg === 'undefined';
33135}
33136exports.isPrimitive = isPrimitive;
33137
33138exports.isBuffer = require('./support/isBuffer');
33139
33140function objectToString(o) {
33141 return Object.prototype.toString.call(o);
33142}
33143
33144
33145function pad(n) {
33146 return n < 10 ? '0' + n.toString(10) : n.toString(10);
33147}
33148
33149
33150var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
33151 'Oct', 'Nov', 'Dec'];
33152
33153// 26 Feb 16:19:34
33154function timestamp() {
33155 var d = new Date();
33156 var time = [pad(d.getHours()),
33157 pad(d.getMinutes()),
33158 pad(d.getSeconds())].join(':');
33159 return [d.getDate(), months[d.getMonth()], time].join(' ');
33160}
33161
33162
33163// log is just a thin wrapper to console.log that prepends a timestamp
33164exports.log = function() {
33165 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
33166};
33167
33168
33169/**
33170 * Inherit the prototype methods from one constructor into another.
33171 *
33172 * The Function.prototype.inherits from lang.js rewritten as a standalone
33173 * function (not on Function.prototype). NOTE: If this file is to be loaded
33174 * during bootstrapping this function needs to be rewritten using some native
33175 * functions as prototype setup using normal JavaScript does not work as
33176 * expected during bootstrapping (see mirror.js in r114903).
33177 *
33178 * @param {function} ctor Constructor function which needs to inherit the
33179 * prototype.
33180 * @param {function} superCtor Constructor function to inherit prototype from.
33181 */
33182exports.inherits = require('inherits');
33183
33184exports._extend = function(origin, add) {
33185 // Don't do anything if add isn't an object
33186 if (!add || !isObject(add)) return origin;
33187
33188 var keys = Object.keys(add);
33189 var i = keys.length;
33190 while (i--) {
33191 origin[keys[i]] = add[keys[i]];
33192 }
33193 return origin;
33194};
33195
33196function hasOwnProperty(obj, prop) {
33197 return Object.prototype.hasOwnProperty.call(obj, prop);
33198}
33199
33200}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
33201},{"./support/isBuffer":32,"_process":13,"inherits":31}],34:[function(require,module,exports){
33202bitcoin = {
33203 base58: require('bs58'),
33204 bitcoin: require('bitcoinjs-lib'),
33205 ecurve: require('ecurve'),
33206 BigInteger: require('bigi'),
33207 Buffer: require('buffer'),
33208 elliptic: require('elliptic'),
33209 bs58check: require('bs58check'),
33210}
33211
33212module.exports = bitcoin;
33213
33214},{"bigi":39,"bitcoinjs-lib":52,"bs58":83,"bs58check":85,"buffer":5,"ecurve":94,"elliptic":97}],35:[function(require,module,exports){
33215// base-x encoding
33216// Forked from https://github.com/cryptocoinjs/bs58
33217// Originally written by Mike Hearn for BitcoinJ
33218// Copyright (c) 2011 Google Inc
33219// Ported to JavaScript by Stefan Thomas
33220// Merged Buffer refactorings from base58-native by Stephen Pair
33221// Copyright (c) 2013 BitPay Inc
33222
33223var Buffer = require('safe-buffer').Buffer
33224
33225module.exports = function base (ALPHABET) {
33226 var ALPHABET_MAP = {}
33227 var BASE = ALPHABET.length
33228 var LEADER = ALPHABET.charAt(0)
33229
33230 // pre-compute lookup table
33231 for (var z = 0; z < ALPHABET.length; z++) {
33232 var x = ALPHABET.charAt(z)
33233
33234 if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')
33235 ALPHABET_MAP[x] = z
33236 }
33237
33238 function encode (source) {
33239 if (source.length === 0) return ''
33240
33241 var digits = [0]
33242 for (var i = 0; i < source.length; ++i) {
33243 for (var j = 0, carry = source[i]; j < digits.length; ++j) {
33244 carry += digits[j] << 8
33245 digits[j] = carry % BASE
33246 carry = (carry / BASE) | 0
33247 }
33248
33249 while (carry > 0) {
33250 digits.push(carry % BASE)
33251 carry = (carry / BASE) | 0
33252 }
33253 }
33254
33255 var string = ''
33256
33257 // deal with leading zeros
33258 for (var k = 0; source[k] === 0 && k < source.length - 1; ++k) string += ALPHABET[0]
33259 // convert digits to a string
33260 for (var q = digits.length - 1; q >= 0; --q) string += ALPHABET[digits[q]]
33261
33262 return string
33263 }
33264
33265 function decodeUnsafe (string) {
33266 if (string.length === 0) return Buffer.allocUnsafe(0)
33267
33268 var bytes = [0]
33269 for (var i = 0; i < string.length; i++) {
33270 var value = ALPHABET_MAP[string[i]]
33271 if (value === undefined) return
33272
33273 for (var j = 0, carry = value; j < bytes.length; ++j) {
33274 carry += bytes[j] * BASE
33275 bytes[j] = carry & 0xff
33276 carry >>= 8
33277 }
33278
33279 while (carry > 0) {
33280 bytes.push(carry & 0xff)
33281 carry >>= 8
33282 }
33283 }
33284
33285 // deal with leading zeros
33286 for (var k = 0; string[k] === LEADER && k < string.length - 1; ++k) {
33287 bytes.push(0)
33288 }
33289
33290 return Buffer.from(bytes.reverse())
33291 }
33292
33293 function decode (string) {
33294 var buffer = decodeUnsafe(string)
33295 if (buffer) return buffer
33296
33297 throw new Error('Non-base' + BASE + ' character')
33298 }
33299
33300 return {
33301 encode: encode,
33302 decodeUnsafe: decodeUnsafe,
33303 decode: decode
33304 }
33305}
33306
33307},{"safe-buffer":128}],36:[function(require,module,exports){
33308'use strict'
33309let ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l'
33310
33311// pre-compute lookup table
33312let ALPHABET_MAP = {}
33313for (let z = 0; z < ALPHABET.length; z++) {
33314 let x = ALPHABET.charAt(z)
33315
33316 if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')
33317 ALPHABET_MAP[x] = z
33318}
33319
33320function polymodStep (pre) {
33321 let b = pre >> 25
33322 return ((pre & 0x1FFFFFF) << 5) ^
33323 (-((b >> 0) & 1) & 0x3b6a57b2) ^
33324 (-((b >> 1) & 1) & 0x26508e6d) ^
33325 (-((b >> 2) & 1) & 0x1ea119fa) ^
33326 (-((b >> 3) & 1) & 0x3d4233dd) ^
33327 (-((b >> 4) & 1) & 0x2a1462b3)
33328}
33329
33330function prefixChk (prefix) {
33331 let chk = 1
33332 for (let i = 0; i < prefix.length; ++i) {
33333 let c = prefix.charCodeAt(i)
33334 if (c < 33 || c > 126) throw new Error('Invalid prefix (' + prefix + ')')
33335
33336 chk = polymodStep(chk) ^ (c >> 5)
33337 }
33338 chk = polymodStep(chk)
33339
33340 for (let i = 0; i < prefix.length; ++i) {
33341 let v = prefix.charCodeAt(i)
33342 chk = polymodStep(chk) ^ (v & 0x1f)
33343 }
33344 return chk
33345}
33346
33347function encode (prefix, words) {
33348 // too long?
33349 if ((prefix.length + 7 + words.length) > 90) throw new TypeError('Exceeds Bech32 maximum length')
33350 prefix = prefix.toLowerCase()
33351
33352 // determine chk mod
33353 let chk = prefixChk(prefix)
33354 let result = prefix + '1'
33355 for (let i = 0; i < words.length; ++i) {
33356 let x = words[i]
33357 if ((x >> 5) !== 0) throw new Error('Non 5-bit word')
33358
33359 chk = polymodStep(chk) ^ x
33360 result += ALPHABET.charAt(x)
33361 }
33362
33363 for (let i = 0; i < 6; ++i) {
33364 chk = polymodStep(chk)
33365 }
33366 chk ^= 1
33367
33368 for (let i = 0; i < 6; ++i) {
33369 let v = (chk >> ((5 - i) * 5)) & 0x1f
33370 result += ALPHABET.charAt(v)
33371 }
33372
33373 return result
33374}
33375
33376function decode (str) {
33377 if (str.length < 8) throw new TypeError(str + ' too short')
33378 if (str.length > 90) throw new TypeError(str + ' too long')
33379
33380 // don't allow mixed case
33381 let lowered = str.toLowerCase()
33382 let uppered = str.toUpperCase()
33383 if (str !== lowered && str !== uppered) throw new Error('Mixed-case string ' + str)
33384 str = lowered
33385
33386 let split = str.lastIndexOf('1')
33387 if (split === 0) throw new Error('Missing prefix for ' + str)
33388
33389 let prefix = str.slice(0, split)
33390 let wordChars = str.slice(split + 1)
33391 if (wordChars.length < 6) throw new Error('Data too short')
33392
33393 let chk = prefixChk(prefix)
33394 let words = []
33395 for (let i = 0; i < wordChars.length; ++i) {
33396 let c = wordChars.charAt(i)
33397 let v = ALPHABET_MAP[c]
33398 if (v === undefined) throw new Error('Unknown character ' + c)
33399 chk = polymodStep(chk) ^ v
33400
33401 // not in the checksum?
33402 if (i + 6 >= wordChars.length) continue
33403 words.push(v)
33404 }
33405
33406 if (chk !== 1) throw new Error('Invalid checksum for ' + str)
33407 return { prefix, words }
33408}
33409
33410function convert (data, inBits, outBits, pad) {
33411 let value = 0
33412 let bits = 0
33413 let maxV = (1 << outBits) - 1
33414
33415 let result = []
33416 for (let i = 0; i < data.length; ++i) {
33417 value = (value << inBits) | data[i]
33418 bits += inBits
33419
33420 while (bits >= outBits) {
33421 bits -= outBits
33422 result.push((value >> bits) & maxV)
33423 }
33424 }
33425
33426 if (pad) {
33427 if (bits > 0) {
33428 result.push((value << (outBits - bits)) & maxV)
33429 }
33430 } else {
33431 if (bits >= inBits) throw new Error('Excess padding')
33432 if ((value << (outBits - bits)) & maxV) throw new Error('Non-zero padding')
33433 }
33434
33435 return result
33436}
33437
33438function toWords (bytes) {
33439 return convert(bytes, 8, 5, true)
33440}
33441
33442function fromWords (words) {
33443 return convert(words, 5, 8, false)
33444}
33445
33446module.exports = { decode, encode, toWords, fromWords }
33447
33448},{}],37:[function(require,module,exports){
33449// (public) Constructor
33450function BigInteger(a, b, c) {
33451 if (!(this instanceof BigInteger))
33452 return new BigInteger(a, b, c)
33453
33454 if (a != null) {
33455 if ("number" == typeof a) this.fromNumber(a, b, c)
33456 else if (b == null && "string" != typeof a) this.fromString(a, 256)
33457 else this.fromString(a, b)
33458 }
33459}
33460
33461var proto = BigInteger.prototype
33462
33463// duck-typed isBigInteger
33464proto.__bigi = require('../package.json').version
33465BigInteger.isBigInteger = function (obj, check_ver) {
33466 return obj && obj.__bigi && (!check_ver || obj.__bigi === proto.__bigi)
33467}
33468
33469// Bits per digit
33470var dbits
33471
33472// am: Compute w_j += (x*this_i), propagate carries,
33473// c is initial carry, returns final carry.
33474// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
33475// We need to select the fastest one that works in this environment.
33476
33477// am1: use a single mult and divide to get the high bits,
33478// max digit bits should be 26 because
33479// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
33480function am1(i, x, w, j, c, n) {
33481 while (--n >= 0) {
33482 var v = x * this[i++] + w[j] + c
33483 c = Math.floor(v / 0x4000000)
33484 w[j++] = v & 0x3ffffff
33485 }
33486 return c
33487}
33488// am2 avoids a big mult-and-extract completely.
33489// Max digit bits should be <= 30 because we do bitwise ops
33490// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
33491function am2(i, x, w, j, c, n) {
33492 var xl = x & 0x7fff,
33493 xh = x >> 15
33494 while (--n >= 0) {
33495 var l = this[i] & 0x7fff
33496 var h = this[i++] >> 15
33497 var m = xh * l + h * xl
33498 l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)
33499 c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)
33500 w[j++] = l & 0x3fffffff
33501 }
33502 return c
33503}
33504// Alternately, set max digit bits to 28 since some
33505// browsers slow down when dealing with 32-bit numbers.
33506function am3(i, x, w, j, c, n) {
33507 var xl = x & 0x3fff,
33508 xh = x >> 14
33509 while (--n >= 0) {
33510 var l = this[i] & 0x3fff
33511 var h = this[i++] >> 14
33512 var m = xh * l + h * xl
33513 l = xl * l + ((m & 0x3fff) << 14) + w[j] + c
33514 c = (l >> 28) + (m >> 14) + xh * h
33515 w[j++] = l & 0xfffffff
33516 }
33517 return c
33518}
33519
33520// wtf?
33521BigInteger.prototype.am = am1
33522dbits = 26
33523
33524BigInteger.prototype.DB = dbits
33525BigInteger.prototype.DM = ((1 << dbits) - 1)
33526var DV = BigInteger.prototype.DV = (1 << dbits)
33527
33528var BI_FP = 52
33529BigInteger.prototype.FV = Math.pow(2, BI_FP)
33530BigInteger.prototype.F1 = BI_FP - dbits
33531BigInteger.prototype.F2 = 2 * dbits - BI_FP
33532
33533// Digit conversions
33534var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"
33535var BI_RC = new Array()
33536var rr, vv
33537rr = "0".charCodeAt(0)
33538for (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv
33539rr = "a".charCodeAt(0)
33540for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv
33541rr = "A".charCodeAt(0)
33542for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv
33543
33544function int2char(n) {
33545 return BI_RM.charAt(n)
33546}
33547
33548function intAt(s, i) {
33549 var c = BI_RC[s.charCodeAt(i)]
33550 return (c == null) ? -1 : c
33551}
33552
33553// (protected) copy this to r
33554function bnpCopyTo(r) {
33555 for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]
33556 r.t = this.t
33557 r.s = this.s
33558}
33559
33560// (protected) set from integer value x, -DV <= x < DV
33561function bnpFromInt(x) {
33562 this.t = 1
33563 this.s = (x < 0) ? -1 : 0
33564 if (x > 0) this[0] = x
33565 else if (x < -1) this[0] = x + DV
33566 else this.t = 0
33567}
33568
33569// return bigint initialized to value
33570function nbv(i) {
33571 var r = new BigInteger()
33572 r.fromInt(i)
33573 return r
33574}
33575
33576// (protected) set from string and radix
33577function bnpFromString(s, b) {
33578 var self = this
33579
33580 var k
33581 if (b == 16) k = 4
33582 else if (b == 8) k = 3
33583 else if (b == 256) k = 8; // byte array
33584 else if (b == 2) k = 1
33585 else if (b == 32) k = 5
33586 else if (b == 4) k = 2
33587 else {
33588 self.fromRadix(s, b)
33589 return
33590 }
33591 self.t = 0
33592 self.s = 0
33593 var i = s.length,
33594 mi = false,
33595 sh = 0
33596 while (--i >= 0) {
33597 var x = (k == 8) ? s[i] & 0xff : intAt(s, i)
33598 if (x < 0) {
33599 if (s.charAt(i) == "-") mi = true
33600 continue
33601 }
33602 mi = false
33603 if (sh == 0)
33604 self[self.t++] = x
33605 else if (sh + k > self.DB) {
33606 self[self.t - 1] |= (x & ((1 << (self.DB - sh)) - 1)) << sh
33607 self[self.t++] = (x >> (self.DB - sh))
33608 } else
33609 self[self.t - 1] |= x << sh
33610 sh += k
33611 if (sh >= self.DB) sh -= self.DB
33612 }
33613 if (k == 8 && (s[0] & 0x80) != 0) {
33614 self.s = -1
33615 if (sh > 0) self[self.t - 1] |= ((1 << (self.DB - sh)) - 1) << sh
33616 }
33617 self.clamp()
33618 if (mi) BigInteger.ZERO.subTo(self, self)
33619}
33620
33621// (protected) clamp off excess high words
33622function bnpClamp() {
33623 var c = this.s & this.DM
33624 while (this.t > 0 && this[this.t - 1] == c)--this.t
33625}
33626
33627// (public) return string representation in given radix
33628function bnToString(b) {
33629 var self = this
33630 if (self.s < 0) return "-" + self.negate()
33631 .toString(b)
33632 var k
33633 if (b == 16) k = 4
33634 else if (b == 8) k = 3
33635 else if (b == 2) k = 1
33636 else if (b == 32) k = 5
33637 else if (b == 4) k = 2
33638 else return self.toRadix(b)
33639 var km = (1 << k) - 1,
33640 d, m = false,
33641 r = "",
33642 i = self.t
33643 var p = self.DB - (i * self.DB) % k
33644 if (i-- > 0) {
33645 if (p < self.DB && (d = self[i] >> p) > 0) {
33646 m = true
33647 r = int2char(d)
33648 }
33649 while (i >= 0) {
33650 if (p < k) {
33651 d = (self[i] & ((1 << p) - 1)) << (k - p)
33652 d |= self[--i] >> (p += self.DB - k)
33653 } else {
33654 d = (self[i] >> (p -= k)) & km
33655 if (p <= 0) {
33656 p += self.DB
33657 --i
33658 }
33659 }
33660 if (d > 0) m = true
33661 if (m) r += int2char(d)
33662 }
33663 }
33664 return m ? r : "0"
33665}
33666
33667// (public) -this
33668function bnNegate() {
33669 var r = new BigInteger()
33670 BigInteger.ZERO.subTo(this, r)
33671 return r
33672}
33673
33674// (public) |this|
33675function bnAbs() {
33676 return (this.s < 0) ? this.negate() : this
33677}
33678
33679// (public) return + if this > a, - if this < a, 0 if equal
33680function bnCompareTo(a) {
33681 var r = this.s - a.s
33682 if (r != 0) return r
33683 var i = this.t
33684 r = i - a.t
33685 if (r != 0) return (this.s < 0) ? -r : r
33686 while (--i >= 0)
33687 if ((r = this[i] - a[i]) != 0) return r
33688 return 0
33689}
33690
33691// returns bit length of the integer x
33692function nbits(x) {
33693 var r = 1,
33694 t
33695 if ((t = x >>> 16) != 0) {
33696 x = t
33697 r += 16
33698 }
33699 if ((t = x >> 8) != 0) {
33700 x = t
33701 r += 8
33702 }
33703 if ((t = x >> 4) != 0) {
33704 x = t
33705 r += 4
33706 }
33707 if ((t = x >> 2) != 0) {
33708 x = t
33709 r += 2
33710 }
33711 if ((t = x >> 1) != 0) {
33712 x = t
33713 r += 1
33714 }
33715 return r
33716}
33717
33718// (public) return the number of bits in "this"
33719function bnBitLength() {
33720 if (this.t <= 0) return 0
33721 return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))
33722}
33723
33724// (public) return the number of bytes in "this"
33725function bnByteLength() {
33726 return this.bitLength() >> 3
33727}
33728
33729// (protected) r = this << n*DB
33730function bnpDLShiftTo(n, r) {
33731 var i
33732 for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i]
33733 for (i = n - 1; i >= 0; --i) r[i] = 0
33734 r.t = this.t + n
33735 r.s = this.s
33736}
33737
33738// (protected) r = this >> n*DB
33739function bnpDRShiftTo(n, r) {
33740 for (var i = n; i < this.t; ++i) r[i - n] = this[i]
33741 r.t = Math.max(this.t - n, 0)
33742 r.s = this.s
33743}
33744
33745// (protected) r = this << n
33746function bnpLShiftTo(n, r) {
33747 var self = this
33748 var bs = n % self.DB
33749 var cbs = self.DB - bs
33750 var bm = (1 << cbs) - 1
33751 var ds = Math.floor(n / self.DB),
33752 c = (self.s << bs) & self.DM,
33753 i
33754 for (i = self.t - 1; i >= 0; --i) {
33755 r[i + ds + 1] = (self[i] >> cbs) | c
33756 c = (self[i] & bm) << bs
33757 }
33758 for (i = ds - 1; i >= 0; --i) r[i] = 0
33759 r[ds] = c
33760 r.t = self.t + ds + 1
33761 r.s = self.s
33762 r.clamp()
33763}
33764
33765// (protected) r = this >> n
33766function bnpRShiftTo(n, r) {
33767 var self = this
33768 r.s = self.s
33769 var ds = Math.floor(n / self.DB)
33770 if (ds >= self.t) {
33771 r.t = 0
33772 return
33773 }
33774 var bs = n % self.DB
33775 var cbs = self.DB - bs
33776 var bm = (1 << bs) - 1
33777 r[0] = self[ds] >> bs
33778 for (var i = ds + 1; i < self.t; ++i) {
33779 r[i - ds - 1] |= (self[i] & bm) << cbs
33780 r[i - ds] = self[i] >> bs
33781 }
33782 if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs
33783 r.t = self.t - ds
33784 r.clamp()
33785}
33786
33787// (protected) r = this - a
33788function bnpSubTo(a, r) {
33789 var self = this
33790 var i = 0,
33791 c = 0,
33792 m = Math.min(a.t, self.t)
33793 while (i < m) {
33794 c += self[i] - a[i]
33795 r[i++] = c & self.DM
33796 c >>= self.DB
33797 }
33798 if (a.t < self.t) {
33799 c -= a.s
33800 while (i < self.t) {
33801 c += self[i]
33802 r[i++] = c & self.DM
33803 c >>= self.DB
33804 }
33805 c += self.s
33806 } else {
33807 c += self.s
33808 while (i < a.t) {
33809 c -= a[i]
33810 r[i++] = c & self.DM
33811 c >>= self.DB
33812 }
33813 c -= a.s
33814 }
33815 r.s = (c < 0) ? -1 : 0
33816 if (c < -1) r[i++] = self.DV + c
33817 else if (c > 0) r[i++] = c
33818 r.t = i
33819 r.clamp()
33820}
33821
33822// (protected) r = this * a, r != this,a (HAC 14.12)
33823// "this" should be the larger one if appropriate.
33824function bnpMultiplyTo(a, r) {
33825 var x = this.abs(),
33826 y = a.abs()
33827 var i = x.t
33828 r.t = i + y.t
33829 while (--i >= 0) r[i] = 0
33830 for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t)
33831 r.s = 0
33832 r.clamp()
33833 if (this.s != a.s) BigInteger.ZERO.subTo(r, r)
33834}
33835
33836// (protected) r = this^2, r != this (HAC 14.16)
33837function bnpSquareTo(r) {
33838 var x = this.abs()
33839 var i = r.t = 2 * x.t
33840 while (--i >= 0) r[i] = 0
33841 for (i = 0; i < x.t - 1; ++i) {
33842 var c = x.am(i, x[i], r, 2 * i, 0, 1)
33843 if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {
33844 r[i + x.t] -= x.DV
33845 r[i + x.t + 1] = 1
33846 }
33847 }
33848 if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1)
33849 r.s = 0
33850 r.clamp()
33851}
33852
33853// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
33854// r != q, this != m. q or r may be null.
33855function bnpDivRemTo(m, q, r) {
33856 var self = this
33857 var pm = m.abs()
33858 if (pm.t <= 0) return
33859 var pt = self.abs()
33860 if (pt.t < pm.t) {
33861 if (q != null) q.fromInt(0)
33862 if (r != null) self.copyTo(r)
33863 return
33864 }
33865 if (r == null) r = new BigInteger()
33866 var y = new BigInteger(),
33867 ts = self.s,
33868 ms = m.s
33869 var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus
33870 if (nsh > 0) {
33871 pm.lShiftTo(nsh, y)
33872 pt.lShiftTo(nsh, r)
33873 } else {
33874 pm.copyTo(y)
33875 pt.copyTo(r)
33876 }
33877 var ys = y.t
33878 var y0 = y[ys - 1]
33879 if (y0 == 0) return
33880 var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)
33881 var d1 = self.FV / yt,
33882 d2 = (1 << self.F1) / yt,
33883 e = 1 << self.F2
33884 var i = r.t,
33885 j = i - ys,
33886 t = (q == null) ? new BigInteger() : q
33887 y.dlShiftTo(j, t)
33888 if (r.compareTo(t) >= 0) {
33889 r[r.t++] = 1
33890 r.subTo(t, r)
33891 }
33892 BigInteger.ONE.dlShiftTo(ys, t)
33893 t.subTo(y, y); // "negative" y so we can replace sub with am later
33894 while (y.t < ys) y[y.t++] = 0
33895 while (--j >= 0) {
33896 // Estimate quotient digit
33897 var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)
33898 if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out
33899 y.dlShiftTo(j, t)
33900 r.subTo(t, r)
33901 while (r[i] < --qd) r.subTo(t, r)
33902 }
33903 }
33904 if (q != null) {
33905 r.drShiftTo(ys, q)
33906 if (ts != ms) BigInteger.ZERO.subTo(q, q)
33907 }
33908 r.t = ys
33909 r.clamp()
33910 if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder
33911 if (ts < 0) BigInteger.ZERO.subTo(r, r)
33912}
33913
33914// (public) this mod a
33915function bnMod(a) {
33916 var r = new BigInteger()
33917 this.abs()
33918 .divRemTo(a, null, r)
33919 if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)
33920 return r
33921}
33922
33923// Modular reduction using "classic" algorithm
33924function Classic(m) {
33925 this.m = m
33926}
33927
33928function cConvert(x) {
33929 if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m)
33930 else return x
33931}
33932
33933function cRevert(x) {
33934 return x
33935}
33936
33937function cReduce(x) {
33938 x.divRemTo(this.m, null, x)
33939}
33940
33941function cMulTo(x, y, r) {
33942 x.multiplyTo(y, r)
33943 this.reduce(r)
33944}
33945
33946function cSqrTo(x, r) {
33947 x.squareTo(r)
33948 this.reduce(r)
33949}
33950
33951Classic.prototype.convert = cConvert
33952Classic.prototype.revert = cRevert
33953Classic.prototype.reduce = cReduce
33954Classic.prototype.mulTo = cMulTo
33955Classic.prototype.sqrTo = cSqrTo
33956
33957// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
33958// justification:
33959// xy == 1 (mod m)
33960// xy = 1+km
33961// xy(2-xy) = (1+km)(1-km)
33962// x[y(2-xy)] = 1-k^2m^2
33963// x[y(2-xy)] == 1 (mod m^2)
33964// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
33965// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
33966// JS multiply "overflows" differently from C/C++, so care is needed here.
33967function bnpInvDigit() {
33968 if (this.t < 1) return 0
33969 var x = this[0]
33970 if ((x & 1) == 0) return 0
33971 var y = x & 3; // y == 1/x mod 2^2
33972 y = (y * (2 - (x & 0xf) * y)) & 0xf; // y == 1/x mod 2^4
33973 y = (y * (2 - (x & 0xff) * y)) & 0xff; // y == 1/x mod 2^8
33974 y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff; // y == 1/x mod 2^16
33975 // last step - calculate inverse mod DV directly
33976 // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
33977 y = (y * (2 - x * y % this.DV)) % this.DV; // y == 1/x mod 2^dbits
33978 // we really want the negative inverse, and -DV < y < DV
33979 return (y > 0) ? this.DV - y : -y
33980}
33981
33982// Montgomery reduction
33983function Montgomery(m) {
33984 this.m = m
33985 this.mp = m.invDigit()
33986 this.mpl = this.mp & 0x7fff
33987 this.mph = this.mp >> 15
33988 this.um = (1 << (m.DB - 15)) - 1
33989 this.mt2 = 2 * m.t
33990}
33991
33992// xR mod m
33993function montConvert(x) {
33994 var r = new BigInteger()
33995 x.abs()
33996 .dlShiftTo(this.m.t, r)
33997 r.divRemTo(this.m, null, r)
33998 if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r)
33999 return r
34000}
34001
34002// x/R mod m
34003function montRevert(x) {
34004 var r = new BigInteger()
34005 x.copyTo(r)
34006 this.reduce(r)
34007 return r
34008}
34009
34010// x = x/R mod m (HAC 14.32)
34011function montReduce(x) {
34012 while (x.t <= this.mt2) // pad x so am has enough room later
34013 x[x.t++] = 0
34014 for (var i = 0; i < this.m.t; ++i) {
34015 // faster way of calculating u0 = x[i]*mp mod DV
34016 var j = x[i] & 0x7fff
34017 var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM
34018 // use am to combine the multiply-shift-add into one call
34019 j = i + this.m.t
34020 x[j] += this.m.am(0, u0, x, i, 0, this.m.t)
34021 // propagate carry
34022 while (x[j] >= x.DV) {
34023 x[j] -= x.DV
34024 x[++j]++
34025 }
34026 }
34027 x.clamp()
34028 x.drShiftTo(this.m.t, x)
34029 if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)
34030}
34031
34032// r = "x^2/R mod m"; x != r
34033function montSqrTo(x, r) {
34034 x.squareTo(r)
34035 this.reduce(r)
34036}
34037
34038// r = "xy/R mod m"; x,y != r
34039function montMulTo(x, y, r) {
34040 x.multiplyTo(y, r)
34041 this.reduce(r)
34042}
34043
34044Montgomery.prototype.convert = montConvert
34045Montgomery.prototype.revert = montRevert
34046Montgomery.prototype.reduce = montReduce
34047Montgomery.prototype.mulTo = montMulTo
34048Montgomery.prototype.sqrTo = montSqrTo
34049
34050// (protected) true iff this is even
34051function bnpIsEven() {
34052 return ((this.t > 0) ? (this[0] & 1) : this.s) == 0
34053}
34054
34055// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
34056function bnpExp(e, z) {
34057 if (e > 0xffffffff || e < 1) return BigInteger.ONE
34058 var r = new BigInteger(),
34059 r2 = new BigInteger(),
34060 g = z.convert(this),
34061 i = nbits(e) - 1
34062 g.copyTo(r)
34063 while (--i >= 0) {
34064 z.sqrTo(r, r2)
34065 if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)
34066 else {
34067 var t = r
34068 r = r2
34069 r2 = t
34070 }
34071 }
34072 return z.revert(r)
34073}
34074
34075// (public) this^e % m, 0 <= e < 2^32
34076function bnModPowInt(e, m) {
34077 var z
34078 if (e < 256 || m.isEven()) z = new Classic(m)
34079 else z = new Montgomery(m)
34080 return this.exp(e, z)
34081}
34082
34083// protected
34084proto.copyTo = bnpCopyTo
34085proto.fromInt = bnpFromInt
34086proto.fromString = bnpFromString
34087proto.clamp = bnpClamp
34088proto.dlShiftTo = bnpDLShiftTo
34089proto.drShiftTo = bnpDRShiftTo
34090proto.lShiftTo = bnpLShiftTo
34091proto.rShiftTo = bnpRShiftTo
34092proto.subTo = bnpSubTo
34093proto.multiplyTo = bnpMultiplyTo
34094proto.squareTo = bnpSquareTo
34095proto.divRemTo = bnpDivRemTo
34096proto.invDigit = bnpInvDigit
34097proto.isEven = bnpIsEven
34098proto.exp = bnpExp
34099
34100// public
34101proto.toString = bnToString
34102proto.negate = bnNegate
34103proto.abs = bnAbs
34104proto.compareTo = bnCompareTo
34105proto.bitLength = bnBitLength
34106proto.byteLength = bnByteLength
34107proto.mod = bnMod
34108proto.modPowInt = bnModPowInt
34109
34110// (public)
34111function bnClone() {
34112 var r = new BigInteger()
34113 this.copyTo(r)
34114 return r
34115}
34116
34117// (public) return value as integer
34118function bnIntValue() {
34119 if (this.s < 0) {
34120 if (this.t == 1) return this[0] - this.DV
34121 else if (this.t == 0) return -1
34122 } else if (this.t == 1) return this[0]
34123 else if (this.t == 0) return 0
34124 // assumes 16 < DB < 32
34125 return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]
34126}
34127
34128// (public) return value as byte
34129function bnByteValue() {
34130 return (this.t == 0) ? this.s : (this[0] << 24) >> 24
34131}
34132
34133// (public) return value as short (assumes DB>=16)
34134function bnShortValue() {
34135 return (this.t == 0) ? this.s : (this[0] << 16) >> 16
34136}
34137
34138// (protected) return x s.t. r^x < DV
34139function bnpChunkSize(r) {
34140 return Math.floor(Math.LN2 * this.DB / Math.log(r))
34141}
34142
34143// (public) 0 if this == 0, 1 if this > 0
34144function bnSigNum() {
34145 if (this.s < 0) return -1
34146 else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0
34147 else return 1
34148}
34149
34150// (protected) convert to radix string
34151function bnpToRadix(b) {
34152 if (b == null) b = 10
34153 if (this.signum() == 0 || b < 2 || b > 36) return "0"
34154 var cs = this.chunkSize(b)
34155 var a = Math.pow(b, cs)
34156 var d = nbv(a),
34157 y = new BigInteger(),
34158 z = new BigInteger(),
34159 r = ""
34160 this.divRemTo(d, y, z)
34161 while (y.signum() > 0) {
34162 r = (a + z.intValue())
34163 .toString(b)
34164 .substr(1) + r
34165 y.divRemTo(d, y, z)
34166 }
34167 return z.intValue()
34168 .toString(b) + r
34169}
34170
34171// (protected) convert from radix string
34172function bnpFromRadix(s, b) {
34173 var self = this
34174 self.fromInt(0)
34175 if (b == null) b = 10
34176 var cs = self.chunkSize(b)
34177 var d = Math.pow(b, cs),
34178 mi = false,
34179 j = 0,
34180 w = 0
34181 for (var i = 0; i < s.length; ++i) {
34182 var x = intAt(s, i)
34183 if (x < 0) {
34184 if (s.charAt(i) == "-" && self.signum() == 0) mi = true
34185 continue
34186 }
34187 w = b * w + x
34188 if (++j >= cs) {
34189 self.dMultiply(d)
34190 self.dAddOffset(w, 0)
34191 j = 0
34192 w = 0
34193 }
34194 }
34195 if (j > 0) {
34196 self.dMultiply(Math.pow(b, j))
34197 self.dAddOffset(w, 0)
34198 }
34199 if (mi) BigInteger.ZERO.subTo(self, self)
34200}
34201
34202// (protected) alternate constructor
34203function bnpFromNumber(a, b, c) {
34204 var self = this
34205 if ("number" == typeof b) {
34206 // new BigInteger(int,int,RNG)
34207 if (a < 2) self.fromInt(1)
34208 else {
34209 self.fromNumber(a, c)
34210 if (!self.testBit(a - 1)) // force MSB set
34211 self.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, self)
34212 if (self.isEven()) self.dAddOffset(1, 0); // force odd
34213 while (!self.isProbablePrime(b)) {
34214 self.dAddOffset(2, 0)
34215 if (self.bitLength() > a) self.subTo(BigInteger.ONE.shiftLeft(a - 1), self)
34216 }
34217 }
34218 } else {
34219 // new BigInteger(int,RNG)
34220 var x = new Array(),
34221 t = a & 7
34222 x.length = (a >> 3) + 1
34223 b.nextBytes(x)
34224 if (t > 0) x[0] &= ((1 << t) - 1)
34225 else x[0] = 0
34226 self.fromString(x, 256)
34227 }
34228}
34229
34230// (public) convert to bigendian byte array
34231function bnToByteArray() {
34232 var self = this
34233 var i = self.t,
34234 r = new Array()
34235 r[0] = self.s
34236 var p = self.DB - (i * self.DB) % 8,
34237 d, k = 0
34238 if (i-- > 0) {
34239 if (p < self.DB && (d = self[i] >> p) != (self.s & self.DM) >> p)
34240 r[k++] = d | (self.s << (self.DB - p))
34241 while (i >= 0) {
34242 if (p < 8) {
34243 d = (self[i] & ((1 << p) - 1)) << (8 - p)
34244 d |= self[--i] >> (p += self.DB - 8)
34245 } else {
34246 d = (self[i] >> (p -= 8)) & 0xff
34247 if (p <= 0) {
34248 p += self.DB
34249 --i
34250 }
34251 }
34252 if ((d & 0x80) != 0) d |= -256
34253 if (k === 0 && (self.s & 0x80) != (d & 0x80))++k
34254 if (k > 0 || d != self.s) r[k++] = d
34255 }
34256 }
34257 return r
34258}
34259
34260function bnEquals(a) {
34261 return (this.compareTo(a) == 0)
34262}
34263
34264function bnMin(a) {
34265 return (this.compareTo(a) < 0) ? this : a
34266}
34267
34268function bnMax(a) {
34269 return (this.compareTo(a) > 0) ? this : a
34270}
34271
34272// (protected) r = this op a (bitwise)
34273function bnpBitwiseTo(a, op, r) {
34274 var self = this
34275 var i, f, m = Math.min(a.t, self.t)
34276 for (i = 0; i < m; ++i) r[i] = op(self[i], a[i])
34277 if (a.t < self.t) {
34278 f = a.s & self.DM
34279 for (i = m; i < self.t; ++i) r[i] = op(self[i], f)
34280 r.t = self.t
34281 } else {
34282 f = self.s & self.DM
34283 for (i = m; i < a.t; ++i) r[i] = op(f, a[i])
34284 r.t = a.t
34285 }
34286 r.s = op(self.s, a.s)
34287 r.clamp()
34288}
34289
34290// (public) this & a
34291function op_and(x, y) {
34292 return x & y
34293}
34294
34295function bnAnd(a) {
34296 var r = new BigInteger()
34297 this.bitwiseTo(a, op_and, r)
34298 return r
34299}
34300
34301// (public) this | a
34302function op_or(x, y) {
34303 return x | y
34304}
34305
34306function bnOr(a) {
34307 var r = new BigInteger()
34308 this.bitwiseTo(a, op_or, r)
34309 return r
34310}
34311
34312// (public) this ^ a
34313function op_xor(x, y) {
34314 return x ^ y
34315}
34316
34317function bnXor(a) {
34318 var r = new BigInteger()
34319 this.bitwiseTo(a, op_xor, r)
34320 return r
34321}
34322
34323// (public) this & ~a
34324function op_andnot(x, y) {
34325 return x & ~y
34326}
34327
34328function bnAndNot(a) {
34329 var r = new BigInteger()
34330 this.bitwiseTo(a, op_andnot, r)
34331 return r
34332}
34333
34334// (public) ~this
34335function bnNot() {
34336 var r = new BigInteger()
34337 for (var i = 0; i < this.t; ++i) r[i] = this.DM & ~this[i]
34338 r.t = this.t
34339 r.s = ~this.s
34340 return r
34341}
34342
34343// (public) this << n
34344function bnShiftLeft(n) {
34345 var r = new BigInteger()
34346 if (n < 0) this.rShiftTo(-n, r)
34347 else this.lShiftTo(n, r)
34348 return r
34349}
34350
34351// (public) this >> n
34352function bnShiftRight(n) {
34353 var r = new BigInteger()
34354 if (n < 0) this.lShiftTo(-n, r)
34355 else this.rShiftTo(n, r)
34356 return r
34357}
34358
34359// return index of lowest 1-bit in x, x < 2^31
34360function lbit(x) {
34361 if (x == 0) return -1
34362 var r = 0
34363 if ((x & 0xffff) == 0) {
34364 x >>= 16
34365 r += 16
34366 }
34367 if ((x & 0xff) == 0) {
34368 x >>= 8
34369 r += 8
34370 }
34371 if ((x & 0xf) == 0) {
34372 x >>= 4
34373 r += 4
34374 }
34375 if ((x & 3) == 0) {
34376 x >>= 2
34377 r += 2
34378 }
34379 if ((x & 1) == 0)++r
34380 return r
34381}
34382
34383// (public) returns index of lowest 1-bit (or -1 if none)
34384function bnGetLowestSetBit() {
34385 for (var i = 0; i < this.t; ++i)
34386 if (this[i] != 0) return i * this.DB + lbit(this[i])
34387 if (this.s < 0) return this.t * this.DB
34388 return -1
34389}
34390
34391// return number of 1 bits in x
34392function cbit(x) {
34393 var r = 0
34394 while (x != 0) {
34395 x &= x - 1
34396 ++r
34397 }
34398 return r
34399}
34400
34401// (public) return number of set bits
34402function bnBitCount() {
34403 var r = 0,
34404 x = this.s & this.DM
34405 for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)
34406 return r
34407}
34408
34409// (public) true iff nth bit is set
34410function bnTestBit(n) {
34411 var j = Math.floor(n / this.DB)
34412 if (j >= this.t) return (this.s != 0)
34413 return ((this[j] & (1 << (n % this.DB))) != 0)
34414}
34415
34416// (protected) this op (1<<n)
34417function bnpChangeBit(n, op) {
34418 var r = BigInteger.ONE.shiftLeft(n)
34419 this.bitwiseTo(r, op, r)
34420 return r
34421}
34422
34423// (public) this | (1<<n)
34424function bnSetBit(n) {
34425 return this.changeBit(n, op_or)
34426}
34427
34428// (public) this & ~(1<<n)
34429function bnClearBit(n) {
34430 return this.changeBit(n, op_andnot)
34431}
34432
34433// (public) this ^ (1<<n)
34434function bnFlipBit(n) {
34435 return this.changeBit(n, op_xor)
34436}
34437
34438// (protected) r = this + a
34439function bnpAddTo(a, r) {
34440 var self = this
34441
34442 var i = 0,
34443 c = 0,
34444 m = Math.min(a.t, self.t)
34445 while (i < m) {
34446 c += self[i] + a[i]
34447 r[i++] = c & self.DM
34448 c >>= self.DB
34449 }
34450 if (a.t < self.t) {
34451 c += a.s
34452 while (i < self.t) {
34453 c += self[i]
34454 r[i++] = c & self.DM
34455 c >>= self.DB
34456 }
34457 c += self.s
34458 } else {
34459 c += self.s
34460 while (i < a.t) {
34461 c += a[i]
34462 r[i++] = c & self.DM
34463 c >>= self.DB
34464 }
34465 c += a.s
34466 }
34467 r.s = (c < 0) ? -1 : 0
34468 if (c > 0) r[i++] = c
34469 else if (c < -1) r[i++] = self.DV + c
34470 r.t = i
34471 r.clamp()
34472}
34473
34474// (public) this + a
34475function bnAdd(a) {
34476 var r = new BigInteger()
34477 this.addTo(a, r)
34478 return r
34479}
34480
34481// (public) this - a
34482function bnSubtract(a) {
34483 var r = new BigInteger()
34484 this.subTo(a, r)
34485 return r
34486}
34487
34488// (public) this * a
34489function bnMultiply(a) {
34490 var r = new BigInteger()
34491 this.multiplyTo(a, r)
34492 return r
34493}
34494
34495// (public) this^2
34496function bnSquare() {
34497 var r = new BigInteger()
34498 this.squareTo(r)
34499 return r
34500}
34501
34502// (public) this / a
34503function bnDivide(a) {
34504 var r = new BigInteger()
34505 this.divRemTo(a, r, null)
34506 return r
34507}
34508
34509// (public) this % a
34510function bnRemainder(a) {
34511 var r = new BigInteger()
34512 this.divRemTo(a, null, r)
34513 return r
34514}
34515
34516// (public) [this/a,this%a]
34517function bnDivideAndRemainder(a) {
34518 var q = new BigInteger(),
34519 r = new BigInteger()
34520 this.divRemTo(a, q, r)
34521 return new Array(q, r)
34522}
34523
34524// (protected) this *= n, this >= 0, 1 < n < DV
34525function bnpDMultiply(n) {
34526 this[this.t] = this.am(0, n - 1, this, 0, 0, this.t)
34527 ++this.t
34528 this.clamp()
34529}
34530
34531// (protected) this += n << w words, this >= 0
34532function bnpDAddOffset(n, w) {
34533 if (n == 0) return
34534 while (this.t <= w) this[this.t++] = 0
34535 this[w] += n
34536 while (this[w] >= this.DV) {
34537 this[w] -= this.DV
34538 if (++w >= this.t) this[this.t++] = 0
34539 ++this[w]
34540 }
34541}
34542
34543// A "null" reducer
34544function NullExp() {}
34545
34546function nNop(x) {
34547 return x
34548}
34549
34550function nMulTo(x, y, r) {
34551 x.multiplyTo(y, r)
34552}
34553
34554function nSqrTo(x, r) {
34555 x.squareTo(r)
34556}
34557
34558NullExp.prototype.convert = nNop
34559NullExp.prototype.revert = nNop
34560NullExp.prototype.mulTo = nMulTo
34561NullExp.prototype.sqrTo = nSqrTo
34562
34563// (public) this^e
34564function bnPow(e) {
34565 return this.exp(e, new NullExp())
34566}
34567
34568// (protected) r = lower n words of "this * a", a.t <= n
34569// "this" should be the larger one if appropriate.
34570function bnpMultiplyLowerTo(a, n, r) {
34571 var i = Math.min(this.t + a.t, n)
34572 r.s = 0; // assumes a,this >= 0
34573 r.t = i
34574 while (i > 0) r[--i] = 0
34575 var j
34576 for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.am(0, a[i], r, i, 0, this.t)
34577 for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a[i], r, i, 0, n - i)
34578 r.clamp()
34579}
34580
34581// (protected) r = "this * a" without lower n words, n > 0
34582// "this" should be the larger one if appropriate.
34583function bnpMultiplyUpperTo(a, n, r) {
34584 --n
34585 var i = r.t = this.t + a.t - n
34586 r.s = 0; // assumes a,this >= 0
34587 while (--i >= 0) r[i] = 0
34588 for (i = Math.max(n - this.t, 0); i < a.t; ++i)
34589 r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n)
34590 r.clamp()
34591 r.drShiftTo(1, r)
34592}
34593
34594// Barrett modular reduction
34595function Barrett(m) {
34596 // setup Barrett
34597 this.r2 = new BigInteger()
34598 this.q3 = new BigInteger()
34599 BigInteger.ONE.dlShiftTo(2 * m.t, this.r2)
34600 this.mu = this.r2.divide(m)
34601 this.m = m
34602}
34603
34604function barrettConvert(x) {
34605 if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m)
34606 else if (x.compareTo(this.m) < 0) return x
34607 else {
34608 var r = new BigInteger()
34609 x.copyTo(r)
34610 this.reduce(r)
34611 return r
34612 }
34613}
34614
34615function barrettRevert(x) {
34616 return x
34617}
34618
34619// x = x mod m (HAC 14.42)
34620function barrettReduce(x) {
34621 var self = this
34622 x.drShiftTo(self.m.t - 1, self.r2)
34623 if (x.t > self.m.t + 1) {
34624 x.t = self.m.t + 1
34625 x.clamp()
34626 }
34627 self.mu.multiplyUpperTo(self.r2, self.m.t + 1, self.q3)
34628 self.m.multiplyLowerTo(self.q3, self.m.t + 1, self.r2)
34629 while (x.compareTo(self.r2) < 0) x.dAddOffset(1, self.m.t + 1)
34630 x.subTo(self.r2, x)
34631 while (x.compareTo(self.m) >= 0) x.subTo(self.m, x)
34632}
34633
34634// r = x^2 mod m; x != r
34635function barrettSqrTo(x, r) {
34636 x.squareTo(r)
34637 this.reduce(r)
34638}
34639
34640// r = x*y mod m; x,y != r
34641function barrettMulTo(x, y, r) {
34642 x.multiplyTo(y, r)
34643 this.reduce(r)
34644}
34645
34646Barrett.prototype.convert = barrettConvert
34647Barrett.prototype.revert = barrettRevert
34648Barrett.prototype.reduce = barrettReduce
34649Barrett.prototype.mulTo = barrettMulTo
34650Barrett.prototype.sqrTo = barrettSqrTo
34651
34652// (public) this^e % m (HAC 14.85)
34653function bnModPow(e, m) {
34654 var i = e.bitLength(),
34655 k, r = nbv(1),
34656 z
34657 if (i <= 0) return r
34658 else if (i < 18) k = 1
34659 else if (i < 48) k = 3
34660 else if (i < 144) k = 4
34661 else if (i < 768) k = 5
34662 else k = 6
34663 if (i < 8)
34664 z = new Classic(m)
34665 else if (m.isEven())
34666 z = new Barrett(m)
34667 else
34668 z = new Montgomery(m)
34669
34670 // precomputation
34671 var g = new Array(),
34672 n = 3,
34673 k1 = k - 1,
34674 km = (1 << k) - 1
34675 g[1] = z.convert(this)
34676 if (k > 1) {
34677 var g2 = new BigInteger()
34678 z.sqrTo(g[1], g2)
34679 while (n <= km) {
34680 g[n] = new BigInteger()
34681 z.mulTo(g2, g[n - 2], g[n])
34682 n += 2
34683 }
34684 }
34685
34686 var j = e.t - 1,
34687 w, is1 = true,
34688 r2 = new BigInteger(),
34689 t
34690 i = nbits(e[j]) - 1
34691 while (j >= 0) {
34692 if (i >= k1) w = (e[j] >> (i - k1)) & km
34693 else {
34694 w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)
34695 if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)
34696 }
34697
34698 n = k
34699 while ((w & 1) == 0) {
34700 w >>= 1
34701 --n
34702 }
34703 if ((i -= n) < 0) {
34704 i += this.DB
34705 --j
34706 }
34707 if (is1) { // ret == 1, don't bother squaring or multiplying it
34708 g[w].copyTo(r)
34709 is1 = false
34710 } else {
34711 while (n > 1) {
34712 z.sqrTo(r, r2)
34713 z.sqrTo(r2, r)
34714 n -= 2
34715 }
34716 if (n > 0) z.sqrTo(r, r2)
34717 else {
34718 t = r
34719 r = r2
34720 r2 = t
34721 }
34722 z.mulTo(r2, g[w], r)
34723 }
34724
34725 while (j >= 0 && (e[j] & (1 << i)) == 0) {
34726 z.sqrTo(r, r2)
34727 t = r
34728 r = r2
34729 r2 = t
34730 if (--i < 0) {
34731 i = this.DB - 1
34732 --j
34733 }
34734 }
34735 }
34736 return z.revert(r)
34737}
34738
34739// (public) gcd(this,a) (HAC 14.54)
34740function bnGCD(a) {
34741 var x = (this.s < 0) ? this.negate() : this.clone()
34742 var y = (a.s < 0) ? a.negate() : a.clone()
34743 if (x.compareTo(y) < 0) {
34744 var t = x
34745 x = y
34746 y = t
34747 }
34748 var i = x.getLowestSetBit(),
34749 g = y.getLowestSetBit()
34750 if (g < 0) return x
34751 if (i < g) g = i
34752 if (g > 0) {
34753 x.rShiftTo(g, x)
34754 y.rShiftTo(g, y)
34755 }
34756 while (x.signum() > 0) {
34757 if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)
34758 if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)
34759 if (x.compareTo(y) >= 0) {
34760 x.subTo(y, x)
34761 x.rShiftTo(1, x)
34762 } else {
34763 y.subTo(x, y)
34764 y.rShiftTo(1, y)
34765 }
34766 }
34767 if (g > 0) y.lShiftTo(g, y)
34768 return y
34769}
34770
34771// (protected) this % n, n < 2^26
34772function bnpModInt(n) {
34773 if (n <= 0) return 0
34774 var d = this.DV % n,
34775 r = (this.s < 0) ? n - 1 : 0
34776 if (this.t > 0)
34777 if (d == 0) r = this[0] % n
34778 else
34779 for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n
34780 return r
34781}
34782
34783// (public) 1/this % m (HAC 14.61)
34784function bnModInverse(m) {
34785 var ac = m.isEven()
34786 if (this.signum() === 0) throw new Error('division by zero')
34787 if ((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO
34788 var u = m.clone(),
34789 v = this.clone()
34790 var a = nbv(1),
34791 b = nbv(0),
34792 c = nbv(0),
34793 d = nbv(1)
34794 while (u.signum() != 0) {
34795 while (u.isEven()) {
34796 u.rShiftTo(1, u)
34797 if (ac) {
34798 if (!a.isEven() || !b.isEven()) {
34799 a.addTo(this, a)
34800 b.subTo(m, b)
34801 }
34802 a.rShiftTo(1, a)
34803 } else if (!b.isEven()) b.subTo(m, b)
34804 b.rShiftTo(1, b)
34805 }
34806 while (v.isEven()) {
34807 v.rShiftTo(1, v)
34808 if (ac) {
34809 if (!c.isEven() || !d.isEven()) {
34810 c.addTo(this, c)
34811 d.subTo(m, d)
34812 }
34813 c.rShiftTo(1, c)
34814 } else if (!d.isEven()) d.subTo(m, d)
34815 d.rShiftTo(1, d)
34816 }
34817 if (u.compareTo(v) >= 0) {
34818 u.subTo(v, u)
34819 if (ac) a.subTo(c, a)
34820 b.subTo(d, b)
34821 } else {
34822 v.subTo(u, v)
34823 if (ac) c.subTo(a, c)
34824 d.subTo(b, d)
34825 }
34826 }
34827 if (v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO
34828 while (d.compareTo(m) >= 0) d.subTo(m, d)
34829 while (d.signum() < 0) d.addTo(m, d)
34830 return d
34831}
34832
34833var lowprimes = [
34834 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
34835 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
34836 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233,
34837 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317,
34838 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419,
34839 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503,
34840 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607,
34841 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701,
34842 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811,
34843 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911,
34844 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997
34845]
34846
34847var lplim = (1 << 26) / lowprimes[lowprimes.length - 1]
34848
34849// (public) test primality with certainty >= 1-.5^t
34850function bnIsProbablePrime(t) {
34851 var i, x = this.abs()
34852 if (x.t == 1 && x[0] <= lowprimes[lowprimes.length - 1]) {
34853 for (i = 0; i < lowprimes.length; ++i)
34854 if (x[0] == lowprimes[i]) return true
34855 return false
34856 }
34857 if (x.isEven()) return false
34858 i = 1
34859 while (i < lowprimes.length) {
34860 var m = lowprimes[i],
34861 j = i + 1
34862 while (j < lowprimes.length && m < lplim) m *= lowprimes[j++]
34863 m = x.modInt(m)
34864 while (i < j) if (m % lowprimes[i++] == 0) return false
34865 }
34866 return x.millerRabin(t)
34867}
34868
34869// (protected) true if probably prime (HAC 4.24, Miller-Rabin)
34870function bnpMillerRabin(t) {
34871 var n1 = this.subtract(BigInteger.ONE)
34872 var k = n1.getLowestSetBit()
34873 if (k <= 0) return false
34874 var r = n1.shiftRight(k)
34875 t = (t + 1) >> 1
34876 if (t > lowprimes.length) t = lowprimes.length
34877 var a = new BigInteger(null)
34878 var j, bases = []
34879 for (var i = 0; i < t; ++i) {
34880 for (;;) {
34881 j = lowprimes[Math.floor(Math.random() * lowprimes.length)]
34882 if (bases.indexOf(j) == -1) break
34883 }
34884 bases.push(j)
34885 a.fromInt(j)
34886 var y = a.modPow(r, this)
34887 if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
34888 var j = 1
34889 while (j++ < k && y.compareTo(n1) != 0) {
34890 y = y.modPowInt(2, this)
34891 if (y.compareTo(BigInteger.ONE) == 0) return false
34892 }
34893 if (y.compareTo(n1) != 0) return false
34894 }
34895 }
34896 return true
34897}
34898
34899// protected
34900proto.chunkSize = bnpChunkSize
34901proto.toRadix = bnpToRadix
34902proto.fromRadix = bnpFromRadix
34903proto.fromNumber = bnpFromNumber
34904proto.bitwiseTo = bnpBitwiseTo
34905proto.changeBit = bnpChangeBit
34906proto.addTo = bnpAddTo
34907proto.dMultiply = bnpDMultiply
34908proto.dAddOffset = bnpDAddOffset
34909proto.multiplyLowerTo = bnpMultiplyLowerTo
34910proto.multiplyUpperTo = bnpMultiplyUpperTo
34911proto.modInt = bnpModInt
34912proto.millerRabin = bnpMillerRabin
34913
34914// public
34915proto.clone = bnClone
34916proto.intValue = bnIntValue
34917proto.byteValue = bnByteValue
34918proto.shortValue = bnShortValue
34919proto.signum = bnSigNum
34920proto.toByteArray = bnToByteArray
34921proto.equals = bnEquals
34922proto.min = bnMin
34923proto.max = bnMax
34924proto.and = bnAnd
34925proto.or = bnOr
34926proto.xor = bnXor
34927proto.andNot = bnAndNot
34928proto.not = bnNot
34929proto.shiftLeft = bnShiftLeft
34930proto.shiftRight = bnShiftRight
34931proto.getLowestSetBit = bnGetLowestSetBit
34932proto.bitCount = bnBitCount
34933proto.testBit = bnTestBit
34934proto.setBit = bnSetBit
34935proto.clearBit = bnClearBit
34936proto.flipBit = bnFlipBit
34937proto.add = bnAdd
34938proto.subtract = bnSubtract
34939proto.multiply = bnMultiply
34940proto.divide = bnDivide
34941proto.remainder = bnRemainder
34942proto.divideAndRemainder = bnDivideAndRemainder
34943proto.modPow = bnModPow
34944proto.modInverse = bnModInverse
34945proto.pow = bnPow
34946proto.gcd = bnGCD
34947proto.isProbablePrime = bnIsProbablePrime
34948
34949// JSBN-specific extension
34950proto.square = bnSquare
34951
34952// constants
34953BigInteger.ZERO = nbv(0)
34954BigInteger.ONE = nbv(1)
34955BigInteger.valueOf = nbv
34956
34957module.exports = BigInteger
34958
34959},{"../package.json":40}],38:[function(require,module,exports){
34960(function (Buffer){
34961// FIXME: Kind of a weird way to throw exceptions, consider removing
34962var assert = require('assert')
34963var BigInteger = require('./bigi')
34964
34965/**
34966 * Turns a byte array into a big integer.
34967 *
34968 * This function will interpret a byte array as a big integer in big
34969 * endian notation.
34970 */
34971BigInteger.fromByteArrayUnsigned = function(byteArray) {
34972 // BigInteger expects a DER integer conformant byte array
34973 if (byteArray[0] & 0x80) {
34974 return new BigInteger([0].concat(byteArray))
34975 }
34976
34977 return new BigInteger(byteArray)
34978}
34979
34980/**
34981 * Returns a byte array representation of the big integer.
34982 *
34983 * This returns the absolute of the contained value in big endian
34984 * form. A value of zero results in an empty array.
34985 */
34986BigInteger.prototype.toByteArrayUnsigned = function() {
34987 var byteArray = this.toByteArray()
34988 return byteArray[0] === 0 ? byteArray.slice(1) : byteArray
34989}
34990
34991BigInteger.fromDERInteger = function(byteArray) {
34992 return new BigInteger(byteArray)
34993}
34994
34995/*
34996 * Converts BigInteger to a DER integer representation.
34997 *
34998 * The format for this value uses the most significant bit as a sign
34999 * bit. If the most significant bit is already set and the integer is
35000 * positive, a 0x00 is prepended.
35001 *
35002 * Examples:
35003 *
35004 * 0 => 0x00
35005 * 1 => 0x01
35006 * -1 => 0xff
35007 * 127 => 0x7f
35008 * -127 => 0x81
35009 * 128 => 0x0080
35010 * -128 => 0x80
35011 * 255 => 0x00ff
35012 * -255 => 0xff01
35013 * 16300 => 0x3fac
35014 * -16300 => 0xc054
35015 * 62300 => 0x00f35c
35016 * -62300 => 0xff0ca4
35017*/
35018BigInteger.prototype.toDERInteger = BigInteger.prototype.toByteArray
35019
35020BigInteger.fromBuffer = function(buffer) {
35021 // BigInteger expects a DER integer conformant byte array
35022 if (buffer[0] & 0x80) {
35023 var byteArray = Array.prototype.slice.call(buffer)
35024
35025 return new BigInteger([0].concat(byteArray))
35026 }
35027
35028 return new BigInteger(buffer)
35029}
35030
35031BigInteger.fromHex = function(hex) {
35032 if (hex === '') return BigInteger.ZERO
35033
35034 assert.equal(hex, hex.match(/^[A-Fa-f0-9]+/), 'Invalid hex string')
35035 assert.equal(hex.length % 2, 0, 'Incomplete hex')
35036 return new BigInteger(hex, 16)
35037}
35038
35039BigInteger.prototype.toBuffer = function(size) {
35040 var byteArray = this.toByteArrayUnsigned()
35041 var zeros = []
35042
35043 var padding = size - byteArray.length
35044 while (zeros.length < padding) zeros.push(0)
35045
35046 return new Buffer(zeros.concat(byteArray))
35047}
35048
35049BigInteger.prototype.toHex = function(size) {
35050 return this.toBuffer(size).toString('hex')
35051}
35052
35053}).call(this,require("buffer").Buffer)
35054},{"./bigi":37,"assert":1,"buffer":5}],39:[function(require,module,exports){
35055var BigInteger = require('./bigi')
35056
35057//addons
35058require('./convert')
35059
35060module.exports = BigInteger
35061},{"./bigi":37,"./convert":38}],40:[function(require,module,exports){
35062module.exports={
35063 "_args": [
35064 [
35065 "bigi",
35066 "/home/ian/git/bitcoin/bitcoinjs-lib-browser"
35067 ]
35068 ],
35069 "_from": "bigi@latest",
35070 "_id": "bigi@1.4.2",
35071 "_inCache": true,
35072 "_installable": true,
35073 "_location": "/bigi",
35074 "_nodeVersion": "6.1.0",
35075 "_npmOperationalInternal": {
35076 "host": "packages-12-west.internal.npmjs.com",
35077 "tmp": "tmp/bigi-1.4.2.tgz_1469584192413_0.6801238611806184"
35078 },
35079 "_npmUser": {
35080 "email": "jprichardson@gmail.com",
35081 "name": "jprichardson"
35082 },
35083 "_npmVersion": "3.8.6",
35084 "_phantomChildren": {},
35085 "_requested": {
35086 "name": "bigi",
35087 "raw": "bigi",
35088 "rawSpec": "",
35089 "scope": null,
35090 "spec": "latest",
35091 "type": "tag"
35092 },
35093 "_requiredBy": [
35094 "#USER",
35095 "/bitcoinjs-lib",
35096 "/ecurve"
35097 ],
35098 "_resolved": "https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz",
35099 "_shasum": "9c665a95f88b8b08fc05cfd731f561859d725825",
35100 "_shrinkwrap": null,
35101 "_spec": "bigi",
35102 "_where": "/home/ian/git/bitcoin/bitcoinjs-lib-browser",
35103 "bugs": {
35104 "url": "https://github.com/cryptocoinjs/bigi/issues"
35105 },
35106 "dependencies": {},
35107 "description": "Big integers.",
35108 "devDependencies": {
35109 "coveralls": "^2.11.2",
35110 "istanbul": "^0.3.5",
35111 "jshint": "^2.5.1",
35112 "mocha": "^2.1.0",
35113 "mochify": "^2.1.0"
35114 },
35115 "directories": {},
35116 "dist": {
35117 "shasum": "9c665a95f88b8b08fc05cfd731f561859d725825",
35118 "tarball": "https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz"
35119 },
35120 "gitHead": "c25308081c896ff84702303722bf5ecd8b3f78e3",
35121 "homepage": "https://github.com/cryptocoinjs/bigi#readme",
35122 "keywords": [
35123 "cryptography",
35124 "math",
35125 "bitcoin",
35126 "arbitrary",
35127 "precision",
35128 "arithmetic",
35129 "big",
35130 "integer",
35131 "int",
35132 "number",
35133 "biginteger",
35134 "bigint",
35135 "bignumber",
35136 "decimal",
35137 "float"
35138 ],
35139 "main": "./lib/index.js",
35140 "maintainers": [
35141 {
35142 "email": "boydb@midnightdesign.ws",
35143 "name": "midnightlightning"
35144 },
35145 {
35146 "email": "sidazhang89@gmail.com",
35147 "name": "sidazhang"
35148 },
35149 {
35150 "email": "npm@shesek.info",
35151 "name": "nadav"
35152 },
35153 {
35154 "email": "jprichardson@gmail.com",
35155 "name": "jprichardson"
35156 }
35157 ],
35158 "name": "bigi",
35159 "optionalDependencies": {},
35160 "readme": "ERROR: No README data found!",
35161 "repository": {
35162 "type": "git",
35163 "url": "git+https://github.com/cryptocoinjs/bigi.git"
35164 },
35165 "scripts": {
35166 "browser-test": "mochify --wd -R spec",
35167 "coverage": "istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js",
35168 "coveralls": "npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info",
35169 "jshint": "jshint --config jshint.json lib/*.js ; true",
35170 "test": "_mocha -- test/*.js",
35171 "unit": "mocha"
35172 },
35173 "testling": {
35174 "browsers": [
35175 "ie/9..latest",
35176 "firefox/latest",
35177 "chrome/latest",
35178 "safari/6.0..latest",
35179 "iphone/6.0..latest",
35180 "android-browser/4.2..latest"
35181 ],
35182 "files": "test/*.js",
35183 "harness": "mocha"
35184 },
35185 "version": "1.4.2"
35186}
35187
35188},{}],41:[function(require,module,exports){
35189// Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki
35190// Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]
35191// NOTE: SIGHASH byte ignored AND restricted, truncate before use
35192
35193var Buffer = require('safe-buffer').Buffer
35194
35195function check (buffer) {
35196 if (buffer.length < 8) return false
35197 if (buffer.length > 72) return false
35198 if (buffer[0] !== 0x30) return false
35199 if (buffer[1] !== buffer.length - 2) return false
35200 if (buffer[2] !== 0x02) return false
35201
35202 var lenR = buffer[3]
35203 if (lenR === 0) return false
35204 if (5 + lenR >= buffer.length) return false
35205 if (buffer[4 + lenR] !== 0x02) return false
35206
35207 var lenS = buffer[5 + lenR]
35208 if (lenS === 0) return false
35209 if ((6 + lenR + lenS) !== buffer.length) return false
35210
35211 if (buffer[4] & 0x80) return false
35212 if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false
35213
35214 if (buffer[lenR + 6] & 0x80) return false
35215 if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false
35216 return true
35217}
35218
35219function decode (buffer) {
35220 if (buffer.length < 8) throw new Error('DER sequence length is too short')
35221 if (buffer.length > 72) throw new Error('DER sequence length is too long')
35222 if (buffer[0] !== 0x30) throw new Error('Expected DER sequence')
35223 if (buffer[1] !== buffer.length - 2) throw new Error('DER sequence length is invalid')
35224 if (buffer[2] !== 0x02) throw new Error('Expected DER integer')
35225
35226 var lenR = buffer[3]
35227 if (lenR === 0) throw new Error('R length is zero')
35228 if (5 + lenR >= buffer.length) throw new Error('R length is too long')
35229 if (buffer[4 + lenR] !== 0x02) throw new Error('Expected DER integer (2)')
35230
35231 var lenS = buffer[5 + lenR]
35232 if (lenS === 0) throw new Error('S length is zero')
35233 if ((6 + lenR + lenS) !== buffer.length) throw new Error('S length is invalid')
35234
35235 if (buffer[4] & 0x80) throw new Error('R value is negative')
35236 if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) throw new Error('R value excessively padded')
35237
35238 if (buffer[lenR + 6] & 0x80) throw new Error('S value is negative')
35239 if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) throw new Error('S value excessively padded')
35240
35241 // non-BIP66 - extract R, S values
35242 return {
35243 r: buffer.slice(4, 4 + lenR),
35244 s: buffer.slice(6 + lenR)
35245 }
35246}
35247
35248/*
35249 * Expects r and s to be positive DER integers.
35250 *
35251 * The DER format uses the most significant bit as a sign bit (& 0x80).
35252 * If the significant bit is set AND the integer is positive, a 0x00 is prepended.
35253 *
35254 * Examples:
35255 *
35256 * 0 => 0x00
35257 * 1 => 0x01
35258 * -1 => 0xff
35259 * 127 => 0x7f
35260 * -127 => 0x81
35261 * 128 => 0x0080
35262 * -128 => 0x80
35263 * 255 => 0x00ff
35264 * -255 => 0xff01
35265 * 16300 => 0x3fac
35266 * -16300 => 0xc054
35267 * 62300 => 0x00f35c
35268 * -62300 => 0xff0ca4
35269*/
35270function encode (r, s) {
35271 var lenR = r.length
35272 var lenS = s.length
35273 if (lenR === 0) throw new Error('R length is zero')
35274 if (lenS === 0) throw new Error('S length is zero')
35275 if (lenR > 33) throw new Error('R length is too long')
35276 if (lenS > 33) throw new Error('S length is too long')
35277 if (r[0] & 0x80) throw new Error('R value is negative')
35278 if (s[0] & 0x80) throw new Error('S value is negative')
35279 if (lenR > 1 && (r[0] === 0x00) && !(r[1] & 0x80)) throw new Error('R value excessively padded')
35280 if (lenS > 1 && (s[0] === 0x00) && !(s[1] & 0x80)) throw new Error('S value excessively padded')
35281
35282 var signature = Buffer.allocUnsafe(6 + lenR + lenS)
35283
35284 // 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]
35285 signature[0] = 0x30
35286 signature[1] = signature.length - 2
35287 signature[2] = 0x02
35288 signature[3] = r.length
35289 r.copy(signature, 4)
35290 signature[4 + lenR] = 0x02
35291 signature[5 + lenR] = s.length
35292 s.copy(signature, 6 + lenR)
35293
35294 return signature
35295}
35296
35297module.exports = {
35298 check: check,
35299 decode: decode,
35300 encode: encode
35301}
35302
35303},{"safe-buffer":128}],42:[function(require,module,exports){
35304module.exports={
35305 "OP_FALSE": 0,
35306 "OP_0": 0,
35307 "OP_PUSHDATA1": 76,
35308 "OP_PUSHDATA2": 77,
35309 "OP_PUSHDATA4": 78,
35310 "OP_1NEGATE": 79,
35311 "OP_RESERVED": 80,
35312 "OP_1": 81,
35313 "OP_TRUE": 81,
35314 "OP_2": 82,
35315 "OP_3": 83,
35316 "OP_4": 84,
35317 "OP_5": 85,
35318 "OP_6": 86,
35319 "OP_7": 87,
35320 "OP_8": 88,
35321 "OP_9": 89,
35322 "OP_10": 90,
35323 "OP_11": 91,
35324 "OP_12": 92,
35325 "OP_13": 93,
35326 "OP_14": 94,
35327 "OP_15": 95,
35328 "OP_16": 96,
35329
35330 "OP_NOP": 97,
35331 "OP_VER": 98,
35332 "OP_IF": 99,
35333 "OP_NOTIF": 100,
35334 "OP_VERIF": 101,
35335 "OP_VERNOTIF": 102,
35336 "OP_ELSE": 103,
35337 "OP_ENDIF": 104,
35338 "OP_VERIFY": 105,
35339 "OP_RETURN": 106,
35340
35341 "OP_TOALTSTACK": 107,
35342 "OP_FROMALTSTACK": 108,
35343 "OP_2DROP": 109,
35344 "OP_2DUP": 110,
35345 "OP_3DUP": 111,
35346 "OP_2OVER": 112,
35347 "OP_2ROT": 113,
35348 "OP_2SWAP": 114,
35349 "OP_IFDUP": 115,
35350 "OP_DEPTH": 116,
35351 "OP_DROP": 117,
35352 "OP_DUP": 118,
35353 "OP_NIP": 119,
35354 "OP_OVER": 120,
35355 "OP_PICK": 121,
35356 "OP_ROLL": 122,
35357 "OP_ROT": 123,
35358 "OP_SWAP": 124,
35359 "OP_TUCK": 125,
35360
35361 "OP_CAT": 126,
35362 "OP_SUBSTR": 127,
35363 "OP_LEFT": 128,
35364 "OP_RIGHT": 129,
35365 "OP_SIZE": 130,
35366
35367 "OP_INVERT": 131,
35368 "OP_AND": 132,
35369 "OP_OR": 133,
35370 "OP_XOR": 134,
35371 "OP_EQUAL": 135,
35372 "OP_EQUALVERIFY": 136,
35373 "OP_RESERVED1": 137,
35374 "OP_RESERVED2": 138,
35375
35376 "OP_1ADD": 139,
35377 "OP_1SUB": 140,
35378 "OP_2MUL": 141,
35379 "OP_2DIV": 142,
35380 "OP_NEGATE": 143,
35381 "OP_ABS": 144,
35382 "OP_NOT": 145,
35383 "OP_0NOTEQUAL": 146,
35384 "OP_ADD": 147,
35385 "OP_SUB": 148,
35386 "OP_MUL": 149,
35387 "OP_DIV": 150,
35388 "OP_MOD": 151,
35389 "OP_LSHIFT": 152,
35390 "OP_RSHIFT": 153,
35391
35392 "OP_BOOLAND": 154,
35393 "OP_BOOLOR": 155,
35394 "OP_NUMEQUAL": 156,
35395 "OP_NUMEQUALVERIFY": 157,
35396 "OP_NUMNOTEQUAL": 158,
35397 "OP_LESSTHAN": 159,
35398 "OP_GREATERTHAN": 160,
35399 "OP_LESSTHANOREQUAL": 161,
35400 "OP_GREATERTHANOREQUAL": 162,
35401 "OP_MIN": 163,
35402 "OP_MAX": 164,
35403
35404 "OP_WITHIN": 165,
35405
35406 "OP_RIPEMD160": 166,
35407 "OP_SHA1": 167,
35408 "OP_SHA256": 168,
35409 "OP_HASH160": 169,
35410 "OP_HASH256": 170,
35411 "OP_CODESEPARATOR": 171,
35412 "OP_CHECKSIG": 172,
35413 "OP_CHECKSIGVERIFY": 173,
35414 "OP_CHECKMULTISIG": 174,
35415 "OP_CHECKMULTISIGVERIFY": 175,
35416
35417 "OP_NOP1": 176,
35418 "OP_NOP2": 177,
35419 "OP_CHECKLOCKTIMEVERIFY": 177,
35420
35421 "OP_NOP3": 178,
35422 "OP_NOP4": 179,
35423 "OP_NOP5": 180,
35424 "OP_NOP6": 181,
35425 "OP_NOP7": 182,
35426 "OP_NOP8": 183,
35427 "OP_NOP9": 184,
35428 "OP_NOP10": 185,
35429
35430 "OP_PUBKEYHASH": 253,
35431 "OP_PUBKEY": 254,
35432 "OP_INVALIDOPCODE": 255
35433}
35434
35435},{}],43:[function(require,module,exports){
35436var OPS = require('./index.json')
35437
35438var map = {}
35439for (var op in OPS) {
35440 var code = OPS[op]
35441 map[code] = op
35442}
35443
35444module.exports = map
35445
35446},{"./index.json":42}],44:[function(require,module,exports){
35447var Buffer = require('safe-buffer').Buffer
35448var bech32 = require('bech32')
35449var bs58check = require('bs58check')
35450var bscript = require('./script')
35451var btemplates = require('./templates')
35452var networks = require('./networks')
35453var typeforce = require('typeforce')
35454var types = require('./types')
35455
35456function fromBase58Check (address) {
35457 var payload = bs58check.decode(address)
35458
35459 // TODO: 4.0.0, move to "toOutputScript"
35460 if (payload.length < 21) throw new TypeError(address + ' is too short')
35461 if (payload.length > 21) throw new TypeError(address + ' is too long')
35462
35463 var version = payload.readUInt8(0)
35464 var hash = payload.slice(1)
35465
35466 return { version: version, hash: hash }
35467}
35468
35469function fromBech32 (address) {
35470 var result = bech32.decode(address)
35471 var data = bech32.fromWords(result.words.slice(1))
35472
35473 return {
35474 version: result.words[0],
35475 prefix: result.prefix,
35476 data: Buffer.from(data)
35477 }
35478}
35479
35480function toBase58Check (hash, version) {
35481 typeforce(types.tuple(types.Hash160bit, types.UInt8), arguments)
35482
35483 var payload = Buffer.allocUnsafe(21)
35484 payload.writeUInt8(version, 0)
35485 hash.copy(payload, 1)
35486
35487 return bs58check.encode(payload)
35488}
35489
35490function toBech32 (data, version, prefix) {
35491 var words = bech32.toWords(data)
35492 words.unshift(version)
35493
35494 return bech32.encode(prefix, words)
35495}
35496
35497function fromOutputScript (outputScript, network) {
35498 network = network || networks.bitcoin
35499
35500 if (btemplates.pubKeyHash.output.check(outputScript)) return toBase58Check(bscript.compile(outputScript).slice(3, 23), network.pubKeyHash)
35501 if (btemplates.scriptHash.output.check(outputScript)) return toBase58Check(bscript.compile(outputScript).slice(2, 22), network.scriptHash)
35502 if (btemplates.witnessPubKeyHash.output.check(outputScript)) return toBech32(bscript.compile(outputScript).slice(2, 22), 0, network.bech32)
35503 if (btemplates.witnessScriptHash.output.check(outputScript)) return toBech32(bscript.compile(outputScript).slice(2, 34), 0, network.bech32)
35504
35505 throw new Error(bscript.toASM(outputScript) + ' has no matching Address')
35506}
35507
35508function toOutputScript (address, network) {
35509 network = network || networks.bitcoin
35510
35511 var decode
35512 try {
35513 decode = fromBase58Check(address)
35514 } catch (e) {}
35515
35516 if (decode) {
35517 if (decode.version === network.pubKeyHash) return btemplates.pubKeyHash.output.encode(decode.hash)
35518 if (decode.version === network.scriptHash) return btemplates.scriptHash.output.encode(decode.hash)
35519 } else {
35520 try {
35521 decode = fromBech32(address)
35522 } catch (e) {}
35523
35524 if (decode) {
35525 if (decode.prefix !== network.bech32) throw new Error(address + ' has an invalid prefix')
35526 if (decode.version === 0) {
35527 if (decode.data.length === 20) return btemplates.witnessPubKeyHash.output.encode(decode.data)
35528 if (decode.data.length === 32) return btemplates.witnessScriptHash.output.encode(decode.data)
35529 }
35530 }
35531 }
35532
35533 throw new Error(address + ' has no matching Script')
35534}
35535
35536module.exports = {
35537 fromBase58Check: fromBase58Check,
35538 fromBech32: fromBech32,
35539 fromOutputScript: fromOutputScript,
35540 toBase58Check: toBase58Check,
35541 toBech32: toBech32,
35542 toOutputScript: toOutputScript
35543}
35544
35545},{"./networks":53,"./script":54,"./templates":56,"./types":80,"bech32":36,"bs58check":85,"safe-buffer":128,"typeforce":139}],45:[function(require,module,exports){
35546var Buffer = require('safe-buffer').Buffer
35547var bcrypto = require('./crypto')
35548var fastMerkleRoot = require('merkle-lib/fastRoot')
35549var typeforce = require('typeforce')
35550var types = require('./types')
35551var varuint = require('varuint-bitcoin')
35552
35553var Transaction = require('./transaction')
35554
35555function Block () {
35556 this.version = 1
35557 this.prevHash = null
35558 this.merkleRoot = null
35559 this.timestamp = 0
35560 this.bits = 0
35561 this.nonce = 0
35562}
35563
35564Block.fromBuffer = function (buffer) {
35565 if (buffer.length < 80) throw new Error('Buffer too small (< 80 bytes)')
35566
35567 var offset = 0
35568 function readSlice (n) {
35569 offset += n
35570 return buffer.slice(offset - n, offset)
35571 }
35572
35573 function readUInt32 () {
35574 var i = buffer.readUInt32LE(offset)
35575 offset += 4
35576 return i
35577 }
35578
35579 function readInt32 () {
35580 var i = buffer.readInt32LE(offset)
35581 offset += 4
35582 return i
35583 }
35584
35585 var block = new Block()
35586 block.version = readInt32()
35587 block.prevHash = readSlice(32)
35588 block.merkleRoot = readSlice(32)
35589 block.timestamp = readUInt32()
35590 block.bits = readUInt32()
35591 block.nonce = readUInt32()
35592
35593 if (buffer.length === 80) return block
35594
35595 function readVarInt () {
35596 var vi = varuint.decode(buffer, offset)
35597 offset += varuint.decode.bytes
35598 return vi
35599 }
35600
35601 function readTransaction () {
35602 var tx = Transaction.fromBuffer(buffer.slice(offset), true)
35603 offset += tx.byteLength()
35604 return tx
35605 }
35606
35607 var nTransactions = readVarInt()
35608 block.transactions = []
35609
35610 for (var i = 0; i < nTransactions; ++i) {
35611 var tx = readTransaction()
35612 block.transactions.push(tx)
35613 }
35614
35615 return block
35616}
35617
35618Block.prototype.byteLength = function (headersOnly) {
35619 if (headersOnly || !this.transactions) return 80
35620
35621 return 80 + varuint.encodingLength(this.transactions.length) + this.transactions.reduce(function (a, x) {
35622 return a + x.byteLength()
35623 }, 0)
35624}
35625
35626Block.fromHex = function (hex) {
35627 return Block.fromBuffer(Buffer.from(hex, 'hex'))
35628}
35629
35630Block.prototype.getHash = function () {
35631 return bcrypto.hash256(this.toBuffer(true))
35632}
35633
35634Block.prototype.getId = function () {
35635 return this.getHash().reverse().toString('hex')
35636}
35637
35638Block.prototype.getUTCDate = function () {
35639 var date = new Date(0) // epoch
35640 date.setUTCSeconds(this.timestamp)
35641
35642 return date
35643}
35644
35645// TODO: buffer, offset compatibility
35646Block.prototype.toBuffer = function (headersOnly) {
35647 var buffer = Buffer.allocUnsafe(this.byteLength(headersOnly))
35648
35649 var offset = 0
35650 function writeSlice (slice) {
35651 slice.copy(buffer, offset)
35652 offset += slice.length
35653 }
35654
35655 function writeInt32 (i) {
35656 buffer.writeInt32LE(i, offset)
35657 offset += 4
35658 }
35659 function writeUInt32 (i) {
35660 buffer.writeUInt32LE(i, offset)
35661 offset += 4
35662 }
35663
35664 writeInt32(this.version)
35665 writeSlice(this.prevHash)
35666 writeSlice(this.merkleRoot)
35667 writeUInt32(this.timestamp)
35668 writeUInt32(this.bits)
35669 writeUInt32(this.nonce)
35670
35671 if (headersOnly || !this.transactions) return buffer
35672
35673 varuint.encode(this.transactions.length, buffer, offset)
35674 offset += varuint.encode.bytes
35675
35676 this.transactions.forEach(function (tx) {
35677 var txSize = tx.byteLength() // TODO: extract from toBuffer?
35678 tx.toBuffer(buffer, offset)
35679 offset += txSize
35680 })
35681
35682 return buffer
35683}
35684
35685Block.prototype.toHex = function (headersOnly) {
35686 return this.toBuffer(headersOnly).toString('hex')
35687}
35688
35689Block.calculateTarget = function (bits) {
35690 var exponent = ((bits & 0xff000000) >> 24) - 3
35691 var mantissa = bits & 0x007fffff
35692 var target = Buffer.alloc(32, 0)
35693 target.writeUInt32BE(mantissa, 28 - exponent)
35694 return target
35695}
35696
35697Block.calculateMerkleRoot = function (transactions) {
35698 typeforce([{ getHash: types.Function }], transactions)
35699 if (transactions.length === 0) throw TypeError('Cannot compute merkle root for zero transactions')
35700
35701 var hashes = transactions.map(function (transaction) {
35702 return transaction.getHash()
35703 })
35704
35705 return fastMerkleRoot(hashes, bcrypto.hash256)
35706}
35707
35708Block.prototype.checkMerkleRoot = function () {
35709 if (!this.transactions) return false
35710
35711 var actualMerkleRoot = Block.calculateMerkleRoot(this.transactions)
35712 return this.merkleRoot.compare(actualMerkleRoot) === 0
35713}
35714
35715Block.prototype.checkProofOfWork = function () {
35716 var hash = this.getHash().reverse()
35717 var target = Block.calculateTarget(this.bits)
35718
35719 return hash.compare(target) <= 0
35720}
35721
35722module.exports = Block
35723
35724},{"./crypto":47,"./transaction":78,"./types":80,"merkle-lib/fastRoot":122,"safe-buffer":128,"typeforce":139,"varuint-bitcoin":141}],46:[function(require,module,exports){
35725var pushdata = require('pushdata-bitcoin')
35726var varuint = require('varuint-bitcoin')
35727
35728// https://github.com/feross/buffer/blob/master/index.js#L1127
35729function verifuint (value, max) {
35730 if (typeof value !== 'number') throw new Error('cannot write a non-number as a number')
35731 if (value < 0) throw new Error('specified a negative value for writing an unsigned value')
35732 if (value > max) throw new Error('RangeError: value out of range')
35733 if (Math.floor(value) !== value) throw new Error('value has a fractional component')
35734}
35735
35736function readUInt64LE (buffer, offset) {
35737 var a = buffer.readUInt32LE(offset)
35738 var b = buffer.readUInt32LE(offset + 4)
35739 b *= 0x100000000
35740
35741 verifuint(b + a, 0x001fffffffffffff)
35742
35743 return b + a
35744}
35745
35746function writeUInt64LE (buffer, value, offset) {
35747 verifuint(value, 0x001fffffffffffff)
35748
35749 buffer.writeInt32LE(value & -1, offset)
35750 buffer.writeUInt32LE(Math.floor(value / 0x100000000), offset + 4)
35751 return offset + 8
35752}
35753
35754// TODO: remove in 4.0.0?
35755function readVarInt (buffer, offset) {
35756 var result = varuint.decode(buffer, offset)
35757
35758 return {
35759 number: result,
35760 size: varuint.decode.bytes
35761 }
35762}
35763
35764// TODO: remove in 4.0.0?
35765function writeVarInt (buffer, number, offset) {
35766 varuint.encode(number, buffer, offset)
35767 return varuint.encode.bytes
35768}
35769
35770module.exports = {
35771 pushDataSize: pushdata.encodingLength,
35772 readPushDataInt: pushdata.decode,
35773 readUInt64LE: readUInt64LE,
35774 readVarInt: readVarInt,
35775 varIntBuffer: varuint.encode,
35776 varIntSize: varuint.encodingLength,
35777 writePushDataInt: pushdata.encode,
35778 writeUInt64LE: writeUInt64LE,
35779 writeVarInt: writeVarInt
35780}
35781
35782},{"pushdata-bitcoin":125,"varuint-bitcoin":141}],47:[function(require,module,exports){
35783var createHash = require('create-hash')
35784
35785function ripemd160 (buffer) {
35786 return createHash('rmd160').update(buffer).digest()
35787}
35788
35789function sha1 (buffer) {
35790 return createHash('sha1').update(buffer).digest()
35791}
35792
35793function sha256 (buffer) {
35794 return createHash('sha256').update(buffer).digest()
35795}
35796
35797function hash160 (buffer) {
35798 return ripemd160(sha256(buffer))
35799}
35800
35801function hash256 (buffer) {
35802 return sha256(sha256(buffer))
35803}
35804
35805module.exports = {
35806 hash160: hash160,
35807 hash256: hash256,
35808 ripemd160: ripemd160,
35809 sha1: sha1,
35810 sha256: sha256
35811}
35812
35813},{"create-hash":87}],48:[function(require,module,exports){
35814var Buffer = require('safe-buffer').Buffer
35815var createHmac = require('create-hmac')
35816var typeforce = require('typeforce')
35817var types = require('./types')
35818
35819var BigInteger = require('bigi')
35820var ECSignature = require('./ecsignature')
35821
35822var ZERO = Buffer.alloc(1, 0)
35823var ONE = Buffer.alloc(1, 1)
35824
35825var ecurve = require('ecurve')
35826var secp256k1 = ecurve.getCurveByName('secp256k1')
35827
35828// https://tools.ietf.org/html/rfc6979#section-3.2
35829function deterministicGenerateK (hash, x, checkSig) {
35830 typeforce(types.tuple(
35831 types.Hash256bit,
35832 types.Buffer256bit,
35833 types.Function
35834 ), arguments)
35835
35836 // Step A, ignored as hash already provided
35837 // Step B
35838 // Step C
35839 var k = Buffer.alloc(32, 0)
35840 var v = Buffer.alloc(32, 1)
35841
35842 // Step D
35843 k = createHmac('sha256', k)
35844 .update(v)
35845 .update(ZERO)
35846 .update(x)
35847 .update(hash)
35848 .digest()
35849
35850 // Step E
35851 v = createHmac('sha256', k).update(v).digest()
35852
35853 // Step F
35854 k = createHmac('sha256', k)
35855 .update(v)
35856 .update(ONE)
35857 .update(x)
35858 .update(hash)
35859 .digest()
35860
35861 // Step G
35862 v = createHmac('sha256', k).update(v).digest()
35863
35864 // Step H1/H2a, ignored as tlen === qlen (256 bit)
35865 // Step H2b
35866 v = createHmac('sha256', k).update(v).digest()
35867
35868 var T = BigInteger.fromBuffer(v)
35869
35870 // Step H3, repeat until T is within the interval [1, n - 1] and is suitable for ECDSA
35871 while (T.signum() <= 0 || T.compareTo(secp256k1.n) >= 0 || !checkSig(T)) {
35872 k = createHmac('sha256', k)
35873 .update(v)
35874 .update(ZERO)
35875 .digest()
35876
35877 v = createHmac('sha256', k).update(v).digest()
35878
35879 // Step H1/H2a, again, ignored as tlen === qlen (256 bit)
35880 // Step H2b again
35881 v = createHmac('sha256', k).update(v).digest()
35882 T = BigInteger.fromBuffer(v)
35883 }
35884
35885 return T
35886}
35887
35888var N_OVER_TWO = secp256k1.n.shiftRight(1)
35889
35890function sign (hash, d) {
35891 typeforce(types.tuple(types.Hash256bit, types.BigInt), arguments)
35892
35893 var x = d.toBuffer(32)
35894 var e = BigInteger.fromBuffer(hash)
35895 var n = secp256k1.n
35896 var G = secp256k1.G
35897
35898 var r, s
35899 deterministicGenerateK(hash, x, function (k) {
35900 var Q = G.multiply(k)
35901
35902 if (secp256k1.isInfinity(Q)) return false
35903
35904 r = Q.affineX.mod(n)
35905 if (r.signum() === 0) return false
35906
35907 s = k.modInverse(n).multiply(e.add(d.multiply(r))).mod(n)
35908 if (s.signum() === 0) return false
35909
35910 return true
35911 })
35912
35913 // enforce low S values, see bip62: 'low s values in signatures'
35914 if (s.compareTo(N_OVER_TWO) > 0) {
35915 s = n.subtract(s)
35916 }
35917
35918 return new ECSignature(r, s)
35919}
35920
35921function verify (hash, signature, Q) {
35922 typeforce(types.tuple(
35923 types.Hash256bit,
35924 types.ECSignature,
35925 types.ECPoint
35926 ), arguments)
35927
35928 var n = secp256k1.n
35929 var G = secp256k1.G
35930
35931 var r = signature.r
35932 var s = signature.s
35933
35934 // 1.4.1 Enforce r and s are both integers in the interval [1, n − 1]
35935 if (r.signum() <= 0 || r.compareTo(n) >= 0) return false
35936 if (s.signum() <= 0 || s.compareTo(n) >= 0) return false
35937
35938 // 1.4.2 H = Hash(M), already done by the user
35939 // 1.4.3 e = H
35940 var e = BigInteger.fromBuffer(hash)
35941
35942 // Compute s^-1
35943 var sInv = s.modInverse(n)
35944
35945 // 1.4.4 Compute u1 = es^−1 mod n
35946 // u2 = rs^−1 mod n
35947 var u1 = e.multiply(sInv).mod(n)
35948 var u2 = r.multiply(sInv).mod(n)
35949
35950 // 1.4.5 Compute R = (xR, yR)
35951 // R = u1G + u2Q
35952 var R = G.multiplyTwo(u1, Q, u2)
35953
35954 // 1.4.5 (cont.) Enforce R is not at infinity
35955 if (secp256k1.isInfinity(R)) return false
35956
35957 // 1.4.6 Convert the field element R.x to an integer
35958 var xR = R.affineX
35959
35960 // 1.4.7 Set v = xR mod n
35961 var v = xR.mod(n)
35962
35963 // 1.4.8 If v = r, output "valid", and if v != r, output "invalid"
35964 return v.equals(r)
35965}
35966
35967module.exports = {
35968 deterministicGenerateK: deterministicGenerateK,
35969 sign: sign,
35970 verify: verify,
35971
35972 // TODO: remove
35973 __curve: secp256k1
35974}
35975
35976},{"./ecsignature":50,"./types":80,"bigi":39,"create-hmac":90,"ecurve":94,"safe-buffer":128,"typeforce":139}],49:[function(require,module,exports){
35977var baddress = require('./address')
35978var bcrypto = require('./crypto')
35979var ecdsa = require('./ecdsa')
35980var randomBytes = require('randombytes')
35981var typeforce = require('typeforce')
35982var types = require('./types')
35983var wif = require('wif')
35984
35985var NETWORKS = require('./networks')
35986var BigInteger = require('bigi')
35987
35988var ecurve = require('ecurve')
35989var secp256k1 = ecdsa.__curve
35990
35991function ECPair (d, Q, options) {
35992 if (options) {
35993 typeforce({
35994 compressed: types.maybe(types.Boolean),
35995 network: types.maybe(types.Network)
35996 }, options)
35997 }
35998
35999 options = options || {}
36000
36001 if (d) {
36002 if (d.signum() <= 0) throw new Error('Private key must be greater than 0')
36003 if (d.compareTo(secp256k1.n) >= 0) throw new Error('Private key must be less than the curve order')
36004 if (Q) throw new TypeError('Unexpected publicKey parameter')
36005
36006 this.d = d
36007 } else {
36008 typeforce(types.ECPoint, Q)
36009
36010 this.__Q = Q
36011 }
36012
36013 this.compressed = options.compressed === undefined ? true : options.compressed
36014 this.network = options.network || NETWORKS.bitcoin
36015}
36016
36017Object.defineProperty(ECPair.prototype, 'Q', {
36018 get: function () {
36019 if (!this.__Q && this.d) {
36020 this.__Q = secp256k1.G.multiply(this.d)
36021 }
36022
36023 return this.__Q
36024 }
36025})
36026
36027ECPair.fromPublicKeyBuffer = function (buffer, network) {
36028 var Q = ecurve.Point.decodeFrom(secp256k1, buffer)
36029
36030 return new ECPair(null, Q, {
36031 compressed: Q.compressed,
36032 network: network
36033 })
36034}
36035
36036ECPair.fromWIF = function (string, network) {
36037 var decoded = wif.decode(string)
36038 var version = decoded.version
36039
36040 // list of networks?
36041 if (types.Array(network)) {
36042 network = network.filter(function (x) {
36043 return version === x.wif
36044 }).pop()
36045
36046 if (!network) throw new Error('Unknown network version')
36047
36048 // otherwise, assume a network object (or default to bitcoin)
36049 } else {
36050 network = network || NETWORKS.bitcoin
36051
36052 if (version !== network.wif) throw new Error('Invalid network version')
36053 }
36054
36055 var d = BigInteger.fromBuffer(decoded.privateKey)
36056
36057 return new ECPair(d, null, {
36058 compressed: decoded.compressed,
36059 network: network
36060 })
36061}
36062
36063ECPair.makeRandom = function (options) {
36064 options = options || {}
36065
36066 var rng = options.rng || randomBytes
36067
36068 var d
36069 do {
36070 var buffer = rng(32)
36071 typeforce(types.Buffer256bit, buffer)
36072
36073 d = BigInteger.fromBuffer(buffer)
36074 } while (d.signum() <= 0 || d.compareTo(secp256k1.n) >= 0)
36075
36076 return new ECPair(d, null, options)
36077}
36078
36079ECPair.prototype.getAddress = function () {
36080 return baddress.toBase58Check(bcrypto.hash160(this.getPublicKeyBuffer()), this.getNetwork().pubKeyHash)
36081}
36082
36083ECPair.prototype.getNetwork = function () {
36084 return this.network
36085}
36086
36087ECPair.prototype.getPublicKeyBuffer = function () {
36088 return this.Q.getEncoded(this.compressed)
36089}
36090
36091ECPair.prototype.sign = function (hash) {
36092 if (!this.d) throw new Error('Missing private key')
36093
36094 return ecdsa.sign(hash, this.d)
36095}
36096
36097ECPair.prototype.toWIF = function () {
36098 if (!this.d) throw new Error('Missing private key')
36099
36100 return wif.encode(this.network.wif, this.d.toBuffer(32), this.compressed)
36101}
36102
36103ECPair.prototype.verify = function (hash, signature) {
36104 return ecdsa.verify(hash, signature, this.Q)
36105}
36106
36107module.exports = ECPair
36108
36109},{"./address":44,"./crypto":47,"./ecdsa":48,"./networks":53,"./types":80,"bigi":39,"ecurve":94,"randombytes":126,"typeforce":139,"wif":142}],50:[function(require,module,exports){
36110(function (Buffer){
36111var bip66 = require('bip66')
36112var typeforce = require('typeforce')
36113var types = require('./types')
36114
36115var BigInteger = require('bigi')
36116
36117function ECSignature (r, s) {
36118 typeforce(types.tuple(types.BigInt, types.BigInt), arguments)
36119
36120 this.r = r
36121 this.s = s
36122}
36123
36124ECSignature.parseCompact = function (buffer) {
36125 typeforce(types.BufferN(65), buffer)
36126
36127 var flagByte = buffer.readUInt8(0) - 27
36128 if (flagByte !== (flagByte & 7)) throw new Error('Invalid signature parameter')
36129
36130 var compressed = !!(flagByte & 4)
36131 var recoveryParam = flagByte & 3
36132 var signature = ECSignature.fromRSBuffer(buffer.slice(1))
36133
36134 return {
36135 compressed: compressed,
36136 i: recoveryParam,
36137 signature: signature
36138 }
36139}
36140
36141ECSignature.fromRSBuffer = function (buffer) {
36142 typeforce(types.BufferN(64), buffer)
36143
36144 var r = BigInteger.fromBuffer(buffer.slice(0, 32))
36145 var s = BigInteger.fromBuffer(buffer.slice(32, 64))
36146 return new ECSignature(r, s)
36147}
36148
36149ECSignature.fromDER = function (buffer) {
36150 var decode = bip66.decode(buffer)
36151 var r = BigInteger.fromDERInteger(decode.r)
36152 var s = BigInteger.fromDERInteger(decode.s)
36153
36154 return new ECSignature(r, s)
36155}
36156
36157// BIP62: 1 byte hashType flag (only 0x01, 0x02, 0x03, 0x81, 0x82 and 0x83 are allowed)
36158ECSignature.parseScriptSignature = function (buffer) {
36159 var hashType = buffer.readUInt8(buffer.length - 1)
36160 var hashTypeMod = hashType & ~0x80
36161
36162 if (hashTypeMod <= 0x00 || hashTypeMod >= 0x04) throw new Error('Invalid hashType ' + hashType)
36163
36164 return {
36165 signature: ECSignature.fromDER(buffer.slice(0, -1)),
36166 hashType: hashType
36167 }
36168}
36169
36170ECSignature.prototype.toCompact = function (i, compressed) {
36171 if (compressed) {
36172 i += 4
36173 }
36174
36175 i += 27
36176
36177 var buffer = Buffer.alloc(65)
36178 buffer.writeUInt8(i, 0)
36179 this.toRSBuffer(buffer, 1)
36180 return buffer
36181}
36182
36183ECSignature.prototype.toDER = function () {
36184 var r = Buffer.from(this.r.toDERInteger())
36185 var s = Buffer.from(this.s.toDERInteger())
36186
36187 return bip66.encode(r, s)
36188}
36189
36190ECSignature.prototype.toRSBuffer = function (buffer, offset) {
36191 buffer = buffer || Buffer.alloc(64)
36192 this.r.toBuffer(32).copy(buffer, offset)
36193 this.s.toBuffer(32).copy(buffer, offset + 32)
36194 return buffer
36195}
36196
36197ECSignature.prototype.toScriptSignature = function (hashType) {
36198 var hashTypeMod = hashType & ~0x80
36199 if (hashTypeMod <= 0 || hashTypeMod >= 4) throw new Error('Invalid hashType ' + hashType)
36200
36201 var hashTypeBuffer = Buffer.alloc(1)
36202 hashTypeBuffer.writeUInt8(hashType, 0)
36203
36204 return Buffer.concat([this.toDER(), hashTypeBuffer])
36205}
36206
36207module.exports = ECSignature
36208
36209}).call(this,require("buffer").Buffer)
36210},{"./types":80,"bigi":39,"bip66":41,"buffer":5,"typeforce":139}],51:[function(require,module,exports){
36211var Buffer = require('safe-buffer').Buffer
36212var base58check = require('bs58check')
36213var bcrypto = require('./crypto')
36214var createHmac = require('create-hmac')
36215var typeforce = require('typeforce')
36216var types = require('./types')
36217var NETWORKS = require('./networks')
36218
36219var BigInteger = require('bigi')
36220var ECPair = require('./ecpair')
36221
36222var ecurve = require('ecurve')
36223var curve = ecurve.getCurveByName('secp256k1')
36224
36225function HDNode (keyPair, chainCode) {
36226 typeforce(types.tuple('ECPair', types.Buffer256bit), arguments)
36227
36228 if (!keyPair.compressed) throw new TypeError('BIP32 only allows compressed keyPairs')
36229
36230 this.keyPair = keyPair
36231 this.chainCode = chainCode
36232 this.depth = 0
36233 this.index = 0
36234 this.parentFingerprint = 0x00000000
36235}
36236
36237HDNode.HIGHEST_BIT = 0x80000000
36238HDNode.LENGTH = 78
36239HDNode.MASTER_SECRET = Buffer.from('Bitcoin seed', 'utf8')
36240
36241HDNode.fromSeedBuffer = function (seed, network) {
36242 typeforce(types.tuple(types.Buffer, types.maybe(types.Network)), arguments)
36243
36244 if (seed.length < 16) throw new TypeError('Seed should be at least 128 bits')
36245 if (seed.length > 64) throw new TypeError('Seed should be at most 512 bits')
36246
36247 var I = createHmac('sha512', HDNode.MASTER_SECRET).update(seed).digest()
36248 var IL = I.slice(0, 32)
36249 var IR = I.slice(32)
36250
36251 // In case IL is 0 or >= n, the master key is invalid
36252 // This is handled by the ECPair constructor
36253 var pIL = BigInteger.fromBuffer(IL)
36254 var keyPair = new ECPair(pIL, null, {
36255 network: network
36256 })
36257
36258 return new HDNode(keyPair, IR)
36259}
36260
36261HDNode.fromSeedHex = function (hex, network) {
36262 return HDNode.fromSeedBuffer(Buffer.from(hex, 'hex'), network)
36263}
36264
36265HDNode.fromBase58 = function (string, networks) {
36266 var buffer = base58check.decode(string)
36267 if (buffer.length !== 78) throw new Error('Invalid buffer length')
36268
36269 // 4 bytes: version bytes
36270 var version = buffer.readUInt32BE(0)
36271 var network
36272
36273 // list of networks?
36274 if (Array.isArray(networks)) {
36275 network = networks.filter(function (x) {
36276 return version === x.bip32.private ||
36277 version === x.bip32.public
36278 }).pop()
36279
36280 if (!network) throw new Error('Unknown network version')
36281
36282 // otherwise, assume a network object (or default to bitcoin)
36283 } else {
36284 network = networks || NETWORKS.bitcoin
36285 }
36286
36287 if (version !== network.bip32.private &&
36288 version !== network.bip32.public) throw new Error('Invalid network version')
36289
36290 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ...
36291 var depth = buffer[4]
36292
36293 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
36294 var parentFingerprint = buffer.readUInt32BE(5)
36295 if (depth === 0) {
36296 if (parentFingerprint !== 0x00000000) throw new Error('Invalid parent fingerprint')
36297 }
36298
36299 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
36300 // This is encoded in MSB order. (0x00000000 if master key)
36301 var index = buffer.readUInt32BE(9)
36302 if (depth === 0 && index !== 0) throw new Error('Invalid index')
36303
36304 // 32 bytes: the chain code
36305 var chainCode = buffer.slice(13, 45)
36306 var keyPair
36307
36308 // 33 bytes: private key data (0x00 + k)
36309 if (version === network.bip32.private) {
36310 if (buffer.readUInt8(45) !== 0x00) throw new Error('Invalid private key')
36311
36312 var d = BigInteger.fromBuffer(buffer.slice(46, 78))
36313 keyPair = new ECPair(d, null, { network: network })
36314
36315 // 33 bytes: public key data (0x02 + X or 0x03 + X)
36316 } else {
36317 var Q = ecurve.Point.decodeFrom(curve, buffer.slice(45, 78))
36318 // Q.compressed is assumed, if somehow this assumption is broken, `new HDNode` will throw
36319
36320 // Verify that the X coordinate in the public point corresponds to a point on the curve.
36321 // If not, the extended public key is invalid.
36322 curve.validate(Q)
36323
36324 keyPair = new ECPair(null, Q, { network: network })
36325 }
36326
36327 var hd = new HDNode(keyPair, chainCode)
36328 hd.depth = depth
36329 hd.index = index
36330 hd.parentFingerprint = parentFingerprint
36331
36332 return hd
36333}
36334
36335HDNode.prototype.getAddress = function () {
36336 return this.keyPair.getAddress()
36337}
36338
36339HDNode.prototype.getIdentifier = function () {
36340 return bcrypto.hash160(this.keyPair.getPublicKeyBuffer())
36341}
36342
36343HDNode.prototype.getFingerprint = function () {
36344 return this.getIdentifier().slice(0, 4)
36345}
36346
36347HDNode.prototype.getNetwork = function () {
36348 return this.keyPair.getNetwork()
36349}
36350
36351HDNode.prototype.getPublicKeyBuffer = function () {
36352 return this.keyPair.getPublicKeyBuffer()
36353}
36354
36355HDNode.prototype.neutered = function () {
36356 var neuteredKeyPair = new ECPair(null, this.keyPair.Q, {
36357 network: this.keyPair.network
36358 })
36359
36360 var neutered = new HDNode(neuteredKeyPair, this.chainCode)
36361 neutered.depth = this.depth
36362 neutered.index = this.index
36363 neutered.parentFingerprint = this.parentFingerprint
36364
36365 return neutered
36366}
36367
36368HDNode.prototype.sign = function (hash) {
36369 return this.keyPair.sign(hash)
36370}
36371
36372HDNode.prototype.verify = function (hash, signature) {
36373 return this.keyPair.verify(hash, signature)
36374}
36375
36376HDNode.prototype.toBase58 = function (__isPrivate) {
36377 if (__isPrivate !== undefined) throw new TypeError('Unsupported argument in 2.0.0')
36378
36379 // Version
36380 var network = this.keyPair.network
36381 var version = (!this.isNeutered()) ? network.bip32.private : network.bip32.public
36382 var buffer = Buffer.allocUnsafe(78)
36383
36384 // 4 bytes: version bytes
36385 buffer.writeUInt32BE(version, 0)
36386
36387 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ....
36388 buffer.writeUInt8(this.depth, 4)
36389
36390 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
36391 buffer.writeUInt32BE(this.parentFingerprint, 5)
36392
36393 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
36394 // This is encoded in big endian. (0x00000000 if master key)
36395 buffer.writeUInt32BE(this.index, 9)
36396
36397 // 32 bytes: the chain code
36398 this.chainCode.copy(buffer, 13)
36399
36400 // 33 bytes: the public key or private key data
36401 if (!this.isNeutered()) {
36402 // 0x00 + k for private keys
36403 buffer.writeUInt8(0, 45)
36404 this.keyPair.d.toBuffer(32).copy(buffer, 46)
36405
36406 // 33 bytes: the public key
36407 } else {
36408 // X9.62 encoding for public keys
36409 this.keyPair.getPublicKeyBuffer().copy(buffer, 45)
36410 }
36411
36412 return base58check.encode(buffer)
36413}
36414
36415// https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#child-key-derivation-ckd-functions
36416HDNode.prototype.derive = function (index) {
36417 typeforce(types.UInt32, index)
36418
36419 var isHardened = index >= HDNode.HIGHEST_BIT
36420 var data = Buffer.allocUnsafe(37)
36421
36422 // Hardened child
36423 if (isHardened) {
36424 if (this.isNeutered()) throw new TypeError('Could not derive hardened child key')
36425
36426 // data = 0x00 || ser256(kpar) || ser32(index)
36427 data[0] = 0x00
36428 this.keyPair.d.toBuffer(32).copy(data, 1)
36429 data.writeUInt32BE(index, 33)
36430
36431 // Normal child
36432 } else {
36433 // data = serP(point(kpar)) || ser32(index)
36434 // = serP(Kpar) || ser32(index)
36435 this.keyPair.getPublicKeyBuffer().copy(data, 0)
36436 data.writeUInt32BE(index, 33)
36437 }
36438
36439 var I = createHmac('sha512', this.chainCode).update(data).digest()
36440 var IL = I.slice(0, 32)
36441 var IR = I.slice(32)
36442
36443 var pIL = BigInteger.fromBuffer(IL)
36444
36445 // In case parse256(IL) >= n, proceed with the next value for i
36446 if (pIL.compareTo(curve.n) >= 0) {
36447 return this.derive(index + 1)
36448 }
36449
36450 // Private parent key -> private child key
36451 var derivedKeyPair
36452 if (!this.isNeutered()) {
36453 // ki = parse256(IL) + kpar (mod n)
36454 var ki = pIL.add(this.keyPair.d).mod(curve.n)
36455
36456 // In case ki == 0, proceed with the next value for i
36457 if (ki.signum() === 0) {
36458 return this.derive(index + 1)
36459 }
36460
36461 derivedKeyPair = new ECPair(ki, null, {
36462 network: this.keyPair.network
36463 })
36464
36465 // Public parent key -> public child key
36466 } else {
36467 // Ki = point(parse256(IL)) + Kpar
36468 // = G*IL + Kpar
36469 var Ki = curve.G.multiply(pIL).add(this.keyPair.Q)
36470
36471 // In case Ki is the point at infinity, proceed with the next value for i
36472 if (curve.isInfinity(Ki)) {
36473 return this.derive(index + 1)
36474 }
36475
36476 derivedKeyPair = new ECPair(null, Ki, {
36477 network: this.keyPair.network
36478 })
36479 }
36480
36481 var hd = new HDNode(derivedKeyPair, IR)
36482 hd.depth = this.depth + 1
36483 hd.index = index
36484 hd.parentFingerprint = this.getFingerprint().readUInt32BE(0)
36485
36486 return hd
36487}
36488
36489HDNode.prototype.deriveHardened = function (index) {
36490 typeforce(types.UInt31, index)
36491
36492 // Only derives hardened private keys by default
36493 return this.derive(index + HDNode.HIGHEST_BIT)
36494}
36495
36496// Private === not neutered
36497// Public === neutered
36498HDNode.prototype.isNeutered = function () {
36499 return !(this.keyPair.d)
36500}
36501
36502HDNode.prototype.derivePath = function (path) {
36503 typeforce(types.BIP32Path, path)
36504
36505 var splitPath = path.split('/')
36506 if (splitPath[0] === 'm') {
36507 if (this.parentFingerprint) {
36508 throw new Error('Not a master node')
36509 }
36510
36511 splitPath = splitPath.slice(1)
36512 }
36513
36514 return splitPath.reduce(function (prevHd, indexStr) {
36515 var index
36516 if (indexStr.slice(-1) === "'") {
36517 index = parseInt(indexStr.slice(0, -1), 10)
36518 return prevHd.deriveHardened(index)
36519 } else {
36520 index = parseInt(indexStr, 10)
36521 return prevHd.derive(index)
36522 }
36523 }, this)
36524}
36525
36526module.exports = HDNode
36527
36528},{"./crypto":47,"./ecpair":49,"./networks":53,"./types":80,"bigi":39,"bs58check":85,"create-hmac":90,"ecurve":94,"safe-buffer":128,"typeforce":139}],52:[function(require,module,exports){
36529var script = require('./script')
36530
36531var templates = require('./templates')
36532for (var key in templates) {
36533 script[key] = templates[key]
36534}
36535
36536module.exports = {
36537 bufferutils: require('./bufferutils'), // TODO: remove in 4.0.0
36538
36539 Block: require('./block'),
36540 ECPair: require('./ecpair'),
36541 ECSignature: require('./ecsignature'),
36542 HDNode: require('./hdnode'),
36543 Transaction: require('./transaction'),
36544 TransactionBuilder: require('./transaction_builder'),
36545
36546 address: require('./address'),
36547 crypto: require('./crypto'),
36548 networks: require('./networks'),
36549 opcodes: require('bitcoin-ops'),
36550 script: script
36551}
36552
36553},{"./address":44,"./block":45,"./bufferutils":46,"./crypto":47,"./ecpair":49,"./ecsignature":50,"./hdnode":51,"./networks":53,"./script":54,"./templates":56,"./transaction":78,"./transaction_builder":79,"bitcoin-ops":42}],53:[function(require,module,exports){
36554// https://en.bitcoin.it/wiki/List_of_address_prefixes
36555// Dogecoin BIP32 is a proposed standard: https://bitcointalk.org/index.php?topic=409731
36556
36557module.exports = {
36558 bitcoin: {
36559 messagePrefix: '\x18Bitcoin Signed Message:\n',
36560 bech32: 'bc',
36561 bip32: {
36562 public: 0x0488b21e,
36563 private: 0x0488ade4
36564 },
36565 pubKeyHash: 0x00,
36566 scriptHash: 0x05,
36567 wif: 0x80
36568 },
36569 testnet: {
36570 messagePrefix: '\x18Bitcoin Signed Message:\n',
36571 bech32: 'tb',
36572 bip32: {
36573 public: 0x043587cf,
36574 private: 0x04358394
36575 },
36576 pubKeyHash: 0x6f,
36577 scriptHash: 0xc4,
36578 wif: 0xef
36579 },
36580 litecoin: {
36581 messagePrefix: '\x19Litecoin Signed Message:\n',
36582 bip32: {
36583 public: 0x019da462,
36584 private: 0x019d9cfe
36585 },
36586 pubKeyHash: 0x30,
36587 scriptHash: 0x32,
36588 wif: 0xb0
36589 }
36590}
36591
36592},{}],54:[function(require,module,exports){
36593var Buffer = require('safe-buffer').Buffer
36594var bip66 = require('bip66')
36595var pushdata = require('pushdata-bitcoin')
36596var typeforce = require('typeforce')
36597var types = require('./types')
36598var scriptNumber = require('./script_number')
36599
36600var OPS = require('bitcoin-ops')
36601var REVERSE_OPS = require('bitcoin-ops/map')
36602var OP_INT_BASE = OPS.OP_RESERVED // OP_1 - 1
36603
36604function isOPInt (value) {
36605 return types.Number(value) &&
36606 ((value === OPS.OP_0) ||
36607 (value >= OPS.OP_1 && value <= OPS.OP_16) ||
36608 (value === OPS.OP_1NEGATE))
36609}
36610
36611function isPushOnlyChunk (value) {
36612 return types.Buffer(value) || isOPInt(value)
36613}
36614
36615function isPushOnly (value) {
36616 return types.Array(value) && value.every(isPushOnlyChunk)
36617}
36618
36619function asMinimalOP (buffer) {
36620 if (buffer.length === 0) return OPS.OP_0
36621 if (buffer.length !== 1) return
36622 if (buffer[0] >= 1 && buffer[0] <= 16) return OP_INT_BASE + buffer[0]
36623 if (buffer[0] === 0x81) return OPS.OP_1NEGATE
36624}
36625
36626function compile (chunks) {
36627 // TODO: remove me
36628 if (Buffer.isBuffer(chunks)) return chunks
36629
36630 typeforce(types.Array, chunks)
36631
36632 var bufferSize = chunks.reduce(function (accum, chunk) {
36633 // data chunk
36634 if (Buffer.isBuffer(chunk)) {
36635 // adhere to BIP62.3, minimal push policy
36636 if (chunk.length === 1 && asMinimalOP(chunk) !== undefined) {
36637 return accum + 1
36638 }
36639
36640 return accum + pushdata.encodingLength(chunk.length) + chunk.length
36641 }
36642
36643 // opcode
36644 return accum + 1
36645 }, 0.0)
36646
36647 var buffer = Buffer.allocUnsafe(bufferSize)
36648 var offset = 0
36649
36650 chunks.forEach(function (chunk) {
36651 // data chunk
36652 if (Buffer.isBuffer(chunk)) {
36653 // adhere to BIP62.3, minimal push policy
36654 var opcode = asMinimalOP(chunk)
36655 if (opcode !== undefined) {
36656 buffer.writeUInt8(opcode, offset)
36657 offset += 1
36658 return
36659 }
36660
36661 offset += pushdata.encode(buffer, chunk.length, offset)
36662 chunk.copy(buffer, offset)
36663 offset += chunk.length
36664
36665 // opcode
36666 } else {
36667 buffer.writeUInt8(chunk, offset)
36668 offset += 1
36669 }
36670 })
36671
36672 if (offset !== buffer.length) throw new Error('Could not decode chunks')
36673 return buffer
36674}
36675
36676function decompile (buffer) {
36677 // TODO: remove me
36678 if (types.Array(buffer)) return buffer
36679
36680 typeforce(types.Buffer, buffer)
36681
36682 var chunks = []
36683 var i = 0
36684
36685 while (i < buffer.length) {
36686 var opcode = buffer[i]
36687
36688 // data chunk
36689 if ((opcode > OPS.OP_0) && (opcode <= OPS.OP_PUSHDATA4)) {
36690 var d = pushdata.decode(buffer, i)
36691
36692 // did reading a pushDataInt fail? empty script
36693 if (d === null) return []
36694 i += d.size
36695
36696 // attempt to read too much data? empty script
36697 if (i + d.number > buffer.length) return []
36698
36699 var data = buffer.slice(i, i + d.number)
36700 i += d.number
36701
36702 // decompile minimally
36703 var op = asMinimalOP(data)
36704 if (op !== undefined) {
36705 chunks.push(op)
36706 } else {
36707 chunks.push(data)
36708 }
36709
36710 // opcode
36711 } else {
36712 chunks.push(opcode)
36713
36714 i += 1
36715 }
36716 }
36717
36718 return chunks
36719}
36720
36721function toASM (chunks) {
36722 if (Buffer.isBuffer(chunks)) {
36723 chunks = decompile(chunks)
36724 }
36725
36726 return chunks.map(function (chunk) {
36727 // data?
36728 if (Buffer.isBuffer(chunk)) {
36729 var op = asMinimalOP(chunk)
36730 if (op === undefined) return chunk.toString('hex')
36731 chunk = op
36732 }
36733
36734 // opcode!
36735 return REVERSE_OPS[chunk]
36736 }).join(' ')
36737}
36738
36739function fromASM (asm) {
36740 typeforce(types.String, asm)
36741
36742 return compile(asm.split(' ').map(function (chunkStr) {
36743 // opcode?
36744 if (OPS[chunkStr] !== undefined) return OPS[chunkStr]
36745 typeforce(types.Hex, chunkStr)
36746
36747 // data!
36748 return Buffer.from(chunkStr, 'hex')
36749 }))
36750}
36751
36752function toStack (chunks) {
36753 chunks = decompile(chunks)
36754 typeforce(isPushOnly, chunks)
36755
36756 return chunks.map(function (op) {
36757 if (Buffer.isBuffer(op)) return op
36758 if (op === OPS.OP_0) return Buffer.allocUnsafe(0)
36759
36760 return scriptNumber.encode(op - OP_INT_BASE)
36761 })
36762}
36763
36764function isCanonicalPubKey (buffer) {
36765 if (!Buffer.isBuffer(buffer)) return false
36766 if (buffer.length < 33) return false
36767
36768 switch (buffer[0]) {
36769 case 0x02:
36770 case 0x03:
36771 return buffer.length === 33
36772 case 0x04:
36773 return buffer.length === 65
36774 }
36775
36776 return false
36777}
36778
36779function isDefinedHashType (hashType) {
36780 var hashTypeMod = hashType & ~0x80
36781
36782// return hashTypeMod > SIGHASH_ALL && hashTypeMod < SIGHASH_SINGLE
36783 return hashTypeMod > 0x00 && hashTypeMod < 0x04
36784}
36785
36786function isCanonicalSignature (buffer) {
36787 if (!Buffer.isBuffer(buffer)) return false
36788 if (!isDefinedHashType(buffer[buffer.length - 1])) return false
36789
36790 return bip66.check(buffer.slice(0, -1))
36791}
36792
36793module.exports = {
36794 compile: compile,
36795 decompile: decompile,
36796 fromASM: fromASM,
36797 toASM: toASM,
36798 toStack: toStack,
36799
36800 number: require('./script_number'),
36801
36802 isCanonicalPubKey: isCanonicalPubKey,
36803 isCanonicalSignature: isCanonicalSignature,
36804 isPushOnly: isPushOnly,
36805 isDefinedHashType: isDefinedHashType
36806}
36807
36808},{"./script_number":55,"./types":80,"bip66":41,"bitcoin-ops":42,"bitcoin-ops/map":43,"pushdata-bitcoin":125,"safe-buffer":128,"typeforce":139}],55:[function(require,module,exports){
36809var Buffer = require('safe-buffer').Buffer
36810
36811function decode (buffer, maxLength, minimal) {
36812 maxLength = maxLength || 4
36813 minimal = minimal === undefined ? true : minimal
36814
36815 var length = buffer.length
36816 if (length === 0) return 0
36817 if (length > maxLength) throw new TypeError('Script number overflow')
36818 if (minimal) {
36819 if ((buffer[length - 1] & 0x7f) === 0) {
36820 if (length <= 1 || (buffer[length - 2] & 0x80) === 0) throw new Error('Non-minimally encoded script number')
36821 }
36822 }
36823
36824 // 40-bit
36825 if (length === 5) {
36826 var a = buffer.readUInt32LE(0)
36827 var b = buffer.readUInt8(4)
36828
36829 if (b & 0x80) return -(((b & ~0x80) * 0x100000000) + a)
36830 return (b * 0x100000000) + a
36831 }
36832
36833 var result = 0
36834
36835 // 32-bit / 24-bit / 16-bit / 8-bit
36836 for (var i = 0; i < length; ++i) {
36837 result |= buffer[i] << (8 * i)
36838 }
36839
36840 if (buffer[length - 1] & 0x80) return -(result & ~(0x80 << (8 * (length - 1))))
36841 return result
36842}
36843
36844function scriptNumSize (i) {
36845 return i > 0x7fffffff ? 5
36846 : i > 0x7fffff ? 4
36847 : i > 0x7fff ? 3
36848 : i > 0x7f ? 2
36849 : i > 0x00 ? 1
36850 : 0
36851}
36852
36853function encode (number) {
36854 var value = Math.abs(number)
36855 var size = scriptNumSize(value)
36856 var buffer = Buffer.allocUnsafe(size)
36857 var negative = number < 0
36858
36859 for (var i = 0; i < size; ++i) {
36860 buffer.writeUInt8(value & 0xff, i)
36861 value >>= 8
36862 }
36863
36864 if (buffer[size - 1] & 0x80) {
36865 buffer.writeUInt8(negative ? 0x80 : 0x00, size - 1)
36866 } else if (negative) {
36867 buffer[size - 1] |= 0x80
36868 }
36869
36870 return buffer
36871}
36872
36873module.exports = {
36874 decode: decode,
36875 encode: encode
36876}
36877
36878},{"safe-buffer":128}],56:[function(require,module,exports){
36879var decompile = require('../script').decompile
36880var multisig = require('./multisig')
36881var nullData = require('./nulldata')
36882var pubKey = require('./pubkey')
36883var pubKeyHash = require('./pubkeyhash')
36884var scriptHash = require('./scripthash')
36885var witnessPubKeyHash = require('./witnesspubkeyhash')
36886var witnessScriptHash = require('./witnessscripthash')
36887var witnessCommitment = require('./witnesscommitment')
36888
36889var types = {
36890 MULTISIG: 'multisig',
36891 NONSTANDARD: 'nonstandard',
36892 NULLDATA: 'nulldata',
36893 P2PK: 'pubkey',
36894 P2PKH: 'pubkeyhash',
36895 P2SH: 'scripthash',
36896 P2WPKH: 'witnesspubkeyhash',
36897 P2WSH: 'witnessscripthash',
36898 WITNESS_COMMITMENT: 'witnesscommitment'
36899}
36900
36901function classifyOutput (script) {
36902 if (witnessPubKeyHash.output.check(script)) return types.P2WPKH
36903 if (witnessScriptHash.output.check(script)) return types.P2WSH
36904 if (pubKeyHash.output.check(script)) return types.P2PKH
36905 if (scriptHash.output.check(script)) return types.P2SH
36906
36907 // XXX: optimization, below functions .decompile before use
36908 var chunks = decompile(script)
36909 if (multisig.output.check(chunks)) return types.MULTISIG
36910 if (pubKey.output.check(chunks)) return types.P2PK
36911 if (witnessCommitment.output.check(chunks)) return types.WITNESS_COMMITMENT
36912 if (nullData.output.check(chunks)) return types.NULLDATA
36913
36914 return types.NONSTANDARD
36915}
36916
36917function classifyInput (script, allowIncomplete) {
36918 // XXX: optimization, below functions .decompile before use
36919 var chunks = decompile(script)
36920
36921 if (pubKeyHash.input.check(chunks)) return types.P2PKH
36922 if (scriptHash.input.check(chunks, allowIncomplete)) return types.P2SH
36923 if (multisig.input.check(chunks, allowIncomplete)) return types.MULTISIG
36924 if (pubKey.input.check(chunks)) return types.P2PK
36925
36926 return types.NONSTANDARD
36927}
36928
36929function classifyWitness (script, allowIncomplete) {
36930 // XXX: optimization, below functions .decompile before use
36931 var chunks = decompile(script)
36932
36933 if (witnessPubKeyHash.input.check(chunks)) return types.P2WPKH
36934 if (witnessScriptHash.input.check(chunks, allowIncomplete)) return types.P2WSH
36935
36936 return types.NONSTANDARD
36937}
36938
36939module.exports = {
36940 classifyInput: classifyInput,
36941 classifyOutput: classifyOutput,
36942 classifyWitness: classifyWitness,
36943 multisig: multisig,
36944 nullData: nullData,
36945 pubKey: pubKey,
36946 pubKeyHash: pubKeyHash,
36947 scriptHash: scriptHash,
36948 witnessPubKeyHash: witnessPubKeyHash,
36949 witnessScriptHash: witnessScriptHash,
36950 witnessCommitment: witnessCommitment,
36951 types: types
36952}
36953
36954},{"../script":54,"./multisig":57,"./nulldata":60,"./pubkey":61,"./pubkeyhash":64,"./scripthash":67,"./witnesscommitment":70,"./witnesspubkeyhash":72,"./witnessscripthash":75}],57:[function(require,module,exports){
36955module.exports = {
36956 input: require('./input'),
36957 output: require('./output')
36958}
36959
36960},{"./input":58,"./output":59}],58:[function(require,module,exports){
36961// OP_0 [signatures ...]
36962
36963var Buffer = require('safe-buffer').Buffer
36964var bscript = require('../../script')
36965var p2mso = require('./output')
36966var typeforce = require('typeforce')
36967var OPS = require('bitcoin-ops')
36968
36969function partialSignature (value) {
36970 return value === OPS.OP_0 || bscript.isCanonicalSignature(value)
36971}
36972
36973function check (script, allowIncomplete) {
36974 var chunks = bscript.decompile(script)
36975 if (chunks.length < 2) return false
36976 if (chunks[0] !== OPS.OP_0) return false
36977
36978 if (allowIncomplete) {
36979 return chunks.slice(1).every(partialSignature)
36980 }
36981
36982 return chunks.slice(1).every(bscript.isCanonicalSignature)
36983}
36984check.toJSON = function () { return 'multisig input' }
36985
36986var EMPTY_BUFFER = Buffer.allocUnsafe(0)
36987
36988function encodeStack (signatures, scriptPubKey) {
36989 typeforce([partialSignature], signatures)
36990
36991 if (scriptPubKey) {
36992 var scriptData = p2mso.decode(scriptPubKey)
36993
36994 if (signatures.length < scriptData.m) {
36995 throw new TypeError('Not enough signatures provided')
36996 }
36997
36998 if (signatures.length > scriptData.pubKeys.length) {
36999 throw new TypeError('Too many signatures provided')
37000 }
37001 }
37002
37003 return [].concat(EMPTY_BUFFER, signatures.map(function (sig) {
37004 if (sig === OPS.OP_0) {
37005 return EMPTY_BUFFER
37006 }
37007 return sig
37008 }))
37009}
37010
37011function encode (signatures, scriptPubKey) {
37012 return bscript.compile(encodeStack(signatures, scriptPubKey))
37013}
37014
37015function decodeStack (stack, allowIncomplete) {
37016 typeforce(check, stack, allowIncomplete)
37017 return stack.slice(1)
37018}
37019
37020function decode (buffer, allowIncomplete) {
37021 var stack = bscript.decompile(buffer)
37022 return decodeStack(stack, allowIncomplete)
37023}
37024
37025module.exports = {
37026 check: check,
37027 decode: decode,
37028 decodeStack: decodeStack,
37029 encode: encode,
37030 encodeStack: encodeStack
37031}
37032
37033},{"../../script":54,"./output":59,"bitcoin-ops":42,"safe-buffer":128,"typeforce":139}],59:[function(require,module,exports){
37034// m [pubKeys ...] n OP_CHECKMULTISIG
37035
37036var bscript = require('../../script')
37037var types = require('../../types')
37038var typeforce = require('typeforce')
37039var OPS = require('bitcoin-ops')
37040var OP_INT_BASE = OPS.OP_RESERVED // OP_1 - 1
37041
37042function check (script, allowIncomplete) {
37043 var chunks = bscript.decompile(script)
37044
37045 if (chunks.length < 4) return false
37046 if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG) return false
37047 if (!types.Number(chunks[0])) return false
37048 if (!types.Number(chunks[chunks.length - 2])) return false
37049 var m = chunks[0] - OP_INT_BASE
37050 var n = chunks[chunks.length - 2] - OP_INT_BASE
37051
37052 if (m <= 0) return false
37053 if (n > 16) return false
37054 if (m > n) return false
37055 if (n !== chunks.length - 3) return false
37056 if (allowIncomplete) return true
37057
37058 var keys = chunks.slice(1, -2)
37059 return keys.every(bscript.isCanonicalPubKey)
37060}
37061check.toJSON = function () { return 'multi-sig output' }
37062
37063function encode (m, pubKeys) {
37064 typeforce({
37065 m: types.Number,
37066 pubKeys: [bscript.isCanonicalPubKey]
37067 }, {
37068 m: m,
37069 pubKeys: pubKeys
37070 })
37071
37072 var n = pubKeys.length
37073 if (n < m) throw new TypeError('Not enough pubKeys provided')
37074
37075 return bscript.compile([].concat(
37076 OP_INT_BASE + m,
37077 pubKeys,
37078 OP_INT_BASE + n,
37079 OPS.OP_CHECKMULTISIG
37080 ))
37081}
37082
37083function decode (buffer, allowIncomplete) {
37084 var chunks = bscript.decompile(buffer)
37085 typeforce(check, chunks, allowIncomplete)
37086
37087 return {
37088 m: chunks[0] - OP_INT_BASE,
37089 pubKeys: chunks.slice(1, -2)
37090 }
37091}
37092
37093module.exports = {
37094 check: check,
37095 decode: decode,
37096 encode: encode
37097}
37098
37099},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":139}],60:[function(require,module,exports){
37100// OP_RETURN {data}
37101
37102var bscript = require('../script')
37103var types = require('../types')
37104var typeforce = require('typeforce')
37105var OPS = require('bitcoin-ops')
37106
37107function check (script) {
37108 var buffer = bscript.compile(script)
37109
37110 return buffer.length > 1 &&
37111 buffer[0] === OPS.OP_RETURN
37112}
37113check.toJSON = function () { return 'null data output' }
37114
37115function encode (data) {
37116 typeforce(types.Buffer, data)
37117
37118 return bscript.compile([OPS.OP_RETURN, data])
37119}
37120
37121function decode (buffer) {
37122 typeforce(check, buffer)
37123
37124 return buffer.slice(2)
37125}
37126
37127module.exports = {
37128 output: {
37129 check: check,
37130 decode: decode,
37131 encode: encode
37132 }
37133}
37134
37135},{"../script":54,"../types":80,"bitcoin-ops":42,"typeforce":139}],61:[function(require,module,exports){
37136arguments[4][57][0].apply(exports,arguments)
37137},{"./input":62,"./output":63,"dup":57}],62:[function(require,module,exports){
37138// {signature}
37139
37140var bscript = require('../../script')
37141var typeforce = require('typeforce')
37142
37143function check (script) {
37144 var chunks = bscript.decompile(script)
37145
37146 return chunks.length === 1 &&
37147 bscript.isCanonicalSignature(chunks[0])
37148}
37149check.toJSON = function () { return 'pubKey input' }
37150
37151function encodeStack (signature) {
37152 typeforce(bscript.isCanonicalSignature, signature)
37153 return [signature]
37154}
37155
37156function encode (signature) {
37157 return bscript.compile(encodeStack(signature))
37158}
37159
37160function decodeStack (stack) {
37161 typeforce(check, stack)
37162 return stack[0]
37163}
37164
37165function decode (buffer) {
37166 var stack = bscript.decompile(buffer)
37167 return decodeStack(stack)
37168}
37169
37170module.exports = {
37171 check: check,
37172 decode: decode,
37173 decodeStack: decodeStack,
37174 encode: encode,
37175 encodeStack: encodeStack
37176}
37177
37178},{"../../script":54,"typeforce":139}],63:[function(require,module,exports){
37179// {pubKey} OP_CHECKSIG
37180
37181var bscript = require('../../script')
37182var typeforce = require('typeforce')
37183var OPS = require('bitcoin-ops')
37184
37185function check (script) {
37186 var chunks = bscript.decompile(script)
37187
37188 return chunks.length === 2 &&
37189 bscript.isCanonicalPubKey(chunks[0]) &&
37190 chunks[1] === OPS.OP_CHECKSIG
37191}
37192check.toJSON = function () { return 'pubKey output' }
37193
37194function encode (pubKey) {
37195 typeforce(bscript.isCanonicalPubKey, pubKey)
37196
37197 return bscript.compile([pubKey, OPS.OP_CHECKSIG])
37198}
37199
37200function decode (buffer) {
37201 var chunks = bscript.decompile(buffer)
37202 typeforce(check, chunks)
37203
37204 return chunks[0]
37205}
37206
37207module.exports = {
37208 check: check,
37209 decode: decode,
37210 encode: encode
37211}
37212
37213},{"../../script":54,"bitcoin-ops":42,"typeforce":139}],64:[function(require,module,exports){
37214arguments[4][57][0].apply(exports,arguments)
37215},{"./input":65,"./output":66,"dup":57}],65:[function(require,module,exports){
37216// {signature} {pubKey}
37217
37218var bscript = require('../../script')
37219var typeforce = require('typeforce')
37220
37221function check (script) {
37222 var chunks = bscript.decompile(script)
37223
37224 return chunks.length === 2 &&
37225 bscript.isCanonicalSignature(chunks[0]) &&
37226 bscript.isCanonicalPubKey(chunks[1])
37227}
37228check.toJSON = function () { return 'pubKeyHash input' }
37229
37230function encodeStack (signature, pubKey) {
37231 typeforce({
37232 signature: bscript.isCanonicalSignature,
37233 pubKey: bscript.isCanonicalPubKey
37234 }, {
37235 signature: signature,
37236 pubKey: pubKey
37237 })
37238
37239 return [signature, pubKey]
37240}
37241
37242function encode (signature, pubKey) {
37243 return bscript.compile(encodeStack(signature, pubKey))
37244}
37245
37246function decodeStack (stack) {
37247 typeforce(check, stack)
37248
37249 return {
37250 signature: stack[0],
37251 pubKey: stack[1]
37252 }
37253}
37254
37255function decode (buffer) {
37256 var stack = bscript.decompile(buffer)
37257 return decodeStack(stack)
37258}
37259
37260module.exports = {
37261 check: check,
37262 decode: decode,
37263 decodeStack: decodeStack,
37264 encode: encode,
37265 encodeStack: encodeStack
37266}
37267
37268},{"../../script":54,"typeforce":139}],66:[function(require,module,exports){
37269// OP_DUP OP_HASH160 {pubKeyHash} OP_EQUALVERIFY OP_CHECKSIG
37270
37271var bscript = require('../../script')
37272var types = require('../../types')
37273var typeforce = require('typeforce')
37274var OPS = require('bitcoin-ops')
37275
37276function check (script) {
37277 var buffer = bscript.compile(script)
37278
37279 return buffer.length === 25 &&
37280 buffer[0] === OPS.OP_DUP &&
37281 buffer[1] === OPS.OP_HASH160 &&
37282 buffer[2] === 0x14 &&
37283 buffer[23] === OPS.OP_EQUALVERIFY &&
37284 buffer[24] === OPS.OP_CHECKSIG
37285}
37286check.toJSON = function () { return 'pubKeyHash output' }
37287
37288function encode (pubKeyHash) {
37289 typeforce(types.Hash160bit, pubKeyHash)
37290
37291 return bscript.compile([
37292 OPS.OP_DUP,
37293 OPS.OP_HASH160,
37294 pubKeyHash,
37295 OPS.OP_EQUALVERIFY,
37296 OPS.OP_CHECKSIG
37297 ])
37298}
37299
37300function decode (buffer) {
37301 typeforce(check, buffer)
37302
37303 return buffer.slice(3, 23)
37304}
37305
37306module.exports = {
37307 check: check,
37308 decode: decode,
37309 encode: encode
37310}
37311
37312},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":139}],67:[function(require,module,exports){
37313arguments[4][57][0].apply(exports,arguments)
37314},{"./input":68,"./output":69,"dup":57}],68:[function(require,module,exports){
37315// <scriptSig> {serialized scriptPubKey script}
37316
37317var Buffer = require('safe-buffer').Buffer
37318var bscript = require('../../script')
37319var typeforce = require('typeforce')
37320
37321var p2ms = require('../multisig/')
37322var p2pk = require('../pubkey/')
37323var p2pkh = require('../pubkeyhash/')
37324var p2wpkho = require('../witnesspubkeyhash/output')
37325var p2wsho = require('../witnessscripthash/output')
37326
37327function check (script, allowIncomplete) {
37328 var chunks = bscript.decompile(script)
37329 if (chunks.length < 1) return false
37330
37331 var lastChunk = chunks[chunks.length - 1]
37332 if (!Buffer.isBuffer(lastChunk)) return false
37333
37334 var scriptSigChunks = bscript.decompile(bscript.compile(chunks.slice(0, -1)))
37335 var redeemScriptChunks = bscript.decompile(lastChunk)
37336
37337 // is redeemScript a valid script?
37338 if (redeemScriptChunks.length === 0) return false
37339
37340 // is redeemScriptSig push only?
37341 if (!bscript.isPushOnly(scriptSigChunks)) return false
37342
37343 // is witness?
37344 if (chunks.length === 1) {
37345 return p2wsho.check(redeemScriptChunks) ||
37346 p2wpkho.check(redeemScriptChunks)
37347 }
37348
37349 // match types
37350 if (p2pkh.input.check(scriptSigChunks) &&
37351 p2pkh.output.check(redeemScriptChunks)) return true
37352
37353 if (p2ms.input.check(scriptSigChunks, allowIncomplete) &&
37354 p2ms.output.check(redeemScriptChunks)) return true
37355
37356 if (p2pk.input.check(scriptSigChunks) &&
37357 p2pk.output.check(redeemScriptChunks)) return true
37358
37359 return false
37360}
37361check.toJSON = function () { return 'scriptHash input' }
37362
37363function encodeStack (redeemScriptStack, redeemScript) {
37364 var serializedScriptPubKey = bscript.compile(redeemScript)
37365
37366 return [].concat(redeemScriptStack, serializedScriptPubKey)
37367}
37368
37369function encode (redeemScriptSig, redeemScript) {
37370 var redeemScriptStack = bscript.decompile(redeemScriptSig)
37371
37372 return bscript.compile(encodeStack(redeemScriptStack, redeemScript))
37373}
37374
37375function decodeStack (stack) {
37376 typeforce(check, stack)
37377
37378 return {
37379 redeemScriptStack: stack.slice(0, -1),
37380 redeemScript: stack[stack.length - 1]
37381 }
37382}
37383
37384function decode (buffer) {
37385 var stack = bscript.decompile(buffer)
37386 var result = decodeStack(stack)
37387 result.redeemScriptSig = bscript.compile(result.redeemScriptStack)
37388 delete result.redeemScriptStack
37389 return result
37390}
37391
37392module.exports = {
37393 check: check,
37394 decode: decode,
37395 decodeStack: decodeStack,
37396 encode: encode,
37397 encodeStack: encodeStack
37398}
37399
37400},{"../../script":54,"../multisig/":57,"../pubkey/":61,"../pubkeyhash/":64,"../witnesspubkeyhash/output":74,"../witnessscripthash/output":77,"safe-buffer":128,"typeforce":139}],69:[function(require,module,exports){
37401// OP_HASH160 {scriptHash} OP_EQUAL
37402
37403var bscript = require('../../script')
37404var types = require('../../types')
37405var typeforce = require('typeforce')
37406var OPS = require('bitcoin-ops')
37407
37408function check (script) {
37409 var buffer = bscript.compile(script)
37410
37411 return buffer.length === 23 &&
37412 buffer[0] === OPS.OP_HASH160 &&
37413 buffer[1] === 0x14 &&
37414 buffer[22] === OPS.OP_EQUAL
37415}
37416check.toJSON = function () { return 'scriptHash output' }
37417
37418function encode (scriptHash) {
37419 typeforce(types.Hash160bit, scriptHash)
37420
37421 return bscript.compile([OPS.OP_HASH160, scriptHash, OPS.OP_EQUAL])
37422}
37423
37424function decode (buffer) {
37425 typeforce(check, buffer)
37426
37427 return buffer.slice(2, 22)
37428}
37429
37430module.exports = {
37431 check: check,
37432 decode: decode,
37433 encode: encode
37434}
37435
37436},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":139}],70:[function(require,module,exports){
37437module.exports = {
37438 output: require('./output')
37439}
37440
37441},{"./output":71}],71:[function(require,module,exports){
37442// OP_RETURN {aa21a9ed} {commitment}
37443
37444var Buffer = require('safe-buffer').Buffer
37445var bscript = require('../../script')
37446var types = require('../../types')
37447var typeforce = require('typeforce')
37448var OPS = require('bitcoin-ops')
37449
37450var HEADER = Buffer.from('aa21a9ed', 'hex')
37451
37452function check (script) {
37453 var buffer = bscript.compile(script)
37454
37455 return buffer.length > 37 &&
37456 buffer[0] === OPS.OP_RETURN &&
37457 buffer[1] === 0x24 &&
37458 buffer.slice(2, 6).equals(HEADER)
37459}
37460
37461check.toJSON = function () { return 'Witness commitment output' }
37462
37463function encode (commitment) {
37464 typeforce(types.Hash256bit, commitment)
37465
37466 var buffer = Buffer.allocUnsafe(36)
37467 HEADER.copy(buffer, 0)
37468 commitment.copy(buffer, 4)
37469
37470 return bscript.compile([OPS.OP_RETURN, buffer])
37471}
37472
37473function decode (buffer) {
37474 typeforce(check, buffer)
37475
37476 return bscript.decompile(buffer)[1].slice(4, 36)
37477}
37478
37479module.exports = {
37480 check: check,
37481 decode: decode,
37482 encode: encode
37483}
37484
37485},{"../../script":54,"../../types":80,"bitcoin-ops":42,"safe-buffer":128,"typeforce":139}],72:[function(require,module,exports){
37486arguments[4][57][0].apply(exports,arguments)
37487},{"./input":73,"./output":74,"dup":57}],73:[function(require,module,exports){
37488// {signature} {pubKey}
37489
37490var bscript = require('../../script')
37491var typeforce = require('typeforce')
37492
37493function isCompressedCanonicalPubKey (pubKey) {
37494 return bscript.isCanonicalPubKey(pubKey) && pubKey.length === 33
37495}
37496
37497function check (script) {
37498 var chunks = bscript.decompile(script)
37499
37500 return chunks.length === 2 &&
37501 bscript.isCanonicalSignature(chunks[0]) &&
37502 isCompressedCanonicalPubKey(chunks[1])
37503}
37504check.toJSON = function () { return 'witnessPubKeyHash input' }
37505
37506function encodeStack (signature, pubKey) {
37507 typeforce({
37508 signature: bscript.isCanonicalSignature,
37509 pubKey: isCompressedCanonicalPubKey
37510 }, {
37511 signature: signature,
37512 pubKey: pubKey
37513 })
37514
37515 return [signature, pubKey]
37516}
37517
37518function decodeStack (stack) {
37519 typeforce(check, stack)
37520
37521 return {
37522 signature: stack[0],
37523 pubKey: stack[1]
37524 }
37525}
37526
37527module.exports = {
37528 check: check,
37529 decodeStack: decodeStack,
37530 encodeStack: encodeStack
37531}
37532
37533},{"../../script":54,"typeforce":139}],74:[function(require,module,exports){
37534// OP_0 {pubKeyHash}
37535
37536var bscript = require('../../script')
37537var types = require('../../types')
37538var typeforce = require('typeforce')
37539var OPS = require('bitcoin-ops')
37540
37541function check (script) {
37542 var buffer = bscript.compile(script)
37543
37544 return buffer.length === 22 &&
37545 buffer[0] === OPS.OP_0 &&
37546 buffer[1] === 0x14
37547}
37548check.toJSON = function () { return 'Witness pubKeyHash output' }
37549
37550function encode (pubKeyHash) {
37551 typeforce(types.Hash160bit, pubKeyHash)
37552
37553 return bscript.compile([OPS.OP_0, pubKeyHash])
37554}
37555
37556function decode (buffer) {
37557 typeforce(check, buffer)
37558
37559 return buffer.slice(2)
37560}
37561
37562module.exports = {
37563 check: check,
37564 decode: decode,
37565 encode: encode
37566}
37567
37568},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":139}],75:[function(require,module,exports){
37569arguments[4][57][0].apply(exports,arguments)
37570},{"./input":76,"./output":77,"dup":57}],76:[function(require,module,exports){
37571(function (Buffer){
37572// <scriptSig> {serialized scriptPubKey script}
37573
37574var bscript = require('../../script')
37575var types = require('../../types')
37576var typeforce = require('typeforce')
37577
37578var p2ms = require('../multisig/')
37579var p2pk = require('../pubkey/')
37580var p2pkh = require('../pubkeyhash/')
37581
37582function check (chunks, allowIncomplete) {
37583 typeforce(types.Array, chunks)
37584 if (chunks.length < 1) return false
37585
37586 var witnessScript = chunks[chunks.length - 1]
37587 if (!Buffer.isBuffer(witnessScript)) return false
37588
37589 var witnessScriptChunks = bscript.decompile(witnessScript)
37590
37591 // is witnessScript a valid script?
37592 if (witnessScriptChunks.length === 0) return false
37593
37594 var witnessRawScriptSig = bscript.compile(chunks.slice(0, -1))
37595
37596 // match types
37597 if (p2pkh.input.check(witnessRawScriptSig) &&
37598 p2pkh.output.check(witnessScriptChunks)) return true
37599
37600 if (p2ms.input.check(witnessRawScriptSig, allowIncomplete) &&
37601 p2ms.output.check(witnessScriptChunks)) return true
37602
37603 if (p2pk.input.check(witnessRawScriptSig) &&
37604 p2pk.output.check(witnessScriptChunks)) return true
37605
37606 return false
37607}
37608check.toJSON = function () { return 'witnessScriptHash input' }
37609
37610function encodeStack (witnessData, witnessScript) {
37611 typeforce({
37612 witnessData: [types.Buffer],
37613 witnessScript: types.Buffer
37614 }, {
37615 witnessData: witnessData,
37616 witnessScript: witnessScript
37617 })
37618
37619 return [].concat(witnessData, witnessScript)
37620}
37621
37622function decodeStack (chunks) {
37623 typeforce(check, chunks)
37624 return {
37625 witnessData: chunks.slice(0, -1),
37626 witnessScript: chunks[chunks.length - 1]
37627 }
37628}
37629
37630module.exports = {
37631 check: check,
37632 decodeStack: decodeStack,
37633 encodeStack: encodeStack
37634}
37635
37636}).call(this,{"isBuffer":require("../../../../../../../../.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")})
37637},{"../../../../../../../../.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":10,"../../script":54,"../../types":80,"../multisig/":57,"../pubkey/":61,"../pubkeyhash/":64,"typeforce":139}],77:[function(require,module,exports){
37638// OP_0 {scriptHash}
37639
37640var bscript = require('../../script')
37641var types = require('../../types')
37642var typeforce = require('typeforce')
37643var OPS = require('bitcoin-ops')
37644
37645function check (script) {
37646 var buffer = bscript.compile(script)
37647
37648 return buffer.length === 34 &&
37649 buffer[0] === OPS.OP_0 &&
37650 buffer[1] === 0x20
37651}
37652check.toJSON = function () { return 'Witness scriptHash output' }
37653
37654function encode (scriptHash) {
37655 typeforce(types.Hash256bit, scriptHash)
37656
37657 return bscript.compile([OPS.OP_0, scriptHash])
37658}
37659
37660function decode (buffer) {
37661 typeforce(check, buffer)
37662
37663 return buffer.slice(2)
37664}
37665
37666module.exports = {
37667 check: check,
37668 decode: decode,
37669 encode: encode
37670}
37671
37672},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":139}],78:[function(require,module,exports){
37673var Buffer = require('safe-buffer').Buffer
37674var bcrypto = require('./crypto')
37675var bscript = require('./script')
37676var bufferutils = require('./bufferutils')
37677var opcodes = require('bitcoin-ops')
37678var typeforce = require('typeforce')
37679var types = require('./types')
37680var varuint = require('varuint-bitcoin')
37681
37682function varSliceSize (someScript) {
37683 var length = someScript.length
37684
37685 return varuint.encodingLength(length) + length
37686}
37687
37688function vectorSize (someVector) {
37689 var length = someVector.length
37690
37691 return varuint.encodingLength(length) + someVector.reduce(function (sum, witness) {
37692 return sum + varSliceSize(witness)
37693 }, 0)
37694}
37695
37696function Transaction () {
37697 this.version = 1
37698 this.locktime = 0
37699 this.ins = []
37700 this.outs = []
37701}
37702
37703Transaction.DEFAULT_SEQUENCE = 0xffffffff
37704Transaction.SIGHASH_ALL = 0x01
37705Transaction.SIGHASH_NONE = 0x02
37706Transaction.SIGHASH_SINGLE = 0x03
37707Transaction.SIGHASH_ANYONECANPAY = 0x80
37708Transaction.ADVANCED_TRANSACTION_MARKER = 0x00
37709Transaction.ADVANCED_TRANSACTION_FLAG = 0x01
37710
37711var EMPTY_SCRIPT = Buffer.allocUnsafe(0)
37712var EMPTY_WITNESS = []
37713var ZERO = Buffer.from('0000000000000000000000000000000000000000000000000000000000000000', 'hex')
37714var ONE = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex')
37715var VALUE_UINT64_MAX = Buffer.from('ffffffffffffffff', 'hex')
37716var BLANK_OUTPUT = {
37717 script: EMPTY_SCRIPT,
37718 valueBuffer: VALUE_UINT64_MAX
37719}
37720
37721Transaction.fromBuffer = function (buffer, __noStrict) {
37722 var offset = 0
37723 function readSlice (n) {
37724 offset += n
37725 return buffer.slice(offset - n, offset)
37726 }
37727
37728 function readUInt32 () {
37729 var i = buffer.readUInt32LE(offset)
37730 offset += 4
37731 return i
37732 }
37733
37734 function readInt32 () {
37735 var i = buffer.readInt32LE(offset)
37736 offset += 4
37737 return i
37738 }
37739
37740 function readUInt64 () {
37741 var i = bufferutils.readUInt64LE(buffer, offset)
37742 offset += 8
37743 return i
37744 }
37745
37746 function readVarInt () {
37747 var vi = varuint.decode(buffer, offset)
37748 offset += varuint.decode.bytes
37749 return vi
37750 }
37751
37752 function readVarSlice () {
37753 return readSlice(readVarInt())
37754 }
37755
37756 function readVector () {
37757 var count = readVarInt()
37758 var vector = []
37759 for (var i = 0; i < count; i++) vector.push(readVarSlice())
37760 return vector
37761 }
37762
37763 var tx = new Transaction()
37764 tx.version = readInt32()
37765
37766 var marker = buffer.readUInt8(offset)
37767 var flag = buffer.readUInt8(offset + 1)
37768
37769 var hasWitnesses = false
37770 if (marker === Transaction.ADVANCED_TRANSACTION_MARKER &&
37771 flag === Transaction.ADVANCED_TRANSACTION_FLAG) {
37772 offset += 2
37773 hasWitnesses = true
37774 }
37775
37776 var vinLen = readVarInt()
37777 for (var i = 0; i < vinLen; ++i) {
37778 tx.ins.push({
37779 hash: readSlice(32),
37780 index: readUInt32(),
37781 script: readVarSlice(),
37782 sequence: readUInt32(),
37783 witness: EMPTY_WITNESS
37784 })
37785 }
37786
37787 var voutLen = readVarInt()
37788 for (i = 0; i < voutLen; ++i) {
37789 tx.outs.push({
37790 value: readUInt64(),
37791 script: readVarSlice()
37792 })
37793 }
37794
37795 if (hasWitnesses) {
37796 for (i = 0; i < vinLen; ++i) {
37797 tx.ins[i].witness = readVector()
37798 }
37799
37800 // was this pointless?
37801 if (!tx.hasWitnesses()) throw new Error('Transaction has superfluous witness data')
37802 }
37803
37804 tx.locktime = readUInt32()
37805
37806 if (__noStrict) return tx
37807 if (offset !== buffer.length) throw new Error('Transaction has unexpected data')
37808
37809 return tx
37810}
37811
37812Transaction.fromHex = function (hex) {
37813 return Transaction.fromBuffer(Buffer.from(hex, 'hex'))
37814}
37815
37816Transaction.isCoinbaseHash = function (buffer) {
37817 typeforce(types.Hash256bit, buffer)
37818 for (var i = 0; i < 32; ++i) {
37819 if (buffer[i] !== 0) return false
37820 }
37821 return true
37822}
37823
37824Transaction.prototype.isCoinbase = function () {
37825 return this.ins.length === 1 && Transaction.isCoinbaseHash(this.ins[0].hash)
37826}
37827
37828Transaction.prototype.addInput = function (hash, index, sequence, scriptSig) {
37829 typeforce(types.tuple(
37830 types.Hash256bit,
37831 types.UInt32,
37832 types.maybe(types.UInt32),
37833 types.maybe(types.Buffer)
37834 ), arguments)
37835
37836 if (types.Null(sequence)) {
37837 sequence = Transaction.DEFAULT_SEQUENCE
37838 }
37839
37840 // Add the input and return the input's index
37841 return (this.ins.push({
37842 hash: hash,
37843 index: index,
37844 script: scriptSig || EMPTY_SCRIPT,
37845 sequence: sequence,
37846 witness: EMPTY_WITNESS
37847 }) - 1)
37848}
37849
37850Transaction.prototype.addOutput = function (scriptPubKey, value) {
37851 typeforce(types.tuple(types.Buffer, types.Satoshi), arguments)
37852
37853 // Add the output and return the output's index
37854 return (this.outs.push({
37855 script: scriptPubKey,
37856 value: value
37857 }) - 1)
37858}
37859
37860Transaction.prototype.hasWitnesses = function () {
37861 return this.ins.some(function (x) {
37862 return x.witness.length !== 0
37863 })
37864}
37865
37866Transaction.prototype.weight = function () {
37867 var base = this.__byteLength(false)
37868 var total = this.__byteLength(true)
37869 return base * 3 + total
37870}
37871
37872Transaction.prototype.virtualSize = function () {
37873 return Math.ceil(this.weight() / 4)
37874}
37875
37876Transaction.prototype.byteLength = function () {
37877 return this.__byteLength(true)
37878}
37879
37880Transaction.prototype.__byteLength = function (__allowWitness) {
37881 var hasWitnesses = __allowWitness && this.hasWitnesses()
37882
37883 return (
37884 (hasWitnesses ? 10 : 8) +
37885 varuint.encodingLength(this.ins.length) +
37886 varuint.encodingLength(this.outs.length) +
37887 this.ins.reduce(function (sum, input) { return sum + 40 + varSliceSize(input.script) }, 0) +
37888 this.outs.reduce(function (sum, output) { return sum + 8 + varSliceSize(output.script) }, 0) +
37889 (hasWitnesses ? this.ins.reduce(function (sum, input) { return sum + vectorSize(input.witness) }, 0) : 0)
37890 )
37891}
37892
37893Transaction.prototype.clone = function () {
37894 var newTx = new Transaction()
37895 newTx.version = this.version
37896 newTx.locktime = this.locktime
37897
37898 newTx.ins = this.ins.map(function (txIn) {
37899 return {
37900 hash: txIn.hash,
37901 index: txIn.index,
37902 script: txIn.script,
37903 sequence: txIn.sequence,
37904 witness: txIn.witness
37905 }
37906 })
37907
37908 newTx.outs = this.outs.map(function (txOut) {
37909 return {
37910 script: txOut.script,
37911 value: txOut.value
37912 }
37913 })
37914
37915 return newTx
37916}
37917
37918/**
37919 * Hash transaction for signing a specific input.
37920 *
37921 * Bitcoin uses a different hash for each signed transaction input.
37922 * This method copies the transaction, makes the necessary changes based on the
37923 * hashType, and then hashes the result.
37924 * This hash can then be used to sign the provided transaction input.
37925 */
37926Transaction.prototype.hashForSignature = function (inIndex, prevOutScript, hashType) {
37927 typeforce(types.tuple(types.UInt32, types.Buffer, /* types.UInt8 */ types.Number), arguments)
37928
37929 // https://github.com/bitcoin/bitcoin/blob/master/src/test/sighash_tests.cpp#L29
37930 if (inIndex >= this.ins.length) return ONE
37931
37932 // ignore OP_CODESEPARATOR
37933 var ourScript = bscript.compile(bscript.decompile(prevOutScript).filter(function (x) {
37934 return x !== opcodes.OP_CODESEPARATOR
37935 }))
37936
37937 var txTmp = this.clone()
37938
37939 // SIGHASH_NONE: ignore all outputs? (wildcard payee)
37940 if ((hashType & 0x1f) === Transaction.SIGHASH_NONE) {
37941 txTmp.outs = []
37942
37943 // ignore sequence numbers (except at inIndex)
37944 txTmp.ins.forEach(function (input, i) {
37945 if (i === inIndex) return
37946
37947 input.sequence = 0
37948 })
37949
37950 // SIGHASH_SINGLE: ignore all outputs, except at the same index?
37951 } else if ((hashType & 0x1f) === Transaction.SIGHASH_SINGLE) {
37952 // https://github.com/bitcoin/bitcoin/blob/master/src/test/sighash_tests.cpp#L60
37953 if (inIndex >= this.outs.length) return ONE
37954
37955 // truncate outputs after
37956 txTmp.outs.length = inIndex + 1
37957
37958 // "blank" outputs before
37959 for (var i = 0; i < inIndex; i++) {
37960 txTmp.outs[i] = BLANK_OUTPUT
37961 }
37962
37963 // ignore sequence numbers (except at inIndex)
37964 txTmp.ins.forEach(function (input, y) {
37965 if (y === inIndex) return
37966
37967 input.sequence = 0
37968 })
37969 }
37970
37971 // SIGHASH_ANYONECANPAY: ignore inputs entirely?
37972 if (hashType & Transaction.SIGHASH_ANYONECANPAY) {
37973 txTmp.ins = [txTmp.ins[inIndex]]
37974 txTmp.ins[0].script = ourScript
37975
37976 // SIGHASH_ALL: only ignore input scripts
37977 } else {
37978 // "blank" others input scripts
37979 txTmp.ins.forEach(function (input) { input.script = EMPTY_SCRIPT })
37980 txTmp.ins[inIndex].script = ourScript
37981 }
37982
37983 // serialize and hash
37984 var buffer = Buffer.allocUnsafe(txTmp.__byteLength(false) + 4)
37985 buffer.writeInt32LE(hashType, buffer.length - 4)
37986 txTmp.__toBuffer(buffer, 0, false)
37987
37988 return bcrypto.hash256(buffer)
37989}
37990
37991Transaction.prototype.hashForWitnessV0 = function (inIndex, prevOutScript, value, hashType) {
37992 typeforce(types.tuple(types.UInt32, types.Buffer, types.Satoshi, types.UInt32), arguments)
37993
37994 var tbuffer, toffset
37995 function writeSlice (slice) { toffset += slice.copy(tbuffer, toffset) }
37996 function writeUInt32 (i) { toffset = tbuffer.writeUInt32LE(i, toffset) }
37997 function writeUInt64 (i) { toffset = bufferutils.writeUInt64LE(tbuffer, i, toffset) }
37998 function writeVarInt (i) {
37999 varuint.encode(i, tbuffer, toffset)
38000 toffset += varuint.encode.bytes
38001 }
38002 function writeVarSlice (slice) { writeVarInt(slice.length); writeSlice(slice) }
38003
38004 var hashOutputs = ZERO
38005 var hashPrevouts = ZERO
38006 var hashSequence = ZERO
38007
38008 if (!(hashType & Transaction.SIGHASH_ANYONECANPAY)) {
38009 tbuffer = Buffer.allocUnsafe(36 * this.ins.length)
38010 toffset = 0
38011
38012 this.ins.forEach(function (txIn) {
38013 writeSlice(txIn.hash)
38014 writeUInt32(txIn.index)
38015 })
38016
38017 hashPrevouts = bcrypto.hash256(tbuffer)
38018 }
38019
38020 if (!(hashType & Transaction.SIGHASH_ANYONECANPAY) &&
38021 (hashType & 0x1f) !== Transaction.SIGHASH_SINGLE &&
38022 (hashType & 0x1f) !== Transaction.SIGHASH_NONE) {
38023 tbuffer = Buffer.allocUnsafe(4 * this.ins.length)
38024 toffset = 0
38025
38026 this.ins.forEach(function (txIn) {
38027 writeUInt32(txIn.sequence)
38028 })
38029
38030 hashSequence = bcrypto.hash256(tbuffer)
38031 }
38032
38033 if ((hashType & 0x1f) !== Transaction.SIGHASH_SINGLE &&
38034 (hashType & 0x1f) !== Transaction.SIGHASH_NONE) {
38035 var txOutsSize = this.outs.reduce(function (sum, output) {
38036 return sum + 8 + varSliceSize(output.script)
38037 }, 0)
38038
38039 tbuffer = Buffer.allocUnsafe(txOutsSize)
38040 toffset = 0
38041
38042 this.outs.forEach(function (out) {
38043 writeUInt64(out.value)
38044 writeVarSlice(out.script)
38045 })
38046
38047 hashOutputs = bcrypto.hash256(tbuffer)
38048 } else if ((hashType & 0x1f) === Transaction.SIGHASH_SINGLE && inIndex < this.outs.length) {
38049 var output = this.outs[inIndex]
38050
38051 tbuffer = Buffer.allocUnsafe(8 + varSliceSize(output.script))
38052 toffset = 0
38053 writeUInt64(output.value)
38054 writeVarSlice(output.script)
38055
38056 hashOutputs = bcrypto.hash256(tbuffer)
38057 }
38058
38059 tbuffer = Buffer.allocUnsafe(156 + varSliceSize(prevOutScript))
38060 toffset = 0
38061
38062 var input = this.ins[inIndex]
38063 writeUInt32(this.version)
38064 writeSlice(hashPrevouts)
38065 writeSlice(hashSequence)
38066 writeSlice(input.hash)
38067 writeUInt32(input.index)
38068 writeVarSlice(prevOutScript)
38069 writeUInt64(value)
38070 writeUInt32(input.sequence)
38071 writeSlice(hashOutputs)
38072 writeUInt32(this.locktime)
38073 writeUInt32(hashType)
38074 return bcrypto.hash256(tbuffer)
38075}
38076
38077Transaction.prototype.getHash = function () {
38078 return bcrypto.hash256(this.__toBuffer(undefined, undefined, false))
38079}
38080
38081Transaction.prototype.getId = function () {
38082 // transaction hash's are displayed in reverse order
38083 return this.getHash().reverse().toString('hex')
38084}
38085
38086Transaction.prototype.toBuffer = function (buffer, initialOffset) {
38087 return this.__toBuffer(buffer, initialOffset, true)
38088}
38089
38090Transaction.prototype.__toBuffer = function (buffer, initialOffset, __allowWitness) {
38091 if (!buffer) buffer = Buffer.allocUnsafe(this.__byteLength(__allowWitness))
38092
38093 var offset = initialOffset || 0
38094 function writeSlice (slice) { offset += slice.copy(buffer, offset) }
38095 function writeUInt8 (i) { offset = buffer.writeUInt8(i, offset) }
38096 function writeUInt32 (i) { offset = buffer.writeUInt32LE(i, offset) }
38097 function writeInt32 (i) { offset = buffer.writeInt32LE(i, offset) }
38098 function writeUInt64 (i) { offset = bufferutils.writeUInt64LE(buffer, i, offset) }
38099 function writeVarInt (i) {
38100 varuint.encode(i, buffer, offset)
38101 offset += varuint.encode.bytes
38102 }
38103 function writeVarSlice (slice) { writeVarInt(slice.length); writeSlice(slice) }
38104 function writeVector (vector) { writeVarInt(vector.length); vector.forEach(writeVarSlice) }
38105
38106 writeInt32(this.version)
38107
38108 var hasWitnesses = __allowWitness && this.hasWitnesses()
38109
38110 if (hasWitnesses) {
38111 writeUInt8(Transaction.ADVANCED_TRANSACTION_MARKER)
38112 writeUInt8(Transaction.ADVANCED_TRANSACTION_FLAG)
38113 }
38114
38115 writeVarInt(this.ins.length)
38116
38117 this.ins.forEach(function (txIn) {
38118 writeSlice(txIn.hash)
38119 writeUInt32(txIn.index)
38120 writeVarSlice(txIn.script)
38121 writeUInt32(txIn.sequence)
38122 })
38123
38124 writeVarInt(this.outs.length)
38125 this.outs.forEach(function (txOut) {
38126 if (!txOut.valueBuffer) {
38127 writeUInt64(txOut.value)
38128 } else {
38129 writeSlice(txOut.valueBuffer)
38130 }
38131
38132 writeVarSlice(txOut.script)
38133 })
38134
38135 if (hasWitnesses) {
38136 this.ins.forEach(function (input) {
38137 writeVector(input.witness)
38138 })
38139 }
38140
38141 writeUInt32(this.locktime)
38142
38143 // avoid slicing unless necessary
38144 if (initialOffset !== undefined) return buffer.slice(initialOffset, offset)
38145 return buffer
38146}
38147
38148Transaction.prototype.toHex = function () {
38149 return this.toBuffer().toString('hex')
38150}
38151
38152Transaction.prototype.setInputScript = function (index, scriptSig) {
38153 typeforce(types.tuple(types.Number, types.Buffer), arguments)
38154
38155 this.ins[index].script = scriptSig
38156}
38157
38158Transaction.prototype.setWitness = function (index, witness) {
38159 typeforce(types.tuple(types.Number, [types.Buffer]), arguments)
38160
38161 this.ins[index].witness = witness
38162}
38163
38164module.exports = Transaction
38165
38166},{"./bufferutils":46,"./crypto":47,"./script":54,"./types":80,"bitcoin-ops":42,"safe-buffer":128,"typeforce":139,"varuint-bitcoin":141}],79:[function(require,module,exports){
38167var Buffer = require('safe-buffer').Buffer
38168var baddress = require('./address')
38169var bcrypto = require('./crypto')
38170var bscript = require('./script')
38171var btemplates = require('./templates')
38172var networks = require('./networks')
38173var ops = require('bitcoin-ops')
38174var typeforce = require('typeforce')
38175var types = require('./types')
38176var scriptTypes = btemplates.types
38177var SIGNABLE = [btemplates.types.P2PKH, btemplates.types.P2PK, btemplates.types.MULTISIG]
38178var P2SH = SIGNABLE.concat([btemplates.types.P2WPKH, btemplates.types.P2WSH])
38179
38180var ECPair = require('./ecpair')
38181var ECSignature = require('./ecsignature')
38182var Transaction = require('./transaction')
38183
38184function supportedType (type) {
38185 return SIGNABLE.indexOf(type) !== -1
38186}
38187
38188function supportedP2SHType (type) {
38189 return P2SH.indexOf(type) !== -1
38190}
38191
38192function extractChunks (type, chunks, script) {
38193 var pubKeys = []
38194 var signatures = []
38195 switch (type) {
38196 case scriptTypes.P2PKH:
38197 // if (redeemScript) throw new Error('Nonstandard... P2SH(P2PKH)')
38198 pubKeys = chunks.slice(1)
38199 signatures = chunks.slice(0, 1)
38200 break
38201
38202 case scriptTypes.P2PK:
38203 pubKeys[0] = script ? btemplates.pubKey.output.decode(script) : undefined
38204 signatures = chunks.slice(0, 1)
38205 break
38206
38207 case scriptTypes.MULTISIG:
38208 if (script) {
38209 var multisig = btemplates.multisig.output.decode(script)
38210 pubKeys = multisig.pubKeys
38211 }
38212
38213 signatures = chunks.slice(1).map(function (chunk) {
38214 return chunk.length === 0 ? undefined : chunk
38215 })
38216 break
38217 }
38218
38219 return {
38220 pubKeys: pubKeys,
38221 signatures: signatures
38222 }
38223}
38224function expandInput (scriptSig, witnessStack) {
38225 if (scriptSig.length === 0 && witnessStack.length === 0) return {}
38226
38227 var prevOutScript
38228 var prevOutType
38229 var scriptType
38230 var script
38231 var redeemScript
38232 var witnessScript
38233 var witnessScriptType
38234 var redeemScriptType
38235 var witness = false
38236 var p2wsh = false
38237 var p2sh = false
38238 var witnessProgram
38239 var chunks
38240
38241 var scriptSigChunks = bscript.decompile(scriptSig)
38242 var sigType = btemplates.classifyInput(scriptSigChunks, true)
38243 if (sigType === scriptTypes.P2SH) {
38244 p2sh = true
38245 redeemScript = scriptSigChunks[scriptSigChunks.length - 1]
38246 redeemScriptType = btemplates.classifyOutput(redeemScript)
38247 prevOutScript = btemplates.scriptHash.output.encode(bcrypto.hash160(redeemScript))
38248 prevOutType = scriptTypes.P2SH
38249 script = redeemScript
38250 }
38251
38252 var classifyWitness = btemplates.classifyWitness(witnessStack, true)
38253 if (classifyWitness === scriptTypes.P2WSH) {
38254 witnessScript = witnessStack[witnessStack.length - 1]
38255 witnessScriptType = btemplates.classifyOutput(witnessScript)
38256 p2wsh = true
38257 witness = true
38258 if (scriptSig.length === 0) {
38259 prevOutScript = btemplates.witnessScriptHash.output.encode(bcrypto.sha256(witnessScript))
38260 prevOutType = scriptTypes.P2WSH
38261 if (redeemScript !== undefined) {
38262 throw new Error('Redeem script given when unnecessary')
38263 }
38264 // bare witness
38265 } else {
38266 if (!redeemScript) {
38267 throw new Error('No redeemScript provided for P2WSH, but scriptSig non-empty')
38268 }
38269 witnessProgram = btemplates.witnessScriptHash.output.encode(bcrypto.sha256(witnessScript))
38270 if (!redeemScript.equals(witnessProgram)) {
38271 throw new Error('Redeem script didn\'t match witnessScript')
38272 }
38273 }
38274
38275 if (!supportedType(btemplates.classifyOutput(witnessScript))) {
38276 throw new Error('unsupported witness script')
38277 }
38278
38279 script = witnessScript
38280 scriptType = witnessScriptType
38281 chunks = witnessStack.slice(0, -1)
38282 } else if (classifyWitness === scriptTypes.P2WPKH) {
38283 witness = true
38284 var key = witnessStack[witnessStack.length - 1]
38285 var keyHash = bcrypto.hash160(key)
38286 if (scriptSig.length === 0) {
38287 prevOutScript = btemplates.witnessPubKeyHash.output.encode(keyHash)
38288 prevOutType = scriptTypes.P2WPKH
38289 if (typeof redeemScript !== 'undefined') {
38290 throw new Error('Redeem script given when unnecessary')
38291 }
38292 } else {
38293 if (!redeemScript) {
38294 throw new Error('No redeemScript provided for P2WPKH, but scriptSig wasn\'t empty')
38295 }
38296 witnessProgram = btemplates.witnessPubKeyHash.output.encode(keyHash)
38297 if (!redeemScript.equals(witnessProgram)) {
38298 throw new Error('Redeem script did not have the right witness program')
38299 }
38300 }
38301
38302 scriptType = scriptTypes.P2PKH
38303 chunks = witnessStack
38304 } else if (redeemScript) {
38305 if (!supportedP2SHType(redeemScriptType)) {
38306 throw new Error('Bad redeemscript!')
38307 }
38308
38309 script = redeemScript
38310 scriptType = redeemScriptType
38311 chunks = scriptSigChunks.slice(0, -1)
38312 } else {
38313 prevOutType = scriptType = btemplates.classifyInput(scriptSig)
38314 chunks = scriptSigChunks
38315 }
38316
38317 var expanded = extractChunks(scriptType, chunks, script)
38318
38319 var result = {
38320 pubKeys: expanded.pubKeys,
38321 signatures: expanded.signatures,
38322 prevOutScript: prevOutScript,
38323 prevOutType: prevOutType,
38324 signType: scriptType,
38325 signScript: script,
38326 witness: Boolean(witness)
38327 }
38328
38329 if (p2sh) {
38330 result.redeemScript = redeemScript
38331 result.redeemScriptType = redeemScriptType
38332 }
38333
38334 if (p2wsh) {
38335 result.witnessScript = witnessScript
38336 result.witnessScriptType = witnessScriptType
38337 }
38338
38339 return result
38340}
38341
38342// could be done in expandInput, but requires the original Transaction for hashForSignature
38343function fixMultisigOrder (input, transaction, vin) {
38344 if (input.redeemScriptType !== scriptTypes.MULTISIG || !input.redeemScript) return
38345 if (input.pubKeys.length === input.signatures.length) return
38346
38347 var unmatched = input.signatures.concat()
38348
38349 input.signatures = input.pubKeys.map(function (pubKey) {
38350 var keyPair = ECPair.fromPublicKeyBuffer(pubKey)
38351 var match
38352
38353 // check for a signature
38354 unmatched.some(function (signature, i) {
38355 // skip if undefined || OP_0
38356 if (!signature) return false
38357
38358 // TODO: avoid O(n) hashForSignature
38359 var parsed = ECSignature.parseScriptSignature(signature)
38360 var hash = transaction.hashForSignature(vin, input.redeemScript, parsed.hashType)
38361
38362 // skip if signature does not match pubKey
38363 if (!keyPair.verify(hash, parsed.signature)) return false
38364
38365 // remove matched signature from unmatched
38366 unmatched[i] = undefined
38367 match = signature
38368
38369 return true
38370 })
38371
38372 return match
38373 })
38374}
38375
38376function expandOutput (script, scriptType, ourPubKey) {
38377 typeforce(types.Buffer, script)
38378
38379 var scriptChunks = bscript.decompile(script)
38380 if (!scriptType) {
38381 scriptType = btemplates.classifyOutput(script)
38382 }
38383
38384 var pubKeys = []
38385
38386 switch (scriptType) {
38387 // does our hash160(pubKey) match the output scripts?
38388 case scriptTypes.P2PKH:
38389 if (!ourPubKey) break
38390
38391 var pkh1 = scriptChunks[2]
38392 var pkh2 = bcrypto.hash160(ourPubKey)
38393 if (pkh1.equals(pkh2)) pubKeys = [ourPubKey]
38394 break
38395
38396 // does our hash160(pubKey) match the output scripts?
38397 case scriptTypes.P2WPKH:
38398 if (!ourPubKey) break
38399
38400 var wpkh1 = scriptChunks[1]
38401 var wpkh2 = bcrypto.hash160(ourPubKey)
38402 if (wpkh1.equals(wpkh2)) pubKeys = [ourPubKey]
38403 break
38404
38405 case scriptTypes.P2PK:
38406 pubKeys = scriptChunks.slice(0, 1)
38407 break
38408
38409 case scriptTypes.MULTISIG:
38410 pubKeys = scriptChunks.slice(1, -2)
38411 break
38412
38413 default: return { scriptType: scriptType }
38414 }
38415
38416 return {
38417 pubKeys: pubKeys,
38418 scriptType: scriptType,
38419 signatures: pubKeys.map(function () { return undefined })
38420 }
38421}
38422
38423function checkP2SHInput (input, redeemScriptHash) {
38424 if (input.prevOutType) {
38425 if (input.prevOutType !== scriptTypes.P2SH) throw new Error('PrevOutScript must be P2SH')
38426
38427 var prevOutScriptScriptHash = bscript.decompile(input.prevOutScript)[1]
38428 if (!prevOutScriptScriptHash.equals(redeemScriptHash)) throw new Error('Inconsistent hash160(RedeemScript)')
38429 }
38430}
38431
38432function checkP2WSHInput (input, witnessScriptHash) {
38433 if (input.prevOutType) {
38434 if (input.prevOutType !== scriptTypes.P2WSH) throw new Error('PrevOutScript must be P2WSH')
38435
38436 var scriptHash = bscript.decompile(input.prevOutScript)[1]
38437 if (!scriptHash.equals(witnessScriptHash)) throw new Error('Inconsistent sha25(WitnessScript)')
38438 }
38439}
38440
38441function prepareInput (input, kpPubKey, redeemScript, witnessValue, witnessScript) {
38442 var expanded
38443 var prevOutType
38444 var prevOutScript
38445
38446 var p2sh = false
38447 var p2shType
38448 var redeemScriptHash
38449
38450 var witness = false
38451 var p2wsh = false
38452 var witnessType
38453 var witnessScriptHash
38454
38455 var signType
38456 var signScript
38457
38458 if (redeemScript && witnessScript) {
38459 redeemScriptHash = bcrypto.hash160(redeemScript)
38460 witnessScriptHash = bcrypto.sha256(witnessScript)
38461 checkP2SHInput(input, redeemScriptHash)
38462
38463 if (!redeemScript.equals(btemplates.witnessScriptHash.output.encode(witnessScriptHash))) throw new Error('Witness script inconsistent with redeem script')
38464
38465 expanded = expandOutput(witnessScript, undefined, kpPubKey)
38466 if (!expanded.pubKeys) throw new Error('WitnessScript not supported "' + bscript.toASM(redeemScript) + '"')
38467
38468 prevOutType = btemplates.types.P2SH
38469 prevOutScript = btemplates.scriptHash.output.encode(redeemScriptHash)
38470 p2sh = witness = p2wsh = true
38471 p2shType = btemplates.types.P2WSH
38472 signType = witnessType = expanded.scriptType
38473 signScript = witnessScript
38474 } else if (redeemScript) {
38475 redeemScriptHash = bcrypto.hash160(redeemScript)
38476 checkP2SHInput(input, redeemScriptHash)
38477
38478 expanded = expandOutput(redeemScript, undefined, kpPubKey)
38479 if (!expanded.pubKeys) throw new Error('RedeemScript not supported "' + bscript.toASM(redeemScript) + '"')
38480
38481 prevOutType = btemplates.types.P2SH
38482 prevOutScript = btemplates.scriptHash.output.encode(redeemScriptHash)
38483 p2sh = true
38484 signType = p2shType = expanded.scriptType
38485 signScript = redeemScript
38486 witness = signType === btemplates.types.P2WPKH
38487 } else if (witnessScript) {
38488 witnessScriptHash = bcrypto.sha256(witnessScript)
38489 checkP2WSHInput(input, witnessScriptHash)
38490
38491 expanded = expandOutput(witnessScript, undefined, kpPubKey)
38492 if (!expanded.pubKeys) throw new Error('WitnessScript not supported "' + bscript.toASM(redeemScript) + '"')
38493
38494 prevOutType = btemplates.types.P2WSH
38495 prevOutScript = btemplates.witnessScriptHash.output.encode(witnessScriptHash)
38496 witness = p2wsh = true
38497 signType = witnessType = expanded.scriptType
38498 signScript = witnessScript
38499 } else if (input.prevOutType) {
38500 // embedded scripts are not possible without a redeemScript
38501 if (input.prevOutType === scriptTypes.P2SH ||
38502 input.prevOutType === scriptTypes.P2WSH) {
38503 throw new Error('PrevOutScript is ' + input.prevOutType + ', requires redeemScript')
38504 }
38505
38506 prevOutType = input.prevOutType
38507 prevOutScript = input.prevOutScript
38508 expanded = expandOutput(input.prevOutScript, input.prevOutType, kpPubKey)
38509 if (!expanded.pubKeys) return
38510
38511 witness = (input.prevOutType === scriptTypes.P2WPKH)
38512 signType = prevOutType
38513 signScript = prevOutScript
38514 } else {
38515 prevOutScript = btemplates.pubKeyHash.output.encode(bcrypto.hash160(kpPubKey))
38516 expanded = expandOutput(prevOutScript, scriptTypes.P2PKH, kpPubKey)
38517
38518 prevOutType = scriptTypes.P2PKH
38519 witness = false
38520 signType = prevOutType
38521 signScript = prevOutScript
38522 }
38523
38524 if (signType === scriptTypes.P2WPKH) {
38525 signScript = btemplates.pubKeyHash.output.encode(btemplates.witnessPubKeyHash.output.decode(signScript))
38526 }
38527
38528 if (p2sh) {
38529 input.redeemScript = redeemScript
38530 input.redeemScriptType = p2shType
38531 }
38532
38533 if (p2wsh) {
38534 input.witnessScript = witnessScript
38535 input.witnessScriptType = witnessType
38536 }
38537
38538 input.pubKeys = expanded.pubKeys
38539 input.signatures = expanded.signatures
38540 input.signScript = signScript
38541 input.signType = signType
38542 input.prevOutScript = prevOutScript
38543 input.prevOutType = prevOutType
38544 input.witness = witness
38545}
38546
38547function buildStack (type, signatures, pubKeys, allowIncomplete) {
38548 if (type === scriptTypes.P2PKH) {
38549 if (signatures.length === 1 && Buffer.isBuffer(signatures[0]) && pubKeys.length === 1) return btemplates.pubKeyHash.input.encodeStack(signatures[0], pubKeys[0])
38550 } else if (type === scriptTypes.P2PK) {
38551 if (signatures.length === 1 && Buffer.isBuffer(signatures[0])) return btemplates.pubKey.input.encodeStack(signatures[0])
38552 } else if (type === scriptTypes.MULTISIG) {
38553 if (signatures.length > 0) {
38554 signatures = signatures.map(function (signature) {
38555 return signature || ops.OP_0
38556 })
38557 if (!allowIncomplete) {
38558 // remove blank signatures
38559 signatures = signatures.filter(function (x) { return x !== ops.OP_0 })
38560 }
38561
38562 return btemplates.multisig.input.encodeStack(signatures)
38563 }
38564 } else {
38565 throw new Error('Not yet supported')
38566 }
38567
38568 if (!allowIncomplete) throw new Error('Not enough signatures provided')
38569 return []
38570}
38571
38572function buildInput (input, allowIncomplete) {
38573 var scriptType = input.prevOutType
38574 var sig = []
38575 var witness = []
38576
38577 if (supportedType(scriptType)) {
38578 sig = buildStack(scriptType, input.signatures, input.pubKeys, allowIncomplete)
38579 }
38580
38581 var p2sh = false
38582 if (scriptType === btemplates.types.P2SH) {
38583 // We can remove this error later when we have a guarantee prepareInput
38584 // rejects unsignable scripts - it MUST be signable at this point.
38585 if (!allowIncomplete && !supportedP2SHType(input.redeemScriptType)) {
38586 throw new Error('Impossible to sign this type')
38587 }
38588
38589 if (supportedType(input.redeemScriptType)) {
38590 sig = buildStack(input.redeemScriptType, input.signatures, input.pubKeys, allowIncomplete)
38591 }
38592
38593 // If it wasn't SIGNABLE, it's witness, defer to that
38594 if (input.redeemScriptType) {
38595 p2sh = true
38596 scriptType = input.redeemScriptType
38597 }
38598 }
38599
38600 switch (scriptType) {
38601 // P2WPKH is a special case of P2PKH
38602 case btemplates.types.P2WPKH:
38603 witness = buildStack(btemplates.types.P2PKH, input.signatures, input.pubKeys, allowIncomplete)
38604 break
38605
38606 case btemplates.types.P2WSH:
38607 // We can remove this check later
38608 if (!allowIncomplete && !supportedType(input.witnessScriptType)) {
38609 throw new Error('Impossible to sign this type')
38610 }
38611
38612 if (supportedType(input.witnessScriptType)) {
38613 witness = buildStack(input.witnessScriptType, input.signatures, input.pubKeys, allowIncomplete)
38614 witness.push(input.witnessScript)
38615 scriptType = input.witnessScriptType
38616 }
38617
38618 break
38619 }
38620
38621 // append redeemScript if necessary
38622 if (p2sh) {
38623 sig.push(input.redeemScript)
38624 }
38625
38626 return {
38627 type: scriptType,
38628 script: bscript.compile(sig),
38629 witness: witness
38630 }
38631}
38632
38633function TransactionBuilder (network, maximumFeeRate) {
38634 this.prevTxMap = {}
38635 this.network = network || networks.bitcoin
38636
38637 // WARNING: This is __NOT__ to be relied on, its just another potential safety mechanism (safety in-depth)
38638 this.maximumFeeRate = maximumFeeRate || 1000
38639
38640 this.inputs = []
38641 this.tx = new Transaction()
38642}
38643
38644TransactionBuilder.prototype.setLockTime = function (locktime) {
38645 typeforce(types.UInt32, locktime)
38646
38647 // if any signatures exist, throw
38648 if (this.inputs.some(function (input) {
38649 if (!input.signatures) return false
38650
38651 return input.signatures.some(function (s) { return s })
38652 })) {
38653 throw new Error('No, this would invalidate signatures')
38654 }
38655
38656 this.tx.locktime = locktime
38657}
38658
38659TransactionBuilder.prototype.setVersion = function (version) {
38660 typeforce(types.UInt32, version)
38661
38662 // XXX: this might eventually become more complex depending on what the versions represent
38663 this.tx.version = version
38664}
38665
38666TransactionBuilder.fromTransaction = function (transaction, network) {
38667 var txb = new TransactionBuilder(network)
38668
38669 // Copy transaction fields
38670 txb.setVersion(transaction.version)
38671 txb.setLockTime(transaction.locktime)
38672
38673 // Copy outputs (done first to avoid signature invalidation)
38674 transaction.outs.forEach(function (txOut) {
38675 txb.addOutput(txOut.script, txOut.value)
38676 })
38677
38678 // Copy inputs
38679 transaction.ins.forEach(function (txIn) {
38680 txb.__addInputUnsafe(txIn.hash, txIn.index, {
38681 sequence: txIn.sequence,
38682 script: txIn.script,
38683 witness: txIn.witness
38684 })
38685 })
38686
38687 // fix some things not possible through the public API
38688 txb.inputs.forEach(function (input, i) {
38689 fixMultisigOrder(input, transaction, i)
38690 })
38691
38692 return txb
38693}
38694
38695TransactionBuilder.prototype.addInput = function (txHash, vout, sequence, prevOutScript) {
38696 if (!this.__canModifyInputs()) {
38697 throw new Error('No, this would invalidate signatures')
38698 }
38699
38700 var value
38701
38702 // is it a hex string?
38703 if (typeof txHash === 'string') {
38704 // transaction hashs's are displayed in reverse order, un-reverse it
38705 txHash = Buffer.from(txHash, 'hex').reverse()
38706
38707 // is it a Transaction object?
38708 } else if (txHash instanceof Transaction) {
38709 var txOut = txHash.outs[vout]
38710 prevOutScript = txOut.script
38711 value = txOut.value
38712
38713 txHash = txHash.getHash()
38714 }
38715
38716 return this.__addInputUnsafe(txHash, vout, {
38717 sequence: sequence,
38718 prevOutScript: prevOutScript,
38719 value: value
38720 })
38721}
38722
38723TransactionBuilder.prototype.__addInputUnsafe = function (txHash, vout, options) {
38724 if (Transaction.isCoinbaseHash(txHash)) {
38725 throw new Error('coinbase inputs not supported')
38726 }
38727
38728 var prevTxOut = txHash.toString('hex') + ':' + vout
38729 if (this.prevTxMap[prevTxOut] !== undefined) throw new Error('Duplicate TxOut: ' + prevTxOut)
38730
38731 var input = {}
38732
38733 // derive what we can from the scriptSig
38734 if (options.script !== undefined) {
38735 input = expandInput(options.script, options.witness || [])
38736 }
38737
38738 // if an input value was given, retain it
38739 if (options.value !== undefined) {
38740 input.value = options.value
38741 }
38742
38743 // derive what we can from the previous transactions output script
38744 if (!input.prevOutScript && options.prevOutScript) {
38745 var prevOutType
38746
38747 if (!input.pubKeys && !input.signatures) {
38748 var expanded = expandOutput(options.prevOutScript)
38749
38750 if (expanded.pubKeys) {
38751 input.pubKeys = expanded.pubKeys
38752 input.signatures = expanded.signatures
38753 }
38754
38755 prevOutType = expanded.scriptType
38756 }
38757
38758 input.prevOutScript = options.prevOutScript
38759 input.prevOutType = prevOutType || btemplates.classifyOutput(options.prevOutScript)
38760 }
38761
38762 var vin = this.tx.addInput(txHash, vout, options.sequence, options.scriptSig)
38763 this.inputs[vin] = input
38764 this.prevTxMap[prevTxOut] = vin
38765 return vin
38766}
38767
38768TransactionBuilder.prototype.addOutput = function (scriptPubKey, value) {
38769 if (!this.__canModifyOutputs()) {
38770 throw new Error('No, this would invalidate signatures')
38771 }
38772
38773 // Attempt to get a script if it's a base58 address string
38774 if (typeof scriptPubKey === 'string') {
38775 scriptPubKey = baddress.toOutputScript(scriptPubKey, this.network)
38776 }
38777
38778 return this.tx.addOutput(scriptPubKey, value)
38779}
38780
38781TransactionBuilder.prototype.build = function () {
38782 return this.__build(false)
38783}
38784TransactionBuilder.prototype.buildIncomplete = function () {
38785 return this.__build(true)
38786}
38787
38788TransactionBuilder.prototype.__build = function (allowIncomplete) {
38789 if (!allowIncomplete) {
38790 if (!this.tx.ins.length) throw new Error('Transaction has no inputs')
38791 if (!this.tx.outs.length) throw new Error('Transaction has no outputs')
38792 }
38793
38794 var tx = this.tx.clone()
38795 // Create script signatures from inputs
38796 this.inputs.forEach(function (input, i) {
38797 var scriptType = input.witnessScriptType || input.redeemScriptType || input.prevOutType
38798 if (!scriptType && !allowIncomplete) throw new Error('Transaction is not complete')
38799 var result = buildInput(input, allowIncomplete)
38800
38801 // skip if no result
38802 if (!allowIncomplete) {
38803 if (!supportedType(result.type) && result.type !== btemplates.types.P2WPKH) {
38804 throw new Error(result.type + ' not supported')
38805 }
38806 }
38807
38808 tx.setInputScript(i, result.script)
38809 tx.setWitness(i, result.witness)
38810 })
38811
38812 if (!allowIncomplete) {
38813 // do not rely on this, its merely a last resort
38814 if (this.__overMaximumFees(tx.virtualSize())) {
38815 throw new Error('Transaction has absurd fees')
38816 }
38817 }
38818
38819 return tx
38820}
38821
38822function canSign (input) {
38823 return input.prevOutScript !== undefined &&
38824 input.signScript !== undefined &&
38825 input.pubKeys !== undefined &&
38826 input.signatures !== undefined &&
38827 input.signatures.length === input.pubKeys.length &&
38828 input.pubKeys.length > 0 &&
38829 (
38830 input.witness === false ||
38831 (input.witness === true && input.value !== undefined)
38832 )
38833}
38834
38835TransactionBuilder.prototype.sign = function (vin, keyPair, redeemScript, hashType, witnessValue, witnessScript) {
38836 // TODO: remove keyPair.network matching in 4.0.0
38837 if (keyPair.network && keyPair.network !== this.network) throw new TypeError('Inconsistent network')
38838 if (!this.inputs[vin]) throw new Error('No input at index: ' + vin)
38839 hashType = hashType || Transaction.SIGHASH_ALL
38840
38841 var input = this.inputs[vin]
38842
38843 // if redeemScript was previously provided, enforce consistency
38844 if (input.redeemScript !== undefined &&
38845 redeemScript &&
38846 !input.redeemScript.equals(redeemScript)) {
38847 throw new Error('Inconsistent redeemScript')
38848 }
38849
38850 var kpPubKey = keyPair.publicKey || keyPair.getPublicKeyBuffer()
38851 if (!canSign(input)) {
38852 if (witnessValue !== undefined) {
38853 if (input.value !== undefined && input.value !== witnessValue) throw new Error('Input didn\'t match witnessValue')
38854 typeforce(types.Satoshi, witnessValue)
38855 input.value = witnessValue
38856 }
38857
38858 if (!canSign(input)) prepareInput(input, kpPubKey, redeemScript, witnessValue, witnessScript)
38859 if (!canSign(input)) throw Error(input.prevOutType + ' not supported')
38860 }
38861
38862 // ready to sign
38863 var signatureHash
38864 if (input.witness) {
38865 signatureHash = this.tx.hashForWitnessV0(vin, input.signScript, input.value, hashType)
38866 } else {
38867 signatureHash = this.tx.hashForSignature(vin, input.signScript, hashType)
38868 }
38869
38870 // enforce in order signing of public keys
38871 var signed = input.pubKeys.some(function (pubKey, i) {
38872 if (!kpPubKey.equals(pubKey)) return false
38873 if (input.signatures[i]) throw new Error('Signature already exists')
38874 if (kpPubKey.length !== 33 &&
38875 input.signType === scriptTypes.P2WPKH) throw new Error('BIP143 rejects uncompressed public keys in P2WPKH or P2WSH')
38876
38877 var signature = keyPair.sign(signatureHash)
38878 if (Buffer.isBuffer(signature)) signature = ECSignature.fromRSBuffer(signature)
38879
38880 input.signatures[i] = signature.toScriptSignature(hashType)
38881 return true
38882 })
38883
38884 if (!signed) throw new Error('Key pair cannot sign for this input')
38885}
38886
38887function signatureHashType (buffer) {
38888 return buffer.readUInt8(buffer.length - 1)
38889}
38890
38891TransactionBuilder.prototype.__canModifyInputs = function () {
38892 return this.inputs.every(function (input) {
38893 // any signatures?
38894 if (input.signatures === undefined) return true
38895
38896 return input.signatures.every(function (signature) {
38897 if (!signature) return true
38898 var hashType = signatureHashType(signature)
38899
38900 // if SIGHASH_ANYONECANPAY is set, signatures would not
38901 // be invalidated by more inputs
38902 return hashType & Transaction.SIGHASH_ANYONECANPAY
38903 })
38904 })
38905}
38906
38907TransactionBuilder.prototype.__canModifyOutputs = function () {
38908 var nInputs = this.tx.ins.length
38909 var nOutputs = this.tx.outs.length
38910
38911 return this.inputs.every(function (input) {
38912 if (input.signatures === undefined) return true
38913
38914 return input.signatures.every(function (signature) {
38915 if (!signature) return true
38916 var hashType = signatureHashType(signature)
38917
38918 var hashTypeMod = hashType & 0x1f
38919 if (hashTypeMod === Transaction.SIGHASH_NONE) return true
38920 if (hashTypeMod === Transaction.SIGHASH_SINGLE) {
38921 // if SIGHASH_SINGLE is set, and nInputs > nOutputs
38922 // some signatures would be invalidated by the addition
38923 // of more outputs
38924 return nInputs <= nOutputs
38925 }
38926 })
38927 })
38928}
38929
38930TransactionBuilder.prototype.__overMaximumFees = function (bytes) {
38931 // not all inputs will have .value defined
38932 var incoming = this.inputs.reduce(function (a, x) { return a + (x.value >>> 0) }, 0)
38933
38934 // but all outputs do, and if we have any input value
38935 // we can immediately determine if the outputs are too small
38936 var outgoing = this.tx.outs.reduce(function (a, x) { return a + x.value }, 0)
38937 var fee = incoming - outgoing
38938 var feeRate = fee / bytes
38939
38940 return feeRate > this.maximumFeeRate
38941}
38942
38943module.exports = TransactionBuilder
38944
38945},{"./address":44,"./crypto":47,"./ecpair":49,"./ecsignature":50,"./networks":53,"./script":54,"./templates":56,"./transaction":78,"./types":80,"bitcoin-ops":42,"safe-buffer":128,"typeforce":139}],80:[function(require,module,exports){
38946var typeforce = require('typeforce')
38947
38948var UINT31_MAX = Math.pow(2, 31) - 1
38949function UInt31 (value) {
38950 return typeforce.UInt32(value) && value <= UINT31_MAX
38951}
38952
38953function BIP32Path (value) {
38954 return typeforce.String(value) && value.match(/^(m\/)?(\d+'?\/)*\d+'?$/)
38955}
38956BIP32Path.toJSON = function () { return 'BIP32 derivation path' }
38957
38958var SATOSHI_MAX = 21 * 1e14
38959function Satoshi (value) {
38960 return typeforce.UInt53(value) && value <= SATOSHI_MAX
38961}
38962
38963// external dependent types
38964var BigInt = typeforce.quacksLike('BigInteger')
38965var ECPoint = typeforce.quacksLike('Point')
38966
38967// exposed, external API
38968var ECSignature = typeforce.compile({ r: BigInt, s: BigInt })
38969var Network = typeforce.compile({
38970 messagePrefix: typeforce.oneOf(typeforce.Buffer, typeforce.String),
38971 bip32: {
38972 public: typeforce.UInt32,
38973 private: typeforce.UInt32
38974 },
38975 pubKeyHash: typeforce.UInt8,
38976 scriptHash: typeforce.UInt8,
38977 wif: typeforce.UInt8
38978})
38979
38980// extend typeforce types with ours
38981var types = {
38982 BigInt: BigInt,
38983 BIP32Path: BIP32Path,
38984 Buffer256bit: typeforce.BufferN(32),
38985 ECPoint: ECPoint,
38986 ECSignature: ECSignature,
38987 Hash160bit: typeforce.BufferN(20),
38988 Hash256bit: typeforce.BufferN(32),
38989 Network: Network,
38990 Satoshi: Satoshi,
38991 UInt31: UInt31
38992}
38993
38994for (var typeName in typeforce) {
38995 types[typeName] = typeforce[typeName]
38996}
38997
38998module.exports = types
38999
39000},{"typeforce":139}],81:[function(require,module,exports){
39001(function (module, exports) {
39002 'use strict';
39003
39004 // Utils
39005 function assert (val, msg) {
39006 if (!val) throw new Error(msg || 'Assertion failed');
39007 }
39008
39009 // Could use `inherits` module, but don't want to move from single file
39010 // architecture yet.
39011 function inherits (ctor, superCtor) {
39012 ctor.super_ = superCtor;
39013 var TempCtor = function () {};
39014 TempCtor.prototype = superCtor.prototype;
39015 ctor.prototype = new TempCtor();
39016 ctor.prototype.constructor = ctor;
39017 }
39018
39019 // BN
39020
39021 function BN (number, base, endian) {
39022 if (BN.isBN(number)) {
39023 return number;
39024 }
39025
39026 this.negative = 0;
39027 this.words = null;
39028 this.length = 0;
39029
39030 // Reduction context
39031 this.red = null;
39032
39033 if (number !== null) {
39034 if (base === 'le' || base === 'be') {
39035 endian = base;
39036 base = 10;
39037 }
39038
39039 this._init(number || 0, base || 10, endian || 'be');
39040 }
39041 }
39042 if (typeof module === 'object') {
39043 module.exports = BN;
39044 } else {
39045 exports.BN = BN;
39046 }
39047
39048 BN.BN = BN;
39049 BN.wordSize = 26;
39050
39051 var Buffer;
39052 try {
39053 Buffer = require('buf' + 'fer').Buffer;
39054 } catch (e) {
39055 }
39056
39057 BN.isBN = function isBN (num) {
39058 if (num instanceof BN) {
39059 return true;
39060 }
39061
39062 return num !== null && typeof num === 'object' &&
39063 num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
39064 };
39065
39066 BN.max = function max (left, right) {
39067 if (left.cmp(right) > 0) return left;
39068 return right;
39069 };
39070
39071 BN.min = function min (left, right) {
39072 if (left.cmp(right) < 0) return left;
39073 return right;
39074 };
39075
39076 BN.prototype._init = function init (number, base, endian) {
39077 if (typeof number === 'number') {
39078 return this._initNumber(number, base, endian);
39079 }
39080
39081 if (typeof number === 'object') {
39082 return this._initArray(number, base, endian);
39083 }
39084
39085 if (base === 'hex') {
39086 base = 16;
39087 }
39088 assert(base === (base | 0) && base >= 2 && base <= 36);
39089
39090 number = number.toString().replace(/\s+/g, '');
39091 var start = 0;
39092 if (number[0] === '-') {
39093 start++;
39094 }
39095
39096 if (base === 16) {
39097 this._parseHex(number, start);
39098 } else {
39099 this._parseBase(number, base, start);
39100 }
39101
39102 if (number[0] === '-') {
39103 this.negative = 1;
39104 }
39105
39106 this.strip();
39107
39108 if (endian !== 'le') return;
39109
39110 this._initArray(this.toArray(), base, endian);
39111 };
39112
39113 BN.prototype._initNumber = function _initNumber (number, base, endian) {
39114 if (number < 0) {
39115 this.negative = 1;
39116 number = -number;
39117 }
39118 if (number < 0x4000000) {
39119 this.words = [ number & 0x3ffffff ];
39120 this.length = 1;
39121 } else if (number < 0x10000000000000) {
39122 this.words = [
39123 number & 0x3ffffff,
39124 (number / 0x4000000) & 0x3ffffff
39125 ];
39126 this.length = 2;
39127 } else {
39128 assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)
39129 this.words = [
39130 number & 0x3ffffff,
39131 (number / 0x4000000) & 0x3ffffff,
39132 1
39133 ];
39134 this.length = 3;
39135 }
39136
39137 if (endian !== 'le') return;
39138
39139 // Reverse the bytes
39140 this._initArray(this.toArray(), base, endian);
39141 };
39142
39143 BN.prototype._initArray = function _initArray (number, base, endian) {
39144 // Perhaps a Uint8Array
39145 assert(typeof number.length === 'number');
39146 if (number.length <= 0) {
39147 this.words = [ 0 ];
39148 this.length = 1;
39149 return this;
39150 }
39151
39152 this.length = Math.ceil(number.length / 3);
39153 this.words = new Array(this.length);
39154 for (var i = 0; i < this.length; i++) {
39155 this.words[i] = 0;
39156 }
39157
39158 var j, w;
39159 var off = 0;
39160 if (endian === 'be') {
39161 for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
39162 w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);
39163 this.words[j] |= (w << off) & 0x3ffffff;
39164 this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
39165 off += 24;
39166 if (off >= 26) {
39167 off -= 26;
39168 j++;
39169 }
39170 }
39171 } else if (endian === 'le') {
39172 for (i = 0, j = 0; i < number.length; i += 3) {
39173 w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);
39174 this.words[j] |= (w << off) & 0x3ffffff;
39175 this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
39176 off += 24;
39177 if (off >= 26) {
39178 off -= 26;
39179 j++;
39180 }
39181 }
39182 }
39183 return this.strip();
39184 };
39185
39186 function parseHex (str, start, end) {
39187 var r = 0;
39188 var len = Math.min(str.length, end);
39189 for (var i = start; i < len; i++) {
39190 var c = str.charCodeAt(i) - 48;
39191
39192 r <<= 4;
39193
39194 // 'a' - 'f'
39195 if (c >= 49 && c <= 54) {
39196 r |= c - 49 + 0xa;
39197
39198 // 'A' - 'F'
39199 } else if (c >= 17 && c <= 22) {
39200 r |= c - 17 + 0xa;
39201
39202 // '0' - '9'
39203 } else {
39204 r |= c & 0xf;
39205 }
39206 }
39207 return r;
39208 }
39209
39210 BN.prototype._parseHex = function _parseHex (number, start) {
39211 // Create possibly bigger array to ensure that it fits the number
39212 this.length = Math.ceil((number.length - start) / 6);
39213 this.words = new Array(this.length);
39214 for (var i = 0; i < this.length; i++) {
39215 this.words[i] = 0;
39216 }
39217
39218 var j, w;
39219 // Scan 24-bit chunks and add them to the number
39220 var off = 0;
39221 for (i = number.length - 6, j = 0; i >= start; i -= 6) {
39222 w = parseHex(number, i, i + 6);
39223 this.words[j] |= (w << off) & 0x3ffffff;
39224 // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb
39225 this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
39226 off += 24;
39227 if (off >= 26) {
39228 off -= 26;
39229 j++;
39230 }
39231 }
39232 if (i + 6 !== start) {
39233 w = parseHex(number, start, i + 6);
39234 this.words[j] |= (w << off) & 0x3ffffff;
39235 this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
39236 }
39237 this.strip();
39238 };
39239
39240 function parseBase (str, start, end, mul) {
39241 var r = 0;
39242 var len = Math.min(str.length, end);
39243 for (var i = start; i < len; i++) {
39244 var c = str.charCodeAt(i) - 48;
39245
39246 r *= mul;
39247
39248 // 'a'
39249 if (c >= 49) {
39250 r += c - 49 + 0xa;
39251
39252 // 'A'
39253 } else if (c >= 17) {
39254 r += c - 17 + 0xa;
39255
39256 // '0' - '9'
39257 } else {
39258 r += c;
39259 }
39260 }
39261 return r;
39262 }
39263
39264 BN.prototype._parseBase = function _parseBase (number, base, start) {
39265 // Initialize as zero
39266 this.words = [ 0 ];
39267 this.length = 1;
39268
39269 // Find length of limb in base
39270 for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {
39271 limbLen++;
39272 }
39273 limbLen--;
39274 limbPow = (limbPow / base) | 0;
39275
39276 var total = number.length - start;
39277 var mod = total % limbLen;
39278 var end = Math.min(total, total - mod) + start;
39279
39280 var word = 0;
39281 for (var i = start; i < end; i += limbLen) {
39282 word = parseBase(number, i, i + limbLen, base);
39283
39284 this.imuln(limbPow);
39285 if (this.words[0] + word < 0x4000000) {
39286 this.words[0] += word;
39287 } else {
39288 this._iaddn(word);
39289 }
39290 }
39291
39292 if (mod !== 0) {
39293 var pow = 1;
39294 word = parseBase(number, i, number.length, base);
39295
39296 for (i = 0; i < mod; i++) {
39297 pow *= base;
39298 }
39299
39300 this.imuln(pow);
39301 if (this.words[0] + word < 0x4000000) {
39302 this.words[0] += word;
39303 } else {
39304 this._iaddn(word);
39305 }
39306 }
39307 };
39308
39309 BN.prototype.copy = function copy (dest) {
39310 dest.words = new Array(this.length);
39311 for (var i = 0; i < this.length; i++) {
39312 dest.words[i] = this.words[i];
39313 }
39314 dest.length = this.length;
39315 dest.negative = this.negative;
39316 dest.red = this.red;
39317 };
39318
39319 BN.prototype.clone = function clone () {
39320 var r = new BN(null);
39321 this.copy(r);
39322 return r;
39323 };
39324
39325 BN.prototype._expand = function _expand (size) {
39326 while (this.length < size) {
39327 this.words[this.length++] = 0;
39328 }
39329 return this;
39330 };
39331
39332 // Remove leading `0` from `this`
39333 BN.prototype.strip = function strip () {
39334 while (this.length > 1 && this.words[this.length - 1] === 0) {
39335 this.length--;
39336 }
39337 return this._normSign();
39338 };
39339
39340 BN.prototype._normSign = function _normSign () {
39341 // -0 = 0
39342 if (this.length === 1 && this.words[0] === 0) {
39343 this.negative = 0;
39344 }
39345 return this;
39346 };
39347
39348 BN.prototype.inspect = function inspect () {
39349 return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';
39350 };
39351
39352 /*
39353
39354 var zeros = [];
39355 var groupSizes = [];
39356 var groupBases = [];
39357
39358 var s = '';
39359 var i = -1;
39360 while (++i < BN.wordSize) {
39361 zeros[i] = s;
39362 s += '0';
39363 }
39364 groupSizes[0] = 0;
39365 groupSizes[1] = 0;
39366 groupBases[0] = 0;
39367 groupBases[1] = 0;
39368 var base = 2 - 1;
39369 while (++base < 36 + 1) {
39370 var groupSize = 0;
39371 var groupBase = 1;
39372 while (groupBase < (1 << BN.wordSize) / base) {
39373 groupBase *= base;
39374 groupSize += 1;
39375 }
39376 groupSizes[base] = groupSize;
39377 groupBases[base] = groupBase;
39378 }
39379
39380 */
39381
39382 var zeros = [
39383 '',
39384 '0',
39385 '00',
39386 '000',
39387 '0000',
39388 '00000',
39389 '000000',
39390 '0000000',
39391 '00000000',
39392 '000000000',
39393 '0000000000',
39394 '00000000000',
39395 '000000000000',
39396 '0000000000000',
39397 '00000000000000',
39398 '000000000000000',
39399 '0000000000000000',
39400 '00000000000000000',
39401 '000000000000000000',
39402 '0000000000000000000',
39403 '00000000000000000000',
39404 '000000000000000000000',
39405 '0000000000000000000000',
39406 '00000000000000000000000',
39407 '000000000000000000000000',
39408 '0000000000000000000000000'
39409 ];
39410
39411 var groupSizes = [
39412 0, 0,
39413 25, 16, 12, 11, 10, 9, 8,
39414 8, 7, 7, 7, 7, 6, 6,
39415 6, 6, 6, 6, 6, 5, 5,
39416 5, 5, 5, 5, 5, 5, 5,
39417 5, 5, 5, 5, 5, 5, 5
39418 ];
39419
39420 var groupBases = [
39421 0, 0,
39422 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,
39423 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,
39424 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,
39425 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,
39426 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176
39427 ];
39428
39429 BN.prototype.toString = function toString (base, padding) {
39430 base = base || 10;
39431 padding = padding | 0 || 1;
39432
39433 var out;
39434 if (base === 16 || base === 'hex') {
39435 out = '';
39436 var off = 0;
39437 var carry = 0;
39438 for (var i = 0; i < this.length; i++) {
39439 var w = this.words[i];
39440 var word = (((w << off) | carry) & 0xffffff).toString(16);
39441 carry = (w >>> (24 - off)) & 0xffffff;
39442 if (carry !== 0 || i !== this.length - 1) {
39443 out = zeros[6 - word.length] + word + out;
39444 } else {
39445 out = word + out;
39446 }
39447 off += 2;
39448 if (off >= 26) {
39449 off -= 26;
39450 i--;
39451 }
39452 }
39453 if (carry !== 0) {
39454 out = carry.toString(16) + out;
39455 }
39456 while (out.length % padding !== 0) {
39457 out = '0' + out;
39458 }
39459 if (this.negative !== 0) {
39460 out = '-' + out;
39461 }
39462 return out;
39463 }
39464
39465 if (base === (base | 0) && base >= 2 && base <= 36) {
39466 // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));
39467 var groupSize = groupSizes[base];
39468 // var groupBase = Math.pow(base, groupSize);
39469 var groupBase = groupBases[base];
39470 out = '';
39471 var c = this.clone();
39472 c.negative = 0;
39473 while (!c.isZero()) {
39474 var r = c.modn(groupBase).toString(base);
39475 c = c.idivn(groupBase);
39476
39477 if (!c.isZero()) {
39478 out = zeros[groupSize - r.length] + r + out;
39479 } else {
39480 out = r + out;
39481 }
39482 }
39483 if (this.isZero()) {
39484 out = '0' + out;
39485 }
39486 while (out.length % padding !== 0) {
39487 out = '0' + out;
39488 }
39489 if (this.negative !== 0) {
39490 out = '-' + out;
39491 }
39492 return out;
39493 }
39494
39495 assert(false, 'Base should be between 2 and 36');
39496 };
39497
39498 BN.prototype.toNumber = function toNumber () {
39499 var ret = this.words[0];
39500 if (this.length === 2) {
39501 ret += this.words[1] * 0x4000000;
39502 } else if (this.length === 3 && this.words[2] === 0x01) {
39503 // NOTE: at this stage it is known that the top bit is set
39504 ret += 0x10000000000000 + (this.words[1] * 0x4000000);
39505 } else if (this.length > 2) {
39506 assert(false, 'Number can only safely store up to 53 bits');
39507 }
39508 return (this.negative !== 0) ? -ret : ret;
39509 };
39510
39511 BN.prototype.toJSON = function toJSON () {
39512 return this.toString(16);
39513 };
39514
39515 BN.prototype.toBuffer = function toBuffer (endian, length) {
39516 assert(typeof Buffer !== 'undefined');
39517 return this.toArrayLike(Buffer, endian, length);
39518 };
39519
39520 BN.prototype.toArray = function toArray (endian, length) {
39521 return this.toArrayLike(Array, endian, length);
39522 };
39523
39524 BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {
39525 var byteLength = this.byteLength();
39526 var reqLength = length || Math.max(1, byteLength);
39527 assert(byteLength <= reqLength, 'byte array longer than desired length');
39528 assert(reqLength > 0, 'Requested array length <= 0');
39529
39530 this.strip();
39531 var littleEndian = endian === 'le';
39532 var res = new ArrayType(reqLength);
39533
39534 var b, i;
39535 var q = this.clone();
39536 if (!littleEndian) {
39537 // Assume big-endian
39538 for (i = 0; i < reqLength - byteLength; i++) {
39539 res[i] = 0;
39540 }
39541
39542 for (i = 0; !q.isZero(); i++) {
39543 b = q.andln(0xff);
39544 q.iushrn(8);
39545
39546 res[reqLength - i - 1] = b;
39547 }
39548 } else {
39549 for (i = 0; !q.isZero(); i++) {
39550 b = q.andln(0xff);
39551 q.iushrn(8);
39552
39553 res[i] = b;
39554 }
39555
39556 for (; i < reqLength; i++) {
39557 res[i] = 0;
39558 }
39559 }
39560
39561 return res;
39562 };
39563
39564 if (Math.clz32) {
39565 BN.prototype._countBits = function _countBits (w) {
39566 return 32 - Math.clz32(w);
39567 };
39568 } else {
39569 BN.prototype._countBits = function _countBits (w) {
39570 var t = w;
39571 var r = 0;
39572 if (t >= 0x1000) {
39573 r += 13;
39574 t >>>= 13;
39575 }
39576 if (t >= 0x40) {
39577 r += 7;
39578 t >>>= 7;
39579 }
39580 if (t >= 0x8) {
39581 r += 4;
39582 t >>>= 4;
39583 }
39584 if (t >= 0x02) {
39585 r += 2;
39586 t >>>= 2;
39587 }
39588 return r + t;
39589 };
39590 }
39591
39592 BN.prototype._zeroBits = function _zeroBits (w) {
39593 // Short-cut
39594 if (w === 0) return 26;
39595
39596 var t = w;
39597 var r = 0;
39598 if ((t & 0x1fff) === 0) {
39599 r += 13;
39600 t >>>= 13;
39601 }
39602 if ((t & 0x7f) === 0) {
39603 r += 7;
39604 t >>>= 7;
39605 }
39606 if ((t & 0xf) === 0) {
39607 r += 4;
39608 t >>>= 4;
39609 }
39610 if ((t & 0x3) === 0) {
39611 r += 2;
39612 t >>>= 2;
39613 }
39614 if ((t & 0x1) === 0) {
39615 r++;
39616 }
39617 return r;
39618 };
39619
39620 // Return number of used bits in a BN
39621 BN.prototype.bitLength = function bitLength () {
39622 var w = this.words[this.length - 1];
39623 var hi = this._countBits(w);
39624 return (this.length - 1) * 26 + hi;
39625 };
39626
39627 function toBitArray (num) {
39628 var w = new Array(num.bitLength());
39629
39630 for (var bit = 0; bit < w.length; bit++) {
39631 var off = (bit / 26) | 0;
39632 var wbit = bit % 26;
39633
39634 w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;
39635 }
39636
39637 return w;
39638 }
39639
39640 // Number of trailing zero bits
39641 BN.prototype.zeroBits = function zeroBits () {
39642 if (this.isZero()) return 0;
39643
39644 var r = 0;
39645 for (var i = 0; i < this.length; i++) {
39646 var b = this._zeroBits(this.words[i]);
39647 r += b;
39648 if (b !== 26) break;
39649 }
39650 return r;
39651 };
39652
39653 BN.prototype.byteLength = function byteLength () {
39654 return Math.ceil(this.bitLength() / 8);
39655 };
39656
39657 BN.prototype.toTwos = function toTwos (width) {
39658 if (this.negative !== 0) {
39659 return this.abs().inotn(width).iaddn(1);
39660 }
39661 return this.clone();
39662 };
39663
39664 BN.prototype.fromTwos = function fromTwos (width) {
39665 if (this.testn(width - 1)) {
39666 return this.notn(width).iaddn(1).ineg();
39667 }
39668 return this.clone();
39669 };
39670
39671 BN.prototype.isNeg = function isNeg () {
39672 return this.negative !== 0;
39673 };
39674
39675 // Return negative clone of `this`
39676 BN.prototype.neg = function neg () {
39677 return this.clone().ineg();
39678 };
39679
39680 BN.prototype.ineg = function ineg () {
39681 if (!this.isZero()) {
39682 this.negative ^= 1;
39683 }
39684
39685 return this;
39686 };
39687
39688 // Or `num` with `this` in-place
39689 BN.prototype.iuor = function iuor (num) {
39690 while (this.length < num.length) {
39691 this.words[this.length++] = 0;
39692 }
39693
39694 for (var i = 0; i < num.length; i++) {
39695 this.words[i] = this.words[i] | num.words[i];
39696 }
39697
39698 return this.strip();
39699 };
39700
39701 BN.prototype.ior = function ior (num) {
39702 assert((this.negative | num.negative) === 0);
39703 return this.iuor(num);
39704 };
39705
39706 // Or `num` with `this`
39707 BN.prototype.or = function or (num) {
39708 if (this.length > num.length) return this.clone().ior(num);
39709 return num.clone().ior(this);
39710 };
39711
39712 BN.prototype.uor = function uor (num) {
39713 if (this.length > num.length) return this.clone().iuor(num);
39714 return num.clone().iuor(this);
39715 };
39716
39717 // And `num` with `this` in-place
39718 BN.prototype.iuand = function iuand (num) {
39719 // b = min-length(num, this)
39720 var b;
39721 if (this.length > num.length) {
39722 b = num;
39723 } else {
39724 b = this;
39725 }
39726
39727 for (var i = 0; i < b.length; i++) {
39728 this.words[i] = this.words[i] & num.words[i];
39729 }
39730
39731 this.length = b.length;
39732
39733 return this.strip();
39734 };
39735
39736 BN.prototype.iand = function iand (num) {
39737 assert((this.negative | num.negative) === 0);
39738 return this.iuand(num);
39739 };
39740
39741 // And `num` with `this`
39742 BN.prototype.and = function and (num) {
39743 if (this.length > num.length) return this.clone().iand(num);
39744 return num.clone().iand(this);
39745 };
39746
39747 BN.prototype.uand = function uand (num) {
39748 if (this.length > num.length) return this.clone().iuand(num);
39749 return num.clone().iuand(this);
39750 };
39751
39752 // Xor `num` with `this` in-place
39753 BN.prototype.iuxor = function iuxor (num) {
39754 // a.length > b.length
39755 var a;
39756 var b;
39757 if (this.length > num.length) {
39758 a = this;
39759 b = num;
39760 } else {
39761 a = num;
39762 b = this;
39763 }
39764
39765 for (var i = 0; i < b.length; i++) {
39766 this.words[i] = a.words[i] ^ b.words[i];
39767 }
39768
39769 if (this !== a) {
39770 for (; i < a.length; i++) {
39771 this.words[i] = a.words[i];
39772 }
39773 }
39774
39775 this.length = a.length;
39776
39777 return this.strip();
39778 };
39779
39780 BN.prototype.ixor = function ixor (num) {
39781 assert((this.negative | num.negative) === 0);
39782 return this.iuxor(num);
39783 };
39784
39785 // Xor `num` with `this`
39786 BN.prototype.xor = function xor (num) {
39787 if (this.length > num.length) return this.clone().ixor(num);
39788 return num.clone().ixor(this);
39789 };
39790
39791 BN.prototype.uxor = function uxor (num) {
39792 if (this.length > num.length) return this.clone().iuxor(num);
39793 return num.clone().iuxor(this);
39794 };
39795
39796 // Not ``this`` with ``width`` bitwidth
39797 BN.prototype.inotn = function inotn (width) {
39798 assert(typeof width === 'number' && width >= 0);
39799
39800 var bytesNeeded = Math.ceil(width / 26) | 0;
39801 var bitsLeft = width % 26;
39802
39803 // Extend the buffer with leading zeroes
39804 this._expand(bytesNeeded);
39805
39806 if (bitsLeft > 0) {
39807 bytesNeeded--;
39808 }
39809
39810 // Handle complete words
39811 for (var i = 0; i < bytesNeeded; i++) {
39812 this.words[i] = ~this.words[i] & 0x3ffffff;
39813 }
39814
39815 // Handle the residue
39816 if (bitsLeft > 0) {
39817 this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));
39818 }
39819
39820 // And remove leading zeroes
39821 return this.strip();
39822 };
39823
39824 BN.prototype.notn = function notn (width) {
39825 return this.clone().inotn(width);
39826 };
39827
39828 // Set `bit` of `this`
39829 BN.prototype.setn = function setn (bit, val) {
39830 assert(typeof bit === 'number' && bit >= 0);
39831
39832 var off = (bit / 26) | 0;
39833 var wbit = bit % 26;
39834
39835 this._expand(off + 1);
39836
39837 if (val) {
39838 this.words[off] = this.words[off] | (1 << wbit);
39839 } else {
39840 this.words[off] = this.words[off] & ~(1 << wbit);
39841 }
39842
39843 return this.strip();
39844 };
39845
39846 // Add `num` to `this` in-place
39847 BN.prototype.iadd = function iadd (num) {
39848 var r;
39849
39850 // negative + positive
39851 if (this.negative !== 0 && num.negative === 0) {
39852 this.negative = 0;
39853 r = this.isub(num);
39854 this.negative ^= 1;
39855 return this._normSign();
39856
39857 // positive + negative
39858 } else if (this.negative === 0 && num.negative !== 0) {
39859 num.negative = 0;
39860 r = this.isub(num);
39861 num.negative = 1;
39862 return r._normSign();
39863 }
39864
39865 // a.length > b.length
39866 var a, b;
39867 if (this.length > num.length) {
39868 a = this;
39869 b = num;
39870 } else {
39871 a = num;
39872 b = this;
39873 }
39874
39875 var carry = 0;
39876 for (var i = 0; i < b.length; i++) {
39877 r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
39878 this.words[i] = r & 0x3ffffff;
39879 carry = r >>> 26;
39880 }
39881 for (; carry !== 0 && i < a.length; i++) {
39882 r = (a.words[i] | 0) + carry;
39883 this.words[i] = r & 0x3ffffff;
39884 carry = r >>> 26;
39885 }
39886
39887 this.length = a.length;
39888 if (carry !== 0) {
39889 this.words[this.length] = carry;
39890 this.length++;
39891 // Copy the rest of the words
39892 } else if (a !== this) {
39893 for (; i < a.length; i++) {
39894 this.words[i] = a.words[i];
39895 }
39896 }
39897
39898 return this;
39899 };
39900
39901 // Add `num` to `this`
39902 BN.prototype.add = function add (num) {
39903 var res;
39904 if (num.negative !== 0 && this.negative === 0) {
39905 num.negative = 0;
39906 res = this.sub(num);
39907 num.negative ^= 1;
39908 return res;
39909 } else if (num.negative === 0 && this.negative !== 0) {
39910 this.negative = 0;
39911 res = num.sub(this);
39912 this.negative = 1;
39913 return res;
39914 }
39915
39916 if (this.length > num.length) return this.clone().iadd(num);
39917
39918 return num.clone().iadd(this);
39919 };
39920
39921 // Subtract `num` from `this` in-place
39922 BN.prototype.isub = function isub (num) {
39923 // this - (-num) = this + num
39924 if (num.negative !== 0) {
39925 num.negative = 0;
39926 var r = this.iadd(num);
39927 num.negative = 1;
39928 return r._normSign();
39929
39930 // -this - num = -(this + num)
39931 } else if (this.negative !== 0) {
39932 this.negative = 0;
39933 this.iadd(num);
39934 this.negative = 1;
39935 return this._normSign();
39936 }
39937
39938 // At this point both numbers are positive
39939 var cmp = this.cmp(num);
39940
39941 // Optimization - zeroify
39942 if (cmp === 0) {
39943 this.negative = 0;
39944 this.length = 1;
39945 this.words[0] = 0;
39946 return this;
39947 }
39948
39949 // a > b
39950 var a, b;
39951 if (cmp > 0) {
39952 a = this;
39953 b = num;
39954 } else {
39955 a = num;
39956 b = this;
39957 }
39958
39959 var carry = 0;
39960 for (var i = 0; i < b.length; i++) {
39961 r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
39962 carry = r >> 26;
39963 this.words[i] = r & 0x3ffffff;
39964 }
39965 for (; carry !== 0 && i < a.length; i++) {
39966 r = (a.words[i] | 0) + carry;
39967 carry = r >> 26;
39968 this.words[i] = r & 0x3ffffff;
39969 }
39970
39971 // Copy rest of the words
39972 if (carry === 0 && i < a.length && a !== this) {
39973 for (; i < a.length; i++) {
39974 this.words[i] = a.words[i];
39975 }
39976 }
39977
39978 this.length = Math.max(this.length, i);
39979
39980 if (a !== this) {
39981 this.negative = 1;
39982 }
39983
39984 return this.strip();
39985 };
39986
39987 // Subtract `num` from `this`
39988 BN.prototype.sub = function sub (num) {
39989 return this.clone().isub(num);
39990 };
39991
39992 function smallMulTo (self, num, out) {
39993 out.negative = num.negative ^ self.negative;
39994 var len = (self.length + num.length) | 0;
39995 out.length = len;
39996 len = (len - 1) | 0;
39997
39998 // Peel one iteration (compiler can't do it, because of code complexity)
39999 var a = self.words[0] | 0;
40000 var b = num.words[0] | 0;
40001 var r = a * b;
40002
40003 var lo = r & 0x3ffffff;
40004 var carry = (r / 0x4000000) | 0;
40005 out.words[0] = lo;
40006
40007 for (var k = 1; k < len; k++) {
40008 // Sum all words with the same `i + j = k` and accumulate `ncarry`,
40009 // note that ncarry could be >= 0x3ffffff
40010 var ncarry = carry >>> 26;
40011 var rword = carry & 0x3ffffff;
40012 var maxJ = Math.min(k, num.length - 1);
40013 for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
40014 var i = (k - j) | 0;
40015 a = self.words[i] | 0;
40016 b = num.words[j] | 0;
40017 r = a * b + rword;
40018 ncarry += (r / 0x4000000) | 0;
40019 rword = r & 0x3ffffff;
40020 }
40021 out.words[k] = rword | 0;
40022 carry = ncarry | 0;
40023 }
40024 if (carry !== 0) {
40025 out.words[k] = carry | 0;
40026 } else {
40027 out.length--;
40028 }
40029
40030 return out.strip();
40031 }
40032
40033 // TODO(indutny): it may be reasonable to omit it for users who don't need
40034 // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit
40035 // multiplication (like elliptic secp256k1).
40036 var comb10MulTo = function comb10MulTo (self, num, out) {
40037 var a = self.words;
40038 var b = num.words;
40039 var o = out.words;
40040 var c = 0;
40041 var lo;
40042 var mid;
40043 var hi;
40044 var a0 = a[0] | 0;
40045 var al0 = a0 & 0x1fff;
40046 var ah0 = a0 >>> 13;
40047 var a1 = a[1] | 0;
40048 var al1 = a1 & 0x1fff;
40049 var ah1 = a1 >>> 13;
40050 var a2 = a[2] | 0;
40051 var al2 = a2 & 0x1fff;
40052 var ah2 = a2 >>> 13;
40053 var a3 = a[3] | 0;
40054 var al3 = a3 & 0x1fff;
40055 var ah3 = a3 >>> 13;
40056 var a4 = a[4] | 0;
40057 var al4 = a4 & 0x1fff;
40058 var ah4 = a4 >>> 13;
40059 var a5 = a[5] | 0;
40060 var al5 = a5 & 0x1fff;
40061 var ah5 = a5 >>> 13;
40062 var a6 = a[6] | 0;
40063 var al6 = a6 & 0x1fff;
40064 var ah6 = a6 >>> 13;
40065 var a7 = a[7] | 0;
40066 var al7 = a7 & 0x1fff;
40067 var ah7 = a7 >>> 13;
40068 var a8 = a[8] | 0;
40069 var al8 = a8 & 0x1fff;
40070 var ah8 = a8 >>> 13;
40071 var a9 = a[9] | 0;
40072 var al9 = a9 & 0x1fff;
40073 var ah9 = a9 >>> 13;
40074 var b0 = b[0] | 0;
40075 var bl0 = b0 & 0x1fff;
40076 var bh0 = b0 >>> 13;
40077 var b1 = b[1] | 0;
40078 var bl1 = b1 & 0x1fff;
40079 var bh1 = b1 >>> 13;
40080 var b2 = b[2] | 0;
40081 var bl2 = b2 & 0x1fff;
40082 var bh2 = b2 >>> 13;
40083 var b3 = b[3] | 0;
40084 var bl3 = b3 & 0x1fff;
40085 var bh3 = b3 >>> 13;
40086 var b4 = b[4] | 0;
40087 var bl4 = b4 & 0x1fff;
40088 var bh4 = b4 >>> 13;
40089 var b5 = b[5] | 0;
40090 var bl5 = b5 & 0x1fff;
40091 var bh5 = b5 >>> 13;
40092 var b6 = b[6] | 0;
40093 var bl6 = b6 & 0x1fff;
40094 var bh6 = b6 >>> 13;
40095 var b7 = b[7] | 0;
40096 var bl7 = b7 & 0x1fff;
40097 var bh7 = b7 >>> 13;
40098 var b8 = b[8] | 0;
40099 var bl8 = b8 & 0x1fff;
40100 var bh8 = b8 >>> 13;
40101 var b9 = b[9] | 0;
40102 var bl9 = b9 & 0x1fff;
40103 var bh9 = b9 >>> 13;
40104
40105 out.negative = self.negative ^ num.negative;
40106 out.length = 19;
40107 /* k = 0 */
40108 lo = Math.imul(al0, bl0);
40109 mid = Math.imul(al0, bh0);
40110 mid = (mid + Math.imul(ah0, bl0)) | 0;
40111 hi = Math.imul(ah0, bh0);
40112 var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40113 c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;
40114 w0 &= 0x3ffffff;
40115 /* k = 1 */
40116 lo = Math.imul(al1, bl0);
40117 mid = Math.imul(al1, bh0);
40118 mid = (mid + Math.imul(ah1, bl0)) | 0;
40119 hi = Math.imul(ah1, bh0);
40120 lo = (lo + Math.imul(al0, bl1)) | 0;
40121 mid = (mid + Math.imul(al0, bh1)) | 0;
40122 mid = (mid + Math.imul(ah0, bl1)) | 0;
40123 hi = (hi + Math.imul(ah0, bh1)) | 0;
40124 var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40125 c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;
40126 w1 &= 0x3ffffff;
40127 /* k = 2 */
40128 lo = Math.imul(al2, bl0);
40129 mid = Math.imul(al2, bh0);
40130 mid = (mid + Math.imul(ah2, bl0)) | 0;
40131 hi = Math.imul(ah2, bh0);
40132 lo = (lo + Math.imul(al1, bl1)) | 0;
40133 mid = (mid + Math.imul(al1, bh1)) | 0;
40134 mid = (mid + Math.imul(ah1, bl1)) | 0;
40135 hi = (hi + Math.imul(ah1, bh1)) | 0;
40136 lo = (lo + Math.imul(al0, bl2)) | 0;
40137 mid = (mid + Math.imul(al0, bh2)) | 0;
40138 mid = (mid + Math.imul(ah0, bl2)) | 0;
40139 hi = (hi + Math.imul(ah0, bh2)) | 0;
40140 var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40141 c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;
40142 w2 &= 0x3ffffff;
40143 /* k = 3 */
40144 lo = Math.imul(al3, bl0);
40145 mid = Math.imul(al3, bh0);
40146 mid = (mid + Math.imul(ah3, bl0)) | 0;
40147 hi = Math.imul(ah3, bh0);
40148 lo = (lo + Math.imul(al2, bl1)) | 0;
40149 mid = (mid + Math.imul(al2, bh1)) | 0;
40150 mid = (mid + Math.imul(ah2, bl1)) | 0;
40151 hi = (hi + Math.imul(ah2, bh1)) | 0;
40152 lo = (lo + Math.imul(al1, bl2)) | 0;
40153 mid = (mid + Math.imul(al1, bh2)) | 0;
40154 mid = (mid + Math.imul(ah1, bl2)) | 0;
40155 hi = (hi + Math.imul(ah1, bh2)) | 0;
40156 lo = (lo + Math.imul(al0, bl3)) | 0;
40157 mid = (mid + Math.imul(al0, bh3)) | 0;
40158 mid = (mid + Math.imul(ah0, bl3)) | 0;
40159 hi = (hi + Math.imul(ah0, bh3)) | 0;
40160 var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40161 c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;
40162 w3 &= 0x3ffffff;
40163 /* k = 4 */
40164 lo = Math.imul(al4, bl0);
40165 mid = Math.imul(al4, bh0);
40166 mid = (mid + Math.imul(ah4, bl0)) | 0;
40167 hi = Math.imul(ah4, bh0);
40168 lo = (lo + Math.imul(al3, bl1)) | 0;
40169 mid = (mid + Math.imul(al3, bh1)) | 0;
40170 mid = (mid + Math.imul(ah3, bl1)) | 0;
40171 hi = (hi + Math.imul(ah3, bh1)) | 0;
40172 lo = (lo + Math.imul(al2, bl2)) | 0;
40173 mid = (mid + Math.imul(al2, bh2)) | 0;
40174 mid = (mid + Math.imul(ah2, bl2)) | 0;
40175 hi = (hi + Math.imul(ah2, bh2)) | 0;
40176 lo = (lo + Math.imul(al1, bl3)) | 0;
40177 mid = (mid + Math.imul(al1, bh3)) | 0;
40178 mid = (mid + Math.imul(ah1, bl3)) | 0;
40179 hi = (hi + Math.imul(ah1, bh3)) | 0;
40180 lo = (lo + Math.imul(al0, bl4)) | 0;
40181 mid = (mid + Math.imul(al0, bh4)) | 0;
40182 mid = (mid + Math.imul(ah0, bl4)) | 0;
40183 hi = (hi + Math.imul(ah0, bh4)) | 0;
40184 var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40185 c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;
40186 w4 &= 0x3ffffff;
40187 /* k = 5 */
40188 lo = Math.imul(al5, bl0);
40189 mid = Math.imul(al5, bh0);
40190 mid = (mid + Math.imul(ah5, bl0)) | 0;
40191 hi = Math.imul(ah5, bh0);
40192 lo = (lo + Math.imul(al4, bl1)) | 0;
40193 mid = (mid + Math.imul(al4, bh1)) | 0;
40194 mid = (mid + Math.imul(ah4, bl1)) | 0;
40195 hi = (hi + Math.imul(ah4, bh1)) | 0;
40196 lo = (lo + Math.imul(al3, bl2)) | 0;
40197 mid = (mid + Math.imul(al3, bh2)) | 0;
40198 mid = (mid + Math.imul(ah3, bl2)) | 0;
40199 hi = (hi + Math.imul(ah3, bh2)) | 0;
40200 lo = (lo + Math.imul(al2, bl3)) | 0;
40201 mid = (mid + Math.imul(al2, bh3)) | 0;
40202 mid = (mid + Math.imul(ah2, bl3)) | 0;
40203 hi = (hi + Math.imul(ah2, bh3)) | 0;
40204 lo = (lo + Math.imul(al1, bl4)) | 0;
40205 mid = (mid + Math.imul(al1, bh4)) | 0;
40206 mid = (mid + Math.imul(ah1, bl4)) | 0;
40207 hi = (hi + Math.imul(ah1, bh4)) | 0;
40208 lo = (lo + Math.imul(al0, bl5)) | 0;
40209 mid = (mid + Math.imul(al0, bh5)) | 0;
40210 mid = (mid + Math.imul(ah0, bl5)) | 0;
40211 hi = (hi + Math.imul(ah0, bh5)) | 0;
40212 var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40213 c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;
40214 w5 &= 0x3ffffff;
40215 /* k = 6 */
40216 lo = Math.imul(al6, bl0);
40217 mid = Math.imul(al6, bh0);
40218 mid = (mid + Math.imul(ah6, bl0)) | 0;
40219 hi = Math.imul(ah6, bh0);
40220 lo = (lo + Math.imul(al5, bl1)) | 0;
40221 mid = (mid + Math.imul(al5, bh1)) | 0;
40222 mid = (mid + Math.imul(ah5, bl1)) | 0;
40223 hi = (hi + Math.imul(ah5, bh1)) | 0;
40224 lo = (lo + Math.imul(al4, bl2)) | 0;
40225 mid = (mid + Math.imul(al4, bh2)) | 0;
40226 mid = (mid + Math.imul(ah4, bl2)) | 0;
40227 hi = (hi + Math.imul(ah4, bh2)) | 0;
40228 lo = (lo + Math.imul(al3, bl3)) | 0;
40229 mid = (mid + Math.imul(al3, bh3)) | 0;
40230 mid = (mid + Math.imul(ah3, bl3)) | 0;
40231 hi = (hi + Math.imul(ah3, bh3)) | 0;
40232 lo = (lo + Math.imul(al2, bl4)) | 0;
40233 mid = (mid + Math.imul(al2, bh4)) | 0;
40234 mid = (mid + Math.imul(ah2, bl4)) | 0;
40235 hi = (hi + Math.imul(ah2, bh4)) | 0;
40236 lo = (lo + Math.imul(al1, bl5)) | 0;
40237 mid = (mid + Math.imul(al1, bh5)) | 0;
40238 mid = (mid + Math.imul(ah1, bl5)) | 0;
40239 hi = (hi + Math.imul(ah1, bh5)) | 0;
40240 lo = (lo + Math.imul(al0, bl6)) | 0;
40241 mid = (mid + Math.imul(al0, bh6)) | 0;
40242 mid = (mid + Math.imul(ah0, bl6)) | 0;
40243 hi = (hi + Math.imul(ah0, bh6)) | 0;
40244 var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40245 c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;
40246 w6 &= 0x3ffffff;
40247 /* k = 7 */
40248 lo = Math.imul(al7, bl0);
40249 mid = Math.imul(al7, bh0);
40250 mid = (mid + Math.imul(ah7, bl0)) | 0;
40251 hi = Math.imul(ah7, bh0);
40252 lo = (lo + Math.imul(al6, bl1)) | 0;
40253 mid = (mid + Math.imul(al6, bh1)) | 0;
40254 mid = (mid + Math.imul(ah6, bl1)) | 0;
40255 hi = (hi + Math.imul(ah6, bh1)) | 0;
40256 lo = (lo + Math.imul(al5, bl2)) | 0;
40257 mid = (mid + Math.imul(al5, bh2)) | 0;
40258 mid = (mid + Math.imul(ah5, bl2)) | 0;
40259 hi = (hi + Math.imul(ah5, bh2)) | 0;
40260 lo = (lo + Math.imul(al4, bl3)) | 0;
40261 mid = (mid + Math.imul(al4, bh3)) | 0;
40262 mid = (mid + Math.imul(ah4, bl3)) | 0;
40263 hi = (hi + Math.imul(ah4, bh3)) | 0;
40264 lo = (lo + Math.imul(al3, bl4)) | 0;
40265 mid = (mid + Math.imul(al3, bh4)) | 0;
40266 mid = (mid + Math.imul(ah3, bl4)) | 0;
40267 hi = (hi + Math.imul(ah3, bh4)) | 0;
40268 lo = (lo + Math.imul(al2, bl5)) | 0;
40269 mid = (mid + Math.imul(al2, bh5)) | 0;
40270 mid = (mid + Math.imul(ah2, bl5)) | 0;
40271 hi = (hi + Math.imul(ah2, bh5)) | 0;
40272 lo = (lo + Math.imul(al1, bl6)) | 0;
40273 mid = (mid + Math.imul(al1, bh6)) | 0;
40274 mid = (mid + Math.imul(ah1, bl6)) | 0;
40275 hi = (hi + Math.imul(ah1, bh6)) | 0;
40276 lo = (lo + Math.imul(al0, bl7)) | 0;
40277 mid = (mid + Math.imul(al0, bh7)) | 0;
40278 mid = (mid + Math.imul(ah0, bl7)) | 0;
40279 hi = (hi + Math.imul(ah0, bh7)) | 0;
40280 var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40281 c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;
40282 w7 &= 0x3ffffff;
40283 /* k = 8 */
40284 lo = Math.imul(al8, bl0);
40285 mid = Math.imul(al8, bh0);
40286 mid = (mid + Math.imul(ah8, bl0)) | 0;
40287 hi = Math.imul(ah8, bh0);
40288 lo = (lo + Math.imul(al7, bl1)) | 0;
40289 mid = (mid + Math.imul(al7, bh1)) | 0;
40290 mid = (mid + Math.imul(ah7, bl1)) | 0;
40291 hi = (hi + Math.imul(ah7, bh1)) | 0;
40292 lo = (lo + Math.imul(al6, bl2)) | 0;
40293 mid = (mid + Math.imul(al6, bh2)) | 0;
40294 mid = (mid + Math.imul(ah6, bl2)) | 0;
40295 hi = (hi + Math.imul(ah6, bh2)) | 0;
40296 lo = (lo + Math.imul(al5, bl3)) | 0;
40297 mid = (mid + Math.imul(al5, bh3)) | 0;
40298 mid = (mid + Math.imul(ah5, bl3)) | 0;
40299 hi = (hi + Math.imul(ah5, bh3)) | 0;
40300 lo = (lo + Math.imul(al4, bl4)) | 0;
40301 mid = (mid + Math.imul(al4, bh4)) | 0;
40302 mid = (mid + Math.imul(ah4, bl4)) | 0;
40303 hi = (hi + Math.imul(ah4, bh4)) | 0;
40304 lo = (lo + Math.imul(al3, bl5)) | 0;
40305 mid = (mid + Math.imul(al3, bh5)) | 0;
40306 mid = (mid + Math.imul(ah3, bl5)) | 0;
40307 hi = (hi + Math.imul(ah3, bh5)) | 0;
40308 lo = (lo + Math.imul(al2, bl6)) | 0;
40309 mid = (mid + Math.imul(al2, bh6)) | 0;
40310 mid = (mid + Math.imul(ah2, bl6)) | 0;
40311 hi = (hi + Math.imul(ah2, bh6)) | 0;
40312 lo = (lo + Math.imul(al1, bl7)) | 0;
40313 mid = (mid + Math.imul(al1, bh7)) | 0;
40314 mid = (mid + Math.imul(ah1, bl7)) | 0;
40315 hi = (hi + Math.imul(ah1, bh7)) | 0;
40316 lo = (lo + Math.imul(al0, bl8)) | 0;
40317 mid = (mid + Math.imul(al0, bh8)) | 0;
40318 mid = (mid + Math.imul(ah0, bl8)) | 0;
40319 hi = (hi + Math.imul(ah0, bh8)) | 0;
40320 var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40321 c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;
40322 w8 &= 0x3ffffff;
40323 /* k = 9 */
40324 lo = Math.imul(al9, bl0);
40325 mid = Math.imul(al9, bh0);
40326 mid = (mid + Math.imul(ah9, bl0)) | 0;
40327 hi = Math.imul(ah9, bh0);
40328 lo = (lo + Math.imul(al8, bl1)) | 0;
40329 mid = (mid + Math.imul(al8, bh1)) | 0;
40330 mid = (mid + Math.imul(ah8, bl1)) | 0;
40331 hi = (hi + Math.imul(ah8, bh1)) | 0;
40332 lo = (lo + Math.imul(al7, bl2)) | 0;
40333 mid = (mid + Math.imul(al7, bh2)) | 0;
40334 mid = (mid + Math.imul(ah7, bl2)) | 0;
40335 hi = (hi + Math.imul(ah7, bh2)) | 0;
40336 lo = (lo + Math.imul(al6, bl3)) | 0;
40337 mid = (mid + Math.imul(al6, bh3)) | 0;
40338 mid = (mid + Math.imul(ah6, bl3)) | 0;
40339 hi = (hi + Math.imul(ah6, bh3)) | 0;
40340 lo = (lo + Math.imul(al5, bl4)) | 0;
40341 mid = (mid + Math.imul(al5, bh4)) | 0;
40342 mid = (mid + Math.imul(ah5, bl4)) | 0;
40343 hi = (hi + Math.imul(ah5, bh4)) | 0;
40344 lo = (lo + Math.imul(al4, bl5)) | 0;
40345 mid = (mid + Math.imul(al4, bh5)) | 0;
40346 mid = (mid + Math.imul(ah4, bl5)) | 0;
40347 hi = (hi + Math.imul(ah4, bh5)) | 0;
40348 lo = (lo + Math.imul(al3, bl6)) | 0;
40349 mid = (mid + Math.imul(al3, bh6)) | 0;
40350 mid = (mid + Math.imul(ah3, bl6)) | 0;
40351 hi = (hi + Math.imul(ah3, bh6)) | 0;
40352 lo = (lo + Math.imul(al2, bl7)) | 0;
40353 mid = (mid + Math.imul(al2, bh7)) | 0;
40354 mid = (mid + Math.imul(ah2, bl7)) | 0;
40355 hi = (hi + Math.imul(ah2, bh7)) | 0;
40356 lo = (lo + Math.imul(al1, bl8)) | 0;
40357 mid = (mid + Math.imul(al1, bh8)) | 0;
40358 mid = (mid + Math.imul(ah1, bl8)) | 0;
40359 hi = (hi + Math.imul(ah1, bh8)) | 0;
40360 lo = (lo + Math.imul(al0, bl9)) | 0;
40361 mid = (mid + Math.imul(al0, bh9)) | 0;
40362 mid = (mid + Math.imul(ah0, bl9)) | 0;
40363 hi = (hi + Math.imul(ah0, bh9)) | 0;
40364 var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40365 c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;
40366 w9 &= 0x3ffffff;
40367 /* k = 10 */
40368 lo = Math.imul(al9, bl1);
40369 mid = Math.imul(al9, bh1);
40370 mid = (mid + Math.imul(ah9, bl1)) | 0;
40371 hi = Math.imul(ah9, bh1);
40372 lo = (lo + Math.imul(al8, bl2)) | 0;
40373 mid = (mid + Math.imul(al8, bh2)) | 0;
40374 mid = (mid + Math.imul(ah8, bl2)) | 0;
40375 hi = (hi + Math.imul(ah8, bh2)) | 0;
40376 lo = (lo + Math.imul(al7, bl3)) | 0;
40377 mid = (mid + Math.imul(al7, bh3)) | 0;
40378 mid = (mid + Math.imul(ah7, bl3)) | 0;
40379 hi = (hi + Math.imul(ah7, bh3)) | 0;
40380 lo = (lo + Math.imul(al6, bl4)) | 0;
40381 mid = (mid + Math.imul(al6, bh4)) | 0;
40382 mid = (mid + Math.imul(ah6, bl4)) | 0;
40383 hi = (hi + Math.imul(ah6, bh4)) | 0;
40384 lo = (lo + Math.imul(al5, bl5)) | 0;
40385 mid = (mid + Math.imul(al5, bh5)) | 0;
40386 mid = (mid + Math.imul(ah5, bl5)) | 0;
40387 hi = (hi + Math.imul(ah5, bh5)) | 0;
40388 lo = (lo + Math.imul(al4, bl6)) | 0;
40389 mid = (mid + Math.imul(al4, bh6)) | 0;
40390 mid = (mid + Math.imul(ah4, bl6)) | 0;
40391 hi = (hi + Math.imul(ah4, bh6)) | 0;
40392 lo = (lo + Math.imul(al3, bl7)) | 0;
40393 mid = (mid + Math.imul(al3, bh7)) | 0;
40394 mid = (mid + Math.imul(ah3, bl7)) | 0;
40395 hi = (hi + Math.imul(ah3, bh7)) | 0;
40396 lo = (lo + Math.imul(al2, bl8)) | 0;
40397 mid = (mid + Math.imul(al2, bh8)) | 0;
40398 mid = (mid + Math.imul(ah2, bl8)) | 0;
40399 hi = (hi + Math.imul(ah2, bh8)) | 0;
40400 lo = (lo + Math.imul(al1, bl9)) | 0;
40401 mid = (mid + Math.imul(al1, bh9)) | 0;
40402 mid = (mid + Math.imul(ah1, bl9)) | 0;
40403 hi = (hi + Math.imul(ah1, bh9)) | 0;
40404 var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40405 c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;
40406 w10 &= 0x3ffffff;
40407 /* k = 11 */
40408 lo = Math.imul(al9, bl2);
40409 mid = Math.imul(al9, bh2);
40410 mid = (mid + Math.imul(ah9, bl2)) | 0;
40411 hi = Math.imul(ah9, bh2);
40412 lo = (lo + Math.imul(al8, bl3)) | 0;
40413 mid = (mid + Math.imul(al8, bh3)) | 0;
40414 mid = (mid + Math.imul(ah8, bl3)) | 0;
40415 hi = (hi + Math.imul(ah8, bh3)) | 0;
40416 lo = (lo + Math.imul(al7, bl4)) | 0;
40417 mid = (mid + Math.imul(al7, bh4)) | 0;
40418 mid = (mid + Math.imul(ah7, bl4)) | 0;
40419 hi = (hi + Math.imul(ah7, bh4)) | 0;
40420 lo = (lo + Math.imul(al6, bl5)) | 0;
40421 mid = (mid + Math.imul(al6, bh5)) | 0;
40422 mid = (mid + Math.imul(ah6, bl5)) | 0;
40423 hi = (hi + Math.imul(ah6, bh5)) | 0;
40424 lo = (lo + Math.imul(al5, bl6)) | 0;
40425 mid = (mid + Math.imul(al5, bh6)) | 0;
40426 mid = (mid + Math.imul(ah5, bl6)) | 0;
40427 hi = (hi + Math.imul(ah5, bh6)) | 0;
40428 lo = (lo + Math.imul(al4, bl7)) | 0;
40429 mid = (mid + Math.imul(al4, bh7)) | 0;
40430 mid = (mid + Math.imul(ah4, bl7)) | 0;
40431 hi = (hi + Math.imul(ah4, bh7)) | 0;
40432 lo = (lo + Math.imul(al3, bl8)) | 0;
40433 mid = (mid + Math.imul(al3, bh8)) | 0;
40434 mid = (mid + Math.imul(ah3, bl8)) | 0;
40435 hi = (hi + Math.imul(ah3, bh8)) | 0;
40436 lo = (lo + Math.imul(al2, bl9)) | 0;
40437 mid = (mid + Math.imul(al2, bh9)) | 0;
40438 mid = (mid + Math.imul(ah2, bl9)) | 0;
40439 hi = (hi + Math.imul(ah2, bh9)) | 0;
40440 var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40441 c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;
40442 w11 &= 0x3ffffff;
40443 /* k = 12 */
40444 lo = Math.imul(al9, bl3);
40445 mid = Math.imul(al9, bh3);
40446 mid = (mid + Math.imul(ah9, bl3)) | 0;
40447 hi = Math.imul(ah9, bh3);
40448 lo = (lo + Math.imul(al8, bl4)) | 0;
40449 mid = (mid + Math.imul(al8, bh4)) | 0;
40450 mid = (mid + Math.imul(ah8, bl4)) | 0;
40451 hi = (hi + Math.imul(ah8, bh4)) | 0;
40452 lo = (lo + Math.imul(al7, bl5)) | 0;
40453 mid = (mid + Math.imul(al7, bh5)) | 0;
40454 mid = (mid + Math.imul(ah7, bl5)) | 0;
40455 hi = (hi + Math.imul(ah7, bh5)) | 0;
40456 lo = (lo + Math.imul(al6, bl6)) | 0;
40457 mid = (mid + Math.imul(al6, bh6)) | 0;
40458 mid = (mid + Math.imul(ah6, bl6)) | 0;
40459 hi = (hi + Math.imul(ah6, bh6)) | 0;
40460 lo = (lo + Math.imul(al5, bl7)) | 0;
40461 mid = (mid + Math.imul(al5, bh7)) | 0;
40462 mid = (mid + Math.imul(ah5, bl7)) | 0;
40463 hi = (hi + Math.imul(ah5, bh7)) | 0;
40464 lo = (lo + Math.imul(al4, bl8)) | 0;
40465 mid = (mid + Math.imul(al4, bh8)) | 0;
40466 mid = (mid + Math.imul(ah4, bl8)) | 0;
40467 hi = (hi + Math.imul(ah4, bh8)) | 0;
40468 lo = (lo + Math.imul(al3, bl9)) | 0;
40469 mid = (mid + Math.imul(al3, bh9)) | 0;
40470 mid = (mid + Math.imul(ah3, bl9)) | 0;
40471 hi = (hi + Math.imul(ah3, bh9)) | 0;
40472 var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40473 c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;
40474 w12 &= 0x3ffffff;
40475 /* k = 13 */
40476 lo = Math.imul(al9, bl4);
40477 mid = Math.imul(al9, bh4);
40478 mid = (mid + Math.imul(ah9, bl4)) | 0;
40479 hi = Math.imul(ah9, bh4);
40480 lo = (lo + Math.imul(al8, bl5)) | 0;
40481 mid = (mid + Math.imul(al8, bh5)) | 0;
40482 mid = (mid + Math.imul(ah8, bl5)) | 0;
40483 hi = (hi + Math.imul(ah8, bh5)) | 0;
40484 lo = (lo + Math.imul(al7, bl6)) | 0;
40485 mid = (mid + Math.imul(al7, bh6)) | 0;
40486 mid = (mid + Math.imul(ah7, bl6)) | 0;
40487 hi = (hi + Math.imul(ah7, bh6)) | 0;
40488 lo = (lo + Math.imul(al6, bl7)) | 0;
40489 mid = (mid + Math.imul(al6, bh7)) | 0;
40490 mid = (mid + Math.imul(ah6, bl7)) | 0;
40491 hi = (hi + Math.imul(ah6, bh7)) | 0;
40492 lo = (lo + Math.imul(al5, bl8)) | 0;
40493 mid = (mid + Math.imul(al5, bh8)) | 0;
40494 mid = (mid + Math.imul(ah5, bl8)) | 0;
40495 hi = (hi + Math.imul(ah5, bh8)) | 0;
40496 lo = (lo + Math.imul(al4, bl9)) | 0;
40497 mid = (mid + Math.imul(al4, bh9)) | 0;
40498 mid = (mid + Math.imul(ah4, bl9)) | 0;
40499 hi = (hi + Math.imul(ah4, bh9)) | 0;
40500 var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40501 c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;
40502 w13 &= 0x3ffffff;
40503 /* k = 14 */
40504 lo = Math.imul(al9, bl5);
40505 mid = Math.imul(al9, bh5);
40506 mid = (mid + Math.imul(ah9, bl5)) | 0;
40507 hi = Math.imul(ah9, bh5);
40508 lo = (lo + Math.imul(al8, bl6)) | 0;
40509 mid = (mid + Math.imul(al8, bh6)) | 0;
40510 mid = (mid + Math.imul(ah8, bl6)) | 0;
40511 hi = (hi + Math.imul(ah8, bh6)) | 0;
40512 lo = (lo + Math.imul(al7, bl7)) | 0;
40513 mid = (mid + Math.imul(al7, bh7)) | 0;
40514 mid = (mid + Math.imul(ah7, bl7)) | 0;
40515 hi = (hi + Math.imul(ah7, bh7)) | 0;
40516 lo = (lo + Math.imul(al6, bl8)) | 0;
40517 mid = (mid + Math.imul(al6, bh8)) | 0;
40518 mid = (mid + Math.imul(ah6, bl8)) | 0;
40519 hi = (hi + Math.imul(ah6, bh8)) | 0;
40520 lo = (lo + Math.imul(al5, bl9)) | 0;
40521 mid = (mid + Math.imul(al5, bh9)) | 0;
40522 mid = (mid + Math.imul(ah5, bl9)) | 0;
40523 hi = (hi + Math.imul(ah5, bh9)) | 0;
40524 var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40525 c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;
40526 w14 &= 0x3ffffff;
40527 /* k = 15 */
40528 lo = Math.imul(al9, bl6);
40529 mid = Math.imul(al9, bh6);
40530 mid = (mid + Math.imul(ah9, bl6)) | 0;
40531 hi = Math.imul(ah9, bh6);
40532 lo = (lo + Math.imul(al8, bl7)) | 0;
40533 mid = (mid + Math.imul(al8, bh7)) | 0;
40534 mid = (mid + Math.imul(ah8, bl7)) | 0;
40535 hi = (hi + Math.imul(ah8, bh7)) | 0;
40536 lo = (lo + Math.imul(al7, bl8)) | 0;
40537 mid = (mid + Math.imul(al7, bh8)) | 0;
40538 mid = (mid + Math.imul(ah7, bl8)) | 0;
40539 hi = (hi + Math.imul(ah7, bh8)) | 0;
40540 lo = (lo + Math.imul(al6, bl9)) | 0;
40541 mid = (mid + Math.imul(al6, bh9)) | 0;
40542 mid = (mid + Math.imul(ah6, bl9)) | 0;
40543 hi = (hi + Math.imul(ah6, bh9)) | 0;
40544 var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40545 c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;
40546 w15 &= 0x3ffffff;
40547 /* k = 16 */
40548 lo = Math.imul(al9, bl7);
40549 mid = Math.imul(al9, bh7);
40550 mid = (mid + Math.imul(ah9, bl7)) | 0;
40551 hi = Math.imul(ah9, bh7);
40552 lo = (lo + Math.imul(al8, bl8)) | 0;
40553 mid = (mid + Math.imul(al8, bh8)) | 0;
40554 mid = (mid + Math.imul(ah8, bl8)) | 0;
40555 hi = (hi + Math.imul(ah8, bh8)) | 0;
40556 lo = (lo + Math.imul(al7, bl9)) | 0;
40557 mid = (mid + Math.imul(al7, bh9)) | 0;
40558 mid = (mid + Math.imul(ah7, bl9)) | 0;
40559 hi = (hi + Math.imul(ah7, bh9)) | 0;
40560 var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40561 c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;
40562 w16 &= 0x3ffffff;
40563 /* k = 17 */
40564 lo = Math.imul(al9, bl8);
40565 mid = Math.imul(al9, bh8);
40566 mid = (mid + Math.imul(ah9, bl8)) | 0;
40567 hi = Math.imul(ah9, bh8);
40568 lo = (lo + Math.imul(al8, bl9)) | 0;
40569 mid = (mid + Math.imul(al8, bh9)) | 0;
40570 mid = (mid + Math.imul(ah8, bl9)) | 0;
40571 hi = (hi + Math.imul(ah8, bh9)) | 0;
40572 var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40573 c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;
40574 w17 &= 0x3ffffff;
40575 /* k = 18 */
40576 lo = Math.imul(al9, bl9);
40577 mid = Math.imul(al9, bh9);
40578 mid = (mid + Math.imul(ah9, bl9)) | 0;
40579 hi = Math.imul(ah9, bh9);
40580 var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
40581 c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;
40582 w18 &= 0x3ffffff;
40583 o[0] = w0;
40584 o[1] = w1;
40585 o[2] = w2;
40586 o[3] = w3;
40587 o[4] = w4;
40588 o[5] = w5;
40589 o[6] = w6;
40590 o[7] = w7;
40591 o[8] = w8;
40592 o[9] = w9;
40593 o[10] = w10;
40594 o[11] = w11;
40595 o[12] = w12;
40596 o[13] = w13;
40597 o[14] = w14;
40598 o[15] = w15;
40599 o[16] = w16;
40600 o[17] = w17;
40601 o[18] = w18;
40602 if (c !== 0) {
40603 o[19] = c;
40604 out.length++;
40605 }
40606 return out;
40607 };
40608
40609 // Polyfill comb
40610 if (!Math.imul) {
40611 comb10MulTo = smallMulTo;
40612 }
40613
40614 function bigMulTo (self, num, out) {
40615 out.negative = num.negative ^ self.negative;
40616 out.length = self.length + num.length;
40617
40618 var carry = 0;
40619 var hncarry = 0;
40620 for (var k = 0; k < out.length - 1; k++) {
40621 // Sum all words with the same `i + j = k` and accumulate `ncarry`,
40622 // note that ncarry could be >= 0x3ffffff
40623 var ncarry = hncarry;
40624 hncarry = 0;
40625 var rword = carry & 0x3ffffff;
40626 var maxJ = Math.min(k, num.length - 1);
40627 for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
40628 var i = k - j;
40629 var a = self.words[i] | 0;
40630 var b = num.words[j] | 0;
40631 var r = a * b;
40632
40633 var lo = r & 0x3ffffff;
40634 ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;
40635 lo = (lo + rword) | 0;
40636 rword = lo & 0x3ffffff;
40637 ncarry = (ncarry + (lo >>> 26)) | 0;
40638
40639 hncarry += ncarry >>> 26;
40640 ncarry &= 0x3ffffff;
40641 }
40642 out.words[k] = rword;
40643 carry = ncarry;
40644 ncarry = hncarry;
40645 }
40646 if (carry !== 0) {
40647 out.words[k] = carry;
40648 } else {
40649 out.length--;
40650 }
40651
40652 return out.strip();
40653 }
40654
40655 function jumboMulTo (self, num, out) {
40656 var fftm = new FFTM();
40657 return fftm.mulp(self, num, out);
40658 }
40659
40660 BN.prototype.mulTo = function mulTo (num, out) {
40661 var res;
40662 var len = this.length + num.length;
40663 if (this.length === 10 && num.length === 10) {
40664 res = comb10MulTo(this, num, out);
40665 } else if (len < 63) {
40666 res = smallMulTo(this, num, out);
40667 } else if (len < 1024) {
40668 res = bigMulTo(this, num, out);
40669 } else {
40670 res = jumboMulTo(this, num, out);
40671 }
40672
40673 return res;
40674 };
40675
40676 // Cooley-Tukey algorithm for FFT
40677 // slightly revisited to rely on looping instead of recursion
40678
40679 function FFTM (x, y) {
40680 this.x = x;
40681 this.y = y;
40682 }
40683
40684 FFTM.prototype.makeRBT = function makeRBT (N) {
40685 var t = new Array(N);
40686 var l = BN.prototype._countBits(N) - 1;
40687 for (var i = 0; i < N; i++) {
40688 t[i] = this.revBin(i, l, N);
40689 }
40690
40691 return t;
40692 };
40693
40694 // Returns binary-reversed representation of `x`
40695 FFTM.prototype.revBin = function revBin (x, l, N) {
40696 if (x === 0 || x === N - 1) return x;
40697
40698 var rb = 0;
40699 for (var i = 0; i < l; i++) {
40700 rb |= (x & 1) << (l - i - 1);
40701 x >>= 1;
40702 }
40703
40704 return rb;
40705 };
40706
40707 // Performs "tweedling" phase, therefore 'emulating'
40708 // behaviour of the recursive algorithm
40709 FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {
40710 for (var i = 0; i < N; i++) {
40711 rtws[i] = rws[rbt[i]];
40712 itws[i] = iws[rbt[i]];
40713 }
40714 };
40715
40716 FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {
40717 this.permute(rbt, rws, iws, rtws, itws, N);
40718
40719 for (var s = 1; s < N; s <<= 1) {
40720 var l = s << 1;
40721
40722 var rtwdf = Math.cos(2 * Math.PI / l);
40723 var itwdf = Math.sin(2 * Math.PI / l);
40724
40725 for (var p = 0; p < N; p += l) {
40726 var rtwdf_ = rtwdf;
40727 var itwdf_ = itwdf;
40728
40729 for (var j = 0; j < s; j++) {
40730 var re = rtws[p + j];
40731 var ie = itws[p + j];
40732
40733 var ro = rtws[p + j + s];
40734 var io = itws[p + j + s];
40735
40736 var rx = rtwdf_ * ro - itwdf_ * io;
40737
40738 io = rtwdf_ * io + itwdf_ * ro;
40739 ro = rx;
40740
40741 rtws[p + j] = re + ro;
40742 itws[p + j] = ie + io;
40743
40744 rtws[p + j + s] = re - ro;
40745 itws[p + j + s] = ie - io;
40746
40747 /* jshint maxdepth : false */
40748 if (j !== l) {
40749 rx = rtwdf * rtwdf_ - itwdf * itwdf_;
40750
40751 itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
40752 rtwdf_ = rx;
40753 }
40754 }
40755 }
40756 }
40757 };
40758
40759 FFTM.prototype.guessLen13b = function guessLen13b (n, m) {
40760 var N = Math.max(m, n) | 1;
40761 var odd = N & 1;
40762 var i = 0;
40763 for (N = N / 2 | 0; N; N = N >>> 1) {
40764 i++;
40765 }
40766
40767 return 1 << i + 1 + odd;
40768 };
40769
40770 FFTM.prototype.conjugate = function conjugate (rws, iws, N) {
40771 if (N <= 1) return;
40772
40773 for (var i = 0; i < N / 2; i++) {
40774 var t = rws[i];
40775
40776 rws[i] = rws[N - i - 1];
40777 rws[N - i - 1] = t;
40778
40779 t = iws[i];
40780
40781 iws[i] = -iws[N - i - 1];
40782 iws[N - i - 1] = -t;
40783 }
40784 };
40785
40786 FFTM.prototype.normalize13b = function normalize13b (ws, N) {
40787 var carry = 0;
40788 for (var i = 0; i < N / 2; i++) {
40789 var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +
40790 Math.round(ws[2 * i] / N) +
40791 carry;
40792
40793 ws[i] = w & 0x3ffffff;
40794
40795 if (w < 0x4000000) {
40796 carry = 0;
40797 } else {
40798 carry = w / 0x4000000 | 0;
40799 }
40800 }
40801
40802 return ws;
40803 };
40804
40805 FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {
40806 var carry = 0;
40807 for (var i = 0; i < len; i++) {
40808 carry = carry + (ws[i] | 0);
40809
40810 rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;
40811 rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;
40812 }
40813
40814 // Pad with zeroes
40815 for (i = 2 * len; i < N; ++i) {
40816 rws[i] = 0;
40817 }
40818
40819 assert(carry === 0);
40820 assert((carry & ~0x1fff) === 0);
40821 };
40822
40823 FFTM.prototype.stub = function stub (N) {
40824 var ph = new Array(N);
40825 for (var i = 0; i < N; i++) {
40826 ph[i] = 0;
40827 }
40828
40829 return ph;
40830 };
40831
40832 FFTM.prototype.mulp = function mulp (x, y, out) {
40833 var N = 2 * this.guessLen13b(x.length, y.length);
40834
40835 var rbt = this.makeRBT(N);
40836
40837 var _ = this.stub(N);
40838
40839 var rws = new Array(N);
40840 var rwst = new Array(N);
40841 var iwst = new Array(N);
40842
40843 var nrws = new Array(N);
40844 var nrwst = new Array(N);
40845 var niwst = new Array(N);
40846
40847 var rmws = out.words;
40848 rmws.length = N;
40849
40850 this.convert13b(x.words, x.length, rws, N);
40851 this.convert13b(y.words, y.length, nrws, N);
40852
40853 this.transform(rws, _, rwst, iwst, N, rbt);
40854 this.transform(nrws, _, nrwst, niwst, N, rbt);
40855
40856 for (var i = 0; i < N; i++) {
40857 var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
40858 iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
40859 rwst[i] = rx;
40860 }
40861
40862 this.conjugate(rwst, iwst, N);
40863 this.transform(rwst, iwst, rmws, _, N, rbt);
40864 this.conjugate(rmws, _, N);
40865 this.normalize13b(rmws, N);
40866
40867 out.negative = x.negative ^ y.negative;
40868 out.length = x.length + y.length;
40869 return out.strip();
40870 };
40871
40872 // Multiply `this` by `num`
40873 BN.prototype.mul = function mul (num) {
40874 var out = new BN(null);
40875 out.words = new Array(this.length + num.length);
40876 return this.mulTo(num, out);
40877 };
40878
40879 // Multiply employing FFT
40880 BN.prototype.mulf = function mulf (num) {
40881 var out = new BN(null);
40882 out.words = new Array(this.length + num.length);
40883 return jumboMulTo(this, num, out);
40884 };
40885
40886 // In-place Multiplication
40887 BN.prototype.imul = function imul (num) {
40888 return this.clone().mulTo(num, this);
40889 };
40890
40891 BN.prototype.imuln = function imuln (num) {
40892 assert(typeof num === 'number');
40893 assert(num < 0x4000000);
40894
40895 // Carry
40896 var carry = 0;
40897 for (var i = 0; i < this.length; i++) {
40898 var w = (this.words[i] | 0) * num;
40899 var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);
40900 carry >>= 26;
40901 carry += (w / 0x4000000) | 0;
40902 // NOTE: lo is 27bit maximum
40903 carry += lo >>> 26;
40904 this.words[i] = lo & 0x3ffffff;
40905 }
40906
40907 if (carry !== 0) {
40908 this.words[i] = carry;
40909 this.length++;
40910 }
40911
40912 return this;
40913 };
40914
40915 BN.prototype.muln = function muln (num) {
40916 return this.clone().imuln(num);
40917 };
40918
40919 // `this` * `this`
40920 BN.prototype.sqr = function sqr () {
40921 return this.mul(this);
40922 };
40923
40924 // `this` * `this` in-place
40925 BN.prototype.isqr = function isqr () {
40926 return this.imul(this.clone());
40927 };
40928
40929 // Math.pow(`this`, `num`)
40930 BN.prototype.pow = function pow (num) {
40931 var w = toBitArray(num);
40932 if (w.length === 0) return new BN(1);
40933
40934 // Skip leading zeroes
40935 var res = this;
40936 for (var i = 0; i < w.length; i++, res = res.sqr()) {
40937 if (w[i] !== 0) break;
40938 }
40939
40940 if (++i < w.length) {
40941 for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
40942 if (w[i] === 0) continue;
40943
40944 res = res.mul(q);
40945 }
40946 }
40947
40948 return res;
40949 };
40950
40951 // Shift-left in-place
40952 BN.prototype.iushln = function iushln (bits) {
40953 assert(typeof bits === 'number' && bits >= 0);
40954 var r = bits % 26;
40955 var s = (bits - r) / 26;
40956 var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);
40957 var i;
40958
40959 if (r !== 0) {
40960 var carry = 0;
40961
40962 for (i = 0; i < this.length; i++) {
40963 var newCarry = this.words[i] & carryMask;
40964 var c = ((this.words[i] | 0) - newCarry) << r;
40965 this.words[i] = c | carry;
40966 carry = newCarry >>> (26 - r);
40967 }
40968
40969 if (carry) {
40970 this.words[i] = carry;
40971 this.length++;
40972 }
40973 }
40974
40975 if (s !== 0) {
40976 for (i = this.length - 1; i >= 0; i--) {
40977 this.words[i + s] = this.words[i];
40978 }
40979
40980 for (i = 0; i < s; i++) {
40981 this.words[i] = 0;
40982 }
40983
40984 this.length += s;
40985 }
40986
40987 return this.strip();
40988 };
40989
40990 BN.prototype.ishln = function ishln (bits) {
40991 // TODO(indutny): implement me
40992 assert(this.negative === 0);
40993 return this.iushln(bits);
40994 };
40995
40996 // Shift-right in-place
40997 // NOTE: `hint` is a lowest bit before trailing zeroes
40998 // NOTE: if `extended` is present - it will be filled with destroyed bits
40999 BN.prototype.iushrn = function iushrn (bits, hint, extended) {
41000 assert(typeof bits === 'number' && bits >= 0);
41001 var h;
41002 if (hint) {
41003 h = (hint - (hint % 26)) / 26;
41004 } else {
41005 h = 0;
41006 }
41007
41008 var r = bits % 26;
41009 var s = Math.min((bits - r) / 26, this.length);
41010 var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
41011 var maskedWords = extended;
41012
41013 h -= s;
41014 h = Math.max(0, h);
41015
41016 // Extended mode, copy masked part
41017 if (maskedWords) {
41018 for (var i = 0; i < s; i++) {
41019 maskedWords.words[i] = this.words[i];
41020 }
41021 maskedWords.length = s;
41022 }
41023
41024 if (s === 0) {
41025 // No-op, we should not move anything at all
41026 } else if (this.length > s) {
41027 this.length -= s;
41028 for (i = 0; i < this.length; i++) {
41029 this.words[i] = this.words[i + s];
41030 }
41031 } else {
41032 this.words[0] = 0;
41033 this.length = 1;
41034 }
41035
41036 var carry = 0;
41037 for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
41038 var word = this.words[i] | 0;
41039 this.words[i] = (carry << (26 - r)) | (word >>> r);
41040 carry = word & mask;
41041 }
41042
41043 // Push carried bits as a mask
41044 if (maskedWords && carry !== 0) {
41045 maskedWords.words[maskedWords.length++] = carry;
41046 }
41047
41048 if (this.length === 0) {
41049 this.words[0] = 0;
41050 this.length = 1;
41051 }
41052
41053 return this.strip();
41054 };
41055
41056 BN.prototype.ishrn = function ishrn (bits, hint, extended) {
41057 // TODO(indutny): implement me
41058 assert(this.negative === 0);
41059 return this.iushrn(bits, hint, extended);
41060 };
41061
41062 // Shift-left
41063 BN.prototype.shln = function shln (bits) {
41064 return this.clone().ishln(bits);
41065 };
41066
41067 BN.prototype.ushln = function ushln (bits) {
41068 return this.clone().iushln(bits);
41069 };
41070
41071 // Shift-right
41072 BN.prototype.shrn = function shrn (bits) {
41073 return this.clone().ishrn(bits);
41074 };
41075
41076 BN.prototype.ushrn = function ushrn (bits) {
41077 return this.clone().iushrn(bits);
41078 };
41079
41080 // Test if n bit is set
41081 BN.prototype.testn = function testn (bit) {
41082 assert(typeof bit === 'number' && bit >= 0);
41083 var r = bit % 26;
41084 var s = (bit - r) / 26;
41085 var q = 1 << r;
41086
41087 // Fast case: bit is much higher than all existing words
41088 if (this.length <= s) return false;
41089
41090 // Check bit and return
41091 var w = this.words[s];
41092
41093 return !!(w & q);
41094 };
41095
41096 // Return only lowers bits of number (in-place)
41097 BN.prototype.imaskn = function imaskn (bits) {
41098 assert(typeof bits === 'number' && bits >= 0);
41099 var r = bits % 26;
41100 var s = (bits - r) / 26;
41101
41102 assert(this.negative === 0, 'imaskn works only with positive numbers');
41103
41104 if (this.length <= s) {
41105 return this;
41106 }
41107
41108 if (r !== 0) {
41109 s++;
41110 }
41111 this.length = Math.min(s, this.length);
41112
41113 if (r !== 0) {
41114 var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
41115 this.words[this.length - 1] &= mask;
41116 }
41117
41118 return this.strip();
41119 };
41120
41121 // Return only lowers bits of number
41122 BN.prototype.maskn = function maskn (bits) {
41123 return this.clone().imaskn(bits);
41124 };
41125
41126 // Add plain number `num` to `this`
41127 BN.prototype.iaddn = function iaddn (num) {
41128 assert(typeof num === 'number');
41129 assert(num < 0x4000000);
41130 if (num < 0) return this.isubn(-num);
41131
41132 // Possible sign change
41133 if (this.negative !== 0) {
41134 if (this.length === 1 && (this.words[0] | 0) < num) {
41135 this.words[0] = num - (this.words[0] | 0);
41136 this.negative = 0;
41137 return this;
41138 }
41139
41140 this.negative = 0;
41141 this.isubn(num);
41142 this.negative = 1;
41143 return this;
41144 }
41145
41146 // Add without checks
41147 return this._iaddn(num);
41148 };
41149
41150 BN.prototype._iaddn = function _iaddn (num) {
41151 this.words[0] += num;
41152
41153 // Carry
41154 for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {
41155 this.words[i] -= 0x4000000;
41156 if (i === this.length - 1) {
41157 this.words[i + 1] = 1;
41158 } else {
41159 this.words[i + 1]++;
41160 }
41161 }
41162 this.length = Math.max(this.length, i + 1);
41163
41164 return this;
41165 };
41166
41167 // Subtract plain number `num` from `this`
41168 BN.prototype.isubn = function isubn (num) {
41169 assert(typeof num === 'number');
41170 assert(num < 0x4000000);
41171 if (num < 0) return this.iaddn(-num);
41172
41173 if (this.negative !== 0) {
41174 this.negative = 0;
41175 this.iaddn(num);
41176 this.negative = 1;
41177 return this;
41178 }
41179
41180 this.words[0] -= num;
41181
41182 if (this.length === 1 && this.words[0] < 0) {
41183 this.words[0] = -this.words[0];
41184 this.negative = 1;
41185 } else {
41186 // Carry
41187 for (var i = 0; i < this.length && this.words[i] < 0; i++) {
41188 this.words[i] += 0x4000000;
41189 this.words[i + 1] -= 1;
41190 }
41191 }
41192
41193 return this.strip();
41194 };
41195
41196 BN.prototype.addn = function addn (num) {
41197 return this.clone().iaddn(num);
41198 };
41199
41200 BN.prototype.subn = function subn (num) {
41201 return this.clone().isubn(num);
41202 };
41203
41204 BN.prototype.iabs = function iabs () {
41205 this.negative = 0;
41206
41207 return this;
41208 };
41209
41210 BN.prototype.abs = function abs () {
41211 return this.clone().iabs();
41212 };
41213
41214 BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {
41215 var len = num.length + shift;
41216 var i;
41217
41218 this._expand(len);
41219
41220 var w;
41221 var carry = 0;
41222 for (i = 0; i < num.length; i++) {
41223 w = (this.words[i + shift] | 0) + carry;
41224 var right = (num.words[i] | 0) * mul;
41225 w -= right & 0x3ffffff;
41226 carry = (w >> 26) - ((right / 0x4000000) | 0);
41227 this.words[i + shift] = w & 0x3ffffff;
41228 }
41229 for (; i < this.length - shift; i++) {
41230 w = (this.words[i + shift] | 0) + carry;
41231 carry = w >> 26;
41232 this.words[i + shift] = w & 0x3ffffff;
41233 }
41234
41235 if (carry === 0) return this.strip();
41236
41237 // Subtraction overflow
41238 assert(carry === -1);
41239 carry = 0;
41240 for (i = 0; i < this.length; i++) {
41241 w = -(this.words[i] | 0) + carry;
41242 carry = w >> 26;
41243 this.words[i] = w & 0x3ffffff;
41244 }
41245 this.negative = 1;
41246
41247 return this.strip();
41248 };
41249
41250 BN.prototype._wordDiv = function _wordDiv (num, mode) {
41251 var shift = this.length - num.length;
41252
41253 var a = this.clone();
41254 var b = num;
41255
41256 // Normalize
41257 var bhi = b.words[b.length - 1] | 0;
41258 var bhiBits = this._countBits(bhi);
41259 shift = 26 - bhiBits;
41260 if (shift !== 0) {
41261 b = b.ushln(shift);
41262 a.iushln(shift);
41263 bhi = b.words[b.length - 1] | 0;
41264 }
41265
41266 // Initialize quotient
41267 var m = a.length - b.length;
41268 var q;
41269
41270 if (mode !== 'mod') {
41271 q = new BN(null);
41272 q.length = m + 1;
41273 q.words = new Array(q.length);
41274 for (var i = 0; i < q.length; i++) {
41275 q.words[i] = 0;
41276 }
41277 }
41278
41279 var diff = a.clone()._ishlnsubmul(b, 1, m);
41280 if (diff.negative === 0) {
41281 a = diff;
41282 if (q) {
41283 q.words[m] = 1;
41284 }
41285 }
41286
41287 for (var j = m - 1; j >= 0; j--) {
41288 var qj = (a.words[b.length + j] | 0) * 0x4000000 +
41289 (a.words[b.length + j - 1] | 0);
41290
41291 // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max
41292 // (0x7ffffff)
41293 qj = Math.min((qj / bhi) | 0, 0x3ffffff);
41294
41295 a._ishlnsubmul(b, qj, j);
41296 while (a.negative !== 0) {
41297 qj--;
41298 a.negative = 0;
41299 a._ishlnsubmul(b, 1, j);
41300 if (!a.isZero()) {
41301 a.negative ^= 1;
41302 }
41303 }
41304 if (q) {
41305 q.words[j] = qj;
41306 }
41307 }
41308 if (q) {
41309 q.strip();
41310 }
41311 a.strip();
41312
41313 // Denormalize
41314 if (mode !== 'div' && shift !== 0) {
41315 a.iushrn(shift);
41316 }
41317
41318 return {
41319 div: q || null,
41320 mod: a
41321 };
41322 };
41323
41324 // NOTE: 1) `mode` can be set to `mod` to request mod only,
41325 // to `div` to request div only, or be absent to
41326 // request both div & mod
41327 // 2) `positive` is true if unsigned mod is requested
41328 BN.prototype.divmod = function divmod (num, mode, positive) {
41329 assert(!num.isZero());
41330
41331 if (this.isZero()) {
41332 return {
41333 div: new BN(0),
41334 mod: new BN(0)
41335 };
41336 }
41337
41338 var div, mod, res;
41339 if (this.negative !== 0 && num.negative === 0) {
41340 res = this.neg().divmod(num, mode);
41341
41342 if (mode !== 'mod') {
41343 div = res.div.neg();
41344 }
41345
41346 if (mode !== 'div') {
41347 mod = res.mod.neg();
41348 if (positive && mod.negative !== 0) {
41349 mod.iadd(num);
41350 }
41351 }
41352
41353 return {
41354 div: div,
41355 mod: mod
41356 };
41357 }
41358
41359 if (this.negative === 0 && num.negative !== 0) {
41360 res = this.divmod(num.neg(), mode);
41361
41362 if (mode !== 'mod') {
41363 div = res.div.neg();
41364 }
41365
41366 return {
41367 div: div,
41368 mod: res.mod
41369 };
41370 }
41371
41372 if ((this.negative & num.negative) !== 0) {
41373 res = this.neg().divmod(num.neg(), mode);
41374
41375 if (mode !== 'div') {
41376 mod = res.mod.neg();
41377 if (positive && mod.negative !== 0) {
41378 mod.isub(num);
41379 }
41380 }
41381
41382 return {
41383 div: res.div,
41384 mod: mod
41385 };
41386 }
41387
41388 // Both numbers are positive at this point
41389
41390 // Strip both numbers to approximate shift value
41391 if (num.length > this.length || this.cmp(num) < 0) {
41392 return {
41393 div: new BN(0),
41394 mod: this
41395 };
41396 }
41397
41398 // Very short reduction
41399 if (num.length === 1) {
41400 if (mode === 'div') {
41401 return {
41402 div: this.divn(num.words[0]),
41403 mod: null
41404 };
41405 }
41406
41407 if (mode === 'mod') {
41408 return {
41409 div: null,
41410 mod: new BN(this.modn(num.words[0]))
41411 };
41412 }
41413
41414 return {
41415 div: this.divn(num.words[0]),
41416 mod: new BN(this.modn(num.words[0]))
41417 };
41418 }
41419
41420 return this._wordDiv(num, mode);
41421 };
41422
41423 // Find `this` / `num`
41424 BN.prototype.div = function div (num) {
41425 return this.divmod(num, 'div', false).div;
41426 };
41427
41428 // Find `this` % `num`
41429 BN.prototype.mod = function mod (num) {
41430 return this.divmod(num, 'mod', false).mod;
41431 };
41432
41433 BN.prototype.umod = function umod (num) {
41434 return this.divmod(num, 'mod', true).mod;
41435 };
41436
41437 // Find Round(`this` / `num`)
41438 BN.prototype.divRound = function divRound (num) {
41439 var dm = this.divmod(num);
41440
41441 // Fast case - exact division
41442 if (dm.mod.isZero()) return dm.div;
41443
41444 var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
41445
41446 var half = num.ushrn(1);
41447 var r2 = num.andln(1);
41448 var cmp = mod.cmp(half);
41449
41450 // Round down
41451 if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
41452
41453 // Round up
41454 return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
41455 };
41456
41457 BN.prototype.modn = function modn (num) {
41458 assert(num <= 0x3ffffff);
41459 var p = (1 << 26) % num;
41460
41461 var acc = 0;
41462 for (var i = this.length - 1; i >= 0; i--) {
41463 acc = (p * acc + (this.words[i] | 0)) % num;
41464 }
41465
41466 return acc;
41467 };
41468
41469 // In-place division by number
41470 BN.prototype.idivn = function idivn (num) {
41471 assert(num <= 0x3ffffff);
41472
41473 var carry = 0;
41474 for (var i = this.length - 1; i >= 0; i--) {
41475 var w = (this.words[i] | 0) + carry * 0x4000000;
41476 this.words[i] = (w / num) | 0;
41477 carry = w % num;
41478 }
41479
41480 return this.strip();
41481 };
41482
41483 BN.prototype.divn = function divn (num) {
41484 return this.clone().idivn(num);
41485 };
41486
41487 BN.prototype.egcd = function egcd (p) {
41488 assert(p.negative === 0);
41489 assert(!p.isZero());
41490
41491 var x = this;
41492 var y = p.clone();
41493
41494 if (x.negative !== 0) {
41495 x = x.umod(p);
41496 } else {
41497 x = x.clone();
41498 }
41499
41500 // A * x + B * y = x
41501 var A = new BN(1);
41502 var B = new BN(0);
41503
41504 // C * x + D * y = y
41505 var C = new BN(0);
41506 var D = new BN(1);
41507
41508 var g = 0;
41509
41510 while (x.isEven() && y.isEven()) {
41511 x.iushrn(1);
41512 y.iushrn(1);
41513 ++g;
41514 }
41515
41516 var yp = y.clone();
41517 var xp = x.clone();
41518
41519 while (!x.isZero()) {
41520 for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
41521 if (i > 0) {
41522 x.iushrn(i);
41523 while (i-- > 0) {
41524 if (A.isOdd() || B.isOdd()) {
41525 A.iadd(yp);
41526 B.isub(xp);
41527 }
41528
41529 A.iushrn(1);
41530 B.iushrn(1);
41531 }
41532 }
41533
41534 for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
41535 if (j > 0) {
41536 y.iushrn(j);
41537 while (j-- > 0) {
41538 if (C.isOdd() || D.isOdd()) {
41539 C.iadd(yp);
41540 D.isub(xp);
41541 }
41542
41543 C.iushrn(1);
41544 D.iushrn(1);
41545 }
41546 }
41547
41548 if (x.cmp(y) >= 0) {
41549 x.isub(y);
41550 A.isub(C);
41551 B.isub(D);
41552 } else {
41553 y.isub(x);
41554 C.isub(A);
41555 D.isub(B);
41556 }
41557 }
41558
41559 return {
41560 a: C,
41561 b: D,
41562 gcd: y.iushln(g)
41563 };
41564 };
41565
41566 // This is reduced incarnation of the binary EEA
41567 // above, designated to invert members of the
41568 // _prime_ fields F(p) at a maximal speed
41569 BN.prototype._invmp = function _invmp (p) {
41570 assert(p.negative === 0);
41571 assert(!p.isZero());
41572
41573 var a = this;
41574 var b = p.clone();
41575
41576 if (a.negative !== 0) {
41577 a = a.umod(p);
41578 } else {
41579 a = a.clone();
41580 }
41581
41582 var x1 = new BN(1);
41583 var x2 = new BN(0);
41584
41585 var delta = b.clone();
41586
41587 while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
41588 for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
41589 if (i > 0) {
41590 a.iushrn(i);
41591 while (i-- > 0) {
41592 if (x1.isOdd()) {
41593 x1.iadd(delta);
41594 }
41595
41596 x1.iushrn(1);
41597 }
41598 }
41599
41600 for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
41601 if (j > 0) {
41602 b.iushrn(j);
41603 while (j-- > 0) {
41604 if (x2.isOdd()) {
41605 x2.iadd(delta);
41606 }
41607
41608 x2.iushrn(1);
41609 }
41610 }
41611
41612 if (a.cmp(b) >= 0) {
41613 a.isub(b);
41614 x1.isub(x2);
41615 } else {
41616 b.isub(a);
41617 x2.isub(x1);
41618 }
41619 }
41620
41621 var res;
41622 if (a.cmpn(1) === 0) {
41623 res = x1;
41624 } else {
41625 res = x2;
41626 }
41627
41628 if (res.cmpn(0) < 0) {
41629 res.iadd(p);
41630 }
41631
41632 return res;
41633 };
41634
41635 BN.prototype.gcd = function gcd (num) {
41636 if (this.isZero()) return num.abs();
41637 if (num.isZero()) return this.abs();
41638
41639 var a = this.clone();
41640 var b = num.clone();
41641 a.negative = 0;
41642 b.negative = 0;
41643
41644 // Remove common factor of two
41645 for (var shift = 0; a.isEven() && b.isEven(); shift++) {
41646 a.iushrn(1);
41647 b.iushrn(1);
41648 }
41649
41650 do {
41651 while (a.isEven()) {
41652 a.iushrn(1);
41653 }
41654 while (b.isEven()) {
41655 b.iushrn(1);
41656 }
41657
41658 var r = a.cmp(b);
41659 if (r < 0) {
41660 // Swap `a` and `b` to make `a` always bigger than `b`
41661 var t = a;
41662 a = b;
41663 b = t;
41664 } else if (r === 0 || b.cmpn(1) === 0) {
41665 break;
41666 }
41667
41668 a.isub(b);
41669 } while (true);
41670
41671 return b.iushln(shift);
41672 };
41673
41674 // Invert number in the field F(num)
41675 BN.prototype.invm = function invm (num) {
41676 return this.egcd(num).a.umod(num);
41677 };
41678
41679 BN.prototype.isEven = function isEven () {
41680 return (this.words[0] & 1) === 0;
41681 };
41682
41683 BN.prototype.isOdd = function isOdd () {
41684 return (this.words[0] & 1) === 1;
41685 };
41686
41687 // And first word and num
41688 BN.prototype.andln = function andln (num) {
41689 return this.words[0] & num;
41690 };
41691
41692 // Increment at the bit position in-line
41693 BN.prototype.bincn = function bincn (bit) {
41694 assert(typeof bit === 'number');
41695 var r = bit % 26;
41696 var s = (bit - r) / 26;
41697 var q = 1 << r;
41698
41699 // Fast case: bit is much higher than all existing words
41700 if (this.length <= s) {
41701 this._expand(s + 1);
41702 this.words[s] |= q;
41703 return this;
41704 }
41705
41706 // Add bit and propagate, if needed
41707 var carry = q;
41708 for (var i = s; carry !== 0 && i < this.length; i++) {
41709 var w = this.words[i] | 0;
41710 w += carry;
41711 carry = w >>> 26;
41712 w &= 0x3ffffff;
41713 this.words[i] = w;
41714 }
41715 if (carry !== 0) {
41716 this.words[i] = carry;
41717 this.length++;
41718 }
41719 return this;
41720 };
41721
41722 BN.prototype.isZero = function isZero () {
41723 return this.length === 1 && this.words[0] === 0;
41724 };
41725
41726 BN.prototype.cmpn = function cmpn (num) {
41727 var negative = num < 0;
41728
41729 if (this.negative !== 0 && !negative) return -1;
41730 if (this.negative === 0 && negative) return 1;
41731
41732 this.strip();
41733
41734 var res;
41735 if (this.length > 1) {
41736 res = 1;
41737 } else {
41738 if (negative) {
41739 num = -num;
41740 }
41741
41742 assert(num <= 0x3ffffff, 'Number is too big');
41743
41744 var w = this.words[0] | 0;
41745 res = w === num ? 0 : w < num ? -1 : 1;
41746 }
41747 if (this.negative !== 0) return -res | 0;
41748 return res;
41749 };
41750
41751 // Compare two numbers and return:
41752 // 1 - if `this` > `num`
41753 // 0 - if `this` == `num`
41754 // -1 - if `this` < `num`
41755 BN.prototype.cmp = function cmp (num) {
41756 if (this.negative !== 0 && num.negative === 0) return -1;
41757 if (this.negative === 0 && num.negative !== 0) return 1;
41758
41759 var res = this.ucmp(num);
41760 if (this.negative !== 0) return -res | 0;
41761 return res;
41762 };
41763
41764 // Unsigned comparison
41765 BN.prototype.ucmp = function ucmp (num) {
41766 // At this point both numbers have the same sign
41767 if (this.length > num.length) return 1;
41768 if (this.length < num.length) return -1;
41769
41770 var res = 0;
41771 for (var i = this.length - 1; i >= 0; i--) {
41772 var a = this.words[i] | 0;
41773 var b = num.words[i] | 0;
41774
41775 if (a === b) continue;
41776 if (a < b) {
41777 res = -1;
41778 } else if (a > b) {
41779 res = 1;
41780 }
41781 break;
41782 }
41783 return res;
41784 };
41785
41786 BN.prototype.gtn = function gtn (num) {
41787 return this.cmpn(num) === 1;
41788 };
41789
41790 BN.prototype.gt = function gt (num) {
41791 return this.cmp(num) === 1;
41792 };
41793
41794 BN.prototype.gten = function gten (num) {
41795 return this.cmpn(num) >= 0;
41796 };
41797
41798 BN.prototype.gte = function gte (num) {
41799 return this.cmp(num) >= 0;
41800 };
41801
41802 BN.prototype.ltn = function ltn (num) {
41803 return this.cmpn(num) === -1;
41804 };
41805
41806 BN.prototype.lt = function lt (num) {
41807 return this.cmp(num) === -1;
41808 };
41809
41810 BN.prototype.lten = function lten (num) {
41811 return this.cmpn(num) <= 0;
41812 };
41813
41814 BN.prototype.lte = function lte (num) {
41815 return this.cmp(num) <= 0;
41816 };
41817
41818 BN.prototype.eqn = function eqn (num) {
41819 return this.cmpn(num) === 0;
41820 };
41821
41822 BN.prototype.eq = function eq (num) {
41823 return this.cmp(num) === 0;
41824 };
41825
41826 //
41827 // A reduce context, could be using montgomery or something better, depending
41828 // on the `m` itself.
41829 //
41830 BN.red = function red (num) {
41831 return new Red(num);
41832 };
41833
41834 BN.prototype.toRed = function toRed (ctx) {
41835 assert(!this.red, 'Already a number in reduction context');
41836 assert(this.negative === 0, 'red works only with positives');
41837 return ctx.convertTo(this)._forceRed(ctx);
41838 };
41839
41840 BN.prototype.fromRed = function fromRed () {
41841 assert(this.red, 'fromRed works only with numbers in reduction context');
41842 return this.red.convertFrom(this);
41843 };
41844
41845 BN.prototype._forceRed = function _forceRed (ctx) {
41846 this.red = ctx;
41847 return this;
41848 };
41849
41850 BN.prototype.forceRed = function forceRed (ctx) {
41851 assert(!this.red, 'Already a number in reduction context');
41852 return this._forceRed(ctx);
41853 };
41854
41855 BN.prototype.redAdd = function redAdd (num) {
41856 assert(this.red, 'redAdd works only with red numbers');
41857 return this.red.add(this, num);
41858 };
41859
41860 BN.prototype.redIAdd = function redIAdd (num) {
41861 assert(this.red, 'redIAdd works only with red numbers');
41862 return this.red.iadd(this, num);
41863 };
41864
41865 BN.prototype.redSub = function redSub (num) {
41866 assert(this.red, 'redSub works only with red numbers');
41867 return this.red.sub(this, num);
41868 };
41869
41870 BN.prototype.redISub = function redISub (num) {
41871 assert(this.red, 'redISub works only with red numbers');
41872 return this.red.isub(this, num);
41873 };
41874
41875 BN.prototype.redShl = function redShl (num) {
41876 assert(this.red, 'redShl works only with red numbers');
41877 return this.red.shl(this, num);
41878 };
41879
41880 BN.prototype.redMul = function redMul (num) {
41881 assert(this.red, 'redMul works only with red numbers');
41882 this.red._verify2(this, num);
41883 return this.red.mul(this, num);
41884 };
41885
41886 BN.prototype.redIMul = function redIMul (num) {
41887 assert(this.red, 'redMul works only with red numbers');
41888 this.red._verify2(this, num);
41889 return this.red.imul(this, num);
41890 };
41891
41892 BN.prototype.redSqr = function redSqr () {
41893 assert(this.red, 'redSqr works only with red numbers');
41894 this.red._verify1(this);
41895 return this.red.sqr(this);
41896 };
41897
41898 BN.prototype.redISqr = function redISqr () {
41899 assert(this.red, 'redISqr works only with red numbers');
41900 this.red._verify1(this);
41901 return this.red.isqr(this);
41902 };
41903
41904 // Square root over p
41905 BN.prototype.redSqrt = function redSqrt () {
41906 assert(this.red, 'redSqrt works only with red numbers');
41907 this.red._verify1(this);
41908 return this.red.sqrt(this);
41909 };
41910
41911 BN.prototype.redInvm = function redInvm () {
41912 assert(this.red, 'redInvm works only with red numbers');
41913 this.red._verify1(this);
41914 return this.red.invm(this);
41915 };
41916
41917 // Return negative clone of `this` % `red modulo`
41918 BN.prototype.redNeg = function redNeg () {
41919 assert(this.red, 'redNeg works only with red numbers');
41920 this.red._verify1(this);
41921 return this.red.neg(this);
41922 };
41923
41924 BN.prototype.redPow = function redPow (num) {
41925 assert(this.red && !num.red, 'redPow(normalNum)');
41926 this.red._verify1(this);
41927 return this.red.pow(this, num);
41928 };
41929
41930 // Prime numbers with efficient reduction
41931 var primes = {
41932 k256: null,
41933 p224: null,
41934 p192: null,
41935 p25519: null
41936 };
41937
41938 // Pseudo-Mersenne prime
41939 function MPrime (name, p) {
41940 // P = 2 ^ N - K
41941 this.name = name;
41942 this.p = new BN(p, 16);
41943 this.n = this.p.bitLength();
41944 this.k = new BN(1).iushln(this.n).isub(this.p);
41945
41946 this.tmp = this._tmp();
41947 }
41948
41949 MPrime.prototype._tmp = function _tmp () {
41950 var tmp = new BN(null);
41951 tmp.words = new Array(Math.ceil(this.n / 13));
41952 return tmp;
41953 };
41954
41955 MPrime.prototype.ireduce = function ireduce (num) {
41956 // Assumes that `num` is less than `P^2`
41957 // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)
41958 var r = num;
41959 var rlen;
41960
41961 do {
41962 this.split(r, this.tmp);
41963 r = this.imulK(r);
41964 r = r.iadd(this.tmp);
41965 rlen = r.bitLength();
41966 } while (rlen > this.n);
41967
41968 var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
41969 if (cmp === 0) {
41970 r.words[0] = 0;
41971 r.length = 1;
41972 } else if (cmp > 0) {
41973 r.isub(this.p);
41974 } else {
41975 r.strip();
41976 }
41977
41978 return r;
41979 };
41980
41981 MPrime.prototype.split = function split (input, out) {
41982 input.iushrn(this.n, 0, out);
41983 };
41984
41985 MPrime.prototype.imulK = function imulK (num) {
41986 return num.imul(this.k);
41987 };
41988
41989 function K256 () {
41990 MPrime.call(
41991 this,
41992 'k256',
41993 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');
41994 }
41995 inherits(K256, MPrime);
41996
41997 K256.prototype.split = function split (input, output) {
41998 // 256 = 9 * 26 + 22
41999 var mask = 0x3fffff;
42000
42001 var outLen = Math.min(input.length, 9);
42002 for (var i = 0; i < outLen; i++) {
42003 output.words[i] = input.words[i];
42004 }
42005 output.length = outLen;
42006
42007 if (input.length <= 9) {
42008 input.words[0] = 0;
42009 input.length = 1;
42010 return;
42011 }
42012
42013 // Shift by 9 limbs
42014 var prev = input.words[9];
42015 output.words[output.length++] = prev & mask;
42016
42017 for (i = 10; i < input.length; i++) {
42018 var next = input.words[i] | 0;
42019 input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);
42020 prev = next;
42021 }
42022 prev >>>= 22;
42023 input.words[i - 10] = prev;
42024 if (prev === 0 && input.length > 10) {
42025 input.length -= 10;
42026 } else {
42027 input.length -= 9;
42028 }
42029 };
42030
42031 K256.prototype.imulK = function imulK (num) {
42032 // K = 0x1000003d1 = [ 0x40, 0x3d1 ]
42033 num.words[num.length] = 0;
42034 num.words[num.length + 1] = 0;
42035 num.length += 2;
42036
42037 // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390
42038 var lo = 0;
42039 for (var i = 0; i < num.length; i++) {
42040 var w = num.words[i] | 0;
42041 lo += w * 0x3d1;
42042 num.words[i] = lo & 0x3ffffff;
42043 lo = w * 0x40 + ((lo / 0x4000000) | 0);
42044 }
42045
42046 // Fast length reduction
42047 if (num.words[num.length - 1] === 0) {
42048 num.length--;
42049 if (num.words[num.length - 1] === 0) {
42050 num.length--;
42051 }
42052 }
42053 return num;
42054 };
42055
42056 function P224 () {
42057 MPrime.call(
42058 this,
42059 'p224',
42060 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');
42061 }
42062 inherits(P224, MPrime);
42063
42064 function P192 () {
42065 MPrime.call(
42066 this,
42067 'p192',
42068 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');
42069 }
42070 inherits(P192, MPrime);
42071
42072 function P25519 () {
42073 // 2 ^ 255 - 19
42074 MPrime.call(
42075 this,
42076 '25519',
42077 '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');
42078 }
42079 inherits(P25519, MPrime);
42080
42081 P25519.prototype.imulK = function imulK (num) {
42082 // K = 0x13
42083 var carry = 0;
42084 for (var i = 0; i < num.length; i++) {
42085 var hi = (num.words[i] | 0) * 0x13 + carry;
42086 var lo = hi & 0x3ffffff;
42087 hi >>>= 26;
42088
42089 num.words[i] = lo;
42090 carry = hi;
42091 }
42092 if (carry !== 0) {
42093 num.words[num.length++] = carry;
42094 }
42095 return num;
42096 };
42097
42098 // Exported mostly for testing purposes, use plain name instead
42099 BN._prime = function prime (name) {
42100 // Cached version of prime
42101 if (primes[name]) return primes[name];
42102
42103 var prime;
42104 if (name === 'k256') {
42105 prime = new K256();
42106 } else if (name === 'p224') {
42107 prime = new P224();
42108 } else if (name === 'p192') {
42109 prime = new P192();
42110 } else if (name === 'p25519') {
42111 prime = new P25519();
42112 } else {
42113 throw new Error('Unknown prime ' + name);
42114 }
42115 primes[name] = prime;
42116
42117 return prime;
42118 };
42119
42120 //
42121 // Base reduction engine
42122 //
42123 function Red (m) {
42124 if (typeof m === 'string') {
42125 var prime = BN._prime(m);
42126 this.m = prime.p;
42127 this.prime = prime;
42128 } else {
42129 assert(m.gtn(1), 'modulus must be greater than 1');
42130 this.m = m;
42131 this.prime = null;
42132 }
42133 }
42134
42135 Red.prototype._verify1 = function _verify1 (a) {
42136 assert(a.negative === 0, 'red works only with positives');
42137 assert(a.red, 'red works only with red numbers');
42138 };
42139
42140 Red.prototype._verify2 = function _verify2 (a, b) {
42141 assert((a.negative | b.negative) === 0, 'red works only with positives');
42142 assert(a.red && a.red === b.red,
42143 'red works only with red numbers');
42144 };
42145
42146 Red.prototype.imod = function imod (a) {
42147 if (this.prime) return this.prime.ireduce(a)._forceRed(this);
42148 return a.umod(this.m)._forceRed(this);
42149 };
42150
42151 Red.prototype.neg = function neg (a) {
42152 if (a.isZero()) {
42153 return a.clone();
42154 }
42155
42156 return this.m.sub(a)._forceRed(this);
42157 };
42158
42159 Red.prototype.add = function add (a, b) {
42160 this._verify2(a, b);
42161
42162 var res = a.add(b);
42163 if (res.cmp(this.m) >= 0) {
42164 res.isub(this.m);
42165 }
42166 return res._forceRed(this);
42167 };
42168
42169 Red.prototype.iadd = function iadd (a, b) {
42170 this._verify2(a, b);
42171
42172 var res = a.iadd(b);
42173 if (res.cmp(this.m) >= 0) {
42174 res.isub(this.m);
42175 }
42176 return res;
42177 };
42178
42179 Red.prototype.sub = function sub (a, b) {
42180 this._verify2(a, b);
42181
42182 var res = a.sub(b);
42183 if (res.cmpn(0) < 0) {
42184 res.iadd(this.m);
42185 }
42186 return res._forceRed(this);
42187 };
42188
42189 Red.prototype.isub = function isub (a, b) {
42190 this._verify2(a, b);
42191
42192 var res = a.isub(b);
42193 if (res.cmpn(0) < 0) {
42194 res.iadd(this.m);
42195 }
42196 return res;
42197 };
42198
42199 Red.prototype.shl = function shl (a, num) {
42200 this._verify1(a);
42201 return this.imod(a.ushln(num));
42202 };
42203
42204 Red.prototype.imul = function imul (a, b) {
42205 this._verify2(a, b);
42206 return this.imod(a.imul(b));
42207 };
42208
42209 Red.prototype.mul = function mul (a, b) {
42210 this._verify2(a, b);
42211 return this.imod(a.mul(b));
42212 };
42213
42214 Red.prototype.isqr = function isqr (a) {
42215 return this.imul(a, a.clone());
42216 };
42217
42218 Red.prototype.sqr = function sqr (a) {
42219 return this.mul(a, a);
42220 };
42221
42222 Red.prototype.sqrt = function sqrt (a) {
42223 if (a.isZero()) return a.clone();
42224
42225 var mod3 = this.m.andln(3);
42226 assert(mod3 % 2 === 1);
42227
42228 // Fast case
42229 if (mod3 === 3) {
42230 var pow = this.m.add(new BN(1)).iushrn(2);
42231 return this.pow(a, pow);
42232 }
42233
42234 // Tonelli-Shanks algorithm (Totally unoptimized and slow)
42235 //
42236 // Find Q and S, that Q * 2 ^ S = (P - 1)
42237 var q = this.m.subn(1);
42238 var s = 0;
42239 while (!q.isZero() && q.andln(1) === 0) {
42240 s++;
42241 q.iushrn(1);
42242 }
42243 assert(!q.isZero());
42244
42245 var one = new BN(1).toRed(this);
42246 var nOne = one.redNeg();
42247
42248 // Find quadratic non-residue
42249 // NOTE: Max is such because of generalized Riemann hypothesis.
42250 var lpow = this.m.subn(1).iushrn(1);
42251 var z = this.m.bitLength();
42252 z = new BN(2 * z * z).toRed(this);
42253
42254 while (this.pow(z, lpow).cmp(nOne) !== 0) {
42255 z.redIAdd(nOne);
42256 }
42257
42258 var c = this.pow(z, q);
42259 var r = this.pow(a, q.addn(1).iushrn(1));
42260 var t = this.pow(a, q);
42261 var m = s;
42262 while (t.cmp(one) !== 0) {
42263 var tmp = t;
42264 for (var i = 0; tmp.cmp(one) !== 0; i++) {
42265 tmp = tmp.redSqr();
42266 }
42267 assert(i < m);
42268 var b = this.pow(c, new BN(1).iushln(m - i - 1));
42269
42270 r = r.redMul(b);
42271 c = b.redSqr();
42272 t = t.redMul(c);
42273 m = i;
42274 }
42275
42276 return r;
42277 };
42278
42279 Red.prototype.invm = function invm (a) {
42280 var inv = a._invmp(this.m);
42281 if (inv.negative !== 0) {
42282 inv.negative = 0;
42283 return this.imod(inv).redNeg();
42284 } else {
42285 return this.imod(inv);
42286 }
42287 };
42288
42289 Red.prototype.pow = function pow (a, num) {
42290 if (num.isZero()) return new BN(1);
42291 if (num.cmpn(1) === 0) return a.clone();
42292
42293 var windowSize = 4;
42294 var wnd = new Array(1 << windowSize);
42295 wnd[0] = new BN(1).toRed(this);
42296 wnd[1] = a;
42297 for (var i = 2; i < wnd.length; i++) {
42298 wnd[i] = this.mul(wnd[i - 1], a);
42299 }
42300
42301 var res = wnd[0];
42302 var current = 0;
42303 var currentLen = 0;
42304 var start = num.bitLength() % 26;
42305 if (start === 0) {
42306 start = 26;
42307 }
42308
42309 for (i = num.length - 1; i >= 0; i--) {
42310 var word = num.words[i];
42311 for (var j = start - 1; j >= 0; j--) {
42312 var bit = (word >> j) & 1;
42313 if (res !== wnd[0]) {
42314 res = this.sqr(res);
42315 }
42316
42317 if (bit === 0 && current === 0) {
42318 currentLen = 0;
42319 continue;
42320 }
42321
42322 current <<= 1;
42323 current |= bit;
42324 currentLen++;
42325 if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
42326
42327 res = this.mul(res, wnd[current]);
42328 currentLen = 0;
42329 current = 0;
42330 }
42331 start = 26;
42332 }
42333
42334 return res;
42335 };
42336
42337 Red.prototype.convertTo = function convertTo (num) {
42338 var r = num.umod(this.m);
42339
42340 return r === num ? r.clone() : r;
42341 };
42342
42343 Red.prototype.convertFrom = function convertFrom (num) {
42344 var res = num.clone();
42345 res.red = null;
42346 return res;
42347 };
42348
42349 //
42350 // Montgomery method engine
42351 //
42352
42353 BN.mont = function mont (num) {
42354 return new Mont(num);
42355 };
42356
42357 function Mont (m) {
42358 Red.call(this, m);
42359
42360 this.shift = this.m.bitLength();
42361 if (this.shift % 26 !== 0) {
42362 this.shift += 26 - (this.shift % 26);
42363 }
42364
42365 this.r = new BN(1).iushln(this.shift);
42366 this.r2 = this.imod(this.r.sqr());
42367 this.rinv = this.r._invmp(this.m);
42368
42369 this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
42370 this.minv = this.minv.umod(this.r);
42371 this.minv = this.r.sub(this.minv);
42372 }
42373 inherits(Mont, Red);
42374
42375 Mont.prototype.convertTo = function convertTo (num) {
42376 return this.imod(num.ushln(this.shift));
42377 };
42378
42379 Mont.prototype.convertFrom = function convertFrom (num) {
42380 var r = this.imod(num.mul(this.rinv));
42381 r.red = null;
42382 return r;
42383 };
42384
42385 Mont.prototype.imul = function imul (a, b) {
42386 if (a.isZero() || b.isZero()) {
42387 a.words[0] = 0;
42388 a.length = 1;
42389 return a;
42390 }
42391
42392 var t = a.imul(b);
42393 var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
42394 var u = t.isub(c).iushrn(this.shift);
42395 var res = u;
42396
42397 if (u.cmp(this.m) >= 0) {
42398 res = u.isub(this.m);
42399 } else if (u.cmpn(0) < 0) {
42400 res = u.iadd(this.m);
42401 }
42402
42403 return res._forceRed(this);
42404 };
42405
42406 Mont.prototype.mul = function mul (a, b) {
42407 if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
42408
42409 var t = a.mul(b);
42410 var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
42411 var u = t.isub(c).iushrn(this.shift);
42412 var res = u;
42413 if (u.cmp(this.m) >= 0) {
42414 res = u.isub(this.m);
42415 } else if (u.cmpn(0) < 0) {
42416 res = u.iadd(this.m);
42417 }
42418
42419 return res._forceRed(this);
42420 };
42421
42422 Mont.prototype.invm = function invm (a) {
42423 // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R
42424 var res = this.imod(a._invmp(this.m).mul(this.r2));
42425 return res._forceRed(this);
42426 };
42427})(typeof module === 'undefined' || module, this);
42428
42429},{}],82:[function(require,module,exports){
42430var r;
42431
42432module.exports = function rand(len) {
42433 if (!r)
42434 r = new Rand(null);
42435
42436 return r.generate(len);
42437};
42438
42439function Rand(rand) {
42440 this.rand = rand;
42441}
42442module.exports.Rand = Rand;
42443
42444Rand.prototype.generate = function generate(len) {
42445 return this._rand(len);
42446};
42447
42448// Emulate crypto API using randy
42449Rand.prototype._rand = function _rand(n) {
42450 if (this.rand.getBytes)
42451 return this.rand.getBytes(n);
42452
42453 var res = new Uint8Array(n);
42454 for (var i = 0; i < res.length; i++)
42455 res[i] = this.rand.getByte();
42456 return res;
42457};
42458
42459if (typeof self === 'object') {
42460 if (self.crypto && self.crypto.getRandomValues) {
42461 // Modern browsers
42462 Rand.prototype._rand = function _rand(n) {
42463 var arr = new Uint8Array(n);
42464 self.crypto.getRandomValues(arr);
42465 return arr;
42466 };
42467 } else if (self.msCrypto && self.msCrypto.getRandomValues) {
42468 // IE
42469 Rand.prototype._rand = function _rand(n) {
42470 var arr = new Uint8Array(n);
42471 self.msCrypto.getRandomValues(arr);
42472 return arr;
42473 };
42474
42475 // Safari's WebWorkers do not have `crypto`
42476 } else if (typeof window === 'object') {
42477 // Old junk
42478 Rand.prototype._rand = function() {
42479 throw new Error('Not implemented yet');
42480 };
42481 }
42482} else {
42483 // Node.js or Web worker with no crypto support
42484 try {
42485 var crypto = require('crypto');
42486 if (typeof crypto.randomBytes !== 'function')
42487 throw new Error('Not supported');
42488
42489 Rand.prototype._rand = function _rand(n) {
42490 return crypto.randomBytes(n);
42491 };
42492 } catch (e) {
42493 }
42494}
42495
42496},{"crypto":3}],83:[function(require,module,exports){
42497var basex = require('base-x')
42498var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
42499
42500module.exports = basex(ALPHABET)
42501
42502},{"base-x":35}],84:[function(require,module,exports){
42503(function (Buffer){
42504'use strict'
42505
42506var base58 = require('bs58')
42507
42508module.exports = function (checksumFn) {
42509 // Encode a buffer as a base58-check encoded string
42510 function encode (payload) {
42511 var checksum = checksumFn(payload)
42512
42513 return base58.encode(Buffer.concat([
42514 payload,
42515 checksum
42516 ], payload.length + 4))
42517 }
42518
42519 function decodeRaw (buffer) {
42520 var payload = buffer.slice(0, -4)
42521 var checksum = buffer.slice(-4)
42522 var newChecksum = checksumFn(payload)
42523
42524 if (checksum[0] ^ newChecksum[0] |
42525 checksum[1] ^ newChecksum[1] |
42526 checksum[2] ^ newChecksum[2] |
42527 checksum[3] ^ newChecksum[3]) return
42528
42529 return payload
42530 }
42531
42532 // Decode a base58-check encoded string to a buffer, no result if checksum is wrong
42533 function decodeUnsafe (string) {
42534 var buffer = base58.decodeUnsafe(string)
42535 if (!buffer) return
42536
42537 return decodeRaw(buffer)
42538 }
42539
42540 function decode (string) {
42541 var buffer = base58.decode(string)
42542 var payload = decodeRaw(buffer, checksumFn)
42543 if (!payload) throw new Error('Invalid checksum')
42544 return payload
42545 }
42546
42547 return {
42548 encode: encode,
42549 decode: decode,
42550 decodeUnsafe: decodeUnsafe
42551 }
42552}
42553
42554}).call(this,require("buffer").Buffer)
42555},{"bs58":83,"buffer":5}],85:[function(require,module,exports){
42556'use strict'
42557
42558var createHash = require('create-hash')
42559var bs58checkBase = require('./base')
42560
42561// SHA256(SHA256(buffer))
42562function sha256x2 (buffer) {
42563 var tmp = createHash('sha256').update(buffer).digest()
42564 return createHash('sha256').update(tmp).digest()
42565}
42566
42567module.exports = bs58checkBase(sha256x2)
42568
42569},{"./base":84,"create-hash":87}],86:[function(require,module,exports){
42570var Buffer = require('safe-buffer').Buffer
42571var Transform = require('stream').Transform
42572var StringDecoder = require('string_decoder').StringDecoder
42573var inherits = require('inherits')
42574
42575function CipherBase (hashMode) {
42576 Transform.call(this)
42577 this.hashMode = typeof hashMode === 'string'
42578 if (this.hashMode) {
42579 this[hashMode] = this._finalOrDigest
42580 } else {
42581 this.final = this._finalOrDigest
42582 }
42583 if (this._final) {
42584 this.__final = this._final
42585 this._final = null
42586 }
42587 this._decoder = null
42588 this._encoding = null
42589}
42590inherits(CipherBase, Transform)
42591
42592CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
42593 if (typeof data === 'string') {
42594 data = Buffer.from(data, inputEnc)
42595 }
42596
42597 var outData = this._update(data)
42598 if (this.hashMode) return this
42599
42600 if (outputEnc) {
42601 outData = this._toString(outData, outputEnc)
42602 }
42603
42604 return outData
42605}
42606
42607CipherBase.prototype.setAutoPadding = function () {}
42608CipherBase.prototype.getAuthTag = function () {
42609 throw new Error('trying to get auth tag in unsupported state')
42610}
42611
42612CipherBase.prototype.setAuthTag = function () {
42613 throw new Error('trying to set auth tag in unsupported state')
42614}
42615
42616CipherBase.prototype.setAAD = function () {
42617 throw new Error('trying to set aad in unsupported state')
42618}
42619
42620CipherBase.prototype._transform = function (data, _, next) {
42621 var err
42622 try {
42623 if (this.hashMode) {
42624 this._update(data)
42625 } else {
42626 this.push(this._update(data))
42627 }
42628 } catch (e) {
42629 err = e
42630 } finally {
42631 next(err)
42632 }
42633}
42634CipherBase.prototype._flush = function (done) {
42635 var err
42636 try {
42637 this.push(this.__final())
42638 } catch (e) {
42639 err = e
42640 }
42641
42642 done(err)
42643}
42644CipherBase.prototype._finalOrDigest = function (outputEnc) {
42645 var outData = this.__final() || Buffer.alloc(0)
42646 if (outputEnc) {
42647 outData = this._toString(outData, outputEnc, true)
42648 }
42649 return outData
42650}
42651
42652CipherBase.prototype._toString = function (value, enc, fin) {
42653 if (!this._decoder) {
42654 this._decoder = new StringDecoder(enc)
42655 this._encoding = enc
42656 }
42657
42658 if (this._encoding !== enc) throw new Error('can\'t switch encodings')
42659
42660 var out = this._decoder.write(value)
42661 if (fin) {
42662 out += this._decoder.end()
42663 }
42664
42665 return out
42666}
42667
42668module.exports = CipherBase
42669
42670},{"inherits":121,"safe-buffer":128,"stream":28,"string_decoder":29}],87:[function(require,module,exports){
42671(function (Buffer){
42672'use strict'
42673var inherits = require('inherits')
42674var md5 = require('./md5')
42675var RIPEMD160 = require('ripemd160')
42676var sha = require('sha.js')
42677
42678var Base = require('cipher-base')
42679
42680function HashNoConstructor (hash) {
42681 Base.call(this, 'digest')
42682
42683 this._hash = hash
42684 this.buffers = []
42685}
42686
42687inherits(HashNoConstructor, Base)
42688
42689HashNoConstructor.prototype._update = function (data) {
42690 this.buffers.push(data)
42691}
42692
42693HashNoConstructor.prototype._final = function () {
42694 var buf = Buffer.concat(this.buffers)
42695 var r = this._hash(buf)
42696 this.buffers = null
42697
42698 return r
42699}
42700
42701function Hash (hash) {
42702 Base.call(this, 'digest')
42703
42704 this._hash = hash
42705}
42706
42707inherits(Hash, Base)
42708
42709Hash.prototype._update = function (data) {
42710 this._hash.update(data)
42711}
42712
42713Hash.prototype._final = function () {
42714 return this._hash.digest()
42715}
42716
42717module.exports = function createHash (alg) {
42718 alg = alg.toLowerCase()
42719 if (alg === 'md5') return new HashNoConstructor(md5)
42720 if (alg === 'rmd160' || alg === 'ripemd160') return new Hash(new RIPEMD160())
42721
42722 return new Hash(sha(alg))
42723}
42724
42725}).call(this,require("buffer").Buffer)
42726},{"./md5":89,"buffer":5,"cipher-base":86,"inherits":121,"ripemd160":127,"sha.js":130}],88:[function(require,module,exports){
42727(function (Buffer){
42728'use strict'
42729var intSize = 4
42730var zeroBuffer = new Buffer(intSize)
42731zeroBuffer.fill(0)
42732
42733var charSize = 8
42734var hashSize = 16
42735
42736function toArray (buf) {
42737 if ((buf.length % intSize) !== 0) {
42738 var len = buf.length + (intSize - (buf.length % intSize))
42739 buf = Buffer.concat([buf, zeroBuffer], len)
42740 }
42741
42742 var arr = new Array(buf.length >>> 2)
42743 for (var i = 0, j = 0; i < buf.length; i += intSize, j++) {
42744 arr[j] = buf.readInt32LE(i)
42745 }
42746
42747 return arr
42748}
42749
42750module.exports = function hash (buf, fn) {
42751 var arr = fn(toArray(buf), buf.length * charSize)
42752 buf = new Buffer(hashSize)
42753 for (var i = 0; i < arr.length; i++) {
42754 buf.writeInt32LE(arr[i], i << 2, true)
42755 }
42756 return buf
42757}
42758
42759}).call(this,require("buffer").Buffer)
42760},{"buffer":5}],89:[function(require,module,exports){
42761'use strict'
42762/*
42763 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
42764 * Digest Algorithm, as defined in RFC 1321.
42765 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
42766 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
42767 * Distributed under the BSD License
42768 * See http://pajhome.org.uk/crypt/md5 for more info.
42769 */
42770
42771var makeHash = require('./make-hash')
42772
42773/*
42774 * Calculate the MD5 of an array of little-endian words, and a bit length
42775 */
42776function core_md5 (x, len) {
42777 /* append padding */
42778 x[len >> 5] |= 0x80 << ((len) % 32)
42779 x[(((len + 64) >>> 9) << 4) + 14] = len
42780
42781 var a = 1732584193
42782 var b = -271733879
42783 var c = -1732584194
42784 var d = 271733878
42785
42786 for (var i = 0; i < x.length; i += 16) {
42787 var olda = a
42788 var oldb = b
42789 var oldc = c
42790 var oldd = d
42791
42792 a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936)
42793 d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586)
42794 c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819)
42795 b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330)
42796 a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897)
42797 d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426)
42798 c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341)
42799 b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983)
42800 a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416)
42801 d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417)
42802 c = md5_ff(c, d, a, b, x[i + 10], 17, -42063)
42803 b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162)
42804 a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682)
42805 d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101)
42806 c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290)
42807 b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329)
42808
42809 a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510)
42810 d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632)
42811 c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713)
42812 b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302)
42813 a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691)
42814 d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083)
42815 c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335)
42816 b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848)
42817 a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438)
42818 d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690)
42819 c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961)
42820 b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501)
42821 a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467)
42822 d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784)
42823 c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473)
42824 b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734)
42825
42826 a = md5_hh(a, b, c, d, x[i + 5], 4, -378558)
42827 d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463)
42828 c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562)
42829 b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556)
42830 a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060)
42831 d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353)
42832 c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632)
42833 b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640)
42834 a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174)
42835 d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222)
42836 c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979)
42837 b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189)
42838 a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487)
42839 d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835)
42840 c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520)
42841 b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651)
42842
42843 a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844)
42844 d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415)
42845 c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905)
42846 b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055)
42847 a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571)
42848 d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606)
42849 c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523)
42850 b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799)
42851 a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359)
42852 d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744)
42853 c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380)
42854 b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649)
42855 a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070)
42856 d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379)
42857 c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259)
42858 b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551)
42859
42860 a = safe_add(a, olda)
42861 b = safe_add(b, oldb)
42862 c = safe_add(c, oldc)
42863 d = safe_add(d, oldd)
42864 }
42865
42866 return [a, b, c, d]
42867}
42868
42869/*
42870 * These functions implement the four basic operations the algorithm uses.
42871 */
42872function md5_cmn (q, a, b, x, s, t) {
42873 return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
42874}
42875
42876function md5_ff (a, b, c, d, x, s, t) {
42877 return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t)
42878}
42879
42880function md5_gg (a, b, c, d, x, s, t) {
42881 return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t)
42882}
42883
42884function md5_hh (a, b, c, d, x, s, t) {
42885 return md5_cmn(b ^ c ^ d, a, b, x, s, t)
42886}
42887
42888function md5_ii (a, b, c, d, x, s, t) {
42889 return md5_cmn(c ^ (b | (~d)), a, b, x, s, t)
42890}
42891
42892/*
42893 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
42894 * to work around bugs in some JS interpreters.
42895 */
42896function safe_add (x, y) {
42897 var lsw = (x & 0xFFFF) + (y & 0xFFFF)
42898 var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
42899 return (msw << 16) | (lsw & 0xFFFF)
42900}
42901
42902/*
42903 * Bitwise rotate a 32-bit number to the left.
42904 */
42905function bit_rol (num, cnt) {
42906 return (num << cnt) | (num >>> (32 - cnt))
42907}
42908
42909module.exports = function md5 (buf) {
42910 return makeHash(buf, core_md5)
42911}
42912
42913},{"./make-hash":88}],90:[function(require,module,exports){
42914'use strict'
42915var inherits = require('inherits')
42916var Legacy = require('./legacy')
42917var Base = require('cipher-base')
42918var Buffer = require('safe-buffer').Buffer
42919var md5 = require('create-hash/md5')
42920var RIPEMD160 = require('ripemd160')
42921
42922var sha = require('sha.js')
42923
42924var ZEROS = Buffer.alloc(128)
42925
42926function Hmac (alg, key) {
42927 Base.call(this, 'digest')
42928 if (typeof key === 'string') {
42929 key = Buffer.from(key)
42930 }
42931
42932 var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
42933
42934 this._alg = alg
42935 this._key = key
42936 if (key.length > blocksize) {
42937 var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
42938 key = hash.update(key).digest()
42939 } else if (key.length < blocksize) {
42940 key = Buffer.concat([key, ZEROS], blocksize)
42941 }
42942
42943 var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
42944 var opad = this._opad = Buffer.allocUnsafe(blocksize)
42945
42946 for (var i = 0; i < blocksize; i++) {
42947 ipad[i] = key[i] ^ 0x36
42948 opad[i] = key[i] ^ 0x5C
42949 }
42950 this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
42951 this._hash.update(ipad)
42952}
42953
42954inherits(Hmac, Base)
42955
42956Hmac.prototype._update = function (data) {
42957 this._hash.update(data)
42958}
42959
42960Hmac.prototype._final = function () {
42961 var h = this._hash.digest()
42962 var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)
42963 return hash.update(this._opad).update(h).digest()
42964}
42965
42966module.exports = function createHmac (alg, key) {
42967 alg = alg.toLowerCase()
42968 if (alg === 'rmd160' || alg === 'ripemd160') {
42969 return new Hmac('rmd160', key)
42970 }
42971 if (alg === 'md5') {
42972 return new Legacy(md5, key)
42973 }
42974 return new Hmac(alg, key)
42975}
42976
42977},{"./legacy":91,"cipher-base":86,"create-hash/md5":89,"inherits":121,"ripemd160":127,"safe-buffer":128,"sha.js":130}],91:[function(require,module,exports){
42978'use strict'
42979var inherits = require('inherits')
42980var Buffer = require('safe-buffer').Buffer
42981
42982var Base = require('cipher-base')
42983
42984var ZEROS = Buffer.alloc(128)
42985var blocksize = 64
42986
42987function Hmac (alg, key) {
42988 Base.call(this, 'digest')
42989 if (typeof key === 'string') {
42990 key = Buffer.from(key)
42991 }
42992
42993 this._alg = alg
42994 this._key = key
42995
42996 if (key.length > blocksize) {
42997 key = alg(key)
42998 } else if (key.length < blocksize) {
42999 key = Buffer.concat([key, ZEROS], blocksize)
43000 }
43001
43002 var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
43003 var opad = this._opad = Buffer.allocUnsafe(blocksize)
43004
43005 for (var i = 0; i < blocksize; i++) {
43006 ipad[i] = key[i] ^ 0x36
43007 opad[i] = key[i] ^ 0x5C
43008 }
43009
43010 this._hash = [ipad]
43011}
43012
43013inherits(Hmac, Base)
43014
43015Hmac.prototype._update = function (data) {
43016 this._hash.push(data)
43017}
43018
43019Hmac.prototype._final = function () {
43020 var h = this._alg(Buffer.concat(this._hash))
43021 return this._alg(Buffer.concat([this._opad, h]))
43022}
43023module.exports = Hmac
43024
43025},{"cipher-base":86,"inherits":121,"safe-buffer":128}],92:[function(require,module,exports){
43026var assert = require('assert')
43027var BigInteger = require('bigi')
43028
43029var Point = require('./point')
43030
43031function Curve (p, a, b, Gx, Gy, n, h) {
43032 this.p = p
43033 this.a = a
43034 this.b = b
43035 this.G = Point.fromAffine(this, Gx, Gy)
43036 this.n = n
43037 this.h = h
43038
43039 this.infinity = new Point(this, null, null, BigInteger.ZERO)
43040
43041 // result caching
43042 this.pOverFour = p.add(BigInteger.ONE).shiftRight(2)
43043
43044 // determine size of p in bytes
43045 this.pLength = Math.floor((this.p.bitLength() + 7) / 8)
43046}
43047
43048Curve.prototype.pointFromX = function (isOdd, x) {
43049 var alpha = x.pow(3).add(this.a.multiply(x)).add(this.b).mod(this.p)
43050 var beta = alpha.modPow(this.pOverFour, this.p) // XXX: not compatible with all curves
43051
43052 var y = beta
43053 if (beta.isEven() ^ !isOdd) {
43054 y = this.p.subtract(y) // -y % p
43055 }
43056
43057 return Point.fromAffine(this, x, y)
43058}
43059
43060Curve.prototype.isInfinity = function (Q) {
43061 if (Q === this.infinity) return true
43062
43063 return Q.z.signum() === 0 && Q.y.signum() !== 0
43064}
43065
43066Curve.prototype.isOnCurve = function (Q) {
43067 if (this.isInfinity(Q)) return true
43068
43069 var x = Q.affineX
43070 var y = Q.affineY
43071 var a = this.a
43072 var b = this.b
43073 var p = this.p
43074
43075 // Check that xQ and yQ are integers in the interval [0, p - 1]
43076 if (x.signum() < 0 || x.compareTo(p) >= 0) return false
43077 if (y.signum() < 0 || y.compareTo(p) >= 0) return false
43078
43079 // and check that y^2 = x^3 + ax + b (mod p)
43080 var lhs = y.square().mod(p)
43081 var rhs = x.pow(3).add(a.multiply(x)).add(b).mod(p)
43082 return lhs.equals(rhs)
43083}
43084
43085/**
43086 * Validate an elliptic curve point.
43087 *
43088 * See SEC 1, section 3.2.2.1: Elliptic Curve Public Key Validation Primitive
43089 */
43090Curve.prototype.validate = function (Q) {
43091 // Check Q != O
43092 assert(!this.isInfinity(Q), 'Point is at infinity')
43093 assert(this.isOnCurve(Q), 'Point is not on the curve')
43094
43095 // Check nQ = O (where Q is a scalar multiple of G)
43096 var nQ = Q.multiply(this.n)
43097 assert(this.isInfinity(nQ), 'Point is not a scalar multiple of G')
43098
43099 return true
43100}
43101
43102module.exports = Curve
43103
43104},{"./point":96,"assert":1,"bigi":39}],93:[function(require,module,exports){
43105module.exports={
43106 "secp128r1": {
43107 "p": "fffffffdffffffffffffffffffffffff",
43108 "a": "fffffffdfffffffffffffffffffffffc",
43109 "b": "e87579c11079f43dd824993c2cee5ed3",
43110 "n": "fffffffe0000000075a30d1b9038a115",
43111 "h": "01",
43112 "Gx": "161ff7528b899b2d0c28607ca52c5b86",
43113 "Gy": "cf5ac8395bafeb13c02da292dded7a83"
43114 },
43115 "secp160k1": {
43116 "p": "fffffffffffffffffffffffffffffffeffffac73",
43117 "a": "00",
43118 "b": "07",
43119 "n": "0100000000000000000001b8fa16dfab9aca16b6b3",
43120 "h": "01",
43121 "Gx": "3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",
43122 "Gy": "938cf935318fdced6bc28286531733c3f03c4fee"
43123 },
43124 "secp160r1": {
43125 "p": "ffffffffffffffffffffffffffffffff7fffffff",
43126 "a": "ffffffffffffffffffffffffffffffff7ffffffc",
43127 "b": "1c97befc54bd7a8b65acf89f81d4d4adc565fa45",
43128 "n": "0100000000000000000001f4c8f927aed3ca752257",
43129 "h": "01",
43130 "Gx": "4a96b5688ef573284664698968c38bb913cbfc82",
43131 "Gy": "23a628553168947d59dcc912042351377ac5fb32"
43132 },
43133 "secp192k1": {
43134 "p": "fffffffffffffffffffffffffffffffffffffffeffffee37",
43135 "a": "00",
43136 "b": "03",
43137 "n": "fffffffffffffffffffffffe26f2fc170f69466a74defd8d",
43138 "h": "01",
43139 "Gx": "db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",
43140 "Gy": "9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"
43141 },
43142 "secp192r1": {
43143 "p": "fffffffffffffffffffffffffffffffeffffffffffffffff",
43144 "a": "fffffffffffffffffffffffffffffffefffffffffffffffc",
43145 "b": "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",
43146 "n": "ffffffffffffffffffffffff99def836146bc9b1b4d22831",
43147 "h": "01",
43148 "Gx": "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",
43149 "Gy": "07192b95ffc8da78631011ed6b24cdd573f977a11e794811"
43150 },
43151 "secp256k1": {
43152 "p": "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",
43153 "a": "00",
43154 "b": "07",
43155 "n": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",
43156 "h": "01",
43157 "Gx": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
43158 "Gy": "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
43159 },
43160 "secp256r1": {
43161 "p": "ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",
43162 "a": "ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",
43163 "b": "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",
43164 "n": "ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",
43165 "h": "01",
43166 "Gx": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",
43167 "Gy": "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"
43168 }
43169}
43170
43171},{}],94:[function(require,module,exports){
43172var Point = require('./point')
43173var Curve = require('./curve')
43174
43175var getCurveByName = require('./names')
43176
43177module.exports = {
43178 Curve: Curve,
43179 Point: Point,
43180 getCurveByName: getCurveByName
43181}
43182
43183},{"./curve":92,"./names":95,"./point":96}],95:[function(require,module,exports){
43184var BigInteger = require('bigi')
43185
43186var curves = require('./curves.json')
43187var Curve = require('./curve')
43188
43189function getCurveByName (name) {
43190 var curve = curves[name]
43191 if (!curve) return null
43192
43193 var p = new BigInteger(curve.p, 16)
43194 var a = new BigInteger(curve.a, 16)
43195 var b = new BigInteger(curve.b, 16)
43196 var n = new BigInteger(curve.n, 16)
43197 var h = new BigInteger(curve.h, 16)
43198 var Gx = new BigInteger(curve.Gx, 16)
43199 var Gy = new BigInteger(curve.Gy, 16)
43200
43201 return new Curve(p, a, b, Gx, Gy, n, h)
43202}
43203
43204module.exports = getCurveByName
43205
43206},{"./curve":92,"./curves.json":93,"bigi":39}],96:[function(require,module,exports){
43207(function (Buffer){
43208var assert = require('assert')
43209var BigInteger = require('bigi')
43210
43211var THREE = BigInteger.valueOf(3)
43212
43213function Point (curve, x, y, z) {
43214 assert.notStrictEqual(z, undefined, 'Missing Z coordinate')
43215
43216 this.curve = curve
43217 this.x = x
43218 this.y = y
43219 this.z = z
43220 this._zInv = null
43221
43222 this.compressed = true
43223}
43224
43225Object.defineProperty(Point.prototype, 'zInv', {
43226 get: function () {
43227 if (this._zInv === null) {
43228 this._zInv = this.z.modInverse(this.curve.p)
43229 }
43230
43231 return this._zInv
43232 }
43233})
43234
43235Object.defineProperty(Point.prototype, 'affineX', {
43236 get: function () {
43237 return this.x.multiply(this.zInv).mod(this.curve.p)
43238 }
43239})
43240
43241Object.defineProperty(Point.prototype, 'affineY', {
43242 get: function () {
43243 return this.y.multiply(this.zInv).mod(this.curve.p)
43244 }
43245})
43246
43247Point.fromAffine = function (curve, x, y) {
43248 return new Point(curve, x, y, BigInteger.ONE)
43249}
43250
43251Point.prototype.equals = function (other) {
43252 if (other === this) return true
43253 if (this.curve.isInfinity(this)) return this.curve.isInfinity(other)
43254 if (this.curve.isInfinity(other)) return this.curve.isInfinity(this)
43255
43256 // u = Y2 * Z1 - Y1 * Z2
43257 var u = other.y.multiply(this.z).subtract(this.y.multiply(other.z)).mod(this.curve.p)
43258
43259 if (u.signum() !== 0) return false
43260
43261 // v = X2 * Z1 - X1 * Z2
43262 var v = other.x.multiply(this.z).subtract(this.x.multiply(other.z)).mod(this.curve.p)
43263
43264 return v.signum() === 0
43265}
43266
43267Point.prototype.negate = function () {
43268 var y = this.curve.p.subtract(this.y)
43269
43270 return new Point(this.curve, this.x, y, this.z)
43271}
43272
43273Point.prototype.add = function (b) {
43274 if (this.curve.isInfinity(this)) return b
43275 if (this.curve.isInfinity(b)) return this
43276
43277 var x1 = this.x
43278 var y1 = this.y
43279 var x2 = b.x
43280 var y2 = b.y
43281
43282 // u = Y2 * Z1 - Y1 * Z2
43283 var u = y2.multiply(this.z).subtract(y1.multiply(b.z)).mod(this.curve.p)
43284 // v = X2 * Z1 - X1 * Z2
43285 var v = x2.multiply(this.z).subtract(x1.multiply(b.z)).mod(this.curve.p)
43286
43287 if (v.signum() === 0) {
43288 if (u.signum() === 0) {
43289 return this.twice() // this == b, so double
43290 }
43291
43292 return this.curve.infinity // this = -b, so infinity
43293 }
43294
43295 var v2 = v.square()
43296 var v3 = v2.multiply(v)
43297 var x1v2 = x1.multiply(v2)
43298 var zu2 = u.square().multiply(this.z)
43299
43300 // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)
43301 var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.p)
43302 // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3
43303 var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.p)
43304 // z3 = v^3 * z1 * z2
43305 var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.p)
43306
43307 return new Point(this.curve, x3, y3, z3)
43308}
43309
43310Point.prototype.twice = function () {
43311 if (this.curve.isInfinity(this)) return this
43312 if (this.y.signum() === 0) return this.curve.infinity
43313
43314 var x1 = this.x
43315 var y1 = this.y
43316
43317 var y1z1 = y1.multiply(this.z).mod(this.curve.p)
43318 var y1sqz1 = y1z1.multiply(y1).mod(this.curve.p)
43319 var a = this.curve.a
43320
43321 // w = 3 * x1^2 + a * z1^2
43322 var w = x1.square().multiply(THREE)
43323
43324 if (a.signum() !== 0) {
43325 w = w.add(this.z.square().multiply(a))
43326 }
43327
43328 w = w.mod(this.curve.p)
43329 // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)
43330 var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.p)
43331 // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3
43332 var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.pow(3)).mod(this.curve.p)
43333 // z3 = 8 * (y1 * z1)^3
43334 var z3 = y1z1.pow(3).shiftLeft(3).mod(this.curve.p)
43335
43336 return new Point(this.curve, x3, y3, z3)
43337}
43338
43339// Simple NAF (Non-Adjacent Form) multiplication algorithm
43340// TODO: modularize the multiplication algorithm
43341Point.prototype.multiply = function (k) {
43342 if (this.curve.isInfinity(this)) return this
43343 if (k.signum() === 0) return this.curve.infinity
43344
43345 var e = k
43346 var h = e.multiply(THREE)
43347
43348 var neg = this.negate()
43349 var R = this
43350
43351 for (var i = h.bitLength() - 2; i > 0; --i) {
43352 var hBit = h.testBit(i)
43353 var eBit = e.testBit(i)
43354
43355 R = R.twice()
43356
43357 if (hBit !== eBit) {
43358 R = R.add(hBit ? this : neg)
43359 }
43360 }
43361
43362 return R
43363}
43364
43365// Compute this*j + x*k (simultaneous multiplication)
43366Point.prototype.multiplyTwo = function (j, x, k) {
43367 var i = Math.max(j.bitLength(), k.bitLength()) - 1
43368 var R = this.curve.infinity
43369 var both = this.add(x)
43370
43371 while (i >= 0) {
43372 var jBit = j.testBit(i)
43373 var kBit = k.testBit(i)
43374
43375 R = R.twice()
43376
43377 if (jBit) {
43378 if (kBit) {
43379 R = R.add(both)
43380 } else {
43381 R = R.add(this)
43382 }
43383 } else if (kBit) {
43384 R = R.add(x)
43385 }
43386 --i
43387 }
43388
43389 return R
43390}
43391
43392Point.prototype.getEncoded = function (compressed) {
43393 if (compressed == null) compressed = this.compressed
43394 if (this.curve.isInfinity(this)) return new Buffer('00', 'hex') // Infinity point encoded is simply '00'
43395
43396 var x = this.affineX
43397 var y = this.affineY
43398 var byteLength = this.curve.pLength
43399 var buffer
43400
43401 // 0x02/0x03 | X
43402 if (compressed) {
43403 buffer = new Buffer(1 + byteLength)
43404 buffer.writeUInt8(y.isEven() ? 0x02 : 0x03, 0)
43405
43406 // 0x04 | X | Y
43407 } else {
43408 buffer = new Buffer(1 + byteLength + byteLength)
43409 buffer.writeUInt8(0x04, 0)
43410
43411 y.toBuffer(byteLength).copy(buffer, 1 + byteLength)
43412 }
43413
43414 x.toBuffer(byteLength).copy(buffer, 1)
43415
43416 return buffer
43417}
43418
43419Point.decodeFrom = function (curve, buffer) {
43420 var type = buffer.readUInt8(0)
43421 var compressed = (type !== 4)
43422
43423 var byteLength = Math.floor((curve.p.bitLength() + 7) / 8)
43424 var x = BigInteger.fromBuffer(buffer.slice(1, 1 + byteLength))
43425
43426 var Q
43427 if (compressed) {
43428 assert.equal(buffer.length, byteLength + 1, 'Invalid sequence length')
43429 assert(type === 0x02 || type === 0x03, 'Invalid sequence tag')
43430
43431 var isOdd = (type === 0x03)
43432 Q = curve.pointFromX(isOdd, x)
43433 } else {
43434 assert.equal(buffer.length, 1 + byteLength + byteLength, 'Invalid sequence length')
43435
43436 var y = BigInteger.fromBuffer(buffer.slice(1 + byteLength))
43437 Q = Point.fromAffine(curve, x, y)
43438 }
43439
43440 Q.compressed = compressed
43441 return Q
43442}
43443
43444Point.prototype.toString = function () {
43445 if (this.curve.isInfinity(this)) return '(INFINITY)'
43446
43447 return '(' + this.affineX.toString() + ',' + this.affineY.toString() + ')'
43448}
43449
43450module.exports = Point
43451
43452}).call(this,require("buffer").Buffer)
43453},{"assert":1,"bigi":39,"buffer":5}],97:[function(require,module,exports){
43454'use strict';
43455
43456var elliptic = exports;
43457
43458elliptic.version = require('../package.json').version;
43459elliptic.utils = require('./elliptic/utils');
43460elliptic.rand = require('brorand');
43461elliptic.curve = require('./elliptic/curve');
43462elliptic.curves = require('./elliptic/curves');
43463
43464// Protocols
43465elliptic.ec = require('./elliptic/ec');
43466elliptic.eddsa = require('./elliptic/eddsa');
43467
43468},{"../package.json":112,"./elliptic/curve":100,"./elliptic/curves":103,"./elliptic/ec":104,"./elliptic/eddsa":107,"./elliptic/utils":111,"brorand":82}],98:[function(require,module,exports){
43469'use strict';
43470
43471var BN = require('bn.js');
43472var elliptic = require('../../elliptic');
43473var utils = elliptic.utils;
43474var getNAF = utils.getNAF;
43475var getJSF = utils.getJSF;
43476var assert = utils.assert;
43477
43478function BaseCurve(type, conf) {
43479 this.type = type;
43480 this.p = new BN(conf.p, 16);
43481
43482 // Use Montgomery, when there is no fast reduction for the prime
43483 this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);
43484
43485 // Useful for many curves
43486 this.zero = new BN(0).toRed(this.red);
43487 this.one = new BN(1).toRed(this.red);
43488 this.two = new BN(2).toRed(this.red);
43489
43490 // Curve configuration, optional
43491 this.n = conf.n && new BN(conf.n, 16);
43492 this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
43493
43494 // Temporary arrays
43495 this._wnafT1 = new Array(4);
43496 this._wnafT2 = new Array(4);
43497 this._wnafT3 = new Array(4);
43498 this._wnafT4 = new Array(4);
43499
43500 // Generalized Greg Maxwell's trick
43501 var adjustCount = this.n && this.p.div(this.n);
43502 if (!adjustCount || adjustCount.cmpn(100) > 0) {
43503 this.redN = null;
43504 } else {
43505 this._maxwellTrick = true;
43506 this.redN = this.n.toRed(this.red);
43507 }
43508}
43509module.exports = BaseCurve;
43510
43511BaseCurve.prototype.point = function point() {
43512 throw new Error('Not implemented');
43513};
43514
43515BaseCurve.prototype.validate = function validate() {
43516 throw new Error('Not implemented');
43517};
43518
43519BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
43520 assert(p.precomputed);
43521 var doubles = p._getDoubles();
43522
43523 var naf = getNAF(k, 1);
43524 var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);
43525 I /= 3;
43526
43527 // Translate into more windowed form
43528 var repr = [];
43529 for (var j = 0; j < naf.length; j += doubles.step) {
43530 var nafW = 0;
43531 for (var k = j + doubles.step - 1; k >= j; k--)
43532 nafW = (nafW << 1) + naf[k];
43533 repr.push(nafW);
43534 }
43535
43536 var a = this.jpoint(null, null, null);
43537 var b = this.jpoint(null, null, null);
43538 for (var i = I; i > 0; i--) {
43539 for (var j = 0; j < repr.length; j++) {
43540 var nafW = repr[j];
43541 if (nafW === i)
43542 b = b.mixedAdd(doubles.points[j]);
43543 else if (nafW === -i)
43544 b = b.mixedAdd(doubles.points[j].neg());
43545 }
43546 a = a.add(b);
43547 }
43548 return a.toP();
43549};
43550
43551BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {
43552 var w = 4;
43553
43554 // Precompute window
43555 var nafPoints = p._getNAFPoints(w);
43556 w = nafPoints.wnd;
43557 var wnd = nafPoints.points;
43558
43559 // Get NAF form
43560 var naf = getNAF(k, w);
43561
43562 // Add `this`*(N+1) for every w-NAF index
43563 var acc = this.jpoint(null, null, null);
43564 for (var i = naf.length - 1; i >= 0; i--) {
43565 // Count zeroes
43566 for (var k = 0; i >= 0 && naf[i] === 0; i--)
43567 k++;
43568 if (i >= 0)
43569 k++;
43570 acc = acc.dblp(k);
43571
43572 if (i < 0)
43573 break;
43574 var z = naf[i];
43575 assert(z !== 0);
43576 if (p.type === 'affine') {
43577 // J +- P
43578 if (z > 0)
43579 acc = acc.mixedAdd(wnd[(z - 1) >> 1]);
43580 else
43581 acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());
43582 } else {
43583 // J +- J
43584 if (z > 0)
43585 acc = acc.add(wnd[(z - 1) >> 1]);
43586 else
43587 acc = acc.add(wnd[(-z - 1) >> 1].neg());
43588 }
43589 }
43590 return p.type === 'affine' ? acc.toP() : acc;
43591};
43592
43593BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,
43594 points,
43595 coeffs,
43596 len,
43597 jacobianResult) {
43598 var wndWidth = this._wnafT1;
43599 var wnd = this._wnafT2;
43600 var naf = this._wnafT3;
43601
43602 // Fill all arrays
43603 var max = 0;
43604 for (var i = 0; i < len; i++) {
43605 var p = points[i];
43606 var nafPoints = p._getNAFPoints(defW);
43607 wndWidth[i] = nafPoints.wnd;
43608 wnd[i] = nafPoints.points;
43609 }
43610
43611 // Comb small window NAFs
43612 for (var i = len - 1; i >= 1; i -= 2) {
43613 var a = i - 1;
43614 var b = i;
43615 if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {
43616 naf[a] = getNAF(coeffs[a], wndWidth[a]);
43617 naf[b] = getNAF(coeffs[b], wndWidth[b]);
43618 max = Math.max(naf[a].length, max);
43619 max = Math.max(naf[b].length, max);
43620 continue;
43621 }
43622
43623 var comb = [
43624 points[a], /* 1 */
43625 null, /* 3 */
43626 null, /* 5 */
43627 points[b] /* 7 */
43628 ];
43629
43630 // Try to avoid Projective points, if possible
43631 if (points[a].y.cmp(points[b].y) === 0) {
43632 comb[1] = points[a].add(points[b]);
43633 comb[2] = points[a].toJ().mixedAdd(points[b].neg());
43634 } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {
43635 comb[1] = points[a].toJ().mixedAdd(points[b]);
43636 comb[2] = points[a].add(points[b].neg());
43637 } else {
43638 comb[1] = points[a].toJ().mixedAdd(points[b]);
43639 comb[2] = points[a].toJ().mixedAdd(points[b].neg());
43640 }
43641
43642 var index = [
43643 -3, /* -1 -1 */
43644 -1, /* -1 0 */
43645 -5, /* -1 1 */
43646 -7, /* 0 -1 */
43647 0, /* 0 0 */
43648 7, /* 0 1 */
43649 5, /* 1 -1 */
43650 1, /* 1 0 */
43651 3 /* 1 1 */
43652 ];
43653
43654 var jsf = getJSF(coeffs[a], coeffs[b]);
43655 max = Math.max(jsf[0].length, max);
43656 naf[a] = new Array(max);
43657 naf[b] = new Array(max);
43658 for (var j = 0; j < max; j++) {
43659 var ja = jsf[0][j] | 0;
43660 var jb = jsf[1][j] | 0;
43661
43662 naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];
43663 naf[b][j] = 0;
43664 wnd[a] = comb;
43665 }
43666 }
43667
43668 var acc = this.jpoint(null, null, null);
43669 var tmp = this._wnafT4;
43670 for (var i = max; i >= 0; i--) {
43671 var k = 0;
43672
43673 while (i >= 0) {
43674 var zero = true;
43675 for (var j = 0; j < len; j++) {
43676 tmp[j] = naf[j][i] | 0;
43677 if (tmp[j] !== 0)
43678 zero = false;
43679 }
43680 if (!zero)
43681 break;
43682 k++;
43683 i--;
43684 }
43685 if (i >= 0)
43686 k++;
43687 acc = acc.dblp(k);
43688 if (i < 0)
43689 break;
43690
43691 for (var j = 0; j < len; j++) {
43692 var z = tmp[j];
43693 var p;
43694 if (z === 0)
43695 continue;
43696 else if (z > 0)
43697 p = wnd[j][(z - 1) >> 1];
43698 else if (z < 0)
43699 p = wnd[j][(-z - 1) >> 1].neg();
43700
43701 if (p.type === 'affine')
43702 acc = acc.mixedAdd(p);
43703 else
43704 acc = acc.add(p);
43705 }
43706 }
43707 // Zeroify references
43708 for (var i = 0; i < len; i++)
43709 wnd[i] = null;
43710
43711 if (jacobianResult)
43712 return acc;
43713 else
43714 return acc.toP();
43715};
43716
43717function BasePoint(curve, type) {
43718 this.curve = curve;
43719 this.type = type;
43720 this.precomputed = null;
43721}
43722BaseCurve.BasePoint = BasePoint;
43723
43724BasePoint.prototype.eq = function eq(/*other*/) {
43725 throw new Error('Not implemented');
43726};
43727
43728BasePoint.prototype.validate = function validate() {
43729 return this.curve.validate(this);
43730};
43731
43732BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
43733 bytes = utils.toArray(bytes, enc);
43734
43735 var len = this.p.byteLength();
43736
43737 // uncompressed, hybrid-odd, hybrid-even
43738 if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&
43739 bytes.length - 1 === 2 * len) {
43740 if (bytes[0] === 0x06)
43741 assert(bytes[bytes.length - 1] % 2 === 0);
43742 else if (bytes[0] === 0x07)
43743 assert(bytes[bytes.length - 1] % 2 === 1);
43744
43745 var res = this.point(bytes.slice(1, 1 + len),
43746 bytes.slice(1 + len, 1 + 2 * len));
43747
43748 return res;
43749 } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&
43750 bytes.length - 1 === len) {
43751 return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);
43752 }
43753 throw new Error('Unknown point format');
43754};
43755
43756BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {
43757 return this.encode(enc, true);
43758};
43759
43760BasePoint.prototype._encode = function _encode(compact) {
43761 var len = this.curve.p.byteLength();
43762 var x = this.getX().toArray('be', len);
43763
43764 if (compact)
43765 return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);
43766
43767 return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ;
43768};
43769
43770BasePoint.prototype.encode = function encode(enc, compact) {
43771 return utils.encode(this._encode(compact), enc);
43772};
43773
43774BasePoint.prototype.precompute = function precompute(power) {
43775 if (this.precomputed)
43776 return this;
43777
43778 var precomputed = {
43779 doubles: null,
43780 naf: null,
43781 beta: null
43782 };
43783 precomputed.naf = this._getNAFPoints(8);
43784 precomputed.doubles = this._getDoubles(4, power);
43785 precomputed.beta = this._getBeta();
43786 this.precomputed = precomputed;
43787
43788 return this;
43789};
43790
43791BasePoint.prototype._hasDoubles = function _hasDoubles(k) {
43792 if (!this.precomputed)
43793 return false;
43794
43795 var doubles = this.precomputed.doubles;
43796 if (!doubles)
43797 return false;
43798
43799 return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
43800};
43801
43802BasePoint.prototype._getDoubles = function _getDoubles(step, power) {
43803 if (this.precomputed && this.precomputed.doubles)
43804 return this.precomputed.doubles;
43805
43806 var doubles = [ this ];
43807 var acc = this;
43808 for (var i = 0; i < power; i += step) {
43809 for (var j = 0; j < step; j++)
43810 acc = acc.dbl();
43811 doubles.push(acc);
43812 }
43813 return {
43814 step: step,
43815 points: doubles
43816 };
43817};
43818
43819BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {
43820 if (this.precomputed && this.precomputed.naf)
43821 return this.precomputed.naf;
43822
43823 var res = [ this ];
43824 var max = (1 << wnd) - 1;
43825 var dbl = max === 1 ? null : this.dbl();
43826 for (var i = 1; i < max; i++)
43827 res[i] = res[i - 1].add(dbl);
43828 return {
43829 wnd: wnd,
43830 points: res
43831 };
43832};
43833
43834BasePoint.prototype._getBeta = function _getBeta() {
43835 return null;
43836};
43837
43838BasePoint.prototype.dblp = function dblp(k) {
43839 var r = this;
43840 for (var i = 0; i < k; i++)
43841 r = r.dbl();
43842 return r;
43843};
43844
43845},{"../../elliptic":97,"bn.js":81}],99:[function(require,module,exports){
43846'use strict';
43847
43848var curve = require('../curve');
43849var elliptic = require('../../elliptic');
43850var BN = require('bn.js');
43851var inherits = require('inherits');
43852var Base = curve.base;
43853
43854var assert = elliptic.utils.assert;
43855
43856function EdwardsCurve(conf) {
43857 // NOTE: Important as we are creating point in Base.call()
43858 this.twisted = (conf.a | 0) !== 1;
43859 this.mOneA = this.twisted && (conf.a | 0) === -1;
43860 this.extended = this.mOneA;
43861
43862 Base.call(this, 'edwards', conf);
43863
43864 this.a = new BN(conf.a, 16).umod(this.red.m);
43865 this.a = this.a.toRed(this.red);
43866 this.c = new BN(conf.c, 16).toRed(this.red);
43867 this.c2 = this.c.redSqr();
43868 this.d = new BN(conf.d, 16).toRed(this.red);
43869 this.dd = this.d.redAdd(this.d);
43870
43871 assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);
43872 this.oneC = (conf.c | 0) === 1;
43873}
43874inherits(EdwardsCurve, Base);
43875module.exports = EdwardsCurve;
43876
43877EdwardsCurve.prototype._mulA = function _mulA(num) {
43878 if (this.mOneA)
43879 return num.redNeg();
43880 else
43881 return this.a.redMul(num);
43882};
43883
43884EdwardsCurve.prototype._mulC = function _mulC(num) {
43885 if (this.oneC)
43886 return num;
43887 else
43888 return this.c.redMul(num);
43889};
43890
43891// Just for compatibility with Short curve
43892EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {
43893 return this.point(x, y, z, t);
43894};
43895
43896EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
43897 x = new BN(x, 16);
43898 if (!x.red)
43899 x = x.toRed(this.red);
43900
43901 var x2 = x.redSqr();
43902 var rhs = this.c2.redSub(this.a.redMul(x2));
43903 var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
43904
43905 var y2 = rhs.redMul(lhs.redInvm());
43906 var y = y2.redSqrt();
43907 if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
43908 throw new Error('invalid point');
43909
43910 var isOdd = y.fromRed().isOdd();
43911 if (odd && !isOdd || !odd && isOdd)
43912 y = y.redNeg();
43913
43914 return this.point(x, y);
43915};
43916
43917EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
43918 y = new BN(y, 16);
43919 if (!y.red)
43920 y = y.toRed(this.red);
43921
43922 // x^2 = (y^2 - 1) / (d y^2 + 1)
43923 var y2 = y.redSqr();
43924 var lhs = y2.redSub(this.one);
43925 var rhs = y2.redMul(this.d).redAdd(this.one);
43926 var x2 = lhs.redMul(rhs.redInvm());
43927
43928 if (x2.cmp(this.zero) === 0) {
43929 if (odd)
43930 throw new Error('invalid point');
43931 else
43932 return this.point(this.zero, y);
43933 }
43934
43935 var x = x2.redSqrt();
43936 if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)
43937 throw new Error('invalid point');
43938
43939 if (x.isOdd() !== odd)
43940 x = x.redNeg();
43941
43942 return this.point(x, y);
43943};
43944
43945EdwardsCurve.prototype.validate = function validate(point) {
43946 if (point.isInfinity())
43947 return true;
43948
43949 // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)
43950 point.normalize();
43951
43952 var x2 = point.x.redSqr();
43953 var y2 = point.y.redSqr();
43954 var lhs = x2.redMul(this.a).redAdd(y2);
43955 var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
43956
43957 return lhs.cmp(rhs) === 0;
43958};
43959
43960function Point(curve, x, y, z, t) {
43961 Base.BasePoint.call(this, curve, 'projective');
43962 if (x === null && y === null && z === null) {
43963 this.x = this.curve.zero;
43964 this.y = this.curve.one;
43965 this.z = this.curve.one;
43966 this.t = this.curve.zero;
43967 this.zOne = true;
43968 } else {
43969 this.x = new BN(x, 16);
43970 this.y = new BN(y, 16);
43971 this.z = z ? new BN(z, 16) : this.curve.one;
43972 this.t = t && new BN(t, 16);
43973 if (!this.x.red)
43974 this.x = this.x.toRed(this.curve.red);
43975 if (!this.y.red)
43976 this.y = this.y.toRed(this.curve.red);
43977 if (!this.z.red)
43978 this.z = this.z.toRed(this.curve.red);
43979 if (this.t && !this.t.red)
43980 this.t = this.t.toRed(this.curve.red);
43981 this.zOne = this.z === this.curve.one;
43982
43983 // Use extended coordinates
43984 if (this.curve.extended && !this.t) {
43985 this.t = this.x.redMul(this.y);
43986 if (!this.zOne)
43987 this.t = this.t.redMul(this.z.redInvm());
43988 }
43989 }
43990}
43991inherits(Point, Base.BasePoint);
43992
43993EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
43994 return Point.fromJSON(this, obj);
43995};
43996
43997EdwardsCurve.prototype.point = function point(x, y, z, t) {
43998 return new Point(this, x, y, z, t);
43999};
44000
44001Point.fromJSON = function fromJSON(curve, obj) {
44002 return new Point(curve, obj[0], obj[1], obj[2]);
44003};
44004
44005Point.prototype.inspect = function inspect() {
44006 if (this.isInfinity())
44007 return '<EC Point Infinity>';
44008 return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
44009 ' y: ' + this.y.fromRed().toString(16, 2) +
44010 ' z: ' + this.z.fromRed().toString(16, 2) + '>';
44011};
44012
44013Point.prototype.isInfinity = function isInfinity() {
44014 // XXX This code assumes that zero is always zero in red
44015 return this.x.cmpn(0) === 0 &&
44016 this.y.cmp(this.z) === 0;
44017};
44018
44019Point.prototype._extDbl = function _extDbl() {
44020 // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
44021 // #doubling-dbl-2008-hwcd
44022 // 4M + 4S
44023
44024 // A = X1^2
44025 var a = this.x.redSqr();
44026 // B = Y1^2
44027 var b = this.y.redSqr();
44028 // C = 2 * Z1^2
44029 var c = this.z.redSqr();
44030 c = c.redIAdd(c);
44031 // D = a * A
44032 var d = this.curve._mulA(a);
44033 // E = (X1 + Y1)^2 - A - B
44034 var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);
44035 // G = D + B
44036 var g = d.redAdd(b);
44037 // F = G - C
44038 var f = g.redSub(c);
44039 // H = D - B
44040 var h = d.redSub(b);
44041 // X3 = E * F
44042 var nx = e.redMul(f);
44043 // Y3 = G * H
44044 var ny = g.redMul(h);
44045 // T3 = E * H
44046 var nt = e.redMul(h);
44047 // Z3 = F * G
44048 var nz = f.redMul(g);
44049 return this.curve.point(nx, ny, nz, nt);
44050};
44051
44052Point.prototype._projDbl = function _projDbl() {
44053 // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
44054 // #doubling-dbl-2008-bbjlp
44055 // #doubling-dbl-2007-bl
44056 // and others
44057 // Generally 3M + 4S or 2M + 4S
44058
44059 // B = (X1 + Y1)^2
44060 var b = this.x.redAdd(this.y).redSqr();
44061 // C = X1^2
44062 var c = this.x.redSqr();
44063 // D = Y1^2
44064 var d = this.y.redSqr();
44065
44066 var nx;
44067 var ny;
44068 var nz;
44069 if (this.curve.twisted) {
44070 // E = a * C
44071 var e = this.curve._mulA(c);
44072 // F = E + D
44073 var f = e.redAdd(d);
44074 if (this.zOne) {
44075 // X3 = (B - C - D) * (F - 2)
44076 nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));
44077 // Y3 = F * (E - D)
44078 ny = f.redMul(e.redSub(d));
44079 // Z3 = F^2 - 2 * F
44080 nz = f.redSqr().redSub(f).redSub(f);
44081 } else {
44082 // H = Z1^2
44083 var h = this.z.redSqr();
44084 // J = F - 2 * H
44085 var j = f.redSub(h).redISub(h);
44086 // X3 = (B-C-D)*J
44087 nx = b.redSub(c).redISub(d).redMul(j);
44088 // Y3 = F * (E - D)
44089 ny = f.redMul(e.redSub(d));
44090 // Z3 = F * J
44091 nz = f.redMul(j);
44092 }
44093 } else {
44094 // E = C + D
44095 var e = c.redAdd(d);
44096 // H = (c * Z1)^2
44097 var h = this.curve._mulC(this.c.redMul(this.z)).redSqr();
44098 // J = E - 2 * H
44099 var j = e.redSub(h).redSub(h);
44100 // X3 = c * (B - E) * J
44101 nx = this.curve._mulC(b.redISub(e)).redMul(j);
44102 // Y3 = c * E * (C - D)
44103 ny = this.curve._mulC(e).redMul(c.redISub(d));
44104 // Z3 = E * J
44105 nz = e.redMul(j);
44106 }
44107 return this.curve.point(nx, ny, nz);
44108};
44109
44110Point.prototype.dbl = function dbl() {
44111 if (this.isInfinity())
44112 return this;
44113
44114 // Double in extended coordinates
44115 if (this.curve.extended)
44116 return this._extDbl();
44117 else
44118 return this._projDbl();
44119};
44120
44121Point.prototype._extAdd = function _extAdd(p) {
44122 // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
44123 // #addition-add-2008-hwcd-3
44124 // 8M
44125
44126 // A = (Y1 - X1) * (Y2 - X2)
44127 var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));
44128 // B = (Y1 + X1) * (Y2 + X2)
44129 var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));
44130 // C = T1 * k * T2
44131 var c = this.t.redMul(this.curve.dd).redMul(p.t);
44132 // D = Z1 * 2 * Z2
44133 var d = this.z.redMul(p.z.redAdd(p.z));
44134 // E = B - A
44135 var e = b.redSub(a);
44136 // F = D - C
44137 var f = d.redSub(c);
44138 // G = D + C
44139 var g = d.redAdd(c);
44140 // H = B + A
44141 var h = b.redAdd(a);
44142 // X3 = E * F
44143 var nx = e.redMul(f);
44144 // Y3 = G * H
44145 var ny = g.redMul(h);
44146 // T3 = E * H
44147 var nt = e.redMul(h);
44148 // Z3 = F * G
44149 var nz = f.redMul(g);
44150 return this.curve.point(nx, ny, nz, nt);
44151};
44152
44153Point.prototype._projAdd = function _projAdd(p) {
44154 // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
44155 // #addition-add-2008-bbjlp
44156 // #addition-add-2007-bl
44157 // 10M + 1S
44158
44159 // A = Z1 * Z2
44160 var a = this.z.redMul(p.z);
44161 // B = A^2
44162 var b = a.redSqr();
44163 // C = X1 * X2
44164 var c = this.x.redMul(p.x);
44165 // D = Y1 * Y2
44166 var d = this.y.redMul(p.y);
44167 // E = d * C * D
44168 var e = this.curve.d.redMul(c).redMul(d);
44169 // F = B - E
44170 var f = b.redSub(e);
44171 // G = B + E
44172 var g = b.redAdd(e);
44173 // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)
44174 var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);
44175 var nx = a.redMul(f).redMul(tmp);
44176 var ny;
44177 var nz;
44178 if (this.curve.twisted) {
44179 // Y3 = A * G * (D - a * C)
44180 ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));
44181 // Z3 = F * G
44182 nz = f.redMul(g);
44183 } else {
44184 // Y3 = A * G * (D - C)
44185 ny = a.redMul(g).redMul(d.redSub(c));
44186 // Z3 = c * F * G
44187 nz = this.curve._mulC(f).redMul(g);
44188 }
44189 return this.curve.point(nx, ny, nz);
44190};
44191
44192Point.prototype.add = function add(p) {
44193 if (this.isInfinity())
44194 return p;
44195 if (p.isInfinity())
44196 return this;
44197
44198 if (this.curve.extended)
44199 return this._extAdd(p);
44200 else
44201 return this._projAdd(p);
44202};
44203
44204Point.prototype.mul = function mul(k) {
44205 if (this._hasDoubles(k))
44206 return this.curve._fixedNafMul(this, k);
44207 else
44208 return this.curve._wnafMul(this, k);
44209};
44210
44211Point.prototype.mulAdd = function mulAdd(k1, p, k2) {
44212 return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);
44213};
44214
44215Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) {
44216 return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);
44217};
44218
44219Point.prototype.normalize = function normalize() {
44220 if (this.zOne)
44221 return this;
44222
44223 // Normalize coordinates
44224 var zi = this.z.redInvm();
44225 this.x = this.x.redMul(zi);
44226 this.y = this.y.redMul(zi);
44227 if (this.t)
44228 this.t = this.t.redMul(zi);
44229 this.z = this.curve.one;
44230 this.zOne = true;
44231 return this;
44232};
44233
44234Point.prototype.neg = function neg() {
44235 return this.curve.point(this.x.redNeg(),
44236 this.y,
44237 this.z,
44238 this.t && this.t.redNeg());
44239};
44240
44241Point.prototype.getX = function getX() {
44242 this.normalize();
44243 return this.x.fromRed();
44244};
44245
44246Point.prototype.getY = function getY() {
44247 this.normalize();
44248 return this.y.fromRed();
44249};
44250
44251Point.prototype.eq = function eq(other) {
44252 return this === other ||
44253 this.getX().cmp(other.getX()) === 0 &&
44254 this.getY().cmp(other.getY()) === 0;
44255};
44256
44257Point.prototype.eqXToP = function eqXToP(x) {
44258 var rx = x.toRed(this.curve.red).redMul(this.z);
44259 if (this.x.cmp(rx) === 0)
44260 return true;
44261
44262 var xc = x.clone();
44263 var t = this.curve.redN.redMul(this.z);
44264 for (;;) {
44265 xc.iadd(this.curve.n);
44266 if (xc.cmp(this.curve.p) >= 0)
44267 return false;
44268
44269 rx.redIAdd(t);
44270 if (this.x.cmp(rx) === 0)
44271 return true;
44272 }
44273 return false;
44274};
44275
44276// Compatibility with BaseCurve
44277Point.prototype.toP = Point.prototype.normalize;
44278Point.prototype.mixedAdd = Point.prototype.add;
44279
44280},{"../../elliptic":97,"../curve":100,"bn.js":81,"inherits":121}],100:[function(require,module,exports){
44281'use strict';
44282
44283var curve = exports;
44284
44285curve.base = require('./base');
44286curve.short = require('./short');
44287curve.mont = require('./mont');
44288curve.edwards = require('./edwards');
44289
44290},{"./base":98,"./edwards":99,"./mont":101,"./short":102}],101:[function(require,module,exports){
44291'use strict';
44292
44293var curve = require('../curve');
44294var BN = require('bn.js');
44295var inherits = require('inherits');
44296var Base = curve.base;
44297
44298var elliptic = require('../../elliptic');
44299var utils = elliptic.utils;
44300
44301function MontCurve(conf) {
44302 Base.call(this, 'mont', conf);
44303
44304 this.a = new BN(conf.a, 16).toRed(this.red);
44305 this.b = new BN(conf.b, 16).toRed(this.red);
44306 this.i4 = new BN(4).toRed(this.red).redInvm();
44307 this.two = new BN(2).toRed(this.red);
44308 this.a24 = this.i4.redMul(this.a.redAdd(this.two));
44309}
44310inherits(MontCurve, Base);
44311module.exports = MontCurve;
44312
44313MontCurve.prototype.validate = function validate(point) {
44314 var x = point.normalize().x;
44315 var x2 = x.redSqr();
44316 var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);
44317 var y = rhs.redSqrt();
44318
44319 return y.redSqr().cmp(rhs) === 0;
44320};
44321
44322function Point(curve, x, z) {
44323 Base.BasePoint.call(this, curve, 'projective');
44324 if (x === null && z === null) {
44325 this.x = this.curve.one;
44326 this.z = this.curve.zero;
44327 } else {
44328 this.x = new BN(x, 16);
44329 this.z = new BN(z, 16);
44330 if (!this.x.red)
44331 this.x = this.x.toRed(this.curve.red);
44332 if (!this.z.red)
44333 this.z = this.z.toRed(this.curve.red);
44334 }
44335}
44336inherits(Point, Base.BasePoint);
44337
44338MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
44339 return this.point(utils.toArray(bytes, enc), 1);
44340};
44341
44342MontCurve.prototype.point = function point(x, z) {
44343 return new Point(this, x, z);
44344};
44345
44346MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
44347 return Point.fromJSON(this, obj);
44348};
44349
44350Point.prototype.precompute = function precompute() {
44351 // No-op
44352};
44353
44354Point.prototype._encode = function _encode() {
44355 return this.getX().toArray('be', this.curve.p.byteLength());
44356};
44357
44358Point.fromJSON = function fromJSON(curve, obj) {
44359 return new Point(curve, obj[0], obj[1] || curve.one);
44360};
44361
44362Point.prototype.inspect = function inspect() {
44363 if (this.isInfinity())
44364 return '<EC Point Infinity>';
44365 return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
44366 ' z: ' + this.z.fromRed().toString(16, 2) + '>';
44367};
44368
44369Point.prototype.isInfinity = function isInfinity() {
44370 // XXX This code assumes that zero is always zero in red
44371 return this.z.cmpn(0) === 0;
44372};
44373
44374Point.prototype.dbl = function dbl() {
44375 // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3
44376 // 2M + 2S + 4A
44377
44378 // A = X1 + Z1
44379 var a = this.x.redAdd(this.z);
44380 // AA = A^2
44381 var aa = a.redSqr();
44382 // B = X1 - Z1
44383 var b = this.x.redSub(this.z);
44384 // BB = B^2
44385 var bb = b.redSqr();
44386 // C = AA - BB
44387 var c = aa.redSub(bb);
44388 // X3 = AA * BB
44389 var nx = aa.redMul(bb);
44390 // Z3 = C * (BB + A24 * C)
44391 var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));
44392 return this.curve.point(nx, nz);
44393};
44394
44395Point.prototype.add = function add() {
44396 throw new Error('Not supported on Montgomery curve');
44397};
44398
44399Point.prototype.diffAdd = function diffAdd(p, diff) {
44400 // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3
44401 // 4M + 2S + 6A
44402
44403 // A = X2 + Z2
44404 var a = this.x.redAdd(this.z);
44405 // B = X2 - Z2
44406 var b = this.x.redSub(this.z);
44407 // C = X3 + Z3
44408 var c = p.x.redAdd(p.z);
44409 // D = X3 - Z3
44410 var d = p.x.redSub(p.z);
44411 // DA = D * A
44412 var da = d.redMul(a);
44413 // CB = C * B
44414 var cb = c.redMul(b);
44415 // X5 = Z1 * (DA + CB)^2
44416 var nx = diff.z.redMul(da.redAdd(cb).redSqr());
44417 // Z5 = X1 * (DA - CB)^2
44418 var nz = diff.x.redMul(da.redISub(cb).redSqr());
44419 return this.curve.point(nx, nz);
44420};
44421
44422Point.prototype.mul = function mul(k) {
44423 var t = k.clone();
44424 var a = this; // (N / 2) * Q + Q
44425 var b = this.curve.point(null, null); // (N / 2) * Q
44426 var c = this; // Q
44427
44428 for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))
44429 bits.push(t.andln(1));
44430
44431 for (var i = bits.length - 1; i >= 0; i--) {
44432 if (bits[i] === 0) {
44433 // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q
44434 a = a.diffAdd(b, c);
44435 // N * Q = 2 * ((N / 2) * Q + Q))
44436 b = b.dbl();
44437 } else {
44438 // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)
44439 b = a.diffAdd(b, c);
44440 // N * Q + Q = 2 * ((N / 2) * Q + Q)
44441 a = a.dbl();
44442 }
44443 }
44444 return b;
44445};
44446
44447Point.prototype.mulAdd = function mulAdd() {
44448 throw new Error('Not supported on Montgomery curve');
44449};
44450
44451Point.prototype.jumlAdd = function jumlAdd() {
44452 throw new Error('Not supported on Montgomery curve');
44453};
44454
44455Point.prototype.eq = function eq(other) {
44456 return this.getX().cmp(other.getX()) === 0;
44457};
44458
44459Point.prototype.normalize = function normalize() {
44460 this.x = this.x.redMul(this.z.redInvm());
44461 this.z = this.curve.one;
44462 return this;
44463};
44464
44465Point.prototype.getX = function getX() {
44466 // Normalize coordinates
44467 this.normalize();
44468
44469 return this.x.fromRed();
44470};
44471
44472},{"../../elliptic":97,"../curve":100,"bn.js":81,"inherits":121}],102:[function(require,module,exports){
44473'use strict';
44474
44475var curve = require('../curve');
44476var elliptic = require('../../elliptic');
44477var BN = require('bn.js');
44478var inherits = require('inherits');
44479var Base = curve.base;
44480
44481var assert = elliptic.utils.assert;
44482
44483function ShortCurve(conf) {
44484 Base.call(this, 'short', conf);
44485
44486 this.a = new BN(conf.a, 16).toRed(this.red);
44487 this.b = new BN(conf.b, 16).toRed(this.red);
44488 this.tinv = this.two.redInvm();
44489
44490 this.zeroA = this.a.fromRed().cmpn(0) === 0;
44491 this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;
44492
44493 // If the curve is endomorphic, precalculate beta and lambda
44494 this.endo = this._getEndomorphism(conf);
44495 this._endoWnafT1 = new Array(4);
44496 this._endoWnafT2 = new Array(4);
44497}
44498inherits(ShortCurve, Base);
44499module.exports = ShortCurve;
44500
44501ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
44502 // No efficient endomorphism
44503 if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)
44504 return;
44505
44506 // Compute beta and lambda, that lambda * P = (beta * Px; Py)
44507 var beta;
44508 var lambda;
44509 if (conf.beta) {
44510 beta = new BN(conf.beta, 16).toRed(this.red);
44511 } else {
44512 var betas = this._getEndoRoots(this.p);
44513 // Choose the smallest beta
44514 beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];
44515 beta = beta.toRed(this.red);
44516 }
44517 if (conf.lambda) {
44518 lambda = new BN(conf.lambda, 16);
44519 } else {
44520 // Choose the lambda that is matching selected beta
44521 var lambdas = this._getEndoRoots(this.n);
44522 if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {
44523 lambda = lambdas[0];
44524 } else {
44525 lambda = lambdas[1];
44526 assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);
44527 }
44528 }
44529
44530 // Get basis vectors, used for balanced length-two representation
44531 var basis;
44532 if (conf.basis) {
44533 basis = conf.basis.map(function(vec) {
44534 return {
44535 a: new BN(vec.a, 16),
44536 b: new BN(vec.b, 16)
44537 };
44538 });
44539 } else {
44540 basis = this._getEndoBasis(lambda);
44541 }
44542
44543 return {
44544 beta: beta,
44545 lambda: lambda,
44546 basis: basis
44547 };
44548};
44549
44550ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {
44551 // Find roots of for x^2 + x + 1 in F
44552 // Root = (-1 +- Sqrt(-3)) / 2
44553 //
44554 var red = num === this.p ? this.red : BN.mont(num);
44555 var tinv = new BN(2).toRed(red).redInvm();
44556 var ntinv = tinv.redNeg();
44557
44558 var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);
44559
44560 var l1 = ntinv.redAdd(s).fromRed();
44561 var l2 = ntinv.redSub(s).fromRed();
44562 return [ l1, l2 ];
44563};
44564
44565ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {
44566 // aprxSqrt >= sqrt(this.n)
44567 var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));
44568
44569 // 3.74
44570 // Run EGCD, until r(L + 1) < aprxSqrt
44571 var u = lambda;
44572 var v = this.n.clone();
44573 var x1 = new BN(1);
44574 var y1 = new BN(0);
44575 var x2 = new BN(0);
44576 var y2 = new BN(1);
44577
44578 // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)
44579 var a0;
44580 var b0;
44581 // First vector
44582 var a1;
44583 var b1;
44584 // Second vector
44585 var a2;
44586 var b2;
44587
44588 var prevR;
44589 var i = 0;
44590 var r;
44591 var x;
44592 while (u.cmpn(0) !== 0) {
44593 var q = v.div(u);
44594 r = v.sub(q.mul(u));
44595 x = x2.sub(q.mul(x1));
44596 var y = y2.sub(q.mul(y1));
44597
44598 if (!a1 && r.cmp(aprxSqrt) < 0) {
44599 a0 = prevR.neg();
44600 b0 = x1;
44601 a1 = r.neg();
44602 b1 = x;
44603 } else if (a1 && ++i === 2) {
44604 break;
44605 }
44606 prevR = r;
44607
44608 v = u;
44609 u = r;
44610 x2 = x1;
44611 x1 = x;
44612 y2 = y1;
44613 y1 = y;
44614 }
44615 a2 = r.neg();
44616 b2 = x;
44617
44618 var len1 = a1.sqr().add(b1.sqr());
44619 var len2 = a2.sqr().add(b2.sqr());
44620 if (len2.cmp(len1) >= 0) {
44621 a2 = a0;
44622 b2 = b0;
44623 }
44624
44625 // Normalize signs
44626 if (a1.negative) {
44627 a1 = a1.neg();
44628 b1 = b1.neg();
44629 }
44630 if (a2.negative) {
44631 a2 = a2.neg();
44632 b2 = b2.neg();
44633 }
44634
44635 return [
44636 { a: a1, b: b1 },
44637 { a: a2, b: b2 }
44638 ];
44639};
44640
44641ShortCurve.prototype._endoSplit = function _endoSplit(k) {
44642 var basis = this.endo.basis;
44643 var v1 = basis[0];
44644 var v2 = basis[1];
44645
44646 var c1 = v2.b.mul(k).divRound(this.n);
44647 var c2 = v1.b.neg().mul(k).divRound(this.n);
44648
44649 var p1 = c1.mul(v1.a);
44650 var p2 = c2.mul(v2.a);
44651 var q1 = c1.mul(v1.b);
44652 var q2 = c2.mul(v2.b);
44653
44654 // Calculate answer
44655 var k1 = k.sub(p1).sub(p2);
44656 var k2 = q1.add(q2).neg();
44657 return { k1: k1, k2: k2 };
44658};
44659
44660ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {
44661 x = new BN(x, 16);
44662 if (!x.red)
44663 x = x.toRed(this.red);
44664
44665 var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);
44666 var y = y2.redSqrt();
44667 if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
44668 throw new Error('invalid point');
44669
44670 // XXX Is there any way to tell if the number is odd without converting it
44671 // to non-red form?
44672 var isOdd = y.fromRed().isOdd();
44673 if (odd && !isOdd || !odd && isOdd)
44674 y = y.redNeg();
44675
44676 return this.point(x, y);
44677};
44678
44679ShortCurve.prototype.validate = function validate(point) {
44680 if (point.inf)
44681 return true;
44682
44683 var x = point.x;
44684 var y = point.y;
44685
44686 var ax = this.a.redMul(x);
44687 var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);
44688 return y.redSqr().redISub(rhs).cmpn(0) === 0;
44689};
44690
44691ShortCurve.prototype._endoWnafMulAdd =
44692 function _endoWnafMulAdd(points, coeffs, jacobianResult) {
44693 var npoints = this._endoWnafT1;
44694 var ncoeffs = this._endoWnafT2;
44695 for (var i = 0; i < points.length; i++) {
44696 var split = this._endoSplit(coeffs[i]);
44697 var p = points[i];
44698 var beta = p._getBeta();
44699
44700 if (split.k1.negative) {
44701 split.k1.ineg();
44702 p = p.neg(true);
44703 }
44704 if (split.k2.negative) {
44705 split.k2.ineg();
44706 beta = beta.neg(true);
44707 }
44708
44709 npoints[i * 2] = p;
44710 npoints[i * 2 + 1] = beta;
44711 ncoeffs[i * 2] = split.k1;
44712 ncoeffs[i * 2 + 1] = split.k2;
44713 }
44714 var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);
44715
44716 // Clean-up references to points and coefficients
44717 for (var j = 0; j < i * 2; j++) {
44718 npoints[j] = null;
44719 ncoeffs[j] = null;
44720 }
44721 return res;
44722};
44723
44724function Point(curve, x, y, isRed) {
44725 Base.BasePoint.call(this, curve, 'affine');
44726 if (x === null && y === null) {
44727 this.x = null;
44728 this.y = null;
44729 this.inf = true;
44730 } else {
44731 this.x = new BN(x, 16);
44732 this.y = new BN(y, 16);
44733 // Force redgomery representation when loading from JSON
44734 if (isRed) {
44735 this.x.forceRed(this.curve.red);
44736 this.y.forceRed(this.curve.red);
44737 }
44738 if (!this.x.red)
44739 this.x = this.x.toRed(this.curve.red);
44740 if (!this.y.red)
44741 this.y = this.y.toRed(this.curve.red);
44742 this.inf = false;
44743 }
44744}
44745inherits(Point, Base.BasePoint);
44746
44747ShortCurve.prototype.point = function point(x, y, isRed) {
44748 return new Point(this, x, y, isRed);
44749};
44750
44751ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {
44752 return Point.fromJSON(this, obj, red);
44753};
44754
44755Point.prototype._getBeta = function _getBeta() {
44756 if (!this.curve.endo)
44757 return;
44758
44759 var pre = this.precomputed;
44760 if (pre && pre.beta)
44761 return pre.beta;
44762
44763 var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
44764 if (pre) {
44765 var curve = this.curve;
44766 var endoMul = function(p) {
44767 return curve.point(p.x.redMul(curve.endo.beta), p.y);
44768 };
44769 pre.beta = beta;
44770 beta.precomputed = {
44771 beta: null,
44772 naf: pre.naf && {
44773 wnd: pre.naf.wnd,
44774 points: pre.naf.points.map(endoMul)
44775 },
44776 doubles: pre.doubles && {
44777 step: pre.doubles.step,
44778 points: pre.doubles.points.map(endoMul)
44779 }
44780 };
44781 }
44782 return beta;
44783};
44784
44785Point.prototype.toJSON = function toJSON() {
44786 if (!this.precomputed)
44787 return [ this.x, this.y ];
44788
44789 return [ this.x, this.y, this.precomputed && {
44790 doubles: this.precomputed.doubles && {
44791 step: this.precomputed.doubles.step,
44792 points: this.precomputed.doubles.points.slice(1)
44793 },
44794 naf: this.precomputed.naf && {
44795 wnd: this.precomputed.naf.wnd,
44796 points: this.precomputed.naf.points.slice(1)
44797 }
44798 } ];
44799};
44800
44801Point.fromJSON = function fromJSON(curve, obj, red) {
44802 if (typeof obj === 'string')
44803 obj = JSON.parse(obj);
44804 var res = curve.point(obj[0], obj[1], red);
44805 if (!obj[2])
44806 return res;
44807
44808 function obj2point(obj) {
44809 return curve.point(obj[0], obj[1], red);
44810 }
44811
44812 var pre = obj[2];
44813 res.precomputed = {
44814 beta: null,
44815 doubles: pre.doubles && {
44816 step: pre.doubles.step,
44817 points: [ res ].concat(pre.doubles.points.map(obj2point))
44818 },
44819 naf: pre.naf && {
44820 wnd: pre.naf.wnd,
44821 points: [ res ].concat(pre.naf.points.map(obj2point))
44822 }
44823 };
44824 return res;
44825};
44826
44827Point.prototype.inspect = function inspect() {
44828 if (this.isInfinity())
44829 return '<EC Point Infinity>';
44830 return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
44831 ' y: ' + this.y.fromRed().toString(16, 2) + '>';
44832};
44833
44834Point.prototype.isInfinity = function isInfinity() {
44835 return this.inf;
44836};
44837
44838Point.prototype.add = function add(p) {
44839 // O + P = P
44840 if (this.inf)
44841 return p;
44842
44843 // P + O = P
44844 if (p.inf)
44845 return this;
44846
44847 // P + P = 2P
44848 if (this.eq(p))
44849 return this.dbl();
44850
44851 // P + (-P) = O
44852 if (this.neg().eq(p))
44853 return this.curve.point(null, null);
44854
44855 // P + Q = O
44856 if (this.x.cmp(p.x) === 0)
44857 return this.curve.point(null, null);
44858
44859 var c = this.y.redSub(p.y);
44860 if (c.cmpn(0) !== 0)
44861 c = c.redMul(this.x.redSub(p.x).redInvm());
44862 var nx = c.redSqr().redISub(this.x).redISub(p.x);
44863 var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
44864 return this.curve.point(nx, ny);
44865};
44866
44867Point.prototype.dbl = function dbl() {
44868 if (this.inf)
44869 return this;
44870
44871 // 2P = O
44872 var ys1 = this.y.redAdd(this.y);
44873 if (ys1.cmpn(0) === 0)
44874 return this.curve.point(null, null);
44875
44876 var a = this.curve.a;
44877
44878 var x2 = this.x.redSqr();
44879 var dyinv = ys1.redInvm();
44880 var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);
44881
44882 var nx = c.redSqr().redISub(this.x.redAdd(this.x));
44883 var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
44884 return this.curve.point(nx, ny);
44885};
44886
44887Point.prototype.getX = function getX() {
44888 return this.x.fromRed();
44889};
44890
44891Point.prototype.getY = function getY() {
44892 return this.y.fromRed();
44893};
44894
44895Point.prototype.mul = function mul(k) {
44896 k = new BN(k, 16);
44897
44898 if (this._hasDoubles(k))
44899 return this.curve._fixedNafMul(this, k);
44900 else if (this.curve.endo)
44901 return this.curve._endoWnafMulAdd([ this ], [ k ]);
44902 else
44903 return this.curve._wnafMul(this, k);
44904};
44905
44906Point.prototype.mulAdd = function mulAdd(k1, p2, k2) {
44907 var points = [ this, p2 ];
44908 var coeffs = [ k1, k2 ];
44909 if (this.curve.endo)
44910 return this.curve._endoWnafMulAdd(points, coeffs);
44911 else
44912 return this.curve._wnafMulAdd(1, points, coeffs, 2);
44913};
44914
44915Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {
44916 var points = [ this, p2 ];
44917 var coeffs = [ k1, k2 ];
44918 if (this.curve.endo)
44919 return this.curve._endoWnafMulAdd(points, coeffs, true);
44920 else
44921 return this.curve._wnafMulAdd(1, points, coeffs, 2, true);
44922};
44923
44924Point.prototype.eq = function eq(p) {
44925 return this === p ||
44926 this.inf === p.inf &&
44927 (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);
44928};
44929
44930Point.prototype.neg = function neg(_precompute) {
44931 if (this.inf)
44932 return this;
44933
44934 var res = this.curve.point(this.x, this.y.redNeg());
44935 if (_precompute && this.precomputed) {
44936 var pre = this.precomputed;
44937 var negate = function(p) {
44938 return p.neg();
44939 };
44940 res.precomputed = {
44941 naf: pre.naf && {
44942 wnd: pre.naf.wnd,
44943 points: pre.naf.points.map(negate)
44944 },
44945 doubles: pre.doubles && {
44946 step: pre.doubles.step,
44947 points: pre.doubles.points.map(negate)
44948 }
44949 };
44950 }
44951 return res;
44952};
44953
44954Point.prototype.toJ = function toJ() {
44955 if (this.inf)
44956 return this.curve.jpoint(null, null, null);
44957
44958 var res = this.curve.jpoint(this.x, this.y, this.curve.one);
44959 return res;
44960};
44961
44962function JPoint(curve, x, y, z) {
44963 Base.BasePoint.call(this, curve, 'jacobian');
44964 if (x === null && y === null && z === null) {
44965 this.x = this.curve.one;
44966 this.y = this.curve.one;
44967 this.z = new BN(0);
44968 } else {
44969 this.x = new BN(x, 16);
44970 this.y = new BN(y, 16);
44971 this.z = new BN(z, 16);
44972 }
44973 if (!this.x.red)
44974 this.x = this.x.toRed(this.curve.red);
44975 if (!this.y.red)
44976 this.y = this.y.toRed(this.curve.red);
44977 if (!this.z.red)
44978 this.z = this.z.toRed(this.curve.red);
44979
44980 this.zOne = this.z === this.curve.one;
44981}
44982inherits(JPoint, Base.BasePoint);
44983
44984ShortCurve.prototype.jpoint = function jpoint(x, y, z) {
44985 return new JPoint(this, x, y, z);
44986};
44987
44988JPoint.prototype.toP = function toP() {
44989 if (this.isInfinity())
44990 return this.curve.point(null, null);
44991
44992 var zinv = this.z.redInvm();
44993 var zinv2 = zinv.redSqr();
44994 var ax = this.x.redMul(zinv2);
44995 var ay = this.y.redMul(zinv2).redMul(zinv);
44996
44997 return this.curve.point(ax, ay);
44998};
44999
45000JPoint.prototype.neg = function neg() {
45001 return this.curve.jpoint(this.x, this.y.redNeg(), this.z);
45002};
45003
45004JPoint.prototype.add = function add(p) {
45005 // O + P = P
45006 if (this.isInfinity())
45007 return p;
45008
45009 // P + O = P
45010 if (p.isInfinity())
45011 return this;
45012
45013 // 12M + 4S + 7A
45014 var pz2 = p.z.redSqr();
45015 var z2 = this.z.redSqr();
45016 var u1 = this.x.redMul(pz2);
45017 var u2 = p.x.redMul(z2);
45018 var s1 = this.y.redMul(pz2.redMul(p.z));
45019 var s2 = p.y.redMul(z2.redMul(this.z));
45020
45021 var h = u1.redSub(u2);
45022 var r = s1.redSub(s2);
45023 if (h.cmpn(0) === 0) {
45024 if (r.cmpn(0) !== 0)
45025 return this.curve.jpoint(null, null, null);
45026 else
45027 return this.dbl();
45028 }
45029
45030 var h2 = h.redSqr();
45031 var h3 = h2.redMul(h);
45032 var v = u1.redMul(h2);
45033
45034 var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
45035 var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
45036 var nz = this.z.redMul(p.z).redMul(h);
45037
45038 return this.curve.jpoint(nx, ny, nz);
45039};
45040
45041JPoint.prototype.mixedAdd = function mixedAdd(p) {
45042 // O + P = P
45043 if (this.isInfinity())
45044 return p.toJ();
45045
45046 // P + O = P
45047 if (p.isInfinity())
45048 return this;
45049
45050 // 8M + 3S + 7A
45051 var z2 = this.z.redSqr();
45052 var u1 = this.x;
45053 var u2 = p.x.redMul(z2);
45054 var s1 = this.y;
45055 var s2 = p.y.redMul(z2).redMul(this.z);
45056
45057 var h = u1.redSub(u2);
45058 var r = s1.redSub(s2);
45059 if (h.cmpn(0) === 0) {
45060 if (r.cmpn(0) !== 0)
45061 return this.curve.jpoint(null, null, null);
45062 else
45063 return this.dbl();
45064 }
45065
45066 var h2 = h.redSqr();
45067 var h3 = h2.redMul(h);
45068 var v = u1.redMul(h2);
45069
45070 var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
45071 var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
45072 var nz = this.z.redMul(h);
45073
45074 return this.curve.jpoint(nx, ny, nz);
45075};
45076
45077JPoint.prototype.dblp = function dblp(pow) {
45078 if (pow === 0)
45079 return this;
45080 if (this.isInfinity())
45081 return this;
45082 if (!pow)
45083 return this.dbl();
45084
45085 if (this.curve.zeroA || this.curve.threeA) {
45086 var r = this;
45087 for (var i = 0; i < pow; i++)
45088 r = r.dbl();
45089 return r;
45090 }
45091
45092 // 1M + 2S + 1A + N * (4S + 5M + 8A)
45093 // N = 1 => 6M + 6S + 9A
45094 var a = this.curve.a;
45095 var tinv = this.curve.tinv;
45096
45097 var jx = this.x;
45098 var jy = this.y;
45099 var jz = this.z;
45100 var jz4 = jz.redSqr().redSqr();
45101
45102 // Reuse results
45103 var jyd = jy.redAdd(jy);
45104 for (var i = 0; i < pow; i++) {
45105 var jx2 = jx.redSqr();
45106 var jyd2 = jyd.redSqr();
45107 var jyd4 = jyd2.redSqr();
45108 var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
45109
45110 var t1 = jx.redMul(jyd2);
45111 var nx = c.redSqr().redISub(t1.redAdd(t1));
45112 var t2 = t1.redISub(nx);
45113 var dny = c.redMul(t2);
45114 dny = dny.redIAdd(dny).redISub(jyd4);
45115 var nz = jyd.redMul(jz);
45116 if (i + 1 < pow)
45117 jz4 = jz4.redMul(jyd4);
45118
45119 jx = nx;
45120 jz = nz;
45121 jyd = dny;
45122 }
45123
45124 return this.curve.jpoint(jx, jyd.redMul(tinv), jz);
45125};
45126
45127JPoint.prototype.dbl = function dbl() {
45128 if (this.isInfinity())
45129 return this;
45130
45131 if (this.curve.zeroA)
45132 return this._zeroDbl();
45133 else if (this.curve.threeA)
45134 return this._threeDbl();
45135 else
45136 return this._dbl();
45137};
45138
45139JPoint.prototype._zeroDbl = function _zeroDbl() {
45140 var nx;
45141 var ny;
45142 var nz;
45143 // Z = 1
45144 if (this.zOne) {
45145 // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
45146 // #doubling-mdbl-2007-bl
45147 // 1M + 5S + 14A
45148
45149 // XX = X1^2
45150 var xx = this.x.redSqr();
45151 // YY = Y1^2
45152 var yy = this.y.redSqr();
45153 // YYYY = YY^2
45154 var yyyy = yy.redSqr();
45155 // S = 2 * ((X1 + YY)^2 - XX - YYYY)
45156 var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
45157 s = s.redIAdd(s);
45158 // M = 3 * XX + a; a = 0
45159 var m = xx.redAdd(xx).redIAdd(xx);
45160 // T = M ^ 2 - 2*S
45161 var t = m.redSqr().redISub(s).redISub(s);
45162
45163 // 8 * YYYY
45164 var yyyy8 = yyyy.redIAdd(yyyy);
45165 yyyy8 = yyyy8.redIAdd(yyyy8);
45166 yyyy8 = yyyy8.redIAdd(yyyy8);
45167
45168 // X3 = T
45169 nx = t;
45170 // Y3 = M * (S - T) - 8 * YYYY
45171 ny = m.redMul(s.redISub(t)).redISub(yyyy8);
45172 // Z3 = 2*Y1
45173 nz = this.y.redAdd(this.y);
45174 } else {
45175 // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
45176 // #doubling-dbl-2009-l
45177 // 2M + 5S + 13A
45178
45179 // A = X1^2
45180 var a = this.x.redSqr();
45181 // B = Y1^2
45182 var b = this.y.redSqr();
45183 // C = B^2
45184 var c = b.redSqr();
45185 // D = 2 * ((X1 + B)^2 - A - C)
45186 var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);
45187 d = d.redIAdd(d);
45188 // E = 3 * A
45189 var e = a.redAdd(a).redIAdd(a);
45190 // F = E^2
45191 var f = e.redSqr();
45192
45193 // 8 * C
45194 var c8 = c.redIAdd(c);
45195 c8 = c8.redIAdd(c8);
45196 c8 = c8.redIAdd(c8);
45197
45198 // X3 = F - 2 * D
45199 nx = f.redISub(d).redISub(d);
45200 // Y3 = E * (D - X3) - 8 * C
45201 ny = e.redMul(d.redISub(nx)).redISub(c8);
45202 // Z3 = 2 * Y1 * Z1
45203 nz = this.y.redMul(this.z);
45204 nz = nz.redIAdd(nz);
45205 }
45206
45207 return this.curve.jpoint(nx, ny, nz);
45208};
45209
45210JPoint.prototype._threeDbl = function _threeDbl() {
45211 var nx;
45212 var ny;
45213 var nz;
45214 // Z = 1
45215 if (this.zOne) {
45216 // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html
45217 // #doubling-mdbl-2007-bl
45218 // 1M + 5S + 15A
45219
45220 // XX = X1^2
45221 var xx = this.x.redSqr();
45222 // YY = Y1^2
45223 var yy = this.y.redSqr();
45224 // YYYY = YY^2
45225 var yyyy = yy.redSqr();
45226 // S = 2 * ((X1 + YY)^2 - XX - YYYY)
45227 var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
45228 s = s.redIAdd(s);
45229 // M = 3 * XX + a
45230 var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);
45231 // T = M^2 - 2 * S
45232 var t = m.redSqr().redISub(s).redISub(s);
45233 // X3 = T
45234 nx = t;
45235 // Y3 = M * (S - T) - 8 * YYYY
45236 var yyyy8 = yyyy.redIAdd(yyyy);
45237 yyyy8 = yyyy8.redIAdd(yyyy8);
45238 yyyy8 = yyyy8.redIAdd(yyyy8);
45239 ny = m.redMul(s.redISub(t)).redISub(yyyy8);
45240 // Z3 = 2 * Y1
45241 nz = this.y.redAdd(this.y);
45242 } else {
45243 // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b
45244 // 3M + 5S
45245
45246 // delta = Z1^2
45247 var delta = this.z.redSqr();
45248 // gamma = Y1^2
45249 var gamma = this.y.redSqr();
45250 // beta = X1 * gamma
45251 var beta = this.x.redMul(gamma);
45252 // alpha = 3 * (X1 - delta) * (X1 + delta)
45253 var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));
45254 alpha = alpha.redAdd(alpha).redIAdd(alpha);
45255 // X3 = alpha^2 - 8 * beta
45256 var beta4 = beta.redIAdd(beta);
45257 beta4 = beta4.redIAdd(beta4);
45258 var beta8 = beta4.redAdd(beta4);
45259 nx = alpha.redSqr().redISub(beta8);
45260 // Z3 = (Y1 + Z1)^2 - gamma - delta
45261 nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);
45262 // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2
45263 var ggamma8 = gamma.redSqr();
45264 ggamma8 = ggamma8.redIAdd(ggamma8);
45265 ggamma8 = ggamma8.redIAdd(ggamma8);
45266 ggamma8 = ggamma8.redIAdd(ggamma8);
45267 ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);
45268 }
45269
45270 return this.curve.jpoint(nx, ny, nz);
45271};
45272
45273JPoint.prototype._dbl = function _dbl() {
45274 var a = this.curve.a;
45275
45276 // 4M + 6S + 10A
45277 var jx = this.x;
45278 var jy = this.y;
45279 var jz = this.z;
45280 var jz4 = jz.redSqr().redSqr();
45281
45282 var jx2 = jx.redSqr();
45283 var jy2 = jy.redSqr();
45284
45285 var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
45286
45287 var jxd4 = jx.redAdd(jx);
45288 jxd4 = jxd4.redIAdd(jxd4);
45289 var t1 = jxd4.redMul(jy2);
45290 var nx = c.redSqr().redISub(t1.redAdd(t1));
45291 var t2 = t1.redISub(nx);
45292
45293 var jyd8 = jy2.redSqr();
45294 jyd8 = jyd8.redIAdd(jyd8);
45295 jyd8 = jyd8.redIAdd(jyd8);
45296 jyd8 = jyd8.redIAdd(jyd8);
45297 var ny = c.redMul(t2).redISub(jyd8);
45298 var nz = jy.redAdd(jy).redMul(jz);
45299
45300 return this.curve.jpoint(nx, ny, nz);
45301};
45302
45303JPoint.prototype.trpl = function trpl() {
45304 if (!this.curve.zeroA)
45305 return this.dbl().add(this);
45306
45307 // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl
45308 // 5M + 10S + ...
45309
45310 // XX = X1^2
45311 var xx = this.x.redSqr();
45312 // YY = Y1^2
45313 var yy = this.y.redSqr();
45314 // ZZ = Z1^2
45315 var zz = this.z.redSqr();
45316 // YYYY = YY^2
45317 var yyyy = yy.redSqr();
45318 // M = 3 * XX + a * ZZ2; a = 0
45319 var m = xx.redAdd(xx).redIAdd(xx);
45320 // MM = M^2
45321 var mm = m.redSqr();
45322 // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM
45323 var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
45324 e = e.redIAdd(e);
45325 e = e.redAdd(e).redIAdd(e);
45326 e = e.redISub(mm);
45327 // EE = E^2
45328 var ee = e.redSqr();
45329 // T = 16*YYYY
45330 var t = yyyy.redIAdd(yyyy);
45331 t = t.redIAdd(t);
45332 t = t.redIAdd(t);
45333 t = t.redIAdd(t);
45334 // U = (M + E)^2 - MM - EE - T
45335 var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);
45336 // X3 = 4 * (X1 * EE - 4 * YY * U)
45337 var yyu4 = yy.redMul(u);
45338 yyu4 = yyu4.redIAdd(yyu4);
45339 yyu4 = yyu4.redIAdd(yyu4);
45340 var nx = this.x.redMul(ee).redISub(yyu4);
45341 nx = nx.redIAdd(nx);
45342 nx = nx.redIAdd(nx);
45343 // Y3 = 8 * Y1 * (U * (T - U) - E * EE)
45344 var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));
45345 ny = ny.redIAdd(ny);
45346 ny = ny.redIAdd(ny);
45347 ny = ny.redIAdd(ny);
45348 // Z3 = (Z1 + E)^2 - ZZ - EE
45349 var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);
45350
45351 return this.curve.jpoint(nx, ny, nz);
45352};
45353
45354JPoint.prototype.mul = function mul(k, kbase) {
45355 k = new BN(k, kbase);
45356
45357 return this.curve._wnafMul(this, k);
45358};
45359
45360JPoint.prototype.eq = function eq(p) {
45361 if (p.type === 'affine')
45362 return this.eq(p.toJ());
45363
45364 if (this === p)
45365 return true;
45366
45367 // x1 * z2^2 == x2 * z1^2
45368 var z2 = this.z.redSqr();
45369 var pz2 = p.z.redSqr();
45370 if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)
45371 return false;
45372
45373 // y1 * z2^3 == y2 * z1^3
45374 var z3 = z2.redMul(this.z);
45375 var pz3 = pz2.redMul(p.z);
45376 return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;
45377};
45378
45379JPoint.prototype.eqXToP = function eqXToP(x) {
45380 var zs = this.z.redSqr();
45381 var rx = x.toRed(this.curve.red).redMul(zs);
45382 if (this.x.cmp(rx) === 0)
45383 return true;
45384
45385 var xc = x.clone();
45386 var t = this.curve.redN.redMul(zs);
45387 for (;;) {
45388 xc.iadd(this.curve.n);
45389 if (xc.cmp(this.curve.p) >= 0)
45390 return false;
45391
45392 rx.redIAdd(t);
45393 if (this.x.cmp(rx) === 0)
45394 return true;
45395 }
45396 return false;
45397};
45398
45399JPoint.prototype.inspect = function inspect() {
45400 if (this.isInfinity())
45401 return '<EC JPoint Infinity>';
45402 return '<EC JPoint x: ' + this.x.toString(16, 2) +
45403 ' y: ' + this.y.toString(16, 2) +
45404 ' z: ' + this.z.toString(16, 2) + '>';
45405};
45406
45407JPoint.prototype.isInfinity = function isInfinity() {
45408 // XXX This code assumes that zero is always zero in red
45409 return this.z.cmpn(0) === 0;
45410};
45411
45412},{"../../elliptic":97,"../curve":100,"bn.js":81,"inherits":121}],103:[function(require,module,exports){
45413'use strict';
45414
45415var curves = exports;
45416
45417var hash = require('hash.js');
45418var elliptic = require('../elliptic');
45419
45420var assert = elliptic.utils.assert;
45421
45422function PresetCurve(options) {
45423 if (options.type === 'short')
45424 this.curve = new elliptic.curve.short(options);
45425 else if (options.type === 'edwards')
45426 this.curve = new elliptic.curve.edwards(options);
45427 else
45428 this.curve = new elliptic.curve.mont(options);
45429 this.g = this.curve.g;
45430 this.n = this.curve.n;
45431 this.hash = options.hash;
45432
45433 assert(this.g.validate(), 'Invalid curve');
45434 assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');
45435}
45436curves.PresetCurve = PresetCurve;
45437
45438function defineCurve(name, options) {
45439 Object.defineProperty(curves, name, {
45440 configurable: true,
45441 enumerable: true,
45442 get: function() {
45443 var curve = new PresetCurve(options);
45444 Object.defineProperty(curves, name, {
45445 configurable: true,
45446 enumerable: true,
45447 value: curve
45448 });
45449 return curve;
45450 }
45451 });
45452}
45453
45454defineCurve('p192', {
45455 type: 'short',
45456 prime: 'p192',
45457 p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',
45458 a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',
45459 b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',
45460 n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',
45461 hash: hash.sha256,
45462 gRed: false,
45463 g: [
45464 '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',
45465 '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811'
45466 ]
45467});
45468
45469defineCurve('p224', {
45470 type: 'short',
45471 prime: 'p224',
45472 p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',
45473 a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',
45474 b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',
45475 n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',
45476 hash: hash.sha256,
45477 gRed: false,
45478 g: [
45479 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',
45480 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34'
45481 ]
45482});
45483
45484defineCurve('p256', {
45485 type: 'short',
45486 prime: null,
45487 p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',
45488 a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',
45489 b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',
45490 n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',
45491 hash: hash.sha256,
45492 gRed: false,
45493 g: [
45494 '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',
45495 '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5'
45496 ]
45497});
45498
45499defineCurve('p384', {
45500 type: 'short',
45501 prime: null,
45502 p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
45503 'fffffffe ffffffff 00000000 00000000 ffffffff',
45504 a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
45505 'fffffffe ffffffff 00000000 00000000 fffffffc',
45506 b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +
45507 '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',
45508 n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +
45509 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',
45510 hash: hash.sha384,
45511 gRed: false,
45512 g: [
45513 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +
45514 '5502f25d bf55296c 3a545e38 72760ab7',
45515 '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +
45516 '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'
45517 ]
45518});
45519
45520defineCurve('p521', {
45521 type: 'short',
45522 prime: null,
45523 p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
45524 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
45525 'ffffffff ffffffff ffffffff ffffffff ffffffff',
45526 a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
45527 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
45528 'ffffffff ffffffff ffffffff ffffffff fffffffc',
45529 b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +
45530 '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +
45531 '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',
45532 n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
45533 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +
45534 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',
45535 hash: hash.sha512,
45536 gRed: false,
45537 g: [
45538 '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +
45539 '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +
45540 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',
45541 '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +
45542 '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +
45543 '3fad0761 353c7086 a272c240 88be9476 9fd16650'
45544 ]
45545});
45546
45547defineCurve('curve25519', {
45548 type: 'mont',
45549 prime: 'p25519',
45550 p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
45551 a: '76d06',
45552 b: '1',
45553 n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
45554 hash: hash.sha256,
45555 gRed: false,
45556 g: [
45557 '9'
45558 ]
45559});
45560
45561defineCurve('ed25519', {
45562 type: 'edwards',
45563 prime: 'p25519',
45564 p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
45565 a: '-1',
45566 c: '1',
45567 // -121665 * (121666^(-1)) (mod P)
45568 d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',
45569 n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
45570 hash: hash.sha256,
45571 gRed: false,
45572 g: [
45573 '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',
45574
45575 // 4/5
45576 '6666666666666666666666666666666666666666666666666666666666666658'
45577 ]
45578});
45579
45580var pre;
45581try {
45582 pre = require('./precomputed/secp256k1');
45583} catch (e) {
45584 pre = undefined;
45585}
45586
45587defineCurve('secp256k1', {
45588 type: 'short',
45589 prime: 'k256',
45590 p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',
45591 a: '0',
45592 b: '7',
45593 n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',
45594 h: '1',
45595 hash: hash.sha256,
45596
45597 // Precomputed endomorphism
45598 beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',
45599 lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',
45600 basis: [
45601 {
45602 a: '3086d221a7d46bcde86c90e49284eb15',
45603 b: '-e4437ed6010e88286f547fa90abfe4c3'
45604 },
45605 {
45606 a: '114ca50f7a8e2f3f657c1108d9d44cfd8',
45607 b: '3086d221a7d46bcde86c90e49284eb15'
45608 }
45609 ],
45610
45611 gRed: false,
45612 g: [
45613 '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
45614 '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',
45615 pre
45616 ]
45617});
45618
45619},{"../elliptic":97,"./precomputed/secp256k1":110,"hash.js":114}],104:[function(require,module,exports){
45620'use strict';
45621
45622var BN = require('bn.js');
45623var HmacDRBG = require('hmac-drbg');
45624var elliptic = require('../../elliptic');
45625var utils = elliptic.utils;
45626var assert = utils.assert;
45627
45628var KeyPair = require('./key');
45629var Signature = require('./signature');
45630
45631function EC(options) {
45632 if (!(this instanceof EC))
45633 return new EC(options);
45634
45635 // Shortcut `elliptic.ec(curve-name)`
45636 if (typeof options === 'string') {
45637 assert(elliptic.curves.hasOwnProperty(options), 'Unknown curve ' + options);
45638
45639 options = elliptic.curves[options];
45640 }
45641
45642 // Shortcut for `elliptic.ec(elliptic.curves.curveName)`
45643 if (options instanceof elliptic.curves.PresetCurve)
45644 options = { curve: options };
45645
45646 this.curve = options.curve.curve;
45647 this.n = this.curve.n;
45648 this.nh = this.n.ushrn(1);
45649 this.g = this.curve.g;
45650
45651 // Point on curve
45652 this.g = options.curve.g;
45653 this.g.precompute(options.curve.n.bitLength() + 1);
45654
45655 // Hash for function for DRBG
45656 this.hash = options.hash || options.curve.hash;
45657}
45658module.exports = EC;
45659
45660EC.prototype.keyPair = function keyPair(options) {
45661 return new KeyPair(this, options);
45662};
45663
45664EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {
45665 return KeyPair.fromPrivate(this, priv, enc);
45666};
45667
45668EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {
45669 return KeyPair.fromPublic(this, pub, enc);
45670};
45671
45672EC.prototype.genKeyPair = function genKeyPair(options) {
45673 if (!options)
45674 options = {};
45675
45676 // Instantiate Hmac_DRBG
45677 var drbg = new HmacDRBG({
45678 hash: this.hash,
45679 pers: options.pers,
45680 persEnc: options.persEnc || 'utf8',
45681 entropy: options.entropy || elliptic.rand(this.hash.hmacStrength),
45682 entropyEnc: options.entropy && options.entropyEnc || 'utf8',
45683 nonce: this.n.toArray()
45684 });
45685
45686 var bytes = this.n.byteLength();
45687 var ns2 = this.n.sub(new BN(2));
45688 do {
45689 var priv = new BN(drbg.generate(bytes));
45690 if (priv.cmp(ns2) > 0)
45691 continue;
45692
45693 priv.iaddn(1);
45694 return this.keyFromPrivate(priv);
45695 } while (true);
45696};
45697
45698EC.prototype._truncateToN = function truncateToN(msg, truncOnly) {
45699 var delta = msg.byteLength() * 8 - this.n.bitLength();
45700 if (delta > 0)
45701 msg = msg.ushrn(delta);
45702 if (!truncOnly && msg.cmp(this.n) >= 0)
45703 return msg.sub(this.n);
45704 else
45705 return msg;
45706};
45707
45708EC.prototype.sign = function sign(msg, key, enc, options) {
45709 if (typeof enc === 'object') {
45710 options = enc;
45711 enc = null;
45712 }
45713 if (!options)
45714 options = {};
45715
45716 key = this.keyFromPrivate(key, enc);
45717 msg = this._truncateToN(new BN(msg, 16));
45718
45719 // Zero-extend key to provide enough entropy
45720 var bytes = this.n.byteLength();
45721 var bkey = key.getPrivate().toArray('be', bytes);
45722
45723 // Zero-extend nonce to have the same byte size as N
45724 var nonce = msg.toArray('be', bytes);
45725
45726 // Instantiate Hmac_DRBG
45727 var drbg = new HmacDRBG({
45728 hash: this.hash,
45729 entropy: bkey,
45730 nonce: nonce,
45731 pers: options.pers,
45732 persEnc: options.persEnc || 'utf8'
45733 });
45734
45735 // Number of bytes to generate
45736 var ns1 = this.n.sub(new BN(1));
45737
45738 for (var iter = 0; true; iter++) {
45739 var k = options.k ?
45740 options.k(iter) :
45741 new BN(drbg.generate(this.n.byteLength()));
45742 k = this._truncateToN(k, true);
45743 if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)
45744 continue;
45745
45746 var kp = this.g.mul(k);
45747 if (kp.isInfinity())
45748 continue;
45749
45750 var kpX = kp.getX();
45751 var r = kpX.umod(this.n);
45752 if (r.cmpn(0) === 0)
45753 continue;
45754
45755 var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));
45756 s = s.umod(this.n);
45757 if (s.cmpn(0) === 0)
45758 continue;
45759
45760 var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |
45761 (kpX.cmp(r) !== 0 ? 2 : 0);
45762
45763 // Use complement of `s`, if it is > `n / 2`
45764 if (options.canonical && s.cmp(this.nh) > 0) {
45765 s = this.n.sub(s);
45766 recoveryParam ^= 1;
45767 }
45768
45769 return new Signature({ r: r, s: s, recoveryParam: recoveryParam });
45770 }
45771};
45772
45773EC.prototype.verify = function verify(msg, signature, key, enc) {
45774 msg = this._truncateToN(new BN(msg, 16));
45775 key = this.keyFromPublic(key, enc);
45776 signature = new Signature(signature, 'hex');
45777
45778 // Perform primitive values validation
45779 var r = signature.r;
45780 var s = signature.s;
45781 if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)
45782 return false;
45783 if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)
45784 return false;
45785
45786 // Validate signature
45787 var sinv = s.invm(this.n);
45788 var u1 = sinv.mul(msg).umod(this.n);
45789 var u2 = sinv.mul(r).umod(this.n);
45790
45791 if (!this.curve._maxwellTrick) {
45792 var p = this.g.mulAdd(u1, key.getPublic(), u2);
45793 if (p.isInfinity())
45794 return false;
45795
45796 return p.getX().umod(this.n).cmp(r) === 0;
45797 }
45798
45799 // NOTE: Greg Maxwell's trick, inspired by:
45800 // https://git.io/vad3K
45801
45802 var p = this.g.jmulAdd(u1, key.getPublic(), u2);
45803 if (p.isInfinity())
45804 return false;
45805
45806 // Compare `p.x` of Jacobian point with `r`,
45807 // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the
45808 // inverse of `p.z^2`
45809 return p.eqXToP(r);
45810};
45811
45812EC.prototype.recoverPubKey = function(msg, signature, j, enc) {
45813 assert((3 & j) === j, 'The recovery param is more than two bits');
45814 signature = new Signature(signature, enc);
45815
45816 var n = this.n;
45817 var e = new BN(msg);
45818 var r = signature.r;
45819 var s = signature.s;
45820
45821 // A set LSB signifies that the y-coordinate is odd
45822 var isYOdd = j & 1;
45823 var isSecondKey = j >> 1;
45824 if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)
45825 throw new Error('Unable to find sencond key candinate');
45826
45827 // 1.1. Let x = r + jn.
45828 if (isSecondKey)
45829 r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);
45830 else
45831 r = this.curve.pointFromX(r, isYOdd);
45832
45833 var rInv = signature.r.invm(n);
45834 var s1 = n.sub(e).mul(rInv).umod(n);
45835 var s2 = s.mul(rInv).umod(n);
45836
45837 // 1.6.1 Compute Q = r^-1 (sR - eG)
45838 // Q = r^-1 (sR + -eG)
45839 return this.g.mulAdd(s1, r, s2);
45840};
45841
45842EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
45843 signature = new Signature(signature, enc);
45844 if (signature.recoveryParam !== null)
45845 return signature.recoveryParam;
45846
45847 for (var i = 0; i < 4; i++) {
45848 var Qprime;
45849 try {
45850 Qprime = this.recoverPubKey(e, signature, i);
45851 } catch (e) {
45852 continue;
45853 }
45854
45855 if (Qprime.eq(Q))
45856 return i;
45857 }
45858 throw new Error('Unable to find valid recovery factor');
45859};
45860
45861},{"../../elliptic":97,"./key":105,"./signature":106,"bn.js":81,"hmac-drbg":120}],105:[function(require,module,exports){
45862'use strict';
45863
45864var BN = require('bn.js');
45865var elliptic = require('../../elliptic');
45866var utils = elliptic.utils;
45867var assert = utils.assert;
45868
45869function KeyPair(ec, options) {
45870 this.ec = ec;
45871 this.priv = null;
45872 this.pub = null;
45873
45874 // KeyPair(ec, { priv: ..., pub: ... })
45875 if (options.priv)
45876 this._importPrivate(options.priv, options.privEnc);
45877 if (options.pub)
45878 this._importPublic(options.pub, options.pubEnc);
45879}
45880module.exports = KeyPair;
45881
45882KeyPair.fromPublic = function fromPublic(ec, pub, enc) {
45883 if (pub instanceof KeyPair)
45884 return pub;
45885
45886 return new KeyPair(ec, {
45887 pub: pub,
45888 pubEnc: enc
45889 });
45890};
45891
45892KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {
45893 if (priv instanceof KeyPair)
45894 return priv;
45895
45896 return new KeyPair(ec, {
45897 priv: priv,
45898 privEnc: enc
45899 });
45900};
45901
45902KeyPair.prototype.validate = function validate() {
45903 var pub = this.getPublic();
45904
45905 if (pub.isInfinity())
45906 return { result: false, reason: 'Invalid public key' };
45907 if (!pub.validate())
45908 return { result: false, reason: 'Public key is not a point' };
45909 if (!pub.mul(this.ec.curve.n).isInfinity())
45910 return { result: false, reason: 'Public key * N != O' };
45911
45912 return { result: true, reason: null };
45913};
45914
45915KeyPair.prototype.getPublic = function getPublic(compact, enc) {
45916 // compact is optional argument
45917 if (typeof compact === 'string') {
45918 enc = compact;
45919 compact = null;
45920 }
45921
45922 if (!this.pub)
45923 this.pub = this.ec.g.mul(this.priv);
45924
45925 if (!enc)
45926 return this.pub;
45927
45928 return this.pub.encode(enc, compact);
45929};
45930
45931KeyPair.prototype.getPrivate = function getPrivate(enc) {
45932 if (enc === 'hex')
45933 return this.priv.toString(16, 2);
45934 else
45935 return this.priv;
45936};
45937
45938KeyPair.prototype._importPrivate = function _importPrivate(key, enc) {
45939 this.priv = new BN(key, enc || 16);
45940
45941 // Ensure that the priv won't be bigger than n, otherwise we may fail
45942 // in fixed multiplication method
45943 this.priv = this.priv.umod(this.ec.curve.n);
45944};
45945
45946KeyPair.prototype._importPublic = function _importPublic(key, enc) {
45947 if (key.x || key.y) {
45948 // Montgomery points only have an `x` coordinate.
45949 // Weierstrass/Edwards points on the other hand have both `x` and
45950 // `y` coordinates.
45951 if (this.ec.curve.type === 'mont') {
45952 assert(key.x, 'Need x coordinate');
45953 } else if (this.ec.curve.type === 'short' ||
45954 this.ec.curve.type === 'edwards') {
45955 assert(key.x && key.y, 'Need both x and y coordinate');
45956 }
45957 this.pub = this.ec.curve.point(key.x, key.y);
45958 return;
45959 }
45960 this.pub = this.ec.curve.decodePoint(key, enc);
45961};
45962
45963// ECDH
45964KeyPair.prototype.derive = function derive(pub) {
45965 return pub.mul(this.priv).getX();
45966};
45967
45968// ECDSA
45969KeyPair.prototype.sign = function sign(msg, enc, options) {
45970 return this.ec.sign(msg, this, enc, options);
45971};
45972
45973KeyPair.prototype.verify = function verify(msg, signature) {
45974 return this.ec.verify(msg, signature, this);
45975};
45976
45977KeyPair.prototype.inspect = function inspect() {
45978 return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +
45979 ' pub: ' + (this.pub && this.pub.inspect()) + ' >';
45980};
45981
45982},{"../../elliptic":97,"bn.js":81}],106:[function(require,module,exports){
45983'use strict';
45984
45985var BN = require('bn.js');
45986
45987var elliptic = require('../../elliptic');
45988var utils = elliptic.utils;
45989var assert = utils.assert;
45990
45991function Signature(options, enc) {
45992 if (options instanceof Signature)
45993 return options;
45994
45995 if (this._importDER(options, enc))
45996 return;
45997
45998 assert(options.r && options.s, 'Signature without r or s');
45999 this.r = new BN(options.r, 16);
46000 this.s = new BN(options.s, 16);
46001 if (options.recoveryParam === undefined)
46002 this.recoveryParam = null;
46003 else
46004 this.recoveryParam = options.recoveryParam;
46005}
46006module.exports = Signature;
46007
46008function Position() {
46009 this.place = 0;
46010}
46011
46012function getLength(buf, p) {
46013 var initial = buf[p.place++];
46014 if (!(initial & 0x80)) {
46015 return initial;
46016 }
46017 var octetLen = initial & 0xf;
46018 var val = 0;
46019 for (var i = 0, off = p.place; i < octetLen; i++, off++) {
46020 val <<= 8;
46021 val |= buf[off];
46022 }
46023 p.place = off;
46024 return val;
46025}
46026
46027function rmPadding(buf) {
46028 var i = 0;
46029 var len = buf.length - 1;
46030 while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {
46031 i++;
46032 }
46033 if (i === 0) {
46034 return buf;
46035 }
46036 return buf.slice(i);
46037}
46038
46039Signature.prototype._importDER = function _importDER(data, enc) {
46040 data = utils.toArray(data, enc);
46041 var p = new Position();
46042 if (data[p.place++] !== 0x30) {
46043 return false;
46044 }
46045 var len = getLength(data, p);
46046 if ((len + p.place) !== data.length) {
46047 return false;
46048 }
46049 if (data[p.place++] !== 0x02) {
46050 return false;
46051 }
46052 var rlen = getLength(data, p);
46053 var r = data.slice(p.place, rlen + p.place);
46054 p.place += rlen;
46055 if (data[p.place++] !== 0x02) {
46056 return false;
46057 }
46058 var slen = getLength(data, p);
46059 if (data.length !== slen + p.place) {
46060 return false;
46061 }
46062 var s = data.slice(p.place, slen + p.place);
46063 if (r[0] === 0 && (r[1] & 0x80)) {
46064 r = r.slice(1);
46065 }
46066 if (s[0] === 0 && (s[1] & 0x80)) {
46067 s = s.slice(1);
46068 }
46069
46070 this.r = new BN(r);
46071 this.s = new BN(s);
46072 this.recoveryParam = null;
46073
46074 return true;
46075};
46076
46077function constructLength(arr, len) {
46078 if (len < 0x80) {
46079 arr.push(len);
46080 return;
46081 }
46082 var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);
46083 arr.push(octets | 0x80);
46084 while (--octets) {
46085 arr.push((len >>> (octets << 3)) & 0xff);
46086 }
46087 arr.push(len);
46088}
46089
46090Signature.prototype.toDER = function toDER(enc) {
46091 var r = this.r.toArray();
46092 var s = this.s.toArray();
46093
46094 // Pad values
46095 if (r[0] & 0x80)
46096 r = [ 0 ].concat(r);
46097 // Pad values
46098 if (s[0] & 0x80)
46099 s = [ 0 ].concat(s);
46100
46101 r = rmPadding(r);
46102 s = rmPadding(s);
46103
46104 while (!s[0] && !(s[1] & 0x80)) {
46105 s = s.slice(1);
46106 }
46107 var arr = [ 0x02 ];
46108 constructLength(arr, r.length);
46109 arr = arr.concat(r);
46110 arr.push(0x02);
46111 constructLength(arr, s.length);
46112 var backHalf = arr.concat(s);
46113 var res = [ 0x30 ];
46114 constructLength(res, backHalf.length);
46115 res = res.concat(backHalf);
46116 return utils.encode(res, enc);
46117};
46118
46119},{"../../elliptic":97,"bn.js":81}],107:[function(require,module,exports){
46120'use strict';
46121
46122var hash = require('hash.js');
46123var elliptic = require('../../elliptic');
46124var utils = elliptic.utils;
46125var assert = utils.assert;
46126var parseBytes = utils.parseBytes;
46127var KeyPair = require('./key');
46128var Signature = require('./signature');
46129
46130function EDDSA(curve) {
46131 assert(curve === 'ed25519', 'only tested with ed25519 so far');
46132
46133 if (!(this instanceof EDDSA))
46134 return new EDDSA(curve);
46135
46136 var curve = elliptic.curves[curve].curve;
46137 this.curve = curve;
46138 this.g = curve.g;
46139 this.g.precompute(curve.n.bitLength() + 1);
46140
46141 this.pointClass = curve.point().constructor;
46142 this.encodingLength = Math.ceil(curve.n.bitLength() / 8);
46143 this.hash = hash.sha512;
46144}
46145
46146module.exports = EDDSA;
46147
46148/**
46149* @param {Array|String} message - message bytes
46150* @param {Array|String|KeyPair} secret - secret bytes or a keypair
46151* @returns {Signature} - signature
46152*/
46153EDDSA.prototype.sign = function sign(message, secret) {
46154 message = parseBytes(message);
46155 var key = this.keyFromSecret(secret);
46156 var r = this.hashInt(key.messagePrefix(), message);
46157 var R = this.g.mul(r);
46158 var Rencoded = this.encodePoint(R);
46159 var s_ = this.hashInt(Rencoded, key.pubBytes(), message)
46160 .mul(key.priv());
46161 var S = r.add(s_).umod(this.curve.n);
46162 return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });
46163};
46164
46165/**
46166* @param {Array} message - message bytes
46167* @param {Array|String|Signature} sig - sig bytes
46168* @param {Array|String|Point|KeyPair} pub - public key
46169* @returns {Boolean} - true if public key matches sig of message
46170*/
46171EDDSA.prototype.verify = function verify(message, sig, pub) {
46172 message = parseBytes(message);
46173 sig = this.makeSignature(sig);
46174 var key = this.keyFromPublic(pub);
46175 var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);
46176 var SG = this.g.mul(sig.S());
46177 var RplusAh = sig.R().add(key.pub().mul(h));
46178 return RplusAh.eq(SG);
46179};
46180
46181EDDSA.prototype.hashInt = function hashInt() {
46182 var hash = this.hash();
46183 for (var i = 0; i < arguments.length; i++)
46184 hash.update(arguments[i]);
46185 return utils.intFromLE(hash.digest()).umod(this.curve.n);
46186};
46187
46188EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {
46189 return KeyPair.fromPublic(this, pub);
46190};
46191
46192EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {
46193 return KeyPair.fromSecret(this, secret);
46194};
46195
46196EDDSA.prototype.makeSignature = function makeSignature(sig) {
46197 if (sig instanceof Signature)
46198 return sig;
46199 return new Signature(this, sig);
46200};
46201
46202/**
46203* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2
46204*
46205* EDDSA defines methods for encoding and decoding points and integers. These are
46206* helper convenience methods, that pass along to utility functions implied
46207* parameters.
46208*
46209*/
46210EDDSA.prototype.encodePoint = function encodePoint(point) {
46211 var enc = point.getY().toArray('le', this.encodingLength);
46212 enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;
46213 return enc;
46214};
46215
46216EDDSA.prototype.decodePoint = function decodePoint(bytes) {
46217 bytes = utils.parseBytes(bytes);
46218
46219 var lastIx = bytes.length - 1;
46220 var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);
46221 var xIsOdd = (bytes[lastIx] & 0x80) !== 0;
46222
46223 var y = utils.intFromLE(normed);
46224 return this.curve.pointFromY(y, xIsOdd);
46225};
46226
46227EDDSA.prototype.encodeInt = function encodeInt(num) {
46228 return num.toArray('le', this.encodingLength);
46229};
46230
46231EDDSA.prototype.decodeInt = function decodeInt(bytes) {
46232 return utils.intFromLE(bytes);
46233};
46234
46235EDDSA.prototype.isPoint = function isPoint(val) {
46236 return val instanceof this.pointClass;
46237};
46238
46239},{"../../elliptic":97,"./key":108,"./signature":109,"hash.js":114}],108:[function(require,module,exports){
46240'use strict';
46241
46242var elliptic = require('../../elliptic');
46243var utils = elliptic.utils;
46244var assert = utils.assert;
46245var parseBytes = utils.parseBytes;
46246var cachedProperty = utils.cachedProperty;
46247
46248/**
46249* @param {EDDSA} eddsa - instance
46250* @param {Object} params - public/private key parameters
46251*
46252* @param {Array<Byte>} [params.secret] - secret seed bytes
46253* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)
46254* @param {Array<Byte>} [params.pub] - public key point encoded as bytes
46255*
46256*/
46257function KeyPair(eddsa, params) {
46258 this.eddsa = eddsa;
46259 this._secret = parseBytes(params.secret);
46260 if (eddsa.isPoint(params.pub))
46261 this._pub = params.pub;
46262 else
46263 this._pubBytes = parseBytes(params.pub);
46264}
46265
46266KeyPair.fromPublic = function fromPublic(eddsa, pub) {
46267 if (pub instanceof KeyPair)
46268 return pub;
46269 return new KeyPair(eddsa, { pub: pub });
46270};
46271
46272KeyPair.fromSecret = function fromSecret(eddsa, secret) {
46273 if (secret instanceof KeyPair)
46274 return secret;
46275 return new KeyPair(eddsa, { secret: secret });
46276};
46277
46278KeyPair.prototype.secret = function secret() {
46279 return this._secret;
46280};
46281
46282cachedProperty(KeyPair, 'pubBytes', function pubBytes() {
46283 return this.eddsa.encodePoint(this.pub());
46284});
46285
46286cachedProperty(KeyPair, 'pub', function pub() {
46287 if (this._pubBytes)
46288 return this.eddsa.decodePoint(this._pubBytes);
46289 return this.eddsa.g.mul(this.priv());
46290});
46291
46292cachedProperty(KeyPair, 'privBytes', function privBytes() {
46293 var eddsa = this.eddsa;
46294 var hash = this.hash();
46295 var lastIx = eddsa.encodingLength - 1;
46296
46297 var a = hash.slice(0, eddsa.encodingLength);
46298 a[0] &= 248;
46299 a[lastIx] &= 127;
46300 a[lastIx] |= 64;
46301
46302 return a;
46303});
46304
46305cachedProperty(KeyPair, 'priv', function priv() {
46306 return this.eddsa.decodeInt(this.privBytes());
46307});
46308
46309cachedProperty(KeyPair, 'hash', function hash() {
46310 return this.eddsa.hash().update(this.secret()).digest();
46311});
46312
46313cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {
46314 return this.hash().slice(this.eddsa.encodingLength);
46315});
46316
46317KeyPair.prototype.sign = function sign(message) {
46318 assert(this._secret, 'KeyPair can only verify');
46319 return this.eddsa.sign(message, this);
46320};
46321
46322KeyPair.prototype.verify = function verify(message, sig) {
46323 return this.eddsa.verify(message, sig, this);
46324};
46325
46326KeyPair.prototype.getSecret = function getSecret(enc) {
46327 assert(this._secret, 'KeyPair is public only');
46328 return utils.encode(this.secret(), enc);
46329};
46330
46331KeyPair.prototype.getPublic = function getPublic(enc) {
46332 return utils.encode(this.pubBytes(), enc);
46333};
46334
46335module.exports = KeyPair;
46336
46337},{"../../elliptic":97}],109:[function(require,module,exports){
46338'use strict';
46339
46340var BN = require('bn.js');
46341var elliptic = require('../../elliptic');
46342var utils = elliptic.utils;
46343var assert = utils.assert;
46344var cachedProperty = utils.cachedProperty;
46345var parseBytes = utils.parseBytes;
46346
46347/**
46348* @param {EDDSA} eddsa - eddsa instance
46349* @param {Array<Bytes>|Object} sig -
46350* @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes
46351* @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes
46352* @param {Array<Bytes>} [sig.Rencoded] - R point encoded
46353* @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded
46354*/
46355function Signature(eddsa, sig) {
46356 this.eddsa = eddsa;
46357
46358 if (typeof sig !== 'object')
46359 sig = parseBytes(sig);
46360
46361 if (Array.isArray(sig)) {
46362 sig = {
46363 R: sig.slice(0, eddsa.encodingLength),
46364 S: sig.slice(eddsa.encodingLength)
46365 };
46366 }
46367
46368 assert(sig.R && sig.S, 'Signature without R or S');
46369
46370 if (eddsa.isPoint(sig.R))
46371 this._R = sig.R;
46372 if (sig.S instanceof BN)
46373 this._S = sig.S;
46374
46375 this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;
46376 this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;
46377}
46378
46379cachedProperty(Signature, 'S', function S() {
46380 return this.eddsa.decodeInt(this.Sencoded());
46381});
46382
46383cachedProperty(Signature, 'R', function R() {
46384 return this.eddsa.decodePoint(this.Rencoded());
46385});
46386
46387cachedProperty(Signature, 'Rencoded', function Rencoded() {
46388 return this.eddsa.encodePoint(this.R());
46389});
46390
46391cachedProperty(Signature, 'Sencoded', function Sencoded() {
46392 return this.eddsa.encodeInt(this.S());
46393});
46394
46395Signature.prototype.toBytes = function toBytes() {
46396 return this.Rencoded().concat(this.Sencoded());
46397};
46398
46399Signature.prototype.toHex = function toHex() {
46400 return utils.encode(this.toBytes(), 'hex').toUpperCase();
46401};
46402
46403module.exports = Signature;
46404
46405},{"../../elliptic":97,"bn.js":81}],110:[function(require,module,exports){
46406module.exports = {
46407 doubles: {
46408 step: 4,
46409 points: [
46410 [
46411 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',
46412 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821'
46413 ],
46414 [
46415 '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',
46416 '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf'
46417 ],
46418 [
46419 '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',
46420 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695'
46421 ],
46422 [
46423 '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',
46424 '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9'
46425 ],
46426 [
46427 '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',
46428 '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36'
46429 ],
46430 [
46431 '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',
46432 '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f'
46433 ],
46434 [
46435 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',
46436 '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999'
46437 ],
46438 [
46439 '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',
46440 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09'
46441 ],
46442 [
46443 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',
46444 '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d'
46445 ],
46446 [
46447 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',
46448 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088'
46449 ],
46450 [
46451 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',
46452 '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d'
46453 ],
46454 [
46455 '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',
46456 '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8'
46457 ],
46458 [
46459 '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',
46460 '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a'
46461 ],
46462 [
46463 '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',
46464 '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453'
46465 ],
46466 [
46467 '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',
46468 '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160'
46469 ],
46470 [
46471 '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',
46472 '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0'
46473 ],
46474 [
46475 '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',
46476 '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6'
46477 ],
46478 [
46479 '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',
46480 '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589'
46481 ],
46482 [
46483 '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',
46484 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17'
46485 ],
46486 [
46487 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',
46488 '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda'
46489 ],
46490 [
46491 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',
46492 '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd'
46493 ],
46494 [
46495 '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',
46496 '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2'
46497 ],
46498 [
46499 '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',
46500 '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6'
46501 ],
46502 [
46503 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',
46504 '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f'
46505 ],
46506 [
46507 '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',
46508 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01'
46509 ],
46510 [
46511 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',
46512 '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3'
46513 ],
46514 [
46515 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',
46516 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f'
46517 ],
46518 [
46519 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',
46520 '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7'
46521 ],
46522 [
46523 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',
46524 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78'
46525 ],
46526 [
46527 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',
46528 '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1'
46529 ],
46530 [
46531 '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',
46532 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150'
46533 ],
46534 [
46535 '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',
46536 '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82'
46537 ],
46538 [
46539 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',
46540 '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc'
46541 ],
46542 [
46543 '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',
46544 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b'
46545 ],
46546 [
46547 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',
46548 '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51'
46549 ],
46550 [
46551 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',
46552 '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45'
46553 ],
46554 [
46555 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',
46556 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120'
46557 ],
46558 [
46559 '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',
46560 '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84'
46561 ],
46562 [
46563 '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',
46564 '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d'
46565 ],
46566 [
46567 '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',
46568 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d'
46569 ],
46570 [
46571 '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',
46572 '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8'
46573 ],
46574 [
46575 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',
46576 '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8'
46577 ],
46578 [
46579 '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',
46580 '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac'
46581 ],
46582 [
46583 '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',
46584 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f'
46585 ],
46586 [
46587 '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',
46588 '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962'
46589 ],
46590 [
46591 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',
46592 '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907'
46593 ],
46594 [
46595 '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',
46596 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec'
46597 ],
46598 [
46599 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',
46600 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d'
46601 ],
46602 [
46603 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',
46604 '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414'
46605 ],
46606 [
46607 '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',
46608 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd'
46609 ],
46610 [
46611 '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',
46612 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0'
46613 ],
46614 [
46615 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',
46616 '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811'
46617 ],
46618 [
46619 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',
46620 '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1'
46621 ],
46622 [
46623 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',
46624 '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c'
46625 ],
46626 [
46627 '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',
46628 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73'
46629 ],
46630 [
46631 '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',
46632 '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd'
46633 ],
46634 [
46635 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',
46636 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405'
46637 ],
46638 [
46639 '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',
46640 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589'
46641 ],
46642 [
46643 '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',
46644 '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e'
46645 ],
46646 [
46647 '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',
46648 '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27'
46649 ],
46650 [
46651 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',
46652 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1'
46653 ],
46654 [
46655 '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',
46656 '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482'
46657 ],
46658 [
46659 '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',
46660 '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945'
46661 ],
46662 [
46663 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',
46664 '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573'
46665 ],
46666 [
46667 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',
46668 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82'
46669 ]
46670 ]
46671 },
46672 naf: {
46673 wnd: 7,
46674 points: [
46675 [
46676 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',
46677 '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672'
46678 ],
46679 [
46680 '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',
46681 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6'
46682 ],
46683 [
46684 '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',
46685 '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da'
46686 ],
46687 [
46688 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',
46689 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37'
46690 ],
46691 [
46692 '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',
46693 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b'
46694 ],
46695 [
46696 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',
46697 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81'
46698 ],
46699 [
46700 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',
46701 '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58'
46702 ],
46703 [
46704 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',
46705 '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77'
46706 ],
46707 [
46708 '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',
46709 '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a'
46710 ],
46711 [
46712 '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',
46713 '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c'
46714 ],
46715 [
46716 '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',
46717 '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67'
46718 ],
46719 [
46720 '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',
46721 '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402'
46722 ],
46723 [
46724 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',
46725 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55'
46726 ],
46727 [
46728 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',
46729 '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482'
46730 ],
46731 [
46732 '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',
46733 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82'
46734 ],
46735 [
46736 '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',
46737 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396'
46738 ],
46739 [
46740 '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',
46741 '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49'
46742 ],
46743 [
46744 '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',
46745 '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf'
46746 ],
46747 [
46748 '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',
46749 '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a'
46750 ],
46751 [
46752 '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',
46753 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7'
46754 ],
46755 [
46756 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',
46757 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933'
46758 ],
46759 [
46760 '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',
46761 '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a'
46762 ],
46763 [
46764 '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',
46765 '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6'
46766 ],
46767 [
46768 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',
46769 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37'
46770 ],
46771 [
46772 '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',
46773 '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e'
46774 ],
46775 [
46776 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',
46777 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6'
46778 ],
46779 [
46780 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',
46781 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476'
46782 ],
46783 [
46784 '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',
46785 '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40'
46786 ],
46787 [
46788 '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',
46789 '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61'
46790 ],
46791 [
46792 '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',
46793 '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683'
46794 ],
46795 [
46796 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',
46797 '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5'
46798 ],
46799 [
46800 '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',
46801 '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b'
46802 ],
46803 [
46804 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',
46805 '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417'
46806 ],
46807 [
46808 '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',
46809 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868'
46810 ],
46811 [
46812 '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',
46813 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a'
46814 ],
46815 [
46816 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',
46817 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6'
46818 ],
46819 [
46820 '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',
46821 '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996'
46822 ],
46823 [
46824 '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',
46825 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e'
46826 ],
46827 [
46828 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',
46829 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d'
46830 ],
46831 [
46832 '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',
46833 '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2'
46834 ],
46835 [
46836 '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',
46837 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e'
46838 ],
46839 [
46840 '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',
46841 '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437'
46842 ],
46843 [
46844 '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',
46845 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311'
46846 ],
46847 [
46848 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',
46849 '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4'
46850 ],
46851 [
46852 '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',
46853 '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575'
46854 ],
46855 [
46856 '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',
46857 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d'
46858 ],
46859 [
46860 '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',
46861 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d'
46862 ],
46863 [
46864 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',
46865 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629'
46866 ],
46867 [
46868 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',
46869 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06'
46870 ],
46871 [
46872 '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',
46873 '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374'
46874 ],
46875 [
46876 '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',
46877 '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee'
46878 ],
46879 [
46880 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',
46881 '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1'
46882 ],
46883 [
46884 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',
46885 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b'
46886 ],
46887 [
46888 '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',
46889 '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661'
46890 ],
46891 [
46892 '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',
46893 '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6'
46894 ],
46895 [
46896 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',
46897 '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e'
46898 ],
46899 [
46900 '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',
46901 '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d'
46902 ],
46903 [
46904 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',
46905 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc'
46906 ],
46907 [
46908 '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',
46909 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4'
46910 ],
46911 [
46912 '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',
46913 '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c'
46914 ],
46915 [
46916 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',
46917 '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b'
46918 ],
46919 [
46920 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',
46921 '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913'
46922 ],
46923 [
46924 '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',
46925 '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154'
46926 ],
46927 [
46928 '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',
46929 '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865'
46930 ],
46931 [
46932 '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',
46933 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc'
46934 ],
46935 [
46936 '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',
46937 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224'
46938 ],
46939 [
46940 '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',
46941 '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e'
46942 ],
46943 [
46944 '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',
46945 '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6'
46946 ],
46947 [
46948 '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',
46949 '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511'
46950 ],
46951 [
46952 '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',
46953 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b'
46954 ],
46955 [
46956 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',
46957 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2'
46958 ],
46959 [
46960 '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',
46961 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c'
46962 ],
46963 [
46964 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',
46965 '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3'
46966 ],
46967 [
46968 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',
46969 '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d'
46970 ],
46971 [
46972 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',
46973 '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700'
46974 ],
46975 [
46976 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',
46977 '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4'
46978 ],
46979 [
46980 '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',
46981 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196'
46982 ],
46983 [
46984 '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',
46985 '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4'
46986 ],
46987 [
46988 '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',
46989 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257'
46990 ],
46991 [
46992 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',
46993 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13'
46994 ],
46995 [
46996 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',
46997 '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096'
46998 ],
46999 [
47000 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',
47001 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38'
47002 ],
47003 [
47004 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',
47005 '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f'
47006 ],
47007 [
47008 '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',
47009 '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448'
47010 ],
47011 [
47012 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',
47013 '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a'
47014 ],
47015 [
47016 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',
47017 '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4'
47018 ],
47019 [
47020 '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',
47021 '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437'
47022 ],
47023 [
47024 '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',
47025 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7'
47026 ],
47027 [
47028 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',
47029 '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d'
47030 ],
47031 [
47032 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',
47033 '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a'
47034 ],
47035 [
47036 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',
47037 '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54'
47038 ],
47039 [
47040 '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',
47041 '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77'
47042 ],
47043 [
47044 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',
47045 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517'
47046 ],
47047 [
47048 '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',
47049 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10'
47050 ],
47051 [
47052 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',
47053 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125'
47054 ],
47055 [
47056 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',
47057 '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e'
47058 ],
47059 [
47060 '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',
47061 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1'
47062 ],
47063 [
47064 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',
47065 '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2'
47066 ],
47067 [
47068 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',
47069 '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423'
47070 ],
47071 [
47072 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',
47073 '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8'
47074 ],
47075 [
47076 '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',
47077 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758'
47078 ],
47079 [
47080 '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',
47081 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375'
47082 ],
47083 [
47084 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',
47085 '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d'
47086 ],
47087 [
47088 '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',
47089 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec'
47090 ],
47091 [
47092 '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',
47093 '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0'
47094 ],
47095 [
47096 '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',
47097 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c'
47098 ],
47099 [
47100 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',
47101 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4'
47102 ],
47103 [
47104 '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',
47105 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f'
47106 ],
47107 [
47108 '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',
47109 '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649'
47110 ],
47111 [
47112 '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',
47113 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826'
47114 ],
47115 [
47116 '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',
47117 '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5'
47118 ],
47119 [
47120 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',
47121 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87'
47122 ],
47123 [
47124 '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',
47125 '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b'
47126 ],
47127 [
47128 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',
47129 '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc'
47130 ],
47131 [
47132 '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',
47133 '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c'
47134 ],
47135 [
47136 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',
47137 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f'
47138 ],
47139 [
47140 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',
47141 '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a'
47142 ],
47143 [
47144 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',
47145 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46'
47146 ],
47147 [
47148 '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',
47149 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f'
47150 ],
47151 [
47152 '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',
47153 '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03'
47154 ],
47155 [
47156 '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',
47157 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08'
47158 ],
47159 [
47160 '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',
47161 '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8'
47162 ],
47163 [
47164 '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',
47165 '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373'
47166 ],
47167 [
47168 '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',
47169 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3'
47170 ],
47171 [
47172 '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',
47173 '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8'
47174 ],
47175 [
47176 '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',
47177 '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1'
47178 ],
47179 [
47180 '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',
47181 '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9'
47182 ]
47183 ]
47184 }
47185};
47186
47187},{}],111:[function(require,module,exports){
47188'use strict';
47189
47190var utils = exports;
47191var BN = require('bn.js');
47192var minAssert = require('minimalistic-assert');
47193var minUtils = require('minimalistic-crypto-utils');
47194
47195utils.assert = minAssert;
47196utils.toArray = minUtils.toArray;
47197utils.zero2 = minUtils.zero2;
47198utils.toHex = minUtils.toHex;
47199utils.encode = minUtils.encode;
47200
47201// Represent num in a w-NAF form
47202function getNAF(num, w) {
47203 var naf = [];
47204 var ws = 1 << (w + 1);
47205 var k = num.clone();
47206 while (k.cmpn(1) >= 0) {
47207 var z;
47208 if (k.isOdd()) {
47209 var mod = k.andln(ws - 1);
47210 if (mod > (ws >> 1) - 1)
47211 z = (ws >> 1) - mod;
47212 else
47213 z = mod;
47214 k.isubn(z);
47215 } else {
47216 z = 0;
47217 }
47218 naf.push(z);
47219
47220 // Optimization, shift by word if possible
47221 var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1;
47222 for (var i = 1; i < shift; i++)
47223 naf.push(0);
47224 k.iushrn(shift);
47225 }
47226
47227 return naf;
47228}
47229utils.getNAF = getNAF;
47230
47231// Represent k1, k2 in a Joint Sparse Form
47232function getJSF(k1, k2) {
47233 var jsf = [
47234 [],
47235 []
47236 ];
47237
47238 k1 = k1.clone();
47239 k2 = k2.clone();
47240 var d1 = 0;
47241 var d2 = 0;
47242 while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {
47243
47244 // First phase
47245 var m14 = (k1.andln(3) + d1) & 3;
47246 var m24 = (k2.andln(3) + d2) & 3;
47247 if (m14 === 3)
47248 m14 = -1;
47249 if (m24 === 3)
47250 m24 = -1;
47251 var u1;
47252 if ((m14 & 1) === 0) {
47253 u1 = 0;
47254 } else {
47255 var m8 = (k1.andln(7) + d1) & 7;
47256 if ((m8 === 3 || m8 === 5) && m24 === 2)
47257 u1 = -m14;
47258 else
47259 u1 = m14;
47260 }
47261 jsf[0].push(u1);
47262
47263 var u2;
47264 if ((m24 & 1) === 0) {
47265 u2 = 0;
47266 } else {
47267 var m8 = (k2.andln(7) + d2) & 7;
47268 if ((m8 === 3 || m8 === 5) && m14 === 2)
47269 u2 = -m24;
47270 else
47271 u2 = m24;
47272 }
47273 jsf[1].push(u2);
47274
47275 // Second phase
47276 if (2 * d1 === u1 + 1)
47277 d1 = 1 - d1;
47278 if (2 * d2 === u2 + 1)
47279 d2 = 1 - d2;
47280 k1.iushrn(1);
47281 k2.iushrn(1);
47282 }
47283
47284 return jsf;
47285}
47286utils.getJSF = getJSF;
47287
47288function cachedProperty(obj, name, computer) {
47289 var key = '_' + name;
47290 obj.prototype[name] = function cachedProperty() {
47291 return this[key] !== undefined ? this[key] :
47292 this[key] = computer.call(this);
47293 };
47294}
47295utils.cachedProperty = cachedProperty;
47296
47297function parseBytes(bytes) {
47298 return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :
47299 bytes;
47300}
47301utils.parseBytes = parseBytes;
47302
47303function intFromLE(bytes) {
47304 return new BN(bytes, 'hex', 'le');
47305}
47306utils.intFromLE = intFromLE;
47307
47308
47309},{"bn.js":81,"minimalistic-assert":123,"minimalistic-crypto-utils":124}],112:[function(require,module,exports){
47310module.exports={
47311 "_args": [
47312 [
47313 "elliptic",
47314 "/home/ian/git/bitcoin/bitcoinjs-lib-browser"
47315 ]
47316 ],
47317 "_from": "elliptic@latest",
47318 "_id": "elliptic@6.4.0",
47319 "_inCache": true,
47320 "_installable": true,
47321 "_location": "/elliptic",
47322 "_nodeVersion": "7.0.0",
47323 "_npmOperationalInternal": {
47324 "host": "packages-18-east.internal.npmjs.com",
47325 "tmp": "tmp/elliptic-6.4.0.tgz_1487798866428_0.30510620190761983"
47326 },
47327 "_npmUser": {
47328 "email": "fedor@indutny.com",
47329 "name": "indutny"
47330 },
47331 "_npmVersion": "3.10.8",
47332 "_phantomChildren": {},
47333 "_requested": {
47334 "name": "elliptic",
47335 "raw": "elliptic",
47336 "rawSpec": "",
47337 "scope": null,
47338 "spec": "latest",
47339 "type": "tag"
47340 },
47341 "_requiredBy": [
47342 "#USER"
47343 ],
47344 "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",
47345 "_shasum": "cac9af8762c85836187003c8dfe193e5e2eae5df",
47346 "_shrinkwrap": null,
47347 "_spec": "elliptic",
47348 "_where": "/home/ian/git/bitcoin/bitcoinjs-lib-browser",
47349 "author": {
47350 "email": "fedor@indutny.com",
47351 "name": "Fedor Indutny"
47352 },
47353 "bugs": {
47354 "url": "https://github.com/indutny/elliptic/issues"
47355 },
47356 "dependencies": {
47357 "bn.js": "^4.4.0",
47358 "brorand": "^1.0.1",
47359 "hash.js": "^1.0.0",
47360 "hmac-drbg": "^1.0.0",
47361 "inherits": "^2.0.1",
47362 "minimalistic-assert": "^1.0.0",
47363 "minimalistic-crypto-utils": "^1.0.0"
47364 },
47365 "description": "EC cryptography",
47366 "devDependencies": {
47367 "brfs": "^1.4.3",
47368 "coveralls": "^2.11.3",
47369 "grunt": "^0.4.5",
47370 "grunt-browserify": "^5.0.0",
47371 "grunt-cli": "^1.2.0",
47372 "grunt-contrib-connect": "^1.0.0",
47373 "grunt-contrib-copy": "^1.0.0",
47374 "grunt-contrib-uglify": "^1.0.1",
47375 "grunt-mocha-istanbul": "^3.0.1",
47376 "grunt-saucelabs": "^8.6.2",
47377 "istanbul": "^0.4.2",
47378 "jscs": "^2.9.0",
47379 "jshint": "^2.6.0",
47380 "mocha": "^2.1.0"
47381 },
47382 "directories": {},
47383 "dist": {
47384 "shasum": "cac9af8762c85836187003c8dfe193e5e2eae5df",
47385 "tarball": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz"
47386 },
47387 "files": [
47388 "lib"
47389 ],
47390 "gitHead": "6b0d2b76caae91471649c8e21f0b1d3ba0f96090",
47391 "homepage": "https://github.com/indutny/elliptic",
47392 "keywords": [
47393 "EC",
47394 "Elliptic",
47395 "curve",
47396 "Cryptography"
47397 ],
47398 "license": "MIT",
47399 "main": "lib/elliptic.js",
47400 "maintainers": [
47401 {
47402 "email": "fedor@indutny.com",
47403 "name": "indutny"
47404 }
47405 ],
47406 "name": "elliptic",
47407 "optionalDependencies": {},
47408 "readme": "ERROR: No README data found!",
47409 "repository": {
47410 "type": "git",
47411 "url": "git+ssh://git@github.com/indutny/elliptic.git"
47412 },
47413 "scripts": {
47414 "jscs": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",
47415 "jshint": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",
47416 "lint": "npm run jscs && npm run jshint",
47417 "test": "npm run lint && npm run unit",
47418 "unit": "istanbul test _mocha --reporter=spec test/index.js",
47419 "version": "grunt dist && git add dist/"
47420 },
47421 "version": "6.4.0"
47422}
47423
47424},{}],113:[function(require,module,exports){
47425(function (Buffer){
47426'use strict'
47427var Transform = require('stream').Transform
47428var inherits = require('inherits')
47429
47430function HashBase (blockSize) {
47431 Transform.call(this)
47432
47433 this._block = new Buffer(blockSize)
47434 this._blockSize = blockSize
47435 this._blockOffset = 0
47436 this._length = [0, 0, 0, 0]
47437
47438 this._finalized = false
47439}
47440
47441inherits(HashBase, Transform)
47442
47443HashBase.prototype._transform = function (chunk, encoding, callback) {
47444 var error = null
47445 try {
47446 if (encoding !== 'buffer') chunk = new Buffer(chunk, encoding)
47447 this.update(chunk)
47448 } catch (err) {
47449 error = err
47450 }
47451
47452 callback(error)
47453}
47454
47455HashBase.prototype._flush = function (callback) {
47456 var error = null
47457 try {
47458 this.push(this._digest())
47459 } catch (err) {
47460 error = err
47461 }
47462
47463 callback(error)
47464}
47465
47466HashBase.prototype.update = function (data, encoding) {
47467 if (!Buffer.isBuffer(data) && typeof data !== 'string') throw new TypeError('Data must be a string or a buffer')
47468 if (this._finalized) throw new Error('Digest already called')
47469 if (!Buffer.isBuffer(data)) data = new Buffer(data, encoding || 'binary')
47470
47471 // consume data
47472 var block = this._block
47473 var offset = 0
47474 while (this._blockOffset + data.length - offset >= this._blockSize) {
47475 for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]
47476 this._update()
47477 this._blockOffset = 0
47478 }
47479 while (offset < data.length) block[this._blockOffset++] = data[offset++]
47480
47481 // update length
47482 for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
47483 this._length[j] += carry
47484 carry = (this._length[j] / 0x0100000000) | 0
47485 if (carry > 0) this._length[j] -= 0x0100000000 * carry
47486 }
47487
47488 return this
47489}
47490
47491HashBase.prototype._update = function (data) {
47492 throw new Error('_update is not implemented')
47493}
47494
47495HashBase.prototype.digest = function (encoding) {
47496 if (this._finalized) throw new Error('Digest already called')
47497 this._finalized = true
47498
47499 var digest = this._digest()
47500 if (encoding !== undefined) digest = digest.toString(encoding)
47501 return digest
47502}
47503
47504HashBase.prototype._digest = function () {
47505 throw new Error('_digest is not implemented')
47506}
47507
47508module.exports = HashBase
47509
47510}).call(this,require("buffer").Buffer)
47511},{"buffer":5,"inherits":121,"stream":28}],114:[function(require,module,exports){
47512var hash = exports;
47513
47514hash.utils = require('./hash/utils');
47515hash.common = require('./hash/common');
47516hash.sha = require('./hash/sha');
47517hash.ripemd = require('./hash/ripemd');
47518hash.hmac = require('./hash/hmac');
47519
47520// Proxy hash functions to the main object
47521hash.sha1 = hash.sha.sha1;
47522hash.sha256 = hash.sha.sha256;
47523hash.sha224 = hash.sha.sha224;
47524hash.sha384 = hash.sha.sha384;
47525hash.sha512 = hash.sha.sha512;
47526hash.ripemd160 = hash.ripemd.ripemd160;
47527
47528},{"./hash/common":115,"./hash/hmac":116,"./hash/ripemd":117,"./hash/sha":118,"./hash/utils":119}],115:[function(require,module,exports){
47529var hash = require('../hash');
47530var utils = hash.utils;
47531var assert = utils.assert;
47532
47533function BlockHash() {
47534 this.pending = null;
47535 this.pendingTotal = 0;
47536 this.blockSize = this.constructor.blockSize;
47537 this.outSize = this.constructor.outSize;
47538 this.hmacStrength = this.constructor.hmacStrength;
47539 this.padLength = this.constructor.padLength / 8;
47540 this.endian = 'big';
47541
47542 this._delta8 = this.blockSize / 8;
47543 this._delta32 = this.blockSize / 32;
47544}
47545exports.BlockHash = BlockHash;
47546
47547BlockHash.prototype.update = function update(msg, enc) {
47548 // Convert message to array, pad it, and join into 32bit blocks
47549 msg = utils.toArray(msg, enc);
47550 if (!this.pending)
47551 this.pending = msg;
47552 else
47553 this.pending = this.pending.concat(msg);
47554 this.pendingTotal += msg.length;
47555
47556 // Enough data, try updating
47557 if (this.pending.length >= this._delta8) {
47558 msg = this.pending;
47559
47560 // Process pending data in blocks
47561 var r = msg.length % this._delta8;
47562 this.pending = msg.slice(msg.length - r, msg.length);
47563 if (this.pending.length === 0)
47564 this.pending = null;
47565
47566 msg = utils.join32(msg, 0, msg.length - r, this.endian);
47567 for (var i = 0; i < msg.length; i += this._delta32)
47568 this._update(msg, i, i + this._delta32);
47569 }
47570
47571 return this;
47572};
47573
47574BlockHash.prototype.digest = function digest(enc) {
47575 this.update(this._pad());
47576 assert(this.pending === null);
47577
47578 return this._digest(enc);
47579};
47580
47581BlockHash.prototype._pad = function pad() {
47582 var len = this.pendingTotal;
47583 var bytes = this._delta8;
47584 var k = bytes - ((len + this.padLength) % bytes);
47585 var res = new Array(k + this.padLength);
47586 res[0] = 0x80;
47587 for (var i = 1; i < k; i++)
47588 res[i] = 0;
47589
47590 // Append length
47591 len <<= 3;
47592 if (this.endian === 'big') {
47593 for (var t = 8; t < this.padLength; t++)
47594 res[i++] = 0;
47595
47596 res[i++] = 0;
47597 res[i++] = 0;
47598 res[i++] = 0;
47599 res[i++] = 0;
47600 res[i++] = (len >>> 24) & 0xff;
47601 res[i++] = (len >>> 16) & 0xff;
47602 res[i++] = (len >>> 8) & 0xff;
47603 res[i++] = len & 0xff;
47604 } else {
47605 res[i++] = len & 0xff;
47606 res[i++] = (len >>> 8) & 0xff;
47607 res[i++] = (len >>> 16) & 0xff;
47608 res[i++] = (len >>> 24) & 0xff;
47609 res[i++] = 0;
47610 res[i++] = 0;
47611 res[i++] = 0;
47612 res[i++] = 0;
47613
47614 for (var t = 8; t < this.padLength; t++)
47615 res[i++] = 0;
47616 }
47617
47618 return res;
47619};
47620
47621},{"../hash":114}],116:[function(require,module,exports){
47622var hmac = exports;
47623
47624var hash = require('../hash');
47625var utils = hash.utils;
47626var assert = utils.assert;
47627
47628function Hmac(hash, key, enc) {
47629 if (!(this instanceof Hmac))
47630 return new Hmac(hash, key, enc);
47631 this.Hash = hash;
47632 this.blockSize = hash.blockSize / 8;
47633 this.outSize = hash.outSize / 8;
47634 this.inner = null;
47635 this.outer = null;
47636
47637 this._init(utils.toArray(key, enc));
47638}
47639module.exports = Hmac;
47640
47641Hmac.prototype._init = function init(key) {
47642 // Shorten key, if needed
47643 if (key.length > this.blockSize)
47644 key = new this.Hash().update(key).digest();
47645 assert(key.length <= this.blockSize);
47646
47647 // Add padding to key
47648 for (var i = key.length; i < this.blockSize; i++)
47649 key.push(0);
47650
47651 for (var i = 0; i < key.length; i++)
47652 key[i] ^= 0x36;
47653 this.inner = new this.Hash().update(key);
47654
47655 // 0x36 ^ 0x5c = 0x6a
47656 for (var i = 0; i < key.length; i++)
47657 key[i] ^= 0x6a;
47658 this.outer = new this.Hash().update(key);
47659};
47660
47661Hmac.prototype.update = function update(msg, enc) {
47662 this.inner.update(msg, enc);
47663 return this;
47664};
47665
47666Hmac.prototype.digest = function digest(enc) {
47667 this.outer.update(this.inner.digest());
47668 return this.outer.digest(enc);
47669};
47670
47671},{"../hash":114}],117:[function(require,module,exports){
47672var hash = require('../hash');
47673var utils = hash.utils;
47674
47675var rotl32 = utils.rotl32;
47676var sum32 = utils.sum32;
47677var sum32_3 = utils.sum32_3;
47678var sum32_4 = utils.sum32_4;
47679var BlockHash = hash.common.BlockHash;
47680
47681function RIPEMD160() {
47682 if (!(this instanceof RIPEMD160))
47683 return new RIPEMD160();
47684
47685 BlockHash.call(this);
47686
47687 this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
47688 this.endian = 'little';
47689}
47690utils.inherits(RIPEMD160, BlockHash);
47691exports.ripemd160 = RIPEMD160;
47692
47693RIPEMD160.blockSize = 512;
47694RIPEMD160.outSize = 160;
47695RIPEMD160.hmacStrength = 192;
47696RIPEMD160.padLength = 64;
47697
47698RIPEMD160.prototype._update = function update(msg, start) {
47699 var A = this.h[0];
47700 var B = this.h[1];
47701 var C = this.h[2];
47702 var D = this.h[3];
47703 var E = this.h[4];
47704 var Ah = A;
47705 var Bh = B;
47706 var Ch = C;
47707 var Dh = D;
47708 var Eh = E;
47709 for (var j = 0; j < 80; j++) {
47710 var T = sum32(
47711 rotl32(
47712 sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),
47713 s[j]),
47714 E);
47715 A = E;
47716 E = D;
47717 D = rotl32(C, 10);
47718 C = B;
47719 B = T;
47720 T = sum32(
47721 rotl32(
47722 sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),
47723 sh[j]),
47724 Eh);
47725 Ah = Eh;
47726 Eh = Dh;
47727 Dh = rotl32(Ch, 10);
47728 Ch = Bh;
47729 Bh = T;
47730 }
47731 T = sum32_3(this.h[1], C, Dh);
47732 this.h[1] = sum32_3(this.h[2], D, Eh);
47733 this.h[2] = sum32_3(this.h[3], E, Ah);
47734 this.h[3] = sum32_3(this.h[4], A, Bh);
47735 this.h[4] = sum32_3(this.h[0], B, Ch);
47736 this.h[0] = T;
47737};
47738
47739RIPEMD160.prototype._digest = function digest(enc) {
47740 if (enc === 'hex')
47741 return utils.toHex32(this.h, 'little');
47742 else
47743 return utils.split32(this.h, 'little');
47744};
47745
47746function f(j, x, y, z) {
47747 if (j <= 15)
47748 return x ^ y ^ z;
47749 else if (j <= 31)
47750 return (x & y) | ((~x) & z);
47751 else if (j <= 47)
47752 return (x | (~y)) ^ z;
47753 else if (j <= 63)
47754 return (x & z) | (y & (~z));
47755 else
47756 return x ^ (y | (~z));
47757}
47758
47759function K(j) {
47760 if (j <= 15)
47761 return 0x00000000;
47762 else if (j <= 31)
47763 return 0x5a827999;
47764 else if (j <= 47)
47765 return 0x6ed9eba1;
47766 else if (j <= 63)
47767 return 0x8f1bbcdc;
47768 else
47769 return 0xa953fd4e;
47770}
47771
47772function Kh(j) {
47773 if (j <= 15)
47774 return 0x50a28be6;
47775 else if (j <= 31)
47776 return 0x5c4dd124;
47777 else if (j <= 47)
47778 return 0x6d703ef3;
47779 else if (j <= 63)
47780 return 0x7a6d76e9;
47781 else
47782 return 0x00000000;
47783}
47784
47785var r = [
47786 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
47787 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
47788 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
47789 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
47790 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
47791];
47792
47793var rh = [
47794 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
47795 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
47796 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
47797 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
47798 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
47799];
47800
47801var s = [
47802 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
47803 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
47804 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
47805 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
47806 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
47807];
47808
47809var sh = [
47810 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
47811 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
47812 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
47813 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
47814 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
47815];
47816
47817},{"../hash":114}],118:[function(require,module,exports){
47818var hash = require('../hash');
47819var utils = hash.utils;
47820var assert = utils.assert;
47821
47822var rotr32 = utils.rotr32;
47823var rotl32 = utils.rotl32;
47824var sum32 = utils.sum32;
47825var sum32_4 = utils.sum32_4;
47826var sum32_5 = utils.sum32_5;
47827var rotr64_hi = utils.rotr64_hi;
47828var rotr64_lo = utils.rotr64_lo;
47829var shr64_hi = utils.shr64_hi;
47830var shr64_lo = utils.shr64_lo;
47831var sum64 = utils.sum64;
47832var sum64_hi = utils.sum64_hi;
47833var sum64_lo = utils.sum64_lo;
47834var sum64_4_hi = utils.sum64_4_hi;
47835var sum64_4_lo = utils.sum64_4_lo;
47836var sum64_5_hi = utils.sum64_5_hi;
47837var sum64_5_lo = utils.sum64_5_lo;
47838var BlockHash = hash.common.BlockHash;
47839
47840var sha256_K = [
47841 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
47842 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
47843 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
47844 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
47845 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
47846 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
47847 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
47848 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
47849 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
47850 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
47851 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
47852 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
47853 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
47854 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
47855 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
47856 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
47857];
47858
47859var sha512_K = [
47860 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
47861 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
47862 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
47863 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
47864 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
47865 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
47866 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
47867 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
47868 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
47869 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
47870 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
47871 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
47872 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
47873 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
47874 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
47875 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
47876 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
47877 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
47878 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
47879 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
47880 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
47881 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
47882 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
47883 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
47884 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
47885 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
47886 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
47887 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
47888 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
47889 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
47890 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
47891 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
47892 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
47893 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
47894 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
47895 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
47896 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
47897 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
47898 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
47899 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
47900];
47901
47902var sha1_K = [
47903 0x5A827999, 0x6ED9EBA1,
47904 0x8F1BBCDC, 0xCA62C1D6
47905];
47906
47907function SHA256() {
47908 if (!(this instanceof SHA256))
47909 return new SHA256();
47910
47911 BlockHash.call(this);
47912 this.h = [ 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
47913 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 ];
47914 this.k = sha256_K;
47915 this.W = new Array(64);
47916}
47917utils.inherits(SHA256, BlockHash);
47918exports.sha256 = SHA256;
47919
47920SHA256.blockSize = 512;
47921SHA256.outSize = 256;
47922SHA256.hmacStrength = 192;
47923SHA256.padLength = 64;
47924
47925SHA256.prototype._update = function _update(msg, start) {
47926 var W = this.W;
47927
47928 for (var i = 0; i < 16; i++)
47929 W[i] = msg[start + i];
47930 for (; i < W.length; i++)
47931 W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
47932
47933 var a = this.h[0];
47934 var b = this.h[1];
47935 var c = this.h[2];
47936 var d = this.h[3];
47937 var e = this.h[4];
47938 var f = this.h[5];
47939 var g = this.h[6];
47940 var h = this.h[7];
47941
47942 assert(this.k.length === W.length);
47943 for (var i = 0; i < W.length; i++) {
47944 var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
47945 var T2 = sum32(s0_256(a), maj32(a, b, c));
47946 h = g;
47947 g = f;
47948 f = e;
47949 e = sum32(d, T1);
47950 d = c;
47951 c = b;
47952 b = a;
47953 a = sum32(T1, T2);
47954 }
47955
47956 this.h[0] = sum32(this.h[0], a);
47957 this.h[1] = sum32(this.h[1], b);
47958 this.h[2] = sum32(this.h[2], c);
47959 this.h[3] = sum32(this.h[3], d);
47960 this.h[4] = sum32(this.h[4], e);
47961 this.h[5] = sum32(this.h[5], f);
47962 this.h[6] = sum32(this.h[6], g);
47963 this.h[7] = sum32(this.h[7], h);
47964};
47965
47966SHA256.prototype._digest = function digest(enc) {
47967 if (enc === 'hex')
47968 return utils.toHex32(this.h, 'big');
47969 else
47970 return utils.split32(this.h, 'big');
47971};
47972
47973function SHA224() {
47974 if (!(this instanceof SHA224))
47975 return new SHA224();
47976
47977 SHA256.call(this);
47978 this.h = [ 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
47979 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];
47980}
47981utils.inherits(SHA224, SHA256);
47982exports.sha224 = SHA224;
47983
47984SHA224.blockSize = 512;
47985SHA224.outSize = 224;
47986SHA224.hmacStrength = 192;
47987SHA224.padLength = 64;
47988
47989SHA224.prototype._digest = function digest(enc) {
47990 // Just truncate output
47991 if (enc === 'hex')
47992 return utils.toHex32(this.h.slice(0, 7), 'big');
47993 else
47994 return utils.split32(this.h.slice(0, 7), 'big');
47995};
47996
47997function SHA512() {
47998 if (!(this instanceof SHA512))
47999 return new SHA512();
48000
48001 BlockHash.call(this);
48002 this.h = [ 0x6a09e667, 0xf3bcc908,
48003 0xbb67ae85, 0x84caa73b,
48004 0x3c6ef372, 0xfe94f82b,
48005 0xa54ff53a, 0x5f1d36f1,
48006 0x510e527f, 0xade682d1,
48007 0x9b05688c, 0x2b3e6c1f,
48008 0x1f83d9ab, 0xfb41bd6b,
48009 0x5be0cd19, 0x137e2179 ];
48010 this.k = sha512_K;
48011 this.W = new Array(160);
48012}
48013utils.inherits(SHA512, BlockHash);
48014exports.sha512 = SHA512;
48015
48016SHA512.blockSize = 1024;
48017SHA512.outSize = 512;
48018SHA512.hmacStrength = 192;
48019SHA512.padLength = 128;
48020
48021SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
48022 var W = this.W;
48023
48024 // 32 x 32bit words
48025 for (var i = 0; i < 32; i++)
48026 W[i] = msg[start + i];
48027 for (; i < W.length; i += 2) {
48028 var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2
48029 var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
48030 var c1_hi = W[i - 14]; // i - 7
48031 var c1_lo = W[i - 13];
48032 var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15
48033 var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);
48034 var c3_hi = W[i - 32]; // i - 16
48035 var c3_lo = W[i - 31];
48036
48037 W[i] = sum64_4_hi(c0_hi, c0_lo,
48038 c1_hi, c1_lo,
48039 c2_hi, c2_lo,
48040 c3_hi, c3_lo);
48041 W[i + 1] = sum64_4_lo(c0_hi, c0_lo,
48042 c1_hi, c1_lo,
48043 c2_hi, c2_lo,
48044 c3_hi, c3_lo);
48045 }
48046};
48047
48048SHA512.prototype._update = function _update(msg, start) {
48049 this._prepareBlock(msg, start);
48050
48051 var W = this.W;
48052
48053 var ah = this.h[0];
48054 var al = this.h[1];
48055 var bh = this.h[2];
48056 var bl = this.h[3];
48057 var ch = this.h[4];
48058 var cl = this.h[5];
48059 var dh = this.h[6];
48060 var dl = this.h[7];
48061 var eh = this.h[8];
48062 var el = this.h[9];
48063 var fh = this.h[10];
48064 var fl = this.h[11];
48065 var gh = this.h[12];
48066 var gl = this.h[13];
48067 var hh = this.h[14];
48068 var hl = this.h[15];
48069
48070 assert(this.k.length === W.length);
48071 for (var i = 0; i < W.length; i += 2) {
48072 var c0_hi = hh;
48073 var c0_lo = hl;
48074 var c1_hi = s1_512_hi(eh, el);
48075 var c1_lo = s1_512_lo(eh, el);
48076 var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);
48077 var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
48078 var c3_hi = this.k[i];
48079 var c3_lo = this.k[i + 1];
48080 var c4_hi = W[i];
48081 var c4_lo = W[i + 1];
48082
48083 var T1_hi = sum64_5_hi(c0_hi, c0_lo,
48084 c1_hi, c1_lo,
48085 c2_hi, c2_lo,
48086 c3_hi, c3_lo,
48087 c4_hi, c4_lo);
48088 var T1_lo = sum64_5_lo(c0_hi, c0_lo,
48089 c1_hi, c1_lo,
48090 c2_hi, c2_lo,
48091 c3_hi, c3_lo,
48092 c4_hi, c4_lo);
48093
48094 var c0_hi = s0_512_hi(ah, al);
48095 var c0_lo = s0_512_lo(ah, al);
48096 var c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);
48097 var c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
48098
48099 var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
48100 var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
48101
48102 hh = gh;
48103 hl = gl;
48104
48105 gh = fh;
48106 gl = fl;
48107
48108 fh = eh;
48109 fl = el;
48110
48111 eh = sum64_hi(dh, dl, T1_hi, T1_lo);
48112 el = sum64_lo(dl, dl, T1_hi, T1_lo);
48113
48114 dh = ch;
48115 dl = cl;
48116
48117 ch = bh;
48118 cl = bl;
48119
48120 bh = ah;
48121 bl = al;
48122
48123 ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);
48124 al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);
48125 }
48126
48127 sum64(this.h, 0, ah, al);
48128 sum64(this.h, 2, bh, bl);
48129 sum64(this.h, 4, ch, cl);
48130 sum64(this.h, 6, dh, dl);
48131 sum64(this.h, 8, eh, el);
48132 sum64(this.h, 10, fh, fl);
48133 sum64(this.h, 12, gh, gl);
48134 sum64(this.h, 14, hh, hl);
48135};
48136
48137SHA512.prototype._digest = function digest(enc) {
48138 if (enc === 'hex')
48139 return utils.toHex32(this.h, 'big');
48140 else
48141 return utils.split32(this.h, 'big');
48142};
48143
48144function SHA384() {
48145 if (!(this instanceof SHA384))
48146 return new SHA384();
48147
48148 SHA512.call(this);
48149 this.h = [ 0xcbbb9d5d, 0xc1059ed8,
48150 0x629a292a, 0x367cd507,
48151 0x9159015a, 0x3070dd17,
48152 0x152fecd8, 0xf70e5939,
48153 0x67332667, 0xffc00b31,
48154 0x8eb44a87, 0x68581511,
48155 0xdb0c2e0d, 0x64f98fa7,
48156 0x47b5481d, 0xbefa4fa4 ];
48157}
48158utils.inherits(SHA384, SHA512);
48159exports.sha384 = SHA384;
48160
48161SHA384.blockSize = 1024;
48162SHA384.outSize = 384;
48163SHA384.hmacStrength = 192;
48164SHA384.padLength = 128;
48165
48166SHA384.prototype._digest = function digest(enc) {
48167 if (enc === 'hex')
48168 return utils.toHex32(this.h.slice(0, 12), 'big');
48169 else
48170 return utils.split32(this.h.slice(0, 12), 'big');
48171};
48172
48173function SHA1() {
48174 if (!(this instanceof SHA1))
48175 return new SHA1();
48176
48177 BlockHash.call(this);
48178 this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe,
48179 0x10325476, 0xc3d2e1f0 ];
48180 this.W = new Array(80);
48181}
48182
48183utils.inherits(SHA1, BlockHash);
48184exports.sha1 = SHA1;
48185
48186SHA1.blockSize = 512;
48187SHA1.outSize = 160;
48188SHA1.hmacStrength = 80;
48189SHA1.padLength = 64;
48190
48191SHA1.prototype._update = function _update(msg, start) {
48192 var W = this.W;
48193
48194 for (var i = 0; i < 16; i++)
48195 W[i] = msg[start + i];
48196
48197 for(; i < W.length; i++)
48198 W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
48199
48200 var a = this.h[0];
48201 var b = this.h[1];
48202 var c = this.h[2];
48203 var d = this.h[3];
48204 var e = this.h[4];
48205
48206 for (var i = 0; i < W.length; i++) {
48207 var s = ~~(i / 20);
48208 var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
48209 e = d;
48210 d = c;
48211 c = rotl32(b, 30);
48212 b = a;
48213 a = t;
48214 }
48215
48216 this.h[0] = sum32(this.h[0], a);
48217 this.h[1] = sum32(this.h[1], b);
48218 this.h[2] = sum32(this.h[2], c);
48219 this.h[3] = sum32(this.h[3], d);
48220 this.h[4] = sum32(this.h[4], e);
48221};
48222
48223SHA1.prototype._digest = function digest(enc) {
48224 if (enc === 'hex')
48225 return utils.toHex32(this.h, 'big');
48226 else
48227 return utils.split32(this.h, 'big');
48228};
48229
48230function ch32(x, y, z) {
48231 return (x & y) ^ ((~x) & z);
48232}
48233
48234function maj32(x, y, z) {
48235 return (x & y) ^ (x & z) ^ (y & z);
48236}
48237
48238function p32(x, y, z) {
48239 return x ^ y ^ z;
48240}
48241
48242function s0_256(x) {
48243 return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
48244}
48245
48246function s1_256(x) {
48247 return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
48248}
48249
48250function g0_256(x) {
48251 return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
48252}
48253
48254function g1_256(x) {
48255 return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
48256}
48257
48258function ft_1(s, x, y, z) {
48259 if (s === 0)
48260 return ch32(x, y, z);
48261 if (s === 1 || s === 3)
48262 return p32(x, y, z);
48263 if (s === 2)
48264 return maj32(x, y, z);
48265}
48266
48267function ch64_hi(xh, xl, yh, yl, zh, zl) {
48268 var r = (xh & yh) ^ ((~xh) & zh);
48269 if (r < 0)
48270 r += 0x100000000;
48271 return r;
48272}
48273
48274function ch64_lo(xh, xl, yh, yl, zh, zl) {
48275 var r = (xl & yl) ^ ((~xl) & zl);
48276 if (r < 0)
48277 r += 0x100000000;
48278 return r;
48279}
48280
48281function maj64_hi(xh, xl, yh, yl, zh, zl) {
48282 var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);
48283 if (r < 0)
48284 r += 0x100000000;
48285 return r;
48286}
48287
48288function maj64_lo(xh, xl, yh, yl, zh, zl) {
48289 var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);
48290 if (r < 0)
48291 r += 0x100000000;
48292 return r;
48293}
48294
48295function s0_512_hi(xh, xl) {
48296 var c0_hi = rotr64_hi(xh, xl, 28);
48297 var c1_hi = rotr64_hi(xl, xh, 2); // 34
48298 var c2_hi = rotr64_hi(xl, xh, 7); // 39
48299
48300 var r = c0_hi ^ c1_hi ^ c2_hi;
48301 if (r < 0)
48302 r += 0x100000000;
48303 return r;
48304}
48305
48306function s0_512_lo(xh, xl) {
48307 var c0_lo = rotr64_lo(xh, xl, 28);
48308 var c1_lo = rotr64_lo(xl, xh, 2); // 34
48309 var c2_lo = rotr64_lo(xl, xh, 7); // 39
48310
48311 var r = c0_lo ^ c1_lo ^ c2_lo;
48312 if (r < 0)
48313 r += 0x100000000;
48314 return r;
48315}
48316
48317function s1_512_hi(xh, xl) {
48318 var c0_hi = rotr64_hi(xh, xl, 14);
48319 var c1_hi = rotr64_hi(xh, xl, 18);
48320 var c2_hi = rotr64_hi(xl, xh, 9); // 41
48321
48322 var r = c0_hi ^ c1_hi ^ c2_hi;
48323 if (r < 0)
48324 r += 0x100000000;
48325 return r;
48326}
48327
48328function s1_512_lo(xh, xl) {
48329 var c0_lo = rotr64_lo(xh, xl, 14);
48330 var c1_lo = rotr64_lo(xh, xl, 18);
48331 var c2_lo = rotr64_lo(xl, xh, 9); // 41
48332
48333 var r = c0_lo ^ c1_lo ^ c2_lo;
48334 if (r < 0)
48335 r += 0x100000000;
48336 return r;
48337}
48338
48339function g0_512_hi(xh, xl) {
48340 var c0_hi = rotr64_hi(xh, xl, 1);
48341 var c1_hi = rotr64_hi(xh, xl, 8);
48342 var c2_hi = shr64_hi(xh, xl, 7);
48343
48344 var r = c0_hi ^ c1_hi ^ c2_hi;
48345 if (r < 0)
48346 r += 0x100000000;
48347 return r;
48348}
48349
48350function g0_512_lo(xh, xl) {
48351 var c0_lo = rotr64_lo(xh, xl, 1);
48352 var c1_lo = rotr64_lo(xh, xl, 8);
48353 var c2_lo = shr64_lo(xh, xl, 7);
48354
48355 var r = c0_lo ^ c1_lo ^ c2_lo;
48356 if (r < 0)
48357 r += 0x100000000;
48358 return r;
48359}
48360
48361function g1_512_hi(xh, xl) {
48362 var c0_hi = rotr64_hi(xh, xl, 19);
48363 var c1_hi = rotr64_hi(xl, xh, 29); // 61
48364 var c2_hi = shr64_hi(xh, xl, 6);
48365
48366 var r = c0_hi ^ c1_hi ^ c2_hi;
48367 if (r < 0)
48368 r += 0x100000000;
48369 return r;
48370}
48371
48372function g1_512_lo(xh, xl) {
48373 var c0_lo = rotr64_lo(xh, xl, 19);
48374 var c1_lo = rotr64_lo(xl, xh, 29); // 61
48375 var c2_lo = shr64_lo(xh, xl, 6);
48376
48377 var r = c0_lo ^ c1_lo ^ c2_lo;
48378 if (r < 0)
48379 r += 0x100000000;
48380 return r;
48381}
48382
48383},{"../hash":114}],119:[function(require,module,exports){
48384var utils = exports;
48385var inherits = require('inherits');
48386
48387function toArray(msg, enc) {
48388 if (Array.isArray(msg))
48389 return msg.slice();
48390 if (!msg)
48391 return [];
48392 var res = [];
48393 if (typeof msg === 'string') {
48394 if (!enc) {
48395 for (var i = 0; i < msg.length; i++) {
48396 var c = msg.charCodeAt(i);
48397 var hi = c >> 8;
48398 var lo = c & 0xff;
48399 if (hi)
48400 res.push(hi, lo);
48401 else
48402 res.push(lo);
48403 }
48404 } else if (enc === 'hex') {
48405 msg = msg.replace(/[^a-z0-9]+/ig, '');
48406 if (msg.length % 2 !== 0)
48407 msg = '0' + msg;
48408 for (var i = 0; i < msg.length; i += 2)
48409 res.push(parseInt(msg[i] + msg[i + 1], 16));
48410 }
48411 } else {
48412 for (var i = 0; i < msg.length; i++)
48413 res[i] = msg[i] | 0;
48414 }
48415 return res;
48416}
48417utils.toArray = toArray;
48418
48419function toHex(msg) {
48420 var res = '';
48421 for (var i = 0; i < msg.length; i++)
48422 res += zero2(msg[i].toString(16));
48423 return res;
48424}
48425utils.toHex = toHex;
48426
48427function htonl(w) {
48428 var res = (w >>> 24) |
48429 ((w >>> 8) & 0xff00) |
48430 ((w << 8) & 0xff0000) |
48431 ((w & 0xff) << 24);
48432 return res >>> 0;
48433}
48434utils.htonl = htonl;
48435
48436function toHex32(msg, endian) {
48437 var res = '';
48438 for (var i = 0; i < msg.length; i++) {
48439 var w = msg[i];
48440 if (endian === 'little')
48441 w = htonl(w);
48442 res += zero8(w.toString(16));
48443 }
48444 return res;
48445}
48446utils.toHex32 = toHex32;
48447
48448function zero2(word) {
48449 if (word.length === 1)
48450 return '0' + word;
48451 else
48452 return word;
48453}
48454utils.zero2 = zero2;
48455
48456function zero8(word) {
48457 if (word.length === 7)
48458 return '0' + word;
48459 else if (word.length === 6)
48460 return '00' + word;
48461 else if (word.length === 5)
48462 return '000' + word;
48463 else if (word.length === 4)
48464 return '0000' + word;
48465 else if (word.length === 3)
48466 return '00000' + word;
48467 else if (word.length === 2)
48468 return '000000' + word;
48469 else if (word.length === 1)
48470 return '0000000' + word;
48471 else
48472 return word;
48473}
48474utils.zero8 = zero8;
48475
48476function join32(msg, start, end, endian) {
48477 var len = end - start;
48478 assert(len % 4 === 0);
48479 var res = new Array(len / 4);
48480 for (var i = 0, k = start; i < res.length; i++, k += 4) {
48481 var w;
48482 if (endian === 'big')
48483 w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
48484 else
48485 w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
48486 res[i] = w >>> 0;
48487 }
48488 return res;
48489}
48490utils.join32 = join32;
48491
48492function split32(msg, endian) {
48493 var res = new Array(msg.length * 4);
48494 for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
48495 var m = msg[i];
48496 if (endian === 'big') {
48497 res[k] = m >>> 24;
48498 res[k + 1] = (m >>> 16) & 0xff;
48499 res[k + 2] = (m >>> 8) & 0xff;
48500 res[k + 3] = m & 0xff;
48501 } else {
48502 res[k + 3] = m >>> 24;
48503 res[k + 2] = (m >>> 16) & 0xff;
48504 res[k + 1] = (m >>> 8) & 0xff;
48505 res[k] = m & 0xff;
48506 }
48507 }
48508 return res;
48509}
48510utils.split32 = split32;
48511
48512function rotr32(w, b) {
48513 return (w >>> b) | (w << (32 - b));
48514}
48515utils.rotr32 = rotr32;
48516
48517function rotl32(w, b) {
48518 return (w << b) | (w >>> (32 - b));
48519}
48520utils.rotl32 = rotl32;
48521
48522function sum32(a, b) {
48523 return (a + b) >>> 0;
48524}
48525utils.sum32 = sum32;
48526
48527function sum32_3(a, b, c) {
48528 return (a + b + c) >>> 0;
48529}
48530utils.sum32_3 = sum32_3;
48531
48532function sum32_4(a, b, c, d) {
48533 return (a + b + c + d) >>> 0;
48534}
48535utils.sum32_4 = sum32_4;
48536
48537function sum32_5(a, b, c, d, e) {
48538 return (a + b + c + d + e) >>> 0;
48539}
48540utils.sum32_5 = sum32_5;
48541
48542function assert(cond, msg) {
48543 if (!cond)
48544 throw new Error(msg || 'Assertion failed');
48545}
48546utils.assert = assert;
48547
48548utils.inherits = inherits;
48549
48550function sum64(buf, pos, ah, al) {
48551 var bh = buf[pos];
48552 var bl = buf[pos + 1];
48553
48554 var lo = (al + bl) >>> 0;
48555 var hi = (lo < al ? 1 : 0) + ah + bh;
48556 buf[pos] = hi >>> 0;
48557 buf[pos + 1] = lo;
48558}
48559exports.sum64 = sum64;
48560
48561function sum64_hi(ah, al, bh, bl) {
48562 var lo = (al + bl) >>> 0;
48563 var hi = (lo < al ? 1 : 0) + ah + bh;
48564 return hi >>> 0;
48565};
48566exports.sum64_hi = sum64_hi;
48567
48568function sum64_lo(ah, al, bh, bl) {
48569 var lo = al + bl;
48570 return lo >>> 0;
48571};
48572exports.sum64_lo = sum64_lo;
48573
48574function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
48575 var carry = 0;
48576 var lo = al;
48577 lo = (lo + bl) >>> 0;
48578 carry += lo < al ? 1 : 0;
48579 lo = (lo + cl) >>> 0;
48580 carry += lo < cl ? 1 : 0;
48581 lo = (lo + dl) >>> 0;
48582 carry += lo < dl ? 1 : 0;
48583
48584 var hi = ah + bh + ch + dh + carry;
48585 return hi >>> 0;
48586};
48587exports.sum64_4_hi = sum64_4_hi;
48588
48589function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
48590 var lo = al + bl + cl + dl;
48591 return lo >>> 0;
48592};
48593exports.sum64_4_lo = sum64_4_lo;
48594
48595function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
48596 var carry = 0;
48597 var lo = al;
48598 lo = (lo + bl) >>> 0;
48599 carry += lo < al ? 1 : 0;
48600 lo = (lo + cl) >>> 0;
48601 carry += lo < cl ? 1 : 0;
48602 lo = (lo + dl) >>> 0;
48603 carry += lo < dl ? 1 : 0;
48604 lo = (lo + el) >>> 0;
48605 carry += lo < el ? 1 : 0;
48606
48607 var hi = ah + bh + ch + dh + eh + carry;
48608 return hi >>> 0;
48609};
48610exports.sum64_5_hi = sum64_5_hi;
48611
48612function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
48613 var lo = al + bl + cl + dl + el;
48614
48615 return lo >>> 0;
48616};
48617exports.sum64_5_lo = sum64_5_lo;
48618
48619function rotr64_hi(ah, al, num) {
48620 var r = (al << (32 - num)) | (ah >>> num);
48621 return r >>> 0;
48622};
48623exports.rotr64_hi = rotr64_hi;
48624
48625function rotr64_lo(ah, al, num) {
48626 var r = (ah << (32 - num)) | (al >>> num);
48627 return r >>> 0;
48628};
48629exports.rotr64_lo = rotr64_lo;
48630
48631function shr64_hi(ah, al, num) {
48632 return ah >>> num;
48633};
48634exports.shr64_hi = shr64_hi;
48635
48636function shr64_lo(ah, al, num) {
48637 var r = (ah << (32 - num)) | (al >>> num);
48638 return r >>> 0;
48639};
48640exports.shr64_lo = shr64_lo;
48641
48642},{"inherits":121}],120:[function(require,module,exports){
48643'use strict';
48644
48645var hash = require('hash.js');
48646var utils = require('minimalistic-crypto-utils');
48647var assert = require('minimalistic-assert');
48648
48649function HmacDRBG(options) {
48650 if (!(this instanceof HmacDRBG))
48651 return new HmacDRBG(options);
48652 this.hash = options.hash;
48653 this.predResist = !!options.predResist;
48654
48655 this.outLen = this.hash.outSize;
48656 this.minEntropy = options.minEntropy || this.hash.hmacStrength;
48657
48658 this._reseed = null;
48659 this.reseedInterval = null;
48660 this.K = null;
48661 this.V = null;
48662
48663 var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');
48664 var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');
48665 var pers = utils.toArray(options.pers, options.persEnc || 'hex');
48666 assert(entropy.length >= (this.minEntropy / 8),
48667 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
48668 this._init(entropy, nonce, pers);
48669}
48670module.exports = HmacDRBG;
48671
48672HmacDRBG.prototype._init = function init(entropy, nonce, pers) {
48673 var seed = entropy.concat(nonce).concat(pers);
48674
48675 this.K = new Array(this.outLen / 8);
48676 this.V = new Array(this.outLen / 8);
48677 for (var i = 0; i < this.V.length; i++) {
48678 this.K[i] = 0x00;
48679 this.V[i] = 0x01;
48680 }
48681
48682 this._update(seed);
48683 this._reseed = 1;
48684 this.reseedInterval = 0x1000000000000; // 2^48
48685};
48686
48687HmacDRBG.prototype._hmac = function hmac() {
48688 return new hash.hmac(this.hash, this.K);
48689};
48690
48691HmacDRBG.prototype._update = function update(seed) {
48692 var kmac = this._hmac()
48693 .update(this.V)
48694 .update([ 0x00 ]);
48695 if (seed)
48696 kmac = kmac.update(seed);
48697 this.K = kmac.digest();
48698 this.V = this._hmac().update(this.V).digest();
48699 if (!seed)
48700 return;
48701
48702 this.K = this._hmac()
48703 .update(this.V)
48704 .update([ 0x01 ])
48705 .update(seed)
48706 .digest();
48707 this.V = this._hmac().update(this.V).digest();
48708};
48709
48710HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {
48711 // Optional entropy enc
48712 if (typeof entropyEnc !== 'string') {
48713 addEnc = add;
48714 add = entropyEnc;
48715 entropyEnc = null;
48716 }
48717
48718 entropy = utils.toArray(entropy, entropyEnc);
48719 add = utils.toArray(add, addEnc);
48720
48721 assert(entropy.length >= (this.minEntropy / 8),
48722 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
48723
48724 this._update(entropy.concat(add || []));
48725 this._reseed = 1;
48726};
48727
48728HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
48729 if (this._reseed > this.reseedInterval)
48730 throw new Error('Reseed is required');
48731
48732 // Optional encoding
48733 if (typeof enc !== 'string') {
48734 addEnc = add;
48735 add = enc;
48736 enc = null;
48737 }
48738
48739 // Optional additional data
48740 if (add) {
48741 add = utils.toArray(add, addEnc || 'hex');
48742 this._update(add);
48743 }
48744
48745 var temp = [];
48746 while (temp.length < len) {
48747 this.V = this._hmac().update(this.V).digest();
48748 temp = temp.concat(this.V);
48749 }
48750
48751 var res = temp.slice(0, len);
48752 this._update(add);
48753 this._reseed++;
48754 return utils.encode(res, enc);
48755};
48756
48757},{"hash.js":114,"minimalistic-assert":123,"minimalistic-crypto-utils":124}],121:[function(require,module,exports){
48758arguments[4][9][0].apply(exports,arguments)
48759},{"dup":9}],122:[function(require,module,exports){
48760(function (Buffer){
48761// constant-space merkle root calculation algorithm
48762module.exports = function fastRoot (values, digestFn) {
48763 if (!Array.isArray(values)) throw TypeError('Expected values Array')
48764 if (typeof digestFn !== 'function') throw TypeError('Expected digest Function')
48765
48766 var length = values.length
48767 var results = values.concat()
48768
48769 while (length > 1) {
48770 var j = 0
48771
48772 for (var i = 0; i < length; i += 2, ++j) {
48773 var left = results[i]
48774 var right = i + 1 === length ? left : results[i + 1]
48775 var data = Buffer.concat([left, right])
48776
48777 results[j] = digestFn(data)
48778 }
48779
48780 length = j
48781 }
48782
48783 return results[0]
48784}
48785
48786}).call(this,require("buffer").Buffer)
48787},{"buffer":5}],123:[function(require,module,exports){
48788module.exports = assert;
48789
48790function assert(val, msg) {
48791 if (!val)
48792 throw new Error(msg || 'Assertion failed');
48793}
48794
48795assert.equal = function assertEqual(l, r, msg) {
48796 if (l != r)
48797 throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
48798};
48799
48800},{}],124:[function(require,module,exports){
48801'use strict';
48802
48803var utils = exports;
48804
48805function toArray(msg, enc) {
48806 if (Array.isArray(msg))
48807 return msg.slice();
48808 if (!msg)
48809 return [];
48810 var res = [];
48811 if (typeof msg !== 'string') {
48812 for (var i = 0; i < msg.length; i++)
48813 res[i] = msg[i] | 0;
48814 return res;
48815 }
48816 if (enc === 'hex') {
48817 msg = msg.replace(/[^a-z0-9]+/ig, '');
48818 if (msg.length % 2 !== 0)
48819 msg = '0' + msg;
48820 for (var i = 0; i < msg.length; i += 2)
48821 res.push(parseInt(msg[i] + msg[i + 1], 16));
48822 } else {
48823 for (var i = 0; i < msg.length; i++) {
48824 var c = msg.charCodeAt(i);
48825 var hi = c >> 8;
48826 var lo = c & 0xff;
48827 if (hi)
48828 res.push(hi, lo);
48829 else
48830 res.push(lo);
48831 }
48832 }
48833 return res;
48834}
48835utils.toArray = toArray;
48836
48837function zero2(word) {
48838 if (word.length === 1)
48839 return '0' + word;
48840 else
48841 return word;
48842}
48843utils.zero2 = zero2;
48844
48845function toHex(msg) {
48846 var res = '';
48847 for (var i = 0; i < msg.length; i++)
48848 res += zero2(msg[i].toString(16));
48849 return res;
48850}
48851utils.toHex = toHex;
48852
48853utils.encode = function encode(arr, enc) {
48854 if (enc === 'hex')
48855 return toHex(arr);
48856 else
48857 return arr;
48858};
48859
48860},{}],125:[function(require,module,exports){
48861var OPS = require('bitcoin-ops')
48862
48863function encodingLength (i) {
48864 return i < OPS.OP_PUSHDATA1 ? 1
48865 : i <= 0xff ? 2
48866 : i <= 0xffff ? 3
48867 : 5
48868}
48869
48870function encode (buffer, number, offset) {
48871 var size = encodingLength(number)
48872
48873 // ~6 bit
48874 if (size === 1) {
48875 buffer.writeUInt8(number, offset)
48876
48877 // 8 bit
48878 } else if (size === 2) {
48879 buffer.writeUInt8(OPS.OP_PUSHDATA1, offset)
48880 buffer.writeUInt8(number, offset + 1)
48881
48882 // 16 bit
48883 } else if (size === 3) {
48884 buffer.writeUInt8(OPS.OP_PUSHDATA2, offset)
48885 buffer.writeUInt16LE(number, offset + 1)
48886
48887 // 32 bit
48888 } else {
48889 buffer.writeUInt8(OPS.OP_PUSHDATA4, offset)
48890 buffer.writeUInt32LE(number, offset + 1)
48891 }
48892
48893 return size
48894}
48895
48896function decode (buffer, offset) {
48897 var opcode = buffer.readUInt8(offset)
48898 var number, size
48899
48900 // ~6 bit
48901 if (opcode < OPS.OP_PUSHDATA1) {
48902 number = opcode
48903 size = 1
48904
48905 // 8 bit
48906 } else if (opcode === OPS.OP_PUSHDATA1) {
48907 if (offset + 2 > buffer.length) return null
48908 number = buffer.readUInt8(offset + 1)
48909 size = 2
48910
48911 // 16 bit
48912 } else if (opcode === OPS.OP_PUSHDATA2) {
48913 if (offset + 3 > buffer.length) return null
48914 number = buffer.readUInt16LE(offset + 1)
48915 size = 3
48916
48917 // 32 bit
48918 } else {
48919 if (offset + 5 > buffer.length) return null
48920 if (opcode !== OPS.OP_PUSHDATA4) throw new Error('Unexpected opcode')
48921
48922 number = buffer.readUInt32LE(offset + 1)
48923 size = 5
48924 }
48925
48926 return {
48927 opcode: opcode,
48928 number: number,
48929 size: size
48930 }
48931}
48932
48933module.exports = {
48934 encodingLength: encodingLength,
48935 encode: encode,
48936 decode: decode
48937}
48938
48939},{"bitcoin-ops":42}],126:[function(require,module,exports){
48940(function (process,global){
48941'use strict'
48942
48943function oldBrowser () {
48944 throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11')
48945}
48946
48947var Buffer = require('safe-buffer').Buffer
48948var crypto = global.crypto || global.msCrypto
48949
48950if (crypto && crypto.getRandomValues) {
48951 module.exports = randomBytes
48952} else {
48953 module.exports = oldBrowser
48954}
48955
48956function randomBytes (size, cb) {
48957 // phantomjs needs to throw
48958 if (size > 65536) throw new Error('requested too many random bytes')
48959 // in case browserify isn't using the Uint8Array version
48960 var rawBytes = new global.Uint8Array(size)
48961
48962 // This will not work in older browsers.
48963 // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues
48964 if (size > 0) { // getRandomValues fails on IE if size == 0
48965 crypto.getRandomValues(rawBytes)
48966 }
48967
48968 // XXX: phantomjs doesn't like a buffer being passed here
48969 var bytes = Buffer.from(rawBytes.buffer)
48970
48971 if (typeof cb === 'function') {
48972 return process.nextTick(function () {
48973 cb(null, bytes)
48974 })
48975 }
48976
48977 return bytes
48978}
48979
48980}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
48981},{"_process":13,"safe-buffer":128}],127:[function(require,module,exports){
48982(function (Buffer){
48983'use strict'
48984var inherits = require('inherits')
48985var HashBase = require('hash-base')
48986
48987function RIPEMD160 () {
48988 HashBase.call(this, 64)
48989
48990 // state
48991 this._a = 0x67452301
48992 this._b = 0xefcdab89
48993 this._c = 0x98badcfe
48994 this._d = 0x10325476
48995 this._e = 0xc3d2e1f0
48996}
48997
48998inherits(RIPEMD160, HashBase)
48999
49000RIPEMD160.prototype._update = function () {
49001 var m = new Array(16)
49002 for (var i = 0; i < 16; ++i) m[i] = this._block.readInt32LE(i * 4)
49003
49004 var al = this._a
49005 var bl = this._b
49006 var cl = this._c
49007 var dl = this._d
49008 var el = this._e
49009
49010 // Mj = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
49011 // K = 0x00000000
49012 // Sj = 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8
49013 al = fn1(al, bl, cl, dl, el, m[0], 0x00000000, 11); cl = rotl(cl, 10)
49014 el = fn1(el, al, bl, cl, dl, m[1], 0x00000000, 14); bl = rotl(bl, 10)
49015 dl = fn1(dl, el, al, bl, cl, m[2], 0x00000000, 15); al = rotl(al, 10)
49016 cl = fn1(cl, dl, el, al, bl, m[3], 0x00000000, 12); el = rotl(el, 10)
49017 bl = fn1(bl, cl, dl, el, al, m[4], 0x00000000, 5); dl = rotl(dl, 10)
49018 al = fn1(al, bl, cl, dl, el, m[5], 0x00000000, 8); cl = rotl(cl, 10)
49019 el = fn1(el, al, bl, cl, dl, m[6], 0x00000000, 7); bl = rotl(bl, 10)
49020 dl = fn1(dl, el, al, bl, cl, m[7], 0x00000000, 9); al = rotl(al, 10)
49021 cl = fn1(cl, dl, el, al, bl, m[8], 0x00000000, 11); el = rotl(el, 10)
49022 bl = fn1(bl, cl, dl, el, al, m[9], 0x00000000, 13); dl = rotl(dl, 10)
49023 al = fn1(al, bl, cl, dl, el, m[10], 0x00000000, 14); cl = rotl(cl, 10)
49024 el = fn1(el, al, bl, cl, dl, m[11], 0x00000000, 15); bl = rotl(bl, 10)
49025 dl = fn1(dl, el, al, bl, cl, m[12], 0x00000000, 6); al = rotl(al, 10)
49026 cl = fn1(cl, dl, el, al, bl, m[13], 0x00000000, 7); el = rotl(el, 10)
49027 bl = fn1(bl, cl, dl, el, al, m[14], 0x00000000, 9); dl = rotl(dl, 10)
49028 al = fn1(al, bl, cl, dl, el, m[15], 0x00000000, 8); cl = rotl(cl, 10)
49029
49030 // Mj = 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8
49031 // K = 0x5a827999
49032 // Sj = 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12
49033 el = fn2(el, al, bl, cl, dl, m[7], 0x5a827999, 7); bl = rotl(bl, 10)
49034 dl = fn2(dl, el, al, bl, cl, m[4], 0x5a827999, 6); al = rotl(al, 10)
49035 cl = fn2(cl, dl, el, al, bl, m[13], 0x5a827999, 8); el = rotl(el, 10)
49036 bl = fn2(bl, cl, dl, el, al, m[1], 0x5a827999, 13); dl = rotl(dl, 10)
49037 al = fn2(al, bl, cl, dl, el, m[10], 0x5a827999, 11); cl = rotl(cl, 10)
49038 el = fn2(el, al, bl, cl, dl, m[6], 0x5a827999, 9); bl = rotl(bl, 10)
49039 dl = fn2(dl, el, al, bl, cl, m[15], 0x5a827999, 7); al = rotl(al, 10)
49040 cl = fn2(cl, dl, el, al, bl, m[3], 0x5a827999, 15); el = rotl(el, 10)
49041 bl = fn2(bl, cl, dl, el, al, m[12], 0x5a827999, 7); dl = rotl(dl, 10)
49042 al = fn2(al, bl, cl, dl, el, m[0], 0x5a827999, 12); cl = rotl(cl, 10)
49043 el = fn2(el, al, bl, cl, dl, m[9], 0x5a827999, 15); bl = rotl(bl, 10)
49044 dl = fn2(dl, el, al, bl, cl, m[5], 0x5a827999, 9); al = rotl(al, 10)
49045 cl = fn2(cl, dl, el, al, bl, m[2], 0x5a827999, 11); el = rotl(el, 10)
49046 bl = fn2(bl, cl, dl, el, al, m[14], 0x5a827999, 7); dl = rotl(dl, 10)
49047 al = fn2(al, bl, cl, dl, el, m[11], 0x5a827999, 13); cl = rotl(cl, 10)
49048 el = fn2(el, al, bl, cl, dl, m[8], 0x5a827999, 12); bl = rotl(bl, 10)
49049
49050 // Mj = 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12
49051 // K = 0x6ed9eba1
49052 // Sj = 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5
49053 dl = fn3(dl, el, al, bl, cl, m[3], 0x6ed9eba1, 11); al = rotl(al, 10)
49054 cl = fn3(cl, dl, el, al, bl, m[10], 0x6ed9eba1, 13); el = rotl(el, 10)
49055 bl = fn3(bl, cl, dl, el, al, m[14], 0x6ed9eba1, 6); dl = rotl(dl, 10)
49056 al = fn3(al, bl, cl, dl, el, m[4], 0x6ed9eba1, 7); cl = rotl(cl, 10)
49057 el = fn3(el, al, bl, cl, dl, m[9], 0x6ed9eba1, 14); bl = rotl(bl, 10)
49058 dl = fn3(dl, el, al, bl, cl, m[15], 0x6ed9eba1, 9); al = rotl(al, 10)
49059 cl = fn3(cl, dl, el, al, bl, m[8], 0x6ed9eba1, 13); el = rotl(el, 10)
49060 bl = fn3(bl, cl, dl, el, al, m[1], 0x6ed9eba1, 15); dl = rotl(dl, 10)
49061 al = fn3(al, bl, cl, dl, el, m[2], 0x6ed9eba1, 14); cl = rotl(cl, 10)
49062 el = fn3(el, al, bl, cl, dl, m[7], 0x6ed9eba1, 8); bl = rotl(bl, 10)
49063 dl = fn3(dl, el, al, bl, cl, m[0], 0x6ed9eba1, 13); al = rotl(al, 10)
49064 cl = fn3(cl, dl, el, al, bl, m[6], 0x6ed9eba1, 6); el = rotl(el, 10)
49065 bl = fn3(bl, cl, dl, el, al, m[13], 0x6ed9eba1, 5); dl = rotl(dl, 10)
49066 al = fn3(al, bl, cl, dl, el, m[11], 0x6ed9eba1, 12); cl = rotl(cl, 10)
49067 el = fn3(el, al, bl, cl, dl, m[5], 0x6ed9eba1, 7); bl = rotl(bl, 10)
49068 dl = fn3(dl, el, al, bl, cl, m[12], 0x6ed9eba1, 5); al = rotl(al, 10)
49069
49070 // Mj = 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2
49071 // K = 0x8f1bbcdc
49072 // Sj = 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12
49073 cl = fn4(cl, dl, el, al, bl, m[1], 0x8f1bbcdc, 11); el = rotl(el, 10)
49074 bl = fn4(bl, cl, dl, el, al, m[9], 0x8f1bbcdc, 12); dl = rotl(dl, 10)
49075 al = fn4(al, bl, cl, dl, el, m[11], 0x8f1bbcdc, 14); cl = rotl(cl, 10)
49076 el = fn4(el, al, bl, cl, dl, m[10], 0x8f1bbcdc, 15); bl = rotl(bl, 10)
49077 dl = fn4(dl, el, al, bl, cl, m[0], 0x8f1bbcdc, 14); al = rotl(al, 10)
49078 cl = fn4(cl, dl, el, al, bl, m[8], 0x8f1bbcdc, 15); el = rotl(el, 10)
49079 bl = fn4(bl, cl, dl, el, al, m[12], 0x8f1bbcdc, 9); dl = rotl(dl, 10)
49080 al = fn4(al, bl, cl, dl, el, m[4], 0x8f1bbcdc, 8); cl = rotl(cl, 10)
49081 el = fn4(el, al, bl, cl, dl, m[13], 0x8f1bbcdc, 9); bl = rotl(bl, 10)
49082 dl = fn4(dl, el, al, bl, cl, m[3], 0x8f1bbcdc, 14); al = rotl(al, 10)
49083 cl = fn4(cl, dl, el, al, bl, m[7], 0x8f1bbcdc, 5); el = rotl(el, 10)
49084 bl = fn4(bl, cl, dl, el, al, m[15], 0x8f1bbcdc, 6); dl = rotl(dl, 10)
49085 al = fn4(al, bl, cl, dl, el, m[14], 0x8f1bbcdc, 8); cl = rotl(cl, 10)
49086 el = fn4(el, al, bl, cl, dl, m[5], 0x8f1bbcdc, 6); bl = rotl(bl, 10)
49087 dl = fn4(dl, el, al, bl, cl, m[6], 0x8f1bbcdc, 5); al = rotl(al, 10)
49088 cl = fn4(cl, dl, el, al, bl, m[2], 0x8f1bbcdc, 12); el = rotl(el, 10)
49089
49090 // Mj = 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
49091 // K = 0xa953fd4e
49092 // Sj = 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
49093 bl = fn5(bl, cl, dl, el, al, m[4], 0xa953fd4e, 9); dl = rotl(dl, 10)
49094 al = fn5(al, bl, cl, dl, el, m[0], 0xa953fd4e, 15); cl = rotl(cl, 10)
49095 el = fn5(el, al, bl, cl, dl, m[5], 0xa953fd4e, 5); bl = rotl(bl, 10)
49096 dl = fn5(dl, el, al, bl, cl, m[9], 0xa953fd4e, 11); al = rotl(al, 10)
49097 cl = fn5(cl, dl, el, al, bl, m[7], 0xa953fd4e, 6); el = rotl(el, 10)
49098 bl = fn5(bl, cl, dl, el, al, m[12], 0xa953fd4e, 8); dl = rotl(dl, 10)
49099 al = fn5(al, bl, cl, dl, el, m[2], 0xa953fd4e, 13); cl = rotl(cl, 10)
49100 el = fn5(el, al, bl, cl, dl, m[10], 0xa953fd4e, 12); bl = rotl(bl, 10)
49101 dl = fn5(dl, el, al, bl, cl, m[14], 0xa953fd4e, 5); al = rotl(al, 10)
49102 cl = fn5(cl, dl, el, al, bl, m[1], 0xa953fd4e, 12); el = rotl(el, 10)
49103 bl = fn5(bl, cl, dl, el, al, m[3], 0xa953fd4e, 13); dl = rotl(dl, 10)
49104 al = fn5(al, bl, cl, dl, el, m[8], 0xa953fd4e, 14); cl = rotl(cl, 10)
49105 el = fn5(el, al, bl, cl, dl, m[11], 0xa953fd4e, 11); bl = rotl(bl, 10)
49106 dl = fn5(dl, el, al, bl, cl, m[6], 0xa953fd4e, 8); al = rotl(al, 10)
49107 cl = fn5(cl, dl, el, al, bl, m[15], 0xa953fd4e, 5); el = rotl(el, 10)
49108 bl = fn5(bl, cl, dl, el, al, m[13], 0xa953fd4e, 6); dl = rotl(dl, 10)
49109
49110 var ar = this._a
49111 var br = this._b
49112 var cr = this._c
49113 var dr = this._d
49114 var er = this._e
49115
49116 // M'j = 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12
49117 // K' = 0x50a28be6
49118 // S'j = 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6
49119 ar = fn5(ar, br, cr, dr, er, m[5], 0x50a28be6, 8); cr = rotl(cr, 10)
49120 er = fn5(er, ar, br, cr, dr, m[14], 0x50a28be6, 9); br = rotl(br, 10)
49121 dr = fn5(dr, er, ar, br, cr, m[7], 0x50a28be6, 9); ar = rotl(ar, 10)
49122 cr = fn5(cr, dr, er, ar, br, m[0], 0x50a28be6, 11); er = rotl(er, 10)
49123 br = fn5(br, cr, dr, er, ar, m[9], 0x50a28be6, 13); dr = rotl(dr, 10)
49124 ar = fn5(ar, br, cr, dr, er, m[2], 0x50a28be6, 15); cr = rotl(cr, 10)
49125 er = fn5(er, ar, br, cr, dr, m[11], 0x50a28be6, 15); br = rotl(br, 10)
49126 dr = fn5(dr, er, ar, br, cr, m[4], 0x50a28be6, 5); ar = rotl(ar, 10)
49127 cr = fn5(cr, dr, er, ar, br, m[13], 0x50a28be6, 7); er = rotl(er, 10)
49128 br = fn5(br, cr, dr, er, ar, m[6], 0x50a28be6, 7); dr = rotl(dr, 10)
49129 ar = fn5(ar, br, cr, dr, er, m[15], 0x50a28be6, 8); cr = rotl(cr, 10)
49130 er = fn5(er, ar, br, cr, dr, m[8], 0x50a28be6, 11); br = rotl(br, 10)
49131 dr = fn5(dr, er, ar, br, cr, m[1], 0x50a28be6, 14); ar = rotl(ar, 10)
49132 cr = fn5(cr, dr, er, ar, br, m[10], 0x50a28be6, 14); er = rotl(er, 10)
49133 br = fn5(br, cr, dr, er, ar, m[3], 0x50a28be6, 12); dr = rotl(dr, 10)
49134 ar = fn5(ar, br, cr, dr, er, m[12], 0x50a28be6, 6); cr = rotl(cr, 10)
49135
49136 // M'j = 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2
49137 // K' = 0x5c4dd124
49138 // S'j = 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11
49139 er = fn4(er, ar, br, cr, dr, m[6], 0x5c4dd124, 9); br = rotl(br, 10)
49140 dr = fn4(dr, er, ar, br, cr, m[11], 0x5c4dd124, 13); ar = rotl(ar, 10)
49141 cr = fn4(cr, dr, er, ar, br, m[3], 0x5c4dd124, 15); er = rotl(er, 10)
49142 br = fn4(br, cr, dr, er, ar, m[7], 0x5c4dd124, 7); dr = rotl(dr, 10)
49143 ar = fn4(ar, br, cr, dr, er, m[0], 0x5c4dd124, 12); cr = rotl(cr, 10)
49144 er = fn4(er, ar, br, cr, dr, m[13], 0x5c4dd124, 8); br = rotl(br, 10)
49145 dr = fn4(dr, er, ar, br, cr, m[5], 0x5c4dd124, 9); ar = rotl(ar, 10)
49146 cr = fn4(cr, dr, er, ar, br, m[10], 0x5c4dd124, 11); er = rotl(er, 10)
49147 br = fn4(br, cr, dr, er, ar, m[14], 0x5c4dd124, 7); dr = rotl(dr, 10)
49148 ar = fn4(ar, br, cr, dr, er, m[15], 0x5c4dd124, 7); cr = rotl(cr, 10)
49149 er = fn4(er, ar, br, cr, dr, m[8], 0x5c4dd124, 12); br = rotl(br, 10)
49150 dr = fn4(dr, er, ar, br, cr, m[12], 0x5c4dd124, 7); ar = rotl(ar, 10)
49151 cr = fn4(cr, dr, er, ar, br, m[4], 0x5c4dd124, 6); er = rotl(er, 10)
49152 br = fn4(br, cr, dr, er, ar, m[9], 0x5c4dd124, 15); dr = rotl(dr, 10)
49153 ar = fn4(ar, br, cr, dr, er, m[1], 0x5c4dd124, 13); cr = rotl(cr, 10)
49154 er = fn4(er, ar, br, cr, dr, m[2], 0x5c4dd124, 11); br = rotl(br, 10)
49155
49156 // M'j = 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13
49157 // K' = 0x6d703ef3
49158 // S'j = 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5
49159 dr = fn3(dr, er, ar, br, cr, m[15], 0x6d703ef3, 9); ar = rotl(ar, 10)
49160 cr = fn3(cr, dr, er, ar, br, m[5], 0x6d703ef3, 7); er = rotl(er, 10)
49161 br = fn3(br, cr, dr, er, ar, m[1], 0x6d703ef3, 15); dr = rotl(dr, 10)
49162 ar = fn3(ar, br, cr, dr, er, m[3], 0x6d703ef3, 11); cr = rotl(cr, 10)
49163 er = fn3(er, ar, br, cr, dr, m[7], 0x6d703ef3, 8); br = rotl(br, 10)
49164 dr = fn3(dr, er, ar, br, cr, m[14], 0x6d703ef3, 6); ar = rotl(ar, 10)
49165 cr = fn3(cr, dr, er, ar, br, m[6], 0x6d703ef3, 6); er = rotl(er, 10)
49166 br = fn3(br, cr, dr, er, ar, m[9], 0x6d703ef3, 14); dr = rotl(dr, 10)
49167 ar = fn3(ar, br, cr, dr, er, m[11], 0x6d703ef3, 12); cr = rotl(cr, 10)
49168 er = fn3(er, ar, br, cr, dr, m[8], 0x6d703ef3, 13); br = rotl(br, 10)
49169 dr = fn3(dr, er, ar, br, cr, m[12], 0x6d703ef3, 5); ar = rotl(ar, 10)
49170 cr = fn3(cr, dr, er, ar, br, m[2], 0x6d703ef3, 14); er = rotl(er, 10)
49171 br = fn3(br, cr, dr, er, ar, m[10], 0x6d703ef3, 13); dr = rotl(dr, 10)
49172 ar = fn3(ar, br, cr, dr, er, m[0], 0x6d703ef3, 13); cr = rotl(cr, 10)
49173 er = fn3(er, ar, br, cr, dr, m[4], 0x6d703ef3, 7); br = rotl(br, 10)
49174 dr = fn3(dr, er, ar, br, cr, m[13], 0x6d703ef3, 5); ar = rotl(ar, 10)
49175
49176 // M'j = 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14
49177 // K' = 0x7a6d76e9
49178 // S'j = 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8
49179 cr = fn2(cr, dr, er, ar, br, m[8], 0x7a6d76e9, 15); er = rotl(er, 10)
49180 br = fn2(br, cr, dr, er, ar, m[6], 0x7a6d76e9, 5); dr = rotl(dr, 10)
49181 ar = fn2(ar, br, cr, dr, er, m[4], 0x7a6d76e9, 8); cr = rotl(cr, 10)
49182 er = fn2(er, ar, br, cr, dr, m[1], 0x7a6d76e9, 11); br = rotl(br, 10)
49183 dr = fn2(dr, er, ar, br, cr, m[3], 0x7a6d76e9, 14); ar = rotl(ar, 10)
49184 cr = fn2(cr, dr, er, ar, br, m[11], 0x7a6d76e9, 14); er = rotl(er, 10)
49185 br = fn2(br, cr, dr, er, ar, m[15], 0x7a6d76e9, 6); dr = rotl(dr, 10)
49186 ar = fn2(ar, br, cr, dr, er, m[0], 0x7a6d76e9, 14); cr = rotl(cr, 10)
49187 er = fn2(er, ar, br, cr, dr, m[5], 0x7a6d76e9, 6); br = rotl(br, 10)
49188 dr = fn2(dr, er, ar, br, cr, m[12], 0x7a6d76e9, 9); ar = rotl(ar, 10)
49189 cr = fn2(cr, dr, er, ar, br, m[2], 0x7a6d76e9, 12); er = rotl(er, 10)
49190 br = fn2(br, cr, dr, er, ar, m[13], 0x7a6d76e9, 9); dr = rotl(dr, 10)
49191 ar = fn2(ar, br, cr, dr, er, m[9], 0x7a6d76e9, 12); cr = rotl(cr, 10)
49192 er = fn2(er, ar, br, cr, dr, m[7], 0x7a6d76e9, 5); br = rotl(br, 10)
49193 dr = fn2(dr, er, ar, br, cr, m[10], 0x7a6d76e9, 15); ar = rotl(ar, 10)
49194 cr = fn2(cr, dr, er, ar, br, m[14], 0x7a6d76e9, 8); er = rotl(er, 10)
49195
49196 // M'j = 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
49197 // K' = 0x00000000
49198 // S'j = 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
49199 br = fn1(br, cr, dr, er, ar, m[12], 0x00000000, 8); dr = rotl(dr, 10)
49200 ar = fn1(ar, br, cr, dr, er, m[15], 0x00000000, 5); cr = rotl(cr, 10)
49201 er = fn1(er, ar, br, cr, dr, m[10], 0x00000000, 12); br = rotl(br, 10)
49202 dr = fn1(dr, er, ar, br, cr, m[4], 0x00000000, 9); ar = rotl(ar, 10)
49203 cr = fn1(cr, dr, er, ar, br, m[1], 0x00000000, 12); er = rotl(er, 10)
49204 br = fn1(br, cr, dr, er, ar, m[5], 0x00000000, 5); dr = rotl(dr, 10)
49205 ar = fn1(ar, br, cr, dr, er, m[8], 0x00000000, 14); cr = rotl(cr, 10)
49206 er = fn1(er, ar, br, cr, dr, m[7], 0x00000000, 6); br = rotl(br, 10)
49207 dr = fn1(dr, er, ar, br, cr, m[6], 0x00000000, 8); ar = rotl(ar, 10)
49208 cr = fn1(cr, dr, er, ar, br, m[2], 0x00000000, 13); er = rotl(er, 10)
49209 br = fn1(br, cr, dr, er, ar, m[13], 0x00000000, 6); dr = rotl(dr, 10)
49210 ar = fn1(ar, br, cr, dr, er, m[14], 0x00000000, 5); cr = rotl(cr, 10)
49211 er = fn1(er, ar, br, cr, dr, m[0], 0x00000000, 15); br = rotl(br, 10)
49212 dr = fn1(dr, er, ar, br, cr, m[3], 0x00000000, 13); ar = rotl(ar, 10)
49213 cr = fn1(cr, dr, er, ar, br, m[9], 0x00000000, 11); er = rotl(er, 10)
49214 br = fn1(br, cr, dr, er, ar, m[11], 0x00000000, 11); dr = rotl(dr, 10)
49215
49216 // change state
49217 var t = (this._b + cl + dr) | 0
49218 this._b = (this._c + dl + er) | 0
49219 this._c = (this._d + el + ar) | 0
49220 this._d = (this._e + al + br) | 0
49221 this._e = (this._a + bl + cr) | 0
49222 this._a = t
49223}
49224
49225RIPEMD160.prototype._digest = function () {
49226 // create padding and handle blocks
49227 this._block[this._blockOffset++] = 0x80
49228 if (this._blockOffset > 56) {
49229 this._block.fill(0, this._blockOffset, 64)
49230 this._update()
49231 this._blockOffset = 0
49232 }
49233
49234 this._block.fill(0, this._blockOffset, 56)
49235 this._block.writeUInt32LE(this._length[0], 56)
49236 this._block.writeUInt32LE(this._length[1], 60)
49237 this._update()
49238
49239 // produce result
49240 var buffer = new Buffer(20)
49241 buffer.writeInt32LE(this._a, 0)
49242 buffer.writeInt32LE(this._b, 4)
49243 buffer.writeInt32LE(this._c, 8)
49244 buffer.writeInt32LE(this._d, 12)
49245 buffer.writeInt32LE(this._e, 16)
49246 return buffer
49247}
49248
49249function rotl (x, n) {
49250 return (x << n) | (x >>> (32 - n))
49251}
49252
49253function fn1 (a, b, c, d, e, m, k, s) {
49254 return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0
49255}
49256
49257function fn2 (a, b, c, d, e, m, k, s) {
49258 return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0
49259}
49260
49261function fn3 (a, b, c, d, e, m, k, s) {
49262 return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0
49263}
49264
49265function fn4 (a, b, c, d, e, m, k, s) {
49266 return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0
49267}
49268
49269function fn5 (a, b, c, d, e, m, k, s) {
49270 return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0
49271}
49272
49273module.exports = RIPEMD160
49274
49275}).call(this,require("buffer").Buffer)
49276},{"buffer":5,"hash-base":113,"inherits":121}],128:[function(require,module,exports){
49277/* eslint-disable node/no-deprecated-api */
49278var buffer = require('buffer')
49279var Buffer = buffer.Buffer
49280
49281// alternative to using Object.keys for old browsers
49282function copyProps (src, dst) {
49283 for (var key in src) {
49284 dst[key] = src[key]
49285 }
49286}
49287if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
49288 module.exports = buffer
49289} else {
49290 // Copy properties from require('buffer')
49291 copyProps(buffer, exports)
49292 exports.Buffer = SafeBuffer
49293}
49294
49295function SafeBuffer (arg, encodingOrOffset, length) {
49296 return Buffer(arg, encodingOrOffset, length)
49297}
49298
49299// Copy static methods from Buffer
49300copyProps(Buffer, SafeBuffer)
49301
49302SafeBuffer.from = function (arg, encodingOrOffset, length) {
49303 if (typeof arg === 'number') {
49304 throw new TypeError('Argument must not be a number')
49305 }
49306 return Buffer(arg, encodingOrOffset, length)
49307}
49308
49309SafeBuffer.alloc = function (size, fill, encoding) {
49310 if (typeof size !== 'number') {
49311 throw new TypeError('Argument must be a number')
49312 }
49313 var buf = Buffer(size)
49314 if (fill !== undefined) {
49315 if (typeof encoding === 'string') {
49316 buf.fill(fill, encoding)
49317 } else {
49318 buf.fill(fill)
49319 }
49320 } else {
49321 buf.fill(0)
49322 }
49323 return buf
49324}
49325
49326SafeBuffer.allocUnsafe = function (size) {
49327 if (typeof size !== 'number') {
49328 throw new TypeError('Argument must be a number')
49329 }
49330 return Buffer(size)
49331}
49332
49333SafeBuffer.allocUnsafeSlow = function (size) {
49334 if (typeof size !== 'number') {
49335 throw new TypeError('Argument must be a number')
49336 }
49337 return buffer.SlowBuffer(size)
49338}
49339
49340},{"buffer":5}],129:[function(require,module,exports){
49341var Buffer = require('safe-buffer').Buffer
49342
49343// prototype class for hash functions
49344function Hash (blockSize, finalSize) {
49345 this._block = Buffer.alloc(blockSize)
49346 this._finalSize = finalSize
49347 this._blockSize = blockSize
49348 this._len = 0
49349}
49350
49351Hash.prototype.update = function (data, enc) {
49352 if (typeof data === 'string') {
49353 enc = enc || 'utf8'
49354 data = Buffer.from(data, enc)
49355 }
49356
49357 var block = this._block
49358 var blockSize = this._blockSize
49359 var length = data.length
49360 var accum = this._len
49361
49362 for (var offset = 0; offset < length;) {
49363 var assigned = accum % blockSize
49364 var remainder = Math.min(length - offset, blockSize - assigned)
49365
49366 for (var i = 0; i < remainder; i++) {
49367 block[assigned + i] = data[offset + i]
49368 }
49369
49370 accum += remainder
49371 offset += remainder
49372
49373 if ((accum % blockSize) === 0) {
49374 this._update(block)
49375 }
49376 }
49377
49378 this._len += length
49379 return this
49380}
49381
49382Hash.prototype.digest = function (enc) {
49383 var rem = this._len % this._blockSize
49384
49385 this._block[rem] = 0x80
49386
49387 // zero (rem + 1) trailing bits, where (rem + 1) is the smallest
49388 // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize
49389 this._block.fill(0, rem + 1)
49390
49391 if (rem >= this._finalSize) {
49392 this._update(this._block)
49393 this._block.fill(0)
49394 }
49395
49396 var bits = this._len * 8
49397
49398 // uint32
49399 if (bits <= 0xffffffff) {
49400 this._block.writeUInt32BE(bits, this._blockSize - 4)
49401
49402 // uint64
49403 } else {
49404 var lowBits = bits & 0xffffffff
49405 var highBits = (bits - lowBits) / 0x100000000
49406
49407 this._block.writeUInt32BE(highBits, this._blockSize - 8)
49408 this._block.writeUInt32BE(lowBits, this._blockSize - 4)
49409 }
49410
49411 this._update(this._block)
49412 var hash = this._hash()
49413
49414 return enc ? hash.toString(enc) : hash
49415}
49416
49417Hash.prototype._update = function () {
49418 throw new Error('_update must be implemented by subclass')
49419}
49420
49421module.exports = Hash
49422
49423},{"safe-buffer":128}],130:[function(require,module,exports){
49424var exports = module.exports = function SHA (algorithm) {
49425 algorithm = algorithm.toLowerCase()
49426
49427 var Algorithm = exports[algorithm]
49428 if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
49429
49430 return new Algorithm()
49431}
49432
49433exports.sha = require('./sha')
49434exports.sha1 = require('./sha1')
49435exports.sha224 = require('./sha224')
49436exports.sha256 = require('./sha256')
49437exports.sha384 = require('./sha384')
49438exports.sha512 = require('./sha512')
49439
49440},{"./sha":131,"./sha1":132,"./sha224":133,"./sha256":134,"./sha384":135,"./sha512":136}],131:[function(require,module,exports){
49441/*
49442 * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
49443 * in FIPS PUB 180-1
49444 * This source code is derived from sha1.js of the same repository.
49445 * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
49446 * operation was added.
49447 */
49448
49449var inherits = require('inherits')
49450var Hash = require('./hash')
49451var Buffer = require('safe-buffer').Buffer
49452
49453var K = [
49454 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
49455]
49456
49457var W = new Array(80)
49458
49459function Sha () {
49460 this.init()
49461 this._w = W
49462
49463 Hash.call(this, 64, 56)
49464}
49465
49466inherits(Sha, Hash)
49467
49468Sha.prototype.init = function () {
49469 this._a = 0x67452301
49470 this._b = 0xefcdab89
49471 this._c = 0x98badcfe
49472 this._d = 0x10325476
49473 this._e = 0xc3d2e1f0
49474
49475 return this
49476}
49477
49478function rotl5 (num) {
49479 return (num << 5) | (num >>> 27)
49480}
49481
49482function rotl30 (num) {
49483 return (num << 30) | (num >>> 2)
49484}
49485
49486function ft (s, b, c, d) {
49487 if (s === 0) return (b & c) | ((~b) & d)
49488 if (s === 2) return (b & c) | (b & d) | (c & d)
49489 return b ^ c ^ d
49490}
49491
49492Sha.prototype._update = function (M) {
49493 var W = this._w
49494
49495 var a = this._a | 0
49496 var b = this._b | 0
49497 var c = this._c | 0
49498 var d = this._d | 0
49499 var e = this._e | 0
49500
49501 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
49502 for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]
49503
49504 for (var j = 0; j < 80; ++j) {
49505 var s = ~~(j / 20)
49506 var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
49507
49508 e = d
49509 d = c
49510 c = rotl30(b)
49511 b = a
49512 a = t
49513 }
49514
49515 this._a = (a + this._a) | 0
49516 this._b = (b + this._b) | 0
49517 this._c = (c + this._c) | 0
49518 this._d = (d + this._d) | 0
49519 this._e = (e + this._e) | 0
49520}
49521
49522Sha.prototype._hash = function () {
49523 var H = Buffer.allocUnsafe(20)
49524
49525 H.writeInt32BE(this._a | 0, 0)
49526 H.writeInt32BE(this._b | 0, 4)
49527 H.writeInt32BE(this._c | 0, 8)
49528 H.writeInt32BE(this._d | 0, 12)
49529 H.writeInt32BE(this._e | 0, 16)
49530
49531 return H
49532}
49533
49534module.exports = Sha
49535
49536},{"./hash":129,"inherits":121,"safe-buffer":128}],132:[function(require,module,exports){
49537/*
49538 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
49539 * in FIPS PUB 180-1
49540 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
49541 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
49542 * Distributed under the BSD License
49543 * See http://pajhome.org.uk/crypt/md5 for details.
49544 */
49545
49546var inherits = require('inherits')
49547var Hash = require('./hash')
49548var Buffer = require('safe-buffer').Buffer
49549
49550var K = [
49551 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
49552]
49553
49554var W = new Array(80)
49555
49556function Sha1 () {
49557 this.init()
49558 this._w = W
49559
49560 Hash.call(this, 64, 56)
49561}
49562
49563inherits(Sha1, Hash)
49564
49565Sha1.prototype.init = function () {
49566 this._a = 0x67452301
49567 this._b = 0xefcdab89
49568 this._c = 0x98badcfe
49569 this._d = 0x10325476
49570 this._e = 0xc3d2e1f0
49571
49572 return this
49573}
49574
49575function rotl1 (num) {
49576 return (num << 1) | (num >>> 31)
49577}
49578
49579function rotl5 (num) {
49580 return (num << 5) | (num >>> 27)
49581}
49582
49583function rotl30 (num) {
49584 return (num << 30) | (num >>> 2)
49585}
49586
49587function ft (s, b, c, d) {
49588 if (s === 0) return (b & c) | ((~b) & d)
49589 if (s === 2) return (b & c) | (b & d) | (c & d)
49590 return b ^ c ^ d
49591}
49592
49593Sha1.prototype._update = function (M) {
49594 var W = this._w
49595
49596 var a = this._a | 0
49597 var b = this._b | 0
49598 var c = this._c | 0
49599 var d = this._d | 0
49600 var e = this._e | 0
49601
49602 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
49603 for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
49604
49605 for (var j = 0; j < 80; ++j) {
49606 var s = ~~(j / 20)
49607 var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
49608
49609 e = d
49610 d = c
49611 c = rotl30(b)
49612 b = a
49613 a = t
49614 }
49615
49616 this._a = (a + this._a) | 0
49617 this._b = (b + this._b) | 0
49618 this._c = (c + this._c) | 0
49619 this._d = (d + this._d) | 0
49620 this._e = (e + this._e) | 0
49621}
49622
49623Sha1.prototype._hash = function () {
49624 var H = Buffer.allocUnsafe(20)
49625
49626 H.writeInt32BE(this._a | 0, 0)
49627 H.writeInt32BE(this._b | 0, 4)
49628 H.writeInt32BE(this._c | 0, 8)
49629 H.writeInt32BE(this._d | 0, 12)
49630 H.writeInt32BE(this._e | 0, 16)
49631
49632 return H
49633}
49634
49635module.exports = Sha1
49636
49637},{"./hash":129,"inherits":121,"safe-buffer":128}],133:[function(require,module,exports){
49638/**
49639 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
49640 * in FIPS 180-2
49641 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
49642 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
49643 *
49644 */
49645
49646var inherits = require('inherits')
49647var Sha256 = require('./sha256')
49648var Hash = require('./hash')
49649var Buffer = require('safe-buffer').Buffer
49650
49651var W = new Array(64)
49652
49653function Sha224 () {
49654 this.init()
49655
49656 this._w = W // new Array(64)
49657
49658 Hash.call(this, 64, 56)
49659}
49660
49661inherits(Sha224, Sha256)
49662
49663Sha224.prototype.init = function () {
49664 this._a = 0xc1059ed8
49665 this._b = 0x367cd507
49666 this._c = 0x3070dd17
49667 this._d = 0xf70e5939
49668 this._e = 0xffc00b31
49669 this._f = 0x68581511
49670 this._g = 0x64f98fa7
49671 this._h = 0xbefa4fa4
49672
49673 return this
49674}
49675
49676Sha224.prototype._hash = function () {
49677 var H = Buffer.allocUnsafe(28)
49678
49679 H.writeInt32BE(this._a, 0)
49680 H.writeInt32BE(this._b, 4)
49681 H.writeInt32BE(this._c, 8)
49682 H.writeInt32BE(this._d, 12)
49683 H.writeInt32BE(this._e, 16)
49684 H.writeInt32BE(this._f, 20)
49685 H.writeInt32BE(this._g, 24)
49686
49687 return H
49688}
49689
49690module.exports = Sha224
49691
49692},{"./hash":129,"./sha256":134,"inherits":121,"safe-buffer":128}],134:[function(require,module,exports){
49693/**
49694 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
49695 * in FIPS 180-2
49696 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
49697 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
49698 *
49699 */
49700
49701var inherits = require('inherits')
49702var Hash = require('./hash')
49703var Buffer = require('safe-buffer').Buffer
49704
49705var K = [
49706 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
49707 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
49708 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
49709 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
49710 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
49711 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
49712 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
49713 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
49714 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
49715 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
49716 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
49717 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
49718 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
49719 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
49720 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
49721 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
49722]
49723
49724var W = new Array(64)
49725
49726function Sha256 () {
49727 this.init()
49728
49729 this._w = W // new Array(64)
49730
49731 Hash.call(this, 64, 56)
49732}
49733
49734inherits(Sha256, Hash)
49735
49736Sha256.prototype.init = function () {
49737 this._a = 0x6a09e667
49738 this._b = 0xbb67ae85
49739 this._c = 0x3c6ef372
49740 this._d = 0xa54ff53a
49741 this._e = 0x510e527f
49742 this._f = 0x9b05688c
49743 this._g = 0x1f83d9ab
49744 this._h = 0x5be0cd19
49745
49746 return this
49747}
49748
49749function ch (x, y, z) {
49750 return z ^ (x & (y ^ z))
49751}
49752
49753function maj (x, y, z) {
49754 return (x & y) | (z & (x | y))
49755}
49756
49757function sigma0 (x) {
49758 return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
49759}
49760
49761function sigma1 (x) {
49762 return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
49763}
49764
49765function gamma0 (x) {
49766 return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
49767}
49768
49769function gamma1 (x) {
49770 return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
49771}
49772
49773Sha256.prototype._update = function (M) {
49774 var W = this._w
49775
49776 var a = this._a | 0
49777 var b = this._b | 0
49778 var c = this._c | 0
49779 var d = this._d | 0
49780 var e = this._e | 0
49781 var f = this._f | 0
49782 var g = this._g | 0
49783 var h = this._h | 0
49784
49785 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
49786 for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
49787
49788 for (var j = 0; j < 64; ++j) {
49789 var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
49790 var T2 = (sigma0(a) + maj(a, b, c)) | 0
49791
49792 h = g
49793 g = f
49794 f = e
49795 e = (d + T1) | 0
49796 d = c
49797 c = b
49798 b = a
49799 a = (T1 + T2) | 0
49800 }
49801
49802 this._a = (a + this._a) | 0
49803 this._b = (b + this._b) | 0
49804 this._c = (c + this._c) | 0
49805 this._d = (d + this._d) | 0
49806 this._e = (e + this._e) | 0
49807 this._f = (f + this._f) | 0
49808 this._g = (g + this._g) | 0
49809 this._h = (h + this._h) | 0
49810}
49811
49812Sha256.prototype._hash = function () {
49813 var H = Buffer.allocUnsafe(32)
49814
49815 H.writeInt32BE(this._a, 0)
49816 H.writeInt32BE(this._b, 4)
49817 H.writeInt32BE(this._c, 8)
49818 H.writeInt32BE(this._d, 12)
49819 H.writeInt32BE(this._e, 16)
49820 H.writeInt32BE(this._f, 20)
49821 H.writeInt32BE(this._g, 24)
49822 H.writeInt32BE(this._h, 28)
49823
49824 return H
49825}
49826
49827module.exports = Sha256
49828
49829},{"./hash":129,"inherits":121,"safe-buffer":128}],135:[function(require,module,exports){
49830var inherits = require('inherits')
49831var SHA512 = require('./sha512')
49832var Hash = require('./hash')
49833var Buffer = require('safe-buffer').Buffer
49834
49835var W = new Array(160)
49836
49837function Sha384 () {
49838 this.init()
49839 this._w = W
49840
49841 Hash.call(this, 128, 112)
49842}
49843
49844inherits(Sha384, SHA512)
49845
49846Sha384.prototype.init = function () {
49847 this._ah = 0xcbbb9d5d
49848 this._bh = 0x629a292a
49849 this._ch = 0x9159015a
49850 this._dh = 0x152fecd8
49851 this._eh = 0x67332667
49852 this._fh = 0x8eb44a87
49853 this._gh = 0xdb0c2e0d
49854 this._hh = 0x47b5481d
49855
49856 this._al = 0xc1059ed8
49857 this._bl = 0x367cd507
49858 this._cl = 0x3070dd17
49859 this._dl = 0xf70e5939
49860 this._el = 0xffc00b31
49861 this._fl = 0x68581511
49862 this._gl = 0x64f98fa7
49863 this._hl = 0xbefa4fa4
49864
49865 return this
49866}
49867
49868Sha384.prototype._hash = function () {
49869 var H = Buffer.allocUnsafe(48)
49870
49871 function writeInt64BE (h, l, offset) {
49872 H.writeInt32BE(h, offset)
49873 H.writeInt32BE(l, offset + 4)
49874 }
49875
49876 writeInt64BE(this._ah, this._al, 0)
49877 writeInt64BE(this._bh, this._bl, 8)
49878 writeInt64BE(this._ch, this._cl, 16)
49879 writeInt64BE(this._dh, this._dl, 24)
49880 writeInt64BE(this._eh, this._el, 32)
49881 writeInt64BE(this._fh, this._fl, 40)
49882
49883 return H
49884}
49885
49886module.exports = Sha384
49887
49888},{"./hash":129,"./sha512":136,"inherits":121,"safe-buffer":128}],136:[function(require,module,exports){
49889var inherits = require('inherits')
49890var Hash = require('./hash')
49891var Buffer = require('safe-buffer').Buffer
49892
49893var K = [
49894 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
49895 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
49896 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
49897 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
49898 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
49899 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
49900 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
49901 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
49902 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
49903 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
49904 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
49905 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
49906 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
49907 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
49908 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
49909 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
49910 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
49911 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
49912 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
49913 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
49914 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
49915 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
49916 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
49917 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
49918 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
49919 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
49920 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
49921 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
49922 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
49923 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
49924 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
49925 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
49926 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
49927 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
49928 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
49929 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
49930 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
49931 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
49932 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
49933 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
49934]
49935
49936var W = new Array(160)
49937
49938function Sha512 () {
49939 this.init()
49940 this._w = W
49941
49942 Hash.call(this, 128, 112)
49943}
49944
49945inherits(Sha512, Hash)
49946
49947Sha512.prototype.init = function () {
49948 this._ah = 0x6a09e667
49949 this._bh = 0xbb67ae85
49950 this._ch = 0x3c6ef372
49951 this._dh = 0xa54ff53a
49952 this._eh = 0x510e527f
49953 this._fh = 0x9b05688c
49954 this._gh = 0x1f83d9ab
49955 this._hh = 0x5be0cd19
49956
49957 this._al = 0xf3bcc908
49958 this._bl = 0x84caa73b
49959 this._cl = 0xfe94f82b
49960 this._dl = 0x5f1d36f1
49961 this._el = 0xade682d1
49962 this._fl = 0x2b3e6c1f
49963 this._gl = 0xfb41bd6b
49964 this._hl = 0x137e2179
49965
49966 return this
49967}
49968
49969function Ch (x, y, z) {
49970 return z ^ (x & (y ^ z))
49971}
49972
49973function maj (x, y, z) {
49974 return (x & y) | (z & (x | y))
49975}
49976
49977function sigma0 (x, xl) {
49978 return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
49979}
49980
49981function sigma1 (x, xl) {
49982 return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
49983}
49984
49985function Gamma0 (x, xl) {
49986 return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
49987}
49988
49989function Gamma0l (x, xl) {
49990 return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
49991}
49992
49993function Gamma1 (x, xl) {
49994 return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
49995}
49996
49997function Gamma1l (x, xl) {
49998 return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
49999}
50000
50001function getCarry (a, b) {
50002 return (a >>> 0) < (b >>> 0) ? 1 : 0
50003}
50004
50005Sha512.prototype._update = function (M) {
50006 var W = this._w
50007
50008 var ah = this._ah | 0
50009 var bh = this._bh | 0
50010 var ch = this._ch | 0
50011 var dh = this._dh | 0
50012 var eh = this._eh | 0
50013 var fh = this._fh | 0
50014 var gh = this._gh | 0
50015 var hh = this._hh | 0
50016
50017 var al = this._al | 0
50018 var bl = this._bl | 0
50019 var cl = this._cl | 0
50020 var dl = this._dl | 0
50021 var el = this._el | 0
50022 var fl = this._fl | 0
50023 var gl = this._gl | 0
50024 var hl = this._hl | 0
50025
50026 for (var i = 0; i < 32; i += 2) {
50027 W[i] = M.readInt32BE(i * 4)
50028 W[i + 1] = M.readInt32BE(i * 4 + 4)
50029 }
50030 for (; i < 160; i += 2) {
50031 var xh = W[i - 15 * 2]
50032 var xl = W[i - 15 * 2 + 1]
50033 var gamma0 = Gamma0(xh, xl)
50034 var gamma0l = Gamma0l(xl, xh)
50035
50036 xh = W[i - 2 * 2]
50037 xl = W[i - 2 * 2 + 1]
50038 var gamma1 = Gamma1(xh, xl)
50039 var gamma1l = Gamma1l(xl, xh)
50040
50041 // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
50042 var Wi7h = W[i - 7 * 2]
50043 var Wi7l = W[i - 7 * 2 + 1]
50044
50045 var Wi16h = W[i - 16 * 2]
50046 var Wi16l = W[i - 16 * 2 + 1]
50047
50048 var Wil = (gamma0l + Wi7l) | 0
50049 var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
50050 Wil = (Wil + gamma1l) | 0
50051 Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
50052 Wil = (Wil + Wi16l) | 0
50053 Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
50054
50055 W[i] = Wih
50056 W[i + 1] = Wil
50057 }
50058
50059 for (var j = 0; j < 160; j += 2) {
50060 Wih = W[j]
50061 Wil = W[j + 1]
50062
50063 var majh = maj(ah, bh, ch)
50064 var majl = maj(al, bl, cl)
50065
50066 var sigma0h = sigma0(ah, al)
50067 var sigma0l = sigma0(al, ah)
50068 var sigma1h = sigma1(eh, el)
50069 var sigma1l = sigma1(el, eh)
50070
50071 // t1 = h + sigma1 + ch + K[j] + W[j]
50072 var Kih = K[j]
50073 var Kil = K[j + 1]
50074
50075 var chh = Ch(eh, fh, gh)
50076 var chl = Ch(el, fl, gl)
50077
50078 var t1l = (hl + sigma1l) | 0
50079 var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
50080 t1l = (t1l + chl) | 0
50081 t1h = (t1h + chh + getCarry(t1l, chl)) | 0
50082 t1l = (t1l + Kil) | 0
50083 t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
50084 t1l = (t1l + Wil) | 0
50085 t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
50086
50087 // t2 = sigma0 + maj
50088 var t2l = (sigma0l + majl) | 0
50089 var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
50090
50091 hh = gh
50092 hl = gl
50093 gh = fh
50094 gl = fl
50095 fh = eh
50096 fl = el
50097 el = (dl + t1l) | 0
50098 eh = (dh + t1h + getCarry(el, dl)) | 0
50099 dh = ch
50100 dl = cl
50101 ch = bh
50102 cl = bl
50103 bh = ah
50104 bl = al
50105 al = (t1l + t2l) | 0
50106 ah = (t1h + t2h + getCarry(al, t1l)) | 0
50107 }
50108
50109 this._al = (this._al + al) | 0
50110 this._bl = (this._bl + bl) | 0
50111 this._cl = (this._cl + cl) | 0
50112 this._dl = (this._dl + dl) | 0
50113 this._el = (this._el + el) | 0
50114 this._fl = (this._fl + fl) | 0
50115 this._gl = (this._gl + gl) | 0
50116 this._hl = (this._hl + hl) | 0
50117
50118 this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
50119 this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
50120 this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
50121 this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
50122 this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
50123 this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
50124 this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
50125 this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
50126}
50127
50128Sha512.prototype._hash = function () {
50129 var H = Buffer.allocUnsafe(64)
50130
50131 function writeInt64BE (h, l, offset) {
50132 H.writeInt32BE(h, offset)
50133 H.writeInt32BE(l, offset + 4)
50134 }
50135
50136 writeInt64BE(this._ah, this._al, 0)
50137 writeInt64BE(this._bh, this._bl, 8)
50138 writeInt64BE(this._ch, this._cl, 16)
50139 writeInt64BE(this._dh, this._dl, 24)
50140 writeInt64BE(this._eh, this._el, 32)
50141 writeInt64BE(this._fh, this._fl, 40)
50142 writeInt64BE(this._gh, this._gl, 48)
50143 writeInt64BE(this._hh, this._hl, 56)
50144
50145 return H
50146}
50147
50148module.exports = Sha512
50149
50150},{"./hash":129,"inherits":121,"safe-buffer":128}],137:[function(require,module,exports){
50151var native = require('./native')
50152
50153function getTypeName (fn) {
50154 return fn.name || fn.toString().match(/function (.*?)\s*\(/)[1]
50155}
50156
50157function getValueTypeName (value) {
50158 return native.Nil(value) ? '' : getTypeName(value.constructor)
50159}
50160
50161function getValue (value) {
50162 if (native.Function(value)) return ''
50163 if (native.String(value)) return JSON.stringify(value)
50164 if (value && native.Object(value)) return ''
50165 return value
50166}
50167
50168function tfJSON (type) {
50169 if (native.Function(type)) return type.toJSON ? type.toJSON() : getTypeName(type)
50170 if (native.Array(type)) return 'Array'
50171 if (type && native.Object(type)) return 'Object'
50172
50173 return type !== undefined ? type : ''
50174}
50175
50176function tfErrorString (type, value, valueTypeName) {
50177 var valueJson = getValue(value)
50178
50179 return 'Expected ' + tfJSON(type) + ', got' +
50180 (valueTypeName !== '' ? ' ' + valueTypeName : '') +
50181 (valueJson !== '' ? ' ' + valueJson : '')
50182}
50183
50184function TfTypeError (type, value, valueTypeName) {
50185 valueTypeName = valueTypeName || getValueTypeName(value)
50186 this.message = tfErrorString(type, value, valueTypeName)
50187
50188 Error.captureStackTrace(this, TfTypeError)
50189 this.__type = type
50190 this.__value = value
50191 this.__valueTypeName = valueTypeName
50192}
50193
50194TfTypeError.prototype = Object.create(Error.prototype)
50195TfTypeError.prototype.constructor = TfTypeError
50196
50197function tfPropertyErrorString (type, label, name, value, valueTypeName) {
50198 var description = '" of type '
50199 if (label === 'key') description = '" with key type '
50200
50201 return tfErrorString('property "' + tfJSON(name) + description + tfJSON(type), value, valueTypeName)
50202}
50203
50204function TfPropertyTypeError (type, property, label, value, valueTypeName) {
50205 if (type) {
50206 valueTypeName = valueTypeName || getValueTypeName(value)
50207 this.message = tfPropertyErrorString(type, label, property, value, valueTypeName)
50208 } else {
50209 this.message = 'Unexpected property "' + property + '"'
50210 }
50211
50212 Error.captureStackTrace(this, TfTypeError)
50213 this.__label = label
50214 this.__property = property
50215 this.__type = type
50216 this.__value = value
50217 this.__valueTypeName = valueTypeName
50218}
50219
50220TfPropertyTypeError.prototype = Object.create(Error.prototype)
50221TfPropertyTypeError.prototype.constructor = TfTypeError
50222
50223function tfCustomError (expected, actual) {
50224 return new TfTypeError(expected, {}, actual)
50225}
50226
50227function tfSubError (e, property, label) {
50228 // sub child?
50229 if (e instanceof TfPropertyTypeError) {
50230 property = property + '.' + e.__property
50231
50232 e = new TfPropertyTypeError(
50233 e.__type, property, e.__label, e.__value, e.__valueTypeName
50234 )
50235
50236 // child?
50237 } else if (e instanceof TfTypeError) {
50238 e = new TfPropertyTypeError(
50239 e.__type, property, label, e.__value, e.__valueTypeName
50240 )
50241 }
50242
50243 Error.captureStackTrace(e)
50244 return e
50245}
50246
50247module.exports = {
50248 TfTypeError: TfTypeError,
50249 TfPropertyTypeError: TfPropertyTypeError,
50250 tfCustomError: tfCustomError,
50251 tfSubError: tfSubError,
50252 tfJSON: tfJSON,
50253 getValueTypeName: getValueTypeName
50254}
50255
50256},{"./native":140}],138:[function(require,module,exports){
50257(function (Buffer){
50258var NATIVE = require('./native')
50259var ERRORS = require('./errors')
50260
50261function _Buffer (value) {
50262 return Buffer.isBuffer(value)
50263}
50264
50265function Hex (value) {
50266 return typeof value === 'string' && /^([0-9a-f]{2})+$/i.test(value)
50267}
50268
50269function _LengthN (type, length) {
50270 var name = type.toJSON()
50271
50272 function Length (value) {
50273 if (!type(value)) return false
50274 if (value.length === length) return true
50275
50276 throw ERRORS.tfCustomError(name + '(Length: ' + length + ')', name + '(Length: ' + value.length + ')')
50277 }
50278 Length.toJSON = function () { return name }
50279
50280 return Length
50281}
50282
50283var _ArrayN = _LengthN.bind(null, NATIVE.Array)
50284var _BufferN = _LengthN.bind(null, _Buffer)
50285var _HexN = _LengthN.bind(null, Hex)
50286var _StringN = _LengthN.bind(null, NATIVE.String)
50287
50288var UINT53_MAX = Math.pow(2, 53) - 1
50289
50290function Finite (value) {
50291 return typeof value === 'number' && isFinite(value)
50292}
50293function Int8 (value) { return ((value << 24) >> 24) === value }
50294function Int16 (value) { return ((value << 16) >> 16) === value }
50295function Int32 (value) { return (value | 0) === value }
50296function UInt8 (value) { return (value & 0xff) === value }
50297function UInt16 (value) { return (value & 0xffff) === value }
50298function UInt32 (value) { return (value >>> 0) === value }
50299function UInt53 (value) {
50300 return typeof value === 'number' &&
50301 value >= 0 &&
50302 value <= UINT53_MAX &&
50303 Math.floor(value) === value
50304}
50305
50306var types = {
50307 ArrayN: _ArrayN,
50308 Buffer: _Buffer,
50309 BufferN: _BufferN,
50310 Finite: Finite,
50311 Hex: Hex,
50312 HexN: _HexN,
50313 Int8: Int8,
50314 Int16: Int16,
50315 Int32: Int32,
50316 StringN: _StringN,
50317 UInt8: UInt8,
50318 UInt16: UInt16,
50319 UInt32: UInt32,
50320 UInt53: UInt53
50321}
50322
50323for (var typeName in types) {
50324 types[typeName].toJSON = function (t) {
50325 return t
50326 }.bind(null, typeName)
50327}
50328
50329module.exports = types
50330
50331}).call(this,{"isBuffer":require("../../../../../.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")})
50332},{"../../../../../.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":10,"./errors":137,"./native":140}],139:[function(require,module,exports){
50333var ERRORS = require('./errors')
50334var NATIVE = require('./native')
50335
50336// short-hand
50337var tfJSON = ERRORS.tfJSON
50338var TfTypeError = ERRORS.TfTypeError
50339var TfPropertyTypeError = ERRORS.TfPropertyTypeError
50340var tfSubError = ERRORS.tfSubError
50341var getValueTypeName = ERRORS.getValueTypeName
50342
50343var TYPES = {
50344 arrayOf: function arrayOf (type) {
50345 type = compile(type)
50346
50347 function _arrayOf (array, strict) {
50348 if (!NATIVE.Array(array)) return false
50349 if (NATIVE.Nil(array)) return false
50350
50351 return array.every(function (value, i) {
50352 try {
50353 return typeforce(type, value, strict)
50354 } catch (e) {
50355 throw tfSubError(e, i)
50356 }
50357 })
50358 }
50359 _arrayOf.toJSON = function () { return '[' + tfJSON(type) + ']' }
50360
50361 return _arrayOf
50362 },
50363
50364 maybe: function maybe (type) {
50365 type = compile(type)
50366
50367 function _maybe (value, strict) {
50368 return NATIVE.Nil(value) || type(value, strict, maybe)
50369 }
50370 _maybe.toJSON = function () { return '?' + tfJSON(type) }
50371
50372 return _maybe
50373 },
50374
50375 map: function map (propertyType, propertyKeyType) {
50376 propertyType = compile(propertyType)
50377 if (propertyKeyType) propertyKeyType = compile(propertyKeyType)
50378
50379 function _map (value, strict) {
50380 if (!NATIVE.Object(value)) return false
50381 if (NATIVE.Nil(value)) return false
50382
50383 for (var propertyName in value) {
50384 try {
50385 if (propertyKeyType) {
50386 typeforce(propertyKeyType, propertyName, strict)
50387 }
50388 } catch (e) {
50389 throw tfSubError(e, propertyName, 'key')
50390 }
50391
50392 try {
50393 var propertyValue = value[propertyName]
50394 typeforce(propertyType, propertyValue, strict)
50395 } catch (e) {
50396 throw tfSubError(e, propertyName)
50397 }
50398 }
50399
50400 return true
50401 }
50402
50403 if (propertyKeyType) {
50404 _map.toJSON = function () {
50405 return '{' + tfJSON(propertyKeyType) + ': ' + tfJSON(propertyType) + '}'
50406 }
50407 } else {
50408 _map.toJSON = function () { return '{' + tfJSON(propertyType) + '}' }
50409 }
50410
50411 return _map
50412 },
50413
50414 object: function object (uncompiled) {
50415 var type = {}
50416
50417 for (var typePropertyName in uncompiled) {
50418 type[typePropertyName] = compile(uncompiled[typePropertyName])
50419 }
50420
50421 function _object (value, strict) {
50422 if (!NATIVE.Object(value)) return false
50423 if (NATIVE.Nil(value)) return false
50424
50425 var propertyName
50426
50427 try {
50428 for (propertyName in type) {
50429 var propertyType = type[propertyName]
50430 var propertyValue = value[propertyName]
50431
50432 typeforce(propertyType, propertyValue, strict)
50433 }
50434 } catch (e) {
50435 throw tfSubError(e, propertyName)
50436 }
50437
50438 if (strict) {
50439 for (propertyName in value) {
50440 if (type[propertyName]) continue
50441
50442 throw new TfPropertyTypeError(undefined, propertyName)
50443 }
50444 }
50445
50446 return true
50447 }
50448 _object.toJSON = function () { return tfJSON(type) }
50449
50450 return _object
50451 },
50452
50453 oneOf: function oneOf () {
50454 var types = [].slice.call(arguments).map(compile)
50455
50456 function _oneOf (value, strict) {
50457 return types.some(function (type) {
50458 try {
50459 return typeforce(type, value, strict)
50460 } catch (e) {
50461 return false
50462 }
50463 })
50464 }
50465 _oneOf.toJSON = function () { return types.map(tfJSON).join('|') }
50466
50467 return _oneOf
50468 },
50469
50470 quacksLike: function quacksLike (type) {
50471 function _quacksLike (value) {
50472 return type === getValueTypeName(value)
50473 }
50474 _quacksLike.toJSON = function () { return type }
50475
50476 return _quacksLike
50477 },
50478
50479 tuple: function tuple () {
50480 var types = [].slice.call(arguments).map(compile)
50481
50482 function _tuple (values, strict) {
50483 if (NATIVE.Nil(values)) return false
50484 if (NATIVE.Nil(values.length)) return false
50485 if (strict && (values.length !== types.length)) return false
50486
50487 return types.every(function (type, i) {
50488 try {
50489 return typeforce(type, values[i], strict)
50490 } catch (e) {
50491 throw tfSubError(e, i)
50492 }
50493 })
50494 }
50495 _tuple.toJSON = function () { return '(' + types.map(tfJSON).join(', ') + ')' }
50496
50497 return _tuple
50498 },
50499
50500 value: function value (expected) {
50501 function _value (actual) {
50502 return actual === expected
50503 }
50504 _value.toJSON = function () { return expected }
50505
50506 return _value
50507 }
50508}
50509
50510function compile (type) {
50511 if (NATIVE.String(type)) {
50512 if (type[0] === '?') return TYPES.maybe(type.slice(1))
50513
50514 return NATIVE[type] || TYPES.quacksLike(type)
50515 } else if (type && NATIVE.Object(type)) {
50516 if (NATIVE.Array(type)) return TYPES.arrayOf(type[0])
50517
50518 return TYPES.object(type)
50519 } else if (NATIVE.Function(type)) {
50520 return type
50521 }
50522
50523 return TYPES.value(type)
50524}
50525
50526function typeforce (type, value, strict, surrogate) {
50527 if (NATIVE.Function(type)) {
50528 if (type(value, strict)) return true
50529
50530 throw new TfTypeError(surrogate || type, value)
50531 }
50532
50533 // JIT
50534 return typeforce(compile(type), value, strict)
50535}
50536
50537// assign types to typeforce function
50538for (var typeName in NATIVE) {
50539 typeforce[typeName] = NATIVE[typeName]
50540}
50541
50542for (typeName in TYPES) {
50543 typeforce[typeName] = TYPES[typeName]
50544}
50545
50546var EXTRA = require('./extra')
50547for (typeName in EXTRA) {
50548 typeforce[typeName] = EXTRA[typeName]
50549}
50550
50551// async wrapper
50552function __async (type, value, strict, callback) {
50553 // default to falsy strict if using shorthand overload
50554 if (typeof strict === 'function') return __async(type, value, false, strict)
50555
50556 try {
50557 typeforce(type, value, strict)
50558 } catch (e) {
50559 return callback(e)
50560 }
50561
50562 callback()
50563}
50564
50565typeforce.async = __async
50566typeforce.compile = compile
50567typeforce.TfTypeError = TfTypeError
50568typeforce.TfPropertyTypeError = TfPropertyTypeError
50569
50570module.exports = typeforce
50571
50572},{"./errors":137,"./extra":138,"./native":140}],140:[function(require,module,exports){
50573var types = {
50574 Array: function (value) { return value !== null && value !== undefined && value.constructor === Array },
50575 Boolean: function (value) { return typeof value === 'boolean' },
50576 Function: function (value) { return typeof value === 'function' },
50577 Nil: function (value) { return value === undefined || value === null },
50578 Number: function (value) { return typeof value === 'number' },
50579 Object: function (value) { return typeof value === 'object' },
50580 String: function (value) { return typeof value === 'string' },
50581 '': function () { return true }
50582}
50583
50584// TODO: deprecate
50585types.Null = types.Nil
50586
50587for (var typeName in types) {
50588 types[typeName].toJSON = function (t) {
50589 return t
50590 }.bind(null, typeName)
50591}
50592
50593module.exports = types
50594
50595},{}],141:[function(require,module,exports){
50596(function (Buffer){
50597'use strict'
50598
50599// Number.MAX_SAFE_INTEGER
50600var MAX_SAFE_INTEGER = 9007199254740991
50601
50602function checkUInt53 (n) {
50603 if (n < 0 || n > MAX_SAFE_INTEGER || n % 1 !== 0) throw new RangeError('value out of range')
50604}
50605
50606function encode (number, buffer, offset) {
50607 checkUInt53(number)
50608
50609 if (!buffer) buffer = new Buffer(encodingLength(number))
50610 if (!Buffer.isBuffer(buffer)) throw new TypeError('buffer must be a Buffer instance')
50611 if (!offset) offset = 0
50612
50613 // 8 bit
50614 if (number < 0xfd) {
50615 buffer.writeUInt8(number, offset)
50616 encode.bytes = 1
50617
50618 // 16 bit
50619 } else if (number <= 0xffff) {
50620 buffer.writeUInt8(0xfd, offset)
50621 buffer.writeUInt16LE(number, offset + 1)
50622 encode.bytes = 3
50623
50624 // 32 bit
50625 } else if (number <= 0xffffffff) {
50626 buffer.writeUInt8(0xfe, offset)
50627 buffer.writeUInt32LE(number, offset + 1)
50628 encode.bytes = 5
50629
50630 // 64 bit
50631 } else {
50632 buffer.writeUInt8(0xff, offset)
50633 buffer.writeUInt32LE(number >>> 0, offset + 1)
50634 buffer.writeUInt32LE((number / 0x100000000) | 0, offset + 5)
50635 encode.bytes = 9
50636 }
50637
50638 return buffer
50639}
50640
50641function decode (buffer, offset) {
50642 if (!Buffer.isBuffer(buffer)) throw new TypeError('buffer must be a Buffer instance')
50643 if (!offset) offset = 0
50644
50645 var first = buffer.readUInt8(offset)
50646
50647 // 8 bit
50648 if (first < 0xfd) {
50649 decode.bytes = 1
50650 return first
50651
50652 // 16 bit
50653 } else if (first === 0xfd) {
50654 decode.bytes = 3
50655 return buffer.readUInt16LE(offset + 1)
50656
50657 // 32 bit
50658 } else if (first === 0xfe) {
50659 decode.bytes = 5
50660 return buffer.readUInt32LE(offset + 1)
50661
50662 // 64 bit
50663 } else {
50664 decode.bytes = 9
50665 var lo = buffer.readUInt32LE(offset + 1)
50666 var hi = buffer.readUInt32LE(offset + 5)
50667 var number = hi * 0x0100000000 + lo
50668 checkUInt53(number)
50669
50670 return number
50671 }
50672}
50673
50674function encodingLength (number) {
50675 checkUInt53(number)
50676
50677 return (
50678 number < 0xfd ? 1
50679 : number <= 0xffff ? 3
50680 : number <= 0xffffffff ? 5
50681 : 9
50682 )
50683}
50684
50685module.exports = { encode: encode, decode: decode, encodingLength: encodingLength }
50686
50687}).call(this,require("buffer").Buffer)
50688},{"buffer":5}],142:[function(require,module,exports){
50689(function (Buffer){
50690var bs58check = require('bs58check')
50691
50692function decodeRaw (buffer, version) {
50693 // check version only if defined
50694 if (version !== undefined && buffer[0] !== version) throw new Error('Invalid network version')
50695
50696 // uncompressed
50697 if (buffer.length === 33) {
50698 return {
50699 version: buffer[0],
50700 privateKey: buffer.slice(1, 33),
50701 compressed: false
50702 }
50703 }
50704
50705 // invalid length
50706 if (buffer.length !== 34) throw new Error('Invalid WIF length')
50707
50708 // invalid compression flag
50709 if (buffer[33] !== 0x01) throw new Error('Invalid compression flag')
50710
50711 return {
50712 version: buffer[0],
50713 privateKey: buffer.slice(1, 33),
50714 compressed: true
50715 }
50716}
50717
50718function encodeRaw (version, privateKey, compressed) {
50719 var result = new Buffer(compressed ? 34 : 33)
50720
50721 result.writeUInt8(version, 0)
50722 privateKey.copy(result, 1)
50723
50724 if (compressed) {
50725 result[33] = 0x01
50726 }
50727
50728 return result
50729}
50730
50731function decode (string, version) {
50732 return decodeRaw(bs58check.decode(string), version)
50733}
50734
50735function encode (version, privateKey, compressed) {
50736 if (typeof version === 'number') return bs58check.encode(encodeRaw(version, privateKey, compressed))
50737
50738 return bs58check.encode(
50739 encodeRaw(
50740 version.version,
50741 version.privateKey,
50742 version.compressed
50743 )
50744 )
50745}
50746
50747module.exports = {
50748 decode: decode,
50749 decodeRaw: decodeRaw,
50750 encode: encode,
50751 encodeRaw: encodeRaw
50752}
50753
50754}).call(this,require("buffer").Buffer)
50755},{"bs58check":85,"buffer":5}]},{},[34])(34)
50756});</script>
50757 <script>bitcoinjs.bitcoin.networks.shadow = {
50758 messagePrefix: 'unused',
50759 bip32: {
50760 public: 0xEE80286A,
50761 private: 0xEE8031E8
50762 },
50763 pubKeyHash: 0x3f,
50764 scriptHash: 0x7d,
50765 wif: 0xbf
50766};
50767
50768bitcoinjs.bitcoin.networks.shadowtn = {
50769 messagePrefix: 'unused',
50770 bip32: {
50771 public: 0x76C0FDFB,
50772 private: 0x76C1077A
50773 },
50774 pubKeyHash: 0x7f,
50775 scriptHash: 0xc4,
50776 wif: 0xff
50777};
50778
50779bitcoinjs.bitcoin.networks.clam = {
50780 messagePrefix: 'unused',
50781 bip32: {
50782 public: 0xa8c26d64,
50783 private: 0xa8c17826
50784 },
50785 pubKeyHash: 0x89,
50786 scriptHash: 0x00, // TODO set this correctly
50787 wif: 0x85
50788};
50789
50790bitcoinjs.bitcoin.networks.crown = {
50791 messagePrefix: 'unused',
50792 bip32: {
50793 public: 0x0488b21e,
50794 private: 0x0488ade4
50795 },
50796 pubKeyHash: 0x00,
50797 scriptHash: 0x05,
50798 wif: 0x80
50799};
50800
50801bitcoinjs.bitcoin.networks.dash = {
50802 messagePrefix: 'unused',
50803 bip32: {
50804 public: 0x0488b21e,
50805 private: 0x0488ade4
50806 },
50807 pubKeyHash: 0x4c,
50808 scriptHash: 0x10,
50809 wif: 0xcc
50810};
50811
50812bitcoinjs.bitcoin.networks.maza = {
50813 messagePrefix: 'unused',
50814 bip32: {
50815 public: 0x0488b21e,
50816 private: 0x0488ade4
50817 },
50818 pubKeyHash: 0x32,
50819 scriptHash: 0x09,
50820 wif: 0xe0
50821};
50822
50823bitcoinjs.bitcoin.networks.dashtn = {
50824 messagePrefix: 'unused',
50825 bip32: {
50826 public: 0x043587cf,
50827 private: 0x04358394
50828 },
50829 pubKeyHash: 0x8c,
50830 scriptHash: 0x13,
50831 wif: 0xef
50832};
50833
50834bitcoinjs.bitcoin.networks.game = {
50835 messagePrefix: 'unused',
50836 bip32: {
50837 public: 0x0488b21e,
50838 private: 0x0488ade4
50839 },
50840 pubKeyHash: 0x26,
50841 scriptHash: 0x05,
50842 wif: 0xa6
50843};
50844
50845bitcoinjs.bitcoin.networks.namecoin = {
50846 messagePrefix: 'unused',
50847 bip32: {
50848 public: 0x0488b21e,
50849 private: 0x0488ade4
50850 },
50851 pubKeyHash: 0x34,
50852 scriptHash: 0x00, // TODO set this correctly
50853 wif: 0x80
50854};
50855
50856bitcoinjs.bitcoin.networks.peercoin = {
50857 messagePrefix: 'unused',
50858 bip32: {
50859 public: 0x0488b21e,
50860 private: 0x0488ade4
50861 },
50862 pubKeyHash: 0x37,
50863 scriptHash: 0x00, // TODO set this correctly
50864 wif: 0xb7
50865};
50866
50867bitcoinjs.bitcoin.networks.slimcoin = {
50868 messagePrefix: 'unused',
50869 bip32: {
50870 public: 0xef6adf10,
50871 private: 0xef69ea80
50872 },
50873 pubKeyHash: 0x3f,
50874 scriptHash: 0x7d,
50875 wif: 0x46
50876};
50877
50878bitcoinjs.bitcoin.networks.slimcointn = {
50879 messagePrefix: 'unused',
50880 bip32: {
50881 public: 0x043587CF,
50882 private: 0x04358394
50883 },
50884 pubKeyHash: 0x6f,
50885 scriptHash: 0xc4,
50886 wif: 0x57
50887};
50888
50889bitcoinjs.bitcoin.networks.dogecoin = {
50890 messagePrefix: '\x19Dogecoin Signed Message:\n',
50891 bip32: {
50892 public: 0x02facafd,
50893 private: 0x02fac398
50894 },
50895 pubKeyHash: 0x1e,
50896 scriptHash: 0x16,
50897 wif: 0x9e
50898};
50899
50900bitcoinjs.bitcoin.networks.viacoin = {
50901 messagePrefix: '\x18Viacoin Signed Message:\n',
50902 bip32: {
50903 public: 0x0488b21e,
50904 private: 0x0488ade4
50905 },
50906 pubKeyHash: 0x47,
50907 scriptHash: 0x21,
50908 wif: 0xc7
50909};
50910
50911bitcoinjs.bitcoin.networks.viacointestnet = {
50912 messagePrefix: '\x18Viacoin Signed Message:\n',
50913 bip32: {
50914 public: 0x043587cf,
50915 private: 0x04358394
50916 },
50917 pubKeyHash: 0x7f,
50918 scriptHash: 0xc4,
50919 wif: 0xff
50920};
50921
50922bitcoinjs.bitcoin.networks.gamerscoin = {
50923 messagePrefix: '\x19Gamerscoin Signed Message:\n',
50924 bip32: {
50925 public: 0x019da462,
50926 private: 0x019d9cfe
50927 },
50928 pubKeyHash: 0x26,
50929 scriptHash: 0x05,
50930 wif: 0xA6
50931};
50932
50933bitcoinjs.bitcoin.networks.jumbucks = {
50934 messagePrefix: '\x19Jumbucks Signed Message:\n',
50935 bip32: {
50936 public: 0x037a689a,
50937 private: 0x037a6460
50938 },
50939 pubKeyHash: 0x2b,
50940 scriptHash: 0x05,
50941 wif: 0xab
50942};
50943
50944bitcoinjs.bitcoin.networks.zetacoin = {
50945 messagePrefix: '\x18Zetacoin Signed Message:\n',
50946 bip32: {
50947 public: 0x0488b21e,
50948 private: 0x0488ade4
50949 },
50950 pubKeyHash: 0x50,
50951 scriptHash: 0x09,
50952 wif: 0xe0
50953};
50954
50955bitcoinjs.bitcoin.networks.myriadcoin = {
50956 messagePrefix: 'unused',
50957 bip32: {
50958 public: 0x0488b21e,
50959 private: 0x0488ade4
50960 },
50961 pubKeyHash: 0x32,
50962 scriptHash: 0x00, // TODO set this correctly
50963 wif: 0xb2
50964};
50965
50966
50967bitcoinjs.bitcoin.networks.onixcoin = {
50968 messagePrefix: 'unused',
50969 bip32: {
50970 public: 0x049d7cb2,
50971 private: 0x049d7878
50972 },
50973 pubKeyHash: 0x4B,
50974 scriptHash: 0x05,
50975 wif: 0x80
50976};
50977
50978bitcoinjs.bitcoin.networks.pivx = {
50979 messagePrefix: 'unused',
50980 bip32: {
50981 public: 0x022d2533,
50982 private: 0x0221312b
50983 },
50984 pubKeyHash: 0x1e,
50985 scriptHash: 0x0d,
50986 wif: 0xd4
50987};
50988
50989bitcoinjs.bitcoin.networks.pivxtestnet = {
50990 messagePrefix: 'unused',
50991 bip32: {
50992 public: 0x3a8061a0,
50993 private: 0x3a805837
50994 },
50995 pubKeyHash: 0x8b,
50996 scriptHash: 0x13,
50997 wif: 0xef
50998};
50999
51000bitcoinjs.bitcoin.networks.fujicoin = {
51001 messagePrefix: '\x19FujiCoin Signed Message:\n',
51002 bip32: {
51003 public: 0x0488b21e,
51004 private: 0x0488ade4
51005 },
51006 pubKeyHash: 0x24,
51007 scriptHash: 0x10,
51008 wif: 0xa4
51009};
51010
51011bitcoinjs.bitcoin.networks.nubits = {
51012 messagePrefix: '\x18Nu Signed Message:\n',
51013 bip32: {
51014 public: 0x0488b21e,
51015 private: 0x0488ade4
51016 },
51017 pubKeyHash: 0x19,
51018 scriptHash: 0x1a,
51019 wif: 0x96,
51020};
51021
51022bitcoinjs.bitcoin.networks.bgold = {
51023 messagePrefix: 'unused',
51024 bip32: {
51025 public: 0x0488b21e,
51026 private: 0x0488ade4
51027 },
51028 pubKeyHash: 38,
51029 scriptHash: 23,
51030 wif: 128
51031};
51032
51033bitcoinjs.bitcoin.networks.bitcoinCashBitbpay = {
51034 messagePrefix: '\x18Bitcoin Signed Message:\n',
51035 bip32: {
51036 public: 0x0488b21e,
51037 private: 0x0488ade4
51038 },
51039 pubKeyHash: 0x1c,
51040 scriptHash: 0x28,
51041 wif: 0x80
51042};
51043
51044bitcoinjs.bitcoin.networks.monacoin = {
51045 messagePrefix: '\x18Monacoin Signed Message:\n',
51046 bip32: {
51047 public: 0x0488b21e,
51048 private: 0x0488ade4
51049 },
51050 pubKeyHash: 0x32,
51051 scriptHash: 0x37,
51052 wif: 0xb0
51053};
51054
51055bitcoinjs.bitcoin.networks.litecoinXprv = {
51056 messagePrefix: '\x19Litecoin Signed Message:\n',
51057 bip32: {
51058 public: 0x0488b21e,
51059 private: 0x0488ade4,
51060 },
51061 pubKeyHash: 0x30,
51062 scriptHash: 0x32,
51063 wif: 0xb0
51064};
51065
51066bitcoinjs.bitcoin.networks.komodo = {
51067 messagePrefix: '\x18Komodo Signed Message:\n',
51068 bip32: {
51069 public: 0x0488B21E,
51070 private: 0x0488ADE4
51071 },
51072 pubKeyHash: 0x3c,
51073 scriptHash: 0x55,
51074 wif: 0xbc
51075};
51076</script>
51077 <script>(function() {
51078
51079// p2wpkh
51080
51081bitcoinjs.bitcoin.networks.bitcoin.p2wpkh = {
51082 baseNetwork: "bitcoin",
51083 messagePrefix: '\x18Bitcoin Signed Message:\n',
51084 bech32: 'bc',
51085 bip32: {
51086 public: 0x04b24746,
51087 private: 0x04b2430c
51088 },
51089 pubKeyHash: 0x00,
51090 scriptHash: 0x05,
51091 wif: 0x80
51092};
51093
51094// p2wpkh in p2sh
51095
51096bitcoinjs.bitcoin.networks.bitcoin.p2wpkhInP2sh = {
51097 baseNetwork: "bitcoin",
51098 messagePrefix: '\x18Bitcoin Signed Message:\n',
51099 bech32: 'bc',
51100 bip32: {
51101 public: 0x049d7cb2,
51102 private: 0x049d7878
51103 },
51104 pubKeyHash: 0x00,
51105 scriptHash: 0x05,
51106 wif: 0x80
51107};
51108
51109bitcoinjs.bitcoin.networks.testnet.p2wpkhInP2sh = {
51110 baseNetwork: "testnet",
51111 messagePrefix: '\x18Bitcoin Signed Message:\n',
51112 bech32: 'tb',
51113 bip32: {
51114 public: 0x044a5262,
51115 private: 0x044a4e28
51116 },
51117 pubKeyHash: 0x6f,
51118 scriptHash: 0xc4,
51119 wif: 0xef
51120};
51121
51122bitcoinjs.bitcoin.networks.litecoin.p2wpkhInP2sh = {
51123 baseNetwork: "litecoin",
51124 messagePrefix: '\x19Litecoin Signed Message:\n',
51125 bip32: {
51126 public: 0x01b26ef6,
51127 private: 0x01b26792
51128 },
51129 pubKeyHash: 0x30,
51130 scriptHash: 0x32,
51131 wif: 0xb0
51132};
51133
51134})();
51135</script>
51136 <script>(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ethUtil = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
51137(function (global){
51138'use strict';
51139
51140// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
51141// original notice:
51142
51143/*!
51144 * The buffer module from node.js, for the browser.
51145 *
51146 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
51147 * @license MIT
51148 */
51149function compare(a, b) {
51150 if (a === b) {
51151 return 0;
51152 }
51153
51154 var x = a.length;
51155 var y = b.length;
51156
51157 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
51158 if (a[i] !== b[i]) {
51159 x = a[i];
51160 y = b[i];
51161 break;
51162 }
51163 }
51164
51165 if (x < y) {
51166 return -1;
51167 }
51168 if (y < x) {
51169 return 1;
51170 }
51171 return 0;
51172}
51173function isBuffer(b) {
51174 if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {
51175 return global.Buffer.isBuffer(b);
51176 }
51177 return !!(b != null && b._isBuffer);
51178}
51179
51180// based on node assert, original notice:
51181
51182// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
51183//
51184// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
51185//
51186// Originally from narwhal.js (http://narwhaljs.org)
51187// Copyright (c) 2009 Thomas Robinson <280north.com>
51188//
51189// Permission is hereby granted, free of charge, to any person obtaining a copy
51190// of this software and associated documentation files (the 'Software'), to
51191// deal in the Software without restriction, including without limitation the
51192// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
51193// sell copies of the Software, and to permit persons to whom the Software is
51194// furnished to do so, subject to the following conditions:
51195//
51196// The above copyright notice and this permission notice shall be included in
51197// all copies or substantial portions of the Software.
51198//
51199// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51200// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
51201// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
51202// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
51203// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
51204// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
51205
51206var util = require('util/');
51207var hasOwn = Object.prototype.hasOwnProperty;
51208var pSlice = Array.prototype.slice;
51209var functionsHaveNames = (function () {
51210 return function foo() {}.name === 'foo';
51211}());
51212function pToString (obj) {
51213 return Object.prototype.toString.call(obj);
51214}
51215function isView(arrbuf) {
51216 if (isBuffer(arrbuf)) {
51217 return false;
51218 }
51219 if (typeof global.ArrayBuffer !== 'function') {
51220 return false;
51221 }
51222 if (typeof ArrayBuffer.isView === 'function') {
51223 return ArrayBuffer.isView(arrbuf);
51224 }
51225 if (!arrbuf) {
51226 return false;
51227 }
51228 if (arrbuf instanceof DataView) {
51229 return true;
51230 }
51231 if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
51232 return true;
51233 }
51234 return false;
51235}
51236// 1. The assert module provides functions that throw
51237// AssertionError's when particular conditions are not met. The
51238// assert module must conform to the following interface.
51239
51240var assert = module.exports = ok;
51241
51242// 2. The AssertionError is defined in assert.
51243// new assert.AssertionError({ message: message,
51244// actual: actual,
51245// expected: expected })
51246
51247var regex = /\s*function\s+([^\(\s]*)\s*/;
51248// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js
51249function getName(func) {
51250 if (!util.isFunction(func)) {
51251 return;
51252 }
51253 if (functionsHaveNames) {
51254 return func.name;
51255 }
51256 var str = func.toString();
51257 var match = str.match(regex);
51258 return match && match[1];
51259}
51260assert.AssertionError = function AssertionError(options) {
51261 this.name = 'AssertionError';
51262 this.actual = options.actual;
51263 this.expected = options.expected;
51264 this.operator = options.operator;
51265 if (options.message) {
51266 this.message = options.message;
51267 this.generatedMessage = false;
51268 } else {
51269 this.message = getMessage(this);
51270 this.generatedMessage = true;
51271 }
51272 var stackStartFunction = options.stackStartFunction || fail;
51273 if (Error.captureStackTrace) {
51274 Error.captureStackTrace(this, stackStartFunction);
51275 } else {
51276 // non v8 browsers so we can have a stacktrace
51277 var err = new Error();
51278 if (err.stack) {
51279 var out = err.stack;
51280
51281 // try to strip useless frames
51282 var fn_name = getName(stackStartFunction);
51283 var idx = out.indexOf('\n' + fn_name);
51284 if (idx >= 0) {
51285 // once we have located the function frame
51286 // we need to strip out everything before it (and its line)
51287 var next_line = out.indexOf('\n', idx + 1);
51288 out = out.substring(next_line + 1);
51289 }
51290
51291 this.stack = out;
51292 }
51293 }
51294};
51295
51296// assert.AssertionError instanceof Error
51297util.inherits(assert.AssertionError, Error);
51298
51299function truncate(s, n) {
51300 if (typeof s === 'string') {
51301 return s.length < n ? s : s.slice(0, n);
51302 } else {
51303 return s;
51304 }
51305}
51306function inspect(something) {
51307 if (functionsHaveNames || !util.isFunction(something)) {
51308 return util.inspect(something);
51309 }
51310 var rawname = getName(something);
51311 var name = rawname ? ': ' + rawname : '';
51312 return '[Function' + name + ']';
51313}
51314function getMessage(self) {
51315 return truncate(inspect(self.actual), 128) + ' ' +
51316 self.operator + ' ' +
51317 truncate(inspect(self.expected), 128);
51318}
51319
51320// At present only the three keys mentioned above are used and
51321// understood by the spec. Implementations or sub modules can pass
51322// other keys to the AssertionError's constructor - they will be
51323// ignored.
51324
51325// 3. All of the following functions must throw an AssertionError
51326// when a corresponding condition is not met, with a message that
51327// may be undefined if not provided. All assertion methods provide
51328// both the actual and expected values to the assertion error for
51329// display purposes.
51330
51331function fail(actual, expected, message, operator, stackStartFunction) {
51332 throw new assert.AssertionError({
51333 message: message,
51334 actual: actual,
51335 expected: expected,
51336 operator: operator,
51337 stackStartFunction: stackStartFunction
51338 });
51339}
51340
51341// EXTENSION! allows for well behaved errors defined elsewhere.
51342assert.fail = fail;
51343
51344// 4. Pure assertion tests whether a value is truthy, as determined
51345// by !!guard.
51346// assert.ok(guard, message_opt);
51347// This statement is equivalent to assert.equal(true, !!guard,
51348// message_opt);. To test strictly for the value true, use
51349// assert.strictEqual(true, guard, message_opt);.
51350
51351function ok(value, message) {
51352 if (!value) fail(value, true, message, '==', assert.ok);
51353}
51354assert.ok = ok;
51355
51356// 5. The equality assertion tests shallow, coercive equality with
51357// ==.
51358// assert.equal(actual, expected, message_opt);
51359
51360assert.equal = function equal(actual, expected, message) {
51361 if (actual != expected) fail(actual, expected, message, '==', assert.equal);
51362};
51363
51364// 6. The non-equality assertion tests for whether two objects are not equal
51365// with != assert.notEqual(actual, expected, message_opt);
51366
51367assert.notEqual = function notEqual(actual, expected, message) {
51368 if (actual == expected) {
51369 fail(actual, expected, message, '!=', assert.notEqual);
51370 }
51371};
51372
51373// 7. The equivalence assertion tests a deep equality relation.
51374// assert.deepEqual(actual, expected, message_opt);
51375
51376assert.deepEqual = function deepEqual(actual, expected, message) {
51377 if (!_deepEqual(actual, expected, false)) {
51378 fail(actual, expected, message, 'deepEqual', assert.deepEqual);
51379 }
51380};
51381
51382assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
51383 if (!_deepEqual(actual, expected, true)) {
51384 fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
51385 }
51386};
51387
51388function _deepEqual(actual, expected, strict, memos) {
51389 // 7.1. All identical values are equivalent, as determined by ===.
51390 if (actual === expected) {
51391 return true;
51392 } else if (isBuffer(actual) && isBuffer(expected)) {
51393 return compare(actual, expected) === 0;
51394
51395 // 7.2. If the expected value is a Date object, the actual value is
51396 // equivalent if it is also a Date object that refers to the same time.
51397 } else if (util.isDate(actual) && util.isDate(expected)) {
51398 return actual.getTime() === expected.getTime();
51399
51400 // 7.3 If the expected value is a RegExp object, the actual value is
51401 // equivalent if it is also a RegExp object with the same source and
51402 // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
51403 } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
51404 return actual.source === expected.source &&
51405 actual.global === expected.global &&
51406 actual.multiline === expected.multiline &&
51407 actual.lastIndex === expected.lastIndex &&
51408 actual.ignoreCase === expected.ignoreCase;
51409
51410 // 7.4. Other pairs that do not both pass typeof value == 'object',
51411 // equivalence is determined by ==.
51412 } else if ((actual === null || typeof actual !== 'object') &&
51413 (expected === null || typeof expected !== 'object')) {
51414 return strict ? actual === expected : actual == expected;
51415
51416 // If both values are instances of typed arrays, wrap their underlying
51417 // ArrayBuffers in a Buffer each to increase performance
51418 // This optimization requires the arrays to have the same type as checked by
51419 // Object.prototype.toString (aka pToString). Never perform binary
51420 // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
51421 // bit patterns are not identical.
51422 } else if (isView(actual) && isView(expected) &&
51423 pToString(actual) === pToString(expected) &&
51424 !(actual instanceof Float32Array ||
51425 actual instanceof Float64Array)) {
51426 return compare(new Uint8Array(actual.buffer),
51427 new Uint8Array(expected.buffer)) === 0;
51428
51429 // 7.5 For all other Object pairs, including Array objects, equivalence is
51430 // determined by having the same number of owned properties (as verified
51431 // with Object.prototype.hasOwnProperty.call), the same set of keys
51432 // (although not necessarily the same order), equivalent values for every
51433 // corresponding key, and an identical 'prototype' property. Note: this
51434 // accounts for both named and indexed properties on Arrays.
51435 } else if (isBuffer(actual) !== isBuffer(expected)) {
51436 return false;
51437 } else {
51438 memos = memos || {actual: [], expected: []};
51439
51440 var actualIndex = memos.actual.indexOf(actual);
51441 if (actualIndex !== -1) {
51442 if (actualIndex === memos.expected.indexOf(expected)) {
51443 return true;
51444 }
51445 }
51446
51447 memos.actual.push(actual);
51448 memos.expected.push(expected);
51449
51450 return objEquiv(actual, expected, strict, memos);
51451 }
51452}
51453
51454function isArguments(object) {
51455 return Object.prototype.toString.call(object) == '[object Arguments]';
51456}
51457
51458function objEquiv(a, b, strict, actualVisitedObjects) {
51459 if (a === null || a === undefined || b === null || b === undefined)
51460 return false;
51461 // if one is a primitive, the other must be same
51462 if (util.isPrimitive(a) || util.isPrimitive(b))
51463 return a === b;
51464 if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
51465 return false;
51466 var aIsArgs = isArguments(a);
51467 var bIsArgs = isArguments(b);
51468 if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
51469 return false;
51470 if (aIsArgs) {
51471 a = pSlice.call(a);
51472 b = pSlice.call(b);
51473 return _deepEqual(a, b, strict);
51474 }
51475 var ka = objectKeys(a);
51476 var kb = objectKeys(b);
51477 var key, i;
51478 // having the same number of owned properties (keys incorporates
51479 // hasOwnProperty)
51480 if (ka.length !== kb.length)
51481 return false;
51482 //the same set of keys (although not necessarily the same order),
51483 ka.sort();
51484 kb.sort();
51485 //~~~cheap key test
51486 for (i = ka.length - 1; i >= 0; i--) {
51487 if (ka[i] !== kb[i])
51488 return false;
51489 }
51490 //equivalent values for every corresponding key, and
51491 //~~~possibly expensive deep test
51492 for (i = ka.length - 1; i >= 0; i--) {
51493 key = ka[i];
51494 if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))
51495 return false;
51496 }
51497 return true;
51498}
51499
51500// 8. The non-equivalence assertion tests for any deep inequality.
51501// assert.notDeepEqual(actual, expected, message_opt);
51502
51503assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
51504 if (_deepEqual(actual, expected, false)) {
51505 fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
51506 }
51507};
51508
51509assert.notDeepStrictEqual = notDeepStrictEqual;
51510function notDeepStrictEqual(actual, expected, message) {
51511 if (_deepEqual(actual, expected, true)) {
51512 fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
51513 }
51514}
51515
51516
51517// 9. The strict equality assertion tests strict equality, as determined by ===.
51518// assert.strictEqual(actual, expected, message_opt);
51519
51520assert.strictEqual = function strictEqual(actual, expected, message) {
51521 if (actual !== expected) {
51522 fail(actual, expected, message, '===', assert.strictEqual);
51523 }
51524};
51525
51526// 10. The strict non-equality assertion tests for strict inequality, as
51527// determined by !==. assert.notStrictEqual(actual, expected, message_opt);
51528
51529assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
51530 if (actual === expected) {
51531 fail(actual, expected, message, '!==', assert.notStrictEqual);
51532 }
51533};
51534
51535function expectedException(actual, expected) {
51536 if (!actual || !expected) {
51537 return false;
51538 }
51539
51540 if (Object.prototype.toString.call(expected) == '[object RegExp]') {
51541 return expected.test(actual);
51542 }
51543
51544 try {
51545 if (actual instanceof expected) {
51546 return true;
51547 }
51548 } catch (e) {
51549 // Ignore. The instanceof check doesn't work for arrow functions.
51550 }
51551
51552 if (Error.isPrototypeOf(expected)) {
51553 return false;
51554 }
51555
51556 return expected.call({}, actual) === true;
51557}
51558
51559function _tryBlock(block) {
51560 var error;
51561 try {
51562 block();
51563 } catch (e) {
51564 error = e;
51565 }
51566 return error;
51567}
51568
51569function _throws(shouldThrow, block, expected, message) {
51570 var actual;
51571
51572 if (typeof block !== 'function') {
51573 throw new TypeError('"block" argument must be a function');
51574 }
51575
51576 if (typeof expected === 'string') {
51577 message = expected;
51578 expected = null;
51579 }
51580
51581 actual = _tryBlock(block);
51582
51583 message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
51584 (message ? ' ' + message : '.');
51585
51586 if (shouldThrow && !actual) {
51587 fail(actual, expected, 'Missing expected exception' + message);
51588 }
51589
51590 var userProvidedMessage = typeof message === 'string';
51591 var isUnwantedException = !shouldThrow && util.isError(actual);
51592 var isUnexpectedException = !shouldThrow && actual && !expected;
51593
51594 if ((isUnwantedException &&
51595 userProvidedMessage &&
51596 expectedException(actual, expected)) ||
51597 isUnexpectedException) {
51598 fail(actual, expected, 'Got unwanted exception' + message);
51599 }
51600
51601 if ((shouldThrow && actual && expected &&
51602 !expectedException(actual, expected)) || (!shouldThrow && actual)) {
51603 throw actual;
51604 }
51605}
51606
51607// 11. Expected to throw an error:
51608// assert.throws(block, Error_opt, message_opt);
51609
51610assert.throws = function(block, /*optional*/error, /*optional*/message) {
51611 _throws(true, block, error, message);
51612};
51613
51614// EXTENSION! This is annoying to write outside this module.
51615assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
51616 _throws(false, block, error, message);
51617};
51618
51619assert.ifError = function(err) { if (err) throw err; };
51620
51621var objectKeys = Object.keys || function (obj) {
51622 var keys = [];
51623 for (var key in obj) {
51624 if (hasOwn.call(obj, key)) keys.push(key);
51625 }
51626 return keys;
51627};
51628
51629}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
51630},{"util/":30}],2:[function(require,module,exports){
51631'use strict'
51632
51633exports.byteLength = byteLength
51634exports.toByteArray = toByteArray
51635exports.fromByteArray = fromByteArray
51636
51637var lookup = []
51638var revLookup = []
51639var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
51640
51641var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
51642for (var i = 0, len = code.length; i < len; ++i) {
51643 lookup[i] = code[i]
51644 revLookup[code.charCodeAt(i)] = i
51645}
51646
51647revLookup['-'.charCodeAt(0)] = 62
51648revLookup['_'.charCodeAt(0)] = 63
51649
51650function placeHoldersCount (b64) {
51651 var len = b64.length
51652 if (len % 4 > 0) {
51653 throw new Error('Invalid string. Length must be a multiple of 4')
51654 }
51655
51656 // the number of equal signs (place holders)
51657 // if there are two placeholders, than the two characters before it
51658 // represent one byte
51659 // if there is only one, then the three characters before it represent 2 bytes
51660 // this is just a cheap hack to not do indexOf twice
51661 return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
51662}
51663
51664function byteLength (b64) {
51665 // base64 is 4/3 + up to two characters of the original data
51666 return b64.length * 3 / 4 - placeHoldersCount(b64)
51667}
51668
51669function toByteArray (b64) {
51670 var i, j, l, tmp, placeHolders, arr
51671 var len = b64.length
51672 placeHolders = placeHoldersCount(b64)
51673
51674 arr = new Arr(len * 3 / 4 - placeHolders)
51675
51676 // if there are placeholders, only get up to the last complete 4 chars
51677 l = placeHolders > 0 ? len - 4 : len
51678
51679 var L = 0
51680
51681 for (i = 0, j = 0; i < l; i += 4, j += 3) {
51682 tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
51683 arr[L++] = (tmp >> 16) & 0xFF
51684 arr[L++] = (tmp >> 8) & 0xFF
51685 arr[L++] = tmp & 0xFF
51686 }
51687
51688 if (placeHolders === 2) {
51689 tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
51690 arr[L++] = tmp & 0xFF
51691 } else if (placeHolders === 1) {
51692 tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
51693 arr[L++] = (tmp >> 8) & 0xFF
51694 arr[L++] = tmp & 0xFF
51695 }
51696
51697 return arr
51698}
51699
51700function tripletToBase64 (num) {
51701 return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
51702}
51703
51704function encodeChunk (uint8, start, end) {
51705 var tmp
51706 var output = []
51707 for (var i = start; i < end; i += 3) {
51708 tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
51709 output.push(tripletToBase64(tmp))
51710 }
51711 return output.join('')
51712}
51713
51714function fromByteArray (uint8) {
51715 var tmp
51716 var len = uint8.length
51717 var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
51718 var output = ''
51719 var parts = []
51720 var maxChunkLength = 16383 // must be multiple of 3
51721
51722 // go through the array every three bytes, we'll deal with trailing stuff later
51723 for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
51724 parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
51725 }
51726
51727 // pad the end with zeros, but make sure to not forget the extra bytes
51728 if (extraBytes === 1) {
51729 tmp = uint8[len - 1]
51730 output += lookup[tmp >> 2]
51731 output += lookup[(tmp << 4) & 0x3F]
51732 output += '=='
51733 } else if (extraBytes === 2) {
51734 tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
51735 output += lookup[tmp >> 10]
51736 output += lookup[(tmp >> 4) & 0x3F]
51737 output += lookup[(tmp << 2) & 0x3F]
51738 output += '='
51739 }
51740
51741 parts.push(output)
51742
51743 return parts.join('')
51744}
51745
51746},{}],3:[function(require,module,exports){
51747
51748},{}],4:[function(require,module,exports){
51749(function (global){
51750'use strict';
51751
51752var buffer = require('buffer');
51753var Buffer = buffer.Buffer;
51754var SlowBuffer = buffer.SlowBuffer;
51755var MAX_LEN = buffer.kMaxLength || 2147483647;
51756exports.alloc = function alloc(size, fill, encoding) {
51757 if (typeof Buffer.alloc === 'function') {
51758 return Buffer.alloc(size, fill, encoding);
51759 }
51760 if (typeof encoding === 'number') {
51761 throw new TypeError('encoding must not be number');
51762 }
51763 if (typeof size !== 'number') {
51764 throw new TypeError('size must be a number');
51765 }
51766 if (size > MAX_LEN) {
51767 throw new RangeError('size is too large');
51768 }
51769 var enc = encoding;
51770 var _fill = fill;
51771 if (_fill === undefined) {
51772 enc = undefined;
51773 _fill = 0;
51774 }
51775 var buf = new Buffer(size);
51776 if (typeof _fill === 'string') {
51777 var fillBuf = new Buffer(_fill, enc);
51778 var flen = fillBuf.length;
51779 var i = -1;
51780 while (++i < size) {
51781 buf[i] = fillBuf[i % flen];
51782 }
51783 } else {
51784 buf.fill(_fill);
51785 }
51786 return buf;
51787}
51788exports.allocUnsafe = function allocUnsafe(size) {
51789 if (typeof Buffer.allocUnsafe === 'function') {
51790 return Buffer.allocUnsafe(size);
51791 }
51792 if (typeof size !== 'number') {
51793 throw new TypeError('size must be a number');
51794 }
51795 if (size > MAX_LEN) {
51796 throw new RangeError('size is too large');
51797 }
51798 return new Buffer(size);
51799}
51800exports.from = function from(value, encodingOrOffset, length) {
51801 if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {
51802 return Buffer.from(value, encodingOrOffset, length);
51803 }
51804 if (typeof value === 'number') {
51805 throw new TypeError('"value" argument must not be a number');
51806 }
51807 if (typeof value === 'string') {
51808 return new Buffer(value, encodingOrOffset);
51809 }
51810 if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
51811 var offset = encodingOrOffset;
51812 if (arguments.length === 1) {
51813 return new Buffer(value);
51814 }
51815 if (typeof offset === 'undefined') {
51816 offset = 0;
51817 }
51818 var len = length;
51819 if (typeof len === 'undefined') {
51820 len = value.byteLength - offset;
51821 }
51822 if (offset >= value.byteLength) {
51823 throw new RangeError('\'offset\' is out of bounds');
51824 }
51825 if (len > value.byteLength - offset) {
51826 throw new RangeError('\'length\' is out of bounds');
51827 }
51828 return new Buffer(value.slice(offset, offset + len));
51829 }
51830 if (Buffer.isBuffer(value)) {
51831 var out = new Buffer(value.length);
51832 value.copy(out, 0, 0, value.length);
51833 return out;
51834 }
51835 if (value) {
51836 if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) {
51837 return new Buffer(value);
51838 }
51839 if (value.type === 'Buffer' && Array.isArray(value.data)) {
51840 return new Buffer(value.data);
51841 }
51842 }
51843
51844 throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');
51845}
51846exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
51847 if (typeof Buffer.allocUnsafeSlow === 'function') {
51848 return Buffer.allocUnsafeSlow(size);
51849 }
51850 if (typeof size !== 'number') {
51851 throw new TypeError('size must be a number');
51852 }
51853 if (size >= MAX_LEN) {
51854 throw new RangeError('size is too large');
51855 }
51856 return new SlowBuffer(size);
51857}
51858
51859}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
51860},{"buffer":5}],5:[function(require,module,exports){
51861/*!
51862 * The buffer module from node.js, for the browser.
51863 *
51864 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
51865 * @license MIT
51866 */
51867/* eslint-disable no-proto */
51868
51869'use strict'
51870
51871var base64 = require('base64-js')
51872var ieee754 = require('ieee754')
51873
51874exports.Buffer = Buffer
51875exports.SlowBuffer = SlowBuffer
51876exports.INSPECT_MAX_BYTES = 50
51877
51878var K_MAX_LENGTH = 0x7fffffff
51879exports.kMaxLength = K_MAX_LENGTH
51880
51881/**
51882 * If `Buffer.TYPED_ARRAY_SUPPORT`:
51883 * === true Use Uint8Array implementation (fastest)
51884 * === false Print warning and recommend using `buffer` v4.x which has an Object
51885 * implementation (most compatible, even IE6)
51886 *
51887 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
51888 * Opera 11.6+, iOS 4.2+.
51889 *
51890 * We report that the browser does not support typed arrays if the are not subclassable
51891 * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
51892 * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
51893 * for __proto__ and has a buggy typed array implementation.
51894 */
51895Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
51896
51897if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
51898 typeof console.error === 'function') {
51899 console.error(
51900 'This browser lacks typed array (Uint8Array) support which is required by ' +
51901 '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
51902 )
51903}
51904
51905function typedArraySupport () {
51906 // Can typed array instances can be augmented?
51907 try {
51908 var arr = new Uint8Array(1)
51909 arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
51910 return arr.foo() === 42
51911 } catch (e) {
51912 return false
51913 }
51914}
51915
51916function createBuffer (length) {
51917 if (length > K_MAX_LENGTH) {
51918 throw new RangeError('Invalid typed array length')
51919 }
51920 // Return an augmented `Uint8Array` instance
51921 var buf = new Uint8Array(length)
51922 buf.__proto__ = Buffer.prototype
51923 return buf
51924}
51925
51926/**
51927 * The Buffer constructor returns instances of `Uint8Array` that have their
51928 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
51929 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
51930 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
51931 * returns a single octet.
51932 *
51933 * The `Uint8Array` prototype remains unmodified.
51934 */
51935
51936function Buffer (arg, encodingOrOffset, length) {
51937 // Common case.
51938 if (typeof arg === 'number') {
51939 if (typeof encodingOrOffset === 'string') {
51940 throw new Error(
51941 'If encoding is specified then the first argument must be a string'
51942 )
51943 }
51944 return allocUnsafe(arg)
51945 }
51946 return from(arg, encodingOrOffset, length)
51947}
51948
51949// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
51950if (typeof Symbol !== 'undefined' && Symbol.species &&
51951 Buffer[Symbol.species] === Buffer) {
51952 Object.defineProperty(Buffer, Symbol.species, {
51953 value: null,
51954 configurable: true,
51955 enumerable: false,
51956 writable: false
51957 })
51958}
51959
51960Buffer.poolSize = 8192 // not used by this implementation
51961
51962function from (value, encodingOrOffset, length) {
51963 if (typeof value === 'number') {
51964 throw new TypeError('"value" argument must not be a number')
51965 }
51966
51967 if (value instanceof ArrayBuffer) {
51968 return fromArrayBuffer(value, encodingOrOffset, length)
51969 }
51970
51971 if (typeof value === 'string') {
51972 return fromString(value, encodingOrOffset)
51973 }
51974
51975 return fromObject(value)
51976}
51977
51978/**
51979 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
51980 * if value is a number.
51981 * Buffer.from(str[, encoding])
51982 * Buffer.from(array)
51983 * Buffer.from(buffer)
51984 * Buffer.from(arrayBuffer[, byteOffset[, length]])
51985 **/
51986Buffer.from = function (value, encodingOrOffset, length) {
51987 return from(value, encodingOrOffset, length)
51988}
51989
51990// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
51991// https://github.com/feross/buffer/pull/148
51992Buffer.prototype.__proto__ = Uint8Array.prototype
51993Buffer.__proto__ = Uint8Array
51994
51995function assertSize (size) {
51996 if (typeof size !== 'number') {
51997 throw new TypeError('"size" argument must be a number')
51998 } else if (size < 0) {
51999 throw new RangeError('"size" argument must not be negative')
52000 }
52001}
52002
52003function alloc (size, fill, encoding) {
52004 assertSize(size)
52005 if (size <= 0) {
52006 return createBuffer(size)
52007 }
52008 if (fill !== undefined) {
52009 // Only pay attention to encoding if it's a string. This
52010 // prevents accidentally sending in a number that would
52011 // be interpretted as a start offset.
52012 return typeof encoding === 'string'
52013 ? createBuffer(size).fill(fill, encoding)
52014 : createBuffer(size).fill(fill)
52015 }
52016 return createBuffer(size)
52017}
52018
52019/**
52020 * Creates a new filled Buffer instance.
52021 * alloc(size[, fill[, encoding]])
52022 **/
52023Buffer.alloc = function (size, fill, encoding) {
52024 return alloc(size, fill, encoding)
52025}
52026
52027function allocUnsafe (size) {
52028 assertSize(size)
52029 return createBuffer(size < 0 ? 0 : checked(size) | 0)
52030}
52031
52032/**
52033 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
52034 * */
52035Buffer.allocUnsafe = function (size) {
52036 return allocUnsafe(size)
52037}
52038/**
52039 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
52040 */
52041Buffer.allocUnsafeSlow = function (size) {
52042 return allocUnsafe(size)
52043}
52044
52045function fromString (string, encoding) {
52046 if (typeof encoding !== 'string' || encoding === '') {
52047 encoding = 'utf8'
52048 }
52049
52050 if (!Buffer.isEncoding(encoding)) {
52051 throw new TypeError('"encoding" must be a valid string encoding')
52052 }
52053
52054 var length = byteLength(string, encoding) | 0
52055 var buf = createBuffer(length)
52056
52057 var actual = buf.write(string, encoding)
52058
52059 if (actual !== length) {
52060 // Writing a hex string, for example, that contains invalid characters will
52061 // cause everything after the first invalid character to be ignored. (e.g.
52062 // 'abxxcd' will be treated as 'ab')
52063 buf = buf.slice(0, actual)
52064 }
52065
52066 return buf
52067}
52068
52069function fromArrayLike (array) {
52070 var length = array.length < 0 ? 0 : checked(array.length) | 0
52071 var buf = createBuffer(length)
52072 for (var i = 0; i < length; i += 1) {
52073 buf[i] = array[i] & 255
52074 }
52075 return buf
52076}
52077
52078function fromArrayBuffer (array, byteOffset, length) {
52079 if (byteOffset < 0 || array.byteLength < byteOffset) {
52080 throw new RangeError('\'offset\' is out of bounds')
52081 }
52082
52083 if (array.byteLength < byteOffset + (length || 0)) {
52084 throw new RangeError('\'length\' is out of bounds')
52085 }
52086
52087 var buf
52088 if (byteOffset === undefined && length === undefined) {
52089 buf = new Uint8Array(array)
52090 } else if (length === undefined) {
52091 buf = new Uint8Array(array, byteOffset)
52092 } else {
52093 buf = new Uint8Array(array, byteOffset, length)
52094 }
52095
52096 // Return an augmented `Uint8Array` instance
52097 buf.__proto__ = Buffer.prototype
52098 return buf
52099}
52100
52101function fromObject (obj) {
52102 if (Buffer.isBuffer(obj)) {
52103 var len = checked(obj.length) | 0
52104 var buf = createBuffer(len)
52105
52106 if (buf.length === 0) {
52107 return buf
52108 }
52109
52110 obj.copy(buf, 0, 0, len)
52111 return buf
52112 }
52113
52114 if (obj) {
52115 if (ArrayBuffer.isView(obj) || 'length' in obj) {
52116 if (typeof obj.length !== 'number' || isnan(obj.length)) {
52117 return createBuffer(0)
52118 }
52119 return fromArrayLike(obj)
52120 }
52121
52122 if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
52123 return fromArrayLike(obj.data)
52124 }
52125 }
52126
52127 throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
52128}
52129
52130function checked (length) {
52131 // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
52132 // length is NaN (which is otherwise coerced to zero.)
52133 if (length >= K_MAX_LENGTH) {
52134 throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
52135 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
52136 }
52137 return length | 0
52138}
52139
52140function SlowBuffer (length) {
52141 if (+length != length) { // eslint-disable-line eqeqeq
52142 length = 0
52143 }
52144 return Buffer.alloc(+length)
52145}
52146
52147Buffer.isBuffer = function isBuffer (b) {
52148 return b != null && b._isBuffer === true
52149}
52150
52151Buffer.compare = function compare (a, b) {
52152 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
52153 throw new TypeError('Arguments must be Buffers')
52154 }
52155
52156 if (a === b) return 0
52157
52158 var x = a.length
52159 var y = b.length
52160
52161 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
52162 if (a[i] !== b[i]) {
52163 x = a[i]
52164 y = b[i]
52165 break
52166 }
52167 }
52168
52169 if (x < y) return -1
52170 if (y < x) return 1
52171 return 0
52172}
52173
52174Buffer.isEncoding = function isEncoding (encoding) {
52175 switch (String(encoding).toLowerCase()) {
52176 case 'hex':
52177 case 'utf8':
52178 case 'utf-8':
52179 case 'ascii':
52180 case 'latin1':
52181 case 'binary':
52182 case 'base64':
52183 case 'ucs2':
52184 case 'ucs-2':
52185 case 'utf16le':
52186 case 'utf-16le':
52187 return true
52188 default:
52189 return false
52190 }
52191}
52192
52193Buffer.concat = function concat (list, length) {
52194 if (!Array.isArray(list)) {
52195 throw new TypeError('"list" argument must be an Array of Buffers')
52196 }
52197
52198 if (list.length === 0) {
52199 return Buffer.alloc(0)
52200 }
52201
52202 var i
52203 if (length === undefined) {
52204 length = 0
52205 for (i = 0; i < list.length; ++i) {
52206 length += list[i].length
52207 }
52208 }
52209
52210 var buffer = Buffer.allocUnsafe(length)
52211 var pos = 0
52212 for (i = 0; i < list.length; ++i) {
52213 var buf = list[i]
52214 if (!Buffer.isBuffer(buf)) {
52215 throw new TypeError('"list" argument must be an Array of Buffers')
52216 }
52217 buf.copy(buffer, pos)
52218 pos += buf.length
52219 }
52220 return buffer
52221}
52222
52223function byteLength (string, encoding) {
52224 if (Buffer.isBuffer(string)) {
52225 return string.length
52226 }
52227 if (ArrayBuffer.isView(string) || string instanceof ArrayBuffer) {
52228 return string.byteLength
52229 }
52230 if (typeof string !== 'string') {
52231 string = '' + string
52232 }
52233
52234 var len = string.length
52235 if (len === 0) return 0
52236
52237 // Use a for loop to avoid recursion
52238 var loweredCase = false
52239 for (;;) {
52240 switch (encoding) {
52241 case 'ascii':
52242 case 'latin1':
52243 case 'binary':
52244 return len
52245 case 'utf8':
52246 case 'utf-8':
52247 case undefined:
52248 return utf8ToBytes(string).length
52249 case 'ucs2':
52250 case 'ucs-2':
52251 case 'utf16le':
52252 case 'utf-16le':
52253 return len * 2
52254 case 'hex':
52255 return len >>> 1
52256 case 'base64':
52257 return base64ToBytes(string).length
52258 default:
52259 if (loweredCase) return utf8ToBytes(string).length // assume utf8
52260 encoding = ('' + encoding).toLowerCase()
52261 loweredCase = true
52262 }
52263 }
52264}
52265Buffer.byteLength = byteLength
52266
52267function slowToString (encoding, start, end) {
52268 var loweredCase = false
52269
52270 // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
52271 // property of a typed array.
52272
52273 // This behaves neither like String nor Uint8Array in that we set start/end
52274 // to their upper/lower bounds if the value passed is out of range.
52275 // undefined is handled specially as per ECMA-262 6th Edition,
52276 // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
52277 if (start === undefined || start < 0) {
52278 start = 0
52279 }
52280 // Return early if start > this.length. Done here to prevent potential uint32
52281 // coercion fail below.
52282 if (start > this.length) {
52283 return ''
52284 }
52285
52286 if (end === undefined || end > this.length) {
52287 end = this.length
52288 }
52289
52290 if (end <= 0) {
52291 return ''
52292 }
52293
52294 // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
52295 end >>>= 0
52296 start >>>= 0
52297
52298 if (end <= start) {
52299 return ''
52300 }
52301
52302 if (!encoding) encoding = 'utf8'
52303
52304 while (true) {
52305 switch (encoding) {
52306 case 'hex':
52307 return hexSlice(this, start, end)
52308
52309 case 'utf8':
52310 case 'utf-8':
52311 return utf8Slice(this, start, end)
52312
52313 case 'ascii':
52314 return asciiSlice(this, start, end)
52315
52316 case 'latin1':
52317 case 'binary':
52318 return latin1Slice(this, start, end)
52319
52320 case 'base64':
52321 return base64Slice(this, start, end)
52322
52323 case 'ucs2':
52324 case 'ucs-2':
52325 case 'utf16le':
52326 case 'utf-16le':
52327 return utf16leSlice(this, start, end)
52328
52329 default:
52330 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
52331 encoding = (encoding + '').toLowerCase()
52332 loweredCase = true
52333 }
52334 }
52335}
52336
52337// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
52338// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
52339// reliably in a browserify context because there could be multiple different
52340// copies of the 'buffer' package in use. This method works even for Buffer
52341// instances that were created from another copy of the `buffer` package.
52342// See: https://github.com/feross/buffer/issues/154
52343Buffer.prototype._isBuffer = true
52344
52345function swap (b, n, m) {
52346 var i = b[n]
52347 b[n] = b[m]
52348 b[m] = i
52349}
52350
52351Buffer.prototype.swap16 = function swap16 () {
52352 var len = this.length
52353 if (len % 2 !== 0) {
52354 throw new RangeError('Buffer size must be a multiple of 16-bits')
52355 }
52356 for (var i = 0; i < len; i += 2) {
52357 swap(this, i, i + 1)
52358 }
52359 return this
52360}
52361
52362Buffer.prototype.swap32 = function swap32 () {
52363 var len = this.length
52364 if (len % 4 !== 0) {
52365 throw new RangeError('Buffer size must be a multiple of 32-bits')
52366 }
52367 for (var i = 0; i < len; i += 4) {
52368 swap(this, i, i + 3)
52369 swap(this, i + 1, i + 2)
52370 }
52371 return this
52372}
52373
52374Buffer.prototype.swap64 = function swap64 () {
52375 var len = this.length
52376 if (len % 8 !== 0) {
52377 throw new RangeError('Buffer size must be a multiple of 64-bits')
52378 }
52379 for (var i = 0; i < len; i += 8) {
52380 swap(this, i, i + 7)
52381 swap(this, i + 1, i + 6)
52382 swap(this, i + 2, i + 5)
52383 swap(this, i + 3, i + 4)
52384 }
52385 return this
52386}
52387
52388Buffer.prototype.toString = function toString () {
52389 var length = this.length
52390 if (length === 0) return ''
52391 if (arguments.length === 0) return utf8Slice(this, 0, length)
52392 return slowToString.apply(this, arguments)
52393}
52394
52395Buffer.prototype.equals = function equals (b) {
52396 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
52397 if (this === b) return true
52398 return Buffer.compare(this, b) === 0
52399}
52400
52401Buffer.prototype.inspect = function inspect () {
52402 var str = ''
52403 var max = exports.INSPECT_MAX_BYTES
52404 if (this.length > 0) {
52405 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
52406 if (this.length > max) str += ' ... '
52407 }
52408 return '<Buffer ' + str + '>'
52409}
52410
52411Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
52412 if (!Buffer.isBuffer(target)) {
52413 throw new TypeError('Argument must be a Buffer')
52414 }
52415
52416 if (start === undefined) {
52417 start = 0
52418 }
52419 if (end === undefined) {
52420 end = target ? target.length : 0
52421 }
52422 if (thisStart === undefined) {
52423 thisStart = 0
52424 }
52425 if (thisEnd === undefined) {
52426 thisEnd = this.length
52427 }
52428
52429 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
52430 throw new RangeError('out of range index')
52431 }
52432
52433 if (thisStart >= thisEnd && start >= end) {
52434 return 0
52435 }
52436 if (thisStart >= thisEnd) {
52437 return -1
52438 }
52439 if (start >= end) {
52440 return 1
52441 }
52442
52443 start >>>= 0
52444 end >>>= 0
52445 thisStart >>>= 0
52446 thisEnd >>>= 0
52447
52448 if (this === target) return 0
52449
52450 var x = thisEnd - thisStart
52451 var y = end - start
52452 var len = Math.min(x, y)
52453
52454 var thisCopy = this.slice(thisStart, thisEnd)
52455 var targetCopy = target.slice(start, end)
52456
52457 for (var i = 0; i < len; ++i) {
52458 if (thisCopy[i] !== targetCopy[i]) {
52459 x = thisCopy[i]
52460 y = targetCopy[i]
52461 break
52462 }
52463 }
52464
52465 if (x < y) return -1
52466 if (y < x) return 1
52467 return 0
52468}
52469
52470// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
52471// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
52472//
52473// Arguments:
52474// - buffer - a Buffer to search
52475// - val - a string, Buffer, or number
52476// - byteOffset - an index into `buffer`; will be clamped to an int32
52477// - encoding - an optional encoding, relevant is val is a string
52478// - dir - true for indexOf, false for lastIndexOf
52479function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
52480 // Empty buffer means no match
52481 if (buffer.length === 0) return -1
52482
52483 // Normalize byteOffset
52484 if (typeof byteOffset === 'string') {
52485 encoding = byteOffset
52486 byteOffset = 0
52487 } else if (byteOffset > 0x7fffffff) {
52488 byteOffset = 0x7fffffff
52489 } else if (byteOffset < -0x80000000) {
52490 byteOffset = -0x80000000
52491 }
52492 byteOffset = +byteOffset // Coerce to Number.
52493 if (isNaN(byteOffset)) {
52494 // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
52495 byteOffset = dir ? 0 : (buffer.length - 1)
52496 }
52497
52498 // Normalize byteOffset: negative offsets start from the end of the buffer
52499 if (byteOffset < 0) byteOffset = buffer.length + byteOffset
52500 if (byteOffset >= buffer.length) {
52501 if (dir) return -1
52502 else byteOffset = buffer.length - 1
52503 } else if (byteOffset < 0) {
52504 if (dir) byteOffset = 0
52505 else return -1
52506 }
52507
52508 // Normalize val
52509 if (typeof val === 'string') {
52510 val = Buffer.from(val, encoding)
52511 }
52512
52513 // Finally, search either indexOf (if dir is true) or lastIndexOf
52514 if (Buffer.isBuffer(val)) {
52515 // Special case: looking for empty string/buffer always fails
52516 if (val.length === 0) {
52517 return -1
52518 }
52519 return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
52520 } else if (typeof val === 'number') {
52521 val = val & 0xFF // Search for a byte value [0-255]
52522 if (typeof Uint8Array.prototype.indexOf === 'function') {
52523 if (dir) {
52524 return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
52525 } else {
52526 return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
52527 }
52528 }
52529 return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
52530 }
52531
52532 throw new TypeError('val must be string, number or Buffer')
52533}
52534
52535function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
52536 var indexSize = 1
52537 var arrLength = arr.length
52538 var valLength = val.length
52539
52540 if (encoding !== undefined) {
52541 encoding = String(encoding).toLowerCase()
52542 if (encoding === 'ucs2' || encoding === 'ucs-2' ||
52543 encoding === 'utf16le' || encoding === 'utf-16le') {
52544 if (arr.length < 2 || val.length < 2) {
52545 return -1
52546 }
52547 indexSize = 2
52548 arrLength /= 2
52549 valLength /= 2
52550 byteOffset /= 2
52551 }
52552 }
52553
52554 function read (buf, i) {
52555 if (indexSize === 1) {
52556 return buf[i]
52557 } else {
52558 return buf.readUInt16BE(i * indexSize)
52559 }
52560 }
52561
52562 var i
52563 if (dir) {
52564 var foundIndex = -1
52565 for (i = byteOffset; i < arrLength; i++) {
52566 if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
52567 if (foundIndex === -1) foundIndex = i
52568 if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
52569 } else {
52570 if (foundIndex !== -1) i -= i - foundIndex
52571 foundIndex = -1
52572 }
52573 }
52574 } else {
52575 if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
52576 for (i = byteOffset; i >= 0; i--) {
52577 var found = true
52578 for (var j = 0; j < valLength; j++) {
52579 if (read(arr, i + j) !== read(val, j)) {
52580 found = false
52581 break
52582 }
52583 }
52584 if (found) return i
52585 }
52586 }
52587
52588 return -1
52589}
52590
52591Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
52592 return this.indexOf(val, byteOffset, encoding) !== -1
52593}
52594
52595Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
52596 return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
52597}
52598
52599Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
52600 return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
52601}
52602
52603function hexWrite (buf, string, offset, length) {
52604 offset = Number(offset) || 0
52605 var remaining = buf.length - offset
52606 if (!length) {
52607 length = remaining
52608 } else {
52609 length = Number(length)
52610 if (length > remaining) {
52611 length = remaining
52612 }
52613 }
52614
52615 // must be an even number of digits
52616 var strLen = string.length
52617 if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
52618
52619 if (length > strLen / 2) {
52620 length = strLen / 2
52621 }
52622 for (var i = 0; i < length; ++i) {
52623 var parsed = parseInt(string.substr(i * 2, 2), 16)
52624 if (isNaN(parsed)) return i
52625 buf[offset + i] = parsed
52626 }
52627 return i
52628}
52629
52630function utf8Write (buf, string, offset, length) {
52631 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
52632}
52633
52634function asciiWrite (buf, string, offset, length) {
52635 return blitBuffer(asciiToBytes(string), buf, offset, length)
52636}
52637
52638function latin1Write (buf, string, offset, length) {
52639 return asciiWrite(buf, string, offset, length)
52640}
52641
52642function base64Write (buf, string, offset, length) {
52643 return blitBuffer(base64ToBytes(string), buf, offset, length)
52644}
52645
52646function ucs2Write (buf, string, offset, length) {
52647 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
52648}
52649
52650Buffer.prototype.write = function write (string, offset, length, encoding) {
52651 // Buffer#write(string)
52652 if (offset === undefined) {
52653 encoding = 'utf8'
52654 length = this.length
52655 offset = 0
52656 // Buffer#write(string, encoding)
52657 } else if (length === undefined && typeof offset === 'string') {
52658 encoding = offset
52659 length = this.length
52660 offset = 0
52661 // Buffer#write(string, offset[, length][, encoding])
52662 } else if (isFinite(offset)) {
52663 offset = offset >>> 0
52664 if (isFinite(length)) {
52665 length = length >>> 0
52666 if (encoding === undefined) encoding = 'utf8'
52667 } else {
52668 encoding = length
52669 length = undefined
52670 }
52671 } else {
52672 throw new Error(
52673 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
52674 )
52675 }
52676
52677 var remaining = this.length - offset
52678 if (length === undefined || length > remaining) length = remaining
52679
52680 if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
52681 throw new RangeError('Attempt to write outside buffer bounds')
52682 }
52683
52684 if (!encoding) encoding = 'utf8'
52685
52686 var loweredCase = false
52687 for (;;) {
52688 switch (encoding) {
52689 case 'hex':
52690 return hexWrite(this, string, offset, length)
52691
52692 case 'utf8':
52693 case 'utf-8':
52694 return utf8Write(this, string, offset, length)
52695
52696 case 'ascii':
52697 return asciiWrite(this, string, offset, length)
52698
52699 case 'latin1':
52700 case 'binary':
52701 return latin1Write(this, string, offset, length)
52702
52703 case 'base64':
52704 // Warning: maxLength not taken into account in base64Write
52705 return base64Write(this, string, offset, length)
52706
52707 case 'ucs2':
52708 case 'ucs-2':
52709 case 'utf16le':
52710 case 'utf-16le':
52711 return ucs2Write(this, string, offset, length)
52712
52713 default:
52714 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
52715 encoding = ('' + encoding).toLowerCase()
52716 loweredCase = true
52717 }
52718 }
52719}
52720
52721Buffer.prototype.toJSON = function toJSON () {
52722 return {
52723 type: 'Buffer',
52724 data: Array.prototype.slice.call(this._arr || this, 0)
52725 }
52726}
52727
52728function base64Slice (buf, start, end) {
52729 if (start === 0 && end === buf.length) {
52730 return base64.fromByteArray(buf)
52731 } else {
52732 return base64.fromByteArray(buf.slice(start, end))
52733 }
52734}
52735
52736function utf8Slice (buf, start, end) {
52737 end = Math.min(buf.length, end)
52738 var res = []
52739
52740 var i = start
52741 while (i < end) {
52742 var firstByte = buf[i]
52743 var codePoint = null
52744 var bytesPerSequence = (firstByte > 0xEF) ? 4
52745 : (firstByte > 0xDF) ? 3
52746 : (firstByte > 0xBF) ? 2
52747 : 1
52748
52749 if (i + bytesPerSequence <= end) {
52750 var secondByte, thirdByte, fourthByte, tempCodePoint
52751
52752 switch (bytesPerSequence) {
52753 case 1:
52754 if (firstByte < 0x80) {
52755 codePoint = firstByte
52756 }
52757 break
52758 case 2:
52759 secondByte = buf[i + 1]
52760 if ((secondByte & 0xC0) === 0x80) {
52761 tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
52762 if (tempCodePoint > 0x7F) {
52763 codePoint = tempCodePoint
52764 }
52765 }
52766 break
52767 case 3:
52768 secondByte = buf[i + 1]
52769 thirdByte = buf[i + 2]
52770 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
52771 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
52772 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
52773 codePoint = tempCodePoint
52774 }
52775 }
52776 break
52777 case 4:
52778 secondByte = buf[i + 1]
52779 thirdByte = buf[i + 2]
52780 fourthByte = buf[i + 3]
52781 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
52782 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
52783 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
52784 codePoint = tempCodePoint
52785 }
52786 }
52787 }
52788 }
52789
52790 if (codePoint === null) {
52791 // we did not generate a valid codePoint so insert a
52792 // replacement char (U+FFFD) and advance only 1 byte
52793 codePoint = 0xFFFD
52794 bytesPerSequence = 1
52795 } else if (codePoint > 0xFFFF) {
52796 // encode to utf16 (surrogate pair dance)
52797 codePoint -= 0x10000
52798 res.push(codePoint >>> 10 & 0x3FF | 0xD800)
52799 codePoint = 0xDC00 | codePoint & 0x3FF
52800 }
52801
52802 res.push(codePoint)
52803 i += bytesPerSequence
52804 }
52805
52806 return decodeCodePointsArray(res)
52807}
52808
52809// Based on http://stackoverflow.com/a/22747272/680742, the browser with
52810// the lowest limit is Chrome, with 0x10000 args.
52811// We go 1 magnitude less, for safety
52812var MAX_ARGUMENTS_LENGTH = 0x1000
52813
52814function decodeCodePointsArray (codePoints) {
52815 var len = codePoints.length
52816 if (len <= MAX_ARGUMENTS_LENGTH) {
52817 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
52818 }
52819
52820 // Decode in chunks to avoid "call stack size exceeded".
52821 var res = ''
52822 var i = 0
52823 while (i < len) {
52824 res += String.fromCharCode.apply(
52825 String,
52826 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
52827 )
52828 }
52829 return res
52830}
52831
52832function asciiSlice (buf, start, end) {
52833 var ret = ''
52834 end = Math.min(buf.length, end)
52835
52836 for (var i = start; i < end; ++i) {
52837 ret += String.fromCharCode(buf[i] & 0x7F)
52838 }
52839 return ret
52840}
52841
52842function latin1Slice (buf, start, end) {
52843 var ret = ''
52844 end = Math.min(buf.length, end)
52845
52846 for (var i = start; i < end; ++i) {
52847 ret += String.fromCharCode(buf[i])
52848 }
52849 return ret
52850}
52851
52852function hexSlice (buf, start, end) {
52853 var len = buf.length
52854
52855 if (!start || start < 0) start = 0
52856 if (!end || end < 0 || end > len) end = len
52857
52858 var out = ''
52859 for (var i = start; i < end; ++i) {
52860 out += toHex(buf[i])
52861 }
52862 return out
52863}
52864
52865function utf16leSlice (buf, start, end) {
52866 var bytes = buf.slice(start, end)
52867 var res = ''
52868 for (var i = 0; i < bytes.length; i += 2) {
52869 res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
52870 }
52871 return res
52872}
52873
52874Buffer.prototype.slice = function slice (start, end) {
52875 var len = this.length
52876 start = ~~start
52877 end = end === undefined ? len : ~~end
52878
52879 if (start < 0) {
52880 start += len
52881 if (start < 0) start = 0
52882 } else if (start > len) {
52883 start = len
52884 }
52885
52886 if (end < 0) {
52887 end += len
52888 if (end < 0) end = 0
52889 } else if (end > len) {
52890 end = len
52891 }
52892
52893 if (end < start) end = start
52894
52895 var newBuf = this.subarray(start, end)
52896 // Return an augmented `Uint8Array` instance
52897 newBuf.__proto__ = Buffer.prototype
52898 return newBuf
52899}
52900
52901/*
52902 * Need to make sure that buffer isn't trying to write out of bounds.
52903 */
52904function checkOffset (offset, ext, length) {
52905 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
52906 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
52907}
52908
52909Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
52910 offset = offset >>> 0
52911 byteLength = byteLength >>> 0
52912 if (!noAssert) checkOffset(offset, byteLength, this.length)
52913
52914 var val = this[offset]
52915 var mul = 1
52916 var i = 0
52917 while (++i < byteLength && (mul *= 0x100)) {
52918 val += this[offset + i] * mul
52919 }
52920
52921 return val
52922}
52923
52924Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
52925 offset = offset >>> 0
52926 byteLength = byteLength >>> 0
52927 if (!noAssert) {
52928 checkOffset(offset, byteLength, this.length)
52929 }
52930
52931 var val = this[offset + --byteLength]
52932 var mul = 1
52933 while (byteLength > 0 && (mul *= 0x100)) {
52934 val += this[offset + --byteLength] * mul
52935 }
52936
52937 return val
52938}
52939
52940Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
52941 offset = offset >>> 0
52942 if (!noAssert) checkOffset(offset, 1, this.length)
52943 return this[offset]
52944}
52945
52946Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
52947 offset = offset >>> 0
52948 if (!noAssert) checkOffset(offset, 2, this.length)
52949 return this[offset] | (this[offset + 1] << 8)
52950}
52951
52952Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
52953 offset = offset >>> 0
52954 if (!noAssert) checkOffset(offset, 2, this.length)
52955 return (this[offset] << 8) | this[offset + 1]
52956}
52957
52958Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
52959 offset = offset >>> 0
52960 if (!noAssert) checkOffset(offset, 4, this.length)
52961
52962 return ((this[offset]) |
52963 (this[offset + 1] << 8) |
52964 (this[offset + 2] << 16)) +
52965 (this[offset + 3] * 0x1000000)
52966}
52967
52968Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
52969 offset = offset >>> 0
52970 if (!noAssert) checkOffset(offset, 4, this.length)
52971
52972 return (this[offset] * 0x1000000) +
52973 ((this[offset + 1] << 16) |
52974 (this[offset + 2] << 8) |
52975 this[offset + 3])
52976}
52977
52978Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
52979 offset = offset >>> 0
52980 byteLength = byteLength >>> 0
52981 if (!noAssert) checkOffset(offset, byteLength, this.length)
52982
52983 var val = this[offset]
52984 var mul = 1
52985 var i = 0
52986 while (++i < byteLength && (mul *= 0x100)) {
52987 val += this[offset + i] * mul
52988 }
52989 mul *= 0x80
52990
52991 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
52992
52993 return val
52994}
52995
52996Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
52997 offset = offset >>> 0
52998 byteLength = byteLength >>> 0
52999 if (!noAssert) checkOffset(offset, byteLength, this.length)
53000
53001 var i = byteLength
53002 var mul = 1
53003 var val = this[offset + --i]
53004 while (i > 0 && (mul *= 0x100)) {
53005 val += this[offset + --i] * mul
53006 }
53007 mul *= 0x80
53008
53009 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
53010
53011 return val
53012}
53013
53014Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
53015 offset = offset >>> 0
53016 if (!noAssert) checkOffset(offset, 1, this.length)
53017 if (!(this[offset] & 0x80)) return (this[offset])
53018 return ((0xff - this[offset] + 1) * -1)
53019}
53020
53021Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
53022 offset = offset >>> 0
53023 if (!noAssert) checkOffset(offset, 2, this.length)
53024 var val = this[offset] | (this[offset + 1] << 8)
53025 return (val & 0x8000) ? val | 0xFFFF0000 : val
53026}
53027
53028Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
53029 offset = offset >>> 0
53030 if (!noAssert) checkOffset(offset, 2, this.length)
53031 var val = this[offset + 1] | (this[offset] << 8)
53032 return (val & 0x8000) ? val | 0xFFFF0000 : val
53033}
53034
53035Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
53036 offset = offset >>> 0
53037 if (!noAssert) checkOffset(offset, 4, this.length)
53038
53039 return (this[offset]) |
53040 (this[offset + 1] << 8) |
53041 (this[offset + 2] << 16) |
53042 (this[offset + 3] << 24)
53043}
53044
53045Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
53046 offset = offset >>> 0
53047 if (!noAssert) checkOffset(offset, 4, this.length)
53048
53049 return (this[offset] << 24) |
53050 (this[offset + 1] << 16) |
53051 (this[offset + 2] << 8) |
53052 (this[offset + 3])
53053}
53054
53055Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
53056 offset = offset >>> 0
53057 if (!noAssert) checkOffset(offset, 4, this.length)
53058 return ieee754.read(this, offset, true, 23, 4)
53059}
53060
53061Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
53062 offset = offset >>> 0
53063 if (!noAssert) checkOffset(offset, 4, this.length)
53064 return ieee754.read(this, offset, false, 23, 4)
53065}
53066
53067Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
53068 offset = offset >>> 0
53069 if (!noAssert) checkOffset(offset, 8, this.length)
53070 return ieee754.read(this, offset, true, 52, 8)
53071}
53072
53073Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
53074 offset = offset >>> 0
53075 if (!noAssert) checkOffset(offset, 8, this.length)
53076 return ieee754.read(this, offset, false, 52, 8)
53077}
53078
53079function checkInt (buf, value, offset, ext, max, min) {
53080 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
53081 if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
53082 if (offset + ext > buf.length) throw new RangeError('Index out of range')
53083}
53084
53085Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
53086 value = +value
53087 offset = offset >>> 0
53088 byteLength = byteLength >>> 0
53089 if (!noAssert) {
53090 var maxBytes = Math.pow(2, 8 * byteLength) - 1
53091 checkInt(this, value, offset, byteLength, maxBytes, 0)
53092 }
53093
53094 var mul = 1
53095 var i = 0
53096 this[offset] = value & 0xFF
53097 while (++i < byteLength && (mul *= 0x100)) {
53098 this[offset + i] = (value / mul) & 0xFF
53099 }
53100
53101 return offset + byteLength
53102}
53103
53104Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
53105 value = +value
53106 offset = offset >>> 0
53107 byteLength = byteLength >>> 0
53108 if (!noAssert) {
53109 var maxBytes = Math.pow(2, 8 * byteLength) - 1
53110 checkInt(this, value, offset, byteLength, maxBytes, 0)
53111 }
53112
53113 var i = byteLength - 1
53114 var mul = 1
53115 this[offset + i] = value & 0xFF
53116 while (--i >= 0 && (mul *= 0x100)) {
53117 this[offset + i] = (value / mul) & 0xFF
53118 }
53119
53120 return offset + byteLength
53121}
53122
53123Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
53124 value = +value
53125 offset = offset >>> 0
53126 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
53127 this[offset] = (value & 0xff)
53128 return offset + 1
53129}
53130
53131Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
53132 value = +value
53133 offset = offset >>> 0
53134 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
53135 this[offset] = (value & 0xff)
53136 this[offset + 1] = (value >>> 8)
53137 return offset + 2
53138}
53139
53140Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
53141 value = +value
53142 offset = offset >>> 0
53143 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
53144 this[offset] = (value >>> 8)
53145 this[offset + 1] = (value & 0xff)
53146 return offset + 2
53147}
53148
53149Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
53150 value = +value
53151 offset = offset >>> 0
53152 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
53153 this[offset + 3] = (value >>> 24)
53154 this[offset + 2] = (value >>> 16)
53155 this[offset + 1] = (value >>> 8)
53156 this[offset] = (value & 0xff)
53157 return offset + 4
53158}
53159
53160Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
53161 value = +value
53162 offset = offset >>> 0
53163 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
53164 this[offset] = (value >>> 24)
53165 this[offset + 1] = (value >>> 16)
53166 this[offset + 2] = (value >>> 8)
53167 this[offset + 3] = (value & 0xff)
53168 return offset + 4
53169}
53170
53171Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
53172 value = +value
53173 offset = offset >>> 0
53174 if (!noAssert) {
53175 var limit = Math.pow(2, (8 * byteLength) - 1)
53176
53177 checkInt(this, value, offset, byteLength, limit - 1, -limit)
53178 }
53179
53180 var i = 0
53181 var mul = 1
53182 var sub = 0
53183 this[offset] = value & 0xFF
53184 while (++i < byteLength && (mul *= 0x100)) {
53185 if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
53186 sub = 1
53187 }
53188 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
53189 }
53190
53191 return offset + byteLength
53192}
53193
53194Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
53195 value = +value
53196 offset = offset >>> 0
53197 if (!noAssert) {
53198 var limit = Math.pow(2, (8 * byteLength) - 1)
53199
53200 checkInt(this, value, offset, byteLength, limit - 1, -limit)
53201 }
53202
53203 var i = byteLength - 1
53204 var mul = 1
53205 var sub = 0
53206 this[offset + i] = value & 0xFF
53207 while (--i >= 0 && (mul *= 0x100)) {
53208 if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
53209 sub = 1
53210 }
53211 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
53212 }
53213
53214 return offset + byteLength
53215}
53216
53217Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
53218 value = +value
53219 offset = offset >>> 0
53220 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
53221 if (value < 0) value = 0xff + value + 1
53222 this[offset] = (value & 0xff)
53223 return offset + 1
53224}
53225
53226Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
53227 value = +value
53228 offset = offset >>> 0
53229 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
53230 this[offset] = (value & 0xff)
53231 this[offset + 1] = (value >>> 8)
53232 return offset + 2
53233}
53234
53235Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
53236 value = +value
53237 offset = offset >>> 0
53238 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
53239 this[offset] = (value >>> 8)
53240 this[offset + 1] = (value & 0xff)
53241 return offset + 2
53242}
53243
53244Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
53245 value = +value
53246 offset = offset >>> 0
53247 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
53248 this[offset] = (value & 0xff)
53249 this[offset + 1] = (value >>> 8)
53250 this[offset + 2] = (value >>> 16)
53251 this[offset + 3] = (value >>> 24)
53252 return offset + 4
53253}
53254
53255Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
53256 value = +value
53257 offset = offset >>> 0
53258 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
53259 if (value < 0) value = 0xffffffff + value + 1
53260 this[offset] = (value >>> 24)
53261 this[offset + 1] = (value >>> 16)
53262 this[offset + 2] = (value >>> 8)
53263 this[offset + 3] = (value & 0xff)
53264 return offset + 4
53265}
53266
53267function checkIEEE754 (buf, value, offset, ext, max, min) {
53268 if (offset + ext > buf.length) throw new RangeError('Index out of range')
53269 if (offset < 0) throw new RangeError('Index out of range')
53270}
53271
53272function writeFloat (buf, value, offset, littleEndian, noAssert) {
53273 value = +value
53274 offset = offset >>> 0
53275 if (!noAssert) {
53276 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
53277 }
53278 ieee754.write(buf, value, offset, littleEndian, 23, 4)
53279 return offset + 4
53280}
53281
53282Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
53283 return writeFloat(this, value, offset, true, noAssert)
53284}
53285
53286Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
53287 return writeFloat(this, value, offset, false, noAssert)
53288}
53289
53290function writeDouble (buf, value, offset, littleEndian, noAssert) {
53291 value = +value
53292 offset = offset >>> 0
53293 if (!noAssert) {
53294 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
53295 }
53296 ieee754.write(buf, value, offset, littleEndian, 52, 8)
53297 return offset + 8
53298}
53299
53300Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
53301 return writeDouble(this, value, offset, true, noAssert)
53302}
53303
53304Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
53305 return writeDouble(this, value, offset, false, noAssert)
53306}
53307
53308// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
53309Buffer.prototype.copy = function copy (target, targetStart, start, end) {
53310 if (!start) start = 0
53311 if (!end && end !== 0) end = this.length
53312 if (targetStart >= target.length) targetStart = target.length
53313 if (!targetStart) targetStart = 0
53314 if (end > 0 && end < start) end = start
53315
53316 // Copy 0 bytes; we're done
53317 if (end === start) return 0
53318 if (target.length === 0 || this.length === 0) return 0
53319
53320 // Fatal error conditions
53321 if (targetStart < 0) {
53322 throw new RangeError('targetStart out of bounds')
53323 }
53324 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
53325 if (end < 0) throw new RangeError('sourceEnd out of bounds')
53326
53327 // Are we oob?
53328 if (end > this.length) end = this.length
53329 if (target.length - targetStart < end - start) {
53330 end = target.length - targetStart + start
53331 }
53332
53333 var len = end - start
53334 var i
53335
53336 if (this === target && start < targetStart && targetStart < end) {
53337 // descending copy from end
53338 for (i = len - 1; i >= 0; --i) {
53339 target[i + targetStart] = this[i + start]
53340 }
53341 } else if (len < 1000) {
53342 // ascending copy from start
53343 for (i = 0; i < len; ++i) {
53344 target[i + targetStart] = this[i + start]
53345 }
53346 } else {
53347 Uint8Array.prototype.set.call(
53348 target,
53349 this.subarray(start, start + len),
53350 targetStart
53351 )
53352 }
53353
53354 return len
53355}
53356
53357// Usage:
53358// buffer.fill(number[, offset[, end]])
53359// buffer.fill(buffer[, offset[, end]])
53360// buffer.fill(string[, offset[, end]][, encoding])
53361Buffer.prototype.fill = function fill (val, start, end, encoding) {
53362 // Handle string cases:
53363 if (typeof val === 'string') {
53364 if (typeof start === 'string') {
53365 encoding = start
53366 start = 0
53367 end = this.length
53368 } else if (typeof end === 'string') {
53369 encoding = end
53370 end = this.length
53371 }
53372 if (val.length === 1) {
53373 var code = val.charCodeAt(0)
53374 if (code < 256) {
53375 val = code
53376 }
53377 }
53378 if (encoding !== undefined && typeof encoding !== 'string') {
53379 throw new TypeError('encoding must be a string')
53380 }
53381 if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
53382 throw new TypeError('Unknown encoding: ' + encoding)
53383 }
53384 } else if (typeof val === 'number') {
53385 val = val & 255
53386 }
53387
53388 // Invalid ranges are not set to a default, so can range check early.
53389 if (start < 0 || this.length < start || this.length < end) {
53390 throw new RangeError('Out of range index')
53391 }
53392
53393 if (end <= start) {
53394 return this
53395 }
53396
53397 start = start >>> 0
53398 end = end === undefined ? this.length : end >>> 0
53399
53400 if (!val) val = 0
53401
53402 var i
53403 if (typeof val === 'number') {
53404 for (i = start; i < end; ++i) {
53405 this[i] = val
53406 }
53407 } else {
53408 var bytes = Buffer.isBuffer(val)
53409 ? val
53410 : new Buffer(val, encoding)
53411 var len = bytes.length
53412 for (i = 0; i < end - start; ++i) {
53413 this[i + start] = bytes[i % len]
53414 }
53415 }
53416
53417 return this
53418}
53419
53420// HELPER FUNCTIONS
53421// ================
53422
53423var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
53424
53425function base64clean (str) {
53426 // Node strips out invalid characters like \n and \t from the string, base64-js does not
53427 str = stringtrim(str).replace(INVALID_BASE64_RE, '')
53428 // Node converts strings with length < 2 to ''
53429 if (str.length < 2) return ''
53430 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
53431 while (str.length % 4 !== 0) {
53432 str = str + '='
53433 }
53434 return str
53435}
53436
53437function stringtrim (str) {
53438 if (str.trim) return str.trim()
53439 return str.replace(/^\s+|\s+$/g, '')
53440}
53441
53442function toHex (n) {
53443 if (n < 16) return '0' + n.toString(16)
53444 return n.toString(16)
53445}
53446
53447function utf8ToBytes (string, units) {
53448 units = units || Infinity
53449 var codePoint
53450 var length = string.length
53451 var leadSurrogate = null
53452 var bytes = []
53453
53454 for (var i = 0; i < length; ++i) {
53455 codePoint = string.charCodeAt(i)
53456
53457 // is surrogate component
53458 if (codePoint > 0xD7FF && codePoint < 0xE000) {
53459 // last char was a lead
53460 if (!leadSurrogate) {
53461 // no lead yet
53462 if (codePoint > 0xDBFF) {
53463 // unexpected trail
53464 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
53465 continue
53466 } else if (i + 1 === length) {
53467 // unpaired lead
53468 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
53469 continue
53470 }
53471
53472 // valid lead
53473 leadSurrogate = codePoint
53474
53475 continue
53476 }
53477
53478 // 2 leads in a row
53479 if (codePoint < 0xDC00) {
53480 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
53481 leadSurrogate = codePoint
53482 continue
53483 }
53484
53485 // valid surrogate pair
53486 codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
53487 } else if (leadSurrogate) {
53488 // valid bmp char, but last char was a lead
53489 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
53490 }
53491
53492 leadSurrogate = null
53493
53494 // encode utf8
53495 if (codePoint < 0x80) {
53496 if ((units -= 1) < 0) break
53497 bytes.push(codePoint)
53498 } else if (codePoint < 0x800) {
53499 if ((units -= 2) < 0) break
53500 bytes.push(
53501 codePoint >> 0x6 | 0xC0,
53502 codePoint & 0x3F | 0x80
53503 )
53504 } else if (codePoint < 0x10000) {
53505 if ((units -= 3) < 0) break
53506 bytes.push(
53507 codePoint >> 0xC | 0xE0,
53508 codePoint >> 0x6 & 0x3F | 0x80,
53509 codePoint & 0x3F | 0x80
53510 )
53511 } else if (codePoint < 0x110000) {
53512 if ((units -= 4) < 0) break
53513 bytes.push(
53514 codePoint >> 0x12 | 0xF0,
53515 codePoint >> 0xC & 0x3F | 0x80,
53516 codePoint >> 0x6 & 0x3F | 0x80,
53517 codePoint & 0x3F | 0x80
53518 )
53519 } else {
53520 throw new Error('Invalid code point')
53521 }
53522 }
53523
53524 return bytes
53525}
53526
53527function asciiToBytes (str) {
53528 var byteArray = []
53529 for (var i = 0; i < str.length; ++i) {
53530 // Node's code seems to be doing this and not & 0x7F..
53531 byteArray.push(str.charCodeAt(i) & 0xFF)
53532 }
53533 return byteArray
53534}
53535
53536function utf16leToBytes (str, units) {
53537 var c, hi, lo
53538 var byteArray = []
53539 for (var i = 0; i < str.length; ++i) {
53540 if ((units -= 2) < 0) break
53541
53542 c = str.charCodeAt(i)
53543 hi = c >> 8
53544 lo = c % 256
53545 byteArray.push(lo)
53546 byteArray.push(hi)
53547 }
53548
53549 return byteArray
53550}
53551
53552function base64ToBytes (str) {
53553 return base64.toByteArray(base64clean(str))
53554}
53555
53556function blitBuffer (src, dst, offset, length) {
53557 for (var i = 0; i < length; ++i) {
53558 if ((i + offset >= dst.length) || (i >= src.length)) break
53559 dst[i + offset] = src[i]
53560 }
53561 return i
53562}
53563
53564function isnan (val) {
53565 return val !== val // eslint-disable-line no-self-compare
53566}
53567
53568},{"base64-js":2,"ieee754":8}],6:[function(require,module,exports){
53569(function (Buffer){
53570// Copyright Joyent, Inc. and other Node contributors.
53571//
53572// Permission is hereby granted, free of charge, to any person obtaining a
53573// copy of this software and associated documentation files (the
53574// "Software"), to deal in the Software without restriction, including
53575// without limitation the rights to use, copy, modify, merge, publish,
53576// distribute, sublicense, and/or sell copies of the Software, and to permit
53577// persons to whom the Software is furnished to do so, subject to the
53578// following conditions:
53579//
53580// The above copyright notice and this permission notice shall be included
53581// in all copies or substantial portions of the Software.
53582//
53583// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
53584// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
53585// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
53586// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
53587// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
53588// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
53589// USE OR OTHER DEALINGS IN THE SOFTWARE.
53590
53591// NOTE: These type checking functions intentionally don't use `instanceof`
53592// because it is fragile and can be easily faked with `Object.create()`.
53593
53594function isArray(arg) {
53595 if (Array.isArray) {
53596 return Array.isArray(arg);
53597 }
53598 return objectToString(arg) === '[object Array]';
53599}
53600exports.isArray = isArray;
53601
53602function isBoolean(arg) {
53603 return typeof arg === 'boolean';
53604}
53605exports.isBoolean = isBoolean;
53606
53607function isNull(arg) {
53608 return arg === null;
53609}
53610exports.isNull = isNull;
53611
53612function isNullOrUndefined(arg) {
53613 return arg == null;
53614}
53615exports.isNullOrUndefined = isNullOrUndefined;
53616
53617function isNumber(arg) {
53618 return typeof arg === 'number';
53619}
53620exports.isNumber = isNumber;
53621
53622function isString(arg) {
53623 return typeof arg === 'string';
53624}
53625exports.isString = isString;
53626
53627function isSymbol(arg) {
53628 return typeof arg === 'symbol';
53629}
53630exports.isSymbol = isSymbol;
53631
53632function isUndefined(arg) {
53633 return arg === void 0;
53634}
53635exports.isUndefined = isUndefined;
53636
53637function isRegExp(re) {
53638 return objectToString(re) === '[object RegExp]';
53639}
53640exports.isRegExp = isRegExp;
53641
53642function isObject(arg) {
53643 return typeof arg === 'object' && arg !== null;
53644}
53645exports.isObject = isObject;
53646
53647function isDate(d) {
53648 return objectToString(d) === '[object Date]';
53649}
53650exports.isDate = isDate;
53651
53652function isError(e) {
53653 return (objectToString(e) === '[object Error]' || e instanceof Error);
53654}
53655exports.isError = isError;
53656
53657function isFunction(arg) {
53658 return typeof arg === 'function';
53659}
53660exports.isFunction = isFunction;
53661
53662function isPrimitive(arg) {
53663 return arg === null ||
53664 typeof arg === 'boolean' ||
53665 typeof arg === 'number' ||
53666 typeof arg === 'string' ||
53667 typeof arg === 'symbol' || // ES6 symbol
53668 typeof arg === 'undefined';
53669}
53670exports.isPrimitive = isPrimitive;
53671
53672exports.isBuffer = Buffer.isBuffer;
53673
53674function objectToString(o) {
53675 return Object.prototype.toString.call(o);
53676}
53677
53678}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
53679},{"../../is-buffer/index.js":10}],7:[function(require,module,exports){
53680// Copyright Joyent, Inc. and other Node contributors.
53681//
53682// Permission is hereby granted, free of charge, to any person obtaining a
53683// copy of this software and associated documentation files (the
53684// "Software"), to deal in the Software without restriction, including
53685// without limitation the rights to use, copy, modify, merge, publish,
53686// distribute, sublicense, and/or sell copies of the Software, and to permit
53687// persons to whom the Software is furnished to do so, subject to the
53688// following conditions:
53689//
53690// The above copyright notice and this permission notice shall be included
53691// in all copies or substantial portions of the Software.
53692//
53693// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
53694// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
53695// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
53696// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
53697// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
53698// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
53699// USE OR OTHER DEALINGS IN THE SOFTWARE.
53700
53701function EventEmitter() {
53702 this._events = this._events || {};
53703 this._maxListeners = this._maxListeners || undefined;
53704}
53705module.exports = EventEmitter;
53706
53707// Backwards-compat with node 0.10.x
53708EventEmitter.EventEmitter = EventEmitter;
53709
53710EventEmitter.prototype._events = undefined;
53711EventEmitter.prototype._maxListeners = undefined;
53712
53713// By default EventEmitters will print a warning if more than 10 listeners are
53714// added to it. This is a useful default which helps finding memory leaks.
53715EventEmitter.defaultMaxListeners = 10;
53716
53717// Obviously not all Emitters should be limited to 10. This function allows
53718// that to be increased. Set to zero for unlimited.
53719EventEmitter.prototype.setMaxListeners = function(n) {
53720 if (!isNumber(n) || n < 0 || isNaN(n))
53721 throw TypeError('n must be a positive number');
53722 this._maxListeners = n;
53723 return this;
53724};
53725
53726EventEmitter.prototype.emit = function(type) {
53727 var er, handler, len, args, i, listeners;
53728
53729 if (!this._events)
53730 this._events = {};
53731
53732 // If there is no 'error' event listener then throw.
53733 if (type === 'error') {
53734 if (!this._events.error ||
53735 (isObject(this._events.error) && !this._events.error.length)) {
53736 er = arguments[1];
53737 if (er instanceof Error) {
53738 throw er; // Unhandled 'error' event
53739 } else {
53740 // At least give some kind of context to the user
53741 var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
53742 err.context = er;
53743 throw err;
53744 }
53745 }
53746 }
53747
53748 handler = this._events[type];
53749
53750 if (isUndefined(handler))
53751 return false;
53752
53753 if (isFunction(handler)) {
53754 switch (arguments.length) {
53755 // fast cases
53756 case 1:
53757 handler.call(this);
53758 break;
53759 case 2:
53760 handler.call(this, arguments[1]);
53761 break;
53762 case 3:
53763 handler.call(this, arguments[1], arguments[2]);
53764 break;
53765 // slower
53766 default:
53767 args = Array.prototype.slice.call(arguments, 1);
53768 handler.apply(this, args);
53769 }
53770 } else if (isObject(handler)) {
53771 args = Array.prototype.slice.call(arguments, 1);
53772 listeners = handler.slice();
53773 len = listeners.length;
53774 for (i = 0; i < len; i++)
53775 listeners[i].apply(this, args);
53776 }
53777
53778 return true;
53779};
53780
53781EventEmitter.prototype.addListener = function(type, listener) {
53782 var m;
53783
53784 if (!isFunction(listener))
53785 throw TypeError('listener must be a function');
53786
53787 if (!this._events)
53788 this._events = {};
53789
53790 // To avoid recursion in the case that type === "newListener"! Before
53791 // adding it to the listeners, first emit "newListener".
53792 if (this._events.newListener)
53793 this.emit('newListener', type,
53794 isFunction(listener.listener) ?
53795 listener.listener : listener);
53796
53797 if (!this._events[type])
53798 // Optimize the case of one listener. Don't need the extra array object.
53799 this._events[type] = listener;
53800 else if (isObject(this._events[type]))
53801 // If we've already got an array, just append.
53802 this._events[type].push(listener);
53803 else
53804 // Adding the second element, need to change to array.
53805 this._events[type] = [this._events[type], listener];
53806
53807 // Check for listener leak
53808 if (isObject(this._events[type]) && !this._events[type].warned) {
53809 if (!isUndefined(this._maxListeners)) {
53810 m = this._maxListeners;
53811 } else {
53812 m = EventEmitter.defaultMaxListeners;
53813 }
53814
53815 if (m && m > 0 && this._events[type].length > m) {
53816 this._events[type].warned = true;
53817 console.error('(node) warning: possible EventEmitter memory ' +
53818 'leak detected. %d listeners added. ' +
53819 'Use emitter.setMaxListeners() to increase limit.',
53820 this._events[type].length);
53821 if (typeof console.trace === 'function') {
53822 // not supported in IE 10
53823 console.trace();
53824 }
53825 }
53826 }
53827
53828 return this;
53829};
53830
53831EventEmitter.prototype.on = EventEmitter.prototype.addListener;
53832
53833EventEmitter.prototype.once = function(type, listener) {
53834 if (!isFunction(listener))
53835 throw TypeError('listener must be a function');
53836
53837 var fired = false;
53838
53839 function g() {
53840 this.removeListener(type, g);
53841
53842 if (!fired) {
53843 fired = true;
53844 listener.apply(this, arguments);
53845 }
53846 }
53847
53848 g.listener = listener;
53849 this.on(type, g);
53850
53851 return this;
53852};
53853
53854// emits a 'removeListener' event iff the listener was removed
53855EventEmitter.prototype.removeListener = function(type, listener) {
53856 var list, position, length, i;
53857
53858 if (!isFunction(listener))
53859 throw TypeError('listener must be a function');
53860
53861 if (!this._events || !this._events[type])
53862 return this;
53863
53864 list = this._events[type];
53865 length = list.length;
53866 position = -1;
53867
53868 if (list === listener ||
53869 (isFunction(list.listener) && list.listener === listener)) {
53870 delete this._events[type];
53871 if (this._events.removeListener)
53872 this.emit('removeListener', type, listener);
53873
53874 } else if (isObject(list)) {
53875 for (i = length; i-- > 0;) {
53876 if (list[i] === listener ||
53877 (list[i].listener && list[i].listener === listener)) {
53878 position = i;
53879 break;
53880 }
53881 }
53882
53883 if (position < 0)
53884 return this;
53885
53886 if (list.length === 1) {
53887 list.length = 0;
53888 delete this._events[type];
53889 } else {
53890 list.splice(position, 1);
53891 }
53892
53893 if (this._events.removeListener)
53894 this.emit('removeListener', type, listener);
53895 }
53896
53897 return this;
53898};
53899
53900EventEmitter.prototype.removeAllListeners = function(type) {
53901 var key, listeners;
53902
53903 if (!this._events)
53904 return this;
53905
53906 // not listening for removeListener, no need to emit
53907 if (!this._events.removeListener) {
53908 if (arguments.length === 0)
53909 this._events = {};
53910 else if (this._events[type])
53911 delete this._events[type];
53912 return this;
53913 }
53914
53915 // emit removeListener for all listeners on all events
53916 if (arguments.length === 0) {
53917 for (key in this._events) {
53918 if (key === 'removeListener') continue;
53919 this.removeAllListeners(key);
53920 }
53921 this.removeAllListeners('removeListener');
53922 this._events = {};
53923 return this;
53924 }
53925
53926 listeners = this._events[type];
53927
53928 if (isFunction(listeners)) {
53929 this.removeListener(type, listeners);
53930 } else if (listeners) {
53931 // LIFO order
53932 while (listeners.length)
53933 this.removeListener(type, listeners[listeners.length - 1]);
53934 }
53935 delete this._events[type];
53936
53937 return this;
53938};
53939
53940EventEmitter.prototype.listeners = function(type) {
53941 var ret;
53942 if (!this._events || !this._events[type])
53943 ret = [];
53944 else if (isFunction(this._events[type]))
53945 ret = [this._events[type]];
53946 else
53947 ret = this._events[type].slice();
53948 return ret;
53949};
53950
53951EventEmitter.prototype.listenerCount = function(type) {
53952 if (this._events) {
53953 var evlistener = this._events[type];
53954
53955 if (isFunction(evlistener))
53956 return 1;
53957 else if (evlistener)
53958 return evlistener.length;
53959 }
53960 return 0;
53961};
53962
53963EventEmitter.listenerCount = function(emitter, type) {
53964 return emitter.listenerCount(type);
53965};
53966
53967function isFunction(arg) {
53968 return typeof arg === 'function';
53969}
53970
53971function isNumber(arg) {
53972 return typeof arg === 'number';
53973}
53974
53975function isObject(arg) {
53976 return typeof arg === 'object' && arg !== null;
53977}
53978
53979function isUndefined(arg) {
53980 return arg === void 0;
53981}
53982
53983},{}],8:[function(require,module,exports){
53984exports.read = function (buffer, offset, isLE, mLen, nBytes) {
53985 var e, m
53986 var eLen = nBytes * 8 - mLen - 1
53987 var eMax = (1 << eLen) - 1
53988 var eBias = eMax >> 1
53989 var nBits = -7
53990 var i = isLE ? (nBytes - 1) : 0
53991 var d = isLE ? -1 : 1
53992 var s = buffer[offset + i]
53993
53994 i += d
53995
53996 e = s & ((1 << (-nBits)) - 1)
53997 s >>= (-nBits)
53998 nBits += eLen
53999 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
54000
54001 m = e & ((1 << (-nBits)) - 1)
54002 e >>= (-nBits)
54003 nBits += mLen
54004 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
54005
54006 if (e === 0) {
54007 e = 1 - eBias
54008 } else if (e === eMax) {
54009 return m ? NaN : ((s ? -1 : 1) * Infinity)
54010 } else {
54011 m = m + Math.pow(2, mLen)
54012 e = e - eBias
54013 }
54014 return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
54015}
54016
54017exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
54018 var e, m, c
54019 var eLen = nBytes * 8 - mLen - 1
54020 var eMax = (1 << eLen) - 1
54021 var eBias = eMax >> 1
54022 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
54023 var i = isLE ? 0 : (nBytes - 1)
54024 var d = isLE ? 1 : -1
54025 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
54026
54027 value = Math.abs(value)
54028
54029 if (isNaN(value) || value === Infinity) {
54030 m = isNaN(value) ? 1 : 0
54031 e = eMax
54032 } else {
54033 e = Math.floor(Math.log(value) / Math.LN2)
54034 if (value * (c = Math.pow(2, -e)) < 1) {
54035 e--
54036 c *= 2
54037 }
54038 if (e + eBias >= 1) {
54039 value += rt / c
54040 } else {
54041 value += rt * Math.pow(2, 1 - eBias)
54042 }
54043 if (value * c >= 2) {
54044 e++
54045 c /= 2
54046 }
54047
54048 if (e + eBias >= eMax) {
54049 m = 0
54050 e = eMax
54051 } else if (e + eBias >= 1) {
54052 m = (value * c - 1) * Math.pow(2, mLen)
54053 e = e + eBias
54054 } else {
54055 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
54056 e = 0
54057 }
54058 }
54059
54060 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
54061
54062 e = (e << mLen) | m
54063 eLen += mLen
54064 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
54065
54066 buffer[offset + i - d] |= s * 128
54067}
54068
54069},{}],9:[function(require,module,exports){
54070if (typeof Object.create === 'function') {
54071 // implementation from standard node.js 'util' module
54072 module.exports = function inherits(ctor, superCtor) {
54073 ctor.super_ = superCtor
54074 ctor.prototype = Object.create(superCtor.prototype, {
54075 constructor: {
54076 value: ctor,
54077 enumerable: false,
54078 writable: true,
54079 configurable: true
54080 }
54081 });
54082 };
54083} else {
54084 // old school shim for old browsers
54085 module.exports = function inherits(ctor, superCtor) {
54086 ctor.super_ = superCtor
54087 var TempCtor = function () {}
54088 TempCtor.prototype = superCtor.prototype
54089 ctor.prototype = new TempCtor()
54090 ctor.prototype.constructor = ctor
54091 }
54092}
54093
54094},{}],10:[function(require,module,exports){
54095/*!
54096 * Determine if an object is a Buffer
54097 *
54098 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
54099 * @license MIT
54100 */
54101
54102// The _isBuffer check is for Safari 5-7 support, because it's missing
54103// Object.prototype.constructor. Remove this eventually
54104module.exports = function (obj) {
54105 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
54106}
54107
54108function isBuffer (obj) {
54109 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
54110}
54111
54112// For Node v0.10 support. Remove this eventually.
54113function isSlowBuffer (obj) {
54114 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
54115}
54116
54117},{}],11:[function(require,module,exports){
54118var toString = {}.toString;
54119
54120module.exports = Array.isArray || function (arr) {
54121 return toString.call(arr) == '[object Array]';
54122};
54123
54124},{}],12:[function(require,module,exports){
54125(function (process){
54126'use strict';
54127
54128if (!process.version ||
54129 process.version.indexOf('v0.') === 0 ||
54130 process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
54131 module.exports = nextTick;
54132} else {
54133 module.exports = process.nextTick;
54134}
54135
54136function nextTick(fn, arg1, arg2, arg3) {
54137 if (typeof fn !== 'function') {
54138 throw new TypeError('"callback" argument must be a function');
54139 }
54140 var len = arguments.length;
54141 var args, i;
54142 switch (len) {
54143 case 0:
54144 case 1:
54145 return process.nextTick(fn);
54146 case 2:
54147 return process.nextTick(function afterTickOne() {
54148 fn.call(null, arg1);
54149 });
54150 case 3:
54151 return process.nextTick(function afterTickTwo() {
54152 fn.call(null, arg1, arg2);
54153 });
54154 case 4:
54155 return process.nextTick(function afterTickThree() {
54156 fn.call(null, arg1, arg2, arg3);
54157 });
54158 default:
54159 args = new Array(len - 1);
54160 i = 0;
54161 while (i < args.length) {
54162 args[i++] = arguments[i];
54163 }
54164 return process.nextTick(function afterTick() {
54165 fn.apply(null, args);
54166 });
54167 }
54168}
54169
54170}).call(this,require('_process'))
54171},{"_process":13}],13:[function(require,module,exports){
54172// shim for using process in browser
54173var process = module.exports = {};
54174
54175// cached from whatever global is present so that test runners that stub it
54176// don't break things. But we need to wrap it in a try catch in case it is
54177// wrapped in strict mode code which doesn't define any globals. It's inside a
54178// function because try/catches deoptimize in certain engines.
54179
54180var cachedSetTimeout;
54181var cachedClearTimeout;
54182
54183function defaultSetTimout() {
54184 throw new Error('setTimeout has not been defined');
54185}
54186function defaultClearTimeout () {
54187 throw new Error('clearTimeout has not been defined');
54188}
54189(function () {
54190 try {
54191 if (typeof setTimeout === 'function') {
54192 cachedSetTimeout = setTimeout;
54193 } else {
54194 cachedSetTimeout = defaultSetTimout;
54195 }
54196 } catch (e) {
54197 cachedSetTimeout = defaultSetTimout;
54198 }
54199 try {
54200 if (typeof clearTimeout === 'function') {
54201 cachedClearTimeout = clearTimeout;
54202 } else {
54203 cachedClearTimeout = defaultClearTimeout;
54204 }
54205 } catch (e) {
54206 cachedClearTimeout = defaultClearTimeout;
54207 }
54208} ())
54209function runTimeout(fun) {
54210 if (cachedSetTimeout === setTimeout) {
54211 //normal enviroments in sane situations
54212 return setTimeout(fun, 0);
54213 }
54214 // if setTimeout wasn't available but was latter defined
54215 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
54216 cachedSetTimeout = setTimeout;
54217 return setTimeout(fun, 0);
54218 }
54219 try {
54220 // when when somebody has screwed with setTimeout but no I.E. maddness
54221 return cachedSetTimeout(fun, 0);
54222 } catch(e){
54223 try {
54224 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
54225 return cachedSetTimeout.call(null, fun, 0);
54226 } catch(e){
54227 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
54228 return cachedSetTimeout.call(this, fun, 0);
54229 }
54230 }
54231
54232
54233}
54234function runClearTimeout(marker) {
54235 if (cachedClearTimeout === clearTimeout) {
54236 //normal enviroments in sane situations
54237 return clearTimeout(marker);
54238 }
54239 // if clearTimeout wasn't available but was latter defined
54240 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
54241 cachedClearTimeout = clearTimeout;
54242 return clearTimeout(marker);
54243 }
54244 try {
54245 // when when somebody has screwed with setTimeout but no I.E. maddness
54246 return cachedClearTimeout(marker);
54247 } catch (e){
54248 try {
54249 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
54250 return cachedClearTimeout.call(null, marker);
54251 } catch (e){
54252 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
54253 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
54254 return cachedClearTimeout.call(this, marker);
54255 }
54256 }
54257
54258
54259
54260}
54261var queue = [];
54262var draining = false;
54263var currentQueue;
54264var queueIndex = -1;
54265
54266function cleanUpNextTick() {
54267 if (!draining || !currentQueue) {
54268 return;
54269 }
54270 draining = false;
54271 if (currentQueue.length) {
54272 queue = currentQueue.concat(queue);
54273 } else {
54274 queueIndex = -1;
54275 }
54276 if (queue.length) {
54277 drainQueue();
54278 }
54279}
54280
54281function drainQueue() {
54282 if (draining) {
54283 return;
54284 }
54285 var timeout = runTimeout(cleanUpNextTick);
54286 draining = true;
54287
54288 var len = queue.length;
54289 while(len) {
54290 currentQueue = queue;
54291 queue = [];
54292 while (++queueIndex < len) {
54293 if (currentQueue) {
54294 currentQueue[queueIndex].run();
54295 }
54296 }
54297 queueIndex = -1;
54298 len = queue.length;
54299 }
54300 currentQueue = null;
54301 draining = false;
54302 runClearTimeout(timeout);
54303}
54304
54305process.nextTick = function (fun) {
54306 var args = new Array(arguments.length - 1);
54307 if (arguments.length > 1) {
54308 for (var i = 1; i < arguments.length; i++) {
54309 args[i - 1] = arguments[i];
54310 }
54311 }
54312 queue.push(new Item(fun, args));
54313 if (queue.length === 1 && !draining) {
54314 runTimeout(drainQueue);
54315 }
54316};
54317
54318// v8 likes predictible objects
54319function Item(fun, array) {
54320 this.fun = fun;
54321 this.array = array;
54322}
54323Item.prototype.run = function () {
54324 this.fun.apply(null, this.array);
54325};
54326process.title = 'browser';
54327process.browser = true;
54328process.env = {};
54329process.argv = [];
54330process.version = ''; // empty string to avoid regexp issues
54331process.versions = {};
54332
54333function noop() {}
54334
54335process.on = noop;
54336process.addListener = noop;
54337process.once = noop;
54338process.off = noop;
54339process.removeListener = noop;
54340process.removeAllListeners = noop;
54341process.emit = noop;
54342
54343process.binding = function (name) {
54344 throw new Error('process.binding is not supported');
54345};
54346
54347process.cwd = function () { return '/' };
54348process.chdir = function (dir) {
54349 throw new Error('process.chdir is not supported');
54350};
54351process.umask = function() { return 0; };
54352
54353},{}],14:[function(require,module,exports){
54354module.exports = require("./lib/_stream_duplex.js")
54355
54356},{"./lib/_stream_duplex.js":15}],15:[function(require,module,exports){
54357// a duplex stream is just a stream that is both readable and writable.
54358// Since JS doesn't have multiple prototypal inheritance, this class
54359// prototypally inherits from Readable, and then parasitically from
54360// Writable.
54361
54362'use strict';
54363
54364/*<replacement>*/
54365
54366var objectKeys = Object.keys || function (obj) {
54367 var keys = [];
54368 for (var key in obj) {
54369 keys.push(key);
54370 }return keys;
54371};
54372/*</replacement>*/
54373
54374module.exports = Duplex;
54375
54376/*<replacement>*/
54377var processNextTick = require('process-nextick-args');
54378/*</replacement>*/
54379
54380/*<replacement>*/
54381var util = require('core-util-is');
54382util.inherits = require('inherits');
54383/*</replacement>*/
54384
54385var Readable = require('./_stream_readable');
54386var Writable = require('./_stream_writable');
54387
54388util.inherits(Duplex, Readable);
54389
54390var keys = objectKeys(Writable.prototype);
54391for (var v = 0; v < keys.length; v++) {
54392 var method = keys[v];
54393 if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
54394}
54395
54396function Duplex(options) {
54397 if (!(this instanceof Duplex)) return new Duplex(options);
54398
54399 Readable.call(this, options);
54400 Writable.call(this, options);
54401
54402 if (options && options.readable === false) this.readable = false;
54403
54404 if (options && options.writable === false) this.writable = false;
54405
54406 this.allowHalfOpen = true;
54407 if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
54408
54409 this.once('end', onend);
54410}
54411
54412// the no-half-open enforcer
54413function onend() {
54414 // if we allow half-open state, or if the writable side ended,
54415 // then we're ok.
54416 if (this.allowHalfOpen || this._writableState.ended) return;
54417
54418 // no more data can be written.
54419 // But allow more writes to happen in this tick.
54420 processNextTick(onEndNT, this);
54421}
54422
54423function onEndNT(self) {
54424 self.end();
54425}
54426
54427function forEach(xs, f) {
54428 for (var i = 0, l = xs.length; i < l; i++) {
54429 f(xs[i], i);
54430 }
54431}
54432},{"./_stream_readable":17,"./_stream_writable":19,"core-util-is":6,"inherits":9,"process-nextick-args":12}],16:[function(require,module,exports){
54433// a passthrough stream.
54434// basically just the most minimal sort of Transform stream.
54435// Every written chunk gets output as-is.
54436
54437'use strict';
54438
54439module.exports = PassThrough;
54440
54441var Transform = require('./_stream_transform');
54442
54443/*<replacement>*/
54444var util = require('core-util-is');
54445util.inherits = require('inherits');
54446/*</replacement>*/
54447
54448util.inherits(PassThrough, Transform);
54449
54450function PassThrough(options) {
54451 if (!(this instanceof PassThrough)) return new PassThrough(options);
54452
54453 Transform.call(this, options);
54454}
54455
54456PassThrough.prototype._transform = function (chunk, encoding, cb) {
54457 cb(null, chunk);
54458};
54459},{"./_stream_transform":18,"core-util-is":6,"inherits":9}],17:[function(require,module,exports){
54460(function (process){
54461'use strict';
54462
54463module.exports = Readable;
54464
54465/*<replacement>*/
54466var processNextTick = require('process-nextick-args');
54467/*</replacement>*/
54468
54469/*<replacement>*/
54470var isArray = require('isarray');
54471/*</replacement>*/
54472
54473/*<replacement>*/
54474var Duplex;
54475/*</replacement>*/
54476
54477Readable.ReadableState = ReadableState;
54478
54479/*<replacement>*/
54480var EE = require('events').EventEmitter;
54481
54482var EElistenerCount = function (emitter, type) {
54483 return emitter.listeners(type).length;
54484};
54485/*</replacement>*/
54486
54487/*<replacement>*/
54488var Stream;
54489(function () {
54490 try {
54491 Stream = require('st' + 'ream');
54492 } catch (_) {} finally {
54493 if (!Stream) Stream = require('events').EventEmitter;
54494 }
54495})();
54496/*</replacement>*/
54497
54498var Buffer = require('buffer').Buffer;
54499/*<replacement>*/
54500var bufferShim = require('buffer-shims');
54501/*</replacement>*/
54502
54503/*<replacement>*/
54504var util = require('core-util-is');
54505util.inherits = require('inherits');
54506/*</replacement>*/
54507
54508/*<replacement>*/
54509var debugUtil = require('util');
54510var debug = void 0;
54511if (debugUtil && debugUtil.debuglog) {
54512 debug = debugUtil.debuglog('stream');
54513} else {
54514 debug = function () {};
54515}
54516/*</replacement>*/
54517
54518var BufferList = require('./internal/streams/BufferList');
54519var StringDecoder;
54520
54521util.inherits(Readable, Stream);
54522
54523function prependListener(emitter, event, fn) {
54524 // Sadly this is not cacheable as some libraries bundle their own
54525 // event emitter implementation with them.
54526 if (typeof emitter.prependListener === 'function') {
54527 return emitter.prependListener(event, fn);
54528 } else {
54529 // This is a hack to make sure that our error handler is attached before any
54530 // userland ones. NEVER DO THIS. This is here only because this code needs
54531 // to continue to work with older versions of Node.js that do not include
54532 // the prependListener() method. The goal is to eventually remove this hack.
54533 if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
54534 }
54535}
54536
54537function ReadableState(options, stream) {
54538 Duplex = Duplex || require('./_stream_duplex');
54539
54540 options = options || {};
54541
54542 // object stream flag. Used to make read(n) ignore n and to
54543 // make all the buffer merging and length checks go away
54544 this.objectMode = !!options.objectMode;
54545
54546 if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
54547
54548 // the point at which it stops calling _read() to fill the buffer
54549 // Note: 0 is a valid value, means "don't call _read preemptively ever"
54550 var hwm = options.highWaterMark;
54551 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
54552 this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
54553
54554 // cast to ints.
54555 this.highWaterMark = ~ ~this.highWaterMark;
54556
54557 // A linked list is used to store data chunks instead of an array because the
54558 // linked list can remove elements from the beginning faster than
54559 // array.shift()
54560 this.buffer = new BufferList();
54561 this.length = 0;
54562 this.pipes = null;
54563 this.pipesCount = 0;
54564 this.flowing = null;
54565 this.ended = false;
54566 this.endEmitted = false;
54567 this.reading = false;
54568
54569 // a flag to be able to tell if the onwrite cb is called immediately,
54570 // or on a later tick. We set this to true at first, because any
54571 // actions that shouldn't happen until "later" should generally also
54572 // not happen before the first write call.
54573 this.sync = true;
54574
54575 // whenever we return null, then we set a flag to say
54576 // that we're awaiting a 'readable' event emission.
54577 this.needReadable = false;
54578 this.emittedReadable = false;
54579 this.readableListening = false;
54580 this.resumeScheduled = false;
54581
54582 // Crypto is kind of old and crusty. Historically, its default string
54583 // encoding is 'binary' so we have to make this configurable.
54584 // Everything else in the universe uses 'utf8', though.
54585 this.defaultEncoding = options.defaultEncoding || 'utf8';
54586
54587 // when piping, we only care about 'readable' events that happen
54588 // after read()ing all the bytes and not getting any pushback.
54589 this.ranOut = false;
54590
54591 // the number of writers that are awaiting a drain event in .pipe()s
54592 this.awaitDrain = 0;
54593
54594 // if true, a maybeReadMore has been scheduled
54595 this.readingMore = false;
54596
54597 this.decoder = null;
54598 this.encoding = null;
54599 if (options.encoding) {
54600 if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
54601 this.decoder = new StringDecoder(options.encoding);
54602 this.encoding = options.encoding;
54603 }
54604}
54605
54606function Readable(options) {
54607 Duplex = Duplex || require('./_stream_duplex');
54608
54609 if (!(this instanceof Readable)) return new Readable(options);
54610
54611 this._readableState = new ReadableState(options, this);
54612
54613 // legacy
54614 this.readable = true;
54615
54616 if (options && typeof options.read === 'function') this._read = options.read;
54617
54618 Stream.call(this);
54619}
54620
54621// Manually shove something into the read() buffer.
54622// This returns true if the highWaterMark has not been hit yet,
54623// similar to how Writable.write() returns true if you should
54624// write() some more.
54625Readable.prototype.push = function (chunk, encoding) {
54626 var state = this._readableState;
54627
54628 if (!state.objectMode && typeof chunk === 'string') {
54629 encoding = encoding || state.defaultEncoding;
54630 if (encoding !== state.encoding) {
54631 chunk = bufferShim.from(chunk, encoding);
54632 encoding = '';
54633 }
54634 }
54635
54636 return readableAddChunk(this, state, chunk, encoding, false);
54637};
54638
54639// Unshift should *always* be something directly out of read()
54640Readable.prototype.unshift = function (chunk) {
54641 var state = this._readableState;
54642 return readableAddChunk(this, state, chunk, '', true);
54643};
54644
54645Readable.prototype.isPaused = function () {
54646 return this._readableState.flowing === false;
54647};
54648
54649function readableAddChunk(stream, state, chunk, encoding, addToFront) {
54650 var er = chunkInvalid(state, chunk);
54651 if (er) {
54652 stream.emit('error', er);
54653 } else if (chunk === null) {
54654 state.reading = false;
54655 onEofChunk(stream, state);
54656 } else if (state.objectMode || chunk && chunk.length > 0) {
54657 if (state.ended && !addToFront) {
54658 var e = new Error('stream.push() after EOF');
54659 stream.emit('error', e);
54660 } else if (state.endEmitted && addToFront) {
54661 var _e = new Error('stream.unshift() after end event');
54662 stream.emit('error', _e);
54663 } else {
54664 var skipAdd;
54665 if (state.decoder && !addToFront && !encoding) {
54666 chunk = state.decoder.write(chunk);
54667 skipAdd = !state.objectMode && chunk.length === 0;
54668 }
54669
54670 if (!addToFront) state.reading = false;
54671
54672 // Don't add to the buffer if we've decoded to an empty string chunk and
54673 // we're not in object mode
54674 if (!skipAdd) {
54675 // if we want the data now, just emit it.
54676 if (state.flowing && state.length === 0 && !state.sync) {
54677 stream.emit('data', chunk);
54678 stream.read(0);
54679 } else {
54680 // update the buffer info.
54681 state.length += state.objectMode ? 1 : chunk.length;
54682 if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
54683
54684 if (state.needReadable) emitReadable(stream);
54685 }
54686 }
54687
54688 maybeReadMore(stream, state);
54689 }
54690 } else if (!addToFront) {
54691 state.reading = false;
54692 }
54693
54694 return needMoreData(state);
54695}
54696
54697// if it's past the high water mark, we can push in some more.
54698// Also, if we have no data yet, we can stand some
54699// more bytes. This is to work around cases where hwm=0,
54700// such as the repl. Also, if the push() triggered a
54701// readable event, and the user called read(largeNumber) such that
54702// needReadable was set, then we ought to push more, so that another
54703// 'readable' event will be triggered.
54704function needMoreData(state) {
54705 return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
54706}
54707
54708// backwards compatibility.
54709Readable.prototype.setEncoding = function (enc) {
54710 if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
54711 this._readableState.decoder = new StringDecoder(enc);
54712 this._readableState.encoding = enc;
54713 return this;
54714};
54715
54716// Don't raise the hwm > 8MB
54717var MAX_HWM = 0x800000;
54718function computeNewHighWaterMark(n) {
54719 if (n >= MAX_HWM) {
54720 n = MAX_HWM;
54721 } else {
54722 // Get the next highest power of 2 to prevent increasing hwm excessively in
54723 // tiny amounts
54724 n--;
54725 n |= n >>> 1;
54726 n |= n >>> 2;
54727 n |= n >>> 4;
54728 n |= n >>> 8;
54729 n |= n >>> 16;
54730 n++;
54731 }
54732 return n;
54733}
54734
54735// This function is designed to be inlinable, so please take care when making
54736// changes to the function body.
54737function howMuchToRead(n, state) {
54738 if (n <= 0 || state.length === 0 && state.ended) return 0;
54739 if (state.objectMode) return 1;
54740 if (n !== n) {
54741 // Only flow one buffer at a time
54742 if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
54743 }
54744 // If we're asking for more than the current hwm, then raise the hwm.
54745 if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
54746 if (n <= state.length) return n;
54747 // Don't have enough
54748 if (!state.ended) {
54749 state.needReadable = true;
54750 return 0;
54751 }
54752 return state.length;
54753}
54754
54755// you can override either this method, or the async _read(n) below.
54756Readable.prototype.read = function (n) {
54757 debug('read', n);
54758 n = parseInt(n, 10);
54759 var state = this._readableState;
54760 var nOrig = n;
54761
54762 if (n !== 0) state.emittedReadable = false;
54763
54764 // if we're doing read(0) to trigger a readable event, but we
54765 // already have a bunch of data in the buffer, then just trigger
54766 // the 'readable' event and move on.
54767 if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
54768 debug('read: emitReadable', state.length, state.ended);
54769 if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
54770 return null;
54771 }
54772
54773 n = howMuchToRead(n, state);
54774
54775 // if we've ended, and we're now clear, then finish it up.
54776 if (n === 0 && state.ended) {
54777 if (state.length === 0) endReadable(this);
54778 return null;
54779 }
54780
54781 // All the actual chunk generation logic needs to be
54782 // *below* the call to _read. The reason is that in certain
54783 // synthetic stream cases, such as passthrough streams, _read
54784 // may be a completely synchronous operation which may change
54785 // the state of the read buffer, providing enough data when
54786 // before there was *not* enough.
54787 //
54788 // So, the steps are:
54789 // 1. Figure out what the state of things will be after we do
54790 // a read from the buffer.
54791 //
54792 // 2. If that resulting state will trigger a _read, then call _read.
54793 // Note that this may be asynchronous, or synchronous. Yes, it is
54794 // deeply ugly to write APIs this way, but that still doesn't mean
54795 // that the Readable class should behave improperly, as streams are
54796 // designed to be sync/async agnostic.
54797 // Take note if the _read call is sync or async (ie, if the read call
54798 // has returned yet), so that we know whether or not it's safe to emit
54799 // 'readable' etc.
54800 //
54801 // 3. Actually pull the requested chunks out of the buffer and return.
54802
54803 // if we need a readable event, then we need to do some reading.
54804 var doRead = state.needReadable;
54805 debug('need readable', doRead);
54806
54807 // if we currently have less than the highWaterMark, then also read some
54808 if (state.length === 0 || state.length - n < state.highWaterMark) {
54809 doRead = true;
54810 debug('length less than watermark', doRead);
54811 }
54812
54813 // however, if we've ended, then there's no point, and if we're already
54814 // reading, then it's unnecessary.
54815 if (state.ended || state.reading) {
54816 doRead = false;
54817 debug('reading or ended', doRead);
54818 } else if (doRead) {
54819 debug('do read');
54820 state.reading = true;
54821 state.sync = true;
54822 // if the length is currently zero, then we *need* a readable event.
54823 if (state.length === 0) state.needReadable = true;
54824 // call internal read method
54825 this._read(state.highWaterMark);
54826 state.sync = false;
54827 // If _read pushed data synchronously, then `reading` will be false,
54828 // and we need to re-evaluate how much data we can return to the user.
54829 if (!state.reading) n = howMuchToRead(nOrig, state);
54830 }
54831
54832 var ret;
54833 if (n > 0) ret = fromList(n, state);else ret = null;
54834
54835 if (ret === null) {
54836 state.needReadable = true;
54837 n = 0;
54838 } else {
54839 state.length -= n;
54840 }
54841
54842 if (state.length === 0) {
54843 // If we have nothing in the buffer, then we want to know
54844 // as soon as we *do* get something into the buffer.
54845 if (!state.ended) state.needReadable = true;
54846
54847 // If we tried to read() past the EOF, then emit end on the next tick.
54848 if (nOrig !== n && state.ended) endReadable(this);
54849 }
54850
54851 if (ret !== null) this.emit('data', ret);
54852
54853 return ret;
54854};
54855
54856function chunkInvalid(state, chunk) {
54857 var er = null;
54858 if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
54859 er = new TypeError('Invalid non-string/buffer chunk');
54860 }
54861 return er;
54862}
54863
54864function onEofChunk(stream, state) {
54865 if (state.ended) return;
54866 if (state.decoder) {
54867 var chunk = state.decoder.end();
54868 if (chunk && chunk.length) {
54869 state.buffer.push(chunk);
54870 state.length += state.objectMode ? 1 : chunk.length;
54871 }
54872 }
54873 state.ended = true;
54874
54875 // emit 'readable' now to make sure it gets picked up.
54876 emitReadable(stream);
54877}
54878
54879// Don't emit readable right away in sync mode, because this can trigger
54880// another read() call => stack overflow. This way, it might trigger
54881// a nextTick recursion warning, but that's not so bad.
54882function emitReadable(stream) {
54883 var state = stream._readableState;
54884 state.needReadable = false;
54885 if (!state.emittedReadable) {
54886 debug('emitReadable', state.flowing);
54887 state.emittedReadable = true;
54888 if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
54889 }
54890}
54891
54892function emitReadable_(stream) {
54893 debug('emit readable');
54894 stream.emit('readable');
54895 flow(stream);
54896}
54897
54898// at this point, the user has presumably seen the 'readable' event,
54899// and called read() to consume some data. that may have triggered
54900// in turn another _read(n) call, in which case reading = true if
54901// it's in progress.
54902// However, if we're not ended, or reading, and the length < hwm,
54903// then go ahead and try to read some more preemptively.
54904function maybeReadMore(stream, state) {
54905 if (!state.readingMore) {
54906 state.readingMore = true;
54907 processNextTick(maybeReadMore_, stream, state);
54908 }
54909}
54910
54911function maybeReadMore_(stream, state) {
54912 var len = state.length;
54913 while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
54914 debug('maybeReadMore read 0');
54915 stream.read(0);
54916 if (len === state.length)
54917 // didn't get any data, stop spinning.
54918 break;else len = state.length;
54919 }
54920 state.readingMore = false;
54921}
54922
54923// abstract method. to be overridden in specific implementation classes.
54924// call cb(er, data) where data is <= n in length.
54925// for virtual (non-string, non-buffer) streams, "length" is somewhat
54926// arbitrary, and perhaps not very meaningful.
54927Readable.prototype._read = function (n) {
54928 this.emit('error', new Error('_read() is not implemented'));
54929};
54930
54931Readable.prototype.pipe = function (dest, pipeOpts) {
54932 var src = this;
54933 var state = this._readableState;
54934
54935 switch (state.pipesCount) {
54936 case 0:
54937 state.pipes = dest;
54938 break;
54939 case 1:
54940 state.pipes = [state.pipes, dest];
54941 break;
54942 default:
54943 state.pipes.push(dest);
54944 break;
54945 }
54946 state.pipesCount += 1;
54947 debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
54948
54949 var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
54950
54951 var endFn = doEnd ? onend : cleanup;
54952 if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
54953
54954 dest.on('unpipe', onunpipe);
54955 function onunpipe(readable) {
54956 debug('onunpipe');
54957 if (readable === src) {
54958 cleanup();
54959 }
54960 }
54961
54962 function onend() {
54963 debug('onend');
54964 dest.end();
54965 }
54966
54967 // when the dest drains, it reduces the awaitDrain counter
54968 // on the source. This would be more elegant with a .once()
54969 // handler in flow(), but adding and removing repeatedly is
54970 // too slow.
54971 var ondrain = pipeOnDrain(src);
54972 dest.on('drain', ondrain);
54973
54974 var cleanedUp = false;
54975 function cleanup() {
54976 debug('cleanup');
54977 // cleanup event handlers once the pipe is broken
54978 dest.removeListener('close', onclose);
54979 dest.removeListener('finish', onfinish);
54980 dest.removeListener('drain', ondrain);
54981 dest.removeListener('error', onerror);
54982 dest.removeListener('unpipe', onunpipe);
54983 src.removeListener('end', onend);
54984 src.removeListener('end', cleanup);
54985 src.removeListener('data', ondata);
54986
54987 cleanedUp = true;
54988
54989 // if the reader is waiting for a drain event from this
54990 // specific writer, then it would cause it to never start
54991 // flowing again.
54992 // So, if this is awaiting a drain, then we just call it now.
54993 // If we don't know, then assume that we are waiting for one.
54994 if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
54995 }
54996
54997 // If the user pushes more data while we're writing to dest then we'll end up
54998 // in ondata again. However, we only want to increase awaitDrain once because
54999 // dest will only emit one 'drain' event for the multiple writes.
55000 // => Introduce a guard on increasing awaitDrain.
55001 var increasedAwaitDrain = false;
55002 src.on('data', ondata);
55003 function ondata(chunk) {
55004 debug('ondata');
55005 increasedAwaitDrain = false;
55006 var ret = dest.write(chunk);
55007 if (false === ret && !increasedAwaitDrain) {
55008 // If the user unpiped during `dest.write()`, it is possible
55009 // to get stuck in a permanently paused state if that write
55010 // also returned false.
55011 // => Check whether `dest` is still a piping destination.
55012 if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
55013 debug('false write response, pause', src._readableState.awaitDrain);
55014 src._readableState.awaitDrain++;
55015 increasedAwaitDrain = true;
55016 }
55017 src.pause();
55018 }
55019 }
55020
55021 // if the dest has an error, then stop piping into it.
55022 // however, don't suppress the throwing behavior for this.
55023 function onerror(er) {
55024 debug('onerror', er);
55025 unpipe();
55026 dest.removeListener('error', onerror);
55027 if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
55028 }
55029
55030 // Make sure our error handler is attached before userland ones.
55031 prependListener(dest, 'error', onerror);
55032
55033 // Both close and finish should trigger unpipe, but only once.
55034 function onclose() {
55035 dest.removeListener('finish', onfinish);
55036 unpipe();
55037 }
55038 dest.once('close', onclose);
55039 function onfinish() {
55040 debug('onfinish');
55041 dest.removeListener('close', onclose);
55042 unpipe();
55043 }
55044 dest.once('finish', onfinish);
55045
55046 function unpipe() {
55047 debug('unpipe');
55048 src.unpipe(dest);
55049 }
55050
55051 // tell the dest that it's being piped to
55052 dest.emit('pipe', src);
55053
55054 // start the flow if it hasn't been started already.
55055 if (!state.flowing) {
55056 debug('pipe resume');
55057 src.resume();
55058 }
55059
55060 return dest;
55061};
55062
55063function pipeOnDrain(src) {
55064 return function () {
55065 var state = src._readableState;
55066 debug('pipeOnDrain', state.awaitDrain);
55067 if (state.awaitDrain) state.awaitDrain--;
55068 if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
55069 state.flowing = true;
55070 flow(src);
55071 }
55072 };
55073}
55074
55075Readable.prototype.unpipe = function (dest) {
55076 var state = this._readableState;
55077
55078 // if we're not piping anywhere, then do nothing.
55079 if (state.pipesCount === 0) return this;
55080
55081 // just one destination. most common case.
55082 if (state.pipesCount === 1) {
55083 // passed in one, but it's not the right one.
55084 if (dest && dest !== state.pipes) return this;
55085
55086 if (!dest) dest = state.pipes;
55087
55088 // got a match.
55089 state.pipes = null;
55090 state.pipesCount = 0;
55091 state.flowing = false;
55092 if (dest) dest.emit('unpipe', this);
55093 return this;
55094 }
55095
55096 // slow case. multiple pipe destinations.
55097
55098 if (!dest) {
55099 // remove all.
55100 var dests = state.pipes;
55101 var len = state.pipesCount;
55102 state.pipes = null;
55103 state.pipesCount = 0;
55104 state.flowing = false;
55105
55106 for (var i = 0; i < len; i++) {
55107 dests[i].emit('unpipe', this);
55108 }return this;
55109 }
55110
55111 // try to find the right one.
55112 var index = indexOf(state.pipes, dest);
55113 if (index === -1) return this;
55114
55115 state.pipes.splice(index, 1);
55116 state.pipesCount -= 1;
55117 if (state.pipesCount === 1) state.pipes = state.pipes[0];
55118
55119 dest.emit('unpipe', this);
55120
55121 return this;
55122};
55123
55124// set up data events if they are asked for
55125// Ensure readable listeners eventually get something
55126Readable.prototype.on = function (ev, fn) {
55127 var res = Stream.prototype.on.call(this, ev, fn);
55128
55129 if (ev === 'data') {
55130 // Start flowing on next tick if stream isn't explicitly paused
55131 if (this._readableState.flowing !== false) this.resume();
55132 } else if (ev === 'readable') {
55133 var state = this._readableState;
55134 if (!state.endEmitted && !state.readableListening) {
55135 state.readableListening = state.needReadable = true;
55136 state.emittedReadable = false;
55137 if (!state.reading) {
55138 processNextTick(nReadingNextTick, this);
55139 } else if (state.length) {
55140 emitReadable(this, state);
55141 }
55142 }
55143 }
55144
55145 return res;
55146};
55147Readable.prototype.addListener = Readable.prototype.on;
55148
55149function nReadingNextTick(self) {
55150 debug('readable nexttick read 0');
55151 self.read(0);
55152}
55153
55154// pause() and resume() are remnants of the legacy readable stream API
55155// If the user uses them, then switch into old mode.
55156Readable.prototype.resume = function () {
55157 var state = this._readableState;
55158 if (!state.flowing) {
55159 debug('resume');
55160 state.flowing = true;
55161 resume(this, state);
55162 }
55163 return this;
55164};
55165
55166function resume(stream, state) {
55167 if (!state.resumeScheduled) {
55168 state.resumeScheduled = true;
55169 processNextTick(resume_, stream, state);
55170 }
55171}
55172
55173function resume_(stream, state) {
55174 if (!state.reading) {
55175 debug('resume read 0');
55176 stream.read(0);
55177 }
55178
55179 state.resumeScheduled = false;
55180 state.awaitDrain = 0;
55181 stream.emit('resume');
55182 flow(stream);
55183 if (state.flowing && !state.reading) stream.read(0);
55184}
55185
55186Readable.prototype.pause = function () {
55187 debug('call pause flowing=%j', this._readableState.flowing);
55188 if (false !== this._readableState.flowing) {
55189 debug('pause');
55190 this._readableState.flowing = false;
55191 this.emit('pause');
55192 }
55193 return this;
55194};
55195
55196function flow(stream) {
55197 var state = stream._readableState;
55198 debug('flow', state.flowing);
55199 while (state.flowing && stream.read() !== null) {}
55200}
55201
55202// wrap an old-style stream as the async data source.
55203// This is *not* part of the readable stream interface.
55204// It is an ugly unfortunate mess of history.
55205Readable.prototype.wrap = function (stream) {
55206 var state = this._readableState;
55207 var paused = false;
55208
55209 var self = this;
55210 stream.on('end', function () {
55211 debug('wrapped end');
55212 if (state.decoder && !state.ended) {
55213 var chunk = state.decoder.end();
55214 if (chunk && chunk.length) self.push(chunk);
55215 }
55216
55217 self.push(null);
55218 });
55219
55220 stream.on('data', function (chunk) {
55221 debug('wrapped data');
55222 if (state.decoder) chunk = state.decoder.write(chunk);
55223
55224 // don't skip over falsy values in objectMode
55225 if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
55226
55227 var ret = self.push(chunk);
55228 if (!ret) {
55229 paused = true;
55230 stream.pause();
55231 }
55232 });
55233
55234 // proxy all the other methods.
55235 // important when wrapping filters and duplexes.
55236 for (var i in stream) {
55237 if (this[i] === undefined && typeof stream[i] === 'function') {
55238 this[i] = function (method) {
55239 return function () {
55240 return stream[method].apply(stream, arguments);
55241 };
55242 }(i);
55243 }
55244 }
55245
55246 // proxy certain important events.
55247 var events = ['error', 'close', 'destroy', 'pause', 'resume'];
55248 forEach(events, function (ev) {
55249 stream.on(ev, self.emit.bind(self, ev));
55250 });
55251
55252 // when we try to consume some more bytes, simply unpause the
55253 // underlying stream.
55254 self._read = function (n) {
55255 debug('wrapped _read', n);
55256 if (paused) {
55257 paused = false;
55258 stream.resume();
55259 }
55260 };
55261
55262 return self;
55263};
55264
55265// exposed for testing purposes only.
55266Readable._fromList = fromList;
55267
55268// Pluck off n bytes from an array of buffers.
55269// Length is the combined lengths of all the buffers in the list.
55270// This function is designed to be inlinable, so please take care when making
55271// changes to the function body.
55272function fromList(n, state) {
55273 // nothing buffered
55274 if (state.length === 0) return null;
55275
55276 var ret;
55277 if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
55278 // read it all, truncate the list
55279 if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
55280 state.buffer.clear();
55281 } else {
55282 // read part of list
55283 ret = fromListPartial(n, state.buffer, state.decoder);
55284 }
55285
55286 return ret;
55287}
55288
55289// Extracts only enough buffered data to satisfy the amount requested.
55290// This function is designed to be inlinable, so please take care when making
55291// changes to the function body.
55292function fromListPartial(n, list, hasStrings) {
55293 var ret;
55294 if (n < list.head.data.length) {
55295 // slice is the same for buffers and strings
55296 ret = list.head.data.slice(0, n);
55297 list.head.data = list.head.data.slice(n);
55298 } else if (n === list.head.data.length) {
55299 // first chunk is a perfect match
55300 ret = list.shift();
55301 } else {
55302 // result spans more than one buffer
55303 ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
55304 }
55305 return ret;
55306}
55307
55308// Copies a specified amount of characters from the list of buffered data
55309// chunks.
55310// This function is designed to be inlinable, so please take care when making
55311// changes to the function body.
55312function copyFromBufferString(n, list) {
55313 var p = list.head;
55314 var c = 1;
55315 var ret = p.data;
55316 n -= ret.length;
55317 while (p = p.next) {
55318 var str = p.data;
55319 var nb = n > str.length ? str.length : n;
55320 if (nb === str.length) ret += str;else ret += str.slice(0, n);
55321 n -= nb;
55322 if (n === 0) {
55323 if (nb === str.length) {
55324 ++c;
55325 if (p.next) list.head = p.next;else list.head = list.tail = null;
55326 } else {
55327 list.head = p;
55328 p.data = str.slice(nb);
55329 }
55330 break;
55331 }
55332 ++c;
55333 }
55334 list.length -= c;
55335 return ret;
55336}
55337
55338// Copies a specified amount of bytes from the list of buffered data chunks.
55339// This function is designed to be inlinable, so please take care when making
55340// changes to the function body.
55341function copyFromBuffer(n, list) {
55342 var ret = bufferShim.allocUnsafe(n);
55343 var p = list.head;
55344 var c = 1;
55345 p.data.copy(ret);
55346 n -= p.data.length;
55347 while (p = p.next) {
55348 var buf = p.data;
55349 var nb = n > buf.length ? buf.length : n;
55350 buf.copy(ret, ret.length - n, 0, nb);
55351 n -= nb;
55352 if (n === 0) {
55353 if (nb === buf.length) {
55354 ++c;
55355 if (p.next) list.head = p.next;else list.head = list.tail = null;
55356 } else {
55357 list.head = p;
55358 p.data = buf.slice(nb);
55359 }
55360 break;
55361 }
55362 ++c;
55363 }
55364 list.length -= c;
55365 return ret;
55366}
55367
55368function endReadable(stream) {
55369 var state = stream._readableState;
55370
55371 // If we get here before consuming all the bytes, then that is a
55372 // bug in node. Should never happen.
55373 if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
55374
55375 if (!state.endEmitted) {
55376 state.ended = true;
55377 processNextTick(endReadableNT, state, stream);
55378 }
55379}
55380
55381function endReadableNT(state, stream) {
55382 // Check that we didn't get one last unshift.
55383 if (!state.endEmitted && state.length === 0) {
55384 state.endEmitted = true;
55385 stream.readable = false;
55386 stream.emit('end');
55387 }
55388}
55389
55390function forEach(xs, f) {
55391 for (var i = 0, l = xs.length; i < l; i++) {
55392 f(xs[i], i);
55393 }
55394}
55395
55396function indexOf(xs, x) {
55397 for (var i = 0, l = xs.length; i < l; i++) {
55398 if (xs[i] === x) return i;
55399 }
55400 return -1;
55401}
55402}).call(this,require('_process'))
55403},{"./_stream_duplex":15,"./internal/streams/BufferList":20,"_process":13,"buffer":5,"buffer-shims":4,"core-util-is":6,"events":7,"inherits":9,"isarray":11,"process-nextick-args":12,"string_decoder/":26,"util":3}],18:[function(require,module,exports){
55404// a transform stream is a readable/writable stream where you do
55405// something with the data. Sometimes it's called a "filter",
55406// but that's not a great name for it, since that implies a thing where
55407// some bits pass through, and others are simply ignored. (That would
55408// be a valid example of a transform, of course.)
55409//
55410// While the output is causally related to the input, it's not a
55411// necessarily symmetric or synchronous transformation. For example,
55412// a zlib stream might take multiple plain-text writes(), and then
55413// emit a single compressed chunk some time in the future.
55414//
55415// Here's how this works:
55416//
55417// The Transform stream has all the aspects of the readable and writable
55418// stream classes. When you write(chunk), that calls _write(chunk,cb)
55419// internally, and returns false if there's a lot of pending writes
55420// buffered up. When you call read(), that calls _read(n) until
55421// there's enough pending readable data buffered up.
55422//
55423// In a transform stream, the written data is placed in a buffer. When
55424// _read(n) is called, it transforms the queued up data, calling the
55425// buffered _write cb's as it consumes chunks. If consuming a single
55426// written chunk would result in multiple output chunks, then the first
55427// outputted bit calls the readcb, and subsequent chunks just go into
55428// the read buffer, and will cause it to emit 'readable' if necessary.
55429//
55430// This way, back-pressure is actually determined by the reading side,
55431// since _read has to be called to start processing a new chunk. However,
55432// a pathological inflate type of transform can cause excessive buffering
55433// here. For example, imagine a stream where every byte of input is
55434// interpreted as an integer from 0-255, and then results in that many
55435// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
55436// 1kb of data being output. In this case, you could write a very small
55437// amount of input, and end up with a very large amount of output. In
55438// such a pathological inflating mechanism, there'd be no way to tell
55439// the system to stop doing the transform. A single 4MB write could
55440// cause the system to run out of memory.
55441//
55442// However, even in such a pathological case, only a single written chunk
55443// would be consumed, and then the rest would wait (un-transformed) until
55444// the results of the previous transformed chunk were consumed.
55445
55446'use strict';
55447
55448module.exports = Transform;
55449
55450var Duplex = require('./_stream_duplex');
55451
55452/*<replacement>*/
55453var util = require('core-util-is');
55454util.inherits = require('inherits');
55455/*</replacement>*/
55456
55457util.inherits(Transform, Duplex);
55458
55459function TransformState(stream) {
55460 this.afterTransform = function (er, data) {
55461 return afterTransform(stream, er, data);
55462 };
55463
55464 this.needTransform = false;
55465 this.transforming = false;
55466 this.writecb = null;
55467 this.writechunk = null;
55468 this.writeencoding = null;
55469}
55470
55471function afterTransform(stream, er, data) {
55472 var ts = stream._transformState;
55473 ts.transforming = false;
55474
55475 var cb = ts.writecb;
55476
55477 if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));
55478
55479 ts.writechunk = null;
55480 ts.writecb = null;
55481
55482 if (data !== null && data !== undefined) stream.push(data);
55483
55484 cb(er);
55485
55486 var rs = stream._readableState;
55487 rs.reading = false;
55488 if (rs.needReadable || rs.length < rs.highWaterMark) {
55489 stream._read(rs.highWaterMark);
55490 }
55491}
55492
55493function Transform(options) {
55494 if (!(this instanceof Transform)) return new Transform(options);
55495
55496 Duplex.call(this, options);
55497
55498 this._transformState = new TransformState(this);
55499
55500 var stream = this;
55501
55502 // start out asking for a readable event once data is transformed.
55503 this._readableState.needReadable = true;
55504
55505 // we have implemented the _read method, and done the other things
55506 // that Readable wants before the first _read call, so unset the
55507 // sync guard flag.
55508 this._readableState.sync = false;
55509
55510 if (options) {
55511 if (typeof options.transform === 'function') this._transform = options.transform;
55512
55513 if (typeof options.flush === 'function') this._flush = options.flush;
55514 }
55515
55516 // When the writable side finishes, then flush out anything remaining.
55517 this.once('prefinish', function () {
55518 if (typeof this._flush === 'function') this._flush(function (er, data) {
55519 done(stream, er, data);
55520 });else done(stream);
55521 });
55522}
55523
55524Transform.prototype.push = function (chunk, encoding) {
55525 this._transformState.needTransform = false;
55526 return Duplex.prototype.push.call(this, chunk, encoding);
55527};
55528
55529// This is the part where you do stuff!
55530// override this function in implementation classes.
55531// 'chunk' is an input chunk.
55532//
55533// Call `push(newChunk)` to pass along transformed output
55534// to the readable side. You may call 'push' zero or more times.
55535//
55536// Call `cb(err)` when you are done with this chunk. If you pass
55537// an error, then that'll put the hurt on the whole operation. If you
55538// never call cb(), then you'll never get another chunk.
55539Transform.prototype._transform = function (chunk, encoding, cb) {
55540 throw new Error('_transform() is not implemented');
55541};
55542
55543Transform.prototype._write = function (chunk, encoding, cb) {
55544 var ts = this._transformState;
55545 ts.writecb = cb;
55546 ts.writechunk = chunk;
55547 ts.writeencoding = encoding;
55548 if (!ts.transforming) {
55549 var rs = this._readableState;
55550 if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
55551 }
55552};
55553
55554// Doesn't matter what the args are here.
55555// _transform does all the work.
55556// That we got here means that the readable side wants more data.
55557Transform.prototype._read = function (n) {
55558 var ts = this._transformState;
55559
55560 if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
55561 ts.transforming = true;
55562 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
55563 } else {
55564 // mark that we need a transform, so that any data that comes in
55565 // will get processed, now that we've asked for it.
55566 ts.needTransform = true;
55567 }
55568};
55569
55570function done(stream, er, data) {
55571 if (er) return stream.emit('error', er);
55572
55573 if (data !== null && data !== undefined) stream.push(data);
55574
55575 // if there's nothing in the write buffer, then that means
55576 // that nothing more will ever be provided
55577 var ws = stream._writableState;
55578 var ts = stream._transformState;
55579
55580 if (ws.length) throw new Error('Calling transform done when ws.length != 0');
55581
55582 if (ts.transforming) throw new Error('Calling transform done when still transforming');
55583
55584 return stream.push(null);
55585}
55586},{"./_stream_duplex":15,"core-util-is":6,"inherits":9}],19:[function(require,module,exports){
55587(function (process){
55588// A bit simpler than readable streams.
55589// Implement an async ._write(chunk, encoding, cb), and it'll handle all
55590// the drain event emission and buffering.
55591
55592'use strict';
55593
55594module.exports = Writable;
55595
55596/*<replacement>*/
55597var processNextTick = require('process-nextick-args');
55598/*</replacement>*/
55599
55600/*<replacement>*/
55601var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
55602/*</replacement>*/
55603
55604/*<replacement>*/
55605var Duplex;
55606/*</replacement>*/
55607
55608Writable.WritableState = WritableState;
55609
55610/*<replacement>*/
55611var util = require('core-util-is');
55612util.inherits = require('inherits');
55613/*</replacement>*/
55614
55615/*<replacement>*/
55616var internalUtil = {
55617 deprecate: require('util-deprecate')
55618};
55619/*</replacement>*/
55620
55621/*<replacement>*/
55622var Stream;
55623(function () {
55624 try {
55625 Stream = require('st' + 'ream');
55626 } catch (_) {} finally {
55627 if (!Stream) Stream = require('events').EventEmitter;
55628 }
55629})();
55630/*</replacement>*/
55631
55632var Buffer = require('buffer').Buffer;
55633/*<replacement>*/
55634var bufferShim = require('buffer-shims');
55635/*</replacement>*/
55636
55637util.inherits(Writable, Stream);
55638
55639function nop() {}
55640
55641function WriteReq(chunk, encoding, cb) {
55642 this.chunk = chunk;
55643 this.encoding = encoding;
55644 this.callback = cb;
55645 this.next = null;
55646}
55647
55648function WritableState(options, stream) {
55649 Duplex = Duplex || require('./_stream_duplex');
55650
55651 options = options || {};
55652
55653 // object stream flag to indicate whether or not this stream
55654 // contains buffers or objects.
55655 this.objectMode = !!options.objectMode;
55656
55657 if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
55658
55659 // the point at which write() starts returning false
55660 // Note: 0 is a valid value, means that we always return false if
55661 // the entire buffer is not flushed immediately on write()
55662 var hwm = options.highWaterMark;
55663 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
55664 this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
55665
55666 // cast to ints.
55667 this.highWaterMark = ~ ~this.highWaterMark;
55668
55669 // drain event flag.
55670 this.needDrain = false;
55671 // at the start of calling end()
55672 this.ending = false;
55673 // when end() has been called, and returned
55674 this.ended = false;
55675 // when 'finish' is emitted
55676 this.finished = false;
55677
55678 // should we decode strings into buffers before passing to _write?
55679 // this is here so that some node-core streams can optimize string
55680 // handling at a lower level.
55681 var noDecode = options.decodeStrings === false;
55682 this.decodeStrings = !noDecode;
55683
55684 // Crypto is kind of old and crusty. Historically, its default string
55685 // encoding is 'binary' so we have to make this configurable.
55686 // Everything else in the universe uses 'utf8', though.
55687 this.defaultEncoding = options.defaultEncoding || 'utf8';
55688
55689 // not an actual buffer we keep track of, but a measurement
55690 // of how much we're waiting to get pushed to some underlying
55691 // socket or file.
55692 this.length = 0;
55693
55694 // a flag to see when we're in the middle of a write.
55695 this.writing = false;
55696
55697 // when true all writes will be buffered until .uncork() call
55698 this.corked = 0;
55699
55700 // a flag to be able to tell if the onwrite cb is called immediately,
55701 // or on a later tick. We set this to true at first, because any
55702 // actions that shouldn't happen until "later" should generally also
55703 // not happen before the first write call.
55704 this.sync = true;
55705
55706 // a flag to know if we're processing previously buffered items, which
55707 // may call the _write() callback in the same tick, so that we don't
55708 // end up in an overlapped onwrite situation.
55709 this.bufferProcessing = false;
55710
55711 // the callback that's passed to _write(chunk,cb)
55712 this.onwrite = function (er) {
55713 onwrite(stream, er);
55714 };
55715
55716 // the callback that the user supplies to write(chunk,encoding,cb)
55717 this.writecb = null;
55718
55719 // the amount that is being written when _write is called.
55720 this.writelen = 0;
55721
55722 this.bufferedRequest = null;
55723 this.lastBufferedRequest = null;
55724
55725 // number of pending user-supplied write callbacks
55726 // this must be 0 before 'finish' can be emitted
55727 this.pendingcb = 0;
55728
55729 // emit prefinish if the only thing we're waiting for is _write cbs
55730 // This is relevant for synchronous Transform streams
55731 this.prefinished = false;
55732
55733 // True if the error was already emitted and should not be thrown again
55734 this.errorEmitted = false;
55735
55736 // count buffered requests
55737 this.bufferedRequestCount = 0;
55738
55739 // allocate the first CorkedRequest, there is always
55740 // one allocated and free to use, and we maintain at most two
55741 this.corkedRequestsFree = new CorkedRequest(this);
55742}
55743
55744WritableState.prototype.getBuffer = function getBuffer() {
55745 var current = this.bufferedRequest;
55746 var out = [];
55747 while (current) {
55748 out.push(current);
55749 current = current.next;
55750 }
55751 return out;
55752};
55753
55754(function () {
55755 try {
55756 Object.defineProperty(WritableState.prototype, 'buffer', {
55757 get: internalUtil.deprecate(function () {
55758 return this.getBuffer();
55759 }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
55760 });
55761 } catch (_) {}
55762})();
55763
55764// Test _writableState for inheritance to account for Duplex streams,
55765// whose prototype chain only points to Readable.
55766var realHasInstance;
55767if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
55768 realHasInstance = Function.prototype[Symbol.hasInstance];
55769 Object.defineProperty(Writable, Symbol.hasInstance, {
55770 value: function (object) {
55771 if (realHasInstance.call(this, object)) return true;
55772
55773 return object && object._writableState instanceof WritableState;
55774 }
55775 });
55776} else {
55777 realHasInstance = function (object) {
55778 return object instanceof this;
55779 };
55780}
55781
55782function Writable(options) {
55783 Duplex = Duplex || require('./_stream_duplex');
55784
55785 // Writable ctor is applied to Duplexes, too.
55786 // `realHasInstance` is necessary because using plain `instanceof`
55787 // would return false, as no `_writableState` property is attached.
55788
55789 // Trying to use the custom `instanceof` for Writable here will also break the
55790 // Node.js LazyTransform implementation, which has a non-trivial getter for
55791 // `_writableState` that would lead to infinite recursion.
55792 if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
55793 return new Writable(options);
55794 }
55795
55796 this._writableState = new WritableState(options, this);
55797
55798 // legacy.
55799 this.writable = true;
55800
55801 if (options) {
55802 if (typeof options.write === 'function') this._write = options.write;
55803
55804 if (typeof options.writev === 'function') this._writev = options.writev;
55805 }
55806
55807 Stream.call(this);
55808}
55809
55810// Otherwise people can pipe Writable streams, which is just wrong.
55811Writable.prototype.pipe = function () {
55812 this.emit('error', new Error('Cannot pipe, not readable'));
55813};
55814
55815function writeAfterEnd(stream, cb) {
55816 var er = new Error('write after end');
55817 // TODO: defer error events consistently everywhere, not just the cb
55818 stream.emit('error', er);
55819 processNextTick(cb, er);
55820}
55821
55822// If we get something that is not a buffer, string, null, or undefined,
55823// and we're not in objectMode, then that's an error.
55824// Otherwise stream chunks are all considered to be of length=1, and the
55825// watermarks determine how many objects to keep in the buffer, rather than
55826// how many bytes or characters.
55827function validChunk(stream, state, chunk, cb) {
55828 var valid = true;
55829 var er = false;
55830 // Always throw error if a null is written
55831 // if we are not in object mode then throw
55832 // if it is not a buffer, string, or undefined.
55833 if (chunk === null) {
55834 er = new TypeError('May not write null values to stream');
55835 } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
55836 er = new TypeError('Invalid non-string/buffer chunk');
55837 }
55838 if (er) {
55839 stream.emit('error', er);
55840 processNextTick(cb, er);
55841 valid = false;
55842 }
55843 return valid;
55844}
55845
55846Writable.prototype.write = function (chunk, encoding, cb) {
55847 var state = this._writableState;
55848 var ret = false;
55849
55850 if (typeof encoding === 'function') {
55851 cb = encoding;
55852 encoding = null;
55853 }
55854
55855 if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
55856
55857 if (typeof cb !== 'function') cb = nop;
55858
55859 if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) {
55860 state.pendingcb++;
55861 ret = writeOrBuffer(this, state, chunk, encoding, cb);
55862 }
55863
55864 return ret;
55865};
55866
55867Writable.prototype.cork = function () {
55868 var state = this._writableState;
55869
55870 state.corked++;
55871};
55872
55873Writable.prototype.uncork = function () {
55874 var state = this._writableState;
55875
55876 if (state.corked) {
55877 state.corked--;
55878
55879 if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
55880 }
55881};
55882
55883Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
55884 // node::ParseEncoding() requires lower case.
55885 if (typeof encoding === 'string') encoding = encoding.toLowerCase();
55886 if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
55887 this._writableState.defaultEncoding = encoding;
55888 return this;
55889};
55890
55891function decodeChunk(state, chunk, encoding) {
55892 if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
55893 chunk = bufferShim.from(chunk, encoding);
55894 }
55895 return chunk;
55896}
55897
55898// if we're already writing something, then just put this
55899// in the queue, and wait our turn. Otherwise, call _write
55900// If we return false, then we need a drain event, so set that flag.
55901function writeOrBuffer(stream, state, chunk, encoding, cb) {
55902 chunk = decodeChunk(state, chunk, encoding);
55903
55904 if (Buffer.isBuffer(chunk)) encoding = 'buffer';
55905 var len = state.objectMode ? 1 : chunk.length;
55906
55907 state.length += len;
55908
55909 var ret = state.length < state.highWaterMark;
55910 // we must ensure that previous needDrain will not be reset to false.
55911 if (!ret) state.needDrain = true;
55912
55913 if (state.writing || state.corked) {
55914 var last = state.lastBufferedRequest;
55915 state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
55916 if (last) {
55917 last.next = state.lastBufferedRequest;
55918 } else {
55919 state.bufferedRequest = state.lastBufferedRequest;
55920 }
55921 state.bufferedRequestCount += 1;
55922 } else {
55923 doWrite(stream, state, false, len, chunk, encoding, cb);
55924 }
55925
55926 return ret;
55927}
55928
55929function doWrite(stream, state, writev, len, chunk, encoding, cb) {
55930 state.writelen = len;
55931 state.writecb = cb;
55932 state.writing = true;
55933 state.sync = true;
55934 if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
55935 state.sync = false;
55936}
55937
55938function onwriteError(stream, state, sync, er, cb) {
55939 --state.pendingcb;
55940 if (sync) processNextTick(cb, er);else cb(er);
55941
55942 stream._writableState.errorEmitted = true;
55943 stream.emit('error', er);
55944}
55945
55946function onwriteStateUpdate(state) {
55947 state.writing = false;
55948 state.writecb = null;
55949 state.length -= state.writelen;
55950 state.writelen = 0;
55951}
55952
55953function onwrite(stream, er) {
55954 var state = stream._writableState;
55955 var sync = state.sync;
55956 var cb = state.writecb;
55957
55958 onwriteStateUpdate(state);
55959
55960 if (er) onwriteError(stream, state, sync, er, cb);else {
55961 // Check if we're actually ready to finish, but don't emit yet
55962 var finished = needFinish(state);
55963
55964 if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
55965 clearBuffer(stream, state);
55966 }
55967
55968 if (sync) {
55969 /*<replacement>*/
55970 asyncWrite(afterWrite, stream, state, finished, cb);
55971 /*</replacement>*/
55972 } else {
55973 afterWrite(stream, state, finished, cb);
55974 }
55975 }
55976}
55977
55978function afterWrite(stream, state, finished, cb) {
55979 if (!finished) onwriteDrain(stream, state);
55980 state.pendingcb--;
55981 cb();
55982 finishMaybe(stream, state);
55983}
55984
55985// Must force callback to be called on nextTick, so that we don't
55986// emit 'drain' before the write() consumer gets the 'false' return
55987// value, and has a chance to attach a 'drain' listener.
55988function onwriteDrain(stream, state) {
55989 if (state.length === 0 && state.needDrain) {
55990 state.needDrain = false;
55991 stream.emit('drain');
55992 }
55993}
55994
55995// if there's something in the buffer waiting, then process it
55996function clearBuffer(stream, state) {
55997 state.bufferProcessing = true;
55998 var entry = state.bufferedRequest;
55999
56000 if (stream._writev && entry && entry.next) {
56001 // Fast case, write everything using _writev()
56002 var l = state.bufferedRequestCount;
56003 var buffer = new Array(l);
56004 var holder = state.corkedRequestsFree;
56005 holder.entry = entry;
56006
56007 var count = 0;
56008 while (entry) {
56009 buffer[count] = entry;
56010 entry = entry.next;
56011 count += 1;
56012 }
56013
56014 doWrite(stream, state, true, state.length, buffer, '', holder.finish);
56015
56016 // doWrite is almost always async, defer these to save a bit of time
56017 // as the hot path ends with doWrite
56018 state.pendingcb++;
56019 state.lastBufferedRequest = null;
56020 if (holder.next) {
56021 state.corkedRequestsFree = holder.next;
56022 holder.next = null;
56023 } else {
56024 state.corkedRequestsFree = new CorkedRequest(state);
56025 }
56026 } else {
56027 // Slow case, write chunks one-by-one
56028 while (entry) {
56029 var chunk = entry.chunk;
56030 var encoding = entry.encoding;
56031 var cb = entry.callback;
56032 var len = state.objectMode ? 1 : chunk.length;
56033
56034 doWrite(stream, state, false, len, chunk, encoding, cb);
56035 entry = entry.next;
56036 // if we didn't call the onwrite immediately, then
56037 // it means that we need to wait until it does.
56038 // also, that means that the chunk and cb are currently
56039 // being processed, so move the buffer counter past them.
56040 if (state.writing) {
56041 break;
56042 }
56043 }
56044
56045 if (entry === null) state.lastBufferedRequest = null;
56046 }
56047
56048 state.bufferedRequestCount = 0;
56049 state.bufferedRequest = entry;
56050 state.bufferProcessing = false;
56051}
56052
56053Writable.prototype._write = function (chunk, encoding, cb) {
56054 cb(new Error('_write() is not implemented'));
56055};
56056
56057Writable.prototype._writev = null;
56058
56059Writable.prototype.end = function (chunk, encoding, cb) {
56060 var state = this._writableState;
56061
56062 if (typeof chunk === 'function') {
56063 cb = chunk;
56064 chunk = null;
56065 encoding = null;
56066 } else if (typeof encoding === 'function') {
56067 cb = encoding;
56068 encoding = null;
56069 }
56070
56071 if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
56072
56073 // .end() fully uncorks
56074 if (state.corked) {
56075 state.corked = 1;
56076 this.uncork();
56077 }
56078
56079 // ignore unnecessary end() calls.
56080 if (!state.ending && !state.finished) endWritable(this, state, cb);
56081};
56082
56083function needFinish(state) {
56084 return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
56085}
56086
56087function prefinish(stream, state) {
56088 if (!state.prefinished) {
56089 state.prefinished = true;
56090 stream.emit('prefinish');
56091 }
56092}
56093
56094function finishMaybe(stream, state) {
56095 var need = needFinish(state);
56096 if (need) {
56097 if (state.pendingcb === 0) {
56098 prefinish(stream, state);
56099 state.finished = true;
56100 stream.emit('finish');
56101 } else {
56102 prefinish(stream, state);
56103 }
56104 }
56105 return need;
56106}
56107
56108function endWritable(stream, state, cb) {
56109 state.ending = true;
56110 finishMaybe(stream, state);
56111 if (cb) {
56112 if (state.finished) processNextTick(cb);else stream.once('finish', cb);
56113 }
56114 state.ended = true;
56115 stream.writable = false;
56116}
56117
56118// It seems a linked list but it is not
56119// there will be only 2 of these for each stream
56120function CorkedRequest(state) {
56121 var _this = this;
56122
56123 this.next = null;
56124 this.entry = null;
56125
56126 this.finish = function (err) {
56127 var entry = _this.entry;
56128 _this.entry = null;
56129 while (entry) {
56130 var cb = entry.callback;
56131 state.pendingcb--;
56132 cb(err);
56133 entry = entry.next;
56134 }
56135 if (state.corkedRequestsFree) {
56136 state.corkedRequestsFree.next = _this;
56137 } else {
56138 state.corkedRequestsFree = _this;
56139 }
56140 };
56141}
56142}).call(this,require('_process'))
56143},{"./_stream_duplex":15,"_process":13,"buffer":5,"buffer-shims":4,"core-util-is":6,"events":7,"inherits":9,"process-nextick-args":12,"util-deprecate":27}],20:[function(require,module,exports){
56144'use strict';
56145
56146var Buffer = require('buffer').Buffer;
56147/*<replacement>*/
56148var bufferShim = require('buffer-shims');
56149/*</replacement>*/
56150
56151module.exports = BufferList;
56152
56153function BufferList() {
56154 this.head = null;
56155 this.tail = null;
56156 this.length = 0;
56157}
56158
56159BufferList.prototype.push = function (v) {
56160 var entry = { data: v, next: null };
56161 if (this.length > 0) this.tail.next = entry;else this.head = entry;
56162 this.tail = entry;
56163 ++this.length;
56164};
56165
56166BufferList.prototype.unshift = function (v) {
56167 var entry = { data: v, next: this.head };
56168 if (this.length === 0) this.tail = entry;
56169 this.head = entry;
56170 ++this.length;
56171};
56172
56173BufferList.prototype.shift = function () {
56174 if (this.length === 0) return;
56175 var ret = this.head.data;
56176 if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
56177 --this.length;
56178 return ret;
56179};
56180
56181BufferList.prototype.clear = function () {
56182 this.head = this.tail = null;
56183 this.length = 0;
56184};
56185
56186BufferList.prototype.join = function (s) {
56187 if (this.length === 0) return '';
56188 var p = this.head;
56189 var ret = '' + p.data;
56190 while (p = p.next) {
56191 ret += s + p.data;
56192 }return ret;
56193};
56194
56195BufferList.prototype.concat = function (n) {
56196 if (this.length === 0) return bufferShim.alloc(0);
56197 if (this.length === 1) return this.head.data;
56198 var ret = bufferShim.allocUnsafe(n >>> 0);
56199 var p = this.head;
56200 var i = 0;
56201 while (p) {
56202 p.data.copy(ret, i);
56203 i += p.data.length;
56204 p = p.next;
56205 }
56206 return ret;
56207};
56208},{"buffer":5,"buffer-shims":4}],21:[function(require,module,exports){
56209module.exports = require("./lib/_stream_passthrough.js")
56210
56211},{"./lib/_stream_passthrough.js":16}],22:[function(require,module,exports){
56212(function (process){
56213var Stream = (function (){
56214 try {
56215 return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify
56216 } catch(_){}
56217}());
56218exports = module.exports = require('./lib/_stream_readable.js');
56219exports.Stream = Stream || exports;
56220exports.Readable = exports;
56221exports.Writable = require('./lib/_stream_writable.js');
56222exports.Duplex = require('./lib/_stream_duplex.js');
56223exports.Transform = require('./lib/_stream_transform.js');
56224exports.PassThrough = require('./lib/_stream_passthrough.js');
56225
56226if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) {
56227 module.exports = Stream;
56228}
56229
56230}).call(this,require('_process'))
56231},{"./lib/_stream_duplex.js":15,"./lib/_stream_passthrough.js":16,"./lib/_stream_readable.js":17,"./lib/_stream_transform.js":18,"./lib/_stream_writable.js":19,"_process":13}],23:[function(require,module,exports){
56232module.exports = require("./lib/_stream_transform.js")
56233
56234},{"./lib/_stream_transform.js":18}],24:[function(require,module,exports){
56235module.exports = require("./lib/_stream_writable.js")
56236
56237},{"./lib/_stream_writable.js":19}],25:[function(require,module,exports){
56238// Copyright Joyent, Inc. and other Node contributors.
56239//
56240// Permission is hereby granted, free of charge, to any person obtaining a
56241// copy of this software and associated documentation files (the
56242// "Software"), to deal in the Software without restriction, including
56243// without limitation the rights to use, copy, modify, merge, publish,
56244// distribute, sublicense, and/or sell copies of the Software, and to permit
56245// persons to whom the Software is furnished to do so, subject to the
56246// following conditions:
56247//
56248// The above copyright notice and this permission notice shall be included
56249// in all copies or substantial portions of the Software.
56250//
56251// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
56252// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
56253// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
56254// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
56255// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
56256// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
56257// USE OR OTHER DEALINGS IN THE SOFTWARE.
56258
56259module.exports = Stream;
56260
56261var EE = require('events').EventEmitter;
56262var inherits = require('inherits');
56263
56264inherits(Stream, EE);
56265Stream.Readable = require('readable-stream/readable.js');
56266Stream.Writable = require('readable-stream/writable.js');
56267Stream.Duplex = require('readable-stream/duplex.js');
56268Stream.Transform = require('readable-stream/transform.js');
56269Stream.PassThrough = require('readable-stream/passthrough.js');
56270
56271// Backwards-compat with node 0.4.x
56272Stream.Stream = Stream;
56273
56274
56275
56276// old-style streams. Note that the pipe method (the only relevant
56277// part of this class) is overridden in the Readable class.
56278
56279function Stream() {
56280 EE.call(this);
56281}
56282
56283Stream.prototype.pipe = function(dest, options) {
56284 var source = this;
56285
56286 function ondata(chunk) {
56287 if (dest.writable) {
56288 if (false === dest.write(chunk) && source.pause) {
56289 source.pause();
56290 }
56291 }
56292 }
56293
56294 source.on('data', ondata);
56295
56296 function ondrain() {
56297 if (source.readable && source.resume) {
56298 source.resume();
56299 }
56300 }
56301
56302 dest.on('drain', ondrain);
56303
56304 // If the 'end' option is not supplied, dest.end() will be called when
56305 // source gets the 'end' or 'close' events. Only dest.end() once.
56306 if (!dest._isStdio && (!options || options.end !== false)) {
56307 source.on('end', onend);
56308 source.on('close', onclose);
56309 }
56310
56311 var didOnEnd = false;
56312 function onend() {
56313 if (didOnEnd) return;
56314 didOnEnd = true;
56315
56316 dest.end();
56317 }
56318
56319
56320 function onclose() {
56321 if (didOnEnd) return;
56322 didOnEnd = true;
56323
56324 if (typeof dest.destroy === 'function') dest.destroy();
56325 }
56326
56327 // don't leave dangling pipes when there are errors.
56328 function onerror(er) {
56329 cleanup();
56330 if (EE.listenerCount(this, 'error') === 0) {
56331 throw er; // Unhandled stream error in pipe.
56332 }
56333 }
56334
56335 source.on('error', onerror);
56336 dest.on('error', onerror);
56337
56338 // remove all the event listeners that were added.
56339 function cleanup() {
56340 source.removeListener('data', ondata);
56341 dest.removeListener('drain', ondrain);
56342
56343 source.removeListener('end', onend);
56344 source.removeListener('close', onclose);
56345
56346 source.removeListener('error', onerror);
56347 dest.removeListener('error', onerror);
56348
56349 source.removeListener('end', cleanup);
56350 source.removeListener('close', cleanup);
56351
56352 dest.removeListener('close', cleanup);
56353 }
56354
56355 source.on('end', cleanup);
56356 source.on('close', cleanup);
56357
56358 dest.on('close', cleanup);
56359
56360 dest.emit('pipe', source);
56361
56362 // Allow for unix-like usage: A.pipe(B).pipe(C)
56363 return dest;
56364};
56365
56366},{"events":7,"inherits":9,"readable-stream/duplex.js":14,"readable-stream/passthrough.js":21,"readable-stream/readable.js":22,"readable-stream/transform.js":23,"readable-stream/writable.js":24}],26:[function(require,module,exports){
56367// Copyright Joyent, Inc. and other Node contributors.
56368//
56369// Permission is hereby granted, free of charge, to any person obtaining a
56370// copy of this software and associated documentation files (the
56371// "Software"), to deal in the Software without restriction, including
56372// without limitation the rights to use, copy, modify, merge, publish,
56373// distribute, sublicense, and/or sell copies of the Software, and to permit
56374// persons to whom the Software is furnished to do so, subject to the
56375// following conditions:
56376//
56377// The above copyright notice and this permission notice shall be included
56378// in all copies or substantial portions of the Software.
56379//
56380// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
56381// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
56382// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
56383// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
56384// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
56385// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
56386// USE OR OTHER DEALINGS IN THE SOFTWARE.
56387
56388var Buffer = require('buffer').Buffer;
56389
56390var isBufferEncoding = Buffer.isEncoding
56391 || function(encoding) {
56392 switch (encoding && encoding.toLowerCase()) {
56393 case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
56394 default: return false;
56395 }
56396 }
56397
56398
56399function assertEncoding(encoding) {
56400 if (encoding && !isBufferEncoding(encoding)) {
56401 throw new Error('Unknown encoding: ' + encoding);
56402 }
56403}
56404
56405// StringDecoder provides an interface for efficiently splitting a series of
56406// buffers into a series of JS strings without breaking apart multi-byte
56407// characters. CESU-8 is handled as part of the UTF-8 encoding.
56408//
56409// @TODO Handling all encodings inside a single object makes it very difficult
56410// to reason about this code, so it should be split up in the future.
56411// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
56412// points as used by CESU-8.
56413var StringDecoder = exports.StringDecoder = function(encoding) {
56414 this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
56415 assertEncoding(encoding);
56416 switch (this.encoding) {
56417 case 'utf8':
56418 // CESU-8 represents each of Surrogate Pair by 3-bytes
56419 this.surrogateSize = 3;
56420 break;
56421 case 'ucs2':
56422 case 'utf16le':
56423 // UTF-16 represents each of Surrogate Pair by 2-bytes
56424 this.surrogateSize = 2;
56425 this.detectIncompleteChar = utf16DetectIncompleteChar;
56426 break;
56427 case 'base64':
56428 // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
56429 this.surrogateSize = 3;
56430 this.detectIncompleteChar = base64DetectIncompleteChar;
56431 break;
56432 default:
56433 this.write = passThroughWrite;
56434 return;
56435 }
56436
56437 // Enough space to store all bytes of a single character. UTF-8 needs 4
56438 // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
56439 this.charBuffer = new Buffer(6);
56440 // Number of bytes received for the current incomplete multi-byte character.
56441 this.charReceived = 0;
56442 // Number of bytes expected for the current incomplete multi-byte character.
56443 this.charLength = 0;
56444};
56445
56446
56447// write decodes the given buffer and returns it as JS string that is
56448// guaranteed to not contain any partial multi-byte characters. Any partial
56449// character found at the end of the buffer is buffered up, and will be
56450// returned when calling write again with the remaining bytes.
56451//
56452// Note: Converting a Buffer containing an orphan surrogate to a String
56453// currently works, but converting a String to a Buffer (via `new Buffer`, or
56454// Buffer#write) will replace incomplete surrogates with the unicode
56455// replacement character. See https://codereview.chromium.org/121173009/ .
56456StringDecoder.prototype.write = function(buffer) {
56457 var charStr = '';
56458 // if our last write ended with an incomplete multibyte character
56459 while (this.charLength) {
56460 // determine how many remaining bytes this buffer has to offer for this char
56461 var available = (buffer.length >= this.charLength - this.charReceived) ?
56462 this.charLength - this.charReceived :
56463 buffer.length;
56464
56465 // add the new bytes to the char buffer
56466 buffer.copy(this.charBuffer, this.charReceived, 0, available);
56467 this.charReceived += available;
56468
56469 if (this.charReceived < this.charLength) {
56470 // still not enough chars in this buffer? wait for more ...
56471 return '';
56472 }
56473
56474 // remove bytes belonging to the current character from the buffer
56475 buffer = buffer.slice(available, buffer.length);
56476
56477 // get the character that was split
56478 charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
56479
56480 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
56481 var charCode = charStr.charCodeAt(charStr.length - 1);
56482 if (charCode >= 0xD800 && charCode <= 0xDBFF) {
56483 this.charLength += this.surrogateSize;
56484 charStr = '';
56485 continue;
56486 }
56487 this.charReceived = this.charLength = 0;
56488
56489 // if there are no more bytes in this buffer, just emit our char
56490 if (buffer.length === 0) {
56491 return charStr;
56492 }
56493 break;
56494 }
56495
56496 // determine and set charLength / charReceived
56497 this.detectIncompleteChar(buffer);
56498
56499 var end = buffer.length;
56500 if (this.charLength) {
56501 // buffer the incomplete character bytes we got
56502 buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
56503 end -= this.charReceived;
56504 }
56505
56506 charStr += buffer.toString(this.encoding, 0, end);
56507
56508 var end = charStr.length - 1;
56509 var charCode = charStr.charCodeAt(end);
56510 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
56511 if (charCode >= 0xD800 && charCode <= 0xDBFF) {
56512 var size = this.surrogateSize;
56513 this.charLength += size;
56514 this.charReceived += size;
56515 this.charBuffer.copy(this.charBuffer, size, 0, size);
56516 buffer.copy(this.charBuffer, 0, 0, size);
56517 return charStr.substring(0, end);
56518 }
56519
56520 // or just emit the charStr
56521 return charStr;
56522};
56523
56524// detectIncompleteChar determines if there is an incomplete UTF-8 character at
56525// the end of the given buffer. If so, it sets this.charLength to the byte
56526// length that character, and sets this.charReceived to the number of bytes
56527// that are available for this character.
56528StringDecoder.prototype.detectIncompleteChar = function(buffer) {
56529 // determine how many bytes we have to check at the end of this buffer
56530 var i = (buffer.length >= 3) ? 3 : buffer.length;
56531
56532 // Figure out if one of the last i bytes of our buffer announces an
56533 // incomplete char.
56534 for (; i > 0; i--) {
56535 var c = buffer[buffer.length - i];
56536
56537 // See http://en.wikipedia.org/wiki/UTF-8#Description
56538
56539 // 110XXXXX
56540 if (i == 1 && c >> 5 == 0x06) {
56541 this.charLength = 2;
56542 break;
56543 }
56544
56545 // 1110XXXX
56546 if (i <= 2 && c >> 4 == 0x0E) {
56547 this.charLength = 3;
56548 break;
56549 }
56550
56551 // 11110XXX
56552 if (i <= 3 && c >> 3 == 0x1E) {
56553 this.charLength = 4;
56554 break;
56555 }
56556 }
56557 this.charReceived = i;
56558};
56559
56560StringDecoder.prototype.end = function(buffer) {
56561 var res = '';
56562 if (buffer && buffer.length)
56563 res = this.write(buffer);
56564
56565 if (this.charReceived) {
56566 var cr = this.charReceived;
56567 var buf = this.charBuffer;
56568 var enc = this.encoding;
56569 res += buf.slice(0, cr).toString(enc);
56570 }
56571
56572 return res;
56573};
56574
56575function passThroughWrite(buffer) {
56576 return buffer.toString(this.encoding);
56577}
56578
56579function utf16DetectIncompleteChar(buffer) {
56580 this.charReceived = buffer.length % 2;
56581 this.charLength = this.charReceived ? 2 : 0;
56582}
56583
56584function base64DetectIncompleteChar(buffer) {
56585 this.charReceived = buffer.length % 3;
56586 this.charLength = this.charReceived ? 3 : 0;
56587}
56588
56589},{"buffer":5}],27:[function(require,module,exports){
56590(function (global){
56591
56592/**
56593 * Module exports.
56594 */
56595
56596module.exports = deprecate;
56597
56598/**
56599 * Mark that a method should not be used.
56600 * Returns a modified function which warns once by default.
56601 *
56602 * If `localStorage.noDeprecation = true` is set, then it is a no-op.
56603 *
56604 * If `localStorage.throwDeprecation = true` is set, then deprecated functions
56605 * will throw an Error when invoked.
56606 *
56607 * If `localStorage.traceDeprecation = true` is set, then deprecated functions
56608 * will invoke `console.trace()` instead of `console.error()`.
56609 *
56610 * @param {Function} fn - the function to deprecate
56611 * @param {String} msg - the string to print to the console when `fn` is invoked
56612 * @returns {Function} a new "deprecated" version of `fn`
56613 * @api public
56614 */
56615
56616function deprecate (fn, msg) {
56617 if (config('noDeprecation')) {
56618 return fn;
56619 }
56620
56621 var warned = false;
56622 function deprecated() {
56623 if (!warned) {
56624 if (config('throwDeprecation')) {
56625 throw new Error(msg);
56626 } else if (config('traceDeprecation')) {
56627 console.trace(msg);
56628 } else {
56629 console.warn(msg);
56630 }
56631 warned = true;
56632 }
56633 return fn.apply(this, arguments);
56634 }
56635
56636 return deprecated;
56637}
56638
56639/**
56640 * Checks `localStorage` for boolean values for the given `name`.
56641 *
56642 * @param {String} name
56643 * @returns {Boolean}
56644 * @api private
56645 */
56646
56647function config (name) {
56648 // accessing global.localStorage can trigger a DOMException in sandboxed iframes
56649 try {
56650 if (!global.localStorage) return false;
56651 } catch (_) {
56652 return false;
56653 }
56654 var val = global.localStorage[name];
56655 if (null == val) return false;
56656 return String(val).toLowerCase() === 'true';
56657}
56658
56659}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
56660},{}],28:[function(require,module,exports){
56661arguments[4][9][0].apply(exports,arguments)
56662},{"dup":9}],29:[function(require,module,exports){
56663module.exports = function isBuffer(arg) {
56664 return arg && typeof arg === 'object'
56665 && typeof arg.copy === 'function'
56666 && typeof arg.fill === 'function'
56667 && typeof arg.readUInt8 === 'function';
56668}
56669},{}],30:[function(require,module,exports){
56670(function (process,global){
56671// Copyright Joyent, Inc. and other Node contributors.
56672//
56673// Permission is hereby granted, free of charge, to any person obtaining a
56674// copy of this software and associated documentation files (the
56675// "Software"), to deal in the Software without restriction, including
56676// without limitation the rights to use, copy, modify, merge, publish,
56677// distribute, sublicense, and/or sell copies of the Software, and to permit
56678// persons to whom the Software is furnished to do so, subject to the
56679// following conditions:
56680//
56681// The above copyright notice and this permission notice shall be included
56682// in all copies or substantial portions of the Software.
56683//
56684// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
56685// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
56686// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
56687// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
56688// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
56689// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
56690// USE OR OTHER DEALINGS IN THE SOFTWARE.
56691
56692var formatRegExp = /%[sdj%]/g;
56693exports.format = function(f) {
56694 if (!isString(f)) {
56695 var objects = [];
56696 for (var i = 0; i < arguments.length; i++) {
56697 objects.push(inspect(arguments[i]));
56698 }
56699 return objects.join(' ');
56700 }
56701
56702 var i = 1;
56703 var args = arguments;
56704 var len = args.length;
56705 var str = String(f).replace(formatRegExp, function(x) {
56706 if (x === '%%') return '%';
56707 if (i >= len) return x;
56708 switch (x) {
56709 case '%s': return String(args[i++]);
56710 case '%d': return Number(args[i++]);
56711 case '%j':
56712 try {
56713 return JSON.stringify(args[i++]);
56714 } catch (_) {
56715 return '[Circular]';
56716 }
56717 default:
56718 return x;
56719 }
56720 });
56721 for (var x = args[i]; i < len; x = args[++i]) {
56722 if (isNull(x) || !isObject(x)) {
56723 str += ' ' + x;
56724 } else {
56725 str += ' ' + inspect(x);
56726 }
56727 }
56728 return str;
56729};
56730
56731
56732// Mark that a method should not be used.
56733// Returns a modified function which warns once by default.
56734// If --no-deprecation is set, then it is a no-op.
56735exports.deprecate = function(fn, msg) {
56736 // Allow for deprecating things in the process of starting up.
56737 if (isUndefined(global.process)) {
56738 return function() {
56739 return exports.deprecate(fn, msg).apply(this, arguments);
56740 };
56741 }
56742
56743 if (process.noDeprecation === true) {
56744 return fn;
56745 }
56746
56747 var warned = false;
56748 function deprecated() {
56749 if (!warned) {
56750 if (process.throwDeprecation) {
56751 throw new Error(msg);
56752 } else if (process.traceDeprecation) {
56753 console.trace(msg);
56754 } else {
56755 console.error(msg);
56756 }
56757 warned = true;
56758 }
56759 return fn.apply(this, arguments);
56760 }
56761
56762 return deprecated;
56763};
56764
56765
56766var debugs = {};
56767var debugEnviron;
56768exports.debuglog = function(set) {
56769 if (isUndefined(debugEnviron))
56770 debugEnviron = process.env.NODE_DEBUG || '';
56771 set = set.toUpperCase();
56772 if (!debugs[set]) {
56773 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
56774 var pid = process.pid;
56775 debugs[set] = function() {
56776 var msg = exports.format.apply(exports, arguments);
56777 console.error('%s %d: %s', set, pid, msg);
56778 };
56779 } else {
56780 debugs[set] = function() {};
56781 }
56782 }
56783 return debugs[set];
56784};
56785
56786
56787/**
56788 * Echos the value of a value. Trys to print the value out
56789 * in the best way possible given the different types.
56790 *
56791 * @param {Object} obj The object to print out.
56792 * @param {Object} opts Optional options object that alters the output.
56793 */
56794/* legacy: obj, showHidden, depth, colors*/
56795function inspect(obj, opts) {
56796 // default options
56797 var ctx = {
56798 seen: [],
56799 stylize: stylizeNoColor
56800 };
56801 // legacy...
56802 if (arguments.length >= 3) ctx.depth = arguments[2];
56803 if (arguments.length >= 4) ctx.colors = arguments[3];
56804 if (isBoolean(opts)) {
56805 // legacy...
56806 ctx.showHidden = opts;
56807 } else if (opts) {
56808 // got an "options" object
56809 exports._extend(ctx, opts);
56810 }
56811 // set default options
56812 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
56813 if (isUndefined(ctx.depth)) ctx.depth = 2;
56814 if (isUndefined(ctx.colors)) ctx.colors = false;
56815 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
56816 if (ctx.colors) ctx.stylize = stylizeWithColor;
56817 return formatValue(ctx, obj, ctx.depth);
56818}
56819exports.inspect = inspect;
56820
56821
56822// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
56823inspect.colors = {
56824 'bold' : [1, 22],
56825 'italic' : [3, 23],
56826 'underline' : [4, 24],
56827 'inverse' : [7, 27],
56828 'white' : [37, 39],
56829 'grey' : [90, 39],
56830 'black' : [30, 39],
56831 'blue' : [34, 39],
56832 'cyan' : [36, 39],
56833 'green' : [32, 39],
56834 'magenta' : [35, 39],
56835 'red' : [31, 39],
56836 'yellow' : [33, 39]
56837};
56838
56839// Don't use 'blue' not visible on cmd.exe
56840inspect.styles = {
56841 'special': 'cyan',
56842 'number': 'yellow',
56843 'boolean': 'yellow',
56844 'undefined': 'grey',
56845 'null': 'bold',
56846 'string': 'green',
56847 'date': 'magenta',
56848 // "name": intentionally not styling
56849 'regexp': 'red'
56850};
56851
56852
56853function stylizeWithColor(str, styleType) {
56854 var style = inspect.styles[styleType];
56855
56856 if (style) {
56857 return '\u001b[' + inspect.colors[style][0] + 'm' + str +
56858 '\u001b[' + inspect.colors[style][1] + 'm';
56859 } else {
56860 return str;
56861 }
56862}
56863
56864
56865function stylizeNoColor(str, styleType) {
56866 return str;
56867}
56868
56869
56870function arrayToHash(array) {
56871 var hash = {};
56872
56873 array.forEach(function(val, idx) {
56874 hash[val] = true;
56875 });
56876
56877 return hash;
56878}
56879
56880
56881function formatValue(ctx, value, recurseTimes) {
56882 // Provide a hook for user-specified inspect functions.
56883 // Check that value is an object with an inspect function on it
56884 if (ctx.customInspect &&
56885 value &&
56886 isFunction(value.inspect) &&
56887 // Filter out the util module, it's inspect function is special
56888 value.inspect !== exports.inspect &&
56889 // Also filter out any prototype objects using the circular check.
56890 !(value.constructor && value.constructor.prototype === value)) {
56891 var ret = value.inspect(recurseTimes, ctx);
56892 if (!isString(ret)) {
56893 ret = formatValue(ctx, ret, recurseTimes);
56894 }
56895 return ret;
56896 }
56897
56898 // Primitive types cannot have properties
56899 var primitive = formatPrimitive(ctx, value);
56900 if (primitive) {
56901 return primitive;
56902 }
56903
56904 // Look up the keys of the object.
56905 var keys = Object.keys(value);
56906 var visibleKeys = arrayToHash(keys);
56907
56908 if (ctx.showHidden) {
56909 keys = Object.getOwnPropertyNames(value);
56910 }
56911
56912 // IE doesn't make error fields non-enumerable
56913 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
56914 if (isError(value)
56915 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
56916 return formatError(value);
56917 }
56918
56919 // Some type of object without properties can be shortcutted.
56920 if (keys.length === 0) {
56921 if (isFunction(value)) {
56922 var name = value.name ? ': ' + value.name : '';
56923 return ctx.stylize('[Function' + name + ']', 'special');
56924 }
56925 if (isRegExp(value)) {
56926 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
56927 }
56928 if (isDate(value)) {
56929 return ctx.stylize(Date.prototype.toString.call(value), 'date');
56930 }
56931 if (isError(value)) {
56932 return formatError(value);
56933 }
56934 }
56935
56936 var base = '', array = false, braces = ['{', '}'];
56937
56938 // Make Array say that they are Array
56939 if (isArray(value)) {
56940 array = true;
56941 braces = ['[', ']'];
56942 }
56943
56944 // Make functions say that they are functions
56945 if (isFunction(value)) {
56946 var n = value.name ? ': ' + value.name : '';
56947 base = ' [Function' + n + ']';
56948 }
56949
56950 // Make RegExps say that they are RegExps
56951 if (isRegExp(value)) {
56952 base = ' ' + RegExp.prototype.toString.call(value);
56953 }
56954
56955 // Make dates with properties first say the date
56956 if (isDate(value)) {
56957 base = ' ' + Date.prototype.toUTCString.call(value);
56958 }
56959
56960 // Make error with message first say the error
56961 if (isError(value)) {
56962 base = ' ' + formatError(value);
56963 }
56964
56965 if (keys.length === 0 && (!array || value.length == 0)) {
56966 return braces[0] + base + braces[1];
56967 }
56968
56969 if (recurseTimes < 0) {
56970 if (isRegExp(value)) {
56971 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
56972 } else {
56973 return ctx.stylize('[Object]', 'special');
56974 }
56975 }
56976
56977 ctx.seen.push(value);
56978
56979 var output;
56980 if (array) {
56981 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
56982 } else {
56983 output = keys.map(function(key) {
56984 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
56985 });
56986 }
56987
56988 ctx.seen.pop();
56989
56990 return reduceToSingleString(output, base, braces);
56991}
56992
56993
56994function formatPrimitive(ctx, value) {
56995 if (isUndefined(value))
56996 return ctx.stylize('undefined', 'undefined');
56997 if (isString(value)) {
56998 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
56999 .replace(/'/g, "\\'")
57000 .replace(/\\"/g, '"') + '\'';
57001 return ctx.stylize(simple, 'string');
57002 }
57003 if (isNumber(value))
57004 return ctx.stylize('' + value, 'number');
57005 if (isBoolean(value))
57006 return ctx.stylize('' + value, 'boolean');
57007 // For some reason typeof null is "object", so special case here.
57008 if (isNull(value))
57009 return ctx.stylize('null', 'null');
57010}
57011
57012
57013function formatError(value) {
57014 return '[' + Error.prototype.toString.call(value) + ']';
57015}
57016
57017
57018function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
57019 var output = [];
57020 for (var i = 0, l = value.length; i < l; ++i) {
57021 if (hasOwnProperty(value, String(i))) {
57022 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
57023 String(i), true));
57024 } else {
57025 output.push('');
57026 }
57027 }
57028 keys.forEach(function(key) {
57029 if (!key.match(/^\d+$/)) {
57030 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
57031 key, true));
57032 }
57033 });
57034 return output;
57035}
57036
57037
57038function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
57039 var name, str, desc;
57040 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
57041 if (desc.get) {
57042 if (desc.set) {
57043 str = ctx.stylize('[Getter/Setter]', 'special');
57044 } else {
57045 str = ctx.stylize('[Getter]', 'special');
57046 }
57047 } else {
57048 if (desc.set) {
57049 str = ctx.stylize('[Setter]', 'special');
57050 }
57051 }
57052 if (!hasOwnProperty(visibleKeys, key)) {
57053 name = '[' + key + ']';
57054 }
57055 if (!str) {
57056 if (ctx.seen.indexOf(desc.value) < 0) {
57057 if (isNull(recurseTimes)) {
57058 str = formatValue(ctx, desc.value, null);
57059 } else {
57060 str = formatValue(ctx, desc.value, recurseTimes - 1);
57061 }
57062 if (str.indexOf('\n') > -1) {
57063 if (array) {
57064 str = str.split('\n').map(function(line) {
57065 return ' ' + line;
57066 }).join('\n').substr(2);
57067 } else {
57068 str = '\n' + str.split('\n').map(function(line) {
57069 return ' ' + line;
57070 }).join('\n');
57071 }
57072 }
57073 } else {
57074 str = ctx.stylize('[Circular]', 'special');
57075 }
57076 }
57077 if (isUndefined(name)) {
57078 if (array && key.match(/^\d+$/)) {
57079 return str;
57080 }
57081 name = JSON.stringify('' + key);
57082 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
57083 name = name.substr(1, name.length - 2);
57084 name = ctx.stylize(name, 'name');
57085 } else {
57086 name = name.replace(/'/g, "\\'")
57087 .replace(/\\"/g, '"')
57088 .replace(/(^"|"$)/g, "'");
57089 name = ctx.stylize(name, 'string');
57090 }
57091 }
57092
57093 return name + ': ' + str;
57094}
57095
57096
57097function reduceToSingleString(output, base, braces) {
57098 var numLinesEst = 0;
57099 var length = output.reduce(function(prev, cur) {
57100 numLinesEst++;
57101 if (cur.indexOf('\n') >= 0) numLinesEst++;
57102 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
57103 }, 0);
57104
57105 if (length > 60) {
57106 return braces[0] +
57107 (base === '' ? '' : base + '\n ') +
57108 ' ' +
57109 output.join(',\n ') +
57110 ' ' +
57111 braces[1];
57112 }
57113
57114 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
57115}
57116
57117
57118// NOTE: These type checking functions intentionally don't use `instanceof`
57119// because it is fragile and can be easily faked with `Object.create()`.
57120function isArray(ar) {
57121 return Array.isArray(ar);
57122}
57123exports.isArray = isArray;
57124
57125function isBoolean(arg) {
57126 return typeof arg === 'boolean';
57127}
57128exports.isBoolean = isBoolean;
57129
57130function isNull(arg) {
57131 return arg === null;
57132}
57133exports.isNull = isNull;
57134
57135function isNullOrUndefined(arg) {
57136 return arg == null;
57137}
57138exports.isNullOrUndefined = isNullOrUndefined;
57139
57140function isNumber(arg) {
57141 return typeof arg === 'number';
57142}
57143exports.isNumber = isNumber;
57144
57145function isString(arg) {
57146 return typeof arg === 'string';
57147}
57148exports.isString = isString;
57149
57150function isSymbol(arg) {
57151 return typeof arg === 'symbol';
57152}
57153exports.isSymbol = isSymbol;
57154
57155function isUndefined(arg) {
57156 return arg === void 0;
57157}
57158exports.isUndefined = isUndefined;
57159
57160function isRegExp(re) {
57161 return isObject(re) && objectToString(re) === '[object RegExp]';
57162}
57163exports.isRegExp = isRegExp;
57164
57165function isObject(arg) {
57166 return typeof arg === 'object' && arg !== null;
57167}
57168exports.isObject = isObject;
57169
57170function isDate(d) {
57171 return isObject(d) && objectToString(d) === '[object Date]';
57172}
57173exports.isDate = isDate;
57174
57175function isError(e) {
57176 return isObject(e) &&
57177 (objectToString(e) === '[object Error]' || e instanceof Error);
57178}
57179exports.isError = isError;
57180
57181function isFunction(arg) {
57182 return typeof arg === 'function';
57183}
57184exports.isFunction = isFunction;
57185
57186function isPrimitive(arg) {
57187 return arg === null ||
57188 typeof arg === 'boolean' ||
57189 typeof arg === 'number' ||
57190 typeof arg === 'string' ||
57191 typeof arg === 'symbol' || // ES6 symbol
57192 typeof arg === 'undefined';
57193}
57194exports.isPrimitive = isPrimitive;
57195
57196exports.isBuffer = require('./support/isBuffer');
57197
57198function objectToString(o) {
57199 return Object.prototype.toString.call(o);
57200}
57201
57202
57203function pad(n) {
57204 return n < 10 ? '0' + n.toString(10) : n.toString(10);
57205}
57206
57207
57208var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
57209 'Oct', 'Nov', 'Dec'];
57210
57211// 26 Feb 16:19:34
57212function timestamp() {
57213 var d = new Date();
57214 var time = [pad(d.getHours()),
57215 pad(d.getMinutes()),
57216 pad(d.getSeconds())].join(':');
57217 return [d.getDate(), months[d.getMonth()], time].join(' ');
57218}
57219
57220
57221// log is just a thin wrapper to console.log that prepends a timestamp
57222exports.log = function() {
57223 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
57224};
57225
57226
57227/**
57228 * Inherit the prototype methods from one constructor into another.
57229 *
57230 * The Function.prototype.inherits from lang.js rewritten as a standalone
57231 * function (not on Function.prototype). NOTE: If this file is to be loaded
57232 * during bootstrapping this function needs to be rewritten using some native
57233 * functions as prototype setup using normal JavaScript does not work as
57234 * expected during bootstrapping (see mirror.js in r114903).
57235 *
57236 * @param {function} ctor Constructor function which needs to inherit the
57237 * prototype.
57238 * @param {function} superCtor Constructor function to inherit prototype from.
57239 */
57240exports.inherits = require('inherits');
57241
57242exports._extend = function(origin, add) {
57243 // Don't do anything if add isn't an object
57244 if (!add || !isObject(add)) return origin;
57245
57246 var keys = Object.keys(add);
57247 var i = keys.length;
57248 while (i--) {
57249 origin[keys[i]] = add[keys[i]];
57250 }
57251 return origin;
57252};
57253
57254function hasOwnProperty(obj, prop) {
57255 return Object.prototype.hasOwnProperty.call(obj, prop);
57256}
57257
57258}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
57259},{"./support/isBuffer":29,"_process":13,"inherits":28}],31:[function(require,module,exports){
57260(function (Buffer){
57261const createKeccakHash = require('keccak')
57262const secp256k1 = require('secp256k1')
57263const assert = require('assert')
57264const rlp = require('rlp')
57265const BN = require('bn.js')
57266const createHash = require('create-hash')
57267Object.assign(exports, require('ethjs-util'))
57268
57269/**
57270 * the max integer that this VM can handle (a ```BN```)
57271 * @var {BN} MAX_INTEGER
57272 */
57273exports.MAX_INTEGER = new BN('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16)
57274
57275/**
57276 * 2^256 (a ```BN```)
57277 * @var {BN} TWO_POW256
57278 */
57279exports.TWO_POW256 = new BN('10000000000000000000000000000000000000000000000000000000000000000', 16)
57280
57281/**
57282 * SHA3-256 hash of null (a ```String```)
57283 * @var {String} SHA3_NULL_S
57284 */
57285exports.SHA3_NULL_S = 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'
57286
57287/**
57288 * SHA3-256 hash of null (a ```Buffer```)
57289 * @var {Buffer} SHA3_NULL
57290 */
57291exports.SHA3_NULL = Buffer.from(exports.SHA3_NULL_S, 'hex')
57292
57293/**
57294 * SHA3-256 of an RLP of an empty array (a ```String```)
57295 * @var {String} SHA3_RLP_ARRAY_S
57296 */
57297exports.SHA3_RLP_ARRAY_S = '1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
57298
57299/**
57300 * SHA3-256 of an RLP of an empty array (a ```Buffer```)
57301 * @var {Buffer} SHA3_RLP_ARRAY
57302 */
57303exports.SHA3_RLP_ARRAY = Buffer.from(exports.SHA3_RLP_ARRAY_S, 'hex')
57304
57305/**
57306 * SHA3-256 hash of the RLP of null (a ```String```)
57307 * @var {String} SHA3_RLP_S
57308 */
57309exports.SHA3_RLP_S = '56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
57310
57311/**
57312 * SHA3-256 hash of the RLP of null (a ```Buffer```)
57313 * @var {Buffer} SHA3_RLP
57314 */
57315exports.SHA3_RLP = Buffer.from(exports.SHA3_RLP_S, 'hex')
57316
57317/**
57318 * [`BN`](https://github.com/indutny/bn.js)
57319 * @var {Function}
57320 */
57321exports.BN = BN
57322
57323/**
57324 * [`rlp`](https://github.com/ethereumjs/rlp)
57325 * @var {Function}
57326 */
57327exports.rlp = rlp
57328
57329/**
57330 * [`secp256k1`](https://github.com/cryptocoinjs/secp256k1-node/)
57331 * @var {Object}
57332 */
57333exports.secp256k1 = secp256k1
57334
57335/**
57336 * Returns a buffer filled with 0s
57337 * @method zeros
57338 * @param {Number} bytes the number of bytes the buffer should be
57339 * @return {Buffer}
57340 */
57341exports.zeros = function (bytes) {
57342 return Buffer.allocUnsafe(bytes).fill(0)
57343}
57344
57345/**
57346 * Left Pads an `Array` or `Buffer` with leading zeros till it has `length` bytes.
57347 * Or it truncates the beginning if it exceeds.
57348 * @method lsetLength
57349 * @param {Buffer|Array} msg the value to pad
57350 * @param {Number} length the number of bytes the output should be
57351 * @param {Boolean} [right=false] whether to start padding form the left or right
57352 * @return {Buffer|Array}
57353 */
57354exports.setLengthLeft = exports.setLength = function (msg, length, right) {
57355 var buf = exports.zeros(length)
57356 msg = exports.toBuffer(msg)
57357 if (right) {
57358 if (msg.length < length) {
57359 msg.copy(buf)
57360 return buf
57361 }
57362 return msg.slice(0, length)
57363 } else {
57364 if (msg.length < length) {
57365 msg.copy(buf, length - msg.length)
57366 return buf
57367 }
57368 return msg.slice(-length)
57369 }
57370}
57371
57372/**
57373 * Right Pads an `Array` or `Buffer` with leading zeros till it has `length` bytes.
57374 * Or it truncates the beginning if it exceeds.
57375 * @param {Buffer|Array} msg the value to pad
57376 * @param {Number} length the number of bytes the output should be
57377 * @return {Buffer|Array}
57378 */
57379exports.setLengthRight = function (msg, length) {
57380 return exports.setLength(msg, length, true)
57381}
57382
57383/**
57384 * Trims leading zeros from a `Buffer` or an `Array`
57385 * @param {Buffer|Array|String} a
57386 * @return {Buffer|Array|String}
57387 */
57388exports.unpad = exports.stripZeros = function (a) {
57389 a = exports.stripHexPrefix(a)
57390 var first = a[0]
57391 while (a.length > 0 && first.toString() === '0') {
57392 a = a.slice(1)
57393 first = a[0]
57394 }
57395 return a
57396}
57397/**
57398 * Attempts to turn a value into a `Buffer`. As input it supports `Buffer`, `String`, `Number`, null/undefined, `BN` and other objects with a `toArray()` method.
57399 * @param {*} v the value
57400 */
57401exports.toBuffer = function (v) {
57402 if (!Buffer.isBuffer(v)) {
57403 if (Array.isArray(v)) {
57404 v = Buffer.from(v)
57405 } else if (typeof v === 'string') {
57406 if (exports.isHexPrefixed(v)) {
57407 v = Buffer.from(exports.padToEven(exports.stripHexPrefix(v)), 'hex')
57408 } else {
57409 v = Buffer.from(v)
57410 }
57411 } else if (typeof v === 'number') {
57412 v = exports.intToBuffer(v)
57413 } else if (v === null || v === undefined) {
57414 v = Buffer.allocUnsafe(0)
57415 } else if (v.toArray) {
57416 // converts a BN to a Buffer
57417 v = Buffer.from(v.toArray())
57418 } else {
57419 throw new Error('invalid type')
57420 }
57421 }
57422 return v
57423}
57424
57425/**
57426 * Converts a `Buffer` to a `Number`
57427 * @param {Buffer} buf
57428 * @return {Number}
57429 * @throws If the input number exceeds 53 bits.
57430 */
57431exports.bufferToInt = function (buf) {
57432 return new BN(exports.toBuffer(buf)).toNumber()
57433}
57434
57435/**
57436 * Converts a `Buffer` into a hex `String`
57437 * @param {Buffer} buf
57438 * @return {String}
57439 */
57440exports.bufferToHex = function (buf) {
57441 buf = exports.toBuffer(buf)
57442 return '0x' + buf.toString('hex')
57443}
57444
57445/**
57446 * Interprets a `Buffer` as a signed integer and returns a `BN`. Assumes 256-bit numbers.
57447 * @param {Buffer} num
57448 * @return {BN}
57449 */
57450exports.fromSigned = function (num) {
57451 return new BN(num).fromTwos(256)
57452}
57453
57454/**
57455 * Converts a `BN` to an unsigned integer and returns it as a `Buffer`. Assumes 256-bit numbers.
57456 * @param {BN} num
57457 * @return {Buffer}
57458 */
57459exports.toUnsigned = function (num) {
57460 return Buffer.from(num.toTwos(256).toArray())
57461}
57462
57463/**
57464 * Creates SHA-3 hash of the input
57465 * @param {Buffer|Array|String|Number} a the input data
57466 * @param {Number} [bits=256] the SHA width
57467 * @return {Buffer}
57468 */
57469exports.sha3 = function (a, bits) {
57470 a = exports.toBuffer(a)
57471 if (!bits) bits = 256
57472
57473 return createKeccakHash('keccak' + bits).update(a).digest()
57474}
57475
57476/**
57477 * Creates SHA256 hash of the input
57478 * @param {Buffer|Array|String|Number} a the input data
57479 * @return {Buffer}
57480 */
57481exports.sha256 = function (a) {
57482 a = exports.toBuffer(a)
57483 return createHash('sha256').update(a).digest()
57484}
57485
57486/**
57487 * Creates RIPEMD160 hash of the input
57488 * @param {Buffer|Array|String|Number} a the input data
57489 * @param {Boolean} padded whether it should be padded to 256 bits or not
57490 * @return {Buffer}
57491 */
57492exports.ripemd160 = function (a, padded) {
57493 a = exports.toBuffer(a)
57494 var hash = createHash('rmd160').update(a).digest()
57495 if (padded === true) {
57496 return exports.setLength(hash, 32)
57497 } else {
57498 return hash
57499 }
57500}
57501
57502/**
57503 * Creates SHA-3 hash of the RLP encoded version of the input
57504 * @param {Buffer|Array|String|Number} a the input data
57505 * @return {Buffer}
57506 */
57507exports.rlphash = function (a) {
57508 return exports.sha3(rlp.encode(a))
57509}
57510
57511/**
57512 * Checks if the private key satisfies the rules of the curve secp256k1.
57513 * @param {Buffer} privateKey
57514 * @return {Boolean}
57515 */
57516exports.isValidPrivate = function (privateKey) {
57517 return secp256k1.privateKeyVerify(privateKey)
57518}
57519
57520/**
57521 * Checks if the public key satisfies the rules of the curve secp256k1
57522 * and the requirements of Ethereum.
57523 * @param {Buffer} publicKey The two points of an uncompressed key, unless sanitize is enabled
57524 * @param {Boolean} [sanitize=false] Accept public keys in other formats
57525 * @return {Boolean}
57526 */
57527exports.isValidPublic = function (publicKey, sanitize) {
57528 if (publicKey.length === 64) {
57529 // Convert to SEC1 for secp256k1
57530 return secp256k1.publicKeyVerify(Buffer.concat([ Buffer.from([4]), publicKey ]))
57531 }
57532
57533 if (!sanitize) {
57534 return false
57535 }
57536
57537 return secp256k1.publicKeyVerify(publicKey)
57538}
57539
57540/**
57541 * Returns the ethereum address of a given public key.
57542 * Accepts "Ethereum public keys" and SEC1 encoded keys.
57543 * @param {Buffer} pubKey The two points of an uncompressed key, unless sanitize is enabled
57544 * @param {Boolean} [sanitize=false] Accept public keys in other formats
57545 * @return {Buffer}
57546 */
57547exports.pubToAddress = exports.publicToAddress = function (pubKey, sanitize) {
57548 pubKey = exports.toBuffer(pubKey)
57549 if (sanitize && (pubKey.length !== 64)) {
57550 pubKey = secp256k1.publicKeyConvert(pubKey, false).slice(1)
57551 }
57552 assert(pubKey.length === 64)
57553 // Only take the lower 160bits of the hash
57554 return exports.sha3(pubKey).slice(-20)
57555}
57556
57557/**
57558 * Returns the ethereum public key of a given private key
57559 * @param {Buffer} privateKey A private key must be 256 bits wide
57560 * @return {Buffer}
57561 */
57562var privateToPublic = exports.privateToPublic = function (privateKey) {
57563 privateKey = exports.toBuffer(privateKey)
57564 // skip the type flag and use the X, Y points
57565 return secp256k1.publicKeyCreate(privateKey, false).slice(1)
57566}
57567
57568/**
57569 * Converts a public key to the Ethereum format.
57570 * @param {Buffer} publicKey
57571 * @return {Buffer}
57572 */
57573exports.importPublic = function (publicKey) {
57574 publicKey = exports.toBuffer(publicKey)
57575 if (publicKey.length !== 64) {
57576 publicKey = secp256k1.publicKeyConvert(publicKey, false).slice(1)
57577 }
57578 return publicKey
57579}
57580
57581/**
57582 * ECDSA sign
57583 * @param {Buffer} msgHash
57584 * @param {Buffer} privateKey
57585 * @return {Object}
57586 */
57587exports.ecsign = function (msgHash, privateKey) {
57588 var sig = secp256k1.sign(msgHash, privateKey)
57589
57590 var ret = {}
57591 ret.r = sig.signature.slice(0, 32)
57592 ret.s = sig.signature.slice(32, 64)
57593 ret.v = sig.recovery + 27
57594 return ret
57595}
57596
57597/**
57598 * Returns the keccak-256 hash of `message`, prefixed with the header used by the `eth_sign` RPC call.
57599 * The output of this function can be fed into `ecsign` to produce the same signature as the `eth_sign`
57600 * call for a given `message`, or fed to `ecrecover` along with a signature to recover the public key
57601 * used to produce the signature.
57602 * @param message
57603 * @returns {Buffer} hash
57604 */
57605exports.hashPersonalMessage = function (message) {
57606 var prefix = exports.toBuffer('\u0019Ethereum Signed Message:\n' + message.length.toString())
57607 return exports.sha3(Buffer.concat([prefix, message]))
57608}
57609
57610/**
57611 * ECDSA public key recovery from signature
57612 * @param {Buffer} msgHash
57613 * @param {Number} v
57614 * @param {Buffer} r
57615 * @param {Buffer} s
57616 * @return {Buffer} publicKey
57617 */
57618exports.ecrecover = function (msgHash, v, r, s) {
57619 var signature = Buffer.concat([exports.setLength(r, 32), exports.setLength(s, 32)], 64)
57620 var recovery = v - 27
57621 if (recovery !== 0 && recovery !== 1) {
57622 throw new Error('Invalid signature v value')
57623 }
57624 var senderPubKey = secp256k1.recover(msgHash, signature, recovery)
57625 return secp256k1.publicKeyConvert(senderPubKey, false).slice(1)
57626}
57627
57628/**
57629 * Convert signature parameters into the format of `eth_sign` RPC method
57630 * @param {Number} v
57631 * @param {Buffer} r
57632 * @param {Buffer} s
57633 * @return {String} sig
57634 */
57635exports.toRpcSig = function (v, r, s) {
57636 // NOTE: with potential introduction of chainId this might need to be updated
57637 if (v !== 27 && v !== 28) {
57638 throw new Error('Invalid recovery id')
57639 }
57640
57641 // geth (and the RPC eth_sign method) uses the 65 byte format used by Bitcoin
57642 // FIXME: this might change in the future - https://github.com/ethereum/go-ethereum/issues/2053
57643 return exports.bufferToHex(Buffer.concat([
57644 exports.setLengthLeft(r, 32),
57645 exports.setLengthLeft(s, 32),
57646 exports.toBuffer(v - 27)
57647 ]))
57648}
57649
57650/**
57651 * Convert signature format of the `eth_sign` RPC method to signature parameters
57652 * NOTE: all because of a bug in geth: https://github.com/ethereum/go-ethereum/issues/2053
57653 * @param {String} sig
57654 * @return {Object}
57655 */
57656exports.fromRpcSig = function (sig) {
57657 sig = exports.toBuffer(sig)
57658
57659 // NOTE: with potential introduction of chainId this might need to be updated
57660 if (sig.length !== 65) {
57661 throw new Error('Invalid signature length')
57662 }
57663
57664 var v = sig[64]
57665 // support both versions of `eth_sign` responses
57666 if (v < 27) {
57667 v += 27
57668 }
57669
57670 return {
57671 v: v,
57672 r: sig.slice(0, 32),
57673 s: sig.slice(32, 64)
57674 }
57675}
57676
57677/**
57678 * Returns the ethereum address of a given private key
57679 * @param {Buffer} privateKey A private key must be 256 bits wide
57680 * @return {Buffer}
57681 */
57682exports.privateToAddress = function (privateKey) {
57683 return exports.publicToAddress(privateToPublic(privateKey))
57684}
57685
57686/**
57687 * Checks if the address is a valid. Accepts checksummed addresses too
57688 * @param {String} address
57689 * @return {Boolean}
57690 */
57691exports.isValidAddress = function (address) {
57692 return /^0x[0-9a-fA-F]{40}$/i.test(address)
57693}
57694
57695/**
57696 * Returns a checksummed address
57697 * @param {String} address
57698 * @return {String}
57699 */
57700exports.toChecksumAddress = function (address) {
57701 address = exports.stripHexPrefix(address).toLowerCase()
57702 var hash = exports.sha3(address).toString('hex')
57703 var ret = '0x'
57704
57705 for (var i = 0; i < address.length; i++) {
57706 if (parseInt(hash[i], 16) >= 8) {
57707 ret += address[i].toUpperCase()
57708 } else {
57709 ret += address[i]
57710 }
57711 }
57712
57713 return ret
57714}
57715
57716/**
57717 * Checks if the address is a valid checksummed address
57718 * @param {Buffer} address
57719 * @return {Boolean}
57720 */
57721exports.isValidChecksumAddress = function (address) {
57722 return exports.isValidAddress(address) && (exports.toChecksumAddress(address) === address)
57723}
57724
57725/**
57726 * Generates an address of a newly created contract
57727 * @param {Buffer} from the address which is creating this new address
57728 * @param {Buffer} nonce the nonce of the from account
57729 * @return {Buffer}
57730 */
57731exports.generateAddress = function (from, nonce) {
57732 from = exports.toBuffer(from)
57733 nonce = new BN(nonce)
57734
57735 if (nonce.isZero()) {
57736 // in RLP we want to encode null in the case of zero nonce
57737 // read the RLP documentation for an answer if you dare
57738 nonce = null
57739 } else {
57740 nonce = Buffer.from(nonce.toArray())
57741 }
57742
57743 // Only take the lower 160bits of the hash
57744 return exports.rlphash([from, nonce]).slice(-20)
57745}
57746
57747/**
57748 * Returns true if the supplied address belongs to a precompiled account
57749 * @param {Buffer|String} address
57750 * @return {Boolean}
57751 */
57752exports.isPrecompiled = function (address) {
57753 var a = exports.unpad(address)
57754 return a.length === 1 && a[0] > 0 && a[0] < 5
57755}
57756
57757/**
57758 * Adds "0x" to a given `String` if it does not already start with "0x"
57759 * @param {String} str
57760 * @return {String}
57761 */
57762exports.addHexPrefix = function (str) {
57763 if (typeof str !== 'string') {
57764 return str
57765 }
57766
57767 return exports.isHexPrefixed(str) ? str : '0x' + str
57768}
57769
57770/**
57771 * Validate ECDSA signature
57772 * @method isValidSignature
57773 * @param {Buffer} v
57774 * @param {Buffer} r
57775 * @param {Buffer} s
57776 * @param {Boolean} [homestead=true]
57777 * @return {Boolean}
57778 */
57779
57780exports.isValidSignature = function (v, r, s, homestead) {
57781 const SECP256K1_N_DIV_2 = new BN('7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0', 16)
57782 const SECP256K1_N = new BN('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141', 16)
57783
57784 if (r.length !== 32 || s.length !== 32) {
57785 return false
57786 }
57787
57788 if (v !== 27 && v !== 28) {
57789 return false
57790 }
57791
57792 r = new BN(r)
57793 s = new BN(s)
57794
57795 if (r.isZero() || r.gt(SECP256K1_N) || s.isZero() || s.gt(SECP256K1_N)) {
57796 return false
57797 }
57798
57799 if ((homestead === false) && (new BN(s).cmp(SECP256K1_N_DIV_2) === 1)) {
57800 return false
57801 }
57802
57803 return true
57804}
57805
57806/**
57807 * Converts a `Buffer` or `Array` to JSON
57808 * @param {Buffer|Array} ba
57809 * @return {Array|String|null}
57810 */
57811exports.baToJSON = function (ba) {
57812 if (Buffer.isBuffer(ba)) {
57813 return '0x' + ba.toString('hex')
57814 } else if (ba instanceof Array) {
57815 var array = []
57816 for (var i = 0; i < ba.length; i++) {
57817 array.push(exports.baToJSON(ba[i]))
57818 }
57819 return array
57820 }
57821}
57822
57823/**
57824 * Defines properties on a `Object`. It make the assumption that underlying data is binary.
57825 * @param {Object} self the `Object` to define properties on
57826 * @param {Array} fields an array fields to define. Fields can contain:
57827 * * `name` - the name of the properties
57828 * * `length` - the number of bytes the field can have
57829 * * `allowLess` - if the field can be less than the length
57830 * * `allowEmpty`
57831 * @param {*} data data to be validated against the definitions
57832 */
57833exports.defineProperties = function (self, fields, data) {
57834 self.raw = []
57835 self._fields = []
57836
57837 // attach the `toJSON`
57838 self.toJSON = function (label) {
57839 if (label) {
57840 var obj = {}
57841 self._fields.forEach(function (field) {
57842 obj[field] = '0x' + self[field].toString('hex')
57843 })
57844 return obj
57845 }
57846 return exports.baToJSON(this.raw)
57847 }
57848
57849 self.serialize = function serialize () {
57850 return rlp.encode(self.raw)
57851 }
57852
57853 fields.forEach(function (field, i) {
57854 self._fields.push(field.name)
57855 function getter () {
57856 return self.raw[i]
57857 }
57858 function setter (v) {
57859 v = exports.toBuffer(v)
57860
57861 if (v.toString('hex') === '00' && !field.allowZero) {
57862 v = Buffer.allocUnsafe(0)
57863 }
57864
57865 if (field.allowLess && field.length) {
57866 v = exports.stripZeros(v)
57867 assert(field.length >= v.length, 'The field ' + field.name + ' must not have more ' + field.length + ' bytes')
57868 } else if (!(field.allowZero && v.length === 0) && field.length) {
57869 assert(field.length === v.length, 'The field ' + field.name + ' must have byte length of ' + field.length)
57870 }
57871
57872 self.raw[i] = v
57873 }
57874
57875 Object.defineProperty(self, field.name, {
57876 enumerable: true,
57877 configurable: true,
57878 get: getter,
57879 set: setter
57880 })
57881
57882 if (field.default) {
57883 self[field.name] = field.default
57884 }
57885
57886 // attach alias
57887 if (field.alias) {
57888 Object.defineProperty(self, field.alias, {
57889 enumerable: false,
57890 configurable: true,
57891 set: setter,
57892 get: getter
57893 })
57894 }
57895 })
57896
57897 // if the constuctor is passed data
57898 if (data) {
57899 if (typeof data === 'string') {
57900 data = Buffer.from(exports.stripHexPrefix(data), 'hex')
57901 }
57902
57903 if (Buffer.isBuffer(data)) {
57904 data = rlp.decode(data)
57905 }
57906
57907 if (Array.isArray(data)) {
57908 if (data.length > self._fields.length) {
57909 throw (new Error('wrong number of fields in data'))
57910 }
57911
57912 // make sure all the items are buffers
57913 data.forEach(function (d, i) {
57914 self[self._fields[i]] = exports.toBuffer(d)
57915 })
57916 } else if (typeof data === 'object') {
57917 const keys = Object.keys(data)
57918 fields.forEach(function (field) {
57919 if (keys.indexOf(field.name) !== -1) self[field.name] = data[field.name]
57920 if (keys.indexOf(field.alias) !== -1) self[field.alias] = data[field.alias]
57921 })
57922 } else {
57923 throw new Error('invalid data')
57924 }
57925 }
57926}
57927
57928}).call(this,require("buffer").Buffer)
57929},{"assert":1,"bn.js":33,"buffer":5,"create-hash":36,"ethjs-util":56,"keccak":65,"rlp":72,"secp256k1":73}],32:[function(require,module,exports){
57930(function (Buffer){
57931// Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki
57932// Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]
57933// NOTE: SIGHASH byte ignored AND restricted, truncate before use
57934
57935function check (buffer) {
57936 if (buffer.length < 8) return false
57937 if (buffer.length > 72) return false
57938 if (buffer[0] !== 0x30) return false
57939 if (buffer[1] !== buffer.length - 2) return false
57940 if (buffer[2] !== 0x02) return false
57941
57942 var lenR = buffer[3]
57943 if (lenR === 0) return false
57944 if (5 + lenR >= buffer.length) return false
57945 if (buffer[4 + lenR] !== 0x02) return false
57946
57947 var lenS = buffer[5 + lenR]
57948 if (lenS === 0) return false
57949 if ((6 + lenR + lenS) !== buffer.length) return false
57950
57951 if (buffer[4] & 0x80) return false
57952 if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false
57953
57954 if (buffer[lenR + 6] & 0x80) return false
57955 if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false
57956 return true
57957}
57958
57959function decode (buffer) {
57960 if (buffer.length < 8) throw new Error('DER sequence length is too short')
57961 if (buffer.length > 72) throw new Error('DER sequence length is too long')
57962 if (buffer[0] !== 0x30) throw new Error('Expected DER sequence')
57963 if (buffer[1] !== buffer.length - 2) throw new Error('DER sequence length is invalid')
57964 if (buffer[2] !== 0x02) throw new Error('Expected DER integer')
57965
57966 var lenR = buffer[3]
57967 if (lenR === 0) throw new Error('R length is zero')
57968 if (5 + lenR >= buffer.length) throw new Error('R length is too long')
57969 if (buffer[4 + lenR] !== 0x02) throw new Error('Expected DER integer (2)')
57970
57971 var lenS = buffer[5 + lenR]
57972 if (lenS === 0) throw new Error('S length is zero')
57973 if ((6 + lenR + lenS) !== buffer.length) throw new Error('S length is invalid')
57974
57975 if (buffer[4] & 0x80) throw new Error('R value is negative')
57976 if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) throw new Error('R value excessively padded')
57977
57978 if (buffer[lenR + 6] & 0x80) throw new Error('S value is negative')
57979 if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) throw new Error('S value excessively padded')
57980
57981 // non-BIP66 - extract R, S values
57982 return {
57983 r: buffer.slice(4, 4 + lenR),
57984 s: buffer.slice(6 + lenR)
57985 }
57986}
57987
57988/*
57989 * Expects r and s to be positive DER integers.
57990 *
57991 * The DER format uses the most significant bit as a sign bit (& 0x80).
57992 * If the significant bit is set AND the integer is positive, a 0x00 is prepended.
57993 *
57994 * Examples:
57995 *
57996 * 0 => 0x00
57997 * 1 => 0x01
57998 * -1 => 0xff
57999 * 127 => 0x7f
58000 * -127 => 0x81
58001 * 128 => 0x0080
58002 * -128 => 0x80
58003 * 255 => 0x00ff
58004 * -255 => 0xff01
58005 * 16300 => 0x3fac
58006 * -16300 => 0xc054
58007 * 62300 => 0x00f35c
58008 * -62300 => 0xff0ca4
58009*/
58010function encode (r, s) {
58011 var lenR = r.length
58012 var lenS = s.length
58013 if (lenR === 0) throw new Error('R length is zero')
58014 if (lenS === 0) throw new Error('S length is zero')
58015 if (lenR > 33) throw new Error('R length is too long')
58016 if (lenS > 33) throw new Error('S length is too long')
58017 if (r[0] & 0x80) throw new Error('R value is negative')
58018 if (s[0] & 0x80) throw new Error('S value is negative')
58019 if (lenR > 1 && (r[0] === 0x00) && !(r[1] & 0x80)) throw new Error('R value excessively padded')
58020 if (lenS > 1 && (s[0] === 0x00) && !(s[1] & 0x80)) throw new Error('S value excessively padded')
58021
58022 var signature = new Buffer(6 + lenR + lenS)
58023
58024 // 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]
58025 signature[0] = 0x30
58026 signature[1] = signature.length - 2
58027 signature[2] = 0x02
58028 signature[3] = r.length
58029 r.copy(signature, 4)
58030 signature[4 + lenR] = 0x02
58031 signature[5 + lenR] = s.length
58032 s.copy(signature, 6 + lenR)
58033
58034 return signature
58035}
58036
58037module.exports = {
58038 check: check,
58039 decode: decode,
58040 encode: encode
58041}
58042
58043}).call(this,require("buffer").Buffer)
58044},{"buffer":5}],33:[function(require,module,exports){
58045(function (module, exports) {
58046 'use strict';
58047
58048 // Utils
58049 function assert (val, msg) {
58050 if (!val) throw new Error(msg || 'Assertion failed');
58051 }
58052
58053 // Could use `inherits` module, but don't want to move from single file
58054 // architecture yet.
58055 function inherits (ctor, superCtor) {
58056 ctor.super_ = superCtor;
58057 var TempCtor = function () {};
58058 TempCtor.prototype = superCtor.prototype;
58059 ctor.prototype = new TempCtor();
58060 ctor.prototype.constructor = ctor;
58061 }
58062
58063 // BN
58064
58065 function BN (number, base, endian) {
58066 if (BN.isBN(number)) {
58067 return number;
58068 }
58069
58070 this.negative = 0;
58071 this.words = null;
58072 this.length = 0;
58073
58074 // Reduction context
58075 this.red = null;
58076
58077 if (number !== null) {
58078 if (base === 'le' || base === 'be') {
58079 endian = base;
58080 base = 10;
58081 }
58082
58083 this._init(number || 0, base || 10, endian || 'be');
58084 }
58085 }
58086 if (typeof module === 'object') {
58087 module.exports = BN;
58088 } else {
58089 exports.BN = BN;
58090 }
58091
58092 BN.BN = BN;
58093 BN.wordSize = 26;
58094
58095 var Buffer;
58096 try {
58097 Buffer = require('buf' + 'fer').Buffer;
58098 } catch (e) {
58099 }
58100
58101 BN.isBN = function isBN (num) {
58102 if (num instanceof BN) {
58103 return true;
58104 }
58105
58106 return num !== null && typeof num === 'object' &&
58107 num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
58108 };
58109
58110 BN.max = function max (left, right) {
58111 if (left.cmp(right) > 0) return left;
58112 return right;
58113 };
58114
58115 BN.min = function min (left, right) {
58116 if (left.cmp(right) < 0) return left;
58117 return right;
58118 };
58119
58120 BN.prototype._init = function init (number, base, endian) {
58121 if (typeof number === 'number') {
58122 return this._initNumber(number, base, endian);
58123 }
58124
58125 if (typeof number === 'object') {
58126 return this._initArray(number, base, endian);
58127 }
58128
58129 if (base === 'hex') {
58130 base = 16;
58131 }
58132 assert(base === (base | 0) && base >= 2 && base <= 36);
58133
58134 number = number.toString().replace(/\s+/g, '');
58135 var start = 0;
58136 if (number[0] === '-') {
58137 start++;
58138 }
58139
58140 if (base === 16) {
58141 this._parseHex(number, start);
58142 } else {
58143 this._parseBase(number, base, start);
58144 }
58145
58146 if (number[0] === '-') {
58147 this.negative = 1;
58148 }
58149
58150 this.strip();
58151
58152 if (endian !== 'le') return;
58153
58154 this._initArray(this.toArray(), base, endian);
58155 };
58156
58157 BN.prototype._initNumber = function _initNumber (number, base, endian) {
58158 if (number < 0) {
58159 this.negative = 1;
58160 number = -number;
58161 }
58162 if (number < 0x4000000) {
58163 this.words = [ number & 0x3ffffff ];
58164 this.length = 1;
58165 } else if (number < 0x10000000000000) {
58166 this.words = [
58167 number & 0x3ffffff,
58168 (number / 0x4000000) & 0x3ffffff
58169 ];
58170 this.length = 2;
58171 } else {
58172 assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)
58173 this.words = [
58174 number & 0x3ffffff,
58175 (number / 0x4000000) & 0x3ffffff,
58176 1
58177 ];
58178 this.length = 3;
58179 }
58180
58181 if (endian !== 'le') return;
58182
58183 // Reverse the bytes
58184 this._initArray(this.toArray(), base, endian);
58185 };
58186
58187 BN.prototype._initArray = function _initArray (number, base, endian) {
58188 // Perhaps a Uint8Array
58189 assert(typeof number.length === 'number');
58190 if (number.length <= 0) {
58191 this.words = [ 0 ];
58192 this.length = 1;
58193 return this;
58194 }
58195
58196 this.length = Math.ceil(number.length / 3);
58197 this.words = new Array(this.length);
58198 for (var i = 0; i < this.length; i++) {
58199 this.words[i] = 0;
58200 }
58201
58202 var j, w;
58203 var off = 0;
58204 if (endian === 'be') {
58205 for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
58206 w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);
58207 this.words[j] |= (w << off) & 0x3ffffff;
58208 this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
58209 off += 24;
58210 if (off >= 26) {
58211 off -= 26;
58212 j++;
58213 }
58214 }
58215 } else if (endian === 'le') {
58216 for (i = 0, j = 0; i < number.length; i += 3) {
58217 w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);
58218 this.words[j] |= (w << off) & 0x3ffffff;
58219 this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
58220 off += 24;
58221 if (off >= 26) {
58222 off -= 26;
58223 j++;
58224 }
58225 }
58226 }
58227 return this.strip();
58228 };
58229
58230 function parseHex (str, start, end) {
58231 var r = 0;
58232 var len = Math.min(str.length, end);
58233 for (var i = start; i < len; i++) {
58234 var c = str.charCodeAt(i) - 48;
58235
58236 r <<= 4;
58237
58238 // 'a' - 'f'
58239 if (c >= 49 && c <= 54) {
58240 r |= c - 49 + 0xa;
58241
58242 // 'A' - 'F'
58243 } else if (c >= 17 && c <= 22) {
58244 r |= c - 17 + 0xa;
58245
58246 // '0' - '9'
58247 } else {
58248 r |= c & 0xf;
58249 }
58250 }
58251 return r;
58252 }
58253
58254 BN.prototype._parseHex = function _parseHex (number, start) {
58255 // Create possibly bigger array to ensure that it fits the number
58256 this.length = Math.ceil((number.length - start) / 6);
58257 this.words = new Array(this.length);
58258 for (var i = 0; i < this.length; i++) {
58259 this.words[i] = 0;
58260 }
58261
58262 var j, w;
58263 // Scan 24-bit chunks and add them to the number
58264 var off = 0;
58265 for (i = number.length - 6, j = 0; i >= start; i -= 6) {
58266 w = parseHex(number, i, i + 6);
58267 this.words[j] |= (w << off) & 0x3ffffff;
58268 // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb
58269 this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
58270 off += 24;
58271 if (off >= 26) {
58272 off -= 26;
58273 j++;
58274 }
58275 }
58276 if (i + 6 !== start) {
58277 w = parseHex(number, start, i + 6);
58278 this.words[j] |= (w << off) & 0x3ffffff;
58279 this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
58280 }
58281 this.strip();
58282 };
58283
58284 function parseBase (str, start, end, mul) {
58285 var r = 0;
58286 var len = Math.min(str.length, end);
58287 for (var i = start; i < len; i++) {
58288 var c = str.charCodeAt(i) - 48;
58289
58290 r *= mul;
58291
58292 // 'a'
58293 if (c >= 49) {
58294 r += c - 49 + 0xa;
58295
58296 // 'A'
58297 } else if (c >= 17) {
58298 r += c - 17 + 0xa;
58299
58300 // '0' - '9'
58301 } else {
58302 r += c;
58303 }
58304 }
58305 return r;
58306 }
58307
58308 BN.prototype._parseBase = function _parseBase (number, base, start) {
58309 // Initialize as zero
58310 this.words = [ 0 ];
58311 this.length = 1;
58312
58313 // Find length of limb in base
58314 for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {
58315 limbLen++;
58316 }
58317 limbLen--;
58318 limbPow = (limbPow / base) | 0;
58319
58320 var total = number.length - start;
58321 var mod = total % limbLen;
58322 var end = Math.min(total, total - mod) + start;
58323
58324 var word = 0;
58325 for (var i = start; i < end; i += limbLen) {
58326 word = parseBase(number, i, i + limbLen, base);
58327
58328 this.imuln(limbPow);
58329 if (this.words[0] + word < 0x4000000) {
58330 this.words[0] += word;
58331 } else {
58332 this._iaddn(word);
58333 }
58334 }
58335
58336 if (mod !== 0) {
58337 var pow = 1;
58338 word = parseBase(number, i, number.length, base);
58339
58340 for (i = 0; i < mod; i++) {
58341 pow *= base;
58342 }
58343
58344 this.imuln(pow);
58345 if (this.words[0] + word < 0x4000000) {
58346 this.words[0] += word;
58347 } else {
58348 this._iaddn(word);
58349 }
58350 }
58351 };
58352
58353 BN.prototype.copy = function copy (dest) {
58354 dest.words = new Array(this.length);
58355 for (var i = 0; i < this.length; i++) {
58356 dest.words[i] = this.words[i];
58357 }
58358 dest.length = this.length;
58359 dest.negative = this.negative;
58360 dest.red = this.red;
58361 };
58362
58363 BN.prototype.clone = function clone () {
58364 var r = new BN(null);
58365 this.copy(r);
58366 return r;
58367 };
58368
58369 BN.prototype._expand = function _expand (size) {
58370 while (this.length < size) {
58371 this.words[this.length++] = 0;
58372 }
58373 return this;
58374 };
58375
58376 // Remove leading `0` from `this`
58377 BN.prototype.strip = function strip () {
58378 while (this.length > 1 && this.words[this.length - 1] === 0) {
58379 this.length--;
58380 }
58381 return this._normSign();
58382 };
58383
58384 BN.prototype._normSign = function _normSign () {
58385 // -0 = 0
58386 if (this.length === 1 && this.words[0] === 0) {
58387 this.negative = 0;
58388 }
58389 return this;
58390 };
58391
58392 BN.prototype.inspect = function inspect () {
58393 return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';
58394 };
58395
58396 /*
58397
58398 var zeros = [];
58399 var groupSizes = [];
58400 var groupBases = [];
58401
58402 var s = '';
58403 var i = -1;
58404 while (++i < BN.wordSize) {
58405 zeros[i] = s;
58406 s += '0';
58407 }
58408 groupSizes[0] = 0;
58409 groupSizes[1] = 0;
58410 groupBases[0] = 0;
58411 groupBases[1] = 0;
58412 var base = 2 - 1;
58413 while (++base < 36 + 1) {
58414 var groupSize = 0;
58415 var groupBase = 1;
58416 while (groupBase < (1 << BN.wordSize) / base) {
58417 groupBase *= base;
58418 groupSize += 1;
58419 }
58420 groupSizes[base] = groupSize;
58421 groupBases[base] = groupBase;
58422 }
58423
58424 */
58425
58426 var zeros = [
58427 '',
58428 '0',
58429 '00',
58430 '000',
58431 '0000',
58432 '00000',
58433 '000000',
58434 '0000000',
58435 '00000000',
58436 '000000000',
58437 '0000000000',
58438 '00000000000',
58439 '000000000000',
58440 '0000000000000',
58441 '00000000000000',
58442 '000000000000000',
58443 '0000000000000000',
58444 '00000000000000000',
58445 '000000000000000000',
58446 '0000000000000000000',
58447 '00000000000000000000',
58448 '000000000000000000000',
58449 '0000000000000000000000',
58450 '00000000000000000000000',
58451 '000000000000000000000000',
58452 '0000000000000000000000000'
58453 ];
58454
58455 var groupSizes = [
58456 0, 0,
58457 25, 16, 12, 11, 10, 9, 8,
58458 8, 7, 7, 7, 7, 6, 6,
58459 6, 6, 6, 6, 6, 5, 5,
58460 5, 5, 5, 5, 5, 5, 5,
58461 5, 5, 5, 5, 5, 5, 5
58462 ];
58463
58464 var groupBases = [
58465 0, 0,
58466 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,
58467 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,
58468 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,
58469 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,
58470 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176
58471 ];
58472
58473 BN.prototype.toString = function toString (base, padding) {
58474 base = base || 10;
58475 padding = padding | 0 || 1;
58476
58477 var out;
58478 if (base === 16 || base === 'hex') {
58479 out = '';
58480 var off = 0;
58481 var carry = 0;
58482 for (var i = 0; i < this.length; i++) {
58483 var w = this.words[i];
58484 var word = (((w << off) | carry) & 0xffffff).toString(16);
58485 carry = (w >>> (24 - off)) & 0xffffff;
58486 if (carry !== 0 || i !== this.length - 1) {
58487 out = zeros[6 - word.length] + word + out;
58488 } else {
58489 out = word + out;
58490 }
58491 off += 2;
58492 if (off >= 26) {
58493 off -= 26;
58494 i--;
58495 }
58496 }
58497 if (carry !== 0) {
58498 out = carry.toString(16) + out;
58499 }
58500 while (out.length % padding !== 0) {
58501 out = '0' + out;
58502 }
58503 if (this.negative !== 0) {
58504 out = '-' + out;
58505 }
58506 return out;
58507 }
58508
58509 if (base === (base | 0) && base >= 2 && base <= 36) {
58510 // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));
58511 var groupSize = groupSizes[base];
58512 // var groupBase = Math.pow(base, groupSize);
58513 var groupBase = groupBases[base];
58514 out = '';
58515 var c = this.clone();
58516 c.negative = 0;
58517 while (!c.isZero()) {
58518 var r = c.modn(groupBase).toString(base);
58519 c = c.idivn(groupBase);
58520
58521 if (!c.isZero()) {
58522 out = zeros[groupSize - r.length] + r + out;
58523 } else {
58524 out = r + out;
58525 }
58526 }
58527 if (this.isZero()) {
58528 out = '0' + out;
58529 }
58530 while (out.length % padding !== 0) {
58531 out = '0' + out;
58532 }
58533 if (this.negative !== 0) {
58534 out = '-' + out;
58535 }
58536 return out;
58537 }
58538
58539 assert(false, 'Base should be between 2 and 36');
58540 };
58541
58542 BN.prototype.toNumber = function toNumber () {
58543 var ret = this.words[0];
58544 if (this.length === 2) {
58545 ret += this.words[1] * 0x4000000;
58546 } else if (this.length === 3 && this.words[2] === 0x01) {
58547 // NOTE: at this stage it is known that the top bit is set
58548 ret += 0x10000000000000 + (this.words[1] * 0x4000000);
58549 } else if (this.length > 2) {
58550 assert(false, 'Number can only safely store up to 53 bits');
58551 }
58552 return (this.negative !== 0) ? -ret : ret;
58553 };
58554
58555 BN.prototype.toJSON = function toJSON () {
58556 return this.toString(16);
58557 };
58558
58559 BN.prototype.toBuffer = function toBuffer (endian, length) {
58560 assert(typeof Buffer !== 'undefined');
58561 return this.toArrayLike(Buffer, endian, length);
58562 };
58563
58564 BN.prototype.toArray = function toArray (endian, length) {
58565 return this.toArrayLike(Array, endian, length);
58566 };
58567
58568 BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {
58569 var byteLength = this.byteLength();
58570 var reqLength = length || Math.max(1, byteLength);
58571 assert(byteLength <= reqLength, 'byte array longer than desired length');
58572 assert(reqLength > 0, 'Requested array length <= 0');
58573
58574 this.strip();
58575 var littleEndian = endian === 'le';
58576 var res = new ArrayType(reqLength);
58577
58578 var b, i;
58579 var q = this.clone();
58580 if (!littleEndian) {
58581 // Assume big-endian
58582 for (i = 0; i < reqLength - byteLength; i++) {
58583 res[i] = 0;
58584 }
58585
58586 for (i = 0; !q.isZero(); i++) {
58587 b = q.andln(0xff);
58588 q.iushrn(8);
58589
58590 res[reqLength - i - 1] = b;
58591 }
58592 } else {
58593 for (i = 0; !q.isZero(); i++) {
58594 b = q.andln(0xff);
58595 q.iushrn(8);
58596
58597 res[i] = b;
58598 }
58599
58600 for (; i < reqLength; i++) {
58601 res[i] = 0;
58602 }
58603 }
58604
58605 return res;
58606 };
58607
58608 if (Math.clz32) {
58609 BN.prototype._countBits = function _countBits (w) {
58610 return 32 - Math.clz32(w);
58611 };
58612 } else {
58613 BN.prototype._countBits = function _countBits (w) {
58614 var t = w;
58615 var r = 0;
58616 if (t >= 0x1000) {
58617 r += 13;
58618 t >>>= 13;
58619 }
58620 if (t >= 0x40) {
58621 r += 7;
58622 t >>>= 7;
58623 }
58624 if (t >= 0x8) {
58625 r += 4;
58626 t >>>= 4;
58627 }
58628 if (t >= 0x02) {
58629 r += 2;
58630 t >>>= 2;
58631 }
58632 return r + t;
58633 };
58634 }
58635
58636 BN.prototype._zeroBits = function _zeroBits (w) {
58637 // Short-cut
58638 if (w === 0) return 26;
58639
58640 var t = w;
58641 var r = 0;
58642 if ((t & 0x1fff) === 0) {
58643 r += 13;
58644 t >>>= 13;
58645 }
58646 if ((t & 0x7f) === 0) {
58647 r += 7;
58648 t >>>= 7;
58649 }
58650 if ((t & 0xf) === 0) {
58651 r += 4;
58652 t >>>= 4;
58653 }
58654 if ((t & 0x3) === 0) {
58655 r += 2;
58656 t >>>= 2;
58657 }
58658 if ((t & 0x1) === 0) {
58659 r++;
58660 }
58661 return r;
58662 };
58663
58664 // Return number of used bits in a BN
58665 BN.prototype.bitLength = function bitLength () {
58666 var w = this.words[this.length - 1];
58667 var hi = this._countBits(w);
58668 return (this.length - 1) * 26 + hi;
58669 };
58670
58671 function toBitArray (num) {
58672 var w = new Array(num.bitLength());
58673
58674 for (var bit = 0; bit < w.length; bit++) {
58675 var off = (bit / 26) | 0;
58676 var wbit = bit % 26;
58677
58678 w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;
58679 }
58680
58681 return w;
58682 }
58683
58684 // Number of trailing zero bits
58685 BN.prototype.zeroBits = function zeroBits () {
58686 if (this.isZero()) return 0;
58687
58688 var r = 0;
58689 for (var i = 0; i < this.length; i++) {
58690 var b = this._zeroBits(this.words[i]);
58691 r += b;
58692 if (b !== 26) break;
58693 }
58694 return r;
58695 };
58696
58697 BN.prototype.byteLength = function byteLength () {
58698 return Math.ceil(this.bitLength() / 8);
58699 };
58700
58701 BN.prototype.toTwos = function toTwos (width) {
58702 if (this.negative !== 0) {
58703 return this.abs().inotn(width).iaddn(1);
58704 }
58705 return this.clone();
58706 };
58707
58708 BN.prototype.fromTwos = function fromTwos (width) {
58709 if (this.testn(width - 1)) {
58710 return this.notn(width).iaddn(1).ineg();
58711 }
58712 return this.clone();
58713 };
58714
58715 BN.prototype.isNeg = function isNeg () {
58716 return this.negative !== 0;
58717 };
58718
58719 // Return negative clone of `this`
58720 BN.prototype.neg = function neg () {
58721 return this.clone().ineg();
58722 };
58723
58724 BN.prototype.ineg = function ineg () {
58725 if (!this.isZero()) {
58726 this.negative ^= 1;
58727 }
58728
58729 return this;
58730 };
58731
58732 // Or `num` with `this` in-place
58733 BN.prototype.iuor = function iuor (num) {
58734 while (this.length < num.length) {
58735 this.words[this.length++] = 0;
58736 }
58737
58738 for (var i = 0; i < num.length; i++) {
58739 this.words[i] = this.words[i] | num.words[i];
58740 }
58741
58742 return this.strip();
58743 };
58744
58745 BN.prototype.ior = function ior (num) {
58746 assert((this.negative | num.negative) === 0);
58747 return this.iuor(num);
58748 };
58749
58750 // Or `num` with `this`
58751 BN.prototype.or = function or (num) {
58752 if (this.length > num.length) return this.clone().ior(num);
58753 return num.clone().ior(this);
58754 };
58755
58756 BN.prototype.uor = function uor (num) {
58757 if (this.length > num.length) return this.clone().iuor(num);
58758 return num.clone().iuor(this);
58759 };
58760
58761 // And `num` with `this` in-place
58762 BN.prototype.iuand = function iuand (num) {
58763 // b = min-length(num, this)
58764 var b;
58765 if (this.length > num.length) {
58766 b = num;
58767 } else {
58768 b = this;
58769 }
58770
58771 for (var i = 0; i < b.length; i++) {
58772 this.words[i] = this.words[i] & num.words[i];
58773 }
58774
58775 this.length = b.length;
58776
58777 return this.strip();
58778 };
58779
58780 BN.prototype.iand = function iand (num) {
58781 assert((this.negative | num.negative) === 0);
58782 return this.iuand(num);
58783 };
58784
58785 // And `num` with `this`
58786 BN.prototype.and = function and (num) {
58787 if (this.length > num.length) return this.clone().iand(num);
58788 return num.clone().iand(this);
58789 };
58790
58791 BN.prototype.uand = function uand (num) {
58792 if (this.length > num.length) return this.clone().iuand(num);
58793 return num.clone().iuand(this);
58794 };
58795
58796 // Xor `num` with `this` in-place
58797 BN.prototype.iuxor = function iuxor (num) {
58798 // a.length > b.length
58799 var a;
58800 var b;
58801 if (this.length > num.length) {
58802 a = this;
58803 b = num;
58804 } else {
58805 a = num;
58806 b = this;
58807 }
58808
58809 for (var i = 0; i < b.length; i++) {
58810 this.words[i] = a.words[i] ^ b.words[i];
58811 }
58812
58813 if (this !== a) {
58814 for (; i < a.length; i++) {
58815 this.words[i] = a.words[i];
58816 }
58817 }
58818
58819 this.length = a.length;
58820
58821 return this.strip();
58822 };
58823
58824 BN.prototype.ixor = function ixor (num) {
58825 assert((this.negative | num.negative) === 0);
58826 return this.iuxor(num);
58827 };
58828
58829 // Xor `num` with `this`
58830 BN.prototype.xor = function xor (num) {
58831 if (this.length > num.length) return this.clone().ixor(num);
58832 return num.clone().ixor(this);
58833 };
58834
58835 BN.prototype.uxor = function uxor (num) {
58836 if (this.length > num.length) return this.clone().iuxor(num);
58837 return num.clone().iuxor(this);
58838 };
58839
58840 // Not ``this`` with ``width`` bitwidth
58841 BN.prototype.inotn = function inotn (width) {
58842 assert(typeof width === 'number' && width >= 0);
58843
58844 var bytesNeeded = Math.ceil(width / 26) | 0;
58845 var bitsLeft = width % 26;
58846
58847 // Extend the buffer with leading zeroes
58848 this._expand(bytesNeeded);
58849
58850 if (bitsLeft > 0) {
58851 bytesNeeded--;
58852 }
58853
58854 // Handle complete words
58855 for (var i = 0; i < bytesNeeded; i++) {
58856 this.words[i] = ~this.words[i] & 0x3ffffff;
58857 }
58858
58859 // Handle the residue
58860 if (bitsLeft > 0) {
58861 this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));
58862 }
58863
58864 // And remove leading zeroes
58865 return this.strip();
58866 };
58867
58868 BN.prototype.notn = function notn (width) {
58869 return this.clone().inotn(width);
58870 };
58871
58872 // Set `bit` of `this`
58873 BN.prototype.setn = function setn (bit, val) {
58874 assert(typeof bit === 'number' && bit >= 0);
58875
58876 var off = (bit / 26) | 0;
58877 var wbit = bit % 26;
58878
58879 this._expand(off + 1);
58880
58881 if (val) {
58882 this.words[off] = this.words[off] | (1 << wbit);
58883 } else {
58884 this.words[off] = this.words[off] & ~(1 << wbit);
58885 }
58886
58887 return this.strip();
58888 };
58889
58890 // Add `num` to `this` in-place
58891 BN.prototype.iadd = function iadd (num) {
58892 var r;
58893
58894 // negative + positive
58895 if (this.negative !== 0 && num.negative === 0) {
58896 this.negative = 0;
58897 r = this.isub(num);
58898 this.negative ^= 1;
58899 return this._normSign();
58900
58901 // positive + negative
58902 } else if (this.negative === 0 && num.negative !== 0) {
58903 num.negative = 0;
58904 r = this.isub(num);
58905 num.negative = 1;
58906 return r._normSign();
58907 }
58908
58909 // a.length > b.length
58910 var a, b;
58911 if (this.length > num.length) {
58912 a = this;
58913 b = num;
58914 } else {
58915 a = num;
58916 b = this;
58917 }
58918
58919 var carry = 0;
58920 for (var i = 0; i < b.length; i++) {
58921 r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
58922 this.words[i] = r & 0x3ffffff;
58923 carry = r >>> 26;
58924 }
58925 for (; carry !== 0 && i < a.length; i++) {
58926 r = (a.words[i] | 0) + carry;
58927 this.words[i] = r & 0x3ffffff;
58928 carry = r >>> 26;
58929 }
58930
58931 this.length = a.length;
58932 if (carry !== 0) {
58933 this.words[this.length] = carry;
58934 this.length++;
58935 // Copy the rest of the words
58936 } else if (a !== this) {
58937 for (; i < a.length; i++) {
58938 this.words[i] = a.words[i];
58939 }
58940 }
58941
58942 return this;
58943 };
58944
58945 // Add `num` to `this`
58946 BN.prototype.add = function add (num) {
58947 var res;
58948 if (num.negative !== 0 && this.negative === 0) {
58949 num.negative = 0;
58950 res = this.sub(num);
58951 num.negative ^= 1;
58952 return res;
58953 } else if (num.negative === 0 && this.negative !== 0) {
58954 this.negative = 0;
58955 res = num.sub(this);
58956 this.negative = 1;
58957 return res;
58958 }
58959
58960 if (this.length > num.length) return this.clone().iadd(num);
58961
58962 return num.clone().iadd(this);
58963 };
58964
58965 // Subtract `num` from `this` in-place
58966 BN.prototype.isub = function isub (num) {
58967 // this - (-num) = this + num
58968 if (num.negative !== 0) {
58969 num.negative = 0;
58970 var r = this.iadd(num);
58971 num.negative = 1;
58972 return r._normSign();
58973
58974 // -this - num = -(this + num)
58975 } else if (this.negative !== 0) {
58976 this.negative = 0;
58977 this.iadd(num);
58978 this.negative = 1;
58979 return this._normSign();
58980 }
58981
58982 // At this point both numbers are positive
58983 var cmp = this.cmp(num);
58984
58985 // Optimization - zeroify
58986 if (cmp === 0) {
58987 this.negative = 0;
58988 this.length = 1;
58989 this.words[0] = 0;
58990 return this;
58991 }
58992
58993 // a > b
58994 var a, b;
58995 if (cmp > 0) {
58996 a = this;
58997 b = num;
58998 } else {
58999 a = num;
59000 b = this;
59001 }
59002
59003 var carry = 0;
59004 for (var i = 0; i < b.length; i++) {
59005 r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
59006 carry = r >> 26;
59007 this.words[i] = r & 0x3ffffff;
59008 }
59009 for (; carry !== 0 && i < a.length; i++) {
59010 r = (a.words[i] | 0) + carry;
59011 carry = r >> 26;
59012 this.words[i] = r & 0x3ffffff;
59013 }
59014
59015 // Copy rest of the words
59016 if (carry === 0 && i < a.length && a !== this) {
59017 for (; i < a.length; i++) {
59018 this.words[i] = a.words[i];
59019 }
59020 }
59021
59022 this.length = Math.max(this.length, i);
59023
59024 if (a !== this) {
59025 this.negative = 1;
59026 }
59027
59028 return this.strip();
59029 };
59030
59031 // Subtract `num` from `this`
59032 BN.prototype.sub = function sub (num) {
59033 return this.clone().isub(num);
59034 };
59035
59036 function smallMulTo (self, num, out) {
59037 out.negative = num.negative ^ self.negative;
59038 var len = (self.length + num.length) | 0;
59039 out.length = len;
59040 len = (len - 1) | 0;
59041
59042 // Peel one iteration (compiler can't do it, because of code complexity)
59043 var a = self.words[0] | 0;
59044 var b = num.words[0] | 0;
59045 var r = a * b;
59046
59047 var lo = r & 0x3ffffff;
59048 var carry = (r / 0x4000000) | 0;
59049 out.words[0] = lo;
59050
59051 for (var k = 1; k < len; k++) {
59052 // Sum all words with the same `i + j = k` and accumulate `ncarry`,
59053 // note that ncarry could be >= 0x3ffffff
59054 var ncarry = carry >>> 26;
59055 var rword = carry & 0x3ffffff;
59056 var maxJ = Math.min(k, num.length - 1);
59057 for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
59058 var i = (k - j) | 0;
59059 a = self.words[i] | 0;
59060 b = num.words[j] | 0;
59061 r = a * b + rword;
59062 ncarry += (r / 0x4000000) | 0;
59063 rword = r & 0x3ffffff;
59064 }
59065 out.words[k] = rword | 0;
59066 carry = ncarry | 0;
59067 }
59068 if (carry !== 0) {
59069 out.words[k] = carry | 0;
59070 } else {
59071 out.length--;
59072 }
59073
59074 return out.strip();
59075 }
59076
59077 // TODO(indutny): it may be reasonable to omit it for users who don't need
59078 // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit
59079 // multiplication (like elliptic secp256k1).
59080 var comb10MulTo = function comb10MulTo (self, num, out) {
59081 var a = self.words;
59082 var b = num.words;
59083 var o = out.words;
59084 var c = 0;
59085 var lo;
59086 var mid;
59087 var hi;
59088 var a0 = a[0] | 0;
59089 var al0 = a0 & 0x1fff;
59090 var ah0 = a0 >>> 13;
59091 var a1 = a[1] | 0;
59092 var al1 = a1 & 0x1fff;
59093 var ah1 = a1 >>> 13;
59094 var a2 = a[2] | 0;
59095 var al2 = a2 & 0x1fff;
59096 var ah2 = a2 >>> 13;
59097 var a3 = a[3] | 0;
59098 var al3 = a3 & 0x1fff;
59099 var ah3 = a3 >>> 13;
59100 var a4 = a[4] | 0;
59101 var al4 = a4 & 0x1fff;
59102 var ah4 = a4 >>> 13;
59103 var a5 = a[5] | 0;
59104 var al5 = a5 & 0x1fff;
59105 var ah5 = a5 >>> 13;
59106 var a6 = a[6] | 0;
59107 var al6 = a6 & 0x1fff;
59108 var ah6 = a6 >>> 13;
59109 var a7 = a[7] | 0;
59110 var al7 = a7 & 0x1fff;
59111 var ah7 = a7 >>> 13;
59112 var a8 = a[8] | 0;
59113 var al8 = a8 & 0x1fff;
59114 var ah8 = a8 >>> 13;
59115 var a9 = a[9] | 0;
59116 var al9 = a9 & 0x1fff;
59117 var ah9 = a9 >>> 13;
59118 var b0 = b[0] | 0;
59119 var bl0 = b0 & 0x1fff;
59120 var bh0 = b0 >>> 13;
59121 var b1 = b[1] | 0;
59122 var bl1 = b1 & 0x1fff;
59123 var bh1 = b1 >>> 13;
59124 var b2 = b[2] | 0;
59125 var bl2 = b2 & 0x1fff;
59126 var bh2 = b2 >>> 13;
59127 var b3 = b[3] | 0;
59128 var bl3 = b3 & 0x1fff;
59129 var bh3 = b3 >>> 13;
59130 var b4 = b[4] | 0;
59131 var bl4 = b4 & 0x1fff;
59132 var bh4 = b4 >>> 13;
59133 var b5 = b[5] | 0;
59134 var bl5 = b5 & 0x1fff;
59135 var bh5 = b5 >>> 13;
59136 var b6 = b[6] | 0;
59137 var bl6 = b6 & 0x1fff;
59138 var bh6 = b6 >>> 13;
59139 var b7 = b[7] | 0;
59140 var bl7 = b7 & 0x1fff;
59141 var bh7 = b7 >>> 13;
59142 var b8 = b[8] | 0;
59143 var bl8 = b8 & 0x1fff;
59144 var bh8 = b8 >>> 13;
59145 var b9 = b[9] | 0;
59146 var bl9 = b9 & 0x1fff;
59147 var bh9 = b9 >>> 13;
59148
59149 out.negative = self.negative ^ num.negative;
59150 out.length = 19;
59151 /* k = 0 */
59152 lo = Math.imul(al0, bl0);
59153 mid = Math.imul(al0, bh0);
59154 mid = (mid + Math.imul(ah0, bl0)) | 0;
59155 hi = Math.imul(ah0, bh0);
59156 var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59157 c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;
59158 w0 &= 0x3ffffff;
59159 /* k = 1 */
59160 lo = Math.imul(al1, bl0);
59161 mid = Math.imul(al1, bh0);
59162 mid = (mid + Math.imul(ah1, bl0)) | 0;
59163 hi = Math.imul(ah1, bh0);
59164 lo = (lo + Math.imul(al0, bl1)) | 0;
59165 mid = (mid + Math.imul(al0, bh1)) | 0;
59166 mid = (mid + Math.imul(ah0, bl1)) | 0;
59167 hi = (hi + Math.imul(ah0, bh1)) | 0;
59168 var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59169 c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;
59170 w1 &= 0x3ffffff;
59171 /* k = 2 */
59172 lo = Math.imul(al2, bl0);
59173 mid = Math.imul(al2, bh0);
59174 mid = (mid + Math.imul(ah2, bl0)) | 0;
59175 hi = Math.imul(ah2, bh0);
59176 lo = (lo + Math.imul(al1, bl1)) | 0;
59177 mid = (mid + Math.imul(al1, bh1)) | 0;
59178 mid = (mid + Math.imul(ah1, bl1)) | 0;
59179 hi = (hi + Math.imul(ah1, bh1)) | 0;
59180 lo = (lo + Math.imul(al0, bl2)) | 0;
59181 mid = (mid + Math.imul(al0, bh2)) | 0;
59182 mid = (mid + Math.imul(ah0, bl2)) | 0;
59183 hi = (hi + Math.imul(ah0, bh2)) | 0;
59184 var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59185 c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;
59186 w2 &= 0x3ffffff;
59187 /* k = 3 */
59188 lo = Math.imul(al3, bl0);
59189 mid = Math.imul(al3, bh0);
59190 mid = (mid + Math.imul(ah3, bl0)) | 0;
59191 hi = Math.imul(ah3, bh0);
59192 lo = (lo + Math.imul(al2, bl1)) | 0;
59193 mid = (mid + Math.imul(al2, bh1)) | 0;
59194 mid = (mid + Math.imul(ah2, bl1)) | 0;
59195 hi = (hi + Math.imul(ah2, bh1)) | 0;
59196 lo = (lo + Math.imul(al1, bl2)) | 0;
59197 mid = (mid + Math.imul(al1, bh2)) | 0;
59198 mid = (mid + Math.imul(ah1, bl2)) | 0;
59199 hi = (hi + Math.imul(ah1, bh2)) | 0;
59200 lo = (lo + Math.imul(al0, bl3)) | 0;
59201 mid = (mid + Math.imul(al0, bh3)) | 0;
59202 mid = (mid + Math.imul(ah0, bl3)) | 0;
59203 hi = (hi + Math.imul(ah0, bh3)) | 0;
59204 var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59205 c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;
59206 w3 &= 0x3ffffff;
59207 /* k = 4 */
59208 lo = Math.imul(al4, bl0);
59209 mid = Math.imul(al4, bh0);
59210 mid = (mid + Math.imul(ah4, bl0)) | 0;
59211 hi = Math.imul(ah4, bh0);
59212 lo = (lo + Math.imul(al3, bl1)) | 0;
59213 mid = (mid + Math.imul(al3, bh1)) | 0;
59214 mid = (mid + Math.imul(ah3, bl1)) | 0;
59215 hi = (hi + Math.imul(ah3, bh1)) | 0;
59216 lo = (lo + Math.imul(al2, bl2)) | 0;
59217 mid = (mid + Math.imul(al2, bh2)) | 0;
59218 mid = (mid + Math.imul(ah2, bl2)) | 0;
59219 hi = (hi + Math.imul(ah2, bh2)) | 0;
59220 lo = (lo + Math.imul(al1, bl3)) | 0;
59221 mid = (mid + Math.imul(al1, bh3)) | 0;
59222 mid = (mid + Math.imul(ah1, bl3)) | 0;
59223 hi = (hi + Math.imul(ah1, bh3)) | 0;
59224 lo = (lo + Math.imul(al0, bl4)) | 0;
59225 mid = (mid + Math.imul(al0, bh4)) | 0;
59226 mid = (mid + Math.imul(ah0, bl4)) | 0;
59227 hi = (hi + Math.imul(ah0, bh4)) | 0;
59228 var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59229 c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;
59230 w4 &= 0x3ffffff;
59231 /* k = 5 */
59232 lo = Math.imul(al5, bl0);
59233 mid = Math.imul(al5, bh0);
59234 mid = (mid + Math.imul(ah5, bl0)) | 0;
59235 hi = Math.imul(ah5, bh0);
59236 lo = (lo + Math.imul(al4, bl1)) | 0;
59237 mid = (mid + Math.imul(al4, bh1)) | 0;
59238 mid = (mid + Math.imul(ah4, bl1)) | 0;
59239 hi = (hi + Math.imul(ah4, bh1)) | 0;
59240 lo = (lo + Math.imul(al3, bl2)) | 0;
59241 mid = (mid + Math.imul(al3, bh2)) | 0;
59242 mid = (mid + Math.imul(ah3, bl2)) | 0;
59243 hi = (hi + Math.imul(ah3, bh2)) | 0;
59244 lo = (lo + Math.imul(al2, bl3)) | 0;
59245 mid = (mid + Math.imul(al2, bh3)) | 0;
59246 mid = (mid + Math.imul(ah2, bl3)) | 0;
59247 hi = (hi + Math.imul(ah2, bh3)) | 0;
59248 lo = (lo + Math.imul(al1, bl4)) | 0;
59249 mid = (mid + Math.imul(al1, bh4)) | 0;
59250 mid = (mid + Math.imul(ah1, bl4)) | 0;
59251 hi = (hi + Math.imul(ah1, bh4)) | 0;
59252 lo = (lo + Math.imul(al0, bl5)) | 0;
59253 mid = (mid + Math.imul(al0, bh5)) | 0;
59254 mid = (mid + Math.imul(ah0, bl5)) | 0;
59255 hi = (hi + Math.imul(ah0, bh5)) | 0;
59256 var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59257 c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;
59258 w5 &= 0x3ffffff;
59259 /* k = 6 */
59260 lo = Math.imul(al6, bl0);
59261 mid = Math.imul(al6, bh0);
59262 mid = (mid + Math.imul(ah6, bl0)) | 0;
59263 hi = Math.imul(ah6, bh0);
59264 lo = (lo + Math.imul(al5, bl1)) | 0;
59265 mid = (mid + Math.imul(al5, bh1)) | 0;
59266 mid = (mid + Math.imul(ah5, bl1)) | 0;
59267 hi = (hi + Math.imul(ah5, bh1)) | 0;
59268 lo = (lo + Math.imul(al4, bl2)) | 0;
59269 mid = (mid + Math.imul(al4, bh2)) | 0;
59270 mid = (mid + Math.imul(ah4, bl2)) | 0;
59271 hi = (hi + Math.imul(ah4, bh2)) | 0;
59272 lo = (lo + Math.imul(al3, bl3)) | 0;
59273 mid = (mid + Math.imul(al3, bh3)) | 0;
59274 mid = (mid + Math.imul(ah3, bl3)) | 0;
59275 hi = (hi + Math.imul(ah3, bh3)) | 0;
59276 lo = (lo + Math.imul(al2, bl4)) | 0;
59277 mid = (mid + Math.imul(al2, bh4)) | 0;
59278 mid = (mid + Math.imul(ah2, bl4)) | 0;
59279 hi = (hi + Math.imul(ah2, bh4)) | 0;
59280 lo = (lo + Math.imul(al1, bl5)) | 0;
59281 mid = (mid + Math.imul(al1, bh5)) | 0;
59282 mid = (mid + Math.imul(ah1, bl5)) | 0;
59283 hi = (hi + Math.imul(ah1, bh5)) | 0;
59284 lo = (lo + Math.imul(al0, bl6)) | 0;
59285 mid = (mid + Math.imul(al0, bh6)) | 0;
59286 mid = (mid + Math.imul(ah0, bl6)) | 0;
59287 hi = (hi + Math.imul(ah0, bh6)) | 0;
59288 var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59289 c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;
59290 w6 &= 0x3ffffff;
59291 /* k = 7 */
59292 lo = Math.imul(al7, bl0);
59293 mid = Math.imul(al7, bh0);
59294 mid = (mid + Math.imul(ah7, bl0)) | 0;
59295 hi = Math.imul(ah7, bh0);
59296 lo = (lo + Math.imul(al6, bl1)) | 0;
59297 mid = (mid + Math.imul(al6, bh1)) | 0;
59298 mid = (mid + Math.imul(ah6, bl1)) | 0;
59299 hi = (hi + Math.imul(ah6, bh1)) | 0;
59300 lo = (lo + Math.imul(al5, bl2)) | 0;
59301 mid = (mid + Math.imul(al5, bh2)) | 0;
59302 mid = (mid + Math.imul(ah5, bl2)) | 0;
59303 hi = (hi + Math.imul(ah5, bh2)) | 0;
59304 lo = (lo + Math.imul(al4, bl3)) | 0;
59305 mid = (mid + Math.imul(al4, bh3)) | 0;
59306 mid = (mid + Math.imul(ah4, bl3)) | 0;
59307 hi = (hi + Math.imul(ah4, bh3)) | 0;
59308 lo = (lo + Math.imul(al3, bl4)) | 0;
59309 mid = (mid + Math.imul(al3, bh4)) | 0;
59310 mid = (mid + Math.imul(ah3, bl4)) | 0;
59311 hi = (hi + Math.imul(ah3, bh4)) | 0;
59312 lo = (lo + Math.imul(al2, bl5)) | 0;
59313 mid = (mid + Math.imul(al2, bh5)) | 0;
59314 mid = (mid + Math.imul(ah2, bl5)) | 0;
59315 hi = (hi + Math.imul(ah2, bh5)) | 0;
59316 lo = (lo + Math.imul(al1, bl6)) | 0;
59317 mid = (mid + Math.imul(al1, bh6)) | 0;
59318 mid = (mid + Math.imul(ah1, bl6)) | 0;
59319 hi = (hi + Math.imul(ah1, bh6)) | 0;
59320 lo = (lo + Math.imul(al0, bl7)) | 0;
59321 mid = (mid + Math.imul(al0, bh7)) | 0;
59322 mid = (mid + Math.imul(ah0, bl7)) | 0;
59323 hi = (hi + Math.imul(ah0, bh7)) | 0;
59324 var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59325 c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;
59326 w7 &= 0x3ffffff;
59327 /* k = 8 */
59328 lo = Math.imul(al8, bl0);
59329 mid = Math.imul(al8, bh0);
59330 mid = (mid + Math.imul(ah8, bl0)) | 0;
59331 hi = Math.imul(ah8, bh0);
59332 lo = (lo + Math.imul(al7, bl1)) | 0;
59333 mid = (mid + Math.imul(al7, bh1)) | 0;
59334 mid = (mid + Math.imul(ah7, bl1)) | 0;
59335 hi = (hi + Math.imul(ah7, bh1)) | 0;
59336 lo = (lo + Math.imul(al6, bl2)) | 0;
59337 mid = (mid + Math.imul(al6, bh2)) | 0;
59338 mid = (mid + Math.imul(ah6, bl2)) | 0;
59339 hi = (hi + Math.imul(ah6, bh2)) | 0;
59340 lo = (lo + Math.imul(al5, bl3)) | 0;
59341 mid = (mid + Math.imul(al5, bh3)) | 0;
59342 mid = (mid + Math.imul(ah5, bl3)) | 0;
59343 hi = (hi + Math.imul(ah5, bh3)) | 0;
59344 lo = (lo + Math.imul(al4, bl4)) | 0;
59345 mid = (mid + Math.imul(al4, bh4)) | 0;
59346 mid = (mid + Math.imul(ah4, bl4)) | 0;
59347 hi = (hi + Math.imul(ah4, bh4)) | 0;
59348 lo = (lo + Math.imul(al3, bl5)) | 0;
59349 mid = (mid + Math.imul(al3, bh5)) | 0;
59350 mid = (mid + Math.imul(ah3, bl5)) | 0;
59351 hi = (hi + Math.imul(ah3, bh5)) | 0;
59352 lo = (lo + Math.imul(al2, bl6)) | 0;
59353 mid = (mid + Math.imul(al2, bh6)) | 0;
59354 mid = (mid + Math.imul(ah2, bl6)) | 0;
59355 hi = (hi + Math.imul(ah2, bh6)) | 0;
59356 lo = (lo + Math.imul(al1, bl7)) | 0;
59357 mid = (mid + Math.imul(al1, bh7)) | 0;
59358 mid = (mid + Math.imul(ah1, bl7)) | 0;
59359 hi = (hi + Math.imul(ah1, bh7)) | 0;
59360 lo = (lo + Math.imul(al0, bl8)) | 0;
59361 mid = (mid + Math.imul(al0, bh8)) | 0;
59362 mid = (mid + Math.imul(ah0, bl8)) | 0;
59363 hi = (hi + Math.imul(ah0, bh8)) | 0;
59364 var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59365 c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;
59366 w8 &= 0x3ffffff;
59367 /* k = 9 */
59368 lo = Math.imul(al9, bl0);
59369 mid = Math.imul(al9, bh0);
59370 mid = (mid + Math.imul(ah9, bl0)) | 0;
59371 hi = Math.imul(ah9, bh0);
59372 lo = (lo + Math.imul(al8, bl1)) | 0;
59373 mid = (mid + Math.imul(al8, bh1)) | 0;
59374 mid = (mid + Math.imul(ah8, bl1)) | 0;
59375 hi = (hi + Math.imul(ah8, bh1)) | 0;
59376 lo = (lo + Math.imul(al7, bl2)) | 0;
59377 mid = (mid + Math.imul(al7, bh2)) | 0;
59378 mid = (mid + Math.imul(ah7, bl2)) | 0;
59379 hi = (hi + Math.imul(ah7, bh2)) | 0;
59380 lo = (lo + Math.imul(al6, bl3)) | 0;
59381 mid = (mid + Math.imul(al6, bh3)) | 0;
59382 mid = (mid + Math.imul(ah6, bl3)) | 0;
59383 hi = (hi + Math.imul(ah6, bh3)) | 0;
59384 lo = (lo + Math.imul(al5, bl4)) | 0;
59385 mid = (mid + Math.imul(al5, bh4)) | 0;
59386 mid = (mid + Math.imul(ah5, bl4)) | 0;
59387 hi = (hi + Math.imul(ah5, bh4)) | 0;
59388 lo = (lo + Math.imul(al4, bl5)) | 0;
59389 mid = (mid + Math.imul(al4, bh5)) | 0;
59390 mid = (mid + Math.imul(ah4, bl5)) | 0;
59391 hi = (hi + Math.imul(ah4, bh5)) | 0;
59392 lo = (lo + Math.imul(al3, bl6)) | 0;
59393 mid = (mid + Math.imul(al3, bh6)) | 0;
59394 mid = (mid + Math.imul(ah3, bl6)) | 0;
59395 hi = (hi + Math.imul(ah3, bh6)) | 0;
59396 lo = (lo + Math.imul(al2, bl7)) | 0;
59397 mid = (mid + Math.imul(al2, bh7)) | 0;
59398 mid = (mid + Math.imul(ah2, bl7)) | 0;
59399 hi = (hi + Math.imul(ah2, bh7)) | 0;
59400 lo = (lo + Math.imul(al1, bl8)) | 0;
59401 mid = (mid + Math.imul(al1, bh8)) | 0;
59402 mid = (mid + Math.imul(ah1, bl8)) | 0;
59403 hi = (hi + Math.imul(ah1, bh8)) | 0;
59404 lo = (lo + Math.imul(al0, bl9)) | 0;
59405 mid = (mid + Math.imul(al0, bh9)) | 0;
59406 mid = (mid + Math.imul(ah0, bl9)) | 0;
59407 hi = (hi + Math.imul(ah0, bh9)) | 0;
59408 var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59409 c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;
59410 w9 &= 0x3ffffff;
59411 /* k = 10 */
59412 lo = Math.imul(al9, bl1);
59413 mid = Math.imul(al9, bh1);
59414 mid = (mid + Math.imul(ah9, bl1)) | 0;
59415 hi = Math.imul(ah9, bh1);
59416 lo = (lo + Math.imul(al8, bl2)) | 0;
59417 mid = (mid + Math.imul(al8, bh2)) | 0;
59418 mid = (mid + Math.imul(ah8, bl2)) | 0;
59419 hi = (hi + Math.imul(ah8, bh2)) | 0;
59420 lo = (lo + Math.imul(al7, bl3)) | 0;
59421 mid = (mid + Math.imul(al7, bh3)) | 0;
59422 mid = (mid + Math.imul(ah7, bl3)) | 0;
59423 hi = (hi + Math.imul(ah7, bh3)) | 0;
59424 lo = (lo + Math.imul(al6, bl4)) | 0;
59425 mid = (mid + Math.imul(al6, bh4)) | 0;
59426 mid = (mid + Math.imul(ah6, bl4)) | 0;
59427 hi = (hi + Math.imul(ah6, bh4)) | 0;
59428 lo = (lo + Math.imul(al5, bl5)) | 0;
59429 mid = (mid + Math.imul(al5, bh5)) | 0;
59430 mid = (mid + Math.imul(ah5, bl5)) | 0;
59431 hi = (hi + Math.imul(ah5, bh5)) | 0;
59432 lo = (lo + Math.imul(al4, bl6)) | 0;
59433 mid = (mid + Math.imul(al4, bh6)) | 0;
59434 mid = (mid + Math.imul(ah4, bl6)) | 0;
59435 hi = (hi + Math.imul(ah4, bh6)) | 0;
59436 lo = (lo + Math.imul(al3, bl7)) | 0;
59437 mid = (mid + Math.imul(al3, bh7)) | 0;
59438 mid = (mid + Math.imul(ah3, bl7)) | 0;
59439 hi = (hi + Math.imul(ah3, bh7)) | 0;
59440 lo = (lo + Math.imul(al2, bl8)) | 0;
59441 mid = (mid + Math.imul(al2, bh8)) | 0;
59442 mid = (mid + Math.imul(ah2, bl8)) | 0;
59443 hi = (hi + Math.imul(ah2, bh8)) | 0;
59444 lo = (lo + Math.imul(al1, bl9)) | 0;
59445 mid = (mid + Math.imul(al1, bh9)) | 0;
59446 mid = (mid + Math.imul(ah1, bl9)) | 0;
59447 hi = (hi + Math.imul(ah1, bh9)) | 0;
59448 var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59449 c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;
59450 w10 &= 0x3ffffff;
59451 /* k = 11 */
59452 lo = Math.imul(al9, bl2);
59453 mid = Math.imul(al9, bh2);
59454 mid = (mid + Math.imul(ah9, bl2)) | 0;
59455 hi = Math.imul(ah9, bh2);
59456 lo = (lo + Math.imul(al8, bl3)) | 0;
59457 mid = (mid + Math.imul(al8, bh3)) | 0;
59458 mid = (mid + Math.imul(ah8, bl3)) | 0;
59459 hi = (hi + Math.imul(ah8, bh3)) | 0;
59460 lo = (lo + Math.imul(al7, bl4)) | 0;
59461 mid = (mid + Math.imul(al7, bh4)) | 0;
59462 mid = (mid + Math.imul(ah7, bl4)) | 0;
59463 hi = (hi + Math.imul(ah7, bh4)) | 0;
59464 lo = (lo + Math.imul(al6, bl5)) | 0;
59465 mid = (mid + Math.imul(al6, bh5)) | 0;
59466 mid = (mid + Math.imul(ah6, bl5)) | 0;
59467 hi = (hi + Math.imul(ah6, bh5)) | 0;
59468 lo = (lo + Math.imul(al5, bl6)) | 0;
59469 mid = (mid + Math.imul(al5, bh6)) | 0;
59470 mid = (mid + Math.imul(ah5, bl6)) | 0;
59471 hi = (hi + Math.imul(ah5, bh6)) | 0;
59472 lo = (lo + Math.imul(al4, bl7)) | 0;
59473 mid = (mid + Math.imul(al4, bh7)) | 0;
59474 mid = (mid + Math.imul(ah4, bl7)) | 0;
59475 hi = (hi + Math.imul(ah4, bh7)) | 0;
59476 lo = (lo + Math.imul(al3, bl8)) | 0;
59477 mid = (mid + Math.imul(al3, bh8)) | 0;
59478 mid = (mid + Math.imul(ah3, bl8)) | 0;
59479 hi = (hi + Math.imul(ah3, bh8)) | 0;
59480 lo = (lo + Math.imul(al2, bl9)) | 0;
59481 mid = (mid + Math.imul(al2, bh9)) | 0;
59482 mid = (mid + Math.imul(ah2, bl9)) | 0;
59483 hi = (hi + Math.imul(ah2, bh9)) | 0;
59484 var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59485 c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;
59486 w11 &= 0x3ffffff;
59487 /* k = 12 */
59488 lo = Math.imul(al9, bl3);
59489 mid = Math.imul(al9, bh3);
59490 mid = (mid + Math.imul(ah9, bl3)) | 0;
59491 hi = Math.imul(ah9, bh3);
59492 lo = (lo + Math.imul(al8, bl4)) | 0;
59493 mid = (mid + Math.imul(al8, bh4)) | 0;
59494 mid = (mid + Math.imul(ah8, bl4)) | 0;
59495 hi = (hi + Math.imul(ah8, bh4)) | 0;
59496 lo = (lo + Math.imul(al7, bl5)) | 0;
59497 mid = (mid + Math.imul(al7, bh5)) | 0;
59498 mid = (mid + Math.imul(ah7, bl5)) | 0;
59499 hi = (hi + Math.imul(ah7, bh5)) | 0;
59500 lo = (lo + Math.imul(al6, bl6)) | 0;
59501 mid = (mid + Math.imul(al6, bh6)) | 0;
59502 mid = (mid + Math.imul(ah6, bl6)) | 0;
59503 hi = (hi + Math.imul(ah6, bh6)) | 0;
59504 lo = (lo + Math.imul(al5, bl7)) | 0;
59505 mid = (mid + Math.imul(al5, bh7)) | 0;
59506 mid = (mid + Math.imul(ah5, bl7)) | 0;
59507 hi = (hi + Math.imul(ah5, bh7)) | 0;
59508 lo = (lo + Math.imul(al4, bl8)) | 0;
59509 mid = (mid + Math.imul(al4, bh8)) | 0;
59510 mid = (mid + Math.imul(ah4, bl8)) | 0;
59511 hi = (hi + Math.imul(ah4, bh8)) | 0;
59512 lo = (lo + Math.imul(al3, bl9)) | 0;
59513 mid = (mid + Math.imul(al3, bh9)) | 0;
59514 mid = (mid + Math.imul(ah3, bl9)) | 0;
59515 hi = (hi + Math.imul(ah3, bh9)) | 0;
59516 var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59517 c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;
59518 w12 &= 0x3ffffff;
59519 /* k = 13 */
59520 lo = Math.imul(al9, bl4);
59521 mid = Math.imul(al9, bh4);
59522 mid = (mid + Math.imul(ah9, bl4)) | 0;
59523 hi = Math.imul(ah9, bh4);
59524 lo = (lo + Math.imul(al8, bl5)) | 0;
59525 mid = (mid + Math.imul(al8, bh5)) | 0;
59526 mid = (mid + Math.imul(ah8, bl5)) | 0;
59527 hi = (hi + Math.imul(ah8, bh5)) | 0;
59528 lo = (lo + Math.imul(al7, bl6)) | 0;
59529 mid = (mid + Math.imul(al7, bh6)) | 0;
59530 mid = (mid + Math.imul(ah7, bl6)) | 0;
59531 hi = (hi + Math.imul(ah7, bh6)) | 0;
59532 lo = (lo + Math.imul(al6, bl7)) | 0;
59533 mid = (mid + Math.imul(al6, bh7)) | 0;
59534 mid = (mid + Math.imul(ah6, bl7)) | 0;
59535 hi = (hi + Math.imul(ah6, bh7)) | 0;
59536 lo = (lo + Math.imul(al5, bl8)) | 0;
59537 mid = (mid + Math.imul(al5, bh8)) | 0;
59538 mid = (mid + Math.imul(ah5, bl8)) | 0;
59539 hi = (hi + Math.imul(ah5, bh8)) | 0;
59540 lo = (lo + Math.imul(al4, bl9)) | 0;
59541 mid = (mid + Math.imul(al4, bh9)) | 0;
59542 mid = (mid + Math.imul(ah4, bl9)) | 0;
59543 hi = (hi + Math.imul(ah4, bh9)) | 0;
59544 var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59545 c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;
59546 w13 &= 0x3ffffff;
59547 /* k = 14 */
59548 lo = Math.imul(al9, bl5);
59549 mid = Math.imul(al9, bh5);
59550 mid = (mid + Math.imul(ah9, bl5)) | 0;
59551 hi = Math.imul(ah9, bh5);
59552 lo = (lo + Math.imul(al8, bl6)) | 0;
59553 mid = (mid + Math.imul(al8, bh6)) | 0;
59554 mid = (mid + Math.imul(ah8, bl6)) | 0;
59555 hi = (hi + Math.imul(ah8, bh6)) | 0;
59556 lo = (lo + Math.imul(al7, bl7)) | 0;
59557 mid = (mid + Math.imul(al7, bh7)) | 0;
59558 mid = (mid + Math.imul(ah7, bl7)) | 0;
59559 hi = (hi + Math.imul(ah7, bh7)) | 0;
59560 lo = (lo + Math.imul(al6, bl8)) | 0;
59561 mid = (mid + Math.imul(al6, bh8)) | 0;
59562 mid = (mid + Math.imul(ah6, bl8)) | 0;
59563 hi = (hi + Math.imul(ah6, bh8)) | 0;
59564 lo = (lo + Math.imul(al5, bl9)) | 0;
59565 mid = (mid + Math.imul(al5, bh9)) | 0;
59566 mid = (mid + Math.imul(ah5, bl9)) | 0;
59567 hi = (hi + Math.imul(ah5, bh9)) | 0;
59568 var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59569 c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;
59570 w14 &= 0x3ffffff;
59571 /* k = 15 */
59572 lo = Math.imul(al9, bl6);
59573 mid = Math.imul(al9, bh6);
59574 mid = (mid + Math.imul(ah9, bl6)) | 0;
59575 hi = Math.imul(ah9, bh6);
59576 lo = (lo + Math.imul(al8, bl7)) | 0;
59577 mid = (mid + Math.imul(al8, bh7)) | 0;
59578 mid = (mid + Math.imul(ah8, bl7)) | 0;
59579 hi = (hi + Math.imul(ah8, bh7)) | 0;
59580 lo = (lo + Math.imul(al7, bl8)) | 0;
59581 mid = (mid + Math.imul(al7, bh8)) | 0;
59582 mid = (mid + Math.imul(ah7, bl8)) | 0;
59583 hi = (hi + Math.imul(ah7, bh8)) | 0;
59584 lo = (lo + Math.imul(al6, bl9)) | 0;
59585 mid = (mid + Math.imul(al6, bh9)) | 0;
59586 mid = (mid + Math.imul(ah6, bl9)) | 0;
59587 hi = (hi + Math.imul(ah6, bh9)) | 0;
59588 var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59589 c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;
59590 w15 &= 0x3ffffff;
59591 /* k = 16 */
59592 lo = Math.imul(al9, bl7);
59593 mid = Math.imul(al9, bh7);
59594 mid = (mid + Math.imul(ah9, bl7)) | 0;
59595 hi = Math.imul(ah9, bh7);
59596 lo = (lo + Math.imul(al8, bl8)) | 0;
59597 mid = (mid + Math.imul(al8, bh8)) | 0;
59598 mid = (mid + Math.imul(ah8, bl8)) | 0;
59599 hi = (hi + Math.imul(ah8, bh8)) | 0;
59600 lo = (lo + Math.imul(al7, bl9)) | 0;
59601 mid = (mid + Math.imul(al7, bh9)) | 0;
59602 mid = (mid + Math.imul(ah7, bl9)) | 0;
59603 hi = (hi + Math.imul(ah7, bh9)) | 0;
59604 var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59605 c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;
59606 w16 &= 0x3ffffff;
59607 /* k = 17 */
59608 lo = Math.imul(al9, bl8);
59609 mid = Math.imul(al9, bh8);
59610 mid = (mid + Math.imul(ah9, bl8)) | 0;
59611 hi = Math.imul(ah9, bh8);
59612 lo = (lo + Math.imul(al8, bl9)) | 0;
59613 mid = (mid + Math.imul(al8, bh9)) | 0;
59614 mid = (mid + Math.imul(ah8, bl9)) | 0;
59615 hi = (hi + Math.imul(ah8, bh9)) | 0;
59616 var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59617 c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;
59618 w17 &= 0x3ffffff;
59619 /* k = 18 */
59620 lo = Math.imul(al9, bl9);
59621 mid = Math.imul(al9, bh9);
59622 mid = (mid + Math.imul(ah9, bl9)) | 0;
59623 hi = Math.imul(ah9, bh9);
59624 var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
59625 c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;
59626 w18 &= 0x3ffffff;
59627 o[0] = w0;
59628 o[1] = w1;
59629 o[2] = w2;
59630 o[3] = w3;
59631 o[4] = w4;
59632 o[5] = w5;
59633 o[6] = w6;
59634 o[7] = w7;
59635 o[8] = w8;
59636 o[9] = w9;
59637 o[10] = w10;
59638 o[11] = w11;
59639 o[12] = w12;
59640 o[13] = w13;
59641 o[14] = w14;
59642 o[15] = w15;
59643 o[16] = w16;
59644 o[17] = w17;
59645 o[18] = w18;
59646 if (c !== 0) {
59647 o[19] = c;
59648 out.length++;
59649 }
59650 return out;
59651 };
59652
59653 // Polyfill comb
59654 if (!Math.imul) {
59655 comb10MulTo = smallMulTo;
59656 }
59657
59658 function bigMulTo (self, num, out) {
59659 out.negative = num.negative ^ self.negative;
59660 out.length = self.length + num.length;
59661
59662 var carry = 0;
59663 var hncarry = 0;
59664 for (var k = 0; k < out.length - 1; k++) {
59665 // Sum all words with the same `i + j = k` and accumulate `ncarry`,
59666 // note that ncarry could be >= 0x3ffffff
59667 var ncarry = hncarry;
59668 hncarry = 0;
59669 var rword = carry & 0x3ffffff;
59670 var maxJ = Math.min(k, num.length - 1);
59671 for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
59672 var i = k - j;
59673 var a = self.words[i] | 0;
59674 var b = num.words[j] | 0;
59675 var r = a * b;
59676
59677 var lo = r & 0x3ffffff;
59678 ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;
59679 lo = (lo + rword) | 0;
59680 rword = lo & 0x3ffffff;
59681 ncarry = (ncarry + (lo >>> 26)) | 0;
59682
59683 hncarry += ncarry >>> 26;
59684 ncarry &= 0x3ffffff;
59685 }
59686 out.words[k] = rword;
59687 carry = ncarry;
59688 ncarry = hncarry;
59689 }
59690 if (carry !== 0) {
59691 out.words[k] = carry;
59692 } else {
59693 out.length--;
59694 }
59695
59696 return out.strip();
59697 }
59698
59699 function jumboMulTo (self, num, out) {
59700 var fftm = new FFTM();
59701 return fftm.mulp(self, num, out);
59702 }
59703
59704 BN.prototype.mulTo = function mulTo (num, out) {
59705 var res;
59706 var len = this.length + num.length;
59707 if (this.length === 10 && num.length === 10) {
59708 res = comb10MulTo(this, num, out);
59709 } else if (len < 63) {
59710 res = smallMulTo(this, num, out);
59711 } else if (len < 1024) {
59712 res = bigMulTo(this, num, out);
59713 } else {
59714 res = jumboMulTo(this, num, out);
59715 }
59716
59717 return res;
59718 };
59719
59720 // Cooley-Tukey algorithm for FFT
59721 // slightly revisited to rely on looping instead of recursion
59722
59723 function FFTM (x, y) {
59724 this.x = x;
59725 this.y = y;
59726 }
59727
59728 FFTM.prototype.makeRBT = function makeRBT (N) {
59729 var t = new Array(N);
59730 var l = BN.prototype._countBits(N) - 1;
59731 for (var i = 0; i < N; i++) {
59732 t[i] = this.revBin(i, l, N);
59733 }
59734
59735 return t;
59736 };
59737
59738 // Returns binary-reversed representation of `x`
59739 FFTM.prototype.revBin = function revBin (x, l, N) {
59740 if (x === 0 || x === N - 1) return x;
59741
59742 var rb = 0;
59743 for (var i = 0; i < l; i++) {
59744 rb |= (x & 1) << (l - i - 1);
59745 x >>= 1;
59746 }
59747
59748 return rb;
59749 };
59750
59751 // Performs "tweedling" phase, therefore 'emulating'
59752 // behaviour of the recursive algorithm
59753 FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {
59754 for (var i = 0; i < N; i++) {
59755 rtws[i] = rws[rbt[i]];
59756 itws[i] = iws[rbt[i]];
59757 }
59758 };
59759
59760 FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {
59761 this.permute(rbt, rws, iws, rtws, itws, N);
59762
59763 for (var s = 1; s < N; s <<= 1) {
59764 var l = s << 1;
59765
59766 var rtwdf = Math.cos(2 * Math.PI / l);
59767 var itwdf = Math.sin(2 * Math.PI / l);
59768
59769 for (var p = 0; p < N; p += l) {
59770 var rtwdf_ = rtwdf;
59771 var itwdf_ = itwdf;
59772
59773 for (var j = 0; j < s; j++) {
59774 var re = rtws[p + j];
59775 var ie = itws[p + j];
59776
59777 var ro = rtws[p + j + s];
59778 var io = itws[p + j + s];
59779
59780 var rx = rtwdf_ * ro - itwdf_ * io;
59781
59782 io = rtwdf_ * io + itwdf_ * ro;
59783 ro = rx;
59784
59785 rtws[p + j] = re + ro;
59786 itws[p + j] = ie + io;
59787
59788 rtws[p + j + s] = re - ro;
59789 itws[p + j + s] = ie - io;
59790
59791 /* jshint maxdepth : false */
59792 if (j !== l) {
59793 rx = rtwdf * rtwdf_ - itwdf * itwdf_;
59794
59795 itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
59796 rtwdf_ = rx;
59797 }
59798 }
59799 }
59800 }
59801 };
59802
59803 FFTM.prototype.guessLen13b = function guessLen13b (n, m) {
59804 var N = Math.max(m, n) | 1;
59805 var odd = N & 1;
59806 var i = 0;
59807 for (N = N / 2 | 0; N; N = N >>> 1) {
59808 i++;
59809 }
59810
59811 return 1 << i + 1 + odd;
59812 };
59813
59814 FFTM.prototype.conjugate = function conjugate (rws, iws, N) {
59815 if (N <= 1) return;
59816
59817 for (var i = 0; i < N / 2; i++) {
59818 var t = rws[i];
59819
59820 rws[i] = rws[N - i - 1];
59821 rws[N - i - 1] = t;
59822
59823 t = iws[i];
59824
59825 iws[i] = -iws[N - i - 1];
59826 iws[N - i - 1] = -t;
59827 }
59828 };
59829
59830 FFTM.prototype.normalize13b = function normalize13b (ws, N) {
59831 var carry = 0;
59832 for (var i = 0; i < N / 2; i++) {
59833 var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +
59834 Math.round(ws[2 * i] / N) +
59835 carry;
59836
59837 ws[i] = w & 0x3ffffff;
59838
59839 if (w < 0x4000000) {
59840 carry = 0;
59841 } else {
59842 carry = w / 0x4000000 | 0;
59843 }
59844 }
59845
59846 return ws;
59847 };
59848
59849 FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {
59850 var carry = 0;
59851 for (var i = 0; i < len; i++) {
59852 carry = carry + (ws[i] | 0);
59853
59854 rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;
59855 rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;
59856 }
59857
59858 // Pad with zeroes
59859 for (i = 2 * len; i < N; ++i) {
59860 rws[i] = 0;
59861 }
59862
59863 assert(carry === 0);
59864 assert((carry & ~0x1fff) === 0);
59865 };
59866
59867 FFTM.prototype.stub = function stub (N) {
59868 var ph = new Array(N);
59869 for (var i = 0; i < N; i++) {
59870 ph[i] = 0;
59871 }
59872
59873 return ph;
59874 };
59875
59876 FFTM.prototype.mulp = function mulp (x, y, out) {
59877 var N = 2 * this.guessLen13b(x.length, y.length);
59878
59879 var rbt = this.makeRBT(N);
59880
59881 var _ = this.stub(N);
59882
59883 var rws = new Array(N);
59884 var rwst = new Array(N);
59885 var iwst = new Array(N);
59886
59887 var nrws = new Array(N);
59888 var nrwst = new Array(N);
59889 var niwst = new Array(N);
59890
59891 var rmws = out.words;
59892 rmws.length = N;
59893
59894 this.convert13b(x.words, x.length, rws, N);
59895 this.convert13b(y.words, y.length, nrws, N);
59896
59897 this.transform(rws, _, rwst, iwst, N, rbt);
59898 this.transform(nrws, _, nrwst, niwst, N, rbt);
59899
59900 for (var i = 0; i < N; i++) {
59901 var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
59902 iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
59903 rwst[i] = rx;
59904 }
59905
59906 this.conjugate(rwst, iwst, N);
59907 this.transform(rwst, iwst, rmws, _, N, rbt);
59908 this.conjugate(rmws, _, N);
59909 this.normalize13b(rmws, N);
59910
59911 out.negative = x.negative ^ y.negative;
59912 out.length = x.length + y.length;
59913 return out.strip();
59914 };
59915
59916 // Multiply `this` by `num`
59917 BN.prototype.mul = function mul (num) {
59918 var out = new BN(null);
59919 out.words = new Array(this.length + num.length);
59920 return this.mulTo(num, out);
59921 };
59922
59923 // Multiply employing FFT
59924 BN.prototype.mulf = function mulf (num) {
59925 var out = new BN(null);
59926 out.words = new Array(this.length + num.length);
59927 return jumboMulTo(this, num, out);
59928 };
59929
59930 // In-place Multiplication
59931 BN.prototype.imul = function imul (num) {
59932 return this.clone().mulTo(num, this);
59933 };
59934
59935 BN.prototype.imuln = function imuln (num) {
59936 assert(typeof num === 'number');
59937 assert(num < 0x4000000);
59938
59939 // Carry
59940 var carry = 0;
59941 for (var i = 0; i < this.length; i++) {
59942 var w = (this.words[i] | 0) * num;
59943 var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);
59944 carry >>= 26;
59945 carry += (w / 0x4000000) | 0;
59946 // NOTE: lo is 27bit maximum
59947 carry += lo >>> 26;
59948 this.words[i] = lo & 0x3ffffff;
59949 }
59950
59951 if (carry !== 0) {
59952 this.words[i] = carry;
59953 this.length++;
59954 }
59955
59956 return this;
59957 };
59958
59959 BN.prototype.muln = function muln (num) {
59960 return this.clone().imuln(num);
59961 };
59962
59963 // `this` * `this`
59964 BN.prototype.sqr = function sqr () {
59965 return this.mul(this);
59966 };
59967
59968 // `this` * `this` in-place
59969 BN.prototype.isqr = function isqr () {
59970 return this.imul(this.clone());
59971 };
59972
59973 // Math.pow(`this`, `num`)
59974 BN.prototype.pow = function pow (num) {
59975 var w = toBitArray(num);
59976 if (w.length === 0) return new BN(1);
59977
59978 // Skip leading zeroes
59979 var res = this;
59980 for (var i = 0; i < w.length; i++, res = res.sqr()) {
59981 if (w[i] !== 0) break;
59982 }
59983
59984 if (++i < w.length) {
59985 for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
59986 if (w[i] === 0) continue;
59987
59988 res = res.mul(q);
59989 }
59990 }
59991
59992 return res;
59993 };
59994
59995 // Shift-left in-place
59996 BN.prototype.iushln = function iushln (bits) {
59997 assert(typeof bits === 'number' && bits >= 0);
59998 var r = bits % 26;
59999 var s = (bits - r) / 26;
60000 var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);
60001 var i;
60002
60003 if (r !== 0) {
60004 var carry = 0;
60005
60006 for (i = 0; i < this.length; i++) {
60007 var newCarry = this.words[i] & carryMask;
60008 var c = ((this.words[i] | 0) - newCarry) << r;
60009 this.words[i] = c | carry;
60010 carry = newCarry >>> (26 - r);
60011 }
60012
60013 if (carry) {
60014 this.words[i] = carry;
60015 this.length++;
60016 }
60017 }
60018
60019 if (s !== 0) {
60020 for (i = this.length - 1; i >= 0; i--) {
60021 this.words[i + s] = this.words[i];
60022 }
60023
60024 for (i = 0; i < s; i++) {
60025 this.words[i] = 0;
60026 }
60027
60028 this.length += s;
60029 }
60030
60031 return this.strip();
60032 };
60033
60034 BN.prototype.ishln = function ishln (bits) {
60035 // TODO(indutny): implement me
60036 assert(this.negative === 0);
60037 return this.iushln(bits);
60038 };
60039
60040 // Shift-right in-place
60041 // NOTE: `hint` is a lowest bit before trailing zeroes
60042 // NOTE: if `extended` is present - it will be filled with destroyed bits
60043 BN.prototype.iushrn = function iushrn (bits, hint, extended) {
60044 assert(typeof bits === 'number' && bits >= 0);
60045 var h;
60046 if (hint) {
60047 h = (hint - (hint % 26)) / 26;
60048 } else {
60049 h = 0;
60050 }
60051
60052 var r = bits % 26;
60053 var s = Math.min((bits - r) / 26, this.length);
60054 var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
60055 var maskedWords = extended;
60056
60057 h -= s;
60058 h = Math.max(0, h);
60059
60060 // Extended mode, copy masked part
60061 if (maskedWords) {
60062 for (var i = 0; i < s; i++) {
60063 maskedWords.words[i] = this.words[i];
60064 }
60065 maskedWords.length = s;
60066 }
60067
60068 if (s === 0) {
60069 // No-op, we should not move anything at all
60070 } else if (this.length > s) {
60071 this.length -= s;
60072 for (i = 0; i < this.length; i++) {
60073 this.words[i] = this.words[i + s];
60074 }
60075 } else {
60076 this.words[0] = 0;
60077 this.length = 1;
60078 }
60079
60080 var carry = 0;
60081 for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
60082 var word = this.words[i] | 0;
60083 this.words[i] = (carry << (26 - r)) | (word >>> r);
60084 carry = word & mask;
60085 }
60086
60087 // Push carried bits as a mask
60088 if (maskedWords && carry !== 0) {
60089 maskedWords.words[maskedWords.length++] = carry;
60090 }
60091
60092 if (this.length === 0) {
60093 this.words[0] = 0;
60094 this.length = 1;
60095 }
60096
60097 return this.strip();
60098 };
60099
60100 BN.prototype.ishrn = function ishrn (bits, hint, extended) {
60101 // TODO(indutny): implement me
60102 assert(this.negative === 0);
60103 return this.iushrn(bits, hint, extended);
60104 };
60105
60106 // Shift-left
60107 BN.prototype.shln = function shln (bits) {
60108 return this.clone().ishln(bits);
60109 };
60110
60111 BN.prototype.ushln = function ushln (bits) {
60112 return this.clone().iushln(bits);
60113 };
60114
60115 // Shift-right
60116 BN.prototype.shrn = function shrn (bits) {
60117 return this.clone().ishrn(bits);
60118 };
60119
60120 BN.prototype.ushrn = function ushrn (bits) {
60121 return this.clone().iushrn(bits);
60122 };
60123
60124 // Test if n bit is set
60125 BN.prototype.testn = function testn (bit) {
60126 assert(typeof bit === 'number' && bit >= 0);
60127 var r = bit % 26;
60128 var s = (bit - r) / 26;
60129 var q = 1 << r;
60130
60131 // Fast case: bit is much higher than all existing words
60132 if (this.length <= s) return false;
60133
60134 // Check bit and return
60135 var w = this.words[s];
60136
60137 return !!(w & q);
60138 };
60139
60140 // Return only lowers bits of number (in-place)
60141 BN.prototype.imaskn = function imaskn (bits) {
60142 assert(typeof bits === 'number' && bits >= 0);
60143 var r = bits % 26;
60144 var s = (bits - r) / 26;
60145
60146 assert(this.negative === 0, 'imaskn works only with positive numbers');
60147
60148 if (this.length <= s) {
60149 return this;
60150 }
60151
60152 if (r !== 0) {
60153 s++;
60154 }
60155 this.length = Math.min(s, this.length);
60156
60157 if (r !== 0) {
60158 var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
60159 this.words[this.length - 1] &= mask;
60160 }
60161
60162 return this.strip();
60163 };
60164
60165 // Return only lowers bits of number
60166 BN.prototype.maskn = function maskn (bits) {
60167 return this.clone().imaskn(bits);
60168 };
60169
60170 // Add plain number `num` to `this`
60171 BN.prototype.iaddn = function iaddn (num) {
60172 assert(typeof num === 'number');
60173 assert(num < 0x4000000);
60174 if (num < 0) return this.isubn(-num);
60175
60176 // Possible sign change
60177 if (this.negative !== 0) {
60178 if (this.length === 1 && (this.words[0] | 0) < num) {
60179 this.words[0] = num - (this.words[0] | 0);
60180 this.negative = 0;
60181 return this;
60182 }
60183
60184 this.negative = 0;
60185 this.isubn(num);
60186 this.negative = 1;
60187 return this;
60188 }
60189
60190 // Add without checks
60191 return this._iaddn(num);
60192 };
60193
60194 BN.prototype._iaddn = function _iaddn (num) {
60195 this.words[0] += num;
60196
60197 // Carry
60198 for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {
60199 this.words[i] -= 0x4000000;
60200 if (i === this.length - 1) {
60201 this.words[i + 1] = 1;
60202 } else {
60203 this.words[i + 1]++;
60204 }
60205 }
60206 this.length = Math.max(this.length, i + 1);
60207
60208 return this;
60209 };
60210
60211 // Subtract plain number `num` from `this`
60212 BN.prototype.isubn = function isubn (num) {
60213 assert(typeof num === 'number');
60214 assert(num < 0x4000000);
60215 if (num < 0) return this.iaddn(-num);
60216
60217 if (this.negative !== 0) {
60218 this.negative = 0;
60219 this.iaddn(num);
60220 this.negative = 1;
60221 return this;
60222 }
60223
60224 this.words[0] -= num;
60225
60226 if (this.length === 1 && this.words[0] < 0) {
60227 this.words[0] = -this.words[0];
60228 this.negative = 1;
60229 } else {
60230 // Carry
60231 for (var i = 0; i < this.length && this.words[i] < 0; i++) {
60232 this.words[i] += 0x4000000;
60233 this.words[i + 1] -= 1;
60234 }
60235 }
60236
60237 return this.strip();
60238 };
60239
60240 BN.prototype.addn = function addn (num) {
60241 return this.clone().iaddn(num);
60242 };
60243
60244 BN.prototype.subn = function subn (num) {
60245 return this.clone().isubn(num);
60246 };
60247
60248 BN.prototype.iabs = function iabs () {
60249 this.negative = 0;
60250
60251 return this;
60252 };
60253
60254 BN.prototype.abs = function abs () {
60255 return this.clone().iabs();
60256 };
60257
60258 BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {
60259 var len = num.length + shift;
60260 var i;
60261
60262 this._expand(len);
60263
60264 var w;
60265 var carry = 0;
60266 for (i = 0; i < num.length; i++) {
60267 w = (this.words[i + shift] | 0) + carry;
60268 var right = (num.words[i] | 0) * mul;
60269 w -= right & 0x3ffffff;
60270 carry = (w >> 26) - ((right / 0x4000000) | 0);
60271 this.words[i + shift] = w & 0x3ffffff;
60272 }
60273 for (; i < this.length - shift; i++) {
60274 w = (this.words[i + shift] | 0) + carry;
60275 carry = w >> 26;
60276 this.words[i + shift] = w & 0x3ffffff;
60277 }
60278
60279 if (carry === 0) return this.strip();
60280
60281 // Subtraction overflow
60282 assert(carry === -1);
60283 carry = 0;
60284 for (i = 0; i < this.length; i++) {
60285 w = -(this.words[i] | 0) + carry;
60286 carry = w >> 26;
60287 this.words[i] = w & 0x3ffffff;
60288 }
60289 this.negative = 1;
60290
60291 return this.strip();
60292 };
60293
60294 BN.prototype._wordDiv = function _wordDiv (num, mode) {
60295 var shift = this.length - num.length;
60296
60297 var a = this.clone();
60298 var b = num;
60299
60300 // Normalize
60301 var bhi = b.words[b.length - 1] | 0;
60302 var bhiBits = this._countBits(bhi);
60303 shift = 26 - bhiBits;
60304 if (shift !== 0) {
60305 b = b.ushln(shift);
60306 a.iushln(shift);
60307 bhi = b.words[b.length - 1] | 0;
60308 }
60309
60310 // Initialize quotient
60311 var m = a.length - b.length;
60312 var q;
60313
60314 if (mode !== 'mod') {
60315 q = new BN(null);
60316 q.length = m + 1;
60317 q.words = new Array(q.length);
60318 for (var i = 0; i < q.length; i++) {
60319 q.words[i] = 0;
60320 }
60321 }
60322
60323 var diff = a.clone()._ishlnsubmul(b, 1, m);
60324 if (diff.negative === 0) {
60325 a = diff;
60326 if (q) {
60327 q.words[m] = 1;
60328 }
60329 }
60330
60331 for (var j = m - 1; j >= 0; j--) {
60332 var qj = (a.words[b.length + j] | 0) * 0x4000000 +
60333 (a.words[b.length + j - 1] | 0);
60334
60335 // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max
60336 // (0x7ffffff)
60337 qj = Math.min((qj / bhi) | 0, 0x3ffffff);
60338
60339 a._ishlnsubmul(b, qj, j);
60340 while (a.negative !== 0) {
60341 qj--;
60342 a.negative = 0;
60343 a._ishlnsubmul(b, 1, j);
60344 if (!a.isZero()) {
60345 a.negative ^= 1;
60346 }
60347 }
60348 if (q) {
60349 q.words[j] = qj;
60350 }
60351 }
60352 if (q) {
60353 q.strip();
60354 }
60355 a.strip();
60356
60357 // Denormalize
60358 if (mode !== 'div' && shift !== 0) {
60359 a.iushrn(shift);
60360 }
60361
60362 return {
60363 div: q || null,
60364 mod: a
60365 };
60366 };
60367
60368 // NOTE: 1) `mode` can be set to `mod` to request mod only,
60369 // to `div` to request div only, or be absent to
60370 // request both div & mod
60371 // 2) `positive` is true if unsigned mod is requested
60372 BN.prototype.divmod = function divmod (num, mode, positive) {
60373 assert(!num.isZero());
60374
60375 if (this.isZero()) {
60376 return {
60377 div: new BN(0),
60378 mod: new BN(0)
60379 };
60380 }
60381
60382 var div, mod, res;
60383 if (this.negative !== 0 && num.negative === 0) {
60384 res = this.neg().divmod(num, mode);
60385
60386 if (mode !== 'mod') {
60387 div = res.div.neg();
60388 }
60389
60390 if (mode !== 'div') {
60391 mod = res.mod.neg();
60392 if (positive && mod.negative !== 0) {
60393 mod.iadd(num);
60394 }
60395 }
60396
60397 return {
60398 div: div,
60399 mod: mod
60400 };
60401 }
60402
60403 if (this.negative === 0 && num.negative !== 0) {
60404 res = this.divmod(num.neg(), mode);
60405
60406 if (mode !== 'mod') {
60407 div = res.div.neg();
60408 }
60409
60410 return {
60411 div: div,
60412 mod: res.mod
60413 };
60414 }
60415
60416 if ((this.negative & num.negative) !== 0) {
60417 res = this.neg().divmod(num.neg(), mode);
60418
60419 if (mode !== 'div') {
60420 mod = res.mod.neg();
60421 if (positive && mod.negative !== 0) {
60422 mod.isub(num);
60423 }
60424 }
60425
60426 return {
60427 div: res.div,
60428 mod: mod
60429 };
60430 }
60431
60432 // Both numbers are positive at this point
60433
60434 // Strip both numbers to approximate shift value
60435 if (num.length > this.length || this.cmp(num) < 0) {
60436 return {
60437 div: new BN(0),
60438 mod: this
60439 };
60440 }
60441
60442 // Very short reduction
60443 if (num.length === 1) {
60444 if (mode === 'div') {
60445 return {
60446 div: this.divn(num.words[0]),
60447 mod: null
60448 };
60449 }
60450
60451 if (mode === 'mod') {
60452 return {
60453 div: null,
60454 mod: new BN(this.modn(num.words[0]))
60455 };
60456 }
60457
60458 return {
60459 div: this.divn(num.words[0]),
60460 mod: new BN(this.modn(num.words[0]))
60461 };
60462 }
60463
60464 return this._wordDiv(num, mode);
60465 };
60466
60467 // Find `this` / `num`
60468 BN.prototype.div = function div (num) {
60469 return this.divmod(num, 'div', false).div;
60470 };
60471
60472 // Find `this` % `num`
60473 BN.prototype.mod = function mod (num) {
60474 return this.divmod(num, 'mod', false).mod;
60475 };
60476
60477 BN.prototype.umod = function umod (num) {
60478 return this.divmod(num, 'mod', true).mod;
60479 };
60480
60481 // Find Round(`this` / `num`)
60482 BN.prototype.divRound = function divRound (num) {
60483 var dm = this.divmod(num);
60484
60485 // Fast case - exact division
60486 if (dm.mod.isZero()) return dm.div;
60487
60488 var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
60489
60490 var half = num.ushrn(1);
60491 var r2 = num.andln(1);
60492 var cmp = mod.cmp(half);
60493
60494 // Round down
60495 if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
60496
60497 // Round up
60498 return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
60499 };
60500
60501 BN.prototype.modn = function modn (num) {
60502 assert(num <= 0x3ffffff);
60503 var p = (1 << 26) % num;
60504
60505 var acc = 0;
60506 for (var i = this.length - 1; i >= 0; i--) {
60507 acc = (p * acc + (this.words[i] | 0)) % num;
60508 }
60509
60510 return acc;
60511 };
60512
60513 // In-place division by number
60514 BN.prototype.idivn = function idivn (num) {
60515 assert(num <= 0x3ffffff);
60516
60517 var carry = 0;
60518 for (var i = this.length - 1; i >= 0; i--) {
60519 var w = (this.words[i] | 0) + carry * 0x4000000;
60520 this.words[i] = (w / num) | 0;
60521 carry = w % num;
60522 }
60523
60524 return this.strip();
60525 };
60526
60527 BN.prototype.divn = function divn (num) {
60528 return this.clone().idivn(num);
60529 };
60530
60531 BN.prototype.egcd = function egcd (p) {
60532 assert(p.negative === 0);
60533 assert(!p.isZero());
60534
60535 var x = this;
60536 var y = p.clone();
60537
60538 if (x.negative !== 0) {
60539 x = x.umod(p);
60540 } else {
60541 x = x.clone();
60542 }
60543
60544 // A * x + B * y = x
60545 var A = new BN(1);
60546 var B = new BN(0);
60547
60548 // C * x + D * y = y
60549 var C = new BN(0);
60550 var D = new BN(1);
60551
60552 var g = 0;
60553
60554 while (x.isEven() && y.isEven()) {
60555 x.iushrn(1);
60556 y.iushrn(1);
60557 ++g;
60558 }
60559
60560 var yp = y.clone();
60561 var xp = x.clone();
60562
60563 while (!x.isZero()) {
60564 for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
60565 if (i > 0) {
60566 x.iushrn(i);
60567 while (i-- > 0) {
60568 if (A.isOdd() || B.isOdd()) {
60569 A.iadd(yp);
60570 B.isub(xp);
60571 }
60572
60573 A.iushrn(1);
60574 B.iushrn(1);
60575 }
60576 }
60577
60578 for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
60579 if (j > 0) {
60580 y.iushrn(j);
60581 while (j-- > 0) {
60582 if (C.isOdd() || D.isOdd()) {
60583 C.iadd(yp);
60584 D.isub(xp);
60585 }
60586
60587 C.iushrn(1);
60588 D.iushrn(1);
60589 }
60590 }
60591
60592 if (x.cmp(y) >= 0) {
60593 x.isub(y);
60594 A.isub(C);
60595 B.isub(D);
60596 } else {
60597 y.isub(x);
60598 C.isub(A);
60599 D.isub(B);
60600 }
60601 }
60602
60603 return {
60604 a: C,
60605 b: D,
60606 gcd: y.iushln(g)
60607 };
60608 };
60609
60610 // This is reduced incarnation of the binary EEA
60611 // above, designated to invert members of the
60612 // _prime_ fields F(p) at a maximal speed
60613 BN.prototype._invmp = function _invmp (p) {
60614 assert(p.negative === 0);
60615 assert(!p.isZero());
60616
60617 var a = this;
60618 var b = p.clone();
60619
60620 if (a.negative !== 0) {
60621 a = a.umod(p);
60622 } else {
60623 a = a.clone();
60624 }
60625
60626 var x1 = new BN(1);
60627 var x2 = new BN(0);
60628
60629 var delta = b.clone();
60630
60631 while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
60632 for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
60633 if (i > 0) {
60634 a.iushrn(i);
60635 while (i-- > 0) {
60636 if (x1.isOdd()) {
60637 x1.iadd(delta);
60638 }
60639
60640 x1.iushrn(1);
60641 }
60642 }
60643
60644 for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
60645 if (j > 0) {
60646 b.iushrn(j);
60647 while (j-- > 0) {
60648 if (x2.isOdd()) {
60649 x2.iadd(delta);
60650 }
60651
60652 x2.iushrn(1);
60653 }
60654 }
60655
60656 if (a.cmp(b) >= 0) {
60657 a.isub(b);
60658 x1.isub(x2);
60659 } else {
60660 b.isub(a);
60661 x2.isub(x1);
60662 }
60663 }
60664
60665 var res;
60666 if (a.cmpn(1) === 0) {
60667 res = x1;
60668 } else {
60669 res = x2;
60670 }
60671
60672 if (res.cmpn(0) < 0) {
60673 res.iadd(p);
60674 }
60675
60676 return res;
60677 };
60678
60679 BN.prototype.gcd = function gcd (num) {
60680 if (this.isZero()) return num.abs();
60681 if (num.isZero()) return this.abs();
60682
60683 var a = this.clone();
60684 var b = num.clone();
60685 a.negative = 0;
60686 b.negative = 0;
60687
60688 // Remove common factor of two
60689 for (var shift = 0; a.isEven() && b.isEven(); shift++) {
60690 a.iushrn(1);
60691 b.iushrn(1);
60692 }
60693
60694 do {
60695 while (a.isEven()) {
60696 a.iushrn(1);
60697 }
60698 while (b.isEven()) {
60699 b.iushrn(1);
60700 }
60701
60702 var r = a.cmp(b);
60703 if (r < 0) {
60704 // Swap `a` and `b` to make `a` always bigger than `b`
60705 var t = a;
60706 a = b;
60707 b = t;
60708 } else if (r === 0 || b.cmpn(1) === 0) {
60709 break;
60710 }
60711
60712 a.isub(b);
60713 } while (true);
60714
60715 return b.iushln(shift);
60716 };
60717
60718 // Invert number in the field F(num)
60719 BN.prototype.invm = function invm (num) {
60720 return this.egcd(num).a.umod(num);
60721 };
60722
60723 BN.prototype.isEven = function isEven () {
60724 return (this.words[0] & 1) === 0;
60725 };
60726
60727 BN.prototype.isOdd = function isOdd () {
60728 return (this.words[0] & 1) === 1;
60729 };
60730
60731 // And first word and num
60732 BN.prototype.andln = function andln (num) {
60733 return this.words[0] & num;
60734 };
60735
60736 // Increment at the bit position in-line
60737 BN.prototype.bincn = function bincn (bit) {
60738 assert(typeof bit === 'number');
60739 var r = bit % 26;
60740 var s = (bit - r) / 26;
60741 var q = 1 << r;
60742
60743 // Fast case: bit is much higher than all existing words
60744 if (this.length <= s) {
60745 this._expand(s + 1);
60746 this.words[s] |= q;
60747 return this;
60748 }
60749
60750 // Add bit and propagate, if needed
60751 var carry = q;
60752 for (var i = s; carry !== 0 && i < this.length; i++) {
60753 var w = this.words[i] | 0;
60754 w += carry;
60755 carry = w >>> 26;
60756 w &= 0x3ffffff;
60757 this.words[i] = w;
60758 }
60759 if (carry !== 0) {
60760 this.words[i] = carry;
60761 this.length++;
60762 }
60763 return this;
60764 };
60765
60766 BN.prototype.isZero = function isZero () {
60767 return this.length === 1 && this.words[0] === 0;
60768 };
60769
60770 BN.prototype.cmpn = function cmpn (num) {
60771 var negative = num < 0;
60772
60773 if (this.negative !== 0 && !negative) return -1;
60774 if (this.negative === 0 && negative) return 1;
60775
60776 this.strip();
60777
60778 var res;
60779 if (this.length > 1) {
60780 res = 1;
60781 } else {
60782 if (negative) {
60783 num = -num;
60784 }
60785
60786 assert(num <= 0x3ffffff, 'Number is too big');
60787
60788 var w = this.words[0] | 0;
60789 res = w === num ? 0 : w < num ? -1 : 1;
60790 }
60791 if (this.negative !== 0) return -res | 0;
60792 return res;
60793 };
60794
60795 // Compare two numbers and return:
60796 // 1 - if `this` > `num`
60797 // 0 - if `this` == `num`
60798 // -1 - if `this` < `num`
60799 BN.prototype.cmp = function cmp (num) {
60800 if (this.negative !== 0 && num.negative === 0) return -1;
60801 if (this.negative === 0 && num.negative !== 0) return 1;
60802
60803 var res = this.ucmp(num);
60804 if (this.negative !== 0) return -res | 0;
60805 return res;
60806 };
60807
60808 // Unsigned comparison
60809 BN.prototype.ucmp = function ucmp (num) {
60810 // At this point both numbers have the same sign
60811 if (this.length > num.length) return 1;
60812 if (this.length < num.length) return -1;
60813
60814 var res = 0;
60815 for (var i = this.length - 1; i >= 0; i--) {
60816 var a = this.words[i] | 0;
60817 var b = num.words[i] | 0;
60818
60819 if (a === b) continue;
60820 if (a < b) {
60821 res = -1;
60822 } else if (a > b) {
60823 res = 1;
60824 }
60825 break;
60826 }
60827 return res;
60828 };
60829
60830 BN.prototype.gtn = function gtn (num) {
60831 return this.cmpn(num) === 1;
60832 };
60833
60834 BN.prototype.gt = function gt (num) {
60835 return this.cmp(num) === 1;
60836 };
60837
60838 BN.prototype.gten = function gten (num) {
60839 return this.cmpn(num) >= 0;
60840 };
60841
60842 BN.prototype.gte = function gte (num) {
60843 return this.cmp(num) >= 0;
60844 };
60845
60846 BN.prototype.ltn = function ltn (num) {
60847 return this.cmpn(num) === -1;
60848 };
60849
60850 BN.prototype.lt = function lt (num) {
60851 return this.cmp(num) === -1;
60852 };
60853
60854 BN.prototype.lten = function lten (num) {
60855 return this.cmpn(num) <= 0;
60856 };
60857
60858 BN.prototype.lte = function lte (num) {
60859 return this.cmp(num) <= 0;
60860 };
60861
60862 BN.prototype.eqn = function eqn (num) {
60863 return this.cmpn(num) === 0;
60864 };
60865
60866 BN.prototype.eq = function eq (num) {
60867 return this.cmp(num) === 0;
60868 };
60869
60870 //
60871 // A reduce context, could be using montgomery or something better, depending
60872 // on the `m` itself.
60873 //
60874 BN.red = function red (num) {
60875 return new Red(num);
60876 };
60877
60878 BN.prototype.toRed = function toRed (ctx) {
60879 assert(!this.red, 'Already a number in reduction context');
60880 assert(this.negative === 0, 'red works only with positives');
60881 return ctx.convertTo(this)._forceRed(ctx);
60882 };
60883
60884 BN.prototype.fromRed = function fromRed () {
60885 assert(this.red, 'fromRed works only with numbers in reduction context');
60886 return this.red.convertFrom(this);
60887 };
60888
60889 BN.prototype._forceRed = function _forceRed (ctx) {
60890 this.red = ctx;
60891 return this;
60892 };
60893
60894 BN.prototype.forceRed = function forceRed (ctx) {
60895 assert(!this.red, 'Already a number in reduction context');
60896 return this._forceRed(ctx);
60897 };
60898
60899 BN.prototype.redAdd = function redAdd (num) {
60900 assert(this.red, 'redAdd works only with red numbers');
60901 return this.red.add(this, num);
60902 };
60903
60904 BN.prototype.redIAdd = function redIAdd (num) {
60905 assert(this.red, 'redIAdd works only with red numbers');
60906 return this.red.iadd(this, num);
60907 };
60908
60909 BN.prototype.redSub = function redSub (num) {
60910 assert(this.red, 'redSub works only with red numbers');
60911 return this.red.sub(this, num);
60912 };
60913
60914 BN.prototype.redISub = function redISub (num) {
60915 assert(this.red, 'redISub works only with red numbers');
60916 return this.red.isub(this, num);
60917 };
60918
60919 BN.prototype.redShl = function redShl (num) {
60920 assert(this.red, 'redShl works only with red numbers');
60921 return this.red.shl(this, num);
60922 };
60923
60924 BN.prototype.redMul = function redMul (num) {
60925 assert(this.red, 'redMul works only with red numbers');
60926 this.red._verify2(this, num);
60927 return this.red.mul(this, num);
60928 };
60929
60930 BN.prototype.redIMul = function redIMul (num) {
60931 assert(this.red, 'redMul works only with red numbers');
60932 this.red._verify2(this, num);
60933 return this.red.imul(this, num);
60934 };
60935
60936 BN.prototype.redSqr = function redSqr () {
60937 assert(this.red, 'redSqr works only with red numbers');
60938 this.red._verify1(this);
60939 return this.red.sqr(this);
60940 };
60941
60942 BN.prototype.redISqr = function redISqr () {
60943 assert(this.red, 'redISqr works only with red numbers');
60944 this.red._verify1(this);
60945 return this.red.isqr(this);
60946 };
60947
60948 // Square root over p
60949 BN.prototype.redSqrt = function redSqrt () {
60950 assert(this.red, 'redSqrt works only with red numbers');
60951 this.red._verify1(this);
60952 return this.red.sqrt(this);
60953 };
60954
60955 BN.prototype.redInvm = function redInvm () {
60956 assert(this.red, 'redInvm works only with red numbers');
60957 this.red._verify1(this);
60958 return this.red.invm(this);
60959 };
60960
60961 // Return negative clone of `this` % `red modulo`
60962 BN.prototype.redNeg = function redNeg () {
60963 assert(this.red, 'redNeg works only with red numbers');
60964 this.red._verify1(this);
60965 return this.red.neg(this);
60966 };
60967
60968 BN.prototype.redPow = function redPow (num) {
60969 assert(this.red && !num.red, 'redPow(normalNum)');
60970 this.red._verify1(this);
60971 return this.red.pow(this, num);
60972 };
60973
60974 // Prime numbers with efficient reduction
60975 var primes = {
60976 k256: null,
60977 p224: null,
60978 p192: null,
60979 p25519: null
60980 };
60981
60982 // Pseudo-Mersenne prime
60983 function MPrime (name, p) {
60984 // P = 2 ^ N - K
60985 this.name = name;
60986 this.p = new BN(p, 16);
60987 this.n = this.p.bitLength();
60988 this.k = new BN(1).iushln(this.n).isub(this.p);
60989
60990 this.tmp = this._tmp();
60991 }
60992
60993 MPrime.prototype._tmp = function _tmp () {
60994 var tmp = new BN(null);
60995 tmp.words = new Array(Math.ceil(this.n / 13));
60996 return tmp;
60997 };
60998
60999 MPrime.prototype.ireduce = function ireduce (num) {
61000 // Assumes that `num` is less than `P^2`
61001 // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)
61002 var r = num;
61003 var rlen;
61004
61005 do {
61006 this.split(r, this.tmp);
61007 r = this.imulK(r);
61008 r = r.iadd(this.tmp);
61009 rlen = r.bitLength();
61010 } while (rlen > this.n);
61011
61012 var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
61013 if (cmp === 0) {
61014 r.words[0] = 0;
61015 r.length = 1;
61016 } else if (cmp > 0) {
61017 r.isub(this.p);
61018 } else {
61019 r.strip();
61020 }
61021
61022 return r;
61023 };
61024
61025 MPrime.prototype.split = function split (input, out) {
61026 input.iushrn(this.n, 0, out);
61027 };
61028
61029 MPrime.prototype.imulK = function imulK (num) {
61030 return num.imul(this.k);
61031 };
61032
61033 function K256 () {
61034 MPrime.call(
61035 this,
61036 'k256',
61037 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');
61038 }
61039 inherits(K256, MPrime);
61040
61041 K256.prototype.split = function split (input, output) {
61042 // 256 = 9 * 26 + 22
61043 var mask = 0x3fffff;
61044
61045 var outLen = Math.min(input.length, 9);
61046 for (var i = 0; i < outLen; i++) {
61047 output.words[i] = input.words[i];
61048 }
61049 output.length = outLen;
61050
61051 if (input.length <= 9) {
61052 input.words[0] = 0;
61053 input.length = 1;
61054 return;
61055 }
61056
61057 // Shift by 9 limbs
61058 var prev = input.words[9];
61059 output.words[output.length++] = prev & mask;
61060
61061 for (i = 10; i < input.length; i++) {
61062 var next = input.words[i] | 0;
61063 input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);
61064 prev = next;
61065 }
61066 prev >>>= 22;
61067 input.words[i - 10] = prev;
61068 if (prev === 0 && input.length > 10) {
61069 input.length -= 10;
61070 } else {
61071 input.length -= 9;
61072 }
61073 };
61074
61075 K256.prototype.imulK = function imulK (num) {
61076 // K = 0x1000003d1 = [ 0x40, 0x3d1 ]
61077 num.words[num.length] = 0;
61078 num.words[num.length + 1] = 0;
61079 num.length += 2;
61080
61081 // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390
61082 var lo = 0;
61083 for (var i = 0; i < num.length; i++) {
61084 var w = num.words[i] | 0;
61085 lo += w * 0x3d1;
61086 num.words[i] = lo & 0x3ffffff;
61087 lo = w * 0x40 + ((lo / 0x4000000) | 0);
61088 }
61089
61090 // Fast length reduction
61091 if (num.words[num.length - 1] === 0) {
61092 num.length--;
61093 if (num.words[num.length - 1] === 0) {
61094 num.length--;
61095 }
61096 }
61097 return num;
61098 };
61099
61100 function P224 () {
61101 MPrime.call(
61102 this,
61103 'p224',
61104 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');
61105 }
61106 inherits(P224, MPrime);
61107
61108 function P192 () {
61109 MPrime.call(
61110 this,
61111 'p192',
61112 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');
61113 }
61114 inherits(P192, MPrime);
61115
61116 function P25519 () {
61117 // 2 ^ 255 - 19
61118 MPrime.call(
61119 this,
61120 '25519',
61121 '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');
61122 }
61123 inherits(P25519, MPrime);
61124
61125 P25519.prototype.imulK = function imulK (num) {
61126 // K = 0x13
61127 var carry = 0;
61128 for (var i = 0; i < num.length; i++) {
61129 var hi = (num.words[i] | 0) * 0x13 + carry;
61130 var lo = hi & 0x3ffffff;
61131 hi >>>= 26;
61132
61133 num.words[i] = lo;
61134 carry = hi;
61135 }
61136 if (carry !== 0) {
61137 num.words[num.length++] = carry;
61138 }
61139 return num;
61140 };
61141
61142 // Exported mostly for testing purposes, use plain name instead
61143 BN._prime = function prime (name) {
61144 // Cached version of prime
61145 if (primes[name]) return primes[name];
61146
61147 var prime;
61148 if (name === 'k256') {
61149 prime = new K256();
61150 } else if (name === 'p224') {
61151 prime = new P224();
61152 } else if (name === 'p192') {
61153 prime = new P192();
61154 } else if (name === 'p25519') {
61155 prime = new P25519();
61156 } else {
61157 throw new Error('Unknown prime ' + name);
61158 }
61159 primes[name] = prime;
61160
61161 return prime;
61162 };
61163
61164 //
61165 // Base reduction engine
61166 //
61167 function Red (m) {
61168 if (typeof m === 'string') {
61169 var prime = BN._prime(m);
61170 this.m = prime.p;
61171 this.prime = prime;
61172 } else {
61173 assert(m.gtn(1), 'modulus must be greater than 1');
61174 this.m = m;
61175 this.prime = null;
61176 }
61177 }
61178
61179 Red.prototype._verify1 = function _verify1 (a) {
61180 assert(a.negative === 0, 'red works only with positives');
61181 assert(a.red, 'red works only with red numbers');
61182 };
61183
61184 Red.prototype._verify2 = function _verify2 (a, b) {
61185 assert((a.negative | b.negative) === 0, 'red works only with positives');
61186 assert(a.red && a.red === b.red,
61187 'red works only with red numbers');
61188 };
61189
61190 Red.prototype.imod = function imod (a) {
61191 if (this.prime) return this.prime.ireduce(a)._forceRed(this);
61192 return a.umod(this.m)._forceRed(this);
61193 };
61194
61195 Red.prototype.neg = function neg (a) {
61196 if (a.isZero()) {
61197 return a.clone();
61198 }
61199
61200 return this.m.sub(a)._forceRed(this);
61201 };
61202
61203 Red.prototype.add = function add (a, b) {
61204 this._verify2(a, b);
61205
61206 var res = a.add(b);
61207 if (res.cmp(this.m) >= 0) {
61208 res.isub(this.m);
61209 }
61210 return res._forceRed(this);
61211 };
61212
61213 Red.prototype.iadd = function iadd (a, b) {
61214 this._verify2(a, b);
61215
61216 var res = a.iadd(b);
61217 if (res.cmp(this.m) >= 0) {
61218 res.isub(this.m);
61219 }
61220 return res;
61221 };
61222
61223 Red.prototype.sub = function sub (a, b) {
61224 this._verify2(a, b);
61225
61226 var res = a.sub(b);
61227 if (res.cmpn(0) < 0) {
61228 res.iadd(this.m);
61229 }
61230 return res._forceRed(this);
61231 };
61232
61233 Red.prototype.isub = function isub (a, b) {
61234 this._verify2(a, b);
61235
61236 var res = a.isub(b);
61237 if (res.cmpn(0) < 0) {
61238 res.iadd(this.m);
61239 }
61240 return res;
61241 };
61242
61243 Red.prototype.shl = function shl (a, num) {
61244 this._verify1(a);
61245 return this.imod(a.ushln(num));
61246 };
61247
61248 Red.prototype.imul = function imul (a, b) {
61249 this._verify2(a, b);
61250 return this.imod(a.imul(b));
61251 };
61252
61253 Red.prototype.mul = function mul (a, b) {
61254 this._verify2(a, b);
61255 return this.imod(a.mul(b));
61256 };
61257
61258 Red.prototype.isqr = function isqr (a) {
61259 return this.imul(a, a.clone());
61260 };
61261
61262 Red.prototype.sqr = function sqr (a) {
61263 return this.mul(a, a);
61264 };
61265
61266 Red.prototype.sqrt = function sqrt (a) {
61267 if (a.isZero()) return a.clone();
61268
61269 var mod3 = this.m.andln(3);
61270 assert(mod3 % 2 === 1);
61271
61272 // Fast case
61273 if (mod3 === 3) {
61274 var pow = this.m.add(new BN(1)).iushrn(2);
61275 return this.pow(a, pow);
61276 }
61277
61278 // Tonelli-Shanks algorithm (Totally unoptimized and slow)
61279 //
61280 // Find Q and S, that Q * 2 ^ S = (P - 1)
61281 var q = this.m.subn(1);
61282 var s = 0;
61283 while (!q.isZero() && q.andln(1) === 0) {
61284 s++;
61285 q.iushrn(1);
61286 }
61287 assert(!q.isZero());
61288
61289 var one = new BN(1).toRed(this);
61290 var nOne = one.redNeg();
61291
61292 // Find quadratic non-residue
61293 // NOTE: Max is such because of generalized Riemann hypothesis.
61294 var lpow = this.m.subn(1).iushrn(1);
61295 var z = this.m.bitLength();
61296 z = new BN(2 * z * z).toRed(this);
61297
61298 while (this.pow(z, lpow).cmp(nOne) !== 0) {
61299 z.redIAdd(nOne);
61300 }
61301
61302 var c = this.pow(z, q);
61303 var r = this.pow(a, q.addn(1).iushrn(1));
61304 var t = this.pow(a, q);
61305 var m = s;
61306 while (t.cmp(one) !== 0) {
61307 var tmp = t;
61308 for (var i = 0; tmp.cmp(one) !== 0; i++) {
61309 tmp = tmp.redSqr();
61310 }
61311 assert(i < m);
61312 var b = this.pow(c, new BN(1).iushln(m - i - 1));
61313
61314 r = r.redMul(b);
61315 c = b.redSqr();
61316 t = t.redMul(c);
61317 m = i;
61318 }
61319
61320 return r;
61321 };
61322
61323 Red.prototype.invm = function invm (a) {
61324 var inv = a._invmp(this.m);
61325 if (inv.negative !== 0) {
61326 inv.negative = 0;
61327 return this.imod(inv).redNeg();
61328 } else {
61329 return this.imod(inv);
61330 }
61331 };
61332
61333 Red.prototype.pow = function pow (a, num) {
61334 if (num.isZero()) return new BN(1);
61335 if (num.cmpn(1) === 0) return a.clone();
61336
61337 var windowSize = 4;
61338 var wnd = new Array(1 << windowSize);
61339 wnd[0] = new BN(1).toRed(this);
61340 wnd[1] = a;
61341 for (var i = 2; i < wnd.length; i++) {
61342 wnd[i] = this.mul(wnd[i - 1], a);
61343 }
61344
61345 var res = wnd[0];
61346 var current = 0;
61347 var currentLen = 0;
61348 var start = num.bitLength() % 26;
61349 if (start === 0) {
61350 start = 26;
61351 }
61352
61353 for (i = num.length - 1; i >= 0; i--) {
61354 var word = num.words[i];
61355 for (var j = start - 1; j >= 0; j--) {
61356 var bit = (word >> j) & 1;
61357 if (res !== wnd[0]) {
61358 res = this.sqr(res);
61359 }
61360
61361 if (bit === 0 && current === 0) {
61362 currentLen = 0;
61363 continue;
61364 }
61365
61366 current <<= 1;
61367 current |= bit;
61368 currentLen++;
61369 if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
61370
61371 res = this.mul(res, wnd[current]);
61372 currentLen = 0;
61373 current = 0;
61374 }
61375 start = 26;
61376 }
61377
61378 return res;
61379 };
61380
61381 Red.prototype.convertTo = function convertTo (num) {
61382 var r = num.umod(this.m);
61383
61384 return r === num ? r.clone() : r;
61385 };
61386
61387 Red.prototype.convertFrom = function convertFrom (num) {
61388 var res = num.clone();
61389 res.red = null;
61390 return res;
61391 };
61392
61393 //
61394 // Montgomery method engine
61395 //
61396
61397 BN.mont = function mont (num) {
61398 return new Mont(num);
61399 };
61400
61401 function Mont (m) {
61402 Red.call(this, m);
61403
61404 this.shift = this.m.bitLength();
61405 if (this.shift % 26 !== 0) {
61406 this.shift += 26 - (this.shift % 26);
61407 }
61408
61409 this.r = new BN(1).iushln(this.shift);
61410 this.r2 = this.imod(this.r.sqr());
61411 this.rinv = this.r._invmp(this.m);
61412
61413 this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
61414 this.minv = this.minv.umod(this.r);
61415 this.minv = this.r.sub(this.minv);
61416 }
61417 inherits(Mont, Red);
61418
61419 Mont.prototype.convertTo = function convertTo (num) {
61420 return this.imod(num.ushln(this.shift));
61421 };
61422
61423 Mont.prototype.convertFrom = function convertFrom (num) {
61424 var r = this.imod(num.mul(this.rinv));
61425 r.red = null;
61426 return r;
61427 };
61428
61429 Mont.prototype.imul = function imul (a, b) {
61430 if (a.isZero() || b.isZero()) {
61431 a.words[0] = 0;
61432 a.length = 1;
61433 return a;
61434 }
61435
61436 var t = a.imul(b);
61437 var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
61438 var u = t.isub(c).iushrn(this.shift);
61439 var res = u;
61440
61441 if (u.cmp(this.m) >= 0) {
61442 res = u.isub(this.m);
61443 } else if (u.cmpn(0) < 0) {
61444 res = u.iadd(this.m);
61445 }
61446
61447 return res._forceRed(this);
61448 };
61449
61450 Mont.prototype.mul = function mul (a, b) {
61451 if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
61452
61453 var t = a.mul(b);
61454 var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
61455 var u = t.isub(c).iushrn(this.shift);
61456 var res = u;
61457 if (u.cmp(this.m) >= 0) {
61458 res = u.isub(this.m);
61459 } else if (u.cmpn(0) < 0) {
61460 res = u.iadd(this.m);
61461 }
61462
61463 return res._forceRed(this);
61464 };
61465
61466 Mont.prototype.invm = function invm (a) {
61467 // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R
61468 var res = this.imod(a._invmp(this.m).mul(this.r2));
61469 return res._forceRed(this);
61470 };
61471})(typeof module === 'undefined' || module, this);
61472
61473},{}],34:[function(require,module,exports){
61474var r;
61475
61476module.exports = function rand(len) {
61477 if (!r)
61478 r = new Rand(null);
61479
61480 return r.generate(len);
61481};
61482
61483function Rand(rand) {
61484 this.rand = rand;
61485}
61486module.exports.Rand = Rand;
61487
61488Rand.prototype.generate = function generate(len) {
61489 return this._rand(len);
61490};
61491
61492if (typeof self === 'object') {
61493 if (self.crypto && self.crypto.getRandomValues) {
61494 // Modern browsers
61495 Rand.prototype._rand = function _rand(n) {
61496 var arr = new Uint8Array(n);
61497 self.crypto.getRandomValues(arr);
61498 return arr;
61499 };
61500 } else if (self.msCrypto && self.msCrypto.getRandomValues) {
61501 // IE
61502 Rand.prototype._rand = function _rand(n) {
61503 var arr = new Uint8Array(n);
61504 self.msCrypto.getRandomValues(arr);
61505 return arr;
61506 };
61507 } else {
61508 // Old junk
61509 Rand.prototype._rand = function() {
61510 throw new Error('Not implemented yet');
61511 };
61512 }
61513} else {
61514 // Node.js or Web worker with no crypto support
61515 try {
61516 var crypto = require('crypto');
61517
61518 Rand.prototype._rand = function _rand(n) {
61519 return crypto.randomBytes(n);
61520 };
61521 } catch (e) {
61522 // Emulate crypto API using randy
61523 Rand.prototype._rand = function _rand(n) {
61524 var res = new Uint8Array(n);
61525 for (var i = 0; i < res.length; i++)
61526 res[i] = this.rand.getByte();
61527 return res;
61528 };
61529 }
61530}
61531
61532},{"crypto":3}],35:[function(require,module,exports){
61533(function (Buffer){
61534var Transform = require('stream').Transform
61535var inherits = require('inherits')
61536var StringDecoder = require('string_decoder').StringDecoder
61537module.exports = CipherBase
61538inherits(CipherBase, Transform)
61539function CipherBase (hashMode) {
61540 Transform.call(this)
61541 this.hashMode = typeof hashMode === 'string'
61542 if (this.hashMode) {
61543 this[hashMode] = this._finalOrDigest
61544 } else {
61545 this.final = this._finalOrDigest
61546 }
61547 this._decoder = null
61548 this._encoding = null
61549}
61550CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
61551 if (typeof data === 'string') {
61552 data = new Buffer(data, inputEnc)
61553 }
61554 var outData = this._update(data)
61555 if (this.hashMode) {
61556 return this
61557 }
61558 if (outputEnc) {
61559 outData = this._toString(outData, outputEnc)
61560 }
61561 return outData
61562}
61563
61564CipherBase.prototype.setAutoPadding = function () {}
61565
61566CipherBase.prototype.getAuthTag = function () {
61567 throw new Error('trying to get auth tag in unsupported state')
61568}
61569
61570CipherBase.prototype.setAuthTag = function () {
61571 throw new Error('trying to set auth tag in unsupported state')
61572}
61573
61574CipherBase.prototype.setAAD = function () {
61575 throw new Error('trying to set aad in unsupported state')
61576}
61577
61578CipherBase.prototype._transform = function (data, _, next) {
61579 var err
61580 try {
61581 if (this.hashMode) {
61582 this._update(data)
61583 } else {
61584 this.push(this._update(data))
61585 }
61586 } catch (e) {
61587 err = e
61588 } finally {
61589 next(err)
61590 }
61591}
61592CipherBase.prototype._flush = function (done) {
61593 var err
61594 try {
61595 this.push(this._final())
61596 } catch (e) {
61597 err = e
61598 } finally {
61599 done(err)
61600 }
61601}
61602CipherBase.prototype._finalOrDigest = function (outputEnc) {
61603 var outData = this._final() || new Buffer('')
61604 if (outputEnc) {
61605 outData = this._toString(outData, outputEnc, true)
61606 }
61607 return outData
61608}
61609
61610CipherBase.prototype._toString = function (value, enc, fin) {
61611 if (!this._decoder) {
61612 this._decoder = new StringDecoder(enc)
61613 this._encoding = enc
61614 }
61615 if (this._encoding !== enc) {
61616 throw new Error('can\'t switch encodings')
61617 }
61618 var out = this._decoder.write(value)
61619 if (fin) {
61620 out += this._decoder.end()
61621 }
61622 return out
61623}
61624
61625}).call(this,require("buffer").Buffer)
61626},{"buffer":5,"inherits":63,"stream":25,"string_decoder":26}],36:[function(require,module,exports){
61627(function (Buffer){
61628'use strict';
61629var inherits = require('inherits')
61630var md5 = require('./md5')
61631var rmd160 = require('ripemd160')
61632var sha = require('sha.js')
61633
61634var Base = require('cipher-base')
61635
61636function HashNoConstructor(hash) {
61637 Base.call(this, 'digest')
61638
61639 this._hash = hash
61640 this.buffers = []
61641}
61642
61643inherits(HashNoConstructor, Base)
61644
61645HashNoConstructor.prototype._update = function (data) {
61646 this.buffers.push(data)
61647}
61648
61649HashNoConstructor.prototype._final = function () {
61650 var buf = Buffer.concat(this.buffers)
61651 var r = this._hash(buf)
61652 this.buffers = null
61653
61654 return r
61655}
61656
61657function Hash(hash) {
61658 Base.call(this, 'digest')
61659
61660 this._hash = hash
61661}
61662
61663inherits(Hash, Base)
61664
61665Hash.prototype._update = function (data) {
61666 this._hash.update(data)
61667}
61668
61669Hash.prototype._final = function () {
61670 return this._hash.digest()
61671}
61672
61673module.exports = function createHash (alg) {
61674 alg = alg.toLowerCase()
61675 if ('md5' === alg) return new HashNoConstructor(md5)
61676 if ('rmd160' === alg || 'ripemd160' === alg) return new HashNoConstructor(rmd160)
61677
61678 return new Hash(sha(alg))
61679}
61680
61681}).call(this,require("buffer").Buffer)
61682},{"./md5":38,"buffer":5,"cipher-base":35,"inherits":63,"ripemd160":71,"sha.js":80}],37:[function(require,module,exports){
61683(function (Buffer){
61684'use strict';
61685var intSize = 4;
61686var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0);
61687var chrsz = 8;
61688
61689function toArray(buf, bigEndian) {
61690 if ((buf.length % intSize) !== 0) {
61691 var len = buf.length + (intSize - (buf.length % intSize));
61692 buf = Buffer.concat([buf, zeroBuffer], len);
61693 }
61694
61695 var arr = [];
61696 var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;
61697 for (var i = 0; i < buf.length; i += intSize) {
61698 arr.push(fn.call(buf, i));
61699 }
61700 return arr;
61701}
61702
61703function toBuffer(arr, size, bigEndian) {
61704 var buf = new Buffer(size);
61705 var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;
61706 for (var i = 0; i < arr.length; i++) {
61707 fn.call(buf, arr[i], i * 4, true);
61708 }
61709 return buf;
61710}
61711
61712function hash(buf, fn, hashSize, bigEndian) {
61713 if (!Buffer.isBuffer(buf)) buf = new Buffer(buf);
61714 var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);
61715 return toBuffer(arr, hashSize, bigEndian);
61716}
61717exports.hash = hash;
61718}).call(this,require("buffer").Buffer)
61719},{"buffer":5}],38:[function(require,module,exports){
61720'use strict';
61721/*
61722 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
61723 * Digest Algorithm, as defined in RFC 1321.
61724 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
61725 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
61726 * Distributed under the BSD License
61727 * See http://pajhome.org.uk/crypt/md5 for more info.
61728 */
61729
61730var helpers = require('./helpers');
61731
61732/*
61733 * Calculate the MD5 of an array of little-endian words, and a bit length
61734 */
61735function core_md5(x, len)
61736{
61737 /* append padding */
61738 x[len >> 5] |= 0x80 << ((len) % 32);
61739 x[(((len + 64) >>> 9) << 4) + 14] = len;
61740
61741 var a = 1732584193;
61742 var b = -271733879;
61743 var c = -1732584194;
61744 var d = 271733878;
61745
61746 for(var i = 0; i < x.length; i += 16)
61747 {
61748 var olda = a;
61749 var oldb = b;
61750 var oldc = c;
61751 var oldd = d;
61752
61753 a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
61754 d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
61755 c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
61756 b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
61757 a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
61758 d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
61759 c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
61760 b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
61761 a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
61762 d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
61763 c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
61764 b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
61765 a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
61766 d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
61767 c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
61768 b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
61769
61770 a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
61771 d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
61772 c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
61773 b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
61774 a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
61775 d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
61776 c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
61777 b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
61778 a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
61779 d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
61780 c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
61781 b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
61782 a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
61783 d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
61784 c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
61785 b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
61786
61787 a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
61788 d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
61789 c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
61790 b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
61791 a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
61792 d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
61793 c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
61794 b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
61795 a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
61796 d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
61797 c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
61798 b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
61799 a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
61800 d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
61801 c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
61802 b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
61803
61804 a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
61805 d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
61806 c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
61807 b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
61808 a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
61809 d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
61810 c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
61811 b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
61812 a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
61813 d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
61814 c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
61815 b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
61816 a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
61817 d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
61818 c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
61819 b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
61820
61821 a = safe_add(a, olda);
61822 b = safe_add(b, oldb);
61823 c = safe_add(c, oldc);
61824 d = safe_add(d, oldd);
61825 }
61826 return Array(a, b, c, d);
61827
61828}
61829
61830/*
61831 * These functions implement the four basic operations the algorithm uses.
61832 */
61833function md5_cmn(q, a, b, x, s, t)
61834{
61835 return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
61836}
61837function md5_ff(a, b, c, d, x, s, t)
61838{
61839 return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
61840}
61841function md5_gg(a, b, c, d, x, s, t)
61842{
61843 return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
61844}
61845function md5_hh(a, b, c, d, x, s, t)
61846{
61847 return md5_cmn(b ^ c ^ d, a, b, x, s, t);
61848}
61849function md5_ii(a, b, c, d, x, s, t)
61850{
61851 return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
61852}
61853
61854/*
61855 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
61856 * to work around bugs in some JS interpreters.
61857 */
61858function safe_add(x, y)
61859{
61860 var lsw = (x & 0xFFFF) + (y & 0xFFFF);
61861 var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
61862 return (msw << 16) | (lsw & 0xFFFF);
61863}
61864
61865/*
61866 * Bitwise rotate a 32-bit number to the left.
61867 */
61868function bit_rol(num, cnt)
61869{
61870 return (num << cnt) | (num >>> (32 - cnt));
61871}
61872
61873module.exports = function md5(buf) {
61874 return helpers.hash(buf, core_md5, 16);
61875};
61876},{"./helpers":37}],39:[function(require,module,exports){
61877'use strict';
61878
61879var elliptic = exports;
61880
61881elliptic.version = require('../package.json').version;
61882elliptic.utils = require('./elliptic/utils');
61883elliptic.rand = require('brorand');
61884elliptic.hmacDRBG = require('./elliptic/hmac-drbg');
61885elliptic.curve = require('./elliptic/curve');
61886elliptic.curves = require('./elliptic/curves');
61887
61888// Protocols
61889elliptic.ec = require('./elliptic/ec');
61890elliptic.eddsa = require('./elliptic/eddsa');
61891
61892},{"../package.json":55,"./elliptic/curve":42,"./elliptic/curves":45,"./elliptic/ec":46,"./elliptic/eddsa":49,"./elliptic/hmac-drbg":52,"./elliptic/utils":54,"brorand":34}],40:[function(require,module,exports){
61893'use strict';
61894
61895var BN = require('bn.js');
61896var elliptic = require('../../elliptic');
61897var utils = elliptic.utils;
61898var getNAF = utils.getNAF;
61899var getJSF = utils.getJSF;
61900var assert = utils.assert;
61901
61902function BaseCurve(type, conf) {
61903 this.type = type;
61904 this.p = new BN(conf.p, 16);
61905
61906 // Use Montgomery, when there is no fast reduction for the prime
61907 this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);
61908
61909 // Useful for many curves
61910 this.zero = new BN(0).toRed(this.red);
61911 this.one = new BN(1).toRed(this.red);
61912 this.two = new BN(2).toRed(this.red);
61913
61914 // Curve configuration, optional
61915 this.n = conf.n && new BN(conf.n, 16);
61916 this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
61917
61918 // Temporary arrays
61919 this._wnafT1 = new Array(4);
61920 this._wnafT2 = new Array(4);
61921 this._wnafT3 = new Array(4);
61922 this._wnafT4 = new Array(4);
61923
61924 // Generalized Greg Maxwell's trick
61925 var adjustCount = this.n && this.p.div(this.n);
61926 if (!adjustCount || adjustCount.cmpn(100) > 0) {
61927 this.redN = null;
61928 } else {
61929 this._maxwellTrick = true;
61930 this.redN = this.n.toRed(this.red);
61931 }
61932}
61933module.exports = BaseCurve;
61934
61935BaseCurve.prototype.point = function point() {
61936 throw new Error('Not implemented');
61937};
61938
61939BaseCurve.prototype.validate = function validate() {
61940 throw new Error('Not implemented');
61941};
61942
61943BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
61944 assert(p.precomputed);
61945 var doubles = p._getDoubles();
61946
61947 var naf = getNAF(k, 1);
61948 var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);
61949 I /= 3;
61950
61951 // Translate into more windowed form
61952 var repr = [];
61953 for (var j = 0; j < naf.length; j += doubles.step) {
61954 var nafW = 0;
61955 for (var k = j + doubles.step - 1; k >= j; k--)
61956 nafW = (nafW << 1) + naf[k];
61957 repr.push(nafW);
61958 }
61959
61960 var a = this.jpoint(null, null, null);
61961 var b = this.jpoint(null, null, null);
61962 for (var i = I; i > 0; i--) {
61963 for (var j = 0; j < repr.length; j++) {
61964 var nafW = repr[j];
61965 if (nafW === i)
61966 b = b.mixedAdd(doubles.points[j]);
61967 else if (nafW === -i)
61968 b = b.mixedAdd(doubles.points[j].neg());
61969 }
61970 a = a.add(b);
61971 }
61972 return a.toP();
61973};
61974
61975BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {
61976 var w = 4;
61977
61978 // Precompute window
61979 var nafPoints = p._getNAFPoints(w);
61980 w = nafPoints.wnd;
61981 var wnd = nafPoints.points;
61982
61983 // Get NAF form
61984 var naf = getNAF(k, w);
61985
61986 // Add `this`*(N+1) for every w-NAF index
61987 var acc = this.jpoint(null, null, null);
61988 for (var i = naf.length - 1; i >= 0; i--) {
61989 // Count zeroes
61990 for (var k = 0; i >= 0 && naf[i] === 0; i--)
61991 k++;
61992 if (i >= 0)
61993 k++;
61994 acc = acc.dblp(k);
61995
61996 if (i < 0)
61997 break;
61998 var z = naf[i];
61999 assert(z !== 0);
62000 if (p.type === 'affine') {
62001 // J +- P
62002 if (z > 0)
62003 acc = acc.mixedAdd(wnd[(z - 1) >> 1]);
62004 else
62005 acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());
62006 } else {
62007 // J +- J
62008 if (z > 0)
62009 acc = acc.add(wnd[(z - 1) >> 1]);
62010 else
62011 acc = acc.add(wnd[(-z - 1) >> 1].neg());
62012 }
62013 }
62014 return p.type === 'affine' ? acc.toP() : acc;
62015};
62016
62017BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,
62018 points,
62019 coeffs,
62020 len,
62021 jacobianResult) {
62022 var wndWidth = this._wnafT1;
62023 var wnd = this._wnafT2;
62024 var naf = this._wnafT3;
62025
62026 // Fill all arrays
62027 var max = 0;
62028 for (var i = 0; i < len; i++) {
62029 var p = points[i];
62030 var nafPoints = p._getNAFPoints(defW);
62031 wndWidth[i] = nafPoints.wnd;
62032 wnd[i] = nafPoints.points;
62033 }
62034
62035 // Comb small window NAFs
62036 for (var i = len - 1; i >= 1; i -= 2) {
62037 var a = i - 1;
62038 var b = i;
62039 if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {
62040 naf[a] = getNAF(coeffs[a], wndWidth[a]);
62041 naf[b] = getNAF(coeffs[b], wndWidth[b]);
62042 max = Math.max(naf[a].length, max);
62043 max = Math.max(naf[b].length, max);
62044 continue;
62045 }
62046
62047 var comb = [
62048 points[a], /* 1 */
62049 null, /* 3 */
62050 null, /* 5 */
62051 points[b] /* 7 */
62052 ];
62053
62054 // Try to avoid Projective points, if possible
62055 if (points[a].y.cmp(points[b].y) === 0) {
62056 comb[1] = points[a].add(points[b]);
62057 comb[2] = points[a].toJ().mixedAdd(points[b].neg());
62058 } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {
62059 comb[1] = points[a].toJ().mixedAdd(points[b]);
62060 comb[2] = points[a].add(points[b].neg());
62061 } else {
62062 comb[1] = points[a].toJ().mixedAdd(points[b]);
62063 comb[2] = points[a].toJ().mixedAdd(points[b].neg());
62064 }
62065
62066 var index = [
62067 -3, /* -1 -1 */
62068 -1, /* -1 0 */
62069 -5, /* -1 1 */
62070 -7, /* 0 -1 */
62071 0, /* 0 0 */
62072 7, /* 0 1 */
62073 5, /* 1 -1 */
62074 1, /* 1 0 */
62075 3 /* 1 1 */
62076 ];
62077
62078 var jsf = getJSF(coeffs[a], coeffs[b]);
62079 max = Math.max(jsf[0].length, max);
62080 naf[a] = new Array(max);
62081 naf[b] = new Array(max);
62082 for (var j = 0; j < max; j++) {
62083 var ja = jsf[0][j] | 0;
62084 var jb = jsf[1][j] | 0;
62085
62086 naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];
62087 naf[b][j] = 0;
62088 wnd[a] = comb;
62089 }
62090 }
62091
62092 var acc = this.jpoint(null, null, null);
62093 var tmp = this._wnafT4;
62094 for (var i = max; i >= 0; i--) {
62095 var k = 0;
62096
62097 while (i >= 0) {
62098 var zero = true;
62099 for (var j = 0; j < len; j++) {
62100 tmp[j] = naf[j][i] | 0;
62101 if (tmp[j] !== 0)
62102 zero = false;
62103 }
62104 if (!zero)
62105 break;
62106 k++;
62107 i--;
62108 }
62109 if (i >= 0)
62110 k++;
62111 acc = acc.dblp(k);
62112 if (i < 0)
62113 break;
62114
62115 for (var j = 0; j < len; j++) {
62116 var z = tmp[j];
62117 var p;
62118 if (z === 0)
62119 continue;
62120 else if (z > 0)
62121 p = wnd[j][(z - 1) >> 1];
62122 else if (z < 0)
62123 p = wnd[j][(-z - 1) >> 1].neg();
62124
62125 if (p.type === 'affine')
62126 acc = acc.mixedAdd(p);
62127 else
62128 acc = acc.add(p);
62129 }
62130 }
62131 // Zeroify references
62132 for (var i = 0; i < len; i++)
62133 wnd[i] = null;
62134
62135 if (jacobianResult)
62136 return acc;
62137 else
62138 return acc.toP();
62139};
62140
62141function BasePoint(curve, type) {
62142 this.curve = curve;
62143 this.type = type;
62144 this.precomputed = null;
62145}
62146BaseCurve.BasePoint = BasePoint;
62147
62148BasePoint.prototype.eq = function eq(/*other*/) {
62149 throw new Error('Not implemented');
62150};
62151
62152BasePoint.prototype.validate = function validate() {
62153 return this.curve.validate(this);
62154};
62155
62156BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
62157 bytes = utils.toArray(bytes, enc);
62158
62159 var len = this.p.byteLength();
62160
62161 // uncompressed, hybrid-odd, hybrid-even
62162 if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&
62163 bytes.length - 1 === 2 * len) {
62164 if (bytes[0] === 0x06)
62165 assert(bytes[bytes.length - 1] % 2 === 0);
62166 else if (bytes[0] === 0x07)
62167 assert(bytes[bytes.length - 1] % 2 === 1);
62168
62169 var res = this.point(bytes.slice(1, 1 + len),
62170 bytes.slice(1 + len, 1 + 2 * len));
62171
62172 return res;
62173 } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&
62174 bytes.length - 1 === len) {
62175 return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);
62176 }
62177 throw new Error('Unknown point format');
62178};
62179
62180BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {
62181 return this.encode(enc, true);
62182};
62183
62184BasePoint.prototype._encode = function _encode(compact) {
62185 var len = this.curve.p.byteLength();
62186 var x = this.getX().toArray('be', len);
62187
62188 if (compact)
62189 return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);
62190
62191 return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ;
62192};
62193
62194BasePoint.prototype.encode = function encode(enc, compact) {
62195 return utils.encode(this._encode(compact), enc);
62196};
62197
62198BasePoint.prototype.precompute = function precompute(power) {
62199 if (this.precomputed)
62200 return this;
62201
62202 var precomputed = {
62203 doubles: null,
62204 naf: null,
62205 beta: null
62206 };
62207 precomputed.naf = this._getNAFPoints(8);
62208 precomputed.doubles = this._getDoubles(4, power);
62209 precomputed.beta = this._getBeta();
62210 this.precomputed = precomputed;
62211
62212 return this;
62213};
62214
62215BasePoint.prototype._hasDoubles = function _hasDoubles(k) {
62216 if (!this.precomputed)
62217 return false;
62218
62219 var doubles = this.precomputed.doubles;
62220 if (!doubles)
62221 return false;
62222
62223 return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
62224};
62225
62226BasePoint.prototype._getDoubles = function _getDoubles(step, power) {
62227 if (this.precomputed && this.precomputed.doubles)
62228 return this.precomputed.doubles;
62229
62230 var doubles = [ this ];
62231 var acc = this;
62232 for (var i = 0; i < power; i += step) {
62233 for (var j = 0; j < step; j++)
62234 acc = acc.dbl();
62235 doubles.push(acc);
62236 }
62237 return {
62238 step: step,
62239 points: doubles
62240 };
62241};
62242
62243BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {
62244 if (this.precomputed && this.precomputed.naf)
62245 return this.precomputed.naf;
62246
62247 var res = [ this ];
62248 var max = (1 << wnd) - 1;
62249 var dbl = max === 1 ? null : this.dbl();
62250 for (var i = 1; i < max; i++)
62251 res[i] = res[i - 1].add(dbl);
62252 return {
62253 wnd: wnd,
62254 points: res
62255 };
62256};
62257
62258BasePoint.prototype._getBeta = function _getBeta() {
62259 return null;
62260};
62261
62262BasePoint.prototype.dblp = function dblp(k) {
62263 var r = this;
62264 for (var i = 0; i < k; i++)
62265 r = r.dbl();
62266 return r;
62267};
62268
62269},{"../../elliptic":39,"bn.js":33}],41:[function(require,module,exports){
62270'use strict';
62271
62272var curve = require('../curve');
62273var elliptic = require('../../elliptic');
62274var BN = require('bn.js');
62275var inherits = require('inherits');
62276var Base = curve.base;
62277
62278var assert = elliptic.utils.assert;
62279
62280function EdwardsCurve(conf) {
62281 // NOTE: Important as we are creating point in Base.call()
62282 this.twisted = (conf.a | 0) !== 1;
62283 this.mOneA = this.twisted && (conf.a | 0) === -1;
62284 this.extended = this.mOneA;
62285
62286 Base.call(this, 'edwards', conf);
62287
62288 this.a = new BN(conf.a, 16).umod(this.red.m);
62289 this.a = this.a.toRed(this.red);
62290 this.c = new BN(conf.c, 16).toRed(this.red);
62291 this.c2 = this.c.redSqr();
62292 this.d = new BN(conf.d, 16).toRed(this.red);
62293 this.dd = this.d.redAdd(this.d);
62294
62295 assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);
62296 this.oneC = (conf.c | 0) === 1;
62297}
62298inherits(EdwardsCurve, Base);
62299module.exports = EdwardsCurve;
62300
62301EdwardsCurve.prototype._mulA = function _mulA(num) {
62302 if (this.mOneA)
62303 return num.redNeg();
62304 else
62305 return this.a.redMul(num);
62306};
62307
62308EdwardsCurve.prototype._mulC = function _mulC(num) {
62309 if (this.oneC)
62310 return num;
62311 else
62312 return this.c.redMul(num);
62313};
62314
62315// Just for compatibility with Short curve
62316EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {
62317 return this.point(x, y, z, t);
62318};
62319
62320EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
62321 x = new BN(x, 16);
62322 if (!x.red)
62323 x = x.toRed(this.red);
62324
62325 var x2 = x.redSqr();
62326 var rhs = this.c2.redSub(this.a.redMul(x2));
62327 var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
62328
62329 var y2 = rhs.redMul(lhs.redInvm());
62330 var y = y2.redSqrt();
62331 if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
62332 throw new Error('invalid point');
62333
62334 var isOdd = y.fromRed().isOdd();
62335 if (odd && !isOdd || !odd && isOdd)
62336 y = y.redNeg();
62337
62338 return this.point(x, y);
62339};
62340
62341EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
62342 y = new BN(y, 16);
62343 if (!y.red)
62344 y = y.toRed(this.red);
62345
62346 // x^2 = (y^2 - 1) / (d y^2 + 1)
62347 var y2 = y.redSqr();
62348 var lhs = y2.redSub(this.one);
62349 var rhs = y2.redMul(this.d).redAdd(this.one);
62350 var x2 = lhs.redMul(rhs.redInvm());
62351
62352 if (x2.cmp(this.zero) === 0) {
62353 if (odd)
62354 throw new Error('invalid point');
62355 else
62356 return this.point(this.zero, y);
62357 }
62358
62359 var x = x2.redSqrt();
62360 if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)
62361 throw new Error('invalid point');
62362
62363 if (x.isOdd() !== odd)
62364 x = x.redNeg();
62365
62366 return this.point(x, y);
62367};
62368
62369EdwardsCurve.prototype.validate = function validate(point) {
62370 if (point.isInfinity())
62371 return true;
62372
62373 // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)
62374 point.normalize();
62375
62376 var x2 = point.x.redSqr();
62377 var y2 = point.y.redSqr();
62378 var lhs = x2.redMul(this.a).redAdd(y2);
62379 var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
62380
62381 return lhs.cmp(rhs) === 0;
62382};
62383
62384function Point(curve, x, y, z, t) {
62385 Base.BasePoint.call(this, curve, 'projective');
62386 if (x === null && y === null && z === null) {
62387 this.x = this.curve.zero;
62388 this.y = this.curve.one;
62389 this.z = this.curve.one;
62390 this.t = this.curve.zero;
62391 this.zOne = true;
62392 } else {
62393 this.x = new BN(x, 16);
62394 this.y = new BN(y, 16);
62395 this.z = z ? new BN(z, 16) : this.curve.one;
62396 this.t = t && new BN(t, 16);
62397 if (!this.x.red)
62398 this.x = this.x.toRed(this.curve.red);
62399 if (!this.y.red)
62400 this.y = this.y.toRed(this.curve.red);
62401 if (!this.z.red)
62402 this.z = this.z.toRed(this.curve.red);
62403 if (this.t && !this.t.red)
62404 this.t = this.t.toRed(this.curve.red);
62405 this.zOne = this.z === this.curve.one;
62406
62407 // Use extended coordinates
62408 if (this.curve.extended && !this.t) {
62409 this.t = this.x.redMul(this.y);
62410 if (!this.zOne)
62411 this.t = this.t.redMul(this.z.redInvm());
62412 }
62413 }
62414}
62415inherits(Point, Base.BasePoint);
62416
62417EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
62418 return Point.fromJSON(this, obj);
62419};
62420
62421EdwardsCurve.prototype.point = function point(x, y, z, t) {
62422 return new Point(this, x, y, z, t);
62423};
62424
62425Point.fromJSON = function fromJSON(curve, obj) {
62426 return new Point(curve, obj[0], obj[1], obj[2]);
62427};
62428
62429Point.prototype.inspect = function inspect() {
62430 if (this.isInfinity())
62431 return '<EC Point Infinity>';
62432 return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
62433 ' y: ' + this.y.fromRed().toString(16, 2) +
62434 ' z: ' + this.z.fromRed().toString(16, 2) + '>';
62435};
62436
62437Point.prototype.isInfinity = function isInfinity() {
62438 // XXX This code assumes that zero is always zero in red
62439 return this.x.cmpn(0) === 0 &&
62440 this.y.cmp(this.z) === 0;
62441};
62442
62443Point.prototype._extDbl = function _extDbl() {
62444 // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
62445 // #doubling-dbl-2008-hwcd
62446 // 4M + 4S
62447
62448 // A = X1^2
62449 var a = this.x.redSqr();
62450 // B = Y1^2
62451 var b = this.y.redSqr();
62452 // C = 2 * Z1^2
62453 var c = this.z.redSqr();
62454 c = c.redIAdd(c);
62455 // D = a * A
62456 var d = this.curve._mulA(a);
62457 // E = (X1 + Y1)^2 - A - B
62458 var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);
62459 // G = D + B
62460 var g = d.redAdd(b);
62461 // F = G - C
62462 var f = g.redSub(c);
62463 // H = D - B
62464 var h = d.redSub(b);
62465 // X3 = E * F
62466 var nx = e.redMul(f);
62467 // Y3 = G * H
62468 var ny = g.redMul(h);
62469 // T3 = E * H
62470 var nt = e.redMul(h);
62471 // Z3 = F * G
62472 var nz = f.redMul(g);
62473 return this.curve.point(nx, ny, nz, nt);
62474};
62475
62476Point.prototype._projDbl = function _projDbl() {
62477 // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
62478 // #doubling-dbl-2008-bbjlp
62479 // #doubling-dbl-2007-bl
62480 // and others
62481 // Generally 3M + 4S or 2M + 4S
62482
62483 // B = (X1 + Y1)^2
62484 var b = this.x.redAdd(this.y).redSqr();
62485 // C = X1^2
62486 var c = this.x.redSqr();
62487 // D = Y1^2
62488 var d = this.y.redSqr();
62489
62490 var nx;
62491 var ny;
62492 var nz;
62493 if (this.curve.twisted) {
62494 // E = a * C
62495 var e = this.curve._mulA(c);
62496 // F = E + D
62497 var f = e.redAdd(d);
62498 if (this.zOne) {
62499 // X3 = (B - C - D) * (F - 2)
62500 nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));
62501 // Y3 = F * (E - D)
62502 ny = f.redMul(e.redSub(d));
62503 // Z3 = F^2 - 2 * F
62504 nz = f.redSqr().redSub(f).redSub(f);
62505 } else {
62506 // H = Z1^2
62507 var h = this.z.redSqr();
62508 // J = F - 2 * H
62509 var j = f.redSub(h).redISub(h);
62510 // X3 = (B-C-D)*J
62511 nx = b.redSub(c).redISub(d).redMul(j);
62512 // Y3 = F * (E - D)
62513 ny = f.redMul(e.redSub(d));
62514 // Z3 = F * J
62515 nz = f.redMul(j);
62516 }
62517 } else {
62518 // E = C + D
62519 var e = c.redAdd(d);
62520 // H = (c * Z1)^2
62521 var h = this.curve._mulC(this.c.redMul(this.z)).redSqr();
62522 // J = E - 2 * H
62523 var j = e.redSub(h).redSub(h);
62524 // X3 = c * (B - E) * J
62525 nx = this.curve._mulC(b.redISub(e)).redMul(j);
62526 // Y3 = c * E * (C - D)
62527 ny = this.curve._mulC(e).redMul(c.redISub(d));
62528 // Z3 = E * J
62529 nz = e.redMul(j);
62530 }
62531 return this.curve.point(nx, ny, nz);
62532};
62533
62534Point.prototype.dbl = function dbl() {
62535 if (this.isInfinity())
62536 return this;
62537
62538 // Double in extended coordinates
62539 if (this.curve.extended)
62540 return this._extDbl();
62541 else
62542 return this._projDbl();
62543};
62544
62545Point.prototype._extAdd = function _extAdd(p) {
62546 // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
62547 // #addition-add-2008-hwcd-3
62548 // 8M
62549
62550 // A = (Y1 - X1) * (Y2 - X2)
62551 var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));
62552 // B = (Y1 + X1) * (Y2 + X2)
62553 var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));
62554 // C = T1 * k * T2
62555 var c = this.t.redMul(this.curve.dd).redMul(p.t);
62556 // D = Z1 * 2 * Z2
62557 var d = this.z.redMul(p.z.redAdd(p.z));
62558 // E = B - A
62559 var e = b.redSub(a);
62560 // F = D - C
62561 var f = d.redSub(c);
62562 // G = D + C
62563 var g = d.redAdd(c);
62564 // H = B + A
62565 var h = b.redAdd(a);
62566 // X3 = E * F
62567 var nx = e.redMul(f);
62568 // Y3 = G * H
62569 var ny = g.redMul(h);
62570 // T3 = E * H
62571 var nt = e.redMul(h);
62572 // Z3 = F * G
62573 var nz = f.redMul(g);
62574 return this.curve.point(nx, ny, nz, nt);
62575};
62576
62577Point.prototype._projAdd = function _projAdd(p) {
62578 // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
62579 // #addition-add-2008-bbjlp
62580 // #addition-add-2007-bl
62581 // 10M + 1S
62582
62583 // A = Z1 * Z2
62584 var a = this.z.redMul(p.z);
62585 // B = A^2
62586 var b = a.redSqr();
62587 // C = X1 * X2
62588 var c = this.x.redMul(p.x);
62589 // D = Y1 * Y2
62590 var d = this.y.redMul(p.y);
62591 // E = d * C * D
62592 var e = this.curve.d.redMul(c).redMul(d);
62593 // F = B - E
62594 var f = b.redSub(e);
62595 // G = B + E
62596 var g = b.redAdd(e);
62597 // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)
62598 var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);
62599 var nx = a.redMul(f).redMul(tmp);
62600 var ny;
62601 var nz;
62602 if (this.curve.twisted) {
62603 // Y3 = A * G * (D - a * C)
62604 ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));
62605 // Z3 = F * G
62606 nz = f.redMul(g);
62607 } else {
62608 // Y3 = A * G * (D - C)
62609 ny = a.redMul(g).redMul(d.redSub(c));
62610 // Z3 = c * F * G
62611 nz = this.curve._mulC(f).redMul(g);
62612 }
62613 return this.curve.point(nx, ny, nz);
62614};
62615
62616Point.prototype.add = function add(p) {
62617 if (this.isInfinity())
62618 return p;
62619 if (p.isInfinity())
62620 return this;
62621
62622 if (this.curve.extended)
62623 return this._extAdd(p);
62624 else
62625 return this._projAdd(p);
62626};
62627
62628Point.prototype.mul = function mul(k) {
62629 if (this._hasDoubles(k))
62630 return this.curve._fixedNafMul(this, k);
62631 else
62632 return this.curve._wnafMul(this, k);
62633};
62634
62635Point.prototype.mulAdd = function mulAdd(k1, p, k2) {
62636 return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);
62637};
62638
62639Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) {
62640 return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);
62641};
62642
62643Point.prototype.normalize = function normalize() {
62644 if (this.zOne)
62645 return this;
62646
62647 // Normalize coordinates
62648 var zi = this.z.redInvm();
62649 this.x = this.x.redMul(zi);
62650 this.y = this.y.redMul(zi);
62651 if (this.t)
62652 this.t = this.t.redMul(zi);
62653 this.z = this.curve.one;
62654 this.zOne = true;
62655 return this;
62656};
62657
62658Point.prototype.neg = function neg() {
62659 return this.curve.point(this.x.redNeg(),
62660 this.y,
62661 this.z,
62662 this.t && this.t.redNeg());
62663};
62664
62665Point.prototype.getX = function getX() {
62666 this.normalize();
62667 return this.x.fromRed();
62668};
62669
62670Point.prototype.getY = function getY() {
62671 this.normalize();
62672 return this.y.fromRed();
62673};
62674
62675Point.prototype.eq = function eq(other) {
62676 return this === other ||
62677 this.getX().cmp(other.getX()) === 0 &&
62678 this.getY().cmp(other.getY()) === 0;
62679};
62680
62681Point.prototype.eqXToP = function eqXToP(x) {
62682 var rx = x.toRed(this.curve.red).redMul(this.z);
62683 if (this.x.cmp(rx) === 0)
62684 return true;
62685
62686 var xc = x.clone();
62687 var t = this.curve.redN.redMul(this.z);
62688 for (;;) {
62689 xc.iadd(this.curve.n);
62690 if (xc.cmp(this.curve.p) >= 0)
62691 return false;
62692
62693 rx.redIAdd(t);
62694 if (this.x.cmp(rx) === 0)
62695 return true;
62696 }
62697 return false;
62698};
62699
62700// Compatibility with BaseCurve
62701Point.prototype.toP = Point.prototype.normalize;
62702Point.prototype.mixedAdd = Point.prototype.add;
62703
62704},{"../../elliptic":39,"../curve":42,"bn.js":33,"inherits":63}],42:[function(require,module,exports){
62705'use strict';
62706
62707var curve = exports;
62708
62709curve.base = require('./base');
62710curve.short = require('./short');
62711curve.mont = require('./mont');
62712curve.edwards = require('./edwards');
62713
62714},{"./base":40,"./edwards":41,"./mont":43,"./short":44}],43:[function(require,module,exports){
62715'use strict';
62716
62717var curve = require('../curve');
62718var BN = require('bn.js');
62719var inherits = require('inherits');
62720var Base = curve.base;
62721
62722var elliptic = require('../../elliptic');
62723var utils = elliptic.utils;
62724
62725function MontCurve(conf) {
62726 Base.call(this, 'mont', conf);
62727
62728 this.a = new BN(conf.a, 16).toRed(this.red);
62729 this.b = new BN(conf.b, 16).toRed(this.red);
62730 this.i4 = new BN(4).toRed(this.red).redInvm();
62731 this.two = new BN(2).toRed(this.red);
62732 this.a24 = this.i4.redMul(this.a.redAdd(this.two));
62733}
62734inherits(MontCurve, Base);
62735module.exports = MontCurve;
62736
62737MontCurve.prototype.validate = function validate(point) {
62738 var x = point.normalize().x;
62739 var x2 = x.redSqr();
62740 var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);
62741 var y = rhs.redSqrt();
62742
62743 return y.redSqr().cmp(rhs) === 0;
62744};
62745
62746function Point(curve, x, z) {
62747 Base.BasePoint.call(this, curve, 'projective');
62748 if (x === null && z === null) {
62749 this.x = this.curve.one;
62750 this.z = this.curve.zero;
62751 } else {
62752 this.x = new BN(x, 16);
62753 this.z = new BN(z, 16);
62754 if (!this.x.red)
62755 this.x = this.x.toRed(this.curve.red);
62756 if (!this.z.red)
62757 this.z = this.z.toRed(this.curve.red);
62758 }
62759}
62760inherits(Point, Base.BasePoint);
62761
62762MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
62763 return this.point(utils.toArray(bytes, enc), 1);
62764};
62765
62766MontCurve.prototype.point = function point(x, z) {
62767 return new Point(this, x, z);
62768};
62769
62770MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
62771 return Point.fromJSON(this, obj);
62772};
62773
62774Point.prototype.precompute = function precompute() {
62775 // No-op
62776};
62777
62778Point.prototype._encode = function _encode() {
62779 return this.getX().toArray('be', this.curve.p.byteLength());
62780};
62781
62782Point.fromJSON = function fromJSON(curve, obj) {
62783 return new Point(curve, obj[0], obj[1] || curve.one);
62784};
62785
62786Point.prototype.inspect = function inspect() {
62787 if (this.isInfinity())
62788 return '<EC Point Infinity>';
62789 return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
62790 ' z: ' + this.z.fromRed().toString(16, 2) + '>';
62791};
62792
62793Point.prototype.isInfinity = function isInfinity() {
62794 // XXX This code assumes that zero is always zero in red
62795 return this.z.cmpn(0) === 0;
62796};
62797
62798Point.prototype.dbl = function dbl() {
62799 // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3
62800 // 2M + 2S + 4A
62801
62802 // A = X1 + Z1
62803 var a = this.x.redAdd(this.z);
62804 // AA = A^2
62805 var aa = a.redSqr();
62806 // B = X1 - Z1
62807 var b = this.x.redSub(this.z);
62808 // BB = B^2
62809 var bb = b.redSqr();
62810 // C = AA - BB
62811 var c = aa.redSub(bb);
62812 // X3 = AA * BB
62813 var nx = aa.redMul(bb);
62814 // Z3 = C * (BB + A24 * C)
62815 var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));
62816 return this.curve.point(nx, nz);
62817};
62818
62819Point.prototype.add = function add() {
62820 throw new Error('Not supported on Montgomery curve');
62821};
62822
62823Point.prototype.diffAdd = function diffAdd(p, diff) {
62824 // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3
62825 // 4M + 2S + 6A
62826
62827 // A = X2 + Z2
62828 var a = this.x.redAdd(this.z);
62829 // B = X2 - Z2
62830 var b = this.x.redSub(this.z);
62831 // C = X3 + Z3
62832 var c = p.x.redAdd(p.z);
62833 // D = X3 - Z3
62834 var d = p.x.redSub(p.z);
62835 // DA = D * A
62836 var da = d.redMul(a);
62837 // CB = C * B
62838 var cb = c.redMul(b);
62839 // X5 = Z1 * (DA + CB)^2
62840 var nx = diff.z.redMul(da.redAdd(cb).redSqr());
62841 // Z5 = X1 * (DA - CB)^2
62842 var nz = diff.x.redMul(da.redISub(cb).redSqr());
62843 return this.curve.point(nx, nz);
62844};
62845
62846Point.prototype.mul = function mul(k) {
62847 var t = k.clone();
62848 var a = this; // (N / 2) * Q + Q
62849 var b = this.curve.point(null, null); // (N / 2) * Q
62850 var c = this; // Q
62851
62852 for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))
62853 bits.push(t.andln(1));
62854
62855 for (var i = bits.length - 1; i >= 0; i--) {
62856 if (bits[i] === 0) {
62857 // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q
62858 a = a.diffAdd(b, c);
62859 // N * Q = 2 * ((N / 2) * Q + Q))
62860 b = b.dbl();
62861 } else {
62862 // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)
62863 b = a.diffAdd(b, c);
62864 // N * Q + Q = 2 * ((N / 2) * Q + Q)
62865 a = a.dbl();
62866 }
62867 }
62868 return b;
62869};
62870
62871Point.prototype.mulAdd = function mulAdd() {
62872 throw new Error('Not supported on Montgomery curve');
62873};
62874
62875Point.prototype.jumlAdd = function jumlAdd() {
62876 throw new Error('Not supported on Montgomery curve');
62877};
62878
62879Point.prototype.eq = function eq(other) {
62880 return this.getX().cmp(other.getX()) === 0;
62881};
62882
62883Point.prototype.normalize = function normalize() {
62884 this.x = this.x.redMul(this.z.redInvm());
62885 this.z = this.curve.one;
62886 return this;
62887};
62888
62889Point.prototype.getX = function getX() {
62890 // Normalize coordinates
62891 this.normalize();
62892
62893 return this.x.fromRed();
62894};
62895
62896},{"../../elliptic":39,"../curve":42,"bn.js":33,"inherits":63}],44:[function(require,module,exports){
62897'use strict';
62898
62899var curve = require('../curve');
62900var elliptic = require('../../elliptic');
62901var BN = require('bn.js');
62902var inherits = require('inherits');
62903var Base = curve.base;
62904
62905var assert = elliptic.utils.assert;
62906
62907function ShortCurve(conf) {
62908 Base.call(this, 'short', conf);
62909
62910 this.a = new BN(conf.a, 16).toRed(this.red);
62911 this.b = new BN(conf.b, 16).toRed(this.red);
62912 this.tinv = this.two.redInvm();
62913
62914 this.zeroA = this.a.fromRed().cmpn(0) === 0;
62915 this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;
62916
62917 // If the curve is endomorphic, precalculate beta and lambda
62918 this.endo = this._getEndomorphism(conf);
62919 this._endoWnafT1 = new Array(4);
62920 this._endoWnafT2 = new Array(4);
62921}
62922inherits(ShortCurve, Base);
62923module.exports = ShortCurve;
62924
62925ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
62926 // No efficient endomorphism
62927 if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)
62928 return;
62929
62930 // Compute beta and lambda, that lambda * P = (beta * Px; Py)
62931 var beta;
62932 var lambda;
62933 if (conf.beta) {
62934 beta = new BN(conf.beta, 16).toRed(this.red);
62935 } else {
62936 var betas = this._getEndoRoots(this.p);
62937 // Choose the smallest beta
62938 beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];
62939 beta = beta.toRed(this.red);
62940 }
62941 if (conf.lambda) {
62942 lambda = new BN(conf.lambda, 16);
62943 } else {
62944 // Choose the lambda that is matching selected beta
62945 var lambdas = this._getEndoRoots(this.n);
62946 if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {
62947 lambda = lambdas[0];
62948 } else {
62949 lambda = lambdas[1];
62950 assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);
62951 }
62952 }
62953
62954 // Get basis vectors, used for balanced length-two representation
62955 var basis;
62956 if (conf.basis) {
62957 basis = conf.basis.map(function(vec) {
62958 return {
62959 a: new BN(vec.a, 16),
62960 b: new BN(vec.b, 16)
62961 };
62962 });
62963 } else {
62964 basis = this._getEndoBasis(lambda);
62965 }
62966
62967 return {
62968 beta: beta,
62969 lambda: lambda,
62970 basis: basis
62971 };
62972};
62973
62974ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {
62975 // Find roots of for x^2 + x + 1 in F
62976 // Root = (-1 +- Sqrt(-3)) / 2
62977 //
62978 var red = num === this.p ? this.red : BN.mont(num);
62979 var tinv = new BN(2).toRed(red).redInvm();
62980 var ntinv = tinv.redNeg();
62981
62982 var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);
62983
62984 var l1 = ntinv.redAdd(s).fromRed();
62985 var l2 = ntinv.redSub(s).fromRed();
62986 return [ l1, l2 ];
62987};
62988
62989ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {
62990 // aprxSqrt >= sqrt(this.n)
62991 var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));
62992
62993 // 3.74
62994 // Run EGCD, until r(L + 1) < aprxSqrt
62995 var u = lambda;
62996 var v = this.n.clone();
62997 var x1 = new BN(1);
62998 var y1 = new BN(0);
62999 var x2 = new BN(0);
63000 var y2 = new BN(1);
63001
63002 // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)
63003 var a0;
63004 var b0;
63005 // First vector
63006 var a1;
63007 var b1;
63008 // Second vector
63009 var a2;
63010 var b2;
63011
63012 var prevR;
63013 var i = 0;
63014 var r;
63015 var x;
63016 while (u.cmpn(0) !== 0) {
63017 var q = v.div(u);
63018 r = v.sub(q.mul(u));
63019 x = x2.sub(q.mul(x1));
63020 var y = y2.sub(q.mul(y1));
63021
63022 if (!a1 && r.cmp(aprxSqrt) < 0) {
63023 a0 = prevR.neg();
63024 b0 = x1;
63025 a1 = r.neg();
63026 b1 = x;
63027 } else if (a1 && ++i === 2) {
63028 break;
63029 }
63030 prevR = r;
63031
63032 v = u;
63033 u = r;
63034 x2 = x1;
63035 x1 = x;
63036 y2 = y1;
63037 y1 = y;
63038 }
63039 a2 = r.neg();
63040 b2 = x;
63041
63042 var len1 = a1.sqr().add(b1.sqr());
63043 var len2 = a2.sqr().add(b2.sqr());
63044 if (len2.cmp(len1) >= 0) {
63045 a2 = a0;
63046 b2 = b0;
63047 }
63048
63049 // Normalize signs
63050 if (a1.negative) {
63051 a1 = a1.neg();
63052 b1 = b1.neg();
63053 }
63054 if (a2.negative) {
63055 a2 = a2.neg();
63056 b2 = b2.neg();
63057 }
63058
63059 return [
63060 { a: a1, b: b1 },
63061 { a: a2, b: b2 }
63062 ];
63063};
63064
63065ShortCurve.prototype._endoSplit = function _endoSplit(k) {
63066 var basis = this.endo.basis;
63067 var v1 = basis[0];
63068 var v2 = basis[1];
63069
63070 var c1 = v2.b.mul(k).divRound(this.n);
63071 var c2 = v1.b.neg().mul(k).divRound(this.n);
63072
63073 var p1 = c1.mul(v1.a);
63074 var p2 = c2.mul(v2.a);
63075 var q1 = c1.mul(v1.b);
63076 var q2 = c2.mul(v2.b);
63077
63078 // Calculate answer
63079 var k1 = k.sub(p1).sub(p2);
63080 var k2 = q1.add(q2).neg();
63081 return { k1: k1, k2: k2 };
63082};
63083
63084ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {
63085 x = new BN(x, 16);
63086 if (!x.red)
63087 x = x.toRed(this.red);
63088
63089 var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);
63090 var y = y2.redSqrt();
63091 if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
63092 throw new Error('invalid point');
63093
63094 // XXX Is there any way to tell if the number is odd without converting it
63095 // to non-red form?
63096 var isOdd = y.fromRed().isOdd();
63097 if (odd && !isOdd || !odd && isOdd)
63098 y = y.redNeg();
63099
63100 return this.point(x, y);
63101};
63102
63103ShortCurve.prototype.validate = function validate(point) {
63104 if (point.inf)
63105 return true;
63106
63107 var x = point.x;
63108 var y = point.y;
63109
63110 var ax = this.a.redMul(x);
63111 var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);
63112 return y.redSqr().redISub(rhs).cmpn(0) === 0;
63113};
63114
63115ShortCurve.prototype._endoWnafMulAdd =
63116 function _endoWnafMulAdd(points, coeffs, jacobianResult) {
63117 var npoints = this._endoWnafT1;
63118 var ncoeffs = this._endoWnafT2;
63119 for (var i = 0; i < points.length; i++) {
63120 var split = this._endoSplit(coeffs[i]);
63121 var p = points[i];
63122 var beta = p._getBeta();
63123
63124 if (split.k1.negative) {
63125 split.k1.ineg();
63126 p = p.neg(true);
63127 }
63128 if (split.k2.negative) {
63129 split.k2.ineg();
63130 beta = beta.neg(true);
63131 }
63132
63133 npoints[i * 2] = p;
63134 npoints[i * 2 + 1] = beta;
63135 ncoeffs[i * 2] = split.k1;
63136 ncoeffs[i * 2 + 1] = split.k2;
63137 }
63138 var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);
63139
63140 // Clean-up references to points and coefficients
63141 for (var j = 0; j < i * 2; j++) {
63142 npoints[j] = null;
63143 ncoeffs[j] = null;
63144 }
63145 return res;
63146};
63147
63148function Point(curve, x, y, isRed) {
63149 Base.BasePoint.call(this, curve, 'affine');
63150 if (x === null && y === null) {
63151 this.x = null;
63152 this.y = null;
63153 this.inf = true;
63154 } else {
63155 this.x = new BN(x, 16);
63156 this.y = new BN(y, 16);
63157 // Force redgomery representation when loading from JSON
63158 if (isRed) {
63159 this.x.forceRed(this.curve.red);
63160 this.y.forceRed(this.curve.red);
63161 }
63162 if (!this.x.red)
63163 this.x = this.x.toRed(this.curve.red);
63164 if (!this.y.red)
63165 this.y = this.y.toRed(this.curve.red);
63166 this.inf = false;
63167 }
63168}
63169inherits(Point, Base.BasePoint);
63170
63171ShortCurve.prototype.point = function point(x, y, isRed) {
63172 return new Point(this, x, y, isRed);
63173};
63174
63175ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {
63176 return Point.fromJSON(this, obj, red);
63177};
63178
63179Point.prototype._getBeta = function _getBeta() {
63180 if (!this.curve.endo)
63181 return;
63182
63183 var pre = this.precomputed;
63184 if (pre && pre.beta)
63185 return pre.beta;
63186
63187 var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
63188 if (pre) {
63189 var curve = this.curve;
63190 var endoMul = function(p) {
63191 return curve.point(p.x.redMul(curve.endo.beta), p.y);
63192 };
63193 pre.beta = beta;
63194 beta.precomputed = {
63195 beta: null,
63196 naf: pre.naf && {
63197 wnd: pre.naf.wnd,
63198 points: pre.naf.points.map(endoMul)
63199 },
63200 doubles: pre.doubles && {
63201 step: pre.doubles.step,
63202 points: pre.doubles.points.map(endoMul)
63203 }
63204 };
63205 }
63206 return beta;
63207};
63208
63209Point.prototype.toJSON = function toJSON() {
63210 if (!this.precomputed)
63211 return [ this.x, this.y ];
63212
63213 return [ this.x, this.y, this.precomputed && {
63214 doubles: this.precomputed.doubles && {
63215 step: this.precomputed.doubles.step,
63216 points: this.precomputed.doubles.points.slice(1)
63217 },
63218 naf: this.precomputed.naf && {
63219 wnd: this.precomputed.naf.wnd,
63220 points: this.precomputed.naf.points.slice(1)
63221 }
63222 } ];
63223};
63224
63225Point.fromJSON = function fromJSON(curve, obj, red) {
63226 if (typeof obj === 'string')
63227 obj = JSON.parse(obj);
63228 var res = curve.point(obj[0], obj[1], red);
63229 if (!obj[2])
63230 return res;
63231
63232 function obj2point(obj) {
63233 return curve.point(obj[0], obj[1], red);
63234 }
63235
63236 var pre = obj[2];
63237 res.precomputed = {
63238 beta: null,
63239 doubles: pre.doubles && {
63240 step: pre.doubles.step,
63241 points: [ res ].concat(pre.doubles.points.map(obj2point))
63242 },
63243 naf: pre.naf && {
63244 wnd: pre.naf.wnd,
63245 points: [ res ].concat(pre.naf.points.map(obj2point))
63246 }
63247 };
63248 return res;
63249};
63250
63251Point.prototype.inspect = function inspect() {
63252 if (this.isInfinity())
63253 return '<EC Point Infinity>';
63254 return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
63255 ' y: ' + this.y.fromRed().toString(16, 2) + '>';
63256};
63257
63258Point.prototype.isInfinity = function isInfinity() {
63259 return this.inf;
63260};
63261
63262Point.prototype.add = function add(p) {
63263 // O + P = P
63264 if (this.inf)
63265 return p;
63266
63267 // P + O = P
63268 if (p.inf)
63269 return this;
63270
63271 // P + P = 2P
63272 if (this.eq(p))
63273 return this.dbl();
63274
63275 // P + (-P) = O
63276 if (this.neg().eq(p))
63277 return this.curve.point(null, null);
63278
63279 // P + Q = O
63280 if (this.x.cmp(p.x) === 0)
63281 return this.curve.point(null, null);
63282
63283 var c = this.y.redSub(p.y);
63284 if (c.cmpn(0) !== 0)
63285 c = c.redMul(this.x.redSub(p.x).redInvm());
63286 var nx = c.redSqr().redISub(this.x).redISub(p.x);
63287 var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
63288 return this.curve.point(nx, ny);
63289};
63290
63291Point.prototype.dbl = function dbl() {
63292 if (this.inf)
63293 return this;
63294
63295 // 2P = O
63296 var ys1 = this.y.redAdd(this.y);
63297 if (ys1.cmpn(0) === 0)
63298 return this.curve.point(null, null);
63299
63300 var a = this.curve.a;
63301
63302 var x2 = this.x.redSqr();
63303 var dyinv = ys1.redInvm();
63304 var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);
63305
63306 var nx = c.redSqr().redISub(this.x.redAdd(this.x));
63307 var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
63308 return this.curve.point(nx, ny);
63309};
63310
63311Point.prototype.getX = function getX() {
63312 return this.x.fromRed();
63313};
63314
63315Point.prototype.getY = function getY() {
63316 return this.y.fromRed();
63317};
63318
63319Point.prototype.mul = function mul(k) {
63320 k = new BN(k, 16);
63321
63322 if (this._hasDoubles(k))
63323 return this.curve._fixedNafMul(this, k);
63324 else if (this.curve.endo)
63325 return this.curve._endoWnafMulAdd([ this ], [ k ]);
63326 else
63327 return this.curve._wnafMul(this, k);
63328};
63329
63330Point.prototype.mulAdd = function mulAdd(k1, p2, k2) {
63331 var points = [ this, p2 ];
63332 var coeffs = [ k1, k2 ];
63333 if (this.curve.endo)
63334 return this.curve._endoWnafMulAdd(points, coeffs);
63335 else
63336 return this.curve._wnafMulAdd(1, points, coeffs, 2);
63337};
63338
63339Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {
63340 var points = [ this, p2 ];
63341 var coeffs = [ k1, k2 ];
63342 if (this.curve.endo)
63343 return this.curve._endoWnafMulAdd(points, coeffs, true);
63344 else
63345 return this.curve._wnafMulAdd(1, points, coeffs, 2, true);
63346};
63347
63348Point.prototype.eq = function eq(p) {
63349 return this === p ||
63350 this.inf === p.inf &&
63351 (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);
63352};
63353
63354Point.prototype.neg = function neg(_precompute) {
63355 if (this.inf)
63356 return this;
63357
63358 var res = this.curve.point(this.x, this.y.redNeg());
63359 if (_precompute && this.precomputed) {
63360 var pre = this.precomputed;
63361 var negate = function(p) {
63362 return p.neg();
63363 };
63364 res.precomputed = {
63365 naf: pre.naf && {
63366 wnd: pre.naf.wnd,
63367 points: pre.naf.points.map(negate)
63368 },
63369 doubles: pre.doubles && {
63370 step: pre.doubles.step,
63371 points: pre.doubles.points.map(negate)
63372 }
63373 };
63374 }
63375 return res;
63376};
63377
63378Point.prototype.toJ = function toJ() {
63379 if (this.inf)
63380 return this.curve.jpoint(null, null, null);
63381
63382 var res = this.curve.jpoint(this.x, this.y, this.curve.one);
63383 return res;
63384};
63385
63386function JPoint(curve, x, y, z) {
63387 Base.BasePoint.call(this, curve, 'jacobian');
63388 if (x === null && y === null && z === null) {
63389 this.x = this.curve.one;
63390 this.y = this.curve.one;
63391 this.z = new BN(0);
63392 } else {
63393 this.x = new BN(x, 16);
63394 this.y = new BN(y, 16);
63395 this.z = new BN(z, 16);
63396 }
63397 if (!this.x.red)
63398 this.x = this.x.toRed(this.curve.red);
63399 if (!this.y.red)
63400 this.y = this.y.toRed(this.curve.red);
63401 if (!this.z.red)
63402 this.z = this.z.toRed(this.curve.red);
63403
63404 this.zOne = this.z === this.curve.one;
63405}
63406inherits(JPoint, Base.BasePoint);
63407
63408ShortCurve.prototype.jpoint = function jpoint(x, y, z) {
63409 return new JPoint(this, x, y, z);
63410};
63411
63412JPoint.prototype.toP = function toP() {
63413 if (this.isInfinity())
63414 return this.curve.point(null, null);
63415
63416 var zinv = this.z.redInvm();
63417 var zinv2 = zinv.redSqr();
63418 var ax = this.x.redMul(zinv2);
63419 var ay = this.y.redMul(zinv2).redMul(zinv);
63420
63421 return this.curve.point(ax, ay);
63422};
63423
63424JPoint.prototype.neg = function neg() {
63425 return this.curve.jpoint(this.x, this.y.redNeg(), this.z);
63426};
63427
63428JPoint.prototype.add = function add(p) {
63429 // O + P = P
63430 if (this.isInfinity())
63431 return p;
63432
63433 // P + O = P
63434 if (p.isInfinity())
63435 return this;
63436
63437 // 12M + 4S + 7A
63438 var pz2 = p.z.redSqr();
63439 var z2 = this.z.redSqr();
63440 var u1 = this.x.redMul(pz2);
63441 var u2 = p.x.redMul(z2);
63442 var s1 = this.y.redMul(pz2.redMul(p.z));
63443 var s2 = p.y.redMul(z2.redMul(this.z));
63444
63445 var h = u1.redSub(u2);
63446 var r = s1.redSub(s2);
63447 if (h.cmpn(0) === 0) {
63448 if (r.cmpn(0) !== 0)
63449 return this.curve.jpoint(null, null, null);
63450 else
63451 return this.dbl();
63452 }
63453
63454 var h2 = h.redSqr();
63455 var h3 = h2.redMul(h);
63456 var v = u1.redMul(h2);
63457
63458 var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
63459 var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
63460 var nz = this.z.redMul(p.z).redMul(h);
63461
63462 return this.curve.jpoint(nx, ny, nz);
63463};
63464
63465JPoint.prototype.mixedAdd = function mixedAdd(p) {
63466 // O + P = P
63467 if (this.isInfinity())
63468 return p.toJ();
63469
63470 // P + O = P
63471 if (p.isInfinity())
63472 return this;
63473
63474 // 8M + 3S + 7A
63475 var z2 = this.z.redSqr();
63476 var u1 = this.x;
63477 var u2 = p.x.redMul(z2);
63478 var s1 = this.y;
63479 var s2 = p.y.redMul(z2).redMul(this.z);
63480
63481 var h = u1.redSub(u2);
63482 var r = s1.redSub(s2);
63483 if (h.cmpn(0) === 0) {
63484 if (r.cmpn(0) !== 0)
63485 return this.curve.jpoint(null, null, null);
63486 else
63487 return this.dbl();
63488 }
63489
63490 var h2 = h.redSqr();
63491 var h3 = h2.redMul(h);
63492 var v = u1.redMul(h2);
63493
63494 var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
63495 var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
63496 var nz = this.z.redMul(h);
63497
63498 return this.curve.jpoint(nx, ny, nz);
63499};
63500
63501JPoint.prototype.dblp = function dblp(pow) {
63502 if (pow === 0)
63503 return this;
63504 if (this.isInfinity())
63505 return this;
63506 if (!pow)
63507 return this.dbl();
63508
63509 if (this.curve.zeroA || this.curve.threeA) {
63510 var r = this;
63511 for (var i = 0; i < pow; i++)
63512 r = r.dbl();
63513 return r;
63514 }
63515
63516 // 1M + 2S + 1A + N * (4S + 5M + 8A)
63517 // N = 1 => 6M + 6S + 9A
63518 var a = this.curve.a;
63519 var tinv = this.curve.tinv;
63520
63521 var jx = this.x;
63522 var jy = this.y;
63523 var jz = this.z;
63524 var jz4 = jz.redSqr().redSqr();
63525
63526 // Reuse results
63527 var jyd = jy.redAdd(jy);
63528 for (var i = 0; i < pow; i++) {
63529 var jx2 = jx.redSqr();
63530 var jyd2 = jyd.redSqr();
63531 var jyd4 = jyd2.redSqr();
63532 var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
63533
63534 var t1 = jx.redMul(jyd2);
63535 var nx = c.redSqr().redISub(t1.redAdd(t1));
63536 var t2 = t1.redISub(nx);
63537 var dny = c.redMul(t2);
63538 dny = dny.redIAdd(dny).redISub(jyd4);
63539 var nz = jyd.redMul(jz);
63540 if (i + 1 < pow)
63541 jz4 = jz4.redMul(jyd4);
63542
63543 jx = nx;
63544 jz = nz;
63545 jyd = dny;
63546 }
63547
63548 return this.curve.jpoint(jx, jyd.redMul(tinv), jz);
63549};
63550
63551JPoint.prototype.dbl = function dbl() {
63552 if (this.isInfinity())
63553 return this;
63554
63555 if (this.curve.zeroA)
63556 return this._zeroDbl();
63557 else if (this.curve.threeA)
63558 return this._threeDbl();
63559 else
63560 return this._dbl();
63561};
63562
63563JPoint.prototype._zeroDbl = function _zeroDbl() {
63564 var nx;
63565 var ny;
63566 var nz;
63567 // Z = 1
63568 if (this.zOne) {
63569 // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
63570 // #doubling-mdbl-2007-bl
63571 // 1M + 5S + 14A
63572
63573 // XX = X1^2
63574 var xx = this.x.redSqr();
63575 // YY = Y1^2
63576 var yy = this.y.redSqr();
63577 // YYYY = YY^2
63578 var yyyy = yy.redSqr();
63579 // S = 2 * ((X1 + YY)^2 - XX - YYYY)
63580 var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
63581 s = s.redIAdd(s);
63582 // M = 3 * XX + a; a = 0
63583 var m = xx.redAdd(xx).redIAdd(xx);
63584 // T = M ^ 2 - 2*S
63585 var t = m.redSqr().redISub(s).redISub(s);
63586
63587 // 8 * YYYY
63588 var yyyy8 = yyyy.redIAdd(yyyy);
63589 yyyy8 = yyyy8.redIAdd(yyyy8);
63590 yyyy8 = yyyy8.redIAdd(yyyy8);
63591
63592 // X3 = T
63593 nx = t;
63594 // Y3 = M * (S - T) - 8 * YYYY
63595 ny = m.redMul(s.redISub(t)).redISub(yyyy8);
63596 // Z3 = 2*Y1
63597 nz = this.y.redAdd(this.y);
63598 } else {
63599 // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
63600 // #doubling-dbl-2009-l
63601 // 2M + 5S + 13A
63602
63603 // A = X1^2
63604 var a = this.x.redSqr();
63605 // B = Y1^2
63606 var b = this.y.redSqr();
63607 // C = B^2
63608 var c = b.redSqr();
63609 // D = 2 * ((X1 + B)^2 - A - C)
63610 var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);
63611 d = d.redIAdd(d);
63612 // E = 3 * A
63613 var e = a.redAdd(a).redIAdd(a);
63614 // F = E^2
63615 var f = e.redSqr();
63616
63617 // 8 * C
63618 var c8 = c.redIAdd(c);
63619 c8 = c8.redIAdd(c8);
63620 c8 = c8.redIAdd(c8);
63621
63622 // X3 = F - 2 * D
63623 nx = f.redISub(d).redISub(d);
63624 // Y3 = E * (D - X3) - 8 * C
63625 ny = e.redMul(d.redISub(nx)).redISub(c8);
63626 // Z3 = 2 * Y1 * Z1
63627 nz = this.y.redMul(this.z);
63628 nz = nz.redIAdd(nz);
63629 }
63630
63631 return this.curve.jpoint(nx, ny, nz);
63632};
63633
63634JPoint.prototype._threeDbl = function _threeDbl() {
63635 var nx;
63636 var ny;
63637 var nz;
63638 // Z = 1
63639 if (this.zOne) {
63640 // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html
63641 // #doubling-mdbl-2007-bl
63642 // 1M + 5S + 15A
63643
63644 // XX = X1^2
63645 var xx = this.x.redSqr();
63646 // YY = Y1^2
63647 var yy = this.y.redSqr();
63648 // YYYY = YY^2
63649 var yyyy = yy.redSqr();
63650 // S = 2 * ((X1 + YY)^2 - XX - YYYY)
63651 var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
63652 s = s.redIAdd(s);
63653 // M = 3 * XX + a
63654 var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);
63655 // T = M^2 - 2 * S
63656 var t = m.redSqr().redISub(s).redISub(s);
63657 // X3 = T
63658 nx = t;
63659 // Y3 = M * (S - T) - 8 * YYYY
63660 var yyyy8 = yyyy.redIAdd(yyyy);
63661 yyyy8 = yyyy8.redIAdd(yyyy8);
63662 yyyy8 = yyyy8.redIAdd(yyyy8);
63663 ny = m.redMul(s.redISub(t)).redISub(yyyy8);
63664 // Z3 = 2 * Y1
63665 nz = this.y.redAdd(this.y);
63666 } else {
63667 // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b
63668 // 3M + 5S
63669
63670 // delta = Z1^2
63671 var delta = this.z.redSqr();
63672 // gamma = Y1^2
63673 var gamma = this.y.redSqr();
63674 // beta = X1 * gamma
63675 var beta = this.x.redMul(gamma);
63676 // alpha = 3 * (X1 - delta) * (X1 + delta)
63677 var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));
63678 alpha = alpha.redAdd(alpha).redIAdd(alpha);
63679 // X3 = alpha^2 - 8 * beta
63680 var beta4 = beta.redIAdd(beta);
63681 beta4 = beta4.redIAdd(beta4);
63682 var beta8 = beta4.redAdd(beta4);
63683 nx = alpha.redSqr().redISub(beta8);
63684 // Z3 = (Y1 + Z1)^2 - gamma - delta
63685 nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);
63686 // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2
63687 var ggamma8 = gamma.redSqr();
63688 ggamma8 = ggamma8.redIAdd(ggamma8);
63689 ggamma8 = ggamma8.redIAdd(ggamma8);
63690 ggamma8 = ggamma8.redIAdd(ggamma8);
63691 ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);
63692 }
63693
63694 return this.curve.jpoint(nx, ny, nz);
63695};
63696
63697JPoint.prototype._dbl = function _dbl() {
63698 var a = this.curve.a;
63699
63700 // 4M + 6S + 10A
63701 var jx = this.x;
63702 var jy = this.y;
63703 var jz = this.z;
63704 var jz4 = jz.redSqr().redSqr();
63705
63706 var jx2 = jx.redSqr();
63707 var jy2 = jy.redSqr();
63708
63709 var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
63710
63711 var jxd4 = jx.redAdd(jx);
63712 jxd4 = jxd4.redIAdd(jxd4);
63713 var t1 = jxd4.redMul(jy2);
63714 var nx = c.redSqr().redISub(t1.redAdd(t1));
63715 var t2 = t1.redISub(nx);
63716
63717 var jyd8 = jy2.redSqr();
63718 jyd8 = jyd8.redIAdd(jyd8);
63719 jyd8 = jyd8.redIAdd(jyd8);
63720 jyd8 = jyd8.redIAdd(jyd8);
63721 var ny = c.redMul(t2).redISub(jyd8);
63722 var nz = jy.redAdd(jy).redMul(jz);
63723
63724 return this.curve.jpoint(nx, ny, nz);
63725};
63726
63727JPoint.prototype.trpl = function trpl() {
63728 if (!this.curve.zeroA)
63729 return this.dbl().add(this);
63730
63731 // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl
63732 // 5M + 10S + ...
63733
63734 // XX = X1^2
63735 var xx = this.x.redSqr();
63736 // YY = Y1^2
63737 var yy = this.y.redSqr();
63738 // ZZ = Z1^2
63739 var zz = this.z.redSqr();
63740 // YYYY = YY^2
63741 var yyyy = yy.redSqr();
63742 // M = 3 * XX + a * ZZ2; a = 0
63743 var m = xx.redAdd(xx).redIAdd(xx);
63744 // MM = M^2
63745 var mm = m.redSqr();
63746 // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM
63747 var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
63748 e = e.redIAdd(e);
63749 e = e.redAdd(e).redIAdd(e);
63750 e = e.redISub(mm);
63751 // EE = E^2
63752 var ee = e.redSqr();
63753 // T = 16*YYYY
63754 var t = yyyy.redIAdd(yyyy);
63755 t = t.redIAdd(t);
63756 t = t.redIAdd(t);
63757 t = t.redIAdd(t);
63758 // U = (M + E)^2 - MM - EE - T
63759 var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);
63760 // X3 = 4 * (X1 * EE - 4 * YY * U)
63761 var yyu4 = yy.redMul(u);
63762 yyu4 = yyu4.redIAdd(yyu4);
63763 yyu4 = yyu4.redIAdd(yyu4);
63764 var nx = this.x.redMul(ee).redISub(yyu4);
63765 nx = nx.redIAdd(nx);
63766 nx = nx.redIAdd(nx);
63767 // Y3 = 8 * Y1 * (U * (T - U) - E * EE)
63768 var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));
63769 ny = ny.redIAdd(ny);
63770 ny = ny.redIAdd(ny);
63771 ny = ny.redIAdd(ny);
63772 // Z3 = (Z1 + E)^2 - ZZ - EE
63773 var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);
63774
63775 return this.curve.jpoint(nx, ny, nz);
63776};
63777
63778JPoint.prototype.mul = function mul(k, kbase) {
63779 k = new BN(k, kbase);
63780
63781 return this.curve._wnafMul(this, k);
63782};
63783
63784JPoint.prototype.eq = function eq(p) {
63785 if (p.type === 'affine')
63786 return this.eq(p.toJ());
63787
63788 if (this === p)
63789 return true;
63790
63791 // x1 * z2^2 == x2 * z1^2
63792 var z2 = this.z.redSqr();
63793 var pz2 = p.z.redSqr();
63794 if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)
63795 return false;
63796
63797 // y1 * z2^3 == y2 * z1^3
63798 var z3 = z2.redMul(this.z);
63799 var pz3 = pz2.redMul(p.z);
63800 return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;
63801};
63802
63803JPoint.prototype.eqXToP = function eqXToP(x) {
63804 var zs = this.z.redSqr();
63805 var rx = x.toRed(this.curve.red).redMul(zs);
63806 if (this.x.cmp(rx) === 0)
63807 return true;
63808
63809 var xc = x.clone();
63810 var t = this.curve.redN.redMul(zs);
63811 for (;;) {
63812 xc.iadd(this.curve.n);
63813 if (xc.cmp(this.curve.p) >= 0)
63814 return false;
63815
63816 rx.redIAdd(t);
63817 if (this.x.cmp(rx) === 0)
63818 return true;
63819 }
63820 return false;
63821};
63822
63823JPoint.prototype.inspect = function inspect() {
63824 if (this.isInfinity())
63825 return '<EC JPoint Infinity>';
63826 return '<EC JPoint x: ' + this.x.toString(16, 2) +
63827 ' y: ' + this.y.toString(16, 2) +
63828 ' z: ' + this.z.toString(16, 2) + '>';
63829};
63830
63831JPoint.prototype.isInfinity = function isInfinity() {
63832 // XXX This code assumes that zero is always zero in red
63833 return this.z.cmpn(0) === 0;
63834};
63835
63836},{"../../elliptic":39,"../curve":42,"bn.js":33,"inherits":63}],45:[function(require,module,exports){
63837'use strict';
63838
63839var curves = exports;
63840
63841var hash = require('hash.js');
63842var elliptic = require('../elliptic');
63843
63844var assert = elliptic.utils.assert;
63845
63846function PresetCurve(options) {
63847 if (options.type === 'short')
63848 this.curve = new elliptic.curve.short(options);
63849 else if (options.type === 'edwards')
63850 this.curve = new elliptic.curve.edwards(options);
63851 else
63852 this.curve = new elliptic.curve.mont(options);
63853 this.g = this.curve.g;
63854 this.n = this.curve.n;
63855 this.hash = options.hash;
63856
63857 assert(this.g.validate(), 'Invalid curve');
63858 assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');
63859}
63860curves.PresetCurve = PresetCurve;
63861
63862function defineCurve(name, options) {
63863 Object.defineProperty(curves, name, {
63864 configurable: true,
63865 enumerable: true,
63866 get: function() {
63867 var curve = new PresetCurve(options);
63868 Object.defineProperty(curves, name, {
63869 configurable: true,
63870 enumerable: true,
63871 value: curve
63872 });
63873 return curve;
63874 }
63875 });
63876}
63877
63878defineCurve('p192', {
63879 type: 'short',
63880 prime: 'p192',
63881 p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',
63882 a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',
63883 b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',
63884 n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',
63885 hash: hash.sha256,
63886 gRed: false,
63887 g: [
63888 '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',
63889 '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811'
63890 ]
63891});
63892
63893defineCurve('p224', {
63894 type: 'short',
63895 prime: 'p224',
63896 p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',
63897 a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',
63898 b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',
63899 n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',
63900 hash: hash.sha256,
63901 gRed: false,
63902 g: [
63903 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',
63904 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34'
63905 ]
63906});
63907
63908defineCurve('p256', {
63909 type: 'short',
63910 prime: null,
63911 p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',
63912 a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',
63913 b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',
63914 n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',
63915 hash: hash.sha256,
63916 gRed: false,
63917 g: [
63918 '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',
63919 '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5'
63920 ]
63921});
63922
63923defineCurve('p384', {
63924 type: 'short',
63925 prime: null,
63926 p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
63927 'fffffffe ffffffff 00000000 00000000 ffffffff',
63928 a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
63929 'fffffffe ffffffff 00000000 00000000 fffffffc',
63930 b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +
63931 '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',
63932 n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +
63933 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',
63934 hash: hash.sha384,
63935 gRed: false,
63936 g: [
63937 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +
63938 '5502f25d bf55296c 3a545e38 72760ab7',
63939 '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +
63940 '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'
63941 ]
63942});
63943
63944defineCurve('p521', {
63945 type: 'short',
63946 prime: null,
63947 p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
63948 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
63949 'ffffffff ffffffff ffffffff ffffffff ffffffff',
63950 a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
63951 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
63952 'ffffffff ffffffff ffffffff ffffffff fffffffc',
63953 b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +
63954 '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +
63955 '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',
63956 n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
63957 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +
63958 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',
63959 hash: hash.sha512,
63960 gRed: false,
63961 g: [
63962 '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +
63963 '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +
63964 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',
63965 '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +
63966 '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +
63967 '3fad0761 353c7086 a272c240 88be9476 9fd16650'
63968 ]
63969});
63970
63971defineCurve('curve25519', {
63972 type: 'mont',
63973 prime: 'p25519',
63974 p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
63975 a: '76d06',
63976 b: '1',
63977 n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
63978 hash: hash.sha256,
63979 gRed: false,
63980 g: [
63981 '9'
63982 ]
63983});
63984
63985defineCurve('ed25519', {
63986 type: 'edwards',
63987 prime: 'p25519',
63988 p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
63989 a: '-1',
63990 c: '1',
63991 // -121665 * (121666^(-1)) (mod P)
63992 d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',
63993 n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
63994 hash: hash.sha256,
63995 gRed: false,
63996 g: [
63997 '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',
63998
63999 // 4/5
64000 '6666666666666666666666666666666666666666666666666666666666666658'
64001 ]
64002});
64003
64004var pre;
64005try {
64006 pre = require('./precomputed/secp256k1');
64007} catch (e) {
64008 pre = undefined;
64009}
64010
64011defineCurve('secp256k1', {
64012 type: 'short',
64013 prime: 'k256',
64014 p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',
64015 a: '0',
64016 b: '7',
64017 n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',
64018 h: '1',
64019 hash: hash.sha256,
64020
64021 // Precomputed endomorphism
64022 beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',
64023 lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',
64024 basis: [
64025 {
64026 a: '3086d221a7d46bcde86c90e49284eb15',
64027 b: '-e4437ed6010e88286f547fa90abfe4c3'
64028 },
64029 {
64030 a: '114ca50f7a8e2f3f657c1108d9d44cfd8',
64031 b: '3086d221a7d46bcde86c90e49284eb15'
64032 }
64033 ],
64034
64035 gRed: false,
64036 g: [
64037 '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
64038 '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',
64039 pre
64040 ]
64041});
64042
64043},{"../elliptic":39,"./precomputed/secp256k1":53,"hash.js":57}],46:[function(require,module,exports){
64044'use strict';
64045
64046var BN = require('bn.js');
64047var elliptic = require('../../elliptic');
64048var utils = elliptic.utils;
64049var assert = utils.assert;
64050
64051var KeyPair = require('./key');
64052var Signature = require('./signature');
64053
64054function EC(options) {
64055 if (!(this instanceof EC))
64056 return new EC(options);
64057
64058 // Shortcut `elliptic.ec(curve-name)`
64059 if (typeof options === 'string') {
64060 assert(elliptic.curves.hasOwnProperty(options), 'Unknown curve ' + options);
64061
64062 options = elliptic.curves[options];
64063 }
64064
64065 // Shortcut for `elliptic.ec(elliptic.curves.curveName)`
64066 if (options instanceof elliptic.curves.PresetCurve)
64067 options = { curve: options };
64068
64069 this.curve = options.curve.curve;
64070 this.n = this.curve.n;
64071 this.nh = this.n.ushrn(1);
64072 this.g = this.curve.g;
64073
64074 // Point on curve
64075 this.g = options.curve.g;
64076 this.g.precompute(options.curve.n.bitLength() + 1);
64077
64078 // Hash for function for DRBG
64079 this.hash = options.hash || options.curve.hash;
64080}
64081module.exports = EC;
64082
64083EC.prototype.keyPair = function keyPair(options) {
64084 return new KeyPair(this, options);
64085};
64086
64087EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {
64088 return KeyPair.fromPrivate(this, priv, enc);
64089};
64090
64091EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {
64092 return KeyPair.fromPublic(this, pub, enc);
64093};
64094
64095EC.prototype.genKeyPair = function genKeyPair(options) {
64096 if (!options)
64097 options = {};
64098
64099 // Instantiate Hmac_DRBG
64100 var drbg = new elliptic.hmacDRBG({
64101 hash: this.hash,
64102 pers: options.pers,
64103 entropy: options.entropy || elliptic.rand(this.hash.hmacStrength),
64104 nonce: this.n.toArray()
64105 });
64106
64107 var bytes = this.n.byteLength();
64108 var ns2 = this.n.sub(new BN(2));
64109 do {
64110 var priv = new BN(drbg.generate(bytes));
64111 if (priv.cmp(ns2) > 0)
64112 continue;
64113
64114 priv.iaddn(1);
64115 return this.keyFromPrivate(priv);
64116 } while (true);
64117};
64118
64119EC.prototype._truncateToN = function truncateToN(msg, truncOnly) {
64120 var delta = msg.byteLength() * 8 - this.n.bitLength();
64121 if (delta > 0)
64122 msg = msg.ushrn(delta);
64123 if (!truncOnly && msg.cmp(this.n) >= 0)
64124 return msg.sub(this.n);
64125 else
64126 return msg;
64127};
64128
64129EC.prototype.sign = function sign(msg, key, enc, options) {
64130 if (typeof enc === 'object') {
64131 options = enc;
64132 enc = null;
64133 }
64134 if (!options)
64135 options = {};
64136
64137 key = this.keyFromPrivate(key, enc);
64138 msg = this._truncateToN(new BN(msg, 16));
64139
64140 // Zero-extend key to provide enough entropy
64141 var bytes = this.n.byteLength();
64142 var bkey = key.getPrivate().toArray('be', bytes);
64143
64144 // Zero-extend nonce to have the same byte size as N
64145 var nonce = msg.toArray('be', bytes);
64146
64147 // Instantiate Hmac_DRBG
64148 var drbg = new elliptic.hmacDRBG({
64149 hash: this.hash,
64150 entropy: bkey,
64151 nonce: nonce,
64152 pers: options.pers,
64153 persEnc: options.persEnc
64154 });
64155
64156 // Number of bytes to generate
64157 var ns1 = this.n.sub(new BN(1));
64158
64159 for (var iter = 0; true; iter++) {
64160 var k = options.k ?
64161 options.k(iter) :
64162 new BN(drbg.generate(this.n.byteLength()));
64163 k = this._truncateToN(k, true);
64164 if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)
64165 continue;
64166
64167 var kp = this.g.mul(k);
64168 if (kp.isInfinity())
64169 continue;
64170
64171 var kpX = kp.getX();
64172 var r = kpX.umod(this.n);
64173 if (r.cmpn(0) === 0)
64174 continue;
64175
64176 var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));
64177 s = s.umod(this.n);
64178 if (s.cmpn(0) === 0)
64179 continue;
64180
64181 var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |
64182 (kpX.cmp(r) !== 0 ? 2 : 0);
64183
64184 // Use complement of `s`, if it is > `n / 2`
64185 if (options.canonical && s.cmp(this.nh) > 0) {
64186 s = this.n.sub(s);
64187 recoveryParam ^= 1;
64188 }
64189
64190 return new Signature({ r: r, s: s, recoveryParam: recoveryParam });
64191 }
64192};
64193
64194EC.prototype.verify = function verify(msg, signature, key, enc) {
64195 msg = this._truncateToN(new BN(msg, 16));
64196 key = this.keyFromPublic(key, enc);
64197 signature = new Signature(signature, 'hex');
64198
64199 // Perform primitive values validation
64200 var r = signature.r;
64201 var s = signature.s;
64202 if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)
64203 return false;
64204 if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)
64205 return false;
64206
64207 // Validate signature
64208 var sinv = s.invm(this.n);
64209 var u1 = sinv.mul(msg).umod(this.n);
64210 var u2 = sinv.mul(r).umod(this.n);
64211
64212 if (!this.curve._maxwellTrick) {
64213 var p = this.g.mulAdd(u1, key.getPublic(), u2);
64214 if (p.isInfinity())
64215 return false;
64216
64217 return p.getX().umod(this.n).cmp(r) === 0;
64218 }
64219
64220 // NOTE: Greg Maxwell's trick, inspired by:
64221 // https://git.io/vad3K
64222
64223 var p = this.g.jmulAdd(u1, key.getPublic(), u2);
64224 if (p.isInfinity())
64225 return false;
64226
64227 // Compare `p.x` of Jacobian point with `r`,
64228 // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the
64229 // inverse of `p.z^2`
64230 return p.eqXToP(r);
64231};
64232
64233EC.prototype.recoverPubKey = function(msg, signature, j, enc) {
64234 assert((3 & j) === j, 'The recovery param is more than two bits');
64235 signature = new Signature(signature, enc);
64236
64237 var n = this.n;
64238 var e = new BN(msg);
64239 var r = signature.r;
64240 var s = signature.s;
64241
64242 // A set LSB signifies that the y-coordinate is odd
64243 var isYOdd = j & 1;
64244 var isSecondKey = j >> 1;
64245 if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)
64246 throw new Error('Unable to find sencond key candinate');
64247
64248 // 1.1. Let x = r + jn.
64249 if (isSecondKey)
64250 r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);
64251 else
64252 r = this.curve.pointFromX(r, isYOdd);
64253
64254 var rInv = signature.r.invm(n);
64255 var s1 = n.sub(e).mul(rInv).umod(n);
64256 var s2 = s.mul(rInv).umod(n);
64257
64258 // 1.6.1 Compute Q = r^-1 (sR - eG)
64259 // Q = r^-1 (sR + -eG)
64260 return this.g.mulAdd(s1, r, s2);
64261};
64262
64263EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
64264 signature = new Signature(signature, enc);
64265 if (signature.recoveryParam !== null)
64266 return signature.recoveryParam;
64267
64268 for (var i = 0; i < 4; i++) {
64269 var Qprime;
64270 try {
64271 Qprime = this.recoverPubKey(e, signature, i);
64272 } catch (e) {
64273 continue;
64274 }
64275
64276 if (Qprime.eq(Q))
64277 return i;
64278 }
64279 throw new Error('Unable to find valid recovery factor');
64280};
64281
64282},{"../../elliptic":39,"./key":47,"./signature":48,"bn.js":33}],47:[function(require,module,exports){
64283'use strict';
64284
64285var BN = require('bn.js');
64286var elliptic = require('../../elliptic');
64287var utils = elliptic.utils;
64288var assert = utils.assert;
64289
64290function KeyPair(ec, options) {
64291 this.ec = ec;
64292 this.priv = null;
64293 this.pub = null;
64294
64295 // KeyPair(ec, { priv: ..., pub: ... })
64296 if (options.priv)
64297 this._importPrivate(options.priv, options.privEnc);
64298 if (options.pub)
64299 this._importPublic(options.pub, options.pubEnc);
64300}
64301module.exports = KeyPair;
64302
64303KeyPair.fromPublic = function fromPublic(ec, pub, enc) {
64304 if (pub instanceof KeyPair)
64305 return pub;
64306
64307 return new KeyPair(ec, {
64308 pub: pub,
64309 pubEnc: enc
64310 });
64311};
64312
64313KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {
64314 if (priv instanceof KeyPair)
64315 return priv;
64316
64317 return new KeyPair(ec, {
64318 priv: priv,
64319 privEnc: enc
64320 });
64321};
64322
64323KeyPair.prototype.validate = function validate() {
64324 var pub = this.getPublic();
64325
64326 if (pub.isInfinity())
64327 return { result: false, reason: 'Invalid public key' };
64328 if (!pub.validate())
64329 return { result: false, reason: 'Public key is not a point' };
64330 if (!pub.mul(this.ec.curve.n).isInfinity())
64331 return { result: false, reason: 'Public key * N != O' };
64332
64333 return { result: true, reason: null };
64334};
64335
64336KeyPair.prototype.getPublic = function getPublic(compact, enc) {
64337 // compact is optional argument
64338 if (typeof compact === 'string') {
64339 enc = compact;
64340 compact = null;
64341 }
64342
64343 if (!this.pub)
64344 this.pub = this.ec.g.mul(this.priv);
64345
64346 if (!enc)
64347 return this.pub;
64348
64349 return this.pub.encode(enc, compact);
64350};
64351
64352KeyPair.prototype.getPrivate = function getPrivate(enc) {
64353 if (enc === 'hex')
64354 return this.priv.toString(16, 2);
64355 else
64356 return this.priv;
64357};
64358
64359KeyPair.prototype._importPrivate = function _importPrivate(key, enc) {
64360 this.priv = new BN(key, enc || 16);
64361
64362 // Ensure that the priv won't be bigger than n, otherwise we may fail
64363 // in fixed multiplication method
64364 this.priv = this.priv.umod(this.ec.curve.n);
64365};
64366
64367KeyPair.prototype._importPublic = function _importPublic(key, enc) {
64368 if (key.x || key.y) {
64369 // Montgomery points only have an `x` coordinate.
64370 // Weierstrass/Edwards points on the other hand have both `x` and
64371 // `y` coordinates.
64372 if (this.ec.curve.type === 'mont') {
64373 assert(key.x, 'Need x coordinate');
64374 } else if (this.ec.curve.type === 'short' ||
64375 this.ec.curve.type === 'edwards') {
64376 assert(key.x && key.y, 'Need both x and y coordinate');
64377 }
64378 this.pub = this.ec.curve.point(key.x, key.y);
64379 return;
64380 }
64381 this.pub = this.ec.curve.decodePoint(key, enc);
64382};
64383
64384// ECDH
64385KeyPair.prototype.derive = function derive(pub) {
64386 return pub.mul(this.priv).getX();
64387};
64388
64389// ECDSA
64390KeyPair.prototype.sign = function sign(msg, enc, options) {
64391 return this.ec.sign(msg, this, enc, options);
64392};
64393
64394KeyPair.prototype.verify = function verify(msg, signature) {
64395 return this.ec.verify(msg, signature, this);
64396};
64397
64398KeyPair.prototype.inspect = function inspect() {
64399 return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +
64400 ' pub: ' + (this.pub && this.pub.inspect()) + ' >';
64401};
64402
64403},{"../../elliptic":39,"bn.js":33}],48:[function(require,module,exports){
64404'use strict';
64405
64406var BN = require('bn.js');
64407
64408var elliptic = require('../../elliptic');
64409var utils = elliptic.utils;
64410var assert = utils.assert;
64411
64412function Signature(options, enc) {
64413 if (options instanceof Signature)
64414 return options;
64415
64416 if (this._importDER(options, enc))
64417 return;
64418
64419 assert(options.r && options.s, 'Signature without r or s');
64420 this.r = new BN(options.r, 16);
64421 this.s = new BN(options.s, 16);
64422 if (options.recoveryParam === undefined)
64423 this.recoveryParam = null;
64424 else
64425 this.recoveryParam = options.recoveryParam;
64426}
64427module.exports = Signature;
64428
64429function Position() {
64430 this.place = 0;
64431}
64432
64433function getLength(buf, p) {
64434 var initial = buf[p.place++];
64435 if (!(initial & 0x80)) {
64436 return initial;
64437 }
64438 var octetLen = initial & 0xf;
64439 var val = 0;
64440 for (var i = 0, off = p.place; i < octetLen; i++, off++) {
64441 val <<= 8;
64442 val |= buf[off];
64443 }
64444 p.place = off;
64445 return val;
64446}
64447
64448function rmPadding(buf) {
64449 var i = 0;
64450 var len = buf.length - 1;
64451 while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {
64452 i++;
64453 }
64454 if (i === 0) {
64455 return buf;
64456 }
64457 return buf.slice(i);
64458}
64459
64460Signature.prototype._importDER = function _importDER(data, enc) {
64461 data = utils.toArray(data, enc);
64462 var p = new Position();
64463 if (data[p.place++] !== 0x30) {
64464 return false;
64465 }
64466 var len = getLength(data, p);
64467 if ((len + p.place) !== data.length) {
64468 return false;
64469 }
64470 if (data[p.place++] !== 0x02) {
64471 return false;
64472 }
64473 var rlen = getLength(data, p);
64474 var r = data.slice(p.place, rlen + p.place);
64475 p.place += rlen;
64476 if (data[p.place++] !== 0x02) {
64477 return false;
64478 }
64479 var slen = getLength(data, p);
64480 if (data.length !== slen + p.place) {
64481 return false;
64482 }
64483 var s = data.slice(p.place, slen + p.place);
64484 if (r[0] === 0 && (r[1] & 0x80)) {
64485 r = r.slice(1);
64486 }
64487 if (s[0] === 0 && (s[1] & 0x80)) {
64488 s = s.slice(1);
64489 }
64490
64491 this.r = new BN(r);
64492 this.s = new BN(s);
64493 this.recoveryParam = null;
64494
64495 return true;
64496};
64497
64498function constructLength(arr, len) {
64499 if (len < 0x80) {
64500 arr.push(len);
64501 return;
64502 }
64503 var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);
64504 arr.push(octets | 0x80);
64505 while (--octets) {
64506 arr.push((len >>> (octets << 3)) & 0xff);
64507 }
64508 arr.push(len);
64509}
64510
64511Signature.prototype.toDER = function toDER(enc) {
64512 var r = this.r.toArray();
64513 var s = this.s.toArray();
64514
64515 // Pad values
64516 if (r[0] & 0x80)
64517 r = [ 0 ].concat(r);
64518 // Pad values
64519 if (s[0] & 0x80)
64520 s = [ 0 ].concat(s);
64521
64522 r = rmPadding(r);
64523 s = rmPadding(s);
64524
64525 while (!s[0] && !(s[1] & 0x80)) {
64526 s = s.slice(1);
64527 }
64528 var arr = [ 0x02 ];
64529 constructLength(arr, r.length);
64530 arr = arr.concat(r);
64531 arr.push(0x02);
64532 constructLength(arr, s.length);
64533 var backHalf = arr.concat(s);
64534 var res = [ 0x30 ];
64535 constructLength(res, backHalf.length);
64536 res = res.concat(backHalf);
64537 return utils.encode(res, enc);
64538};
64539
64540},{"../../elliptic":39,"bn.js":33}],49:[function(require,module,exports){
64541'use strict';
64542
64543var hash = require('hash.js');
64544var elliptic = require('../../elliptic');
64545var utils = elliptic.utils;
64546var assert = utils.assert;
64547var parseBytes = utils.parseBytes;
64548var KeyPair = require('./key');
64549var Signature = require('./signature');
64550
64551function EDDSA(curve) {
64552 assert(curve === 'ed25519', 'only tested with ed25519 so far');
64553
64554 if (!(this instanceof EDDSA))
64555 return new EDDSA(curve);
64556
64557 var curve = elliptic.curves[curve].curve;
64558 this.curve = curve;
64559 this.g = curve.g;
64560 this.g.precompute(curve.n.bitLength() + 1);
64561
64562 this.pointClass = curve.point().constructor;
64563 this.encodingLength = Math.ceil(curve.n.bitLength() / 8);
64564 this.hash = hash.sha512;
64565}
64566
64567module.exports = EDDSA;
64568
64569/**
64570* @param {Array|String} message - message bytes
64571* @param {Array|String|KeyPair} secret - secret bytes or a keypair
64572* @returns {Signature} - signature
64573*/
64574EDDSA.prototype.sign = function sign(message, secret) {
64575 message = parseBytes(message);
64576 var key = this.keyFromSecret(secret);
64577 var r = this.hashInt(key.messagePrefix(), message);
64578 var R = this.g.mul(r);
64579 var Rencoded = this.encodePoint(R);
64580 var s_ = this.hashInt(Rencoded, key.pubBytes(), message)
64581 .mul(key.priv());
64582 var S = r.add(s_).umod(this.curve.n);
64583 return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });
64584};
64585
64586/**
64587* @param {Array} message - message bytes
64588* @param {Array|String|Signature} sig - sig bytes
64589* @param {Array|String|Point|KeyPair} pub - public key
64590* @returns {Boolean} - true if public key matches sig of message
64591*/
64592EDDSA.prototype.verify = function verify(message, sig, pub) {
64593 message = parseBytes(message);
64594 sig = this.makeSignature(sig);
64595 var key = this.keyFromPublic(pub);
64596 var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);
64597 var SG = this.g.mul(sig.S());
64598 var RplusAh = sig.R().add(key.pub().mul(h));
64599 return RplusAh.eq(SG);
64600};
64601
64602EDDSA.prototype.hashInt = function hashInt() {
64603 var hash = this.hash();
64604 for (var i = 0; i < arguments.length; i++)
64605 hash.update(arguments[i]);
64606 return utils.intFromLE(hash.digest()).umod(this.curve.n);
64607};
64608
64609EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {
64610 return KeyPair.fromPublic(this, pub);
64611};
64612
64613EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {
64614 return KeyPair.fromSecret(this, secret);
64615};
64616
64617EDDSA.prototype.makeSignature = function makeSignature(sig) {
64618 if (sig instanceof Signature)
64619 return sig;
64620 return new Signature(this, sig);
64621};
64622
64623/**
64624* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2
64625*
64626* EDDSA defines methods for encoding and decoding points and integers. These are
64627* helper convenience methods, that pass along to utility functions implied
64628* parameters.
64629*
64630*/
64631EDDSA.prototype.encodePoint = function encodePoint(point) {
64632 var enc = point.getY().toArray('le', this.encodingLength);
64633 enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;
64634 return enc;
64635};
64636
64637EDDSA.prototype.decodePoint = function decodePoint(bytes) {
64638 bytes = utils.parseBytes(bytes);
64639
64640 var lastIx = bytes.length - 1;
64641 var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);
64642 var xIsOdd = (bytes[lastIx] & 0x80) !== 0;
64643
64644 var y = utils.intFromLE(normed);
64645 return this.curve.pointFromY(y, xIsOdd);
64646};
64647
64648EDDSA.prototype.encodeInt = function encodeInt(num) {
64649 return num.toArray('le', this.encodingLength);
64650};
64651
64652EDDSA.prototype.decodeInt = function decodeInt(bytes) {
64653 return utils.intFromLE(bytes);
64654};
64655
64656EDDSA.prototype.isPoint = function isPoint(val) {
64657 return val instanceof this.pointClass;
64658};
64659
64660},{"../../elliptic":39,"./key":50,"./signature":51,"hash.js":57}],50:[function(require,module,exports){
64661'use strict';
64662
64663var elliptic = require('../../elliptic');
64664var utils = elliptic.utils;
64665var assert = utils.assert;
64666var parseBytes = utils.parseBytes;
64667var cachedProperty = utils.cachedProperty;
64668
64669/**
64670* @param {EDDSA} eddsa - instance
64671* @param {Object} params - public/private key parameters
64672*
64673* @param {Array<Byte>} [params.secret] - secret seed bytes
64674* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)
64675* @param {Array<Byte>} [params.pub] - public key point encoded as bytes
64676*
64677*/
64678function KeyPair(eddsa, params) {
64679 this.eddsa = eddsa;
64680 this._secret = parseBytes(params.secret);
64681 if (eddsa.isPoint(params.pub))
64682 this._pub = params.pub;
64683 else
64684 this._pubBytes = parseBytes(params.pub);
64685}
64686
64687KeyPair.fromPublic = function fromPublic(eddsa, pub) {
64688 if (pub instanceof KeyPair)
64689 return pub;
64690 return new KeyPair(eddsa, { pub: pub });
64691};
64692
64693KeyPair.fromSecret = function fromSecret(eddsa, secret) {
64694 if (secret instanceof KeyPair)
64695 return secret;
64696 return new KeyPair(eddsa, { secret: secret });
64697};
64698
64699KeyPair.prototype.secret = function secret() {
64700 return this._secret;
64701};
64702
64703cachedProperty(KeyPair, 'pubBytes', function pubBytes() {
64704 return this.eddsa.encodePoint(this.pub());
64705});
64706
64707cachedProperty(KeyPair, 'pub', function pub() {
64708 if (this._pubBytes)
64709 return this.eddsa.decodePoint(this._pubBytes);
64710 return this.eddsa.g.mul(this.priv());
64711});
64712
64713cachedProperty(KeyPair, 'privBytes', function privBytes() {
64714 var eddsa = this.eddsa;
64715 var hash = this.hash();
64716 var lastIx = eddsa.encodingLength - 1;
64717
64718 var a = hash.slice(0, eddsa.encodingLength);
64719 a[0] &= 248;
64720 a[lastIx] &= 127;
64721 a[lastIx] |= 64;
64722
64723 return a;
64724});
64725
64726cachedProperty(KeyPair, 'priv', function priv() {
64727 return this.eddsa.decodeInt(this.privBytes());
64728});
64729
64730cachedProperty(KeyPair, 'hash', function hash() {
64731 return this.eddsa.hash().update(this.secret()).digest();
64732});
64733
64734cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {
64735 return this.hash().slice(this.eddsa.encodingLength);
64736});
64737
64738KeyPair.prototype.sign = function sign(message) {
64739 assert(this._secret, 'KeyPair can only verify');
64740 return this.eddsa.sign(message, this);
64741};
64742
64743KeyPair.prototype.verify = function verify(message, sig) {
64744 return this.eddsa.verify(message, sig, this);
64745};
64746
64747KeyPair.prototype.getSecret = function getSecret(enc) {
64748 assert(this._secret, 'KeyPair is public only');
64749 return utils.encode(this.secret(), enc);
64750};
64751
64752KeyPair.prototype.getPublic = function getPublic(enc) {
64753 return utils.encode(this.pubBytes(), enc);
64754};
64755
64756module.exports = KeyPair;
64757
64758},{"../../elliptic":39}],51:[function(require,module,exports){
64759'use strict';
64760
64761var BN = require('bn.js');
64762var elliptic = require('../../elliptic');
64763var utils = elliptic.utils;
64764var assert = utils.assert;
64765var cachedProperty = utils.cachedProperty;
64766var parseBytes = utils.parseBytes;
64767
64768/**
64769* @param {EDDSA} eddsa - eddsa instance
64770* @param {Array<Bytes>|Object} sig -
64771* @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes
64772* @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes
64773* @param {Array<Bytes>} [sig.Rencoded] - R point encoded
64774* @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded
64775*/
64776function Signature(eddsa, sig) {
64777 this.eddsa = eddsa;
64778
64779 if (typeof sig !== 'object')
64780 sig = parseBytes(sig);
64781
64782 if (Array.isArray(sig)) {
64783 sig = {
64784 R: sig.slice(0, eddsa.encodingLength),
64785 S: sig.slice(eddsa.encodingLength)
64786 };
64787 }
64788
64789 assert(sig.R && sig.S, 'Signature without R or S');
64790
64791 if (eddsa.isPoint(sig.R))
64792 this._R = sig.R;
64793 if (sig.S instanceof BN)
64794 this._S = sig.S;
64795
64796 this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;
64797 this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;
64798}
64799
64800cachedProperty(Signature, 'S', function S() {
64801 return this.eddsa.decodeInt(this.Sencoded());
64802});
64803
64804cachedProperty(Signature, 'R', function R() {
64805 return this.eddsa.decodePoint(this.Rencoded());
64806});
64807
64808cachedProperty(Signature, 'Rencoded', function Rencoded() {
64809 return this.eddsa.encodePoint(this.R());
64810});
64811
64812cachedProperty(Signature, 'Sencoded', function Sencoded() {
64813 return this.eddsa.encodeInt(this.S());
64814});
64815
64816Signature.prototype.toBytes = function toBytes() {
64817 return this.Rencoded().concat(this.Sencoded());
64818};
64819
64820Signature.prototype.toHex = function toHex() {
64821 return utils.encode(this.toBytes(), 'hex').toUpperCase();
64822};
64823
64824module.exports = Signature;
64825
64826},{"../../elliptic":39,"bn.js":33}],52:[function(require,module,exports){
64827'use strict';
64828
64829var hash = require('hash.js');
64830var elliptic = require('../elliptic');
64831var utils = elliptic.utils;
64832var assert = utils.assert;
64833
64834function HmacDRBG(options) {
64835 if (!(this instanceof HmacDRBG))
64836 return new HmacDRBG(options);
64837 this.hash = options.hash;
64838 this.predResist = !!options.predResist;
64839
64840 this.outLen = this.hash.outSize;
64841 this.minEntropy = options.minEntropy || this.hash.hmacStrength;
64842
64843 this.reseed = null;
64844 this.reseedInterval = null;
64845 this.K = null;
64846 this.V = null;
64847
64848 var entropy = utils.toArray(options.entropy, options.entropyEnc);
64849 var nonce = utils.toArray(options.nonce, options.nonceEnc);
64850 var pers = utils.toArray(options.pers, options.persEnc);
64851 assert(entropy.length >= (this.minEntropy / 8),
64852 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
64853 this._init(entropy, nonce, pers);
64854}
64855module.exports = HmacDRBG;
64856
64857HmacDRBG.prototype._init = function init(entropy, nonce, pers) {
64858 var seed = entropy.concat(nonce).concat(pers);
64859
64860 this.K = new Array(this.outLen / 8);
64861 this.V = new Array(this.outLen / 8);
64862 for (var i = 0; i < this.V.length; i++) {
64863 this.K[i] = 0x00;
64864 this.V[i] = 0x01;
64865 }
64866
64867 this._update(seed);
64868 this.reseed = 1;
64869 this.reseedInterval = 0x1000000000000; // 2^48
64870};
64871
64872HmacDRBG.prototype._hmac = function hmac() {
64873 return new hash.hmac(this.hash, this.K);
64874};
64875
64876HmacDRBG.prototype._update = function update(seed) {
64877 var kmac = this._hmac()
64878 .update(this.V)
64879 .update([ 0x00 ]);
64880 if (seed)
64881 kmac = kmac.update(seed);
64882 this.K = kmac.digest();
64883 this.V = this._hmac().update(this.V).digest();
64884 if (!seed)
64885 return;
64886
64887 this.K = this._hmac()
64888 .update(this.V)
64889 .update([ 0x01 ])
64890 .update(seed)
64891 .digest();
64892 this.V = this._hmac().update(this.V).digest();
64893};
64894
64895HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {
64896 // Optional entropy enc
64897 if (typeof entropyEnc !== 'string') {
64898 addEnc = add;
64899 add = entropyEnc;
64900 entropyEnc = null;
64901 }
64902
64903 entropy = utils.toBuffer(entropy, entropyEnc);
64904 add = utils.toBuffer(add, addEnc);
64905
64906 assert(entropy.length >= (this.minEntropy / 8),
64907 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
64908
64909 this._update(entropy.concat(add || []));
64910 this.reseed = 1;
64911};
64912
64913HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
64914 if (this.reseed > this.reseedInterval)
64915 throw new Error('Reseed is required');
64916
64917 // Optional encoding
64918 if (typeof enc !== 'string') {
64919 addEnc = add;
64920 add = enc;
64921 enc = null;
64922 }
64923
64924 // Optional additional data
64925 if (add) {
64926 add = utils.toArray(add, addEnc);
64927 this._update(add);
64928 }
64929
64930 var temp = [];
64931 while (temp.length < len) {
64932 this.V = this._hmac().update(this.V).digest();
64933 temp = temp.concat(this.V);
64934 }
64935
64936 var res = temp.slice(0, len);
64937 this._update(add);
64938 this.reseed++;
64939 return utils.encode(res, enc);
64940};
64941
64942},{"../elliptic":39,"hash.js":57}],53:[function(require,module,exports){
64943module.exports = {
64944 doubles: {
64945 step: 4,
64946 points: [
64947 [
64948 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',
64949 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821'
64950 ],
64951 [
64952 '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',
64953 '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf'
64954 ],
64955 [
64956 '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',
64957 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695'
64958 ],
64959 [
64960 '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',
64961 '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9'
64962 ],
64963 [
64964 '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',
64965 '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36'
64966 ],
64967 [
64968 '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',
64969 '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f'
64970 ],
64971 [
64972 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',
64973 '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999'
64974 ],
64975 [
64976 '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',
64977 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09'
64978 ],
64979 [
64980 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',
64981 '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d'
64982 ],
64983 [
64984 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',
64985 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088'
64986 ],
64987 [
64988 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',
64989 '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d'
64990 ],
64991 [
64992 '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',
64993 '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8'
64994 ],
64995 [
64996 '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',
64997 '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a'
64998 ],
64999 [
65000 '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',
65001 '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453'
65002 ],
65003 [
65004 '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',
65005 '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160'
65006 ],
65007 [
65008 '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',
65009 '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0'
65010 ],
65011 [
65012 '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',
65013 '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6'
65014 ],
65015 [
65016 '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',
65017 '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589'
65018 ],
65019 [
65020 '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',
65021 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17'
65022 ],
65023 [
65024 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',
65025 '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda'
65026 ],
65027 [
65028 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',
65029 '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd'
65030 ],
65031 [
65032 '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',
65033 '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2'
65034 ],
65035 [
65036 '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',
65037 '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6'
65038 ],
65039 [
65040 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',
65041 '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f'
65042 ],
65043 [
65044 '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',
65045 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01'
65046 ],
65047 [
65048 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',
65049 '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3'
65050 ],
65051 [
65052 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',
65053 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f'
65054 ],
65055 [
65056 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',
65057 '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7'
65058 ],
65059 [
65060 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',
65061 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78'
65062 ],
65063 [
65064 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',
65065 '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1'
65066 ],
65067 [
65068 '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',
65069 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150'
65070 ],
65071 [
65072 '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',
65073 '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82'
65074 ],
65075 [
65076 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',
65077 '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc'
65078 ],
65079 [
65080 '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',
65081 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b'
65082 ],
65083 [
65084 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',
65085 '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51'
65086 ],
65087 [
65088 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',
65089 '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45'
65090 ],
65091 [
65092 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',
65093 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120'
65094 ],
65095 [
65096 '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',
65097 '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84'
65098 ],
65099 [
65100 '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',
65101 '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d'
65102 ],
65103 [
65104 '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',
65105 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d'
65106 ],
65107 [
65108 '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',
65109 '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8'
65110 ],
65111 [
65112 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',
65113 '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8'
65114 ],
65115 [
65116 '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',
65117 '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac'
65118 ],
65119 [
65120 '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',
65121 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f'
65122 ],
65123 [
65124 '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',
65125 '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962'
65126 ],
65127 [
65128 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',
65129 '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907'
65130 ],
65131 [
65132 '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',
65133 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec'
65134 ],
65135 [
65136 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',
65137 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d'
65138 ],
65139 [
65140 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',
65141 '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414'
65142 ],
65143 [
65144 '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',
65145 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd'
65146 ],
65147 [
65148 '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',
65149 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0'
65150 ],
65151 [
65152 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',
65153 '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811'
65154 ],
65155 [
65156 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',
65157 '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1'
65158 ],
65159 [
65160 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',
65161 '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c'
65162 ],
65163 [
65164 '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',
65165 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73'
65166 ],
65167 [
65168 '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',
65169 '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd'
65170 ],
65171 [
65172 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',
65173 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405'
65174 ],
65175 [
65176 '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',
65177 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589'
65178 ],
65179 [
65180 '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',
65181 '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e'
65182 ],
65183 [
65184 '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',
65185 '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27'
65186 ],
65187 [
65188 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',
65189 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1'
65190 ],
65191 [
65192 '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',
65193 '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482'
65194 ],
65195 [
65196 '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',
65197 '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945'
65198 ],
65199 [
65200 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',
65201 '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573'
65202 ],
65203 [
65204 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',
65205 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82'
65206 ]
65207 ]
65208 },
65209 naf: {
65210 wnd: 7,
65211 points: [
65212 [
65213 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',
65214 '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672'
65215 ],
65216 [
65217 '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',
65218 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6'
65219 ],
65220 [
65221 '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',
65222 '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da'
65223 ],
65224 [
65225 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',
65226 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37'
65227 ],
65228 [
65229 '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',
65230 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b'
65231 ],
65232 [
65233 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',
65234 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81'
65235 ],
65236 [
65237 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',
65238 '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58'
65239 ],
65240 [
65241 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',
65242 '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77'
65243 ],
65244 [
65245 '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',
65246 '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a'
65247 ],
65248 [
65249 '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',
65250 '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c'
65251 ],
65252 [
65253 '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',
65254 '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67'
65255 ],
65256 [
65257 '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',
65258 '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402'
65259 ],
65260 [
65261 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',
65262 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55'
65263 ],
65264 [
65265 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',
65266 '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482'
65267 ],
65268 [
65269 '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',
65270 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82'
65271 ],
65272 [
65273 '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',
65274 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396'
65275 ],
65276 [
65277 '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',
65278 '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49'
65279 ],
65280 [
65281 '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',
65282 '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf'
65283 ],
65284 [
65285 '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',
65286 '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a'
65287 ],
65288 [
65289 '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',
65290 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7'
65291 ],
65292 [
65293 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',
65294 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933'
65295 ],
65296 [
65297 '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',
65298 '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a'
65299 ],
65300 [
65301 '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',
65302 '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6'
65303 ],
65304 [
65305 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',
65306 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37'
65307 ],
65308 [
65309 '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',
65310 '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e'
65311 ],
65312 [
65313 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',
65314 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6'
65315 ],
65316 [
65317 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',
65318 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476'
65319 ],
65320 [
65321 '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',
65322 '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40'
65323 ],
65324 [
65325 '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',
65326 '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61'
65327 ],
65328 [
65329 '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',
65330 '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683'
65331 ],
65332 [
65333 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',
65334 '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5'
65335 ],
65336 [
65337 '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',
65338 '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b'
65339 ],
65340 [
65341 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',
65342 '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417'
65343 ],
65344 [
65345 '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',
65346 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868'
65347 ],
65348 [
65349 '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',
65350 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a'
65351 ],
65352 [
65353 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',
65354 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6'
65355 ],
65356 [
65357 '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',
65358 '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996'
65359 ],
65360 [
65361 '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',
65362 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e'
65363 ],
65364 [
65365 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',
65366 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d'
65367 ],
65368 [
65369 '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',
65370 '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2'
65371 ],
65372 [
65373 '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',
65374 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e'
65375 ],
65376 [
65377 '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',
65378 '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437'
65379 ],
65380 [
65381 '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',
65382 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311'
65383 ],
65384 [
65385 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',
65386 '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4'
65387 ],
65388 [
65389 '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',
65390 '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575'
65391 ],
65392 [
65393 '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',
65394 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d'
65395 ],
65396 [
65397 '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',
65398 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d'
65399 ],
65400 [
65401 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',
65402 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629'
65403 ],
65404 [
65405 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',
65406 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06'
65407 ],
65408 [
65409 '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',
65410 '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374'
65411 ],
65412 [
65413 '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',
65414 '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee'
65415 ],
65416 [
65417 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',
65418 '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1'
65419 ],
65420 [
65421 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',
65422 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b'
65423 ],
65424 [
65425 '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',
65426 '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661'
65427 ],
65428 [
65429 '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',
65430 '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6'
65431 ],
65432 [
65433 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',
65434 '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e'
65435 ],
65436 [
65437 '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',
65438 '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d'
65439 ],
65440 [
65441 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',
65442 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc'
65443 ],
65444 [
65445 '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',
65446 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4'
65447 ],
65448 [
65449 '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',
65450 '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c'
65451 ],
65452 [
65453 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',
65454 '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b'
65455 ],
65456 [
65457 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',
65458 '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913'
65459 ],
65460 [
65461 '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',
65462 '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154'
65463 ],
65464 [
65465 '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',
65466 '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865'
65467 ],
65468 [
65469 '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',
65470 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc'
65471 ],
65472 [
65473 '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',
65474 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224'
65475 ],
65476 [
65477 '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',
65478 '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e'
65479 ],
65480 [
65481 '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',
65482 '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6'
65483 ],
65484 [
65485 '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',
65486 '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511'
65487 ],
65488 [
65489 '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',
65490 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b'
65491 ],
65492 [
65493 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',
65494 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2'
65495 ],
65496 [
65497 '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',
65498 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c'
65499 ],
65500 [
65501 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',
65502 '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3'
65503 ],
65504 [
65505 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',
65506 '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d'
65507 ],
65508 [
65509 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',
65510 '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700'
65511 ],
65512 [
65513 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',
65514 '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4'
65515 ],
65516 [
65517 '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',
65518 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196'
65519 ],
65520 [
65521 '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',
65522 '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4'
65523 ],
65524 [
65525 '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',
65526 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257'
65527 ],
65528 [
65529 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',
65530 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13'
65531 ],
65532 [
65533 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',
65534 '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096'
65535 ],
65536 [
65537 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',
65538 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38'
65539 ],
65540 [
65541 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',
65542 '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f'
65543 ],
65544 [
65545 '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',
65546 '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448'
65547 ],
65548 [
65549 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',
65550 '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a'
65551 ],
65552 [
65553 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',
65554 '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4'
65555 ],
65556 [
65557 '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',
65558 '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437'
65559 ],
65560 [
65561 '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',
65562 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7'
65563 ],
65564 [
65565 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',
65566 '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d'
65567 ],
65568 [
65569 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',
65570 '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a'
65571 ],
65572 [
65573 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',
65574 '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54'
65575 ],
65576 [
65577 '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',
65578 '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77'
65579 ],
65580 [
65581 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',
65582 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517'
65583 ],
65584 [
65585 '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',
65586 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10'
65587 ],
65588 [
65589 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',
65590 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125'
65591 ],
65592 [
65593 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',
65594 '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e'
65595 ],
65596 [
65597 '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',
65598 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1'
65599 ],
65600 [
65601 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',
65602 '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2'
65603 ],
65604 [
65605 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',
65606 '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423'
65607 ],
65608 [
65609 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',
65610 '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8'
65611 ],
65612 [
65613 '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',
65614 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758'
65615 ],
65616 [
65617 '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',
65618 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375'
65619 ],
65620 [
65621 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',
65622 '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d'
65623 ],
65624 [
65625 '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',
65626 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec'
65627 ],
65628 [
65629 '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',
65630 '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0'
65631 ],
65632 [
65633 '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',
65634 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c'
65635 ],
65636 [
65637 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',
65638 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4'
65639 ],
65640 [
65641 '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',
65642 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f'
65643 ],
65644 [
65645 '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',
65646 '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649'
65647 ],
65648 [
65649 '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',
65650 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826'
65651 ],
65652 [
65653 '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',
65654 '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5'
65655 ],
65656 [
65657 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',
65658 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87'
65659 ],
65660 [
65661 '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',
65662 '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b'
65663 ],
65664 [
65665 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',
65666 '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc'
65667 ],
65668 [
65669 '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',
65670 '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c'
65671 ],
65672 [
65673 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',
65674 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f'
65675 ],
65676 [
65677 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',
65678 '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a'
65679 ],
65680 [
65681 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',
65682 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46'
65683 ],
65684 [
65685 '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',
65686 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f'
65687 ],
65688 [
65689 '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',
65690 '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03'
65691 ],
65692 [
65693 '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',
65694 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08'
65695 ],
65696 [
65697 '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',
65698 '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8'
65699 ],
65700 [
65701 '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',
65702 '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373'
65703 ],
65704 [
65705 '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',
65706 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3'
65707 ],
65708 [
65709 '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',
65710 '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8'
65711 ],
65712 [
65713 '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',
65714 '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1'
65715 ],
65716 [
65717 '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',
65718 '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9'
65719 ]
65720 ]
65721 }
65722};
65723
65724},{}],54:[function(require,module,exports){
65725'use strict';
65726
65727var utils = exports;
65728var BN = require('bn.js');
65729
65730utils.assert = function assert(val, msg) {
65731 if (!val)
65732 throw new Error(msg || 'Assertion failed');
65733};
65734
65735function toArray(msg, enc) {
65736 if (Array.isArray(msg))
65737 return msg.slice();
65738 if (!msg)
65739 return [];
65740 var res = [];
65741 if (typeof msg !== 'string') {
65742 for (var i = 0; i < msg.length; i++)
65743 res[i] = msg[i] | 0;
65744 return res;
65745 }
65746 if (!enc) {
65747 for (var i = 0; i < msg.length; i++) {
65748 var c = msg.charCodeAt(i);
65749 var hi = c >> 8;
65750 var lo = c & 0xff;
65751 if (hi)
65752 res.push(hi, lo);
65753 else
65754 res.push(lo);
65755 }
65756 } else if (enc === 'hex') {
65757 msg = msg.replace(/[^a-z0-9]+/ig, '');
65758 if (msg.length % 2 !== 0)
65759 msg = '0' + msg;
65760 for (var i = 0; i < msg.length; i += 2)
65761 res.push(parseInt(msg[i] + msg[i + 1], 16));
65762 }
65763 return res;
65764}
65765utils.toArray = toArray;
65766
65767function zero2(word) {
65768 if (word.length === 1)
65769 return '0' + word;
65770 else
65771 return word;
65772}
65773utils.zero2 = zero2;
65774
65775function toHex(msg) {
65776 var res = '';
65777 for (var i = 0; i < msg.length; i++)
65778 res += zero2(msg[i].toString(16));
65779 return res;
65780}
65781utils.toHex = toHex;
65782
65783utils.encode = function encode(arr, enc) {
65784 if (enc === 'hex')
65785 return toHex(arr);
65786 else
65787 return arr;
65788};
65789
65790// Represent num in a w-NAF form
65791function getNAF(num, w) {
65792 var naf = [];
65793 var ws = 1 << (w + 1);
65794 var k = num.clone();
65795 while (k.cmpn(1) >= 0) {
65796 var z;
65797 if (k.isOdd()) {
65798 var mod = k.andln(ws - 1);
65799 if (mod > (ws >> 1) - 1)
65800 z = (ws >> 1) - mod;
65801 else
65802 z = mod;
65803 k.isubn(z);
65804 } else {
65805 z = 0;
65806 }
65807 naf.push(z);
65808
65809 // Optimization, shift by word if possible
65810 var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1;
65811 for (var i = 1; i < shift; i++)
65812 naf.push(0);
65813 k.iushrn(shift);
65814 }
65815
65816 return naf;
65817}
65818utils.getNAF = getNAF;
65819
65820// Represent k1, k2 in a Joint Sparse Form
65821function getJSF(k1, k2) {
65822 var jsf = [
65823 [],
65824 []
65825 ];
65826
65827 k1 = k1.clone();
65828 k2 = k2.clone();
65829 var d1 = 0;
65830 var d2 = 0;
65831 while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {
65832
65833 // First phase
65834 var m14 = (k1.andln(3) + d1) & 3;
65835 var m24 = (k2.andln(3) + d2) & 3;
65836 if (m14 === 3)
65837 m14 = -1;
65838 if (m24 === 3)
65839 m24 = -1;
65840 var u1;
65841 if ((m14 & 1) === 0) {
65842 u1 = 0;
65843 } else {
65844 var m8 = (k1.andln(7) + d1) & 7;
65845 if ((m8 === 3 || m8 === 5) && m24 === 2)
65846 u1 = -m14;
65847 else
65848 u1 = m14;
65849 }
65850 jsf[0].push(u1);
65851
65852 var u2;
65853 if ((m24 & 1) === 0) {
65854 u2 = 0;
65855 } else {
65856 var m8 = (k2.andln(7) + d2) & 7;
65857 if ((m8 === 3 || m8 === 5) && m14 === 2)
65858 u2 = -m24;
65859 else
65860 u2 = m24;
65861 }
65862 jsf[1].push(u2);
65863
65864 // Second phase
65865 if (2 * d1 === u1 + 1)
65866 d1 = 1 - d1;
65867 if (2 * d2 === u2 + 1)
65868 d2 = 1 - d2;
65869 k1.iushrn(1);
65870 k2.iushrn(1);
65871 }
65872
65873 return jsf;
65874}
65875utils.getJSF = getJSF;
65876
65877function cachedProperty(obj, name, computer) {
65878 var key = '_' + name;
65879 obj.prototype[name] = function cachedProperty() {
65880 return this[key] !== undefined ? this[key] :
65881 this[key] = computer.call(this);
65882 };
65883}
65884utils.cachedProperty = cachedProperty;
65885
65886function parseBytes(bytes) {
65887 return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :
65888 bytes;
65889}
65890utils.parseBytes = parseBytes;
65891
65892function intFromLE(bytes) {
65893 return new BN(bytes, 'hex', 'le');
65894}
65895utils.intFromLE = intFromLE;
65896
65897
65898},{"bn.js":33}],55:[function(require,module,exports){
65899module.exports={
65900 "_args": [
65901 [
65902 {
65903 "raw": "elliptic@^6.2.3",
65904 "scope": null,
65905 "escapedName": "elliptic",
65906 "name": "elliptic",
65907 "rawSpec": "^6.2.3",
65908 "spec": ">=6.2.3 <7.0.0",
65909 "type": "range"
65910 },
65911 "/home/user/ethereum/ethereumjs-util/node_modules/secp256k1"
65912 ]
65913 ],
65914 "_from": "elliptic@>=6.2.3 <7.0.0",
65915 "_id": "elliptic@6.3.3",
65916 "_inCache": true,
65917 "_location": "/elliptic",
65918 "_nodeVersion": "7.0.0",
65919 "_npmOperationalInternal": {
65920 "host": "packages-18-east.internal.npmjs.com",
65921 "tmp": "tmp/elliptic-6.3.3.tgz_1486422837740_0.10658654430881143"
65922 },
65923 "_npmUser": {
65924 "name": "indutny",
65925 "email": "fedor@indutny.com"
65926 },
65927 "_npmVersion": "3.10.8",
65928 "_phantomChildren": {},
65929 "_requested": {
65930 "raw": "elliptic@^6.2.3",
65931 "scope": null,
65932 "escapedName": "elliptic",
65933 "name": "elliptic",
65934 "rawSpec": "^6.2.3",
65935 "spec": ">=6.2.3 <7.0.0",
65936 "type": "range"
65937 },
65938 "_requiredBy": [
65939 "/browserify-sign",
65940 "/create-ecdh",
65941 "/secp256k1"
65942 ],
65943 "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz",
65944 "_shasum": "5482d9646d54bcb89fd7d994fc9e2e9568876e3f",
65945 "_shrinkwrap": null,
65946 "_spec": "elliptic@^6.2.3",
65947 "_where": "/home/user/ethereum/ethereumjs-util/node_modules/secp256k1",
65948 "author": {
65949 "name": "Fedor Indutny",
65950 "email": "fedor@indutny.com"
65951 },
65952 "bugs": {
65953 "url": "https://github.com/indutny/elliptic/issues"
65954 },
65955 "dependencies": {
65956 "bn.js": "^4.4.0",
65957 "brorand": "^1.0.1",
65958 "hash.js": "^1.0.0",
65959 "inherits": "^2.0.1"
65960 },
65961 "description": "EC cryptography",
65962 "devDependencies": {
65963 "brfs": "^1.4.3",
65964 "coveralls": "^2.11.3",
65965 "grunt": "^0.4.5",
65966 "grunt-browserify": "^5.0.0",
65967 "grunt-cli": "^1.2.0",
65968 "grunt-contrib-connect": "^1.0.0",
65969 "grunt-contrib-copy": "^1.0.0",
65970 "grunt-contrib-uglify": "^1.0.1",
65971 "grunt-mocha-istanbul": "^3.0.1",
65972 "grunt-saucelabs": "^8.6.2",
65973 "istanbul": "^0.4.2",
65974 "jscs": "^2.9.0",
65975 "jshint": "^2.6.0",
65976 "mocha": "^2.1.0"
65977 },
65978 "directories": {},
65979 "dist": {
65980 "shasum": "5482d9646d54bcb89fd7d994fc9e2e9568876e3f",
65981 "tarball": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz"
65982 },
65983 "files": [
65984 "lib"
65985 ],
65986 "gitHead": "63aee8d697e9b7fac37ece24222029117a890a7e",
65987 "homepage": "https://github.com/indutny/elliptic",
65988 "keywords": [
65989 "EC",
65990 "Elliptic",
65991 "curve",
65992 "Cryptography"
65993 ],
65994 "license": "MIT",
65995 "main": "lib/elliptic.js",
65996 "maintainers": [
65997 {
65998 "name": "indutny",
65999 "email": "fedor@indutny.com"
66000 }
66001 ],
66002 "name": "elliptic",
66003 "optionalDependencies": {},
66004 "readme": "ERROR: No README data found!",
66005 "repository": {
66006 "type": "git",
66007 "url": "git+ssh://git@github.com/indutny/elliptic.git"
66008 },
66009 "scripts": {
66010 "jscs": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",
66011 "jshint": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",
66012 "lint": "npm run jscs && npm run jshint",
66013 "test": "npm run lint && npm run unit",
66014 "unit": "istanbul test _mocha --reporter=spec test/index.js",
66015 "version": "grunt dist && git add dist/"
66016 },
66017 "version": "6.3.3"
66018}
66019
66020},{}],56:[function(require,module,exports){
66021(function (Buffer){
66022'use strict';
66023
66024var isHexPrefixed = require('is-hex-prefixed');
66025var stripHexPrefix = require('strip-hex-prefix');
66026
66027/**
66028 * Pads a `String` to have an even length
66029 * @param {String} value
66030 * @return {String} output
66031 */
66032function padToEven(value) {
66033 var a = value; // eslint-disable-line
66034
66035 if (typeof a !== 'string') {
66036 throw new Error('[ethjs-util] while padding to even, value must be string, is currently ' + typeof a + ', while padToEven.');
66037 }
66038
66039 if (a.length % 2) {
66040 a = '0' + a;
66041 }
66042
66043 return a;
66044}
66045
66046/**
66047 * Converts a `Number` into a hex `String`
66048 * @param {Number} i
66049 * @return {String}
66050 */
66051function intToHex(i) {
66052 var hex = i.toString(16); // eslint-disable-line
66053
66054 return '0x' + padToEven(hex);
66055}
66056
66057/**
66058 * Converts an `Number` to a `Buffer`
66059 * @param {Number} i
66060 * @return {Buffer}
66061 */
66062function intToBuffer(i) {
66063 var hex = intToHex(i);
66064
66065 return new Buffer(hex.slice(2), 'hex');
66066}
66067
66068/**
66069 * Get the binary size of a string
66070 * @param {String} str
66071 * @return {Number}
66072 */
66073function getBinarySize(str) {
66074 if (typeof str !== 'string') {
66075 throw new Error('[ethjs-util] while getting binary size, method getBinarySize requires input \'str\' to be type String, got \'' + typeof str + '\'.');
66076 }
66077
66078 return Buffer.byteLength(str, 'utf8');
66079}
66080
66081/**
66082 * Returns TRUE if the first specified array contains all elements
66083 * from the second one. FALSE otherwise.
66084 *
66085 * @param {array} superset
66086 * @param {array} subset
66087 *
66088 * @returns {boolean}
66089 */
66090function arrayContainsArray(superset, subset, some) {
66091 if (Array.isArray(superset) !== true) {
66092 throw new Error('[ethjs-util] method arrayContainsArray requires input \'superset\' to be an array got type \'' + typeof superset + '\'');
66093 }
66094 if (Array.isArray(subset) !== true) {
66095 throw new Error('[ethjs-util] method arrayContainsArray requires input \'subset\' to be an array got type \'' + typeof subset + '\'');
66096 }
66097
66098 return subset[Boolean(some) && 'some' || 'every'](function (value) {
66099 return superset.indexOf(value) >= 0;
66100 });
66101}
66102
66103/**
66104 * Should be called to get utf8 from it's hex representation
66105 *
66106 * @method toUtf8
66107 * @param {String} string in hex
66108 * @returns {String} ascii string representation of hex value
66109 */
66110function toUtf8(hex) {
66111 var bufferValue = new Buffer(padToEven(stripHexPrefix(hex).replace(/^0+|0+$/g, '')), 'hex');
66112
66113 return bufferValue.toString('utf8');
66114}
66115
66116/**
66117 * Should be called to get ascii from it's hex representation
66118 *
66119 * @method toAscii
66120 * @param {String} string in hex
66121 * @returns {String} ascii string representation of hex value
66122 */
66123function toAscii(hex) {
66124 var str = ''; // eslint-disable-line
66125 var i = 0,
66126 l = hex.length; // eslint-disable-line
66127
66128 if (hex.substring(0, 2) === '0x') {
66129 i = 2;
66130 }
66131
66132 for (; i < l; i += 2) {
66133 var code = parseInt(hex.substr(i, 2), 16);
66134 str += String.fromCharCode(code);
66135 }
66136
66137 return str;
66138}
66139
66140/**
66141 * Should be called to get hex representation (prefixed by 0x) of utf8 string
66142 *
66143 * @method fromUtf8
66144 * @param {String} string
66145 * @param {Number} optional padding
66146 * @returns {String} hex representation of input string
66147 */
66148function fromUtf8(stringValue) {
66149 var str = new Buffer(stringValue, 'utf8');
66150
66151 return '0x' + padToEven(str.toString('hex')).replace(/^0+|0+$/g, '');
66152}
66153
66154/**
66155 * Should be called to get hex representation (prefixed by 0x) of ascii string
66156 *
66157 * @method fromAscii
66158 * @param {String} string
66159 * @param {Number} optional padding
66160 * @returns {String} hex representation of input string
66161 */
66162function fromAscii(stringValue) {
66163 var hex = ''; // eslint-disable-line
66164 for (var i = 0; i < stringValue.length; i++) {
66165 // eslint-disable-line
66166 var code = stringValue.charCodeAt(i);
66167 var n = code.toString(16);
66168 hex += n.length < 2 ? '0' + n : n;
66169 }
66170
66171 return '0x' + hex;
66172}
66173
66174/**
66175 * getKeys([{a: 1, b: 2}, {a: 3, b: 4}], 'a') => [1, 3]
66176 *
66177 * @method getKeys get specific key from inner object array of objects
66178 * @param {String} params
66179 * @param {String} key
66180 * @param {Boolean} allowEmpty
66181 * @returns {Array} output just a simple array of output keys
66182 */
66183function getKeys(params, key, allowEmpty) {
66184 if (!Array.isArray(params)) {
66185 throw new Error('[ethjs-util] method getKeys expecting type Array as \'params\' input, got \'' + typeof params + '\'');
66186 }
66187 if (typeof key !== 'string') {
66188 throw new Error('[ethjs-util] method getKeys expecting type String for input \'key\' got \'' + typeof key + '\'.');
66189 }
66190
66191 var result = []; // eslint-disable-line
66192
66193 for (var i = 0; i < params.length; i++) {
66194 // eslint-disable-line
66195 var value = params[i][key]; // eslint-disable-line
66196 if (allowEmpty && !value) {
66197 value = '';
66198 } else if (typeof value !== 'string') {
66199 throw new Error('invalid abi');
66200 }
66201 result.push(value);
66202 }
66203
66204 return result;
66205}
66206
66207/**
66208 * Is the string a hex string.
66209 *
66210 * @method check if string is hex string of specific length
66211 * @param {String} value
66212 * @param {Number} length
66213 * @returns {Boolean} output the string is a hex string
66214 */
66215function isHexString(value, length) {
66216 if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/)) {
66217 return false;
66218 }
66219
66220 if (length && value.length !== 2 + 2 * length) {
66221 return false;
66222 }
66223
66224 return true;
66225}
66226
66227module.exports = {
66228 arrayContainsArray: arrayContainsArray,
66229 intToBuffer: intToBuffer,
66230 getBinarySize: getBinarySize,
66231 isHexPrefixed: isHexPrefixed,
66232 stripHexPrefix: stripHexPrefix,
66233 padToEven: padToEven,
66234 intToHex: intToHex,
66235 fromAscii: fromAscii,
66236 fromUtf8: fromUtf8,
66237 toAscii: toAscii,
66238 toUtf8: toUtf8,
66239 getKeys: getKeys,
66240 isHexString: isHexString
66241};
66242}).call(this,require("buffer").Buffer)
66243},{"buffer":5,"is-hex-prefixed":64,"strip-hex-prefix":87}],57:[function(require,module,exports){
66244var hash = exports;
66245
66246hash.utils = require('./hash/utils');
66247hash.common = require('./hash/common');
66248hash.sha = require('./hash/sha');
66249hash.ripemd = require('./hash/ripemd');
66250hash.hmac = require('./hash/hmac');
66251
66252// Proxy hash functions to the main object
66253hash.sha1 = hash.sha.sha1;
66254hash.sha256 = hash.sha.sha256;
66255hash.sha224 = hash.sha.sha224;
66256hash.sha384 = hash.sha.sha384;
66257hash.sha512 = hash.sha.sha512;
66258hash.ripemd160 = hash.ripemd.ripemd160;
66259
66260},{"./hash/common":58,"./hash/hmac":59,"./hash/ripemd":60,"./hash/sha":61,"./hash/utils":62}],58:[function(require,module,exports){
66261var hash = require('../hash');
66262var utils = hash.utils;
66263var assert = utils.assert;
66264
66265function BlockHash() {
66266 this.pending = null;
66267 this.pendingTotal = 0;
66268 this.blockSize = this.constructor.blockSize;
66269 this.outSize = this.constructor.outSize;
66270 this.hmacStrength = this.constructor.hmacStrength;
66271 this.padLength = this.constructor.padLength / 8;
66272 this.endian = 'big';
66273
66274 this._delta8 = this.blockSize / 8;
66275 this._delta32 = this.blockSize / 32;
66276}
66277exports.BlockHash = BlockHash;
66278
66279BlockHash.prototype.update = function update(msg, enc) {
66280 // Convert message to array, pad it, and join into 32bit blocks
66281 msg = utils.toArray(msg, enc);
66282 if (!this.pending)
66283 this.pending = msg;
66284 else
66285 this.pending = this.pending.concat(msg);
66286 this.pendingTotal += msg.length;
66287
66288 // Enough data, try updating
66289 if (this.pending.length >= this._delta8) {
66290 msg = this.pending;
66291
66292 // Process pending data in blocks
66293 var r = msg.length % this._delta8;
66294 this.pending = msg.slice(msg.length - r, msg.length);
66295 if (this.pending.length === 0)
66296 this.pending = null;
66297
66298 msg = utils.join32(msg, 0, msg.length - r, this.endian);
66299 for (var i = 0; i < msg.length; i += this._delta32)
66300 this._update(msg, i, i + this._delta32);
66301 }
66302
66303 return this;
66304};
66305
66306BlockHash.prototype.digest = function digest(enc) {
66307 this.update(this._pad());
66308 assert(this.pending === null);
66309
66310 return this._digest(enc);
66311};
66312
66313BlockHash.prototype._pad = function pad() {
66314 var len = this.pendingTotal;
66315 var bytes = this._delta8;
66316 var k = bytes - ((len + this.padLength) % bytes);
66317 var res = new Array(k + this.padLength);
66318 res[0] = 0x80;
66319 for (var i = 1; i < k; i++)
66320 res[i] = 0;
66321
66322 // Append length
66323 len <<= 3;
66324 if (this.endian === 'big') {
66325 for (var t = 8; t < this.padLength; t++)
66326 res[i++] = 0;
66327
66328 res[i++] = 0;
66329 res[i++] = 0;
66330 res[i++] = 0;
66331 res[i++] = 0;
66332 res[i++] = (len >>> 24) & 0xff;
66333 res[i++] = (len >>> 16) & 0xff;
66334 res[i++] = (len >>> 8) & 0xff;
66335 res[i++] = len & 0xff;
66336 } else {
66337 res[i++] = len & 0xff;
66338 res[i++] = (len >>> 8) & 0xff;
66339 res[i++] = (len >>> 16) & 0xff;
66340 res[i++] = (len >>> 24) & 0xff;
66341 res[i++] = 0;
66342 res[i++] = 0;
66343 res[i++] = 0;
66344 res[i++] = 0;
66345
66346 for (var t = 8; t < this.padLength; t++)
66347 res[i++] = 0;
66348 }
66349
66350 return res;
66351};
66352
66353},{"../hash":57}],59:[function(require,module,exports){
66354var hmac = exports;
66355
66356var hash = require('../hash');
66357var utils = hash.utils;
66358var assert = utils.assert;
66359
66360function Hmac(hash, key, enc) {
66361 if (!(this instanceof Hmac))
66362 return new Hmac(hash, key, enc);
66363 this.Hash = hash;
66364 this.blockSize = hash.blockSize / 8;
66365 this.outSize = hash.outSize / 8;
66366 this.inner = null;
66367 this.outer = null;
66368
66369 this._init(utils.toArray(key, enc));
66370}
66371module.exports = Hmac;
66372
66373Hmac.prototype._init = function init(key) {
66374 // Shorten key, if needed
66375 if (key.length > this.blockSize)
66376 key = new this.Hash().update(key).digest();
66377 assert(key.length <= this.blockSize);
66378
66379 // Add padding to key
66380 for (var i = key.length; i < this.blockSize; i++)
66381 key.push(0);
66382
66383 for (var i = 0; i < key.length; i++)
66384 key[i] ^= 0x36;
66385 this.inner = new this.Hash().update(key);
66386
66387 // 0x36 ^ 0x5c = 0x6a
66388 for (var i = 0; i < key.length; i++)
66389 key[i] ^= 0x6a;
66390 this.outer = new this.Hash().update(key);
66391};
66392
66393Hmac.prototype.update = function update(msg, enc) {
66394 this.inner.update(msg, enc);
66395 return this;
66396};
66397
66398Hmac.prototype.digest = function digest(enc) {
66399 this.outer.update(this.inner.digest());
66400 return this.outer.digest(enc);
66401};
66402
66403},{"../hash":57}],60:[function(require,module,exports){
66404var hash = require('../hash');
66405var utils = hash.utils;
66406
66407var rotl32 = utils.rotl32;
66408var sum32 = utils.sum32;
66409var sum32_3 = utils.sum32_3;
66410var sum32_4 = utils.sum32_4;
66411var BlockHash = hash.common.BlockHash;
66412
66413function RIPEMD160() {
66414 if (!(this instanceof RIPEMD160))
66415 return new RIPEMD160();
66416
66417 BlockHash.call(this);
66418
66419 this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
66420 this.endian = 'little';
66421}
66422utils.inherits(RIPEMD160, BlockHash);
66423exports.ripemd160 = RIPEMD160;
66424
66425RIPEMD160.blockSize = 512;
66426RIPEMD160.outSize = 160;
66427RIPEMD160.hmacStrength = 192;
66428RIPEMD160.padLength = 64;
66429
66430RIPEMD160.prototype._update = function update(msg, start) {
66431 var A = this.h[0];
66432 var B = this.h[1];
66433 var C = this.h[2];
66434 var D = this.h[3];
66435 var E = this.h[4];
66436 var Ah = A;
66437 var Bh = B;
66438 var Ch = C;
66439 var Dh = D;
66440 var Eh = E;
66441 for (var j = 0; j < 80; j++) {
66442 var T = sum32(
66443 rotl32(
66444 sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),
66445 s[j]),
66446 E);
66447 A = E;
66448 E = D;
66449 D = rotl32(C, 10);
66450 C = B;
66451 B = T;
66452 T = sum32(
66453 rotl32(
66454 sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),
66455 sh[j]),
66456 Eh);
66457 Ah = Eh;
66458 Eh = Dh;
66459 Dh = rotl32(Ch, 10);
66460 Ch = Bh;
66461 Bh = T;
66462 }
66463 T = sum32_3(this.h[1], C, Dh);
66464 this.h[1] = sum32_3(this.h[2], D, Eh);
66465 this.h[2] = sum32_3(this.h[3], E, Ah);
66466 this.h[3] = sum32_3(this.h[4], A, Bh);
66467 this.h[4] = sum32_3(this.h[0], B, Ch);
66468 this.h[0] = T;
66469};
66470
66471RIPEMD160.prototype._digest = function digest(enc) {
66472 if (enc === 'hex')
66473 return utils.toHex32(this.h, 'little');
66474 else
66475 return utils.split32(this.h, 'little');
66476};
66477
66478function f(j, x, y, z) {
66479 if (j <= 15)
66480 return x ^ y ^ z;
66481 else if (j <= 31)
66482 return (x & y) | ((~x) & z);
66483 else if (j <= 47)
66484 return (x | (~y)) ^ z;
66485 else if (j <= 63)
66486 return (x & z) | (y & (~z));
66487 else
66488 return x ^ (y | (~z));
66489}
66490
66491function K(j) {
66492 if (j <= 15)
66493 return 0x00000000;
66494 else if (j <= 31)
66495 return 0x5a827999;
66496 else if (j <= 47)
66497 return 0x6ed9eba1;
66498 else if (j <= 63)
66499 return 0x8f1bbcdc;
66500 else
66501 return 0xa953fd4e;
66502}
66503
66504function Kh(j) {
66505 if (j <= 15)
66506 return 0x50a28be6;
66507 else if (j <= 31)
66508 return 0x5c4dd124;
66509 else if (j <= 47)
66510 return 0x6d703ef3;
66511 else if (j <= 63)
66512 return 0x7a6d76e9;
66513 else
66514 return 0x00000000;
66515}
66516
66517var r = [
66518 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
66519 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
66520 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
66521 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
66522 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
66523];
66524
66525var rh = [
66526 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
66527 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
66528 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
66529 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
66530 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
66531];
66532
66533var s = [
66534 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
66535 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
66536 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
66537 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
66538 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
66539];
66540
66541var sh = [
66542 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
66543 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
66544 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
66545 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
66546 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
66547];
66548
66549},{"../hash":57}],61:[function(require,module,exports){
66550var hash = require('../hash');
66551var utils = hash.utils;
66552var assert = utils.assert;
66553
66554var rotr32 = utils.rotr32;
66555var rotl32 = utils.rotl32;
66556var sum32 = utils.sum32;
66557var sum32_4 = utils.sum32_4;
66558var sum32_5 = utils.sum32_5;
66559var rotr64_hi = utils.rotr64_hi;
66560var rotr64_lo = utils.rotr64_lo;
66561var shr64_hi = utils.shr64_hi;
66562var shr64_lo = utils.shr64_lo;
66563var sum64 = utils.sum64;
66564var sum64_hi = utils.sum64_hi;
66565var sum64_lo = utils.sum64_lo;
66566var sum64_4_hi = utils.sum64_4_hi;
66567var sum64_4_lo = utils.sum64_4_lo;
66568var sum64_5_hi = utils.sum64_5_hi;
66569var sum64_5_lo = utils.sum64_5_lo;
66570var BlockHash = hash.common.BlockHash;
66571
66572var sha256_K = [
66573 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
66574 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
66575 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
66576 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
66577 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
66578 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
66579 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
66580 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
66581 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
66582 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
66583 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
66584 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
66585 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
66586 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
66587 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
66588 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
66589];
66590
66591var sha512_K = [
66592 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
66593 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
66594 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
66595 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
66596 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
66597 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
66598 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
66599 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
66600 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
66601 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
66602 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
66603 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
66604 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
66605 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
66606 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
66607 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
66608 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
66609 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
66610 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
66611 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
66612 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
66613 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
66614 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
66615 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
66616 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
66617 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
66618 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
66619 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
66620 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
66621 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
66622 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
66623 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
66624 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
66625 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
66626 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
66627 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
66628 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
66629 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
66630 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
66631 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
66632];
66633
66634var sha1_K = [
66635 0x5A827999, 0x6ED9EBA1,
66636 0x8F1BBCDC, 0xCA62C1D6
66637];
66638
66639function SHA256() {
66640 if (!(this instanceof SHA256))
66641 return new SHA256();
66642
66643 BlockHash.call(this);
66644 this.h = [ 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
66645 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 ];
66646 this.k = sha256_K;
66647 this.W = new Array(64);
66648}
66649utils.inherits(SHA256, BlockHash);
66650exports.sha256 = SHA256;
66651
66652SHA256.blockSize = 512;
66653SHA256.outSize = 256;
66654SHA256.hmacStrength = 192;
66655SHA256.padLength = 64;
66656
66657SHA256.prototype._update = function _update(msg, start) {
66658 var W = this.W;
66659
66660 for (var i = 0; i < 16; i++)
66661 W[i] = msg[start + i];
66662 for (; i < W.length; i++)
66663 W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
66664
66665 var a = this.h[0];
66666 var b = this.h[1];
66667 var c = this.h[2];
66668 var d = this.h[3];
66669 var e = this.h[4];
66670 var f = this.h[5];
66671 var g = this.h[6];
66672 var h = this.h[7];
66673
66674 assert(this.k.length === W.length);
66675 for (var i = 0; i < W.length; i++) {
66676 var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
66677 var T2 = sum32(s0_256(a), maj32(a, b, c));
66678 h = g;
66679 g = f;
66680 f = e;
66681 e = sum32(d, T1);
66682 d = c;
66683 c = b;
66684 b = a;
66685 a = sum32(T1, T2);
66686 }
66687
66688 this.h[0] = sum32(this.h[0], a);
66689 this.h[1] = sum32(this.h[1], b);
66690 this.h[2] = sum32(this.h[2], c);
66691 this.h[3] = sum32(this.h[3], d);
66692 this.h[4] = sum32(this.h[4], e);
66693 this.h[5] = sum32(this.h[5], f);
66694 this.h[6] = sum32(this.h[6], g);
66695 this.h[7] = sum32(this.h[7], h);
66696};
66697
66698SHA256.prototype._digest = function digest(enc) {
66699 if (enc === 'hex')
66700 return utils.toHex32(this.h, 'big');
66701 else
66702 return utils.split32(this.h, 'big');
66703};
66704
66705function SHA224() {
66706 if (!(this instanceof SHA224))
66707 return new SHA224();
66708
66709 SHA256.call(this);
66710 this.h = [ 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
66711 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];
66712}
66713utils.inherits(SHA224, SHA256);
66714exports.sha224 = SHA224;
66715
66716SHA224.blockSize = 512;
66717SHA224.outSize = 224;
66718SHA224.hmacStrength = 192;
66719SHA224.padLength = 64;
66720
66721SHA224.prototype._digest = function digest(enc) {
66722 // Just truncate output
66723 if (enc === 'hex')
66724 return utils.toHex32(this.h.slice(0, 7), 'big');
66725 else
66726 return utils.split32(this.h.slice(0, 7), 'big');
66727};
66728
66729function SHA512() {
66730 if (!(this instanceof SHA512))
66731 return new SHA512();
66732
66733 BlockHash.call(this);
66734 this.h = [ 0x6a09e667, 0xf3bcc908,
66735 0xbb67ae85, 0x84caa73b,
66736 0x3c6ef372, 0xfe94f82b,
66737 0xa54ff53a, 0x5f1d36f1,
66738 0x510e527f, 0xade682d1,
66739 0x9b05688c, 0x2b3e6c1f,
66740 0x1f83d9ab, 0xfb41bd6b,
66741 0x5be0cd19, 0x137e2179 ];
66742 this.k = sha512_K;
66743 this.W = new Array(160);
66744}
66745utils.inherits(SHA512, BlockHash);
66746exports.sha512 = SHA512;
66747
66748SHA512.blockSize = 1024;
66749SHA512.outSize = 512;
66750SHA512.hmacStrength = 192;
66751SHA512.padLength = 128;
66752
66753SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
66754 var W = this.W;
66755
66756 // 32 x 32bit words
66757 for (var i = 0; i < 32; i++)
66758 W[i] = msg[start + i];
66759 for (; i < W.length; i += 2) {
66760 var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2
66761 var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
66762 var c1_hi = W[i - 14]; // i - 7
66763 var c1_lo = W[i - 13];
66764 var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15
66765 var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);
66766 var c3_hi = W[i - 32]; // i - 16
66767 var c3_lo = W[i - 31];
66768
66769 W[i] = sum64_4_hi(c0_hi, c0_lo,
66770 c1_hi, c1_lo,
66771 c2_hi, c2_lo,
66772 c3_hi, c3_lo);
66773 W[i + 1] = sum64_4_lo(c0_hi, c0_lo,
66774 c1_hi, c1_lo,
66775 c2_hi, c2_lo,
66776 c3_hi, c3_lo);
66777 }
66778};
66779
66780SHA512.prototype._update = function _update(msg, start) {
66781 this._prepareBlock(msg, start);
66782
66783 var W = this.W;
66784
66785 var ah = this.h[0];
66786 var al = this.h[1];
66787 var bh = this.h[2];
66788 var bl = this.h[3];
66789 var ch = this.h[4];
66790 var cl = this.h[5];
66791 var dh = this.h[6];
66792 var dl = this.h[7];
66793 var eh = this.h[8];
66794 var el = this.h[9];
66795 var fh = this.h[10];
66796 var fl = this.h[11];
66797 var gh = this.h[12];
66798 var gl = this.h[13];
66799 var hh = this.h[14];
66800 var hl = this.h[15];
66801
66802 assert(this.k.length === W.length);
66803 for (var i = 0; i < W.length; i += 2) {
66804 var c0_hi = hh;
66805 var c0_lo = hl;
66806 var c1_hi = s1_512_hi(eh, el);
66807 var c1_lo = s1_512_lo(eh, el);
66808 var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);
66809 var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
66810 var c3_hi = this.k[i];
66811 var c3_lo = this.k[i + 1];
66812 var c4_hi = W[i];
66813 var c4_lo = W[i + 1];
66814
66815 var T1_hi = sum64_5_hi(c0_hi, c0_lo,
66816 c1_hi, c1_lo,
66817 c2_hi, c2_lo,
66818 c3_hi, c3_lo,
66819 c4_hi, c4_lo);
66820 var T1_lo = sum64_5_lo(c0_hi, c0_lo,
66821 c1_hi, c1_lo,
66822 c2_hi, c2_lo,
66823 c3_hi, c3_lo,
66824 c4_hi, c4_lo);
66825
66826 var c0_hi = s0_512_hi(ah, al);
66827 var c0_lo = s0_512_lo(ah, al);
66828 var c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);
66829 var c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
66830
66831 var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
66832 var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
66833
66834 hh = gh;
66835 hl = gl;
66836
66837 gh = fh;
66838 gl = fl;
66839
66840 fh = eh;
66841 fl = el;
66842
66843 eh = sum64_hi(dh, dl, T1_hi, T1_lo);
66844 el = sum64_lo(dl, dl, T1_hi, T1_lo);
66845
66846 dh = ch;
66847 dl = cl;
66848
66849 ch = bh;
66850 cl = bl;
66851
66852 bh = ah;
66853 bl = al;
66854
66855 ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);
66856 al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);
66857 }
66858
66859 sum64(this.h, 0, ah, al);
66860 sum64(this.h, 2, bh, bl);
66861 sum64(this.h, 4, ch, cl);
66862 sum64(this.h, 6, dh, dl);
66863 sum64(this.h, 8, eh, el);
66864 sum64(this.h, 10, fh, fl);
66865 sum64(this.h, 12, gh, gl);
66866 sum64(this.h, 14, hh, hl);
66867};
66868
66869SHA512.prototype._digest = function digest(enc) {
66870 if (enc === 'hex')
66871 return utils.toHex32(this.h, 'big');
66872 else
66873 return utils.split32(this.h, 'big');
66874};
66875
66876function SHA384() {
66877 if (!(this instanceof SHA384))
66878 return new SHA384();
66879
66880 SHA512.call(this);
66881 this.h = [ 0xcbbb9d5d, 0xc1059ed8,
66882 0x629a292a, 0x367cd507,
66883 0x9159015a, 0x3070dd17,
66884 0x152fecd8, 0xf70e5939,
66885 0x67332667, 0xffc00b31,
66886 0x8eb44a87, 0x68581511,
66887 0xdb0c2e0d, 0x64f98fa7,
66888 0x47b5481d, 0xbefa4fa4 ];
66889}
66890utils.inherits(SHA384, SHA512);
66891exports.sha384 = SHA384;
66892
66893SHA384.blockSize = 1024;
66894SHA384.outSize = 384;
66895SHA384.hmacStrength = 192;
66896SHA384.padLength = 128;
66897
66898SHA384.prototype._digest = function digest(enc) {
66899 if (enc === 'hex')
66900 return utils.toHex32(this.h.slice(0, 12), 'big');
66901 else
66902 return utils.split32(this.h.slice(0, 12), 'big');
66903};
66904
66905function SHA1() {
66906 if (!(this instanceof SHA1))
66907 return new SHA1();
66908
66909 BlockHash.call(this);
66910 this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe,
66911 0x10325476, 0xc3d2e1f0 ];
66912 this.W = new Array(80);
66913}
66914
66915utils.inherits(SHA1, BlockHash);
66916exports.sha1 = SHA1;
66917
66918SHA1.blockSize = 512;
66919SHA1.outSize = 160;
66920SHA1.hmacStrength = 80;
66921SHA1.padLength = 64;
66922
66923SHA1.prototype._update = function _update(msg, start) {
66924 var W = this.W;
66925
66926 for (var i = 0; i < 16; i++)
66927 W[i] = msg[start + i];
66928
66929 for(; i < W.length; i++)
66930 W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
66931
66932 var a = this.h[0];
66933 var b = this.h[1];
66934 var c = this.h[2];
66935 var d = this.h[3];
66936 var e = this.h[4];
66937
66938 for (var i = 0; i < W.length; i++) {
66939 var s = ~~(i / 20);
66940 var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
66941 e = d;
66942 d = c;
66943 c = rotl32(b, 30);
66944 b = a;
66945 a = t;
66946 }
66947
66948 this.h[0] = sum32(this.h[0], a);
66949 this.h[1] = sum32(this.h[1], b);
66950 this.h[2] = sum32(this.h[2], c);
66951 this.h[3] = sum32(this.h[3], d);
66952 this.h[4] = sum32(this.h[4], e);
66953};
66954
66955SHA1.prototype._digest = function digest(enc) {
66956 if (enc === 'hex')
66957 return utils.toHex32(this.h, 'big');
66958 else
66959 return utils.split32(this.h, 'big');
66960};
66961
66962function ch32(x, y, z) {
66963 return (x & y) ^ ((~x) & z);
66964}
66965
66966function maj32(x, y, z) {
66967 return (x & y) ^ (x & z) ^ (y & z);
66968}
66969
66970function p32(x, y, z) {
66971 return x ^ y ^ z;
66972}
66973
66974function s0_256(x) {
66975 return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
66976}
66977
66978function s1_256(x) {
66979 return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
66980}
66981
66982function g0_256(x) {
66983 return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
66984}
66985
66986function g1_256(x) {
66987 return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
66988}
66989
66990function ft_1(s, x, y, z) {
66991 if (s === 0)
66992 return ch32(x, y, z);
66993 if (s === 1 || s === 3)
66994 return p32(x, y, z);
66995 if (s === 2)
66996 return maj32(x, y, z);
66997}
66998
66999function ch64_hi(xh, xl, yh, yl, zh, zl) {
67000 var r = (xh & yh) ^ ((~xh) & zh);
67001 if (r < 0)
67002 r += 0x100000000;
67003 return r;
67004}
67005
67006function ch64_lo(xh, xl, yh, yl, zh, zl) {
67007 var r = (xl & yl) ^ ((~xl) & zl);
67008 if (r < 0)
67009 r += 0x100000000;
67010 return r;
67011}
67012
67013function maj64_hi(xh, xl, yh, yl, zh, zl) {
67014 var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);
67015 if (r < 0)
67016 r += 0x100000000;
67017 return r;
67018}
67019
67020function maj64_lo(xh, xl, yh, yl, zh, zl) {
67021 var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);
67022 if (r < 0)
67023 r += 0x100000000;
67024 return r;
67025}
67026
67027function s0_512_hi(xh, xl) {
67028 var c0_hi = rotr64_hi(xh, xl, 28);
67029 var c1_hi = rotr64_hi(xl, xh, 2); // 34
67030 var c2_hi = rotr64_hi(xl, xh, 7); // 39
67031
67032 var r = c0_hi ^ c1_hi ^ c2_hi;
67033 if (r < 0)
67034 r += 0x100000000;
67035 return r;
67036}
67037
67038function s0_512_lo(xh, xl) {
67039 var c0_lo = rotr64_lo(xh, xl, 28);
67040 var c1_lo = rotr64_lo(xl, xh, 2); // 34
67041 var c2_lo = rotr64_lo(xl, xh, 7); // 39
67042
67043 var r = c0_lo ^ c1_lo ^ c2_lo;
67044 if (r < 0)
67045 r += 0x100000000;
67046 return r;
67047}
67048
67049function s1_512_hi(xh, xl) {
67050 var c0_hi = rotr64_hi(xh, xl, 14);
67051 var c1_hi = rotr64_hi(xh, xl, 18);
67052 var c2_hi = rotr64_hi(xl, xh, 9); // 41
67053
67054 var r = c0_hi ^ c1_hi ^ c2_hi;
67055 if (r < 0)
67056 r += 0x100000000;
67057 return r;
67058}
67059
67060function s1_512_lo(xh, xl) {
67061 var c0_lo = rotr64_lo(xh, xl, 14);
67062 var c1_lo = rotr64_lo(xh, xl, 18);
67063 var c2_lo = rotr64_lo(xl, xh, 9); // 41
67064
67065 var r = c0_lo ^ c1_lo ^ c2_lo;
67066 if (r < 0)
67067 r += 0x100000000;
67068 return r;
67069}
67070
67071function g0_512_hi(xh, xl) {
67072 var c0_hi = rotr64_hi(xh, xl, 1);
67073 var c1_hi = rotr64_hi(xh, xl, 8);
67074 var c2_hi = shr64_hi(xh, xl, 7);
67075
67076 var r = c0_hi ^ c1_hi ^ c2_hi;
67077 if (r < 0)
67078 r += 0x100000000;
67079 return r;
67080}
67081
67082function g0_512_lo(xh, xl) {
67083 var c0_lo = rotr64_lo(xh, xl, 1);
67084 var c1_lo = rotr64_lo(xh, xl, 8);
67085 var c2_lo = shr64_lo(xh, xl, 7);
67086
67087 var r = c0_lo ^ c1_lo ^ c2_lo;
67088 if (r < 0)
67089 r += 0x100000000;
67090 return r;
67091}
67092
67093function g1_512_hi(xh, xl) {
67094 var c0_hi = rotr64_hi(xh, xl, 19);
67095 var c1_hi = rotr64_hi(xl, xh, 29); // 61
67096 var c2_hi = shr64_hi(xh, xl, 6);
67097
67098 var r = c0_hi ^ c1_hi ^ c2_hi;
67099 if (r < 0)
67100 r += 0x100000000;
67101 return r;
67102}
67103
67104function g1_512_lo(xh, xl) {
67105 var c0_lo = rotr64_lo(xh, xl, 19);
67106 var c1_lo = rotr64_lo(xl, xh, 29); // 61
67107 var c2_lo = shr64_lo(xh, xl, 6);
67108
67109 var r = c0_lo ^ c1_lo ^ c2_lo;
67110 if (r < 0)
67111 r += 0x100000000;
67112 return r;
67113}
67114
67115},{"../hash":57}],62:[function(require,module,exports){
67116var utils = exports;
67117var inherits = require('inherits');
67118
67119function toArray(msg, enc) {
67120 if (Array.isArray(msg))
67121 return msg.slice();
67122 if (!msg)
67123 return [];
67124 var res = [];
67125 if (typeof msg === 'string') {
67126 if (!enc) {
67127 for (var i = 0; i < msg.length; i++) {
67128 var c = msg.charCodeAt(i);
67129 var hi = c >> 8;
67130 var lo = c & 0xff;
67131 if (hi)
67132 res.push(hi, lo);
67133 else
67134 res.push(lo);
67135 }
67136 } else if (enc === 'hex') {
67137 msg = msg.replace(/[^a-z0-9]+/ig, '');
67138 if (msg.length % 2 !== 0)
67139 msg = '0' + msg;
67140 for (var i = 0; i < msg.length; i += 2)
67141 res.push(parseInt(msg[i] + msg[i + 1], 16));
67142 }
67143 } else {
67144 for (var i = 0; i < msg.length; i++)
67145 res[i] = msg[i] | 0;
67146 }
67147 return res;
67148}
67149utils.toArray = toArray;
67150
67151function toHex(msg) {
67152 var res = '';
67153 for (var i = 0; i < msg.length; i++)
67154 res += zero2(msg[i].toString(16));
67155 return res;
67156}
67157utils.toHex = toHex;
67158
67159function htonl(w) {
67160 var res = (w >>> 24) |
67161 ((w >>> 8) & 0xff00) |
67162 ((w << 8) & 0xff0000) |
67163 ((w & 0xff) << 24);
67164 return res >>> 0;
67165}
67166utils.htonl = htonl;
67167
67168function toHex32(msg, endian) {
67169 var res = '';
67170 for (var i = 0; i < msg.length; i++) {
67171 var w = msg[i];
67172 if (endian === 'little')
67173 w = htonl(w);
67174 res += zero8(w.toString(16));
67175 }
67176 return res;
67177}
67178utils.toHex32 = toHex32;
67179
67180function zero2(word) {
67181 if (word.length === 1)
67182 return '0' + word;
67183 else
67184 return word;
67185}
67186utils.zero2 = zero2;
67187
67188function zero8(word) {
67189 if (word.length === 7)
67190 return '0' + word;
67191 else if (word.length === 6)
67192 return '00' + word;
67193 else if (word.length === 5)
67194 return '000' + word;
67195 else if (word.length === 4)
67196 return '0000' + word;
67197 else if (word.length === 3)
67198 return '00000' + word;
67199 else if (word.length === 2)
67200 return '000000' + word;
67201 else if (word.length === 1)
67202 return '0000000' + word;
67203 else
67204 return word;
67205}
67206utils.zero8 = zero8;
67207
67208function join32(msg, start, end, endian) {
67209 var len = end - start;
67210 assert(len % 4 === 0);
67211 var res = new Array(len / 4);
67212 for (var i = 0, k = start; i < res.length; i++, k += 4) {
67213 var w;
67214 if (endian === 'big')
67215 w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
67216 else
67217 w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
67218 res[i] = w >>> 0;
67219 }
67220 return res;
67221}
67222utils.join32 = join32;
67223
67224function split32(msg, endian) {
67225 var res = new Array(msg.length * 4);
67226 for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
67227 var m = msg[i];
67228 if (endian === 'big') {
67229 res[k] = m >>> 24;
67230 res[k + 1] = (m >>> 16) & 0xff;
67231 res[k + 2] = (m >>> 8) & 0xff;
67232 res[k + 3] = m & 0xff;
67233 } else {
67234 res[k + 3] = m >>> 24;
67235 res[k + 2] = (m >>> 16) & 0xff;
67236 res[k + 1] = (m >>> 8) & 0xff;
67237 res[k] = m & 0xff;
67238 }
67239 }
67240 return res;
67241}
67242utils.split32 = split32;
67243
67244function rotr32(w, b) {
67245 return (w >>> b) | (w << (32 - b));
67246}
67247utils.rotr32 = rotr32;
67248
67249function rotl32(w, b) {
67250 return (w << b) | (w >>> (32 - b));
67251}
67252utils.rotl32 = rotl32;
67253
67254function sum32(a, b) {
67255 return (a + b) >>> 0;
67256}
67257utils.sum32 = sum32;
67258
67259function sum32_3(a, b, c) {
67260 return (a + b + c) >>> 0;
67261}
67262utils.sum32_3 = sum32_3;
67263
67264function sum32_4(a, b, c, d) {
67265 return (a + b + c + d) >>> 0;
67266}
67267utils.sum32_4 = sum32_4;
67268
67269function sum32_5(a, b, c, d, e) {
67270 return (a + b + c + d + e) >>> 0;
67271}
67272utils.sum32_5 = sum32_5;
67273
67274function assert(cond, msg) {
67275 if (!cond)
67276 throw new Error(msg || 'Assertion failed');
67277}
67278utils.assert = assert;
67279
67280utils.inherits = inherits;
67281
67282function sum64(buf, pos, ah, al) {
67283 var bh = buf[pos];
67284 var bl = buf[pos + 1];
67285
67286 var lo = (al + bl) >>> 0;
67287 var hi = (lo < al ? 1 : 0) + ah + bh;
67288 buf[pos] = hi >>> 0;
67289 buf[pos + 1] = lo;
67290}
67291exports.sum64 = sum64;
67292
67293function sum64_hi(ah, al, bh, bl) {
67294 var lo = (al + bl) >>> 0;
67295 var hi = (lo < al ? 1 : 0) + ah + bh;
67296 return hi >>> 0;
67297};
67298exports.sum64_hi = sum64_hi;
67299
67300function sum64_lo(ah, al, bh, bl) {
67301 var lo = al + bl;
67302 return lo >>> 0;
67303};
67304exports.sum64_lo = sum64_lo;
67305
67306function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
67307 var carry = 0;
67308 var lo = al;
67309 lo = (lo + bl) >>> 0;
67310 carry += lo < al ? 1 : 0;
67311 lo = (lo + cl) >>> 0;
67312 carry += lo < cl ? 1 : 0;
67313 lo = (lo + dl) >>> 0;
67314 carry += lo < dl ? 1 : 0;
67315
67316 var hi = ah + bh + ch + dh + carry;
67317 return hi >>> 0;
67318};
67319exports.sum64_4_hi = sum64_4_hi;
67320
67321function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
67322 var lo = al + bl + cl + dl;
67323 return lo >>> 0;
67324};
67325exports.sum64_4_lo = sum64_4_lo;
67326
67327function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
67328 var carry = 0;
67329 var lo = al;
67330 lo = (lo + bl) >>> 0;
67331 carry += lo < al ? 1 : 0;
67332 lo = (lo + cl) >>> 0;
67333 carry += lo < cl ? 1 : 0;
67334 lo = (lo + dl) >>> 0;
67335 carry += lo < dl ? 1 : 0;
67336 lo = (lo + el) >>> 0;
67337 carry += lo < el ? 1 : 0;
67338
67339 var hi = ah + bh + ch + dh + eh + carry;
67340 return hi >>> 0;
67341};
67342exports.sum64_5_hi = sum64_5_hi;
67343
67344function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
67345 var lo = al + bl + cl + dl + el;
67346
67347 return lo >>> 0;
67348};
67349exports.sum64_5_lo = sum64_5_lo;
67350
67351function rotr64_hi(ah, al, num) {
67352 var r = (al << (32 - num)) | (ah >>> num);
67353 return r >>> 0;
67354};
67355exports.rotr64_hi = rotr64_hi;
67356
67357function rotr64_lo(ah, al, num) {
67358 var r = (ah << (32 - num)) | (al >>> num);
67359 return r >>> 0;
67360};
67361exports.rotr64_lo = rotr64_lo;
67362
67363function shr64_hi(ah, al, num) {
67364 return ah >>> num;
67365};
67366exports.shr64_hi = shr64_hi;
67367
67368function shr64_lo(ah, al, num) {
67369 var r = (ah << (32 - num)) | (al >>> num);
67370 return r >>> 0;
67371};
67372exports.shr64_lo = shr64_lo;
67373
67374},{"inherits":63}],63:[function(require,module,exports){
67375arguments[4][9][0].apply(exports,arguments)
67376},{"dup":9}],64:[function(require,module,exports){
67377/**
67378 * Returns a `Boolean` on whether or not the a `String` starts with '0x'
67379 * @param {String} str the string input value
67380 * @return {Boolean} a boolean if it is or is not hex prefixed
67381 * @throws if the str input is not a string
67382 */
67383module.exports = function isHexPrefixed(str) {
67384 if (typeof str !== 'string') {
67385 throw new Error("[is-hex-prefixed] value must be type 'string', is currently type " + (typeof str) + ", while checking isHexPrefixed.");
67386 }
67387
67388 return str.slice(0, 2) === '0x';
67389}
67390
67391},{}],65:[function(require,module,exports){
67392'use strict'
67393module.exports = require('./lib/api')(require('./lib/keccak'))
67394
67395},{"./lib/api":66,"./lib/keccak":70}],66:[function(require,module,exports){
67396'use strict'
67397var createKeccak = require('./keccak')
67398var createShake = require('./shake')
67399
67400module.exports = function (KeccakState) {
67401 var Keccak = createKeccak(KeccakState)
67402 var Shake = createShake(KeccakState)
67403
67404 return function (algorithm, options) {
67405 var hash = typeof algorithm === 'string' ? algorithm.toLowerCase() : algorithm
67406 switch (hash) {
67407 case 'keccak224': return new Keccak(1152, 448, null, 224, options)
67408 case 'keccak256': return new Keccak(1088, 512, null, 256, options)
67409 case 'keccak384': return new Keccak(832, 768, null, 384, options)
67410 case 'keccak512': return new Keccak(576, 1024, null, 512, options)
67411
67412 case 'sha3-224': return new Keccak(1152, 448, 0x06, 224, options)
67413 case 'sha3-256': return new Keccak(1088, 512, 0x06, 256, options)
67414 case 'sha3-384': return new Keccak(832, 768, 0x06, 384, options)
67415 case 'sha3-512': return new Keccak(576, 1024, 0x06, 512, options)
67416
67417 case 'shake128': return new Shake(1344, 256, 0x1f, options)
67418 case 'shake256': return new Shake(1088, 512, 0x1f, options)
67419
67420 default: throw new Error('Invald algorithm: ' + algorithm)
67421 }
67422 }
67423}
67424
67425},{"./keccak":67,"./shake":68}],67:[function(require,module,exports){
67426(function (Buffer){
67427'use strict'
67428var Transform = require('stream').Transform
67429var inherits = require('inherits')
67430
67431module.exports = function (KeccakState) {
67432 function Keccak (rate, capacity, delimitedSuffix, hashBitLength, options) {
67433 Transform.call(this, options)
67434
67435 this._rate = rate
67436 this._capacity = capacity
67437 this._delimitedSuffix = delimitedSuffix
67438 this._hashBitLength = hashBitLength
67439 this._options = options
67440
67441 this._state = new KeccakState()
67442 this._state.initialize(rate, capacity)
67443 this._finalized = false
67444 }
67445
67446 inherits(Keccak, Transform)
67447
67448 Keccak.prototype._transform = function (chunk, encoding, callback) {
67449 var error = null
67450 try {
67451 this.update(chunk, encoding)
67452 } catch (err) {
67453 error = err
67454 }
67455
67456 callback(error)
67457 }
67458
67459 Keccak.prototype._flush = function (callback) {
67460 var error = null
67461 try {
67462 this.push(this.digest())
67463 } catch (err) {
67464 error = err
67465 }
67466
67467 callback(error)
67468 }
67469
67470 Keccak.prototype.update = function (data, encoding) {
67471 if (!Buffer.isBuffer(data) && typeof data !== 'string') throw new TypeError('Data must be a string or a buffer')
67472 if (this._finalized) throw new Error('Digest already called')
67473 if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)
67474
67475 this._state.absorb(data)
67476
67477 return this
67478 }
67479
67480 Keccak.prototype.digest = function (encoding) {
67481 if (this._finalized) throw new Error('Digest already called')
67482 this._finalized = true
67483
67484 if (this._delimitedSuffix) this._state.absorbLastFewBits(this._delimitedSuffix)
67485 var digest = this._state.squeeze(this._hashBitLength / 8)
67486 if (encoding !== undefined) digest = digest.toString(encoding)
67487
67488 this._resetState()
67489
67490 return digest
67491 }
67492
67493 // remove result from memory
67494 Keccak.prototype._resetState = function () {
67495 this._state.initialize(this._rate, this._capacity)
67496 return this
67497 }
67498
67499 // because sometimes we need hash right now and little later
67500 Keccak.prototype._clone = function () {
67501 var clone = new Keccak(this._rate, this._capacity, this._delimitedSuffix, this._hashBitLength, this._options)
67502 this._state.copy(clone._state)
67503 clone._finalized = this._finalized
67504
67505 return clone
67506 }
67507
67508 return Keccak
67509}
67510
67511}).call(this,require("buffer").Buffer)
67512},{"buffer":5,"inherits":63,"stream":25}],68:[function(require,module,exports){
67513(function (Buffer){
67514'use strict'
67515var Transform = require('stream').Transform
67516var inherits = require('inherits')
67517
67518module.exports = function (KeccakState) {
67519 function Shake (rate, capacity, delimitedSuffix, options) {
67520 Transform.call(this, options)
67521
67522 this._rate = rate
67523 this._capacity = capacity
67524 this._delimitedSuffix = delimitedSuffix
67525 this._options = options
67526
67527 this._state = new KeccakState()
67528 this._state.initialize(rate, capacity)
67529 this._finalized = false
67530 }
67531
67532 inherits(Shake, Transform)
67533
67534 Shake.prototype._transform = function (chunk, encoding, callback) {
67535 var error = null
67536 try {
67537 this.update(chunk, encoding)
67538 } catch (err) {
67539 error = err
67540 }
67541
67542 callback(error)
67543 }
67544
67545 Shake.prototype._flush = function () {}
67546
67547 Shake.prototype._read = function (size) {
67548 this.push(this.squeeze(size))
67549 }
67550
67551 Shake.prototype.update = function (data, encoding) {
67552 if (!Buffer.isBuffer(data) && typeof data !== 'string') throw new TypeError('Data must be a string or a buffer')
67553 if (this._finalized) throw new Error('Squeeze already called')
67554 if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)
67555
67556 this._state.absorb(data)
67557
67558 return this
67559 }
67560
67561 Shake.prototype.squeeze = function (dataByteLength, encoding) {
67562 if (!this._finalized) {
67563 this._finalized = true
67564 this._state.absorbLastFewBits(this._delimitedSuffix)
67565 }
67566
67567 var data = this._state.squeeze(dataByteLength)
67568 if (encoding !== undefined) data = data.toString(encoding)
67569
67570 return data
67571 }
67572
67573 Shake.prototype._resetState = function () {
67574 this._state.initialize(this._rate, this._capacity)
67575 return this
67576 }
67577
67578 Shake.prototype._clone = function () {
67579 var clone = new Shake(this._rate, this._capacity, this._delimitedSuffix, this._options)
67580 this._state.copy(clone._state)
67581 clone._finalized = this._finalized
67582
67583 return clone
67584 }
67585
67586 return Shake
67587}
67588
67589}).call(this,require("buffer").Buffer)
67590},{"buffer":5,"inherits":63,"stream":25}],69:[function(require,module,exports){
67591'use strict'
67592var P1600_ROUND_CONSTANTS = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648]
67593
67594exports.p1600 = function (s) {
67595 for (var round = 0; round < 24; ++round) {
67596 // theta
67597 var lo0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40]
67598 var hi0 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41]
67599 var lo1 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42]
67600 var hi1 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43]
67601 var lo2 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44]
67602 var hi2 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45]
67603 var lo3 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46]
67604 var hi3 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47]
67605 var lo4 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48]
67606 var hi4 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49]
67607
67608 var lo = lo4 ^ (lo1 << 1 | hi1 >>> 31)
67609 var hi = hi4 ^ (hi1 << 1 | lo1 >>> 31)
67610 var t1slo0 = s[0] ^ lo
67611 var t1shi0 = s[1] ^ hi
67612 var t1slo5 = s[10] ^ lo
67613 var t1shi5 = s[11] ^ hi
67614 var t1slo10 = s[20] ^ lo
67615 var t1shi10 = s[21] ^ hi
67616 var t1slo15 = s[30] ^ lo
67617 var t1shi15 = s[31] ^ hi
67618 var t1slo20 = s[40] ^ lo
67619 var t1shi20 = s[41] ^ hi
67620 lo = lo0 ^ (lo2 << 1 | hi2 >>> 31)
67621 hi = hi0 ^ (hi2 << 1 | lo2 >>> 31)
67622 var t1slo1 = s[2] ^ lo
67623 var t1shi1 = s[3] ^ hi
67624 var t1slo6 = s[12] ^ lo
67625 var t1shi6 = s[13] ^ hi
67626 var t1slo11 = s[22] ^ lo
67627 var t1shi11 = s[23] ^ hi
67628 var t1slo16 = s[32] ^ lo
67629 var t1shi16 = s[33] ^ hi
67630 var t1slo21 = s[42] ^ lo
67631 var t1shi21 = s[43] ^ hi
67632 lo = lo1 ^ (lo3 << 1 | hi3 >>> 31)
67633 hi = hi1 ^ (hi3 << 1 | lo3 >>> 31)
67634 var t1slo2 = s[4] ^ lo
67635 var t1shi2 = s[5] ^ hi
67636 var t1slo7 = s[14] ^ lo
67637 var t1shi7 = s[15] ^ hi
67638 var t1slo12 = s[24] ^ lo
67639 var t1shi12 = s[25] ^ hi
67640 var t1slo17 = s[34] ^ lo
67641 var t1shi17 = s[35] ^ hi
67642 var t1slo22 = s[44] ^ lo
67643 var t1shi22 = s[45] ^ hi
67644 lo = lo2 ^ (lo4 << 1 | hi4 >>> 31)
67645 hi = hi2 ^ (hi4 << 1 | lo4 >>> 31)
67646 var t1slo3 = s[6] ^ lo
67647 var t1shi3 = s[7] ^ hi
67648 var t1slo8 = s[16] ^ lo
67649 var t1shi8 = s[17] ^ hi
67650 var t1slo13 = s[26] ^ lo
67651 var t1shi13 = s[27] ^ hi
67652 var t1slo18 = s[36] ^ lo
67653 var t1shi18 = s[37] ^ hi
67654 var t1slo23 = s[46] ^ lo
67655 var t1shi23 = s[47] ^ hi
67656 lo = lo3 ^ (lo0 << 1 | hi0 >>> 31)
67657 hi = hi3 ^ (hi0 << 1 | lo0 >>> 31)
67658 var t1slo4 = s[8] ^ lo
67659 var t1shi4 = s[9] ^ hi
67660 var t1slo9 = s[18] ^ lo
67661 var t1shi9 = s[19] ^ hi
67662 var t1slo14 = s[28] ^ lo
67663 var t1shi14 = s[29] ^ hi
67664 var t1slo19 = s[38] ^ lo
67665 var t1shi19 = s[39] ^ hi
67666 var t1slo24 = s[48] ^ lo
67667 var t1shi24 = s[49] ^ hi
67668
67669 // rho & pi
67670 var t2slo0 = t1slo0
67671 var t2shi0 = t1shi0
67672 var t2slo16 = (t1shi5 << 4 | t1slo5 >>> 28)
67673 var t2shi16 = (t1slo5 << 4 | t1shi5 >>> 28)
67674 var t2slo7 = (t1slo10 << 3 | t1shi10 >>> 29)
67675 var t2shi7 = (t1shi10 << 3 | t1slo10 >>> 29)
67676 var t2slo23 = (t1shi15 << 9 | t1slo15 >>> 23)
67677 var t2shi23 = (t1slo15 << 9 | t1shi15 >>> 23)
67678 var t2slo14 = (t1slo20 << 18 | t1shi20 >>> 14)
67679 var t2shi14 = (t1shi20 << 18 | t1slo20 >>> 14)
67680 var t2slo10 = (t1slo1 << 1 | t1shi1 >>> 31)
67681 var t2shi10 = (t1shi1 << 1 | t1slo1 >>> 31)
67682 var t2slo1 = (t1shi6 << 12 | t1slo6 >>> 20)
67683 var t2shi1 = (t1slo6 << 12 | t1shi6 >>> 20)
67684 var t2slo17 = (t1slo11 << 10 | t1shi11 >>> 22)
67685 var t2shi17 = (t1shi11 << 10 | t1slo11 >>> 22)
67686 var t2slo8 = (t1shi16 << 13 | t1slo16 >>> 19)
67687 var t2shi8 = (t1slo16 << 13 | t1shi16 >>> 19)
67688 var t2slo24 = (t1slo21 << 2 | t1shi21 >>> 30)
67689 var t2shi24 = (t1shi21 << 2 | t1slo21 >>> 30)
67690 var t2slo20 = (t1shi2 << 30 | t1slo2 >>> 2)
67691 var t2shi20 = (t1slo2 << 30 | t1shi2 >>> 2)
67692 var t2slo11 = (t1slo7 << 6 | t1shi7 >>> 26)
67693 var t2shi11 = (t1shi7 << 6 | t1slo7 >>> 26)
67694 var t2slo2 = (t1shi12 << 11 | t1slo12 >>> 21)
67695 var t2shi2 = (t1slo12 << 11 | t1shi12 >>> 21)
67696 var t2slo18 = (t1slo17 << 15 | t1shi17 >>> 17)
67697 var t2shi18 = (t1shi17 << 15 | t1slo17 >>> 17)
67698 var t2slo9 = (t1shi22 << 29 | t1slo22 >>> 3)
67699 var t2shi9 = (t1slo22 << 29 | t1shi22 >>> 3)
67700 var t2slo5 = (t1slo3 << 28 | t1shi3 >>> 4)
67701 var t2shi5 = (t1shi3 << 28 | t1slo3 >>> 4)
67702 var t2slo21 = (t1shi8 << 23 | t1slo8 >>> 9)
67703 var t2shi21 = (t1slo8 << 23 | t1shi8 >>> 9)
67704 var t2slo12 = (t1slo13 << 25 | t1shi13 >>> 7)
67705 var t2shi12 = (t1shi13 << 25 | t1slo13 >>> 7)
67706 var t2slo3 = (t1slo18 << 21 | t1shi18 >>> 11)
67707 var t2shi3 = (t1shi18 << 21 | t1slo18 >>> 11)
67708 var t2slo19 = (t1shi23 << 24 | t1slo23 >>> 8)
67709 var t2shi19 = (t1slo23 << 24 | t1shi23 >>> 8)
67710 var t2slo15 = (t1slo4 << 27 | t1shi4 >>> 5)
67711 var t2shi15 = (t1shi4 << 27 | t1slo4 >>> 5)
67712 var t2slo6 = (t1slo9 << 20 | t1shi9 >>> 12)
67713 var t2shi6 = (t1shi9 << 20 | t1slo9 >>> 12)
67714 var t2slo22 = (t1shi14 << 7 | t1slo14 >>> 25)
67715 var t2shi22 = (t1slo14 << 7 | t1shi14 >>> 25)
67716 var t2slo13 = (t1slo19 << 8 | t1shi19 >>> 24)
67717 var t2shi13 = (t1shi19 << 8 | t1slo19 >>> 24)
67718 var t2slo4 = (t1slo24 << 14 | t1shi24 >>> 18)
67719 var t2shi4 = (t1shi24 << 14 | t1slo24 >>> 18)
67720
67721 // chi
67722 s[0] = t2slo0 ^ (~t2slo1 & t2slo2)
67723 s[1] = t2shi0 ^ (~t2shi1 & t2shi2)
67724 s[10] = t2slo5 ^ (~t2slo6 & t2slo7)
67725 s[11] = t2shi5 ^ (~t2shi6 & t2shi7)
67726 s[20] = t2slo10 ^ (~t2slo11 & t2slo12)
67727 s[21] = t2shi10 ^ (~t2shi11 & t2shi12)
67728 s[30] = t2slo15 ^ (~t2slo16 & t2slo17)
67729 s[31] = t2shi15 ^ (~t2shi16 & t2shi17)
67730 s[40] = t2slo20 ^ (~t2slo21 & t2slo22)
67731 s[41] = t2shi20 ^ (~t2shi21 & t2shi22)
67732 s[2] = t2slo1 ^ (~t2slo2 & t2slo3)
67733 s[3] = t2shi1 ^ (~t2shi2 & t2shi3)
67734 s[12] = t2slo6 ^ (~t2slo7 & t2slo8)
67735 s[13] = t2shi6 ^ (~t2shi7 & t2shi8)
67736 s[22] = t2slo11 ^ (~t2slo12 & t2slo13)
67737 s[23] = t2shi11 ^ (~t2shi12 & t2shi13)
67738 s[32] = t2slo16 ^ (~t2slo17 & t2slo18)
67739 s[33] = t2shi16 ^ (~t2shi17 & t2shi18)
67740 s[42] = t2slo21 ^ (~t2slo22 & t2slo23)
67741 s[43] = t2shi21 ^ (~t2shi22 & t2shi23)
67742 s[4] = t2slo2 ^ (~t2slo3 & t2slo4)
67743 s[5] = t2shi2 ^ (~t2shi3 & t2shi4)
67744 s[14] = t2slo7 ^ (~t2slo8 & t2slo9)
67745 s[15] = t2shi7 ^ (~t2shi8 & t2shi9)
67746 s[24] = t2slo12 ^ (~t2slo13 & t2slo14)
67747 s[25] = t2shi12 ^ (~t2shi13 & t2shi14)
67748 s[34] = t2slo17 ^ (~t2slo18 & t2slo19)
67749 s[35] = t2shi17 ^ (~t2shi18 & t2shi19)
67750 s[44] = t2slo22 ^ (~t2slo23 & t2slo24)
67751 s[45] = t2shi22 ^ (~t2shi23 & t2shi24)
67752 s[6] = t2slo3 ^ (~t2slo4 & t2slo0)
67753 s[7] = t2shi3 ^ (~t2shi4 & t2shi0)
67754 s[16] = t2slo8 ^ (~t2slo9 & t2slo5)
67755 s[17] = t2shi8 ^ (~t2shi9 & t2shi5)
67756 s[26] = t2slo13 ^ (~t2slo14 & t2slo10)
67757 s[27] = t2shi13 ^ (~t2shi14 & t2shi10)
67758 s[36] = t2slo18 ^ (~t2slo19 & t2slo15)
67759 s[37] = t2shi18 ^ (~t2shi19 & t2shi15)
67760 s[46] = t2slo23 ^ (~t2slo24 & t2slo20)
67761 s[47] = t2shi23 ^ (~t2shi24 & t2shi20)
67762 s[8] = t2slo4 ^ (~t2slo0 & t2slo1)
67763 s[9] = t2shi4 ^ (~t2shi0 & t2shi1)
67764 s[18] = t2slo9 ^ (~t2slo5 & t2slo6)
67765 s[19] = t2shi9 ^ (~t2shi5 & t2shi6)
67766 s[28] = t2slo14 ^ (~t2slo10 & t2slo11)
67767 s[29] = t2shi14 ^ (~t2shi10 & t2shi11)
67768 s[38] = t2slo19 ^ (~t2slo15 & t2slo16)
67769 s[39] = t2shi19 ^ (~t2shi15 & t2shi16)
67770 s[48] = t2slo24 ^ (~t2slo20 & t2slo21)
67771 s[49] = t2shi24 ^ (~t2shi20 & t2shi21)
67772
67773 // iota
67774 s[0] ^= P1600_ROUND_CONSTANTS[round * 2]
67775 s[1] ^= P1600_ROUND_CONSTANTS[round * 2 + 1]
67776 }
67777}
67778
67779},{}],70:[function(require,module,exports){
67780(function (Buffer){
67781'use strict'
67782var keccakState = require('./keccak-state-unroll')
67783
67784function Keccak () {
67785 // much faster than `new Array(50)`
67786 this.state = [
67787 0, 0, 0, 0, 0,
67788 0, 0, 0, 0, 0,
67789 0, 0, 0, 0, 0,
67790 0, 0, 0, 0, 0,
67791 0, 0, 0, 0, 0
67792 ]
67793
67794 this.blockSize = null
67795 this.count = 0
67796 this.squeezing = false
67797}
67798
67799Keccak.prototype.initialize = function (rate, capacity) {
67800 for (var i = 0; i < 50; ++i) this.state[i] = 0
67801 this.blockSize = rate / 8
67802 this.count = 0
67803 this.squeezing = false
67804}
67805
67806Keccak.prototype.absorb = function (data) {
67807 for (var i = 0; i < data.length; ++i) {
67808 this.state[~~(this.count / 4)] ^= data[i] << (8 * (this.count % 4))
67809 this.count += 1
67810 if (this.count === this.blockSize) {
67811 keccakState.p1600(this.state)
67812 this.count = 0
67813 }
67814 }
67815}
67816
67817Keccak.prototype.absorbLastFewBits = function (bits) {
67818 this.state[~~(this.count / 4)] ^= bits << (8 * (this.count % 4))
67819 if ((bits & 0x80) !== 0 && this.count === (this.blockSize - 1)) keccakState.p1600(this.state)
67820 this.state[~~((this.blockSize - 1) / 4)] ^= 0x80 << (8 * ((this.blockSize - 1) % 4))
67821 keccakState.p1600(this.state)
67822 this.count = 0
67823 this.squeezing = true
67824}
67825
67826Keccak.prototype.squeeze = function (length) {
67827 if (!this.squeezing) this.absorbLastFewBits(0x01)
67828
67829 var output = Buffer.allocUnsafe(length)
67830 for (var i = 0; i < length; ++i) {
67831 output[i] = (this.state[~~(this.count / 4)] >>> (8 * (this.count % 4))) & 0xff
67832 this.count += 1
67833 if (this.count === this.blockSize) {
67834 keccakState.p1600(this.state)
67835 this.count = 0
67836 }
67837 }
67838
67839 return output
67840}
67841
67842Keccak.prototype.copy = function (dest) {
67843 for (var i = 0; i < 50; ++i) dest.state[i] = this.state[i]
67844 dest.blockSize = this.blockSize
67845 dest.count = this.count
67846 dest.squeezing = this.squeezing
67847}
67848
67849module.exports = Keccak
67850
67851}).call(this,require("buffer").Buffer)
67852},{"./keccak-state-unroll":69,"buffer":5}],71:[function(require,module,exports){
67853(function (Buffer){
67854/*
67855CryptoJS v3.1.2
67856code.google.com/p/crypto-js
67857(c) 2009-2013 by Jeff Mott. All rights reserved.
67858code.google.com/p/crypto-js/wiki/License
67859*/
67860/** @preserve
67861(c) 2012 by Cédric Mesnil. All rights reserved.
67862
67863Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
67864
67865 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
67866 - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
67867
67868THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67869*/
67870
67871// constants table
67872var zl = [
67873 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
67874 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
67875 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
67876 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
67877 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
67878]
67879
67880var zr = [
67881 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
67882 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
67883 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
67884 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
67885 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
67886]
67887
67888var sl = [
67889 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
67890 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
67891 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
67892 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
67893 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
67894]
67895
67896var sr = [
67897 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
67898 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
67899 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
67900 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
67901 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
67902]
67903
67904var hl = [0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]
67905var hr = [0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]
67906
67907function bytesToWords (bytes) {
67908 var words = []
67909 for (var i = 0, b = 0; i < bytes.length; i++, b += 8) {
67910 words[b >>> 5] |= bytes[i] << (24 - b % 32)
67911 }
67912 return words
67913}
67914
67915function wordsToBytes (words) {
67916 var bytes = []
67917 for (var b = 0; b < words.length * 32; b += 8) {
67918 bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF)
67919 }
67920 return bytes
67921}
67922
67923function processBlock (H, M, offset) {
67924 // swap endian
67925 for (var i = 0; i < 16; i++) {
67926 var offset_i = offset + i
67927 var M_offset_i = M[offset_i]
67928
67929 // Swap
67930 M[offset_i] = (
67931 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
67932 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
67933 )
67934 }
67935
67936 // Working variables
67937 var al, bl, cl, dl, el
67938 var ar, br, cr, dr, er
67939
67940 ar = al = H[0]
67941 br = bl = H[1]
67942 cr = cl = H[2]
67943 dr = dl = H[3]
67944 er = el = H[4]
67945
67946 // computation
67947 var t
67948 for (i = 0; i < 80; i += 1) {
67949 t = (al + M[offset + zl[i]]) | 0
67950 if (i < 16) {
67951 t += f1(bl, cl, dl) + hl[0]
67952 } else if (i < 32) {
67953 t += f2(bl, cl, dl) + hl[1]
67954 } else if (i < 48) {
67955 t += f3(bl, cl, dl) + hl[2]
67956 } else if (i < 64) {
67957 t += f4(bl, cl, dl) + hl[3]
67958 } else {// if (i<80) {
67959 t += f5(bl, cl, dl) + hl[4]
67960 }
67961 t = t | 0
67962 t = rotl(t, sl[i])
67963 t = (t + el) | 0
67964 al = el
67965 el = dl
67966 dl = rotl(cl, 10)
67967 cl = bl
67968 bl = t
67969
67970 t = (ar + M[offset + zr[i]]) | 0
67971 if (i < 16) {
67972 t += f5(br, cr, dr) + hr[0]
67973 } else if (i < 32) {
67974 t += f4(br, cr, dr) + hr[1]
67975 } else if (i < 48) {
67976 t += f3(br, cr, dr) + hr[2]
67977 } else if (i < 64) {
67978 t += f2(br, cr, dr) + hr[3]
67979 } else {// if (i<80) {
67980 t += f1(br, cr, dr) + hr[4]
67981 }
67982
67983 t = t | 0
67984 t = rotl(t, sr[i])
67985 t = (t + er) | 0
67986 ar = er
67987 er = dr
67988 dr = rotl(cr, 10)
67989 cr = br
67990 br = t
67991 }
67992
67993 // intermediate hash value
67994 t = (H[1] + cl + dr) | 0
67995 H[1] = (H[2] + dl + er) | 0
67996 H[2] = (H[3] + el + ar) | 0
67997 H[3] = (H[4] + al + br) | 0
67998 H[4] = (H[0] + bl + cr) | 0
67999 H[0] = t
68000}
68001
68002function f1 (x, y, z) {
68003 return ((x) ^ (y) ^ (z))
68004}
68005
68006function f2 (x, y, z) {
68007 return (((x) & (y)) | ((~x) & (z)))
68008}
68009
68010function f3 (x, y, z) {
68011 return (((x) | (~(y))) ^ (z))
68012}
68013
68014function f4 (x, y, z) {
68015 return (((x) & (z)) | ((y) & (~(z))))
68016}
68017
68018function f5 (x, y, z) {
68019 return ((x) ^ ((y) | (~(z))))
68020}
68021
68022function rotl (x, n) {
68023 return (x << n) | (x >>> (32 - n))
68024}
68025
68026function ripemd160 (message) {
68027 var H = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]
68028
68029 if (typeof message === 'string') {
68030 message = new Buffer(message, 'utf8')
68031 }
68032
68033 var m = bytesToWords(message)
68034
68035 var nBitsLeft = message.length * 8
68036 var nBitsTotal = message.length * 8
68037
68038 // Add padding
68039 m[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32)
68040 m[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
68041 (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
68042 (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
68043 )
68044
68045 for (var i = 0; i < m.length; i += 16) {
68046 processBlock(H, m, i)
68047 }
68048
68049 // swap endian
68050 for (i = 0; i < 5; i++) {
68051 // shortcut
68052 var H_i = H[i]
68053
68054 // Swap
68055 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
68056 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00)
68057 }
68058
68059 var digestbytes = wordsToBytes(H)
68060 return new Buffer(digestbytes)
68061}
68062
68063module.exports = ripemd160
68064
68065}).call(this,require("buffer").Buffer)
68066},{"buffer":5}],72:[function(require,module,exports){
68067(function (Buffer){
68068const assert = require('assert')
68069/**
68070 * RLP Encoding based on: https://github.com/ethereum/wiki/wiki/%5BEnglish%5D-RLP
68071 * This function takes in a data, convert it to buffer if not, and a length for recursion
68072 *
68073 * @param {Buffer,String,Integer,Array} data - will be converted to buffer
68074 * @returns {Buffer} - returns buffer of encoded data
68075 **/
68076exports.encode = function (input) {
68077 if (input instanceof Array) {
68078 var output = []
68079 for (var i = 0; i < input.length; i++) {
68080 output.push(exports.encode(input[i]))
68081 }
68082 var buf = Buffer.concat(output)
68083 return Buffer.concat([encodeLength(buf.length, 192), buf])
68084 } else {
68085 input = toBuffer(input)
68086 if (input.length === 1 && input[0] < 128) {
68087 return input
68088 } else {
68089 return Buffer.concat([encodeLength(input.length, 128), input])
68090 }
68091 }
68092}
68093
68094function safeParseInt (v, base) {
68095 if (v.slice(0, 2) === '00') {
68096 throw (new Error('invalid RLP: extra zeros'))
68097 }
68098
68099 return parseInt(v, base)
68100}
68101
68102function encodeLength (len, offset) {
68103 if (len < 56) {
68104 return new Buffer([len + offset])
68105 } else {
68106 var hexLength = intToHex(len)
68107 var lLength = hexLength.length / 2
68108 var firstByte = intToHex(offset + 55 + lLength)
68109 return new Buffer(firstByte + hexLength, 'hex')
68110 }
68111}
68112
68113/**
68114 * RLP Decoding based on: {@link https://github.com/ethereum/wiki/wiki/%5BEnglish%5D-RLP|RLP}
68115 * @param {Buffer,String,Integer,Array} data - will be converted to buffer
68116 * @returns {Array} - returns decode Array of Buffers containg the original message
68117 **/
68118exports.decode = function (input, stream) {
68119 if (!input || input.length === 0) {
68120 return new Buffer([])
68121 }
68122
68123 input = toBuffer(input)
68124 var decoded = _decode(input)
68125
68126 if (stream) {
68127 return decoded
68128 }
68129
68130 assert.equal(decoded.remainder.length, 0, 'invalid remainder')
68131 return decoded.data
68132}
68133
68134exports.getLength = function (input) {
68135 if (!input || input.length === 0) {
68136 return new Buffer([])
68137 }
68138
68139 input = toBuffer(input)
68140 var firstByte = input[0]
68141 if (firstByte <= 0x7f) {
68142 return input.length
68143 } else if (firstByte <= 0xb7) {
68144 return firstByte - 0x7f
68145 } else if (firstByte <= 0xbf) {
68146 return firstByte - 0xb6
68147 } else if (firstByte <= 0xf7) {
68148 // a list between 0-55 bytes long
68149 return firstByte - 0xbf
68150 } else {
68151 // a list over 55 bytes long
68152 var llength = firstByte - 0xf6
68153 var length = safeParseInt(input.slice(1, llength).toString('hex'), 16)
68154 return llength + length
68155 }
68156}
68157
68158function _decode (input) {
68159 var length, llength, data, innerRemainder, d
68160 var decoded = []
68161 var firstByte = input[0]
68162
68163 if (firstByte <= 0x7f) {
68164 // a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.
68165 return {
68166 data: input.slice(0, 1),
68167 remainder: input.slice(1)
68168 }
68169 } else if (firstByte <= 0xb7) {
68170 // string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string
68171 // The range of the first byte is [0x80, 0xb7]
68172 length = firstByte - 0x7f
68173
68174 // set 0x80 null to 0
68175 if (firstByte === 0x80) {
68176 data = new Buffer([])
68177 } else {
68178 data = input.slice(1, length)
68179 }
68180
68181 if (length === 2 && data[0] < 0x80) {
68182 throw new Error('invalid rlp encoding: byte must be less 0x80')
68183 }
68184
68185 return {
68186 data: data,
68187 remainder: input.slice(length)
68188 }
68189 } else if (firstByte <= 0xbf) {
68190 llength = firstByte - 0xb6
68191 length = safeParseInt(input.slice(1, llength).toString('hex'), 16)
68192 data = input.slice(llength, length + llength)
68193 if (data.length < length) {
68194 throw (new Error('invalid RLP'))
68195 }
68196
68197 return {
68198 data: data,
68199 remainder: input.slice(length + llength)
68200 }
68201 } else if (firstByte <= 0xf7) {
68202 // a list between 0-55 bytes long
68203 length = firstByte - 0xbf
68204 innerRemainder = input.slice(1, length)
68205 while (innerRemainder.length) {
68206 d = _decode(innerRemainder)
68207 decoded.push(d.data)
68208 innerRemainder = d.remainder
68209 }
68210
68211 return {
68212 data: decoded,
68213 remainder: input.slice(length)
68214 }
68215 } else {
68216 // a list over 55 bytes long
68217 llength = firstByte - 0xf6
68218 length = safeParseInt(input.slice(1, llength).toString('hex'), 16)
68219 var totalLength = llength + length
68220 if (totalLength > input.length) {
68221 throw new Error('invalid rlp: total length is larger than the data')
68222 }
68223
68224 innerRemainder = input.slice(llength, totalLength)
68225 if (innerRemainder.length === 0) {
68226 throw new Error('invalid rlp, List has a invalid length')
68227 }
68228
68229 while (innerRemainder.length) {
68230 d = _decode(innerRemainder)
68231 decoded.push(d.data)
68232 innerRemainder = d.remainder
68233 }
68234 return {
68235 data: decoded,
68236 remainder: input.slice(totalLength)
68237 }
68238 }
68239}
68240
68241function isHexPrefixed (str) {
68242 return str.slice(0, 2) === '0x'
68243}
68244
68245// Removes 0x from a given String
68246function stripHexPrefix (str) {
68247 if (typeof str !== 'string') {
68248 return str
68249 }
68250 return isHexPrefixed(str) ? str.slice(2) : str
68251}
68252
68253function intToHex (i) {
68254 var hex = i.toString(16)
68255 if (hex.length % 2) {
68256 hex = '0' + hex
68257 }
68258
68259 return hex
68260}
68261
68262function padToEven (a) {
68263 if (a.length % 2) a = '0' + a
68264 return a
68265}
68266
68267function intToBuffer (i) {
68268 var hex = intToHex(i)
68269 return new Buffer(hex, 'hex')
68270}
68271
68272function toBuffer (v) {
68273 if (!Buffer.isBuffer(v)) {
68274 if (typeof v === 'string') {
68275 if (isHexPrefixed(v)) {
68276 v = new Buffer(padToEven(stripHexPrefix(v)), 'hex')
68277 } else {
68278 v = new Buffer(v)
68279 }
68280 } else if (typeof v === 'number') {
68281 if (!v) {
68282 v = new Buffer([])
68283 } else {
68284 v = intToBuffer(v)
68285 }
68286 } else if (v === null || v === undefined) {
68287 v = new Buffer([])
68288 } else if (v.toArray) {
68289 // converts a BN to a Buffer
68290 v = new Buffer(v.toArray())
68291 } else {
68292 throw new Error('invalid type')
68293 }
68294 }
68295 return v
68296}
68297
68298}).call(this,require("buffer").Buffer)
68299},{"assert":1,"buffer":5}],73:[function(require,module,exports){
68300'use strict'
68301module.exports = require('./lib')(require('./lib/elliptic'))
68302
68303},{"./lib":77,"./lib/elliptic":76}],74:[function(require,module,exports){
68304(function (Buffer){
68305'use strict'
68306var toString = Object.prototype.toString
68307
68308// TypeError
68309exports.isArray = function (value, message) {
68310 if (!Array.isArray(value)) throw TypeError(message)
68311}
68312
68313exports.isBoolean = function (value, message) {
68314 if (toString.call(value) !== '[object Boolean]') throw TypeError(message)
68315}
68316
68317exports.isBuffer = function (value, message) {
68318 if (!Buffer.isBuffer(value)) throw TypeError(message)
68319}
68320
68321exports.isFunction = function (value, message) {
68322 if (toString.call(value) !== '[object Function]') throw TypeError(message)
68323}
68324
68325exports.isNumber = function (value, message) {
68326 if (toString.call(value) !== '[object Number]') throw TypeError(message)
68327}
68328
68329exports.isObject = function (value, message) {
68330 if (toString.call(value) !== '[object Object]') throw TypeError(message)
68331}
68332
68333// RangeError
68334exports.isBufferLength = function (buffer, length, message) {
68335 if (buffer.length !== length) throw RangeError(message)
68336}
68337
68338exports.isBufferLength2 = function (buffer, length1, length2, message) {
68339 if (buffer.length !== length1 && buffer.length !== length2) throw RangeError(message)
68340}
68341
68342exports.isLengthGTZero = function (value, message) {
68343 if (value.length === 0) throw RangeError(message)
68344}
68345
68346exports.isNumberInInterval = function (number, x, y, message) {
68347 if (number <= x || number >= y) throw RangeError(message)
68348}
68349
68350}).call(this,{"isBuffer":require("../../../../../.nvm/versions/node/v7.5.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")})
68351},{"../../../../../.nvm/versions/node/v7.5.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":10}],75:[function(require,module,exports){
68352(function (Buffer){
68353'use strict'
68354var bip66 = require('bip66')
68355
68356var EC_PRIVKEY_EXPORT_DER_COMPRESSED = new Buffer([
68357 // begin
68358 0x30, 0x81, 0xd3, 0x02, 0x01, 0x01, 0x04, 0x20,
68359 // private key
68360 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68361 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68362 // middle
68363 0xa0, 0x81, 0x85, 0x30, 0x81, 0x82, 0x02, 0x01, 0x01, 0x30, 0x2c, 0x06, 0x07, 0x2a, 0x86, 0x48,
68364 0xcE, 0x3d, 0x01, 0x01, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
68365 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
68366 0xff, 0xff, 0xfE, 0xff, 0xff, 0xfc, 0x2f, 0x30, 0x06, 0x04, 0x01, 0x00, 0x04, 0x01, 0x07, 0x04,
68367 0x21, 0x02, 0x79, 0xbE, 0x66, 0x7E, 0xf9, 0xdc, 0xbb, 0xac, 0x55, 0xa0, 0x62, 0x95, 0xcE, 0x87,
68368 0x0b, 0x07, 0x02, 0x9b, 0xfc, 0xdb, 0x2d, 0xcE, 0x28, 0xd9, 0x59, 0xf2, 0x81, 0x5b, 0x16, 0xf8,
68369 0x17, 0x98, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
68370 0xff, 0xff, 0xff, 0xff, 0xfE, 0xba, 0xaE, 0xdc, 0xE6, 0xaf, 0x48, 0xa0, 0x3b, 0xbf, 0xd2, 0x5E,
68371 0x8c, 0xd0, 0x36, 0x41, 0x41, 0x02, 0x01, 0x01, 0xa1, 0x24, 0x03, 0x22, 0x00,
68372 // public key
68373 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68374 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68375 0x00
68376])
68377
68378var EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED = new Buffer([
68379 // begin
68380 0x30, 0x82, 0x01, 0x13, 0x02, 0x01, 0x01, 0x04, 0x20,
68381 // private key
68382 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68383 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68384 // middle
68385 0xa0, 0x81, 0xa5, 0x30, 0x81, 0xa2, 0x02, 0x01, 0x01, 0x30, 0x2c, 0x06, 0x07, 0x2a, 0x86, 0x48,
68386 0xcE, 0x3d, 0x01, 0x01, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
68387 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
68388 0xff, 0xff, 0xfE, 0xff, 0xff, 0xfc, 0x2f, 0x30, 0x06, 0x04, 0x01, 0x00, 0x04, 0x01, 0x07, 0x04,
68389 0x41, 0x04, 0x79, 0xbE, 0x66, 0x7E, 0xf9, 0xdc, 0xbb, 0xac, 0x55, 0xa0, 0x62, 0x95, 0xcE, 0x87,
68390 0x0b, 0x07, 0x02, 0x9b, 0xfc, 0xdb, 0x2d, 0xcE, 0x28, 0xd9, 0x59, 0xf2, 0x81, 0x5b, 0x16, 0xf8,
68391 0x17, 0x98, 0x48, 0x3a, 0xda, 0x77, 0x26, 0xa3, 0xc4, 0x65, 0x5d, 0xa4, 0xfb, 0xfc, 0x0E, 0x11,
68392 0x08, 0xa8, 0xfd, 0x17, 0xb4, 0x48, 0xa6, 0x85, 0x54, 0x19, 0x9c, 0x47, 0xd0, 0x8f, 0xfb, 0x10,
68393 0xd4, 0xb8, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
68394 0xff, 0xff, 0xff, 0xff, 0xfE, 0xba, 0xaE, 0xdc, 0xE6, 0xaf, 0x48, 0xa0, 0x3b, 0xbf, 0xd2, 0x5E,
68395 0x8c, 0xd0, 0x36, 0x41, 0x41, 0x02, 0x01, 0x01, 0xa1, 0x44, 0x03, 0x42, 0x00,
68396 // public key
68397 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68398 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68399 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68400 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68401 0x00
68402])
68403
68404var ZERO_BUFFER_32 = new Buffer([
68405 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68406 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
68407])
68408
68409exports.privateKeyExport = function (privateKey, publicKey, compressed) {
68410 var result = new Buffer(compressed ? EC_PRIVKEY_EXPORT_DER_COMPRESSED : EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED)
68411 privateKey.copy(result, compressed ? 8 : 9)
68412 publicKey.copy(result, compressed ? 181 : 214)
68413 return result
68414}
68415
68416exports.privateKeyImport = function (privateKey) {
68417 var length = privateKey.length
68418
68419 // sequence header
68420 var index = 0
68421 if (length < index + 1 || privateKey[index] !== 0x30) return
68422 index += 1
68423
68424 // sequence length constructor
68425 if (length < index + 1 || !(privateKey[index] & 0x80)) return
68426
68427 var lenb = privateKey[index] & 0x7f
68428 index += 1
68429 if (lenb < 1 || lenb > 2) return
68430 if (length < index + lenb) return
68431
68432 // sequence length
68433 var len = privateKey[index + lenb - 1] | (lenb > 1 ? privateKey[index + lenb - 2] << 8 : 0)
68434 index += lenb
68435 if (length < index + len) return
68436
68437 // sequence element 0: version number (=1)
68438 if (length < index + 3 ||
68439 privateKey[index] !== 0x02 ||
68440 privateKey[index + 1] !== 0x01 ||
68441 privateKey[index + 2] !== 0x01) {
68442 return
68443 }
68444 index += 3
68445
68446 // sequence element 1: octet string, up to 32 bytes
68447 if (length < index + 2 ||
68448 privateKey[index] !== 0x04 ||
68449 privateKey[index + 1] > 0x20 ||
68450 length < index + 2 + privateKey[index + 1]) {
68451 return
68452 }
68453
68454 return privateKey.slice(index + 2, index + 2 + privateKey[index + 1])
68455}
68456
68457exports.signatureExport = function (sigObj) {
68458 var r = Buffer.concat([new Buffer([0]), sigObj.r])
68459 for (var lenR = 33, posR = 0; lenR > 1 && r[posR] === 0x00 && !(r[posR + 1] & 0x80); --lenR, ++posR);
68460
68461 var s = Buffer.concat([new Buffer([0]), sigObj.s])
68462 for (var lenS = 33, posS = 0; lenS > 1 && s[posS] === 0x00 && !(s[posS + 1] & 0x80); --lenS, ++posS);
68463
68464 return bip66.encode(r.slice(posR), s.slice(posS))
68465}
68466
68467exports.signatureImport = function (sig) {
68468 var r = new Buffer(ZERO_BUFFER_32)
68469 var s = new Buffer(ZERO_BUFFER_32)
68470
68471 try {
68472 var sigObj = bip66.decode(sig)
68473 if (sigObj.r.length === 33 && sigObj.r[0] === 0x00) sigObj.r = sigObj.r.slice(1)
68474 if (sigObj.r.length > 32) throw new Error('R length is too long')
68475 if (sigObj.s.length === 33 && sigObj.s[0] === 0x00) sigObj.s = sigObj.s.slice(1)
68476 if (sigObj.s.length > 32) throw new Error('S length is too long')
68477 } catch (err) {
68478 return
68479 }
68480
68481 sigObj.r.copy(r, 32 - sigObj.r.length)
68482 sigObj.s.copy(s, 32 - sigObj.s.length)
68483
68484 return { r: r, s: s }
68485}
68486
68487exports.signatureImportLax = function (sig) {
68488 var r = new Buffer(ZERO_BUFFER_32)
68489 var s = new Buffer(ZERO_BUFFER_32)
68490
68491 var length = sig.length
68492 var index = 0
68493
68494 // sequence tag byte
68495 if (sig[index++] !== 0x30) return
68496
68497 // sequence length byte
68498 var lenbyte = sig[index++]
68499 if (lenbyte & 0x80) {
68500 index += lenbyte - 0x80
68501 if (index > length) return
68502 }
68503
68504 // sequence tag byte for r
68505 if (sig[index++] !== 0x02) return
68506
68507 // length for r
68508 var rlen = sig[index++]
68509 if (rlen & 0x80) {
68510 lenbyte = rlen - 0x80
68511 if (index + lenbyte > length) return
68512 for (; lenbyte > 0 && sig[index] === 0x00; index += 1, lenbyte -= 1);
68513 for (rlen = 0; lenbyte > 0; index += 1, lenbyte -= 1) rlen = (rlen << 8) + sig[index]
68514 }
68515 if (rlen > length - index) return
68516 var rindex = index
68517 index += rlen
68518
68519 // sequence tag byte for s
68520 if (sig[index++] !== 0x02) return
68521
68522 // length for s
68523 var slen = sig[index++]
68524 if (slen & 0x80) {
68525 lenbyte = slen - 0x80
68526 if (index + lenbyte > length) return
68527 for (; lenbyte > 0 && sig[index] === 0x00; index += 1, lenbyte -= 1);
68528 for (slen = 0; lenbyte > 0; index += 1, lenbyte -= 1) slen = (slen << 8) + sig[index]
68529 }
68530 if (slen > length - index) return
68531 var sindex = index
68532 index += slen
68533
68534 // ignore leading zeros in r
68535 for (; rlen > 0 && sig[rindex] === 0x00; rlen -= 1, rindex += 1);
68536 // copy r value
68537 if (rlen > 32) return
68538 var rvalue = sig.slice(rindex, rindex + rlen)
68539 rvalue.copy(r, 32 - rvalue.length)
68540
68541 // ignore leading zeros in s
68542 for (; slen > 0 && sig[sindex] === 0x00; slen -= 1, sindex += 1);
68543 // copy s value
68544 if (slen > 32) return
68545 var svalue = sig.slice(sindex, sindex + slen)
68546 svalue.copy(s, 32 - svalue.length)
68547
68548 return { r: r, s: s }
68549}
68550
68551}).call(this,require("buffer").Buffer)
68552},{"bip66":32,"buffer":5}],76:[function(require,module,exports){
68553(function (Buffer){
68554'use strict'
68555var createHash = require('create-hash')
68556var BN = require('bn.js')
68557var EC = require('elliptic').ec
68558
68559var messages = require('../messages.json')
68560
68561var ec = new EC('secp256k1')
68562var ecparams = ec.curve
68563
68564function loadCompressedPublicKey (first, xBuffer) {
68565 var x = new BN(xBuffer)
68566
68567 // overflow
68568 if (x.cmp(ecparams.p) >= 0) return null
68569 x = x.toRed(ecparams.red)
68570
68571 // compute corresponding Y
68572 var y = x.redSqr().redIMul(x).redIAdd(ecparams.b).redSqrt()
68573 if ((first === 0x03) !== y.isOdd()) y = y.redNeg()
68574
68575 return ec.keyPair({ pub: { x: x, y: y } })
68576}
68577
68578function loadUncompressedPublicKey (first, xBuffer, yBuffer) {
68579 var x = new BN(xBuffer)
68580 var y = new BN(yBuffer)
68581
68582 // overflow
68583 if (x.cmp(ecparams.p) >= 0 || y.cmp(ecparams.p) >= 0) return null
68584
68585 x = x.toRed(ecparams.red)
68586 y = y.toRed(ecparams.red)
68587
68588 // is odd flag
68589 if ((first === 0x06 || first === 0x07) && y.isOdd() !== (first === 0x07)) return null
68590
68591 // x*x*x + b = y*y
68592 var x3 = x.redSqr().redIMul(x)
68593 if (!y.redSqr().redISub(x3.redIAdd(ecparams.b)).isZero()) return null
68594
68595 return ec.keyPair({ pub: { x: x, y: y } })
68596}
68597
68598function loadPublicKey (publicKey) {
68599 var first = publicKey[0]
68600 switch (first) {
68601 case 0x02:
68602 case 0x03:
68603 if (publicKey.length !== 33) return null
68604 return loadCompressedPublicKey(first, publicKey.slice(1, 33))
68605 case 0x04:
68606 case 0x06:
68607 case 0x07:
68608 if (publicKey.length !== 65) return null
68609 return loadUncompressedPublicKey(first, publicKey.slice(1, 33), publicKey.slice(33, 65))
68610 default:
68611 return null
68612 }
68613}
68614
68615exports.privateKeyVerify = function (privateKey) {
68616 var bn = new BN(privateKey)
68617 return bn.cmp(ecparams.n) < 0 && !bn.isZero()
68618}
68619
68620exports.privateKeyExport = function (privateKey, compressed) {
68621 var d = new BN(privateKey)
68622 if (d.cmp(ecparams.n) >= 0 || d.isZero()) throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL)
68623
68624 return new Buffer(ec.keyFromPrivate(privateKey).getPublic(compressed, true))
68625}
68626
68627exports.privateKeyTweakAdd = function (privateKey, tweak) {
68628 var bn = new BN(tweak)
68629 if (bn.cmp(ecparams.n) >= 0) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL)
68630
68631 bn.iadd(new BN(privateKey))
68632 if (bn.cmp(ecparams.n) >= 0) bn.isub(ecparams.n)
68633 if (bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL)
68634
68635 return bn.toArrayLike(Buffer, 'be', 32)
68636}
68637
68638exports.privateKeyTweakMul = function (privateKey, tweak) {
68639 var bn = new BN(tweak)
68640 if (bn.cmp(ecparams.n) >= 0 || bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL)
68641
68642 bn.imul(new BN(privateKey))
68643 if (bn.cmp(ecparams.n)) bn = bn.umod(ecparams.n)
68644
68645 return bn.toArrayLike(Buffer, 'be', 32)
68646}
68647
68648exports.publicKeyCreate = function (privateKey, compressed) {
68649 var d = new BN(privateKey)
68650 if (d.cmp(ecparams.n) >= 0 || d.isZero()) throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL)
68651
68652 return new Buffer(ec.keyFromPrivate(privateKey).getPublic(compressed, true))
68653}
68654
68655exports.publicKeyConvert = function (publicKey, compressed) {
68656 var pair = loadPublicKey(publicKey)
68657 if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)
68658
68659 return new Buffer(pair.getPublic(compressed, true))
68660}
68661
68662exports.publicKeyVerify = function (publicKey) {
68663 return loadPublicKey(publicKey) !== null
68664}
68665
68666exports.publicKeyTweakAdd = function (publicKey, tweak, compressed) {
68667 var pair = loadPublicKey(publicKey)
68668 if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)
68669
68670 tweak = new BN(tweak)
68671 if (tweak.cmp(ecparams.n) >= 0) throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL)
68672
68673 return new Buffer(ecparams.g.mul(tweak).add(pair.pub).encode(true, compressed))
68674}
68675
68676exports.publicKeyTweakMul = function (publicKey, tweak, compressed) {
68677 var pair = loadPublicKey(publicKey)
68678 if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)
68679
68680 tweak = new BN(tweak)
68681 if (tweak.cmp(ecparams.n) >= 0 || tweak.isZero()) throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL)
68682
68683 return new Buffer(pair.pub.mul(tweak).encode(true, compressed))
68684}
68685
68686exports.publicKeyCombine = function (publicKeys, compressed) {
68687 var pairs = new Array(publicKeys.length)
68688 for (var i = 0; i < publicKeys.length; ++i) {
68689 pairs[i] = loadPublicKey(publicKeys[i])
68690 if (pairs[i] === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)
68691 }
68692
68693 var point = pairs[0].pub
68694 for (var j = 1; j < pairs.length; ++j) point = point.add(pairs[j].pub)
68695 if (point.isInfinity()) throw new Error(messages.EC_PUBLIC_KEY_COMBINE_FAIL)
68696
68697 return new Buffer(point.encode(true, compressed))
68698}
68699
68700exports.signatureNormalize = function (signature) {
68701 var r = new BN(signature.slice(0, 32))
68702 var s = new BN(signature.slice(32, 64))
68703 if (r.cmp(ecparams.n) >= 0 || s.cmp(ecparams.n) >= 0) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)
68704
68705 var result = new Buffer(signature)
68706 if (s.cmp(ec.nh) === 1) ecparams.n.sub(s).toArrayLike(Buffer, 'be', 32).copy(result, 32)
68707
68708 return result
68709}
68710
68711exports.signatureExport = function (signature) {
68712 var r = signature.slice(0, 32)
68713 var s = signature.slice(32, 64)
68714 if (new BN(r).cmp(ecparams.n) >= 0 || new BN(s).cmp(ecparams.n) >= 0) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)
68715
68716 return { r: r, s: s }
68717}
68718
68719exports.signatureImport = function (sigObj) {
68720 var r = new BN(sigObj.r)
68721 if (r.cmp(ecparams.n) >= 0) r = new BN(0)
68722
68723 var s = new BN(sigObj.s)
68724 if (s.cmp(ecparams.n) >= 0) s = new BN(0)
68725
68726 return Buffer.concat([
68727 r.toArrayLike(Buffer, 'be', 32),
68728 s.toArrayLike(Buffer, 'be', 32)
68729 ])
68730}
68731
68732exports.sign = function (message, privateKey, noncefn, data) {
68733 if (typeof noncefn === 'function') {
68734 var getNonce = noncefn
68735 noncefn = function (counter) {
68736 var nonce = getNonce(message, privateKey, null, data, counter)
68737 if (!Buffer.isBuffer(nonce) || nonce.length !== 32) throw new Error(messages.ECDSA_SIGN_FAIL)
68738
68739 return new BN(nonce)
68740 }
68741 }
68742
68743 var d = new BN(privateKey)
68744 if (d.cmp(ecparams.n) >= 0 || d.isZero()) throw new Error(messages.ECDSA_SIGN_FAIL)
68745
68746 var result = ec.sign(message, privateKey, { canonical: true, k: noncefn, pers: data })
68747 return {
68748 signature: Buffer.concat([
68749 result.r.toArrayLike(Buffer, 'be', 32),
68750 result.s.toArrayLike(Buffer, 'be', 32)
68751 ]),
68752 recovery: result.recoveryParam
68753 }
68754}
68755
68756exports.verify = function (message, signature, publicKey) {
68757 var sigObj = {r: signature.slice(0, 32), s: signature.slice(32, 64)}
68758
68759 var sigr = new BN(sigObj.r)
68760 var sigs = new BN(sigObj.s)
68761 if (sigr.cmp(ecparams.n) >= 0 || sigs.cmp(ecparams.n) >= 0) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)
68762 if (sigs.cmp(ec.nh) === 1 || sigr.isZero() || sigs.isZero()) return false
68763
68764 var pair = loadPublicKey(publicKey)
68765 if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)
68766
68767 return ec.verify(message, sigObj, {x: pair.pub.x, y: pair.pub.y})
68768}
68769
68770exports.recover = function (message, signature, recovery, compressed) {
68771 var sigObj = {r: signature.slice(0, 32), s: signature.slice(32, 64)}
68772
68773 var sigr = new BN(sigObj.r)
68774 var sigs = new BN(sigObj.s)
68775 if (sigr.cmp(ecparams.n) >= 0 || sigs.cmp(ecparams.n) >= 0) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)
68776
68777 try {
68778 if (sigr.isZero() || sigs.isZero()) throw new Error()
68779
68780 var point = ec.recoverPubKey(message, sigObj, recovery)
68781 return new Buffer(point.encode(true, compressed))
68782 } catch (err) {
68783 throw new Error(messages.ECDSA_RECOVER_FAIL)
68784 }
68785}
68786
68787exports.ecdh = function (publicKey, privateKey) {
68788 var shared = exports.ecdhUnsafe(publicKey, privateKey, true)
68789 return createHash('sha256').update(shared).digest()
68790}
68791
68792exports.ecdhUnsafe = function (publicKey, privateKey, compressed) {
68793 var pair = loadPublicKey(publicKey)
68794 if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)
68795
68796 var scalar = new BN(privateKey)
68797 if (scalar.cmp(ecparams.n) >= 0 || scalar.isZero()) throw new Error(messages.ECDH_FAIL)
68798
68799 return new Buffer(pair.pub.mul(scalar).encode(true, compressed))
68800}
68801
68802}).call(this,require("buffer").Buffer)
68803},{"../messages.json":78,"bn.js":33,"buffer":5,"create-hash":36,"elliptic":39}],77:[function(require,module,exports){
68804'use strict'
68805var assert = require('./assert')
68806var der = require('./der')
68807var messages = require('./messages.json')
68808
68809function initCompressedValue (value, defaultValue) {
68810 if (value === undefined) return defaultValue
68811
68812 assert.isBoolean(value, messages.COMPRESSED_TYPE_INVALID)
68813 return value
68814}
68815
68816module.exports = function (secp256k1) {
68817 return {
68818 privateKeyVerify: function (privateKey) {
68819 assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)
68820 return privateKey.length === 32 && secp256k1.privateKeyVerify(privateKey)
68821 },
68822
68823 privateKeyExport: function (privateKey, compressed) {
68824 assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)
68825 assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)
68826
68827 compressed = initCompressedValue(compressed, true)
68828 var publicKey = secp256k1.privateKeyExport(privateKey, compressed)
68829
68830 return der.privateKeyExport(privateKey, publicKey, compressed)
68831 },
68832
68833 privateKeyImport: function (privateKey) {
68834 assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)
68835
68836 privateKey = der.privateKeyImport(privateKey)
68837 if (privateKey && privateKey.length === 32 && secp256k1.privateKeyVerify(privateKey)) return privateKey
68838
68839 throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL)
68840 },
68841
68842 privateKeyTweakAdd: function (privateKey, tweak) {
68843 assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)
68844 assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)
68845
68846 assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)
68847 assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)
68848
68849 return secp256k1.privateKeyTweakAdd(privateKey, tweak)
68850 },
68851
68852 privateKeyTweakMul: function (privateKey, tweak) {
68853 assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)
68854 assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)
68855
68856 assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)
68857 assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)
68858
68859 return secp256k1.privateKeyTweakMul(privateKey, tweak)
68860 },
68861
68862 publicKeyCreate: function (privateKey, compressed) {
68863 assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)
68864 assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)
68865
68866 compressed = initCompressedValue(compressed, true)
68867
68868 return secp256k1.publicKeyCreate(privateKey, compressed)
68869 },
68870
68871 publicKeyConvert: function (publicKey, compressed) {
68872 assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)
68873 assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)
68874
68875 compressed = initCompressedValue(compressed, true)
68876
68877 return secp256k1.publicKeyConvert(publicKey, compressed)
68878 },
68879
68880 publicKeyVerify: function (publicKey) {
68881 assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)
68882 return secp256k1.publicKeyVerify(publicKey)
68883 },
68884
68885 publicKeyTweakAdd: function (publicKey, tweak, compressed) {
68886 assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)
68887 assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)
68888
68889 assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)
68890 assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)
68891
68892 compressed = initCompressedValue(compressed, true)
68893
68894 return secp256k1.publicKeyTweakAdd(publicKey, tweak, compressed)
68895 },
68896
68897 publicKeyTweakMul: function (publicKey, tweak, compressed) {
68898 assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)
68899 assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)
68900
68901 assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)
68902 assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)
68903
68904 compressed = initCompressedValue(compressed, true)
68905
68906 return secp256k1.publicKeyTweakMul(publicKey, tweak, compressed)
68907 },
68908
68909 publicKeyCombine: function (publicKeys, compressed) {
68910 assert.isArray(publicKeys, messages.EC_PUBLIC_KEYS_TYPE_INVALID)
68911 assert.isLengthGTZero(publicKeys, messages.EC_PUBLIC_KEYS_LENGTH_INVALID)
68912 for (var i = 0; i < publicKeys.length; ++i) {
68913 assert.isBuffer(publicKeys[i], messages.EC_PUBLIC_KEY_TYPE_INVALID)
68914 assert.isBufferLength2(publicKeys[i], 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)
68915 }
68916
68917 compressed = initCompressedValue(compressed, true)
68918
68919 return secp256k1.publicKeyCombine(publicKeys, compressed)
68920 },
68921
68922 signatureNormalize: function (signature) {
68923 assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)
68924 assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)
68925
68926 return secp256k1.signatureNormalize(signature)
68927 },
68928
68929 signatureExport: function (signature) {
68930 assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)
68931 assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)
68932
68933 var sigObj = secp256k1.signatureExport(signature)
68934 return der.signatureExport(sigObj)
68935 },
68936
68937 signatureImport: function (sig) {
68938 assert.isBuffer(sig, messages.ECDSA_SIGNATURE_TYPE_INVALID)
68939 assert.isLengthGTZero(sig, messages.ECDSA_SIGNATURE_LENGTH_INVALID)
68940
68941 var sigObj = der.signatureImport(sig)
68942 if (sigObj) return secp256k1.signatureImport(sigObj)
68943
68944 throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL)
68945 },
68946
68947 signatureImportLax: function (sig) {
68948 assert.isBuffer(sig, messages.ECDSA_SIGNATURE_TYPE_INVALID)
68949 assert.isLengthGTZero(sig, messages.ECDSA_SIGNATURE_LENGTH_INVALID)
68950
68951 var sigObj = der.signatureImportLax(sig)
68952 if (sigObj) return secp256k1.signatureImport(sigObj)
68953
68954 throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL)
68955 },
68956
68957 sign: function (message, privateKey, options) {
68958 assert.isBuffer(message, messages.MSG32_TYPE_INVALID)
68959 assert.isBufferLength(message, 32, messages.MSG32_LENGTH_INVALID)
68960
68961 assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)
68962 assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)
68963
68964 var data = null
68965 var noncefn = null
68966 if (options !== undefined) {
68967 assert.isObject(options, messages.OPTIONS_TYPE_INVALID)
68968
68969 if (options.data !== undefined) {
68970 assert.isBuffer(options.data, messages.OPTIONS_DATA_TYPE_INVALID)
68971 assert.isBufferLength(options.data, 32, messages.OPTIONS_DATA_LENGTH_INVALID)
68972 data = options.data
68973 }
68974
68975 if (options.noncefn !== undefined) {
68976 assert.isFunction(options.noncefn, messages.OPTIONS_NONCEFN_TYPE_INVALID)
68977 noncefn = options.noncefn
68978 }
68979 }
68980
68981 return secp256k1.sign(message, privateKey, noncefn, data)
68982 },
68983
68984 verify: function (message, signature, publicKey) {
68985 assert.isBuffer(message, messages.MSG32_TYPE_INVALID)
68986 assert.isBufferLength(message, 32, messages.MSG32_LENGTH_INVALID)
68987
68988 assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)
68989 assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)
68990
68991 assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)
68992 assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)
68993
68994 return secp256k1.verify(message, signature, publicKey)
68995 },
68996
68997 recover: function (message, signature, recovery, compressed) {
68998 assert.isBuffer(message, messages.MSG32_TYPE_INVALID)
68999 assert.isBufferLength(message, 32, messages.MSG32_LENGTH_INVALID)
69000
69001 assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)
69002 assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)
69003
69004 assert.isNumber(recovery, messages.RECOVERY_ID_TYPE_INVALID)
69005 assert.isNumberInInterval(recovery, -1, 4, messages.RECOVERY_ID_VALUE_INVALID)
69006
69007 compressed = initCompressedValue(compressed, true)
69008
69009 return secp256k1.recover(message, signature, recovery, compressed)
69010 },
69011
69012 ecdh: function (publicKey, privateKey) {
69013 assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)
69014 assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)
69015
69016 assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)
69017 assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)
69018
69019 return secp256k1.ecdh(publicKey, privateKey)
69020 },
69021
69022 ecdhUnsafe: function (publicKey, privateKey, compressed) {
69023 assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)
69024 assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)
69025
69026 assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)
69027 assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)
69028
69029 compressed = initCompressedValue(compressed, true)
69030
69031 return secp256k1.ecdhUnsafe(publicKey, privateKey, compressed)
69032 }
69033 }
69034}
69035
69036},{"./assert":74,"./der":75,"./messages.json":78}],78:[function(require,module,exports){
69037module.exports={
69038 "COMPRESSED_TYPE_INVALID": "compressed should be a boolean",
69039 "EC_PRIVATE_KEY_TYPE_INVALID": "private key should be a Buffer",
69040 "EC_PRIVATE_KEY_LENGTH_INVALID": "private key length is invalid",
69041 "EC_PRIVATE_KEY_TWEAK_ADD_FAIL": "tweak out of range or resulting private key is invalid",
69042 "EC_PRIVATE_KEY_TWEAK_MUL_FAIL": "tweak out of range",
69043 "EC_PRIVATE_KEY_EXPORT_DER_FAIL": "couldn't export to DER format",
69044 "EC_PRIVATE_KEY_IMPORT_DER_FAIL": "couldn't import from DER format",
69045 "EC_PUBLIC_KEYS_TYPE_INVALID": "public keys should be an Array",
69046 "EC_PUBLIC_KEYS_LENGTH_INVALID": "public keys Array should have at least 1 element",
69047 "EC_PUBLIC_KEY_TYPE_INVALID": "public key should be a Buffer",
69048 "EC_PUBLIC_KEY_LENGTH_INVALID": "public key length is invalid",
69049 "EC_PUBLIC_KEY_PARSE_FAIL": "the public key could not be parsed or is invalid",
69050 "EC_PUBLIC_KEY_CREATE_FAIL": "private was invalid, try again",
69051 "EC_PUBLIC_KEY_TWEAK_ADD_FAIL": "tweak out of range or resulting public key is invalid",
69052 "EC_PUBLIC_KEY_TWEAK_MUL_FAIL": "tweak out of range",
69053 "EC_PUBLIC_KEY_COMBINE_FAIL": "the sum of the public keys is not valid",
69054 "ECDH_FAIL": "scalar was invalid (zero or overflow)",
69055 "ECDSA_SIGNATURE_TYPE_INVALID": "signature should be a Buffer",
69056 "ECDSA_SIGNATURE_LENGTH_INVALID": "signature length is invalid",
69057 "ECDSA_SIGNATURE_PARSE_FAIL": "couldn't parse signature",
69058 "ECDSA_SIGNATURE_PARSE_DER_FAIL": "couldn't parse DER signature",
69059 "ECDSA_SIGNATURE_SERIALIZE_DER_FAIL": "couldn't serialize signature to DER format",
69060 "ECDSA_SIGN_FAIL": "nonce generation function failed or private key is invalid",
69061 "ECDSA_RECOVER_FAIL": "couldn't recover public key from signature",
69062 "MSG32_TYPE_INVALID": "message should be a Buffer",
69063 "MSG32_LENGTH_INVALID": "message length is invalid",
69064 "OPTIONS_TYPE_INVALID": "options should be an Object",
69065 "OPTIONS_DATA_TYPE_INVALID": "options.data should be a Buffer",
69066 "OPTIONS_DATA_LENGTH_INVALID": "options.data length is invalid",
69067 "OPTIONS_NONCEFN_TYPE_INVALID": "options.noncefn should be a Function",
69068 "RECOVERY_ID_TYPE_INVALID": "recovery should be a Number",
69069 "RECOVERY_ID_VALUE_INVALID": "recovery should have value between -1 and 4",
69070 "TWEAK_TYPE_INVALID": "tweak should be a Buffer",
69071 "TWEAK_LENGTH_INVALID": "tweak length is invalid"
69072}
69073
69074},{}],79:[function(require,module,exports){
69075(function (Buffer){
69076// prototype class for hash functions
69077function Hash (blockSize, finalSize) {
69078 this._block = new Buffer(blockSize)
69079 this._finalSize = finalSize
69080 this._blockSize = blockSize
69081 this._len = 0
69082 this._s = 0
69083}
69084
69085Hash.prototype.update = function (data, enc) {
69086 if (typeof data === 'string') {
69087 enc = enc || 'utf8'
69088 data = new Buffer(data, enc)
69089 }
69090
69091 var l = this._len += data.length
69092 var s = this._s || 0
69093 var f = 0
69094 var buffer = this._block
69095
69096 while (s < l) {
69097 var t = Math.min(data.length, f + this._blockSize - (s % this._blockSize))
69098 var ch = (t - f)
69099
69100 for (var i = 0; i < ch; i++) {
69101 buffer[(s % this._blockSize) + i] = data[i + f]
69102 }
69103
69104 s += ch
69105 f += ch
69106
69107 if ((s % this._blockSize) === 0) {
69108 this._update(buffer)
69109 }
69110 }
69111 this._s = s
69112
69113 return this
69114}
69115
69116Hash.prototype.digest = function (enc) {
69117 // Suppose the length of the message M, in bits, is l
69118 var l = this._len * 8
69119
69120 // Append the bit 1 to the end of the message
69121 this._block[this._len % this._blockSize] = 0x80
69122
69123 // and then k zero bits, where k is the smallest non-negative solution to the equation (l + 1 + k) === finalSize mod blockSize
69124 this._block.fill(0, this._len % this._blockSize + 1)
69125
69126 if (l % (this._blockSize * 8) >= this._finalSize * 8) {
69127 this._update(this._block)
69128 this._block.fill(0)
69129 }
69130
69131 // to this append the block which is equal to the number l written in binary
69132 // TODO: handle case where l is > Math.pow(2, 29)
69133 this._block.writeInt32BE(l, this._blockSize - 4)
69134
69135 var hash = this._update(this._block) || this._hash()
69136
69137 return enc ? hash.toString(enc) : hash
69138}
69139
69140Hash.prototype._update = function () {
69141 throw new Error('_update must be implemented by subclass')
69142}
69143
69144module.exports = Hash
69145
69146}).call(this,require("buffer").Buffer)
69147},{"buffer":5}],80:[function(require,module,exports){
69148var exports = module.exports = function SHA (algorithm) {
69149 algorithm = algorithm.toLowerCase()
69150
69151 var Algorithm = exports[algorithm]
69152 if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
69153
69154 return new Algorithm()
69155}
69156
69157exports.sha = require('./sha')
69158exports.sha1 = require('./sha1')
69159exports.sha224 = require('./sha224')
69160exports.sha256 = require('./sha256')
69161exports.sha384 = require('./sha384')
69162exports.sha512 = require('./sha512')
69163
69164},{"./sha":81,"./sha1":82,"./sha224":83,"./sha256":84,"./sha384":85,"./sha512":86}],81:[function(require,module,exports){
69165(function (Buffer){
69166/*
69167 * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
69168 * in FIPS PUB 180-1
69169 * This source code is derived from sha1.js of the same repository.
69170 * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
69171 * operation was added.
69172 */
69173
69174var inherits = require('inherits')
69175var Hash = require('./hash')
69176
69177var K = [
69178 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
69179]
69180
69181var W = new Array(80)
69182
69183function Sha () {
69184 this.init()
69185 this._w = W
69186
69187 Hash.call(this, 64, 56)
69188}
69189
69190inherits(Sha, Hash)
69191
69192Sha.prototype.init = function () {
69193 this._a = 0x67452301
69194 this._b = 0xefcdab89
69195 this._c = 0x98badcfe
69196 this._d = 0x10325476
69197 this._e = 0xc3d2e1f0
69198
69199 return this
69200}
69201
69202function rotl5 (num) {
69203 return (num << 5) | (num >>> 27)
69204}
69205
69206function rotl30 (num) {
69207 return (num << 30) | (num >>> 2)
69208}
69209
69210function ft (s, b, c, d) {
69211 if (s === 0) return (b & c) | ((~b) & d)
69212 if (s === 2) return (b & c) | (b & d) | (c & d)
69213 return b ^ c ^ d
69214}
69215
69216Sha.prototype._update = function (M) {
69217 var W = this._w
69218
69219 var a = this._a | 0
69220 var b = this._b | 0
69221 var c = this._c | 0
69222 var d = this._d | 0
69223 var e = this._e | 0
69224
69225 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
69226 for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]
69227
69228 for (var j = 0; j < 80; ++j) {
69229 var s = ~~(j / 20)
69230 var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
69231
69232 e = d
69233 d = c
69234 c = rotl30(b)
69235 b = a
69236 a = t
69237 }
69238
69239 this._a = (a + this._a) | 0
69240 this._b = (b + this._b) | 0
69241 this._c = (c + this._c) | 0
69242 this._d = (d + this._d) | 0
69243 this._e = (e + this._e) | 0
69244}
69245
69246Sha.prototype._hash = function () {
69247 var H = new Buffer(20)
69248
69249 H.writeInt32BE(this._a | 0, 0)
69250 H.writeInt32BE(this._b | 0, 4)
69251 H.writeInt32BE(this._c | 0, 8)
69252 H.writeInt32BE(this._d | 0, 12)
69253 H.writeInt32BE(this._e | 0, 16)
69254
69255 return H
69256}
69257
69258module.exports = Sha
69259
69260}).call(this,require("buffer").Buffer)
69261},{"./hash":79,"buffer":5,"inherits":63}],82:[function(require,module,exports){
69262(function (Buffer){
69263/*
69264 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
69265 * in FIPS PUB 180-1
69266 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
69267 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
69268 * Distributed under the BSD License
69269 * See http://pajhome.org.uk/crypt/md5 for details.
69270 */
69271
69272var inherits = require('inherits')
69273var Hash = require('./hash')
69274
69275var K = [
69276 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
69277]
69278
69279var W = new Array(80)
69280
69281function Sha1 () {
69282 this.init()
69283 this._w = W
69284
69285 Hash.call(this, 64, 56)
69286}
69287
69288inherits(Sha1, Hash)
69289
69290Sha1.prototype.init = function () {
69291 this._a = 0x67452301
69292 this._b = 0xefcdab89
69293 this._c = 0x98badcfe
69294 this._d = 0x10325476
69295 this._e = 0xc3d2e1f0
69296
69297 return this
69298}
69299
69300function rotl1 (num) {
69301 return (num << 1) | (num >>> 31)
69302}
69303
69304function rotl5 (num) {
69305 return (num << 5) | (num >>> 27)
69306}
69307
69308function rotl30 (num) {
69309 return (num << 30) | (num >>> 2)
69310}
69311
69312function ft (s, b, c, d) {
69313 if (s === 0) return (b & c) | ((~b) & d)
69314 if (s === 2) return (b & c) | (b & d) | (c & d)
69315 return b ^ c ^ d
69316}
69317
69318Sha1.prototype._update = function (M) {
69319 var W = this._w
69320
69321 var a = this._a | 0
69322 var b = this._b | 0
69323 var c = this._c | 0
69324 var d = this._d | 0
69325 var e = this._e | 0
69326
69327 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
69328 for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
69329
69330 for (var j = 0; j < 80; ++j) {
69331 var s = ~~(j / 20)
69332 var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
69333
69334 e = d
69335 d = c
69336 c = rotl30(b)
69337 b = a
69338 a = t
69339 }
69340
69341 this._a = (a + this._a) | 0
69342 this._b = (b + this._b) | 0
69343 this._c = (c + this._c) | 0
69344 this._d = (d + this._d) | 0
69345 this._e = (e + this._e) | 0
69346}
69347
69348Sha1.prototype._hash = function () {
69349 var H = new Buffer(20)
69350
69351 H.writeInt32BE(this._a | 0, 0)
69352 H.writeInt32BE(this._b | 0, 4)
69353 H.writeInt32BE(this._c | 0, 8)
69354 H.writeInt32BE(this._d | 0, 12)
69355 H.writeInt32BE(this._e | 0, 16)
69356
69357 return H
69358}
69359
69360module.exports = Sha1
69361
69362}).call(this,require("buffer").Buffer)
69363},{"./hash":79,"buffer":5,"inherits":63}],83:[function(require,module,exports){
69364(function (Buffer){
69365/**
69366 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
69367 * in FIPS 180-2
69368 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
69369 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
69370 *
69371 */
69372
69373var inherits = require('inherits')
69374var Sha256 = require('./sha256')
69375var Hash = require('./hash')
69376
69377var W = new Array(64)
69378
69379function Sha224 () {
69380 this.init()
69381
69382 this._w = W // new Array(64)
69383
69384 Hash.call(this, 64, 56)
69385}
69386
69387inherits(Sha224, Sha256)
69388
69389Sha224.prototype.init = function () {
69390 this._a = 0xc1059ed8
69391 this._b = 0x367cd507
69392 this._c = 0x3070dd17
69393 this._d = 0xf70e5939
69394 this._e = 0xffc00b31
69395 this._f = 0x68581511
69396 this._g = 0x64f98fa7
69397 this._h = 0xbefa4fa4
69398
69399 return this
69400}
69401
69402Sha224.prototype._hash = function () {
69403 var H = new Buffer(28)
69404
69405 H.writeInt32BE(this._a, 0)
69406 H.writeInt32BE(this._b, 4)
69407 H.writeInt32BE(this._c, 8)
69408 H.writeInt32BE(this._d, 12)
69409 H.writeInt32BE(this._e, 16)
69410 H.writeInt32BE(this._f, 20)
69411 H.writeInt32BE(this._g, 24)
69412
69413 return H
69414}
69415
69416module.exports = Sha224
69417
69418}).call(this,require("buffer").Buffer)
69419},{"./hash":79,"./sha256":84,"buffer":5,"inherits":63}],84:[function(require,module,exports){
69420(function (Buffer){
69421/**
69422 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
69423 * in FIPS 180-2
69424 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
69425 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
69426 *
69427 */
69428
69429var inherits = require('inherits')
69430var Hash = require('./hash')
69431
69432var K = [
69433 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
69434 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
69435 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
69436 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
69437 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
69438 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
69439 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
69440 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
69441 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
69442 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
69443 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
69444 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
69445 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
69446 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
69447 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
69448 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
69449]
69450
69451var W = new Array(64)
69452
69453function Sha256 () {
69454 this.init()
69455
69456 this._w = W // new Array(64)
69457
69458 Hash.call(this, 64, 56)
69459}
69460
69461inherits(Sha256, Hash)
69462
69463Sha256.prototype.init = function () {
69464 this._a = 0x6a09e667
69465 this._b = 0xbb67ae85
69466 this._c = 0x3c6ef372
69467 this._d = 0xa54ff53a
69468 this._e = 0x510e527f
69469 this._f = 0x9b05688c
69470 this._g = 0x1f83d9ab
69471 this._h = 0x5be0cd19
69472
69473 return this
69474}
69475
69476function ch (x, y, z) {
69477 return z ^ (x & (y ^ z))
69478}
69479
69480function maj (x, y, z) {
69481 return (x & y) | (z & (x | y))
69482}
69483
69484function sigma0 (x) {
69485 return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
69486}
69487
69488function sigma1 (x) {
69489 return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
69490}
69491
69492function gamma0 (x) {
69493 return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
69494}
69495
69496function gamma1 (x) {
69497 return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
69498}
69499
69500Sha256.prototype._update = function (M) {
69501 var W = this._w
69502
69503 var a = this._a | 0
69504 var b = this._b | 0
69505 var c = this._c | 0
69506 var d = this._d | 0
69507 var e = this._e | 0
69508 var f = this._f | 0
69509 var g = this._g | 0
69510 var h = this._h | 0
69511
69512 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
69513 for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
69514
69515 for (var j = 0; j < 64; ++j) {
69516 var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
69517 var T2 = (sigma0(a) + maj(a, b, c)) | 0
69518
69519 h = g
69520 g = f
69521 f = e
69522 e = (d + T1) | 0
69523 d = c
69524 c = b
69525 b = a
69526 a = (T1 + T2) | 0
69527 }
69528
69529 this._a = (a + this._a) | 0
69530 this._b = (b + this._b) | 0
69531 this._c = (c + this._c) | 0
69532 this._d = (d + this._d) | 0
69533 this._e = (e + this._e) | 0
69534 this._f = (f + this._f) | 0
69535 this._g = (g + this._g) | 0
69536 this._h = (h + this._h) | 0
69537}
69538
69539Sha256.prototype._hash = function () {
69540 var H = new Buffer(32)
69541
69542 H.writeInt32BE(this._a, 0)
69543 H.writeInt32BE(this._b, 4)
69544 H.writeInt32BE(this._c, 8)
69545 H.writeInt32BE(this._d, 12)
69546 H.writeInt32BE(this._e, 16)
69547 H.writeInt32BE(this._f, 20)
69548 H.writeInt32BE(this._g, 24)
69549 H.writeInt32BE(this._h, 28)
69550
69551 return H
69552}
69553
69554module.exports = Sha256
69555
69556}).call(this,require("buffer").Buffer)
69557},{"./hash":79,"buffer":5,"inherits":63}],85:[function(require,module,exports){
69558(function (Buffer){
69559var inherits = require('inherits')
69560var SHA512 = require('./sha512')
69561var Hash = require('./hash')
69562
69563var W = new Array(160)
69564
69565function Sha384 () {
69566 this.init()
69567 this._w = W
69568
69569 Hash.call(this, 128, 112)
69570}
69571
69572inherits(Sha384, SHA512)
69573
69574Sha384.prototype.init = function () {
69575 this._ah = 0xcbbb9d5d
69576 this._bh = 0x629a292a
69577 this._ch = 0x9159015a
69578 this._dh = 0x152fecd8
69579 this._eh = 0x67332667
69580 this._fh = 0x8eb44a87
69581 this._gh = 0xdb0c2e0d
69582 this._hh = 0x47b5481d
69583
69584 this._al = 0xc1059ed8
69585 this._bl = 0x367cd507
69586 this._cl = 0x3070dd17
69587 this._dl = 0xf70e5939
69588 this._el = 0xffc00b31
69589 this._fl = 0x68581511
69590 this._gl = 0x64f98fa7
69591 this._hl = 0xbefa4fa4
69592
69593 return this
69594}
69595
69596Sha384.prototype._hash = function () {
69597 var H = new Buffer(48)
69598
69599 function writeInt64BE (h, l, offset) {
69600 H.writeInt32BE(h, offset)
69601 H.writeInt32BE(l, offset + 4)
69602 }
69603
69604 writeInt64BE(this._ah, this._al, 0)
69605 writeInt64BE(this._bh, this._bl, 8)
69606 writeInt64BE(this._ch, this._cl, 16)
69607 writeInt64BE(this._dh, this._dl, 24)
69608 writeInt64BE(this._eh, this._el, 32)
69609 writeInt64BE(this._fh, this._fl, 40)
69610
69611 return H
69612}
69613
69614module.exports = Sha384
69615
69616}).call(this,require("buffer").Buffer)
69617},{"./hash":79,"./sha512":86,"buffer":5,"inherits":63}],86:[function(require,module,exports){
69618(function (Buffer){
69619var inherits = require('inherits')
69620var Hash = require('./hash')
69621
69622var K = [
69623 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
69624 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
69625 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
69626 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
69627 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
69628 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
69629 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
69630 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
69631 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
69632 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
69633 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
69634 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
69635 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
69636 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
69637 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
69638 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
69639 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
69640 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
69641 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
69642 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
69643 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
69644 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
69645 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
69646 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
69647 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
69648 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
69649 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
69650 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
69651 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
69652 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
69653 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
69654 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
69655 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
69656 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
69657 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
69658 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
69659 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
69660 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
69661 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
69662 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
69663]
69664
69665var W = new Array(160)
69666
69667function Sha512 () {
69668 this.init()
69669 this._w = W
69670
69671 Hash.call(this, 128, 112)
69672}
69673
69674inherits(Sha512, Hash)
69675
69676Sha512.prototype.init = function () {
69677 this._ah = 0x6a09e667
69678 this._bh = 0xbb67ae85
69679 this._ch = 0x3c6ef372
69680 this._dh = 0xa54ff53a
69681 this._eh = 0x510e527f
69682 this._fh = 0x9b05688c
69683 this._gh = 0x1f83d9ab
69684 this._hh = 0x5be0cd19
69685
69686 this._al = 0xf3bcc908
69687 this._bl = 0x84caa73b
69688 this._cl = 0xfe94f82b
69689 this._dl = 0x5f1d36f1
69690 this._el = 0xade682d1
69691 this._fl = 0x2b3e6c1f
69692 this._gl = 0xfb41bd6b
69693 this._hl = 0x137e2179
69694
69695 return this
69696}
69697
69698function Ch (x, y, z) {
69699 return z ^ (x & (y ^ z))
69700}
69701
69702function maj (x, y, z) {
69703 return (x & y) | (z & (x | y))
69704}
69705
69706function sigma0 (x, xl) {
69707 return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
69708}
69709
69710function sigma1 (x, xl) {
69711 return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
69712}
69713
69714function Gamma0 (x, xl) {
69715 return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
69716}
69717
69718function Gamma0l (x, xl) {
69719 return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
69720}
69721
69722function Gamma1 (x, xl) {
69723 return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
69724}
69725
69726function Gamma1l (x, xl) {
69727 return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
69728}
69729
69730function getCarry (a, b) {
69731 return (a >>> 0) < (b >>> 0) ? 1 : 0
69732}
69733
69734Sha512.prototype._update = function (M) {
69735 var W = this._w
69736
69737 var ah = this._ah | 0
69738 var bh = this._bh | 0
69739 var ch = this._ch | 0
69740 var dh = this._dh | 0
69741 var eh = this._eh | 0
69742 var fh = this._fh | 0
69743 var gh = this._gh | 0
69744 var hh = this._hh | 0
69745
69746 var al = this._al | 0
69747 var bl = this._bl | 0
69748 var cl = this._cl | 0
69749 var dl = this._dl | 0
69750 var el = this._el | 0
69751 var fl = this._fl | 0
69752 var gl = this._gl | 0
69753 var hl = this._hl | 0
69754
69755 for (var i = 0; i < 32; i += 2) {
69756 W[i] = M.readInt32BE(i * 4)
69757 W[i + 1] = M.readInt32BE(i * 4 + 4)
69758 }
69759 for (; i < 160; i += 2) {
69760 var xh = W[i - 15 * 2]
69761 var xl = W[i - 15 * 2 + 1]
69762 var gamma0 = Gamma0(xh, xl)
69763 var gamma0l = Gamma0l(xl, xh)
69764
69765 xh = W[i - 2 * 2]
69766 xl = W[i - 2 * 2 + 1]
69767 var gamma1 = Gamma1(xh, xl)
69768 var gamma1l = Gamma1l(xl, xh)
69769
69770 // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
69771 var Wi7h = W[i - 7 * 2]
69772 var Wi7l = W[i - 7 * 2 + 1]
69773
69774 var Wi16h = W[i - 16 * 2]
69775 var Wi16l = W[i - 16 * 2 + 1]
69776
69777 var Wil = (gamma0l + Wi7l) | 0
69778 var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
69779 Wil = (Wil + gamma1l) | 0
69780 Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
69781 Wil = (Wil + Wi16l) | 0
69782 Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
69783
69784 W[i] = Wih
69785 W[i + 1] = Wil
69786 }
69787
69788 for (var j = 0; j < 160; j += 2) {
69789 Wih = W[j]
69790 Wil = W[j + 1]
69791
69792 var majh = maj(ah, bh, ch)
69793 var majl = maj(al, bl, cl)
69794
69795 var sigma0h = sigma0(ah, al)
69796 var sigma0l = sigma0(al, ah)
69797 var sigma1h = sigma1(eh, el)
69798 var sigma1l = sigma1(el, eh)
69799
69800 // t1 = h + sigma1 + ch + K[j] + W[j]
69801 var Kih = K[j]
69802 var Kil = K[j + 1]
69803
69804 var chh = Ch(eh, fh, gh)
69805 var chl = Ch(el, fl, gl)
69806
69807 var t1l = (hl + sigma1l) | 0
69808 var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
69809 t1l = (t1l + chl) | 0
69810 t1h = (t1h + chh + getCarry(t1l, chl)) | 0
69811 t1l = (t1l + Kil) | 0
69812 t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
69813 t1l = (t1l + Wil) | 0
69814 t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
69815
69816 // t2 = sigma0 + maj
69817 var t2l = (sigma0l + majl) | 0
69818 var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
69819
69820 hh = gh
69821 hl = gl
69822 gh = fh
69823 gl = fl
69824 fh = eh
69825 fl = el
69826 el = (dl + t1l) | 0
69827 eh = (dh + t1h + getCarry(el, dl)) | 0
69828 dh = ch
69829 dl = cl
69830 ch = bh
69831 cl = bl
69832 bh = ah
69833 bl = al
69834 al = (t1l + t2l) | 0
69835 ah = (t1h + t2h + getCarry(al, t1l)) | 0
69836 }
69837
69838 this._al = (this._al + al) | 0
69839 this._bl = (this._bl + bl) | 0
69840 this._cl = (this._cl + cl) | 0
69841 this._dl = (this._dl + dl) | 0
69842 this._el = (this._el + el) | 0
69843 this._fl = (this._fl + fl) | 0
69844 this._gl = (this._gl + gl) | 0
69845 this._hl = (this._hl + hl) | 0
69846
69847 this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
69848 this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
69849 this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
69850 this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
69851 this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
69852 this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
69853 this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
69854 this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
69855}
69856
69857Sha512.prototype._hash = function () {
69858 var H = new Buffer(64)
69859
69860 function writeInt64BE (h, l, offset) {
69861 H.writeInt32BE(h, offset)
69862 H.writeInt32BE(l, offset + 4)
69863 }
69864
69865 writeInt64BE(this._ah, this._al, 0)
69866 writeInt64BE(this._bh, this._bl, 8)
69867 writeInt64BE(this._ch, this._cl, 16)
69868 writeInt64BE(this._dh, this._dl, 24)
69869 writeInt64BE(this._eh, this._el, 32)
69870 writeInt64BE(this._fh, this._fl, 40)
69871 writeInt64BE(this._gh, this._gl, 48)
69872 writeInt64BE(this._hh, this._hl, 56)
69873
69874 return H
69875}
69876
69877module.exports = Sha512
69878
69879}).call(this,require("buffer").Buffer)
69880},{"./hash":79,"buffer":5,"inherits":63}],87:[function(require,module,exports){
69881var isHexPrefixed = require('is-hex-prefixed');
69882
69883/**
69884 * Removes '0x' from a given `String` is present
69885 * @param {String} str the string value
69886 * @return {String|Optional} a string by pass if necessary
69887 */
69888module.exports = function stripHexPrefix(str) {
69889 if (typeof str !== 'string') {
69890 return str;
69891 }
69892
69893 return isHexPrefixed(str) ? str.slice(2) : str;
69894}
69895
69896},{"is-hex-prefixed":64}]},{},[31])(31)
69897});</script>
69898 <script>function convertRippleAdrr(address) {
69899 return window.basex('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz').encode(
69900 window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address)
69901 )
69902 }
69903
69904function convertRipplePriv(priv) {
69905 return window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66)
69906}
69907
69908</script>
69909 <script>// Select components from sjcl to suit the crypto operations bip39 requires.
69910
69911//// base.js
69912
69913/** @fileOverview Javascript cryptography implementation.
69914 *
69915 * Crush to remove comments, shorten variable names and
69916 * generally reduce transmission size.
69917 *
69918 * @author Emily Stark
69919 * @author Mike Hamburg
69920 * @author Dan Boneh
69921 */
69922
69923"use strict";
69924/*jslint indent: 2, bitwise: false, nomen: false, plusplus: false, white: false, regexp: false */
69925/*global document, window, escape, unescape, module, require, Uint32Array */
69926
69927/** @namespace The Stanford Javascript Crypto Library, top-level namespace. */
69928var sjcl = {
69929 /** @namespace Symmetric ciphers. */
69930 cipher: {},
69931
69932 /** @namespace Hash functions. Right now only SHA256 is implemented. */
69933 hash: {},
69934
69935 /** @namespace Key exchange functions. Right now only SRP is implemented. */
69936 keyexchange: {},
69937
69938 /** @namespace Block cipher modes of operation. */
69939 mode: {},
69940
69941 /** @namespace Miscellaneous. HMAC and PBKDF2. */
69942 misc: {},
69943
69944 /**
69945 * @namespace Bit array encoders and decoders.
69946 *
69947 * @description
69948 * The members of this namespace are functions which translate between
69949 * SJCL's bitArrays and other objects (usually strings). Because it
69950 * isn't always clear which direction is encoding and which is decoding,
69951 * the method names are "fromBits" and "toBits".
69952 */
69953 codec: {},
69954
69955 /** @namespace Exceptions. */
69956 exception: {
69957 /** @constructor Ciphertext is corrupt. */
69958 corrupt: function(message) {
69959 this.toString = function() { return "CORRUPT: "+this.message; };
69960 this.message = message;
69961 },
69962
69963 /** @constructor Invalid parameter. */
69964 invalid: function(message) {
69965 this.toString = function() { return "INVALID: "+this.message; };
69966 this.message = message;
69967 },
69968
69969 /** @constructor Bug or missing feature in SJCL. @constructor */
69970 bug: function(message) {
69971 this.toString = function() { return "BUG: "+this.message; };
69972 this.message = message;
69973 },
69974
69975 /** @constructor Something isn't ready. */
69976 notReady: function(message) {
69977 this.toString = function() { return "NOT READY: "+this.message; };
69978 this.message = message;
69979 }
69980 }
69981};
69982
69983if(typeof module !== 'undefined' && module.exports){
69984 module.exports = sjcl;
69985}
69986if (typeof define === "function") {
69987 define([], function () {
69988 return sjcl;
69989 });
69990}
69991
69992
69993//// bitArray.js
69994
69995/** @fileOverview Arrays of bits, encoded as arrays of Numbers.
69996 *
69997 * @author Emily Stark
69998 * @author Mike Hamburg
69999 * @author Dan Boneh
70000 */
70001
70002/** @namespace Arrays of bits, encoded as arrays of Numbers.
70003 *
70004 * @description
70005 * <p>
70006 * These objects are the currency accepted by SJCL's crypto functions.
70007 * </p>
70008 *
70009 * <p>
70010 * Most of our crypto primitives operate on arrays of 4-byte words internally,
70011 * but many of them can take arguments that are not a multiple of 4 bytes.
70012 * This library encodes arrays of bits (whose size need not be a multiple of 8
70013 * bits) as arrays of 32-bit words. The bits are packed, big-endian, into an
70014 * array of words, 32 bits at a time. Since the words are double-precision
70015 * floating point numbers, they fit some extra data. We use this (in a private,
70016 * possibly-changing manner) to encode the number of bits actually present
70017 * in the last word of the array.
70018 * </p>
70019 *
70020 * <p>
70021 * Because bitwise ops clear this out-of-band data, these arrays can be passed
70022 * to ciphers like AES which want arrays of words.
70023 * </p>
70024 */
70025sjcl.bitArray = {
70026 /**
70027 * Array slices in units of bits.
70028 * @param {bitArray} a The array to slice.
70029 * @param {Number} bstart The offset to the start of the slice, in bits.
70030 * @param {Number} bend The offset to the end of the slice, in bits. If this is undefined,
70031 * slice until the end of the array.
70032 * @return {bitArray} The requested slice.
70033 */
70034 bitSlice: function (a, bstart, bend) {
70035 a = sjcl.bitArray._shiftRight(a.slice(bstart/32), 32 - (bstart & 31)).slice(1);
70036 return (bend === undefined) ? a : sjcl.bitArray.clamp(a, bend-bstart);
70037 },
70038
70039 /**
70040 * Extract a number packed into a bit array.
70041 * @param {bitArray} a The array to slice.
70042 * @param {Number} bstart The offset to the start of the slice, in bits.
70043 * @param {Number} length The length of the number to extract.
70044 * @return {Number} The requested slice.
70045 */
70046 extract: function(a, bstart, blength) {
70047 // FIXME: this Math.floor is not necessary at all, but for some reason
70048 // seems to suppress a bug in the Chromium JIT.
70049 var x, sh = Math.floor((-bstart-blength) & 31);
70050 if ((bstart + blength - 1 ^ bstart) & -32) {
70051 // it crosses a boundary
70052 x = (a[bstart/32|0] << (32 - sh)) ^ (a[bstart/32+1|0] >>> sh);
70053 } else {
70054 // within a single word
70055 x = a[bstart/32|0] >>> sh;
70056 }
70057 return x & ((1<<blength) - 1);
70058 },
70059
70060 /**
70061 * Concatenate two bit arrays.
70062 * @param {bitArray} a1 The first array.
70063 * @param {bitArray} a2 The second array.
70064 * @return {bitArray} The concatenation of a1 and a2.
70065 */
70066 concat: function (a1, a2) {
70067 if (a1.length === 0 || a2.length === 0) {
70068 return a1.concat(a2);
70069 }
70070
70071 var last = a1[a1.length-1], shift = sjcl.bitArray.getPartial(last);
70072 if (shift === 32) {
70073 return a1.concat(a2);
70074 } else {
70075 return sjcl.bitArray._shiftRight(a2, shift, last|0, a1.slice(0,a1.length-1));
70076 }
70077 },
70078
70079 /**
70080 * Find the length of an array of bits.
70081 * @param {bitArray} a The array.
70082 * @return {Number} The length of a, in bits.
70083 */
70084 bitLength: function (a) {
70085 var l = a.length, x;
70086 if (l === 0) { return 0; }
70087 x = a[l - 1];
70088 return (l-1) * 32 + sjcl.bitArray.getPartial(x);
70089 },
70090
70091 /**
70092 * Truncate an array.
70093 * @param {bitArray} a The array.
70094 * @param {Number} len The length to truncate to, in bits.
70095 * @return {bitArray} A new array, truncated to len bits.
70096 */
70097 clamp: function (a, len) {
70098 if (a.length * 32 < len) { return a; }
70099 a = a.slice(0, Math.ceil(len / 32));
70100 var l = a.length;
70101 len = len & 31;
70102 if (l > 0 && len) {
70103 a[l-1] = sjcl.bitArray.partial(len, a[l-1] & 0x80000000 >> (len-1), 1);
70104 }
70105 return a;
70106 },
70107
70108 /**
70109 * Make a partial word for a bit array.
70110 * @param {Number} len The number of bits in the word.
70111 * @param {Number} x The bits.
70112 * @param {Number} [0] _end Pass 1 if x has already been shifted to the high side.
70113 * @return {Number} The partial word.
70114 */
70115 partial: function (len, x, _end) {
70116 if (len === 32) { return x; }
70117 return (_end ? x|0 : x << (32-len)) + len * 0x10000000000;
70118 },
70119
70120 /**
70121 * Get the number of bits used by a partial word.
70122 * @param {Number} x The partial word.
70123 * @return {Number} The number of bits used by the partial word.
70124 */
70125 getPartial: function (x) {
70126 return Math.round(x/0x10000000000) || 32;
70127 },
70128
70129 /**
70130 * Compare two arrays for equality in a predictable amount of time.
70131 * @param {bitArray} a The first array.
70132 * @param {bitArray} b The second array.
70133 * @return {boolean} true if a == b; false otherwise.
70134 */
70135 equal: function (a, b) {
70136 if (sjcl.bitArray.bitLength(a) !== sjcl.bitArray.bitLength(b)) {
70137 return false;
70138 }
70139 var x = 0, i;
70140 for (i=0; i<a.length; i++) {
70141 x |= a[i]^b[i];
70142 }
70143 return (x === 0);
70144 },
70145
70146 /** Shift an array right.
70147 * @param {bitArray} a The array to shift.
70148 * @param {Number} shift The number of bits to shift.
70149 * @param {Number} [carry=0] A byte to carry in
70150 * @param {bitArray} [out=[]] An array to prepend to the output.
70151 * @private
70152 */
70153 _shiftRight: function (a, shift, carry, out) {
70154 var i, last2=0, shift2;
70155 if (out === undefined) { out = []; }
70156
70157 for (; shift >= 32; shift -= 32) {
70158 out.push(carry);
70159 carry = 0;
70160 }
70161 if (shift === 0) {
70162 return out.concat(a);
70163 }
70164
70165 for (i=0; i<a.length; i++) {
70166 out.push(carry | a[i]>>>shift);
70167 carry = a[i] << (32-shift);
70168 }
70169 last2 = a.length ? a[a.length-1] : 0;
70170 shift2 = sjcl.bitArray.getPartial(last2);
70171 out.push(sjcl.bitArray.partial(shift+shift2 & 31, (shift + shift2 > 32) ? carry : out.pop(),1));
70172 return out;
70173 },
70174
70175 /** xor a block of 4 words together.
70176 * @private
70177 */
70178 _xor4: function(x,y) {
70179 return [x[0]^y[0],x[1]^y[1],x[2]^y[2],x[3]^y[3]];
70180 },
70181
70182 /** byteswap a word array inplace.
70183 * (does not handle partial words)
70184 * @param {sjcl.bitArray} a word array
70185 * @return {sjcl.bitArray} byteswapped array
70186 */
70187 byteswapM: function(a) {
70188 var i, v, m = 0xff00;
70189 for (i = 0; i < a.length; ++i) {
70190 v = a[i];
70191 a[i] = (v >>> 24) | ((v >>> 8) & m) | ((v & m) << 8) | (v << 24);
70192 }
70193 return a;
70194 }
70195};
70196
70197
70198//// codecString.js
70199
70200/** @fileOverview Bit array codec implementations.
70201 *
70202 * @author Emily Stark
70203 * @author Mike Hamburg
70204 * @author Dan Boneh
70205 */
70206
70207/** @namespace UTF-8 strings */
70208sjcl.codec.utf8String = {
70209 /** Convert from a bitArray to a UTF-8 string. */
70210 fromBits: function (arr) {
70211 var out = "", bl = sjcl.bitArray.bitLength(arr), i, tmp;
70212 for (i=0; i<bl/8; i++) {
70213 if ((i&3) === 0) {
70214 tmp = arr[i/4];
70215 }
70216 out += String.fromCharCode(tmp >>> 24);
70217 tmp <<= 8;
70218 }
70219 return decodeURIComponent(escape(out));
70220 },
70221
70222 /** Convert from a UTF-8 string to a bitArray. */
70223 toBits: function (str) {
70224 str = unescape(encodeURIComponent(str));
70225 var out = [], i, tmp=0;
70226 for (i=0; i<str.length; i++) {
70227 tmp = tmp << 8 | str.charCodeAt(i);
70228 if ((i&3) === 3) {
70229 out.push(tmp);
70230 tmp = 0;
70231 }
70232 }
70233 if (i&3) {
70234 out.push(sjcl.bitArray.partial(8*(i&3), tmp));
70235 }
70236 return out;
70237 }
70238};
70239
70240
70241//// codecHex.js
70242
70243/** @fileOverview Bit array codec implementations.
70244 *
70245 * @author Emily Stark
70246 * @author Mike Hamburg
70247 * @author Dan Boneh
70248 */
70249
70250/** @namespace Hexadecimal */
70251sjcl.codec.hex = {
70252 /** Convert from a bitArray to a hex string. */
70253 fromBits: function (arr) {
70254 var out = "", i;
70255 for (i=0; i<arr.length; i++) {
70256 out += ((arr[i]|0)+0xF00000000000).toString(16).substr(4);
70257 }
70258 return out.substr(0, sjcl.bitArray.bitLength(arr)/4);//.replace(/(.{8})/g, "$1 ");
70259 },
70260 /** Convert from a hex string to a bitArray. */
70261 toBits: function (str) {
70262 var i, out=[], len;
70263 str = str.replace(/\s|0x/g, "");
70264 len = str.length;
70265 str = str + "00000000";
70266 for (i=0; i<str.length; i+=8) {
70267 out.push(parseInt(str.substr(i,8),16)^0);
70268 }
70269 return sjcl.bitArray.clamp(out, len*4);
70270 }
70271};
70272
70273
70274//// sha512.js
70275
70276/** @fileOverview Javascript SHA-512 implementation.
70277 *
70278 * This implementation was written for CryptoJS by Jeff Mott and adapted for
70279 * SJCL by Stefan Thomas.
70280 *
70281 * CryptoJS (c) 2009–2012 by Jeff Mott. All rights reserved.
70282 * Released with New BSD License
70283 *
70284 * @author Emily Stark
70285 * @author Mike Hamburg
70286 * @author Dan Boneh
70287 * @author Jeff Mott
70288 * @author Stefan Thomas
70289 */
70290
70291/**
70292 * Context for a SHA-512 operation in progress.
70293 * @constructor
70294 * @class Secure Hash Algorithm, 512 bits.
70295 */
70296sjcl.hash.sha512 = function (hash) {
70297 if (!this._key[0]) { this._precompute(); }
70298 if (hash) {
70299 this._h = hash._h.slice(0);
70300 this._buffer = hash._buffer.slice(0);
70301 this._length = hash._length;
70302 } else {
70303 this.reset();
70304 }
70305};
70306
70307/**
70308 * Hash a string or an array of words.
70309 * @static
70310 * @param {bitArray|String} data the data to hash.
70311 * @return {bitArray} The hash value, an array of 16 big-endian words.
70312 */
70313sjcl.hash.sha512.hash = function (data) {
70314 return (new sjcl.hash.sha512()).update(data).finalize();
70315};
70316
70317sjcl.hash.sha512.prototype = {
70318 /**
70319 * The hash's block size, in bits.
70320 * @constant
70321 */
70322 blockSize: 1024,
70323
70324 /**
70325 * Reset the hash state.
70326 * @return this
70327 */
70328 reset:function () {
70329 this._h = this._init.slice(0);
70330 this._buffer = [];
70331 this._length = 0;
70332 return this;
70333 },
70334
70335 /**
70336 * Input several words to the hash.
70337 * @param {bitArray|String} data the data to hash.
70338 * @return this
70339 */
70340 update: function (data) {
70341 if (typeof data === "string") {
70342 data = sjcl.codec.utf8String.toBits(data);
70343 }
70344 var i, b = this._buffer = sjcl.bitArray.concat(this._buffer, data),
70345 ol = this._length,
70346 nl = this._length = ol + sjcl.bitArray.bitLength(data);
70347 for (i = 1024+ol & -1024; i <= nl; i+= 1024) {
70348 this._block(b.splice(0,32));
70349 }
70350 return this;
70351 },
70352
70353 /**
70354 * Complete hashing and output the hash value.
70355 * @return {bitArray} The hash value, an array of 16 big-endian words.
70356 */
70357 finalize:function () {
70358 var i, b = this._buffer, h = this._h;
70359
70360 // Round out and push the buffer
70361 b = sjcl.bitArray.concat(b, [sjcl.bitArray.partial(1,1)]);
70362
70363 // Round out the buffer to a multiple of 32 words, less the 4 length words.
70364 for (i = b.length + 4; i & 31; i++) {
70365 b.push(0);
70366 }
70367
70368 // append the length
70369 b.push(0);
70370 b.push(0);
70371 b.push(Math.floor(this._length / 0x100000000));
70372 b.push(this._length | 0);
70373
70374 while (b.length) {
70375 this._block(b.splice(0,32));
70376 }
70377
70378 this.reset();
70379 return h;
70380 },
70381
70382 /**
70383 * The SHA-512 initialization vector, to be precomputed.
70384 * @private
70385 */
70386 _init:[],
70387
70388 /**
70389 * Least significant 24 bits of SHA512 initialization values.
70390 *
70391 * Javascript only has 53 bits of precision, so we compute the 40 most
70392 * significant bits and add the remaining 24 bits as constants.
70393 *
70394 * @private
70395 */
70396 _initr: [ 0xbcc908, 0xcaa73b, 0x94f82b, 0x1d36f1, 0xe682d1, 0x3e6c1f, 0x41bd6b, 0x7e2179 ],
70397
70398 /*
70399 _init:
70400 [0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,
70401 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179],
70402 */
70403
70404 /**
70405 * The SHA-512 hash key, to be precomputed.
70406 * @private
70407 */
70408 _key:[],
70409
70410 /**
70411 * Least significant 24 bits of SHA512 key values.
70412 * @private
70413 */
70414 _keyr:
70415 [0x28ae22, 0xef65cd, 0x4d3b2f, 0x89dbbc, 0x48b538, 0x05d019, 0x194f9b, 0x6d8118,
70416 0x030242, 0x706fbe, 0xe4b28c, 0xffb4e2, 0x7b896f, 0x1696b1, 0xc71235, 0x692694,
70417 0xf14ad2, 0x4f25e3, 0x8cd5b5, 0xac9c65, 0x2b0275, 0xa6e483, 0x41fbd4, 0x1153b5,
70418 0x66dfab, 0xb43210, 0xfb213f, 0xef0ee4, 0xa88fc2, 0x0aa725, 0x03826f, 0x0e6e70,
70419 0xd22ffc, 0x26c926, 0xc42aed, 0x95b3df, 0xaf63de, 0x77b2a8, 0xedaee6, 0x82353b,
70420 0xf10364, 0x423001, 0xf89791, 0x54be30, 0xef5218, 0x65a910, 0x71202a, 0xbbd1b8,
70421 0xd2d0c8, 0x41ab53, 0x8eeb99, 0x9b48a8, 0xc95a63, 0x418acb, 0x63e373, 0xb2b8a3,
70422 0xefb2fc, 0x172f60, 0xf0ab72, 0x6439ec, 0x631e28, 0x82bde9, 0xc67915, 0x72532b,
70423 0x26619c, 0xc0c207, 0xe0eb1e, 0x6ed178, 0x176fba, 0xc898a6, 0xf90dae, 0x1c471b,
70424 0x047d84, 0xc72493, 0xc9bebc, 0x100d4c, 0x3e42b6, 0x657e2a, 0xd6faec, 0x475817],
70425
70426 /*
70427 _key:
70428 [0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
70429 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
70430 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
70431 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
70432 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
70433 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
70434 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
70435 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
70436 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
70437 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
70438 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
70439 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
70440 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
70441 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
70442 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
70443 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
70444 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
70445 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
70446 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
70447 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817],
70448 */
70449
70450 /**
70451 * Function to precompute _init and _key.
70452 * @private
70453 */
70454 _precompute: function () {
70455 // XXX: This code is for precomputing the SHA256 constants, change for
70456 // SHA512 and re-enable.
70457 var i = 0, prime = 2, factor;
70458
70459 function frac(x) { return (x-Math.floor(x)) * 0x100000000 | 0; }
70460 function frac2(x) { return (x-Math.floor(x)) * 0x10000000000 & 0xff; }
70461
70462 outer: for (; i<80; prime++) {
70463 for (factor=2; factor*factor <= prime; factor++) {
70464 if (prime % factor === 0) {
70465 // not a prime
70466 continue outer;
70467 }
70468 }
70469
70470 if (i<8) {
70471 this._init[i*2] = frac(Math.pow(prime, 1/2));
70472 this._init[i*2+1] = (frac2(Math.pow(prime, 1/2)) << 24) | this._initr[i];
70473 }
70474 this._key[i*2] = frac(Math.pow(prime, 1/3));
70475 this._key[i*2+1] = (frac2(Math.pow(prime, 1/3)) << 24) | this._keyr[i];
70476 i++;
70477 }
70478 },
70479
70480 /**
70481 * Perform one cycle of SHA-512.
70482 * @param {bitArray} words one block of words.
70483 * @private
70484 */
70485 _block:function (words) {
70486 var i, wrh, wrl,
70487 w = words.slice(0),
70488 h = this._h,
70489 k = this._key,
70490 h0h = h[ 0], h0l = h[ 1], h1h = h[ 2], h1l = h[ 3],
70491 h2h = h[ 4], h2l = h[ 5], h3h = h[ 6], h3l = h[ 7],
70492 h4h = h[ 8], h4l = h[ 9], h5h = h[10], h5l = h[11],
70493 h6h = h[12], h6l = h[13], h7h = h[14], h7l = h[15];
70494
70495 // Working variables
70496 var ah = h0h, al = h0l, bh = h1h, bl = h1l,
70497 ch = h2h, cl = h2l, dh = h3h, dl = h3l,
70498 eh = h4h, el = h4l, fh = h5h, fl = h5l,
70499 gh = h6h, gl = h6l, hh = h7h, hl = h7l;
70500
70501 for (i=0; i<80; i++) {
70502 // load up the input word for this round
70503 if (i<16) {
70504 wrh = w[i * 2];
70505 wrl = w[i * 2 + 1];
70506 } else {
70507 // Gamma0
70508 var gamma0xh = w[(i-15) * 2];
70509 var gamma0xl = w[(i-15) * 2 + 1];
70510 var gamma0h =
70511 ((gamma0xl << 31) | (gamma0xh >>> 1)) ^
70512 ((gamma0xl << 24) | (gamma0xh >>> 8)) ^
70513 (gamma0xh >>> 7);
70514 var gamma0l =
70515 ((gamma0xh << 31) | (gamma0xl >>> 1)) ^
70516 ((gamma0xh << 24) | (gamma0xl >>> 8)) ^
70517 ((gamma0xh << 25) | (gamma0xl >>> 7));
70518
70519 // Gamma1
70520 var gamma1xh = w[(i-2) * 2];
70521 var gamma1xl = w[(i-2) * 2 + 1];
70522 var gamma1h =
70523 ((gamma1xl << 13) | (gamma1xh >>> 19)) ^
70524 ((gamma1xh << 3) | (gamma1xl >>> 29)) ^
70525 (gamma1xh >>> 6);
70526 var gamma1l =
70527 ((gamma1xh << 13) | (gamma1xl >>> 19)) ^
70528 ((gamma1xl << 3) | (gamma1xh >>> 29)) ^
70529 ((gamma1xh << 26) | (gamma1xl >>> 6));
70530
70531 // Shortcuts
70532 var wr7h = w[(i-7) * 2];
70533 var wr7l = w[(i-7) * 2 + 1];
70534
70535 var wr16h = w[(i-16) * 2];
70536 var wr16l = w[(i-16) * 2 + 1];
70537
70538 // W(round) = gamma0 + W(round - 7) + gamma1 + W(round - 16)
70539 wrl = gamma0l + wr7l;
70540 wrh = gamma0h + wr7h + ((wrl >>> 0) < (gamma0l >>> 0) ? 1 : 0);
70541 wrl += gamma1l;
70542 wrh += gamma1h + ((wrl >>> 0) < (gamma1l >>> 0) ? 1 : 0);
70543 wrl += wr16l;
70544 wrh += wr16h + ((wrl >>> 0) < (wr16l >>> 0) ? 1 : 0);
70545 }
70546
70547 w[i*2] = wrh |= 0;
70548 w[i*2 + 1] = wrl |= 0;
70549
70550 // Ch
70551 var chh = (eh & fh) ^ (~eh & gh);
70552 var chl = (el & fl) ^ (~el & gl);
70553
70554 // Maj
70555 var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
70556 var majl = (al & bl) ^ (al & cl) ^ (bl & cl);
70557
70558 // Sigma0
70559 var sigma0h = ((al << 4) | (ah >>> 28)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
70560 var sigma0l = ((ah << 4) | (al >>> 28)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
70561
70562 // Sigma1
70563 var sigma1h = ((el << 18) | (eh >>> 14)) ^ ((el << 14) | (eh >>> 18)) ^ ((eh << 23) | (el >>> 9));
70564 var sigma1l = ((eh << 18) | (el >>> 14)) ^ ((eh << 14) | (el >>> 18)) ^ ((el << 23) | (eh >>> 9));
70565
70566 // K(round)
70567 var krh = k[i*2];
70568 var krl = k[i*2+1];
70569
70570 // t1 = h + sigma1 + ch + K(round) + W(round)
70571 var t1l = hl + sigma1l;
70572 var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
70573 t1l += chl;
70574 t1h += chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
70575 t1l += krl;
70576 t1h += krh + ((t1l >>> 0) < (krl >>> 0) ? 1 : 0);
70577 t1l = t1l + wrl|0; // FF32..FF34 perf issue https://bugzilla.mozilla.org/show_bug.cgi?id=1054972
70578 t1h += wrh + ((t1l >>> 0) < (wrl >>> 0) ? 1 : 0);
70579
70580 // t2 = sigma0 + maj
70581 var t2l = sigma0l + majl;
70582 var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
70583
70584 // Update working variables
70585 hh = gh;
70586 hl = gl;
70587 gh = fh;
70588 gl = fl;
70589 fh = eh;
70590 fl = el;
70591 el = (dl + t1l) | 0;
70592 eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
70593 dh = ch;
70594 dl = cl;
70595 ch = bh;
70596 cl = bl;
70597 bh = ah;
70598 bl = al;
70599 al = (t1l + t2l) | 0;
70600 ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
70601 }
70602
70603 // Intermediate hash
70604 h0l = h[1] = (h0l + al) | 0;
70605 h[0] = (h0h + ah + ((h0l >>> 0) < (al >>> 0) ? 1 : 0)) | 0;
70606 h1l = h[3] = (h1l + bl) | 0;
70607 h[2] = (h1h + bh + ((h1l >>> 0) < (bl >>> 0) ? 1 : 0)) | 0;
70608 h2l = h[5] = (h2l + cl) | 0;
70609 h[4] = (h2h + ch + ((h2l >>> 0) < (cl >>> 0) ? 1 : 0)) | 0;
70610 h3l = h[7] = (h3l + dl) | 0;
70611 h[6] = (h3h + dh + ((h3l >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
70612 h4l = h[9] = (h4l + el) | 0;
70613 h[8] = (h4h + eh + ((h4l >>> 0) < (el >>> 0) ? 1 : 0)) | 0;
70614 h5l = h[11] = (h5l + fl) | 0;
70615 h[10] = (h5h + fh + ((h5l >>> 0) < (fl >>> 0) ? 1 : 0)) | 0;
70616 h6l = h[13] = (h6l + gl) | 0;
70617 h[12] = (h6h + gh + ((h6l >>> 0) < (gl >>> 0) ? 1 : 0)) | 0;
70618 h7l = h[15] = (h7l + hl) | 0;
70619 h[14] = (h7h + hh + ((h7l >>> 0) < (hl >>> 0) ? 1 : 0)) | 0;
70620 }
70621};
70622
70623
70624//// hmac.js
70625
70626/** @fileOverview HMAC implementation.
70627 *
70628 * @author Emily Stark
70629 * @author Mike Hamburg
70630 * @author Dan Boneh
70631 */
70632
70633/** HMAC with the specified hash function.
70634 * @constructor
70635 * @param {bitArray} key the key for HMAC.
70636 * @param {Object} [hash=sjcl.hash.sha256] The hash function to use.
70637 */
70638sjcl.misc.hmac = function (key, Hash) {
70639 this._hash = Hash = Hash || sjcl.hash.sha256;
70640 var exKey = [[],[]], i,
70641 bs = Hash.prototype.blockSize / 32;
70642 this._baseHash = [new Hash(), new Hash()];
70643
70644 if (key.length > bs) {
70645 key = Hash.hash(key);
70646 }
70647
70648 for (i=0; i<bs; i++) {
70649 exKey[0][i] = key[i]^0x36363636;
70650 exKey[1][i] = key[i]^0x5C5C5C5C;
70651 }
70652
70653 this._baseHash[0].update(exKey[0]);
70654 this._baseHash[1].update(exKey[1]);
70655 this._resultHash = new Hash(this._baseHash[0]);
70656};
70657
70658/** HMAC with the specified hash function. Also called encrypt since it's a prf.
70659 * @param {bitArray|String} data The data to mac.
70660 */
70661sjcl.misc.hmac.prototype.encrypt = sjcl.misc.hmac.prototype.mac = function (data) {
70662 if (!this._updated) {
70663 this.update(data);
70664 return this.digest(data);
70665 } else {
70666 throw new sjcl.exception.invalid("encrypt on already updated hmac called!");
70667 }
70668};
70669
70670sjcl.misc.hmac.prototype.reset = function () {
70671 this._resultHash = new this._hash(this._baseHash[0]);
70672 this._updated = false;
70673};
70674
70675sjcl.misc.hmac.prototype.update = function (data) {
70676 this._updated = true;
70677 this._resultHash.update(data);
70678};
70679
70680sjcl.misc.hmac.prototype.digest = function () {
70681 var w = this._resultHash.finalize(), result = new (this._hash)(this._baseHash[1]).update(w).finalize();
70682
70683 this.reset();
70684
70685 return result;
70686};
70687
70688
70689//// pbkdf2.js
70690
70691
70692/** @fileOverview Password-based key-derivation function, version 2.0.
70693 *
70694 * @author Emily Stark
70695 * @author Mike Hamburg
70696 * @author Dan Boneh
70697 */
70698
70699/** Password-Based Key-Derivation Function, version 2.0.
70700 *
70701 * Generate keys from passwords using PBKDF2-HMAC-SHA256.
70702 *
70703 * This is the method specified by RSA's PKCS #5 standard.
70704 *
70705 * @param {bitArray|String} password The password.
70706 * @param {bitArray|String} salt The salt. Should have lots of entropy.
70707 * @param {Number} [count=1000] The number of iterations. Higher numbers make the function slower but more secure.
70708 * @param {Number} [length] The length of the derived key. Defaults to the
70709 output size of the hash function.
70710 * @param {Object} [Prff=sjcl.misc.hmac] The pseudorandom function family.
70711 * @return {bitArray} the derived key.
70712 */
70713sjcl.misc.pbkdf2 = function (password, salt, count, length, Prff) {
70714 count = count || 1000;
70715
70716 if (length < 0 || count < 0) {
70717 throw sjcl.exception.invalid("invalid params to pbkdf2");
70718 }
70719
70720 if (typeof password === "string") {
70721 password = sjcl.codec.utf8String.toBits(password);
70722 }
70723
70724 if (typeof salt === "string") {
70725 salt = sjcl.codec.utf8String.toBits(salt);
70726 }
70727
70728 Prff = Prff || sjcl.misc.hmac;
70729
70730 var prf = new Prff(password),
70731 u, ui, i, j, k, out = [], b = sjcl.bitArray;
70732
70733 for (k = 1; 32 * out.length < (length || 1); k++) {
70734 u = ui = prf.encrypt(b.concat(salt,[k]));
70735
70736 for (i=1; i<count; i++) {
70737 ui = prf.encrypt(ui);
70738 for (j=0; j<ui.length; j++) {
70739 u[j] ^= ui[j];
70740 }
70741 }
70742
70743 out = out.concat(u);
70744 }
70745
70746 if (length) { out = b.clamp(out, length); }
70747
70748 return out;
70749};
70750
70751
70752//// sha256.js
70753
70754/** @fileOverview Javascript SHA-256 implementation.
70755 *
70756 * An older version of this implementation is available in the public
70757 * domain, but this one is (c) Emily Stark, Mike Hamburg, Dan Boneh,
70758 * Stanford University 2008-2010 and BSD-licensed for liability
70759 * reasons.
70760 *
70761 * Special thanks to Aldo Cortesi for pointing out several bugs in
70762 * this code.
70763 *
70764 * @author Emily Stark
70765 * @author Mike Hamburg
70766 * @author Dan Boneh
70767 */
70768
70769/**
70770 * Context for a SHA-256 operation in progress.
70771 * @constructor
70772 * @class Secure Hash Algorithm, 256 bits.
70773 */
70774sjcl.hash.sha256 = function (hash) {
70775 if (!this._key[0]) { this._precompute(); }
70776 if (hash) {
70777 this._h = hash._h.slice(0);
70778 this._buffer = hash._buffer.slice(0);
70779 this._length = hash._length;
70780 } else {
70781 this.reset();
70782 }
70783};
70784
70785/**
70786 * Hash a string or an array of words.
70787 * @static
70788 * @param {bitArray|String} data the data to hash.
70789 * @return {bitArray} The hash value, an array of 16 big-endian words.
70790 */
70791sjcl.hash.sha256.hash = function (data) {
70792 return (new sjcl.hash.sha256()).update(data).finalize();
70793};
70794
70795sjcl.hash.sha256.prototype = {
70796 /**
70797 * The hash's block size, in bits.
70798 * @constant
70799 */
70800 blockSize: 512,
70801
70802 /**
70803 * Reset the hash state.
70804 * @return this
70805 */
70806 reset:function () {
70807 this._h = this._init.slice(0);
70808 this._buffer = [];
70809 this._length = 0;
70810 return this;
70811 },
70812
70813 /**
70814 * Input several words to the hash.
70815 * @param {bitArray|String} data the data to hash.
70816 * @return this
70817 */
70818 update: function (data) {
70819 if (typeof data === "string") {
70820 data = sjcl.codec.utf8String.toBits(data);
70821 }
70822 var i, b = this._buffer = sjcl.bitArray.concat(this._buffer, data),
70823 ol = this._length,
70824 nl = this._length = ol + sjcl.bitArray.bitLength(data);
70825 for (i = 512+ol & -512; i <= nl; i+= 512) {
70826 this._block(b.splice(0,16));
70827 }
70828 return this;
70829 },
70830
70831 /**
70832 * Complete hashing and output the hash value.
70833 * @return {bitArray} The hash value, an array of 8 big-endian words.
70834 */
70835 finalize:function () {
70836 var i, b = this._buffer, h = this._h;
70837
70838 // Round out and push the buffer
70839 b = sjcl.bitArray.concat(b, [sjcl.bitArray.partial(1,1)]);
70840
70841 // Round out the buffer to a multiple of 16 words, less the 2 length words.
70842 for (i = b.length + 2; i & 15; i++) {
70843 b.push(0);
70844 }
70845
70846 // append the length
70847 b.push(Math.floor(this._length / 0x100000000));
70848 b.push(this._length | 0);
70849
70850 while (b.length) {
70851 this._block(b.splice(0,16));
70852 }
70853
70854 this.reset();
70855 return h;
70856 },
70857
70858 /**
70859 * The SHA-256 initialization vector, to be precomputed.
70860 * @private
70861 */
70862 _init:[],
70863 /*
70864 _init:[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],
70865 */
70866
70867 /**
70868 * The SHA-256 hash key, to be precomputed.
70869 * @private
70870 */
70871 _key:[],
70872 /*
70873 _key:
70874 [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
70875 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
70876 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
70877 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
70878 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
70879 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
70880 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
70881 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2],
70882 */
70883
70884
70885 /**
70886 * Function to precompute _init and _key.
70887 * @private
70888 */
70889 _precompute: function () {
70890 var i = 0, prime = 2, factor;
70891
70892 function frac(x) { return (x-Math.floor(x)) * 0x100000000 | 0; }
70893
70894 outer: for (; i<64; prime++) {
70895 for (factor=2; factor*factor <= prime; factor++) {
70896 if (prime % factor === 0) {
70897 // not a prime
70898 continue outer;
70899 }
70900 }
70901
70902 if (i<8) {
70903 this._init[i] = frac(Math.pow(prime, 1/2));
70904 }
70905 this._key[i] = frac(Math.pow(prime, 1/3));
70906 i++;
70907 }
70908 },
70909
70910 /**
70911 * Perform one cycle of SHA-256.
70912 * @param {bitArray} words one block of words.
70913 * @private
70914 */
70915 _block:function (words) {
70916 var i, tmp, a, b,
70917 w = words.slice(0),
70918 h = this._h,
70919 k = this._key,
70920 h0 = h[0], h1 = h[1], h2 = h[2], h3 = h[3],
70921 h4 = h[4], h5 = h[5], h6 = h[6], h7 = h[7];
70922
70923 /* Rationale for placement of |0 :
70924 * If a value can overflow is original 32 bits by a factor of more than a few
70925 * million (2^23 ish), there is a possibility that it might overflow the
70926 * 53-bit mantissa and lose precision.
70927 *
70928 * To avoid this, we clamp back to 32 bits by |'ing with 0 on any value that
70929 * propagates around the loop, and on the hash state h[]. I don't believe
70930 * that the clamps on h4 and on h0 are strictly necessary, but it's close
70931 * (for h4 anyway), and better safe than sorry.
70932 *
70933 * The clamps on h[] are necessary for the output to be correct even in the
70934 * common case and for short inputs.
70935 */
70936 for (i=0; i<64; i++) {
70937 // load up the input word for this round
70938 if (i<16) {
70939 tmp = w[i];
70940 } else {
70941 a = w[(i+1 ) & 15];
70942 b = w[(i+14) & 15];
70943 tmp = w[i&15] = ((a>>>7 ^ a>>>18 ^ a>>>3 ^ a<<25 ^ a<<14) +
70944 (b>>>17 ^ b>>>19 ^ b>>>10 ^ b<<15 ^ b<<13) +
70945 w[i&15] + w[(i+9) & 15]) | 0;
70946 }
70947
70948 tmp = (tmp + h7 + (h4>>>6 ^ h4>>>11 ^ h4>>>25 ^ h4<<26 ^ h4<<21 ^ h4<<7) + (h6 ^ h4&(h5^h6)) + k[i]); // | 0;
70949
70950 // shift register
70951 h7 = h6; h6 = h5; h5 = h4;
70952 h4 = h3 + tmp | 0;
70953 h3 = h2; h2 = h1; h1 = h0;
70954
70955 h0 = (tmp + ((h1&h2) ^ (h3&(h1^h2))) + (h1>>>2 ^ h1>>>13 ^ h1>>>22 ^ h1<<30 ^ h1<<19 ^ h1<<10)) | 0;
70956 }
70957
70958 h[0] = h[0]+h0 | 0;
70959 h[1] = h[1]+h1 | 0;
70960 h[2] = h[2]+h2 | 0;
70961 h[3] = h[3]+h3 | 0;
70962 h[4] = h[4]+h4 | 0;
70963 h[5] = h[5]+h5 | 0;
70964 h[6] = h[6]+h6 | 0;
70965 h[7] = h[7]+h7 | 0;
70966 }
70967};
70968</script>
70969 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
70970WORDLISTS["english"] = [
70971"abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse",
70972"access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act",
70973"action","actor","actress","actual","adapt","add","addict","address","adjust","admit",
70974"adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent",
70975"agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert",
70976"alien","all","alley","allow","almost","alone","alpha","already","also","alter",
70977"always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger",
70978"angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique",
70979"anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic",
70980"area","arena","argue","arm","armed","armor","army","around","arrange","arrest",
70981"arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset",
70982"assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction",
70983"audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake",
70984"aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge",
70985"bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain",
70986"barrel","base","basic","basket","battle","beach","bean","beauty","because","become",
70987"beef","before","begin","behave","behind","believe","below","belt","bench","benefit",
70988"best","betray","better","between","beyond","bicycle","bid","bike","bind","biology",
70989"bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless",
70990"blind","blood","blossom","blouse","blue","blur","blush","board","boat","body",
70991"boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss",
70992"bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread",
70993"breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze",
70994"broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb",
70995"bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy",
70996"butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call",
70997"calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas",
70998"canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry",
70999"cart","case","cash","casino","castle","casual","cat","catalog","catch","category",
71000"cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century",
71001"cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase",
71002"chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child",
71003"chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle",
71004"citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk",
71005"clever","click","client","cliff","climb","clinic","clip","clock","clog","close",
71006"cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut",
71007"code","coffee","coil","coin","collect","color","column","combine","come","comfort",
71008"comic","common","company","concert","conduct","confirm","congress","connect","consider","control",
71009"convince","cook","cool","copper","copy","coral","core","corn","correct","cost",
71010"cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle",
71011"craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek",
71012"crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial",
71013"cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup",
71014"cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad",
71015"damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal",
71016"debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense",
71017"define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny",
71018"depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk",
71019"despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond",
71020"diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur",
71021"direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance",
71022"divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain",
71023"donate","donkey","donor","door","dose","double","dove","draft","dragon","drama",
71024"drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop",
71025"drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf",
71026"dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo",
71027"ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow",
71028"elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody",
71029"embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless",
71030"endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough",
71031"enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip",
71032"era","erase","erode","erosion","error","erupt","escape","essay","essence","estate",
71033"eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange",
71034"excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit",
71035"exotic","expand","expect","expire","explain","expose","express","extend","extra","eye",
71036"eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame",
71037"family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father",
71038"fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female",
71039"fence","festival","fetch","fever","few","fiber","fiction","field","figure","file",
71040"film","filter","final","find","fine","finger","finish","fire","firm","first",
71041"fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor",
71042"flee","flight","flip","float","flock","floor","flower","fluid","flush","fly",
71043"foam","focus","fog","foil","fold","follow","food","foot","force","forest",
71044"forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile",
71045"frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen",
71046"fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy",
71047"gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp",
71048"gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture",
71049"ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance",
71050"glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue",
71051"goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown",
71052"grab","grace","grain","grant","grape","grass","gravity","great","green","grid",
71053"grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt",
71054"guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy",
71055"harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health",
71056"heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden",
71057"high","hill","hint","hip","hire","history","hobby","hockey","hold","hole",
71058"holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital",
71059"host","hotel","hour","hover","hub","huge","human","humble","humor","hundred",
71060"hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea",
71061"identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune",
71062"impact","impose","improve","impulse","inch","include","income","increase","index","indicate",
71063"indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury",
71064"inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install",
71065"intact","interest","into","invest","invite","involve","iron","island","isolate","issue",
71066"item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel",
71067"job","join","joke","journey","joy","judge","juice","jump","jungle","junior",
71068"junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney",
71069"kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife",
71070"knock","know","lab","label","labor","ladder","lady","lake","lamp","language",
71071"laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit",
71072"layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal",
71073"legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level",
71074"liar","liberty","library","license","life","lift","light","like","limb","limit",
71075"link","lion","liquid","list","little","live","lizard","load","loan","lobster",
71076"local","lock","logic","lonely","long","loop","lottery","loud","lounge","love",
71077"loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad",
71078"magic","magnet","maid","mail","main","major","make","mammal","man","manage",
71079"mandate","mango","mansion","manual","maple","marble","march","margin","marine","market",
71080"marriage","mask","mass","master","match","material","math","matrix","matter","maximum",
71081"maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt",
71082"member","memory","mention","menu","mercy","merge","merit","merry","mesh","message",
71083"metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor",
71084"minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile",
71085"model","modify","mom","moment","monitor","monkey","monster","month","moon","moral",
71086"more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie",
71087"much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual",
71088"myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature",
71089"near","neck","need","negative","neglect","neither","nephew","nerve","nest","net",
71090"network","neutral","never","news","next","nice","night","noble","noise","nominee",
71091"noodle","normal","north","nose","notable","note","nothing","notice","novel","now",
71092"nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe",
71093"obtain","obvious","occur","ocean","october","odor","off","offer","office","often",
71094"oil","okay","old","olive","olympic","omit","once","one","onion","online",
71095"only","open","opera","opinion","oppose","option","orange","orbit","orchard","order",
71096"ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output",
71097"outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact",
71098"paddle","page","pair","palace","palm","panda","panel","panic","panther","paper",
71099"parade","parent","park","parrot","party","pass","patch","path","patient","patrol",
71100"pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen",
71101"penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo",
71102"phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot",
71103"pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate",
71104"play","please","pledge","pluck","plug","plunge","poem","poet","point","polar",
71105"pole","police","pond","pony","pool","popular","portion","position","possible","post",
71106"potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare",
71107"present","pretty","prevent","price","pride","primary","print","priority","prison","private",
71108"prize","problem","process","produce","profit","program","project","promote","proof","property",
71109"prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin",
71110"punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle",
71111"pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit",
71112"raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp",
71113"ranch","random","range","rapid","rare","rate","rather","raven","raw","razor",
71114"ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle",
71115"reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release",
71116"relief","rely","remain","remember","remind","remove","render","renew","rent","reopen",
71117"repair","repeat","replace","report","require","rescue","resemble","resist","resource","response",
71118"result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib",
71119"ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot",
71120"ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket",
71121"romance","roof","rookie","room","rose","rotate","rough","round","route","royal",
71122"rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness",
71123"safe","sail","salad","salmon","salon","salt","salute","same","sample","sand",
71124"satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter",
71125"scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script",
71126"scrub","sea","search","season","seat","second","secret","section","security","seed",
71127"seek","segment","select","sell","seminar","senior","sense","sentence","series","service",
71128"session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell",
71129"sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop",
71130"short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side",
71131"siege","sight","sign","silent","silk","silly","silver","similar","simple","since",
71132"sing","siren","sister","situate","six","size","skate","sketch","ski","skill",
71133"skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight",
71134"slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth",
71135"snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda",
71136"soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry",
71137"sort","soul","sound","soup","source","south","space","spare","spatial","spawn",
71138"speak","special","speed","spell","spend","sphere","spice","spider","spike","spin",
71139"spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring",
71140"spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp",
71141"stand","start","state","stay","steak","steel","stem","step","stereo","stick",
71142"still","sting","stock","stomach","stone","stool","story","stove","strategy","street",
71143"strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway",
71144"success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny",
71145"sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey",
71146"suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim",
71147"swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag",
71148"tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi",
71149"teach","team","tell","ten","tenant","tennis","tent","term","test","text",
71150"thank","that","theme","then","theory","there","they","thing","this","thought",
71151"three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber",
71152"time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler",
71153"toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool",
71154"tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist",
71155"toward","tower","town","toy","track","trade","traffic","tragic","train","transfer",
71156"trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick",
71157"trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust",
71158"truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle",
71159"twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella",
71160"unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform",
71161"unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade",
71162"uphold","upon","upper","upset","urban","urge","usage","use","used","useful",
71163"useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van",
71164"vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue",
71165"verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory",
71166"video","view","village","vintage","violin","virtual","virus","visa","visit","visual",
71167"vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage",
71168"wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash",
71169"wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather",
71170"web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat",
71171"wheel","when","where","whip","whisper","wide","width","wife","wild","will",
71172"win","window","wine","wing","wink","winner","winter","wire","wisdom","wise",
71173"wish","witness","wolf","woman","wonder","wood","wool","word","work","world",
71174"worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year",
71175"yellow","you","young","youth","zebra","zero","zone","zoo"]
71176</script>
71177 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
71178WORDLISTS["japanese"] = [
71179"あいこくしん", "あいさつ", "あいだ", "あおぞら", "あかちゃん", "あきる", "あけがた", "あける", "あこがれる", "あさい",
71180"あさひ", "あしあと", "あじわう", "あずかる", "あずき", "あそぶ", "あたえる", "あたためる", "あたりまえ", "あたる",
71181"あつい", "あつかう", "あっしゅく", "あつまり", "あつめる", "あてな", "あてはまる", "あひる", "あぶら", "あぶる",
71182"あふれる", "あまい", "あまど", "あまやかす", "あまり", "あみもの", "あめりか", "あやまる", "あゆむ", "あらいぐま",
71183"あらし", "あらすじ", "あらためる", "あらゆる", "あらわす", "ありがとう", "あわせる", "あわてる", "あんい", "あんがい",
71184"あんこ", "あんぜん", "あんてい", "あんない", "あんまり", "いいだす", "いおん", "いがい", "いがく", "いきおい",
71185"いきなり", "いきもの", "いきる", "いくじ", "いくぶん", "いけばな", "いけん", "いこう", "いこく", "いこつ",
71186"いさましい", "いさん", "いしき", "いじゅう", "いじょう", "いじわる", "いずみ", "いずれ", "いせい", "いせえび",
71187"いせかい", "いせき", "いぜん", "いそうろう", "いそがしい", "いだい", "いだく", "いたずら", "いたみ", "いたりあ",
71188"いちおう", "いちじ", "いちど", "いちば", "いちぶ", "いちりゅう", "いつか", "いっしゅん", "いっせい", "いっそう",
71189"いったん", "いっち", "いってい", "いっぽう", "いてざ", "いてん", "いどう", "いとこ", "いない", "いなか",
71190"いねむり", "いのち", "いのる", "いはつ", "いばる", "いはん", "いびき", "いひん", "いふく", "いへん",
71191"いほう", "いみん", "いもうと", "いもたれ", "いもり", "いやがる", "いやす", "いよかん", "いよく", "いらい",
71192"いらすと", "いりぐち", "いりょう", "いれい", "いれもの", "いれる", "いろえんぴつ", "いわい", "いわう", "いわかん",
71193"いわば", "いわゆる", "いんげんまめ", "いんさつ", "いんしょう", "いんよう", "うえき", "うえる", "うおざ", "うがい",
71194"うかぶ", "うかべる", "うきわ", "うくらいな", "うくれれ", "うけたまわる", "うけつけ", "うけとる", "うけもつ", "うける",
71195"うごかす", "うごく", "うこん", "うさぎ", "うしなう", "うしろがみ", "うすい", "うすぎ", "うすぐらい", "うすめる",
71196"うせつ", "うちあわせ", "うちがわ", "うちき", "うちゅう", "うっかり", "うつくしい", "うったえる", "うつる", "うどん",
71197"うなぎ", "うなじ", "うなずく", "うなる", "うねる", "うのう", "うぶげ", "うぶごえ", "うまれる", "うめる",
71198"うもう", "うやまう", "うよく", "うらがえす", "うらぐち", "うらない", "うりあげ", "うりきれ", "うるさい", "うれしい",
71199"うれゆき", "うれる", "うろこ", "うわき", "うわさ", "うんこう", "うんちん", "うんてん", "うんどう", "えいえん",
71200"えいが", "えいきょう", "えいご", "えいせい", "えいぶん", "えいよう", "えいわ", "えおり", "えがお", "えがく",
71201"えきたい", "えくせる", "えしゃく", "えすて", "えつらん", "えのぐ", "えほうまき", "えほん", "えまき", "えもじ",
71202"えもの", "えらい", "えらぶ", "えりあ", "えんえん", "えんかい", "えんぎ", "えんげき", "えんしゅう", "えんぜつ",
71203"えんそく", "えんちょう", "えんとつ", "おいかける", "おいこす", "おいしい", "おいつく", "おうえん", "おうさま", "おうじ",
71204"おうせつ", "おうたい", "おうふく", "おうべい", "おうよう", "おえる", "おおい", "おおう", "おおどおり", "おおや",
71205"おおよそ", "おかえり", "おかず", "おがむ", "おかわり", "おぎなう", "おきる", "おくさま", "おくじょう", "おくりがな",
71206"おくる", "おくれる", "おこす", "おこなう", "おこる", "おさえる", "おさない", "おさめる", "おしいれ", "おしえる",
71207"おじぎ", "おじさん", "おしゃれ", "おそらく", "おそわる", "おたがい", "おたく", "おだやか", "おちつく", "おっと",
71208"おつり", "おでかけ", "おとしもの", "おとなしい", "おどり", "おどろかす", "おばさん", "おまいり", "おめでとう", "おもいで",
71209"おもう", "おもたい", "おもちゃ", "おやつ", "おやゆび", "およぼす", "おらんだ", "おろす", "おんがく", "おんけい",
71210"おんしゃ", "おんせん", "おんだん", "おんちゅう", "おんどけい", "かあつ", "かいが", "がいき", "がいけん", "がいこう",
71211"かいさつ", "かいしゃ", "かいすいよく", "かいぜん", "かいぞうど", "かいつう", "かいてん", "かいとう", "かいふく", "がいへき",
71212"かいほう", "かいよう", "がいらい", "かいわ", "かえる", "かおり", "かかえる", "かがく", "かがし", "かがみ",
71213"かくご", "かくとく", "かざる", "がぞう", "かたい", "かたち", "がちょう", "がっきゅう", "がっこう", "がっさん",
71214"がっしょう", "かなざわし", "かのう", "がはく", "かぶか", "かほう", "かほご", "かまう", "かまぼこ", "かめれおん",
71215"かゆい", "かようび", "からい", "かるい", "かろう", "かわく", "かわら", "がんか", "かんけい", "かんこう",
71216"かんしゃ", "かんそう", "かんたん", "かんち", "がんばる", "きあい", "きあつ", "きいろ", "ぎいん", "きうい",
71217"きうん", "きえる", "きおう", "きおく", "きおち", "きおん", "きかい", "きかく", "きかんしゃ", "ききて",
71218"きくばり", "きくらげ", "きけんせい", "きこう", "きこえる", "きこく", "きさい", "きさく", "きさま", "きさらぎ",
71219"ぎじかがく", "ぎしき", "ぎじたいけん", "ぎじにってい", "ぎじゅつしゃ", "きすう", "きせい", "きせき", "きせつ", "きそう",
71220"きぞく", "きぞん", "きたえる", "きちょう", "きつえん", "ぎっちり", "きつつき", "きつね", "きてい", "きどう",
71221"きどく", "きない", "きなが", "きなこ", "きぬごし", "きねん", "きのう", "きのした", "きはく", "きびしい",
71222"きひん", "きふく", "きぶん", "きぼう", "きほん", "きまる", "きみつ", "きむずかしい", "きめる", "きもだめし",
71223"きもち", "きもの", "きゃく", "きやく", "ぎゅうにく", "きよう", "きょうりゅう", "きらい", "きらく", "きりん",
71224"きれい", "きれつ", "きろく", "ぎろん", "きわめる", "ぎんいろ", "きんかくじ", "きんじょ", "きんようび", "ぐあい",
71225"くいず", "くうかん", "くうき", "くうぐん", "くうこう", "ぐうせい", "くうそう", "ぐうたら", "くうふく", "くうぼ",
71226"くかん", "くきょう", "くげん", "ぐこう", "くさい", "くさき", "くさばな", "くさる", "くしゃみ", "くしょう",
71227"くすのき", "くすりゆび", "くせげ", "くせん", "ぐたいてき", "くださる", "くたびれる", "くちこみ", "くちさき", "くつした",
71228"ぐっすり", "くつろぐ", "くとうてん", "くどく", "くなん", "くねくね", "くのう", "くふう", "くみあわせ", "くみたてる",
71229"くめる", "くやくしょ", "くらす", "くらべる", "くるま", "くれる", "くろう", "くわしい", "ぐんかん", "ぐんしょく",
71230"ぐんたい", "ぐんて", "けあな", "けいかく", "けいけん", "けいこ", "けいさつ", "げいじゅつ", "けいたい", "げいのうじん",
71231"けいれき", "けいろ", "けおとす", "けおりもの", "げきか", "げきげん", "げきだん", "げきちん", "げきとつ", "げきは",
71232"げきやく", "げこう", "げこくじょう", "げざい", "けさき", "げざん", "けしき", "けしごむ", "けしょう", "げすと",
71233"けたば", "けちゃっぷ", "けちらす", "けつあつ", "けつい", "けつえき", "けっこん", "けつじょ", "けっせき", "けってい",
71234"けつまつ", "げつようび", "げつれい", "けつろん", "げどく", "けとばす", "けとる", "けなげ", "けなす", "けなみ",
71235"けぬき", "げねつ", "けねん", "けはい", "げひん", "けぶかい", "げぼく", "けまり", "けみかる", "けむし",
71236"けむり", "けもの", "けらい", "けろけろ", "けわしい", "けんい", "けんえつ", "けんお", "けんか", "げんき",
71237"けんげん", "けんこう", "けんさく", "けんしゅう", "けんすう", "げんそう", "けんちく", "けんてい", "けんとう", "けんない",
71238"けんにん", "げんぶつ", "けんま", "けんみん", "けんめい", "けんらん", "けんり", "こあくま", "こいぬ", "こいびと",
71239"ごうい", "こうえん", "こうおん", "こうかん", "ごうきゅう", "ごうけい", "こうこう", "こうさい", "こうじ", "こうすい",
71240"ごうせい", "こうそく", "こうたい", "こうちゃ", "こうつう", "こうてい", "こうどう", "こうない", "こうはい", "ごうほう",
71241"ごうまん", "こうもく", "こうりつ", "こえる", "こおり", "ごかい", "ごがつ", "ごかん", "こくご", "こくさい",
71242"こくとう", "こくない", "こくはく", "こぐま", "こけい", "こける", "ここのか", "こころ", "こさめ", "こしつ",
71243"こすう", "こせい", "こせき", "こぜん", "こそだて", "こたい", "こたえる", "こたつ", "こちょう", "こっか",
71244"こつこつ", "こつばん", "こつぶ", "こてい", "こてん", "ことがら", "ことし", "ことば", "ことり", "こなごな",
71245"こねこね", "このまま", "このみ", "このよ", "ごはん", "こひつじ", "こふう", "こふん", "こぼれる", "ごまあぶら",
71246"こまかい", "ごますり", "こまつな", "こまる", "こむぎこ", "こもじ", "こもち", "こもの", "こもん", "こやく",
71247"こやま", "こゆう", "こゆび", "こよい", "こよう", "こりる", "これくしょん", "ころっけ", "こわもて", "こわれる",
71248"こんいん", "こんかい", "こんき", "こんしゅう", "こんすい", "こんだて", "こんとん", "こんなん", "こんびに", "こんぽん",
71249"こんまけ", "こんや", "こんれい", "こんわく", "ざいえき", "さいかい", "さいきん", "ざいげん", "ざいこ", "さいしょ",
71250"さいせい", "ざいたく", "ざいちゅう", "さいてき", "ざいりょう", "さうな", "さかいし", "さがす", "さかな", "さかみち",
71251"さがる", "さぎょう", "さくし", "さくひん", "さくら", "さこく", "さこつ", "さずかる", "ざせき", "さたん",
71252"さつえい", "ざつおん", "ざっか", "ざつがく", "さっきょく", "ざっし", "さつじん", "ざっそう", "さつたば", "さつまいも",
71253"さてい", "さといも", "さとう", "さとおや", "さとし", "さとる", "さのう", "さばく", "さびしい", "さべつ",
71254"さほう", "さほど", "さます", "さみしい", "さみだれ", "さむけ", "さめる", "さやえんどう", "さゆう", "さよう",
71255"さよく", "さらだ", "ざるそば", "さわやか", "さわる", "さんいん", "さんか", "さんきゃく", "さんこう", "さんさい",
71256"ざんしょ", "さんすう", "さんせい", "さんそ", "さんち", "さんま", "さんみ", "さんらん", "しあい", "しあげ",
71257"しあさって", "しあわせ", "しいく", "しいん", "しうち", "しえい", "しおけ", "しかい", "しかく", "じかん",
71258"しごと", "しすう", "じだい", "したうけ", "したぎ", "したて", "したみ", "しちょう", "しちりん", "しっかり",
71259"しつじ", "しつもん", "してい", "してき", "してつ", "じてん", "じどう", "しなぎれ", "しなもの", "しなん",
71260"しねま", "しねん", "しのぐ", "しのぶ", "しはい", "しばかり", "しはつ", "しはらい", "しはん", "しひょう",
71261"しふく", "じぶん", "しへい", "しほう", "しほん", "しまう", "しまる", "しみん", "しむける", "じむしょ",
71262"しめい", "しめる", "しもん", "しゃいん", "しゃうん", "しゃおん", "じゃがいも", "しやくしょ", "しゃくほう", "しゃけん",
71263"しゃこ", "しゃざい", "しゃしん", "しゃせん", "しゃそう", "しゃたい", "しゃちょう", "しゃっきん", "じゃま", "しゃりん",
71264"しゃれい", "じゆう", "じゅうしょ", "しゅくはく", "じゅしん", "しゅっせき", "しゅみ", "しゅらば", "じゅんばん", "しょうかい",
71265"しょくたく", "しょっけん", "しょどう", "しょもつ", "しらせる", "しらべる", "しんか", "しんこう", "じんじゃ", "しんせいじ",
71266"しんちく", "しんりん", "すあげ", "すあし", "すあな", "ずあん", "すいえい", "すいか", "すいとう", "ずいぶん",
71267"すいようび", "すうがく", "すうじつ", "すうせん", "すおどり", "すきま", "すくう", "すくない", "すける", "すごい",
71268"すこし", "ずさん", "すずしい", "すすむ", "すすめる", "すっかり", "ずっしり", "ずっと", "すてき", "すてる",
71269"すねる", "すのこ", "すはだ", "すばらしい", "ずひょう", "ずぶぬれ", "すぶり", "すふれ", "すべて", "すべる",
71270"ずほう", "すぼん", "すまい", "すめし", "すもう", "すやき", "すらすら", "するめ", "すれちがう", "すろっと",
71271"すわる", "すんぜん", "すんぽう", "せあぶら", "せいかつ", "せいげん", "せいじ", "せいよう", "せおう", "せかいかん",
71272"せきにん", "せきむ", "せきゆ", "せきらんうん", "せけん", "せこう", "せすじ", "せたい", "せたけ", "せっかく",
71273"せっきゃく", "ぜっく", "せっけん", "せっこつ", "せっさたくま", "せつぞく", "せつだん", "せつでん", "せっぱん", "せつび",
71274"せつぶん", "せつめい", "せつりつ", "せなか", "せのび", "せはば", "せびろ", "せぼね", "せまい", "せまる",
71275"せめる", "せもたれ", "せりふ", "ぜんあく", "せんい", "せんえい", "せんか", "せんきょ", "せんく", "せんげん",
71276"ぜんご", "せんさい", "せんしゅ", "せんすい", "せんせい", "せんぞ", "せんたく", "せんちょう", "せんてい", "せんとう",
71277"せんぬき", "せんねん", "せんぱい", "ぜんぶ", "ぜんぽう", "せんむ", "せんめんじょ", "せんもん", "せんやく", "せんゆう",
71278"せんよう", "ぜんら", "ぜんりゃく", "せんれい", "せんろ", "そあく", "そいとげる", "そいね", "そうがんきょう", "そうき",
71279"そうご", "そうしん", "そうだん", "そうなん", "そうび", "そうめん", "そうり", "そえもの", "そえん", "そがい",
71280"そげき", "そこう", "そこそこ", "そざい", "そしな", "そせい", "そせん", "そそぐ", "そだてる", "そつう",
71281"そつえん", "そっかん", "そつぎょう", "そっけつ", "そっこう", "そっせん", "そっと", "そとがわ", "そとづら", "そなえる",
71282"そなた", "そふぼ", "そぼく", "そぼろ", "そまつ", "そまる", "そむく", "そむりえ", "そめる", "そもそも",
71283"そよかぜ", "そらまめ", "そろう", "そんかい", "そんけい", "そんざい", "そんしつ", "そんぞく", "そんちょう", "ぞんび",
71284"ぞんぶん", "そんみん", "たあい", "たいいん", "たいうん", "たいえき", "たいおう", "だいがく", "たいき", "たいぐう",
71285"たいけん", "たいこ", "たいざい", "だいじょうぶ", "だいすき", "たいせつ", "たいそう", "だいたい", "たいちょう", "たいてい",
71286"だいどころ", "たいない", "たいねつ", "たいのう", "たいはん", "だいひょう", "たいふう", "たいへん", "たいほ", "たいまつばな",
71287"たいみんぐ", "たいむ", "たいめん", "たいやき", "たいよう", "たいら", "たいりょく", "たいる", "たいわん", "たうえ",
71288"たえる", "たおす", "たおる", "たおれる", "たかい", "たかね", "たきび", "たくさん", "たこく", "たこやき",
71289"たさい", "たしざん", "だじゃれ", "たすける", "たずさわる", "たそがれ", "たたかう", "たたく", "ただしい", "たたみ",
71290"たちばな", "だっかい", "だっきゃく", "だっこ", "だっしゅつ", "だったい", "たてる", "たとえる", "たなばた", "たにん",
71291"たぬき", "たのしみ", "たはつ", "たぶん", "たべる", "たぼう", "たまご", "たまる", "だむる", "ためいき",
71292"ためす", "ためる", "たもつ", "たやすい", "たよる", "たらす", "たりきほんがん", "たりょう", "たりる", "たると",
71293"たれる", "たれんと", "たろっと", "たわむれる", "だんあつ", "たんい", "たんおん", "たんか", "たんき", "たんけん",
71294"たんご", "たんさん", "たんじょうび", "だんせい", "たんそく", "たんたい", "だんち", "たんてい", "たんとう", "だんな",
71295"たんにん", "だんねつ", "たんのう", "たんぴん", "だんぼう", "たんまつ", "たんめい", "だんれつ", "だんろ", "だんわ",
71296"ちあい", "ちあん", "ちいき", "ちいさい", "ちえん", "ちかい", "ちから", "ちきゅう", "ちきん", "ちけいず",
71297"ちけん", "ちこく", "ちさい", "ちしき", "ちしりょう", "ちせい", "ちそう", "ちたい", "ちたん", "ちちおや",
71298"ちつじょ", "ちてき", "ちてん", "ちぬき", "ちぬり", "ちのう", "ちひょう", "ちへいせん", "ちほう", "ちまた",
71299"ちみつ", "ちみどろ", "ちめいど", "ちゃんこなべ", "ちゅうい", "ちゆりょく", "ちょうし", "ちょさくけん", "ちらし", "ちらみ",
71300"ちりがみ", "ちりょう", "ちるど", "ちわわ", "ちんたい", "ちんもく", "ついか", "ついたち", "つうか", "つうじょう",
71301"つうはん", "つうわ", "つかう", "つかれる", "つくね", "つくる", "つけね", "つける", "つごう", "つたえる",
71302"つづく", "つつじ", "つつむ", "つとめる", "つながる", "つなみ", "つねづね", "つのる", "つぶす", "つまらない",
71303"つまる", "つみき", "つめたい", "つもり", "つもる", "つよい", "つるぼ", "つるみく", "つわもの", "つわり",
71304"てあし", "てあて", "てあみ", "ていおん", "ていか", "ていき", "ていけい", "ていこく", "ていさつ", "ていし",
71305"ていせい", "ていたい", "ていど", "ていねい", "ていひょう", "ていへん", "ていぼう", "てうち", "ておくれ", "てきとう",
71306"てくび", "でこぼこ", "てさぎょう", "てさげ", "てすり", "てそう", "てちがい", "てちょう", "てつがく", "てつづき",
71307"でっぱ", "てつぼう", "てつや", "でぬかえ", "てぬき", "てぬぐい", "てのひら", "てはい", "てぶくろ", "てふだ",
71308"てほどき", "てほん", "てまえ", "てまきずし", "てみじか", "てみやげ", "てらす", "てれび", "てわけ", "てわたし",
71309"でんあつ", "てんいん", "てんかい", "てんき", "てんぐ", "てんけん", "てんごく", "てんさい", "てんし", "てんすう",
71310"でんち", "てんてき", "てんとう", "てんない", "てんぷら", "てんぼうだい", "てんめつ", "てんらんかい", "でんりょく", "でんわ",
71311"どあい", "といれ", "どうかん", "とうきゅう", "どうぐ", "とうし", "とうむぎ", "とおい", "とおか", "とおく",
71312"とおす", "とおる", "とかい", "とかす", "ときおり", "ときどき", "とくい", "とくしゅう", "とくてん", "とくに",
71313"とくべつ", "とけい", "とける", "とこや", "とさか", "としょかん", "とそう", "とたん", "とちゅう", "とっきゅう",
71314"とっくん", "とつぜん", "とつにゅう", "とどける", "ととのえる", "とない", "となえる", "となり", "とのさま", "とばす",
71315"どぶがわ", "とほう", "とまる", "とめる", "ともだち", "ともる", "どようび", "とらえる", "とんかつ", "どんぶり",
71316"ないかく", "ないこう", "ないしょ", "ないす", "ないせん", "ないそう", "なおす", "ながい", "なくす", "なげる",
71317"なこうど", "なさけ", "なたでここ", "なっとう", "なつやすみ", "ななおし", "なにごと", "なにもの", "なにわ", "なのか",
71318"なふだ", "なまいき", "なまえ", "なまみ", "なみだ", "なめらか", "なめる", "なやむ", "ならう", "ならび",
71319"ならぶ", "なれる", "なわとび", "なわばり", "にあう", "にいがた", "にうけ", "におい", "にかい", "にがて",
71320"にきび", "にくしみ", "にくまん", "にげる", "にさんかたんそ", "にしき", "にせもの", "にちじょう", "にちようび", "にっか",
71321"にっき", "にっけい", "にっこう", "にっさん", "にっしょく", "にっすう", "にっせき", "にってい", "になう", "にほん",
71322"にまめ", "にもつ", "にやり", "にゅういん", "にりんしゃ", "にわとり", "にんい", "にんか", "にんき", "にんげん",
71323"にんしき", "にんずう", "にんそう", "にんたい", "にんち", "にんてい", "にんにく", "にんぷ", "にんまり", "にんむ",
71324"にんめい", "にんよう", "ぬいくぎ", "ぬかす", "ぬぐいとる", "ぬぐう", "ぬくもり", "ぬすむ", "ぬまえび", "ぬめり",
71325"ぬらす", "ぬんちゃく", "ねあげ", "ねいき", "ねいる", "ねいろ", "ねぐせ", "ねくたい", "ねくら", "ねこぜ",
71326"ねこむ", "ねさげ", "ねすごす", "ねそべる", "ねだん", "ねつい", "ねっしん", "ねつぞう", "ねったいぎょ", "ねぶそく",
71327"ねふだ", "ねぼう", "ねほりはほり", "ねまき", "ねまわし", "ねみみ", "ねむい", "ねむたい", "ねもと", "ねらう",
71328"ねわざ", "ねんいり", "ねんおし", "ねんかん", "ねんきん", "ねんぐ", "ねんざ", "ねんし", "ねんちゃく", "ねんど",
71329"ねんぴ", "ねんぶつ", "ねんまつ", "ねんりょう", "ねんれい", "のいず", "のおづま", "のがす", "のきなみ", "のこぎり",
71330"のこす", "のこる", "のせる", "のぞく", "のぞむ", "のたまう", "のちほど", "のっく", "のばす", "のはら",
71331"のべる", "のぼる", "のみもの", "のやま", "のらいぬ", "のらねこ", "のりもの", "のりゆき", "のれん", "のんき",
71332"ばあい", "はあく", "ばあさん", "ばいか", "ばいく", "はいけん", "はいご", "はいしん", "はいすい", "はいせん",
71333"はいそう", "はいち", "ばいばい", "はいれつ", "はえる", "はおる", "はかい", "ばかり", "はかる", "はくしゅ",
71334"はけん", "はこぶ", "はさみ", "はさん", "はしご", "ばしょ", "はしる", "はせる", "ぱそこん", "はそん",
71335"はたん", "はちみつ", "はつおん", "はっかく", "はづき", "はっきり", "はっくつ", "はっけん", "はっこう", "はっさん",
71336"はっしん", "はったつ", "はっちゅう", "はってん", "はっぴょう", "はっぽう", "はなす", "はなび", "はにかむ", "はぶらし",
71337"はみがき", "はむかう", "はめつ", "はやい", "はやし", "はらう", "はろうぃん", "はわい", "はんい", "はんえい",
71338"はんおん", "はんかく", "はんきょう", "ばんぐみ", "はんこ", "はんしゃ", "はんすう", "はんだん", "ぱんち", "ぱんつ",
71339"はんてい", "はんとし", "はんのう", "はんぱ", "はんぶん", "はんぺん", "はんぼうき", "はんめい", "はんらん", "はんろん",
71340"ひいき", "ひうん", "ひえる", "ひかく", "ひかり", "ひかる", "ひかん", "ひくい", "ひけつ", "ひこうき",
71341"ひこく", "ひさい", "ひさしぶり", "ひさん", "びじゅつかん", "ひしょ", "ひそか", "ひそむ", "ひたむき", "ひだり",
71342"ひたる", "ひつぎ", "ひっこし", "ひっし", "ひつじゅひん", "ひっす", "ひつぜん", "ぴったり", "ぴっちり", "ひつよう",
71343"ひてい", "ひとごみ", "ひなまつり", "ひなん", "ひねる", "ひはん", "ひびく", "ひひょう", "ひほう", "ひまわり",
71344"ひまん", "ひみつ", "ひめい", "ひめじし", "ひやけ", "ひやす", "ひよう", "びょうき", "ひらがな", "ひらく",
71345"ひりつ", "ひりょう", "ひるま", "ひるやすみ", "ひれい", "ひろい", "ひろう", "ひろき", "ひろゆき", "ひんかく",
71346"ひんけつ", "ひんこん", "ひんしゅ", "ひんそう", "ぴんち", "ひんぱん", "びんぼう", "ふあん", "ふいうち", "ふうけい",
71347"ふうせん", "ぷうたろう", "ふうとう", "ふうふ", "ふえる", "ふおん", "ふかい", "ふきん", "ふくざつ", "ふくぶくろ",
71348"ふこう", "ふさい", "ふしぎ", "ふじみ", "ふすま", "ふせい", "ふせぐ", "ふそく", "ぶたにく", "ふたん",
71349"ふちょう", "ふつう", "ふつか", "ふっかつ", "ふっき", "ふっこく", "ぶどう", "ふとる", "ふとん", "ふのう",
71350"ふはい", "ふひょう", "ふへん", "ふまん", "ふみん", "ふめつ", "ふめん", "ふよう", "ふりこ", "ふりる",
71351"ふるい", "ふんいき", "ぶんがく", "ぶんぐ", "ふんしつ", "ぶんせき", "ふんそう", "ぶんぽう", "へいあん", "へいおん",
71352"へいがい", "へいき", "へいげん", "へいこう", "へいさ", "へいしゃ", "へいせつ", "へいそ", "へいたく", "へいてん",
71353"へいねつ", "へいわ", "へきが", "へこむ", "べにいろ", "べにしょうが", "へらす", "へんかん", "べんきょう", "べんごし",
71354"へんさい", "へんたい", "べんり", "ほあん", "ほいく", "ぼうぎょ", "ほうこく", "ほうそう", "ほうほう", "ほうもん",
71355"ほうりつ", "ほえる", "ほおん", "ほかん", "ほきょう", "ぼきん", "ほくろ", "ほけつ", "ほけん", "ほこう",
71356"ほこる", "ほしい", "ほしつ", "ほしゅ", "ほしょう", "ほせい", "ほそい", "ほそく", "ほたて", "ほたる",
71357"ぽちぶくろ", "ほっきょく", "ほっさ", "ほったん", "ほとんど", "ほめる", "ほんい", "ほんき", "ほんけ", "ほんしつ",
71358"ほんやく", "まいにち", "まかい", "まかせる", "まがる", "まける", "まこと", "まさつ", "まじめ", "ますく",
71359"まぜる", "まつり", "まとめ", "まなぶ", "まぬけ", "まねく", "まほう", "まもる", "まゆげ", "まよう",
71360"まろやか", "まわす", "まわり", "まわる", "まんが", "まんきつ", "まんぞく", "まんなか", "みいら", "みうち",
71361"みえる", "みがく", "みかた", "みかん", "みけん", "みこん", "みじかい", "みすい", "みすえる", "みせる",
71362"みっか", "みつかる", "みつける", "みてい", "みとめる", "みなと", "みなみかさい", "みねらる", "みのう", "みのがす",
71363"みほん", "みもと", "みやげ", "みらい", "みりょく", "みわく", "みんか", "みんぞく", "むいか", "むえき",
71364"むえん", "むかい", "むかう", "むかえ", "むかし", "むぎちゃ", "むける", "むげん", "むさぼる", "むしあつい",
71365"むしば", "むじゅん", "むしろ", "むすう", "むすこ", "むすぶ", "むすめ", "むせる", "むせん", "むちゅう",
71366"むなしい", "むのう", "むやみ", "むよう", "むらさき", "むりょう", "むろん", "めいあん", "めいうん", "めいえん",
71367"めいかく", "めいきょく", "めいさい", "めいし", "めいそう", "めいぶつ", "めいれい", "めいわく", "めぐまれる", "めざす",
71368"めした", "めずらしい", "めだつ", "めまい", "めやす", "めんきょ", "めんせき", "めんどう", "もうしあげる", "もうどうけん",
71369"もえる", "もくし", "もくてき", "もくようび", "もちろん", "もどる", "もらう", "もんく", "もんだい", "やおや",
71370"やける", "やさい", "やさしい", "やすい", "やすたろう", "やすみ", "やせる", "やそう", "やたい", "やちん",
71371"やっと", "やっぱり", "やぶる", "やめる", "ややこしい", "やよい", "やわらかい", "ゆうき", "ゆうびんきょく", "ゆうべ",
71372"ゆうめい", "ゆけつ", "ゆしゅつ", "ゆせん", "ゆそう", "ゆたか", "ゆちゃく", "ゆでる", "ゆにゅう", "ゆびわ",
71373"ゆらい", "ゆれる", "ようい", "ようか", "ようきゅう", "ようじ", "ようす", "ようちえん", "よかぜ", "よかん",
71374"よきん", "よくせい", "よくぼう", "よけい", "よごれる", "よさん", "よしゅう", "よそう", "よそく", "よっか",
71375"よてい", "よどがわく", "よねつ", "よやく", "よゆう", "よろこぶ", "よろしい", "らいう", "らくがき", "らくご",
71376"らくさつ", "らくだ", "らしんばん", "らせん", "らぞく", "らたい", "らっか", "られつ", "りえき", "りかい",
71377"りきさく", "りきせつ", "りくぐん", "りくつ", "りけん", "りこう", "りせい", "りそう", "りそく", "りてん",
71378"りねん", "りゆう", "りゅうがく", "りよう", "りょうり", "りょかん", "りょくちゃ", "りょこう", "りりく", "りれき",
71379"りろん", "りんご", "るいけい", "るいさい", "るいじ", "るいせき", "るすばん", "るりがわら", "れいかん", "れいぎ",
71380"れいせい", "れいぞうこ", "れいとう", "れいぼう", "れきし", "れきだい", "れんあい", "れんけい", "れんこん", "れんさい",
71381"れんしゅう", "れんぞく", "れんらく", "ろうか", "ろうご", "ろうじん", "ろうそく", "ろくが", "ろこつ", "ろじうら",
71382"ろしゅつ", "ろせん", "ろてん", "ろめん", "ろれつ", "ろんぎ", "ろんぱ", "ろんぶん", "ろんり", "わかす",
71383"わかめ", "わかやま", "わかれる", "わしつ", "わじまし", "わすれもの", "わらう", "われる"]
71384</script>
71385 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
71386WORDLISTS["spanish"] = [
71387"ábaco", "abdomen", "abeja", "abierto", "abogado", "abono", "aborto", "abrazo", "abrir", "abuelo",
71388"abuso", "acabar", "academia", "acceso", "acción", "aceite", "acelga", "acento", "aceptar", "ácido",
71389"aclarar", "acné", "acoger", "acoso", "activo", "acto", "actriz", "actuar", "acudir", "acuerdo",
71390"acusar", "adicto", "admitir", "adoptar", "adorno", "aduana", "adulto", "aéreo", "afectar", "afición",
71391"afinar", "afirmar", "ágil", "agitar", "agonía", "agosto", "agotar", "agregar", "agrio", "agua",
71392"agudo", "águila", "aguja", "ahogo", "ahorro", "aire", "aislar", "ajedrez", "ajeno", "ajuste",
71393"alacrán", "alambre", "alarma", "alba", "álbum", "alcalde", "aldea", "alegre", "alejar", "alerta",
71394"aleta", "alfiler", "alga", "algodón", "aliado", "aliento", "alivio", "alma", "almeja", "almíbar",
71395"altar", "alteza", "altivo", "alto", "altura", "alumno", "alzar", "amable", "amante", "amapola",
71396"amargo", "amasar", "ámbar", "ámbito", "ameno", "amigo", "amistad", "amor", "amparo", "amplio",
71397"ancho", "anciano", "ancla", "andar", "andén", "anemia", "ángulo", "anillo", "ánimo", "anís",
71398"anotar", "antena", "antiguo", "antojo", "anual", "anular", "anuncio", "añadir", "añejo", "año",
71399"apagar", "aparato", "apetito", "apio", "aplicar", "apodo", "aporte", "apoyo", "aprender", "aprobar",
71400"apuesta", "apuro", "arado", "araña", "arar", "árbitro", "árbol", "arbusto", "archivo", "arco",
71401"arder", "ardilla", "arduo", "área", "árido", "aries", "armonía", "arnés", "aroma", "arpa",
71402"arpón", "arreglo", "arroz", "arruga", "arte", "artista", "asa", "asado", "asalto", "ascenso",
71403"asegurar", "aseo", "asesor", "asiento", "asilo", "asistir", "asno", "asombro", "áspero", "astilla",
71404"astro", "astuto", "asumir", "asunto", "atajo", "ataque", "atar", "atento", "ateo", "ático",
71405"atleta", "átomo", "atraer", "atroz", "atún", "audaz", "audio", "auge", "aula", "aumento",
71406"ausente", "autor", "aval", "avance", "avaro", "ave", "avellana", "avena", "avestruz", "avión",
71407"aviso", "ayer", "ayuda", "ayuno", "azafrán", "azar", "azote", "azúcar", "azufre", "azul",
71408"baba", "babor", "bache", "bahía", "baile", "bajar", "balanza", "balcón", "balde", "bambú",
71409"banco", "banda", "baño", "barba", "barco", "barniz", "barro", "báscula", "bastón", "basura",
71410"batalla", "batería", "batir", "batuta", "baúl", "bazar", "bebé", "bebida", "bello", "besar",
71411"beso", "bestia", "bicho", "bien", "bingo", "blanco", "bloque", "blusa", "boa", "bobina",
71412"bobo", "boca", "bocina", "boda", "bodega", "boina", "bola", "bolero", "bolsa", "bomba",
71413"bondad", "bonito", "bono", "bonsái", "borde", "borrar", "bosque", "bote", "botín", "bóveda",
71414"bozal", "bravo", "brazo", "brecha", "breve", "brillo", "brinco", "brisa", "broca", "broma",
71415"bronce", "brote", "bruja", "brusco", "bruto", "buceo", "bucle", "bueno", "buey", "bufanda",
71416"bufón", "búho", "buitre", "bulto", "burbuja", "burla", "burro", "buscar", "butaca", "buzón",
71417"caballo", "cabeza", "cabina", "cabra", "cacao", "cadáver", "cadena", "caer", "café", "caída",
71418"caimán", "caja", "cajón", "cal", "calamar", "calcio", "caldo", "calidad", "calle", "calma",
71419"calor", "calvo", "cama", "cambio", "camello", "camino", "campo", "cáncer", "candil", "canela",
71420"canguro", "canica", "canto", "caña", "cañón", "caoba", "caos", "capaz", "capitán", "capote",
71421"captar", "capucha", "cara", "carbón", "cárcel", "careta", "carga", "cariño", "carne", "carpeta",
71422"carro", "carta", "casa", "casco", "casero", "caspa", "castor", "catorce", "catre", "caudal",
71423"causa", "cazo", "cebolla", "ceder", "cedro", "celda", "célebre", "celoso", "célula", "cemento",
71424"ceniza", "centro", "cerca", "cerdo", "cereza", "cero", "cerrar", "certeza", "césped", "cetro",
71425"chacal", "chaleco", "champú", "chancla", "chapa", "charla", "chico", "chiste", "chivo", "choque",
71426"choza", "chuleta", "chupar", "ciclón", "ciego", "cielo", "cien", "cierto", "cifra", "cigarro",
71427"cima", "cinco", "cine", "cinta", "ciprés", "circo", "ciruela", "cisne", "cita", "ciudad",
71428"clamor", "clan", "claro", "clase", "clave", "cliente", "clima", "clínica", "cobre", "cocción",
71429"cochino", "cocina", "coco", "código", "codo", "cofre", "coger", "cohete", "cojín", "cojo",
71430"cola", "colcha", "colegio", "colgar", "colina", "collar", "colmo", "columna", "combate", "comer",
71431"comida", "cómodo", "compra", "conde", "conejo", "conga", "conocer", "consejo", "contar", "copa",
71432"copia", "corazón", "corbata", "corcho", "cordón", "corona", "correr", "coser", "cosmos", "costa",
71433"cráneo", "cráter", "crear", "crecer", "creído", "crema", "cría", "crimen", "cripta", "crisis",
71434"cromo", "crónica", "croqueta", "crudo", "cruz", "cuadro", "cuarto", "cuatro", "cubo", "cubrir",
71435"cuchara", "cuello", "cuento", "cuerda", "cuesta", "cueva", "cuidar", "culebra", "culpa", "culto",
71436"cumbre", "cumplir", "cuna", "cuneta", "cuota", "cupón", "cúpula", "curar", "curioso", "curso",
71437"curva", "cutis", "dama", "danza", "dar", "dardo", "dátil", "deber", "débil", "década",
71438"decir", "dedo", "defensa", "definir", "dejar", "delfín", "delgado", "delito", "demora", "denso",
71439"dental", "deporte", "derecho", "derrota", "desayuno", "deseo", "desfile", "desnudo", "destino", "desvío",
71440"detalle", "detener", "deuda", "día", "diablo", "diadema", "diamante", "diana", "diario", "dibujo",
71441"dictar", "diente", "dieta", "diez", "difícil", "digno", "dilema", "diluir", "dinero", "directo",
71442"dirigir", "disco", "diseño", "disfraz", "diva", "divino", "doble", "doce", "dolor", "domingo",
71443"don", "donar", "dorado", "dormir", "dorso", "dos", "dosis", "dragón", "droga", "ducha",
71444"duda", "duelo", "dueño", "dulce", "dúo", "duque", "durar", "dureza", "duro", "ébano",
71445"ebrio", "echar", "eco", "ecuador", "edad", "edición", "edificio", "editor", "educar", "efecto",
71446"eficaz", "eje", "ejemplo", "elefante", "elegir", "elemento", "elevar", "elipse", "élite", "elixir",
71447"elogio", "eludir", "embudo", "emitir", "emoción", "empate", "empeño", "empleo", "empresa", "enano",
71448"encargo", "enchufe", "encía", "enemigo", "enero", "enfado", "enfermo", "engaño", "enigma", "enlace",
71449"enorme", "enredo", "ensayo", "enseñar", "entero", "entrar", "envase", "envío", "época", "equipo",
71450"erizo", "escala", "escena", "escolar", "escribir", "escudo", "esencia", "esfera", "esfuerzo", "espada",
71451"espejo", "espía", "esposa", "espuma", "esquí", "estar", "este", "estilo", "estufa", "etapa",
71452"eterno", "ética", "etnia", "evadir", "evaluar", "evento", "evitar", "exacto", "examen", "exceso",
71453"excusa", "exento", "exigir", "exilio", "existir", "éxito", "experto", "explicar", "exponer", "extremo",
71454"fábrica", "fábula", "fachada", "fácil", "factor", "faena", "faja", "falda", "fallo", "falso",
71455"faltar", "fama", "familia", "famoso", "faraón", "farmacia", "farol", "farsa", "fase", "fatiga",
71456"fauna", "favor", "fax", "febrero", "fecha", "feliz", "feo", "feria", "feroz", "fértil",
71457"fervor", "festín", "fiable", "fianza", "fiar", "fibra", "ficción", "ficha", "fideo", "fiebre",
71458"fiel", "fiera", "fiesta", "figura", "fijar", "fijo", "fila", "filete", "filial", "filtro",
71459"fin", "finca", "fingir", "finito", "firma", "flaco", "flauta", "flecha", "flor", "flota",
71460"fluir", "flujo", "flúor", "fobia", "foca", "fogata", "fogón", "folio", "folleto", "fondo",
71461"forma", "forro", "fortuna", "forzar", "fosa", "foto", "fracaso", "frágil", "franja", "frase",
71462"fraude", "freír", "freno", "fresa", "frío", "frito", "fruta", "fuego", "fuente", "fuerza",
71463"fuga", "fumar", "función", "funda", "furgón", "furia", "fusil", "fútbol", "futuro", "gacela",
71464"gafas", "gaita", "gajo", "gala", "galería", "gallo", "gamba", "ganar", "gancho", "ganga",
71465"ganso", "garaje", "garza", "gasolina", "gastar", "gato", "gavilán", "gemelo", "gemir", "gen",
71466"género", "genio", "gente", "geranio", "gerente", "germen", "gesto", "gigante", "gimnasio", "girar",
71467"giro", "glaciar", "globo", "gloria", "gol", "golfo", "goloso", "golpe", "goma", "gordo",
71468"gorila", "gorra", "gota", "goteo", "gozar", "grada", "gráfico", "grano", "grasa", "gratis",
71469"grave", "grieta", "grillo", "gripe", "gris", "grito", "grosor", "grúa", "grueso", "grumo",
71470"grupo", "guante", "guapo", "guardia", "guerra", "guía", "guiño", "guion", "guiso", "guitarra",
71471"gusano", "gustar", "haber", "hábil", "hablar", "hacer", "hacha", "hada", "hallar", "hamaca",
71472"harina", "haz", "hazaña", "hebilla", "hebra", "hecho", "helado", "helio", "hembra", "herir",
71473"hermano", "héroe", "hervir", "hielo", "hierro", "hígado", "higiene", "hijo", "himno", "historia",
71474"hocico", "hogar", "hoguera", "hoja", "hombre", "hongo", "honor", "honra", "hora", "hormiga",
71475"horno", "hostil", "hoyo", "hueco", "huelga", "huerta", "hueso", "huevo", "huida", "huir",
71476"humano", "húmedo", "humilde", "humo", "hundir", "huracán", "hurto", "icono", "ideal", "idioma",
71477"ídolo", "iglesia", "iglú", "igual", "ilegal", "ilusión", "imagen", "imán", "imitar", "impar",
71478"imperio", "imponer", "impulso", "incapaz", "índice", "inerte", "infiel", "informe", "ingenio", "inicio",
71479"inmenso", "inmune", "innato", "insecto", "instante", "interés", "íntimo", "intuir", "inútil", "invierno",
71480"ira", "iris", "ironía", "isla", "islote", "jabalí", "jabón", "jamón", "jarabe", "jardín",
71481"jarra", "jaula", "jazmín", "jefe", "jeringa", "jinete", "jornada", "joroba", "joven", "joya",
71482"juerga", "jueves", "juez", "jugador", "jugo", "juguete", "juicio", "junco", "jungla", "junio",
71483"juntar", "júpiter", "jurar", "justo", "juvenil", "juzgar", "kilo", "koala", "labio", "lacio",
71484"lacra", "lado", "ladrón", "lagarto", "lágrima", "laguna", "laico", "lamer", "lámina", "lámpara",
71485"lana", "lancha", "langosta", "lanza", "lápiz", "largo", "larva", "lástima", "lata", "látex",
71486"latir", "laurel", "lavar", "lazo", "leal", "lección", "leche", "lector", "leer", "legión",
71487"legumbre", "lejano", "lengua", "lento", "leña", "león", "leopardo", "lesión", "letal", "letra",
71488"leve", "leyenda", "libertad", "libro", "licor", "líder", "lidiar", "lienzo", "liga", "ligero",
71489"lima", "límite", "limón", "limpio", "lince", "lindo", "línea", "lingote", "lino", "linterna",
71490"líquido", "liso", "lista", "litera", "litio", "litro", "llaga", "llama", "llanto", "llave",
71491"llegar", "llenar", "llevar", "llorar", "llover", "lluvia", "lobo", "loción", "loco", "locura",
71492"lógica", "logro", "lombriz", "lomo", "lonja", "lote", "lucha", "lucir", "lugar", "lujo",
71493"luna", "lunes", "lupa", "lustro", "luto", "luz", "maceta", "macho", "madera", "madre",
71494"maduro", "maestro", "mafia", "magia", "mago", "maíz", "maldad", "maleta", "malla", "malo",
71495"mamá", "mambo", "mamut", "manco", "mando", "manejar", "manga", "maniquí", "manjar", "mano",
71496"manso", "manta", "mañana", "mapa", "máquina", "mar", "marco", "marea", "marfil", "margen",
71497"marido", "mármol", "marrón", "martes", "marzo", "masa", "máscara", "masivo", "matar", "materia",
71498"matiz", "matriz", "máximo", "mayor", "mazorca", "mecha", "medalla", "medio", "médula", "mejilla",
71499"mejor", "melena", "melón", "memoria", "menor", "mensaje", "mente", "menú", "mercado", "merengue",
71500"mérito", "mes", "mesón", "meta", "meter", "método", "metro", "mezcla", "miedo", "miel",
71501"miembro", "miga", "mil", "milagro", "militar", "millón", "mimo", "mina", "minero", "mínimo",
71502"minuto", "miope", "mirar", "misa", "miseria", "misil", "mismo", "mitad", "mito", "mochila",
71503"moción", "moda", "modelo", "moho", "mojar", "molde", "moler", "molino", "momento", "momia",
71504"monarca", "moneda", "monja", "monto", "moño", "morada", "morder", "moreno", "morir", "morro",
71505"morsa", "mortal", "mosca", "mostrar", "motivo", "mover", "móvil", "mozo", "mucho", "mudar",
71506"mueble", "muela", "muerte", "muestra", "mugre", "mujer", "mula", "muleta", "multa", "mundo",
71507"muñeca", "mural", "muro", "músculo", "museo", "musgo", "música", "muslo", "nácar", "nación",
71508"nadar", "naipe", "naranja", "nariz", "narrar", "nasal", "natal", "nativo", "natural", "náusea",
71509"naval", "nave", "navidad", "necio", "néctar", "negar", "negocio", "negro", "neón", "nervio",
71510"neto", "neutro", "nevar", "nevera", "nicho", "nido", "niebla", "nieto", "niñez", "niño",
71511"nítido", "nivel", "nobleza", "noche", "nómina", "noria", "norma", "norte", "nota", "noticia",
71512"novato", "novela", "novio", "nube", "nuca", "núcleo", "nudillo", "nudo", "nuera", "nueve",
71513"nuez", "nulo", "número", "nutria", "oasis", "obeso", "obispo", "objeto", "obra", "obrero",
71514"observar", "obtener", "obvio", "oca", "ocaso", "océano", "ochenta", "ocho", "ocio", "ocre",
71515"octavo", "octubre", "oculto", "ocupar", "ocurrir", "odiar", "odio", "odisea", "oeste", "ofensa",
71516"oferta", "oficio", "ofrecer", "ogro", "oído", "oír", "ojo", "ola", "oleada", "olfato",
71517"olivo", "olla", "olmo", "olor", "olvido", "ombligo", "onda", "onza", "opaco", "opción",
71518"ópera", "opinar", "oponer", "optar", "óptica", "opuesto", "oración", "orador", "oral", "órbita",
71519"orca", "orden", "oreja", "órgano", "orgía", "orgullo", "oriente", "origen", "orilla", "oro",
71520"orquesta", "oruga", "osadía", "oscuro", "osezno", "oso", "ostra", "otoño", "otro", "oveja",
71521"óvulo", "óxido", "oxígeno", "oyente", "ozono", "pacto", "padre", "paella", "página", "pago",
71522"país", "pájaro", "palabra", "palco", "paleta", "pálido", "palma", "paloma", "palpar", "pan",
71523"panal", "pánico", "pantera", "pañuelo", "papá", "papel", "papilla", "paquete", "parar", "parcela",
71524"pared", "parir", "paro", "párpado", "parque", "párrafo", "parte", "pasar", "paseo", "pasión",
71525"paso", "pasta", "pata", "patio", "patria", "pausa", "pauta", "pavo", "payaso", "peatón",
71526"pecado", "pecera", "pecho", "pedal", "pedir", "pegar", "peine", "pelar", "peldaño", "pelea",
71527"peligro", "pellejo", "pelo", "peluca", "pena", "pensar", "peñón", "peón", "peor", "pepino",
71528"pequeño", "pera", "percha", "perder", "pereza", "perfil", "perico", "perla", "permiso", "perro",
71529"persona", "pesa", "pesca", "pésimo", "pestaña", "pétalo", "petróleo", "pez", "pezuña", "picar",
71530"pichón", "pie", "piedra", "pierna", "pieza", "pijama", "pilar", "piloto", "pimienta", "pino",
71531"pintor", "pinza", "piña", "piojo", "pipa", "pirata", "pisar", "piscina", "piso", "pista",
71532"pitón", "pizca", "placa", "plan", "plata", "playa", "plaza", "pleito", "pleno", "plomo",
71533"pluma", "plural", "pobre", "poco", "poder", "podio", "poema", "poesía", "poeta", "polen",
71534"policía", "pollo", "polvo", "pomada", "pomelo", "pomo", "pompa", "poner", "porción", "portal",
71535"posada", "poseer", "posible", "poste", "potencia", "potro", "pozo", "prado", "precoz", "pregunta",
71536"premio", "prensa", "preso", "previo", "primo", "príncipe", "prisión", "privar", "proa", "probar",
71537"proceso", "producto", "proeza", "profesor", "programa", "prole", "promesa", "pronto", "propio", "próximo",
71538"prueba", "público", "puchero", "pudor", "pueblo", "puerta", "puesto", "pulga", "pulir", "pulmón",
71539"pulpo", "pulso", "puma", "punto", "puñal", "puño", "pupa", "pupila", "puré", "quedar",
71540"queja", "quemar", "querer", "queso", "quieto", "química", "quince", "quitar", "rábano", "rabia",
71541"rabo", "ración", "radical", "raíz", "rama", "rampa", "rancho", "rango", "rapaz", "rápido",
71542"rapto", "rasgo", "raspa", "rato", "rayo", "raza", "razón", "reacción", "realidad", "rebaño",
71543"rebote", "recaer", "receta", "rechazo", "recoger", "recreo", "recto", "recurso", "red", "redondo",
71544"reducir", "reflejo", "reforma", "refrán", "refugio", "regalo", "regir", "regla", "regreso", "rehén",
71545"reino", "reír", "reja", "relato", "relevo", "relieve", "relleno", "reloj", "remar", "remedio",
71546"remo", "rencor", "rendir", "renta", "reparto", "repetir", "reposo", "reptil", "res", "rescate",
71547"resina", "respeto", "resto", "resumen", "retiro", "retorno", "retrato", "reunir", "revés", "revista",
71548"rey", "rezar", "rico", "riego", "rienda", "riesgo", "rifa", "rígido", "rigor", "rincón",
71549"riñón", "río", "riqueza", "risa", "ritmo", "rito", "rizo", "roble", "roce", "rociar",
71550"rodar", "rodeo", "rodilla", "roer", "rojizo", "rojo", "romero", "romper", "ron", "ronco",
71551"ronda", "ropa", "ropero", "rosa", "rosca", "rostro", "rotar", "rubí", "rubor", "rudo",
71552"rueda", "rugir", "ruido", "ruina", "ruleta", "rulo", "rumbo", "rumor", "ruptura", "ruta",
71553"rutina", "sábado", "saber", "sabio", "sable", "sacar", "sagaz", "sagrado", "sala", "saldo",
71554"salero", "salir", "salmón", "salón", "salsa", "salto", "salud", "salvar", "samba", "sanción",
71555"sandía", "sanear", "sangre", "sanidad", "sano", "santo", "sapo", "saque", "sardina", "sartén",
71556"sastre", "satán", "sauna", "saxofón", "sección", "seco", "secreto", "secta", "sed", "seguir",
71557"seis", "sello", "selva", "semana", "semilla", "senda", "sensor", "señal", "señor", "separar",
71558"sepia", "sequía", "ser", "serie", "sermón", "servir", "sesenta", "sesión", "seta", "setenta",
71559"severo", "sexo", "sexto", "sidra", "siesta", "siete", "siglo", "signo", "sílaba", "silbar",
71560"silencio", "silla", "símbolo", "simio", "sirena", "sistema", "sitio", "situar", "sobre", "socio",
71561"sodio", "sol", "solapa", "soldado", "soledad", "sólido", "soltar", "solución", "sombra", "sondeo",
71562"sonido", "sonoro", "sonrisa", "sopa", "soplar", "soporte", "sordo", "sorpresa", "sorteo", "sostén",
71563"sótano", "suave", "subir", "suceso", "sudor", "suegra", "suelo", "sueño", "suerte", "sufrir",
71564"sujeto", "sultán", "sumar", "superar", "suplir", "suponer", "supremo", "sur", "surco", "sureño",
71565"surgir", "susto", "sutil", "tabaco", "tabique", "tabla", "tabú", "taco", "tacto", "tajo",
71566"talar", "talco", "talento", "talla", "talón", "tamaño", "tambor", "tango", "tanque", "tapa",
71567"tapete", "tapia", "tapón", "taquilla", "tarde", "tarea", "tarifa", "tarjeta", "tarot", "tarro",
71568"tarta", "tatuaje", "tauro", "taza", "tazón", "teatro", "techo", "tecla", "técnica", "tejado",
71569"tejer", "tejido", "tela", "teléfono", "tema", "temor", "templo", "tenaz", "tender", "tener",
71570"tenis", "tenso", "teoría", "terapia", "terco", "término", "ternura", "terror", "tesis", "tesoro",
71571"testigo", "tetera", "texto", "tez", "tibio", "tiburón", "tiempo", "tienda", "tierra", "tieso",
71572"tigre", "tijera", "tilde", "timbre", "tímido", "timo", "tinta", "tío", "típico", "tipo",
71573"tira", "tirón", "titán", "títere", "título", "tiza", "toalla", "tobillo", "tocar", "tocino",
71574"todo", "toga", "toldo", "tomar", "tono", "tonto", "topar", "tope", "toque", "tórax",
71575"torero", "tormenta", "torneo", "toro", "torpedo", "torre", "torso", "tortuga", "tos", "tosco",
71576"toser", "tóxico", "trabajo", "tractor", "traer", "tráfico", "trago", "traje", "tramo", "trance",
71577"trato", "trauma", "trazar", "trébol", "tregua", "treinta", "tren", "trepar", "tres", "tribu",
71578"trigo", "tripa", "triste", "triunfo", "trofeo", "trompa", "tronco", "tropa", "trote", "trozo",
71579"truco", "trueno", "trufa", "tubería", "tubo", "tuerto", "tumba", "tumor", "túnel", "túnica",
71580"turbina", "turismo", "turno", "tutor", "ubicar", "úlcera", "umbral", "unidad", "unir", "universo",
71581"uno", "untar", "uña", "urbano", "urbe", "urgente", "urna", "usar", "usuario", "útil",
71582"utopía", "uva", "vaca", "vacío", "vacuna", "vagar", "vago", "vaina", "vajilla", "vale",
71583"válido", "valle", "valor", "válvula", "vampiro", "vara", "variar", "varón", "vaso", "vecino",
71584"vector", "vehículo", "veinte", "vejez", "vela", "velero", "veloz", "vena", "vencer", "venda",
71585"veneno", "vengar", "venir", "venta", "venus", "ver", "verano", "verbo", "verde", "vereda",
71586"verja", "verso", "verter", "vía", "viaje", "vibrar", "vicio", "víctima", "vida", "vídeo",
71587"vidrio", "viejo", "viernes", "vigor", "vil", "villa", "vinagre", "vino", "viñedo", "violín",
71588"viral", "virgo", "virtud", "visor", "víspera", "vista", "vitamina", "viudo", "vivaz", "vivero",
71589"vivir", "vivo", "volcán", "volumen", "volver", "voraz", "votar", "voto", "voz", "vuelo",
71590"vulgar", "yacer", "yate", "yegua", "yema", "yerno", "yeso", "yodo", "yoga", "yogur",
71591"zafiro", "zanja", "zapato", "zarza", "zona", "zorro", "zumo", "zurdo"]
71592</script>
71593 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
71594WORDLISTS["chinese_simplified"] = [
71595"的", "一", "是", "在", "不", "了", "有", "和", "人", "这",
71596"中", "大", "为", "上", "个", "国", "我", "以", "要", "他",
71597"时", "来", "用", "们", "生", "到", "作", "地", "于", "出",
71598"就", "分", "对", "成", "会", "可", "主", "发", "年", "动",
71599"同", "工", "也", "能", "下", "过", "子", "说", "产", "种",
71600"面", "而", "方", "后", "多", "定", "行", "学", "法", "所",
71601"民", "得", "经", "十", "三", "之", "进", "着", "等", "部",
71602"度", "家", "电", "力", "里", "如", "水", "化", "高", "自",
71603"二", "理", "起", "小", "物", "现", "实", "加", "量", "都",
71604"两", "体", "制", "机", "当", "使", "点", "从", "业", "本",
71605"去", "把", "性", "好", "应", "开", "它", "合", "还", "因",
71606"由", "其", "些", "然", "前", "外", "天", "政", "四", "日",
71607"那", "社", "义", "事", "平", "形", "相", "全", "表", "间",
71608"样", "与", "关", "各", "重", "新", "线", "内", "数", "正",
71609"心", "反", "你", "明", "看", "原", "又", "么", "利", "比",
71610"或", "但", "质", "气", "第", "向", "道", "命", "此", "变",
71611"条", "只", "没", "结", "解", "问", "意", "建", "月", "公",
71612"无", "系", "军", "很", "情", "者", "最", "立", "代", "想",
71613"已", "通", "并", "提", "直", "题", "党", "程", "展", "五",
71614"果", "料", "象", "员", "革", "位", "入", "常", "文", "总",
71615"次", "品", "式", "活", "设", "及", "管", "特", "件", "长",
71616"求", "老", "头", "基", "资", "边", "流", "路", "级", "少",
71617"图", "山", "统", "接", "知", "较", "将", "组", "见", "计",
71618"别", "她", "手", "角", "期", "根", "论", "运", "农", "指",
71619"几", "九", "区", "强", "放", "决", "西", "被", "干", "做",
71620"必", "战", "先", "回", "则", "任", "取", "据", "处", "队",
71621"南", "给", "色", "光", "门", "即", "保", "治", "北", "造",
71622"百", "规", "热", "领", "七", "海", "口", "东", "导", "器",
71623"压", "志", "世", "金", "增", "争", "济", "阶", "油", "思",
71624"术", "极", "交", "受", "联", "什", "认", "六", "共", "权",
71625"收", "证", "改", "清", "美", "再", "采", "转", "更", "单",
71626"风", "切", "打", "白", "教", "速", "花", "带", "安", "场",
71627"身", "车", "例", "真", "务", "具", "万", "每", "目", "至",
71628"达", "走", "积", "示", "议", "声", "报", "斗", "完", "类",
71629"八", "离", "华", "名", "确", "才", "科", "张", "信", "马",
71630"节", "话", "米", "整", "空", "元", "况", "今", "集", "温",
71631"传", "土", "许", "步", "群", "广", "石", "记", "需", "段",
71632"研", "界", "拉", "林", "律", "叫", "且", "究", "观", "越",
71633"织", "装", "影", "算", "低", "持", "音", "众", "书", "布",
71634"复", "容", "儿", "须", "际", "商", "非", "验", "连", "断",
71635"深", "难", "近", "矿", "千", "周", "委", "素", "技", "备",
71636"半", "办", "青", "省", "列", "习", "响", "约", "支", "般",
71637"史", "感", "劳", "便", "团", "往", "酸", "历", "市", "克",
71638"何", "除", "消", "构", "府", "称", "太", "准", "精", "值",
71639"号", "率", "族", "维", "划", "选", "标", "写", "存", "候",
71640"毛", "亲", "快", "效", "斯", "院", "查", "江", "型", "眼",
71641"王", "按", "格", "养", "易", "置", "派", "层", "片", "始",
71642"却", "专", "状", "育", "厂", "京", "识", "适", "属", "圆",
71643"包", "火", "住", "调", "满", "县", "局", "照", "参", "红",
71644"细", "引", "听", "该", "铁", "价", "严", "首", "底", "液",
71645"官", "德", "随", "病", "苏", "失", "尔", "死", "讲", "配",
71646"女", "黄", "推", "显", "谈", "罪", "神", "艺", "呢", "席",
71647"含", "企", "望", "密", "批", "营", "项", "防", "举", "球",
71648"英", "氧", "势", "告", "李", "台", "落", "木", "帮", "轮",
71649"破", "亚", "师", "围", "注", "远", "字", "材", "排", "供",
71650"河", "态", "封", "另", "施", "减", "树", "溶", "怎", "止",
71651"案", "言", "士", "均", "武", "固", "叶", "鱼", "波", "视",
71652"仅", "费", "紧", "爱", "左", "章", "早", "朝", "害", "续",
71653"轻", "服", "试", "食", "充", "兵", "源", "判", "护", "司",
71654"足", "某", "练", "差", "致", "板", "田", "降", "黑", "犯",
71655"负", "击", "范", "继", "兴", "似", "余", "坚", "曲", "输",
71656"修", "故", "城", "夫", "够", "送", "笔", "船", "占", "右",
71657"财", "吃", "富", "春", "职", "觉", "汉", "画", "功", "巴",
71658"跟", "虽", "杂", "飞", "检", "吸", "助", "升", "阳", "互",
71659"初", "创", "抗", "考", "投", "坏", "策", "古", "径", "换",
71660"未", "跑", "留", "钢", "曾", "端", "责", "站", "简", "述",
71661"钱", "副", "尽", "帝", "射", "草", "冲", "承", "独", "令",
71662"限", "阿", "宣", "环", "双", "请", "超", "微", "让", "控",
71663"州", "良", "轴", "找", "否", "纪", "益", "依", "优", "顶",
71664"础", "载", "倒", "房", "突", "坐", "粉", "敌", "略", "客",
71665"袁", "冷", "胜", "绝", "析", "块", "剂", "测", "丝", "协",
71666"诉", "念", "陈", "仍", "罗", "盐", "友", "洋", "错", "苦",
71667"夜", "刑", "移", "频", "逐", "靠", "混", "母", "短", "皮",
71668"终", "聚", "汽", "村", "云", "哪", "既", "距", "卫", "停",
71669"烈", "央", "察", "烧", "迅", "境", "若", "印", "洲", "刻",
71670"括", "激", "孔", "搞", "甚", "室", "待", "核", "校", "散",
71671"侵", "吧", "甲", "游", "久", "菜", "味", "旧", "模", "湖",
71672"货", "损", "预", "阻", "毫", "普", "稳", "乙", "妈", "植",
71673"息", "扩", "银", "语", "挥", "酒", "守", "拿", "序", "纸",
71674"医", "缺", "雨", "吗", "针", "刘", "啊", "急", "唱", "误",
71675"训", "愿", "审", "附", "获", "茶", "鲜", "粮", "斤", "孩",
71676"脱", "硫", "肥", "善", "龙", "演", "父", "渐", "血", "欢",
71677"械", "掌", "歌", "沙", "刚", "攻", "谓", "盾", "讨", "晚",
71678"粒", "乱", "燃", "矛", "乎", "杀", "药", "宁", "鲁", "贵",
71679"钟", "煤", "读", "班", "伯", "香", "介", "迫", "句", "丰",
71680"培", "握", "兰", "担", "弦", "蛋", "沉", "假", "穿", "执",
71681"答", "乐", "谁", "顺", "烟", "缩", "征", "脸", "喜", "松",
71682"脚", "困", "异", "免", "背", "星", "福", "买", "染", "井",
71683"概", "慢", "怕", "磁", "倍", "祖", "皇", "促", "静", "补",
71684"评", "翻", "肉", "践", "尼", "衣", "宽", "扬", "棉", "希",
71685"伤", "操", "垂", "秋", "宜", "氢", "套", "督", "振", "架",
71686"亮", "末", "宪", "庆", "编", "牛", "触", "映", "雷", "销",
71687"诗", "座", "居", "抓", "裂", "胞", "呼", "娘", "景", "威",
71688"绿", "晶", "厚", "盟", "衡", "鸡", "孙", "延", "危", "胶",
71689"屋", "乡", "临", "陆", "顾", "掉", "呀", "灯", "岁", "措",
71690"束", "耐", "剧", "玉", "赵", "跳", "哥", "季", "课", "凯",
71691"胡", "额", "款", "绍", "卷", "齐", "伟", "蒸", "殖", "永",
71692"宗", "苗", "川", "炉", "岩", "弱", "零", "杨", "奏", "沿",
71693"露", "杆", "探", "滑", "镇", "饭", "浓", "航", "怀", "赶",
71694"库", "夺", "伊", "灵", "税", "途", "灭", "赛", "归", "召",
71695"鼓", "播", "盘", "裁", "险", "康", "唯", "录", "菌", "纯",
71696"借", "糖", "盖", "横", "符", "私", "努", "堂", "域", "枪",
71697"润", "幅", "哈", "竟", "熟", "虫", "泽", "脑", "壤", "碳",
71698"欧", "遍", "侧", "寨", "敢", "彻", "虑", "斜", "薄", "庭",
71699"纳", "弹", "饲", "伸", "折", "麦", "湿", "暗", "荷", "瓦",
71700"塞", "床", "筑", "恶", "户", "访", "塔", "奇", "透", "梁",
71701"刀", "旋", "迹", "卡", "氯", "遇", "份", "毒", "泥", "退",
71702"洗", "摆", "灰", "彩", "卖", "耗", "夏", "择", "忙", "铜",
71703"献", "硬", "予", "繁", "圈", "雪", "函", "亦", "抽", "篇",
71704"阵", "阴", "丁", "尺", "追", "堆", "雄", "迎", "泛", "爸",
71705"楼", "避", "谋", "吨", "野", "猪", "旗", "累", "偏", "典",
71706"馆", "索", "秦", "脂", "潮", "爷", "豆", "忽", "托", "惊",
71707"塑", "遗", "愈", "朱", "替", "纤", "粗", "倾", "尚", "痛",
71708"楚", "谢", "奋", "购", "磨", "君", "池", "旁", "碎", "骨",
71709"监", "捕", "弟", "暴", "割", "贯", "殊", "释", "词", "亡",
71710"壁", "顿", "宝", "午", "尘", "闻", "揭", "炮", "残", "冬",
71711"桥", "妇", "警", "综", "招", "吴", "付", "浮", "遭", "徐",
71712"您", "摇", "谷", "赞", "箱", "隔", "订", "男", "吹", "园",
71713"纷", "唐", "败", "宋", "玻", "巨", "耕", "坦", "荣", "闭",
71714"湾", "键", "凡", "驻", "锅", "救", "恩", "剥", "凝", "碱",
71715"齿", "截", "炼", "麻", "纺", "禁", "废", "盛", "版", "缓",
71716"净", "睛", "昌", "婚", "涉", "筒", "嘴", "插", "岸", "朗",
71717"庄", "街", "藏", "姑", "贸", "腐", "奴", "啦", "惯", "乘",
71718"伙", "恢", "匀", "纱", "扎", "辩", "耳", "彪", "臣", "亿",
71719"璃", "抵", "脉", "秀", "萨", "俄", "网", "舞", "店", "喷",
71720"纵", "寸", "汗", "挂", "洪", "贺", "闪", "柬", "爆", "烯",
71721"津", "稻", "墙", "软", "勇", "像", "滚", "厘", "蒙", "芳",
71722"肯", "坡", "柱", "荡", "腿", "仪", "旅", "尾", "轧", "冰",
71723"贡", "登", "黎", "削", "钻", "勒", "逃", "障", "氨", "郭",
71724"峰", "币", "港", "伏", "轨", "亩", "毕", "擦", "莫", "刺",
71725"浪", "秘", "援", "株", "健", "售", "股", "岛", "甘", "泡",
71726"睡", "童", "铸", "汤", "阀", "休", "汇", "舍", "牧", "绕",
71727"炸", "哲", "磷", "绩", "朋", "淡", "尖", "启", "陷", "柴",
71728"呈", "徒", "颜", "泪", "稍", "忘", "泵", "蓝", "拖", "洞",
71729"授", "镜", "辛", "壮", "锋", "贫", "虚", "弯", "摩", "泰",
71730"幼", "廷", "尊", "窗", "纲", "弄", "隶", "疑", "氏", "宫",
71731"姐", "震", "瑞", "怪", "尤", "琴", "循", "描", "膜", "违",
71732"夹", "腰", "缘", "珠", "穷", "森", "枝", "竹", "沟", "催",
71733"绳", "忆", "邦", "剩", "幸", "浆", "栏", "拥", "牙", "贮",
71734"礼", "滤", "钠", "纹", "罢", "拍", "咱", "喊", "袖", "埃",
71735"勤", "罚", "焦", "潜", "伍", "墨", "欲", "缝", "姓", "刊",
71736"饱", "仿", "奖", "铝", "鬼", "丽", "跨", "默", "挖", "链",
71737"扫", "喝", "袋", "炭", "污", "幕", "诸", "弧", "励", "梅",
71738"奶", "洁", "灾", "舟", "鉴", "苯", "讼", "抱", "毁", "懂",
71739"寒", "智", "埔", "寄", "届", "跃", "渡", "挑", "丹", "艰",
71740"贝", "碰", "拔", "爹", "戴", "码", "梦", "芽", "熔", "赤",
71741"渔", "哭", "敬", "颗", "奔", "铅", "仲", "虎", "稀", "妹",
71742"乏", "珍", "申", "桌", "遵", "允", "隆", "螺", "仓", "魏",
71743"锐", "晓", "氮", "兼", "隐", "碍", "赫", "拨", "忠", "肃",
71744"缸", "牵", "抢", "博", "巧", "壳", "兄", "杜", "讯", "诚",
71745"碧", "祥", "柯", "页", "巡", "矩", "悲", "灌", "龄", "伦",
71746"票", "寻", "桂", "铺", "圣", "恐", "恰", "郑", "趣", "抬",
71747"荒", "腾", "贴", "柔", "滴", "猛", "阔", "辆", "妻", "填",
71748"撤", "储", "签", "闹", "扰", "紫", "砂", "递", "戏", "吊",
71749"陶", "伐", "喂", "疗", "瓶", "婆", "抚", "臂", "摸", "忍",
71750"虾", "蜡", "邻", "胸", "巩", "挤", "偶", "弃", "槽", "劲",
71751"乳", "邓", "吉", "仁", "烂", "砖", "租", "乌", "舰", "伴",
71752"瓜", "浅", "丙", "暂", "燥", "橡", "柳", "迷", "暖", "牌",
71753"秧", "胆", "详", "簧", "踏", "瓷", "谱", "呆", "宾", "糊",
71754"洛", "辉", "愤", "竞", "隙", "怒", "粘", "乃", "绪", "肩",
71755"籍", "敏", "涂", "熙", "皆", "侦", "悬", "掘", "享", "纠",
71756"醒", "狂", "锁", "淀", "恨", "牲", "霸", "爬", "赏", "逆",
71757"玩", "陵", "祝", "秒", "浙", "貌", "役", "彼", "悉", "鸭",
71758"趋", "凤", "晨", "畜", "辈", "秩", "卵", "署", "梯", "炎",
71759"滩", "棋", "驱", "筛", "峡", "冒", "啥", "寿", "译", "浸",
71760"泉", "帽", "迟", "硅", "疆", "贷", "漏", "稿", "冠", "嫩",
71761"胁", "芯", "牢", "叛", "蚀", "奥", "鸣", "岭", "羊", "凭",
71762"串", "塘", "绘", "酵", "融", "盆", "锡", "庙", "筹", "冻",
71763"辅", "摄", "袭", "筋", "拒", "僚", "旱", "钾", "鸟", "漆",
71764"沈", "眉", "疏", "添", "棒", "穗", "硝", "韩", "逼", "扭",
71765"侨", "凉", "挺", "碗", "栽", "炒", "杯", "患", "馏", "劝",
71766"豪", "辽", "勃", "鸿", "旦", "吏", "拜", "狗", "埋", "辊",
71767"掩", "饮", "搬", "骂", "辞", "勾", "扣", "估", "蒋", "绒",
71768"雾", "丈", "朵", "姆", "拟", "宇", "辑", "陕", "雕", "偿",
71769"蓄", "崇", "剪", "倡", "厅", "咬", "驶", "薯", "刷", "斥",
71770"番", "赋", "奉", "佛", "浇", "漫", "曼", "扇", "钙", "桃",
71771"扶", "仔", "返", "俗", "亏", "腔", "鞋", "棱", "覆", "框",
71772"悄", "叔", "撞", "骗", "勘", "旺", "沸", "孤", "吐", "孟",
71773"渠", "屈", "疾", "妙", "惜", "仰", "狠", "胀", "谐", "抛",
71774"霉", "桑", "岗", "嘛", "衰", "盗", "渗", "脏", "赖", "涌",
71775"甜", "曹", "阅", "肌", "哩", "厉", "烃", "纬", "毅", "昨",
71776"伪", "症", "煮", "叹", "钉", "搭", "茎", "笼", "酷", "偷",
71777"弓", "锥", "恒", "杰", "坑", "鼻", "翼", "纶", "叙", "狱",
71778"逮", "罐", "络", "棚", "抑", "膨", "蔬", "寺", "骤", "穆",
71779"冶", "枯", "册", "尸", "凸", "绅", "坯", "牺", "焰", "轰",
71780"欣", "晋", "瘦", "御", "锭", "锦", "丧", "旬", "锻", "垄",
71781"搜", "扑", "邀", "亭", "酯", "迈", "舒", "脆", "酶", "闲",
71782"忧", "酚", "顽", "羽", "涨", "卸", "仗", "陪", "辟", "惩",
71783"杭", "姚", "肚", "捉", "飘", "漂", "昆", "欺", "吾", "郎",
71784"烷", "汁", "呵", "饰", "萧", "雅", "邮", "迁", "燕", "撒",
71785"姻", "赴", "宴", "烦", "债", "帐", "斑", "铃", "旨", "醇",
71786"董", "饼", "雏", "姿", "拌", "傅", "腹", "妥", "揉", "贤",
71787"拆", "歪", "葡", "胺", "丢", "浩", "徽", "昂", "垫", "挡",
71788"览", "贪", "慰", "缴", "汪", "慌", "冯", "诺", "姜", "谊",
71789"凶", "劣", "诬", "耀", "昏", "躺", "盈", "骑", "乔", "溪",
71790"丛", "卢", "抹", "闷", "咨", "刮", "驾", "缆", "悟", "摘",
71791"铒", "掷", "颇", "幻", "柄", "惠", "惨", "佳", "仇", "腊",
71792"窝", "涤", "剑", "瞧", "堡", "泼", "葱", "罩", "霍", "捞",
71793"胎", "苍", "滨", "俩", "捅", "湘", "砍", "霞", "邵", "萄",
71794"疯", "淮", "遂", "熊", "粪", "烘", "宿", "档", "戈", "驳",
71795"嫂", "裕", "徙", "箭", "捐", "肠", "撑", "晒", "辨", "殿",
71796"莲", "摊", "搅", "酱", "屏", "疫", "哀", "蔡", "堵", "沫",
71797"皱", "畅", "叠", "阁", "莱", "敲", "辖", "钩", "痕", "坝",
71798"巷", "饿", "祸", "丘", "玄", "溜", "曰", "逻", "彭", "尝",
71799"卿", "妨", "艇", "吞", "韦", "怨", "矮", "歇" ]
71800</script>
71801 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
71802WORDLISTS["chinese_traditional"] = [
71803"的", "一", "是", "在", "不", "了", "有", "和", "人", "這",
71804"中", "大", "為", "上", "個", "國", "我", "以", "要", "他",
71805"時", "來", "用", "們", "生", "到", "作", "地", "於", "出",
71806"就", "分", "對", "成", "會", "可", "主", "發", "年", "動",
71807"同", "工", "也", "能", "下", "過", "子", "說", "產", "種",
71808"面", "而", "方", "後", "多", "定", "行", "學", "法", "所",
71809"民", "得", "經", "十", "三", "之", "進", "著", "等", "部",
71810"度", "家", "電", "力", "裡", "如", "水", "化", "高", "自",
71811"二", "理", "起", "小", "物", "現", "實", "加", "量", "都",
71812"兩", "體", "制", "機", "當", "使", "點", "從", "業", "本",
71813"去", "把", "性", "好", "應", "開", "它", "合", "還", "因",
71814"由", "其", "些", "然", "前", "外", "天", "政", "四", "日",
71815"那", "社", "義", "事", "平", "形", "相", "全", "表", "間",
71816"樣", "與", "關", "各", "重", "新", "線", "內", "數", "正",
71817"心", "反", "你", "明", "看", "原", "又", "麼", "利", "比",
71818"或", "但", "質", "氣", "第", "向", "道", "命", "此", "變",
71819"條", "只", "沒", "結", "解", "問", "意", "建", "月", "公",
71820"無", "系", "軍", "很", "情", "者", "最", "立", "代", "想",
71821"已", "通", "並", "提", "直", "題", "黨", "程", "展", "五",
71822"果", "料", "象", "員", "革", "位", "入", "常", "文", "總",
71823"次", "品", "式", "活", "設", "及", "管", "特", "件", "長",
71824"求", "老", "頭", "基", "資", "邊", "流", "路", "級", "少",
71825"圖", "山", "統", "接", "知", "較", "將", "組", "見", "計",
71826"別", "她", "手", "角", "期", "根", "論", "運", "農", "指",
71827"幾", "九", "區", "強", "放", "決", "西", "被", "幹", "做",
71828"必", "戰", "先", "回", "則", "任", "取", "據", "處", "隊",
71829"南", "給", "色", "光", "門", "即", "保", "治", "北", "造",
71830"百", "規", "熱", "領", "七", "海", "口", "東", "導", "器",
71831"壓", "志", "世", "金", "增", "爭", "濟", "階", "油", "思",
71832"術", "極", "交", "受", "聯", "什", "認", "六", "共", "權",
71833"收", "證", "改", "清", "美", "再", "採", "轉", "更", "單",
71834"風", "切", "打", "白", "教", "速", "花", "帶", "安", "場",
71835"身", "車", "例", "真", "務", "具", "萬", "每", "目", "至",
71836"達", "走", "積", "示", "議", "聲", "報", "鬥", "完", "類",
71837"八", "離", "華", "名", "確", "才", "科", "張", "信", "馬",
71838"節", "話", "米", "整", "空", "元", "況", "今", "集", "溫",
71839"傳", "土", "許", "步", "群", "廣", "石", "記", "需", "段",
71840"研", "界", "拉", "林", "律", "叫", "且", "究", "觀", "越",
71841"織", "裝", "影", "算", "低", "持", "音", "眾", "書", "布",
71842"复", "容", "兒", "須", "際", "商", "非", "驗", "連", "斷",
71843"深", "難", "近", "礦", "千", "週", "委", "素", "技", "備",
71844"半", "辦", "青", "省", "列", "習", "響", "約", "支", "般",
71845"史", "感", "勞", "便", "團", "往", "酸", "歷", "市", "克",
71846"何", "除", "消", "構", "府", "稱", "太", "準", "精", "值",
71847"號", "率", "族", "維", "劃", "選", "標", "寫", "存", "候",
71848"毛", "親", "快", "效", "斯", "院", "查", "江", "型", "眼",
71849"王", "按", "格", "養", "易", "置", "派", "層", "片", "始",
71850"卻", "專", "狀", "育", "廠", "京", "識", "適", "屬", "圓",
71851"包", "火", "住", "調", "滿", "縣", "局", "照", "參", "紅",
71852"細", "引", "聽", "該", "鐵", "價", "嚴", "首", "底", "液",
71853"官", "德", "隨", "病", "蘇", "失", "爾", "死", "講", "配",
71854"女", "黃", "推", "顯", "談", "罪", "神", "藝", "呢", "席",
71855"含", "企", "望", "密", "批", "營", "項", "防", "舉", "球",
71856"英", "氧", "勢", "告", "李", "台", "落", "木", "幫", "輪",
71857"破", "亞", "師", "圍", "注", "遠", "字", "材", "排", "供",
71858"河", "態", "封", "另", "施", "減", "樹", "溶", "怎", "止",
71859"案", "言", "士", "均", "武", "固", "葉", "魚", "波", "視",
71860"僅", "費", "緊", "愛", "左", "章", "早", "朝", "害", "續",
71861"輕", "服", "試", "食", "充", "兵", "源", "判", "護", "司",
71862"足", "某", "練", "差", "致", "板", "田", "降", "黑", "犯",
71863"負", "擊", "范", "繼", "興", "似", "餘", "堅", "曲", "輸",
71864"修", "故", "城", "夫", "夠", "送", "筆", "船", "佔", "右",
71865"財", "吃", "富", "春", "職", "覺", "漢", "畫", "功", "巴",
71866"跟", "雖", "雜", "飛", "檢", "吸", "助", "昇", "陽", "互",
71867"初", "創", "抗", "考", "投", "壞", "策", "古", "徑", "換",
71868"未", "跑", "留", "鋼", "曾", "端", "責", "站", "簡", "述",
71869"錢", "副", "盡", "帝", "射", "草", "衝", "承", "獨", "令",
71870"限", "阿", "宣", "環", "雙", "請", "超", "微", "讓", "控",
71871"州", "良", "軸", "找", "否", "紀", "益", "依", "優", "頂",
71872"礎", "載", "倒", "房", "突", "坐", "粉", "敵", "略", "客",
71873"袁", "冷", "勝", "絕", "析", "塊", "劑", "測", "絲", "協",
71874"訴", "念", "陳", "仍", "羅", "鹽", "友", "洋", "錯", "苦",
71875"夜", "刑", "移", "頻", "逐", "靠", "混", "母", "短", "皮",
71876"終", "聚", "汽", "村", "雲", "哪", "既", "距", "衛", "停",
71877"烈", "央", "察", "燒", "迅", "境", "若", "印", "洲", "刻",
71878"括", "激", "孔", "搞", "甚", "室", "待", "核", "校", "散",
71879"侵", "吧", "甲", "遊", "久", "菜", "味", "舊", "模", "湖",
71880"貨", "損", "預", "阻", "毫", "普", "穩", "乙", "媽", "植",
71881"息", "擴", "銀", "語", "揮", "酒", "守", "拿", "序", "紙",
71882"醫", "缺", "雨", "嗎", "針", "劉", "啊", "急", "唱", "誤",
71883"訓", "願", "審", "附", "獲", "茶", "鮮", "糧", "斤", "孩",
71884"脫", "硫", "肥", "善", "龍", "演", "父", "漸", "血", "歡",
71885"械", "掌", "歌", "沙", "剛", "攻", "謂", "盾", "討", "晚",
71886"粒", "亂", "燃", "矛", "乎", "殺", "藥", "寧", "魯", "貴",
71887"鐘", "煤", "讀", "班", "伯", "香", "介", "迫", "句", "豐",
71888"培", "握", "蘭", "擔", "弦", "蛋", "沉", "假", "穿", "執",
71889"答", "樂", "誰", "順", "煙", "縮", "徵", "臉", "喜", "松",
71890"腳", "困", "異", "免", "背", "星", "福", "買", "染", "井",
71891"概", "慢", "怕", "磁", "倍", "祖", "皇", "促", "靜", "補",
71892"評", "翻", "肉", "踐", "尼", "衣", "寬", "揚", "棉", "希",
71893"傷", "操", "垂", "秋", "宜", "氫", "套", "督", "振", "架",
71894"亮", "末", "憲", "慶", "編", "牛", "觸", "映", "雷", "銷",
71895"詩", "座", "居", "抓", "裂", "胞", "呼", "娘", "景", "威",
71896"綠", "晶", "厚", "盟", "衡", "雞", "孫", "延", "危", "膠",
71897"屋", "鄉", "臨", "陸", "顧", "掉", "呀", "燈", "歲", "措",
71898"束", "耐", "劇", "玉", "趙", "跳", "哥", "季", "課", "凱",
71899"胡", "額", "款", "紹", "卷", "齊", "偉", "蒸", "殖", "永",
71900"宗", "苗", "川", "爐", "岩", "弱", "零", "楊", "奏", "沿",
71901"露", "桿", "探", "滑", "鎮", "飯", "濃", "航", "懷", "趕",
71902"庫", "奪", "伊", "靈", "稅", "途", "滅", "賽", "歸", "召",
71903"鼓", "播", "盤", "裁", "險", "康", "唯", "錄", "菌", "純",
71904"借", "糖", "蓋", "橫", "符", "私", "努", "堂", "域", "槍",
71905"潤", "幅", "哈", "竟", "熟", "蟲", "澤", "腦", "壤", "碳",
71906"歐", "遍", "側", "寨", "敢", "徹", "慮", "斜", "薄", "庭",
71907"納", "彈", "飼", "伸", "折", "麥", "濕", "暗", "荷", "瓦",
71908"塞", "床", "築", "惡", "戶", "訪", "塔", "奇", "透", "梁",
71909"刀", "旋", "跡", "卡", "氯", "遇", "份", "毒", "泥", "退",
71910"洗", "擺", "灰", "彩", "賣", "耗", "夏", "擇", "忙", "銅",
71911"獻", "硬", "予", "繁", "圈", "雪", "函", "亦", "抽", "篇",
71912"陣", "陰", "丁", "尺", "追", "堆", "雄", "迎", "泛", "爸",
71913"樓", "避", "謀", "噸", "野", "豬", "旗", "累", "偏", "典",
71914"館", "索", "秦", "脂", "潮", "爺", "豆", "忽", "托", "驚",
71915"塑", "遺", "愈", "朱", "替", "纖", "粗", "傾", "尚", "痛",
71916"楚", "謝", "奮", "購", "磨", "君", "池", "旁", "碎", "骨",
71917"監", "捕", "弟", "暴", "割", "貫", "殊", "釋", "詞", "亡",
71918"壁", "頓", "寶", "午", "塵", "聞", "揭", "炮", "殘", "冬",
71919"橋", "婦", "警", "綜", "招", "吳", "付", "浮", "遭", "徐",
71920"您", "搖", "谷", "贊", "箱", "隔", "訂", "男", "吹", "園",
71921"紛", "唐", "敗", "宋", "玻", "巨", "耕", "坦", "榮", "閉",
71922"灣", "鍵", "凡", "駐", "鍋", "救", "恩", "剝", "凝", "鹼",
71923"齒", "截", "煉", "麻", "紡", "禁", "廢", "盛", "版", "緩",
71924"淨", "睛", "昌", "婚", "涉", "筒", "嘴", "插", "岸", "朗",
71925"莊", "街", "藏", "姑", "貿", "腐", "奴", "啦", "慣", "乘",
71926"夥", "恢", "勻", "紗", "扎", "辯", "耳", "彪", "臣", "億",
71927"璃", "抵", "脈", "秀", "薩", "俄", "網", "舞", "店", "噴",
71928"縱", "寸", "汗", "掛", "洪", "賀", "閃", "柬", "爆", "烯",
71929"津", "稻", "牆", "軟", "勇", "像", "滾", "厘", "蒙", "芳",
71930"肯", "坡", "柱", "盪", "腿", "儀", "旅", "尾", "軋", "冰",
71931"貢", "登", "黎", "削", "鑽", "勒", "逃", "障", "氨", "郭",
71932"峰", "幣", "港", "伏", "軌", "畝", "畢", "擦", "莫", "刺",
71933"浪", "秘", "援", "株", "健", "售", "股", "島", "甘", "泡",
71934"睡", "童", "鑄", "湯", "閥", "休", "匯", "舍", "牧", "繞",
71935"炸", "哲", "磷", "績", "朋", "淡", "尖", "啟", "陷", "柴",
71936"呈", "徒", "顏", "淚", "稍", "忘", "泵", "藍", "拖", "洞",
71937"授", "鏡", "辛", "壯", "鋒", "貧", "虛", "彎", "摩", "泰",
71938"幼", "廷", "尊", "窗", "綱", "弄", "隸", "疑", "氏", "宮",
71939"姐", "震", "瑞", "怪", "尤", "琴", "循", "描", "膜", "違",
71940"夾", "腰", "緣", "珠", "窮", "森", "枝", "竹", "溝", "催",
71941"繩", "憶", "邦", "剩", "幸", "漿", "欄", "擁", "牙", "貯",
71942"禮", "濾", "鈉", "紋", "罷", "拍", "咱", "喊", "袖", "埃",
71943"勤", "罰", "焦", "潛", "伍", "墨", "欲", "縫", "姓", "刊",
71944"飽", "仿", "獎", "鋁", "鬼", "麗", "跨", "默", "挖", "鏈",
71945"掃", "喝", "袋", "炭", "污", "幕", "諸", "弧", "勵", "梅",
71946"奶", "潔", "災", "舟", "鑑", "苯", "訟", "抱", "毀", "懂",
71947"寒", "智", "埔", "寄", "屆", "躍", "渡", "挑", "丹", "艱",
71948"貝", "碰", "拔", "爹", "戴", "碼", "夢", "芽", "熔", "赤",
71949"漁", "哭", "敬", "顆", "奔", "鉛", "仲", "虎", "稀", "妹",
71950"乏", "珍", "申", "桌", "遵", "允", "隆", "螺", "倉", "魏",
71951"銳", "曉", "氮", "兼", "隱", "礙", "赫", "撥", "忠", "肅",
71952"缸", "牽", "搶", "博", "巧", "殼", "兄", "杜", "訊", "誠",
71953"碧", "祥", "柯", "頁", "巡", "矩", "悲", "灌", "齡", "倫",
71954"票", "尋", "桂", "鋪", "聖", "恐", "恰", "鄭", "趣", "抬",
71955"荒", "騰", "貼", "柔", "滴", "猛", "闊", "輛", "妻", "填",
71956"撤", "儲", "簽", "鬧", "擾", "紫", "砂", "遞", "戲", "吊",
71957"陶", "伐", "餵", "療", "瓶", "婆", "撫", "臂", "摸", "忍",
71958"蝦", "蠟", "鄰", "胸", "鞏", "擠", "偶", "棄", "槽", "勁",
71959"乳", "鄧", "吉", "仁", "爛", "磚", "租", "烏", "艦", "伴",
71960"瓜", "淺", "丙", "暫", "燥", "橡", "柳", "迷", "暖", "牌",
71961"秧", "膽", "詳", "簧", "踏", "瓷", "譜", "呆", "賓", "糊",
71962"洛", "輝", "憤", "競", "隙", "怒", "粘", "乃", "緒", "肩",
71963"籍", "敏", "塗", "熙", "皆", "偵", "懸", "掘", "享", "糾",
71964"醒", "狂", "鎖", "淀", "恨", "牲", "霸", "爬", "賞", "逆",
71965"玩", "陵", "祝", "秒", "浙", "貌", "役", "彼", "悉", "鴨",
71966"趨", "鳳", "晨", "畜", "輩", "秩", "卵", "署", "梯", "炎",
71967"灘", "棋", "驅", "篩", "峽", "冒", "啥", "壽", "譯", "浸",
71968"泉", "帽", "遲", "矽", "疆", "貸", "漏", "稿", "冠", "嫩",
71969"脅", "芯", "牢", "叛", "蝕", "奧", "鳴", "嶺", "羊", "憑",
71970"串", "塘", "繪", "酵", "融", "盆", "錫", "廟", "籌", "凍",
71971"輔", "攝", "襲", "筋", "拒", "僚", "旱", "鉀", "鳥", "漆",
71972"沈", "眉", "疏", "添", "棒", "穗", "硝", "韓", "逼", "扭",
71973"僑", "涼", "挺", "碗", "栽", "炒", "杯", "患", "餾", "勸",
71974"豪", "遼", "勃", "鴻", "旦", "吏", "拜", "狗", "埋", "輥",
71975"掩", "飲", "搬", "罵", "辭", "勾", "扣", "估", "蔣", "絨",
71976"霧", "丈", "朵", "姆", "擬", "宇", "輯", "陝", "雕", "償",
71977"蓄", "崇", "剪", "倡", "廳", "咬", "駛", "薯", "刷", "斥",
71978"番", "賦", "奉", "佛", "澆", "漫", "曼", "扇", "鈣", "桃",
71979"扶", "仔", "返", "俗", "虧", "腔", "鞋", "棱", "覆", "框",
71980"悄", "叔", "撞", "騙", "勘", "旺", "沸", "孤", "吐", "孟",
71981"渠", "屈", "疾", "妙", "惜", "仰", "狠", "脹", "諧", "拋",
71982"黴", "桑", "崗", "嘛", "衰", "盜", "滲", "臟", "賴", "湧",
71983"甜", "曹", "閱", "肌", "哩", "厲", "烴", "緯", "毅", "昨",
71984"偽", "症", "煮", "嘆", "釘", "搭", "莖", "籠", "酷", "偷",
71985"弓", "錐", "恆", "傑", "坑", "鼻", "翼", "綸", "敘", "獄",
71986"逮", "罐", "絡", "棚", "抑", "膨", "蔬", "寺", "驟", "穆",
71987"冶", "枯", "冊", "屍", "凸", "紳", "坯", "犧", "焰", "轟",
71988"欣", "晉", "瘦", "禦", "錠", "錦", "喪", "旬", "鍛", "壟",
71989"搜", "撲", "邀", "亭", "酯", "邁", "舒", "脆", "酶", "閒",
71990"憂", "酚", "頑", "羽", "漲", "卸", "仗", "陪", "闢", "懲",
71991"杭", "姚", "肚", "捉", "飄", "漂", "昆", "欺", "吾", "郎",
71992"烷", "汁", "呵", "飾", "蕭", "雅", "郵", "遷", "燕", "撒",
71993"姻", "赴", "宴", "煩", "債", "帳", "斑", "鈴", "旨", "醇",
71994"董", "餅", "雛", "姿", "拌", "傅", "腹", "妥", "揉", "賢",
71995"拆", "歪", "葡", "胺", "丟", "浩", "徽", "昂", "墊", "擋",
71996"覽", "貪", "慰", "繳", "汪", "慌", "馮", "諾", "姜", "誼",
71997"兇", "劣", "誣", "耀", "昏", "躺", "盈", "騎", "喬", "溪",
71998"叢", "盧", "抹", "悶", "諮", "刮", "駕", "纜", "悟", "摘",
71999"鉺", "擲", "頗", "幻", "柄", "惠", "慘", "佳", "仇", "臘",
72000"窩", "滌", "劍", "瞧", "堡", "潑", "蔥", "罩", "霍", "撈",
72001"胎", "蒼", "濱", "倆", "捅", "湘", "砍", "霞", "邵", "萄",
72002"瘋", "淮", "遂", "熊", "糞", "烘", "宿", "檔", "戈", "駁",
72003"嫂", "裕", "徙", "箭", "捐", "腸", "撐", "曬", "辨", "殿",
72004"蓮", "攤", "攪", "醬", "屏", "疫", "哀", "蔡", "堵", "沫",
72005"皺", "暢", "疊", "閣", "萊", "敲", "轄", "鉤", "痕", "壩",
72006"巷", "餓", "禍", "丘", "玄", "溜", "曰", "邏", "彭", "嘗",
72007"卿", "妨", "艇", "吞", "韋", "怨", "矮", "歇" ]
72008</script>
72009 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
72010WORDLISTS["french"] = [
72011"abaisser", "abandon", "abdiquer", "abeille", "abolir", "aborder", "aboutir", "aboyer", "abrasif", "abreuver",
72012"abriter", "abroger", "abrupt", "absence", "absolu", "absurde", "abusif", "abyssal", "académie", "acajou",
72013"acarien", "accabler", "accepter", "acclamer", "accolade", "accroche", "accuser", "acerbe", "achat", "acheter",
72014"aciduler", "acier", "acompte", "acquérir", "acronyme", "acteur", "actif", "actuel", "adepte", "adéquat",
72015"adhésif", "adjectif", "adjuger", "admettre", "admirer", "adopter", "adorer", "adoucir", "adresse", "adroit",
72016"adulte", "adverbe", "aérer", "aéronef", "affaire", "affecter", "affiche", "affreux", "affubler", "agacer",
72017"agencer", "agile", "agiter", "agrafer", "agréable", "agrume", "aider", "aiguille", "ailier", "aimable",
72018"aisance", "ajouter", "ajuster", "alarmer", "alchimie", "alerte", "algèbre", "algue", "aliéner", "aliment",
72019"alléger", "alliage", "allouer", "allumer", "alourdir", "alpaga", "altesse", "alvéole", "amateur", "ambigu",
72020"ambre", "aménager", "amertume", "amidon", "amiral", "amorcer", "amour", "amovible", "amphibie", "ampleur",
72021"amusant", "analyse", "anaphore", "anarchie", "anatomie", "ancien", "anéantir", "angle", "angoisse", "anguleux",
72022"animal", "annexer", "annonce", "annuel", "anodin", "anomalie", "anonyme", "anormal", "antenne", "antidote",
72023"anxieux", "apaiser", "apéritif", "aplanir", "apologie", "appareil", "appeler", "apporter", "appuyer", "aquarium",
72024"aqueduc", "arbitre", "arbuste", "ardeur", "ardoise", "argent", "arlequin", "armature", "armement", "armoire",
72025"armure", "arpenter", "arracher", "arriver", "arroser", "arsenic", "artériel", "article", "aspect", "asphalte",
72026"aspirer", "assaut", "asservir", "assiette", "associer", "assurer", "asticot", "astre", "astuce", "atelier",
72027"atome", "atrium", "atroce", "attaque", "attentif", "attirer", "attraper", "aubaine", "auberge", "audace",
72028"audible", "augurer", "aurore", "automne", "autruche", "avaler", "avancer", "avarice", "avenir", "averse",
72029"aveugle", "aviateur", "avide", "avion", "aviser", "avoine", "avouer", "avril", "axial", "axiome",
72030"badge", "bafouer", "bagage", "baguette", "baignade", "balancer", "balcon", "baleine", "balisage", "bambin",
72031"bancaire", "bandage", "banlieue", "bannière", "banquier", "barbier", "baril", "baron", "barque", "barrage",
72032"bassin", "bastion", "bataille", "bateau", "batterie", "baudrier", "bavarder", "belette", "bélier", "belote",
72033"bénéfice", "berceau", "berger", "berline", "bermuda", "besace", "besogne", "bétail", "beurre", "biberon",
72034"bicycle", "bidule", "bijou", "bilan", "bilingue", "billard", "binaire", "biologie", "biopsie", "biotype",
72035"biscuit", "bison", "bistouri", "bitume", "bizarre", "blafard", "blague", "blanchir", "blessant", "blinder",
72036"blond", "bloquer", "blouson", "bobard", "bobine", "boire", "boiser", "bolide", "bonbon", "bondir",
72037"bonheur", "bonifier", "bonus", "bordure", "borne", "botte", "boucle", "boueux", "bougie", "boulon",
72038"bouquin", "bourse", "boussole", "boutique", "boxeur", "branche", "brasier", "brave", "brebis", "brèche",
72039"breuvage", "bricoler", "brigade", "brillant", "brioche", "brique", "brochure", "broder", "bronzer", "brousse",
72040"broyeur", "brume", "brusque", "brutal", "bruyant", "buffle", "buisson", "bulletin", "bureau", "burin",
72041"bustier", "butiner", "butoir", "buvable", "buvette", "cabanon", "cabine", "cachette", "cadeau", "cadre",
72042"caféine", "caillou", "caisson", "calculer", "calepin", "calibre", "calmer", "calomnie", "calvaire", "camarade",
72043"caméra", "camion", "campagne", "canal", "caneton", "canon", "cantine", "canular", "capable", "caporal",
72044"caprice", "capsule", "capter", "capuche", "carabine", "carbone", "caresser", "caribou", "carnage", "carotte",
72045"carreau", "carton", "cascade", "casier", "casque", "cassure", "causer", "caution", "cavalier", "caverne",
72046"caviar", "cédille", "ceinture", "céleste", "cellule", "cendrier", "censurer", "central", "cercle", "cérébral",
72047"cerise", "cerner", "cerveau", "cesser", "chagrin", "chaise", "chaleur", "chambre", "chance", "chapitre",
72048"charbon", "chasseur", "chaton", "chausson", "chavirer", "chemise", "chenille", "chéquier", "chercher", "cheval",
72049"chien", "chiffre", "chignon", "chimère", "chiot", "chlorure", "chocolat", "choisir", "chose", "chouette",
72050"chrome", "chute", "cigare", "cigogne", "cimenter", "cinéma", "cintrer", "circuler", "cirer", "cirque",
72051"citerne", "citoyen", "citron", "civil", "clairon", "clameur", "claquer", "classe", "clavier", "client",
72052"cligner", "climat", "clivage", "cloche", "clonage", "cloporte", "cobalt", "cobra", "cocasse", "cocotier",
72053"coder", "codifier", "coffre", "cogner", "cohésion", "coiffer", "coincer", "colère", "colibri", "colline",
72054"colmater", "colonel", "combat", "comédie", "commande", "compact", "concert", "conduire", "confier", "congeler",
72055"connoter", "consonne", "contact", "convexe", "copain", "copie", "corail", "corbeau", "cordage", "corniche",
72056"corpus", "correct", "cortège", "cosmique", "costume", "coton", "coude", "coupure", "courage", "couteau",
72057"couvrir", "coyote", "crabe", "crainte", "cravate", "crayon", "créature", "créditer", "crémeux", "creuser",
72058"crevette", "cribler", "crier", "cristal", "critère", "croire", "croquer", "crotale", "crucial", "cruel",
72059"crypter", "cubique", "cueillir", "cuillère", "cuisine", "cuivre", "culminer", "cultiver", "cumuler", "cupide",
72060"curatif", "curseur", "cyanure", "cycle", "cylindre", "cynique", "daigner", "damier", "danger", "danseur",
72061"dauphin", "débattre", "débiter", "déborder", "débrider", "débutant", "décaler", "décembre", "déchirer", "décider",
72062"déclarer", "décorer", "décrire", "décupler", "dédale", "déductif", "déesse", "défensif", "défiler", "défrayer",
72063"dégager", "dégivrer", "déglutir", "dégrafer", "déjeuner", "délice", "déloger", "demander", "demeurer", "démolir",
72064"dénicher", "dénouer", "dentelle", "dénuder", "départ", "dépenser", "déphaser", "déplacer", "déposer", "déranger",
72065"dérober", "désastre", "descente", "désert", "désigner", "désobéir", "dessiner", "destrier", "détacher", "détester",
72066"détourer", "détresse", "devancer", "devenir", "deviner", "devoir", "diable", "dialogue", "diamant", "dicter",
72067"différer", "digérer", "digital", "digne", "diluer", "dimanche", "diminuer", "dioxyde", "directif", "diriger",
72068"discuter", "disposer", "dissiper", "distance", "divertir", "diviser", "docile", "docteur", "dogme", "doigt",
72069"domaine", "domicile", "dompter", "donateur", "donjon", "donner", "dopamine", "dortoir", "dorure", "dosage",
72070"doseur", "dossier", "dotation", "douanier", "double", "douceur", "douter", "doyen", "dragon", "draper",
72071"dresser", "dribbler", "droiture", "duperie", "duplexe", "durable", "durcir", "dynastie", "éblouir", "écarter",
72072"écharpe", "échelle", "éclairer", "éclipse", "éclore", "écluse", "école", "économie", "écorce", "écouter",
72073"écraser", "écrémer", "écrivain", "écrou", "écume", "écureuil", "édifier", "éduquer", "effacer", "effectif",
72074"effigie", "effort", "effrayer", "effusion", "égaliser", "égarer", "éjecter", "élaborer", "élargir", "électron",
72075"élégant", "éléphant", "élève", "éligible", "élitisme", "éloge", "élucider", "éluder", "emballer", "embellir",
72076"embryon", "émeraude", "émission", "emmener", "émotion", "émouvoir", "empereur", "employer", "emporter", "emprise",
72077"émulsion", "encadrer", "enchère", "enclave", "encoche", "endiguer", "endosser", "endroit", "enduire", "énergie",
72078"enfance", "enfermer", "enfouir", "engager", "engin", "englober", "énigme", "enjamber", "enjeu", "enlever",
72079"ennemi", "ennuyeux", "enrichir", "enrobage", "enseigne", "entasser", "entendre", "entier", "entourer", "entraver",
72080"énumérer", "envahir", "enviable", "envoyer", "enzyme", "éolien", "épaissir", "épargne", "épatant", "épaule",
72081"épicerie", "épidémie", "épier", "épilogue", "épine", "épisode", "épitaphe", "époque", "épreuve", "éprouver",
72082"épuisant", "équerre", "équipe", "ériger", "érosion", "erreur", "éruption", "escalier", "espadon", "espèce",
72083"espiègle", "espoir", "esprit", "esquiver", "essayer", "essence", "essieu", "essorer", "estime", "estomac",
72084"estrade", "étagère", "étaler", "étanche", "étatique", "éteindre", "étendoir", "éternel", "éthanol", "éthique",
72085"ethnie", "étirer", "étoffer", "étoile", "étonnant", "étourdir", "étrange", "étroit", "étude", "euphorie",
72086"évaluer", "évasion", "éventail", "évidence", "éviter", "évolutif", "évoquer", "exact", "exagérer", "exaucer",
72087"exceller", "excitant", "exclusif", "excuse", "exécuter", "exemple", "exercer", "exhaler", "exhorter", "exigence",
72088"exiler", "exister", "exotique", "expédier", "explorer", "exposer", "exprimer", "exquis", "extensif", "extraire",
72089"exulter", "fable", "fabuleux", "facette", "facile", "facture", "faiblir", "falaise", "fameux", "famille",
72090"farceur", "farfelu", "farine", "farouche", "fasciner", "fatal", "fatigue", "faucon", "fautif", "faveur",
72091"favori", "fébrile", "féconder", "fédérer", "félin", "femme", "fémur", "fendoir", "féodal", "fermer",
72092"féroce", "ferveur", "festival", "feuille", "feutre", "février", "fiasco", "ficeler", "fictif", "fidèle",
72093"figure", "filature", "filetage", "filière", "filleul", "filmer", "filou", "filtrer", "financer", "finir",
72094"fiole", "firme", "fissure", "fixer", "flairer", "flamme", "flasque", "flatteur", "fléau", "flèche",
72095"fleur", "flexion", "flocon", "flore", "fluctuer", "fluide", "fluvial", "folie", "fonderie", "fongible",
72096"fontaine", "forcer", "forgeron", "formuler", "fortune", "fossile", "foudre", "fougère", "fouiller", "foulure",
72097"fourmi", "fragile", "fraise", "franchir", "frapper", "frayeur", "frégate", "freiner", "frelon", "frémir",
72098"frénésie", "frère", "friable", "friction", "frisson", "frivole", "froid", "fromage", "frontal", "frotter",
72099"fruit", "fugitif", "fuite", "fureur", "furieux", "furtif", "fusion", "futur", "gagner", "galaxie",
72100"galerie", "gambader", "garantir", "gardien", "garnir", "garrigue", "gazelle", "gazon", "géant", "gélatine",
72101"gélule", "gendarme", "général", "génie", "genou", "gentil", "géologie", "géomètre", "géranium", "germe",
72102"gestuel", "geyser", "gibier", "gicler", "girafe", "givre", "glace", "glaive", "glisser", "globe",
72103"gloire", "glorieux", "golfeur", "gomme", "gonfler", "gorge", "gorille", "goudron", "gouffre", "goulot",
72104"goupille", "gourmand", "goutte", "graduel", "graffiti", "graine", "grand", "grappin", "gratuit", "gravir",
72105"grenat", "griffure", "griller", "grimper", "grogner", "gronder", "grotte", "groupe", "gruger", "grutier",
72106"gruyère", "guépard", "guerrier", "guide", "guimauve", "guitare", "gustatif", "gymnaste", "gyrostat", "habitude",
72107"hachoir", "halte", "hameau", "hangar", "hanneton", "haricot", "harmonie", "harpon", "hasard", "hélium",
72108"hématome", "herbe", "hérisson", "hermine", "héron", "hésiter", "heureux", "hiberner", "hibou", "hilarant",
72109"histoire", "hiver", "homard", "hommage", "homogène", "honneur", "honorer", "honteux", "horde", "horizon",
72110"horloge", "hormone", "horrible", "houleux", "housse", "hublot", "huileux", "humain", "humble", "humide",
72111"humour", "hurler", "hydromel", "hygiène", "hymne", "hypnose", "idylle", "ignorer", "iguane", "illicite",
72112"illusion", "image", "imbiber", "imiter", "immense", "immobile", "immuable", "impact", "impérial", "implorer",
72113"imposer", "imprimer", "imputer", "incarner", "incendie", "incident", "incliner", "incolore", "indexer", "indice",
72114"inductif", "inédit", "ineptie", "inexact", "infini", "infliger", "informer", "infusion", "ingérer", "inhaler",
72115"inhiber", "injecter", "injure", "innocent", "inoculer", "inonder", "inscrire", "insecte", "insigne", "insolite",
72116"inspirer", "instinct", "insulter", "intact", "intense", "intime", "intrigue", "intuitif", "inutile", "invasion",
72117"inventer", "inviter", "invoquer", "ironique", "irradier", "irréel", "irriter", "isoler", "ivoire", "ivresse",
72118"jaguar", "jaillir", "jambe", "janvier", "jardin", "jauger", "jaune", "javelot", "jetable", "jeton",
72119"jeudi", "jeunesse", "joindre", "joncher", "jongler", "joueur", "jouissif", "journal", "jovial", "joyau",
72120"joyeux", "jubiler", "jugement", "junior", "jupon", "juriste", "justice", "juteux", "juvénile", "kayak",
72121"kimono", "kiosque", "label", "labial", "labourer", "lacérer", "lactose", "lagune", "laine", "laisser",
72122"laitier", "lambeau", "lamelle", "lampe", "lanceur", "langage", "lanterne", "lapin", "largeur", "larme",
72123"laurier", "lavabo", "lavoir", "lecture", "légal", "léger", "légume", "lessive", "lettre", "levier",
72124"lexique", "lézard", "liasse", "libérer", "libre", "licence", "licorne", "liège", "lièvre", "ligature",
72125"ligoter", "ligue", "limer", "limite", "limonade", "limpide", "linéaire", "lingot", "lionceau", "liquide",
72126"lisière", "lister", "lithium", "litige", "littoral", "livreur", "logique", "lointain", "loisir", "lombric",
72127"loterie", "louer", "lourd", "loutre", "louve", "loyal", "lubie", "lucide", "lucratif", "lueur",
72128"lugubre", "luisant", "lumière", "lunaire", "lundi", "luron", "lutter", "luxueux", "machine", "magasin",
72129"magenta", "magique", "maigre", "maillon", "maintien", "mairie", "maison", "majorer", "malaxer", "maléfice",
72130"malheur", "malice", "mallette", "mammouth", "mandater", "maniable", "manquant", "manteau", "manuel", "marathon",
72131"marbre", "marchand", "mardi", "maritime", "marqueur", "marron", "marteler", "mascotte", "massif", "matériel",
72132"matière", "matraque", "maudire", "maussade", "mauve", "maximal", "méchant", "méconnu", "médaille", "médecin",
72133"méditer", "méduse", "meilleur", "mélange", "mélodie", "membre", "mémoire", "menacer", "mener", "menhir",
72134"mensonge", "mentor", "mercredi", "mérite", "merle", "messager", "mesure", "métal", "météore", "méthode",
72135"métier", "meuble", "miauler", "microbe", "miette", "mignon", "migrer", "milieu", "million", "mimique",
72136"mince", "minéral", "minimal", "minorer", "minute", "miracle", "miroiter", "missile", "mixte", "mobile",
72137"moderne", "moelleux", "mondial", "moniteur", "monnaie", "monotone", "monstre", "montagne", "monument", "moqueur",
72138"morceau", "morsure", "mortier", "moteur", "motif", "mouche", "moufle", "moulin", "mousson", "mouton",
72139"mouvant", "multiple", "munition", "muraille", "murène", "murmure", "muscle", "muséum", "musicien", "mutation",
72140"muter", "mutuel", "myriade", "myrtille", "mystère", "mythique", "nageur", "nappe", "narquois", "narrer",
72141"natation", "nation", "nature", "naufrage", "nautique", "navire", "nébuleux", "nectar", "néfaste", "négation",
72142"négliger", "négocier", "neige", "nerveux", "nettoyer", "neurone", "neutron", "neveu", "niche", "nickel",
72143"nitrate", "niveau", "noble", "nocif", "nocturne", "noirceur", "noisette", "nomade", "nombreux", "nommer",
72144"normatif", "notable", "notifier", "notoire", "nourrir", "nouveau", "novateur", "novembre", "novice", "nuage",
72145"nuancer", "nuire", "nuisible", "numéro", "nuptial", "nuque", "nutritif", "obéir", "objectif", "obliger",
72146"obscur", "observer", "obstacle", "obtenir", "obturer", "occasion", "occuper", "océan", "octobre", "octroyer",
72147"octupler", "oculaire", "odeur", "odorant", "offenser", "officier", "offrir", "ogive", "oiseau", "oisillon",
72148"olfactif", "olivier", "ombrage", "omettre", "onctueux", "onduler", "onéreux", "onirique", "opale", "opaque",
72149"opérer", "opinion", "opportun", "opprimer", "opter", "optique", "orageux", "orange", "orbite", "ordonner",
72150"oreille", "organe", "orgueil", "orifice", "ornement", "orque", "ortie", "osciller", "osmose", "ossature",
72151"otarie", "ouragan", "ourson", "outil", "outrager", "ouvrage", "ovation", "oxyde", "oxygène", "ozone",
72152"paisible", "palace", "palmarès", "palourde", "palper", "panache", "panda", "pangolin", "paniquer", "panneau",
72153"panorama", "pantalon", "papaye", "papier", "papoter", "papyrus", "paradoxe", "parcelle", "paresse", "parfumer",
72154"parler", "parole", "parrain", "parsemer", "partager", "parure", "parvenir", "passion", "pastèque", "paternel",
72155"patience", "patron", "pavillon", "pavoiser", "payer", "paysage", "peigne", "peintre", "pelage", "pélican",
72156"pelle", "pelouse", "peluche", "pendule", "pénétrer", "pénible", "pensif", "pénurie", "pépite", "péplum",
72157"perdrix", "perforer", "période", "permuter", "perplexe", "persil", "perte", "peser", "pétale", "petit",
72158"pétrir", "peuple", "pharaon", "phobie", "phoque", "photon", "phrase", "physique", "piano", "pictural",
72159"pièce", "pierre", "pieuvre", "pilote", "pinceau", "pipette", "piquer", "pirogue", "piscine", "piston",
72160"pivoter", "pixel", "pizza", "placard", "plafond", "plaisir", "planer", "plaque", "plastron", "plateau",
72161"pleurer", "plexus", "pliage", "plomb", "plonger", "pluie", "plumage", "pochette", "poésie", "poète",
72162"pointe", "poirier", "poisson", "poivre", "polaire", "policier", "pollen", "polygone", "pommade", "pompier",
72163"ponctuel", "pondérer", "poney", "portique", "position", "posséder", "posture", "potager", "poteau", "potion",
72164"pouce", "poulain", "poumon", "pourpre", "poussin", "pouvoir", "prairie", "pratique", "précieux", "prédire",
72165"préfixe", "prélude", "prénom", "présence", "prétexte", "prévoir", "primitif", "prince", "prison", "priver",
72166"problème", "procéder", "prodige", "profond", "progrès", "proie", "projeter", "prologue", "promener", "propre",
72167"prospère", "protéger", "prouesse", "proverbe", "prudence", "pruneau", "psychose", "public", "puceron", "puiser",
72168"pulpe", "pulsar", "punaise", "punitif", "pupitre", "purifier", "puzzle", "pyramide", "quasar", "querelle",
72169"question", "quiétude", "quitter", "quotient", "racine", "raconter", "radieux", "ragondin", "raideur", "raisin",
72170"ralentir", "rallonge", "ramasser", "rapide", "rasage", "ratisser", "ravager", "ravin", "rayonner", "réactif",
72171"réagir", "réaliser", "réanimer", "recevoir", "réciter", "réclamer", "récolter", "recruter", "reculer", "recycler",
72172"rédiger", "redouter", "refaire", "réflexe", "réformer", "refrain", "refuge", "régalien", "région", "réglage",
72173"régulier", "réitérer", "rejeter", "rejouer", "relatif", "relever", "relief", "remarque", "remède", "remise",
72174"remonter", "remplir", "remuer", "renard", "renfort", "renifler", "renoncer", "rentrer", "renvoi", "replier",
72175"reporter", "reprise", "reptile", "requin", "réserve", "résineux", "résoudre", "respect", "rester", "résultat",
72176"rétablir", "retenir", "réticule", "retomber", "retracer", "réunion", "réussir", "revanche", "revivre", "révolte",
72177"révulsif", "richesse", "rideau", "rieur", "rigide", "rigoler", "rincer", "riposter", "risible", "risque",
72178"rituel", "rival", "rivière", "rocheux", "romance", "rompre", "ronce", "rondin", "roseau", "rosier",
72179"rotatif", "rotor", "rotule", "rouge", "rouille", "rouleau", "routine", "royaume", "ruban", "rubis",
72180"ruche", "ruelle", "rugueux", "ruiner", "ruisseau", "ruser", "rustique", "rythme", "sabler", "saboter",
72181"sabre", "sacoche", "safari", "sagesse", "saisir", "salade", "salive", "salon", "saluer", "samedi",
72182"sanction", "sanglier", "sarcasme", "sardine", "saturer", "saugrenu", "saumon", "sauter", "sauvage", "savant",
72183"savonner", "scalpel", "scandale", "scélérat", "scénario", "sceptre", "schéma", "science", "scinder", "score",
72184"scrutin", "sculpter", "séance", "sécable", "sécher", "secouer", "sécréter", "sédatif", "séduire", "seigneur",
72185"séjour", "sélectif", "semaine", "sembler", "semence", "séminal", "sénateur", "sensible", "sentence", "séparer",
72186"séquence", "serein", "sergent", "sérieux", "serrure", "sérum", "service", "sésame", "sévir", "sevrage",
72187"sextuple", "sidéral", "siècle", "siéger", "siffler", "sigle", "signal", "silence", "silicium", "simple",
72188"sincère", "sinistre", "siphon", "sirop", "sismique", "situer", "skier", "social", "socle", "sodium",
72189"soigneux", "soldat", "soleil", "solitude", "soluble", "sombre", "sommeil", "somnoler", "sonde", "songeur",
72190"sonnette", "sonore", "sorcier", "sortir", "sosie", "sottise", "soucieux", "soudure", "souffle", "soulever",
72191"soupape", "source", "soutirer", "souvenir", "spacieux", "spatial", "spécial", "sphère", "spiral", "stable",
72192"station", "sternum", "stimulus", "stipuler", "strict", "studieux", "stupeur", "styliste", "sublime", "substrat",
72193"subtil", "subvenir", "succès", "sucre", "suffixe", "suggérer", "suiveur", "sulfate", "superbe", "supplier",
72194"surface", "suricate", "surmener", "surprise", "sursaut", "survie", "suspect", "syllabe", "symbole", "symétrie",
72195"synapse", "syntaxe", "système", "tabac", "tablier", "tactile", "tailler", "talent", "talisman", "talonner",
72196"tambour", "tamiser", "tangible", "tapis", "taquiner", "tarder", "tarif", "tartine", "tasse", "tatami",
72197"tatouage", "taupe", "taureau", "taxer", "témoin", "temporel", "tenaille", "tendre", "teneur", "tenir",
72198"tension", "terminer", "terne", "terrible", "tétine", "texte", "thème", "théorie", "thérapie", "thorax",
72199"tibia", "tiède", "timide", "tirelire", "tiroir", "tissu", "titane", "titre", "tituber", "toboggan",
72200"tolérant", "tomate", "tonique", "tonneau", "toponyme", "torche", "tordre", "tornade", "torpille", "torrent",
72201"torse", "tortue", "totem", "toucher", "tournage", "tousser", "toxine", "traction", "trafic", "tragique",
72202"trahir", "train", "trancher", "travail", "trèfle", "tremper", "trésor", "treuil", "triage", "tribunal",
72203"tricoter", "trilogie", "triomphe", "tripler", "triturer", "trivial", "trombone", "tronc", "tropical", "troupeau",
72204"tuile", "tulipe", "tumulte", "tunnel", "turbine", "tuteur", "tutoyer", "tuyau", "tympan", "typhon",
72205"typique", "tyran", "ubuesque", "ultime", "ultrason", "unanime", "unifier", "union", "unique", "unitaire",
72206"univers", "uranium", "urbain", "urticant", "usage", "usine", "usuel", "usure", "utile", "utopie",
72207"vacarme", "vaccin", "vagabond", "vague", "vaillant", "vaincre", "vaisseau", "valable", "valise", "vallon",
72208"valve", "vampire", "vanille", "vapeur", "varier", "vaseux", "vassal", "vaste", "vecteur", "vedette",
72209"végétal", "véhicule", "veinard", "véloce", "vendredi", "vénérer", "venger", "venimeux", "ventouse", "verdure",
72210"vérin", "vernir", "verrou", "verser", "vertu", "veston", "vétéran", "vétuste", "vexant", "vexer",
72211"viaduc", "viande", "victoire", "vidange", "vidéo", "vignette", "vigueur", "vilain", "village", "vinaigre",
72212"violon", "vipère", "virement", "virtuose", "virus", "visage", "viseur", "vision", "visqueux", "visuel",
72213"vital", "vitesse", "viticole", "vitrine", "vivace", "vivipare", "vocation", "voguer", "voile", "voisin",
72214"voiture", "volaille", "volcan", "voltiger", "volume", "vorace", "vortex", "voter", "vouloir", "voyage",
72215"voyelle", "wagon", "xénon", "yacht", "zèbre", "zénith", "zeste", "zoologie"]
72216</script>
72217 <script>WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
72218WORDLISTS["italian"] = [
72219"abaco", "abbaglio", "abbinato", "abete", "abisso", "abolire", "abrasivo", "abrogato", "accadere", "accenno",
72220"accusato", "acetone", "achille", "acido", "acqua", "acre", "acrilico", "acrobata", "acuto", "adagio",
72221"addebito", "addome", "adeguato", "aderire", "adipe", "adottare", "adulare", "affabile", "affetto", "affisso",
72222"affranto", "aforisma", "afoso", "africano", "agave", "agente", "agevole", "aggancio", "agire", "agitare",
72223"agonismo", "agricolo", "agrumeto", "aguzzo", "alabarda", "alato", "albatro", "alberato", "albo", "albume",
72224"alce", "alcolico", "alettone", "alfa", "algebra", "aliante", "alibi", "alimento", "allagato", "allegro",
72225"allievo", "allodola", "allusivo", "almeno", "alogeno", "alpaca", "alpestre", "altalena", "alterno", "alticcio",
72226"altrove", "alunno", "alveolo", "alzare", "amalgama", "amanita", "amarena", "ambito", "ambrato", "ameba",
72227"america", "ametista", "amico", "ammasso", "ammenda", "ammirare", "ammonito", "amore", "ampio", "ampliare",
72228"amuleto", "anacardo", "anagrafe", "analista", "anarchia", "anatra", "anca", "ancella", "ancora", "andare",
72229"andrea", "anello", "angelo", "angolare", "angusto", "anima", "annegare", "annidato", "anno", "annuncio",
72230"anonimo", "anticipo", "anzi", "apatico", "apertura", "apode", "apparire", "appetito", "appoggio", "approdo",
72231"appunto", "aprile", "arabica", "arachide", "aragosta", "araldica", "arancio", "aratura", "arazzo", "arbitro",
72232"archivio", "ardito", "arenile", "argento", "argine", "arguto", "aria", "armonia", "arnese", "arredato",
72233"arringa", "arrosto", "arsenico", "arso", "artefice", "arzillo", "asciutto", "ascolto", "asepsi", "asettico",
72234"asfalto", "asino", "asola", "aspirato", "aspro", "assaggio", "asse", "assoluto", "assurdo", "asta",
72235"astenuto", "astice", "astratto", "atavico", "ateismo", "atomico", "atono", "attesa", "attivare", "attorno",
72236"attrito", "attuale", "ausilio", "austria", "autista", "autonomo", "autunno", "avanzato", "avere", "avvenire",
72237"avviso", "avvolgere", "azione", "azoto", "azzimo", "azzurro", "babele", "baccano", "bacino", "baco",
72238"badessa", "badilata", "bagnato", "baita", "balcone", "baldo", "balena", "ballata", "balzano", "bambino",
72239"bandire", "baraonda", "barbaro", "barca", "baritono", "barlume", "barocco", "basilico", "basso", "batosta",
72240"battuto", "baule", "bava", "bavosa", "becco", "beffa", "belgio", "belva", "benda", "benevole",
72241"benigno", "benzina", "bere", "berlina", "beta", "bibita", "bici", "bidone", "bifido", "biga",
72242"bilancia", "bimbo", "binocolo", "biologo", "bipede", "bipolare", "birbante", "birra", "biscotto", "bisesto",
72243"bisnonno", "bisonte", "bisturi", "bizzarro", "blando", "blatta", "bollito", "bonifico", "bordo", "bosco",
72244"botanico", "bottino", "bozzolo", "braccio", "bradipo", "brama", "branca", "bravura", "bretella", "brevetto",
72245"brezza", "briglia", "brillante", "brindare", "broccolo", "brodo", "bronzina", "brullo", "bruno", "bubbone",
72246"buca", "budino", "buffone", "buio", "bulbo", "buono", "burlone", "burrasca", "bussola", "busta",
72247"cadetto", "caduco", "calamaro", "calcolo", "calesse", "calibro", "calmo", "caloria", "cambusa", "camerata",
72248"camicia", "cammino", "camola", "campale", "canapa", "candela", "cane", "canino", "canotto", "cantina",
72249"capace", "capello", "capitolo", "capogiro", "cappero", "capra", "capsula", "carapace", "carcassa", "cardo",
72250"carisma", "carovana", "carretto", "cartolina", "casaccio", "cascata", "caserma", "caso", "cassone", "castello",
72251"casuale", "catasta", "catena", "catrame", "cauto", "cavillo", "cedibile", "cedrata", "cefalo", "celebre",
72252"cellulare", "cena", "cenone", "centesimo", "ceramica", "cercare", "certo", "cerume", "cervello", "cesoia",
72253"cespo", "ceto", "chela", "chiaro", "chicca", "chiedere", "chimera", "china", "chirurgo", "chitarra",
72254"ciao", "ciclismo", "cifrare", "cigno", "cilindro", "ciottolo", "circa", "cirrosi", "citrico", "cittadino",
72255"ciuffo", "civetta", "civile", "classico", "clinica", "cloro", "cocco", "codardo", "codice", "coerente",
72256"cognome", "collare", "colmato", "colore", "colposo", "coltivato", "colza", "coma", "cometa", "commando",
72257"comodo", "computer", "comune", "conciso", "condurre", "conferma", "congelare", "coniuge", "connesso", "conoscere",
72258"consumo", "continuo", "convegno", "coperto", "copione", "coppia", "copricapo", "corazza", "cordata", "coricato",
72259"cornice", "corolla", "corpo", "corredo", "corsia", "cortese", "cosmico", "costante", "cottura", "covato",
72260"cratere", "cravatta", "creato", "credere", "cremoso", "crescita", "creta", "criceto", "crinale", "crisi",
72261"critico", "croce", "cronaca", "crostata", "cruciale", "crusca", "cucire", "cuculo", "cugino", "cullato",
72262"cupola", "curatore", "cursore", "curvo", "cuscino", "custode", "dado", "daino", "dalmata", "damerino",
72263"daniela", "dannoso", "danzare", "datato", "davanti", "davvero", "debutto", "decennio", "deciso", "declino",
72264"decollo", "decreto", "dedicato", "definito", "deforme", "degno", "delegare", "delfino", "delirio", "delta",
72265"demenza", "denotato", "dentro", "deposito", "derapata", "derivare", "deroga", "descritto", "deserto", "desiderio",
72266"desumere", "detersivo", "devoto", "diametro", "dicembre", "diedro", "difeso", "diffuso", "digerire", "digitale",
72267"diluvio", "dinamico", "dinnanzi", "dipinto", "diploma", "dipolo", "diradare", "dire", "dirotto", "dirupo",
72268"disagio", "discreto", "disfare", "disgelo", "disposto", "distanza", "disumano", "dito", "divano", "divelto",
72269"dividere", "divorato", "doblone", "docente", "doganale", "dogma", "dolce", "domato", "domenica", "dominare",
72270"dondolo", "dono", "dormire", "dote", "dottore", "dovuto", "dozzina", "drago", "druido", "dubbio",
72271"dubitare", "ducale", "duna", "duomo", "duplice", "duraturo", "ebano", "eccesso", "ecco", "eclissi",
72272"economia", "edera", "edicola", "edile", "editoria", "educare", "egemonia", "egli", "egoismo", "egregio",
72273"elaborato", "elargire", "elegante", "elencato", "eletto", "elevare", "elfico", "elica", "elmo", "elsa",
72274"eluso", "emanato", "emblema", "emesso", "emiro", "emotivo", "emozione", "empirico", "emulo", "endemico",
72275"enduro", "energia", "enfasi", "enoteca", "entrare", "enzima", "epatite", "epilogo", "episodio", "epocale",
72276"eppure", "equatore", "erario", "erba", "erboso", "erede", "eremita", "erigere", "ermetico", "eroe",
72277"erosivo", "errante", "esagono", "esame", "esanime", "esaudire", "esca", "esempio", "esercito", "esibito",
72278"esigente", "esistere", "esito", "esofago", "esortato", "esoso", "espanso", "espresso", "essenza", "esso",
72279"esteso", "estimare", "estonia", "estroso", "esultare", "etilico", "etnico", "etrusco", "etto", "euclideo",
72280"europa", "evaso", "evidenza", "evitato", "evoluto", "evviva", "fabbrica", "faccenda", "fachiro", "falco",
72281"famiglia", "fanale", "fanfara", "fango", "fantasma", "fare", "farfalla", "farinoso", "farmaco", "fascia",
72282"fastoso", "fasullo", "faticare", "fato", "favoloso", "febbre", "fecola", "fede", "fegato", "felpa",
72283"feltro", "femmina", "fendere", "fenomeno", "fermento", "ferro", "fertile", "fessura", "festivo", "fetta",
72284"feudo", "fiaba", "fiducia", "fifa", "figurato", "filo", "finanza", "finestra", "finire", "fiore",
72285"fiscale", "fisico", "fiume", "flacone", "flamenco", "flebo", "flemma", "florido", "fluente", "fluoro",
72286"fobico", "focaccia", "focoso", "foderato", "foglio", "folata", "folclore", "folgore", "fondente", "fonetico",
72287"fonia", "fontana", "forbito", "forchetta", "foresta", "formica", "fornaio", "foro", "fortezza", "forzare",
72288"fosfato", "fosso", "fracasso", "frana", "frassino", "fratello", "freccetta", "frenata", "fresco", "frigo",
72289"frollino", "fronde", "frugale", "frutta", "fucilata", "fucsia", "fuggente", "fulmine", "fulvo", "fumante",
72290"fumetto", "fumoso", "fune", "funzione", "fuoco", "furbo", "furgone", "furore", "fuso", "futile",
72291"gabbiano", "gaffe", "galateo", "gallina", "galoppo", "gambero", "gamma", "garanzia", "garbo", "garofano",
72292"garzone", "gasdotto", "gasolio", "gastrico", "gatto", "gaudio", "gazebo", "gazzella", "geco", "gelatina",
72293"gelso", "gemello", "gemmato", "gene", "genitore", "gennaio", "genotipo", "gergo", "ghepardo", "ghiaccio",
72294"ghisa", "giallo", "gilda", "ginepro", "giocare", "gioiello", "giorno", "giove", "girato", "girone",
72295"gittata", "giudizio", "giurato", "giusto", "globulo", "glutine", "gnomo", "gobba", "golf", "gomito",
72296"gommone", "gonfio", "gonna", "governo", "gracile", "grado", "grafico", "grammo", "grande", "grattare",
72297"gravoso", "grazia", "greca", "gregge", "grifone", "grigio", "grinza", "grotta", "gruppo", "guadagno",
72298"guaio", "guanto", "guardare", "gufo", "guidare", "ibernato", "icona", "identico", "idillio", "idolo",
72299"idra", "idrico", "idrogeno", "igiene", "ignaro", "ignorato", "ilare", "illeso", "illogico", "illudere",
72300"imballo", "imbevuto", "imbocco", "imbuto", "immane", "immerso", "immolato", "impacco", "impeto", "impiego",
72301"importo", "impronta", "inalare", "inarcare", "inattivo", "incanto", "incendio", "inchino", "incisivo", "incluso",
72302"incontro", "incrocio", "incubo", "indagine", "india", "indole", "inedito", "infatti", "infilare", "inflitto",
72303"ingaggio", "ingegno", "inglese", "ingordo", "ingrosso", "innesco", "inodore", "inoltrare", "inondato", "insano",
72304"insetto", "insieme", "insonnia", "insulina", "intasato", "intero", "intonaco", "intuito", "inumidire", "invalido",
72305"invece", "invito", "iperbole", "ipnotico", "ipotesi", "ippica", "iride", "irlanda", "ironico", "irrigato",
72306"irrorare", "isolato", "isotopo", "isterico", "istituto", "istrice", "italia", "iterare", "labbro", "labirinto",
72307"lacca", "lacerato", "lacrima", "lacuna", "laddove", "lago", "lampo", "lancetta", "lanterna", "lardoso",
72308"larga", "laringe", "lastra", "latenza", "latino", "lattuga", "lavagna", "lavoro", "legale", "leggero",
72309"lembo", "lentezza", "lenza", "leone", "lepre", "lesivo", "lessato", "lesto", "letterale", "leva",
72310"levigato", "libero", "lido", "lievito", "lilla", "limatura", "limitare", "limpido", "lineare", "lingua",
72311"liquido", "lira", "lirica", "lisca", "lite", "litigio", "livrea", "locanda", "lode", "logica",
72312"lombare", "londra", "longevo", "loquace", "lorenzo", "loto", "lotteria", "luce", "lucidato", "lumaca",
72313"luminoso", "lungo", "lupo", "luppolo", "lusinga", "lusso", "lutto", "macabro", "macchina", "macero",
72314"macinato", "madama", "magico", "maglia", "magnete", "magro", "maiolica", "malafede", "malgrado", "malinteso",
72315"malsano", "malto", "malumore", "mana", "mancia", "mandorla", "mangiare", "manifesto", "mannaro", "manovra",
72316"mansarda", "mantide", "manubrio", "mappa", "maratona", "marcire", "maretta", "marmo", "marsupio", "maschera",
72317"massaia", "mastino", "materasso", "matricola", "mattone", "maturo", "mazurca", "meandro", "meccanico", "mecenate",
72318"medesimo", "meditare", "mega", "melassa", "melis", "melodia", "meninge", "meno", "mensola", "mercurio",
72319"merenda", "merlo", "meschino", "mese", "messere", "mestolo", "metallo", "metodo", "mettere", "miagolare",
72320"mica", "micelio", "michele", "microbo", "midollo", "miele", "migliore", "milano", "milite", "mimosa",
72321"minerale", "mini", "minore", "mirino", "mirtillo", "miscela", "missiva", "misto", "misurare", "mitezza",
72322"mitigare", "mitra", "mittente", "mnemonico", "modello", "modifica", "modulo", "mogano", "mogio", "mole",
72323"molosso", "monastero", "monco", "mondina", "monetario", "monile", "monotono", "monsone", "montato", "monviso",
72324"mora", "mordere", "morsicato", "mostro", "motivato", "motosega", "motto", "movenza", "movimento", "mozzo",
72325"mucca", "mucosa", "muffa", "mughetto", "mugnaio", "mulatto", "mulinello", "multiplo", "mummia", "munto",
72326"muovere", "murale", "musa", "muscolo", "musica", "mutevole", "muto", "nababbo", "nafta", "nanometro",
72327"narciso", "narice", "narrato", "nascere", "nastrare", "naturale", "nautica", "naviglio", "nebulosa", "necrosi",
72328"negativo", "negozio", "nemmeno", "neofita", "neretto", "nervo", "nessuno", "nettuno", "neutrale", "neve",
72329"nevrotico", "nicchia", "ninfa", "nitido", "nobile", "nocivo", "nodo", "nome", "nomina", "nordico",
72330"normale", "norvegese", "nostrano", "notare", "notizia", "notturno", "novella", "nucleo", "nulla", "numero",
72331"nuovo", "nutrire", "nuvola", "nuziale", "oasi", "obbedire", "obbligo", "obelisco", "oblio", "obolo",
72332"obsoleto", "occasione", "occhio", "occidente", "occorrere", "occultare", "ocra", "oculato", "odierno", "odorare",
72333"offerta", "offrire", "offuscato", "oggetto", "oggi", "ognuno", "olandese", "olfatto", "oliato", "oliva",
72334"ologramma", "oltre", "omaggio", "ombelico", "ombra", "omega", "omissione", "ondoso", "onere", "onice",
72335"onnivoro", "onorevole", "onta", "operato", "opinione", "opposto", "oracolo", "orafo", "ordine", "orecchino",
72336"orefice", "orfano", "organico", "origine", "orizzonte", "orma", "ormeggio", "ornativo", "orologio", "orrendo",
72337"orribile", "ortensia", "ortica", "orzata", "orzo", "osare", "oscurare", "osmosi", "ospedale", "ospite",
72338"ossa", "ossidare", "ostacolo", "oste", "otite", "otre", "ottagono", "ottimo", "ottobre", "ovale",
72339"ovest", "ovino", "oviparo", "ovocito", "ovunque", "ovviare", "ozio", "pacchetto", "pace", "pacifico",
72340"padella", "padrone", "paese", "paga", "pagina", "palazzina", "palesare", "pallido", "palo", "palude",
72341"pandoro", "pannello", "paolo", "paonazzo", "paprica", "parabola", "parcella", "parere", "pargolo", "pari",
72342"parlato", "parola", "partire", "parvenza", "parziale", "passivo", "pasticca", "patacca", "patologia", "pattume",
72343"pavone", "peccato", "pedalare", "pedonale", "peggio", "peloso", "penare", "pendice", "penisola", "pennuto",
72344"penombra", "pensare", "pentola", "pepe", "pepita", "perbene", "percorso", "perdonato", "perforare", "pergamena",
72345"periodo", "permesso", "perno", "perplesso", "persuaso", "pertugio", "pervaso", "pesatore", "pesista", "peso",
72346"pestifero", "petalo", "pettine", "petulante", "pezzo", "piacere", "pianta", "piattino", "piccino", "picozza",
72347"piega", "pietra", "piffero", "pigiama", "pigolio", "pigro", "pila", "pilifero", "pillola", "pilota",
72348"pimpante", "pineta", "pinna", "pinolo", "pioggia", "piombo", "piramide", "piretico", "pirite", "pirolisi",
72349"pitone", "pizzico", "placebo", "planare", "plasma", "platano", "plenario", "pochezza", "poderoso", "podismo",
72350"poesia", "poggiare", "polenta", "poligono", "pollice", "polmonite", "polpetta", "polso", "poltrona", "polvere",
72351"pomice", "pomodoro", "ponte", "popoloso", "porfido", "poroso", "porpora", "porre", "portata", "posa",
72352"positivo", "possesso", "postulato", "potassio", "potere", "pranzo", "prassi", "pratica", "precluso", "predica",
72353"prefisso", "pregiato", "prelievo", "premere", "prenotare", "preparato", "presenza", "pretesto", "prevalso", "prima",
72354"principe", "privato", "problema", "procura", "produrre", "profumo", "progetto", "prolunga", "promessa", "pronome",
72355"proposta", "proroga", "proteso", "prova", "prudente", "prugna", "prurito", "psiche", "pubblico", "pudica",
72356"pugilato", "pugno", "pulce", "pulito", "pulsante", "puntare", "pupazzo", "pupilla", "puro", "quadro",
72357"qualcosa", "quasi", "querela", "quota", "raccolto", "raddoppio", "radicale", "radunato", "raffica", "ragazzo",
72358"ragione", "ragno", "ramarro", "ramingo", "ramo", "randagio", "rantolare", "rapato", "rapina", "rappreso",
72359"rasatura", "raschiato", "rasente", "rassegna", "rastrello", "rata", "ravveduto", "reale", "recepire", "recinto",
72360"recluta", "recondito", "recupero", "reddito", "redimere", "regalato", "registro", "regola", "regresso", "relazione",
72361"remare", "remoto", "renna", "replica", "reprimere", "reputare", "resa", "residente", "responso", "restauro",
72362"rete", "retina", "retorica", "rettifica", "revocato", "riassunto", "ribadire", "ribelle", "ribrezzo", "ricarica",
72363"ricco", "ricevere", "riciclato", "ricordo", "ricreduto", "ridicolo", "ridurre", "rifasare", "riflesso", "riforma",
72364"rifugio", "rigare", "rigettato", "righello", "rilassato", "rilevato", "rimanere", "rimbalzo", "rimedio", "rimorchio",
72365"rinascita", "rincaro", "rinforzo", "rinnovo", "rinomato", "rinsavito", "rintocco", "rinuncia", "rinvenire", "riparato",
72366"ripetuto", "ripieno", "riportare", "ripresa", "ripulire", "risata", "rischio", "riserva", "risibile", "riso",
72367"rispetto", "ristoro", "risultato", "risvolto", "ritardo", "ritegno", "ritmico", "ritrovo", "riunione", "riva",
72368"riverso", "rivincita", "rivolto", "rizoma", "roba", "robotico", "robusto", "roccia", "roco", "rodaggio",
72369"rodere", "roditore", "rogito", "rollio", "romantico", "rompere", "ronzio", "rosolare", "rospo", "rotante",
72370"rotondo", "rotula", "rovescio", "rubizzo", "rubrica", "ruga", "rullino", "rumine", "rumoroso", "ruolo",
72371"rupe", "russare", "rustico", "sabato", "sabbiare", "sabotato", "sagoma", "salasso", "saldatura", "salgemma",
72372"salivare", "salmone", "salone", "saltare", "saluto", "salvo", "sapere", "sapido", "saporito", "saraceno",
72373"sarcasmo", "sarto", "sassoso", "satellite", "satira", "satollo", "saturno", "savana", "savio", "saziato",
72374"sbadiglio", "sbalzo", "sbancato", "sbarra", "sbattere", "sbavare", "sbendare", "sbirciare", "sbloccato", "sbocciato",
72375"sbrinare", "sbruffone", "sbuffare", "scabroso", "scadenza", "scala", "scambiare", "scandalo", "scapola", "scarso",
72376"scatenare", "scavato", "scelto", "scenico", "scettro", "scheda", "schiena", "sciarpa", "scienza", "scindere",
72377"scippo", "sciroppo", "scivolo", "sclerare", "scodella", "scolpito", "scomparto", "sconforto", "scoprire", "scorta",
72378"scossone", "scozzese", "scriba", "scrollare", "scrutinio", "scuderia", "scultore", "scuola", "scuro", "scusare",
72379"sdebitare", "sdoganare", "seccatura", "secondo", "sedano", "seggiola", "segnalato", "segregato", "seguito", "selciato",
72380"selettivo", "sella", "selvaggio", "semaforo", "sembrare", "seme", "seminato", "sempre", "senso", "sentire",
72381"sepolto", "sequenza", "serata", "serbato", "sereno", "serio", "serpente", "serraglio", "servire", "sestina",
72382"setola", "settimana", "sfacelo", "sfaldare", "sfamato", "sfarzoso", "sfaticato", "sfera", "sfida", "sfilato",
72383"sfinge", "sfocato", "sfoderare", "sfogo", "sfoltire", "sforzato", "sfratto", "sfruttato", "sfuggito", "sfumare",
72384"sfuso", "sgabello", "sgarbato", "sgonfiare", "sgorbio", "sgrassato", "sguardo", "sibilo", "siccome", "sierra",
72385"sigla", "signore", "silenzio", "sillaba", "simbolo", "simpatico", "simulato", "sinfonia", "singolo", "sinistro",
72386"sino", "sintesi", "sinusoide", "sipario", "sisma", "sistole", "situato", "slitta", "slogatura", "sloveno",
72387"smarrito", "smemorato", "smentito", "smeraldo", "smilzo", "smontare", "smottato", "smussato", "snellire", "snervato",
72388"snodo", "sobbalzo", "sobrio", "soccorso", "sociale", "sodale", "soffitto", "sogno", "soldato", "solenne",
72389"solido", "sollazzo", "solo", "solubile", "solvente", "somatico", "somma", "sonda", "sonetto", "sonnifero",
72390"sopire", "soppeso", "sopra", "sorgere", "sorpasso", "sorriso", "sorso", "sorteggio", "sorvolato", "sospiro",
72391"sosta", "sottile", "spada", "spalla", "spargere", "spatola", "spavento", "spazzola", "specie", "spedire",
72392"spegnere", "spelatura", "speranza", "spessore", "spettrale", "spezzato", "spia", "spigoloso", "spillato", "spinoso",
72393"spirale", "splendido", "sportivo", "sposo", "spranga", "sprecare", "spronato", "spruzzo", "spuntino", "squillo",
72394"sradicare", "srotolato", "stabile", "stacco", "staffa", "stagnare", "stampato", "stantio", "starnuto", "stasera",
72395"statuto", "stelo", "steppa", "sterzo", "stiletto", "stima", "stirpe", "stivale", "stizzoso", "stonato",
72396"storico", "strappo", "stregato", "stridulo", "strozzare", "strutto", "stuccare", "stufo", "stupendo", "subentro",
72397"succoso", "sudore", "suggerito", "sugo", "sultano", "suonare", "superbo", "supporto", "surgelato", "surrogato",
72398"sussurro", "sutura", "svagare", "svedese", "sveglio", "svelare", "svenuto", "svezia", "sviluppo", "svista",
72399"svizzera", "svolta", "svuotare", "tabacco", "tabulato", "tacciare", "taciturno", "tale", "talismano", "tampone",
72400"tannino", "tara", "tardivo", "targato", "tariffa", "tarpare", "tartaruga", "tasto", "tattico", "taverna",
72401"tavolata", "tazza", "teca", "tecnico", "telefono", "temerario", "tempo", "temuto", "tendone", "tenero",
72402"tensione", "tentacolo", "teorema", "terme", "terrazzo", "terzetto", "tesi", "tesserato", "testato", "tetro",
72403"tettoia", "tifare", "tigella", "timbro", "tinto", "tipico", "tipografo", "tiraggio", "tiro", "titanio",
72404"titolo", "titubante", "tizio", "tizzone", "toccare", "tollerare", "tolto", "tombola", "tomo", "tonfo",
72405"tonsilla", "topazio", "topologia", "toppa", "torba", "tornare", "torrone", "tortora", "toscano", "tossire",
72406"tostatura", "totano", "trabocco", "trachea", "trafila", "tragedia", "tralcio", "tramonto", "transito", "trapano",
72407"trarre", "trasloco", "trattato", "trave", "treccia", "tremolio", "trespolo", "tributo", "tricheco", "trifoglio",
72408"trillo", "trincea", "trio", "tristezza", "triturato", "trivella", "tromba", "trono", "troppo", "trottola",
72409"trovare", "truccato", "tubatura", "tuffato", "tulipano", "tumulto", "tunisia", "turbare", "turchino", "tuta",
72410"tutela", "ubicato", "uccello", "uccisore", "udire", "uditivo", "uffa", "ufficio", "uguale", "ulisse",
72411"ultimato", "umano", "umile", "umorismo", "uncinetto", "ungere", "ungherese", "unicorno", "unificato", "unisono",
72412"unitario", "unte", "uovo", "upupa", "uragano", "urgenza", "urlo", "usanza", "usato", "uscito",
72413"usignolo", "usuraio", "utensile", "utilizzo", "utopia", "vacante", "vaccinato", "vagabondo", "vagliato", "valanga",
72414"valgo", "valico", "valletta", "valoroso", "valutare", "valvola", "vampata", "vangare", "vanitoso", "vano",
72415"vantaggio", "vanvera", "vapore", "varano", "varcato", "variante", "vasca", "vedetta", "vedova", "veduto",
72416"vegetale", "veicolo", "velcro", "velina", "velluto", "veloce", "venato", "vendemmia", "vento", "verace",
72417"verbale", "vergogna", "verifica", "vero", "verruca", "verticale", "vescica", "vessillo", "vestale", "veterano",
72418"vetrina", "vetusto", "viandante", "vibrante", "vicenda", "vichingo", "vicinanza", "vidimare", "vigilia", "vigneto",
72419"vigore", "vile", "villano", "vimini", "vincitore", "viola", "vipera", "virgola", "virologo", "virulento",
72420"viscoso", "visione", "vispo", "vissuto", "visura", "vita", "vitello", "vittima", "vivanda", "vivido",
72421"viziare", "voce", "voga", "volatile", "volere", "volpe", "voragine", "vulcano", "zampogna", "zanna",
72422"zappato", "zattera", "zavorra", "zefiro", "zelante", "zelo", "zenzero", "zerbino", "zibetto", "zinco",
72423"zircone", "zitto", "zolla", "zotico", "zucchero", "zufolo", "zulu", "zuppa"]
72424</script>
72425 <script>/*
72426 * Copyright (c) 2013 Pavol Rusnak
72427 *
72428 * Permission is hereby granted, free of charge, to any person obtaining a copy of
72429 * this software and associated documentation files (the "Software"), to deal in
72430 * the Software without restriction, including without limitation the rights to
72431 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
72432 * of the Software, and to permit persons to whom the Software is furnished to do
72433 * so, subject to the following conditions:
72434 *
72435 * The above copyright notice and this permission notice shall be included in all
72436 * copies or substantial portions of the Software.
72437 *
72438 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
72439 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
72440 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
72441 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
72442 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
72443 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
72444 */
72445
72446/*
72447 * Javascript port from python by Ian Coleman
72448 *
72449 * Requires code from sjcl
72450 * https://github.com/bitwiseshiftleft/sjcl
72451 */
72452
72453var Mnemonic = function(language) {
72454
72455 var PBKDF2_ROUNDS = 2048;
72456 var RADIX = 2048;
72457
72458 var self = this;
72459 var wordlist = [];
72460
72461 var hmacSHA512 = function(key) {
72462 var hasher = new sjcl.misc.hmac(key, sjcl.hash.sha512);
72463 this.encrypt = function() {
72464 return hasher.encrypt.apply(hasher, arguments);
72465 };
72466 };
72467
72468 function init() {
72469 wordlist = WORDLISTS[language];
72470 if (wordlist.length != RADIX) {
72471 err = 'Wordlist should contain ' + RADIX + ' words, but it contains ' + wordlist.length + ' words.';
72472 throw err;
72473 }
72474 }
72475
72476 self.generate = function(strength) {
72477 strength = strength || 128;
72478 var r = strength % 32;
72479 if (r > 0) {
72480 throw 'Strength should be divisible by 32, but it is not (' + r + ').';
72481 }
72482 var hasStrongCrypto = 'crypto' in window && window['crypto'] !== null;
72483 if (!hasStrongCrypto) {
72484 throw 'Mnemonic should be generated with strong randomness, but crypto.getRandomValues is unavailable';
72485 }
72486 var buffer = new Uint8Array(strength / 8);
72487 var data = crypto.getRandomValues(buffer);
72488 return self.toMnemonic(data);
72489 }
72490
72491 self.toMnemonic = function(byteArray) {
72492 if (byteArray.length % 4 > 0) {
72493 throw 'Data length in bits should be divisible by 32, but it is not (' + byteArray.length + ' bytes = ' + byteArray.length*8 + ' bits).'
72494 }
72495
72496 //h = hashlib.sha256(data).hexdigest()
72497 var data = byteArrayToWordArray(byteArray);
72498 var hash = sjcl.hash.sha256.hash(data);
72499 var h = sjcl.codec.hex.fromBits(hash);
72500
72501 // b is a binary string, eg '00111010101100...'
72502 //b = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8) + \
72503 // bin(int(h, 16))[2:].zfill(256)[:len(data) * 8 / 32]
72504 //
72505 // a = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8)
72506 // c = bin(int(h, 16))[2:].zfill(256)
72507 // d = c[:len(data) * 8 / 32]
72508 var a = byteArrayToBinaryString(byteArray);
72509 var c = zfill(hexStringToBinaryString(h), 256);
72510 var d = c.substring(0, byteArray.length * 8 / 32);
72511 // b = line1 + line2
72512 var b = a + d;
72513
72514 var result = [];
72515 var blen = b.length / 11;
72516 for (var i=0; i<blen; i++) {
72517 var idx = parseInt(b.substring(i * 11, (i + 1) * 11), 2);
72518 result.push(wordlist[idx]);
72519 }
72520 return self.joinWords(result);
72521 }
72522
72523 self.check = function(mnemonic) {
72524 var mnemonic = self.splitWords(mnemonic);
72525 if (mnemonic.length == 0 || mnemonic.length % 3 > 0) {
72526 return false
72527 }
72528 // idx = map(lambda x: bin(self.wordlist.index(x))[2:].zfill(11), mnemonic)
72529 var idx = [];
72530 for (var i=0; i<mnemonic.length; i++) {
72531 var word = mnemonic[i];
72532 var wordIndex = wordlist.indexOf(word);
72533 if (wordIndex == -1) {
72534 return false;
72535 }
72536 var binaryIndex = zfill(wordIndex.toString(2), 11);
72537 idx.push(binaryIndex);
72538 }
72539 var b = idx.join('');
72540 var l = b.length;
72541 //d = b[:l / 33 * 32]
72542 //h = b[-l / 33:]
72543 var d = b.substring(0, l / 33 * 32);
72544 var h = b.substring(l - l / 33, l);
72545 //nd = binascii.unhexlify(hex(int(d, 2))[2:].rstrip('L').zfill(l / 33 * 8))
72546 var nd = binaryStringToWordArray(d);
72547 //nh = bin(int(hashlib.sha256(nd).hexdigest(), 16))[2:].zfill(256)[:l / 33]
72548 var ndHash = sjcl.hash.sha256.hash(nd);
72549 var ndHex = sjcl.codec.hex.fromBits(ndHash);
72550 var ndBstr = zfill(hexStringToBinaryString(ndHex), 256);
72551 var nh = ndBstr.substring(0,l/33);
72552 return h == nh;
72553 }
72554
72555 self.toSeed = function(mnemonic, passphrase) {
72556 passphrase = passphrase || '';
72557 mnemonic = self.joinWords(self.splitWords(mnemonic)); // removes duplicate blanks
72558 var mnemonicNormalized = self.normalizeString(mnemonic);
72559 passphrase = self.normalizeString(passphrase)
72560 passphrase = "mnemonic" + passphrase;
72561 var mnemonicBits = sjcl.codec.utf8String.toBits(mnemonicNormalized);
72562 var passphraseBits = sjcl.codec.utf8String.toBits(passphrase);
72563 var result = sjcl.misc.pbkdf2(mnemonicBits, passphraseBits, PBKDF2_ROUNDS, 512, hmacSHA512);
72564 var hashHex = sjcl.codec.hex.fromBits(result);
72565 return hashHex;
72566 }
72567
72568 self.splitWords = function(mnemonic) {
72569 return mnemonic.split(/\s/g).filter(function(x) { return x.length; });
72570 }
72571
72572 self.joinWords = function(words) {
72573 // Set space correctly depending on the language
72574 // see https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md#japanese
72575 var space = " ";
72576 if (language == "japanese") {
72577 space = "\u3000"; // ideographic space
72578 }
72579 return words.join(space);
72580 }
72581
72582 self.normalizeString = function(str) {
72583 if (typeof str.normalize == "function") {
72584 return str.normalize("NFKD");
72585 }
72586 else {
72587 // TODO decide how to handle this in the future.
72588 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
72589 return str;
72590 }
72591 }
72592
72593 function byteArrayToWordArray(data) {
72594 var a = [];
72595 for (var i=0; i<data.length/4; i++) {
72596 v = 0;
72597 v += data[i*4 + 0] << 8 * 3;
72598 v += data[i*4 + 1] << 8 * 2;
72599 v += data[i*4 + 2] << 8 * 1;
72600 v += data[i*4 + 3] << 8 * 0;
72601 a.push(v);
72602 }
72603 return a;
72604 }
72605
72606 function byteArrayToBinaryString(data) {
72607 var bin = "";
72608 for (var i=0; i<data.length; i++) {
72609 bin += zfill(data[i].toString(2), 8);
72610 }
72611 return bin;
72612 }
72613
72614 function hexStringToBinaryString(hexString) {
72615 binaryString = "";
72616 for (var i=0; i<hexString.length; i++) {
72617 binaryString += zfill(parseInt(hexString[i], 16).toString(2),4);
72618 }
72619 return binaryString;
72620 }
72621
72622 function binaryStringToWordArray(binary) {
72623 var aLen = binary.length / 32;
72624 var a = [];
72625 for (var i=0; i<aLen; i++) {
72626 var valueStr = binary.substring(0,32);
72627 var value = parseInt(valueStr, 2);
72628 a.push(value);
72629 binary = binary.slice(32);
72630 }
72631 return a;
72632 }
72633
72634 // Pad a numeric string on the left with zero digits until the given width
72635 // is reached.
72636 // Note this differs to the python implementation because it does not
72637 // handle numbers starting with a sign.
72638 function zfill(source, length) {
72639 source = source.toString();
72640 while (source.length < length) {
72641 source = '0' + source;
72642 }
72643 return source;
72644 }
72645
72646 init();
72647
72648}
72649</script>
72650 <script>/*
72651 JavaScript BigInteger library version 0.9.1
72652 http://silentmatt.com/biginteger/
72653
72654 Copyright (c) 2009 Matthew Crumley <email@matthewcrumley.com>
72655 Copyright (c) 2010,2011 by John Tobey <John.Tobey@gmail.com>
72656 Licensed under the MIT license.
72657
72658 Support for arbitrary internal representation base was added by
72659 Vitaly Magerya.
72660*/
72661
72662/*
72663 File: biginteger.js
72664
72665 Exports:
72666
72667 <BigInteger>
72668*/
72669(function(exports) {
72670"use strict";
72671/*
72672 Class: BigInteger
72673 An arbitrarily-large integer.
72674
72675 <BigInteger> objects should be considered immutable. None of the "built-in"
72676 methods modify *this* or their arguments. All properties should be
72677 considered private.
72678
72679 All the methods of <BigInteger> instances can be called "statically". The
72680 static versions are convenient if you don't already have a <BigInteger>
72681 object.
72682
72683 As an example, these calls are equivalent.
72684
72685 > BigInteger(4).multiply(5); // returns BigInteger(20);
72686 > BigInteger.multiply(4, 5); // returns BigInteger(20);
72687
72688 > var a = 42;
72689 > var a = BigInteger.toJSValue("0b101010"); // Not completely useless...
72690*/
72691
72692var CONSTRUCT = {}; // Unique token to call "private" version of constructor
72693
72694/*
72695 Constructor: BigInteger()
72696 Convert a value to a <BigInteger>.
72697
72698 Although <BigInteger()> is the constructor for <BigInteger> objects, it is
72699 best not to call it as a constructor. If *n* is a <BigInteger> object, it is
72700 simply returned as-is. Otherwise, <BigInteger()> is equivalent to <parse>
72701 without a radix argument.
72702
72703 > var n0 = BigInteger(); // Same as <BigInteger.ZERO>
72704 > var n1 = BigInteger("123"); // Create a new <BigInteger> with value 123
72705 > var n2 = BigInteger(123); // Create a new <BigInteger> with value 123
72706 > var n3 = BigInteger(n2); // Return n2, unchanged
72707
72708 The constructor form only takes an array and a sign. *n* must be an
72709 array of numbers in little-endian order, where each digit is between 0
72710 and BigInteger.base. The second parameter sets the sign: -1 for
72711 negative, +1 for positive, or 0 for zero. The array is *not copied and
72712 may be modified*. If the array contains only zeros, the sign parameter
72713 is ignored and is forced to zero.
72714
72715 > new BigInteger([5], -1): create a new BigInteger with value -5
72716
72717 Parameters:
72718
72719 n - Value to convert to a <BigInteger>.
72720
72721 Returns:
72722
72723 A <BigInteger> value.
72724
72725 See Also:
72726
72727 <parse>, <BigInteger>
72728*/
72729function BigInteger(n, s, token) {
72730 if (token !== CONSTRUCT) {
72731 if (n instanceof BigInteger) {
72732 return n;
72733 }
72734 else if (typeof n === "undefined") {
72735 return ZERO;
72736 }
72737 return BigInteger.parse(n);
72738 }
72739
72740 n = n || []; // Provide the nullary constructor for subclasses.
72741 while (n.length && !n[n.length - 1]) {
72742 --n.length;
72743 }
72744 this._d = n;
72745 this._s = n.length ? (s || 1) : 0;
72746}
72747
72748BigInteger._construct = function(n, s) {
72749 return new BigInteger(n, s, CONSTRUCT);
72750};
72751
72752// Base-10 speedup hacks in parse, toString, exp10 and log functions
72753// require base to be a power of 10. 10^7 is the largest such power
72754// that won't cause a precision loss when digits are multiplied.
72755var BigInteger_base = 10000000;
72756var BigInteger_base_log10 = 7;
72757
72758BigInteger.base = BigInteger_base;
72759BigInteger.base_log10 = BigInteger_base_log10;
72760
72761var ZERO = new BigInteger([], 0, CONSTRUCT);
72762// Constant: ZERO
72763// <BigInteger> 0.
72764BigInteger.ZERO = ZERO;
72765
72766var ONE = new BigInteger([1], 1, CONSTRUCT);
72767// Constant: ONE
72768// <BigInteger> 1.
72769BigInteger.ONE = ONE;
72770
72771var M_ONE = new BigInteger(ONE._d, -1, CONSTRUCT);
72772// Constant: M_ONE
72773// <BigInteger> -1.
72774BigInteger.M_ONE = M_ONE;
72775
72776// Constant: _0
72777// Shortcut for <ZERO>.
72778BigInteger._0 = ZERO;
72779
72780// Constant: _1
72781// Shortcut for <ONE>.
72782BigInteger._1 = ONE;
72783
72784/*
72785 Constant: small
72786 Array of <BigIntegers> from 0 to 36.
72787
72788 These are used internally for parsing, but useful when you need a "small"
72789 <BigInteger>.
72790
72791 See Also:
72792
72793 <ZERO>, <ONE>, <_0>, <_1>
72794*/
72795BigInteger.small = [
72796 ZERO,
72797 ONE,
72798 /* Assuming BigInteger_base > 36 */
72799 new BigInteger( [2], 1, CONSTRUCT),
72800 new BigInteger( [3], 1, CONSTRUCT),
72801 new BigInteger( [4], 1, CONSTRUCT),
72802 new BigInteger( [5], 1, CONSTRUCT),
72803 new BigInteger( [6], 1, CONSTRUCT),
72804 new BigInteger( [7], 1, CONSTRUCT),
72805 new BigInteger( [8], 1, CONSTRUCT),
72806 new BigInteger( [9], 1, CONSTRUCT),
72807 new BigInteger([10], 1, CONSTRUCT),
72808 new BigInteger([11], 1, CONSTRUCT),
72809 new BigInteger([12], 1, CONSTRUCT),
72810 new BigInteger([13], 1, CONSTRUCT),
72811 new BigInteger([14], 1, CONSTRUCT),
72812 new BigInteger([15], 1, CONSTRUCT),
72813 new BigInteger([16], 1, CONSTRUCT),
72814 new BigInteger([17], 1, CONSTRUCT),
72815 new BigInteger([18], 1, CONSTRUCT),
72816 new BigInteger([19], 1, CONSTRUCT),
72817 new BigInteger([20], 1, CONSTRUCT),
72818 new BigInteger([21], 1, CONSTRUCT),
72819 new BigInteger([22], 1, CONSTRUCT),
72820 new BigInteger([23], 1, CONSTRUCT),
72821 new BigInteger([24], 1, CONSTRUCT),
72822 new BigInteger([25], 1, CONSTRUCT),
72823 new BigInteger([26], 1, CONSTRUCT),
72824 new BigInteger([27], 1, CONSTRUCT),
72825 new BigInteger([28], 1, CONSTRUCT),
72826 new BigInteger([29], 1, CONSTRUCT),
72827 new BigInteger([30], 1, CONSTRUCT),
72828 new BigInteger([31], 1, CONSTRUCT),
72829 new BigInteger([32], 1, CONSTRUCT),
72830 new BigInteger([33], 1, CONSTRUCT),
72831 new BigInteger([34], 1, CONSTRUCT),
72832 new BigInteger([35], 1, CONSTRUCT),
72833 new BigInteger([36], 1, CONSTRUCT)
72834];
72835
72836// Used for parsing/radix conversion
72837BigInteger.digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
72838
72839/*
72840 Method: toString
72841 Convert a <BigInteger> to a string.
72842
72843 When *base* is greater than 10, letters are upper case.
72844
72845 Parameters:
72846
72847 base - Optional base to represent the number in (default is base 10).
72848 Must be between 2 and 36 inclusive, or an Error will be thrown.
72849
72850 Returns:
72851
72852 The string representation of the <BigInteger>.
72853*/
72854BigInteger.prototype.toString = function(base) {
72855 base = +base || 10;
72856 if (base < 2 || base > 36) {
72857 throw new Error("illegal radix " + base + ".");
72858 }
72859 if (this._s === 0) {
72860 return "0";
72861 }
72862 if (base === 10) {
72863 var str = this._s < 0 ? "-" : "";
72864 str += this._d[this._d.length - 1].toString();
72865 for (var i = this._d.length - 2; i >= 0; i--) {
72866 var group = this._d[i].toString();
72867 while (group.length < BigInteger_base_log10) group = '0' + group;
72868 str += group;
72869 }
72870 return str;
72871 }
72872 else {
72873 var numerals = BigInteger.digits;
72874 base = BigInteger.small[base];
72875 var sign = this._s;
72876
72877 var n = this.abs();
72878 var digits = [];
72879 var digit;
72880
72881 while (n._s !== 0) {
72882 var divmod = n.divRem(base);
72883 n = divmod[0];
72884 digit = divmod[1];
72885 // TODO: This could be changed to unshift instead of reversing at the end.
72886 // Benchmark both to compare speeds.
72887 digits.push(numerals[digit.valueOf()]);
72888 }
72889 return (sign < 0 ? "-" : "") + digits.reverse().join("");
72890 }
72891};
72892
72893// Verify strings for parsing
72894BigInteger.radixRegex = [
72895 /^$/,
72896 /^$/,
72897 /^[01]*$/,
72898 /^[012]*$/,
72899 /^[0-3]*$/,
72900 /^[0-4]*$/,
72901 /^[0-5]*$/,
72902 /^[0-6]*$/,
72903 /^[0-7]*$/,
72904 /^[0-8]*$/,
72905 /^[0-9]*$/,
72906 /^[0-9aA]*$/,
72907 /^[0-9abAB]*$/,
72908 /^[0-9abcABC]*$/,
72909 /^[0-9a-dA-D]*$/,
72910 /^[0-9a-eA-E]*$/,
72911 /^[0-9a-fA-F]*$/,
72912 /^[0-9a-gA-G]*$/,
72913 /^[0-9a-hA-H]*$/,
72914 /^[0-9a-iA-I]*$/,
72915 /^[0-9a-jA-J]*$/,
72916 /^[0-9a-kA-K]*$/,
72917 /^[0-9a-lA-L]*$/,
72918 /^[0-9a-mA-M]*$/,
72919 /^[0-9a-nA-N]*$/,
72920 /^[0-9a-oA-O]*$/,
72921 /^[0-9a-pA-P]*$/,
72922 /^[0-9a-qA-Q]*$/,
72923 /^[0-9a-rA-R]*$/,
72924 /^[0-9a-sA-S]*$/,
72925 /^[0-9a-tA-T]*$/,
72926 /^[0-9a-uA-U]*$/,
72927 /^[0-9a-vA-V]*$/,
72928 /^[0-9a-wA-W]*$/,
72929 /^[0-9a-xA-X]*$/,
72930 /^[0-9a-yA-Y]*$/,
72931 /^[0-9a-zA-Z]*$/
72932];
72933
72934/*
72935 Function: parse
72936 Parse a string into a <BigInteger>.
72937
72938 *base* is optional but, if provided, must be from 2 to 36 inclusive. If
72939 *base* is not provided, it will be guessed based on the leading characters
72940 of *s* as follows:
72941
72942 - "0x" or "0X": *base* = 16
72943 - "0c" or "0C": *base* = 8
72944 - "0b" or "0B": *base* = 2
72945 - else: *base* = 10
72946
72947 If no base is provided, or *base* is 10, the number can be in exponential
72948 form. For example, these are all valid:
72949
72950 > BigInteger.parse("1e9"); // Same as "1000000000"
72951 > BigInteger.parse("1.234*10^3"); // Same as 1234
72952 > BigInteger.parse("56789 * 10 ** -2"); // Same as 567
72953
72954 If any characters fall outside the range defined by the radix, an exception
72955 will be thrown.
72956
72957 Parameters:
72958
72959 s - The string to parse.
72960 base - Optional radix (default is to guess based on *s*).
72961
72962 Returns:
72963
72964 a <BigInteger> instance.
72965*/
72966BigInteger.parse = function(s, base) {
72967 // Expands a number in exponential form to decimal form.
72968 // expandExponential("-13.441*10^5") === "1344100";
72969 // expandExponential("1.12300e-1") === "0.112300";
72970 // expandExponential(1000000000000000000000000000000) === "1000000000000000000000000000000";
72971 function expandExponential(str) {
72972 str = str.replace(/\s*[*xX]\s*10\s*(\^|\*\*)\s*/, "e");
72973
72974 return str.replace(/^([+\-])?(\d+)\.?(\d*)[eE]([+\-]?\d+)$/, function(x, s, n, f, c) {
72975 c = +c;
72976 var l = c < 0;
72977 var i = n.length + c;
72978 x = (l ? n : f).length;
72979 c = ((c = Math.abs(c)) >= x ? c - x + l : 0);
72980 var z = (new Array(c + 1)).join("0");
72981 var r = n + f;
72982 return (s || "") + (l ? r = z + r : r += z).substr(0, i += l ? z.length : 0) + (i < r.length ? "." + r.substr(i) : "");
72983 });
72984 }
72985
72986 s = s.toString();
72987 if (typeof base === "undefined" || +base === 10) {
72988 s = expandExponential(s);
72989 }
72990
72991 var prefixRE;
72992 if (typeof base === "undefined") {
72993 prefixRE = '0[xcb]';
72994 }
72995 else if (base == 16) {
72996 prefixRE = '0x';
72997 }
72998 else if (base == 8) {
72999 prefixRE = '0c';
73000 }
73001 else if (base == 2) {
73002 prefixRE = '0b';
73003 }
73004 else {
73005 prefixRE = '';
73006 }
73007 var parts = new RegExp('^([+\\-]?)(' + prefixRE + ')?([0-9a-z]*)(?:\\.\\d*)?$', 'i').exec(s);
73008 if (parts) {
73009 var sign = parts[1] || "+";
73010 var baseSection = parts[2] || "";
73011 var digits = parts[3] || "";
73012
73013 if (typeof base === "undefined") {
73014 // Guess base
73015 if (baseSection === "0x" || baseSection === "0X") { // Hex
73016 base = 16;
73017 }
73018 else if (baseSection === "0c" || baseSection === "0C") { // Octal
73019 base = 8;
73020 }
73021 else if (baseSection === "0b" || baseSection === "0B") { // Binary
73022 base = 2;
73023 }
73024 else {
73025 base = 10;
73026 }
73027 }
73028 else if (base < 2 || base > 36) {
73029 throw new Error("Illegal radix " + base + ".");
73030 }
73031
73032 base = +base;
73033
73034 // Check for digits outside the range
73035 if (!(BigInteger.radixRegex[base].test(digits))) {
73036 throw new Error("Bad digit for radix " + base);
73037 }
73038
73039 // Strip leading zeros, and convert to array
73040 digits = digits.replace(/^0+/, "").split("");
73041 if (digits.length === 0) {
73042 return ZERO;
73043 }
73044
73045 // Get the sign (we know it's not zero)
73046 sign = (sign === "-") ? -1 : 1;
73047
73048 // Optimize 10
73049 if (base == 10) {
73050 var d = [];
73051 while (digits.length >= BigInteger_base_log10) {
73052 d.push(parseInt(digits.splice(digits.length-BigInteger.base_log10, BigInteger.base_log10).join(''), 10));
73053 }
73054 d.push(parseInt(digits.join(''), 10));
73055 return new BigInteger(d, sign, CONSTRUCT);
73056 }
73057
73058 // Do the conversion
73059 var d = ZERO;
73060 base = BigInteger.small[base];
73061 var small = BigInteger.small;
73062 for (var i = 0; i < digits.length; i++) {
73063 d = d.multiply(base).add(small[parseInt(digits[i], 36)]);
73064 }
73065 return new BigInteger(d._d, sign, CONSTRUCT);
73066 }
73067 else {
73068 throw new Error("Invalid BigInteger format: " + s);
73069 }
73070};
73071
73072/*
73073 Function: add
73074 Add two <BigIntegers>.
73075
73076 Parameters:
73077
73078 n - The number to add to *this*. Will be converted to a <BigInteger>.
73079
73080 Returns:
73081
73082 The numbers added together.
73083
73084 See Also:
73085
73086 <subtract>, <multiply>, <quotient>, <next>
73087*/
73088BigInteger.prototype.add = function(n) {
73089 if (this._s === 0) {
73090 return BigInteger(n);
73091 }
73092
73093 n = BigInteger(n);
73094 if (n._s === 0) {
73095 return this;
73096 }
73097 if (this._s !== n._s) {
73098 n = n.negate();
73099 return this.subtract(n);
73100 }
73101
73102 var a = this._d;
73103 var b = n._d;
73104 var al = a.length;
73105 var bl = b.length;
73106 var sum = new Array(Math.max(al, bl) + 1);
73107 var size = Math.min(al, bl);
73108 var carry = 0;
73109 var digit;
73110
73111 for (var i = 0; i < size; i++) {
73112 digit = a[i] + b[i] + carry;
73113 sum[i] = digit % BigInteger_base;
73114 carry = (digit / BigInteger_base) | 0;
73115 }
73116 if (bl > al) {
73117 a = b;
73118 al = bl;
73119 }
73120 for (i = size; carry && i < al; i++) {
73121 digit = a[i] + carry;
73122 sum[i] = digit % BigInteger_base;
73123 carry = (digit / BigInteger_base) | 0;
73124 }
73125 if (carry) {
73126 sum[i] = carry;
73127 }
73128
73129 for ( ; i < al; i++) {
73130 sum[i] = a[i];
73131 }
73132
73133 return new BigInteger(sum, this._s, CONSTRUCT);
73134};
73135
73136/*
73137 Function: negate
73138 Get the additive inverse of a <BigInteger>.
73139
73140 Returns:
73141
73142 A <BigInteger> with the same magnatude, but with the opposite sign.
73143
73144 See Also:
73145
73146 <abs>
73147*/
73148BigInteger.prototype.negate = function() {
73149 return new BigInteger(this._d, (-this._s) | 0, CONSTRUCT);
73150};
73151
73152/*
73153 Function: abs
73154 Get the absolute value of a <BigInteger>.
73155
73156 Returns:
73157
73158 A <BigInteger> with the same magnatude, but always positive (or zero).
73159
73160 See Also:
73161
73162 <negate>
73163*/
73164BigInteger.prototype.abs = function() {
73165 return (this._s < 0) ? this.negate() : this;
73166};
73167
73168/*
73169 Function: subtract
73170 Subtract two <BigIntegers>.
73171
73172 Parameters:
73173
73174 n - The number to subtract from *this*. Will be converted to a <BigInteger>.
73175
73176 Returns:
73177
73178 The *n* subtracted from *this*.
73179
73180 See Also:
73181
73182 <add>, <multiply>, <quotient>, <prev>
73183*/
73184BigInteger.prototype.subtract = function(n) {
73185 if (this._s === 0) {
73186 return BigInteger(n).negate();
73187 }
73188
73189 n = BigInteger(n);
73190 if (n._s === 0) {
73191 return this;
73192 }
73193 if (this._s !== n._s) {
73194 n = n.negate();
73195 return this.add(n);
73196 }
73197
73198 var m = this;
73199 // negative - negative => -|a| - -|b| => -|a| + |b| => |b| - |a|
73200 if (this._s < 0) {
73201 m = new BigInteger(n._d, 1, CONSTRUCT);
73202 n = new BigInteger(this._d, 1, CONSTRUCT);
73203 }
73204
73205 // Both are positive => a - b
73206 var sign = m.compareAbs(n);
73207 if (sign === 0) {
73208 return ZERO;
73209 }
73210 else if (sign < 0) {
73211 // swap m and n
73212 var t = n;
73213 n = m;
73214 m = t;
73215 }
73216
73217 // a > b
73218 var a = m._d;
73219 var b = n._d;
73220 var al = a.length;
73221 var bl = b.length;
73222 var diff = new Array(al); // al >= bl since a > b
73223 var borrow = 0;
73224 var i;
73225 var digit;
73226
73227 for (i = 0; i < bl; i++) {
73228 digit = a[i] - borrow - b[i];
73229 if (digit < 0) {
73230 digit += BigInteger_base;
73231 borrow = 1;
73232 }
73233 else {
73234 borrow = 0;
73235 }
73236 diff[i] = digit;
73237 }
73238 for (i = bl; i < al; i++) {
73239 digit = a[i] - borrow;
73240 if (digit < 0) {
73241 digit += BigInteger_base;
73242 }
73243 else {
73244 diff[i++] = digit;
73245 break;
73246 }
73247 diff[i] = digit;
73248 }
73249 for ( ; i < al; i++) {
73250 diff[i] = a[i];
73251 }
73252
73253 return new BigInteger(diff, sign, CONSTRUCT);
73254};
73255
73256(function() {
73257 function addOne(n, sign) {
73258 var a = n._d;
73259 var sum = a.slice();
73260 var carry = true;
73261 var i = 0;
73262
73263 while (true) {
73264 var digit = (a[i] || 0) + 1;
73265 sum[i] = digit % BigInteger_base;
73266 if (digit <= BigInteger_base - 1) {
73267 break;
73268 }
73269 ++i;
73270 }
73271
73272 return new BigInteger(sum, sign, CONSTRUCT);
73273 }
73274
73275 function subtractOne(n, sign) {
73276 var a = n._d;
73277 var sum = a.slice();
73278 var borrow = true;
73279 var i = 0;
73280
73281 while (true) {
73282 var digit = (a[i] || 0) - 1;
73283 if (digit < 0) {
73284 sum[i] = digit + BigInteger_base;
73285 }
73286 else {
73287 sum[i] = digit;
73288 break;
73289 }
73290 ++i;
73291 }
73292
73293 return new BigInteger(sum, sign, CONSTRUCT);
73294 }
73295
73296 /*
73297 Function: next
73298 Get the next <BigInteger> (add one).
73299
73300 Returns:
73301
73302 *this* + 1.
73303
73304 See Also:
73305
73306 <add>, <prev>
73307 */
73308 BigInteger.prototype.next = function() {
73309 switch (this._s) {
73310 case 0:
73311 return ONE;
73312 case -1:
73313 return subtractOne(this, -1);
73314 // case 1:
73315 default:
73316 return addOne(this, 1);
73317 }
73318 };
73319
73320 /*
73321 Function: prev
73322 Get the previous <BigInteger> (subtract one).
73323
73324 Returns:
73325
73326 *this* - 1.
73327
73328 See Also:
73329
73330 <next>, <subtract>
73331 */
73332 BigInteger.prototype.prev = function() {
73333 switch (this._s) {
73334 case 0:
73335 return M_ONE;
73336 case -1:
73337 return addOne(this, -1);
73338 // case 1:
73339 default:
73340 return subtractOne(this, 1);
73341 }
73342 };
73343})();
73344
73345/*
73346 Function: compareAbs
73347 Compare the absolute value of two <BigIntegers>.
73348
73349 Calling <compareAbs> is faster than calling <abs> twice, then <compare>.
73350
73351 Parameters:
73352
73353 n - The number to compare to *this*. Will be converted to a <BigInteger>.
73354
73355 Returns:
73356
73357 -1, 0, or +1 if *|this|* is less than, equal to, or greater than *|n|*.
73358
73359 See Also:
73360
73361 <compare>, <abs>
73362*/
73363BigInteger.prototype.compareAbs = function(n) {
73364 if (this === n) {
73365 return 0;
73366 }
73367
73368 if (!(n instanceof BigInteger)) {
73369 if (!isFinite(n)) {
73370 return(isNaN(n) ? n : -1);
73371 }
73372 n = BigInteger(n);
73373 }
73374
73375 if (this._s === 0) {
73376 return (n._s !== 0) ? -1 : 0;
73377 }
73378 if (n._s === 0) {
73379 return 1;
73380 }
73381
73382 var l = this._d.length;
73383 var nl = n._d.length;
73384 if (l < nl) {
73385 return -1;
73386 }
73387 else if (l > nl) {
73388 return 1;
73389 }
73390
73391 var a = this._d;
73392 var b = n._d;
73393 for (var i = l-1; i >= 0; i--) {
73394 if (a[i] !== b[i]) {
73395 return a[i] < b[i] ? -1 : 1;
73396 }
73397 }
73398
73399 return 0;
73400};
73401
73402/*
73403 Function: compare
73404 Compare two <BigIntegers>.
73405
73406 Parameters:
73407
73408 n - The number to compare to *this*. Will be converted to a <BigInteger>.
73409
73410 Returns:
73411
73412 -1, 0, or +1 if *this* is less than, equal to, or greater than *n*.
73413
73414 See Also:
73415
73416 <compareAbs>, <isPositive>, <isNegative>, <isUnit>
73417*/
73418BigInteger.prototype.compare = function(n) {
73419 if (this === n) {
73420 return 0;
73421 }
73422
73423 n = BigInteger(n);
73424
73425 if (this._s === 0) {
73426 return -n._s;
73427 }
73428
73429 if (this._s === n._s) { // both positive or both negative
73430 var cmp = this.compareAbs(n);
73431 return cmp * this._s;
73432 }
73433 else {
73434 return this._s;
73435 }
73436};
73437
73438/*
73439 Function: isUnit
73440 Return true iff *this* is either 1 or -1.
73441
73442 Returns:
73443
73444 true if *this* compares equal to <BigInteger.ONE> or <BigInteger.M_ONE>.
73445
73446 See Also:
73447
73448 <isZero>, <isNegative>, <isPositive>, <compareAbs>, <compare>,
73449 <BigInteger.ONE>, <BigInteger.M_ONE>
73450*/
73451BigInteger.prototype.isUnit = function() {
73452 return this === ONE ||
73453 this === M_ONE ||
73454 (this._d.length === 1 && this._d[0] === 1);
73455};
73456
73457/*
73458 Function: multiply
73459 Multiply two <BigIntegers>.
73460
73461 Parameters:
73462
73463 n - The number to multiply *this* by. Will be converted to a
73464 <BigInteger>.
73465
73466 Returns:
73467
73468 The numbers multiplied together.
73469
73470 See Also:
73471
73472 <add>, <subtract>, <quotient>, <square>
73473*/
73474BigInteger.prototype.multiply = function(n) {
73475 // TODO: Consider adding Karatsuba multiplication for large numbers
73476 if (this._s === 0) {
73477 return ZERO;
73478 }
73479
73480 n = BigInteger(n);
73481 if (n._s === 0) {
73482 return ZERO;
73483 }
73484 if (this.isUnit()) {
73485 if (this._s < 0) {
73486 return n.negate();
73487 }
73488 return n;
73489 }
73490 if (n.isUnit()) {
73491 if (n._s < 0) {
73492 return this.negate();
73493 }
73494 return this;
73495 }
73496 if (this === n) {
73497 return this.square();
73498 }
73499
73500 var r = (this._d.length >= n._d.length);
73501 var a = (r ? this : n)._d; // a will be longer than b
73502 var b = (r ? n : this)._d;
73503 var al = a.length;
73504 var bl = b.length;
73505
73506 var pl = al + bl;
73507 var partial = new Array(pl);
73508 var i;
73509 for (i = 0; i < pl; i++) {
73510 partial[i] = 0;
73511 }
73512
73513 for (i = 0; i < bl; i++) {
73514 var carry = 0;
73515 var bi = b[i];
73516 var jlimit = al + i;
73517 var digit;
73518 for (var j = i; j < jlimit; j++) {
73519 digit = partial[j] + bi * a[j - i] + carry;
73520 carry = (digit / BigInteger_base) | 0;
73521 partial[j] = (digit % BigInteger_base) | 0;
73522 }
73523 if (carry) {
73524 digit = partial[j] + carry;
73525 carry = (digit / BigInteger_base) | 0;
73526 partial[j] = digit % BigInteger_base;
73527 }
73528 }
73529 return new BigInteger(partial, this._s * n._s, CONSTRUCT);
73530};
73531
73532// Multiply a BigInteger by a single-digit native number
73533// Assumes that this and n are >= 0
73534// This is not really intended to be used outside the library itself
73535BigInteger.prototype.multiplySingleDigit = function(n) {
73536 if (n === 0 || this._s === 0) {
73537 return ZERO;
73538 }
73539 if (n === 1) {
73540 return this;
73541 }
73542
73543 var digit;
73544 if (this._d.length === 1) {
73545 digit = this._d[0] * n;
73546 if (digit >= BigInteger_base) {
73547 return new BigInteger([(digit % BigInteger_base)|0,
73548 (digit / BigInteger_base)|0], 1, CONSTRUCT);
73549 }
73550 return new BigInteger([digit], 1, CONSTRUCT);
73551 }
73552
73553 if (n === 2) {
73554 return this.add(this);
73555 }
73556 if (this.isUnit()) {
73557 return new BigInteger([n], 1, CONSTRUCT);
73558 }
73559
73560 var a = this._d;
73561 var al = a.length;
73562
73563 var pl = al + 1;
73564 var partial = new Array(pl);
73565 for (var i = 0; i < pl; i++) {
73566 partial[i] = 0;
73567 }
73568
73569 var carry = 0;
73570 for (var j = 0; j < al; j++) {
73571 digit = n * a[j] + carry;
73572 carry = (digit / BigInteger_base) | 0;
73573 partial[j] = (digit % BigInteger_base) | 0;
73574 }
73575 if (carry) {
73576 partial[j] = carry;
73577 }
73578
73579 return new BigInteger(partial, 1, CONSTRUCT);
73580};
73581
73582/*
73583 Function: square
73584 Multiply a <BigInteger> by itself.
73585
73586 This is slightly faster than regular multiplication, since it removes the
73587 duplicated multiplcations.
73588
73589 Returns:
73590
73591 > this.multiply(this)
73592
73593 See Also:
73594 <multiply>
73595*/
73596BigInteger.prototype.square = function() {
73597 // Normally, squaring a 10-digit number would take 100 multiplications.
73598 // Of these 10 are unique diagonals, of the remaining 90 (100-10), 45 are repeated.
73599 // This procedure saves (N*(N-1))/2 multiplications, (e.g., 45 of 100 multiplies).
73600 // Based on code by Gary Darby, Intellitech Systems Inc., www.DelphiForFun.org
73601
73602 if (this._s === 0) {
73603 return ZERO;
73604 }
73605 if (this.isUnit()) {
73606 return ONE;
73607 }
73608
73609 var digits = this._d;
73610 var length = digits.length;
73611 var imult1 = new Array(length + length + 1);
73612 var product, carry, k;
73613 var i;
73614
73615 // Calculate diagonal
73616 for (i = 0; i < length; i++) {
73617 k = i * 2;
73618 product = digits[i] * digits[i];
73619 carry = (product / BigInteger_base) | 0;
73620 imult1[k] = product % BigInteger_base;
73621 imult1[k + 1] = carry;
73622 }
73623
73624 // Calculate repeating part
73625 for (i = 0; i < length; i++) {
73626 carry = 0;
73627 k = i * 2 + 1;
73628 for (var j = i + 1; j < length; j++, k++) {
73629 product = digits[j] * digits[i] * 2 + imult1[k] + carry;
73630 carry = (product / BigInteger_base) | 0;
73631 imult1[k] = product % BigInteger_base;
73632 }
73633 k = length + i;
73634 var digit = carry + imult1[k];
73635 carry = (digit / BigInteger_base) | 0;
73636 imult1[k] = digit % BigInteger_base;
73637 imult1[k + 1] += carry;
73638 }
73639
73640 return new BigInteger(imult1, 1, CONSTRUCT);
73641};
73642
73643/*
73644 Function: quotient
73645 Divide two <BigIntegers> and truncate towards zero.
73646
73647 <quotient> throws an exception if *n* is zero.
73648
73649 Parameters:
73650
73651 n - The number to divide *this* by. Will be converted to a <BigInteger>.
73652
73653 Returns:
73654
73655 The *this* / *n*, truncated to an integer.
73656
73657 See Also:
73658
73659 <add>, <subtract>, <multiply>, <divRem>, <remainder>
73660*/
73661BigInteger.prototype.quotient = function(n) {
73662 return this.divRem(n)[0];
73663};
73664
73665/*
73666 Function: divide
73667 Deprecated synonym for <quotient>.
73668*/
73669BigInteger.prototype.divide = BigInteger.prototype.quotient;
73670
73671/*
73672 Function: remainder
73673 Calculate the remainder of two <BigIntegers>.
73674
73675 <remainder> throws an exception if *n* is zero.
73676
73677 Parameters:
73678
73679 n - The remainder after *this* is divided *this* by *n*. Will be
73680 converted to a <BigInteger>.
73681
73682 Returns:
73683
73684 *this* % *n*.
73685
73686 See Also:
73687
73688 <divRem>, <quotient>
73689*/
73690BigInteger.prototype.remainder = function(n) {
73691 return this.divRem(n)[1];
73692};
73693
73694/*
73695 Function: divRem
73696 Calculate the integer quotient and remainder of two <BigIntegers>.
73697
73698 <divRem> throws an exception if *n* is zero.
73699
73700 Parameters:
73701
73702 n - The number to divide *this* by. Will be converted to a <BigInteger>.
73703
73704 Returns:
73705
73706 A two-element array containing the quotient and the remainder.
73707
73708 > a.divRem(b)
73709
73710 is exactly equivalent to
73711
73712 > [a.quotient(b), a.remainder(b)]
73713
73714 except it is faster, because they are calculated at the same time.
73715
73716 See Also:
73717
73718 <quotient>, <remainder>
73719*/
73720BigInteger.prototype.divRem = function(n) {
73721 n = BigInteger(n);
73722 if (n._s === 0) {
73723 throw new Error("Divide by zero");
73724 }
73725 if (this._s === 0) {
73726 return [ZERO, ZERO];
73727 }
73728 if (n._d.length === 1) {
73729 return this.divRemSmall(n._s * n._d[0]);
73730 }
73731
73732 // Test for easy cases -- |n1| <= |n2|
73733 switch (this.compareAbs(n)) {
73734 case 0: // n1 == n2
73735 return [this._s === n._s ? ONE : M_ONE, ZERO];
73736 case -1: // |n1| < |n2|
73737 return [ZERO, this];
73738 }
73739
73740 var sign = this._s * n._s;
73741 var a = n.abs();
73742 var b_digits = this._d;
73743 var b_index = b_digits.length;
73744 var digits = n._d.length;
73745 var quot = [];
73746 var guess;
73747
73748 var part = new BigInteger([], 0, CONSTRUCT);
73749
73750 while (b_index) {
73751 part._d.unshift(b_digits[--b_index]);
73752 part = new BigInteger(part._d, 1, CONSTRUCT);
73753
73754 if (part.compareAbs(n) < 0) {
73755 quot.push(0);
73756 continue;
73757 }
73758 if (part._s === 0) {
73759 guess = 0;
73760 }
73761 else {
73762 var xlen = part._d.length, ylen = a._d.length;
73763 var highx = part._d[xlen-1]*BigInteger_base + part._d[xlen-2];
73764 var highy = a._d[ylen-1]*BigInteger_base + a._d[ylen-2];
73765 if (part._d.length > a._d.length) {
73766 // The length of part._d can either match a._d length,
73767 // or exceed it by one.
73768 highx = (highx+1)*BigInteger_base;
73769 }
73770 guess = Math.ceil(highx/highy);
73771 }
73772 do {
73773 var check = a.multiplySingleDigit(guess);
73774 if (check.compareAbs(part) <= 0) {
73775 break;
73776 }
73777 guess--;
73778 } while (guess);
73779
73780 quot.push(guess);
73781 if (!guess) {
73782 continue;
73783 }
73784 var diff = part.subtract(check);
73785 part._d = diff._d.slice();
73786 }
73787
73788 return [new BigInteger(quot.reverse(), sign, CONSTRUCT),
73789 new BigInteger(part._d, this._s, CONSTRUCT)];
73790};
73791
73792// Throws an exception if n is outside of (-BigInteger.base, -1] or
73793// [1, BigInteger.base). It's not necessary to call this, since the
73794// other division functions will call it if they are able to.
73795BigInteger.prototype.divRemSmall = function(n) {
73796 var r;
73797 n = +n;
73798 if (n === 0) {
73799 throw new Error("Divide by zero");
73800 }
73801
73802 var n_s = n < 0 ? -1 : 1;
73803 var sign = this._s * n_s;
73804 n = Math.abs(n);
73805
73806 if (n < 1 || n >= BigInteger_base) {
73807 throw new Error("Argument out of range");
73808 }
73809
73810 if (this._s === 0) {
73811 return [ZERO, ZERO];
73812 }
73813
73814 if (n === 1 || n === -1) {
73815 return [(sign === 1) ? this.abs() : new BigInteger(this._d, sign, CONSTRUCT), ZERO];
73816 }
73817
73818 // 2 <= n < BigInteger_base
73819
73820 // divide a single digit by a single digit
73821 if (this._d.length === 1) {
73822 var q = new BigInteger([(this._d[0] / n) | 0], 1, CONSTRUCT);
73823 r = new BigInteger([(this._d[0] % n) | 0], 1, CONSTRUCT);
73824 if (sign < 0) {
73825 q = q.negate();
73826 }
73827 if (this._s < 0) {
73828 r = r.negate();
73829 }
73830 return [q, r];
73831 }
73832
73833 var digits = this._d.slice();
73834 var quot = new Array(digits.length);
73835 var part = 0;
73836 var diff = 0;
73837 var i = 0;
73838 var guess;
73839
73840 while (digits.length) {
73841 part = part * BigInteger_base + digits[digits.length - 1];
73842 if (part < n) {
73843 quot[i++] = 0;
73844 digits.pop();
73845 diff = BigInteger_base * diff + part;
73846 continue;
73847 }
73848 if (part === 0) {
73849 guess = 0;
73850 }
73851 else {
73852 guess = (part / n) | 0;
73853 }
73854
73855 var check = n * guess;
73856 diff = part - check;
73857 quot[i++] = guess;
73858 if (!guess) {
73859 digits.pop();
73860 continue;
73861 }
73862
73863 digits.pop();
73864 part = diff;
73865 }
73866
73867 r = new BigInteger([diff], 1, CONSTRUCT);
73868 if (this._s < 0) {
73869 r = r.negate();
73870 }
73871 return [new BigInteger(quot.reverse(), sign, CONSTRUCT), r];
73872};
73873
73874/*
73875 Function: isEven
73876 Return true iff *this* is divisible by two.
73877
73878 Note that <BigInteger.ZERO> is even.
73879
73880 Returns:
73881
73882 true if *this* is even, false otherwise.
73883
73884 See Also:
73885
73886 <isOdd>
73887*/
73888BigInteger.prototype.isEven = function() {
73889 var digits = this._d;
73890 return this._s === 0 || digits.length === 0 || (digits[0] % 2) === 0;
73891};
73892
73893/*
73894 Function: isOdd
73895 Return true iff *this* is not divisible by two.
73896
73897 Returns:
73898
73899 true if *this* is odd, false otherwise.
73900
73901 See Also:
73902
73903 <isEven>
73904*/
73905BigInteger.prototype.isOdd = function() {
73906 return !this.isEven();
73907};
73908
73909/*
73910 Function: sign
73911 Get the sign of a <BigInteger>.
73912
73913 Returns:
73914
73915 * -1 if *this* < 0
73916 * 0 if *this* == 0
73917 * +1 if *this* > 0
73918
73919 See Also:
73920
73921 <isZero>, <isPositive>, <isNegative>, <compare>, <BigInteger.ZERO>
73922*/
73923BigInteger.prototype.sign = function() {
73924 return this._s;
73925};
73926
73927/*
73928 Function: isPositive
73929 Return true iff *this* > 0.
73930
73931 Returns:
73932
73933 true if *this*.compare(<BigInteger.ZERO>) == 1.
73934
73935 See Also:
73936
73937 <sign>, <isZero>, <isNegative>, <isUnit>, <compare>, <BigInteger.ZERO>
73938*/
73939BigInteger.prototype.isPositive = function() {
73940 return this._s > 0;
73941};
73942
73943/*
73944 Function: isNegative
73945 Return true iff *this* < 0.
73946
73947 Returns:
73948
73949 true if *this*.compare(<BigInteger.ZERO>) == -1.
73950
73951 See Also:
73952
73953 <sign>, <isPositive>, <isZero>, <isUnit>, <compare>, <BigInteger.ZERO>
73954*/
73955BigInteger.prototype.isNegative = function() {
73956 return this._s < 0;
73957};
73958
73959/*
73960 Function: isZero
73961 Return true iff *this* == 0.
73962
73963 Returns:
73964
73965 true if *this*.compare(<BigInteger.ZERO>) == 0.
73966
73967 See Also:
73968
73969 <sign>, <isPositive>, <isNegative>, <isUnit>, <BigInteger.ZERO>
73970*/
73971BigInteger.prototype.isZero = function() {
73972 return this._s === 0;
73973};
73974
73975/*
73976 Function: exp10
73977 Multiply a <BigInteger> by a power of 10.
73978
73979 This is equivalent to, but faster than
73980
73981 > if (n >= 0) {
73982 > return this.multiply(BigInteger("1e" + n));
73983 > }
73984 > else { // n <= 0
73985 > return this.quotient(BigInteger("1e" + -n));
73986 > }
73987
73988 Parameters:
73989
73990 n - The power of 10 to multiply *this* by. *n* is converted to a
73991 javascipt number and must be no greater than <BigInteger.MAX_EXP>
73992 (0x7FFFFFFF), or an exception will be thrown.
73993
73994 Returns:
73995
73996 *this* * (10 ** *n*), truncated to an integer if necessary.
73997
73998 See Also:
73999
74000 <pow>, <multiply>
74001*/
74002BigInteger.prototype.exp10 = function(n) {
74003 n = +n;
74004 if (n === 0) {
74005 return this;
74006 }
74007 if (Math.abs(n) > Number(MAX_EXP)) {
74008 throw new Error("exponent too large in BigInteger.exp10");
74009 }
74010 // Optimization for this == 0. This also keeps us from having to trim zeros in the positive n case
74011 if (this._s === 0) {
74012 return ZERO;
74013 }
74014 if (n > 0) {
74015 var k = new BigInteger(this._d.slice(), this._s, CONSTRUCT);
74016
74017 for (; n >= BigInteger_base_log10; n -= BigInteger_base_log10) {
74018 k._d.unshift(0);
74019 }
74020 if (n == 0)
74021 return k;
74022 k._s = 1;
74023 k = k.multiplySingleDigit(Math.pow(10, n));
74024 return (this._s < 0 ? k.negate() : k);
74025 } else if (-n >= this._d.length*BigInteger_base_log10) {
74026 return ZERO;
74027 } else {
74028 var k = new BigInteger(this._d.slice(), this._s, CONSTRUCT);
74029
74030 for (n = -n; n >= BigInteger_base_log10; n -= BigInteger_base_log10) {
74031 k._d.shift();
74032 }
74033 return (n == 0) ? k : k.divRemSmall(Math.pow(10, n))[0];
74034 }
74035};
74036
74037/*
74038 Function: pow
74039 Raise a <BigInteger> to a power.
74040
74041 In this implementation, 0**0 is 1.
74042
74043 Parameters:
74044
74045 n - The exponent to raise *this* by. *n* must be no greater than
74046 <BigInteger.MAX_EXP> (0x7FFFFFFF), or an exception will be thrown.
74047
74048 Returns:
74049
74050 *this* raised to the *nth* power.
74051
74052 See Also:
74053
74054 <modPow>
74055*/
74056BigInteger.prototype.pow = function(n) {
74057 if (this.isUnit()) {
74058 if (this._s > 0) {
74059 return this;
74060 }
74061 else {
74062 return BigInteger(n).isOdd() ? this : this.negate();
74063 }
74064 }
74065
74066 n = BigInteger(n);
74067 if (n._s === 0) {
74068 return ONE;
74069 }
74070 else if (n._s < 0) {
74071 if (this._s === 0) {
74072 throw new Error("Divide by zero");
74073 }
74074 else {
74075 return ZERO;
74076 }
74077 }
74078 if (this._s === 0) {
74079 return ZERO;
74080 }
74081 if (n.isUnit()) {
74082 return this;
74083 }
74084
74085 if (n.compareAbs(MAX_EXP) > 0) {
74086 throw new Error("exponent too large in BigInteger.pow");
74087 }
74088 var x = this;
74089 var aux = ONE;
74090 var two = BigInteger.small[2];
74091
74092 while (n.isPositive()) {
74093 if (n.isOdd()) {
74094 aux = aux.multiply(x);
74095 if (n.isUnit()) {
74096 return aux;
74097 }
74098 }
74099 x = x.square();
74100 n = n.quotient(two);
74101 }
74102
74103 return aux;
74104};
74105
74106/*
74107 Function: modPow
74108 Raise a <BigInteger> to a power (mod m).
74109
74110 Because it is reduced by a modulus, <modPow> is not limited by
74111 <BigInteger.MAX_EXP> like <pow>.
74112
74113 Parameters:
74114
74115 exponent - The exponent to raise *this* by. Must be positive.
74116 modulus - The modulus.
74117
74118 Returns:
74119
74120 *this* ^ *exponent* (mod *modulus*).
74121
74122 See Also:
74123
74124 <pow>, <mod>
74125*/
74126BigInteger.prototype.modPow = function(exponent, modulus) {
74127 var result = ONE;
74128 var base = this;
74129
74130 while (exponent.isPositive()) {
74131 if (exponent.isOdd()) {
74132 result = result.multiply(base).remainder(modulus);
74133 }
74134
74135 exponent = exponent.quotient(BigInteger.small[2]);
74136 if (exponent.isPositive()) {
74137 base = base.square().remainder(modulus);
74138 }
74139 }
74140
74141 return result;
74142};
74143
74144/*
74145 Function: log
74146 Get the natural logarithm of a <BigInteger> as a native JavaScript number.
74147
74148 This is equivalent to
74149
74150 > Math.log(this.toJSValue())
74151
74152 but handles values outside of the native number range.
74153
74154 Returns:
74155
74156 log( *this* )
74157
74158 See Also:
74159
74160 <toJSValue>
74161*/
74162BigInteger.prototype.log = function() {
74163 switch (this._s) {
74164 case 0: return -Infinity;
74165 case -1: return NaN;
74166 default: // Fall through.
74167 }
74168
74169 var l = this._d.length;
74170
74171 if (l*BigInteger_base_log10 < 30) {
74172 return Math.log(this.valueOf());
74173 }
74174
74175 var N = Math.ceil(30/BigInteger_base_log10);
74176 var firstNdigits = this._d.slice(l - N);
74177 return Math.log((new BigInteger(firstNdigits, 1, CONSTRUCT)).valueOf()) + (l - N) * Math.log(BigInteger_base);
74178};
74179
74180/*
74181 Function: valueOf
74182 Convert a <BigInteger> to a native JavaScript integer.
74183
74184 This is called automatically by JavaScipt to convert a <BigInteger> to a
74185 native value.
74186
74187 Returns:
74188
74189 > parseInt(this.toString(), 10)
74190
74191 See Also:
74192
74193 <toString>, <toJSValue>
74194*/
74195BigInteger.prototype.valueOf = function() {
74196 return parseInt(this.toString(), 10);
74197};
74198
74199/*
74200 Function: toJSValue
74201 Convert a <BigInteger> to a native JavaScript integer.
74202
74203 This is the same as valueOf, but more explicitly named.
74204
74205 Returns:
74206
74207 > parseInt(this.toString(), 10)
74208
74209 See Also:
74210
74211 <toString>, <valueOf>
74212*/
74213BigInteger.prototype.toJSValue = function() {
74214 return parseInt(this.toString(), 10);
74215};
74216
74217var MAX_EXP = BigInteger(0x7FFFFFFF);
74218// Constant: MAX_EXP
74219// The largest exponent allowed in <pow> and <exp10> (0x7FFFFFFF or 2147483647).
74220BigInteger.MAX_EXP = MAX_EXP;
74221
74222(function() {
74223 function makeUnary(fn) {
74224 return function(a) {
74225 return fn.call(BigInteger(a));
74226 };
74227 }
74228
74229 function makeBinary(fn) {
74230 return function(a, b) {
74231 return fn.call(BigInteger(a), BigInteger(b));
74232 };
74233 }
74234
74235 function makeTrinary(fn) {
74236 return function(a, b, c) {
74237 return fn.call(BigInteger(a), BigInteger(b), BigInteger(c));
74238 };
74239 }
74240
74241 (function() {
74242 var i, fn;
74243 var unary = "toJSValue,isEven,isOdd,sign,isZero,isNegative,abs,isUnit,square,negate,isPositive,toString,next,prev,log".split(",");
74244 var binary = "compare,remainder,divRem,subtract,add,quotient,divide,multiply,pow,compareAbs".split(",");
74245 var trinary = ["modPow"];
74246
74247 for (i = 0; i < unary.length; i++) {
74248 fn = unary[i];
74249 BigInteger[fn] = makeUnary(BigInteger.prototype[fn]);
74250 }
74251
74252 for (i = 0; i < binary.length; i++) {
74253 fn = binary[i];
74254 BigInteger[fn] = makeBinary(BigInteger.prototype[fn]);
74255 }
74256
74257 for (i = 0; i < trinary.length; i++) {
74258 fn = trinary[i];
74259 BigInteger[fn] = makeTrinary(BigInteger.prototype[fn]);
74260 }
74261
74262 BigInteger.exp10 = function(x, n) {
74263 return BigInteger(x).exp10(n);
74264 };
74265 })();
74266})();
74267
74268exports.BigInteger = BigInteger;
74269})(typeof exports !== 'undefined' ? exports : this);
74270</script>
74271 <script>(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.zxcvbn = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
74272var adjacency_graphs;adjacency_graphs={qwerty:{"!":["`~",null,null,"2@","qQ",null],'"':[";:","[{","]}",null,null,"/?"],"#":["2@",null,null,"4$","eE","wW"],$:["3#",null,null,"5%","rR","eE"],"%":["4$",null,null,"6^","tT","rR"],"&":["6^",null,null,"8*","uU","yY"],"'":[";:","[{","]}",null,null,"/?"],"(":["8*",null,null,"0)","oO","iI"],")":["9(",null,null,"-_","pP","oO"],"*":["7&",null,null,"9(","iI","uU"],"+":["-_",null,null,null,"]}","[{"],",":["mM","kK","lL",".>",null,null],"-":["0)",null,null,"=+","[{","pP"],".":[",<","lL",";:","/?",null,null],"/":[".>",";:","'\"",null,null,null],0:["9(",null,null,"-_","pP","oO"],1:["`~",null,null,"2@","qQ",null],2:["1!",null,null,"3#","wW","qQ"],3:["2@",null,null,"4$","eE","wW"],4:["3#",null,null,"5%","rR","eE"],5:["4$",null,null,"6^","tT","rR"],6:["5%",null,null,"7&","yY","tT"],7:["6^",null,null,"8*","uU","yY"],8:["7&",null,null,"9(","iI","uU"],9:["8*",null,null,"0)","oO","iI"],":":["lL","pP","[{","'\"","/?",".>"],";":["lL","pP","[{","'\"","/?",".>"],"<":["mM","kK","lL",".>",null,null],"=":["-_",null,null,null,"]}","[{"],">":[",<","lL",";:","/?",null,null],"?":[".>",";:","'\"",null,null,null],"@":["1!",null,null,"3#","wW","qQ"],A:[null,"qQ","wW","sS","zZ",null],B:["vV","gG","hH","nN",null,null],C:["xX","dD","fF","vV",null,null],D:["sS","eE","rR","fF","cC","xX"],E:["wW","3#","4$","rR","dD","sS"],F:["dD","rR","tT","gG","vV","cC"],G:["fF","tT","yY","hH","bB","vV"],H:["gG","yY","uU","jJ","nN","bB"],I:["uU","8*","9(","oO","kK","jJ"],J:["hH","uU","iI","kK","mM","nN"],K:["jJ","iI","oO","lL",",<","mM"],L:["kK","oO","pP",";:",".>",",<"],M:["nN","jJ","kK",",<",null,null],N:["bB","hH","jJ","mM",null,null],O:["iI","9(","0)","pP","lL","kK"],P:["oO","0)","-_","[{",";:","lL"],Q:[null,"1!","2@","wW","aA",null],R:["eE","4$","5%","tT","fF","dD"],S:["aA","wW","eE","dD","xX","zZ"],T:["rR","5%","6^","yY","gG","fF"],U:["yY","7&","8*","iI","jJ","hH"],V:["cC","fF","gG","bB",null,null],W:["qQ","2@","3#","eE","sS","aA"],X:["zZ","sS","dD","cC",null,null],Y:["tT","6^","7&","uU","hH","gG"],Z:[null,"aA","sS","xX",null,null],"[":["pP","-_","=+","]}","'\"",";:"],"\\":["]}",null,null,null,null,null],"]":["[{","=+",null,"\\|",null,"'\""],"^":["5%",null,null,"7&","yY","tT"],_:["0)",null,null,"=+","[{","pP"],"`":[null,null,null,"1!",null,null],a:[null,"qQ","wW","sS","zZ",null],b:["vV","gG","hH","nN",null,null],c:["xX","dD","fF","vV",null,null],d:["sS","eE","rR","fF","cC","xX"],e:["wW","3#","4$","rR","dD","sS"],f:["dD","rR","tT","gG","vV","cC"],g:["fF","tT","yY","hH","bB","vV"],h:["gG","yY","uU","jJ","nN","bB"],i:["uU","8*","9(","oO","kK","jJ"],j:["hH","uU","iI","kK","mM","nN"],k:["jJ","iI","oO","lL",",<","mM"],l:["kK","oO","pP",";:",".>",",<"],m:["nN","jJ","kK",",<",null,null],n:["bB","hH","jJ","mM",null,null],o:["iI","9(","0)","pP","lL","kK"],p:["oO","0)","-_","[{",";:","lL"],q:[null,"1!","2@","wW","aA",null],r:["eE","4$","5%","tT","fF","dD"],s:["aA","wW","eE","dD","xX","zZ"],t:["rR","5%","6^","yY","gG","fF"],u:["yY","7&","8*","iI","jJ","hH"],v:["cC","fF","gG","bB",null,null],w:["qQ","2@","3#","eE","sS","aA"],x:["zZ","sS","dD","cC",null,null],y:["tT","6^","7&","uU","hH","gG"],z:[null,"aA","sS","xX",null,null],"{":["pP","-_","=+","]}","'\"",";:"],"|":["]}",null,null,null,null,null],"}":["[{","=+",null,"\\|",null,"'\""],"~":[null,null,null,"1!",null,null]},dvorak:{"!":["`~",null,null,"2@","'\"",null],'"':[null,"1!","2@",",<","aA",null],"#":["2@",null,null,"4$",".>",",<"],$:["3#",null,null,"5%","pP",".>"],"%":["4$",null,null,"6^","yY","pP"],"&":["6^",null,null,"8*","gG","fF"],"'":[null,"1!","2@",",<","aA",null],"(":["8*",null,null,"0)","rR","cC"],")":["9(",null,null,"[{","lL","rR"],"*":["7&",null,null,"9(","cC","gG"],"+":["/?","]}",null,"\\|",null,"-_"],",":["'\"","2@","3#",".>","oO","aA"],"-":["sS","/?","=+",null,null,"zZ"],".":[",<","3#","4$","pP","eE","oO"],"/":["lL","[{","]}","=+","-_","sS"],0:["9(",null,null,"[{","lL","rR"],1:["`~",null,null,"2@","'\"",null],2:["1!",null,null,"3#",",<","'\""],3:["2@",null,null,"4$",".>",",<"],4:["3#",null,null,"5%","pP",".>"],5:["4$",null,null,"6^","yY","pP"],6:["5%",null,null,"7&","fF","yY"],7:["6^",null,null,"8*","gG","fF"],8:["7&",null,null,"9(","cC","gG"],9:["8*",null,null,"0)","rR","cC"],":":[null,"aA","oO","qQ",null,null],";":[null,"aA","oO","qQ",null,null],"<":["'\"","2@","3#",".>","oO","aA"],"=":["/?","]}",null,"\\|",null,"-_"],">":[",<","3#","4$","pP","eE","oO"],"?":["lL","[{","]}","=+","-_","sS"],"@":["1!",null,null,"3#",",<","'\""],A:[null,"'\"",",<","oO",";:",null],B:["xX","dD","hH","mM",null,null],C:["gG","8*","9(","rR","tT","hH"],D:["iI","fF","gG","hH","bB","xX"],E:["oO",".>","pP","uU","jJ","qQ"],F:["yY","6^","7&","gG","dD","iI"],G:["fF","7&","8*","cC","hH","dD"],H:["dD","gG","cC","tT","mM","bB"],I:["uU","yY","fF","dD","xX","kK"],J:["qQ","eE","uU","kK",null,null],K:["jJ","uU","iI","xX",null,null],L:["rR","0)","[{","/?","sS","nN"],M:["bB","hH","tT","wW",null,null],N:["tT","rR","lL","sS","vV","wW"],O:["aA",",<",".>","eE","qQ",";:"],P:[".>","4$","5%","yY","uU","eE"],Q:[";:","oO","eE","jJ",null,null],R:["cC","9(","0)","lL","nN","tT"],S:["nN","lL","/?","-_","zZ","vV"],T:["hH","cC","rR","nN","wW","mM"],U:["eE","pP","yY","iI","kK","jJ"],V:["wW","nN","sS","zZ",null,null],W:["mM","tT","nN","vV",null,null],X:["kK","iI","dD","bB",null,null],Y:["pP","5%","6^","fF","iI","uU"],Z:["vV","sS","-_",null,null,null],"[":["0)",null,null,"]}","/?","lL"],"\\":["=+",null,null,null,null,null],"]":["[{",null,null,null,"=+","/?"],"^":["5%",null,null,"7&","fF","yY"],_:["sS","/?","=+",null,null,"zZ"],"`":[null,null,null,"1!",null,null],a:[null,"'\"",",<","oO",";:",null],b:["xX","dD","hH","mM",null,null],c:["gG","8*","9(","rR","tT","hH"],d:["iI","fF","gG","hH","bB","xX"],e:["oO",".>","pP","uU","jJ","qQ"],f:["yY","6^","7&","gG","dD","iI"],g:["fF","7&","8*","cC","hH","dD"],h:["dD","gG","cC","tT","mM","bB"],i:["uU","yY","fF","dD","xX","kK"],j:["qQ","eE","uU","kK",null,null],k:["jJ","uU","iI","xX",null,null],l:["rR","0)","[{","/?","sS","nN"],m:["bB","hH","tT","wW",null,null],n:["tT","rR","lL","sS","vV","wW"],o:["aA",",<",".>","eE","qQ",";:"],p:[".>","4$","5%","yY","uU","eE"],q:[";:","oO","eE","jJ",null,null],r:["cC","9(","0)","lL","nN","tT"],s:["nN","lL","/?","-_","zZ","vV"],t:["hH","cC","rR","nN","wW","mM"],u:["eE","pP","yY","iI","kK","jJ"],v:["wW","nN","sS","zZ",null,null],w:["mM","tT","nN","vV",null,null],x:["kK","iI","dD","bB",null,null],y:["pP","5%","6^","fF","iI","uU"],z:["vV","sS","-_",null,null,null],"{":["0)",null,null,"]}","/?","lL"],"|":["=+",null,null,null,null,null],"}":["[{",null,null,null,"=+","/?"],"~":[null,null,null,"1!",null,null]},keypad:{"*":["/",null,null,null,"-","+","9","8"],"+":["9","*","-",null,null,null,null,"6"],"-":["*",null,null,null,null,null,"+","9"],".":["0","2","3",null,null,null,null,null],"/":[null,null,null,null,"*","9","8","7"],0:[null,"1","2","3",".",null,null,null],1:[null,null,"4","5","2","0",null,null],2:["1","4","5","6","3",".","0",null],3:["2","5","6",null,null,null,".","0"],4:[null,null,"7","8","5","2","1",null],5:["4","7","8","9","6","3","2","1"],6:["5","8","9","+",null,null,"3","2"],7:[null,null,null,"/","8","5","4",null],8:["7",null,"/","*","9","6","5","4"],9:["8","/","*","-","+",null,"6","5"]},mac_keypad:{"*":["/",null,null,null,null,null,"-","9"],"+":["6","9","-",null,null,null,null,"3"],"-":["9","/","*",null,null,null,"+","6"],".":["0","2","3",null,null,null,null,null],"/":["=",null,null,null,"*","-","9","8"],0:[null,"1","2","3",".",null,null,null],1:[null,null,"4","5","2","0",null,null],2:["1","4","5","6","3",".","0",null],3:["2","5","6","+",null,null,".","0"],4:[null,null,"7","8","5","2","1",null],5:["4","7","8","9","6","3","2","1"],6:["5","8","9","-","+",null,"3","2"],7:[null,null,null,"=","8","5","4",null],8:["7",null,"=","/","9","6","5","4"],9:["8","=","/","*","-","+","6","5"],"=":[null,null,null,null,"/","9","8","7"]}},module.exports=adjacency_graphs;
74273
74274},{}],2:[function(require,module,exports){
74275var feedback,scoring;scoring=require("./scoring"),feedback={default_feedback:{warning:"",suggestions:["Use a few words, avoid common phrases","No need for symbols, digits, or uppercase letters"]},get_feedback:function(e,s){var a,t,r,n,o,i;if(0===s.length)return this.default_feedback;if(e>2)return{warning:"",suggestions:[]};for(n=s[0],i=s.slice(1),t=0,r=i.length;t<r;t++)o=i[t],o.token.length>n.token.length&&(n=o);return feedback=this.get_match_feedback(n,1===s.length),a="Add another word or two. Uncommon words are better.",null!=feedback?(feedback.suggestions.unshift(a),null==feedback.warning&&(feedback.warning="")):feedback={warning:"",suggestions:[a]},feedback},get_match_feedback:function(e,s){var a,t;switch(e.pattern){case"dictionary":return this.get_dictionary_match_feedback(e,s);case"spatial":return a=e.graph.toUpperCase(),t=1===e.turns?"Straight rows of keys are easy to guess":"Short keyboard patterns are easy to guess",{warning:t,suggestions:["Use a longer keyboard pattern with more turns"]};case"repeat":return t=1===e.base_token.length?'Repeats like "aaa" are easy to guess':'Repeats like "abcabcabc" are only slightly harder to guess than "abc"',{warning:t,suggestions:["Avoid repeated words and characters"]};case"sequence":return{warning:"Sequences like abc or 6543 are easy to guess",suggestions:["Avoid sequences"]};case"regex":if("recent_year"===e.regex_name)return{warning:"Recent years are easy to guess",suggestions:["Avoid recent years","Avoid years that are associated with you"]};break;case"date":return{warning:"Dates are often easy to guess",suggestions:["Avoid dates and years that are associated with you"]}}},get_dictionary_match_feedback:function(e,s){var a,t,r,n,o;return n="passwords"===e.dictionary_name?!s||e.l33t||e.reversed?e.guesses_log10<=4?"This is similar to a commonly used password":void 0:e.rank<=10?"This is a top-10 common password":e.rank<=100?"This is a top-100 common password":"This is a very common password":"english"===e.dictionary_name?s?"A word by itself is easy to guess":void 0:"surnames"===(a=e.dictionary_name)||"male_names"===a||"female_names"===a?s?"Names and surnames by themselves are easy to guess":"Common names and surnames are easy to guess":"",r=[],o=e.token,o.match(scoring.START_UPPER)?r.push("Capitalization doesn't help very much"):o.match(scoring.ALL_UPPER)&&o.toLowerCase()!==o&&r.push("All-uppercase is almost as easy to guess as all-lowercase"),e.reversed&&e.token.length>=4&&r.push("Reversed words aren't much harder to guess"),e.l33t&&r.push("Predictable substitutions like '@' instead of 'a' don't help very much"),t={warning:n,suggestions:r}}},module.exports=feedback;
74276
74277},{"./scoring":6}],3:[function(require,module,exports){
74278var frequency_lists;frequency_lists={passwords:"123456,password,12345678,qwerty,123456789,12345,1234,111111,1234567,dragon,123123,baseball,abc123,football,monkey,letmein,shadow,master,696969,mustang,666666,qwertyuiop,123321,1234567890,pussy,superman,654321,1qaz2wsx,7777777,fuckyou,qazwsx,jordan,123qwe,000000,killer,trustno1,hunter,harley,zxcvbnm,asdfgh,buster,batman,soccer,tigger,charlie,sunshine,iloveyou,fuckme,ranger,hockey,computer,starwars,asshole,pepper,klaster,112233,zxcvbn,freedom,princess,maggie,pass,ginger,11111111,131313,fuck,love,cheese,159753,summer,chelsea,dallas,biteme,matrix,yankees,6969,corvette,austin,access,thunder,merlin,secret,diamond,hello,hammer,fucker,1234qwer,silver,gfhjkm,internet,samantha,golfer,scooter,test,orange,cookie,q1w2e3r4t5,maverick,sparky,phoenix,mickey,bigdog,snoopy,guitar,whatever,chicken,camaro,mercedes,peanut,ferrari,falcon,cowboy,welcome,sexy,samsung,steelers,smokey,dakota,arsenal,boomer,eagles,tigers,marina,nascar,booboo,gateway,yellow,porsche,monster,spider,diablo,hannah,bulldog,junior,london,purple,compaq,lakers,iceman,qwer1234,hardcore,cowboys,money,banana,ncc1701,boston,tennis,q1w2e3r4,coffee,scooby,123654,nikita,yamaha,mother,barney,brandy,chester,fuckoff,oliver,player,forever,rangers,midnight,chicago,bigdaddy,redsox,angel,badboy,fender,jasper,slayer,rabbit,natasha,marine,bigdick,wizard,marlboro,raiders,prince,casper,fishing,flower,jasmine,iwantu,panties,adidas,winter,winner,gandalf,password1,enter,ghbdtn,1q2w3e4r,golden,cocacola,jordan23,winston,madison,angels,panther,blowme,sexsex,bigtits,spanky,bitch,sophie,asdfasdf,horny,thx1138,toyota,tiger,dick,canada,12344321,blowjob,8675309,muffin,liverpoo,apples,qwerty123,passw0rd,abcd1234,pokemon,123abc,slipknot,qazxsw,123456a,scorpion,qwaszx,butter,startrek,rainbow,asdfghjkl,razz,newyork,redskins,gemini,cameron,qazwsxedc,florida,liverpool,turtle,sierra,viking,booger,butthead,doctor,rocket,159357,dolphins,captain,bandit,jaguar,packers,pookie,peaches,789456,asdf,dolphin,helpme,blue,theman,maxwell,qwertyui,shithead,lovers,maddog,giants,nirvana,metallic,hotdog,rosebud,mountain,warrior,stupid,elephant,suckit,success,bond007,jackass,alexis,porn,lucky,scorpio,samson,q1w2e3,azerty,rush2112,driver,freddy,1q2w3e4r5t,sydney,gators,dexter,red123,123456q,12345a,bubba,creative,voodoo,golf,trouble,america,nissan,gunner,garfield,bullshit,asdfghjk,5150,fucking,apollo,1qazxsw2,2112,eminem,legend,airborne,bear,beavis,apple,brooklyn,godzilla,skippy,4815162342,buddy,qwert,kitten,magic,shelby,beaver,phantom,asdasd,xavier,braves,darkness,blink182,copper,platinum,qweqwe,tomcat,01012011,girls,bigboy,102030,animal,police,online,11223344,voyager,lifehack,12qwaszx,fish,sniper,315475,trinity,blazer,heaven,lover,snowball,playboy,loveme,bubbles,hooters,cricket,willow,donkey,topgun,nintendo,saturn,destiny,pakistan,pumpkin,digital,sergey,redwings,explorer,tits,private,runner,therock,guinness,lasvegas,beatles,789456123,fire,cassie,christin,qwerty1,celtic,asdf1234,andrey,broncos,007007,babygirl,eclipse,fluffy,cartman,michigan,carolina,testing,alexande,birdie,pantera,cherry,vampire,mexico,dickhead,buffalo,genius,montana,beer,minecraft,maximus,flyers,lovely,stalker,metallica,doggie,snickers,speedy,bronco,lol123,paradise,yankee,horses,magnum,dreams,147258369,lacrosse,ou812,goober,enigma,qwertyu,scotty,pimpin,bollocks,surfer,cock,poohbear,genesis,star,asd123,qweasdzxc,racing,hello1,hawaii,eagle1,viper,poopoo,einstein,boobies,12345q,bitches,drowssap,simple,badger,alaska,action,jester,drummer,111222,spitfire,forest,maryjane,champion,diesel,svetlana,friday,hotrod,147258,chevy,lucky1,westside,security,google,badass,tester,shorty,thumper,hitman,mozart,zaq12wsx,boobs,reddog,010203,lizard,a123456,123456789a,ruslan,eagle,1232323q,scarface,qwerty12,147852,a12345,buddha,porno,420420,spirit,money1,stargate,qwe123,naruto,mercury,liberty,12345qwert,semperfi,suzuki,popcorn,spooky,marley,scotland,kitty,cherokee,vikings,simpsons,rascal,qweasd,hummer,loveyou,michael1,patches,russia,jupiter,penguin,passion,cumshot,vfhbyf,honda,vladimir,sandman,passport,raider,bastard,123789,infinity,assman,bulldogs,fantasy,sucker,1234554321,horney,domino,budlight,disney,ironman,usuckballz1,softball,brutus,redrum,bigred,mnbvcxz,fktrcfylh,karina,marines,digger,kawasaki,cougar,fireman,oksana,monday,cunt,justice,nigger,super,wildcats,tinker,logitech,dancer,swordfis,avalon,everton,alexandr,motorola,patriots,hentai,madonna,pussy1,ducati,colorado,connor,juventus,galore,smooth,freeuser,warcraft,boogie,titanic,wolverin,elizabet,arizona,valentin,saints,asdfg,accord,test123,password123,christ,yfnfif,stinky,slut,spiderma,naughty,chopper,hello123,ncc1701d,extreme,skyline,poop,zombie,pearljam,123qweasd,froggy,awesome,vision,pirate,fylhtq,dreamer,bullet,predator,empire,123123a,kirill,charlie1,panthers,penis,skipper,nemesis,rasdzv3,peekaboo,rolltide,cardinal,psycho,danger,mookie,happy1,wanker,chevelle,manutd,goblue,9379992,hobbes,vegeta,fyfcnfcbz,852456,picard,159951,windows,loverboy,victory,vfrcbv,bambam,serega,123654789,turkey,tweety,galina,hiphop,rooster,changeme,berlin,taurus,suckme,polina,electric,avatar,134679,maksim,raptor,alpha1,hendrix,newport,bigcock,brazil,spring,a1b2c3,madmax,alpha,britney,sublime,darkside,bigman,wolfpack,classic,hercules,ronaldo,letmein1,1q2w3e,741852963,spiderman,blizzard,123456789q,cheyenne,cjkysirj,tiger1,wombat,bubba1,pandora,zxc123,holiday,wildcat,devils,horse,alabama,147852369,caesar,12312,buddy1,bondage,pussycat,pickle,shaggy,catch22,leather,chronic,a1b2c3d4,admin,qqq111,qaz123,airplane,kodiak,freepass,billybob,sunset,katana,phpbb,chocolat,snowman,angel1,stingray,firebird,wolves,zeppelin,detroit,pontiac,gundam,panzer,vagina,outlaw,redhead,tarheels,greenday,nastya,01011980,hardon,engineer,dragon1,hellfire,serenity,cobra,fireball,lickme,darkstar,1029384756,01011,mustang1,flash,124578,strike,beauty,pavilion,01012000,bobafett,dbrnjhbz,bigmac,bowling,chris1,ytrewq,natali,pyramid,rulez,welcome1,dodgers,apache,swimming,whynot,teens,trooper,fuckit,defender,precious,135790,packard,weasel,popeye,lucifer,cancer,icecream,142536,raven,swordfish,presario,viktor,rockstar,blonde,james1,wutang,spike,pimp,atlanta,airforce,thailand,casino,lennon,mouse,741852,hacker,bluebird,hawkeye,456123,theone,catfish,sailor,goldfish,nfnmzyf,tattoo,pervert,barbie,maxima,nipples,machine,trucks,wrangler,rocks,tornado,lights,cadillac,bubble,pegasus,madman,longhorn,browns,target,666999,eatme,qazwsx123,microsoft,dilbert,christia,baller,lesbian,shooter,xfiles,seattle,qazqaz,cthutq,amateur,prelude,corona,freaky,malibu,123qweasdzxc,assassin,246810,atlantis,integra,pussies,iloveu,lonewolf,dragons,monkey1,unicorn,software,bobcat,stealth,peewee,openup,753951,srinivas,zaqwsx,valentina,shotgun,trigger,veronika,bruins,coyote,babydoll,joker,dollar,lestat,rocky1,hottie,random,butterfly,wordpass,smiley,sweety,snake,chipper,woody,samurai,devildog,gizmo,maddie,soso123aljg,mistress,freedom1,flipper,express,hjvfirf,moose,cessna,piglet,polaris,teacher,montreal,cookies,wolfgang,scully,fatboy,wicked,balls,tickle,bunny,dfvgbh,foobar,transam,pepsi,fetish,oicu812,basketba,toshiba,hotstuff,sunday,booty,gambit,31415926,impala,stephani,jessica1,hooker,lancer,knicks,shamrock,fuckyou2,stinger,314159,redneck,deftones,squirt,siemens,blaster,trucker,subaru,renegade,ibanez,manson,swinger,reaper,blondie,mylove,galaxy,blahblah,enterpri,travel,1234abcd,babylon5,indiana,skeeter,master1,sugar,ficken,smoke,bigone,sweetpea,fucked,trfnthbyf,marino,escort,smitty,bigfoot,babes,larisa,trumpet,spartan,valera,babylon,asdfghj,yankees1,bigboobs,stormy,mister,hamlet,aardvark,butterfl,marathon,paladin,cavalier,manchester,skater,indigo,hornet,buckeyes,01011990,indians,karate,hesoyam,toronto,diamonds,chiefs,buckeye,1qaz2wsx3edc,highland,hotsex,charger,redman,passwor,maiden,drpepper,storm,pornstar,garden,12345678910,pencil,sherlock,timber,thuglife,insane,pizza,jungle,jesus1,aragorn,1a2b3c,hamster,david1,triumph,techno,lollol,pioneer,catdog,321654,fktrctq,morpheus,141627,pascal,shadow1,hobbit,wetpussy,erotic,consumer,blabla,justme,stones,chrissy,spartak,goforit,burger,pitbull,adgjmptw,italia,barcelona,hunting,colors,kissme,virgin,overlord,pebbles,sundance,emerald,doggy,racecar,irina,element,1478963,zipper,alpine,basket,goddess,poison,nipple,sakura,chichi,huskers,13579,pussys,q12345,ultimate,ncc1701e,blackie,nicola,rommel,matthew1,caserta,omega,geronimo,sammy1,trojan,123qwe123,philips,nugget,tarzan,chicks,aleksandr,bassman,trixie,portugal,anakin,dodger,bomber,superfly,madness,q1w2e3r4t5y6,loser,123asd,fatcat,ybrbnf,soldier,warlock,wrinkle1,desire,sexual,babe,seminole,alejandr,951753,11235813,westham,andrei,concrete,access14,weed,letmein2,ladybug,naked,christop,trombone,tintin,bluesky,rhbcnbyf,qazxswedc,onelove,cdtnkfyf,whore,vfvjxrf,titans,stallion,truck,hansolo,blue22,smiles,beagle,panama,kingkong,flatron,inferno,mongoose,connect,poiuyt,snatch,qawsed,juice,blessed,rocker,snakes,turbo,bluemoon,sex4me,finger,jamaica,a1234567,mulder,beetle,fuckyou1,passat,immortal,plastic,123454321,anthony1,whiskey,dietcoke,suck,spunky,magic1,monitor,cactus,exigen,planet,ripper,teen,spyder,apple1,nolimit,hollywoo,sluts,sticky,trunks,1234321,14789632,pickles,sailing,bonehead,ghbdtnbr,delta,charlott,rubber,911911,112358,molly1,yomama,hongkong,jumper,william1,ilovesex,faster,unreal,cumming,memphis,1123581321,nylons,legion,sebastia,shalom,pentium,geheim,werewolf,funtime,ferret,orion,curious,555666,niners,cantona,sprite,philly,pirates,abgrtyu,lollipop,eternity,boeing,super123,sweets,cooldude,tottenha,green1,jackoff,stocking,7895123,moomoo,martini,biscuit,drizzt,colt45,fossil,makaveli,snapper,satan666,maniac,salmon,patriot,verbatim,nasty,shasta,asdzxc,shaved,blackcat,raistlin,qwerty12345,punkrock,cjkywt,01012010,4128,waterloo,crimson,twister,oxford,musicman,seinfeld,biggie,condor,ravens,megadeth,wolfman,cosmos,sharks,banshee,keeper,foxtrot,gn56gn56,skywalke,velvet,black1,sesame,dogs,squirrel,privet,sunrise,wolverine,sucks,legolas,grendel,ghost,cats,carrot,frosty,lvbnhbq,blades,stardust,frog,qazwsxed,121314,coolio,brownie,groovy,twilight,daytona,vanhalen,pikachu,peanuts,licker,hershey,jericho,intrepid,ninja,1234567a,zaq123,lobster,goblin,punisher,strider,shogun,kansas,amadeus,seven7,jason1,neptune,showtime,muscle,oldman,ekaterina,rfrfirf,getsome,showme,111222333,obiwan,skittles,danni,tanker,maestro,tarheel,anubis,hannibal,anal,newlife,gothic,shark,fighter,blue123,blues,123456z,princes,slick,chaos,thunder1,sabine,1q2w3e4r5t6y,python,test1,mirage,devil,clover,tequila,chelsea1,surfing,delete,potato,chubby,panasonic,sandiego,portland,baggins,fusion,sooners,blackdog,buttons,californ,moscow,playtime,mature,1a2b3c4d,dagger,dima,stimpy,asdf123,gangster,warriors,iverson,chargers,byteme,swallow,liquid,lucky7,dingdong,nymets,cracker,mushroom,456852,crusader,bigguy,miami,dkflbvbh,bugger,nimrod,tazman,stranger,newpass,doodle,powder,gotcha,guardian,dublin,slapshot,septembe,147896325,pepsi1,milano,grizzly,woody1,knights,photos,2468,nookie,charly,rammstein,brasil,123321123,scruffy,munchkin,poopie,123098,kittycat,latino,walnut,1701,thegame,viper1,1passwor,kolobok,picasso,robert1,barcelon,bananas,trance,auburn,coltrane,eatshit,goodluck,starcraft,wheels,parrot,postal,blade,wisdom,pink,gorilla,katerina,pass123,andrew1,shaney14,dumbass,osiris,fuck_inside,oakland,discover,ranger1,spanking,lonestar,bingo,meridian,ping,heather1,dookie,stonecol,megaman,192837465,rjntyjr,ledzep,lowrider,25802580,richard1,firefly,griffey,racerx,paradox,ghjcnj,gangsta,zaq1xsw2,tacobell,weezer,sirius,halflife,buffett,shiloh,123698745,vertigo,sergei,aliens,sobaka,keyboard,kangaroo,sinner,soccer1,0.0.000,bonjour,socrates,chucky,hotboy,sprint,0007,sarah1,scarlet,celica,shazam,formula1,sommer,trebor,qwerasdf,jeep,mailcreated5240,bollox,asshole1,fuckface,honda1,rebels,vacation,lexmark,penguins,12369874,ragnarok,formula,258456,tempest,vfhecz,tacoma,qwertz,colombia,flames,rockon,duck,prodigy,wookie,dodgeram,mustangs,123qaz,sithlord,smoker,server,bang,incubus,scoobydo,oblivion,molson,kitkat,titleist,rescue,zxcv1234,carpet,1122,bigballs,tardis,jimbob,xanadu,blueeyes,shaman,mersedes,pooper,pussy69,golfing,hearts,mallard,12312312,kenwood,patrick1,dogg,cowboys1,oracle,123zxc,nuttertools,102938,topper,1122334455,shemale,sleepy,gremlin,yourmom,123987,gateway1,printer,monkeys,peterpan,mikey,kingston,cooler,analsex,jimbo,pa55word,asterix,freckles,birdman,frank1,defiant,aussie,stud,blondes,tatyana,445566,aspirine,mariners,jackal,deadhead,katrin,anime,rootbeer,frogger,polo,scooter1,hallo,noodles,thomas1,parola,shaolin,celine,11112222,plymouth,creampie,justdoit,ohyeah,fatass,assfuck,amazon,1234567q,kisses,magnus,camel,nopass,bosco,987456,6751520,harley1,putter,champs,massive,spidey,lightnin,camelot,letsgo,gizmodo,aezakmi,bones,caliente,12121,goodtime,thankyou,raiders1,brucelee,redalert,aquarius,456654,catherin,smokin,pooh,mypass,astros,roller,porkchop,sapphire,qwert123,kevin1,a1s2d3f4,beckham,atomic,rusty1,vanilla,qazwsxedcrfv,hunter1,kaktus,cxfcnmt,blacky,753159,elvis1,aggies,blackjac,bangkok,scream,123321q,iforgot,power1,kasper,abc12,buster1,slappy,shitty,veritas,chevrole,amber1,01012001,vader,amsterdam,jammer,primus,spectrum,eduard,granny,horny1,sasha1,clancy,usa123,satan,diamond1,hitler,avenger,1221,spankme,123456qwerty,simba,smudge,scrappy,labrador,john316,syracuse,front242,falcons,husker,candyman,commando,gator,pacman,delta1,pancho,krishna,fatman,clitoris,pineappl,lesbians,8j4ye3uz,barkley,vulcan,punkin,boner,celtics,monopoly,flyboy,romashka,hamburg,123456aa,lick,gangbang,223344,area51,spartans,aaa111,tricky,snuggles,drago,homerun,vectra,homer1,hermes,topcat,cuddles,infiniti,1234567890q,cosworth,goose,phoenix1,killer1,ivanov,bossman,qawsedrf,peugeot,exigent,doberman,durango,brandon1,plumber,telefon,horndog,laguna,rbhbkk,dawg,webmaster,breeze,beast,porsche9,beefcake,leopard,redbull,oscar1,topdog,godsmack,theking,pics,omega1,speaker,viktoria,fuckers,bowler,starbuck,gjkbyf,valhalla,anarchy,blacks,herbie,kingpin,starfish,nokia,loveit,achilles,906090,labtec,ncc1701a,fitness,jordan1,brando,arsenal1,bull,kicker,napass,desert,sailboat,bohica,tractor,hidden,muppet,jackson1,jimmy1,terminator,phillies,pa55w0rd,terror,farside,swingers,legacy,frontier,butthole,doughboy,jrcfyf,tuesday,sabbath,daniel1,nebraska,homers,qwertyuio,azamat,fallen,agent007,striker,camels,iguana,looker,pinkfloy,moloko,qwerty123456,dannyboy,luckydog,789654,pistol,whocares,charmed,skiing,select,franky,puppy,daniil,vladik,vette,vfrcbvrf,ihateyou,nevada,moneys,vkontakte,mandingo,puppies,666777,mystic,zidane,kotenok,dilligaf,budman,bunghole,zvezda,123457,triton,golfball,technics,trojans,panda,laptop,rookie,01011991,15426378,aberdeen,gustav,jethro,enterprise,igor,stripper,filter,hurrican,rfnthbyf,lespaul,gizmo1,butch,132435,dthjybrf,1366613,excalibu,963852,nofear,momoney,possum,cutter,oilers,moocow,cupcake,gbpltw,batman1,splash,svetik,super1,soleil,bogdan,melissa1,vipers,babyboy,tdutybq,lancelot,ccbill,keystone,passwort,flamingo,firefox,dogman,vortex,rebel,noodle,raven1,zaphod,killme,pokemon1,coolman,danila,designer,skinny,kamikaze,deadman,gopher,doobie,warhammer,deeznuts,freaks,engage,chevy1,steve1,apollo13,poncho,hammers,azsxdc,dracula,000007,sassy,bitch1,boots,deskjet,12332,macdaddy,mighty,rangers1,manchest,sterlin,casey1,meatball,mailman,sinatra,cthulhu,summer1,bubbas,cartoon,bicycle,eatpussy,truelove,sentinel,tolkien,breast,capone,lickit,summit,123456k,peter1,daisy1,kitty1,123456789z,crazy1,jamesbon,texas1,sexygirl,362436,sonic,billyboy,redhot,microsof,microlab,daddy1,rockets,iloveyo,fernand,gordon24,danie,cutlass,polska,star69,titties,pantyhos,01011985,thekid,aikido,gofish,mayday,1234qwe,coke,anfield,sony,lansing,smut,scotch,sexx,catman,73501505,hustler,saun,dfkthbz,passwor1,jenny1,azsxdcfv,cheers,irish1,gabrie,tinman,orioles,1225,charlton,fortuna,01011970,airbus,rustam,xtreme,bigmoney,zxcasd,retard,grumpy,huskies,boxing,4runner,kelly1,ultima,warlord,fordf150,oranges,rotten,asdfjkl,superstar,denali,sultan,bikini,saratoga,thor,figaro,sixers,wildfire,vladislav,128500,sparta,mayhem,greenbay,chewie,music1,number1,cancun,fabie,mellon,poiuytrewq,cloud9,crunch,bigtime,chicken1,piccolo,bigbird,321654987,billy1,mojo,01011981,maradona,sandro,chester1,bizkit,rjirfrgbde,789123,rightnow,jasmine1,hyperion,treasure,meatloaf,armani,rovers,jarhead,01011986,cruise,coconut,dragoon,utopia,davids,cosmo,rfhbyf,reebok,1066,charli,giorgi,sticks,sayang,pass1234,exodus,anaconda,zaqxsw,illini,woofwoof,emily1,sandy1,packer,poontang,govols,jedi,tomato,beaner,cooter,creamy,lionking,happy123,albatros,poodle,kenworth,dinosaur,greens,goku,happyday,eeyore,tsunami,cabbage,holyshit,turkey50,memorex,chaser,bogart,orgasm,tommy1,volley,whisper,knopka,ericsson,walleye,321123,pepper1,katie1,chickens,tyler1,corrado,twisted,100000,zorro,clemson,zxcasdqwe,tootsie,milana,zenith,fktrcfylhf,shania,frisco,polniypizdec0211,crazybab,junebug,fugazi,rereirf,vfvekz,1001,sausage,vfczyz,koshka,clapton,justin1,anhyeuem,condom,fubar,hardrock,skywalker,tundra,cocks,gringo,150781,canon,vitalik,aspire,stocks,samsung1,applepie,abc12345,arjay,gandalf1,boob,pillow,sparkle,gmoney,rockhard,lucky13,samiam,everest,hellyeah,bigsexy,skorpion,rfrnec,hedgehog,australi,candle,slacker,dicks,voyeur,jazzman,america1,bobby1,br0d3r,wolfie,vfksirf,1qa2ws3ed,13243546,fright,yosemite,temp,karolina,fart,barsik,surf,cheetah,baddog,deniska,starship,bootie,milena,hithere,kume,greatone,dildo,50cent,0.0.0.000,albion,amanda1,midget,lion,maxell,football1,cyclone,freeporn,nikola,bonsai,kenshin,slider,balloon,roadkill,killbill,222333,jerkoff,78945612,dinamo,tekken,rambler,goliath,cinnamon,malaka,backdoor,fiesta,packers1,rastaman,fletch,sojdlg123aljg,stefano,artemis,calico,nyjets,damnit,robotech,duchess,rctybz,hooter,keywest,18436572,hal9000,mechanic,pingpong,operator,presto,sword,rasputin,spank,bristol,faggot,shado,963852741,amsterda,321456,wibble,carrera,alibaba,majestic,ramses,duster,route66,trident,clipper,steeler,wrestlin,divine,kipper,gotohell,kingfish,snake1,passwords,buttman,pompey,viagra,zxcvbnm1,spurs,332211,slutty,lineage2,oleg,macross,pooter,brian1,qwert1,charles1,slave,jokers,yzerman,swimmer,ne1469,nwo4life,solnce,seamus,lolipop,pupsik,moose1,ivanova,secret1,matador,love69,420247,ktyjxrf,subway,cinder,vermont,pussie,chico,florian,magick,guiness,allsop,ghetto,flash1,a123456789,typhoon,dfkthf,depeche,skydive,dammit,seeker,fuckthis,crysis,kcj9wx5n,umbrella,r2d2c3po,123123q,snoopdog,critter,theboss,ding,162534,splinter,kinky,cyclops,jayhawk,456321,caramel,qwer123,underdog,caveman,onlyme,grapes,feather,hotshot,fuckher,renault,george1,sex123,pippen,000001,789987,floppy,cunts,megapass,1000,pornos,usmc,kickass,great1,quattro,135246,wassup,helloo,p0015123,nicole1,chivas,shannon1,bullseye,java,fishes,blackhaw,jamesbond,tunafish,juggalo,dkflbckfd,123789456,dallas1,translator,122333,beanie,alucard,gfhjkm123,supersta,magicman,ashley1,cohiba,xbox360,caligula,12131415,facial,7753191,dfktynbyf,cobra1,cigars,fang,klingon,bob123,safari,looser,10203,deepthroat,malina,200000,tazmania,gonzo,goalie,jacob1,monaco,cruiser,misfit,vh5150,tommyboy,marino13,yousuck,sharky,vfhufhbnf,horizon,absolut,brighton,123456r,death1,kungfu,maxx,forfun,mamapapa,enter1,budweise,banker,getmoney,kostya,qazwsx12,bigbear,vector,fallout,nudist,gunners,royals,chainsaw,scania,trader,blueboy,walrus,eastside,kahuna,qwerty1234,love123,steph,01011989,cypress,champ,undertaker,ybrjkfq,europa,snowboar,sabres,moneyman,chrisbln,minime,nipper,groucho,whitey,viewsonic,penthous,wolf359,fabric,flounder,coolguy,whitesox,passme,smegma,skidoo,thanatos,fucku2,snapple,dalejr,mondeo,thesims,mybaby,panasoni,sinbad,thecat,topher,frodo,sneakers,q123456,z1x2c3,alfa,chicago1,taylor1,ghjcnjnfr,cat123,olivier,cyber,titanium,0420,madison1,jabroni,dang,hambone,intruder,holly1,gargoyle,sadie1,static,poseidon,studly,newcastl,sexxxx,poppy,johannes,danzig,beastie,musica,buckshot,sunnyday,adonis,bluedog,bonkers,2128506,chrono,compute,spawn,01011988,turbo1,smelly,wapbbs,goldstar,ferrari1,778899,quantum,pisces,boomboom,gunnar,1024,test1234,florida1,nike,superman1,multiplelo,custom,motherlode,1qwerty,westwood,usnavy,apple123,daewoo,korn,stereo,sasuke,sunflowe,watcher,dharma,555777,mouse1,assholes,babyblue,123qwerty,marius,walmart,snoop,starfire,tigger1,paintbal,knickers,aaliyah,lokomotiv,theend,winston1,sapper,rover,erotica,scanner,racer,zeus,sexy69,doogie,bayern,joshua1,newbie,scott1,losers,droopy,outkast,martin1,dodge1,wasser,ufkbyf,rjycnfynby,thirteen,12345z,112211,hotred,deejay,hotpussy,192837,jessic,philippe,scout,panther1,cubbies,havefun,magpie,fghtkm,avalanch,newyork1,pudding,leonid,harry1,cbr600,audia4,bimmer,fucku,01011984,idontknow,vfvfgfgf,1357,aleksey,builder,01011987,zerocool,godfather,mylife,donuts,allmine,redfish,777888,sascha,nitram,bounce,333666,smokes,1x2zkg8w,rodman,stunner,zxasqw12,hoosier,hairy,beretta,insert,123456s,rtyuehe,francesc,tights,cheese1,micron,quartz,hockey1,gegcbr,searay,jewels,bogey,paintball,celeron,padres,bing,syncmaster,ziggy,simon1,beaches,prissy,diehard,orange1,mittens,aleksandra,queens,02071986,biggles,thongs,southpark,artur,twinkle,gretzky,rabota,cambiami,monalisa,gollum,chuckles,spike1,gladiator,whisky,spongebob,sexy1,03082006,mazafaka,meathead,4121,ou8122,barefoot,12345678q,cfitymrf,bigass,a1s2d3,kosmos,blessing,titty,clevelan,terrapin,ginger1,johnboy,maggot,clarinet,deeznutz,336699,stumpy,stoney,footbal,traveler,volvo,bucket,snapon,pianoman,hawkeyes,futbol,casanova,tango,goodboy,scuba,honey1,sexyman,warthog,mustard,abc1234,nickel,10203040,meowmeow,1012,boricua,prophet,sauron,12qwas,reefer,andromeda,crystal1,joker1,90210,goofy,loco,lovesex,triangle,whatsup,mellow,bengals,monster1,maste,01011910,lover1,love1,123aaa,sunshin,smeghead,hokies,sting,welder,rambo,cerberus,bunny1,rockford,monke,1q2w3e4r5,goldwing,gabriell,buzzard,crjhgbjy,james007,rainman,groove,tiberius,purdue,nokia6300,hayabusa,shou,jagger,diver,zigzag,poochie,usarmy,phish,redwood,redwing,12345679,salamander,silver1,abcd123,sputnik,boobie,ripple,eternal,12qw34er,thegreat,allstar,slinky,gesperrt,mishka,whiskers,pinhead,overkill,sweet1,rhfcjnrf,montgom240,sersolution,jamie1,starman,proxy,swords,nikolay,bacardi,rasta,badgirl,rebecca1,wildman,penny1,spaceman,1007,10101,logan1,hacked,bulldog1,helmet,windsor,buffy1,runescape,trapper,123451,banane,dbrnjh,ripken,12345qwe,frisky,shun,fester,oasis,lightning,ib6ub9,cicero,kool,pony,thedog,784512,01011992,megatron,illusion,edward1,napster,11223,squash,roadking,woohoo,19411945,hoosiers,01091989,tracker,bagira,midway,leavemealone,br549,14725836,235689,menace,rachel1,feng,laser,stoned,realmadrid,787898,balloons,tinkerbell,5551212,maria1,pobeda,heineken,sonics,moonlight,optimus,comet,orchid,02071982,jaybird,kashmir,12345678a,chuang,chunky,peach,mortgage,rulezzz,saleen,chuckie,zippy,fishing1,gsxr750,doghouse,maxim,reader,shai,buddah,benfica,chou,salomon,meister,eraser,blackbir,bigmike,starter,pissing,angus,deluxe,eagles1,hardcock,135792468,mian,seahawks,godfathe,bookworm,gregor,intel,talisman,blackjack,babyface,hawaiian,dogfood,zhong,01011975,sancho,ludmila,medusa,mortimer,123456654321,roadrunn,just4me,stalin,01011993,handyman,alphabet,pizzas,calgary,clouds,password2,cgfhnfr,f**k,cubswin,gong,lexus,max123,xxx123,digital1,gfhjkm1,7779311,missy1,michae,beautifu,gator1,1005,pacers,buddie,chinook,heckfy,dutchess,sally1,breasts,beowulf,darkman,jenn,tiffany1,zhei,quan,qazwsx1,satana,shang,idontkno,smiths,puddin,nasty1,teddybea,valkyrie,passwd,chao,boxster,killers,yoda,cheater,inuyasha,beast1,wareagle,foryou,dragonball,mermaid,bhbirf,teddy1,dolphin1,misty1,delphi,gromit,sponge,qazzaq,fytxrf,gameover,diao,sergi,beamer,beemer,kittykat,rancid,manowar,adam12,diggler,assword,austin1,wishbone,gonavy,sparky1,fisting,thedude,sinister,1213,venera,novell,salsero,jayden,fuckoff1,linda1,vedder,02021987,1pussy,redline,lust,jktymrf,02011985,dfcbkbq,dragon12,chrome,gamecube,titten,cong,bella1,leng,02081988,eureka,bitchass,147369,banner,lakota,123321a,mustafa,preacher,hotbox,02041986,z1x2c3v4,playstation,01011977,claymore,electra,checkers,zheng,qing,armagedon,02051986,wrestle,svoboda,bulls,nimbus,alenka,madina,newpass6,onetime,aa123456,bartman,02091987,silverad,electron,12345t,devil666,oliver1,skylar,rhtdtlrj,gobucks,johann,12011987,milkman,02101985,camper,thunderb,bigbutt,jammin,davide,cheeks,goaway,lighter,claudi,thumbs,pissoff,ghostrider,cocaine,teng,squall,lotus,hootie,blackout,doitnow,subzero,02031986,marine1,02021988,pothead,123456qw,skate,1369,peng,antoni,neng,miao,bcfields,1492,marika,794613,musashi,tulips,nong,piao,chai,ruan,southpar,02061985,nude,mandarin,654123,ninjas,cannabis,jetski,xerxes,zhuang,kleopatra,dickie,bilbo,pinky,morgan1,1020,1017,dieter,baseball1,tottenham,quest,yfnfkmz,dirtbike,1234567890a,mango,jackson5,ipswich,iamgod,02011987,tdutybz,modena,qiao,slippery,qweasd123,bluefish,samtron,toon,111333,iscool,02091986,petrov,fuzzy,zhou,1357924680,mollydog,deng,02021986,1236987,pheonix,zhun,ghblehjr,othello,starcraf,000111,sanfran,a11111,cameltoe,badman,vasilisa,jiang,1qaz2ws,luan,sveta,12qw12,akira,chuai,369963,cheech,beatle,pickup,paloma,01011983,caravan,elizaveta,gawker,banzai,pussey,mullet,seng,bingo1,bearcat,flexible,farscape,borussia,zhuai,templar,guitar1,toolman,yfcntymrf,chloe1,xiang,slave1,guai,nuggets,02081984,mantis,slim,scorpio1,fyutkbyf,thedoors,02081987,02061986,123qq123,zappa,fergie,7ugd5hip2j,huai,asdfzxcv,sunflower,pussyman,deadpool,bigtit,01011982,love12,lassie,skyler,gatorade,carpedie,jockey,mancity,spectre,02021984,cameron1,artemka,reng,02031984,iomega,jing,moritz,spice,rhino,spinner,heater,zhai,hover,talon,grease,qiong,corleone,ltybcrf,tian,cowboy1,hippie,chimera,ting,alex123,02021985,mickey1,corsair,sonoma,aaron1,xxxpass,bacchus,webmaste,chuo,xyz123,chrysler,spurs1,artem,shei,cosmic,01020304,deutsch,gabriel1,123455,oceans,987456321,binladen,latinas,a12345678,speedo,buttercu,02081989,21031988,merlot,millwall,ceng,kotaku,jiong,dragonba,2580,stonecold,snuffy,01011999,02011986,hellos,blaze,maggie1,slapper,istanbul,bonjovi,babylove,mazda,bullfrog,phoeni,meng,porsche1,nomore,02061989,bobdylan,capslock,orion1,zaraza,teddybear,ntktajy,myname,rong,wraith,mets,niao,02041984,smokie,chevrolet,dialog,gfhjkmgfhjkm,dotcom,vadim,monarch,athlon,mikey1,hamish,pian,liang,coolness,chui,thoma,ramones,ciccio,chippy,eddie1,house1,ning,marker,cougars,jackpot,barbados,reds,pdtplf,knockers,cobalt,amateurs,dipshit,napoli,kilroy,pulsar,jayhawks,daemon,alexey,weng,shuang,9293709b13,shiner,eldorado,soulmate,mclaren,golfer1,andromed,duan,50spanks,sexyboy,dogshit,02021983,shuo,kakashka,syzygy,111111a,yeahbaby,qiang,netscape,fulham,120676,gooner,zhui,rainbow6,laurent,dog123,halifax,freeway,carlitos,147963,eastwood,microphone,monkey12,1123,persik,coldbeer,geng,nuan,danny1,fgtkmcby,entropy,gadget,just4fun,sophi,baggio,carlito,1234567891,02021989,02041983,specialk,piramida,suan,bigblue,salasana,hopeful,mephisto,bailey1,hack,annie1,generic,violetta,spencer1,arcadia,02051983,hondas,9562876,trainer,jones1,smashing,liao,159632,iceberg,rebel1,snooker,temp123,zang,matteo,fastball,q2w3e4r5,bamboo,fuckyo,shutup,astro,buddyboy,nikitos,redbird,maxxxx,shitface,02031987,kuai,kissmyass,sahara,radiohea,1234asdf,wildcard,maxwell1,patric,plasma,heynow,bruno1,shao,bigfish,misfits,sassy1,sheng,02011988,02081986,testpass,nanook,cygnus,licking,slavik,pringles,xing,1022,ninja1,submit,dundee,tiburon,pinkfloyd,yummy,shuai,guang,chopin,obelix,insomnia,stroker,1a2s3d4f,1223,playboy1,lazarus,jorda,spider1,homerj,sleeper,02041982,darklord,cang,02041988,02041987,tripod,magician,jelly,telephon,15975,vsjasnel12,pasword,iverson3,pavlov,homeboy,gamecock,amigo,brodie,budapest,yjdsqgfhjkm,reckless,02011980,pang,tiger123,2469,mason1,orient,01011979,zong,cdtnbr,maksimka,1011,bushido,taxman,giorgio,sphinx,kazantip,02101984,concorde,verizon,lovebug,georg,sam123,seadoo,qazwsxedc123,jiao,jezebel,pharmacy,abnormal,jellybea,maxime,puffy,islander,bunnies,jiggaman,drakon,010180,pluto,zhjckfd,12365,classics,crusher,mordor,hooligan,strawberry,02081985,scrabble,hawaii50,1224,wg8e3wjf,cthtuf,premium,arrow,123456qwe,mazda626,ramrod,tootie,rhjrjlbk,ghost1,1211,bounty,niang,02071984,goat,killer12,sweetnes,porno1,masamune,426hemi,corolla,mariposa,hjccbz,doomsday,bummer,blue12,zhao,bird33,excalibur,samsun,kirsty,buttfuck,kfhbcf,zhuo,marcello,ozzy,02021982,dynamite,655321,master12,123465,lollypop,stepan,1qa2ws,spiker,goirish,callum,michael2,moonbeam,attila,henry1,lindros,andrea1,sporty,lantern,12365478,nextel,violin,volcom,998877,water1,imation,inspiron,dynamo,citadel,placebo,clowns,tiao,02061988,tripper,dabears,haggis,merlin1,02031985,anthrax,amerika,iloveme,vsegda,burrito,bombers,snowboard,forsaken,katarina,a1a2a3,woofer,tigger2,fullmoon,tiger2,spock,hannah1,snoopy1,sexxxy,sausages,stanislav,cobain,robotics,exotic,green123,mobydick,senators,pumpkins,fergus,asddsa,147741,258852,windsurf,reddevil,vfitymrf,nevermind,nang,woodland,4417,mick,shui,q1q2q3,wingman,69696,superb,zuan,ganesh,pecker,zephyr,anastasiya,icu812,larry1,02081982,broker,zalupa,mihail,vfibyf,dogger,7007,paddle,varvara,schalke,1z2x3c,presiden,yankees2,tuning,poopy,02051982,concord,vanguard,stiffy,rjhjktdf,felix1,wrench,firewall,boxer,bubba69,popper,02011984,temppass,gobears,cuan,tipper,fuckme1,kamila,thong,puss,bigcat,drummer1,02031982,sowhat,digimon,tigers1,rang,jingle,bian,uranus,soprano,mandy1,dusty1,fandango,aloha,pumpkin1,postman,02061980,dogcat,bombay,pussy123,onetwo,highheel,pippo,julie1,laura1,pepito,beng,smokey1,stylus,stratus,reload,duckie,karen1,jimbo1,225588,369258,krusty,snappy,asdf12,electro,111qqq,kuang,fishin,clit,abstr,christma,qqqqq1,1234560,carnage,guyver,boxers,kittens,zeng,1000000,qwerty11,toaster,cramps,yugioh,02061987,icehouse,zxcvbnm123,pineapple,namaste,harrypotter,mygirl,falcon1,earnhard,fender1,spikes,nutmeg,01081989,dogboy,02091983,369852,softail,mypassword,prowler,bigboss,1112,harvest,heng,jubilee,killjoy,basset,keng,zaqxswcde,redsox1,biao,titan,misfit99,robot,wifey,kidrock,02101987,gameboy,enrico,1z2x3c4v,broncos1,arrows,havana,banger,cookie1,chriss,123qw,platypus,cindy1,lumber,pinball,foxy,london1,1023,05051987,02041985,password12,superma,longbow,radiohead,nigga,12051988,spongebo,qwert12345,abrakadabra,dodgers1,02101989,chillin,niceguy,pistons,hookup,santafe,bigben,jets,1013,vikings1,mankind,viktoriya,beardog,hammer1,02071980,reddwarf,magelan,longjohn,jennife,gilles,carmex2,02071987,stasik,bumper,doofus,slamdunk,pixies,garion,steffi,alessandro,beerman,niceass,warrior1,honolulu,134679852,visa,johndeer,mother1,windmill,boozer,oatmeal,aptiva,busty,delight,tasty,slick1,bergkamp,badgers,guitars,puffin,02091981,nikki1,irishman,miller1,zildjian,123000,airwolf,magnet,anai,install,02041981,02061983,astra,romans,megan1,mudvayne,freebird,muscles,dogbert,02091980,02091984,snowflak,01011900,mang,joseph1,nygiants,playstat,junior1,vjcrdf,qwer12,webhompas,giraffe,pelican,jefferso,comanche,bruiser,monkeybo,kjkszpj,123456l,micro,albany,02051987,angel123,epsilon,aladin,death666,hounddog,josephin,altima,chilly,02071988,78945,ultra,02041979,gasman,thisisit,pavel,idunno,kimmie,05051985,paulie,ballin,medion,moondog,manolo,pallmall,climber,fishbone,genesis1,153624,toffee,tbone,clippers,krypton,jerry1,picturs,compass,111111q,02051988,1121,02081977,sairam,getout,333777,cobras,22041987,bigblock,severin,booster,norwich,whiteout,ctrhtn,123456m,02061984,hewlett,shocker,fuckinside,02031981,chase1,white1,versace,123456789s,basebal,iloveyou2,bluebell,08031986,anthon,stubby,foreve,undertak,werder,saiyan,mama123,medic,chipmunk,mike123,mazdarx7,qwe123qwe,bowwow,kjrjvjnbd,celeb,choochoo,demo,lovelife,02051984,colnago,lithium,02051989,15051981,zzzxxx,welcom,anastasi,fidelio,franc,26061987,roadster,stone55,drifter,hookem,hellboy,1234qw,cbr900rr,sinned,good123654,storm1,gypsy,zebra,zachary1,toejam,buceta,02021979,testing1,redfox,lineage,mike1,highbury,koroleva,nathan1,washingt,02061982,02091985,vintage,redbaron,dalshe,mykids,11051987,macbeth,julien,james123,krasotka,111000,10011986,987123,pipeline,tatarin,sensei,codered,komodo,frogman,7894561230,nascar24,juicy,01031988,redrose,mydick,pigeon,tkbpfdtnf,smirnoff,1215,spam,winner1,flyfish,moskva,81fukkc,21031987,olesya,starligh,summer99,13041988,fishhead,freesex,super12,06061986,azazel,scoobydoo,02021981,cabron,yogibear,sheba1,konstantin,tranny,chilli,terminat,ghbywtccf,slowhand,soccer12,cricket1,fuckhead,1002,seagull,achtung,blam,bigbob,bdsm,nostromo,survivor,cnfybckfd,lemonade,boomer1,rainbow1,rober,irinka,cocksuck,peaches1,itsme,sugar1,zodiac,upyours,dinara,135791,sunny1,chiara,johnson1,02041989,solitude,habibi,sushi,markiz,smoke1,rockies,catwoman,johnny1,qwerty7,bearcats,username,01011978,wanderer,ohshit,02101986,sigma,stephen1,paradigm,02011989,flanker,sanity,jsbach,spotty,bologna,fantasia,chevys,borabora,cocker,74108520,123ewq,12021988,01061990,gtnhjdbx,02071981,01011960,sundevil,3000gt,mustang6,gagging,maggi,armstron,yfnfkb,13041987,revolver,02021976,trouble1,madcat,jeremy1,jackass1,volkswag,30051985,corndog,pool6123,marines1,03041991,pizza1,piggy,sissy,02031979,sunfire,angelus,undead,24061986,14061991,wildbill,shinobi,45m2do5bs,123qwer,21011989,cleopatr,lasvega,hornets,amorcit,11081989,coventry,nirvana1,destin,sidekick,20061988,02081983,gbhfvblf,sneaky,bmw325,22021989,nfytxrf,sekret,kalina,zanzibar,hotone,qazws,wasabi,heidi1,highlander,blues1,hitachi,paolo,23041987,slayer1,simba1,02011981,tinkerbe,kieran,01121986,172839,boiler,1125,bluesman,waffle,asdfgh01,threesom,conan,1102,reflex,18011987,nautilus,everlast,fatty,vader1,01071986,cyborg,ghbdtn123,birddog,rubble,02071983,suckers,02021973,skyhawk,12qw12qw,dakota1,joebob,nokia6233,woodie,longdong,lamer,troll,ghjcnjgfhjkm,420000,boating,nitro,armada,messiah,1031,penguin1,02091989,americ,02071989,redeye,asdqwe123,07071987,monty1,goten,spikey,sonata,635241,tokiohotel,sonyericsson,citroen,compaq1,1812,umpire,belmont,jonny,pantera1,nudes,palmtree,14111986,fenway,bighead,razor,gryphon,andyod22,aaaaa1,taco,10031988,enterme,malachi,dogface,reptile,01041985,dindom,handball,marseille,candy1,19101987,torino,tigge,matthias,viewsoni,13031987,stinker,evangelion,24011985,123456123,rampage,sandrine,02081980,thecrow,astral,28041987,sprinter,private1,seabee,shibby,02101988,25081988,fearless,junkie,01091987,aramis,antelope,draven,fuck1,mazda6,eggman,02021990,barselona,buddy123,19061987,fyfnjkbq,nancy1,12121990,10071987,sluggo,kille,hotties,irishka,zxcasdqwe123,shamus,fairlane,honeybee,soccer10,13061986,fantomas,17051988,10051987,20111986,gladiato,karachi,gambler,gordo,01011995,biatch,matthe,25800852,papito,excite,buffalo1,bobdole,cheshire,player1,28021992,thewho,10101986,pinky1,mentor,tomahawk,brown1,03041986,bismillah,bigpoppa,ijrjkfl,01121988,runaway,08121986,skibum,studman,helper,squeak,holycow,manfred,harlem,glock,gideon,987321,14021985,yellow1,wizard1,margarit,success1,medved,sf49ers,lambda,pasadena,johngalt,quasar,1776,02031980,coldplay,amand,playa,bigpimp,04041991,capricorn,elefant,sweetness,bruce1,luca,dominik,10011990,biker,09051945,datsun,elcamino,trinitro,malice,audi,voyager1,02101983,joe123,carpente,spartan1,mario1,glamour,diaper,12121985,22011988,winter1,asimov,callisto,nikolai,pebble,02101981,vendetta,david123,boytoy,11061985,02031989,iloveyou1,stupid1,cayman,casper1,zippo,yamahar1,wildwood,foxylady,calibra,02041980,27061988,dungeon,leedsutd,30041986,11051990,bestbuy,antares,dominion,24680,01061986,skillet,enforcer,derparol,01041988,196969,29071983,f00tball,purple1,mingus,25031987,21031990,remingto,giggles,klaste,3x7pxr,01011994,coolcat,29051989,megane,20031987,02051980,04041988,synergy,0000007,macman,iforget,adgjmp,vjqgfhjkm,28011987,rfvfcenhf,16051989,25121987,16051987,rogue,mamamia,08051990,20091991,1210,carnival,bolitas,paris1,dmitriy,dimas,05051989,papillon,knuckles,29011985,hola,tophat,28021990,100500,cutiepie,devo,415263,ducks,ghjuhfvvf,asdqwe,22021986,freefall,parol,02011983,zarina,buste,vitamin,warez,bigones,17061988,baritone,jamess,twiggy,mischief,bitchy,hetfield,1003,dontknow,grinch,sasha_007,18061990,12031985,12031987,calimero,224466,letmei,15011987,acmilan,alexandre,02031977,08081988,whiteboy,21051991,barney1,02071978,money123,18091985,bigdawg,02031988,cygnusx1,zoloto,31011987,firefigh,blowfish,screamer,lfybbk,20051988,chelse,11121986,01031989,harddick,sexylady,30031988,02041974,auditt,pizdec,kojak,kfgjxrf,20091988,123456ru,wp2003wp,1204,15051990,slugger,kordell1,03031986,swinging,01011974,02071979,rockie,dimples,1234123,1dragon,trucking,rusty2,roger1,marijuana,kerouac,02051978,08031985,paco,thecure,keepout,kernel,noname123,13121985,francisc,bozo,02011982,22071986,02101979,obsidian,12345qw,spud,tabasco,02051985,jaguars,dfktynby,kokomo,popova,notused,sevens,4200,magneto,02051976,roswell,15101986,21101986,lakeside,bigbang,aspen,little1,14021986,loki,suckmydick,strawber,carlos1,nokian73,dirty1,joshu,25091987,16121987,02041975,advent,17011987,slimshady,whistler,10101990,stryker,22031984,15021985,01031985,blueball,26031988,ksusha,bahamut,robocop,w_pass,chris123,impreza,prozac,bookie,bricks,13021990,alice1,cassandr,11111q,john123,4ever,korova,02051973,142857,25041988,paramedi,eclipse1,salope,07091990,1124,darkangel,23021986,999666,nomad,02051981,smackdow,01021990,yoyoma,argentin,moonligh,57chevy,bootys,hardone,capricor,galant,spanker,dkflbr,24111989,magpies,krolik,21051988,cevthrb,cheddar,22041988,bigbooty,scuba1,qwedsa,duffman,bukkake,acura,johncena,sexxy,p@ssw0rd,258369,cherries,12345s,asgard,leopold,fuck123,mopar,lalakers,dogpound,matrix1,crusty,spanner,kestrel,fenris,universa,peachy,assasin,lemmein,eggplant,hejsan,canucks,wendy1,doggy1,aikman,tupac,turnip,godlike,fussball,golden1,19283746,april1,django,petrova,captain1,vincent1,ratman,taekwondo,chocha,serpent,perfect1,capetown,vampir,amore,gymnast,timeout,nbvjatq,blue32,ksenia,k.lvbkf,nazgul,budweiser,clutch,mariya,sylveste,02051972,beaker,cartman1,q11111,sexxx,forever1,loser1,marseill,magellan,vehpbr,sexgod,jktxrf,hallo123,132456,liverpool1,southpaw,seneca,camden,357159,camero,tenchi,johndoe,145236,roofer,741963,vlad,02041978,fktyrf,zxcv123,wingnut,wolfpac,notebook,pufunga7782,brandy1,biteme1,goodgirl,redhat,02031978,challeng,millenium,hoops,maveric,noname,angus1,gaell,onion,olympus,sabrina1,ricard,sixpack,gratis,gagged,camaross,hotgirls,flasher,02051977,bubba123,goldfing,moonshin,gerrard,volkov,sonyfuck,mandrake,258963,tracer,lakers1,asians,susan1,money12,helmut,boater,diablo2,1234zxcv,dogwood,bubbles1,happy2,randy1,aries,beach1,marcius2,navigator,goodie,hellokitty,fkbyjxrf,earthlink,lookout,jumbo,opendoor,stanley1,marie1,12345m,07071977,ashle,wormix,murzik,02081976,lakewood,bluejays,loveya,commande,gateway2,peppe,01011976,7896321,goth,oreo,slammer,rasmus,faith1,knight1,stone1,redskin,ironmaiden,gotmilk,destiny1,dejavu,1master,midnite,timosha,espresso,delfin,toriamos,oberon,ceasar,markie,1a2s3d,ghhh47hj7649,vjkjrj,daddyo,dougie,disco,auggie,lekker,therock1,ou8123,start1,noway,p4ssw0rd,shadow12,333444,saigon,2fast4u,capecod,23skidoo,qazxcv,beater,bremen,aaasss,roadrunner,peace1,12345qwer,02071975,platon,bordeaux,vbkfirf,135798642,test12,supernov,beatles1,qwert40,optimist,vanessa1,prince1,ilovegod,nightwish,natasha1,alchemy,bimbo,blue99,patches1,gsxr1000,richar,hattrick,hott,solaris,proton,nevets,enternow,beavis1,amigos,159357a,ambers,lenochka,147896,suckdick,shag,intercourse,blue1234,spiral,02061977,tosser,ilove,02031975,cowgirl,canuck,q2w3e4,munch,spoons,waterboy,123567,evgeniy,savior,zasada,redcar,mamacita,terefon,globus,doggies,htubcnhfwbz,1008,cuervo,suslik,azertyui,limewire,houston1,stratfor,steaua,coors,tennis1,12345qwerty,stigmata,derf,klondike,patrici,marijuan,hardball,odyssey,nineinch,boston1,pass1,beezer,sandr,charon,power123,a1234,vauxhall,875421,awesome1,reggae,boulder,funstuff,iriska,krokodil,rfntymrf,sterva,champ1,bball,peeper,m123456,toolbox,cabernet,sheepdog,magic32,pigpen,02041977,holein1,lhfrjy,banan,dabomb,natalie1,jennaj,montana1,joecool,funky,steven1,ringo,junio,sammy123,qqqwww,baltimor,footjob,geezer,357951,mash4077,cashmone,pancake,monic,grandam,bongo,yessir,gocubs,nastia,vancouve,barley,dragon69,watford,ilikepie,02071976,laddie,123456789m,hairball,toonarmy,pimpdadd,cvthnm,hunte,davinci,lback,sophie1,firenze,q1234567,admin1,bonanza,elway7,daman,strap,azert,wxcvbn,afrika,theforce,123456t,idefix,wolfen,houdini,scheisse,default,beech,maserati,02061976,sigmachi,dylan1,bigdicks,eskimo,mizzou,02101976,riccardo,egghead,111777,kronos,ghbrjk,chaos1,jomama,rfhnjirf,rodeo,dolemite,cafc91,nittany,pathfind,mikael,password9,vqsablpzla,purpl,gabber,modelsne,myxworld,hellsing,punker,rocknrol,fishon,fuck69,02041976,lolol,twinkie,tripleh,cirrus,redbone,killer123,biggun,allegro,gthcbr,smith1,wanking,bootsy,barry1,mohawk,koolaid,5329,futurama,samoht,klizma,996633,lobo,honeys,peanut1,556677,zxasqw,joemama,javelin,samm,223322,sandra1,flicks,montag,nataly,3006,tasha1,1235789,dogbone,poker1,p0o9i8u7,goodday,smoothie,toocool,max333,metroid,archange,vagabond,billabon,22061941,tyson1,02031973,darkange,skateboard,evolutio,morrowind,wizards,frodo1,rockin,cumslut,plastics,zaqwsxcde,5201314,doit,outback,bumble,dominiqu,persona,nevermore,alinka,02021971,forgetit,sexo,all4one,c2h5oh,petunia,sheeba,kenny1,elisabet,aolsucks,woodstoc,pumper,02011975,fabio,granada,scrapper,123459,minimoni,q123456789,breaker,1004,02091976,ncc74656,slimshad,friendster,austin31,wiseguy,donner,dilbert1,132465,blackbird,buffet,jellybean,barfly,behappy,01011971,carebear,fireblad,02051975,boxcar,cheeky,kiteboy,hello12,panda1,elvisp,opennow,doktor,alex12,02101977,pornking,flamengo,02091975,snowbird,lonesome,robin1,11111a,weed420,baracuda,bleach,12345abc,nokia1,metall,singapor,mariner,herewego,dingo,tycoon,cubs,blunts,proview,123456789d,kamasutra,lagnaf,vipergts,navyseal,starwar,masterbate,wildone,peterbil,cucumber,butkus,123qwert,climax,deniro,gotribe,cement,scooby1,summer69,harrier,shodan,newyear,02091977,starwars1,romeo1,sedona,harald,doubled,sasha123,bigguns,salami,awnyce,kiwi,homemade,pimping,azzer,bradley1,warhamme,linkin,dudeman,qwe321,pinnacle,maxdog,flipflop,lfitymrf,fucker1,acidburn,esquire,sperma,fellatio,jeepster,thedon,sexybitch,pookey,spliff,widget,vfntvfnbrf,trinity1,mutant,samuel1,meliss,gohome,1q2q3q,mercede,comein,grin,cartoons,paragon,henrik,rainyday,pacino,senna,bigdog1,alleycat,12345qaz,narnia,mustang2,tanya1,gianni,apollo11,wetter,clovis,escalade,rainbows,freddy1,smart1,daisydog,s123456,cocksucker,pushkin,lefty,sambo,fyutkjxtr,hiziad,boyz,whiplash,orchard,newark,adrenalin,1598753,bootsie,chelle,trustme,chewy,golfgti,tuscl,ambrosia,5wr2i7h8,penetration,shonuf,jughead,payday,stickman,gotham,kolokol,johnny5,kolbasa,stang,puppydog,charisma,gators1,mone,jakarta,draco,nightmar,01011973,inlove,laetitia,02091973,tarpon,nautica,meadow,0192837465,luckyone,14881488,chessie,goldeney,tarakan,69camaro,bungle,wordup,interne,fuckme2,515000,dragonfl,sprout,02081974,gerbil,bandit1,02071971,melanie1,phialpha,camber,kathy1,adriano,gonzo1,10293847,bigjohn,bismarck,7777777a,scamper,12348765,rabbits,222777,bynthytn,dima123,alexander1,mallorca,dragster,favorite6,beethove,burner,cooper1,fosters,hello2,normandy,777999,sebring,1michael,lauren1,blake1,killa,02091971,nounours,trumpet1,thumper1,playball,xantia,rugby1,rocknroll,guillaum,angela1,strelok,prosper,buttercup,masterp,dbnfkbr,cambridg,venom,treefrog,lumina,1234566,supra,sexybabe,freee,shen,frogs,driller,pavement,grace1,dicky,checker,smackdown,pandas,cannibal,asdffdsa,blue42,zyjxrf,nthvbyfnjh,melrose,neon,jabber,gamma,369258147,aprilia,atticus,benessere,catcher,skipper1,azertyuiop,sixty9,thierry,treetop,jello,melons,123456789qwe,tantra,buzzer,catnip,bouncer,computer1,sexyone,ananas,young1,olenka,sexman,mooses,kittys,sephiroth,contra,hallowee,skylark,sparkles,777333,1qazxsw23edc,lucas1,q1w2e3r,gofast,hannes,amethyst,ploppy,flower2,hotass,amatory,volleyba,dixie1,bettyboo,ticklish,02061974,frenchy,phish1,murphy1,trustno,02061972,leinad,mynameis,spooge,jupiter1,hyundai,frosch,junkmail,abacab,marbles,32167,casio,sunshine1,wayne1,longhair,caster,snicker,02101973,gannibal,skinhead,hansol,gatsby,segblue2,montecar,plato,gumby,kaboom,matty,bosco1,888999,jazzy,panter,jesus123,charlie2,giulia,candyass,sex69,travis1,farmboy,special1,02041973,letsdoit,password01,allison1,abcdefg1,notredam,ilikeit,789654123,liberty1,rugger,uptown,alcatraz,123456w,airman,007bond,navajo,kenobi,terrier,stayout,grisha,frankie1,fluff,1qazzaq1,1234561,virginie,1234568,tango1,werdna,octopus,fitter,dfcbkbcf,blacklab,115599,montrose,allen1,supernova,frederik,ilovepussy,justice1,radeon,playboy2,blubber,sliver,swoosh,motocros,lockdown,pearls,thebear,istheman,pinetree,biit,1234rewq,rustydog,tampabay,titts,babycake,jehovah,vampire1,streaming,collie,camil,fidelity,calvin1,stitch,gatit,restart,puppy1,budgie,grunt,capitals,hiking,dreamcas,zorro1,321678,riffraff,makaka,playmate,napalm,rollin,amstel,zxcvb123,samanth,rumble,fuckme69,jimmys,951357,pizzaman,1234567899,tralala,delpiero,alexi,yamato,itisme,1million,vfndtq,kahlua,londo,wonderboy,carrots,tazz,ratboy,rfgecnf,02081973,nico,fujitsu,tujhrf,sergbest,blobby,02051970,sonic1,1357911,smirnov,video1,panhead,bucky,02031974,44332211,duffer,cashmoney,left4dead,bagpuss,salman,01011972,titfuck,66613666,england1,malish,dresden,lemans,darina,zapper,123456as,123456qqq,met2002,02041972,redstar,blue23,1234509876,pajero,booyah,please1,tetsuo,semper,finder,hanuman,sunlight,123456n,02061971,treble,cupoi,password99,dimitri,3ip76k2,popcorn1,lol12345,stellar,nympho,shark1,keith1,saskia,bigtruck,revoluti,rambo1,asd222,feelgood,phat,gogators,bismark,cola,puck,furball,burnout,slonik,bowtie,mommy1,icecube,fabienn,mouser,papamama,rolex,giants1,blue11,trooper1,momdad,iklo,morten,rhubarb,gareth,123456d,blitz,canada1,r2d2,brest,tigercat,usmarine,lilbit,benny1,azrael,lebowski,12345r,madagaskar,begemot,loverman,dragonballz,italiano,mazda3,naughty1,onions,diver1,cyrano,capcom,asdfg123,forlife,fisherman,weare138,requiem,mufasa,alpha123,piercing,hellas,abracadabra,duckman,caracas,macintos,02011971,jordan2,crescent,fduecn,hogtied,eatmenow,ramjet,18121812,kicksass,whatthe,discus,rfhfvtkmrf,rufus1,sqdwfe,mantle,vegitto,trek,dan123,paladin1,rudeboy,liliya,lunchbox,riversid,acapulco,libero,dnsadm,maison,toomuch,boobear,hemlock,sextoy,pugsley,misiek,athome,migue,altoids,marcin,123450,rhfcfdbwf,jeter2,rhinos,rjhjkm,mercury1,ronaldinho,shampoo,makayla,kamilla,masterbating,tennesse,holger,john1,matchbox,hores,poptart,parlament,goodyear,asdfgh1,02081970,hardwood,alain,erection,hfytnrb,highlife,implants,benjami,dipper,jeeper,bendover,supersonic,babybear,laserjet,gotenks,bama,natedogg,aol123,pokemo,rabbit1,raduga,sopranos,cashflow,menthol,pharao,hacking,334455,ghjcnbnenrf,lizzy,muffin1,pooky,penis1,flyer,gramma,dipset,becca,ireland1,diana1,donjuan,pong,ziggy1,alterego,simple1,cbr900,logger,111555,claudia1,cantona7,matisse,ljxtymrf,victori,harle,mamas,encore,mangos,iceman1,diamon,alexxx,tiamat,5000,desktop,mafia,smurf,princesa,shojou,blueberr,welkom,maximka,123890,123q123,tammy1,bobmarley,clips,demon666,ismail,termite,laser1,missie,altair,donna1,bauhaus,trinitron,mogwai,flyers88,juniper,nokia5800,boroda,jingles,qwerasdfzxcv,shakur,777666,legos,mallrats,1qazxsw,goldeneye,tamerlan,julia1,backbone,spleen,49ers,shady,darkone,medic1,justi,giggle,cloudy,aisan,douche,parkour,bluejay,huskers1,redwine,1qw23er4,satchmo,1231234,nineball,stewart1,ballsack,probes,kappa,amiga,flipper1,dortmund,963258,trigun,1237895,homepage,blinky,screwy,gizzmo,belkin,chemist,coolhand,chachi,braves1,thebest,greedisgood,pro100,banana1,101091m,123456g,wonderfu,barefeet,8inches,1111qqqq,kcchiefs,qweasdzxc123,metal1,jennifer1,xian,asdasd123,pollux,cheerleaers,fruity,mustang5,turbos,shopper,photon,espana,hillbill,oyster,macaroni,gigabyte,jesper,motown,tuxedo,buster12,triplex,cyclones,estrell,mortis,holla,456987,fiddle,sapphic,jurassic,thebeast,ghjcnjq,baura,spock1,metallica1,karaoke,nemrac58,love1234,02031970,flvbybcnhfnjh,frisbee,diva,ajax,feathers,flower1,soccer11,allday,mierda,pearl1,amature,marauder,333555,redheads,womans,egorka,godbless,159263,nimitz,aaaa1111,sashka,madcow,socce,greywolf,baboon,pimpdaddy,123456789r,reloaded,lancia,rfhfylfi,dicker,placid,grimace,22446688,olemiss,whores,culinary,wannabe,maxi,1234567aa,amelie,riley1,trample,phantom1,baberuth,bramble,asdfqwer,vides,4you,abc123456,taichi,aztnm,smother,outsider,hakr,blackhawk,bigblack,girlie,spook,valeriya,gianluca,freedo,1q2q3q4q,handbag,lavalamp,cumm,pertinant,whatup,nokia123,redlight,patrik,111aaa,poppy1,dfytxrf,aviator,sweeps,kristin1,cypher,elway,yinyang,access1,poophead,tucson,noles1,monterey,waterfal,dank,dougal,918273,suede,minnesot,legman,bukowski,ganja,mammoth,riverrat,asswipe,daredevi,lian,arizona1,kamikadze,alex1234,smile1,angel2,55bgates,bellagio,0001,wanrltw,stiletto,lipton,arsena,biohazard,bbking,chappy,tetris,as123456,darthvad,lilwayne,nopassword,7412369,123456789987654321,natchez,glitter,14785236,mytime,rubicon,moto,pyon,wazzup,tbird,shane1,nightowl,getoff,beckham7,trueblue,hotgirl,nevermin,deathnote,13131,taffy,bigal,copenhag,apricot,gallaries,dtkjcbgtl,totoro,onlyone,civicsi,jesse1,baby123,sierra1,festus,abacus,sickboy,fishtank,fungus,charle,golfpro,teensex,mario66,seaside,aleksei,rosewood,blackberry,1020304050,bedlam,schumi,deerhunt,contour,darkelf,surveyor,deltas,pitchers,741258963,dipstick,funny1,lizzard,112233445566,jupiter2,softtail,titman,greenman,z1x2c3v4b5,smartass,12345677,notnow,myworld,nascar1,chewbacc,nosferatu,downhill,dallas22,kuan,blazers,whales,soldat,craving,powerman,yfcntyf,hotrats,cfvceyu,qweasdzx,princess1,feline,qqwwee,chitown,1234qaz,mastermind,114477,dingbat,care1839,standby,kismet,atreides,dogmeat,icarus,monkeyboy,alex1,mouses,nicetits,sealteam,chopper1,crispy,winter99,rrpass1,myporn,myspace1,corazo,topolino,ass123,lawman,muffy,orgy,1love,passord,hooyah,ekmzyf,pretzel,amonra,nestle,01011950,jimbeam,happyman,z12345,stonewal,helios,manunited,harcore,dick1,gaymen,2hot4u,light1,qwerty13,kakashi,pjkjnj,alcatel,taylo,allah,buddydog,ltkmaby,mongo,blonds,start123,audia6,123456v,civilwar,bellaco,turtles,mustan,deadspin,aaa123,fynjirf,lucky123,tortoise,amor,summe,waterski,zulu,drag0n,dtxyjcnm,gizmos,strife,interacial,pusyy,goose1,bear1,equinox,matri,jaguar1,tobydog,sammys,nachos,traktor,bryan1,morgoth,444555,dasani,miami1,mashka,xxxxxx1,ownage,nightwin,hotlips,passmast,cool123,skolko,eldiablo,manu,1357908642,screwyou,badabing,foreplay,hydro,kubrick,seductive,demon1,comeon,galileo,aladdin,metoo,happines,902100,mizuno,caddy,bizzare,girls1,redone,ohmygod,sable,bonovox,girlies,hamper,opus,gizmodo1,aaabbb,pizzahut,999888,rocky2,anton1,kikimora,peavey,ocelot,a1a2a3a4,2wsx3edc,jackie1,solace,sprocket,galary,chuck1,volvo1,shurik,poop123,locutus,virago,wdtnjxtr,tequier,bisexual,doodles,makeitso,fishy,789632145,nothing1,fishcake,sentry,libertad,oaktree,fivestar,adidas1,vegitta,mississi,spiffy,carme,neutron,vantage,agassi,boners,123456789v,hilltop,taipan,barrage,kenneth1,fister,martian,willem,lfybkf,bluestar,moonman,ntktdbpjh,paperino,bikers,daffy,benji,quake,dragonfly,suckcock,danilka,lapochka,belinea,calypso,asshol,camero1,abraxas,mike1234,womam,q1q2q3q4q5,youknow,maxpower,pic's,audi80,sonora,raymond1,tickler,tadpole,belair,crazyman,finalfantasy,999000,jonatha,paisley,kissmyas,morgana,monste,mantra,spunk,magic123,jonesy,mark1,alessand,741258,baddest,ghbdtnrfrltkf,zxccxz,tictac,augustin,racers,7grout,foxfire,99762000,openit,nathanie,1z2x3c4v5b,seadog,gangbanged,lovehate,hondacbr,harpoon,mamochka,fisherma,bismilla,locust,wally1,spiderman1,saffron,utjhubq,123456987,20spanks,safeway,pisser,bdfyjd,kristen1,bigdick1,magenta,vfhujif,anfisa,friday13,qaz123wsx,0987654321q,tyrant,guan,meggie,kontol,nurlan,ayanami,rocket1,yaroslav,websol76,mutley,hugoboss,websolutions,elpaso,gagarin,badboys,sephirot,918273645,newuser,qian,edcrfv,booger1,852258,lockout,timoxa94,mazda323,firedog,sokolova,skydiver,jesus777,1234567890z,soulfly,canary,malinka,guillerm,hookers,dogfart,surfer1,osprey,india123,rhjkbr,stoppedby,nokia5530,123456789o,blue1,werter,divers,3000,123456f,alpina,cali,whoknows,godspeed,986532,foreskin,fuzzy1,heyyou,didier,slapnuts,fresno,rosebud1,sandman1,bears1,blade1,honeybun,queen1,baronn,pakista,philipp,9111961,topsecret,sniper1,214365,slipper,letsfuck,pippen33,godawgs,mousey,qw123456,scrotum,loveis,lighthou,bp2002,nancy123,jeffrey1,susieq,buddy2,ralphie,trout1,willi,antonov,sluttey,rehbwf,marty1,darian,losangeles,letme1n,12345d,pusssy,godiva,ender,golfnut,leonidas,a1b2c3d4e5,puffer,general1,wizzard,lehjxrf,racer1,bigbucks,cool12,buddys,zinger,esprit,vbienrf,josep,tickling,froggie,987654321a,895623,daddys,crumbs,gucci,mikkel,opiate,tracy1,christophe,came11,777555,petrovich,humbug,dirtydog,allstate,horatio,wachtwoord,creepers,squirts,rotary,bigd,georgia1,fujifilm,2sweet,dasha,yorkie,slimjim,wiccan,kenzie,system1,skunk,b12345,getit,pommes,daredevil,sugars,bucker,piston,lionheart,1bitch,515051,catfight,recon,icecold,fantom,vodafone,kontakt,boris1,vfcnth,canine,01011961,valleywa,faraon,chickenwing101,qq123456,livewire,livelife,roosters,jeepers,ilya1234,coochie,pavlik,dewalt,dfhdfhf,architec,blackops,1qaz2wsx3edc4rfv,rhfcjnf,wsxedc,teaser,sebora,25252,rhino1,ankara,swifty,decimal,redleg,shanno,nermal,candies,smirnova,dragon01,photo1,ranetki,a1s2d3f4g5,axio,wertzu,maurizio,6uldv8,zxcvasdf,punkass,flowe,graywolf,peddler,3rjs1la7qe,mpegs,seawolf,ladyboy,pianos,piggies,vixen,alexus,orpheus,gdtrfb,z123456,macgyver,hugetits,ralph1,flathead,maurici,mailru,goofball,nissan1,nikon,stopit,odin,big1,smooch,reboot,famil,bullit,anthony7,gerhard,methos,124038,morena,eagle2,jessica2,zebras,getlost,gfynthf,123581321,sarajevo,indon,comets,tatjana,rfgbnjirf,joystick,batman12,123456c,sabre,beerme,victory1,kitties,1475369,badboy1,booboo1,comcast,slava,squid,saxophon,lionhear,qaywsx,bustle,nastena,roadway,loader,hillside,starlight,24681012,niggers,access99,bazooka,molly123,blackice,bandi,cocacol,nfhfrfy,timur,muschi,horse1,quant4307s,squerting,oscars,mygirls,flashman,tangerin,goofy1,p0o9i8,housewifes,newness,monkey69,escorpio,password11,hippo,warcraft3,qazxsw123,qpalzm,ribbit,ghbdtndctv,bogota,star123,258000,lincoln1,bigjim,lacoste,firestorm,legenda,indain,ludacris,milamber,1009,evangeli,letmesee,a111111,hooters1,bigred1,shaker,husky,a4tech,cnfkrth,argyle,rjhjdf,nataha,0o9i8u7y,gibson1,sooners1,glendale,archery,hoochie,stooge,aaaaaa1,scorpions,school1,vegas1,rapier,mike23,bassoon,groupd2013,macaco,baker1,labia,freewill,santiag,silverado,butch1,vflfufcrfh,monica1,rugrat,cornhole,aerosmit,bionicle,gfgfvfvf,daniel12,virgo,fmale,favorite2,detroit1,pokey,shredder,baggies,wednesda,cosmo1,mimosa,sparhawk,firehawk,romario,911turbo,funtimes,fhntvrf,nexus6,159753456,timothy1,bajingan,terry1,frenchie,raiden,1mustang,babemagnet,74123698,nadejda,truffles,rapture,douglas1,lamborghini,motocross,rjcvjc,748596,skeeter1,dante1,angel666,telecom,carsten,pietro,bmw318,astro1,carpediem,samir,orang,helium,scirocco,fuzzball,rushmore,rebelz,hotspur,lacrimosa,chevys10,madonna1,domenico,yfnfirf,jachin,shelby1,bloke,dawgs,dunhill,atlanta1,service1,mikado,devilman,angelit,reznor,euphoria,lesbain,checkmat,browndog,phreak,blaze1,crash1,farida,mutter,luckyme,horsemen,vgirl,jediknig,asdas,cesare,allnight,rockey,starlite,truck1,passfan,close-up,samue,cazzo,wrinkles,homely,eatme1,sexpot,snapshot,dima1995,asthma,thetruth,ducky,blender,priyanka,gaucho,dutchman,sizzle,kakarot,651550,passcode,justinbieber,666333,elodie,sanjay,110442,alex01,lotus1,2300mj,lakshmi,zoomer,quake3,12349876,teapot,12345687,ramada,pennywis,striper,pilot1,chingon,optima,nudity,ethan1,euclid,beeline,loyola,biguns,zaq12345,bravo1,disney1,buffa,assmunch,vivid,6661313,wellingt,aqwzsx,madala11,9874123,sigmar,pictere,tiptop,bettyboop,dinero,tahiti,gregory1,bionic,speed1,fubar1,lexus1,denis1,hawthorn,saxman,suntzu,bernhard,dominika,camaro1,hunter12,balboa,bmw2002,seville,diablo1,vfhbyjxrf,1234abc,carling,lockerroom,punani,darth,baron1,vaness,1password,libido,picher,232425,karamba,futyn007,daydream,11001001,dragon123,friends1,bopper,rocky123,chooch,asslover,shimmer,riddler,openme,tugboat,sexy123,midori,gulnara,christo,swatch,laker,offroad,puddles,hackers,mannheim,manager1,horseman,roman1,dancer1,komputer,pictuers,nokia5130,ejaculation,lioness,123456y,evilone,nastenka,pushok,javie,lilman,3141592,mjolnir,toulouse,pussy2,bigworm,smoke420,fullback,extensa,dreamcast,belize,delboy,willie1,casablanca,csyjxtr,ricky1,bonghit,salvator,basher,pussylover,rosie1,963258741,vivitron,cobra427,meonly,armageddon,myfriend,zardoz,qwedsazxc,kraken,fzappa,starfox,333999,illmatic,capoeira,weenie,ramzes,freedom2,toasty,pupkin,shinigami,fhvfutljy,nocturne,churchil,thumbnils,tailgate,neworder,sexymama,goarmy,cerebus,michelle1,vbifyz,surfsup,earthlin,dabulls,basketbal,aligator,mojojojo,saibaba,welcome2,wifes,wdtnjr,12345w,slasher,papabear,terran,footman,hocke,153759,texans,tom123,sfgiants,billabong,aassdd,monolith,xxx777,l3tm31n,ticktock,newone,hellno,japanees,contortionist,admin123,scout1,alabama1,divx1,rochard,privat,radar1,bigdad,fhctybq,tortuga,citrus,avanti,fantasy1,woodstock,s12345,fireman1,embalmer,woodwork,bonzai,konyor,newstart,jigga,panorama,goats,smithy,rugrats,hotmama,daedalus,nonstop,fruitbat,lisenok,quaker,violator,12345123,my3sons,cajun,fraggle,gayboy,oldfart,vulva,knickerless,orgasms,undertow,binky,litle,kfcnjxrf,masturbation,bunnie,alexis1,planner,transexual,sparty,leeloo,monies,fozzie,stinger1,landrove,anakonda,scoobie,yamaha1,henti,star12,rfhlbyfk,beyonce,catfood,cjytxrf,zealots,strat,fordtruc,archangel,silvi,sativa,boogers,miles1,bigjoe,tulip,petite,greentea,shitter,jonboy,voltron,morticia,evanescence,3edc4rfv,longshot,windows1,serge,aabbcc,starbucks,sinful,drywall,prelude1,www123,camel1,homebrew,marlins,123412,letmeinn,domini,swampy,plokij,fordf350,webcam,michele1,bolivi,27731828,wingzero,qawsedrftg,shinji,sverige,jasper1,piper1,cummer,iiyama,gocats,amour,alfarome,jumanji,mike69,fantasti,1monkey,w00t88,shawn1,lorien,1a2s3d4f5g,koleso,murph,natascha,sunkist,kennwort,emine,grinder,m12345,q1q2q3q4,cheeba,money2,qazwsxedc1,diamante,prosto,pdiddy,stinky1,gabby1,luckys,franci,pornographic,moochie,gfhjdjp,samdog,empire1,comicbookdb,emili,motdepasse,iphone,braveheart,reeses,nebula,sanjose,bubba2,kickflip,arcangel,superbow,porsche911,xyzzy,nigger1,dagobert,devil1,alatam,monkey2,barbara1,12345v,vfpfafrf,alessio,babemagn,aceman,arrakis,kavkaz,987789,jasons,berserk,sublime1,rogue1,myspace,buckwhea,csyekz,pussy4me,vette1,boots1,boingo,arnaud,budlite,redstorm,paramore,becky1,imtheman,chango,marley1,milkyway,666555,giveme,mahalo,lux2000,lucian,paddy,praxis,shimano,bigpenis,creeper,newproject2004,rammstei,j3qq4h7h2v,hfljcnm,lambchop,anthony2,bugman,gfhjkm12,dreamer1,stooges,cybersex,diamant,cowboyup,maximus1,sentra,615243,goethe,manhatta,fastcar,selmer,1213141516,yfnfitymrf,denni,chewey,yankee1,elektra,123456789p,trousers,fishface,topspin,orwell,vorona,sodapop,motherfu,ibilltes,forall,kookie,ronald1,balrog,maximilian,mypasswo,sonny1,zzxxcc,tkfkdg,magoo,mdogg,heeled,gitara,lesbos,marajade,tippy,morozova,enter123,lesbean,pounded,asd456,fialka,scarab,sharpie,spanky1,gstring,sachin,12345asd,princeto,hellohel,ursitesux,billows,1234kekc,kombat,cashew,duracell,kseniya,sevenof9,kostik,arthur1,corvet07,rdfhnbhf,songoku,tiberian,needforspeed,1qwert,dropkick,kevin123,panache,libra,a123456a,kjiflm,vfhnsirf,cntgfy,iamcool,narut,buffer,sk8ordie,urlaub,fireblade,blanked,marishka,gemini1,altec,gorillaz,chief1,revival47,ironman1,space1,ramstein,doorknob,devilmaycry,nemesis1,sosiska,pennstat,monday1,pioner,shevchenko,detectiv,evildead,blessed1,aggie,coffees,tical,scotts,bullwink,marsel,krypto,adrock,rjitxrf,asmodeus,rapunzel,theboys,hotdogs,deepthro,maxpayne,veronic,fyyeirf,otter,cheste,abbey1,thanos,bedrock,bartok,google1,xxxzzz,rodent,montecarlo,hernande,mikayla,123456789l,bravehea,12locked,ltymub,pegasus1,ameteur,saltydog,faisal,milfnew,momsuck,everques,ytngfhjkz,m0nkey,businessbabe,cooki,custard,123456ab,lbvjxrf,outlaws,753357,qwerty78,udacha,insider,chees,fuckmehard,shotokan,katya,seahorse,vtldtlm,turtle1,mike12,beebop,heathe,everton1,darknes,barnie,rbcekz,alisher,toohot,theduke,555222,reddog1,breezy,bulldawg,monkeyman,baylee,losangel,mastermi,apollo1,aurelie,zxcvb12345,cayenne,bastet,wsxzaq,geibcnbr,yello,fucmy69,redwall,ladybird,bitchs,cccccc1,rktjgfnhf,ghjdthrf,quest1,oedipus,linus,impalass,fartman,12345k,fokker,159753a,optiplex,bbbbbb1,realtor,slipkno,santacru,rowdy,jelena,smeller,3984240,ddddd1,sexyme,janet1,3698741,eatme69,cazzone,today1,poobear,ignatius,master123,newpass1,heather2,snoopdogg,blondinka,pass12,honeydew,fuckthat,890098890,lovem,goldrush,gecko,biker1,llama,pendejo,avalanche,fremont,snowman1,gandolf,chowder,1a2b3c4d5e,flyguy,magadan,1fuck,pingvin,nokia5230,ab1234,lothar,lasers,bignuts,renee1,royboy,skynet,12340987,1122334,dragrace,lovely1,22334455,booter,12345612,corvett,123456qq,capital1,videoes,funtik,wyvern,flange,sammydog,hulkster,13245768,not4you,vorlon,omegared,l58jkdjp!,filippo,123mudar,samadams,petrus,chris12,charlie123,123456789123,icetea,sunderla,adrian1,123qweas,kazanova,aslan,monkey123,fktyeirf,goodsex,123ab,lbtest,banaan,bluenose,837519,asd12345,waffenss,whateve,1a2a3a4a,trailers,vfhbirf,bhbcrf,klaatu,turk182,monsoon,beachbum,sunbeam,succes,clyde1,viking1,rawhide,bubblegum,princ,mackenzi,hershey1,222555,dima55,niggaz,manatee,aquila,anechka,pamel,bugsbunn,lovel,sestra,newport1,althor,hornyman,wakeup,zzz111,phishy,cerber,torrent,thething,solnishko,babel,buckeye1,peanu,ethernet,uncencored,baraka,665544,chris2,rb26dett,willy1,choppers,texaco,biggirl,123456b,anna2614,sukebe,caralho,callofduty,rt6ytere,jesus7,angel12,1money,timelord,allblack,pavlova,romanov,tequiero,yitbos,lookup,bulls23,snowflake,dickweed,barks,lever,irisha,firestar,fred1234,ghjnjnbg,danman,gatito,betty1,milhouse,kbctyjr,masterbaiting,delsol,papit,doggys,123698741,bdfyjdf,invictus,bloods,kayla1,yourmama,apple2,angelok,bigboy1,pontiac1,verygood,yeshua,twins2,porn4me,141516,rasta69,james2,bosshog,candys,adventur,stripe,djkjlz,dokken,austin316,skins,hogwarts,vbhevbh,navigato,desperado,xxx666,cneltyn,vasiliy,hazmat,daytek,eightbal,fred1,four20,74227422,fabia,aerosmith,manue,wingchun,boohoo,hombre,sanity72,goatboy,fuckm,partizan,avrora,utahjazz,submarin,pussyeat,heinlein,control1,costaric,smarty,chuan,triplets,snowy,snafu,teacher1,vangogh,vandal,evergree,cochise,qwerty99,pyramid1,saab900,sniffer,qaz741,lebron23,mark123,wolvie,blackbelt,yoshi,feeder,janeway,nutella,fuking,asscock,deepak,poppie,bigshow,housewife,grils,tonto,cynthia1,temptress,irakli,belle1,russell1,manders,frank123,seabass,gforce,songbird,zippy1,naught,brenda1,chewy1,hotshit,topaz,43046721,girfriend,marinka,jakester,thatsme,planeta,falstaff,patrizia,reborn,riptide,cherry1,shuan,nogard,chino,oasis1,qwaszx12,goodlife,davis1,1911a1,harrys,shitfuck,12345678900,russian7,007700,bulls1,porshe,danil,dolphi,river1,sabaka,gobigred,deborah1,volkswagen,miamo,alkaline,muffdive,1letmein,fkbyrf,goodguy,hallo1,nirvan,ozzie,cannonda,cvbhyjdf,marmite,germany1,joeblow,radio1,love11,raindrop,159852,jacko,newday,fathead,elvis123,caspe,citibank,sports1,deuce,boxter,fakepass,golfman,snowdog,birthday4,nonmembe,niklas,parsifal,krasota,theshit,1235813,maganda,nikita1,omicron,cassie1,columbo,buick,sigma1,thistle,bassin,rickster,apteka,sienna,skulls,miamor,coolgirl,gravis,1qazxc,virgini,hunter2,akasha,batma,motorcyc,bambino,tenerife,fordf250,zhuan,iloveporn,markiza,hotbabes,becool,fynjybyf,wapapapa,forme,mamont,pizda,dragonz,sharon1,scrooge,mrbill,pfloyd,leeroy,natedog,ishmael,777111,tecumseh,carajo,nfy.irf,0000000000o,blackcock,fedorov,antigone,feanor,novikova,bobert,peregrin,spartan117,pumkin,rayman,manuals,tooltime,555333,bonethug,marina1,bonnie1,tonyhawk,laracroft,mahalkita,18273645,terriers,gamer,hoser,littlema,molotok,glennwei,lemon1,caboose,tater,12345654321,brians,fritz1,mistral,jigsaw,fuckshit,hornyguy,southside,edthom,antonio1,bobmarle,pitures,ilikesex,crafty,nexus,boarder,fulcrum,astonvil,yanks1,yngwie,account1,zooropa,hotlegs,sammi,gumbo,rover1,perkele,maurolarastefy,lampard,357753,barracud,dmband,abcxyz,pathfinder,335577,yuliya,micky,jayman,asdfg12345,1596321,halcyon,rerfhtre,feniks,zaxscd,gotyoass,jaycee,samson1,jamesb,vibrate,grandpri,camino,colossus,davidb,mamo4ka,nicky1,homer123,pinguin,watermelon,shadow01,lasttime,glider,823762,helen1,pyramids,tulane,osama,rostov,john12,scoote,bhbyrf,gohan,galeries,joyful,bigpussy,tonka,mowgli,astalavista,zzz123,leafs,dalejr8,unicorn1,777000,primal,bigmama,okmijn,killzone,qaz12345,snookie,zxcvvcxz,davidc,epson,rockman,ceaser,beanbag,katten,3151020,duckhunt,segreto,matros,ragnar,699669,sexsexse,123123z,fuckyeah,bigbutts,gbcmrf,element1,marketin,saratov,elbereth,blaster1,yamahar6,grime,masha,juneau,1230123,pappy,lindsay1,mooner,seattle1,katzen,lucent,polly1,lagwagon,pixie,misiaczek,666666a,smokedog,lakers24,eyeball,ironhors,ametuer,volkodav,vepsrf,kimmy,gumby1,poi098,ovation,1q2w3,drinker,penetrating,summertime,1dallas,prima,modles,takamine,hardwork,macintosh,tahoe,passthie,chiks,sundown,flowers1,boromir,music123,phaedrus,albert1,joung,malakas,gulliver,parker1,balder,sonne,jessie1,domainlock2005,express1,vfkbyf,youandme,raketa,koala,dhjnvytyjub,nhfrnjh,testibil,ybrbnjc,987654321q,axeman,pintail,pokemon123,dogggg,shandy,thesaint,11122233,x72jhhu3z,theclash,raptors,zappa1,djdjxrf,hell666,friday1,vivaldi,pluto1,lance1,guesswho,jeadmi,corgan,skillz,skippy1,mango1,gymnastic,satori,362514,theedge,cxfcnkbdfz,sparkey,deicide,bagels,lololol,lemmings,r4e3w2q1,silve,staind,schnuffi,dazzle,basebal1,leroy1,bilbo1,luckie,qwerty2,goodfell,hermione,peaceout,davidoff,yesterda,killah,flippy,chrisb,zelda1,headless,muttley,fuckof,tittys,catdaddy,photog,beeker,reaver,ram1500,yorktown,bolero,tryagain,arman,chicco,learjet,alexei,jenna1,go2hell,12s3t4p55,momsanaladventure,mustang9,protoss,rooter,ginola,dingo1,mojave,erica1,1qazse4,marvin1,redwolf,sunbird,dangerou,maciek,girsl,hawks1,packard1,excellen,dashka,soleda,toonces,acetate,nacked,jbond007,alligator,debbie1,wellhung,monkeyma,supers,rigger,larsson,vaseline,rjnzhf,maripos,123456asd,cbr600rr,doggydog,cronic,jason123,trekker,flipmode,druid,sonyvaio,dodges,mayfair,mystuff,fun4me,samanta,sofiya,magics,1ranger,arcane,sixtynin,222444,omerta,luscious,gbyudby,bobcats,envision,chance1,seaweed,holdem,tomate,mensch,slicer,acura1,goochi,qweewq,punter,repoman,tomboy,never1,cortina,gomets,147896321,369852147,dogma,bhjxrf,loglatin,eragon,strato,gazelle,growler,885522,klaudia,payton34,fuckem,butchie,scorpi,lugano,123456789k,nichola,chipper1,spide,uhbujhbq,rsalinas,vfylfhby,longhorns,bugatti,everquest,!qaz2wsx,blackass,999111,snakeman,p455w0rd,fanatic,family1,pfqxbr,777vlad,mysecret,marat,phoenix2,october1,genghis,panties1,cooker,citron,ace123,1234569,gramps,blackcoc,kodiak1,hickory,ivanhoe,blackboy,escher,sincity,beaks,meandyou,spaniel,canon1,timmy1,lancaste,polaroid,edinburg,fuckedup,hotman,cueball,golfclub,gopack,bookcase,worldcup,dkflbvbhjdbx,twostep,17171717aa,letsplay,zolushka,stella1,pfkegf,kingtut,67camaro,barracuda,wiggles,gjhjkm,prancer,patata,kjifhf,theman1,romanova,sexyass,copper1,dobber,sokolov,pomidor,algernon,cadman,amoremio,william2,silly1,bobbys,hercule,hd764nw5d7e1vb1,defcon,deutschland,robinhood,alfalfa,machoman,lesbens,pandora1,easypay,tomservo,nadezhda,goonies,saab9000,jordyn,f15eagle,dbrecz,12qwerty,greatsex,thrawn,blunted,baywatch,doggystyle,loloxx,chevy2,january1,kodak,bushel,78963214,ub6ib9,zz8807zpl,briefs,hawker,224488,first1,bonzo,brent1,erasure,69213124,sidewind,soccer13,622521,mentos,kolibri,onepiece,united1,ponyboy,keksa12,wayer,mypussy,andrej,mischa,mille,bruno123,garter,bigpun,talgat,familia,jazzy1,mustang8,newjob,747400,bobber,blackbel,hatteras,ginge,asdfjkl;,camelot1,blue44,rebbyt34,ebony1,vegas123,myboys,aleksander,ijrjkflrf,lopata,pilsner,lotus123,m0nk3y,andreev,freiheit,balls1,drjynfrnt,mazda1,waterpolo,shibumi,852963,123bbb,cezer121,blondie1,volkova,rattler,kleenex,ben123,sanane,happydog,satellit,qazplm,qazwsxedcrfvtgb,meowmix,badguy,facefuck,spice1,blondy,major1,25000,anna123,654321a,sober1,deathrow,patterso,china1,naruto1,hawkeye1,waldo1,butchy,crayon,5tgb6yhn,klopik,crocodil,mothra,imhorny,pookie1,splatter,slippy,lizard1,router,buratino,yahweh,123698,dragon11,123qwe456,peepers,trucker1,ganjaman,1hxboqg2,cheyanne,storys,sebastie,zztop,maddison,4rfv3edc,darthvader,jeffro,iloveit,victor1,hotty,delphin,lifeisgood,gooseman,shifty,insertions,dude123,abrupt,123masha,boogaloo,chronos,stamford,pimpster,kthjxrf,getmein,amidala,flubber,fettish,grapeape,dantes,oralsex,jack1,foxcg33,winchest,francis1,getin,archon,cliffy,blueman,1basebal,sport1,emmitt22,porn123,bignasty,morga,123hfjdk147,ferrar,juanito,fabiol,caseydog,steveo,peternorth,paroll,kimchi,bootleg,gaijin,secre,acacia,eatme2,amarillo,monkey11,rfhfgep,tylers,a1a2a3a4a5,sweetass,blower,rodina,babushka,camilo,cimbom,tiffan,vfnbkmlf,ohbaby,gotigers,lindsey1,dragon13,romulus,qazxsw12,zxcvbn1,dropdead,hitman47,snuggle,eleven11,bloopers,357mag,avangard,bmw320,ginscoot,dshade,masterkey,voodoo1,rootedit,caramba,leahcim,hannover,8phrowz622,tim123,cassius,000000a,angelito,zzzzz1,badkarma,star1,malaga,glenwood,footlove,golf1,summer12,helpme1,fastcars,titan1,police1,polinka,k.jdm,marusya,augusto,shiraz,pantyhose,donald1,blaise,arabella,brigada,c3por2d2,peter01,marco1,hellow,dillweed,uzumymw,geraldin,loveyou2,toyota1,088011,gophers,indy500,slainte,5hsu75kpot,teejay,renat,racoon,sabrin,angie1,shiznit,harpua,sexyred,latex,tucker1,alexandru,wahoo,teamwork,deepblue,goodison,rundmc,r2d2c3p0,puppys,samba,ayrton,boobed,999777,topsecre,blowme1,123321z,loudog,random1,pantie,drevil,mandolin,121212q,hottub,brother1,failsafe,spade1,matvey,open1234,carmen1,priscill,schatzi,kajak,gooddog,trojans1,gordon1,kayak,calamity,argent,ufhvjybz,seviyi,penfold,assface,dildos,hawkwind,crowbar,yanks,ruffles,rastus,luv2epus,open123,aquafina,dawns,jared1,teufel,12345c,vwgolf,pepsi123,amores,passwerd,01478520,boliva,smutty,headshot,password3,davidd,zydfhm,gbgbcmrf,pornpass,insertion,ceckbr,test2,car123,checkit,dbnfkbq,niggas,nyyankee,muskrat,nbuhtyjr,gunner1,ocean1,fabienne,chrissy1,wendys,loveme89,batgirl,cerveza,igorek,steel1,ragman,boris123,novifarm,sexy12,qwerty777,mike01,giveitup,123456abc,fuckall,crevice,hackerz,gspot,eight8,assassins,texass,swallows,123458,baldur,moonshine,labatt,modem,sydney1,voland,dbnfkz,hotchick,jacker,princessa,dawgs1,holiday1,booper,reliant,miranda1,jamaica1,andre1,badnaamhere,barnaby,tiger7,david12,margaux,corsica,085tzzqi,universi,thewall,nevermor,martin6,qwerty77,cipher,apples1,0102030405,seraphim,black123,imzadi,gandon,ducati99,1shadow,dkflbvbhjdyf,44magnum,bigbad,feedme,samantha1,ultraman,redneck1,jackdog,usmc0311,fresh1,monique1,tigre,alphaman,cool1,greyhoun,indycar,crunchy,55chevy,carefree,willow1,063dyjuy,xrated,assclown,federica,hilfiger,trivia,bronco1,mamita,100200300,simcity,lexingky,akatsuki,retsam,johndeere,abudfv,raster,elgato,businka,satanas,mattingl,redwing1,shamil,patate,mannn,moonstar,evil666,b123456,bowl300,tanechka,34523452,carthage,babygir,santino,bondarenko,jesuss,chico1,numlock,shyguy,sound1,kirby1,needit,mostwanted,427900,funky1,steve123,passions,anduril,kermit1,prospero,lusty,barakuda,dream1,broodwar,porky,christy1,mahal,yyyyyy1,allan1,1sexy,flintsto,capri,cumeater,heretic,robert2,hippos,blindax,marykay,collecti,kasumi,1qaz!qaz,112233q,123258,chemistr,coolboy,0o9i8u,kabuki,righton,tigress,nessie,sergej,andrew12,yfafyz,ytrhjvfyn,angel7,victo,mobbdeep,lemming,transfor,1725782,myhouse,aeynbr,muskie,leno4ka,westham1,cvbhyjd,daffodil,pussylicker,pamela1,stuffer,warehous,tinker1,2w3e4r,pluton,louise1,polarbea,253634,prime1,anatoliy,januar,wysiwyg,cobraya,ralphy,whaler,xterra,cableguy,112233a,porn69,jamesd,aqualung,jimmy123,lumpy,luckyman,kingsize,golfing1,alpha7,leeds1,marigold,lol1234,teabag,alex11,10sne1,saopaulo,shanny,roland1,basser,3216732167,carol1,year2005,morozov,saturn1,joseluis,bushed,redrock,memnoch,lalaland,indiana1,lovegod,gulnaz,buffalos,loveyou1,anteater,pattaya,jaydee,redshift,bartek,summerti,coffee1,ricochet,incest,schastie,rakkaus,h2opolo,suikoden,perro,dance1,loveme1,whoopass,vladvlad,boober,flyers1,alessia,gfcgjhn,pipers,papaya,gunsling,coolone,blackie1,gonads,gfhjkzytn,foxhound,qwert12,gangrel,ghjvtntq,bluedevi,mywife,summer01,hangman,licorice,patter,vfr750,thorsten,515253,ninguna,dakine,strange1,mexic,vergeten,12345432,8phrowz624,stampede,floyd1,sailfish,raziel,ananda,giacomo,freeme,crfprf,74185296,allstars,master01,solrac,gfnhbjn,bayliner,bmw525,3465xxx,catter,single1,michael3,pentium4,nitrox,mapet123456,halibut,killroy,xxxxx1,phillip1,poopsie,arsenalfc,buffys,kosova,all4me,32165498,arslan,opensesame,brutis,charles2,pochta,nadegda,backspac,mustang0,invis,gogeta,654321q,adam25,niceday,truckin,gfdkbr,biceps,sceptre,bigdave,lauras,user345,sandys,shabba,ratdog,cristiano,natha,march13,gumball,getsdown,wasdwasd,redhead1,dddddd1,longlegs,13572468,starsky,ducksoup,bunnys,omsairam,whoami,fred123,danmark,flapper,swanky,lakings,yfhenj,asterios,rainier,searcher,dapper,ltdjxrf,horsey,seahawk,shroom,tkfkdgo,aquaman,tashkent,number9,messi10,1asshole,milenium,illumina,vegita,jodeci,buster01,bareback,goldfinger,fire1,33rjhjds,sabian,thinkpad,smooth1,sully,bonghits,sushi1,magnavox,colombi,voiture,limpone,oldone,aruba,rooster1,zhenya,nomar5,touchdow,limpbizkit,rhfcfdxbr,baphomet,afrodita,bball1,madiso,ladles,lovefeet,matthew2,theworld,thunderbird,dolly1,123rrr,forklift,alfons,berkut,speedy1,saphire,oilman,creatine,pussylov,bastard1,456258,wicked1,filimon,skyline1,fucing,yfnfkbz,hot123,abdulla,nippon,nolimits,billiard,booty1,buttplug,westlife,coolbean,aloha1,lopas,asasin,1212121,october2,whodat,good4u,d12345,kostas,ilya1992,regal,pioneer1,volodya,focus1,bastos,nbvjif,fenix,anita1,vadimka,nickle,jesusc,123321456,teste,christ1,essendon,evgenii,celticfc,adam1,forumwp,lovesme,26exkp,chillout,burly,thelast1,marcus1,metalgear,test11,ronaldo7,socrate,world1,franki,mommie,vicecity,postov1000,charlie3,oldschool,333221,legoland,antoshka,counterstrike,buggy,mustang3,123454,qwertzui,toons,chesty,bigtoe,tigger12,limpopo,rerehepf,diddle,nokia3250,solidsnake,conan1,rockroll,963369,titanic1,qwezxc,cloggy,prashant,katharin,maxfli,takashi,cumonme,michael9,mymother,pennstate,khalid,48151623,fightclub,showboat,mateusz,elrond,teenie,arrow1,mammamia,dustydog,dominator,erasmus,zxcvb1,1a2a3a,bones1,dennis1,galaxie,pleaseme,whatever1,junkyard,galadriel,charlies,2wsxzaq1,crimson1,behemoth,teres,master11,fairway,shady1,pass99,1batman,joshua12,baraban,apelsin,mousepad,melon,twodogs,123321qwe,metalica,ryjgrf,pipiska,rerfhfxf,lugnut,cretin,iloveu2,powerade,aaaaaaa1,omanko,kovalenko,isabe,chobits,151nxjmt,shadow11,zcxfcnkbdf,gy3yt2rgls,vfhbyrf,159753123,bladerunner,goodone,wonton,doodie,333666999,fuckyou123,kitty123,chisox,orlando1,skateboa,red12345,destroye,snoogans,satan1,juancarlo,goheels,jetson,scottt,fuckup,aleksa,gfhfljrc,passfind,oscar123,derrick1,hateme,viper123,pieman,audi100,tuffy,andover,shooter1,10000,makarov,grant1,nighthaw,13576479,browneye,batigol,nfvfhf,chocolate1,7hrdnw23,petter,bantam,morlii,jediknight,brenden,argonaut,goodstuf,wisconsi,315920,abigail1,dirtbag,splurge,k123456,lucky777,valdepen,gsxr600,322223,ghjnjrjk,zaq1xsw2cde3,schwanz,walter1,letmein22,nomads,124356,codeblue,nokian70,fucke,footbal1,agyvorc,aztecs,passw0r,smuggles,femmes,ballgag,krasnodar,tamuna,schule,sixtynine,empires,erfolg,dvader,ladygaga,elite1,venezuel,nitrous,kochamcie,olivia1,trustn01,arioch,sting1,131415,tristar,555000,maroon,135799,marsik,555556,fomoco,natalka,cwoui,tartan,davecole,nosferat,hotsauce,dmitry,horus,dimasik,skazka,boss302,bluebear,vesper,ultras,tarantul,asd123asd,azteca,theflash,8ball,1footbal,titlover,lucas123,number6,sampson1,789852,party1,dragon99,adonai,carwash,metropol,psychnau,vthctltc,hounds,firework,blink18,145632,wildcat1,satchel,rice80,ghtktcnm,sailor1,cubano,anderso,rocks1,mike11,famili,dfghjc,besiktas,roygbiv,nikko,bethan,minotaur,rakesh,orange12,hfleuf,jackel,myangel,favorite7,1478520,asssss,agnieszka,haley1,raisin,htubyf,1buster,cfiekz,derevo,1a2a3a4a5a,baltika,raffles,scruffy1,clitlick,louis1,buddha1,fy.nrf,walker1,makoto,shadow2,redbeard,vfvfvskfhfve,mycock,sandydog,lineman,network1,favorite8,longdick,mustangg,mavericks,indica,1killer,cisco1,angelofwar,blue69,brianna1,bubbaa,slayer666,level42,baldrick,brutus1,lowdown,haribo,lovesexy,500000,thissuck,picker,stephy,1fuckme,characte,telecast,1bigdog,repytwjdf,thematrix,hammerhe,chucha,ganesha,gunsmoke,georgi,sheltie,1harley,knulla,sallas,westie,dragon7,conker,crappie,margosha,lisboa,3e2w1q,shrike,grifter,ghjcnjghjcnj,asdfg1,mnbvcxz1,myszka,posture,boggie,rocketman,flhtyfkby,twiztid,vostok,pi314159,force1,televizor,gtkmvtym,samhain,imcool,jadzia,dreamers,strannik,k2trix,steelhea,nikitin,commodor,brian123,chocobo,whopper,ibilljpf,megafon,ararat,thomas12,ghbrjkbcn,q1234567890,hibernia,kings1,jim123,redfive,68camaro,iawgk2,xavier1,1234567u,d123456,ndirish,airborn,halfmoon,fluffy1,ranchero,sneaker,soccer2,passion1,cowman,birthday1,johnn,razzle,glock17,wsxqaz,nubian,lucky2,jelly1,henderso,eric1,123123e,boscoe01,fuck0ff,simpson1,sassie,rjyjgkz,nascar3,watashi,loredana,janus,wilso,conman,david2,mothe,iloveher,snikers,davidj,fkmnthyfnbdf,mettss,ratfink,123456h,lostsoul,sweet16,brabus,wobble,petra1,fuckfest,otters,sable1,svetka,spartacu,bigstick,milashka,1lover,pasport,champagn,papichul,hrvatska,hondacivic,kevins,tacit,moneybag,gohogs,rasta1,246813579,ytyfdbcnm,gubber,darkmoon,vitaliy,233223,playboys,tristan1,joyce1,oriflame,mugwump,access2,autocad,thematri,qweqwe123,lolwut,ibill01,multisyn,1233211,pelikan,rob123,chacal,1234432,griffon,pooch,dagestan,geisha,satriani,anjali,rocketma,gixxer,pendrago,vincen,hellokit,killyou,ruger,doodah,bumblebe,badlands,galactic,emachines,foghorn,jackso,jerem,avgust,frontera,123369,daisymae,hornyboy,welcome123,tigger01,diabl,angel13,interex,iwantsex,rockydog,kukolka,sawdust,online1,3234412,bigpapa,jewboy,3263827,dave123,riches,333222,tony1,toggle,farter,124816,tities,balle,brasilia,southsid,micke,ghbdtn12,patit,ctdfcnjgjkm,olds442,zzzzzz1,nelso,gremlins,gypsy1,carter1,slut69,farcry,7415963,michael8,birdie1,charl,123456789abc,100001,aztec,sinjin,bigpimpi,closeup,atlas1,nvidia,doggone,classic1,manana,malcolm1,rfkbyf,hotbabe,rajesh,dimebag,ganjubas,rodion,jagr68,seren,syrinx,funnyman,karapuz,123456789n,bloomin,admin18533362,biggdogg,ocarina,poopy1,hellome,internet1,booties,blowjobs,matt1,donkey1,swede,1jennife,evgeniya,lfhbyf,coach1,444777,green12,patryk,pinewood,justin12,271828,89600506779,notredame,tuborg,lemond,sk8ter,million1,wowser,pablo1,st0n3,jeeves,funhouse,hiroshi,gobucs,angeleye,bereza,winter12,catalin,qazedc,andros,ramazan,vampyre,sweethea,imperium,murat,jamest,flossy,sandeep,morgen,salamandra,bigdogg,stroller,njdevils,nutsack,vittorio,%%passwo,playful,rjyatnrf,tookie,ubnfhf,michi,777444,shadow13,devils1,radiance,toshiba1,beluga,amormi,dandfa,trust1,killemall,smallville,polgara,billyb,landscap,steves,exploite,zamboni,damage11,dzxtckfd,trader12,pokey1,kobe08,damager,egorov,dragon88,ckfdbr,lisa69,blade2,audis4,nelson1,nibbles,23176djivanfros,mutabor,artofwar,matvei,metal666,hrfzlz,schwinn,poohbea,seven77,thinker,123456789qwerty,sobriety,jakers,karamelka,vbkfyf,volodin,iddqd,dale03,roberto1,lizaveta,qqqqqq1,cathy1,08154711,davidm,quixote,bluenote,tazdevil,katrina1,bigfoot1,bublik,marma,olechka,fatpussy,marduk,arina,nonrev67,qqqq1111,camill,wtpfhm,truffle,fairview,mashina,voltaire,qazxswedcvfr,dickface,grassy,lapdance,bosstone,crazy8,yackwin,mobil,danielit,mounta1n,player69,bluegill,mewtwo,reverb,cnthdf,pablito,a123321,elena1,warcraft1,orland,ilovemyself,rfntyjr,joyride,schoo,dthjxrf,thetachi,goodtimes,blacksun,humpty,chewbacca,guyute,123xyz,lexicon,blue45,qwe789,galatasaray,centrino,hendrix1,deimos,saturn5,craig1,vlad1996,sarah123,tupelo,ljrnjh,hotwife,bingos,1231231,nicholas1,flamer,pusher,1233210,heart1,hun999,jiggy,giddyup,oktober,123456zxc,budda,galahad,glamur,samwise,oneton,bugsbunny,dominic1,scooby2,freetime,internat,159753852,sc00ter,wantit,mazinger,inflames,laracrof,greedo,014789,godofwar,repytwjd,water123,fishnet,venus1,wallace1,tenpin,paula1,1475963,mania,novikov,qwertyasdfgh,goldmine,homies,777888999,8balls,holeinon,paper1,samael,013579,mansur,nikit,ak1234,blueline,polska1,hotcock,laredo,windstar,vbkbwbz,raider1,newworld,lfybkrf,catfish1,shorty1,piranha,treacle,royale,2234562,smurfs,minion,cadence,flapjack,123456p,sydne,135531,robinhoo,nasdaq,decatur,cyberonline,newage,gemstone,jabba,touchme,hooch,pigdog,indahous,fonzie,zebra1,juggle,patrick2,nihongo,hitomi,oldnavy,qwerfdsa,ukraina,shakti,allure,kingrich,diane1,canad,piramide,hottie1,clarion,college1,5641110,connect1,therion,clubber,velcro,dave1,astra1,13579-,astroboy,skittle,isgreat,photoes,cvzefh1gkc,001100,2cool4u,7555545,ginger12,2wsxcde3,camaro69,invader,domenow,asd1234,colgate,qwertasdfg,jack123,pass01,maxman,bronte,whkzyc,peter123,bogie,yecgaa,abc321,1qay2wsx,enfield,camaroz2,trashman,bonefish,system32,azsxdcfvgb,peterose,iwantyou,dick69,temp1234,blastoff,capa200,connie1,blazin,12233445,sexybaby,123456j,brentfor,pheasant,hommer,jerryg,thunders,august1,lager,kapusta,boobs1,nokia5300,rocco1,xytfu7,stars1,tugger,123sas,blingbling,1bubba,0wnsyo0,1george,baile,richard2,habana,1diamond,sensatio,1golfer,maverick1,1chris,clinton1,michael7,dragons1,sunrise1,pissant,fatim,mopar1,levani,rostik,pizzapie,987412365,oceans11,748159263,cum4me,palmetto,4r3e2w1q,paige1,muncher,arsehole,kratos,gaffer,banderas,billys,prakash,crabby,bungie,silver12,caddis,spawn1,xboxlive,sylvania,littlebi,524645,futura,valdemar,isacs155,prettygirl,big123,555444,slimer,chicke,newstyle,skypilot,sailormoon,fatluvr69,jetaime,sitruc,jesuschrist,sameer,bear12,hellion,yendor,country1,etnies,conejo,jedimast,darkknight,toobad,yxcvbn,snooks,porn4life,calvary,alfaromeo,ghostman,yannick,fnkfynblf,vatoloco,homebase,5550666,barret,1111111111zz,odysseus,edwardss,favre4,jerrys,crybaby,xsw21qaz,firestor,spanks,indians1,squish,kingair,babycakes,haters,sarahs,212223,teddyb,xfactor,cumload,rhapsody,death123,three3,raccoon,thomas2,slayer66,1q2q3q4q5q,thebes,mysterio,thirdeye,orkiox.,nodoubt,bugsy,schweiz,dima1996,angels1,darkwing,jeronimo,moonpie,ronaldo9,peaches2,mack10,manish,denise1,fellowes,carioca,taylor12,epaulson,makemoney,oc247ngucz,kochanie,3edcvfr4,vulture,1qw23e,1234567z,munchie,picard1,xthtgfirf,sportste,psycho1,tahoe1,creativ,perils,slurred,hermit,scoob,diesel1,cards1,wipeout,weeble,integra1,out3xf,powerpc,chrism,kalle,ariadne,kailua,phatty,dexter1,fordman,bungalow,paul123,compa,train1,thejoker,jys6wz,pussyeater,eatmee,sludge,dominus,denisa,tagheuer,yxcvbnm,bill1,ghfdlf,300zx,nikita123,carcass,semaj,ramone,muenchen,animal1,greeny,annemari,dbrf134,jeepcj7,mollys,garten,sashok,ironmaid,coyotes,astoria,george12,westcoast,primetim,123456o,panchito,rafae,japan1,framer,auralo,tooshort,egorova,qwerty22,callme,medicina,warhawk,w1w2w3w4,cristia,merli,alex22,kawaii,chatte,wargames,utvols,muaddib,trinket,andreas1,jjjjj1,cleric,scooters,cuntlick,gggggg1,slipknot1,235711,handcuff,stussy,guess1,leiceste,ppppp1,passe,lovegun,chevyman,hugecock,driver1,buttsex,psychnaut1,cyber1,black2,alpha12,melbourn,man123,metalman,yjdsqujl,blondi,bungee,freak1,stomper,caitlin1,nikitina,flyaway,prikol,begood,desperad,aurelius,john1234,whosyourdaddy,slimed123,bretagne,den123,hotwheel,king123,roodypoo,izzicam,save13tx,warpten,nokia3310,samolet,ready1,coopers,scott123,bonito,1aaaaa,yomomma,dawg1,rache,itworks,asecret,fencer,451236,polka,olivetti,sysadmin,zepplin,sanjuan,479373,lickem,hondacrx,pulamea,future1,naked1,sexyguy,w4g8at,lollol1,declan,runner1,rumple,daddy123,4snz9g,grandprix,calcio,whatthefuck,nagrom,asslick,pennst,negrit,squiggy,1223334444,police22,giovann,toronto1,tweet,yardbird,seagate,truckers,554455,scimitar,pescator,slydog,gaysex,dogfish,fuck777,12332112,qazxswed,morkovka,daniela1,imback,horny69,789123456,123456789w,jimmy2,bagger,ilove69,nikolaus,atdhfkm,rebirth,1111aaaa,pervasive,gjgeufq,dte4uw,gfhnbpfy,skeletor,whitney1,walkman,delorean,disco1,555888,as1234,ishikawa,fuck12,reaper1,dmitrii,bigshot,morrisse,purgen,qwer4321,itachi,willys,123123qwe,kisska,roma123,trafford,sk84life,326159487,pedros,idiom,plover,bebop,159875321,jailbird,arrowhea,qwaszx123,zaxscdvf,catlover,bakers,13579246,bones69,vermont1,helloyou,simeon,chevyz71,funguy,stargaze,parolparol,steph1,bubby,apathy,poppet,laxman,kelly123,goodnews,741236,boner1,gaetano,astonvilla,virtua,luckyboy,rocheste,hello2u,elohim,trigger1,cstrike,pepsicola,miroslav,96385274,fistfuck,cheval,magyar,svetlanka,lbfyjxrf,mamedov,123123123q,ronaldo1,scotty1,1nicole,pittbull,fredd,bbbbb1,dagwood,gfhkfvtyn,ghblehrb,logan5,1jordan,sexbomb,omega2,montauk,258741,dtythf,gibbon,winamp,thebomb,millerli,852654,gemin,baldy,halflife2,dragon22,mulberry,morrigan,hotel6,zorglub,surfin,951159,excell,arhangel,emachine,moses1,968574,reklama,bulldog2,cuties,barca,twingo,saber,elite11,redtruck,casablan,ashish,moneyy,pepper12,cnhtktw,rjcnbr,arschloch,phenix,cachorro,sunita,madoka,joselui,adams1,mymoney,hemicuda,fyutkjr,jake12,chicas,eeeee1,sonnyboy,smarties,birdy,kitten1,cnfcbr,island1,kurosaki,taekwond,konfetka,bennett1,omega3,jackson2,fresca,minako,octavian,kban667,feyenoord,muaythai,jakedog,fktrcfylhjdyf,1357911q,phuket,sexslave,fktrcfylhjdbx,asdfjk,89015173454,qwerty00,kindbud,eltoro,sex6969,nyknicks,12344321q,caballo,evenflow,hoddle,love22,metro1,mahalko,lawdog,tightass,manitou,buckie,whiskey1,anton123,335533,password4,primo,ramair,timbo,brayden,stewie,pedro1,yorkshir,ganster,hellothe,tippy1,direwolf,genesi,rodrig,enkeli,vaz21099,sorcerer,winky,oneshot,boggle,serebro,badger1,japanes,comicbook,kamehame,alcat,denis123,echo45,sexboy,gr8ful,hondo,voetbal,blue33,2112rush,geneviev,danni1,moosey,polkmn,matthew7,ironhead,hot2trot,ashley12,sweeper,imogen,blue21,retep,stealth1,guitarra,bernard1,tatian,frankfur,vfnhbwf,slacking,haha123,963741,asdasdas,katenok,airforce1,123456789qaz,shotgun1,12qwasz,reggie1,sharo,976431,pacifica,dhip6a,neptun,kardon,spooky1,beaut,555555a,toosweet,tiedup,11121314,startac,lover69,rediska,pirata,vfhrbp,1234qwerty,energize,hansolo1,playbo,larry123,oemdlg,cnjvfnjkju,a123123,alexan,gohawks,antonius,fcbayern,mambo,yummy1,kremlin,ellen1,tremere,vfiekz,bellevue,charlie9,izabella,malishka,fermat,rotterda,dawggy,becket,chasey,kramer1,21125150,lolit,cabrio,schlong,arisha,verity,3some,favorit,maricon,travelle,hotpants,red1234,garrett1,home123,knarf,seven777,figment,asdewq,canseco,good2go,warhol,thomas01,pionee,al9agd,panacea,chevy454,brazzers,oriole,azerty123,finalfan,patricio,northsta,rebelde,bulldo,stallone,boogie1,7uftyx,cfhfnjd,compusa,cornholi,config,deere,hoopster,sepultura,grasshop,babygurl,lesbo,diceman,proverbs,reddragon,nurbek,tigerwoo,superdup,buzzsaw,kakaroto,golgo13,edwar,123qaz123,butter1,sssss1,texas2,respekt,ou812ic,123456qaz,55555a,doctor1,mcgwire,maria123,aol999,cinders,aa1234,joness,ghbrjkmyj,makemone,sammyboy,567765,380zliki,theraven,testme,mylene,elvira26,indiglo,tiramisu,shannara,baby1,123666,gfhreh,papercut,johnmish,orange8,bogey1,mustang7,bagpipes,dimarik,vsijyjr,4637324,ravage,cogito,seven11,natashka,warzone,hr3ytm,4free,bigdee,000006,243462536,bigboi,123333,trouts,sandy123,szevasz,monica2,guderian,newlife1,ratchet,r12345,razorbac,12345i,piazza31,oddjob,beauty1,fffff1,anklet,nodrog,pepit,olivi,puravida,robert12,transam1,portman,bubbadog,steelers1,wilson1,eightball,mexico1,superboy,4rfv5tgb,mzepab,samurai1,fuckslut,colleen1,girdle,vfrcbvec,q1w2e3r4t,soldier1,19844891,alyssa1,a12345a,fidelis,skelter,nolove,mickeymouse,frehley,password69,watermel,aliska,soccer15,12345e,ladybug1,abulafia,adagio,tigerlil,takehana,hecate,bootneck,junfan,arigato,wonkette,bobby123,trustnoone,phantasm,132465798,brianjo,w12345,t34vfrc1991,deadeye,1robert,1daddy,adida,check1,grimlock,muffi,airwalk,prizrak,onclick,longbeac,ernie1,eadgbe,moore1,geniu,shadow123,bugaga,jonathan1,cjrjkjdf,orlova,buldog,talon1,westport,aenima,541233432442,barsuk,chicago2,kellys,hellbent,toughguy,iskander,skoal,whatisit,jake123,scooter2,fgjrfkbgcbc,ghandi,love13,adelphia,vjhrjdrf,adrenali,niunia,jemoeder,rainbo,all4u8,anime1,freedom7,seraph,789321,tommys,antman,firetruc,neogeo,natas,bmwm3,froggy1,paul1,mamit,bayview,gateways,kusanagi,ihateu,frederi,rock1,centurion,grizli,biggin,fish1,stalker1,3girls,ilovepor,klootzak,lollo,redsox04,kirill123,jake1,pampers,vasya,hammers1,teacup,towing,celtic1,ishtar,yingyang,4904s677075,dahc1,patriot1,patrick9,redbirds,doremi,rebecc,yoohoo,makarova,epiphone,rfgbnfy,milesd,blister,chelseafc,katana1,blackrose,1james,primrose,shock5,hard1,scooby12,c6h12o6,dustoff,boing,chisel,kamil,1william,defiant1,tyvugq,mp8o6d,aaa340,nafets,sonnet,flyhigh,242526,crewcom,love23,strike1,stairway,katusha,salamand,cupcake1,password0,007james,sunnie,multisync,harley01,tequila1,fred12,driver8,q8zo8wzq,hunter01,mozzer,temporar,eatmeraw,mrbrownxx,kailey,sycamore,flogger,tincup,rahasia,ganymede,bandera,slinger,1111122222,vander,woodys,1cowboy,khaled,jamies,london12,babyboo,tzpvaw,diogenes,budice,mavrick,135797531,cheeta,macros,squonk,blackber,topfuel,apache1,falcon16,darkjedi,cheeze,vfhvtkfl,sparco,change1,gfhfif,freestyl,kukuruza,loveme2,12345f,kozlov,sherpa,marbella,44445555,bocephus,1winner,alvar,hollydog,gonefish,iwantin,barman,godislove,amanda18,rfpfynbg,eugen,abcdef1,redhawk,thelema,spoonman,baller1,harry123,475869,tigerman,cdtnjxrf,marillio,scribble,elnino,carguy,hardhead,l2g7k3,troopers,selen,dragon76,antigua,ewtosi,ulysse,astana,paroli,cristo,carmex,marjan,bassfish,letitbe,kasparov,jay123,19933991,blue13,eyecandy,scribe,mylord,ukflbjkec,ellie1,beaver1,destro,neuken,halfpint,ameli,lilly1,satanic,xngwoj,12345trewq,asdf1,bulldogg,asakura,jesucrist,flipside,packers4,biggy,kadett,biteme69,bobdog,silverfo,saint1,bobbo,packman,knowledg,foolio,fussbal,12345g,kozerog,westcoas,minidisc,nbvcxw,martini1,alastair,rasengan,superbee,memento,porker,lena123,florenc,kakadu,bmw123,getalife,bigsky,monkee,people1,schlampe,red321,memyself,0147896325,12345678900987654321,soccer14,realdeal,gfgjxrf,bella123,juggs,doritos,celtics1,peterbilt,ghbdtnbrb,gnusmas,xcountry,ghbdtn1,batman99,deusex,gtnhjdf,blablabl,juster,marimba,love2,rerjkrf,alhambra,micros,siemens1,assmaste,moonie,dashadasha,atybrc,eeeeee1,wildrose,blue55,davidl,xrp23q,skyblue,leo123,ggggg1,bestfriend,franny,1234rmvb,fun123,rules1,sebastien,chester2,hakeem,winston2,fartripper,atlant,07831505,iluvsex,q1a2z3,larrys,009900,ghjkju,capitan,rider1,qazxsw21,belochka,andy123,hellya,chicca,maximal,juergen,password1234,howard1,quetzal,daniel123,qpwoeiruty,123555,bharat,ferrari3,numbnuts,savant,ladydog,phipsi,lovepussy,etoile,power2,mitten,britneys,chilidog,08522580,2fchbg,kinky1,bluerose,loulo,ricardo1,doqvq3,kswbdu,013cpfza,timoha,ghbdtnghbdtn,3stooges,gearhead,browns1,g00ber,super7,greenbud,kitty2,pootie,toolshed,gamers,coffe,ibill123,freelove,anasazi,sister1,jigger,natash,stacy1,weronika,luzern,soccer7,hoopla,dmoney,valerie1,canes,razdvatri,washere,greenwoo,rfhjkbyf,anselm,pkxe62,maribe,daniel2,maxim1,faceoff,carbine,xtkjdtr,buddy12,stratos,jumpman,buttocks,aqswdefr,pepsis,sonechka,steeler1,lanman,nietzsch,ballz,biscuit1,wrxsti,goodfood,juventu,federic,mattman,vika123,strelec,jledfyxbr,sideshow,4life,fredderf,bigwilly,12347890,12345671,sharik,bmw325i,fylhtqrf,dannon4,marky,mrhappy,drdoom,maddog1,pompier,cerbera,goobers,howler,jenny69,evely,letitrid,cthuttdyf,felip,shizzle,golf12,t123456,yamah,bluearmy,squishy,roxan,10inches,dollface,babygirl1,blacksta,kaneda,lexingto,canadien,222888,kukushka,sistema,224422,shadow69,ppspankp,mellons,barbie1,free4all,alfa156,lostone,2w3e4r5t,painkiller,robbie1,binger,8dihc6,jaspe,rellik,quark,sogood,hoopstar,number2,snowy1,dad2ownu,cresta,qwe123asd,hjvfyjdf,gibsonsg,qbg26i,dockers,grunge,duckling,lfiekz,cuntsoup,kasia1,1tigger,woaini,reksio,tmoney,firefighter,neuron,audia3,woogie,powerboo,powermac,fatcock,12345666,upnfmc,lustful,porn1,gotlove,amylee,kbytqrf,11924704,25251325,sarasota,sexme,ozzie1,berliner,nigga1,guatemal,seagulls,iloveyou!,chicken2,qwerty21,010203040506,1pillow,libby1,vodoley,backlash,piglets,teiubesc,019283,vonnegut,perico,thunde,buckey,gtxtymrf,manunite,iiiii1,lost4815162342,madonn,270873_,britney1,kevlar,piano1,boondock,colt1911,salamat,doma77ns,anuradha,cnhjqrf,rottweil,newmoon,topgun1,mauser,fightclu,birthday21,reviewpa,herons,aassddff,lakers32,melissa2,vredina,jiujitsu,mgoblue,shakey,moss84,12345zxcvb,funsex,benji1,garci,113322,chipie,windex,nokia5310,pwxd5x,bluemax,cosita,chalupa,trotsky,new123,g3ujwg,newguy,canabis,gnaget,happydays,felixx,1patrick,cumface,sparkie,kozlova,123234,newports,broncos7,golf18,recycle,hahah,harrypot,cachondo,open4me,miria,guessit,pepsione,knocker,usmc1775,countach,playe,wiking,landrover,cracksevi,drumline,a7777777,smile123,manzana,panty,liberta,pimp69,dolfan,quality1,schnee,superson,elaine22,webhompass,mrbrownx,deepsea,4wheel,mamasita,rockport,rollie,myhome,jordan12,kfvgjxrf,hockey12,seagrave,ford1,chelsea2,samsara,marissa1,lamesa,mobil1,piotrek,tommygun,yyyyy1,wesley1,billy123,homersim,julies,amanda12,shaka,maldini,suzenet,springst,iiiiii1,yakuza,111111aa,westwind,helpdesk,annamari,bringit,hopefull,hhhhhhh1,saywhat,mazdarx8,bulova,jennife1,baikal,gfhjkmxbr,victoria1,gizmo123,alex99,defjam,2girls,sandrock,positivo,shingo,syncmast,opensesa,silicone,fuckina,senna1,karlos,duffbeer,montagne,gehrig,thetick,pepino,hamburge,paramedic,scamp,smokeweed,fabregas,phantoms,venom121293,2583458,badone,porno69,manwhore,vfvf123,notagain,vbktyf,rfnthbyrf,wildblue,kelly001,dragon66,camell,curtis1,frolova,1212123,dothedew,tyler123,reddrago,planetx,promethe,gigolo,1001001,thisone,eugeni,blackshe,cruzazul,incognito,puller,joonas,quick1,spirit1,gazza,zealot,gordito,hotrod1,mitch1,pollito,hellcat,mythos,duluth,383pdjvl,easy123,hermos,binkie,its420,lovecraf,darien,romina,doraemon,19877891,syclone,hadoken,transpor,ichiro,intell,gargamel,dragon2,wavpzt,557744,rjw7x4,jennys,kickit,rjynfrn,likeit,555111,corvus,nec3520,133113,mookie1,bochum,samsung2,locoman0,154ugeiu,vfvfbgfgf,135792,[start],tenni,20001,vestax,hufmqw,neveragain,wizkid,kjgfnf,nokia6303,tristen,saltanat,louie1,gandalf2,sinfonia,alpha3,tolstoy,ford150,f00bar,1hello,alici,lol12,riker1,hellou,333888,1hunter,qw1234,vibrator,mets86,43211234,gonzale,cookies1,sissy1,john11,bubber,blue01,cup2006,gtkmvtyb,nazareth,heybaby,suresh,teddie,mozilla,rodeo1,madhouse,gamera,123123321,naresh,dominos,foxtrot1,taras,powerup,kipling,jasonb,fidget,galena,meatman,alpacino,bookmark,farting,humper,titsnass,gorgon,castaway,dianka,anutka,gecko1,fucklove,connery,wings1,erika1,peoria,moneymaker,ichabod,heaven1,paperboy,phaser,breakers,nurse1,westbrom,alex13,brendan1,123asd123,almera,grubber,clarkie,thisisme,welkom01,51051051051,crypto,freenet,pflybwf,black12,testme2,changeit,autobahn,attica,chaoss,denver1,tercel,gnasher23,master2,vasilii,sherman1,gomer,bigbuck,derek1,qwerzxcv,jumble,dragon23,art131313,numark,beasty,cxfcnmttcnm,updown,starion,glist,sxhq65,ranger99,monkey7,shifter,wolves1,4r5t6y,phone1,favorite5,skytommy,abracada,1martin,102030405060,gatech,giulio,blacktop,cheer1,africa1,grizzly1,inkjet,shemales,durango1,booner,11223344q,supergirl,vanyarespekt,dickless,srilanka,weaponx,6string,nashvill,spicey,boxer1,fabien,2sexy2ho,bowhunt,jerrylee,acrobat,tawnee,ulisse,nolimit8,l8g3bkde,pershing,gordo1,allover,gobrowns,123432,123444,321456987,spoon1,hhhhh1,sailing1,gardenia,teache,sexmachine,tratata,pirate1,niceone,jimbos,314159265,qsdfgh,bobbyy,ccccc1,carla1,vjkjltw,savana,biotech,frigid,123456789g,dragon10,yesiam,alpha06,oakwood,tooter,winsto,radioman,vavilon,asnaeb,google123,nariman,kellyb,dthyjcnm,password6,parol1,golf72,skate1,lthtdj,1234567890s,kennet,rossia,lindas,nataliya,perfecto,eminem1,kitana,aragorn1,rexona,arsenalf,planot,coope,testing123,timex,blackbox,bullhead,barbarian,dreamon,polaris1,cfvjktn,frdfhbev,gametime,slipknot666,nomad1,hfgcjlbz,happy69,fiddler,brazil1,joeboy,indianali,113355,obelisk,telemark,ghostrid,preston1,anonim,wellcome,verizon1,sayangku,censor,timeport,dummies,adult1,nbnfybr,donger,thales,iamgay,sexy1234,deadlift,pidaras,doroga,123qwe321,portuga,asdfgh12,happys,cadr14nu,pi3141,maksik,dribble,cortland,darken,stepanova,bommel,tropic,sochi2014,bluegras,shahid,merhaba,nacho,2580456,orange44,kongen,3cudjz,78girl,my3kids,marcopol,deadmeat,gabbie,saruman,jeepman,freddie1,katie123,master99,ronal,ballbag,centauri,killer7,xqgann,pinecone,jdeere,geirby,aceshigh,55832811,pepsimax,rayden,razor1,tallyho,ewelina,coldfire,florid,glotest,999333,sevenup,bluefin,limaperu,apostol,bobbins,charmed1,michelin,sundin,centaur,alphaone,christof,trial1,lions1,45645,just4you,starflee,vicki1,cougar1,green2,jellyfis,batman69,games1,hihje863,crazyzil,w0rm1,oklick,dogbite,yssup,sunstar,paprika,postov10,124578963,x24ik3,kanada,buckster,iloveamy,bear123,smiler,nx74205,ohiostat,spacey,bigbill,doudo,nikolaeva,hcleeb,sex666,mindy1,buster11,deacons,boness,njkcnsq,candy2,cracker1,turkey1,qwertyu1,gogreen,tazzzz,edgewise,ranger01,qwerty6,blazer1,arian,letmeinnow,cigar1,jjjjjj1,grigio,frien,tenchu,f9lmwd,imissyou,filipp,heathers,coolie,salem1,woodduck,scubadiv,123kat,raffaele,nikolaev,dapzu455,skooter,9inches,lthgfhjkm,gr8one,ffffff1,zujlrf,amanda69,gldmeo,m5wkqf,rfrltkf,televisi,bonjou,paleale,stuff1,cumalot,fuckmenow,climb7,mark1234,t26gn4,oneeye,george2,utyyflbq,hunting1,tracy71,ready2go,hotguy,accessno,charger1,rudedog,kmfdm,goober1,sweetie1,wtpmjgda,dimensio,ollie1,pickles1,hellraiser,mustdie,123zzz,99887766,stepanov,verdun,tokenbad,anatol,bartende,cidkid86,onkelz,timmie,mooseman,patch1,12345678c,marta1,dummy1,bethany1,myfamily,history1,178500,lsutiger,phydeaux,moren,dbrnjhjdbx,gnbxrf,uniden,drummers,abpbrf,godboy,daisy123,hogan1,ratpack,irland,tangerine,greddy,flore,sqrunch,billyjoe,q55555,clemson1,98745632,marios,ishot,angelin,access12,naruto12,lolly,scxakv,austin12,sallad,cool99,rockit,mongo1,mark22,ghbynth,ariadna,senha,docto,tyler2,mobius,hammarby,192168,anna12,claire1,pxx3eftp,secreto,greeneye,stjabn,baguvix,satana666,rhbcnbyjxrf,dallastx,garfiel,michaelj,1summer,montan,1234ab,filbert,squids,fastback,lyudmila,chucho,eagleone,kimberle,ar3yuk3,jake01,nokids,soccer22,1066ad,ballon,cheeto,review69,madeira,taylor2,sunny123,chubbs,lakeland,striker1,porche,qwertyu8,digiview,go1234,ferari,lovetits,aditya,minnow,green3,matman,cellphon,fortytwo,minni,pucara,69a20a,roman123,fuente,12e3e456,paul12,jacky,demian,littleman,jadakiss,vlad1997,franca,282860,midian,nunzio,xaccess2,colibri,jessica0,revilo,654456,harvey1,wolf1,macarena,corey1,husky1,arsen,milleniu,852147,crowes,redcat,combat123654,hugger,psalms,quixtar,ilovemom,toyot,ballss,ilovekim,serdar,james23,avenger1,serendip,malamute,nalgas,teflon,shagger,letmein6,vyjujnjxbt,assa1234,student1,dixiedog,gznybwf13,fuckass,aq1sw2de3,robroy,hosehead,sosa21,123345,ias100,teddy123,poppin,dgl70460,zanoza,farhan,quicksilver,1701d,tajmahal,depechemode,paulchen,angler,tommy2,recoil,megamanx,scarecro,nicole2,152535,rfvtgb,skunky,fatty1,saturno,wormwood,milwauke,udbwsk,sexlover,stefa,7bgiqk,gfnhbr,omar10,bratan,lbyfvj,slyfox,forest1,jambo,william3,tempus,solitari,lucydog,murzilka,qweasdzxc1,vehpbkrf,12312345,fixit,woobie,andre123,123456789x,lifter,zinaida,soccer17,andone,foxbat,torsten,apple12,teleport,123456i,leglover,bigcocks,vologda,dodger1,martyn,d6o8pm,naciona,eagleeye,maria6,rimshot,bentley1,octagon,barbos,masaki,gremio,siemen,s1107d,mujeres,bigtits1,cherr,saints1,mrpink,simran,ghzybr,ferrari2,secret12,tornado1,kocham,picolo,deneme,onelove1,rolan,fenster,1fuckyou,cabbie,pegaso,nastyboy,password5,aidana,mine2306,mike13,wetone,tigger69,ytreza,bondage1,myass,golova,tolik,happyboy,poilkj,nimda2k,rammer,rubies,hardcore1,jetset,hoops1,jlaudio,misskitt,1charlie,google12,theone1,phred,porsch,aalborg,luft4,charlie5,password7,gnosis,djgabbab,1daniel,vinny,borris,cumulus,member1,trogdor,darthmau,andrew2,ktjybl,relisys,kriste,rasta220,chgobndg,weener,qwerty66,fritter,followme,freeman1,ballen,blood1,peache,mariso,trevor1,biotch,gtfullam,chamonix,friendste,alligato,misha1,1soccer,18821221,venkat,superd,molotov,bongos,mpower,acun3t1x,dfcmrf,h4x3d,rfhfufylf,tigran,booyaa,plastic1,monstr,rfnhby,lookatme,anabolic,tiesto,simon123,soulman,canes1,skyking,tomcat1,madona,bassline,dasha123,tarheel1,dutch1,xsw23edc,qwerty123456789,imperator,slaveboy,bateau,paypal,house123,pentax,wolf666,drgonzo,perros,digger1,juninho,hellomoto,bladerun,zzzzzzz1,keebler,take8422,fffffff1,ginuwine,israe,caesar1,crack1,precious1,garand,magda1,zigazaga,321ewq,johnpaul,mama1234,iceman69,sanjeev,treeman,elric,rebell,1thunder,cochon,deamon,zoltan,straycat,uhbyuj,luvfur,mugsy,primer,wonder1,teetime,candycan,pfchfytw,fromage,gitler,salvatio,piggy1,23049307,zafira,chicky,sergeev,katze,bangers,andriy,jailbait,vaz2107,ghbhjlf,dbjktnnf,aqswde,zaratustra,asroma,1pepper,alyss,kkkkk1,ryan1,radish,cozumel,waterpol,pentium1,rosebowl,farmall,steinway,dbrekz,baranov,jkmuf,another1,chinacat,qqqqqqq1,hadrian,devilmaycry4,ratbag,teddy2,love21,pullings,packrat,robyn1,boobo,qw12er34,tribe1,rosey,celestia,nikkie,fortune12,olga123,danthema,gameon,vfrfhjys,dilshod,henry14,jenova,redblue,chimaera,pennywise,sokrates,danimal,qqaazz,fuaqz4,killer2,198200,tbone1,kolyan,wabbit,lewis1,maxtor,egoist,asdfas,spyglass,omegas,jack12,nikitka,esperanz,doozer,matematika,wwwww1,ssssss1,poiu0987,suchka,courtney1,gungho,alpha2,fktyjxrf,summer06,bud420,devildriver,heavyd,saracen,foucault,choclate,rjdfktyrj,goblue1,monaro,jmoney,dcpugh,efbcapa201,qqh92r,pepsicol,bbb747,ch5nmk,honeyb,beszoptad,tweeter,intheass,iseedeadpeople,123dan,89231243658s,farside1,findme,smiley1,55556666,sartre,ytcnjh,kacper,costarica,134679258,mikeys,nolimit9,vova123,withyou,5rxypn,love143,freebie,rescue1,203040,michael6,12monkey,redgreen,steff,itstime,naveen,good12345,acidrain,1dawg,miramar,playas,daddio,orion2,852741,studmuff,kobe24,senha123,stephe,mehmet,allalone,scarface1,helloworld,smith123,blueyes,vitali,memphis1,mybitch,colin1,159874,1dick,podaria,d6wnro,brahms,f3gh65,dfcbkmtd,xxxman,corran,ugejvp,qcfmtz,marusia,totem,arachnid,matrix2,antonell,fgntrf,zemfira,christos,surfing1,naruto123,plato1,56qhxs,madzia,vanille,043aaa,asq321,mutton,ohiostate,golde,cdznjckfd,rhfcysq,green5,elephan,superdog,jacqueli,bollock,lolitas,nick12,1orange,maplelea,july23,argento,waldorf,wolfer,pokemon12,zxcvbnmm,flicka,drexel,outlawz,harrie,atrain,juice2,falcons1,charlie6,19391945,tower1,dragon21,hotdamn,dirtyboy,love4ever,1ginger,thunder2,virgo1,alien1,bubblegu,4wwvte,123456789qqq,realtime,studio54,passss,vasilek,awsome,giorgia,bigbass,2002tii,sunghile,mosdef,simbas,count0,uwrl7c,summer05,lhepmz,ranger21,sugarbea,principe,5550123,tatanka,9638v,cheerios,majere,nomercy,jamesbond007,bh90210,7550055,jobber,karaganda,pongo,trickle,defamer,6chid8,1q2a3z,tuscan,nick123,.adgjm,loveyo,hobbes1,note1234,shootme,171819,loveporn,9788960,monty123,fabrice,macduff,monkey13,shadowfa,tweeker,hanna1,madball,telnet,loveu2,qwedcxzas,thatsit,vfhcbr,ptfe3xxp,gblfhfcs,ddddddd1,hakkinen,liverune,deathsta,misty123,suka123,recon1,inferno1,232629,polecat,sanibel,grouch,hitech,hamradio,rkfdbfnehf,vandam,nadin,fastlane,shlong,iddqdidkfa,ledzeppelin,sexyfeet,098123,stacey1,negras,roofing,lucifer1,ikarus,tgbyhn,melnik,barbaria,montego,twisted1,bigal1,jiggle,darkwolf,acerview,silvio,treetops,bishop1,iwanna,pornsite,happyme,gfccdjhl,114411,veritech,batterse,casey123,yhntgb,mailto,milli,guster,q12345678,coronet,sleuth,fuckmeha,armadill,kroshka,geordie,lastochka,pynchon,killall,tommy123,sasha1996,godslove,hikaru,clticic,cornbrea,vfkmdbyf,passmaster,123123123a,souris,nailer,diabolo,skipjack,martin12,hinata,mof6681,brookie,dogfight,johnso,karpov,326598,rfvbrflpt,travesti,caballer,galaxy1,wotan,antoha,art123,xakep1234,ricflair,pervert1,p00kie,ambulanc,santosh,berserker,larry33,bitch123,a987654321,dogstar,angel22,cjcbcrf,redhouse,toodles,gold123,hotspot,kennedy1,glock21,chosen1,schneide,mainman,taffy1,3ki42x,4zqauf,ranger2,4meonly,year2000,121212a,kfylsi,netzwerk,diese,picasso1,rerecz,225522,dastan,swimmer1,brooke1,blackbea,oneway,ruslana,dont4get,phidelt,chrisp,gjyxbr,xwing,kickme,shimmy,kimmy1,4815162342lost,qwerty5,fcporto,jazzbo,mierd,252627,basses,sr20det,00133,florin,howdy1,kryten,goshen,koufax,cichlid,imhotep,andyman,wrest666,saveme,dutchy,anonymou,semprini,siempre,mocha1,forest11,wildroid,aspen1,sesam,kfgekz,cbhbec,a55555,sigmanu,slash1,giggs11,vatech,marias,candy123,jericho1,kingme,123a123,drakula,cdjkjxm,mercur,oneman,hoseman,plumper,ilovehim,lancers,sergey1,takeshi,goodtogo,cranberr,ghjcnj123,harvick,qazxs,1972chev,horsesho,freedom3,letmein7,saitek,anguss,vfvfgfgfz,300000,elektro,toonporn,999111999q,mamuka,q9umoz,edelweis,subwoofer,bayside,disturbe,volition,lucky3,12345678z,3mpz4r,march1,atlantida,strekoza,seagrams,090909t,yy5rbfsc,jack1234,sammy12,sampras,mark12,eintrach,chaucer,lllll1,nochance,whitepower,197000,lbvekz,passer,torana,12345as,pallas,koolio,12qw34,nokia8800,findout,1thomas,mmmmm1,654987,mihaela,chinaman,superduper,donnas,ringo1,jeroen,gfdkjdf,professo,cdtnrf,tranmere,tanstaaf,himera,ukflbfnjh,667788,alex32,joschi,w123456,okidoki,flatline,papercli,super8,doris1,2good4u,4z34l0ts,pedigree,freeride,gsxr1100,wulfgar,benjie,ferdinan,king1,charlie7,djdxbr,fhntvbq,ripcurl,2wsx1qaz,kingsx,desade,sn00py,loveboat,rottie,evgesha,4money,dolittle,adgjmpt,buzzers,brett1,makita,123123qweqwe,rusalka,sluts1,123456e,jameson1,bigbaby,1z2z3z,ckjybr,love4u,fucker69,erhfbyf,jeanluc,farhad,fishfood,merkin,giant1,golf69,rfnfcnhjaf,camera1,stromb,smoothy,774411,nylon,juice1,rfn.irf,newyor,123456789t,marmot,star11,jennyff,jester1,hisashi,kumquat,alex777,helicopt,merkur,dehpye,cummin,zsmj2v,kristjan,april12,englan,honeypot,badgirls,uzumaki,keines,p12345,guita,quake1,duncan1,juicer,milkbone,hurtme,123456789b,qq123456789,schwein,p3wqaw,54132442,qwertyytrewq,andreeva,ruffryde,punkie,abfkrf,kristinka,anna1987,ooooo1,335533aa,umberto,amber123,456123789,456789123,beelch,manta,peeker,1112131415,3141592654,gipper,wrinkle5,katies,asd123456,james11,78n3s5af,michael0,daboss,jimmyb,hotdog1,david69,852123,blazed,sickan,eljefe,2n6wvq,gobills,rfhfcm,squeaker,cabowabo,luebri,karups,test01,melkor,angel777,smallvil,modano,olorin,4rkpkt,leslie1,koffie,shadows1,littleon,amiga1,topeka,summer20,asterix1,pitstop,aloysius,k12345,magazin,joker69,panocha,pass1word,1233214,ironpony,368ejhih,88keys,pizza123,sonali,57np39,quake2,1234567890qw,1020304,sword1,fynjif,abcde123,dfktyjr,rockys,grendel1,harley12,kokakola,super2,azathoth,lisa123,shelley1,girlss,ibragim,seven1,jeff24,1bigdick,dragan,autobot,t4nvp7,omega123,900000,hecnfv,889988,nitro1,doggie1,fatjoe,811pahc,tommyt,savage1,pallino,smitty1,jg3h4hfn,jamielee,1qazwsx,zx123456,machine1,asdfgh123,guinnes,789520,sharkman,jochen,legend1,sonic2,extreme1,dima12,photoman,123459876,nokian95,775533,vaz2109,april10,becks,repmvf,pooker,qwer12345,themaster,nabeel,monkey10,gogetit,hockey99,bbbbbbb1,zinedine,dolphin2,anelka,1superma,winter01,muggsy,horny2,669966,kuleshov,jesusis,calavera,bullet1,87t5hdf,sleepers,winkie,vespa,lightsab,carine,magister,1spider,shitbird,salavat,becca1,wc18c2,shirak,galactus,zaskar,barkley1,reshma,dogbreat,fullsail,asasa,boeder,12345ta,zxcvbnm12,lepton,elfquest,tony123,vkaxcs,savatage,sevilia1,badkitty,munkey,pebbles1,diciembr,qapmoc,gabriel2,1qa2ws3e,cbcmrb,welldone,nfyufh,kaizen,jack11,manisha,grommit,g12345,maverik,chessman,heythere,mixail,jjjjjjj1,sylvia1,fairmont,harve,skully,global1,youwish,pikachu1,badcat,zombie1,49527843,ultra1,redrider,offsprin,lovebird,153426,stymie,aq1sw2,sorrento,0000001,r3ady41t,webster1,95175,adam123,coonass,159487,slut1,gerasim,monkey99,slutwife,159963,1pass1page,hobiecat,bigtymer,all4you,maggie2,olamide,comcast1,infinit,bailee,vasileva,.ktxrf,asdfghjkl1,12345678912,setter,fuckyou7,nnagqx,lifesuck,draken,austi,feb2000,cable1,1234qwerasdf,hax0red,zxcv12,vlad7788,nosaj,lenovo,underpar,huskies1,lovegirl,feynman,suerte,babaloo,alskdjfhg,oldsmobi,bomber1,redrover,pupuce,methodman,phenom,cutegirl,countyli,gretsch,godisgood,bysunsu,hardhat,mironova,123qwe456rty,rusty123,salut,187211,555666777,11111z,mahesh,rjntyjxtr,br00klyn,dunce1,timebomb,bovine,makelove,littlee,shaven,rizwan,patrick7,42042042,bobbijo,rustem,buttmunc,dongle,tiger69,bluecat,blackhol,shirin,peaces,cherub,cubase,longwood,lotus7,gwju3g,bruin,pzaiu8,green11,uyxnyd,seventee,dragon5,tinkerbel,bluess,bomba,fedorova,joshua2,bodyshop,peluche,gbpacker,shelly1,d1i2m3a4,ghtpbltyn,talons,sergeevna,misato,chrisc,sexmeup,brend,olddog,davros,hazelnut,bridget1,hzze929b,readme,brethart,wild1,ghbdtnbr1,nortel,kinger,royal1,bucky1,allah1,drakkar,emyeuanh,gallaghe,hardtime,jocker,tanman,flavio,abcdef123,leviatha,squid1,skeet,sexse,123456x,mom4u4mm,lilred,djljktq,ocean11,cadaver,baxter1,808state,fighton,primavera,1andrew,moogle,limabean,goddess1,vitalya,blue56,258025,bullride,cicci,1234567d,connor1,gsxr11,oliveoil,leonard1,legsex,gavrik,rjnjgtc,mexicano,2bad4u,goodfellas,ornw6d,mancheste,hawkmoon,zlzfrh,schorsch,g9zns4,bashful,rossi46,stephie,rfhfntkm,sellout,123fuck,stewar1,solnze,00007,thor5200,compaq12,didit,bigdeal,hjlbyf,zebulon,wpf8eu,kamran,emanuele,197500,carvin,ozlq6qwm,3syqo15hil,pennys,epvjb6,asdfghjkl123,198000,nfbcbz,jazzer,asfnhg66,zoloft,albundy,aeiou,getlaid,planet1,gjkbyjxrf,alex2000,brianb,moveon,maggie11,eieio,vcradq,shaggy1,novartis,cocoloco,dunamis,554uzpad,sundrop,1qwertyu,alfie,feliks,briand,123www,red456,addams,fhntv1998,goodhead,theway,javaman,angel01,stratoca,lonsdale,15987532,bigpimpin,skater1,issue43,muffie,yasmina,slowride,crm114,sanity729,himmel,carolcox,bustanut,parabola,masterlo,computador,crackhea,dynastar,rockbott,doggysty,wantsome,bigten,gaelle,juicy1,alaska1,etower,sixnine,suntan,froggies,nokia7610,hunter11,njnets,alicante,buttons1,diosesamo,elizabeth1,chiron,trustnoo,amatuers,tinytim,mechta,sammy2,cthulu,trs8f7,poonam,m6cjy69u35,cookie12,blue25,jordans,santa1,kalinka,mikey123,lebedeva,12345689,kissss,queenbee,vjybnjh,ghostdog,cuckold,bearshare,rjcntyrj,alinochka,ghjcnjrdfibyj,aggie1,teens1,3qvqod,dauren,tonino,hpk2qc,iqzzt580,bears85,nascar88,theboy,njqcw4,masyanya,pn5jvw,intranet,lollone,shadow99,00096462,techie,cvtifhbrb,redeemed,gocanes,62717315,topman,intj3a,cobrajet,antivirus,whyme,berserke,ikilz083,airedale,brandon2,hopkig,johanna1,danil8098,gojira,arthu,vision1,pendragon,milen,chrissie,vampiro,mudder,chris22,blowme69,omega7,surfers,goterps,italy1,baseba11,diego1,gnatsum,birdies,semenov,joker123,zenit2011,wojtek,cab4ma99,watchmen,damia,forgotte,fdm7ed,strummer,freelanc,cingular,orange77,mcdonalds,vjhjpjdf,kariya,tombston,starlet,hawaii1,dantheman,megabyte,nbvjirf,anjing,ybrjkftdbx,hotmom,kazbek,pacific1,sashimi,asd12,coorslig,yvtte545,kitte,elysium,klimenko,cobblers,kamehameha,only4me,redriver,triforce,sidorov,vittoria,fredi,dank420,m1234567,fallout2,989244342a,crazy123,crapola,servus,volvos,1scooter,griffin1,autopass,ownzyou,deviant,george01,2kgwai,boeing74,simhrq,hermosa,hardcor,griffy,rolex1,hackme,cuddles1,master3,bujhtr,aaron123,popolo,blader,1sexyred,gerry1,cronos,ffvdj474,yeehaw,bob1234,carlos2,mike77,buckwheat,ramesh,acls2h,monster2,montess,11qq22ww,lazer,zx123456789,chimpy,masterch,sargon,lochness,archana,1234qwert,hbxfhl,sarahb,altoid,zxcvbn12,dakot,caterham,dolomite,chazz,r29hqq,longone,pericles,grand1,sherbert,eagle3,pudge,irontree,synapse,boome,nogood,summer2,pooki,gangsta1,mahalkit,elenka,lbhtrnjh,dukedog,19922991,hopkins1,evgenia,domino1,x123456,manny1,tabbycat,drake1,jerico,drahcir,kelly2,708090a,facesit,11c645df,mac123,boodog,kalani,hiphop1,critters,hellothere,tbirds,valerka,551scasi,love777,paloalto,mrbrown,duke3d,killa1,arcturus,spider12,dizzy1,smudger,goddog,75395,spammy,1357997531,78678,datalife,zxcvbn123,1122112211,london22,23dp4x,rxmtkp,biggirls,ownsu,lzbs2twz,sharps,geryfe,237081a,golakers,nemesi,sasha1995,pretty1,mittens1,d1lakiss,speedrac,gfhjkmm,sabbat,hellrais,159753258,qwertyuiop123,playgirl,crippler,salma,strat1,celest,hello5,omega5,cheese12,ndeyl5,edward12,soccer3,cheerio,davido,vfrcbr,gjhjctyjr,boscoe,inessa,shithole,ibill,qwepoi,201jedlz,asdlkj,davidk,spawn2,ariel1,michael4,jamie123,romantik,micro1,pittsbur,canibus,katja,muhtar,thomas123,studboy,masahiro,rebrov,patrick8,hotboys,sarge1,1hammer,nnnnn1,eistee,datalore,jackdani,sasha2010,mwq6qlzo,cmfnpu,klausi,cnhjbntkm,andrzej,ilovejen,lindaa,hunter123,vvvvv1,novembe,hamster1,x35v8l,lacey1,1silver,iluvporn,valter,herson,alexsandr,cojones,backhoe,womens,777angel,beatit,klingon1,ta8g4w,luisito,benedikt,maxwel,inspecto,zaq12ws,wladimir,bobbyd,peterj,asdfg12,hellspawn,bitch69,nick1234,golfer23,sony123,jello1,killie,chubby1,kodaira52,yanochka,buckfast,morris1,roaddogg,snakeeye,sex1234,mike22,mmouse,fucker11,dantist,brittan,vfrfhjdf,doc123,plokijuh,emerald1,batman01,serafim,elementa,soccer9,footlong,cthuttdbx,hapkido,eagle123,getsmart,getiton,batman2,masons,mastiff,098890,cfvfhf,james7,azalea,sherif,saun24865709,123red,cnhtrjpf,martina1,pupper,michael5,alan12,shakir,devin1,ha8fyp,palom,mamulya,trippy,deerhunter,happyone,monkey77,3mta3,123456789f,crownvic,teodor,natusik,0137485,vovchik,strutter,triumph1,cvetok,moremone,sonnen,screwbal,akira1,sexnow,pernille,independ,poopies,samapi,kbcbxrf,master22,swetlana,urchin,viper2,magica,slurpee,postit,gilgames,kissarmy,clubpenguin,limpbizk,timber1,celin,lilkim,fuckhard,lonely1,mom123,goodwood,extasy,sdsadee23,foxglove,malibog,clark1,casey2,shell1,odense,balefire,dcunited,cubbie,pierr,solei,161718,bowling1,areyukesc,batboy,r123456,1pionee,marmelad,maynard1,cn42qj,cfvehfq,heathrow,qazxcvbn,connecti,secret123,newfie,xzsawq21,tubitzen,nikusha,enigma1,yfcnz123,1austin,michaelc,splunge,wanger,phantom2,jason2,pain4me,primetime21,babes1,liberte,sugarray,undergro,zonker,labatts,djhjyf,watch1,eagle5,madison2,cntgfirf,sasha2,masterca,fiction7,slick50,bruins1,sagitari,12481632,peniss,insuranc,2b8riedt,12346789,mrclean,ssptx452,tissot,q1w2e3r4t5y6u7,avatar1,comet1,spacer,vbrjkf,pass11,wanker1,14vbqk9p,noshit,money4me,sayana,fish1234,seaways,pipper,romeo123,karens,wardog,ab123456,gorilla1,andrey123,lifesucks,jamesr,4wcqjn,bearman,glock22,matt11,dflbvrf,barbi,maine1,dima1997,sunnyboy,6bjvpe,bangkok1,666666q,rafiki,letmein0,0raziel0,dalla,london99,wildthin,patrycja,skydog,qcactw,tmjxn151,yqlgr667,jimmyd,stripclub,deadwood,863abgsg,horses1,qn632o,scatman,sonia1,subrosa,woland,kolya,charlie4,moleman,j12345,summer11,angel11,blasen,sandal,mynewpas,retlaw,cambria,mustang4,nohack04,kimber45,fatdog,maiden1,bigload,necron,dupont24,ghost123,turbo2,.ktymrf,radagast,balzac,vsevolod,pankaj,argentum,2bigtits,mamabear,bumblebee,mercury7,maddie1,chomper,jq24nc,snooky,pussylic,1lovers,taltos,warchild,diablo66,jojo12,sumerki,aventura,gagger,annelies,drumset,cumshots,azimut,123580,clambake,bmw540,birthday54,psswrd,paganini,wildwest,filibert,teaseme,1test,scampi,thunder5,antosha,purple12,supersex,hhhhhh1,brujah,111222333a,13579a,bvgthfnjh,4506802a,killians,choco,qqqwwweee,raygun,1grand,koetsu13,sharp1,mimi92139,fastfood,idontcare,bluered,chochoz,4z3al0ts,target1,sheffiel,labrat,stalingrad,147123,cubfan,corvett1,holden1,snapper1,4071505,amadeo,pollo,desperados,lovestory,marcopolo,mumbles,familyguy,kimchee,marcio,support1,tekila,shygirl1,trekkie,submissi,ilaria,salam,loveu,wildstar,master69,sales1,netware,homer2,arseniy,gerrity1,raspberr,atreyu,stick1,aldric,tennis12,matahari,alohomora,dicanio,michae1,michaeld,666111,luvbug,boyscout,esmerald,mjordan,admiral1,steamboa,616913,ybhdfyf,557711,555999,sunray,apokalipsis,theroc,bmw330,buzzy,chicos,lenusik,shadowma,eagles05,444222,peartree,qqq123,sandmann,spring1,430799,phatass,andi03,binky1,arsch,bamba,kenny123,fabolous,loser123,poop12,maman,phobos,tecate,myxworld4,metros,cocorico,nokia6120,johnny69,hater,spanked,313233,markos,love2011,mozart1,viktoriy,reccos,331234,hornyone,vitesse,1um83z,55555q,proline,v12345,skaven,alizee,bimini,fenerbahce,543216,zaqqaz,poi123,stabilo,brownie1,1qwerty1,dinesh,baggins1,1234567t,davidkin,friend1,lietuva,octopuss,spooks,12345qq,myshit,buttface,paradoxx,pop123,golfin,sweet69,rfghbp,sambuca,kayak1,bogus1,girlz,dallas12,millers,123456zx,operatio,pravda,eternal1,chase123,moroni,proust,blueduck,harris1,redbarch,996699,1010101,mouche,millenni,1123456,score1,1234565,1234576,eae21157,dave12,pussyy,gfif1991,1598741,hoppy,darrian,snoogins,fartface,ichbins,vfkbyrf,rusrap,2741001,fyfrjylf,aprils,favre,thisis,bannana,serval,wiggum,satsuma,matt123,ivan123,gulmira,123zxc123,oscar2,acces,annie2,dragon0,emiliano,allthat,pajaro,amandine,rawiswar,sinead,tassie,karma1,piggys,nokias,orions,origami,type40,mondo,ferrets,monker,biteme2,gauntlet,arkham,ascona,ingram01,klem1,quicksil,bingo123,blue66,plazma,onfire,shortie,spjfet,123963,thered,fire777,lobito,vball,1chicken,moosehea,elefante,babe23,jesus12,parallax,elfstone,number5,shrooms,freya,hacker1,roxette,snoops,number7,fellini,dtlmvf,chigger,mission1,mitsubis,kannan,whitedog,james01,ghjgecr,rfnfgekmnf,everythi,getnaked,prettybo,sylvan,chiller,carrera4,cowbo,biochem,azbuka,qwertyuiop1,midnight1,informat,audio1,alfred1,0range,sucker1,scott2,russland,1eagle,torben,djkrjlfd,rocky6,maddy1,bonobo,portos,chrissi,xjznq5,dexte,vdlxuc,teardrop,pktmxr,iamtheone,danijela,eyphed,suzuki1,etvww4,redtail,ranger11,mowerman,asshole2,coolkid,adriana1,bootcamp,longcut,evets,npyxr5,bighurt,bassman1,stryder,giblet,nastja,blackadd,topflite,wizar,cumnow,technolo,bassboat,bullitt,kugm7b,maksimus,wankers,mine12,sunfish,pimpin1,shearer9,user1,vjzgjxnf,tycobb,80070633pc,stanly,vitaly,shirley1,cinzia,carolyn1,angeliqu,teamo,qdarcv,aa123321,ragdoll,bonit,ladyluck,wiggly,vitara,jetbalance,12345600,ozzman,dima12345,mybuddy,shilo,satan66,erebus,warrio,090808qwe,stupi,bigdan,paul1234,chiapet,brooks1,philly1,dually,gowest,farmer1,1qa2ws3ed4rf,alberto1,beachboy,barne,aa12345,aliyah,radman,benson1,dfkthbq,highball,bonou2,i81u812,workit,darter,redhook,csfbr5yy,buttlove,episode1,ewyuza,porthos,lalal,abcd12,papero,toosexy,keeper1,silver7,jujitsu,corset,pilot123,simonsay,pinggolf,katerinka,kender,drunk1,fylhjvtlf,rashmi,nighthawk,maggy,juggernaut,larryb,cabibble,fyabcf,247365,gangstar,jaybee,verycool,123456789qw,forbidde,prufrock,12345zxc,malaika,blackbur,docker,filipe,koshechka,gemma1,djamaal,dfcbkmtdf,gangst,9988aa,ducks1,pthrfkj,puertorico,muppets,griffins,whippet,sauber,timofey,larinso,123456789zxc,quicken,qsefth,liteon,headcase,bigdadd,zxc321,maniak,jamesc,bassmast,bigdogs,1girls,123xxx,trajan,lerochka,noggin,mtndew,04975756,domin,wer123,fumanchu,lambada,thankgod,june22,kayaking,patchy,summer10,timepass,poiu1234,kondor,kakka,lament,zidane10,686xqxfg,l8v53x,caveman1,nfvthkfy,holymoly,pepita,alex1996,mifune,fighter1,asslicker,jack22,abc123abc,zaxxon,midnigh,winni,psalm23,punky,monkey22,password13,mymusic,justyna,annushka,lucky5,briann,495rus19,withlove,almaz,supergir,miata,bingbong,bradpitt,kamasutr,yfgjktjy,vanman,pegleg,amsterdam1,123a321,letmein9,shivan,korona,bmw520,annette1,scotsman,gandal,welcome12,sc00by,qpwoei,fred69,m1sf1t,hamburg1,1access,dfkmrbhbz,excalibe,boobies1,fuckhole,karamel,starfuck,star99,breakfas,georgiy,ywvxpz,smasher,fatcat1,allanon,12345n,coondog,whacko,avalon1,scythe,saab93,timon,khorne,atlast,nemisis,brady12,blenheim,52678677,mick7278,9skw5g,fleetwoo,ruger1,kissass,pussy7,scruff,12345l,bigfun,vpmfsz,yxkck878,evgeny,55667788,lickher,foothill,alesis,poppies,77777778,californi,mannie,bartjek,qhxbij,thehulk,xirt2k,angelo4ek,rfkmrekznjh,tinhorse,1david,sparky12,night1,luojianhua,bobble,nederland,rosemari,travi,minou,ciscokid,beehive,565hlgqo,alpine1,samsung123,trainman,xpress,logistic,vw198m2n,hanter,zaqwsx123,qwasz,mariachi,paska,kmg365,kaulitz,sasha12,north1,polarbear,mighty1,makeksa11,123456781,one4all,gladston,notoriou,polniypizdec110211,gosia,grandad,xholes,timofei,invalidp,speaker1,zaharov,maggiema,loislane,gonoles,br5499,discgolf,kaskad,snooper,newman1,belial,demigod,vicky1,pridurok,alex1990,tardis1,cruzer,hornie,sacramen,babycat,burunduk,mark69,oakland1,me1234,gmctruck,extacy,sexdog,putang,poppen,billyd,1qaz2w,loveable,gimlet,azwebitalia,ragtop,198500,qweas,mirela,rock123,11bravo,sprewell,tigrenok,jaredleto,vfhbif,blue2,rimjob,catwalk,sigsauer,loqse,doromich,jack01,lasombra,jonny5,newpassword,profesor,garcia1,123as123,croucher,demeter,4_life,rfhfvtkm,superman2,rogues,assword1,russia1,jeff1,mydream,z123456789,rascal1,darre,kimberl,pickle1,ztmfcq,ponchik,lovesporn,hikari,gsgba368,pornoman,chbjun,choppy,diggity,nightwolf,viktori,camar,vfhecmrf,alisa1,minstrel,wishmaster,mulder1,aleks,gogirl,gracelan,8womys,highwind,solstice,dbrnjhjdyf,nightman,pimmel,beertje,ms6nud,wwfwcw,fx3tuo,poopface,asshat,dirtyd,jiminy,luv2fuck,ptybnxtvgbjy,dragnet,pornogra,10inch,scarlet1,guido1,raintree,v123456,1aaaaaaa,maxim1935,hotwater,gadzooks,playaz,harri,brando1,defcon1,ivanna,123654a,arsenal2,candela,nt5d27,jaime1,duke1,burton1,allstar1,dragos,newpoint,albacore,1236987z,verygoodbot,1wildcat,fishy1,ptktysq,chris11,puschel,itdxtyrj,7kbe9d,serpico,jazzie,1zzzzz,kindbuds,wenef45313,1compute,tatung,sardor,gfyfcjybr,test99,toucan,meteora,lysander,asscrack,jowgnx,hevnm4,suckthis,masha123,karinka,marit,oqglh565,dragon00,vvvbbb,cheburashka,vfrfrf,downlow,unforgiven,p3e85tr,kim123,sillyboy,gold1,golfvr6,quicksan,irochka,froglegs,shortsto,caleb1,tishka,bigtitts,smurfy,bosto,dropzone,nocode,jazzbass,digdug,green7,saltlake,therat,dmitriev,lunita,deaddog,summer0,1212qq,bobbyg,mty3rh,isaac1,gusher,helloman,sugarbear,corvair,extrem,teatime,tujazopi,titanik,efyreg,jo9k2jw2,counchac,tivoli,utjvtnhbz,bebit,jacob6,clayton1,incubus1,flash123,squirter,dima2010,cock1,rawks,komatsu,forty2,98741236,cajun1,madelein,mudhoney,magomed,q111111,qaswed,consense,12345b,bakayaro,silencer,zoinks,bigdic,werwolf,pinkpuss,96321478,alfie1,ali123,sarit,minette,musics,chato,iaapptfcor,cobaka,strumpf,datnigga,sonic123,yfnecbr,vjzctvmz,pasta1,tribbles,crasher,htlbcrf,1tiger,shock123,bearshar,syphon,a654321,cubbies1,jlhanes,eyespy,fucktheworld,carrie1,bmw325is,suzuk,mander,dorina,mithril,hondo1,vfhnbyb,sachem,newton1,12345x,7777755102q,230857z,xxxsex,scubapro,hayastan,spankit,delasoul,searock6,fallout3,nilrem,24681357,pashka,voluntee,pharoh,willo,india1,badboy69,roflmao,gunslinger,lovergir,mama12,melange,640xwfkv,chaton,darkknig,bigman1,aabbccdd,harleyd,birdhouse,giggsy,hiawatha,tiberium,joker7,hello1234,sloopy,tm371855,greendog,solar1,bignose,djohn11,espanol,oswego,iridium,kavitha,pavell,mirjam,cyjdsvujljv,alpha5,deluge,hamme,luntik,turismo,stasya,kjkbnf,caeser,schnecke,tweety1,tralfaz,lambrett,prodigy1,trstno1,pimpshit,werty1,karman,bigboob,pastel,blackmen,matthew8,moomin,q1w2e,gilly,primaver,jimmyg,house2,elviss,15975321,1jessica,monaliza,salt55,vfylfhbyrf,harley11,tickleme,murder1,nurgle,kickass1,theresa1,fordtruck,pargolf,managua,inkognito,sherry1,gotit,friedric,metro2033,slk230,freeport,cigarett,492529,vfhctkm,thebeach,twocats,bakugan,yzerman1,charlieb,motoko,skiman,1234567w,pussy3,love77,asenna,buffie,260zntpc,kinkos,access20,mallard1,fuckyou69,monami,rrrrr1,bigdog69,mikola,1boomer,godzila,ginger2,dima2000,skorpion39,dima1234,hawkdog79,warrior2,ltleirf,supra1,jerusale,monkey01,333z333,666888,kelsey1,w8gkz2x1,fdfnfh,msnxbi,qwe123rty,mach1,monkey3,123456789qq,c123456,nezabudka,barclays,nisse,dasha1,12345678987654321,dima1993,oldspice,frank2,rabbitt,prettyboy,ov3ajy,iamthema,kawasak,banjo1,gtivr6,collants,gondor,hibees,cowboys2,codfish,buster2,purzel,rubyred,kayaker,bikerboy,qguvyt,masher,sseexx,kenshiro,moonglow,semenova,rosari,eduard1,deltaforce,grouper,bongo1,tempgod,1taylor,goldsink,qazxsw1,1jesus,m69fg2w,maximili,marysia,husker1,kokanee,sideout,googl,south1,plumber1,trillian,00001,1357900,farkle,1xxxxx,pascha,emanuela,bagheera,hound1,mylov,newjersey,swampfox,sakic19,torey,geforce,wu4etd,conrail,pigman,martin2,ber02,nascar2,angel69,barty,kitsune,cornet,yes90125,goomba,daking,anthea,sivart,weather1,ndaswf,scoubidou,masterchief,rectum,3364068,oranges1,copter,1samanth,eddies,mimoza,ahfywbz,celtic88,86mets,applemac,amanda11,taliesin,1angel,imhere,london11,bandit12,killer666,beer1,06225930,psylocke,james69,schumach,24pnz6kc,endymion,wookie1,poiu123,birdland,smoochie,lastone,rclaki,olive1,pirat,thunder7,chris69,rocko,151617,djg4bb4b,lapper,ajcuivd289,colole57,shadow7,dallas21,ajtdmw,executiv,dickies,omegaman,jason12,newhaven,aaaaaas,pmdmscts,s456123789,beatri,applesauce,levelone,strapon,benladen,creaven,ttttt1,saab95,f123456,pitbul,54321a,sex12345,robert3,atilla,mevefalkcakk,1johnny,veedub,lilleke,nitsuj,5t6y7u8i,teddys,bluefox,nascar20,vwjetta,buffy123,playstation3,loverr,qweasd12,lover2,telekom,benjamin1,alemania,neutrino,rockz,valjean,testicle,trinity3,realty,firestarter,794613852,ardvark,guadalup,philmont,arnold1,holas,zw6syj,birthday299,dover1,sexxy1,gojets,741236985,cance,blue77,xzibit,qwerty88,komarova,qweszxc,footer,rainger,silverst,ghjcnb,catmando,tatooine,31217221027711,amalgam,69dude,qwerty321,roscoe1,74185,cubby,alfa147,perry1,darock,katmandu,darknight,knicks1,freestuff,45454,kidman,4tlved,axlrose,cutie1,quantum1,joseph10,ichigo,pentium3,rfhectkm,rowdy1,woodsink,justforfun,sveta123,pornografia,mrbean,bigpig,tujheirf,delta9,portsmou,hotbod,kartal,10111213,fkbyf001,pavel1,pistons1,necromancer,verga,c7lrwu,doober,thegame1,hatesyou,sexisfun,1melissa,tuczno18,bowhunte,gobama,scorch,campeon,bruce2,fudge1,herpderp,bacon1,redsky,blackeye,19966991,19992000,ripken8,masturba,34524815,primax,paulina1,vp6y38,427cobra,4dwvjj,dracon,fkg7h4f3v6,longview,arakis,panama1,honda2,lkjhgfdsaz,razors,steels,fqkw5m,dionysus,mariajos,soroka,enriqu,nissa,barolo,king1234,hshfd4n279,holland1,flyer1,tbones,343104ky,modems,tk421,ybrbnrf,pikapp,sureshot,wooddoor,florida2,mrbungle,vecmrf,catsdogs,axolotl,nowayout,francoi,chris21,toenail,hartland,asdjkl,nikkii,onlyyou,buckskin,fnord,flutie,holen1,rincewind,lefty1,ducky1,199000,fvthbrf,redskin1,ryno23,lostlove,19mtpgam19,abercrom,benhur,jordan11,roflcopter,ranma,phillesh,avondale,igromania,p4ssword,jenny123,tttttt1,spycams,cardigan,2112yyz,sleepy1,paris123,mopars,lakers34,hustler1,james99,matrix3,popimp,12pack,eggbert,medvedev,testit,performa,logitec,marija,sexybeast,supermanboy,iwantit,rjktcj,jeffer,svarog,halo123,whdbtp,nokia3230,heyjoe,marilyn1,speeder,ibxnsm,prostock,bennyboy,charmin,codydog,parol999,ford9402,jimmer,crayola,159357258,alex77,joey1,cayuga,phish420,poligon,specops,tarasova,caramelo,draconis,dimon,cyzkhw,june29,getbent,1guitar,jimjam,dictiona,shammy,flotsam,0okm9ijn,crapper,technic,fwsadn,rhfdxtyrj,zaq11qaz,anfield1,159753q,curious1,hip-hop,1iiiii,gfhjkm2,cocteau,liveevil,friskie,crackhead,b1afra,elektrik,lancer1,b0ll0cks,jasond,z1234567,tempest1,alakazam,asdfasd,duffy1,oneday,dinkle,qazedctgb,kasimir,happy7,salama,hondaciv,nadezda,andretti,cannondale,sparticu,znbvjd,blueice,money01,finster,eldar,moosie,pappa,delta123,neruda,bmw330ci,jeanpaul,malibu1,alevtina,sobeit,travolta,fullmetal,enamorad,mausi,boston12,greggy,smurf1,ratrace,ichiban,ilovepus,davidg,wolf69,villa1,cocopuff,football12,starfury,zxc12345,forfree,fairfiel,dreams1,tayson,mike2,dogday,hej123,oldtimer,sanpedro,clicker,mollycat,roadstar,golfe,lvbnhbq1,topdevice,a1b2c,sevastopol,calli,milosc,fire911,pink123,team3x,nolimit5,snickers1,annies,09877890,jewel1,steve69,justin11,autechre,killerbe,browncow,slava1,christer,fantomen,redcloud,elenberg,beautiful1,passw0rd1,nazira,advantag,cockring,chaka,rjpzdrf,99941,az123456,biohazar,energie,bubble1,bmw323,tellme,printer1,glavine,1starwar,coolbeans,april17,carly1,quagmire,admin2,djkujuhfl,pontoon,texmex,carlos12,thermo,vaz2106,nougat,bob666,1hockey,1john,cricke,qwerty10,twinz,totalwar,underwoo,tijger,lildevil,123q321,germania,freddd,1scott,beefy,5t4r3e2w1q,fishbait,nobby,hogger,dnstuff,jimmyc,redknapp,flame1,tinfloor,balla,nfnfhby,yukon1,vixens,batata,danny123,1zxcvbnm,gaetan,homewood,greats,tester1,green99,1fucker,sc0tland,starss,glori,arnhem,goatman,1234asd,supertra,bill123,elguapo,sexylegs,jackryan,usmc69,innow,roaddog,alukard,winter11,crawler,gogiants,rvd420,alessandr,homegrow,gobbler,esteba,valeriy,happy12,1joshua,hawking,sicnarf,waynes,iamhappy,bayadera,august2,sashas,gotti,dragonfire,pencil1,halogen,borisov,bassingw,15975346,zachar,sweetp,soccer99,sky123,flipyou,spots3,xakepy,cyclops1,dragon77,rattolo58,motorhea,piligrim,helloween,dmb2010,supermen,shad0w,eatcum,sandokan,pinga,ufkfrnbrf,roksana,amista,pusser,sony1234,azerty1,1qasw2,ghbdt,q1w2e3r4t5y6u7i8,ktutylf,brehznev,zaebali,shitass,creosote,gjrtvjy,14938685,naughtyboy,pedro123,21crack,maurice1,joesakic,nicolas1,matthew9,lbyfhf,elocin,hfcgbplzq,pepper123,tiktak,mycroft,ryan11,firefly1,arriva,cyecvevhbr,loreal,peedee,jessica8,lisa01,anamari,pionex,ipanema,airbag,frfltvbz,123456789aa,epwr49,casper12,sweethear,sanandreas,wuschel,cocodog,france1,119911,redroses,erevan,xtvgbjy,bigfella,geneve,volvo850,evermore,amy123,moxie,celebs,geeman,underwor,haslo1,joy123,hallow,chelsea0,12435687,abarth,12332145,tazman1,roshan,yummie,genius1,chrisd,ilovelife,seventy7,qaz1wsx2,rocket88,gaurav,bobbyboy,tauchen,roberts1,locksmit,masterof,www111,d9ungl,volvos40,asdasd1,golfers,jillian1,7xm5rq,arwpls4u,gbhcf2,elloco,football2,muerte,bob101,sabbath1,strider1,killer66,notyou,lawnboy,de7mdf,johnnyb,voodoo2,sashaa,homedepo,bravos,nihao123,braindea,weedhead,rajeev,artem1,camille1,rockss,bobbyb,aniston,frnhbcf,oakridge,biscayne,cxfcnm,dressage,jesus3,kellyann,king69,juillet,holliste,h00ters,ripoff,123645,1999ar,eric12,123777,tommi,dick12,bilder,chris99,rulezz,getpaid,chicubs,ender1,byajhvfnbrf,milkshak,sk8board,freakshow,antonella,monolit,shelb,hannah01,masters1,pitbull1,1matthew,luvpussy,agbdlcid,panther2,alphas,euskadi,8318131,ronnie1,7558795,sweetgirl,cookie59,sequoia,5552555,ktyxbr,4500455,money7,severus,shinobu,dbityrf,phisig,rogue2,fractal,redfred,sebastian1,nelli,b00mer,cyberman,zqjphsyf6ctifgu,oldsmobile,redeemer,pimpi,lovehurts,1slayer,black13,rtynfdh,airmax,g00gle,1panther,artemon,nopasswo,fuck1234,luke1,trinit,666000,ziadma,oscardog,davex,hazel1,isgood,demond,james5,construc,555551,january2,m1911a1,flameboy,merda,nathan12,nicklaus,dukester,hello99,scorpio7,leviathan,dfcbktr,pourquoi,vfrcbv123,shlomo,rfcgth,rocky3,ignatz,ajhneyf,roger123,squeek,4815162342a,biskit,mossimo,soccer21,gridlock,lunker,popstar,ghhh47hj764,chutney,nitehawk,vortec,gamma1,codeman,dragula,kappasig,rainbow2,milehigh,blueballs,ou8124me,rulesyou,collingw,mystere,aster,astrovan,firetruck,fische,crawfish,hornydog,morebeer,tigerpaw,radost,144000,1chance,1234567890qwe,gracie1,myopia,oxnard,seminoles,evgeni,edvard,partytim,domani,tuffy1,jaimatadi,blackmag,kzueirf,peternor,mathew1,maggie12,henrys,k1234567,fasted,pozitiv,cfdtkbq,jessica7,goleafs,bandito,girl78,sharingan,skyhigh,bigrob,zorros,poopers,oldschoo,pentium2,gripper,norcal,kimba,artiller,moneymak,00197400,272829,shadow1212,thebull,handbags,all4u2c,bigman2,civics,godisgoo,section8,bandaid,suzanne1,zorba,159123,racecars,i62gbq,rambo123,ironroad,johnson2,knobby,twinboys,sausage1,kelly69,enter2,rhjirf,yessss,james12,anguilla,boutit,iggypop,vovochka,06060,budwiser,romuald,meditate,good1,sandrin,herkules,lakers8,honeybea,11111111a,miche,rangers9,lobster1,seiko,belova,midcon,mackdadd,bigdaddy1,daddie,sepultur,freddy12,damon1,stormy1,hockey2,bailey12,hedimaptfcor,dcowboys,sadiedog,thuggin,horny123,josie1,nikki2,beaver69,peewee1,mateus,viktorija,barrys,cubswin1,matt1234,timoxa,rileydog,sicilia,luckycat,candybar,julian1,abc456,pussylip,phase1,acadia,catty,246800,evertonf,bojangle,qzwxec,nikolaj,fabrizi,kagome,noncapa0,marle,popol,hahaha1,cossie,carla10,diggers,spankey,sangeeta,cucciolo,breezer,starwar1,cornholio,rastafari,spring99,yyyyyyy1,webstar,72d5tn,sasha1234,inhouse,gobuffs,civic1,redstone,234523,minnie1,rivaldo,angel5,sti2000,xenocide,11qq11,1phoenix,herman1,holly123,tallguy,sharks1,madri,superbad,ronin,jalal123,hardbody,1234567r,assman1,vivahate,buddylee,38972091,bonds25,40028922,qrhmis,wp2005,ceejay,pepper01,51842543,redrum1,renton,varadero,tvxtjk7r,vetteman,djhvbrc,curly1,fruitcak,jessicas,maduro,popmart,acuari,dirkpitt,buick1,bergerac,golfcart,pdtpljxrf,hooch1,dudelove,d9ebk7,123452000,afdjhbn,greener,123455432,parachut,mookie12,123456780,jeepcj5,potatoe,sanya,qwerty2010,waqw3p,gotika,freaky1,chihuahu,buccanee,ecstacy,crazyboy,slickric,blue88,fktdnbyf,2004rj,delta4,333222111,calient,ptbdhw,1bailey,blitz1,sheila1,master23,hoagie,pyf8ah,orbita,daveyboy,prono1,delta2,heman,1horny,tyrik123,ostrov,md2020,herve,rockfish,el546218,rfhbyjxrf,chessmaster,redmoon,lenny1,215487,tomat,guppy,amekpass,amoeba,my3girls,nottingh,kavita,natalia1,puccini,fabiana,8letters,romeos,netgear,casper2,taters,gowings,iforgot1,pokesmot,pollit,lawrun,petey1,rosebuds,007jr,gthtcnhjqrf,k9dls02a,neener,azertyu,duke11,manyak,tiger01,petros,supermar,mangas,twisty,spotter,takagi,dlanod,qcmfd454,tusymo,zz123456,chach,navyblue,gilbert1,2kash6zq,avemaria,1hxboqg2s,viviane,lhbjkjubz2957704,nowwowtg,1a2b3c4,m0rn3,kqigb7,superpuper,juehtw,gethigh,theclown,makeme,pradeep,sergik,deion21,nurik,devo2706,nbvibt,roman222,kalima,nevaeh,martin7,anathema,florian1,tamwsn3sja,dinmamma,133159,123654q,slicks,pnp0c08,yojimbo,skipp,kiran,pussyfuck,teengirl,apples12,myballs,angeli,1234a,125678,opelastra,blind1,armagedd,fish123,pitufo,chelseaf,thedevil,nugget1,cunt69,beetle1,carter15,apolon,collant,password00,fishboy,djkrjdf,deftone,celti,three11,cyrus1,lefthand,skoal1,ferndale,aries1,fred01,roberta1,chucks,cornbread,lloyd1,icecrea,cisco123,newjerse,vfhrbpf,passio,volcom1,rikimaru,yeah11,djembe,facile,a1l2e3x4,batman7,nurbol,lorenzo1,monica69,blowjob1,998899,spank1,233391,n123456,1bear,bellsout,999998,celtic67,sabre1,putas,y9enkj,alfabeta,heatwave,honey123,hard4u,insane1,xthysq,magnum1,lightsaber,123qweqwe,fisher1,pixie1,precios,benfic,thegirls,bootsman,4321rewq,nabokov,hightime,djghjc,1chelsea,junglist,august16,t3fkvkmj,1232123,lsdlsd12,chuckie1,pescado,granit,toogood,cathouse,natedawg,bmw530,123kid,hajime,198400,engine1,wessonnn,kingdom1,novembre,1rocks,kingfisher,qwerty89,jordan22,zasranec,megat,sucess,installutil,fetish01,yanshi1982,1313666,1314520,clemence,wargod,time1,newzealand,snaker,13324124,cfrehf,hepcat,mazahaka,bigjay,denisov,eastwest,1yellow,mistydog,cheetos,1596357,ginger11,mavrik,bubby1,bhbyf,pyramide,giusepp,luthien,honda250,andrewjackie,kentavr,lampoon,zaq123wsx,sonicx,davidh,1ccccc,gorodok,windsong,programm,blunt420,vlad1995,zxcvfdsa,tarasov,mrskin,sachas,mercedes1,koteczek,rawdog,honeybear,stuart1,kaktys,richard7,55555n,azalia,hockey10,scouter,francy,1xxxxxx,julie456,tequilla,penis123,schmoe,tigerwoods,1ferrari,popov,snowdrop,matthieu,smolensk,cornflak,jordan01,love2000,23wesdxc,kswiss,anna2000,geniusnet,baby2000,33ds5x,waverly,onlyone4,networkingpe,raven123,blesse,gocards,wow123,pjflkork,juicey,poorboy,freeee,billybo,shaheen,zxcvbnm.,berlit,truth1,gepard,ludovic,gunther1,bobby2,bob12345,sunmoon,septembr,bigmac1,bcnjhbz,seaking,all4u,12qw34er56ty,bassie,nokia5228,7355608,sylwia,charvel,billgate,davion,chablis,catsmeow,kjiflrf,amylynn,rfvbkkf,mizredhe,handjob,jasper12,erbol,solara,bagpipe,biffer,notime,erlan,8543852,sugaree,oshkosh,fedora,bangbus,5lyedn,longball,teresa1,bootyman,aleksand,qazwsxedc12,nujbhc,tifosi,zpxvwy,lights1,slowpoke,tiger12,kstate,password10,alex69,collins1,9632147,doglover,baseball2,security1,grunts,orange2,godloves,213qwe879,julieb,1qazxsw23edcvfr4,noidea,8uiazp,betsy1,junior2,parol123,123456zz,piehonkii,kanker,bunky,hingis,reese1,qaz123456,sidewinder,tonedup,footsie,blackpoo,jalapeno,mummy1,always1,josh1,rockyboy,plucky,chicag,nadroj,blarney,blood123,wheaties,packer1,ravens1,mrjones,gfhjkm007,anna2010,awatar,guitar12,hashish,scale1,tomwaits,amrita,fantasma,rfpfym,pass2,tigris,bigair,slicker,sylvi,shilpa,cindylou,archie1,bitches1,poppys,ontime,horney1,camaroz28,alladin,bujhm,cq2kph,alina1,wvj5np,1211123a,tetons,scorelan,concordi,morgan2,awacs,shanty,tomcat14,andrew123,bear69,vitae,fred99,chingy,octane,belgario,fatdaddy,rhodan,password23,sexxes,boomtown,joshua01,war3demo,my2kids,buck1,hot4you,monamour,12345aa,yumiko,parool,carlton1,neverland,rose12,right1,sociald,grouse,brandon0,cat222,alex00,civicex,bintang,malkav,arschloc,dodgeviper,qwerty666,goduke,dante123,boss1,ontheroc,corpsman,love14,uiegu451,hardtail,irondoor,ghjrehfnehf,36460341,konijn,h2slca,kondom25,123456ss,cfytxrf,btnjey,nando,freemail,comander,natas666,siouxsie,hummer1,biomed,dimsum,yankees0,diablo666,lesbian1,pot420,jasonm,glock23,jennyb,itsmine,lena2010,whattheh,beandip,abaddon,kishore,signup,apogee,biteme12,suzieq,vgfun4,iseeyou,rifleman,qwerta,4pussy,hawkman,guest1,june17,dicksuck,bootay,cash12,bassale,ktybyuhfl,leetch,nescafe,7ovtgimc,clapton1,auror,boonie,tracker1,john69,bellas,cabinboy,yonkers,silky1,ladyffesta,drache,kamil1,davidp,bad123,snoopy12,sanche,werthvfy,achille,nefertiti,gerald1,slage33,warszawa,macsan26,mason123,kotopes,welcome8,nascar99,kiril,77778888,hairy1,monito,comicsans,81726354,killabee,arclight,yuo67,feelme,86753099,nnssnn,monday12,88351132,88889999,websters,subito,asdf12345,vaz2108,zvbxrpl,159753456852,rezeda,multimed,noaccess,henrique,tascam,captiva,zadrot,hateyou,sophie12,123123456,snoop1,charlie8,birmingh,hardline,libert,azsxdcf,89172735872,rjpthju,bondar,philips1,olegnaruto,myword,yakman,stardog,banana12,1234567890w,farout,annick,duke01,rfj422,billard,glock19,shaolin1,master10,cinderel,deltaone,manning1,biggreen,sidney1,patty1,goforit1,766rglqy,sevendus,aristotl,armagedo,blumen,gfhfyjz,kazakov,lekbyxxx,accord1,idiota,soccer16,texas123,victoire,ololo,chris01,bobbbb,299792458,eeeeeee1,confiden,07070,clarks,techno1,kayley,stang1,wwwwww1,uuuuu1,neverdie,jasonr,cavscout,481516234,mylove1,shaitan,1qazxcvb,barbaros,123456782000,123wer,thissucks,7seven,227722,faerie,hayduke,dbacks,snorkel,zmxncbv,tiger99,unknown1,melmac,polo1234,sssssss1,1fire,369147,bandung,bluejean,nivram,stanle,ctcnhf,soccer20,blingbli,dirtball,alex2112,183461,skylin,boobman,geronto,brittany1,yyz2112,gizmo69,ktrcec,dakota12,chiken,sexy11,vg08k714,bernadet,1bulldog,beachs,hollyb,maryjoy,margo1,danielle1,chakra,alexand,hullcity,matrix12,sarenna,pablos,antler,supercar,chomsky,german1,airjordan,545ettvy,camaron,flight1,netvideo,tootall,valheru,481516,1234as,skimmer,redcross,inuyash,uthvfy,1012nw,edoardo,bjhgfi,golf11,9379992a,lagarto,socball,boopie,krazy,.adgjmptw,gaydar,kovalev,geddylee,firstone,turbodog,loveee,135711,badbo,trapdoor,opopop11,danny2,max2000,526452,kerry1,leapfrog,daisy2,134kzbip,1andrea,playa1,peekab00,heskey,pirrello,gsewfmck,dimon4ik,puppie,chelios,554433,hypnodanny,fantik,yhwnqc,ghbdtngjrf,anchorag,buffett1,fanta,sappho,024680,vialli,chiva,lucylu,hashem,exbntkm,thema,23jordan,jake11,wildside,smartie,emerica,2wj2k9oj,ventrue,timoth,lamers,baerchen,suspende,boobis,denman85,1adam12,otello,king12,dzakuni,qsawbbs,isgay,porno123,jam123,daytona1,tazzie,bunny123,amaterasu,jeffre,crocus,mastercard,bitchedup,chicago7,aynrand,intel1,tamila,alianza,mulch,merlin12,rose123,alcapone,mircea,loveher,joseph12,chelsea6,dorothy1,wolfgar,unlimite,arturik,qwerty3,paddy1,piramid,linda123,cooool,millie1,warlock1,forgotit,tort02,ilikeyou,avensis,loveislife,dumbass1,clint1,2110se,drlove,olesia,kalinina,sergey123,123423,alicia1,markova,tri5a3,media1,willia1,xxxxxxx1,beercan,smk7366,jesusislord,motherfuck,smacker,birthday5,jbaby,harley2,hyper1,a9387670a,honey2,corvet,gjmptw,rjhjkmbien,apollon,madhuri,3a5irt,cessna17,saluki,digweed,tamia1,yja3vo,cfvlehfr,1111111q,martyna,stimpy1,anjana,yankeemp,jupiler,idkfa,1blue,fromv,afric,3xbobobo,liverp00l,nikon1,amadeus1,acer123,napoleo,david7,vbhjckfdf,mojo69,percy1,pirates1,grunt1,alenushka,finbar,zsxdcf,mandy123,1fred,timewarp,747bbb,druids,julia123,123321qq,spacebar,dreads,fcbarcelona,angela12,anima,christopher1,stargazer,123123s,hockey11,brewski,marlbor,blinker,motorhead,damngood,werthrf,letmein3,moremoney,killer99,anneke,eatit,pilatus,andrew01,fiona1,maitai,blucher,zxgdqn,e5pftu,nagual,panic1,andron,openwide,alphabeta,alison1,chelsea8,fende,mmm666,1shot2,a19l1980,123456@,1black,m1chael,vagner,realgood,maxxx,vekmnbr,stifler,2509mmh,tarkan,sherzod,1234567b,gunners1,artem2010,shooby,sammie1,p123456,piggie,abcde12345,nokia6230,moldir,piter,1qaz3edc,frequenc,acuransx,1star,nikeair,alex21,dapimp,ranjan,ilovegirls,anastasiy,berbatov,manso,21436587,leafs1,106666,angelochek,ingodwetrust,123456aaa,deano,korsar,pipetka,thunder9,minka,himura,installdevic,1qqqqq,digitalprodu,suckmeoff,plonker,headers,vlasov,ktr1996,windsor1,mishanya,garfield1,korvin,littlebit,azaz09,vandamme,scripto,s4114d,passward,britt1,r1chard,ferrari5,running1,7xswzaq,falcon2,pepper76,trademan,ea53g5,graham1,volvos80,reanimator,micasa,1234554321q,kairat,escorpion,sanek94,karolina1,kolovrat,karen2,1qaz@wsx,racing1,splooge,sarah2,deadman1,creed1,nooner,minicoop,oceane,room112,charme,12345ab,summer00,wetcunt,drewman,nastyman,redfire,appels,merlin69,dolfin,bornfree,diskette,ohwell,12345678qwe,jasont,madcap,cobra2,dolemit1,whatthehell,juanit,voldemar,rocke,bianc,elendil,vtufgjkbc,hotwheels,spanis,sukram,pokerface,k1ller,freakout,dontae,realmadri,drumss,gorams,258789,snakey,jasonn,whitewolf,befree,johnny99,pooka,theghost,kennys,vfvektxrf,toby1,jumpman23,deadlock,barbwire,stellina,alexa1,dalamar,mustanggt,northwes,tesoro,chameleo,sigtau,satoshi,george11,hotcum,cornell1,golfer12,geek01d,trololo,kellym,megapolis,pepsi2,hea666,monkfish,blue52,sarajane,bowler1,skeets,ddgirls,hfccbz,bailey01,isabella1,dreday,moose123,baobab,crushme,000009,veryhot,roadie,meanone,mike18,henriett,dohcvtec,moulin,gulnur,adastra,angel9,western1,natura,sweetpe,dtnfkm,marsbar,daisys,frogger1,virus1,redwood1,streetball,fridolin,d78unhxq,midas,michelob,cantik,sk2000,kikker,macanudo,rambone,fizzle,20000,peanuts1,cowpie,stone32,astaroth,dakota01,redso,mustard1,sexylove,giantess,teaparty,bobbin,beerbong,monet1,charles3,anniedog,anna1988,cameleon,longbeach,tamere,qpful542,mesquite,waldemar,12345zx,iamhere,lowboy,canard,granp,daisymay,love33,moosejaw,nivek,ninjaman,shrike01,aaa777,88002000600,vodolei,bambush,falcor,harley69,alphaomega,severine,grappler,bosox,twogirls,gatorman,vettes,buttmunch,chyna,excelsio,crayfish,birillo,megumi,lsia9dnb9y,littlebo,stevek,hiroyuki,firehous,master5,briley2,gangste,chrisk,camaleon,bulle,troyboy,froinlaven,mybutt,sandhya,rapala,jagged,crazycat,lucky12,jetman,wavmanuk,1heather,beegee,negril,mario123,funtime1,conehead,abigai,mhorgan,patagoni,travel1,backspace,frenchfr,mudcat,dashenka,baseball3,rustys,741852kk,dickme,baller23,griffey1,suckmycock,fuhrfzgc,jenny2,spuds,berlin1,justfun,icewind,bumerang,pavlusha,minecraft123,shasta1,ranger12,123400,twisters,buthead,miked,finance1,dignity7,hello9,lvjdp383,jgthfnjh,dalmatio,paparoach,miller31,2bornot2b,fathe,monterre,theblues,satans,schaap,jasmine2,sibelius,manon,heslo,jcnhjd,shane123,natasha2,pierrot,bluecar,iloveass,harriso,red12,london20,job314,beholder,reddawg,fuckyou!,pussylick,bologna1,austintx,ole4ka,blotto,onering,jearly,balbes,lightbul,bighorn,crossfir,lee123,prapor,1ashley,gfhjkm22,wwe123,09090,sexsite,marina123,jagua,witch1,schmoo,parkview,dragon3,chilango,ultimo,abramova,nautique,2bornot2,duende,1arthur,nightwing,surfboar,quant4307,15s9pu03,karina1,shitball,walleye1,wildman1,whytesha,1morgan,my2girls,polic,baranova,berezuckiy,kkkkkk1,forzima,fornow,qwerty02,gokart,suckit69,davidlee,whatnow,edgard,tits1,bayshore,36987412,ghbphfr,daddyy,explore1,zoidberg,5qnzjx,morgane,danilov,blacksex,mickey12,balsam,83y6pv,sarahc,slaye,all4u2,slayer69,nadia1,rlzwp503,4cranker,kaylie,numberon,teremok,wolf12,deeppurple,goodbeer,aaa555,66669999,whatif,harmony1,ue8fpw,3tmnej,254xtpss,dusty197,wcksdypk,zerkalo,dfnheirf,motorol,digita,whoareyou,darksoul,manics,rounders,killer11,d2000lb,cegthgfhjkm,catdog1,beograd,pepsico,julius1,123654987,softbal,killer23,weasel1,lifeson,q123456q,444555666,bunches,andy1,darby1,service01,bear11,jordan123,amega,duncan21,yensid,lerxst,rassvet,bronco2,fortis,pornlove,paiste,198900,asdflkjh,1236547890,futur,eugene1,winnipeg261,fk8bhydb,seanjohn,brimston,matthe1,bitchedu,crisco,302731,roxydog,woodlawn,volgograd,ace1210,boy4u2ownnyc,laura123,pronger,parker12,z123456z,andrew13,longlife,sarang,drogba,gobruins,soccer4,holida,espace,almira,murmansk,green22,safina,wm00022,1chevy,schlumpf,doroth,ulises,golf99,hellyes,detlef,mydog,erkina,bastardo,mashenka,sucram,wehttam,generic1,195000,spaceboy,lopas123,scammer,skynyrd,daddy2,titani,ficker,cr250r,kbnthfnehf,takedown,sticky1,davidruiz,desant,nremtp,painter1,bogies,agamemno,kansas1,smallfry,archi,2b4dnvsx,1player,saddie,peapod,6458zn7a,qvw6n2,gfxqx686,twice2,sh4d0w3d,mayfly,375125,phitau,yqmbevgk,89211375759,kumar1,pfhfpf,toyboy,way2go,7pvn4t,pass69,chipster,spoony,buddycat,diamond3,rincewin,hobie,david01,billbo,hxp4life,matild,pokemon2,dimochka,clown1,148888,jenmt3,cuxldv,cqnwhy,cde34rfv,simone1,verynice,toobig,pasha123,mike00,maria2,lolpop,firewire,dragon9,martesana,a1234567890,birthday3,providen,kiska,pitbulls,556655,misawa,damned69,martin11,goldorak,gunship,glory1,winxclub,sixgun,splodge,agent1,splitter,dome69,ifghjb,eliza1,snaiper,wutang36,phoenix7,666425,arshavin,paulaner,namron,m69fg1w,qwert1234,terrys,zesyrmvu,joeman,scoots,dwml9f,625vrobg,sally123,gostoso,symow8,pelota,c43qpul5rz,majinbuu,lithium1,bigstuff,horndog1,kipelov,kringle,1beavis,loshara,octobe,jmzacf,12342000,qw12qw,runescape1,chargers1,krokus,piknik,jessy,778811,gjvbljh,474jdvff,pleaser,misskitty,breaker1,7f4df451,dayan,twinky,yakumo,chippers,matia,tanith,len2ski1,manni,nichol1,f00b4r,nokia3110,standart,123456789i,shami,steffie,larrywn,chucker,john99,chamois,jjjkkk,penmouse,ktnj2010,gooners,hemmelig,rodney1,merlin01,bearcat1,1yyyyy,159753z,1fffff,1ddddd,thomas11,gjkbyrf,ivanka,f1f2f3,petrovna,phunky,conair,brian2,creative1,klipsch,vbitymrf,freek,breitlin,cecili,westwing,gohabsgo,tippmann,1steve,quattro6,fatbob,sp00ky,rastas,1123581,redsea,rfnmrf,jerky1,1aaaaaa,spk666,simba123,qwert54321,123abcd,beavis69,fyfyfc,starr1,1236547,peanutbutter,sintra,12345abcde,1357246,abcde1,climbon,755dfx,mermaids,monte1,serkan,geilesau,777win,jasonc,parkside,imagine1,rockhead,producti,playhard,principa,spammer,gagher,escada,tsv1860,dbyjuhfl,cruiser1,kennyg,montgome,2481632,pompano,cum123,angel6,sooty,bear01,april6,bodyhamm,pugsly,getrich,mikes,pelusa,fosgate,jasonp,rostislav,kimberly1,128mo,dallas11,gooner1,manuel1,cocacola1,imesh,5782790,password8,daboys,1jones,intheend,e3w2q1,whisper1,madone,pjcgujrat,1p2o3i,jamesp,felicida,nemrac,phikap,firecat,jrcfyjxrf,matt12,bigfan,doedel,005500,jasonx,1234567k,badfish,goosey,utjuhfabz,wilco,artem123,igor123,spike123,jor23dan,dga9la,v2jmsz,morgan12,avery1,dogstyle,natasa,221195ws,twopac,oktober7,karthik,poop1,mightymo,davidr,zermatt,jehova,aezakmi1,dimwit,monkey5,serega123,qwerty111,blabl,casey22,boy123,1clutch,asdfjkl1,hariom,bruce10,jeep95,1smith,sm9934,karishma,bazzzz,aristo,669e53e1,nesterov,kill666,fihdfv,1abc2,anna1,silver11,mojoman,telefono,goeagles,sd3lpgdr,rfhfynby,melinda1,llcoolj,idteul,bigchief,rocky13,timberwo,ballers,gatekeep,kashif,hardass,anastasija,max777,vfuyjkbz,riesling,agent99,kappas,dalglish,tincan,orange3,turtoise,abkbvjy,mike24,hugedick,alabala,geolog,aziza,devilboy,habanero,waheguru,funboy,freedom5,natwest,seashore,impaler,qwaszx1,pastas,bmw535,tecktonik,mika00,jobsearc,pinche,puntang,aw96b6,1corvett,skorpio,foundati,zzr1100,gembird,vfnhjcrby,soccer18,vaz2110,peterp,archer1,cross1,samedi,dima1992,hunter99,lipper,hotbody,zhjckfdf,ducati1,trailer1,04325956,cheryl1,benetton,kononenko,sloneczko,rfgtkmrf,nashua,balalaika,ampere,eliston,dorsai,digge,flyrod,oxymoron,minolta,ironmike,majortom,karimov,fortun,putaria,an83546921an13,blade123,franchis,mxaigtg5,dynxyu,devlt4,brasi,terces,wqmfuh,nqdgxz,dale88,minchia,seeyou,housepen,1apple,1buddy,mariusz,bighouse,tango2,flimflam,nicola1,qwertyasd,tomek1,shumaher,kartoshka,bassss,canaries,redman1,123456789as,preciosa,allblacks,navidad,tommaso,beaudog,forrest1,green23,ryjgjxrf,go4it,ironman2,badnews,butterba,1grizzly,isaeva,rembrand,toront,1richard,bigjon,yfltymrf,1kitty,4ng62t,littlejo,wolfdog,ctvtyjd,spain1,megryan,tatertot,raven69,4809594q,tapout,stuntman,a131313,lagers,hotstuf,lfdbl11,stanley2,advokat,boloto,7894561,dooker,adxel187,cleodog,4play,0p9o8i,masterb,bimota,charlee,toystory,6820055,6666667,crevette,6031769,corsa,bingoo,dima1990,tennis11,samuri,avocado,melissa6,unicor,habari,metart,needsex,cockman,hernan,3891576,3334444,amigo1,gobuffs2,mike21,allianz,2835493,179355,midgard,joey123,oneluv,ellis1,towncar,shonuff,scouse,tool69,thomas19,chorizo,jblaze,lisa1,dima1999,sophia1,anna1989,vfvekbxrf,krasavica,redlegs,jason25,tbontb,katrine,eumesmo,vfhufhbnrf,1654321,asdfghj1,motdepas,booga,doogle,1453145,byron1,158272,kardinal,tanne,fallen1,abcd12345,ufyljy,n12345,kucing,burberry,bodger,1234578,februar,1234512,nekkid,prober,harrison1,idlewild,rfnz90,foiegras,pussy21,bigstud,denzel,tiffany2,bigwill,1234567890zzz,hello69,compute1,viper9,hellspaw,trythis,gococks,dogballs,delfi,lupine,millenia,newdelhi,charlest,basspro,1mike,joeblack,975310,1rosebud,batman11,misterio,fucknut,charlie0,august11,juancho,ilonka,jigei743ks,adam1234,889900,goonie,alicat,ggggggg1,1zzzzzzz,sexywife,northstar,chris23,888111,containe,trojan1,jason5,graikos,1ggggg,1eeeee,tigers01,indigo1,hotmale,jacob123,mishima,richard3,cjxb2014,coco123,meagain,thaman,wallst,edgewood,bundas,1power,matilda1,maradon,hookedup,jemima,r3vi3wpass,2004-10-,mudman,taz123,xswzaq,emerson1,anna21,warlord1,toering,pelle,tgwdvu,masterb8,wallstre,moppel,priora,ghjcnjrdfif,yoland,12332100,1j9e7f6f,jazzzz,yesman,brianm,42qwerty42,12345698,darkmanx,nirmal,john31,bb123456,neuspeed,billgates,moguls,fj1200,hbhlair,shaun1,ghbdfn,305pwzlr,nbu3cd,susanb,pimpdad,mangust6403,joedog,dawidek,gigante,708090,703751,700007,ikalcr,tbivbn,697769,marvi,iyaayas,karen123,jimmyboy,dozer1,e6z8jh,bigtime1,getdown,kevin12,brookly,zjduc3,nolan1,cobber,yr8wdxcq,liebe,m1garand,blah123,616879,action1,600000,sumitomo,albcaz,asian1,557799,dave69,556699,sasa123,streaker,michel1,karate1,buddy7,daulet,koks888,roadtrip,wapiti,oldguy,illini1,1234qq,mrspock,kwiatek,buterfly,august31,jibxhq,jackin,taxicab,tristram,talisker,446655,444666,chrisa,freespace,vfhbfyyf,chevell,444333,notyours,442244,christian1,seemore,sniper12,marlin1,joker666,multik,devilish,crf450,cdfoli,eastern1,asshead,duhast,voyager2,cyberia,1wizard,cybernet,iloveme1,veterok,karandash,392781,looksee,diddy,diabolic,foofight,missey,herbert1,bmw318i,premier1,zsfmpv,eric1234,dun6sm,fuck11,345543,spudman,lurker,bitem,lizzy1,ironsink,minami,339311,s7fhs127,sterne,332233,plankton,galax,azuywe,changepa,august25,mouse123,sikici,killer69,xswqaz,quovadis,gnomik,033028pw,777777a,barrakuda,spawn666,goodgod,slurp,morbius,yelnats,cujo31,norman1,fastone,earwig,aureli,wordlife,bnfkbz,yasmi,austin123,timberla,missy2,legalize,netcom,liljon,takeit,georgin,987654321z,warbird,vitalina,all4u3,mmmmmm1,bichon,ellobo,wahoos,fcazmj,aksarben,lodoss,satnam,vasili,197800,maarten,sam138989,0u812,ankita,walte,prince12,anvils,bestia,hoschi,198300,univer,jack10,ktyecbr,gr00vy,hokie,wolfman1,fuckwit,geyser,emmanue,ybrjkftd,qwerty33,karat,dblock,avocat,bobbym,womersle,1please,nostra,dayana,billyray,alternat,iloveu1,qwerty69,rammstein1,mystikal,winne,drawde,executor,craxxxs,ghjcnjnf,999888777,welshman,access123,963214785,951753852,babe69,fvcnthlfv,****me,666999666,testing2,199200,nintendo64,oscarr,guido8,zhanna,gumshoe,jbird,159357456,pasca,123452345,satan6,mithrand,fhbirf,aa1111aa,viggen,ficktjuv,radial9,davids1,rainbow7,futuro,hipho,platin,poppy123,rhenjq,fulle,rosit,chicano,scrumpy,lumpy1,seifer,uvmrysez,autumn1,xenon,susie1,7u8i9o0p,gamer1,sirene,muffy1,monkeys1,kalinin,olcrackmaster,hotmove,uconn,gshock,merson,lthtdyz,pizzaboy,peggy1,pistache,pinto1,fishka,ladydi,pandor,baileys,hungwell,redboy,rookie1,amanda01,passwrd,clean1,matty1,tarkus,jabba1,bobster,beer30,solomon1,moneymon,sesamo,fred11,sunnysid,jasmine5,thebears,putamadre,workhard,flashbac,counter1,liefde,magnat,corky1,green6,abramov,lordik,univers,shortys,david3,vip123,gnarly,1234567s,billy2,honkey,deathstar,grimmy,govinda,direktor,12345678s,linus1,shoppin,rekbrjdf,santeria,prett,berty75,mohican,daftpunk,uekmyfhf,chupa,strats,ironbird,giants56,salisbur,koldun,summer04,pondscum,jimmyj,miata1,george3,redshoes,weezie,bartman1,0p9o8i7u,s1lver,dorkus,125478,omega9,sexisgood,mancow,patric1,jetta1,074401,ghjuhtcc,gfhjk,bibble,terry2,123213,medicin,rebel2,hen3ry,4freedom,aldrin,lovesyou,browny,renwod,winnie1,belladon,1house,tyghbn,blessme,rfhfrfnbwf,haylee,deepdive,booya,phantasy,gansta,cock69,4mnveh,gazza1,redapple,structur,anakin1,manolito,steve01,poolman,chloe123,vlad1998,qazwsxe,pushit,random123,ontherocks,o236nq,brain1,dimedrol,agape,rovnogod,1balls,knigh,alliso,love01,wolf01,flintstone,beernuts,tuffguy,isengard,highfive,alex23,casper99,rubina,getreal,chinita,italian1,airsoft,qwerty23,muffdiver,willi1,grace123,orioles1,redbull1,chino1,ziggy123,breadman,estefan,ljcneg,gotoit,logan123,wideglid,mancity1,treess,qwe123456,kazumi,qweasdqwe,oddworld,naveed,protos,towson,a801016,godislov,at_asp,bambam1,soccer5,dark123,67vette,carlos123,hoser1,scouser,wesdxc,pelus,dragon25,pflhjn,abdula,1freedom,policema,tarkin,eduardo1,mackdad,gfhjkm11,lfplhfgthvf,adilet,zzzzxxxx,childre,samarkand,cegthgegth,shama,fresher,silvestr,greaser,allout,plmokn,sexdrive,nintendo1,fantasy7,oleander,fe126fd,crumpet,pingzing,dionis,hipster,yfcnz,requin,calliope,jerome1,housecat,abc123456789,doghot,snake123,augus,brillig,chronic1,gfhjkbot,expediti,noisette,master7,caliban,whitetai,favorite3,lisamari,educatio,ghjhjr,saber1,zcegth,1958proman,vtkrbq,milkdud,imajica,thehip,bailey10,hockey19,dkflbdjcnjr,j123456,bernar,aeiouy,gamlet,deltachi,endzone,conni,bcgfybz,brandi1,auckland2010,7653ajl1,mardigra,testuser,bunko18,camaro67,36936,greenie,454dfmcq,6xe8j2z4,mrgreen,ranger5,headhunt,banshee1,moonunit,zyltrc,hello3,pussyboy,stoopid,tigger11,yellow12,drums1,blue02,kils123,junkman,banyan,jimmyjam,tbbucs,sportster,badass1,joshie,braves10,lajolla,1amanda,antani,78787,antero,19216801,chich,rhett32,sarahm,beloit,sucker69,corkey,nicosnn,rccola,caracol,daffyduc,bunny2,mantas,monkies,hedonist,cacapipi,ashton1,sid123,19899891,patche,greekgod,cbr1000,leader1,19977991,ettore,chongo,113311,picass,cfif123,rhtfnbd,frances1,andy12,minnette,bigboy12,green69,alices,babcia,partyboy,javabean,freehand,qawsed123,xxx111,harold1,passwo,jonny1,kappa1,w2dlww3v5p,1merlin,222999,tomjones,jakeman,franken,markhegarty,john01,carole1,daveman,caseys,apeman,mookey,moon123,claret,titans1,residentevil,campari,curitiba,dovetail,aerostar,jackdaniels,basenji,zaq12w,glencoe,biglove,goober12,ncc170,far7766,monkey21,eclipse9,1234567v,vanechka,aristote,grumble,belgorod,abhishek,neworleans,pazzword,dummie,sashadog,diablo11,mst3000,koala1,maureen1,jake99,isaiah1,funkster,gillian1,ekaterina20,chibears,astra123,4me2no,winte,skippe,necro,windows9,vinograd,demolay,vika2010,quiksilver,19371ayj,dollar1,shecky,qzwxecrv,butterfly1,merrill1,scoreland,1crazy,megastar,mandragora,track1,dedhed,jacob2,newhope,qawsedrftgyh,shack1,samvel,gatita,shyster,clara1,telstar,office1,crickett,truls,nirmala,joselito,chrisl,lesnik,aaaabbbb,austin01,leto2010,bubbie,aaa12345,widder,234432,salinger,mrsmith,qazsedcft,newshoes,skunks,yt1300,bmw316,arbeit,smoove,123321qweewq,123qazwsx,22221111,seesaw,0987654321a,peach1,1029384756q,sereda,gerrard8,shit123,batcave,energy1,peterb,mytruck,peter12,alesya,tomato1,spirou,laputaxx,magoo1,omgkremidia,knight12,norton1,vladislava,shaddy,austin11,jlbyjxrf,kbdthgekm,punheta,fetish69,exploiter,roger2,manstein,gtnhjd,32615948worms,dogbreath,ujkjdjkjvrf,vodka1,ripcord,fatrat,kotek1,tiziana,larrybir,thunder3,nbvfnb,9kyq6fge,remembe,likemike,gavin1,shinigam,yfcnfcmz,13245678,jabbar,vampyr,ane4ka,lollipo,ashwin,scuderia,limpdick,deagle,3247562,vishenka,fdhjhf,alex02,volvov70,mandys,bioshock,caraca,tombraider,matrix69,jeff123,13579135,parazit,black3,noway1,diablos,hitmen,garden1,aminor,decembe,august12,b00ger,006900,452073t,schach,hitman1,mariner1,vbnmrf,paint1,742617000027,bitchboy,pfqxjyjr,5681392,marryher,sinnet,malik1,muffin12,aninha,piolin,lady12,traffic1,cbvjyf,6345789,june21,ivan2010,ryan123,honda99,gunny,coorslight,asd321,hunter69,7224763,sonofgod,dolphins1,1dolphin,pavlenko,woodwind,lovelov,pinkpant,gblfhfcbyf,hotel1,justinbiebe,vinter,jeff1234,mydogs,1pizza,boats1,parrothe,shawshan,brooklyn1,cbrown,1rocky,hemi426,dragon64,redwings1,porsches,ghostly,hubbahub,buttnut,b929ezzh,sorokina,flashg,fritos,b7mguk,metatron,treehous,vorpal,8902792,marcu,free123,labamba,chiefs1,zxc123zxc,keli_14,hotti,1steeler,money4,rakker,foxwoods,free1,ahjkjd,sidorova,snowwhit,neptune1,mrlover,trader1,nudelamb,baloo,power7,deltasig,bills1,trevo,7gorwell,nokia6630,nokia5320,madhatte,1cowboys,manga1,namtab,sanjar,fanny1,birdman1,adv12775,carlo1,dude1998,babyhuey,nicole11,madmike,ubvyfpbz,qawsedr,lifetec,skyhook,stalker123,toolong,robertso,ripazha,zippy123,1111111a,manol,dirtyman,analslut,jason3,dutches,minhasenha,cerise,fenrir,jayjay1,flatbush,franka,bhbyjxrf,26429vadim,lawntrax,198700,fritzy,nikhil,ripper1,harami,truckman,nemvxyheqdd5oqxyxyzi,gkfytnf,bugaboo,cableman,hairpie,xplorer,movado,hotsex69,mordred,ohyeah1,patrick3,frolov,katieh,4311111q,mochaj,presari,bigdo,753951852,freedom4,kapitan,tomas1,135795,sweet123,pokers,shagme,tane4ka,sentinal,ufgyndmv,jonnyb,skate123,123456798,123456788,very1,gerrit,damocles,dollarbi,caroline1,lloyds,pizdets,flatland,92702689,dave13,meoff,ajnjuhfabz,achmed,madison9,744744z,amonte,avrillavigne,elaine1,norma1,asseater,everlong,buddy23,cmgang1,trash1,mitsu,flyman,ulugbek,june27,magistr,fittan,sebora64,dingos,sleipnir,caterpil,cindys,212121qaz,partys,dialer,gjytltkmybr,qweqaz,janvier,rocawear,lostboy,aileron,sweety1,everest1,pornman,boombox,potter1,blackdic,44448888,eric123,112233aa,2502557i,novass,nanotech,yourname,x12345,indian1,15975300,1234567l,carla51,chicago0,coleta,cxzdsaewq,qqwweerr,marwan,deltic,hollys,qwerasd,pon32029,rainmake,nathan0,matveeva,legioner,kevink,riven,tombraid,blitzen,a54321,jackyl,chinese1,shalimar,oleg1995,beaches1,tommylee,eknock,berli,monkey23,badbob,pugwash,likewhoa,jesus2,yujyd360,belmar,shadow22,utfp5e,angelo1,minimax,pooder,cocoa1,moresex,tortue,lesbia,panthe,snoopy2,drumnbass,alway,gmcz71,6jhwmqku,leppard,dinsdale,blair1,boriqua,money111,virtuagirl,267605,rattlesn,1sunshin,monica12,veritas1,newmexic,millertime,turandot,rfvxfnrf,jaydog,kakawka,bowhunter,booboo12,deerpark,erreway,taylorma,rfkbybyf,wooglin,weegee,rexdog,iamhorny,cazzo1,vhou812,bacardi1,dctktyyfz,godpasi,peanut12,bertha1,fuckyoubitch,ghosty,altavista,jertoot,smokeit,ghjcnbvtyz,fhnehxbr,rolsen,qazxcdews,maddmaxx,redrocke,qazokm,spencer2,thekiller,asdf11,123sex,tupac1,p1234567,dbrown,1biteme,tgo4466,316769,sunghi,shakespe,frosty1,gucci1,arcana,bandit01,lyubov,poochy,dartmout,magpies1,sunnyd,mouseman,summer07,chester7,shalini,danbury,pigboy,dave99,deniss,harryb,ashley11,pppppp1,01081988m,balloon1,tkachenko,bucks1,master77,pussyca,tricky1,zzxxccvv,zoulou,doomer,mukesh,iluv69,supermax,todays,thefox,don123,dontask,diplom,piglett,shiney,fahbrf,qaz12wsx,temitope,reggin,project1,buffy2,inside1,lbpfqyth,vanilla1,lovecock,u4slpwra,fylh.irf,123211,7ertu3ds,necroman,chalky,artist1,simpso,4x7wjr,chaos666,lazyacres,harley99,ch33s3,marusa,eagle7,dilligas,computadora,lucky69,denwer,nissan350z,unforgiv,oddball,schalke0,aztec1,borisova,branden1,parkave,marie123,germa,lafayett,878kckxy,405060,cheeseca,bigwave,fred22,andreea,poulet,mercutio,psycholo,andrew88,o4izdmxu,sanctuar,newhome,milion,suckmydi,rjvgm.nth,warior,goodgame,1qwertyuiop,6339cndh,scorpio2,macker,southbay,crabcake,toadie,paperclip,fatkid,maddo,cliff1,rastafar,maries,twins1,geujdrf,anjela,wc4fun,dolina,mpetroff,rollout,zydeco,shadow3,pumpki,steeda,volvo240,terras,blowjo,blue2000,incognit,badmojo,gambit1,zhukov,station1,aaronb,graci,duke123,clipper1,qazxsw2,ledzeppe,kukareku,sexkitte,cinco,007008,lakers12,a1234b,acmilan1,afhfjy,starrr,slutty3,phoneman,kostyan,bonzo1,sintesi07,ersatz,cloud1,nephilim,nascar03,rey619,kairos,123456789e,hardon1,boeing1,juliya,hfccdtn,vgfun8,polizei,456838,keithb,minouche,ariston,savag,213141,clarkken,microwav,london2,santacla,campeo,qr5mx7,464811,mynuts,bombo,1mickey,lucky8,danger1,ironside,carter12,wyatt1,borntorun,iloveyou123,jose1,pancake1,tadmichaels,monsta,jugger,hunnie,triste,heat7777,ilovejesus,queeny,luckycharm,lieben,gordolee85,jtkirk,forever21,jetlag,skylane,taucher,neworlea,holera,000005,anhnhoem,melissa7,mumdad,massimiliano,dima1994,nigel1,madison3,slicky,shokolad,serenit,jmh1978,soccer123,chris3,drwho,rfpzdrf,1qasw23ed,free4me,wonka,sasquatc,sanan,maytag,verochka,bankone,molly12,monopoli,xfqybr,lamborgini,gondolin,candycane,needsome,jb007,scottie1,brigit,0147258369,kalamazo,lololyo123,bill1234,ilovejes,lol123123,popkorn,april13,567rntvm,downunde,charle1,angelbab,guildwars,homeworld,qazxcvbnm,superma1,dupa123,kryptoni,happyy,artyom,stormie,cool11,calvin69,saphir,konovalov,jansport,october8,liebling,druuna,susans,megans,tujhjdf,wmegrfux,jumbo1,ljb4dt7n,012345678910,kolesnik,speculum,at4gftlw,kurgan,93pn75,cahek0980,dallas01,godswill,fhifdby,chelsea4,jump23,barsoom,catinhat,urlacher,angel99,vidadi1,678910,lickme69,topaz1,westend,loveone,c12345,gold12,alex1959,mamon,barney12,1maggie,alex12345,lp2568cskt,s1234567,gjikbdctyf,anthony0,browns99,chips1,sunking,widespre,lalala1,tdutif,fucklife,master00,alino4ka,stakan,blonde1,phoebus,tenore,bvgthbz,brunos,suzjv8,uvdwgt,revenant,1banana,veroniqu,sexfun,sp1der,4g3izhox,isakov,shiva1,scooba,bluefire,wizard12,dimitris,funbags,perseus,hoodoo,keving,malboro,157953,a32tv8ls,latics,animate,mossad,yejntb,karting,qmpq39zr,busdrive,jtuac3my,jkne9y,sr20dett,4gxrzemq,keylargo,741147,rfktylfhm,toast1,skins1,xcalibur,gattone,seether,kameron,glock9mm,julio1,delenn,gameday,tommyd,str8edge,bulls123,66699,carlsberg,woodbird,adnama,45auto,codyman,truck2,1w2w3w4w,pvjegu,method1,luetdi,41d8cd98f00b,bankai,5432112345,94rwpe,reneee,chrisx,melvins,775577,sam2000,scrappy1,rachid,grizzley,margare,morgan01,winstons,gevorg,gonzal,crawdad,gfhfdjp,babilon,noneya,pussy11,barbell,easyride,c00li0,777771,311music,karla1,golions,19866891,peejay,leadfoot,hfvbkm,kr9z40sy,cobra123,isotwe,grizz,sallys,****you,aaa123a,dembel,foxs14,hillcres,webman,mudshark,alfredo1,weeded,lester1,hovepark,ratface,000777fffa,huskie,wildthing,elbarto,waikiki,masami,call911,goose2,regin,dovajb,agricola,cjytxrj,andy11,penny123,family01,a121212,1braves,upupa68,happy100,824655,cjlove,firsttim,kalel,redhair,dfhtymt,sliders,bananna,loverbo,fifa2008,crouton,chevy350,panties2,kolya1,alyona,hagrid,spagetti,q2w3e4r,867530,narkoman,nhfdvfnjkju123,1ccccccc,napolean,0072563,allay,w8sted,wigwam,jamesk,state1,parovoz,beach69,kevinb,rossella,logitech1,celula,gnocca,canucks1,loginova,marlboro1,aaaa1,kalleanka,mester,mishutka,milenko,alibek,jersey1,peterc,1mouse,nedved,blackone,ghfplybr,682regkh,beejay,newburgh,ruffian,clarets,noreaga,xenophon,hummerh2,tenshi,smeagol,soloyo,vfhnby,ereiamjh,ewq321,goomie,sportin,cellphone,sonnie,jetblack,saudan,gblfhfc,matheus,uhfvjnf,alicja,jayman1,devon1,hexagon,bailey2,vtufajy,yankees7,salty1,908070,killemal,gammas,eurocard,sydney12,tuesday1,antietam,wayfarer,beast666,19952009sa,aq12ws,eveli,hockey21,haloreach,dontcare,xxxx1,andrea11,karlmarx,jelszo,tylerb,protools,timberwolf,ruffneck,pololo,1bbbbb,waleed,sasami,twinss,fairlady,illuminati,alex007,sucks1,homerjay,scooter7,tarbaby,barmaley,amistad,vanes,randers,tigers12,dreamer2,goleafsg,googie,bernie1,as12345,godeep,james3,phanto,gwbush,cumlover,2196dc,studioworks,995511,golf56,titova,kaleka,itali,socks1,kurwamac,daisuke,hevonen,woody123,daisie,wouter,henry123,gostosa,guppie,porpoise,iamsexy,276115,paula123,1020315,38gjgeuftd,rjrfrjkf,knotty,idiot1,sasha12345,matrix13,securit,radical1,ag764ks,jsmith,coolguy1,secretar,juanas,sasha1988,itout,00000001,tiger11,1butthea,putain,cavalo,basia1,kobebryant,1232323,12345asdfg,sunsh1ne,cyfqgth,tomkat,dorota,dashit,pelmen,5t6y7u,whipit,smokeone,helloall,bonjour1,snowshoe,nilknarf,x1x2x3,lammas,1234599,lol123456,atombomb,ironchef,noclue,alekseev,gwbush1,silver2,12345678m,yesican,fahjlbnf,chapstic,alex95,open1,tiger200,lisichka,pogiako,cbr929,searchin,tanya123,alex1973,phil413,alex1991,dominati,geckos,freddi,silenthill,egroeg,vorobey,antoxa,dark666,shkola,apple22,rebellio,shamanking,7f8srt,cumsucker,partagas,bill99,22223333,arnster55,fucknuts,proxima,silversi,goblues,parcells,vfrcbvjdf,piloto,avocet,emily2,1597530,miniskir,himitsu,pepper2,juiceman,venom1,bogdana,jujube,quatro,botafogo,mama2010,junior12,derrickh,asdfrewq,miller2,chitarra,silverfox,napol,prestigio,devil123,mm111qm,ara123,max33484,sex2000,primo1,sephan,anyuta,alena2010,viborg,verysexy,hibiscus,terps,josefin,oxcart,spooker,speciali,raffaello,partyon,vfhvtkflrf,strela,a123456z,worksuck,glasss,lomonosov,dusty123,dukeblue,1winter,sergeeva,lala123,john22,cmc09,sobolev,bettylou,dannyb,gjkrjdybr,hagakure,iecnhbr,awsedr,pmdmsctsk,costco,alekseeva,fktrcttd,bazuka,flyingv,garuda,buffy16,gutierre,beer12,stomatolog,ernies,palmeiras,golf123,love269,n.kmgfy,gjkysqgbpltw,youare,joeboo,baksik,lifeguar,111a111,nascar8,mindgame,dude1,neopets,frdfkfyu,june24,phoenix8,penelopa,merlin99,mercenar,badluck,mishel,bookert,deadsexy,power9,chinchil,1234567m,alex10,skunk1,rfhkcjy,sammycat,wright1,randy2,marakesh,temppassword,elmer251,mooki,patrick0,bonoedge,1tits,chiar,kylie1,graffix,milkman1,cornel,mrkitty,nicole12,ticketmaster,beatles4,number20,ffff1,terps1,superfre,yfdbufnjh,jake1234,flblfc,1111qq,zanuda,jmol01,wpoolejr,polopol,nicolett,omega13,cannonba,123456789.,sandy69,ribeye,bo243ns,marilena,bogdan123,milla,redskins1,19733791,alias1,movie1,ducat,marzena,shadowru,56565,coolman1,pornlover,teepee,spiff,nafanya,gateway3,fuckyou0,hasher,34778,booboo69,staticx,hang10,qq12345,garnier,bosco123,1234567qw,carson1,samso,1xrg4kcq,cbr929rr,allan123,motorbik,andrew22,pussy101,miroslava,cytujdbr,camp0017,cobweb,snusmumrik,salmon1,cindy2,aliya,serendipity,co437at,tincouch,timmy123,hunter22,st1100,vvvvvv1,blanka,krondor,sweeti,nenit,kuzmich,gustavo1,bmw320i,alex2010,trees1,kyliem,essayons,april26,kumari,sprin,fajita,appletre,fghbjhb,1green,katieb,steven2,corrado1,satelite,1michell,123456789c,cfkfvfylhf,acurarsx,slut543,inhere,bob2000,pouncer,k123456789,fishie,aliso,audia8,bluetick,soccer69,jordan99,fromhell,mammoth1,fighting54,mike25,pepper11,extra1,worldwid,chaise,vfr800,sordfish,almat,nofate,listopad,hellgate,dctvghbdf,jeremia,qantas,lokiju,honker,sprint1,maral,triniti,compaq3,sixsix6,married1,loveman,juggalo1,repvtyrj,zxcasdqw,123445,whore1,123678,monkey6,west123,warcraf,pwnage,mystery1,creamyou,ant123,rehjgfnrf,corona1,coleman1,steve121,alderaan,barnaul,celeste1,junebug1,bombshel,gretzky9,tankist,targa,cachou,vaz2101,playgolf,boneyard,strateg,romawka,iforgotit,pullup,garbage1,irock,archmage,shaft1,oceano,sadies,alvin1,135135ab,psalm69,lmfao,ranger02,zaharova,33334444,perkman,realman,salguod,cmoney,astonmartin,glock1,greyfox,viper99,helpm,blackdick,46775575,family5,shazbot,dewey1,qwertyas,shivani,black22,mailman1,greenday1,57392632,red007,stanky,sanchez1,tysons,daruma,altosax,krayzie,85852008,1forever,98798798,irock.,123456654,142536789,ford22,brick1,michela,preciou,crazy4u,01telemike01,nolife,concac,safety1,annie123,brunswic,destini,123456qwer,madison0,snowball1,137946,1133557799,jarule,scout2,songohan,thedead,00009999,murphy01,spycam,hirsute,aurinko,associat,1miller,baklan,hermes1,2183rm,martie,kangoo,shweta,yvonne1,westsid,jackpot1,rotciv,maratik,fabrika,claude1,nursultan,noentry,ytnhjufnm,electra1,ghjcnjnfr1,puneet,smokey01,integrit,bugeye,trouble2,14071789,paul01,omgwtf,dmh415,ekilpool,yourmom1,moimeme,sparky11,boludo,ruslan123,kissme1,demetrio,appelsin,asshole3,raiders2,bunns,fynjybj,billygoa,p030710p$e4o,macdonal,248ujnfk,acorns,schmidt1,sparrow1,vinbylrj,weasle,jerom,ycwvrxxh,skywalk,gerlinde,solidus,postal1,poochie1,1charles,rhianna,terorist,rehnrf,omgwtfbbq,assfucke,deadend,zidan,jimboy,vengence,maroon5,7452tr,dalejr88,sombra,anatole,elodi,amazonas,147789,q12345q,gawker1,juanma,kassidy,greek1,bruces,bilbob,mike44,0o9i8u7y6t,kaligula,agentx,familie,anders1,pimpjuice,0128um,birthday10,lawncare,hownow,grandorgue,juggerna,scarfac,kensai,swatteam,123four,motorbike,repytxbr,other1,celicagt,pleomax,gen0303,godisgreat,icepick,lucifer666,heavy1,tea4two,forsure,02020,shortdog,webhead,chris13,palenque,3techsrl,knights1,orenburg,prong,nomarg,wutang1,80637852730,laika,iamfree,12345670,pillow1,12343412,bigears,peterg,stunna,rocky5,12123434,damir,feuerwehr,7418529630,danone,yanina,valenci,andy69,111222q,silvia1,1jjjjj,loveforever,passwo1,stratocaster,8928190a,motorolla,lateralu,ujujkm,chubba,ujkjdf,signon,123456789zx,serdce,stevo,wifey200,ololo123,popeye1,1pass,central1,melena,luxor,nemezida,poker123,ilovemusic,qaz1234,noodles1,lakeshow,amarill,ginseng,billiam,trento,321cba,fatback,soccer33,master13,marie2,newcar,bigtop,dark1,camron,nosgoth,155555,biglou,redbud,jordan7,159789,diversio,actros,dazed,drizzit,hjcnjd,wiktoria,justic,gooses,luzifer,darren1,chynna,tanuki,11335577,icculus,boobss,biggi,firstson,ceisi123,gatewa,hrothgar,jarhead1,happyjoy,felipe1,bebop1,medman,athena1,boneman,keiths,djljgfl,dicklick,russ120,mylady,zxcdsa,rock12,bluesea,kayaks,provista,luckies,smile4me,bootycal,enduro,123123f,heartbre,ern3sto,apple13,bigpappa,fy.njxrf,bigtom,cool69,perrito,quiet1,puszek,cious,cruella,temp1,david26,alemap,aa123123,teddies,tricolor,smokey12,kikiriki,mickey01,robert01,super5,ranman,stevenso,deliciou,money777,degauss,mozar,susanne1,asdasd12,shitbag,mommy123,wrestle1,imfree,fuckyou12,barbaris,florent,ujhijr,f8yruxoj,tefjps,anemone,toltec,2gether,left4dead2,ximen,gfkmvf,dunca,emilys,diana123,16473a,mark01,bigbro,annarbor,nikita2000,11aa11,tigres,llllll1,loser2,fbi11213,jupite,qwaszxqw,macabre,123ert,rev2000,mooooo,klapaucius,bagel1,chiquit,iyaoyas,bear101,irocz28,vfktymrfz,smokey2,love99,rfhnbyf,dracul,keith123,slicko,peacock1,orgasmic,thesnake,solder,wetass,doofer,david5,rhfcyjlfh,swanny,tammys,turkiye,tubaman,estefani,firehose,funnyguy,servo,grace17,pippa1,arbiter,jimmy69,nfymrf,asdf67nm,rjcnzy,demon123,thicknes,sexysex,kristall,michail,encarta,banderos,minty,marchenko,de1987ma,mo5kva,aircav,naomi1,bonni,tatoo,cronaldo,49ers1,mama1963,1truck,telecaster,punksnotdead,erotik,1eagles,1fender,luv269,acdeehan,tanner1,freema,1q3e5t7u,linksys,tiger6,megaman1,neophyte,australia1,mydaddy,1jeffrey,fgdfgdfg,gfgekz,1986irachka,keyman,m0b1l3,dfcz123,mikeyg,playstation2,abc125,slacker1,110491g,lordsoth,bhavani,ssecca,dctvghbdtn,niblick,hondacar,baby01,worldcom,4034407,51094didi,3657549,3630000,3578951,sweetpussy,majick,supercoo,robert11,abacabb,panda123,gfhjkm13,ford4x4,zippo1,lapin,1726354,lovesong,dude11,moebius,paravoz,1357642,matkhau,solnyshko,daniel4,multiplelog,starik,martusia,iamtheman,greentre,jetblue,motorrad,vfrcbvev,redoak,dogma1,gnorman,komlos,tonka1,1010220,666satan,losenord,lateralus,absinthe,command1,jigga1,iiiiiii1,pants1,jungfrau,926337,ufhhbgjnnth,yamakasi,888555,sunny7,gemini69,alone1,zxcvbnmz,cabezon,skyblues,zxc1234,456123a,zero00,caseih,azzurra,legolas1,menudo,murcielago,785612,779977,benidorm,viperman,dima1985,piglet1,hemligt,hotfeet,7elephants,hardup,gamess,a000000,267ksyjf,kaitlynn,sharkie,sisyphus,yellow22,667766,redvette,666420,mets69,ac2zxdty,hxxrvwcy,cdavis,alan1,noddy,579300,druss,eatshit1,555123,appleseed,simpleplan,kazak,526282,fynfyfyfhbde,birthday6,dragon6,1pookie,bluedevils,omg123,hj8z6e,x5dxwp,455445,batman23,termin,chrisbrown,animals1,lucky9,443322,kzktxrf,takayuki,fermer,assembler,zomu9q,sissyboy,sergant,felina,nokia6230i,eminem12,croco,hunt4red,festina,darknigh,cptnz062,ndshnx4s,twizzler,wnmaz7sd,aamaax,gfhfcjkmrf,alabama123,barrynov,happy5,punt0it,durandal,8xuuobe4,cmu9ggzh,bruno12,316497,crazyfrog,vfvfktyf,apple3,kasey1,mackdaddy,anthon1,sunnys,angel3,cribbage,moon1,donal,bryce1,pandabear,mwss474,whitesta,freaker,197100,bitche,p2ssw0rd,turnb,tiktonik,moonlite,ferret1,jackas,ferrum,bearclaw,liberty2,1diablo,caribe,snakeeyes,janbam,azonic,rainmaker,vetalik,bigeasy,baby1234,sureno13,blink1,kluivert,calbears,lavanda,198600,dhtlbyf,medvedeva,fox123,whirling,bonscott,freedom9,october3,manoman,segredo,cerulean,robinso,bsmith,flatus,dannon,password21,rrrrrr1,callista,romai,rainman1,trantor,mickeymo,bulldog7,g123456,pavlin,pass22,snowie,hookah,7ofnine,bubba22,cabible,nicerack,moomoo1,summer98,yoyo123,milan1,lieve27,mustang69,jackster,exocet,nadege,qaz12,bahama,watson1,libras,eclipse2,bahram,bapezm,up9x8rww,ghjcnjz,themaste,deflep27,ghost16,gattaca,fotograf,junior123,gilber,gbjyth,8vjzus,rosco1,begonia,aldebara,flower12,novastar,buzzman,manchild,lopez1,mama11,william7,yfcnz1,blackstar,spurs123,moom4242,1amber,iownyou,tightend,07931505,paquito,1johnson,smokepot,pi31415,snowmass,ayacdc,jessicam,giuliana,5tgbnhy6,harlee,giuli,bigwig,tentacle,scoubidou2,benelli,vasilina,nimda,284655,jaihind,lero4ka,1tommy,reggi,ididit,jlbyjxtcndj,mike26,qbert,wweraw,lukasz,loosee123,palantir,flint1,mapper,baldie,saturne,virgin1,meeeee,elkcit,iloveme2,blue15,themoon,radmir,number3,shyanne,missle,hannelor,jasmina,karin1,lewie622,ghjcnjqgfhjkm,blasters,oiseau,sheela,grinders,panget,rapido,positiv,twink,fltkbyf,kzsfj874,daniel01,enjoyit,nofags,doodad,rustler,squealer,fortunat,peace123,khushi,devils2,7inches,candlebo,topdawg,armen,soundman,zxcqweasd,april7,gazeta,netman,hoppers,bear99,ghbjhbntn,mantle7,bigbo,harpo,jgordon,bullshi,vinny1,krishn,star22,thunderc,galinka,phish123,tintable,nightcrawler,tigerboy,rbhgbx,messi,basilisk,masha1998,nina123,yomamma,kayla123,geemoney,0000000000d,motoman,a3jtni,ser123,owen10,italien,vintelok,12345rewq,nightime,jeepin,ch1tt1ck,mxyzptlk,bandido,ohboy,doctorj,hussar,superted,parfilev,grundle,1jack,livestrong,chrisj,matthew3,access22,moikka,fatone,miguelit,trivium,glenn1,smooches,heiko,dezember,spaghett,stason,molokai,bossdog,guitarma,waderh,boriska,photosho,path13,hfrtnf,audre,junior24,monkey24,silke,vaz21093,bigblue1,trident1,candide,arcanum,klinker,orange99,bengals1,rosebu,mjujuj,nallepuh,mtwapa1a,ranger69,level1,bissjop,leica,1tiffany,rutabega,elvis77,kellie1,sameas,barada,karabas,frank12,queenb,toutoune,surfcity,samanth1,monitor1,littledo,kazakova,fodase,mistral1,april22,carlit,shakal,batman123,fuckoff2,alpha01,5544332211,buddy3,towtruck,kenwood1,vfiekmrf,jkl123,pypsik,ranger75,sitges,toyman,bartek1,ladygirl,booman,boeing77,installsqlst,222666,gosling,bigmack,223311,bogos,kevin2,gomez1,xohzi3g4,kfnju842,klubnika,cubalibr,123456789101,kenpo,0147852369,raptor1,tallulah,boobys,jjones,1q2s3c,moogie,vid2600,almas,wombat1,extra300,xfiles1,green77,sexsex1,heyjude,sammyy,missy123,maiyeuem,nccpl25282,thicluv,sissie,raven3,fldjrfn,buster22,broncos2,laurab,letmein4,harrydog,solovey,fishlips,asdf4321,ford123,superjet,norwegen,movieman,psw333333,intoit,postbank,deepwate,ola123,geolog323,murphys,eshort,a3eilm2s2y,kimota,belous,saurus,123321qaz,i81b4u,aaa12,monkey20,buckwild,byabybnb,mapleleafs,yfcnzyfcnz,baby69,summer03,twista,246890,246824,ltcnhjth,z1z2z3,monika1,sad123,uto29321,bathory,villan,funkey,poptarts,spam967888,705499fh,sebast,porn1234,earn381,1porsche,whatthef,123456789y,polo12,brillo,soreilly,waters1,eudora,allochka,is_a_bot,winter00,bassplay,531879fiz,onemore,bjarne,red911,kot123,artur1,qazxdr,c0rvette,diamond7,matematica,klesko,beaver12,2enter,seashell,panam,chaching,edward2,browni,xenogear,cornfed,aniram,chicco22,darwin1,ancella2,sophie2,vika1998,anneli,shawn41,babie,resolute,pandora2,william8,twoone,coors1,jesusis1,teh012,cheerlea,renfield,tessa1,anna1986,madness1,bkmlfh,19719870,liebherr,ck6znp42,gary123,123654z,alsscan,eyedoc,matrix7,metalgea,chinito,4iter,falcon11,7jokx7b9du,bigfeet,tassadar,retnuh,muscle1,klimova,darion,batistuta,bigsur,1herbier,noonie,ghjrehjh,karimova,faustus,snowwhite,1manager,dasboot,michael12,analfuck,inbed,dwdrums,jaysoncj,maranell,bsheep75,164379,rolodex,166666,rrrrrrr1,almaz666,167943,russel1,negrito,alianz,goodpussy,veronik,1w2q3r4e,efremov,emb377,sdpass,william6,alanfahy,nastya1995,panther5,automag,123qwe12,vfvf2011,fishe,1peanut,speedie,qazwsx1234,pass999,171204j,ketamine,sheena1,energizer,usethis1,123abc123,buster21,thechamp,flvbhfk,frank69,chane,hopeful1,claybird,pander,anusha,bigmaxxx,faktor,housebed,dimidrol,bigball,shashi,derby1,fredy,dervish,bootycall,80988218126,killerb,cheese2,pariss,mymail,dell123,catbert,christa1,chevytru,gjgjdf,00998877,overdriv,ratten,golf01,nyyanks,dinamite,bloembol,gismo,magnus1,march2,twinkles,ryan22,duckey,118a105b,kitcat,brielle,poussin,lanzarot,youngone,ssvegeta,hero63,battle1,kiler,fktrcfylh1,newera,vika1996,dynomite,oooppp,beer4me,foodie,ljhjuf,sonshine,godess,doug1,constanc,thinkbig,steve2,damnyou,autogod,www333,kyle1,ranger7,roller1,harry2,dustin1,hopalong,tkachuk,b00bies,bill2,deep111,stuffit,fire69,redfish1,andrei123,graphix,1fishing,kimbo1,mlesp31,ifufkbyf,gurkan,44556,emily123,busman,and123,8546404,paladine,1world,bulgakov,4294967296,bball23,1wwwww,mycats,elain,delta6,36363,emilyb,color1,6060842,cdtnkfyrf,hedonism,gfgfrfhkj,5551298,scubad,gostate,sillyme,hdbiker,beardown,fishers,sektor,00000007,newbaby,rapid1,braves95,gator2,nigge,anthony3,sammmy,oou812,heffer,phishin,roxanne1,yourass,hornet1,albator,2521659,underwat,tanusha,dianas,3f3fpht7op,dragon20,bilbobag,cheroke,radiatio,dwarf1,majik,33st33,dochka,garibald,robinh,sham69,temp01,wakeboar,violet1,1w2w3w,registr,tonite,maranello,1593570,parolamea,galatasara,loranthos,1472583,asmodean,1362840,scylla,doneit,jokerr,porkypig,kungen,mercator,koolhaas,come2me,debbie69,calbear,liverpoolfc,yankees4,12344321a,kennyb,madma,85200258,dustin23,thomas13,tooling,mikasa,mistic,crfnbyf,112233445,sofia1,heinz57,colts1,price1,snowey,joakim,mark11,963147,cnhfcnm,kzinti,1bbbbbbb,rubberdu,donthate,rupert1,sasha1992,regis1,nbuhbwf,fanboy,sundial,sooner1,wayout,vjnjhjkf,deskpro,arkangel,willie12,mikeyb,celtic1888,luis1,buddy01,duane1,grandma1,aolcom,weeman,172839456,basshead,hornball,magnu,pagedown,molly2,131517,rfvtgbyhn,astonmar,mistery,madalina,cash1,1happy,shenlong,matrix01,nazarova,369874125,800500,webguy,rse2540,ashley2,briank,789551,786110,chunli,j0nathan,greshnik,courtne,suckmyco,mjollnir,789632147,asdfg1234,754321,odelay,ranma12,zebedee,artem777,bmw318is,butt1,rambler1,yankees9,alabam,5w76rnqp,rosies,mafioso,studio1,babyruth,tranzit,magical123,gfhjkm135,12345$,soboleva,709394,ubique,drizzt1,elmers,teamster,pokemons,1472583690,1597532486,shockers,merckx,melanie2,ttocs,clarisse,earth1,dennys,slobber,flagman,farfalla,troika,4fa82hyx,hakan,x4ww5qdr,cumsuck,leather1,forum1,july20,barbel,zodiak,samuel12,ford01,rushfan,bugsy1,invest1,tumadre,screwme,a666666,money5,henry8,tiddles,sailaway,starburs,100years,killer01,comando,hiromi,ranetka,thordog,blackhole,palmeira,verboten,solidsna,q1w1e1,humme,kevinc,gbrfxe,gevaudan,hannah11,peter2,vangar,sharky7,talktome,jesse123,chuchi,pammy,!qazxsw2,siesta,twenty1,wetwilly,477041,natural1,sun123,daniel3,intersta,shithead1,hellyea,bonethugs,solitair,bubbles2,father1,nick01,444000,adidas12,dripik,cameron2,442200,a7nz8546,respublika,fkojn6gb,428054,snoppy,rulez1,haslo,rachael1,purple01,zldej102,ab12cd34,cytuehjxrf,madhu,astroman,preteen,handsoff,mrblonde,biggio,testin,vfdhif,twolves,unclesam,asmara,kpydskcw,lg2wmgvr,grolsch,biarritz,feather1,williamm,s62i93,bone1,penske,337733,336633,taurus1,334433,billet,diamondd,333000,nukem,fishhook,godogs,thehun,lena1982,blue00,smelly1,unb4g9ty,65pjv22,applegat,mikehunt,giancarlo,krillin,felix123,december1,soapy,46doris,nicole23,bigsexy1,justin10,pingu,bambou,falcon12,dgthtl,1surfer,qwerty01,estrellit,nfqcjy,easygo,konica,qazqwe,1234567890m,stingers,nonrev,3e4r5t,champio,bbbbbb99,196400,allen123,seppel,simba2,rockme,zebra3,tekken3,endgame,sandy2,197300,fitte,monkey00,eldritch,littleone,rfyfgkz,1member,66chevy,oohrah,cormac,hpmrbm41,197600,grayfox,elvis69,celebrit,maxwell7,rodders,krist,1camaro,broken1,kendall1,silkcut,katenka,angrick,maruni,17071994a,tktyf,kruemel,snuffles,iro4ka,baby12,alexis01,marryme,vlad1994,forward1,culero,badaboom,malvin,hardtoon,hatelove,molley,knopo4ka,duchess1,mensuck,cba321,kickbutt,zastava,wayner,fuckyou6,eddie123,cjkysir,john33,dragonfi,cody1,jabell,cjhjrf,badseed,sweden1,marihuana,brownlov,elland,nike1234,kwiettie,jonnyboy,togepi,billyk,robert123,bb334,florenci,ssgoku,198910,bristol1,bob007,allister,yjdujhjl,gauloise,198920,bellaboo,9lives,aguilas,wltfg4ta,foxyroxy,rocket69,fifty50,babalu,master21,malinois,kaluga,gogosox,obsessio,yeahrigh,panthers1,capstan,liza2000,leigh1,paintball1,blueskie,cbr600f3,bagdad,jose98,mandreki,shark01,wonderbo,muledeer,xsvnd4b2,hangten,200001,grenden,anaell,apa195,model1,245lufpq,zip100,ghjcgtrn,wert1234,misty2,charro,juanjose,fkbcrf,frostbit,badminto,buddyy,1doctor,vanya,archibal,parviz,spunky1,footboy,dm6tzsgp,legola,samadhi,poopee,ytdxz2ca,hallowboy,dposton,gautie,theworm,guilherme,dopehead,iluvtits,bobbob1,ranger6,worldwar,lowkey,chewbaca,oooooo99,ducttape,dedalus,celular,8i9o0p,borisenko,taylor01,111111z,arlingto,p3nnywiz,rdgpl3ds,boobless,kcmfwesg,blacksab,mother2,markus1,leachim,secret2,s123456789,1derful,espero,russell2,tazzer,marykate,freakme,mollyb,lindros8,james00,gofaster,stokrotka,kilbosik,aquamann,pawel1,shedevil,mousie,slot2009,october6,146969,mm259up,brewcrew,choucho,uliana,sexfiend,fktirf,pantss,vladimi,starz,sheeps,12341234q,bigun,tiggers,crjhjcnm,libtech,pudge1,home12,zircon,klaus1,jerry2,pink1,lingus,monkey66,dumass,polopolo09,feuerweh,rjyatnf,chessy,beefer,shamen,poohbear1,4jjcho,bennevis,fatgirls,ujnbrf,cdexswzaq,9noize9,rich123,nomoney,racecar1,hacke,clahay,acuario,getsum,hondacrv,william0,cheyenn,techdeck,atljhjdf,wtcacq,suger,fallenangel,bammer,tranquil,carla123,relayer,lespaul1,portvale,idontno,bycnbnen,trooper2,gennadiy,pompon,billbob,amazonka,akitas,chinatow,atkbrc,busters,fitness1,cateye,selfok2013,1murphy,fullhous,mucker,bajskorv,nectarin,littlebitch,love24,feyenoor,bigal37,lambo1,pussybitch,icecube1,biged,kyocera,ltybcjdf,boodle,theking1,gotrice,sunset1,abm1224,fromme,sexsells,inheat,kenya1,swinger1,aphrodit,kurtcobain,rhind101,poidog,poiulkjh,kuzmina,beantown,tony88,stuttgar,drumer,joaqui,messenge,motorman,amber2,nicegirl,rachel69,andreia,faith123,studmuffin,jaiden,red111,vtkmybr,gamecocks,gumper,bosshogg,4me2know,tokyo1,kleaner,roadhog,fuckmeno,phoenix3,seeme,buttnutt,boner69,andreyka,myheart,katerin,rugburn,jvtuepip,dc3ubn,chile1,ashley69,happy99,swissair,balls2,fylhttdf,jimboo,55555d,mickey11,voronin,m7hsqstm,stufff,merete,weihnachte,dowjones,baloo1,freeones,bears34,auburn1,beverl,timberland,1elvis,guinness1,bombadil,flatron1,logging7,telefoon,merl1n,masha1,andrei1,cowabung,yousuck1,1matrix,peopl,asd123qwe,sweett,mirror1,torrente,joker12,diamond6,jackaroo,00000a,millerlite,ironhorse,2twins,stryke,gggg1,zzzxxxccc,roosevel,8363eddy,angel21,depeche1,d0ct0r,blue14,areyou,veloce,grendal,frederiksberg,cbcntvf,cb207sl,sasha2000,was.here,fritzz,rosedale,spinoza,cokeisit,gandalf3,skidmark,ashley01,12345j,1234567890qaz,sexxxxxx,beagles,lennart,12345789,pass10,politic,max007,gcheckou,12345611,tiffy,lightman,mushin,velosiped,brucewayne,gauthie,elena123,greenegg,h2oski,clocker,nitemare,123321s,megiddo,cassidy1,david13,boywonde,flori,peggy12,pgszt6md,batterie,redlands,scooter6,bckhere,trueno,bailey11,maxwell2,bandana,timoth1,startnow,ducati74,tiern,maxine1,blackmetal,suzyq,balla007,phatfarm,kirsten1,titmouse,benhogan,culito,forbin,chess1,warren1,panman,mickey7,24lover,dascha,speed2,redlion,andrew10,johnwayn,nike23,chacha1,bendog,bullyboy,goldtree,spookie,tigger99,1cookie,poutine,cyclone1,woodpony,camaleun,bluesky1,dfadan,eagles20,lovergirl,peepshow,mine1,dima1989,rjdfkmxer,11111aaaaa,machina,august17,1hhhhh,0773417k,1monster,freaksho,jazzmin,davidw,kurupt,chumly,huggies,sashenka,ccccccc1,bridge1,giggalo,cincinna,pistol1,hello22,david77,lightfoo,lucky6,jimmy12,261397,lisa12,tabaluga,mysite,belo4ka,greenn,eagle99,punkrawk,salvado,slick123,wichsen,knight99,dummys,fefolico,contrera,kalle1,anna1984,delray,robert99,garena,pretende,racefan,alons,serenada,ludmilla,cnhtkjr,l0swf9gx,hankster,dfktynbyrf,sheep1,john23,cv141ab,kalyani,944turbo,crystal2,blackfly,zrjdktdf,eus1sue1,mario5,riverplate,harddriv,melissa3,elliott1,sexybitc,cnhfyybr,jimdavis,bollix,beta1,amberlee,skywalk1,natala,1blood,brattax,shitty1,gb15kv99,ronjon,rothmans,thedoc,joey21,hotboi,firedawg,bimbo38,jibber,aftermat,nomar,01478963,phishing,domodo,anna13,materia,martha1,budman1,gunblade,exclusiv,sasha1997,anastas,rebecca2,fackyou,kallisti,fuckmyass,norseman,ipswich1,151500,1edward,intelinside,darcy1,bcrich,yjdjcnbf,failte,buzzzz,cream1,tatiana1,7eleven,green8,153351,1a2s3d4f5g6h,154263,milano1,bambi1,bruins77,rugby2,jamal1,bolita,sundaypunch,bubba12,realmadr,vfyxtcnth,iwojima,notlob,black666,valkiria,nexus1,millerti,birthday100,swiss1,appollo,gefest,greeneyes,celebrat,tigerr,slava123,izumrud,bubbabub,legoman,joesmith,katya123,sweetdream,john44,wwwwwww1,oooooo1,socal,lovespor,s5r8ed67s,258147,heidis,cowboy22,wachovia,michaelb,qwe1234567,i12345,255225,goldie1,alfa155,45colt,safeu851,antonova,longtong,1sparky,gfvznm,busen,hjlbjy,whateva,rocky4,cokeman,joshua3,kekskek1,sirocco,jagman,123456qwert,phinupi,thomas10,loller,sakur,vika2011,fullred,mariska,azucar,ncstate,glenn74,halima,aleshka,ilovemylife,verlaat,baggie,scoubidou6,phatboy,jbruton,scoop1,barney11,blindman,def456,maximus2,master55,nestea,11223355,diego123,sexpistols,sniffy,philip1,f12345,prisonbreak,nokia2700,ajnjuhfa,yankees3,colfax,ak470000,mtnman,bdfyeirf,fotball,ichbin,trebla,ilusha,riobravo,beaner1,thoradin,polkaudi,kurosawa,honda123,ladybu,valerik,poltava,saviola,fuckyouguys,754740g0,anallove,microlab1,juris01,ncc1864,garfild,shania1,qagsud,makarenko,cindy69,lebedev,andrew11,johnnybo,groovy1,booster1,sanders1,tommyb,johnson4,kd189nlcih,hondaman,vlasova,chick1,sokada,sevisgur,bear2327,chacho,sexmania,roma1993,hjcnbckfd,valley1,howdie,tuppence,jimandanne,strike3,y4kuz4,nhfnfnf,tsubasa,19955991,scabby,quincunx,dima1998,uuuuuu1,logica,skinner1,pinguino,lisa1234,xpressmusic,getfucked,qqqq1,bbbb1,matulino,ulyana,upsman,johnsmith,123579,co2000,spanner1,todiefor,mangoes,isabel1,123852,negra,snowdon,nikki123,bronx1,booom,ram2500,chuck123,fireboy,creek1,batman13,princesse,az12345,maksat,1knight,28infern,241455,r7112s,muselman,mets1986,katydid,vlad777,playme,kmfdm1,asssex,1prince,iop890,bigbroth,mollymoo,waitron,lizottes,125412,juggler,quinta,0sister0,zanardi,nata123,heckfyxbr,22q04w90e,engine2,nikita95,zamira,hammer22,lutscher,carolina1,zz6319,sanman,vfuflfy,buster99,rossco,kourniko,aggarwal,tattoo1,janice1,finger1,125521,19911992,shdwlnds,rudenko,vfvfgfgf123,galatea,monkeybu,juhani,premiumcash,classact,devilmay,helpme2,knuddel,hardpack,ramil,perrit,basil1,zombie13,stockcar,tos8217,honeypie,nowayman,alphadog,melon1,talula,125689,tiribon12,tornike,haribol,telefone,tiger22,sucka,lfytxrf,chicken123,muggins,a23456,b1234567,lytdybr,otter1,pippa,vasilisk,cooking1,helter,78978,bestboy,viper7,ahmed1,whitewol,mommys,apple5,shazam1,chelsea7,kumiko,masterma,rallye,bushmast,jkz123,entrar,andrew6,nathan01,alaric,tavasz,heimdall,gravy1,jimmy99,cthlwt,powerr,gthtrhtcnjr,canesfan,sasha11,ybrbnf_25,august9,brucie,artichok,arnie1,superdude,tarelka,mickey22,dooper,luners,holeshot,good123,gettysbu,bicho,hammer99,divine5,1zxcvbn,stronzo,q22222,disne,bmw750il,godhead,hallodu,aerith,nastik,differen,cestmoi,amber69,5string,pornosta,dirtygirl,ginger123,formel1,scott12,honda200,hotspurs,johnatha,firstone123,lexmark1,msconfig,karlmasc,l123456,123qweasdzx,baldman,sungod,furka,retsub,9811020,ryder1,tcglyued,astron,lbvfcbr,minddoc,dirt49,baseball12,tbear,simpl,schuey,artimus,bikman,plat1num,quantex,gotyou,hailey1,justin01,ellada,8481068,000002,manimal,dthjybxrf,buck123,dick123,6969696,nospam,strong1,kodeord,bama12,123321w,superman123,gladiolus,nintend,5792076,dreamgirl,spankme1,gautam,arianna1,titti,tetas,cool1234,belladog,importan,4206969,87e5nclizry,teufelo7,doller,yfl.irf,quaresma,3440172,melis,bradle,nnmaster,fast1,iverso,blargh,lucas12,chrisg,iamsam,123321az,tomjerry,kawika,2597174,standrew,billyg,muskan,gizmodo2,rz93qpmq,870621345,sathya,qmezrxg4,januari,marthe,moom4261,cum2me,hkger286,lou1988,suckit1,croaker,klaudia1,753951456,aidan1,fsunoles,romanenko,abbydog,isthebes,akshay,corgi,fuck666,walkman555,ranger98,scorpian,hardwareid,bluedragon,fastman,2305822q,iddqdiddqd,1597532,gopokes,zvfrfcb,w1234567,sputnik1,tr1993,pa$$w0rd,2i5fdruv,havvoc,1357913,1313131,bnm123,cowd00d,flexscan,thesims2,boogiema,bigsexxy,powerstr,ngc4565,joshman,babyboy1,123jlb,funfunfu,qwe456,honor1,puttana,bobbyj,daniel21,pussy12,shmuck,1232580,123578951,maxthedo,hithere1,bond0007,gehenna,nomames,blueone,r1234567,bwana,gatinho,1011111,torrents,cinta,123451234,tiger25,money69,edibey,pointman,mmcm19,wales1,caffreys,phaedra,bloodlus,321ret32,rufuss,tarbit,joanna1,102030405,stickboy,lotrfotr34,jamshid,mclarenf1,ataman,99ford,yarrak,logan2,ironlung,pushistik,dragoon1,unclebob,tigereye,pinokio,tylerj,mermaid1,stevie1,jaylen,888777,ramana,roman777,brandon7,17711771s,thiago,luigi1,edgar1,brucey,videogam,classi,birder,faramir,twiddle,cubalibre,grizzy,fucky,jjvwd4,august15,idinahui,ranita,nikita1998,123342,w1w2w3,78621323,4cancel,789963,(null,vassago,jaydog472,123452,timt42,canada99,123589,rebenok,htyfnf,785001,osipov,maks123,neverwinter,love2010,777222,67390436,eleanor1,bykemo,aquemini,frogg,roboto,thorny,shipmate,logcabin,66005918,nokian,gonzos,louisian,1abcdefg,triathlo,ilovemar,couger,letmeino,supera,runvs,fibonacci,muttly,58565254,5thgbqi,vfnehsv,electr,jose12,artemis1,newlove,thd1shr,hawkey,grigoryan,saisha,tosca,redder,lifesux,temple1,bunnyman,thekids,sabbeth,tarzan1,182838,158uefas,dell50,1super,666222,47ds8x,jackhamm,mineonly,rfnfhbyf,048ro,665259,kristina1,bombero,52545856,secure1,bigloser,peterk,alex2,51525354,anarchy1,superx,teenslut,money23,sigmapi,sanfrancisco,acme34,private5,eclips,qwerttrewq,axelle,kokain,hardguy,peter69,jesuschr,dyanna,dude69,sarah69,toyota91,amberr,45645645,bugmenot,bigted,44556677,556644,wwr8x9pu,alphaome,harley13,kolia123,wejrpfpu,revelati,nairda,sodoff,cityboy,pinkpussy,dkalis,miami305,wow12345,triplet,tannenbau,asdfasdf1,darkhors,527952,retired1,soxfan,nfyz123,37583867,goddes,515069,gxlmxbewym,1warrior,36925814,dmb2011,topten,karpova,89876065093rax,naturals,gateway9,cepseoun,turbot,493949,cock22,italia1,sasafras,gopnik,stalke,1qazxdr5,wm2006,ace1062,alieva,blue28,aracel,sandia,motoguzz,terri1,emmajane,conej,recoba,alex1995,jerkyboy,cowboy12,arenrone,precisio,31415927,scsa316,panzer1,studly1,powerhou,bensam,mashoutq,billee,eeyore1,reape,thebeatl,rul3z,montesa,doodle1,cvzefh1gk,424365,a159753,zimmerma,gumdrop,ashaman,grimreap,icandoit,borodina,branca,dima2009,keywest1,vaders,bubluk,diavolo,assss,goleta,eatass,napster1,382436,369741,5411pimo,lenchik,pikach,gilgamesh,kalimera,singer1,gordon2,rjycnbnewbz,maulwurf,joker13,2much4u,bond00,alice123,robotec,fuckgirl,zgjybz,redhorse,margaret1,brady1,pumpkin2,chinky,fourplay,1booger,roisin,1brandon,sandan,blackheart,cheez,blackfin,cntgfyjdf,mymoney1,09080706,goodboss,sebring1,rose1,kensingt,bigboner,marcus12,ym3cautj,struppi,thestone,lovebugs,stater,silver99,forest99,qazwsx12345,vasile,longboar,mkonji,huligan,rhfcbdfz,airmail,porn11,1ooooo,sofun,snake2,msouthwa,dougla,1iceman,shahrukh,sharona,dragon666,france98,196800,196820,ps253535,zjses9evpa,sniper01,design1,konfeta,jack99,drum66,good4you,station2,brucew,regedit,school12,mvtnr765,pub113,fantas,tiburon1,king99,ghjcnjgbpltw,checkito,308win,1ladybug,corneliu,svetasveta,197430,icicle,imaccess,ou81269,jjjdsl,brandon6,bimbo1,smokee,piccolo1,3611jcmg,children2,cookie2,conor1,darth1,margera,aoi856,paully,ou812345,sklave,eklhigcz,30624700,amazing1,wahooo,seau55,1beer,apples2,chulo,dolphin9,heather6,198206,198207,hergood,miracle1,njhyflj,4real,milka,silverfi,fabfive,spring12,ermine,mammy,jumpjet,adilbek,toscana,caustic,hotlove,sammy69,lolita1,byoung,whipme,barney01,mistys,tree1,buster3,kaylin,gfccgjhn,132333,aishiteru,pangaea,fathead1,smurph,198701,ryslan,gasto,xexeylhf,anisimov,chevyss,saskatoo,brandy12,tweaker,irish123,music2,denny1,palpatin,outlaw1,lovesuck,woman1,mrpibb,diadora,hfnfneq,poulette,harlock,mclaren1,cooper12,newpass3,bobby12,rfgecnfcerf,alskdjfh,mini14,dukers,raffael,199103,cleo123,1234567qwertyu,mossberg,scoopy,dctulf,starline,hjvjxrf,misfits1,rangers2,bilbos,blackhea,pappnase,atwork,purple2,daywalker,summoner,1jjjjjjj,swansong,chris10,laluna,12345qqq,charly1,lionsden,money99,silver33,hoghead,bdaddy,199430,saisg002,nosaints,tirpitz,1gggggg,jason13,kingss,ernest1,0cdh0v99ue,pkunzip,arowana,spiri,deskjet1,armine,lances,magic2,thetaxi,14159265,cacique,14142135,orange10,richard0,backdraf,255ooo,humtum,kohsamui,c43dae874d,wrestling1,cbhtym,sorento,megha,pepsiman,qweqwe12,bliss7,mario64,korolev,balls123,schlange,gordit,optiquest,fatdick,fish99,richy,nottoday,dianne1,armyof1,1234qwerasdfzxcv,bbonds,aekara,lidiya,baddog1,yellow5,funkie,ryan01,greentree,gcheckout,marshal1,liliput,000000z,rfhbyrf,gtogto43,rumpole,tarado,marcelit,aqwzsxedc,kenshin1,sassydog,system12,belly1,zilla,kissfan,tools1,desember,donsdad,nick11,scorpio6,poopoo1,toto99,steph123,dogfuck,rocket21,thx113,dude12,sanek,sommar,smacky,pimpsta,letmego,k1200rs,lytghjgtnhjdcr,abigale,buddog,deles,baseball9,roofus,carlsbad,hamzah,hereiam,genial,schoolgirlie,yfz450,breads,piesek,washear,chimay,apocalyp,nicole18,gfgf1234,gobulls,dnevnik,wonderwall,beer1234,1moose,beer69,maryann1,adpass,mike34,birdcage,hottuna,gigant,penquin,praveen,donna123,123lol123,thesame,fregat,adidas11,selrahc,pandoras,test3,chasmo,111222333000,pecos,daniel11,ingersol,shana1,mama12345,cessna15,myhero,1simpson,nazarenko,cognit,seattle2,irina1,azfpc310,rfycthdf,hardy1,jazmyn,sl1200,hotlanta,jason22,kumar123,sujatha,fsd9shtyu,highjump,changer,entertai,kolding,mrbig,sayuri,eagle21,qwertzu,jorge1,0101dd,bigdong,ou812a,sinatra1,htcnjhfy,oleg123,videoman,pbyfblf,tv612se,bigbird1,kenaidog,gunite,silverma,ardmore,123123qq,hotbot,cascada,cbr600f4,harakiri,chico123,boscos,aaron12,glasgow1,kmn5hc,lanfear,1light,liveoak,fizika,ybrjkftdyf,surfside,intermilan,multipas,redcard,72chevy,balata,coolio1,schroede,kanat,testerer,camion,kierra,hejmeddig,antonio2,tornados,isidor,pinkey,n8skfswa,ginny1,houndog,1bill,chris25,hastur,1marine,greatdan,french1,hatman,123qqq,z1z2z3z4,kicker1,katiedog,usopen,smith22,mrmagoo,1234512i,assa123,7seven7,monster7,june12,bpvtyf,149521,guenter,alex1985,voronina,mbkugegs,zaqwsxcderfv,rusty5,mystic1,master0,abcdef12,jndfkb,r4zpm3,cheesey,skripka,blackwhite,sharon69,dro8smwq,lektor,techman,boognish,deidara,heckfyf,quietkey,authcode,monkey4,jayboy,pinkerto,merengue,chulita,bushwick,turambar,kittykit,joseph2,dad123,kristo,pepote,scheiss,hambone1,bigballa,restaura,tequil,111luzer,euro2000,motox,denhaag,chelsi,flaco1,preeti,lillo,1001sin,passw,august24,beatoff,555555d,willis1,kissthis,qwertyz,rvgmw2gl,iloveboobies,timati,kimbo,msinfo,dewdrop,sdbaker,fcc5nky2,messiah1,catboy,small1,chode,beastie1,star77,hvidovre,short1,xavie,dagobah,alex1987,papageno,dakota2,toonami,fuerte,jesus33,lawina,souppp,dirtybir,chrish,naturist,channel1,peyote,flibble,gutentag,lactate,killem,zucchero,robinho,ditka,grumpy1,avr7000,boxxer,topcop,berry1,mypass1,beverly1,deuce1,9638527410,cthuttdf,kzkmrf,lovethem,band1t,cantona1,purple11,apples123,wonderwo,123a456,fuzzie,lucky99,dancer2,hoddling,rockcity,winner12,spooty,mansfiel,aimee1,287hf71h,rudiger,culebra,god123,agent86,daniel0,bunky1,notmine,9ball,goofus,puffy1,xyh28af4,kulikov,bankshot,vurdf5i2,kevinm,ercole,sexygirls,razvan,october7,goater,lollie,raissa,thefrog,mdmaiwa3,mascha,jesussaves,union1,anthony9,crossroa,brother2,areyuke,rodman91,toonsex,dopeman,gericom,vaz2115,cockgobbler,12356789,12345699,signatur,alexandra1,coolwhip,erwin1,awdrgyjilp,pens66,ghjrjgtyrj,linkinpark,emergenc,psych0,blood666,bootmort,wetworks,piroca,johnd,iamthe1,supermario,homer69,flameon,image1,bebert,fylhtq1,annapoli,apple11,hockey22,10048,indahouse,mykiss,1penguin,markp,misha123,foghat,march11,hank1,santorin,defcon4,tampico,vbnhjafy,robert22,bunkie,athlon64,sex777,nextdoor,koskesh,lolnoob,seemnemaailm,black23,march15,yeehaa,chiqui,teagan,siegheil,monday2,cornhusk,mamusia,chilis,sthgrtst,feldspar,scottm,pugdog,rfghjy,micmac,gtnhjdyf,terminato,1jackson,kakosja,bogomol,123321aa,rkbvtyrj,tresor,tigertig,fuckitall,vbkkbjy,caramon,zxc12,balin,dildo1,soccer09,avata,abby123,cheetah1,marquise,jennyc,hondavfr,tinti,anna1985,dennis2,jorel,mayflowe,icema,hal2000,nikkis,bigmouth,greenery,nurjan,leonov,liberty7,fafnir,larionov,sat321321,byteme1,nausicaa,hjvfynbrf,everto,zebra123,sergio1,titone,wisdom1,kahala,104328q,marcin1,salima,pcitra,1nnnnn,nalini,galvesto,neeraj,rick1,squeeky,agnes1,jitterbu,agshar,maria12,0112358,traxxas,stivone,prophet1,bananza,sommer1,canoneos,hotfun,redsox11,1bigmac,dctdjkjl,legion1,everclea,valenok,black9,danny001,roxie1,1theman,mudslide,july16,lechef,chula,glamis,emilka,canbeef,ioanna,cactus1,rockshox,im2cool,ninja9,thvfrjdf,june28,milo17,missyou,micky1,nbibyf,nokiaa,goldi,mattias,fuckthem,asdzxc123,ironfist,junior01,nesta,crazzy,killswit,hygge,zantac,kazama,melvin1,allston,maandag,hiccup,prototyp,specboot,dwl610,hello6,159456,baldhead,redwhite,calpoly,whitetail,agile1,cousteau,matt01,aust1n,malcolmx,gjlfhjr,semperf1,ferarri,a1b2c3d,vangelis,mkvdari,bettis36,andzia,comand,tazzman,morgaine,pepluv,anna1990,inandout,anetka,anna1997,wallpape,moonrake,huntress,hogtie,cameron7,sammy7,singe11,clownboy,newzeala,wilmar,safrane,rebeld,poopi,granat,hammertime,nermin,11251422,xyzzy1,bogeys,jkmxbr,fktrcfyl,11223311,nfyrbcn,11223300,powerpla,zoedog,ybrbnbyf,zaphod42,tarawa,jxfhjdfirf,dude1234,g5wks9,goobe,czekolada,blackros,amaranth,medical1,thereds,julija,nhecsyfujkjdt,promopas,buddy4,marmalad,weihnachten,tronic,letici,passthief,67mustan,ds7zamnw,morri,w8woord,cheops,pinarell,sonofsam,av473dv,sf161pn,5c92v5h6,purple13,tango123,plant1,1baby,xufrgemw,fitta,1rangers,spawns,kenned,taratata,19944991,11111118,coronas,4ebouux8,roadrash,corvette1,dfyjdf846,marley12,qwaszxerdfcv,68stang,67stang,racin,ellehcim,sofiko,nicetry,seabass1,jazzman1,zaqwsx1,laz2937,uuuuuuu1,vlad123,rafale,j1234567,223366,nnnnnn1,226622,junkfood,asilas,cer980,daddymac,persepho,neelam,00700,shithappens,255555,qwertyy,xbox36,19755791,qweasd1,bearcub,jerryb,a1b1c1,polkaudio,basketball1,456rty,1loveyou,marcus2,mama1961,palace1,transcend,shuriken,sudhakar,teenlove,anabelle,matrix99,pogoda,notme,bartend,jordana,nihaoma,ataris,littlegi,ferraris,redarmy,giallo,fastdraw,accountbloc,peludo,pornostar,pinoyako,cindee,glassjaw,dameon,johnnyd,finnland,saudade,losbravo,slonko,toplay,smalltit,nicksfun,stockhol,penpal,caraj,divedeep,cannibus,poppydog,pass88,viktory,walhalla,arisia,lucozade,goldenbo,tigers11,caball,ownage123,tonna,handy1,johny,capital5,faith2,stillher,brandan,pooky1,antananarivu,hotdick,1justin,lacrimos,goathead,bobrik,cgtwbfkbcn,maywood,kamilek,gbplf123,gulnar,beanhead,vfvjyn,shash,viper69,ttttttt1,hondacr,kanako,muffer,dukies,justin123,agapov58,mushka,bad11bad,muleman,jojo123,andreika,makeit,vanill,boomers,bigals,merlin11,quacker,aurelien,spartak1922,ligeti,diana2,lawnmowe,fortune1,awesom,rockyy,anna1994,oinker,love88,eastbay,ab55484,poker0,ozzy666,papasmurf,antihero,photogra,ktm250,painkill,jegr2d2,p3orion,canman,dextur,qwest123,samboy,yomismo,sierra01,herber,vfrcbvvfrcbv,gloria1,llama1,pie123,bobbyjoe,buzzkill,skidrow,grabber,phili,javier1,9379992q,geroin,oleg1994,sovereig,rollover,zaq12qaz,battery1,killer13,alina123,groucho1,mario12,peter22,butterbean,elise1,lucycat,neo123,ferdi,golfer01,randie,gfhfyjbr,ventura1,chelsea3,pinoy,mtgox,yrrim7,shoeman,mirko,ffggyyo,65mustan,ufdibyjd,john55,suckfuck,greatgoo,fvfnjhb,mmmnnn,love20,1bullshi,sucesso,easy1234,robin123,rockets1,diamondb,wolfee,nothing0,joker777,glasnost,richar1,guille,sayan,koresh,goshawk,alexx,batman21,a123456b,hball,243122,rockandr,coolfool,isaia,mary1,yjdbrjdf,lolopc,cleocat,cimbo,lovehina,8vfhnf,passking,bonapart,diamond2,bigboys,kreator,ctvtyjdf,sassy123,shellac,table54781,nedkelly,philbert,sux2bu,nomis,sparky99,python1,littlebear,numpty,silmaril,sweeet,jamesw,cbufhtnf,peggysue,wodahs,luvsex,wizardry,venom123,love4you,bama1,samat,reviewpass,ned467,cjkjdtq,mamula,gijoe,amersham,devochka,redhill,gisel,preggo,polock,cando,rewster,greenlantern,panasonik,dave1234,mikeee,1carlos,miledi,darkness1,p0o9i8u7y6,kathryn1,happyguy,dcp500,assmaster,sambuka,sailormo,antonio3,logans,18254288,nokiax2,qwertzuiop,zavilov,totti,xenon1,edward11,targa1,something1,tony_t,q1w2e3r4t5y6u7i8o9p0,02551670,vladimir1,monkeybutt,greenda,neel21,craiger,saveliy,dei008,honda450,fylhtq95,spike2,fjnq8915,passwordstandard,vova12345,talonesi,richi,gigemags,pierre1,westin,trevoga,dorothee,bastogne,25563o,brandon3,truegrit,krimml,iamgreat,servis,a112233,paulinka,azimuth,corperfmonsy,358hkyp,homerun1,dogbert1,eatmyass,cottage1,savina,baseball7,bigtex,gimmesum,asdcxz,lennon1,a159357,1bastard,413276191q,pngfilt,pchealth,netsnip,bodiroga,1matt,webtvs,ravers,adapters,siddis,mashamasha,coffee2,myhoney,anna1982,marcia1,fairchil,maniek,iloveluc,batmonh,wildon,bowie1,netnwlnk,fancy1,tom204,olga1976,vfif123,queens1,ajax01,lovess,mockba,icam4usb,triada,odinthor,rstlne,exciter,sundog,anchorat,girls69,nfnmzyrf,soloma,gti16v,shadowman,ottom,rataros,tonchin,vishal,chicken0,pornlo,christiaan,volante,likesit,mariupol,runfast,gbpltw123,missys,villevalo,kbpjxrf,ghibli,calla,cessna172,kinglear,dell11,swift1,walera,1cricket,pussy5,turbo911,tucke,maprchem56458,rosehill,thekiwi1,ygfxbkgt,mandarinka,98xa29,magnit,cjfrf,paswoord,grandam1,shenmue,leedsuni,hatrick,zagadka,angeldog,michaell,dance123,koichi,bballs,29palms,xanth,228822,ppppppp1,1kkkkk,1lllll,mynewbots,spurss,madmax1,224455,city1,mmmmmmm1,nnnnnnn1,biedronka,thebeatles,elessar,f14tomcat,jordan18,bobo123,ayi000,tedbear,86chevyx,user123,bobolink,maktub,elmer1,flyfishi,franco1,gandalf0,traxdata,david21,enlighte,dmitrij,beckys,1giants,flippe,12345678w,jossie,rugbyman,snowcat,rapeme,peanut11,gemeni,udders,techn9ne,armani1,chappie,war123,vakantie,maddawg,sewanee,jake5253,tautt1,anthony5,letterma,jimbo2,kmdtyjr,hextall,jessica6,amiga500,hotcunt,phoenix9,veronda,saqartvelo,scubas,sixer3,williamj,nightfal,shihan,melnikova,kosssss,handily,killer77,jhrl0821,march17,rushman,6gcf636i,metoyou,irina123,mine11,primus1,formatters,matthew5,infotech,gangster1,jordan45,moose69,kompas,motoxxx,greatwhi,cobra12,kirpich,weezer1,hello23,montse,tracy123,connecte,cjymrf,hemingwa,azreal,gundam00,mobila,boxman,slayers1,ravshan,june26,fktrcfylhjd,bermuda1,tylerd,maersk,qazwsx11,eybdthcbntn,ash123,camelo,kat123,backd00r,cheyenne1,1king,jerkin,tnt123,trabant,warhammer40k,rambos,punto,home77,pedrito,1frank,brille,guitarman,george13,rakas,tgbxtcrbq,flute1,bananas1,lovezp1314,thespot,postie,buster69,sexytime,twistys,zacharia,sportage,toccata,denver7,terry123,bogdanova,devil69,higgins1,whatluck,pele10,kkk666,jeffery1,1qayxsw2,riptide1,chevy11,munchy,lazer1,hooker1,ghfgjh,vergesse,playgrou,4077mash,gusev,humpin,oneputt,hydepark,monster9,tiger8,tangsoo,guy123,hesoyam1,uhtqneyu,thanku,lomond,ortezza,kronik,geetha,rabbit66,killas,qazxswe,alabaste,1234567890qwerty,capone1,andrea12,geral,beatbox,slutfuck,booyaka,jasmine7,ostsee,maestro1,beatme,tracey1,buster123,donaldduck,ironfish,happy6,konnichi,gintonic,momoney1,dugan1,today2,enkidu,destiny2,trim7gun,katuha,fractals,morganstanley,polkadot,gotime,prince11,204060,fifa2010,bobbyt,seemee,amanda10,airbrush,bigtitty,heidie,layla1,cotton1,5speed,fyfnjkmtdyf,flynavy,joxury8f,meeko,akuma,dudley1,flyboy1,moondog1,trotters,mariami,signin,chinna,legs11,pussy4,1s1h1e1f1,felici,optimus1,iluvu,marlins1,gavaec,balance1,glock40,london01,kokot,southwes,comfort1,sammy11,rockbottom,brianc,litebeer,homero,chopsuey,greenlan,charit,freecell,hampster,smalldog,viper12,blofeld,1234567890987654321,realsex,romann,cartman2,cjdthitycndj,nelly1,bmw528,zwezda,masterba,jeep99,turtl,america2,sunburst,sanyco,auntjudy,125wm,blue10,qwsazx,cartma,toby12,robbob,red222,ilovecock,losfix16,1explore,helge,vaz2114,whynotme,baba123,mugen,1qazwsxedc,albertjr,0101198,sextime,supras,nicolas2,wantsex,pussy6,checkm8,winam,24gordon,misterme,curlew,gbljhfcs,medtech,franzi,butthea,voivod,blackhat,egoiste,pjkeirf,maddog69,pakalolo,hockey4,igor1234,rouges,snowhite,homefree,sexfreak,acer12,dsmith,blessyou,199410,vfrcbvjd,falco02,belinda1,yaglasph,april21,groundho,jasmin1,nevergiveup,elvir,gborv526,c00kie,emma01,awesome2,larina,mike12345,maximu,anupam,bltynbabrfwbz,tanushka,sukkel,raptor22,josh12,schalke04,cosmodog,fuckyou8,busybee,198800,bijoux,frame1,blackmor,giveit,issmall,bear13,123-123,bladez,littlegirl,ultra123,fletch1,flashnet,loploprock,rkelly,12step,lukas1,littlewhore,cuntfinger,stinkyfinger,laurenc,198020,n7td4bjl,jackie69,camel123,ben1234,1gateway,adelheid,fatmike,thuglove,zzaaqq,chivas1,4815162342q,mamadou,nadano,james22,benwin,andrea99,rjirf,michou,abkbgg,d50gnn,aaazzz,a123654,blankman,booboo11,medicus,bigbone,197200,justine1,bendix,morphius,njhvjp,44mag,zsecyus56,goodbye1,nokiadermo,a333444,waratsea,4rzp8ab7,fevral,brillian,kirbys,minim,erathia,grazia,zxcvb1234,dukey,snaggle,poppi,hymen,1video,dune2000,jpthjdf,cvbn123,zcxfcnkbdfz,astonv,ginnie,316271,engine3,pr1ncess,64chevy,glass1,laotzu,hollyy,comicbooks,assasins,nuaddn9561,scottsda,hfcnfvfy,accobra,7777777z,werty123,metalhead,romanson,redsand,365214,shalo,arsenii,1989cc,sissi,duramax,382563,petera,414243,mamapap,jollymon,field1,fatgirl,janets,trompete,matchbox20,rambo2,nepenthe,441232,qwertyuiop10,bozo123,phezc419hv,romantika,lifestyl,pengui,decembre,demon6,panther6,444888,scanman,ghjcnjabkz,pachanga,buzzword,indianer,spiderman3,tony12,startre,frog1,fyutk,483422,tupacshakur,albert12,1drummer,bmw328i,green17,aerdna,invisibl,summer13,calimer,mustaine,lgnu9d,morefun,hesoyam123,escort1,scrapland,stargat,barabbas,dead13,545645,mexicali,sierr,gfhfpbn,gonchar,moonstafa,searock,counte,foster1,jayhawk1,floren,maremma,nastya2010,softball1,adaptec,halloo,barrabas,zxcasd123,hunny,mariana1,kafedra,freedom0,green420,vlad1234,method7,665566,tooting,hallo12,davinchi,conducto,medias,666444,invernes,madhatter,456asd,12345678i,687887,le33px,spring00,help123,bellybut,billy5,vitalik1,river123,gorila,bendis,power666,747200,footslav,acehigh,qazxswedc123,q1a1z1,richard9,peterburg,tabletop,gavrilov,123qwe1,kolosov,fredrau,run4fun,789056,jkbvgbflf,chitra,87654321q,steve22,wideopen,access88,surfe,tdfyutkbjy,impossib,kevin69,880888,cantina,887766,wxcvb,dontforg,qwer1209,asslicke,mamma123,indig,arkasha,scrapp,morelia,vehxbr,jones2,scratch1,cody11,cassie12,gerbera,dontgotm,underhil,maks2010,hollywood1,hanibal,elena2010,jason11,1010321,stewar,elaman,fireplug,goodby,sacrific,babyphat,bobcat12,bruce123,1233215,tony45,tiburo,love15,bmw750,wallstreet,2h0t4me,1346795,lamerz,munkee,134679q,granvill,1512198,armastus,aiden1,pipeutvj,g1234567,angeleyes,usmc1,102030q,putangina,brandnew,shadowfax,eagles12,1falcon,brianw,lokomoti,2022958,scooper,pegas,jabroni1,2121212,buffal,siffredi,wewiz,twotone,rosebudd,nightwis,carpet1,mickey2,2525252,sleddog,red333,jamesm,2797349,jeff12,onizuka,felixxxx,rf6666,fine1,ohlala,forplay,chicago5,muncho,scooby11,ptichka,johnnn,19851985p,dogphil3650,totenkopf,monitor2,macross7,3816778,dudder,semaj1,bounder,racerx1,5556633,7085506,ofclr278,brody1,7506751,nantucke,hedj2n4q,drew1,aessedai,trekbike,pussykat,samatron,imani,9124852,wiley1,dukenukem,iampurehaha2,9556035,obvious1,mccool24,apache64,kravchenko,justforf,basura,jamese,s0ccer,safado,darksta,surfer69,damian1,gjpbnbd,gunny1,wolley,sananton,zxcvbn123456,odt4p6sv8,sergei1,modem1,mansikka,zzzz1,rifraf,dima777,mary69,looking4,donttell,red100,ninjutsu,uaeuaeman,bigbri,brasco,queenas8151,demetri,angel007,bubbl,kolort,conny,antonia1,avtoritet,kaka22,kailayu,sassy2,wrongway,chevy3,1nascar,patriots1,chrisrey,mike99,sexy22,chkdsk,sd3utre7,padawan,a6pihd,doming,mesohorny,tamada,donatello,emma22,eather,susan69,pinky123,stud69,fatbitch,pilsbury,thc420,lovepuss,1creativ,golf1234,hurryup,1honda,huskerdu,marino1,gowron,girl1,fucktoy,gtnhjpfdjlcr,dkjfghdk,pinkfl,loreli,7777777s,donkeykong,rockytop,staples1,sone4ka,xxxjay,flywheel,toppdogg,bigbubba,aaa123456,2letmein,shavkat,paule,dlanor,adamas,0147852,aassaa,dixon1,bmw328,mother12,ilikepussy,holly2,tsmith,excaliber,fhutynbyf,nicole3,tulipan,emanue,flyvholm,currahee,godsgift,antonioj,torito,dinky1,sanna,yfcnzvjz,june14,anime123,123321456654,hanswurst,bandman,hello101,xxxyyy,chevy69,technica,tagada,arnol,v00d00,lilone,filles,drumandbass,dinamit,a1234a,eatmeat,elway07,inout,james6,dawid1,thewolf,diapason,yodaddy,qscwdv,fuckit1,liljoe,sloeber,simbacat,sascha1,qwe1234,1badger,prisca,angel17,gravedig,jakeyboy,longboard,truskawka,golfer11,pyramid7,highspee,pistola,theriver,hammer69,1packers,dannyd,alfonse,qwertgfdsa,11119999,basket1,ghjtrn,saralee,12inches,paolo1,zse4xdr5,taproot,sophieh6,grizzlie,hockey69,danang,biggums,hotbitch,5alive,beloved1,bluewave,dimon95,koketka,multiscan,littleb,leghorn,poker2,delite,skyfir,bigjake,persona1,amberdog,hannah12,derren,ziffle,1sarah,1assword,sparky01,seymur,tomtom1,123321qw,goskins,soccer19,luvbekki,bumhole,2balls,1muffin,borodin,monkey9,yfeiybrb,1alex,betmen,freder,nigger123,azizbek,gjkzrjdf,lilmike,1bigdadd,1rock,taganrog,snappy1,andrey1,kolonka,bunyan,gomango,vivia,clarkkent,satur,gaudeamus,mantaray,1month,whitehea,fargus,andrew99,ray123,redhawks,liza2009,qw12345,den12345,vfhnsyjdf,147258369a,mazepa,newyorke,1arsenal,hondas2000,demona,fordgt,steve12,birthday2,12457896,dickster,edcwsxqaz,sahalin,pantyman,skinny1,hubertus,cumshot1,chiro,kappaman,mark3434,canada12,lichking,bonkers1,ivan1985,sybase,valmet,doors1,deedlit,kyjelly,bdfysx,ford11,throatfuck,backwood,fylhsq,lalit,boss429,kotova,bricky,steveh,joshua19,kissa,imladris,star1234,lubimka,partyman,crazyd,tobias1,ilike69,imhome,whome,fourstar,scanner1,ujhjl312,anatoli,85bears,jimbo69,5678ytr,potapova,nokia7070,sunday1,kalleank,1996gta,refinnej,july1,molodec,nothanks,enigm,12play,sugardog,nhfkbdfkb,larousse,cannon1,144444,qazxcdew,stimorol,jhereg,spawn7,143000,fearme,hambur,merlin21,dobie,is3yeusc,partner1,dekal,varsha,478jfszk,flavi,hippo1,9hmlpyjd,july21,7imjfstw,lexxus,truelov,nokia5200,carlos6,anais,mudbone,anahit,taylorc,tashas,larkspur,animal2000,nibiru,jan123,miyvarxar,deflep,dolore,communit,ifoptfcor,laura2,anadrol,mamaliga,mitzi1,blue92,april15,matveev,kajlas,wowlook1,1flowers,shadow14,alucard1,1golf,bantha,scotlan,singapur,mark13,manchester1,telus01,superdav,jackoff1,madnes,bullnuts,world123,clitty,palmer1,david10,spider10,sargsyan,rattlers,david4,windows2,sony12,visigoth,qqqaaa,penfloor,cabledog,camilla1,natasha123,eagleman,softcore,bobrov,dietmar,divad,sss123,d1234567,tlbyjhju,1q1q1q1,paraiso,dav123,lfiekmrf,drachen,lzhan16889,tplate,gfghbrf,casio1,123boots1,123test,sys64738,heavymetal,andiamo,meduza,soarer,coco12,negrita,amigas,heavymet,bespin,1asdfghj,wharfrat,wetsex,tight1,janus1,sword123,ladeda,dragon98,austin2,atep1,jungle1,12345abcd,lexus300,pheonix1,alex1974,123qw123,137955,bigtim,shadow88,igor1994,goodjob,arzen,champ123,121ebay,changeme1,brooksie,frogman1,buldozer,morrowin,achim,trish1,lasse,festiva,bubbaman,scottb,kramit,august22,tyson123,passsword,oompah,al123456,fucking1,green45,noodle1,looking1,ashlynn,al1716,stang50,coco11,greese,bob111,brennan1,jasonj,1cherry,1q2345,1xxxxxxx,fifa2011,brondby,zachar1,satyam,easy1,magic7,1rainbow,cheezit,1eeeeeee,ashley123,assass1,amanda123,jerbear,1bbbbbb,azerty12,15975391,654321z,twinturb,onlyone1,denis1988,6846kg3r,jumbos,pennydog,dandelion,haileris,epervier,snoopy69,afrodite,oldpussy,green55,poopypan,verymuch,katyusha,recon7,mine69,tangos,contro,blowme2,jade1,skydive1,fiveiron,dimo4ka,bokser,stargirl,fordfocus,tigers2,platina,baseball11,raque,pimper,jawbreak,buster88,walter34,chucko,penchair,horizon1,thecure1,scc1975,adrianna1,kareta,duke12,krille,dumbfuck,cunt1,aldebaran,laverda,harumi,knopfler,pongo1,pfhbyf,dogman1,rossigno,1hardon,scarlets,nuggets1,ibelieve,akinfeev,xfhkbr,athene,falcon69,happie,billly,nitsua,fiocco,qwerty09,gizmo2,slava2,125690,doggy123,craigs,vader123,silkeborg,124365,peterm,123978,krakatoa,123699,123592,kgvebmqy,pensacol,d1d2d3,snowstor,goldenboy,gfg65h7,ev700,church1,orange11,g0dz1ll4,chester3,acheron,cynthi,hotshot1,jesuschris,motdepass,zymurgy,one2one,fietsbel,harryp,wisper,pookster,nn527hp,dolla,milkmaid,rustyboy,terrell1,epsilon1,lillian1,dale3,crhbgrf,maxsim,selecta,mamada,fatman1,ufkjxrf,shinchan,fuckuall,women1,000008,bossss,greta1,rbhjxrf,mamasboy,purple69,felicidade,sexy21,cathay,hunglow,splatt,kahless,shopping1,1gandalf,themis,delta7,moon69,blue24,parliame,mamma1,miyuki,2500hd,jackmeof,razer,rocker1,juvis123,noremac,boing747,9z5ve9rrcz,icewater,titania,alley1,moparman,christo1,oliver2,vinicius,tigerfan,chevyy,joshua99,doda99,matrixx,ekbnrf,jackfrost,viper01,kasia,cnfhsq,triton1,ssbt8ae2,rugby8,ramman,1lucky,barabash,ghtlfntkm,junaid,apeshit,enfant,kenpo1,shit12,007000,marge1,shadow10,qwerty789,richard8,vbitkm,lostboys,jesus4me,richard4,hifive,kolawole,damilola,prisma,paranoya,prince2,lisaann,happyness,cardss,methodma,supercop,a8kd47v5,gamgee,polly123,irene1,number8,hoyasaxa,1digital,matthew0,dclxvi,lisica,roy123,2468013579,sparda,queball,vaffanculo,pass1wor,repmvbx,999666333,freedom8,botanik,777555333,marcos1,lubimaya,flash2,einstei,08080,123456789j,159951159,159357123,carrot1,alina1995,sanjos,dilara,mustang67,wisteria,jhnjgtl12,98766789,darksun,arxangel,87062134,creativ1,malyshka,fuckthemall,barsic,rocksta,2big4u,5nizza,genesis2,romance1,ofcourse,1horse,latenite,cubana,sactown,789456123a,milliona,61808861,57699434,imperia,bubba11,yellow3,change12,55495746,flappy,jimbo123,19372846,19380018,cutlass1,craig123,klepto,beagle1,solus,51502112,pasha1,19822891,46466452,19855891,petshop,nikolaevna,119966,nokia6131,evenpar,hoosier1,contrasena,jawa350,gonzo123,mouse2,115511,eetfuk,gfhfvgfvgfv,1crystal,sofaking,coyote1,kwiatuszek,fhrflbq,valeria1,anthro,0123654789,alltheway,zoltar,maasikas,wildchil,fredonia,earlgrey,gtnhjczy,matrix123,solid1,slavko,12monkeys,fjdksl,inter1,nokia6500,59382113kevinp,spuddy,cachero,coorslit,password!,kiba1z,karizma,vova1994,chicony,english1,bondra12,1rocket,hunden,jimbob1,zpflhjn1,th0mas,deuce22,meatwad,fatfree,congas,sambora,cooper2,janne,clancy1,stonie,busta,kamaz,speedy2,jasmine3,fahayek,arsenal0,beerss,trixie1,boobs69,luansantana,toadman,control2,ewing33,maxcat,mama1964,diamond4,tabaco,joshua0,piper2,music101,guybrush,reynald,pincher,katiebug,starrs,pimphard,frontosa,alex97,cootie,clockwor,belluno,skyeseth,booty69,chaparra,boochie,green4,bobcat1,havok,saraann,pipeman,aekdb,jumpshot,wintermu,chaika,1chester,rjnjatq,emokid,reset1,regal1,j0shua,134679a,asmodey,sarahh,zapidoo,ciccione,sosexy,beckham23,hornets1,alex1971,delerium,manageme,connor11,1rabbit,sane4ek,caseyboy,cbljhjdf,redsox20,tttttt99,haustool,ander,pantera6,passwd1,journey1,9988776655,blue135,writerspace,xiaoyua123,justice2,niagra,cassis,scorpius,bpgjldsgjldthnf,gamemaster,bloody1,retrac,stabbin,toybox,fight1,ytpyf.,glasha,va2001,taylor11,shameles,ladylove,10078,karmann,rodeos,eintritt,lanesra,tobasco,jnrhjqcz,navyman,pablit,leshka,jessica3,123vika,alena1,platinu,ilford,storm7,undernet,sasha777,1legend,anna2002,kanmax1994,porkpie,thunder0,gundog,pallina,easypass,duck1,supermom,roach1,twincam,14028,tiziano,qwerty32,123654789a,evropa,shampoo1,yfxfkmybr,cubby1,tsunami1,fktrcttdf,yasacrac,17098,happyhap,bullrun,rodder,oaktown,holde,isbest,taylor9,reeper,hammer11,julias,rolltide1,compaq123,fourx4,subzero1,hockey9,7mary3,busines,ybrbnjcbr,wagoneer,danniash,portishead,digitex,alex1981,david11,infidel,1snoopy,free30,jaden,tonto1,redcar27,footie,moskwa,thomas21,hammer12,burzum,cosmo123,50000,burltree,54343,54354,vwpassat,jack5225,cougars1,burlpony,blackhorse,alegna,petert,katemoss,ram123,nels0n,ferrina,angel77,cstock,1christi,dave55,abc123a,alex1975,av626ss,flipoff,folgore,max1998,science1,si711ne,yams7,wifey1,sveiks,cabin1,volodia,ox3ford,cartagen,platini,picture1,sparkle1,tiedomi,service321,wooody,christi1,gnasher,brunob,hammie,iraffert,bot2010,dtcyeirf,1234567890p,cooper11,alcoholi,savchenko,adam01,chelsea5,niewiem,icebear,lllooottt,ilovedick,sweetpus,money8,cookie13,rfnthbyf1988,booboo2,angus123,blockbus,david9,chica1,nazaret,samsung9,smile4u,daystar,skinnass,john10,thegirl,sexybeas,wasdwasd1,sigge1,1qa2ws3ed4rf5tg,czarny,ripley1,chris5,ashley19,anitha,pokerman,prevert,trfnthby,tony69,georgia2,stoppedb,qwertyuiop12345,miniclip,franky1,durdom,cabbages,1234567890o,delta5,liudmila,nhfycajhvths,court1,josiew,abcd1,doghead,diman,masiania,songline,boogle,triston,deepika,sexy4me,grapple,spacebal,ebonee,winter0,smokewee,nargiza,dragonla,sassys,andy2000,menards,yoshio,massive1,suckmy1k,passat99,sexybo,nastya1996,isdead,stratcat,hokuto,infix,pidoras,daffyduck,cumhard,baldeagl,kerberos,yardman,shibainu,guitare,cqub6553,tommyy,bk.irf,bigfoo,hecto,july27,james4,biggus,esbjerg,isgod,1irish,phenmarr,jamaic,roma1990,diamond0,yjdbrjd,girls4me,tampa1,kabuto,vaduz,hanse,spieng,dianochka,csm101,lorna1,ogoshi,plhy6hql,2wsx4rfv,cameron0,adebayo,oleg1996,sharipov,bouboule,hollister1,frogss,yeababy,kablam,adelante,memem,howies,thering,cecilia1,onetwo12,ojp123456,jordan9,msorcloledbr,neveraga,evh5150,redwin,1august,canno,1mercede,moody1,mudbug,chessmas,tiikeri,stickdaddy77,alex15,kvartira,7654321a,lollol123,qwaszxedc,algore,solana,vfhbyfvfhbyf,blue72,misha1111,smoke20,junior13,mogli,threee,shannon2,fuckmylife,kevinh,saransk,karenw,isolde,sekirarr,orion123,thomas0,debra1,laketaho,alondra,curiva,jazz1234,1tigers,jambos,lickme2,suomi,gandalf7,028526,zygote,brett123,br1ttany,supafly,159000,kingrat,luton1,cool-ca,bocman,thomasd,skiller,katter,mama777,chanc,tomass,1rachel,oldno7,rfpfyjdf,bigkev,yelrah,primas,osito,kipper1,msvcr71,bigboy11,thesun,noskcaj,chicc,sonja1,lozinka,mobile1,1vader,ummagumma,waves1,punter12,tubgtn,server1,irina1991,magic69,dak001,pandemonium,dead1,berlingo,cherrypi,1montana,lohotron,chicklet,asdfgh123456,stepside,ikmvw103,icebaby,trillium,1sucks,ukrnet,glock9,ab12345,thepower,robert8,thugstools,hockey13,buffon,livefree,sexpics,dessar,ja0000,rosenrot,james10,1fish,svoloch,mykitty,muffin11,evbukb,shwing,artem1992,andrey1992,sheldon1,passpage,nikita99,fubar123,vannasx,eight888,marial,max2010,express2,violentj,2ykn5ccf,spartan11,brenda69,jackiech,abagail,robin2,grass1,andy76,bell1,taison,superme,vika1995,xtr451,fred20,89032073168,denis1984,2000jeep,weetabix,199020,daxter,tevion,panther8,h9iymxmc,bigrig,kalambur,tsalagi,12213443,racecar02,jeffrey4,nataxa,bigsam,purgator,acuracl,troutbum,potsmoke,jimmyz,manutd1,nytimes,pureevil,bearss,cool22,dragonage,nodnarb,dbrbyu,4seasons,freude,elric1,werule,hockey14,12758698,corkie,yeahright,blademan,tafkap,clave,liziko,hofner,jeffhardy,nurich,runne,stanisla,lucy1,monk3y,forzaroma,eric99,bonaire,blackwoo,fengshui,1qaz0okm,newmoney,pimpin69,07078,anonymer,laptop1,cherry12,ace111,salsa1,wilbur1,doom12,diablo23,jgtxzbhr,under1,honda01,breadfan,megan2,juancarlos,stratus1,ackbar,love5683,happytim,lambert1,cbljhtyrj,komarov,spam69,nfhtkrf,brownn,sarmat,ifiksr,spike69,hoangen,angelz,economia,tanzen,avogadro,1vampire,spanners,mazdarx,queequeg,oriana,hershil,sulaco,joseph11,8seconds,aquariu,cumberla,heather9,anthony8,burton12,crystal0,maria3,qazwsxc,snow123,notgood,198520,raindog,heehaw,consulta,dasein,miller01,cthulhu1,dukenuke,iubire,baytown,hatebree,198505,sistem,lena12,welcome01,maraca,middleto,sindhu,mitsou,phoenix5,vovan,donaldo,dylandog,domovoy,lauren12,byrjuybnj,123llll,stillers,sanchin,tulpan,smallvill,1mmmmm,patti1,folgers,mike31,colts18,123456rrr,njkmrjz,phoenix0,biene,ironcity,kasperok,password22,fitnes,matthew6,spotligh,bujhm123,tommycat,hazel5,guitar11,145678,vfcmrf,compass1,willee,1barney,jack2000,littleminge,shemp,derrek,xxx12345,littlefuck,spuds1,karolinka,camneely,qwertyu123,142500,brandon00,munson15,falcon3,passssap,z3cn2erv,goahead,baggio10,141592,denali1,37kazoo,copernic,123456789asd,orange88,bravada,rush211,197700,pablo123,uptheass,samsam1,demoman,mattylad10,heydude,mister2,werken,13467985,marantz,a22222,f1f2f3f4,fm12mn12,gerasimova,burrito1,sony1,glenny,baldeagle,rmfidd,fenomen,verbati,forgetme,5element,wer138,chanel1,ooicu812,10293847qp,minicooper,chispa,myturn,deisel,vthrehbq,boredboi4u,filatova,anabe,poiuyt1,barmalei,yyyy1,fourkids,naumenko,bangbros,pornclub,okaykk,euclid90,warrior3,kornet,palevo,patatina,gocart,antanta,jed1054,clock1,111111w,dewars,mankind1,peugeot406,liten,tahira,howlin,naumov,rmracing,corone,cunthole,passit,rock69,jaguarxj,bumsen,197101,sweet2,197010,whitecat,sawadee,money100,yfhrjnbrb,andyboy,9085603566,trace1,fagget,robot1,angel20,6yhn7ujm,specialinsta,kareena,newblood,chingada,boobies2,bugger1,squad51,133andre,call06,ashes1,ilovelucy,success2,kotton,cavalla,philou,deebee,theband,nine09,artefact,196100,kkkkkkk1,nikolay9,onelov,basia,emilyann,sadman,fkrjujkbr,teamomuch,david777,padrino,money21,firdaus,orion3,chevy01,albatro,erdfcv,2legit,sarah7,torock,kevinn,holio,soloy,enron714,starfleet,qwer11,neverman,doctorwh,lucy11,dino12,trinity7,seatleon,o123456,pimpman,1asdfgh,snakebit,chancho,prorok,bleacher,ramire,darkseed,warhorse,michael123,1spanky,1hotdog,34erdfcv,n0th1ng,dimanche,repmvbyf,michaeljackson,login1,icequeen,toshiro,sperme,racer2,veget,birthday26,daniel9,lbvekmrf,charlus,bryan123,wspanic,schreibe,1andonly,dgoins,kewell,apollo12,egypt1,fernie,tiger21,aa123456789,blowj,spandau,bisquit,12345678d,deadmau5,fredie,311420,happyface,samant,gruppa,filmstar,andrew17,bakesale,sexy01,justlook,cbarkley,paul11,bloodred,rideme,birdbath,nfkbcvfy,jaxson,sirius1,kristof,virgos,nimrod1,hardc0re,killerbee,1abcdef,pitcher1,justonce,vlada,dakota99,vespucci,wpass,outside1,puertori,rfvbkf,teamlosi,vgfun2,porol777,empire11,20091989q,jasong,webuivalidat,escrima,lakers08,trigger2,addpass,342500,mongini,dfhtybr,horndogg,palermo1,136900,babyblu,alla98,dasha2010,jkelly,kernow,yfnecz,rockhopper,toeman,tlaloc,silver77,dave01,kevinr,1234567887654321,135642,me2you,8096468644q,remmus,spider7,jamesa,jilly,samba1,drongo,770129ji,supercat,juntas,tema1234,esthe,1234567892000,drew11,qazqaz123,beegees,blome,rattrace,howhigh,tallboy,rufus2,sunny2,sou812,miller12,indiana7,irnbru,patch123,letmeon,welcome5,nabisco,9hotpoin,hpvteb,lovinit,stormin,assmonke,trill,atlanti,money1234,cubsfan,mello1,stars2,ueptkm,agate,dannym88,lover123,wordz,worldnet,julemand,chaser1,s12345678,pissword,cinemax,woodchuc,point1,hotchkis,packers2,bananana,kalender,420666,penguin8,awo8rx3wa8t,hoppie,metlife,ilovemyfamily,weihnachtsbau,pudding1,luckystr,scully1,fatboy1,amizade,dedham,jahbless,blaat,surrende,****er,1panties,bigasses,ghjuhfvbcn,asshole123,dfktyrb,likeme,nickers,plastik,hektor,deeman,muchacha,cerebro,santana5,testdrive,dracula1,canalc,l1750sq,savannah1,murena,1inside,pokemon00,1iiiiiii,jordan20,sexual1,mailliw,calipso,014702580369,1zzzzzz,1jjjjjj,break1,15253545,yomama1,katinka,kevin11,1ffffff,martijn,sslazio,daniel5,porno2,nosmas,leolion,jscript,15975312,pundai,kelli1,kkkddd,obafgkm,marmaris,lilmama,london123,rfhfnt,elgordo,talk87,daniel7,thesims3,444111,bishkek,afrika2002,toby22,1speedy,daishi,2children,afroman,qqqqwwww,oldskool,hawai,v55555,syndicat,pukimak,fanatik,tiger5,parker01,bri5kev6,timexx,wartburg,love55,ecosse,yelena03,madinina,highway1,uhfdbwfgf,karuna,buhjvfybz,wallie,46and2,khalif,europ,qaz123wsx456,bobbybob,wolfone,falloutboy,manning18,scuba10,schnuff,ihateyou1,lindam,sara123,popcor,fallengun,divine1,montblanc,qwerty8,rooney10,roadrage,bertie1,latinus,lexusis,rhfvfnjhcr,opelgt,hitme,agatka,1yamaha,dmfxhkju,imaloser,michell1,sb211st,silver22,lockedup,andrew9,monica01,sassycat,dsobwick,tinroof,ctrhtnyj,bultaco,rhfcyjzhcr,aaaassss,14ss88,joanne1,momanddad,ahjkjdf,yelhsa,zipdrive,telescop,500600,1sexsex,facial1,motaro,511647,stoner1,temujin,elephant1,greatman,honey69,kociak,ukqmwhj6,altezza,cumquat,zippos,kontiki,123max,altec1,bibigon,tontos,qazsew,nopasaran,militar,supratt,oglala,kobayash,agathe,yawetag,dogs1,cfiekmrf,megan123,jamesdea,porosenok,tiger23,berger1,hello11,seemann,stunner1,walker2,imissu,jabari,minfd,lollol12,hjvfy,1-oct,stjohns,2278124q,123456789qwer,alex1983,glowworm,chicho,mallards,bluedevil,explorer1,543211,casita,1time,lachesis,alex1982,airborn1,dubesor,changa,lizzie1,captaink,socool,bidule,march23,1861brr,k.ljxrf,watchout,fotze,1brian,keksa2,aaaa1122,matrim,providian,privado,dreame,merry1,aregdone,davidt,nounour,twenty2,play2win,artcast2,zontik,552255,shit1,sluggy,552861,dr8350,brooze,alpha69,thunder6,kamelia2011,caleb123,mmxxmm,jamesh,lfybkjd,125267,125000,124536,bliss1,dddsss,indonesi,bob69,123888,tgkbxfgy,gerar,themack,hijodeputa,good4now,ddd123,clk430,kalash,tolkien1,132forever,blackb,whatis,s1s2s3s4,lolkin09,yamahar,48n25rcc,djtiesto,111222333444555,bigbull,blade55,coolbree,kelse,ichwill,yamaha12,sakic,bebeto,katoom,donke,sahar,wahine,645202,god666,berni,starwood,june15,sonoio,time123,llbean,deadsoul,lazarev,cdtnf,ksyusha,madarchod,technik,jamesy,4speed,tenorsax,legshow,yoshi1,chrisbl,44e3ebda,trafalga,heather7,serafima,favorite4,havefun1,wolve,55555r,james13,nosredna,bodean,jlettier,borracho,mickael,marinus,brutu,sweet666,kiborg,rollrock,jackson6,macross1,ousooner,9085084232,takeme,123qwaszx,firedept,vfrfhjd,jackfros,123456789000,briane,cookie11,baby22,bobby18,gromova,systemofadown,martin01,silver01,pimaou,darthmaul,hijinx,commo,chech,skyman,sunse,2vrd6,vladimirovna,uthvfybz,nicole01,kreker,bobo1,v123456789,erxtgb,meetoo,drakcap,vfvf12,misiek1,butane,network2,flyers99,riogrand,jennyk,e12345,spinne,avalon11,lovejone,studen,maint,porsche2,qwerty100,chamberl,bluedog1,sungam,just4u,andrew23,summer22,ludic,musiclover,aguil,beardog1,libertin,pippo1,joselit,patito,bigberth,digler,sydnee,jockstra,poopo,jas4an,nastya123,profil,fuesse,default1,titan2,mendoz,kpcofgs,anamika,brillo021,bomberman,guitar69,latching,69pussy,blues2,phelge,ninja123,m7n56xo,qwertasd,alex1976,cunningh,estrela,gladbach,marillion,mike2000,258046,bypop,muffinman,kd5396b,zeratul,djkxbwf,john77,sigma2,1linda,selur,reppep,quartz1,teen1,freeclus,spook1,kudos4ever,clitring,sexiness,blumpkin,macbook,tileman,centra,escaflowne,pentable,shant,grappa,zverev,1albert,lommerse,coffee11,777123,polkilo,muppet1,alex74,lkjhgfdsazx,olesica,april14,ba25547,souths,jasmi,arashi,smile2,2401pedro,mybabe,alex111,quintain,pimp1,tdeir8b2,makenna,122333444455555,%e2%82%ac,tootsie1,pass111,zaqxsw123,gkfdfybt,cnfnbcnbrf,usermane,iloveyou12,hard69,osasuna,firegod,arvind,babochka,kiss123,cookie123,julie123,kamakazi,dylan2,223355,tanguy,nbhtqa,tigger13,tubby1,makavel,asdflkj,sambo1,mononoke,mickeys,gayguy,win123,green33,wcrfxtvgbjy,bigsmall,1newlife,clove,babyfac,bigwaves,mama1970,shockwav,1friday,bassey,yarddog,codered1,victory7,bigrick,kracker,gulfstre,chris200,sunbanna,bertuzzi,begemotik,kuolema,pondus,destinee,123456789zz,abiodun,flopsy,amadeusptfcor,geronim,yggdrasi,contex,daniel6,suck1,adonis1,moorea,el345612,f22raptor,moviebuf,raunchy,6043dkf,zxcvbnm123456789,eric11,deadmoin,ratiug,nosliw,fannies,danno,888889,blank1,mikey2,gullit,thor99,mamiya,ollieb,thoth,dagger1,websolutionssu,bonker,prive,1346798520,03038,q1234q,mommy2,contax,zhipo,gwendoli,gothic1,1234562000,lovedick,gibso,digital2,space199,b26354,987654123,golive,serious1,pivkoo,better1,824358553,794613258,nata1980,logout,fishpond,buttss,squidly,good4me,redsox19,jhonny,zse45rdx,matrixxx,honey12,ramina,213546879,motzart,fall99,newspape,killit,gimpy,photowiz,olesja,thebus,marco123,147852963,bedbug,147369258,hellbound,gjgjxrf,123987456,lovehurt,five55,hammer01,1234554321a,alina2011,peppino,ang238,questor,112358132,alina1994,alina1998,money77,bobjones,aigerim,cressida,madalena,420smoke,tinchair,raven13,mooser,mauric,lovebu,adidas69,krypton1,1111112,loveline,divin,voshod,michaelm,cocotte,gbkbuhbv,76689295,kellyj,rhonda1,sweetu70,steamforums,geeque,nothere,124c41,quixotic,steam181,1169900,rfcgthcrbq,rfvbkm,sexstuff,1231230,djctvm,rockstar1,fulhamfc,bhecbr,rfntyf,quiksilv,56836803,jedimaster,pangit,gfhjkm777,tocool,1237654,stella12,55378008,19216811,potte,fender12,mortalkombat,ball1,nudegirl,palace22,rattrap,debeers,lickpussy,jimmy6,not4u2c,wert12,bigjuggs,sadomaso,1357924,312mas,laser123,arminia,branford,coastie,mrmojo,19801982,scott11,banaan123,ingres,300zxtt,hooters6,sweeties,19821983,19831985,19833891,sinnfein,welcome4,winner69,killerman,tachyon,tigre1,nymets1,kangol,martinet,sooty1,19921993,789qwe,harsingh,1597535,thecount,phantom3,36985214,lukas123,117711,pakistan1,madmax11,willow01,19932916,fucker12,flhrci,opelagila,theword,ashley24,tigger3,crazyj,rapide,deadfish,allana,31359092,sasha1993,sanders2,discman,zaq!2wsx,boilerma,mickey69,jamesg,babybo,jackson9,orion7,alina2010,indien,breeze1,atease,warspite,bazongaz,1celtic,asguard,mygal,fitzgera,1secret,duke33,cyklone,dipascuc,potapov,1escobar2,c0l0rad0,kki177hk,1little,macondo,victoriya,peter7,red666,winston6,kl?benhavn,muneca,jackme,jennan,happylife,am4h39d8nh,bodybuil,201980,dutchie,biggame,lapo4ka,rauchen,black10,flaquit,water12,31021364,command2,lainth88,mazdamx5,typhon,colin123,rcfhlfc,qwaszx11,g0away,ramir,diesirae,hacked1,cessna1,woodfish,enigma2,pqnr67w5,odgez8j3,grisou,hiheels,5gtgiaxm,2580258,ohotnik,transits,quackers,serjik,makenzie,mdmgatew,bryana,superman12,melly,lokit,thegod,slickone,fun4all,netpass,penhorse,1cooper,nsync,asdasd22,otherside,honeydog,herbie1,chiphi,proghouse,l0nd0n,shagg,select1,frost1996,casper123,countr,magichat,greatzyo,jyothi,3bears,thefly,nikkita,fgjcnjk,nitros,hornys,san123,lightspe,maslova,kimber1,newyork2,spammm,mikejone,pumpk1n,bruiser1,bacons,prelude9,boodie,dragon4,kenneth2,love98,power5,yodude,pumba,thinline,blue30,sexxybj,2dumb2live,matt21,forsale,1carolin,innova,ilikeporn,rbgtkjd,a1s2d3f,wu9942,ruffus,blackboo,qwerty999,draco1,marcelin,hideki,gendalf,trevon,saraha,cartmen,yjhbkmcr,time2go,fanclub,ladder1,chinni,6942987,united99,lindac,quadra,paolit,mainstre,beano002,lincoln7,bellend,anomie,8520456,bangalor,goodstuff,chernov,stepashka,gulla,mike007,frasse,harley03,omnislash,8538622,maryjan,sasha2011,gineok,8807031,hornier,gopinath,princesit,bdr529,godown,bosslady,hakaone,1qwe2,madman1,joshua11,lovegame,bayamon,jedi01,stupid12,sport123,aaa666,tony44,collect1,charliem,chimaira,cx18ka,trrim777,chuckd,thedream,redsox99,goodmorning,delta88,iloveyou11,newlife2,figvam,chicago3,jasonk,12qwer,9875321,lestat1,satcom,conditio,capri50,sayaka,9933162,trunks1,chinga,snooch,alexand1,findus,poekie,cfdbyf,kevind,mike1969,fire13,leftie,bigtuna,chinnu,silence1,celos1,blackdra,alex24,gfgfif,2boobs,happy8,enolagay,sataniv1993,turner1,dylans,peugeo,sasha1994,hoppel,conno,moonshot,santa234,meister1,008800,hanako,tree123,qweras,gfitymrf,reggie31,august29,supert,joshua10,akademia,gbljhfc,zorro123,nathalia,redsox12,hfpdjl,mishmash,nokiae51,nyyankees,tu190022,strongbo,none1,not4u2no,katie2,popart,harlequi,santan,michal1,1therock,screwu,csyekmrf,olemiss1,tyrese,hoople,sunshin1,cucina,starbase,topshelf,fostex,california1,castle1,symantec,pippolo,babare,turntabl,1angela,moo123,ipvteb,gogolf,alex88,cycle1,maxie1,phase2,selhurst,furnitur,samfox,fromvermine,shaq34,gators96,captain2,delonge,tomatoe,bisous,zxcvbnma,glacius,pineapple1,cannelle,ganibal,mko09ijn,paraklast1974,hobbes12,petty43,artema,junior8,mylover,1234567890d,fatal1ty,prostreet,peruan,10020,nadya,caution1,marocas,chanel5,summer08,metal123,111lox,scrapy,thatguy,eddie666,washingto,yannis,minnesota_hp,lucky4,playboy6,naumova,azzurro,patat,dale33,pa55wd,speedster,zemanova,saraht,newto,tony22,qscesz,arkady,1oliver,death6,vkfwx046,antiflag,stangs,jzf7qf2e,brianp,fozzy,cody123,startrek1,yoda123,murciela,trabajo,lvbnhbtdf,canario,fliper,adroit,henry5,goducks,papirus,alskdj,soccer6,88mike,gogetter,tanelorn,donking,marky1,leedsu,badmofo,al1916,wetdog,akmaral,pallet,april24,killer00,nesterova,rugby123,coffee12,browseui,ralliart,paigow,calgary1,armyman,vtldtltd,frodo2,frxtgb,iambigal,benno,jaytee,2hot4you,askar,bigtee,brentwoo,palladin,eddie2,al1916w,horosho,entrada,ilovetits,venture1,dragon19,jayde,chuvak,jamesl,fzr600,brandon8,vjqvbh,snowbal,snatch1,bg6njokf,pudder,karolin,candoo,pfuflrf,satchel1,manteca,khongbiet,critter1,partridg,skyclad,bigdon,ginger69,brave1,anthony4,spinnake,chinadol,passout,cochino,nipples1,15058,lopesk,sixflags,lloo999,parkhead,breakdance,cia123,fidodido,yuitre12,fooey,artem1995,gayathri,medin,nondriversig,l12345,bravo7,happy13,kazuya,camster,alex1998,luckyy,zipcode,dizzle,boating1,opusone,newpassw,movies23,kamikazi,zapato,bart316,cowboys0,corsair1,kingshit,hotdog12,rolyat,h200svrm,qwerty4,boofer,rhtyltkm,chris999,vaz21074,simferopol,pitboss,love3,britania,tanyshka,brause,123qwerty123,abeille,moscow1,ilkaev,manut,process1,inetcfg,dragon05,fortknox,castill,rynner,mrmike,koalas,jeebus,stockpor,longman,juanpabl,caiman,roleplay,jeremi,26058,prodojo,002200,magical1,black5,bvlgari,doogie1,cbhtqa,mahina,a1s2d3f4g5h6,jblpro,usmc01,bismilah,guitar01,april9,santana1,1234aa,monkey14,sorokin,evan1,doohan,animalsex,pfqxtyjr,dimitry,catchme,chello,silverch,glock45,dogleg,litespee,nirvana9,peyton18,alydar,warhamer,iluvme,sig229,minotavr,lobzik,jack23,bushwack,onlin,football123,joshua5,federov,winter2,bigmax,fufnfrhbcnb,hfpldfnhb,1dakota,f56307,chipmonk,4nick8,praline,vbhjh123,king11,22tango,gemini12,street1,77879,doodlebu,homyak,165432,chuluthu,trixi,karlito,salom,reisen,cdtnkzxjr,pookie11,tremendo,shazaam,welcome0,00000ty,peewee51,pizzle,gilead,bydand,sarvar,upskirt,legends1,freeway1,teenfuck,ranger9,darkfire,dfymrf,hunt0802,justme1,buffy1ma,1harry,671fsa75yt,burrfoot,budster,pa437tu,jimmyp,alina2006,malacon,charlize,elway1,free12,summer02,gadina,manara,gomer1,1cassie,sanja,kisulya,money3,pujols,ford50,midiland,turga,orange6,demetriu,freakboy,orosie1,radio123,open12,vfufpby,mustek,chris33,animes,meiling,nthtvjr,jasmine9,gfdkjd,oligarh,marimar,chicago9,.kzirf,bugssgub,samuraix,jackie01,pimpjuic,macdad,cagiva,vernost,willyboy,fynjyjdf,tabby1,privet123,torres9,retype,blueroom,raven11,q12we3,alex1989,bringiton,ridered,kareltje,ow8jtcs8t,ciccia,goniners,countryb,24688642,covingto,24861793,beyblade,vikin,badboyz,wlafiga,walstib,mirand,needajob,chloes,balaton,kbpfdtnf,freyja,bond9007,gabriel12,stormbri,hollage,love4eve,fenomeno,darknite,dragstar,kyle123,milfhunter,ma123123123,samia,ghislain,enrique1,ferien12,xjy6721,natalie2,reglisse,wilson2,wesker,rosebud7,amazon1,robertr,roykeane,xtcnth,mamatata,crazyc,mikie,savanah,blowjob69,jackie2,forty1,1coffee,fhbyjxrf,bubbah,goteam,hackedit,risky1,logoff,h397pnvr,buck13,robert23,bronc,st123st,godflesh,pornog,iamking,cisco69,septiembr,dale38,zhongguo,tibbar,panther9,buffa1,bigjohn1,mypuppy,vehvfycr,april16,shippo,fire1234,green15,q123123,gungadin,steveg,olivier1,chinaski,magnoli,faithy,storm12,toadfrog,paul99,78791,august20,automati,squirtle,cheezy,positano,burbon,nunya,llebpmac,kimmi,turtle2,alan123,prokuror,violin1,durex,pussygal,visionar,trick1,chicken6,29024,plowboy,rfybreks,imbue,sasha13,wagner1,vitalogy,cfymrf,thepro,26028,gorbunov,dvdcom,letmein5,duder,fastfun,pronin,libra1,conner1,harley20,stinker1,20068,20038,amitech,syoung,dugway,18068,welcome7,jimmypag,anastaci,kafka1,pfhfnecnhf,catsss,campus100,shamal,nacho1,fire12,vikings2,brasil1,rangerover,mohamma,peresvet,14058,cocomo,aliona,14038,qwaser,vikes,cbkmdf,skyblue1,ou81234,goodlove,dfkmltvfh,108888,roamer,pinky2,static1,zxcv4321,barmen,rock22,shelby2,morgans,1junior,pasword1,logjam,fifty5,nhfrnjhbcn,chaddy,philli,nemesis2,ingenier,djkrjd,ranger3,aikman8,knothead,daddy69,love007,vsythb,ford350,tiger00,renrut,owen11,energy12,march14,alena123,robert19,carisma,orange22,murphy11,podarok,prozak,kfgeirf,wolf13,lydia1,shazza,parasha,akimov,tobbie,pilote,heather4,baster,leones,gznfxjr,megama,987654321g,bullgod,boxster1,minkey,wombats,vergil,colegiata,lincol,smoothe,pride1,carwash1,latrell,bowling3,fylhtq123,pickwick,eider,bubblebox,bunnies1,loquit,slipper1,nutsac,purina,xtutdfhf,plokiju,1qazxs,uhjpysq,zxcvbasdfg,enjoy1,1pumpkin,phantom7,mama22,swordsma,wonderbr,dogdays,milker,u23456,silvan,dfkthbr,slagelse,yeahman,twothree,boston11,wolf100,dannyg,troll1,fynjy123,ghbcnfd,bftest,ballsdeep,bobbyorr,alphasig,cccdemo,fire123,norwest,claire2,august10,lth1108,problemas,sapito,alex06,1rusty,maccom,goirish1,ohyes,bxdumb,nabila,boobear1,rabbit69,princip,alexsander,travail,chantal1,dogggy,greenpea,diablo69,alex2009,bergen09,petticoa,classe,ceilidh,vlad2011,kamakiri,lucidity,qaz321,chileno,cexfhf,99ranger,mcitra,estoppel,volvos60,carter80,webpass,temp12,touareg,fcgbhby,bubba8,sunitha,200190ru,bitch2,shadow23,iluvit,nicole0,ruben1,nikki69,butttt,shocker1,souschef,lopotok01,kantot,corsano,cfnfyf,riverat,makalu,swapna,all4u9,cdtnkfy,ntktgepbr,ronaldo99,thomasj,bmw540i,chrisw,boomba,open321,z1x2c3v4b5n6m7,gaviota,iceman44,frosya,chris100,chris24,cosette,clearwat,micael,boogyman,pussy9,camus1,chumpy,heccrbq,konoplya,chester8,scooter5,ghjgfufylf,giotto,koolkat,zero000,bonita1,ckflrbq,j1964,mandog,18n28n24a,renob,head1,shergar,ringo123,tanita,sex4free,johnny12,halberd,reddevils,biolog,dillinge,fatb0y,c00per,hyperlit,wallace2,spears1,vitamine,buheirf,sloboda,alkash,mooman,marion1,arsenal7,sunder,nokia5610,edifier,pippone,fyfnjkmtdbx,fujimo,pepsi12,kulikova,bolat,duetto,daimon,maddog01,timoshka,ezmoney,desdemon,chesters,aiden,hugues,patrick5,aikman08,robert4,roenick,nyranger,writer1,36169544,foxmulder,118801,kutter,shashank,jamjar,118811,119955,aspirina,dinkus,1sailor,nalgene,19891959,snarf,allie1,cracky,resipsa,45678912,kemerovo,19841989,netware1,alhimik,19801984,nicole123,19761977,51501984,malaka1,montella,peachfuz,jethro1,cypress1,henkie,holdon,esmith,55443322,1friend,quique,bandicoot,statistika,great123,death13,ucht36,master4,67899876,bobsmith,nikko1,jr1234,hillary1,78978978,rsturbo,lzlzdfcz,bloodlust,shadow00,skagen,bambina,yummies,88887777,91328378,matthew4,itdoes,98256518,102938475,alina2002,123123789,fubared,dannys,123456321,nikifor,suck69,newmexico,scubaman,rhbcnb,fifnfy,puffdadd,159357852,dtheyxbr,theman22,212009164,prohor,shirle,nji90okm,newmedia,goose5,roma1995,letssee,iceman11,aksana,wirenut,pimpdady,1212312121,tamplier,pelican1,domodedovo,1928374655,fiction6,duckpond,ybrecz,thwack,onetwo34,gunsmith,murphydo,fallout1,spectre1,jabberwo,jgjesq,turbo6,bobo12,redryder,blackpus,elena1971,danilova,antoin,bobo1234,bobob,bobbobbo,dean1,222222a,jesusgod,matt23,musical1,darkmage,loppol,werrew,josepha,rebel12,toshka,gadfly,hawkwood,alina12,dnomyar,sexaddict,dangit,cool23,yocrack,archimed,farouk,nhfkzkz,lindalou,111zzzzz,ghjatccjh,wethepeople,m123456789,wowsers,kbkbxrf,bulldog5,m_roesel,sissinit,yamoon6,123ewqasd,dangel,miruvor79,kaytee,falcon7,bandit11,dotnet,dannii,arsenal9,miatamx5,1trouble,strip4me,dogpile,sexyred1,rjdfktdf,google10,shortman,crystal7,awesome123,cowdog,haruka,birthday28,jitter,diabolik,boomer12,dknight,bluewate,hockey123,crm0624,blueboys,willy123,jumpup,google2,cobra777,llabesab,vicelord,hopper1,gerryber,remmah,j10e5d4,qqqqqqw,agusti,fre_ak8yj,nahlik,redrobin,scott3,epson1,dumpy,bundao,aniolek,hola123,jergens,itsasecret,maxsam,bluelight,mountai1,bongwater,1london,pepper14,freeuse,dereks,qweqw,fordgt40,rfhfdfy,raider12,hunnybun,compac,splicer,megamon,tuffgong,gymnast1,butter11,modaddy,wapbbs_1,dandelio,soccer77,ghjnbdjcnjzybt,123xyi2,fishead,x002tp00,whodaman,555aaa,oussama,brunodog,technici,pmtgjnbl,qcxdw8ry,schweden,redsox3,throbber,collecto,japan10,dbm123dm,hellhoun,tech1,deadzone,kahlan,wolf123,dethklok,xzsawq,bigguy1,cybrthc,chandle,buck01,qq123123,secreta,williams1,c32649135,delta12,flash33,123joker,spacejam,polopo,holycrap,daman1,tummybed,financia,nusrat,euroline,magicone,jimkirk,ameritec,daniel26,sevenn,topazz,kingpins,dima1991,macdog,spencer5,oi812,geoffre,music11,baffle,123569,usagi,cassiope,polla,lilcrowe,thecakeisalie,vbhjndjhtw,vthokies,oldmans,sophie01,ghoster,penny2,129834,locutus1,meesha,magik,jerry69,daddysgirl,irondesk,andrey12,jasmine123,vepsrfyn,likesdick,1accord,jetboat,grafix,tomuch,showit,protozoa,mosias98,taburetka,blaze420,esenin,anal69,zhv84kv,puissant,charles0,aishwarya,babylon6,bitter1,lenina,raleigh1,lechat,access01,kamilka,fynjy,sparkplu,daisy3112,choppe,zootsuit,1234567j,rubyrose,gorilla9,nightshade,alternativa,cghfdjxybr,snuggles1,10121v,vova1992,leonardo1,dave2,matthewd,vfhfnbr,1986mets,nobull,bacall,mexican1,juanjo,mafia1,boomer22,soylent,edwards1,jordan10,blackwid,alex86,gemini13,lunar2,dctvcjcfnm,malaki,plugger,eagles11,snafu2,1shelly,cintaku,hannah22,tbird1,maks5843,irish88,homer22,amarok,fktrcfylhjdf,lincoln2,acess,gre69kik,need4speed,hightech,core2duo,blunt1,ublhjgjybrf,dragon33,1autopas,autopas1,wwww1,15935746,daniel20,2500aa,massim,1ggggggg,96ford,hardcor1,cobra5,blackdragon,vovan_lt,orochimaru,hjlbntkb,qwertyuiop12,tallen,paradoks,frozenfish,ghjuhfvvbcn,gerri1,nuggett,camilit,doright,trans1,serena1,catch2,bkmyeh,fireston,afhvfwtdn,purple3,figure8,fuckya,scamp1,laranja,ontheoutside,louis123,yellow7,moonwalk,mercury2,tolkein,raide,amenra,a13579,dranreb,5150vh,harish,tracksta,sexking,ozzmosis,katiee,alomar,matrix19,headroom,jahlove,ringding,apollo8,132546,132613,12345672000,saretta,135798,136666,thomas7,136913,onetwothree,hockey33,calida,nefertit,bitwise,tailhook,boop4,kfgecbr,bujhmbujhm,metal69,thedark,meteoro,felicia1,house12,tinuviel,istina,vaz2105,pimp13,toolfan,nina1,tuesday2,maxmotives,lgkp500,locksley,treech,darling1,kurama,aminka,ramin,redhed,dazzler,jager1,stpiliot,cardman,rfvtym,cheeser,14314314,paramoun,samcat,plumpy,stiffie,vsajyjr,panatha,qqq777,car12345,098poi,asdzx,keegan1,furelise,kalifornia,vbhjckfd,beast123,zcfvfzkexifz,harry5,1birdie,96328i,escola,extra330,henry12,gfhfyjqz,14u2nv,max1234,templar1,1dave,02588520,catrin,pangolin,marhaba,latin1,amorcito,dave22,escape1,advance1,yasuhiro,grepw,meetme,orange01,ernes,erdna,zsergn,nautica1,justinb,soundwav,miasma,greg78,nadine1,sexmad,lovebaby,promo1,excel1,babys,dragonma,camry1,sonnenschein,farooq,wazzkaprivet,magal,katinas,elvis99,redsox24,rooney1,chiefy,peggys,aliev,pilsung,mudhen,dontdoit,dennis12,supercal,energia,ballsout,funone,claudiu,brown2,amoco,dabl1125,philos,gjdtkbntkm,servette,13571113,whizzer,nollie,13467982,upiter,12string,bluejay1,silkie,william4,kosta1,143333,connor12,sustanon,06068,corporat,ssnake,laurita,king10,tahoes,arsenal123,sapato,charless,jeanmarc,levent,algerie,marine21,jettas,winsome,dctvgbplf,1701ab,xxxp455w0rd5,lllllll1,ooooooo1,monalis,koufax32,anastasya,debugger,sarita2,jason69,ufkxjyjr,gjlcnfdf,1jerry,daniel10,balinor,sexkitten,death2,qwertasdfgzxcvb,s9te949f,vegeta1,sysman,maxxam,dimabilan,mooose,ilovetit,june23,illest,doesit,mamou,abby12,longjump,transalp,moderato,littleguy,magritte,dilnoza,hawaiiguy,winbig,nemiroff,kokaine,admira,myemail,dream2,browneyes,destiny7,dragonss,suckme1,asa123,andranik,suckem,fleshbot,dandie,timmys,scitra,timdog,hasbeen,guesss,smellyfe,arachne,deutschl,harley88,birthday27,nobody1,papasmur,home1,jonass,bunia3,epatb1,embalm,vfvekmrf,apacer,12345656,estreet,weihnachtsbaum,mrwhite,admin12,kristie1,kelebek,yoda69,socken,tima123,bayern1,fktrcfylth,tamiya,99strenght,andy01,denis2011,19delta,stokecit,aotearoa,stalker2,nicnac,conrad1,popey,agusta,bowl36,1bigfish,mossyoak,1stunner,getinnow,jessejames,gkfnjy,drako,1nissan,egor123,hotness,1hawaii,zxc123456,cantstop,1peaches,madlen,west1234,jeter1,markis,judit,attack1,artemi,silver69,153246,crazy2,green9,yoshimi,1vette,chief123,jasper2,1sierra,twentyon,drstrang,aspirant,yannic,jenna123,bongtoke,slurpy,1sugar,civic97,rusty21,shineon,james19,anna12345,wonderwoman,1kevin,karol1,kanabis,wert21,fktif6115,evil1,kakaha,54gv768,826248s,tyrone1,1winston,sugar2,falcon01,adelya,mopar440,zasxcd,leecher,kinkysex,mercede1,travka,11234567,rebon,geekboy".split(","),
74279english_wikipedia:"the,of,and,in,was,is,for,as,on,with,by,he,at,from,his,an,were,are,which,doc,https,also,or,has,had,first,one,their,its,after,new,who,they,two,her,she,been,other,when,time,during,there,into,school,more,may,years,over,only,year,most,would,world,city,some,where,between,later,three,state,such,then,national,used,made,known,under,many,university,united,while,part,season,team,these,american,than,film,second,born,south,became,states,war,through,being,including,both,before,north,high,however,people,family,early,history,album,area,them,series,against,until,since,district,county,name,work,life,group,music,following,number,company,several,four,called,played,released,career,league,game,government,house,each,based,day,same,won,use,station,club,international,town,located,population,general,college,east,found,age,march,end,september,began,home,public,church,line,june,river,member,system,place,century,band,july,york,january,october,song,august,best,former,british,party,named,held,village,show,local,november,took,service,december,built,another,major,within,along,members,five,single,due,although,small,old,left,final,large,include,building,served,president,received,games,death,february,main,third,set,children,own,order,species,park,law,air,published,road,died,book,men,women,army,often,according,education,central,country,division,english,top,included,development,french,community,among,water,play,side,list,times,near,late,form,original,different,center,power,led,students,german,moved,court,six,land,council,island,u.s.,record,million,research,art,established,award,street,military,television,given,region,support,western,production,non,political,point,cup,period,business,title,started,various,election,using,england,role,produced,become,program,works,field,total,office,class,written,association,radio,union,level,championship,director,few,force,created,department,founded,services,married,though,per,n't,site,open,act,short,society,version,royal,present,northern,worked,professional,full,returned,joined,story,france,european,currently,language,social,california,india,days,design,st.,further,round,australia,wrote,san,project,control,southern,railway,board,popular,continued,free,battle,considered,video,common,position,living,half,playing,recorded,red,post,described,average,records,special,modern,appeared,announced,areas,rock,release,elected,others,example,term,opened,similar,formed,route,census,current,schools,originally,lake,developed,race,himself,forces,addition,information,upon,province,match,event,songs,result,events,win,eastern,track,lead,teams,science,human,construction,minister,germany,awards,available,throughout,training,style,body,museum,australian,health,seven,signed,chief,eventually,appointed,sea,centre,debut,tour,points,media,light,range,character,across,features,families,largest,indian,network,less,performance,players,refer,europe,sold,festival,usually,taken,despite,designed,committee,process,return,official,episode,institute,stage,followed,performed,japanese,personal,thus,arts,space,low,months,includes,china,study,middle,magazine,leading,japan,groups,aircraft,featured,federal,civil,rights,model,coach,canadian,books,remained,eight,type,independent,completed,capital,academy,instead,kingdom,organization,countries,studies,competition,sports,size,above,section,finished,gold,involved,reported,management,systems,industry,directed,market,fourth,movement,technology,bank,ground,campaign,base,lower,sent,rather,added,provided,coast,grand,historic,valley,conference,bridge,winning,approximately,films,chinese,awarded,degree,russian,shows,native,female,replaced,municipality,square,studio,medical,data,african,successful,mid,bay,attack,previous,operations,spanish,theatre,student,republic,beginning,provide,ship,primary,owned,writing,tournament,culture,introduced,texas,related,natural,parts,governor,reached,ireland,units,senior,decided,italian,whose,higher,africa,standard,income,professor,placed,regional,los,buildings,championships,active,novel,energy,generally,interest,via,economic,previously,stated,itself,channel,below,operation,leader,traditional,trade,structure,limited,runs,prior,regular,famous,saint,navy,foreign,listed,artist,catholic,airport,results,parliament,collection,unit,officer,goal,attended,command,staff,commission,lived,location,plays,commercial,places,foundation,significant,older,medal,self,scored,companies,highway,activities,programs,wide,musical,notable,library,numerous,paris,towards,individual,allowed,plant,property,annual,contract,whom,highest,initially,required,earlier,assembly,artists,rural,seat,practice,defeated,ended,soviet,length,spent,manager,press,associated,author,issues,additional,characters,lord,zealand,policy,engine,township,noted,historical,complete,financial,religious,mission,contains,nine,recent,represented,pennsylvania,administration,opening,secretary,lines,report,executive,youth,closed,theory,writer,italy,angeles,appearance,feature,queen,launched,legal,terms,entered,issue,edition,singer,greek,majority,background,source,anti,cultural,complex,changes,recording,stadium,islands,operated,particularly,basketball,month,uses,port,castle,mostly,names,fort,selected,increased,status,earth,subsequently,pacific,cover,variety,certain,goals,remains,upper,congress,becoming,studied,irish,nature,particular,loss,caused,chart,dr.,forced,create,era,retired,material,review,rate,singles,referred,larger,individuals,shown,provides,products,speed,democratic,poland,parish,olympics,cities,themselves,temple,wing,genus,households,serving,cost,wales,stations,passed,supported,view,cases,forms,actor,male,matches,males,stars,tracks,females,administrative,median,effect,biography,train,engineering,camp,offered,chairman,houses,mainly,19th,surface,therefore,nearly,score,ancient,subject,prime,seasons,claimed,experience,specific,jewish,failed,overall,believed,plot,troops,greater,spain,consists,broadcast,heavy,increase,raised,separate,campus,1980s,appears,presented,lies,composed,recently,influence,fifth,nations,creek,references,elections,britain,double,cast,meaning,earned,carried,producer,latter,housing,brothers,attempt,article,response,border,remaining,nearby,direct,ships,value,workers,politician,academic,label,1970s,commander,rule,fellow,residents,authority,editor,transport,dutch,projects,responsible,covered,territory,flight,races,defense,tower,emperor,albums,facilities,daily,stories,assistant,managed,primarily,quality,function,proposed,distribution,conditions,prize,journal,code,vice,newspaper,corps,highly,constructed,mayor,critical,secondary,corporation,rugby,regiment,ohio,appearances,serve,allow,nation,multiple,discovered,directly,scene,levels,growth,elements,acquired,1990s,officers,physical,20th,latin,host,jersey,graduated,arrived,issued,literature,metal,estate,vote,immediately,quickly,asian,competed,extended,produce,urban,1960s,promoted,contemporary,global,formerly,appear,industrial,types,opera,ministry,soldiers,commonly,mass,formation,smaller,typically,drama,shortly,density,senate,effects,iran,polish,prominent,naval,settlement,divided,basis,republican,languages,distance,treatment,continue,product,mile,sources,footballer,format,clubs,leadership,initial,offers,operating,avenue,officially,columbia,grade,squadron,fleet,percent,farm,leaders,agreement,likely,equipment,website,mount,grew,method,transferred,intended,renamed,iron,asia,reserve,capacity,politics,widely,activity,advanced,relations,scottish,dedicated,crew,founder,episodes,lack,amount,build,efforts,concept,follows,ordered,leaves,positive,economy,entertainment,affairs,memorial,ability,illinois,communities,color,text,railroad,scientific,focus,comedy,serves,exchange,environment,cars,direction,organized,firm,description,agency,analysis,purpose,destroyed,reception,planned,revealed,infantry,architecture,growing,featuring,household,candidate,removed,situated,models,knowledge,solo,technical,organizations,assigned,conducted,participated,largely,purchased,register,gained,combined,headquarters,adopted,potential,protection,scale,approach,spread,independence,mountains,titled,geography,applied,safety,mixed,accepted,continues,captured,rail,defeat,principal,recognized,lieutenant,mentioned,semi,owner,joint,liberal,actress,traffic,creation,basic,notes,unique,supreme,declared,simply,plants,sales,massachusetts,designated,parties,jazz,compared,becomes,resources,titles,concert,learning,remain,teaching,versions,content,alongside,revolution,sons,block,premier,impact,champions,districts,generation,estimated,volume,image,sites,account,roles,sport,quarter,providing,zone,yard,scoring,classes,presence,performances,representatives,hosted,split,taught,origin,olympic,claims,critics,facility,occurred,suffered,municipal,damage,defined,resulted,respectively,expanded,platform,draft,opposition,expected,educational,ontario,climate,reports,atlantic,surrounding,performing,reduced,ranked,allows,birth,nominated,younger,newly,kong,positions,theater,philadelphia,heritage,finals,disease,sixth,laws,reviews,constitution,tradition,swedish,theme,fiction,rome,medicine,trains,resulting,existing,deputy,environmental,labour,classical,develop,fans,granted,receive,alternative,begins,nuclear,fame,buried,connected,identified,palace,falls,letters,combat,sciences,effort,villages,inspired,regions,towns,conservative,chosen,animals,labor,attacks,materials,yards,steel,representative,orchestra,peak,entitled,officials,returning,reference,northwest,imperial,convention,examples,ocean,publication,painting,subsequent,frequently,religion,brigade,fully,sides,acts,cemetery,relatively,oldest,suggested,succeeded,achieved,application,programme,cells,votes,promotion,graduate,armed,supply,flying,communist,figures,literary,netherlands,korea,worldwide,citizens,1950s,faculty,draw,stock,seats,occupied,methods,unknown,articles,claim,holds,authorities,audience,sweden,interview,obtained,covers,settled,transfer,marked,allowing,funding,challenge,southeast,unlike,crown,rise,portion,transportation,sector,phase,properties,edge,tropical,standards,institutions,philosophy,legislative,hills,brand,fund,conflict,unable,founding,refused,attempts,metres,permanent,starring,applications,creating,effective,aired,extensive,employed,enemy,expansion,billboard,rank,battalion,multi,vehicle,fought,alliance,category,perform,federation,poetry,bronze,bands,entry,vehicles,bureau,maximum,billion,trees,intelligence,greatest,screen,refers,commissioned,gallery,injury,confirmed,setting,treaty,adult,americans,broadcasting,supporting,pilot,mobile,writers,programming,existence,squad,minnesota,copies,korean,provincial,sets,defence,offices,agricultural,internal,core,northeast,retirement,factory,actions,prevent,communications,ending,weekly,containing,functions,attempted,interior,weight,bowl,recognition,incorporated,increasing,ultimately,documentary,derived,attacked,lyrics,mexican,external,churches,centuries,metropolitan,selling,opposed,personnel,mill,visited,presidential,roads,pieces,norwegian,controlled,18th,rear,influenced,wrestling,weapons,launch,composer,locations,developing,circuit,specifically,studios,shared,canal,wisconsin,publishing,approved,domestic,consisted,determined,comic,establishment,exhibition,southwest,fuel,electronic,cape,converted,educated,melbourne,hits,wins,producing,norway,slightly,occur,surname,identity,represent,constituency,funds,proved,links,structures,athletic,birds,contest,users,poet,institution,display,receiving,rare,contained,guns,motion,piano,temperature,publications,passenger,contributed,toward,cathedral,inhabitants,architect,exist,athletics,muslim,courses,abandoned,signal,successfully,disambiguation,tennessee,dynasty,heavily,maryland,jews,representing,budget,weather,missouri,introduction,faced,pair,chapel,reform,height,vietnam,occurs,motor,cambridge,lands,focused,sought,patients,shape,invasion,chemical,importance,communication,selection,regarding,homes,voivodeship,maintained,borough,failure,aged,passing,agriculture,oregon,teachers,flow,philippines,trail,seventh,portuguese,resistance,reaching,negative,fashion,scheduled,downtown,universities,trained,skills,scenes,views,notably,typical,incident,candidates,engines,decades,composition,commune,chain,inc.,austria,sale,values,employees,chamber,regarded,winners,registered,task,investment,colonial,swiss,user,entirely,flag,stores,closely,entrance,laid,journalist,coal,equal,causes,turkish,quebec,techniques,promote,junction,easily,dates,kentucky,singapore,residence,violence,advance,survey,humans,expressed,passes,streets,distinguished,qualified,folk,establish,egypt,artillery,visual,improved,actual,finishing,medium,protein,switzerland,productions,operate,poverty,neighborhood,organisation,consisting,consecutive,sections,partnership,extension,reaction,factor,costs,bodies,device,ethnic,racial,flat,objects,chapter,improve,musicians,courts,controversy,membership,merged,wars,expedition,interests,arab,comics,gain,describes,mining,bachelor,crisis,joining,decade,1930s,distributed,habitat,routes,arena,cycle,divisions,briefly,vocals,directors,degrees,object,recordings,installed,adjacent,demand,voted,causing,businesses,ruled,grounds,starred,drawn,opposite,stands,formal,operates,persons,counties,compete,wave,israeli,ncaa,resigned,brief,greece,combination,demographics,historian,contain,commonwealth,musician,collected,argued,louisiana,session,cabinet,parliamentary,electoral,loan,profit,regularly,conservation,islamic,purchase,17th,charts,residential,earliest,designs,paintings,survived,moth,items,goods,grey,anniversary,criticism,images,discovery,observed,underground,progress,additionally,participate,thousands,reduce,elementary,owners,stating,iraq,resolution,capture,tank,rooms,hollywood,finance,queensland,reign,maintain,iowa,landing,broad,outstanding,circle,path,manufacturing,assistance,sequence,gmina,crossing,leads,universal,shaped,kings,attached,medieval,ages,metro,colony,affected,scholars,oklahoma,coastal,soundtrack,painted,attend,definition,meanwhile,purposes,trophy,require,marketing,popularity,cable,mathematics,mississippi,represents,scheme,appeal,distinct,factors,acid,subjects,roughly,terminal,economics,senator,diocese,prix,contrast,argentina,czech,wings,relief,stages,duties,16th,novels,accused,whilst,equivalent,charged,measure,documents,couples,request,danish,defensive,guide,devices,statistics,credited,tries,passengers,allied,frame,puerto,peninsula,concluded,instruments,wounded,differences,associate,forests,afterwards,replace,requirements,aviation,solution,offensive,ownership,inner,legislation,hungarian,contributions,actors,translated,denmark,steam,depending,aspects,assumed,injured,severe,admitted,determine,shore,technique,arrival,measures,translation,debuted,delivered,returns,rejected,separated,visitors,damaged,storage,accompanied,markets,industries,losses,gulf,charter,strategy,corporate,socialist,somewhat,significantly,physics,mounted,satellite,experienced,constant,relative,pattern,restored,belgium,connecticut,partners,harvard,retained,networks,protected,mode,artistic,parallel,collaboration,debate,involving,journey,linked,salt,authors,components,context,occupation,requires,occasionally,policies,tamil,ottoman,revolutionary,hungary,poem,versus,gardens,amongst,audio,makeup,frequency,meters,orthodox,continuing,suggests,legislature,coalition,guitarist,eighth,classification,practices,soil,tokyo,instance,limit,coverage,considerable,ranking,colleges,cavalry,centers,daughters,twin,equipped,broadway,narrow,hosts,rates,domain,boundary,arranged,12th,whereas,brazilian,forming,rating,strategic,competitions,trading,covering,baltimore,commissioner,infrastructure,origins,replacement,praised,disc,collections,expression,ukraine,driven,edited,austrian,solar,ensure,premiered,successor,wooden,operational,hispanic,concerns,rapid,prisoners,childhood,meets,influential,tunnel,employment,tribe,qualifying,adapted,temporary,celebrated,appearing,increasingly,depression,adults,cinema,entering,laboratory,script,flows,romania,accounts,fictional,pittsburgh,achieve,monastery,franchise,formally,tools,newspapers,revival,sponsored,processes,vienna,springs,missions,classified,13th,annually,branches,lakes,gender,manner,advertising,normally,maintenance,adding,characteristics,integrated,decline,modified,strongly,critic,victims,malaysia,arkansas,nazi,restoration,powered,monument,hundreds,depth,15th,controversial,admiral,criticized,brick,honorary,initiative,output,visiting,birmingham,progressive,existed,carbon,1920s,credits,colour,rising,hence,defeating,superior,filmed,listing,column,surrounded,orleans,principles,territories,struck,participation,indonesia,movements,index,commerce,conduct,constitutional,spiritual,ambassador,vocal,completion,edinburgh,residing,tourism,finland,bears,medals,resident,themes,visible,indigenous,involvement,basin,electrical,ukrainian,concerts,boats,styles,processing,rival,drawing,vessels,experimental,declined,touring,supporters,compilation,coaching,cited,dated,roots,string,explained,transit,traditionally,poems,minimum,representation,14th,releases,effectively,architectural,triple,indicated,greatly,elevation,clinical,printed,10th,proposal,peaked,producers,romanized,rapidly,stream,innings,meetings,counter,householder,honour,lasted,agencies,document,exists,surviving,experiences,honors,landscape,hurricane,harbor,panel,competing,profile,vessel,farmers,lists,revenue,exception,customers,11th,participants,wildlife,utah,bible,gradually,preserved,replacing,symphony,begun,longest,siege,provinces,mechanical,genre,transmission,agents,executed,videos,benefits,funded,rated,instrumental,ninth,similarly,dominated,destruction,passage,technologies,thereafter,outer,facing,affiliated,opportunities,instrument,governments,scholar,evolution,channels,shares,sessions,widespread,occasions,engineers,scientists,signing,battery,competitive,alleged,eliminated,supplies,judges,hampshire,regime,portrayed,penalty,taiwan,denied,submarine,scholarship,substantial,transition,victorian,http,nevertheless,filed,supports,continental,tribes,ratio,doubles,useful,honours,blocks,principle,retail,departure,ranks,patrol,yorkshire,vancouver,inter,extent,afghanistan,strip,railways,component,organ,symbol,categories,encouraged,abroad,civilian,periods,traveled,writes,struggle,immediate,recommended,adaptation,egyptian,graduating,assault,drums,nomination,historically,voting,allies,detailed,achievement,percentage,arabic,assist,frequent,toured,apply,and/or,intersection,maine,touchdown,throne,produces,contribution,emerged,obtain,archbishop,seek,researchers,remainder,populations,clan,finnish,overseas,fifa,licensed,chemistry,festivals,mediterranean,injuries,animated,seeking,publisher,volumes,limits,venue,jerusalem,generated,trials,islam,youngest,ruling,glasgow,germans,songwriter,persian,municipalities,donated,viewed,belgian,cooperation,posted,tech,dual,volunteer,settlers,commanded,claiming,approval,delhi,usage,terminus,partly,electricity,locally,editions,premiere,absence,belief,traditions,statue,indicate,manor,stable,attributed,possession,managing,viewers,chile,overview,seed,regulations,essential,minority,cargo,segment,endemic,forum,deaths,monthly,playoffs,erected,practical,machines,suburb,relation,mrs.,descent,indoor,continuous,characterized,solutions,caribbean,rebuilt,serbian,summary,contested,psychology,pitch,attending,muhammad,tenure,drivers,diameter,assets,venture,punk,airlines,concentration,athletes,volunteers,pages,mines,influences,sculpture,protest,ferry,behalf,drafted,apparent,furthermore,ranging,romanian,democracy,lanka,significance,linear,d.c.,certified,voters,recovered,tours,demolished,boundaries,assisted,identify,grades,elsewhere,mechanism,1940s,reportedly,aimed,conversion,suspended,photography,departments,beijing,locomotives,publicly,dispute,magazines,resort,conventional,platforms,internationally,capita,settlements,dramatic,derby,establishing,involves,statistical,implementation,immigrants,exposed,diverse,layer,vast,ceased,connections,belonged,interstate,uefa,organised,abuse,deployed,cattle,partially,filming,mainstream,reduction,automatic,rarely,subsidiary,decides,merger,comprehensive,displayed,amendment,guinea,exclusively,manhattan,concerning,commons,radical,serbia,baptist,buses,initiated,portrait,harbour,choir,citizen,sole,unsuccessful,manufactured,enforcement,connecting,increases,patterns,sacred,muslims,clothing,hindu,unincorporated,sentenced,advisory,tanks,campaigns,fled,repeated,remote,rebellion,implemented,texts,fitted,tribute,writings,sufficient,ministers,21st,devoted,jurisdiction,coaches,interpretation,pole,businessman,peru,sporting,prices,cuba,relocated,opponent,arrangement,elite,manufacturer,responded,suitable,distinction,calendar,dominant,tourist,earning,prefecture,ties,preparation,anglo,pursue,worship,archaeological,chancellor,bangladesh,scores,traded,lowest,horror,outdoor,biology,commented,specialized,loop,arriving,farming,housed,historians,'the,patent,pupils,christianity,opponents,athens,northwestern,maps,promoting,reveals,flights,exclusive,lions,norfolk,hebrew,extensively,eldest,shops,acquisition,virtual,renowned,margin,ongoing,essentially,iranian,alternate,sailed,reporting,conclusion,originated,temperatures,exposure,secured,landed,rifle,framework,identical,martial,focuses,topics,ballet,fighters,belonging,wealthy,negotiations,evolved,bases,oriented,acres,democrat,heights,restricted,vary,graduation,aftermath,chess,illness,participating,vertical,collective,immigration,demonstrated,leaf,completing,organic,missile,leeds,eligible,grammar,confederate,improvement,congressional,wealth,cincinnati,spaces,indicates,corresponding,reaches,repair,isolated,taxes,congregation,ratings,leagues,diplomatic,submitted,winds,awareness,photographs,maritime,nigeria,accessible,animation,restaurants,philippine,inaugural,dismissed,armenian,illustrated,reservoir,speakers,programmes,resource,genetic,interviews,camps,regulation,computers,preferred,travelled,comparison,distinctive,recreation,requested,southeastern,dependent,brisbane,breeding,playoff,expand,bonus,gauge,departed,qualification,inspiration,shipping,slaves,variations,shield,theories,munich,recognised,emphasis,favour,variable,seeds,undergraduate,territorial,intellectual,qualify,mini,banned,pointed,democrats,assessment,judicial,examination,attempting,objective,partial,characteristic,hardware,pradesh,execution,ottawa,metre,drum,exhibitions,withdrew,attendance,phrase,journalism,logo,measured,error,christians,trio,protestant,theology,respective,atmosphere,buddhist,substitute,curriculum,fundamental,outbreak,rabbi,intermediate,designation,globe,liberation,simultaneously,diseases,experiments,locomotive,difficulties,mainland,nepal,relegated,contributing,database,developments,veteran,carries,ranges,instruction,lodge,protests,obama,newcastle,experiment,physician,describing,challenges,corruption,delaware,adventures,ensemble,succession,renaissance,tenth,altitude,receives,approached,crosses,syria,croatia,warsaw,professionals,improvements,worn,airline,compound,permitted,preservation,reducing,printing,scientist,activist,comprises,sized,societies,enters,ruler,gospel,earthquake,extend,autonomous,croatian,serial,decorated,relevant,ideal,grows,grass,tier,towers,wider,welfare,columns,alumni,descendants,interface,reserves,banking,colonies,manufacturers,magnetic,closure,pitched,vocalist,preserve,enrolled,cancelled,equation,2000s,nickname,bulgaria,heroes,exile,mathematical,demands,input,structural,tube,stem,approaches,argentine,axis,manuscript,inherited,depicted,targets,visits,veterans,regard,removal,efficiency,organisations,concepts,lebanon,manga,petersburg,rally,supplied,amounts,yale,tournaments,broadcasts,signals,pilots,azerbaijan,architects,enzyme,literacy,declaration,placing,batting,incumbent,bulgarian,consistent,poll,defended,landmark,southwestern,raid,resignation,travels,casualties,prestigious,namely,aims,recipient,warfare,readers,collapse,coached,controls,volleyball,coup,lesser,verse,pairs,exhibited,proteins,molecular,abilities,integration,consist,aspect,advocate,administered,governing,hospitals,commenced,coins,lords,variation,resumed,canton,artificial,elevated,palm,difficulty,civic,efficient,northeastern,inducted,radiation,affiliate,boards,stakes,byzantine,consumption,freight,interaction,oblast,numbered,seminary,contracts,extinct,predecessor,bearing,cultures,functional,neighboring,revised,cylinder,grants,narrative,reforms,athlete,tales,reflect,presidency,compositions,specialist,cricketer,founders,sequel,widow,disbanded,associations,backed,thereby,pitcher,commanding,boulevard,singers,crops,militia,reviewed,centres,waves,consequently,fortress,tributary,portions,bombing,excellence,nest,payment,mars,plaza,unity,victories,scotia,farms,nominations,variant,attacking,suspension,installation,graphics,estates,comments,acoustic,destination,venues,surrender,retreat,libraries,quarterback,customs,berkeley,collaborated,gathered,syndrome,dialogue,recruited,shanghai,neighbouring,psychological,saudi,moderate,exhibit,innovation,depot,binding,brunswick,situations,certificate,actively,shakespeare,editorial,presentation,ports,relay,nationalist,methodist,archives,experts,maintains,collegiate,bishops,maintaining,temporarily,embassy,essex,wellington,connects,reformed,bengal,recalled,inches,doctrine,deemed,legendary,reconstruction,statements,palestinian,meter,achievements,riders,interchange,spots,auto,accurate,chorus,dissolved,missionary,thai,operators,e.g.,generations,failing,delayed,cork,nashville,perceived,venezuela,cult,emerging,tomb,abolished,documented,gaining,canyon,episcopal,stored,assists,compiled,kerala,kilometers,mosque,grammy,theorem,unions,segments,glacier,arrives,theatrical,circulation,conferences,chapters,displays,circular,authored,conductor,fewer,dimensional,nationwide,liga,yugoslavia,peer,vietnamese,fellowship,armies,regardless,relating,dynamic,politicians,mixture,serie,somerset,imprisoned,posts,beliefs,beta,layout,independently,electronics,provisions,fastest,logic,headquartered,creates,challenged,beaten,appeals,plains,protocol,graphic,accommodate,iraqi,midfielder,span,commentary,freestyle,reflected,palestine,lighting,burial,virtually,backing,prague,tribal,heir,identification,prototype,criteria,dame,arch,tissue,footage,extending,procedures,predominantly,updated,rhythm,preliminary,cafe,disorder,prevented,suburbs,discontinued,retiring,oral,followers,extends,massacre,journalists,conquest,larvae,pronounced,behaviour,diversity,sustained,addressed,geographic,restrictions,voiced,milwaukee,dialect,quoted,grid,nationally,nearest,roster,twentieth,separation,indies,manages,citing,intervention,guidance,severely,migration,artwork,focusing,rivals,trustees,varied,enabled,committees,centered,skating,slavery,cardinals,forcing,tasks,auckland,youtube,argues,colored,advisor,mumbai,requiring,theological,registration,refugees,nineteenth,survivors,runners,colleagues,priests,contribute,variants,workshop,concentrated,creator,lectures,temples,exploration,requirement,interactive,navigation,companion,perth,allegedly,releasing,citizenship,observation,stationed,ph.d.,sheep,breed,discovers,encourage,kilometres,journals,performers,isle,saskatchewan,hybrid,hotels,lancashire,dubbed,airfield,anchor,suburban,theoretical,sussex,anglican,stockholm,permanently,upcoming,privately,receiver,optical,highways,congo,colours,aggregate,authorized,repeatedly,varies,fluid,innovative,transformed,praise,convoy,demanded,discography,attraction,export,audiences,ordained,enlisted,occasional,westminster,syrian,heavyweight,bosnia,consultant,eventual,improving,aires,wickets,epic,reactions,scandal,i.e.,discrimination,buenos,patron,investors,conjunction,testament,construct,encountered,celebrity,expanding,georgian,brands,retain,underwent,algorithm,foods,provision,orbit,transformation,associates,tactical,compact,varieties,stability,refuge,gathering,moreover,manila,configuration,gameplay,discipline,entity,comprising,composers,skill,monitoring,ruins,museums,sustainable,aerial,altered,codes,voyage,friedrich,conflicts,storyline,travelling,conducting,merit,indicating,referendum,currency,encounter,particles,automobile,workshops,acclaimed,inhabited,doctorate,cuban,phenomenon,dome,enrollment,tobacco,governance,trend,equally,manufacture,hydrogen,grande,compensation,download,pianist,grain,shifted,neutral,evaluation,define,cycling,seized,array,relatives,motors,firms,varying,automatically,restore,nicknamed,findings,governed,investigate,manitoba,administrator,vital,integral,indonesian,confusion,publishers,enable,geographical,inland,naming,civilians,reconnaissance,indianapolis,lecturer,deer,tourists,exterior,rhode,bassist,symbols,scope,ammunition,yuan,poets,punjab,nursing,cent,developers,estimates,presbyterian,nasa,holdings,generate,renewed,computing,cyprus,arabia,duration,compounds,gastropod,permit,valid,touchdowns,facade,interactions,mineral,practiced,allegations,consequence,goalkeeper,baronet,copyright,uprising,carved,targeted,competitors,mentions,sanctuary,fees,pursued,tampa,chronicle,capabilities,specified,specimens,toll,accounting,limestone,staged,upgraded,philosophical,streams,guild,revolt,rainfall,supporter,princeton,terrain,hometown,probability,assembled,paulo,surrey,voltage,developer,destroyer,floors,lineup,curve,prevention,potentially,onwards,trips,imposed,hosting,striking,strict,admission,apartments,solely,utility,proceeded,observations,euro,incidents,vinyl,profession,haven,distant,expelled,rivalry,runway,torpedo,zones,shrine,dimensions,investigations,lithuania,idaho,pursuit,copenhagen,considerably,locality,wireless,decrease,genes,thermal,deposits,hindi,habitats,withdrawn,biblical,monuments,casting,plateau,thesis,managers,flooding,assassination,acknowledged,interim,inscription,guided,pastor,finale,insects,transported,activists,marshal,intensity,airing,cardiff,proposals,lifestyle,prey,herald,capitol,aboriginal,measuring,lasting,interpreted,occurring,desired,drawings,healthcare,panels,elimination,oslo,ghana,blog,sabha,intent,superintendent,governors,bankruptcy,p.m.,equity,disk,layers,slovenia,prussia,quartet,mechanics,graduates,politically,monks,screenplay,nato,absorbed,topped,petition,bold,morocco,exhibits,canterbury,publish,rankings,crater,dominican,enhanced,planes,lutheran,governmental,joins,collecting,brussels,unified,streak,strategies,flagship,surfaces,oval,archive,etymology,imprisonment,instructor,noting,remix,opposing,servant,rotation,width,trans,maker,synthesis,excess,tactics,snail,ltd.,lighthouse,sequences,cornwall,plantation,mythology,performs,foundations,populated,horizontal,speedway,activated,performer,diving,conceived,edmonton,subtropical,environments,prompted,semifinals,caps,bulk,treasury,recreational,telegraph,continent,portraits,relegation,catholics,graph,velocity,rulers,endangered,secular,observer,learns,inquiry,idol,dictionary,certification,estimate,cluster,armenia,observatory,revived,nadu,consumers,hypothesis,manuscripts,contents,arguments,editing,trails,arctic,essays,belfast,acquire,promotional,undertaken,corridor,proceedings,antarctic,millennium,labels,delegates,vegetation,acclaim,directing,substance,outcome,diploma,philosopher,malta,albanian,vicinity,degc,legends,regiments,consent,terrorist,scattered,presidents,gravity,orientation,deployment,duchy,refuses,estonia,crowned,separately,renovation,rises,wilderness,objectives,agreements,empress,slopes,inclusion,equality,decree,ballot,criticised,rochester,recurring,struggled,disabled,henri,poles,prussian,convert,bacteria,poorly,sudan,geological,wyoming,consistently,minimal,withdrawal,interviewed,proximity,repairs,initiatives,pakistani,republicans,propaganda,viii,abstract,commercially,availability,mechanisms,naples,discussions,underlying,lens,proclaimed,advised,spelling,auxiliary,attract,lithuanian,editors,o'brien,accordance,measurement,novelist,ussr,formats,councils,contestants,indie,facebook,parishes,barrier,battalions,sponsor,consulting,terrorism,implement,uganda,crucial,unclear,notion,distinguish,collector,attractions,filipino,ecology,investments,capability,renovated,iceland,albania,accredited,scouts,armor,sculptor,cognitive,errors,gaming,condemned,successive,consolidated,baroque,entries,regulatory,reserved,treasurer,variables,arose,technological,rounded,provider,rhine,agrees,accuracy,genera,decreased,frankfurt,ecuador,edges,particle,rendered,calculated,careers,faction,rifles,americas,gaelic,portsmouth,resides,merchants,fiscal,premises,coin,draws,presenter,acceptance,ceremonies,pollution,consensus,membrane,brigadier,nonetheless,genres,supervision,predicted,magnitude,finite,differ,ancestry,vale,delegation,removing,proceeds,placement,emigrated,siblings,molecules,payments,considers,demonstration,proportion,newer,valve,achieving,confederation,continuously,luxury,notre,introducing,coordinates,charitable,squadrons,disorders,geometry,winnipeg,ulster,loans,longtime,receptor,preceding,belgrade,mandate,wrestler,neighbourhood,factories,buddhism,imported,sectors,protagonist,steep,elaborate,prohibited,artifacts,prizes,pupil,cooperative,sovereign,subspecies,carriers,allmusic,nationals,settings,autobiography,neighborhoods,analog,facilitate,voluntary,jointly,newfoundland,organizing,raids,exercises,nobel,machinery,baltic,crop,granite,dense,websites,mandatory,seeks,surrendered,anthology,comedian,bombs,slot,synopsis,critically,arcade,marking,equations,halls,indo,inaugurated,embarked,speeds,clause,invention,premiership,likewise,presenting,demonstrate,designers,organize,examined,km/h,bavaria,troop,referee,detection,zurich,prairie,rapper,wingspan,eurovision,luxembourg,slovakia,inception,disputed,mammals,entrepreneur,makers,evangelical,yield,clergy,trademark,defunct,allocated,depicting,volcanic,batted,conquered,sculptures,providers,reflects,armoured,locals,walt,herzegovina,contracted,entities,sponsorship,prominence,flowing,ethiopia,marketed,corporations,withdraw,carnegie,induced,investigated,portfolio,flowering,opinions,viewing,classroom,donations,bounded,perception,leicester,fruits,charleston,academics,statute,complaints,smallest,deceased,petroleum,resolved,commanders,algebra,southampton,modes,cultivation,transmitter,spelled,obtaining,sizes,acre,pageant,bats,abbreviated,correspondence,barracks,feast,tackles,raja,derives,geology,disputes,translations,counted,constantinople,seating,macedonia,preventing,accommodation,homeland,explored,invaded,provisional,transform,sphere,unsuccessfully,missionaries,conservatives,highlights,traces,organisms,openly,dancers,fossils,absent,monarchy,combining,lanes,stint,dynamics,chains,missiles,screening,module,tribune,generating,miners,nottingham,seoul,unofficial,owing,linking,rehabilitation,citation,louisville,mollusk,depicts,differential,zimbabwe,kosovo,recommendations,responses,pottery,scorer,aided,exceptions,dialects,telecommunications,defines,elderly,lunar,coupled,flown,25th,espn,formula_1,bordered,fragments,guidelines,gymnasium,valued,complexity,papal,presumably,maternal,challenging,reunited,advancing,comprised,uncertain,favorable,twelfth,correspondent,nobility,livestock,expressway,chilean,tide,researcher,emissions,profits,lengths,accompanying,witnessed,itunes,drainage,slope,reinforced,feminist,sanskrit,develops,physicians,outlets,isbn,coordinator,averaged,termed,occupy,diagnosed,yearly,humanitarian,prospect,spacecraft,stems,enacted,linux,ancestors,karnataka,constitute,immigrant,thriller,ecclesiastical,generals,celebrations,enhance,heating,advocated,evident,advances,bombardment,watershed,shuttle,wicket,twitter,adds,branded,teaches,schemes,pension,advocacy,conservatory,cairo,varsity,freshwater,providence,seemingly,shells,cuisine,specially,peaks,intensive,publishes,trilogy,skilled,nacional,unemployment,destinations,parameters,verses,trafficking,determination,infinite,savings,alignment,linguistic,countryside,dissolution,measurements,advantages,licence,subfamily,highlands,modest,regent,algeria,crest,teachings,knockout,brewery,combine,conventions,descended,chassis,primitive,fiji,explicitly,cumberland,uruguay,laboratories,bypass,elect,informal,preceded,holocaust,tackle,minneapolis,quantity,securities,console,doctoral,religions,commissioners,expertise,unveiled,precise,diplomat,standings,infant,disciplines,sicily,endorsed,systematic,charted,armored,mild,lateral,townships,hurling,prolific,invested,wartime,compatible,galleries,moist,battlefield,decoration,convent,tubes,terrestrial,nominee,requests,delegate,leased,dubai,polar,applying,addresses,munster,sings,commercials,teamed,dances,eleventh,midland,cedar,flee,sandstone,snails,inspection,divide,asset,themed,comparable,paramount,dairy,archaeology,intact,institutes,rectangular,instances,phases,reflecting,substantially,applies,vacant,lacked,copa,coloured,encounters,sponsors,encoded,possess,revenues,ucla,chaired,a.m.,enabling,playwright,stoke,sociology,tibetan,frames,motto,financing,illustrations,gibraltar,chateau,bolivia,transmitted,enclosed,persuaded,urged,folded,suffolk,regulated,bros.,submarines,myth,oriental,malaysian,effectiveness,narrowly,acute,sunk,replied,utilized,tasmania,consortium,quantities,gains,parkway,enlarged,sided,employers,adequate,accordingly,assumption,ballad,mascot,distances,peaking,saxony,projected,affiliation,limitations,metals,guatemala,scots,theaters,kindergarten,verb,employer,differs,discharge,controller,seasonal,marching,guru,campuses,avoided,vatican,maori,excessive,chartered,modifications,caves,monetary,sacramento,mixing,institutional,celebrities,irrigation,shapes,broadcaster,anthem,attributes,demolition,offshore,specification,surveys,yugoslav,contributor,auditorium,lebanese,capturing,airports,classrooms,chennai,paths,tendency,determining,lacking,upgrade,sailors,detected,kingdoms,sovereignty,freely,decorative,momentum,scholarly,georges,gandhi,speculation,transactions,undertook,interact,similarities,cove,teammate,constituted,painters,tends,madagascar,partnerships,afghan,personalities,attained,rebounds,masses,synagogue,reopened,asylum,embedded,imaging,catalogue,defenders,taxonomy,fiber,afterward,appealed,communists,lisbon,rica,judaism,adviser,batsman,ecological,commands,lgbt,cooling,accessed,wards,shiva,employs,thirds,scenic,worcester,tallest,contestant,humanities,economist,textile,constituencies,motorway,tram,percussion,cloth,leisure,1880s,baden,flags,resemble,riots,coined,sitcom,composite,implies,daytime,tanzania,penalties,optional,competitor,excluded,steering,reversed,autonomy,reviewer,breakthrough,professionally,damages,pomeranian,deputies,valleys,ventures,highlighted,electorate,mapping,shortened,executives,tertiary,specimen,launching,bibliography,sank,pursuing,binary,descendant,marched,natives,ideology,turks,adolf,archdiocese,tribunal,exceptional,nigerian,preference,fails,loading,comeback,vacuum,favored,alter,remnants,consecrated,spectators,trends,patriarch,feedback,paved,sentences,councillor,astronomy,advocates,broader,commentator,commissions,identifying,revealing,theatres,incomplete,enables,constituent,reformation,tract,haiti,atmospheric,screened,explosive,czechoslovakia,acids,symbolic,subdivision,liberals,incorporate,challenger,erie,filmmaker,laps,kazakhstan,organizational,evolutionary,chemicals,dedication,riverside,fauna,moths,maharashtra,annexed,gen.,resembles,underwater,garnered,timeline,remake,suited,educator,hectares,automotive,feared,latvia,finalist,narrator,portable,airways,plaque,designing,villagers,licensing,flank,statues,struggles,deutsche,migrated,cellular,jacksonville,wimbledon,defining,highlight,preparatory,planets,cologne,employ,frequencies,detachment,readily,libya,resign,halt,helicopters,reef,landmarks,collaborative,irregular,retaining,helsinki,folklore,weakened,viscount,interred,professors,memorable,mega,repertoire,rowing,dorsal,albeit,progressed,operative,coronation,liner,telugu,domains,philharmonic,detect,bengali,synthetic,tensions,atlas,dramatically,paralympics,xbox,shire,kiev,lengthy,sued,notorious,seas,screenwriter,transfers,aquatic,pioneers,unesco,radius,abundant,tunnels,syndicated,inventor,accreditation,janeiro,exeter,ceremonial,omaha,cadet,predators,resided,prose,slavic,precision,abbot,deity,engaging,cambodia,estonian,compliance,demonstrations,protesters,reactor,commodore,successes,chronicles,mare,extant,listings,minerals,tonnes,parody,cultivated,traders,pioneering,supplement,slovak,preparations,collision,partnered,vocational,atoms,malayalam,welcomed,documentation,curved,functioning,presently,formations,incorporates,nazis,botanical,nucleus,ethical,greeks,metric,automated,whereby,stance,europeans,duet,disability,purchasing,email,telescope,displaced,sodium,comparative,processor,inning,precipitation,aesthetic,import,coordination,feud,alternatively,mobility,tibet,regained,succeeding,hierarchy,apostolic,catalog,reproduction,inscriptions,vicar,clusters,posthumously,rican,loosely,additions,photographic,nowadays,selective,derivative,keyboards,guides,collectively,affecting,combines,operas,networking,decisive,terminated,continuity,finishes,ancestor,consul,heated,simulation,leipzig,incorporating,georgetown,formula_2,circa,forestry,portrayal,councillors,advancement,complained,forewings,confined,transaction,definitions,reduces,televised,1890s,rapids,phenomena,belarus,alps,landscapes,quarterly,specifications,commemorate,continuation,isolation,antenna,downstream,patents,ensuing,tended,saga,lifelong,columnist,labeled,gymnastics,papua,anticipated,demise,encompasses,madras,antarctica,interval,icon,rams,midlands,ingredients,priory,strengthen,rouge,explicit,gaza,aging,securing,anthropology,listeners,adaptations,underway,vista,malay,fortified,lightweight,violations,concerto,financed,jesuit,observers,trustee,descriptions,nordic,resistant,opted,accepts,prohibition,andhra,inflation,negro,wholly,imagery,spur,instructed,gloucester,cycles,middlesex,destroyers,statewide,evacuated,hyderabad,peasants,mice,shipyard,coordinate,pitching,colombian,exploring,numbering,compression,countess,hiatus,exceed,raced,archipelago,traits,soils,o'connor,vowel,android,facto,angola,amino,holders,logistics,circuits,emergence,kuwait,partition,emeritus,outcomes,submission,promotes,barack,negotiated,loaned,stripped,50th,excavations,treatments,fierce,participant,exports,decommissioned,cameo,remarked,residences,fuselage,mound,undergo,quarry,node,midwest,specializing,occupies,etc.,showcase,molecule,offs,modules,salon,exposition,revision,peers,positioned,hunters,competes,algorithms,reside,zagreb,calcium,uranium,silicon,airs,counterpart,outlet,collectors,sufficiently,canberra,inmates,anatomy,ensuring,curves,aviv,firearms,basque,volcano,thrust,sheikh,extensions,installations,aluminum,darker,sacked,emphasized,aligned,asserted,pseudonym,spanning,decorations,eighteenth,orbital,spatial,subdivided,notation,decay,macedonian,amended,declining,cyclist,feat,unusually,commuter,birthplace,latitude,activation,overhead,30th,finalists,whites,encyclopedia,tenor,qatar,survives,complement,concentrations,uncommon,astronomical,bangalore,pius,genome,memoir,recruit,prosecutor,modification,paired,container,basilica,arlington,displacement,germanic,mongolia,proportional,debates,matched,calcutta,rows,tehran,aerospace,prevalent,arise,lowland,24th,spokesman,supervised,advertisements,clash,tunes,revelation,wanderers,quarterfinals,fisheries,steadily,memoirs,pastoral,renewable,confluence,acquiring,strips,slogan,upstream,scouting,analyst,practitioners,turbine,strengthened,heavier,prehistoric,plural,excluding,isles,persecution,turin,rotating,villain,hemisphere,unaware,arabs,corpus,relied,singular,unanimous,schooling,passive,angles,dominance,instituted,aria,outskirts,balanced,beginnings,financially,structured,parachute,viewer,attitudes,subjected,escapes,derbyshire,erosion,addressing,styled,declaring,originating,colts,adjusted,stained,occurrence,fortifications,baghdad,nitrogen,localities,yemen,galway,debris,lodz,victorious,pharmaceutical,substances,unnamed,dwelling,atop,developmental,activism,voter,refugee,forested,relates,overlooking,genocide,kannada,insufficient,oversaw,partisan,dioxide,recipients,factions,mortality,capped,expeditions,receptors,reorganized,prominently,atom,flooded,flute,orchestral,scripts,mathematician,airplay,detached,rebuilding,dwarf,brotherhood,salvation,expressions,arabian,cameroon,poetic,recruiting,bundesliga,inserted,scrapped,disabilities,evacuation,pasha,undefeated,crafts,rituals,aluminium,norm,pools,submerged,occupying,pathway,exams,prosperity,wrestlers,promotions,basal,permits,nationalism,trim,merge,gazette,tributaries,transcription,caste,porto,emerge,modeled,adjoining,counterparts,paraguay,redevelopment,renewal,unreleased,equilibrium,similarity,minorities,soviets,comprise,nodes,tasked,unrelated,expired,johan,precursor,examinations,electrons,socialism,exiled,admiralty,floods,wigan,nonprofit,lacks,brigades,screens,repaired,hanover,fascist,labs,osaka,delays,judged,statutory,colt,col.,offspring,solving,bred,assisting,retains,somalia,grouped,corresponds,tunisia,chaplain,eminent,chord,22nd,spans,viral,innovations,possessions,mikhail,kolkata,icelandic,implications,introduces,racism,workforce,alto,compulsory,admits,censorship,onset,reluctant,inferior,iconic,progression,liability,turnout,satellites,behavioral,coordinated,exploitation,posterior,averaging,fringe,krakow,mountainous,greenwich,para,plantations,reinforcements,offerings,famed,intervals,constraints,individually,nutrition,1870s,taxation,threshold,tomatoes,fungi,contractor,ethiopian,apprentice,diabetes,wool,gujarat,honduras,norse,bucharest,23rd,arguably,accompany,prone,teammates,perennial,vacancy,polytechnic,deficit,okinawa,functionality,reminiscent,tolerance,transferring,myanmar,concludes,neighbours,hydraulic,economically,slower,plots,charities,synod,investor,catholicism,identifies,bronx,interpretations,adverse,judiciary,hereditary,nominal,sensor,symmetry,cubic,triangular,tenants,divisional,outreach,representations,passages,undergoing,cartridge,testified,exceeded,impacts,limiting,railroads,defeats,regain,rendering,humid,retreated,reliability,governorate,antwerp,infamous,implied,packaging,lahore,trades,billed,extinction,ecole,rejoined,recognizes,projection,qualifications,stripes,forts,socially,lexington,accurately,sexuality,westward,wikipedia,pilgrimage,abolition,choral,stuttgart,nests,expressing,strikeouts,assessed,monasteries,reconstructed,humorous,marxist,fertile,consort,urdu,patronage,peruvian,devised,lyric,baba,nassau,communism,extraction,popularly,markings,inability,litigation,accounted,processed,emirates,tempo,cadets,eponymous,contests,broadly,oxide,courtyard,frigate,directory,apex,outline,regency,chiefly,patrols,secretariat,cliffs,residency,privy,armament,australians,dorset,geometric,genetics,scholarships,fundraising,flats,demographic,multimedia,captained,documentaries,updates,canvas,blockade,guerrilla,songwriting,administrators,intake,drought,implementing,fraction,cannes,refusal,inscribed,meditation,announcing,exported,ballots,formula_3,curator,basel,arches,flour,subordinate,confrontation,gravel,simplified,berkshire,patriotic,tuition,employing,servers,castile,posting,combinations,discharged,miniature,mutations,constellation,incarnation,ideals,necessity,granting,ancestral,crowds,pioneered,mormon,methodology,rama,indirect,complexes,bavarian,patrons,uttar,skeleton,bollywood,flemish,viable,bloc,breeds,triggered,sustainability,tailed,referenced,comply,takeover,latvian,homestead,platoon,communal,nationality,excavated,targeting,sundays,posed,physicist,turret,endowment,marginal,dispatched,commentators,renovations,attachment,collaborations,ridges,barriers,obligations,shareholders,prof.,defenses,presided,rite,backgrounds,arbitrary,affordable,gloucestershire,thirteenth,inlet,miniseries,possesses,detained,pressures,subscription,realism,solidarity,proto,postgraduate,noun,burmese,abundance,homage,reasoning,anterior,robust,fencing,shifting,vowels,garde,profitable,loch,anchored,coastline,samoa,terminology,prostitution,magistrate,venezuelan,speculated,regulate,fixture,colonists,digit,induction,manned,expeditionary,computational,centennial,principally,vein,preserving,engineered,numerical,cancellation,conferred,continually,borne,seeded,advertisement,unanimously,treaties,infections,ions,sensors,lowered,amphibious,lava,fourteenth,bahrain,niagara,nicaragua,squares,congregations,26th,periodic,proprietary,1860s,contributors,seller,overs,emission,procession,presumed,illustrator,zinc,gases,tens,applicable,stretches,reproductive,sixteenth,apparatus,accomplishments,canoe,guam,oppose,recruitment,accumulated,limerick,namibia,staging,remixes,ordnance,uncertainty,pedestrian,temperate,treason,deposited,registry,cerambycidae,attracting,lankan,reprinted,shipbuilding,homosexuality,neurons,eliminating,1900s,resume,ministries,beneficial,blackpool,surplus,northampton,licenses,constructing,announcer,standardized,alternatives,taipei,inadequate,failures,yields,medalist,titular,obsolete,torah,burlington,predecessors,lublin,retailers,castles,depiction,issuing,gubernatorial,propulsion,tiles,damascus,discs,alternating,pomerania,peasant,tavern,redesignated,27th,illustration,focal,mans,codex,specialists,productivity,antiquity,controversies,promoter,pits,companions,behaviors,lyrical,prestige,creativity,swansea,dramas,approximate,feudal,tissues,crude,campaigned,unprecedented,chancel,amendments,surroundings,allegiance,exchanges,align,firmly,optimal,commenting,reigning,landings,obscure,1850s,contemporaries,paternal,devi,endurance,communes,incorporation,denominations,exchanged,routing,resorts,amnesty,slender,explores,suppression,heats,pronunciation,centred,coupe,stirling,freelance,treatise,linguistics,laos,informs,discovering,pillars,encourages,halted,robots,definitive,maturity,tuberculosis,venetian,silesian,unchanged,originates,mali,lincolnshire,quotes,seniors,premise,contingent,distribute,danube,gorge,logging,dams,curling,seventeenth,specializes,wetlands,deities,assess,thickness,rigid,culminated,utilities,substrate,insignia,nile,assam,shri,currents,suffrage,canadians,mortar,asteroid,bosnian,discoveries,enzymes,sanctioned,replica,hymn,investigators,tidal,dominate,derivatives,converting,leinster,verbs,honoured,criticisms,dismissal,discrete,masculine,reorganization,unlimited,wurttemberg,sacks,allocation,bahn,jurisdictions,participates,lagoon,famine,communion,culminating,surveyed,shortage,cables,intersects,cassette,foremost,adopting,solicitor,outright,bihar,reissued,farmland,dissertation,turnpike,baton,photographed,christchurch,kyoto,finances,rails,histories,linebacker,kilkenny,accelerated,dispersed,handicap,absorption,rancho,ceramic,captivity,cites,font,weighed,mater,utilize,bravery,extract,validity,slovenian,seminars,discourse,ranged,duel,ironically,warships,sega,temporal,surpassed,prolonged,recruits,northumberland,greenland,contributes,patented,eligibility,unification,discusses,reply,translates,beirut,relies,torque,northward,reviewers,monastic,accession,neural,tramway,heirs,sikh,subscribers,amenities,taliban,audit,rotterdam,wagons,kurdish,favoured,combustion,meanings,persia,browser,diagnostic,niger,formula_4,denomination,dividing,parameter,branding,badminton,leningrad,sparked,hurricanes,beetles,propeller,mozambique,refined,diagram,exhaust,vacated,readings,markers,reconciliation,determines,concurrent,imprint,primera,organism,demonstrating,filmmakers,vanderbilt,affiliates,traction,evaluated,defendants,megachile,investigative,zambia,assassinated,rewarded,probable,staffordshire,foreigners,directorate,nominees,consolidation,commandant,reddish,differing,unrest,drilling,bohemia,resembling,instrumentation,considerations,haute,promptly,variously,dwellings,clans,tablet,enforced,cockpit,semifinal,hussein,prisons,ceylon,emblem,monumental,phrases,correspond,crossover,outlined,characterised,acceleration,caucus,crusade,protested,composing,rajasthan,habsburg,rhythmic,interception,inherent,cooled,ponds,spokesperson,gradual,consultation,kuala,globally,suppressed,builders,avengers,suffix,integer,enforce,fibers,unionist,proclamation,uncovered,infrared,adapt,eisenhower,utilizing,captains,stretched,observing,assumes,prevents,analyses,saxophone,caucasus,notices,villains,dartmouth,mongol,hostilities,stretching,veterinary,lenses,texture,prompting,overthrow,excavation,islanders,masovian,battleship,biographer,replay,degradation,departing,luftwaffe,fleeing,oversight,immigrated,serbs,fishermen,strengthening,respiratory,italians,denotes,radial,escorted,motif,wiltshire,expresses,accessories,reverted,establishments,inequality,protocols,charting,famously,satirical,entirety,trench,friction,atletico,sampling,subset,weekday,upheld,sharply,correlation,incorrect,mughal,travelers,hasan,earnings,offset,evaluate,specialised,recognizing,flexibility,nagar,postseason,algebraic,capitalism,crystals,melodies,polynomial,racecourse,defences,austro,wembley,attracts,anarchist,resurrection,reviewing,decreasing,prefix,ratified,mutation,displaying,separating,restoring,assemblies,ordinance,priesthood,cruisers,appoint,moldova,imports,directive,epidemic,militant,senegal,signaling,restriction,critique,retrospective,nationalists,undertake,sioux,canals,algerian,redesigned,philanthropist,depict,conceptual,turbines,intellectuals,eastward,applicants,contractors,vendors,undergone,namesake,ensured,tones,substituted,hindwings,arrests,tombs,transitional,principality,reelection,taiwanese,cavity,manifesto,broadcasters,spawned,thoroughbred,identities,generators,proposes,hydroelectric,johannesburg,cortex,scandinavian,killings,aggression,boycott,catalyst,physiology,fifteenth,waterfront,chromosome,organist,costly,calculation,cemeteries,flourished,recognise,juniors,merging,disciples,ashore,workplace,enlightenment,diminished,debated,hailed,podium,educate,mandated,distributor,litre,electromagnetic,flotilla,estuary,peterborough,staircase,selections,melodic,confronts,wholesale,integrate,intercepted,catalonia,unite,immense,palatinate,switches,earthquakes,occupational,successors,praising,concluding,faculties,firstly,overhaul,empirical,metacritic,inauguration,evergreen,laden,winged,philosophers,amalgamated,geoff,centimeters,napoleonic,upright,planting,brewing,fined,sensory,migrants,wherein,inactive,headmaster,warwickshire,siberia,terminals,denounced,academia,divinity,bilateral,clive,omitted,peerage,relics,apartheid,syndicate,fearing,fixtures,desirable,dismantled,ethnicity,valves,biodiversity,aquarium,ideological,visibility,creators,analyzed,tenant,balkan,postwar,supplier,smithsonian,risen,morphology,digits,bohemian,wilmington,vishnu,demonstrates,aforementioned,biographical,mapped,khorasan,phosphate,presentations,ecosystem,processors,calculations,mosaic,clashes,penned,recalls,coding,angular,lattice,macau,accountability,extracted,pollen,therapeutic,overlap,violinist,deposed,candidacy,infants,covenant,bacterial,restructuring,dungeons,ordination,conducts,builds,invasive,customary,concurrently,relocation,cello,statutes,borneo,entrepreneurs,sanctions,packet,rockefeller,piedmont,comparisons,waterfall,receptions,glacial,surge,signatures,alterations,advertised,enduring,somali,botanist,100th,canonical,motifs,longitude,circulated,alloy,indirectly,margins,preserves,internally,besieged,shale,peripheral,drained,baseman,reassigned,tobago,soloist,socio,grazing,contexts,roofs,portraying,ottomans,shrewsbury,noteworthy,lamps,supplying,beams,qualifier,portray,greenhouse,stronghold,hitter,rites,cretaceous,urging,derive,nautical,aiming,fortunes,verde,donors,reliance,exceeding,exclusion,exercised,simultaneous,continents,guiding,pillar,gradient,poznan,eruption,clinics,moroccan,indicator,trams,piers,parallels,fragment,teatro,potassium,satire,compressed,businessmen,influx,seine,perspectives,shelters,decreases,mounting,formula_5,confederacy,equestrian,expulsion,mayors,liberia,resisted,affinity,shrub,unexpectedly,stimulus,amtrak,deported,perpendicular,statesman,wharf,storylines,romanesque,weights,surfaced,interceptions,dhaka,crambidae,orchestras,rwanda,conclude,constitutes,subsidiaries,admissions,prospective,shear,bilingual,campaigning,presiding,domination,commemorative,trailing,confiscated,petrol,acquisitions,polymer,onlyinclude,chloride,elevations,resolutions,hurdles,pledged,likelihood,objected,erect,encoding,databases,aristotle,hindus,marshes,bowled,ministerial,grange,acronym,annexation,squads,ambient,pilgrims,botany,sofla,astronomer,planetary,descending,bestowed,ceramics,diplomacy,metabolism,colonization,potomac,africans,engraved,recycling,commitments,resonance,disciplinary,jamaican,narrated,spectral,tipperary,waterford,stationary,arbitration,transparency,threatens,crossroads,slalom,oversee,centenary,incidence,economies,livery,moisture,newsletter,autobiographical,bhutan,propelled,dependence,moderately,adobe,barrels,subdivisions,outlook,labelled,stratford,arising,diaspora,barony,automobiles,ornamental,slated,norms,primetime,generalized,analysts,vectors,libyan,yielded,certificates,rooted,vernacular,belarusian,marketplace,prediction,fairfax,malawi,viruses,wooded,demos,mauritius,prosperous,coincided,liberties,huddersfield,ascent,warnings,hinduism,glucose,pulitzer,unused,filters,illegitimate,acquitted,protestants,canopy,staple,psychedelic,winding,abbas,pathways,cheltenham,lagos,niche,invaders,proponents,barred,conversely,doncaster,recession,embraced,rematch,concession,emigration,upgrades,bowls,tablets,remixed,loops,kensington,shootout,monarchs,organizers,harmful,punjabi,broadband,exempt,neolithic,profiles,portrays,parma,cyrillic,quasi,attested,regimental,revive,torpedoes,heidelberg,rhythms,spherical,denote,hymns,icons,theologian,qaeda,exceptionally,reinstated,comune,playhouse,lobbying,grossing,viceroy,delivers,visually,armistice,utrecht,syllable,vertices,analogous,annex,refurbished,entrants,knighted,disciple,rhetoric,detailing,inactivated,ballads,algae,intensified,favourable,sanitation,receivers,pornography,commemorated,cannons,entrusted,manifold,photographers,pueblo,textiles,steamer,myths,marquess,onward,liturgical,romney,uzbekistan,consistency,denoted,hertfordshire,convex,hearings,sulfur,universidad,podcast,selecting,emperors,arises,justices,1840s,mongolian,exploited,termination,digitally,infectious,sedan,symmetric,penal,illustrate,formulation,attribute,problematic,modular,inverse,berth,searches,rutgers,leicestershire,enthusiasts,lockheed,upwards,transverse,accolades,backward,archaeologists,crusaders,nuremberg,defects,ferries,vogue,containers,openings,transporting,separates,lumpur,purchases,attain,wichita,topology,woodlands,deleted,periodically,syntax,overturned,musicals,corp.,strasbourg,instability,nationale,prevailing,cache,marathi,versailles,unmarried,grains,straits,antagonist,segregation,assistants,d'etat,contention,dictatorship,unpopular,motorcycles,criterion,analytical,salzburg,militants,hanged,worcestershire,emphasize,paralympic,erupted,convinces,offences,oxidation,nouns,populace,atari,spanned,hazardous,educators,playable,births,baha'i,preseason,generates,invites,meteorological,handbook,foothills,enclosure,diffusion,mirza,convergence,geelong,coefficient,connector,formula_6,cylindrical,disasters,pleaded,knoxville,contamination,compose,libertarian,arrondissement,franciscan,intercontinental,susceptible,initiation,malaria,unbeaten,consonants,waived,saloon,popularized,estadio,pseudo,interdisciplinary,transports,transformers,carriages,bombings,revolves,ceded,collaborator,celestial,exemption,colchester,maltese,oceanic,ligue,crete,shareholder,routed,depictions,ridden,advisors,calculate,lending,guangzhou,simplicity,newscast,scheduling,snout,eliot,undertaking,armenians,nottinghamshire,whitish,consulted,deficiency,salle,cinemas,superseded,rigorous,kerman,convened,landowners,modernization,evenings,pitches,conditional,scandinavia,differed,formulated,cyclists,swami,guyana,dunes,electrified,appalachian,abdomen,scenarios,prototypes,sindh,consonant,adaptive,boroughs,wolverhampton,modelling,cylinders,amounted,minimize,ambassadors,lenin,settler,coincide,approximation,grouping,murals,bullying,registers,rumours,engagements,energetic,vertex,annals,bordering,geologic,yellowish,runoff,converts,allegheny,facilitated,saturdays,colliery,monitored,rainforest,interfaces,geographically,impaired,prevalence,joachim,paperback,slowed,shankar,distinguishing,seminal,categorized,authorised,auspices,bandwidth,asserts,rebranded,balkans,supplemented,seldom,weaving,capsule,apostles,populous,monmouth,payload,symphonic,densely,shoreline,managerial,masonry,antioch,averages,textbooks,royalist,coliseum,tandem,brewers,diocesan,posthumous,walled,incorrectly,distributions,ensued,reasonably,graffiti,propagation,automation,harmonic,augmented,middleweight,limbs,elongated,landfall,comparatively,literal,grossed,koppen,wavelength,1830s,cerebral,boasts,congestion,physiological,practitioner,coasts,cartoonist,undisclosed,frontal,launches,burgundy,qualifiers,imposing,stade,flanked,assyrian,raided,multiplayer,montane,chesapeake,pathology,drains,vineyards,intercollegiate,semiconductor,grassland,convey,citations,predominant,rejects,benefited,yahoo,graphs,busiest,encompassing,hamlets,explorers,suppress,minors,graphical,calculus,sediment,intends,diverted,mainline,unopposed,cottages,initiate,alumnus,towed,autism,forums,darlington,modernist,oxfordshire,lectured,capitalist,suppliers,panchayat,actresses,foundry,southbound,commodity,wesleyan,divides,palestinians,luton,caretaker,nobleman,mutiny,organizer,preferences,nomenclature,splits,unwilling,offenders,timor,relying,halftime,semitic,arithmetic,milestone,jesuits,arctiidae,retrieved,consuming,contender,edged,plagued,inclusive,transforming,khmer,federally,insurgents,distributing,amherst,rendition,prosecutors,viaduct,disqualified,kabul,liturgy,prevailed,reelected,instructors,swimmers,aperture,churchyard,interventions,totals,darts,metropolis,fuels,fluent,northbound,correctional,inflicted,barrister,realms,culturally,aristocratic,collaborating,emphasizes,choreographer,inputs,ensembles,humboldt,practised,endowed,strains,infringement,archaeologist,congregational,magna,relativity,efficiently,proliferation,mixtape,abruptly,regeneration,commissioning,yukon,archaic,reluctantly,retailer,northamptonshire,universally,crossings,boilers,nickelodeon,revue,abbreviation,retaliation,scripture,routinely,medicinal,benedictine,kenyan,retention,deteriorated,glaciers,apprenticeship,coupling,researched,topography,entrances,anaheim,pivotal,compensate,arched,modify,reinforce,dusseldorf,journeys,motorsport,conceded,sumatra,spaniards,quantitative,loire,cinematography,discarded,botswana,morale,engined,zionist,philanthropy,sainte,fatalities,cypriot,motorsports,indicators,pricing,institut,bethlehem,implicated,gravitational,differentiation,rotor,thriving,precedent,ambiguous,concessions,forecast,conserved,fremantle,asphalt,landslide,middlesbrough,formula_7,humidity,overseeing,chronological,diaries,multinational,crimean,turnover,improvised,youths,declares,tasmanian,canadiens,fumble,refinery,weekdays,unconstitutional,upward,guardians,brownish,imminent,hamas,endorsement,naturalist,martyrs,caledonia,chords,yeshiva,reptiles,severity,mitsubishi,fairs,installment,substitution,repertory,keyboardist,interpreter,silesia,noticeable,rhineland,transmit,inconsistent,booklet,academies,epithet,pertaining,progressively,aquatics,scrutiny,prefect,toxicity,rugged,consume,o'donnell,evolve,uniquely,cabaret,mediated,landowner,transgender,palazzo,compilations,albuquerque,induce,sinai,remastered,efficacy,underside,analogue,specify,possessing,advocating,compatibility,liberated,greenville,mecklenburg,header,memorials,sewage,rhodesia,1800s,salaries,atoll,coordinating,partisans,repealed,amidst,subjective,optimization,nectar,evolving,exploits,madhya,styling,accumulation,raion,postage,responds,buccaneers,frontman,brunei,choreography,coated,kinetic,sampled,inflammatory,complementary,eclectic,norte,vijay,a.k.a,mainz,casualty,connectivity,laureate,franchises,yiddish,reputed,unpublished,economical,periodicals,vertically,bicycles,brethren,capacities,unitary,archeological,tehsil,domesday,wehrmacht,justification,angered,mysore,fielded,abuses,nutrients,ambitions,taluk,battleships,symbolism,superiority,neglect,attendees,commentaries,collaborators,predictions,yorker,breeders,investing,libretto,informally,coefficients,memorandum,pounder,collingwood,tightly,envisioned,arbor,mistakenly,captures,nesting,conflicting,enhancing,streetcar,manufactures,buckinghamshire,rewards,commemorating,stony,expenditure,tornadoes,semantic,relocate,weimar,iberian,sighted,intending,ensign,beverages,expectation,differentiate,centro,utilizes,saxophonist,catchment,transylvania,ecosystems,shortest,sediments,socialists,ineffective,kapoor,formidable,heroine,guantanamo,prepares,scattering,pamphlet,verified,elector,barons,totaling,shrubs,pyrenees,amalgamation,mutually,longitudinal,comte,negatively,masonic,envoy,sexes,akbar,mythical,tonga,bishopric,assessments,malaya,warns,interiors,reefs,reflections,neutrality,musically,nomadic,waterways,provence,collaborate,scaled,adulthood,emerges,euros,optics,incentives,overland,periodical,liege,awarding,realization,slang,affirmed,schooner,hokkaido,czechoslovak,protectorate,undrafted,disagreed,commencement,electors,spruce,swindon,fueled,equatorial,inventions,suites,slovene,backdrop,adjunct,energies,remnant,inhabit,alliances,simulcast,reactors,mosques,travellers,outfielder,plumage,migratory,benin,experimented,fibre,projecting,drafting,laude,evidenced,northernmost,indicted,directional,replication,croydon,comedies,jailed,organizes,devotees,reservoirs,turrets,originate,economists,songwriters,junta,trenches,mounds,proportions,comedic,apostle,azerbaijani,farmhouse,resembled,disrupted,playback,mixes,diagonal,relevance,govern,programmer,gdansk,maize,soundtracks,tendencies,mastered,impacted,believers,kilometre,intervene,chairperson,aerodrome,sails,subsidies,ensures,aesthetics,congresses,ratios,sardinia,southernmost,functioned,controllers,downward,randomly,distortion,regents,palatine,disruption,spirituality,vidhan,tracts,compiler,ventilation,anchorage,symposium,assert,pistols,excelled,avenues,convoys,moniker,constructions,proponent,phased,spines,organising,schleswig,policing,campeonato,mined,hourly,croix,lucrative,authenticity,haitian,stimulation,burkina,espionage,midfield,manually,staffed,awakening,metabolic,biographies,entrepreneurship,conspicuous,guangdong,preface,subgroup,mythological,adjutant,feminism,vilnius,oversees,honourable,tripoli,stylized,kinase,societe,notoriety,altitudes,configurations,outward,transmissions,announces,auditor,ethanol,clube,nanjing,mecca,haifa,blogs,postmaster,paramilitary,depart,positioning,potent,recognizable,spire,brackets,remembrance,overlapping,turkic,articulated,scientology,operatic,deploy,readiness,biotechnology,restrict,cinematographer,inverted,synonymous,administratively,westphalia,commodities,replaces,downloads,centralized,munitions,preached,sichuan,fashionable,implementations,matrices,hiv/aids,loyalist,luzon,celebrates,hazards,heiress,mercenaries,synonym,creole,ljubljana,technician,auditioned,technicians,viewpoint,wetland,mongols,princely,sharif,coating,dynasties,southward,doubling,formula_8,mayoral,harvesting,conjecture,goaltender,oceania,spokane,welterweight,bracket,gatherings,weighted,newscasts,mussolini,affiliations,disadvantage,vibrant,spheres,sultanate,distributors,disliked,establishes,marches,drastically,yielding,jewellery,yokohama,vascular,airlift,canons,subcommittee,repression,strengths,graded,outspoken,fused,pembroke,filmography,redundant,fatigue,repeal,threads,reissue,pennant,edible,vapor,corrections,stimuli,commemoration,dictator,anand,secession,amassed,orchards,pontifical,experimentation,greeted,bangor,forwards,decomposition,quran,trolley,chesterfield,traverse,sermons,burials,skier,climbs,consultants,petitioned,reproduce,parted,illuminated,kurdistan,reigned,occupants,packaged,geometridae,woven,regulating,protagonists,crafted,affluent,clergyman,consoles,migrant,supremacy,attackers,caliph,defect,convection,rallies,huron,resin,segunda,quota,warship,overseen,criticizing,shrines,glamorgan,lowering,beaux,hampered,invasions,conductors,collects,bluegrass,surrounds,substrates,perpetual,chronology,pulmonary,executions,crimea,compiling,noctuidae,battled,tumors,minsk,novgorod,serviced,yeast,computation,swamps,theodor,baronetcy,salford,uruguayan,shortages,odisha,siberian,novelty,cinematic,invitational,decks,dowager,oppression,bandits,appellate,state-of-the-art,clade,palaces,signalling,galaxies,industrialist,tensor,learnt,incurred,magistrates,binds,orbits,ciudad,willingness,peninsular,basins,biomedical,shafts,marlborough,bournemouth,withstand,fitzroy,dunedin,variance,steamship,integrating,muscular,fines,akron,bulbophyllum,malmo,disclosed,cornerstone,runways,medicines,twenty20,gettysburg,progresses,frigates,bodied,transformations,transforms,helens,modelled,versatile,regulator,pursuits,legitimacy,amplifier,scriptures,voyages,examines,presenters,octagonal,poultry,formula_9,anatolia,computed,migrate,directorial,hybrids,localized,preferring,guggenheim,persisted,grassroots,inflammation,fishery,otago,vigorous,professions,instructional,inexpensive,insurgency,legislators,sequels,surnames,agrarian,stainless,nairobi,minas,forerunner,aristocracy,transitions,sicilian,showcased,doses,hiroshima,summarized,gearbox,emancipation,limitation,nuclei,seismic,abandonment,dominating,appropriations,occupations,electrification,hilly,contracting,exaggerated,entertainer,kazan,oricon,cartridges,characterization,parcel,maharaja,exceeds,aspiring,obituary,flattened,contrasted,narration,replies,oblique,outpost,fronts,arranger,talmud,keynes,doctrines,endured,confesses,fortification,supervisors,kilometer,academie,jammu,bathurst,piracy,prostitutes,navarre,cumulative,cruises,lifeboat,twinned,radicals,interacting,expenditures,wexford,libre,futsal,curated,clockwise,colloquially,procurement,immaculate,lyricist,enhancement,porcelain,alzheimer,highlighting,judah,disagreements,storytelling,sheltered,wroclaw,vaudeville,contrasts,neoclassical,compares,contrasting,deciduous,francaise,descriptive,cyclic,reactive,antiquities,meiji,repeats,creditors,forcibly,newmarket,picturesque,impending,uneven,bison,raceway,solvent,ecumenical,optic,professorship,harvested,waterway,banjo,pharaoh,geologist,scanning,dissent,recycled,unmanned,retreating,gospels,aqueduct,branched,tallinn,groundbreaking,syllables,hangar,designations,procedural,craters,cabins,encryption,anthropologist,montevideo,outgoing,inverness,chattanooga,fascism,calais,chapels,groundwater,downfall,misleading,robotic,tortricidae,pixel,handel,prohibit,crewe,renaming,reprised,kickoff,leftist,spaced,integers,causeway,pines,authorship,organise,ptolemy,accessibility,virtues,lesions,iroquois,qur'an,atheist,synthesized,biennial,confederates,dietary,skaters,stresses,tariff,koreans,intercity,republics,quintet,baroness,naive,amplitude,insistence,tbilisi,residues,grammatical,diversified,egyptians,accompaniment,vibration,repository,mandal,topological,distinctions,coherent,invariant,batters,nuevo,internationals,implements,follower,bahia,widened,independents,cantonese,totaled,guadalajara,wolverines,befriended,muzzle,surveying,hungarians,medici,deportation,rayon,approx,recounts,attends,clerical,hellenic,furnished,alleging,soluble,systemic,gallantry,bolshevik,intervened,hostel,gunpowder,specialising,stimulate,leiden,removes,thematic,floral,bafta,printers,conglomerate,eroded,analytic,successively,lehigh,thessaloniki,kilda,clauses,ascended,nehru,scripted,tokugawa,competence,diplomats,exclude,consecration,freedoms,assaults,revisions,blacksmith,textual,sparse,concacaf,slain,uploaded,enraged,whaling,guise,stadiums,debuting,dormitory,cardiovascular,yunnan,dioceses,consultancy,notions,lordship,archdeacon,collided,medial,airfields,garment,wrestled,adriatic,reversal,refueling,verification,jakob,horseshoe,intricate,veracruz,sarawak,syndication,synthesizer,anthologies,stature,feasibility,guillaume,narratives,publicized,antrim,intermittent,constituents,grimsby,filmmaking,doping,unlawful,nominally,transmitting,documenting,seater,internationale,ejected,steamboat,alsace,boise,ineligible,geared,vassal,mustered,ville,inline,pairing,eurasian,kyrgyzstan,barnsley,reprise,stereotypes,rushes,conform,firefighters,deportivo,revolutionaries,rabbis,concurrency,charters,sustaining,aspirations,algiers,chichester,falkland,morphological,systematically,volcanoes,designate,artworks,reclaimed,jurist,anglia,resurrected,chaotic,feasible,circulating,simulated,environmentally,confinement,adventist,harrisburg,laborers,ostensibly,universiade,pensions,influenza,bratislava,octave,refurbishment,gothenburg,putin,barangay,annapolis,breaststroke,illustrates,distorted,choreographed,promo,emphasizing,stakeholders,descends,exhibiting,intrinsic,invertebrates,evenly,roundabout,salts,formula_10,strata,inhibition,branching,stylistic,rumored,realises,mitochondrial,commuted,adherents,logos,bloomberg,telenovela,guineas,charcoal,engages,winery,reflective,siena,cambridgeshire,ventral,flashback,installing,engraving,grasses,traveller,rotated,proprietor,nationalities,precedence,sourced,trainers,cambodian,reductions,depleted,saharan,classifications,biochemistry,plaintiffs,arboretum,humanist,fictitious,aleppo,climates,bazaar,his/her,homogeneous,multiplication,moines,indexed,linguist,skeletal,foliage,societal,differentiated,informing,mammal,infancy,archival,cafes,malls,graeme,musee,schizophrenia,fargo,pronouns,derivation,descend,ascending,terminating,deviation,recaptured,confessions,weakening,tajikistan,bahadur,pasture,b/hip,donegal,supervising,sikhs,thinkers,euclidean,reinforcement,friars,portage,fuscous,lucknow,synchronized,assertion,choirs,privatization,corrosion,multitude,skyscraper,royalties,ligament,usable,spores,directs,clashed,stockport,fronted,dependency,contiguous,biologist,backstroke,powerhouse,frescoes,phylogenetic,welding,kildare,gabon,conveyed,augsburg,severn,continuum,sahib,lille,injuring,passeriformesfamily,succeeds,translating,unitarian,startup,turbulent,outlying,philanthropic,stanislaw,idols,claremont,conical,haryana,armagh,blended,implicit,conditioned,modulation,rochdale,labourers,coinage,shortstop,potsdam,gears,obesity,bestseller,advisers,bouts,comedians,jozef,lausanne,taxonomic,correlated,columbian,marne,indications,psychologists,libel,edict,beaufort,disadvantages,renal,finalized,racehorse,unconventional,disturbances,falsely,zoology,adorned,redesign,executing,narrower,commended,appliances,stalls,resurgence,saskatoon,miscellaneous,permitting,epoch,formula_11,cumbria,forefront,vedic,eastenders,disposed,supermarkets,rower,inhibitor,magnesium,colourful,yusuf,harrow,formulas,centrally,balancing,ionic,nocturnal,consolidate,ornate,raiding,charismatic,accelerate,nominate,residual,dhabi,commemorates,attribution,uninhabited,mindanao,atrocities,genealogical,romani,applicant,enactment,abstraction,trough,pulpit,minuscule,misconduct,grenades,timely,supplements,messaging,curvature,ceasefire,telangana,susquehanna,braking,redistribution,shreveport,neighbourhoods,gregorian,widowed,khuzestan,empowerment,scholastic,evangelist,peptide,topical,theorist,historia,thence,sudanese,museo,jurisprudence,masurian,frankish,headlined,recounted,netball,petitions,tolerant,hectare,truncated,southend,methane,captives,reigns,massif,subunit,acidic,weightlifting,footballers,sabah,britannia,tunisian,segregated,sawmill,withdrawing,unpaid,weaponry,somme,perceptions,unicode,alcoholism,durban,wrought,waterfalls,jihad,auschwitz,upland,eastbound,adjective,anhalt,evaluating,regimes,guildford,reproduced,pamphlets,hierarchical,maneuvers,hanoi,fabricated,repetition,enriched,arterial,replacements,tides,globalization,adequately,westbound,satisfactory,fleets,phosphorus,lastly,neuroscience,anchors,xinjiang,membranes,improvisation,shipments,orthodoxy,submissions,bolivian,mahmud,ramps,leyte,pastures,outlines,flees,transmitters,fares,sequential,stimulated,novice,alternately,symmetrical,breakaway,layered,baronets,lizards,blackish,edouard,horsepower,penang,principals,mercantile,maldives,overwhelmingly,hawke,rallied,prostate,conscription,juveniles,maccabi,carvings,strikers,sudbury,spurred,improves,lombardy,macquarie,parisian,elastic,distillery,shetland,humane,brentford,wrexham,warehouses,routines,encompassed,introductory,isfahan,instituto,palais,revolutions,sporadic,impoverished,portico,fellowships,speculative,enroll,dormant,adhere,fundamentally,sculpted,meritorious,template,upgrading,reformer,rectory,uncredited,indicative,creeks,galveston,radically,hezbollah,firearm,educating,prohibits,trondheim,locus,refit,headwaters,screenings,lowlands,wasps,coarse,attaining,sedimentary,perished,pitchfork,interned,cerro,stagecoach,aeronautical,liter,transitioned,haydn,inaccurate,legislatures,bromwich,knesset,spectroscopy,butte,asiatic,degraded,concordia,catastrophic,lobes,wellness,pensacola,periphery,hapoel,theta,horizontally,freiburg,liberalism,pleas,durable,warmian,offenses,mesopotamia,shandong,unsuitable,hospitalized,appropriately,phonetic,encompass,conversions,observes,illnesses,breakout,assigns,crowns,inhibitors,nightly,manifestation,fountains,maximize,alphabetical,sloop,expands,newtown,widening,gaddafi,commencing,camouflage,footprint,tyrol,barangays,universite,highlanders,budgets,query,lobbied,westchester,equator,stipulated,pointe,distinguishes,allotted,embankment,advises,storing,loyalists,fourier,rehearsals,starvation,gland,rihanna,tubular,expressive,baccalaureate,intersections,revered,carbonate,eritrea,craftsmen,cosmopolitan,sequencing,corridors,shortlisted,bangladeshi,persians,mimic,parades,repetitive,recommends,flanks,promoters,incompatible,teaming,ammonia,greyhound,solos,improper,legislator,newsweek,recurrent,vitro,cavendish,eireann,crises,prophets,mandir,strategically,guerrillas,formula_12,ghent,contenders,equivalence,drone,sociological,hamid,castes,statehood,aland,clinched,relaunched,tariffs,simulations,williamsburg,rotate,mediation,smallpox,harmonica,lodges,lavish,restrictive,o'sullivan,detainees,polynomials,echoes,intersecting,learners,elects,charlemagne,defiance,epsom,liszt,facilitating,absorbing,revelations,padua,pieter,pious,penultimate,mammalian,montenegrin,supplementary,widows,aromatic,croats,roanoke,trieste,legions,subdistrict,babylonian,grasslands,volga,violently,sparsely,oldies,telecommunication,respondents,quarries,downloadable,commandos,taxpayer,catalytic,malabar,afforded,copying,declines,nawab,junctions,assessing,filtering,classed,disused,compliant,christoph,gottingen,civilizations,hermitage,caledonian,whereupon,ethnically,springsteen,mobilization,terraces,indus,excel,zoological,enrichment,simulate,guitarists,registrar,cappella,invoked,reused,manchu,configured,uppsala,genealogy,mergers,casts,curricular,rebelled,subcontinent,horticultural,parramatta,orchestrated,dockyard,claudius,decca,prohibiting,turkmenistan,brahmin,clandestine,obligatory,elaborated,parasitic,helix,constraint,spearheaded,rotherham,eviction,adapting,albans,rescues,sociologist,guiana,convicts,occurrences,kamen,antennas,asturias,wheeled,sanitary,deterioration,trier,theorists,baseline,announcements,valea,planners,factual,serialized,serials,bilbao,demoted,fission,jamestown,cholera,alleviate,alteration,indefinite,sulfate,paced,climatic,valuation,artisans,proficiency,aegean,regulators,fledgling,sealing,influencing,servicemen,frequented,cancers,tambon,narayan,bankers,clarified,embodied,engraver,reorganisation,dissatisfied,dictated,supplemental,temperance,ratification,puget,nutrient,pretoria,papyrus,uniting,ascribed,cores,coptic,schoolhouse,barrio,1910s,armory,defected,transatlantic,regulates,ported,artefacts,specifies,boasted,scorers,mollusks,emitted,navigable,quakers,projective,dialogues,reunification,exponential,vastly,banners,unsigned,dissipated,halves,coincidentally,leasing,purported,escorting,estimation,foxes,lifespan,inflorescence,assimilation,showdown,staunch,prologue,ligand,superliga,telescopes,northwards,keynote,heaviest,taunton,redeveloped,vocalists,podlaskie,soyuz,rodents,azores,moravian,outset,parentheses,apparel,domestically,authoritative,polymers,monterrey,inhibit,launcher,jordanian,folds,taxis,mandates,singled,liechtenstein,subsistence,marxism,ousted,governorship,servicing,offseason,modernism,prism,devout,translators,islamist,chromosomes,pitted,bedfordshire,fabrication,authoritarian,javanese,leaflets,transient,substantive,predatory,sigismund,assassinate,diagrams,arrays,rediscovered,reclamation,spawning,fjord,peacekeeping,strands,fabrics,highs,regulars,tirana,ultraviolet,athenian,filly,barnet,naacp,nueva,favourites,terminates,showcases,clones,inherently,interpreting,bjorn,finely,lauded,unspecified,chola,pleistocene,insulation,antilles,donetsk,funnel,nutritional,biennale,reactivated,southport,primate,cavaliers,austrians,interspersed,restarted,suriname,amplifiers,wladyslaw,blockbuster,sportsman,minogue,brightness,benches,bridgeport,initiating,israelis,orbiting,newcomers,externally,scaling,transcribed,impairment,luxurious,longevity,impetus,temperament,ceilings,tchaikovsky,spreads,pantheon,bureaucracy,1820s,heraldic,villas,formula_13,galician,meath,avoidance,corresponded,headlining,connacht,seekers,rappers,solids,monograph,scoreless,opole,isotopes,himalayas,parodies,garments,microscopic,republished,havilland,orkney,demonstrators,pathogen,saturated,hellenistic,facilitates,aerodynamic,relocating,indochina,laval,astronomers,bequeathed,administrations,extracts,nagoya,torquay,demography,medicare,ambiguity,renumbered,pursuant,concave,syriac,electrode,dispersal,henan,bialystok,walsall,crystalline,puebla,janata,illumination,tianjin,enslaved,coloration,championed,defamation,grille,johor,rejoin,caspian,fatally,planck,workings,appointing,institutionalized,wessex,modernized,exemplified,regatta,jacobite,parochial,programmers,blending,eruptions,insurrection,regression,indices,sited,dentistry,mobilized,furnishings,levant,primaries,ardent,nagasaki,conqueror,dorchester,opined,heartland,amman,mortally,wellesley,bowlers,outputs,coveted,orthography,immersion,disrepair,disadvantaged,curate,childless,condensed,codice_1,remodeled,resultant,bolsheviks,superfamily,saxons,2010s,contractual,rivalries,malacca,oaxaca,magnate,vertebrae,quezon,olympiad,yucatan,tyres,macro,specialization,commendation,caliphate,gunnery,exiles,excerpts,fraudulent,adjustable,aramaic,interceptor,drumming,standardization,reciprocal,adolescents,federalist,aeronautics,favorably,enforcing,reintroduced,zhejiang,refining,biplane,banknotes,accordion,intersect,illustrating,summits,classmate,militias,biomass,massacres,epidemiology,reworked,wrestlemania,nantes,auditory,taxon,elliptical,chemotherapy,asserting,avoids,proficient,airmen,yellowstone,multicultural,alloys,utilization,seniority,kuyavian,huntsville,orthogonal,bloomington,cultivars,casimir,internment,repulsed,impedance,revolving,fermentation,parana,shutout,partnering,empowered,islamabad,polled,classify,amphibians,greyish,obedience,4x100,projectile,khyber,halfback,relational,d'ivoire,synonyms,endeavour,padma,customized,mastery,defenceman,berber,purge,interestingly,covent,promulgated,restricting,condemnation,hillsborough,walkers,privateer,intra,captaincy,naturalized,huffington,detecting,hinted,migrating,bayou,counterattack,anatomical,foraging,unsafe,swiftly,outdated,paraguayan,attire,masjid,endeavors,jerseys,triassic,quechua,growers,axial,accumulate,wastewater,cognition,fungal,animator,pagoda,kochi,uniformly,antibody,yerevan,hypotheses,combatants,italianate,draining,fragmentation,snowfall,formative,inversion,kitchener,identifier,additive,lucha,selects,ashland,cambrian,racetrack,trapping,congenital,primates,wavelengths,expansions,yeomanry,harcourt,wealthiest,awaited,punta,intervening,aggressively,vichy,piloted,midtown,tailored,heyday,metadata,guadalcanal,inorganic,hadith,pulses,francais,tangent,scandals,erroneously,tractors,pigment,constabulary,jiangsu,landfill,merton,basalt,astor,forbade,debuts,collisions,exchequer,stadion,roofed,flavour,sculptors,conservancy,dissemination,electrically,undeveloped,existent,surpassing,pentecostal,manifested,amend,formula_14,superhuman,barges,tunis,analytics,argyll,liquids,mechanized,domes,mansions,himalayan,indexing,reuters,nonlinear,purification,exiting,timbers,triangles,decommissioning,departmental,causal,fonts,americana,sept.,seasonally,incomes,razavi,sheds,memorabilia,rotational,terre,sutra,protege,yarmouth,grandmaster,annum,looted,imperialism,variability,liquidation,baptised,isotope,showcasing,milling,rationale,hammersmith,austen,streamlined,acknowledging,contentious,qaleh,breadth,turing,referees,feral,toulon,unofficially,identifiable,standout,labeling,dissatisfaction,jurgen,angrily,featherweight,cantons,constrained,dominates,standalone,relinquished,theologians,markedly,italics,downed,nitrate,likened,gules,craftsman,singaporean,pixels,mandela,moray,parity,departement,antigen,academically,burgh,brahma,arranges,wounding,triathlon,nouveau,vanuatu,banded,acknowledges,unearthed,stemming,authentication,byzantines,converge,nepali,commonplace,deteriorating,recalling,palette,mathematicians,greenish,pictorial,ahmedabad,rouen,validation,u.s.a.,'best,malvern,archers,converter,undergoes,fluorescent,logistical,notification,transvaal,illicit,symphonies,stabilization,worsened,fukuoka,decrees,enthusiast,seychelles,blogger,louvre,dignitaries,burundi,wreckage,signage,pinyin,bursts,federer,polarization,urbana,lazio,schism,nietzsche,venerable,administers,seton,kilograms,invariably,kathmandu,farmed,disqualification,earldom,appropriated,fluctuations,kermanshah,deployments,deformation,wheelbase,maratha,psalm,bytes,methyl,engravings,skirmish,fayette,vaccines,ideally,astrology,breweries,botanic,opposes,harmonies,irregularities,contended,gaulle,prowess,constants,aground,filipinos,fresco,ochreous,jaipur,willamette,quercus,eastwards,mortars,champaign,braille,reforming,horned,hunan,spacious,agitation,draught,specialties,flourishing,greensboro,necessitated,swedes,elemental,whorls,hugely,structurally,plurality,synthesizers,embassies,assad,contradictory,inference,discontent,recreated,inspectors,unicef,commuters,embryo,modifying,stints,numerals,communicated,boosted,trumpeter,brightly,adherence,remade,leases,restrained,eucalyptus,dwellers,planar,grooves,gainesville,daimler,anzac,szczecin,cornerback,prized,peking,mauritania,khalifa,motorized,lodging,instrumentalist,fortresses,cervical,formula_15,passerine,sectarian,researches,apprenticed,reliefs,disclose,gliding,repairing,queue,kyushu,literate,canoeing,sacrament,separatist,calabria,parkland,flowed,investigates,statistically,visionary,commits,dragoons,scrolls,premieres,revisited,subdued,censored,patterned,elective,outlawed,orphaned,leyland,richly,fujian,miniatures,heresy,plaques,countered,nonfiction,exponent,moravia,dispersion,marylebone,midwestern,enclave,ithaca,federated,electronically,handheld,microscopy,tolls,arrivals,climbers,continual,cossacks,moselle,deserts,ubiquitous,gables,forecasts,deforestation,vertebrates,flanking,drilled,superstructure,inspected,consultative,bypassed,ballast,subsidy,socioeconomic,relic,grenada,journalistic,administering,accommodated,collapses,appropriation,reclassified,foreword,porte,assimilated,observance,fragmented,arundel,thuringia,gonzaga,shenzhen,shipyards,sectional,ayrshire,sloping,dependencies,promenade,ecuadorian,mangrove,constructs,goalscorer,heroism,iteration,transistor,omnibus,hampstead,cochin,overshadowed,chieftain,scalar,finishers,ghanaian,abnormalities,monoplane,encyclopaedia,characterize,travancore,baronetage,bearers,biking,distributes,paving,christened,inspections,banco,humber,corinth,quadratic,albanians,lineages,majored,roadside,inaccessible,inclination,darmstadt,fianna,epilepsy,propellers,papacy,montagu,bhutto,sugarcane,optimized,pilasters,contend,batsmen,brabant,housemates,sligo,ascot,aquinas,supervisory,accorded,gerais,echoed,nunavut,conservatoire,carniola,quartermaster,gminas,impeachment,aquitaine,reformers,quarterfinal,karlsruhe,accelerator,coeducational,archduke,gelechiidae,seaplane,dissident,frenchman,palau,depots,hardcover,aachen,darreh,denominational,groningen,parcels,reluctance,drafts,elliptic,counters,decreed,airship,devotional,contradiction,formula_16,undergraduates,qualitative,guatemalan,slavs,southland,blackhawks,detrimental,abolish,chechen,manifestations,arthritis,perch,fated,hebei,peshawar,palin,immensely,havre,totalling,rampant,ferns,concourse,triples,elites,olympian,larva,herds,lipid,karabakh,distal,monotypic,vojvodina,batavia,multiplied,spacing,spellings,pedestrians,parchment,glossy,industrialization,dehydrogenase,patriotism,abolitionist,mentoring,elizabethan,figurative,dysfunction,abyss,constantin,middletown,stigma,mondays,gambia,gaius,israelites,renounced,nepalese,overcoming,buren,sulphur,divergence,predation,looting,iberia,futuristic,shelved,anthropological,innsbruck,escalated,clermont,entrepreneurial,benchmark,mechanically,detachments,populist,apocalyptic,exited,embryonic,stanza,readership,chiba,landlords,expansive,boniface,therapies,perpetrators,whitehall,kassel,masts,carriageway,clinch,pathogens,mazandaran,undesirable,teutonic,miocene,nagpur,juris,cantata,compile,diffuse,dynastic,reopening,comptroller,o'neal,flourish,electing,scientifically,departs,welded,modal,cosmology,fukushima,libertadores,chang'an,asean,generalization,localization,afrikaans,cricketers,accompanies,emigrants,esoteric,southwards,shutdown,prequel,fittings,innate,wrongly,equitable,dictionaries,senatorial,bipolar,flashbacks,semitism,walkway,lyrically,legality,sorbonne,vigorously,durga,samoan,karel,interchanges,patna,decider,registering,electrodes,anarchists,excursion,overthrown,gilan,recited,michelangelo,advertiser,kinship,taboo,cessation,formula_17,premiers,traversed,madurai,poorest,torneo,exerted,replicate,spelt,sporadically,horde,landscaping,razed,hindered,esperanto,manchuria,propellant,jalan,baha'is,sikkim,linguists,pandit,racially,ligands,dowry,francophone,escarpment,behest,magdeburg,mainstay,villiers,yangtze,grupo,conspirators,martyrdom,noticeably,lexical,kazakh,unrestricted,utilised,sired,inhabits,proofs,joseon,pliny,minted,buddhists,cultivate,interconnected,reuse,viability,australasian,derelict,resolving,overlooks,menon,stewardship,playwrights,thwarted,filmfare,disarmament,protections,bundles,sidelined,hypothesized,singer/songwriter,forage,netted,chancery,townshend,restructured,quotation,hyperbolic,succumbed,parliaments,shenandoah,apical,kibbutz,storeys,pastors,lettering,ukrainians,hardships,chihuahua,avail,aisles,taluka,antisemitism,assent,ventured,banksia,seamen,hospice,faroe,fearful,woreda,outfield,chlorine,transformer,tatar,panoramic,pendulum,haarlem,styria,cornice,importing,catalyzes,subunits,enamel,bakersfield,realignment,sorties,subordinates,deanery,townland,gunmen,tutelage,evaluations,allahabad,thrace,veneto,mennonite,sharia,subgenus,satisfies,puritan,unequal,gastrointestinal,ordinances,bacterium,horticulture,argonauts,adjectives,arable,duets,visualization,woolwich,revamped,euroleague,thorax,completes,originality,vasco,freighter,sardar,oratory,sects,extremes,signatories,exporting,arisen,exacerbated,departures,saipan,furlongs,d'italia,goring,dakar,conquests,docked,offshoot,okrug,referencing,disperse,netting,summed,rewritten,articulation,humanoid,spindle,competitiveness,preventive,facades,westinghouse,wycombe,synthase,emulate,fostering,abdel,hexagonal,myriad,caters,arjun,dismay,axiom,psychotherapy,colloquial,complemented,martinique,fractures,culmination,erstwhile,atrium,electronica,anarchism,nadal,montpellier,algebras,submitting,adopts,stemmed,overcame,internacional,asymmetric,gallipoli,gliders,flushing,extermination,hartlepool,tesla,interwar,patriarchal,hitherto,ganges,combatant,marred,philology,glastonbury,reversible,isthmus,undermined,southwark,gateshead,andalusia,remedies,hastily,optimum,smartphone,evade,patrolled,beheaded,dopamine,waivers,ugandan,gujarati,densities,predicting,intestinal,tentative,interstellar,kolonia,soloists,penetrated,rebellions,qeshlaq,prospered,colegio,deficits,konigsberg,deficient,accessing,relays,kurds,politburo,codified,incarnations,occupancy,cossack,metaphysical,deprivation,chopra,piccadilly,formula_18,makeshift,protestantism,alaskan,frontiers,faiths,tendon,dunkirk,durability,autobots,bonuses,coinciding,emails,gunboat,stucco,magma,neutrons,vizier,subscriptions,visuals,envisaged,carpets,smoky,schema,parliamentarian,immersed,domesticated,parishioners,flinders,diminutive,mahabharata,ballarat,falmouth,vacancies,gilded,twigs,mastering,clerics,dalmatia,islington,slogans,compressor,iconography,congolese,sanction,blends,bulgarians,moderator,outflow,textures,safeguard,trafalgar,tramways,skopje,colonialism,chimneys,jazeera,organisers,denoting,motivations,ganga,longstanding,deficiencies,gwynedd,palladium,holistic,fascia,preachers,embargo,sidings,busan,ignited,artificially,clearwater,cemented,northerly,salim,equivalents,crustaceans,oberliga,quadrangle,historiography,romanians,vaults,fiercely,incidental,peacetime,tonal,bhopal,oskar,radha,pesticides,timeslot,westerly,cathedrals,roadways,aldershot,connectors,brahmins,paler,aqueous,gustave,chromatic,linkage,lothian,specialises,aggregation,tributes,insurgent,enact,hampden,ghulam,federations,instigated,lyceum,fredrik,chairmanship,floated,consequent,antagonists,intimidation,patriarchate,warbler,heraldry,entrenched,expectancy,habitation,partitions,widest,launchers,nascent,ethos,wurzburg,lycee,chittagong,mahatma,merseyside,asteroids,yokosuka,cooperatives,quorum,redistricting,bureaucratic,yachts,deploying,rustic,phonology,chorale,cellist,stochastic,crucifixion,surmounted,confucian,portfolios,geothermal,crested,calibre,tropics,deferred,nasir,iqbal,persistence,essayist,chengdu,aborigines,fayetteville,bastion,interchangeable,burlesque,kilmarnock,specificity,tankers,colonels,fijian,quotations,enquiry,quito,palmerston,delle,multidisciplinary,polynesian,iodine,antennae,emphasised,manganese,baptists,galilee,jutland,latent,excursions,skepticism,tectonic,precursors,negligible,musique,misuse,vitoria,expressly,veneration,sulawesi,footed,mubarak,chongqing,chemically,midday,ravaged,facets,varma,yeovil,ethnographic,discounted,physicists,attache,disbanding,essen,shogunate,cooperated,waikato,realising,motherwell,pharmacology,sulfide,inward,expatriate,devoid,cultivar,monde,andean,groupings,goran,unaffected,moldovan,postdoctoral,coleophora,delegated,pronoun,conductivity,coleridge,disapproval,reappeared,microbial,campground,olsztyn,fostered,vaccination,rabbinical,champlain,milestones,viewership,caterpillar,effected,eupithecia,financier,inferred,uzbek,bundled,bandar,balochistan,mysticism,biosphere,holotype,symbolizes,lovecraft,photons,abkhazia,swaziland,subgroups,measurable,falkirk,valparaiso,ashok,discriminatory,rarity,tabernacle,flyweight,jalisco,westernmost,antiquarian,extracellular,margrave,colspan=9,midsummer,digestive,reversing,burgeoning,substitutes,medallist,khrushchev,guerre,folio,detonated,partido,plentiful,aggregator,medallion,infiltration,shaded,santander,fared,auctioned,permian,ramakrishna,andorra,mentors,diffraction,bukit,potentials,translucent,feminists,tiers,protracted,coburg,wreath,guelph,adventurer,he/she,vertebrate,pipelines,celsius,outbreaks,australasia,deccan,garibaldi,unionists,buildup,biochemical,reconstruct,boulders,stringent,barbed,wording,furnaces,pests,befriends,organises,popes,rizal,tentacles,cadre,tallahassee,punishments,occidental,formatted,mitigation,rulings,rubens,cascades,inducing,choctaw,volta,synagogues,movable,altarpiece,mitigate,practise,intermittently,encountering,memberships,earns,signify,retractable,amounting,pragmatic,wilfrid,dissenting,divergent,kanji,reconstituted,devonian,constitutions,levied,hendrik,starch,costal,honduran,ditches,polygon,eindhoven,superstars,salient,argus,punitive,purana,alluvial,flaps,inefficient,retracted,advantageous,quang,andersson,danville,binghamton,symbolize,conclave,shaanxi,silica,interpersonal,adept,frans,pavilions,lubbock,equip,sunken,limburg,activates,prosecutions,corinthian,venerated,shootings,retreats,parapet,orissa,riviere,animations,parodied,offline,metaphysics,bluffs,plume,piety,fruition,subsidized,steeplechase,shanxi,eurasia,angled,forecasting,suffragan,ashram,larval,labyrinth,chronicler,summaries,trailed,merges,thunderstorms,filtered,formula_19,advertisers,alpes,informatics,parti,constituting,undisputed,certifications,javascript,molten,sclerosis,rumoured,boulogne,hmong,lewes,breslau,notts,bantu,ducal,messengers,radars,nightclubs,bantamweight,carnatic,kaunas,fraternal,triggering,controversially,londonderry,visas,scarcity,offaly,uprisings,repelled,corinthians,pretext,kuomintang,kielce,empties,matriculated,pneumatic,expos,agile,treatises,midpoint,prehistory,oncology,subsets,hydra,hypertension,axioms,wabash,reiterated,swapped,achieves,premio,ageing,overture,curricula,challengers,subic,selangor,liners,frontline,shutter,validated,normalized,entertainers,molluscs,maharaj,allegation,youngstown,synth,thoroughfare,regionally,pillai,transcontinental,pedagogical,riemann,colonia,easternmost,tentatively,profiled,herefordshire,nativity,meuse,nucleotide,inhibits,huntingdon,throughput,recorders,conceding,domed,homeowners,centric,gabled,canoes,fringes,breeder,subtitled,fluoride,haplogroup,zionism,izmir,phylogeny,kharkiv,romanticism,adhesion,usaaf,delegations,lorestan,whalers,biathlon,vaulted,mathematically,pesos,skirmishes,heisman,kalamazoo,gesellschaft,launceston,interacts,quadruple,kowloon,psychoanalysis,toothed,ideologies,navigational,valence,induces,lesotho,frieze,rigging,undercarriage,explorations,spoof,eucharist,profitability,virtuoso,recitals,subterranean,sizeable,herodotus,subscriber,huxley,pivot,forewing,warring,boleslaw,bharatiya,suffixes,trois,percussionist,downturn,garrisons,philosophies,chants,mersin,mentored,dramatist,guilds,frameworks,thermodynamic,venomous,mehmed,assembling,rabbinic,hegemony,replicas,enlargement,claimant,retitled,utica,dumfries,metis,deter,assortment,tubing,afflicted,weavers,rupture,ornamentation,transept,salvaged,upkeep,callsign,rajput,stevenage,trimmed,intracellular,synchronization,consular,unfavorable,royalists,goldwyn,fasting,hussars,doppler,obscurity,currencies,amiens,acorn,tagore,townsville,gaussian,migrations,porta,anjou,graphite,seaport,monographs,gladiators,metrics,calligraphy,sculptural,swietokrzyskie,tolombeh,eredivisie,shoals,queries,carts,exempted,fiberglass,mirrored,bazar,progeny,formalized,mukherjee,professed,amazon.com,cathode,moreton,removable,mountaineers,nagano,transplantation,augustinian,steeply,epilogue,adapter,decisively,accelerating,mediaeval,substituting,tasman,devonshire,litres,enhancements,himmler,nephews,bypassing,imperfect,argentinian,reims,integrates,sochi,ascii,licences,niches,surgeries,fables,versatility,indra,footpath,afonso,crore,evaporation,encodes,shelling,conformity,simplify,updating,quotient,overt,firmware,umpires,architectures,eocene,conservatism,secretion,embroidery,f.c..,tuvalu,mosaics,shipwreck,prefectural,cohort,grievances,garnering,centerpiece,apoptosis,djibouti,bethesda,formula_20,shonen,richland,justinian,dormitories,meteorite,reliably,obtains,pedagogy,hardness,cupola,manifolds,amplification,steamers,familial,dumbarton,jerzy,genital,maidstone,salinity,grumman,signifies,presbytery,meteorology,procured,aegis,streamed,deletion,nuestra,mountaineering,accords,neuronal,khanate,grenoble,axles,dispatches,tokens,turku,auctions,propositions,planters,proclaiming,recommissioned,stravinsky,obverse,bombarded,waged,saviour,massacred,reformist,purportedly,resettlement,ravenna,embroiled,minden,revitalization,hikers,bridging,torpedoed,depletion,nizam,affectionately,latitudes,lubeck,spore,polymerase,aarhus,nazism,101st,buyout,galerie,diets,overflow,motivational,renown,brevet,deriving,melee,goddesses,demolish,amplified,tamworth,retake,brokerage,beneficiaries,henceforth,reorganised,silhouette,browsers,pollutants,peron,lichfield,encircled,defends,bulge,dubbing,flamenco,coimbatore,refinement,enshrined,grizzlies,capacitor,usefulness,evansville,interscholastic,rhodesian,bulletins,diamondbacks,rockers,platted,medalists,formosa,transporter,slabs,guadeloupe,disparate,concertos,violins,regaining,mandible,untitled,agnostic,issuance,hamiltonian,brampton,srpska,homology,downgraded,florentine,epitaph,kanye,rallying,analysed,grandstand,infinitely,antitrust,plundered,modernity,colspan=3|total,amphitheatre,doric,motorists,yemeni,carnivorous,probabilities,prelate,struts,scrapping,bydgoszcz,pancreatic,signings,predicts,compendium,ombudsman,apertura,appoints,rebbe,stereotypical,valladolid,clustered,touted,plywood,inertial,kettering,curving,d'honneur,housewives,grenadier,vandals,barbarossa,necked,waltham,reputedly,jharkhand,cistercian,pursues,viscosity,organiser,cloister,islet,stardom,moorish,himachal,strives,scripps,staggered,blasts,westwards,millimeters,angolan,hubei,agility,admirals,mordellistena,coincides,platte,vehicular,cordillera,riffs,schoolteacher,canaan,acoustics,tinged,reinforcing,concentrates,daleks,monza,selectively,musik,polynesia,exporter,reviving,macclesfield,bunkers,ballets,manors,caudal,microbiology,primes,unbroken,outcry,flocks,pakhtunkhwa,abelian,toowoomba,luminous,mould,appraisal,leuven,experimentally,interoperability,hideout,perak,specifying,knighthood,vasily,excerpt,computerized,niels,networked,byzantium,reaffirmed,geographer,obscured,fraternities,mixtures,allusion,accra,lengthened,inquest,panhandle,pigments,revolts,bluetooth,conjugate,overtaken,foray,coils,breech,streaks,impressionist,mendelssohn,intermediary,panned,suggestive,nevis,upazila,rotunda,mersey,linnaeus,anecdotes,gorbachev,viennese,exhaustive,moldavia,arcades,irrespective,orator,diminishing,predictive,cohesion,polarized,montage,avian,alienation,conus,jaffna,urbanization,seawater,extremity,editorials,scrolling,dreyfus,traverses,topographic,gunboats,extratropical,normans,correspondents,recognises,millennia,filtration,ammonium,voicing,complied,prefixes,diplomas,figurines,weakly,gated,oscillator,lucerne,embroidered,outpatient,airframe,fractional,disobedience,quarterbacks,formula_21,shinto,chiapas,epistle,leakage,pacifist,avignon,penrith,renders,mantua,screenplays,gustaf,tesco,alphabetically,rations,discharges,headland,tapestry,manipur,boolean,mediator,ebenezer,subchannel,fable,bestselling,ateneo,trademarks,recurrence,dwarfs,britannica,signifying,vikram,mediate,condensation,censuses,verbandsgemeinde,cartesian,sprang,surat,britons,chelmsford,courtenay,statistic,retina,abortions,liabilities,closures,mississauga,skyscrapers,saginaw,compounded,aristocrat,msnbc,stavanger,septa,interpretive,hinder,visibly,seeding,shutouts,irregularly,quebecois,footbridge,hydroxide,implicitly,lieutenants,simplex,persuades,midshipman,heterogeneous,officiated,crackdown,lends,tartu,altars,fractions,dissidents,tapered,modernisation,scripting,blazon,aquaculture,thermodynamics,sistan,hasidic,bellator,pavia,propagated,theorized,bedouin,transnational,mekong,chronicled,declarations,kickstarter,quotas,runtime,duquesne,broadened,clarendon,brownsville,saturation,tatars,electorates,malayan,replicated,observable,amphitheater,endorsements,referral,allentown,mormons,pantomime,eliminates,typeface,allegorical,varna,conduction,evoke,interviewer,subordinated,uyghur,landscaped,conventionally,ascend,edifice,postulated,hanja,whitewater,embarking,musicologist,tagalog,frontage,paratroopers,hydrocarbons,transliterated,nicolae,viewpoints,surrealist,asheville,falklands,hacienda,glide,opting,zimbabwean,discal,mortgages,nicaraguan,yadav,ghosh,abstracted,castilian,compositional,cartilage,intergovernmental,forfeited,importation,rapping,artes,republika,narayana,condominium,frisian,bradman,duality,marche,extremist,phosphorylation,genomes,allusions,valencian,habeas,ironworks,multiplex,harpsichord,emigrate,alternated,breda,waffen,smartphones,familiarity,regionalliga,herbaceous,piping,dilapidated,carboniferous,xviii,critiques,carcinoma,sagar,chippewa,postmodern,neapolitan,excludes,notoriously,distillation,tungsten,richness,installments,monoxide,chand,privatisation,molded,maths,projectiles,luoyang,epirus,lemma,concentric,incline,erroneous,sideline,gazetted,leopards,fibres,renovate,corrugated,unilateral,repatriation,orchestration,saeed,rockingham,loughborough,formula_22,bandleader,appellation,openness,nanotechnology,massively,tonnage,dunfermline,exposes,moored,ridership,motte,eurobasket,majoring,feats,silla,laterally,playlist,downwards,methodologies,eastbourne,daimyo,cellulose,leyton,norwalk,oblong,hibernian,opaque,insular,allegory,camogie,inactivation,favoring,masterpieces,rinpoche,serotonin,portrayals,waverley,airliner,longford,minimalist,outsourcing,excise,meyrick,qasim,organisational,synaptic,farmington,gorges,scunthorpe,zoned,tohoku,librarians,davao,decor,theatrically,brentwood,pomona,acquires,planter,capacitors,synchronous,skateboarding,coatings,turbocharged,ephraim,capitulation,scoreboard,hebrides,ensues,cereals,ailing,counterpoint,duplication,antisemitic,clique,aichi,oppressive,transcendental,incursions,rename,renumbering,powys,vestry,bitterly,neurology,supplanted,affine,susceptibility,orbiter,activating,overlaps,ecoregion,raman,canoer,darfur,microorganisms,precipitated,protruding,torun,anthropologists,rennes,kangaroos,parliamentarians,edits,littoral,archived,begum,rensselaer,microphones,ypres,empower,etruscan,wisden,montfort,calibration,isomorphic,rioting,kingship,verbally,smyrna,cohesive,canyons,fredericksburg,rahul,relativistic,micropolitan,maroons,industrialized,henchmen,uplift,earthworks,mahdi,disparity,cultured,transliteration,spiny,fragmentary,extinguished,atypical,inventors,biosynthesis,heralded,curacao,anomalies,aeroplane,surya,mangalore,maastricht,ashkenazi,fusiliers,hangzhou,emitting,monmouthshire,schwarzenegger,ramayana,peptides,thiruvananthapuram,alkali,coimbra,budding,reasoned,epithelial,harbors,rudimentary,classically,parque,ealing,crusades,rotations,riparian,pygmy,inertia,revolted,microprocessor,calendars,solvents,kriegsmarine,accademia,cheshmeh,yoruba,ardabil,mitra,genomic,notables,propagate,narrates,univision,outposts,polio,birkenhead,urinary,crocodiles,pectoral,barrymore,deadliest,rupees,chaim,protons,comical,astrophysics,unifying,formula_23,vassals,cortical,audubon,pedals,tenders,resorted,geophysical,lenders,recognising,tackling,lanarkshire,doctrinal,annan,combating,guangxi,estimating,selectors,tribunals,chambered,inhabiting,exemptions,curtailed,abbasid,kandahar,boron,bissau,150th,codenamed,wearer,whorl,adhered,subversive,famer,smelting,inserting,mogadishu,zoologist,mosul,stumps,almanac,olympiacos,stamens,participatory,cults,honeycomb,geologists,dividend,recursive,skiers,reprint,pandemic,liber,percentages,adversely,stoppage,chieftains,tubingen,southerly,overcrowding,unorganized,hangars,fulfil,hails,cantilever,woodbridge,pinus,wiesbaden,fertilization,fluorescence,enhances,plenary,troublesome,episodic,thrissur,kickboxing,allele,staffing,garda,televisions,philatelic,spacetime,bullpen,oxides,leninist,enrolling,inventive,truro,compatriot,ruskin,normative,assay,gotha,murad,illawarra,gendarmerie,strasse,mazraeh,rebounded,fanfare,liaoning,rembrandt,iranians,emirate,governs,latency,waterfowl,chairmen,katowice,aristocrats,eclipsed,sentient,sonatas,interplay,sacking,decepticons,dynamical,arbitrarily,resonant,petar,velocities,alludes,wastes,prefectures,belleville,sensibility,salvadoran,consolidating,medicaid,trainees,vivekananda,molar,porous,upload,youngster,infused,doctorates,wuhan,annihilation,enthusiastically,gamespot,kanpur,accumulating,monorail,operetta,tiling,sapporo,finns,calvinist,hydrocarbon,sparrows,orienteering,cornelis,minster,vuelta,plebiscite,embraces,panchayats,focussed,remediation,brahman,olfactory,reestablished,uniqueness,northumbria,rwandan,predominately,abode,ghats,balances,californian,uptake,bruges,inert,westerns,reprints,cairn,yarra,resurfaced,audible,rossini,regensburg,italiana,fleshy,irrigated,alerts,yahya,varanasi,marginalized,expatriates,cantonment,normandie,sahitya,directives,rounder,hulls,fictionalized,constables,inserts,hipped,potosi,navies,biologists,canteen,husbandry,augment,fortnight,assamese,kampala,o'keefe,paleolithic,bluish,promontory,consecutively,striving,niall,reuniting,dipole,friendlies,disapproved,thrived,netflix,liberian,dielectric,medway,strategist,sankt,pickups,hitters,encode,rerouted,claimants,anglesey,partitioned,cavan,flutes,reared,repainted,armaments,bowed,thoracic,balliol,piero,chaplains,dehestan,sender,junkers,sindhi,sickle,dividends,metallurgy,honorific,berths,namco,springboard,resettled,gansu,copyrighted,criticizes,utopian,bendigo,ovarian,binomial,spaceflight,oratorio,proprietors,supergroup,duplicated,foreground,strongholds,revolved,optimize,layouts,westland,hurler,anthropomorphic,excelsior,merchandising,reeds,vetoed,cryptography,hollyoaks,monash,flooring,ionian,resilience,johnstown,resolves,lawmakers,alegre,wildcards,intolerance,subculture,selector,slums,formulate,bayonet,istvan,restitution,interchangeably,awakens,rostock,serpentine,oscillation,reichstag,phenotype,recessed,piotr,annotated,preparedness,consultations,clausura,preferential,euthanasia,genoese,outcrops,freemasonry,geometrical,genesee,islets,prometheus,panamanian,thunderbolt,terraced,stara,shipwrecks,futebol,faroese,sharqi,aldermen,zeitung,unify,formula_24,humanism,syntactic,earthen,blyth,taxed,rescinded,suleiman,cymru,dwindled,vitality,superieure,resupply,adolphe,ardennes,rajiv,profiling,olympique,gestation,interfaith,milosevic,tagline,funerary,druze,silvery,plough,shrubland,relaunch,disband,nunatak,minimizing,excessively,waned,attaching,luminosity,bugle,encampment,electrostatic,minesweeper,dubrovnik,rufous,greenock,hochschule,assyrians,extracting,malnutrition,priya,attainment,anhui,connotations,predicate,seabirds,deduced,pseudonyms,gopal,plovdiv,refineries,imitated,kwazulu,terracotta,tenets,discourses,brandeis,whigs,dominions,pulmonate,landslides,tutors,determinant,richelieu,farmstead,tubercles,technicolor,hegel,redundancy,greenpeace,shortening,mules,distilled,xxiii,fundamentalist,acrylic,outbuildings,lighted,corals,signaled,transistors,cavite,austerity,76ers,exposures,dionysius,outlining,commutative,permissible,knowledgeable,howrah,assemblage,inhibited,crewmen,mbit/s,pyramidal,aberdeenshire,bering,rotates,atheism,howitzer,saone,lancet,fermented,contradicted,materiel,ofsted,numeric,uniformity,josephus,nazarene,kuwaiti,noblemen,pediment,emergent,campaigner,akademi,murcia,perugia,gallen,allsvenskan,finned,cavities,matriculation,rosters,twickenham,signatory,propel,readable,contends,artisan,flamboyant,reggio,italo,fumbles,widescreen,rectangle,centimetres,collaborates,envoys,rijeka,phonological,thinly,refractive,civilisation,reductase,cognate,dalhousie,monticello,lighthouses,jitsu,luneburg,socialite,fermi,collectible,optioned,marquee,jokingly,architecturally,kabir,concubine,nationalisation,watercolor,wicklow,acharya,pooja,leibniz,rajendra,nationalized,stalemate,bloggers,glutamate,uplands,shivaji,carolingian,bucuresti,dasht,reappears,muscat,functionally,formulations,hinged,hainan,catechism,autosomal,incremental,asahi,coeur,diversification,multilateral,fewest,recombination,finisher,harrogate,hangul,feasts,photovoltaic,paget,liquidity,alluded,incubation,applauded,choruses,malagasy,hispanics,bequest,underparts,cassava,kazimierz,gastric,eradication,mowtowr,tyrosine,archbishopric,e9e9e9,unproductive,uxbridge,hydrolysis,harbours,officio,deterministic,devonport,kanagawa,breaches,freetown,rhinoceros,chandigarh,janos,sanatorium,liberator,inequalities,agonist,hydrophobic,constructors,nagorno,snowboarding,welcomes,subscribed,iloilo,resuming,catalysts,stallions,jawaharlal,harriers,definitively,roughriders,hertford,inhibiting,elgar,randomized,incumbents,episcopate,rainforests,yangon,improperly,kemal,interpreters,diverged,uttarakhand,umayyad,phnom,panathinaikos,shabbat,diode,jiangxi,forbidding,nozzle,artistry,licensee,processions,staffs,decimated,expressionism,shingle,palsy,ontology,mahayana,maribor,sunil,hostels,edwardian,jetty,freehold,overthrew,eukaryotic,schuylkill,rawalpindi,sheath,recessive,ferenc,mandibles,berlusconi,confessor,convergent,ababa,slugging,rentals,sephardic,equivalently,collagen,markov,dynamically,hailing,depressions,sprawling,fairgrounds,indistinguishable,plutarch,pressurized,banff,coldest,braunschweig,mackintosh,sociedad,wittgenstein,tromso,airbase,lecturers,subtitle,attaches,purified,contemplated,dreamworks,telephony,prophetic,rockland,aylesbury,biscay,coherence,aleksandar,judoka,pageants,theses,homelessness,luthor,sitcoms,hinterland,fifths,derwent,privateers,enigmatic,nationalistic,instructs,superimposed,conformation,tricycle,dusan,attributable,unbeknownst,laptops,etching,archbishops,ayatollah,cranial,gharbi,interprets,lackawanna,abingdon,saltwater,tories,lender,minaj,ancillary,ranching,pembrokeshire,topographical,plagiarism,murong,marque,chameleon,assertions,infiltrated,guildhall,reverence,schenectady,formula_25,kollam,notary,mexicana,initiates,abdication,basra,theorems,ionization,dismantling,eared,censors,budgetary,numeral,verlag,excommunicated,distinguishable,quarried,cagliari,hindustan,symbolizing,watertown,descartes,relayed,enclosures,militarily,sault,devolved,dalian,djokovic,filaments,staunton,tumour,curia,villainous,decentralized,galapagos,moncton,quartets,onscreen,necropolis,brasileiro,multipurpose,alamos,comarca,jorgen,concise,mercia,saitama,billiards,entomologist,montserrat,lindbergh,commuting,lethbridge,phoenician,deviations,anaerobic,denouncing,redoubt,fachhochschule,principalities,negros,announcers,seconded,parrots,konami,revivals,approving,devotee,riyadh,overtook,morecambe,lichen,expressionist,waterline,silverstone,geffen,sternites,aspiration,behavioural,grenville,tripura,mediums,genders,pyotr,charlottesville,sacraments,programmable,ps100,shackleton,garonne,sumerian,surpass,authorizing,interlocking,lagoons,voiceless,advert,steeple,boycotted,alouettes,yosef,oxidative,sassanid,benefiting,sayyid,nauru,predetermined,idealism,maxillary,polymerization,semesters,munchen,conor,outfitted,clapham,progenitor,gheorghe,observational,recognitions,numerically,colonized,hazrat,indore,contaminants,fatality,eradicate,assyria,convocation,cameos,skillful,skoda,corfu,confucius,overtly,ramadan,wollongong,placements,d.c..,permutation,contemporaneous,voltages,elegans,universitat,samar,plunder,dwindling,neuter,antonin,sinhala,campania,solidified,stanzas,fibrous,marburg,modernize,sorcery,deutscher,florets,thakur,disruptive,infielder,disintegration,internazionale,vicariate,effigy,tripartite,corrective,klamath,environs,leavenworth,sandhurst,workmen,compagnie,hoseynabad,strabo,palisades,ordovician,sigurd,grandsons,defection,viacom,sinhalese,innovator,uncontrolled,slavonic,indexes,refrigeration,aircrew,superbike,resumption,neustadt,confrontations,arras,hindenburg,ripon,embedding,isomorphism,dwarves,matchup,unison,lofty,argos,louth,constitutionally,transitive,newington,facelift,degeneration,perceptual,aviators,enclosing,igneous,symbolically,academician,constitutionality,iso/iec,sacrificial,maturation,apprentices,enzymology,naturalistic,hajji,arthropods,abbess,vistula,scuttled,gradients,pentathlon,etudes,freedmen,melaleuca,thrice,conductive,sackville,franciscans,stricter,golds,kites,worshiped,monsignor,trios,orally,tiered,primacy,bodywork,castleford,epidemics,alveolar,chapelle,chemists,hillsboro,soulful,warlords,ngati,huguenot,diurnal,remarking,luger,motorways,gauss,jahan,cutoff,proximal,bandai,catchphrase,jonubi,ossetia,codename,codice_2,throated,itinerant,chechnya,riverfront,leela,evoked,entailed,zamboanga,rejoining,circuitry,haymarket,khartoum,feuds,braced,miyazaki,mirren,lubusz,caricature,buttresses,attrition,characterizes,widnes,evanston,materialism,contradictions,marist,midrash,gainsborough,ulithi,turkmen,vidya,escuela,patrician,inspirations,reagent,premierships,humanistic,euphrates,transitioning,belfry,zedong,adaption,kaliningrad,lobos,epics,waiver,coniferous,polydor,inductee,refitted,moraine,unsatisfactory,worsening,polygamy,rajya,nested,subgenre,broadside,stampeders,lingua,incheon,pretender,peloton,persuading,excitation,multan,predates,tonne,brackish,autoimmune,insulated,podcasts,iraqis,bodybuilding,condominiums,midlothian,delft,debtor,asymmetrical,lycaenidae,forcefully,pathogenic,tamaulipas,andaman,intravenous,advancements,senegalese,chronologically,realigned,inquirer,eusebius,dekalb,additives,shortlist,goldwater,hindustani,auditing,caterpillars,pesticide,nakhon,ingestion,lansdowne,traditionalist,northland,thunderbirds,josip,nominating,locale,ventricular,animators,verandah,epistles,surveyors,anthems,dredd,upheaval,passaic,anatolian,svalbard,associative,floodplain,taranaki,estuaries,irreducible,beginners,hammerstein,allocate,coursework,secreted,counteract,handwritten,foundational,passover,discoverer,decoding,wares,bourgeoisie,playgrounds,nazionale,abbreviations,seanad,golan,mishra,godavari,rebranding,attendances,backstory,interrupts,lettered,hasbro,ultralight,hormozgan,armee,moderne,subdue,disuse,improvisational,enrolment,persists,moderated,carinthia,hatchback,inhibitory,capitalized,anatoly,abstracts,albemarle,bergamo,insolvency,sentai,cellars,walloon,joked,kashmiri,dirac,materialized,renomination,homologous,gusts,eighteens,centrifugal,storied,baluchestan,formula_26,poincare,vettel,infuriated,gauges,streetcars,vedanta,stately,liquidated,goguryeo,swifts,accountancy,levee,acadian,hydropower,eustace,comintern,allotment,designating,torsion,molding,irritation,aerobic,halen,concerted,plantings,garrisoned,gramophone,cytoplasm,onslaught,requisitioned,relieving,genitive,centrist,jeong,espanola,dissolving,chatterjee,sparking,connaught,varese,arjuna,carpathian,empowering,meteorologist,decathlon,opioid,hohenzollern,fenced,ibiza,avionics,footscray,scrum,discounts,filament,directories,a.f.c,stiffness,quaternary,adventurers,transmits,harmonious,taizong,radiating,germantown,ejection,projectors,gaseous,nahuatl,vidyalaya,nightlife,redefined,refuted,destitute,arista,potters,disseminated,distanced,jamboree,kaohsiung,tilted,lakeshore,grained,inflicting,kreis,novelists,descendents,mezzanine,recast,fatah,deregulation,ac/dc,australis,kohgiluyeh,boreal,goths,authoring,intoxicated,nonpartisan,theodosius,pyongyang,shree,boyhood,sanfl,plenipotentiary,photosynthesis,presidium,sinaloa,honshu,texan,avenida,transmembrane,malays,acropolis,catalunya,vases,inconsistencies,methodists,quell,suisse,banat,simcoe,cercle,zealanders,discredited,equine,sages,parthian,fascists,interpolation,classifying,spinoff,yehuda,cruised,gypsum,foaled,wallachia,saraswati,imperialist,seabed,footnotes,nakajima,locales,schoolmaster,drosophila,bridgehead,immanuel,courtier,bookseller,niccolo,stylistically,portmanteau,superleague,konkani,millimetres,arboreal,thanjavur,emulation,sounders,decompression,commoners,infusion,methodological,osage,rococo,anchoring,bayreuth,formula_27,abstracting,symbolized,bayonne,electrolyte,rowed,corvettes,traversing,editorship,sampler,presidio,curzon,adirondack,swahili,rearing,bladed,lemur,pashtun,behaviours,bottling,zaire,recognisable,systematics,leeward,formulae,subdistricts,smithfield,vijaya,buoyancy,boosting,cantonal,rishi,airflow,kamakura,adana,emblems,aquifer,clustering,husayn,woolly,wineries,montessori,turntable,exponentially,caverns,espoused,pianists,vorpommern,vicenza,latterly,o'rourke,williamstown,generale,kosice,duisburg,poirot,marshy,mismanagement,mandalay,dagenham,universes,chiral,radiated,stewards,vegan,crankshaft,kyrgyz,amphibian,cymbals,infrequently,offenbach,environmentalist,repatriated,permutations,midshipmen,loudoun,refereed,bamberg,ornamented,nitric,selim,translational,dorsum,annunciation,gippsland,reflector,informational,regia,reactionary,ahmet,weathering,erlewine,legalized,berne,occupant,divas,manifests,analyzes,disproportionate,mitochondria,totalitarian,paulista,interscope,anarcho,correlate,brookfield,elongate,brunel,ordinal,precincts,volatility,equaliser,hittite,somaliland,ticketing,monochrome,ubuntu,chhattisgarh,titleholder,ranches,referendums,blooms,accommodates,merthyr,religiously,ryukyu,tumultuous,checkpoints,anode,mi'kmaq,cannonball,punctuation,remodelled,assassinations,criminology,alternates,yonge,pixar,namibian,piraeus,trondelag,hautes,lifeboats,shoal,atelier,vehemently,sadat,postcode,jainism,lycoming,undisturbed,lutherans,genomics,popmatters,tabriz,isthmian,notched,autistic,horsham,mites,conseil,bloomsbury,seung,cybertron,idris,overhauled,disbandment,idealized,goldfields,worshippers,lobbyist,ailments,paganism,herbarium,athenians,messerschmitt,faraday,entangled,'olya,untreated,criticising,howitzers,parvati,lobed,debussy,atonement,tadeusz,permeability,mueang,sepals,degli,optionally,fuelled,follies,asterisk,pristina,lewiston,congested,overpass,affixed,pleads,telecasts,stanislaus,cryptographic,friesland,hamstring,selkirk,antisubmarine,inundated,overlay,aggregates,fleur,trolleybus,sagan,ibsen,inductees,beltway,tiled,ladders,cadbury,laplace,ascetic,micronesia,conveying,bellingham,cleft,batches,usaid,conjugation,macedon,assisi,reappointed,brine,jinnah,prairies,screenwriting,oxidized,despatches,linearly,fertilizers,brazilians,absorbs,wagga,modernised,scorsese,ashraf,charlestown,esque,habitable,nizhny,lettres,tuscaloosa,esplanade,coalitions,carbohydrates,legate,vermilion,standardised,galleria,psychoanalytic,rearrangement,substation,competency,nationalised,reshuffle,reconstructions,mehdi,bougainville,receivership,contraception,enlistment,conducive,aberystwyth,solicitors,dismisses,fibrosis,montclair,homeowner,surrealism,s.h.i.e.l.d,peregrine,compilers,1790s,parentage,palmas,rzeszow,worldview,eased,svenska,housemate,bundestag,originator,enlisting,outwards,reciprocity,formula_28,carbohydrate,democratically,firefighting,romagna,acknowledgement,khomeini,carbide,quests,vedas,characteristically,guwahati,brixton,unintended,brothels,parietal,namur,sherbrooke,moldavian,baruch,milieu,undulating,laurier,entre,dijon,ethylene,abilene,heracles,paralleling,ceres,dundalk,falun,auspicious,chisinau,polarity,foreclosure,templates,ojibwe,punic,eriksson,biden,bachchan,glaciation,spitfires,norsk,nonviolent,heidegger,algonquin,capacitance,cassettes,balconies,alleles,airdate,conveys,replays,classifies,infrequent,amine,cuttings,rarer,woking,olomouc,amritsar,rockabilly,illyrian,maoist,poignant,tempore,stalinist,segmented,bandmate,mollusc,muhammed,totalled,byrds,tendered,endogenous,kottayam,aisne,oxidase,overhears,illustrators,verve,commercialization,purplish,directv,moulded,lyttelton,baptismal,captors,saracens,georgios,shorten,polity,grids,fitzwilliam,sculls,impurities,confederations,akhtar,intangible,oscillations,parabolic,harlequin,maulana,ovate,tanzanian,singularity,confiscation,qazvin,speyer,phonemes,overgrown,vicarage,gurion,undocumented,niigata,thrones,preamble,stave,interment,liiga,ataturk,aphrodite,groupe,indentured,habsburgs,caption,utilitarian,ozark,slovenes,reproductions,plasticity,serbo,dulwich,castel,barbuda,salons,feuding,lenape,wikileaks,swamy,breuning,shedding,afield,superficially,operationally,lamented,okanagan,hamadan,accolade,furthering,adolphus,fyodor,abridged,cartoonists,pinkish,suharto,cytochrome,methylation,debit,colspan=9|,refine,taoist,signalled,herding,leaved,bayan,fatherland,rampart,sequenced,negation,storyteller,occupiers,barnabas,pelicans,nadir,conscripted,railcars,prerequisite,furthered,columba,carolinas,markup,gwalior,franche,chaco,eglinton,ramparts,rangoon,metabolites,pollination,croat,televisa,holyoke,testimonial,setlist,safavid,sendai,georgians,shakespearean,galleys,regenerative,krzysztof,overtones,estado,barbary,cherbourg,obispo,sayings,composites,sainsbury,deliberation,cosmological,mahalleh,embellished,ascap,biala,pancras,calumet,grands,canvases,antigens,marianas,defenseman,approximated,seedlings,soren,stele,nuncio,immunology,testimonies,glossary,recollections,suitability,tampere,venous,cohomology,methanol,echoing,ivanovich,warmly,sterilization,imran,multiplying,whitechapel,undersea,xuanzong,tacitus,bayesian,roundhouse,correlations,rioters,molds,fiorentina,bandmates,mezzo,thani,guerilla,200th,premiums,tamils,deepwater,chimpanzees,tribesmen,selwyn,globo,turnovers,punctuated,erode,nouvelle,banbury,exponents,abolishing,helical,maimonides,endothelial,goteborg,infield,encroachment,cottonwood,mazowiecki,parable,saarbrucken,reliever,epistemology,artistes,enrich,rationing,formula_29,palmyra,subfamilies,kauai,zoran,fieldwork,arousal,creditor,friuli,celts,comoros,equated,escalation,negev,tallied,inductive,anion,netanyahu,mesoamerican,lepidoptera,aspirated,remit,westmorland,italic,crosse,vaclav,fuego,owain,balmain,venetians,ethnicities,deflected,ticino,apulia,austere,flycatcher,reprising,repressive,hauptbahnhof,subtype,ophthalmology,summarizes,eniwetok,colonisation,subspace,nymphalidae,earmarked,tempe,burnet,crests,abbots,norwegians,enlarge,ashoka,frankfort,livorno,malware,renters,singly,iliad,moresby,rookies,gustavus,affirming,alleges,legume,chekhov,studded,abdicated,suzhou,isidore,townsite,repayment,quintus,yankovic,amorphous,constructor,narrowing,industrialists,tanganyika,capitalization,connective,mughals,rarities,aerodynamics,worthing,antalya,diagnostics,shaftesbury,thracian,obstetrics,benghazi,multiplier,orbitals,livonia,roscommon,intensify,ravel,oaths,overseer,locomotion,necessities,chickasaw,strathclyde,treviso,erfurt,aortic,contemplation,accrington,markazi,predeceased,hippocampus,whitecaps,assemblyman,incursion,ethnography,extraliga,reproducing,directorship,benzene,byway,stupa,taxable,scottsdale,onondaga,favourably,countermeasures,lithuanians,thatched,deflection,tarsus,consuls,annuity,paralleled,contextual,anglian,klang,hoisted,multilingual,enacting,samaj,taoiseach,carthaginian,apologised,hydrology,entrant,seamless,inflorescences,mugabe,westerners,seminaries,wintering,penzance,mitre,sergeants,unoccupied,delimitation,discriminate,upriver,abortive,nihon,bessarabia,calcareous,buffaloes,patil,daegu,streamline,berks,chaparral,laity,conceptions,typified,kiribati,threaded,mattel,eccentricity,signified,patagonia,slavonia,certifying,adnan,astley,sedition,minimally,enumerated,nikos,goalless,walid,narendra,causa,missoula,coolant,dalek,outcrop,hybridization,schoolchildren,peasantry,afghans,confucianism,shahr,gallic,tajik,kierkegaard,sauvignon,commissar,patriarchs,tuskegee,prussians,laois,ricans,talmudic,officiating,aesthetically,baloch,antiochus,separatists,suzerainty,arafat,shading,u.s.c,chancellors,inc..,toolkit,nepenthes,erebidae,solicited,pratap,kabbalah,alchemist,caltech,darjeeling,biopic,spillway,kaiserslautern,nijmegen,bolstered,neath,pahlavi,eugenics,bureaus,retook,northfield,instantaneous,deerfield,humankind,selectivity,putative,boarders,cornhuskers,marathas,raikkonen,aliabad,mangroves,garages,gulch,karzai,poitiers,chernobyl,thane,alexios,belgrano,scion,solubility,urbanized,executable,guizhou,nucleic,tripled,equalled,harare,houseguests,potency,ghazi,repeater,overarching,regrouped,broward,ragtime,d'art,nandi,regalia,campsites,mamluk,plating,wirral,presumption,zenit,archivist,emmerdale,decepticon,carabidae,kagoshima,franconia,guarani,formalism,diagonally,submarginal,denys,walkways,punts,metrolink,hydrographic,droplets,upperside,martyred,hummingbird,antebellum,curiously,mufti,friary,chabad,czechs,shaykh,reactivity,berklee,turbonilla,tongan,sultans,woodville,unlicensed,enmity,dominicans,operculum,quarrying,watercolour,catalyzed,gatwick,'what,mesozoic,auditors,shizuoka,footballing,haldane,telemundo,appended,deducted,disseminate,o'shea,pskov,abrasive,entente,gauteng,calicut,lemurs,elasticity,suffused,scopula,staining,upholding,excesses,shostakovich,loanwords,naidu,championnat,chromatography,boasting,goaltenders,engulfed,salah,kilogram,morristown,shingles,shi'a,labourer,renditions,frantisek,jekyll,zonal,nanda,sheriffs,eigenvalues,divisione,endorsing,ushered,auvergne,cadres,repentance,freemasons,utilising,laureates,diocletian,semiconductors,o'grady,vladivostok,sarkozy,trackage,masculinity,hydroxyl,mervyn,muskets,speculations,gridiron,opportunistic,mascots,aleutian,fillies,sewerage,excommunication,borrowers,capillary,trending,sydenham,synthpop,rajah,cagayan,deportes,kedah,faure,extremism,michoacan,levski,culminates,occitan,bioinformatics,unknowingly,inciting,emulated,footpaths,piacenza,dreadnought,viceroyalty,oceanographic,scouted,combinatorial,ornithologist,cannibalism,mujahideen,independiente,cilicia,hindwing,minimized,odeon,gyorgy,rubles,purchaser,collieries,kickers,interurban,coiled,lynchburg,respondent,plzen,detractors,etchings,centering,intensification,tomography,ranjit,warblers,retelling,reinstatement,cauchy,modulus,redirected,evaluates,beginner,kalateh,perforated,manoeuvre,scrimmage,internships,megawatts,mottled,haakon,tunbridge,kalyan,summarised,sukarno,quetta,canonized,henryk,agglomeration,coahuila,diluted,chiropractic,yogyakarta,talladega,sheik,cation,halting,reprisals,sulfuric,musharraf,sympathizers,publicised,arles,lectionary,fracturing,startups,sangha,latrobe,rideau,ligaments,blockading,cremona,lichens,fabaceae,modulated,evocative,embodies,battersea,indistinct,altai,subsystem,acidity,somatic,formula_30,tariq,rationality,sortie,ashlar,pokal,cytoplasmic,valour,bangla,displacing,hijacking,spectrometry,westmeath,weill,charing,goias,revolvers,individualized,tenured,nawaz,piquet,chanted,discard,bernd,phalanx,reworking,unilaterally,subclass,yitzhak,piloting,circumvent,disregarded,semicircular,viscous,tibetans,endeavours,retaliated,cretan,vienne,workhouse,sufficiency,aurangzeb,legalization,lipids,expanse,eintracht,sanjak,megas,125th,bahraini,yakima,eukaryotes,thwart,affirmation,peloponnese,retailing,carbonyl,chairwoman,macedonians,dentate,rockaway,correctness,wealthier,metamorphic,aragonese,fermanagh,pituitary,schrodinger,evokes,spoiler,chariots,akita,genitalia,combe,confectionery,desegregation,experiential,commodores,persepolis,viejo,restorations,virtualization,hispania,printmaking,stipend,yisrael,theravada,expended,radium,tweeted,polygonal,lippe,charente,leveraged,cutaneous,fallacy,fragrant,bypasses,elaborately,rigidity,majid,majorca,kongo,plasmodium,skits,audiovisual,eerste,staircases,prompts,coulthard,northwestward,riverdale,beatrix,copyrights,prudential,communicates,mated,obscenity,asynchronous,analyse,hansa,searchlight,farnborough,patras,asquith,qarah,contours,fumbled,pasteur,redistributed,almeria,sanctuaries,jewry,israelite,clinicians,koblenz,bookshop,affective,goulburn,panelist,sikorsky,cobham,mimics,ringed,portraiture,probabilistic,girolamo,intelligible,andalusian,jalal,athenaeum,eritrean,auxiliaries,pittsburg,devolution,sangam,isolating,anglers,cronulla,annihilated,kidderminster,synthesize,popularised,theophilus,bandstand,innumerable,chagrin,retroactively,weser,multiples,birdlife,goryeo,pawnee,grosser,grappling,tactile,ahmadinejad,turboprop,erdogan,matchday,proletarian,adhering,complements,austronesian,adverts,luminaries,archeology,impressionism,conifer,sodomy,interracial,platoons,lessen,postings,pejorative,registrations,cookery,persecutions,microbes,audits,idiosyncratic,subsp,suspensions,restricts,colouring,ratify,instrumentals,nucleotides,sulla,posits,bibliotheque,diameters,oceanography,instigation,subsumed,submachine,acceptor,legation,borrows,sedge,discriminated,loaves,insurers,highgate,detectable,abandons,kilns,sportscaster,harwich,iterations,preakness,arduous,tensile,prabhu,shortwave,philologist,shareholding,vegetative,complexities,councilors,distinctively,revitalize,automaton,amassing,montreux,khanh,surabaya,nurnberg,pernambuco,cuisines,charterhouse,firsts,tercera,inhabitant,homophobia,naturalism,einar,powerplant,coruna,entertainments,whedon,rajputs,raton,democracies,arunachal,oeuvre,wallonia,jeddah,trolleybuses,evangelism,vosges,kiowa,minimise,encirclement,undertakes,emigrant,beacons,deepened,grammars,publius,preeminent,seyyed,repechage,crafting,headingley,osteopathic,lithography,hotly,bligh,inshore,betrothed,olympians,formula_31,dissociation,trivandrum,arran,petrovic,stettin,disembarked,simplification,bronzes,philo,acrobatic,jonsson,conjectured,supercharged,kanto,detects,cheeses,correlates,harmonics,lifecycle,sudamericana,reservists,decayed,elitserien,parametric,113th,dusky,hogarth,modulo,symbiotic,monopolies,discontinuation,converges,southerners,tucuman,eclipses,enclaves,emits,famicom,caricatures,artistically,levelled,mussels,erecting,mouthparts,cunard,octaves,crucible,guardia,unusable,lagrangian,droughts,ephemeral,pashto,canis,tapering,sasebo,silurian,metallurgical,outscored,evolves,reissues,sedentary,homotopy,greyhawk,reagents,inheriting,onshore,tilting,rebuffed,reusable,naturalists,basingstoke,insofar,offensives,dravidian,curators,planks,rajan,isoforms,flagstaff,preside,globular,egalitarian,linkages,biographers,goalscorers,molybdenum,centralised,nordland,jurists,ellesmere,rosberg,hideyoshi,restructure,biases,borrower,scathing,redress,tunnelling,workflow,magnates,mahendra,dissenters,plethora,transcriptions,handicrafts,keyword,xi'an,petrograd,unser,prokofiev,90deg,madan,bataan,maronite,kearny,carmarthen,termini,consulates,disallowed,rockville,bowery,fanzine,docklands,bests,prohibitions,yeltsin,selassie,naturalization,realisation,dispensary,tribeca,abdulaziz,pocahontas,stagnation,pamplona,cuneiform,propagating,subsurface,christgau,epithelium,schwerin,lynching,routledge,hanseatic,upanishad,glebe,yugoslavian,complicity,endowments,girona,mynetworktv,entomology,plinth,ba'ath,supercup,torus,akkadian,salted,englewood,commandery,belgaum,prefixed,colorless,dartford,enthroned,caesarea,nominative,sandown,safeguards,hulled,formula_32,leamington,dieppe,spearhead,generalizations,demarcation,llanelli,masque,brickwork,recounting,sufism,strikingly,petrochemical,onslow,monologues,emigrating,anderlecht,sturt,hossein,sakhalin,subduction,novices,deptford,zanjan,airstrikes,coalfield,reintroduction,timbaland,hornby,messianic,stinging,universalist,situational,radiocarbon,strongman,rowling,saloons,traffickers,overran,fribourg,cambrai,gravesend,discretionary,finitely,archetype,assessor,pilipinas,exhumed,invocation,interacted,digitized,timisoara,smelter,teton,sexism,precepts,srinagar,pilsudski,carmelite,hanau,scoreline,hernando,trekking,blogging,fanbase,wielded,vesicles,nationalization,banja,rafts,motoring,luang,takeda,girder,stimulates,histone,sunda,nanoparticles,attains,jumpers,catalogued,alluding,pontus,ancients,examiners,shinkansen,ribbentrop,reimbursement,pharmacological,ramat,stringed,imposes,cheaply,transplanted,taiping,mizoram,looms,wallabies,sideman,kootenay,encased,sportsnet,revolutionized,tangier,benthic,runic,pakistanis,heatseekers,shyam,mishnah,presbyterians,stadt,sutras,straddles,zoroastrian,infer,fueling,gymnasts,ofcom,gunfight,journeyman,tracklist,oshawa,ps500,pa'in,mackinac,xiongnu,mississippian,breckinridge,freemason,bight,autoroute,liberalization,distantly,thrillers,solomons,presumptive,romanization,anecdotal,bohemians,unpaved,milder,concurred,spinners,alphabets,strenuous,rivieres,kerrang,mistreatment,dismounted,intensively,carlist,dancehall,shunting,pluralism,trafficked,brokered,bonaventure,bromide,neckar,designates,malian,reverses,sotheby,sorghum,serine,environmentalists,languedoc,consulship,metering,bankstown,handlers,militiamen,conforming,regularity,pondicherry,armin,capsized,consejo,capitalists,drogheda,granular,purged,acadians,endocrine,intramural,elicit,terns,orientations,miklos,omitting,apocryphal,slapstick,brecon,pliocene,affords,typography,emigre,tsarist,tomasz,beset,nishi,necessitating,encyclical,roleplaying,journeyed,inflow,sprints,progressives,novosibirsk,cameroonian,ephesus,speckled,kinshasa,freiherr,burnaby,dalmatian,torrential,rigor,renegades,bhakti,nurburgring,cosimo,convincingly,reverting,visayas,lewisham,charlottetown,charadriiformesfamily,transferable,jodhpur,converters,deepening,camshaft,underdeveloped,protease,polonia,uterine,quantify,tobruk,dealerships,narasimha,fortran,inactivity,1780s,victors,categorised,naxos,workstation,skink,sardinian,chalice,precede,dammed,sondheim,phineas,tutored,sourcing,uncompromising,placer,tyneside,courtiers,proclaims,pharmacies,hyogo,booksellers,sengoku,kursk,spectrometer,countywide,wielkopolski,bobsleigh,shetty,llywelyn,consistory,heretics,guinean,cliches,individualism,monolithic,imams,usability,bursa,deliberations,railings,torchwood,inconsistency,balearic,stabilizer,demonstrator,facet,radioactivity,outboard,educates,d'oyly,heretical,handover,jurisdictional,shockwave,hispaniola,conceptually,routers,unaffiliated,trentino,formula_33,cypriots,intervenes,neuchatel,formulating,maggiore,delisted,alcohols,thessaly,potable,estimator,suborder,fluency,mimicry,clergymen,infrastructures,rivals.com,baroda,subplot,majlis,plano,clinching,connotation,carinae,savile,intercultural,transcriptional,sandstones,ailerons,annotations,impresario,heinkel,scriptural,intermodal,astrological,ribbed,northeastward,posited,boers,utilise,kalmar,phylum,breakwater,skype,textured,guideline,azeri,rimini,massed,subsidence,anomalous,wolfsburg,polyphonic,accrediting,vodacom,kirov,captaining,kelantan,logie,fervent,eamon,taper,bundeswehr,disproportionately,divination,slobodan,pundits,hispano,kinetics,reunites,makati,ceasing,statistician,amending,chiltern,eparchy,riverine,melanoma,narragansett,pagans,raged,toppled,breaching,zadar,holby,dacian,ochre,velodrome,disparities,amphoe,sedans,webpage,williamsport,lachlan,groton,baring,swastika,heliport,unwillingness,razorbacks,exhibitors,foodstuffs,impacting,tithe,appendages,dermot,subtypes,nurseries,balinese,simulating,stary,remakes,mundi,chautauqua,geologically,stockade,hakka,dilute,kalimantan,pahang,overlapped,fredericton,baha'u'llah,jahangir,damping,benefactors,shomali,triumphal,cieszyn,paradigms,shielded,reggaeton,maharishi,zambian,shearing,golestan,mirroring,partitioning,flyover,songbook,incandescent,merrimack,huguenots,sangeet,vulnerabilities,trademarked,drydock,tantric,honoris,queenstown,labelling,iterative,enlists,statesmen,anglicans,herge,qinghai,burgundian,islami,delineated,zhuge,aggregated,banknote,qatari,suitably,tapestries,asymptotic,charleroi,majorities,pyramidellidae,leanings,climactic,tahir,ramsar,suppressor,revisionist,trawler,ernakulam,penicillium,categorization,slits,entitlement,collegium,earths,benefice,pinochet,puritans,loudspeaker,stockhausen,eurocup,roskilde,alois,jaroslav,rhondda,boutiques,vigor,neurotransmitter,ansar,malden,ferdinando,sported,relented,intercession,camberwell,wettest,thunderbolts,positional,oriel,cloverleaf,penalized,shoshone,rajkumar,completeness,sharjah,chromosomal,belgians,woolen,ultrasonic,sequentially,boleyn,mordella,microsystems,initiator,elachista,mineralogy,rhododendron,integrals,compostela,hamza,sawmills,stadio,berlioz,maidens,stonework,yachting,tappeh,myocardial,laborer,workstations,costumed,nicaea,lanark,roundtable,mashhad,nablus,algonquian,stuyvesant,sarkar,heroines,diwan,laments,intonation,intrigues,almaty,feuded,grandes,algarve,rehabilitate,macrophages,cruciate,dismayed,heuristic,eliezer,kozhikode,covalent,finalised,dimorphism,yaroslavl,overtaking,leverkusen,middlebury,feeders,brookings,speculates,insoluble,lodgings,jozsef,cysteine,shenyang,habilitation,spurious,brainchild,mtdna,comique,albedo,recife,partick,broadening,shahi,orientated,himalaya,swabia,palme,mennonites,spokeswoman,conscripts,sepulchre,chartres,eurozone,scaffold,invertebrate,parishad,bagan,heian,watercolors,basse,supercomputer,commences,tarragona,plainfield,arthurian,functor,identically,murex,chronicling,pressings,burrowing,histoire,guayaquil,goalkeeping,differentiable,warburg,machining,aeneas,kanawha,holocene,ramesses,reprisal,qingdao,avatars,turkestan,cantatas,besieging,repudiated,teamsters,equipping,hydride,ahmadiyya,euston,bottleneck,computations,terengganu,kalinga,stela,rediscovery,'this,azhar,stylised,karelia,polyethylene,kansai,motorised,lounges,normalization,calculators,1700s,goalkeepers,unfolded,commissary,cubism,vignettes,multiverse,heaters,briton,sparingly,childcare,thorium,plock,riksdag,eunuchs,catalysis,limassol,perce,uncensored,whitlam,ulmus,unites,mesopotamian,refraction,biodiesel,forza,fulda,unseated,mountbatten,shahrak,selenium,osijek,mimicking,antimicrobial,axons,simulcasting,donizetti,swabian,sportsmen,hafiz,neared,heraclius,locates,evaded,subcarpathian,bhubaneswar,negeri,jagannath,thaksin,aydin,oromo,lateran,goldsmiths,multiculturalism,cilia,mihai,evangelists,lorient,qajar,polygons,vinod,mechanised,anglophone,prefabricated,mosses,supervillain,airliners,biofuels,iodide,innovators,valais,wilberforce,logarithm,intelligentsia,dissipation,sanctioning,duchies,aymara,porches,simulators,mostar,telepathic,coaxial,caithness,burghs,fourths,stratification,joaquim,scribes,meteorites,monarchist,germination,vries,desiring,replenishment,istria,winemaking,tammany,troupes,hetman,lanceolate,pelagic,triptych,primeira,scant,outbound,hyphae,denser,bentham,basie,normale,executes,ladislaus,kontinental,herat,cruiserweight,activision,customization,manoeuvres,inglewood,northwood,waveform,investiture,inpatient,alignments,kiryat,rabat,archimedes,ustad,monsanto,archetypal,kirkby,sikhism,correspondingly,catskill,overlaid,petrels,widowers,unicameral,federalists,metalcore,gamerankings,mussel,formula_34,lymphocytes,cystic,southgate,vestiges,immortals,kalam,strove,amazons,pocono,sociologists,sopwith,adheres,laurens,caregivers,inspecting,transylvanian,rebroadcast,rhenish,miserables,pyrams,blois,newtonian,carapace,redshirt,gotland,nazir,unilever,distortions,linebackers,federalism,mombasa,lumen,bernoulli,favouring,aligarh,denounce,steamboats,dnieper,stratigraphic,synths,bernese,umass,icebreaker,guanajuato,heisenberg,boldly,diodes,ladakh,dogmatic,scriptwriter,maritimes,battlestar,symposia,adaptable,toluca,bhavan,nanking,ieyasu,picardy,soybean,adalbert,brompton,deutsches,brezhnev,glandular,laotian,hispanicized,ibadan,personification,dalit,yamuna,regio,dispensed,yamagata,zweibrucken,revising,fandom,stances,participle,flavours,khitan,vertebral,crores,mayaguez,dispensation,guntur,undefined,harpercollins,unionism,meena,leveling,philippa,refractory,telstra,judea,attenuation,pylons,elaboration,elegy,edging,gracillariidae,residencies,absentia,reflexive,deportations,dichotomy,stoves,sanremo,shimon,menachem,corneal,conifers,mordellidae,facsimile,diagnoses,cowper,citta,viticulture,divisive,riverview,foals,mystics,polyhedron,plazas,airspeed,redgrave,motherland,impede,multiplicity,barrichello,airships,pharmacists,harvester,clays,payloads,differentiating,popularize,caesars,tunneling,stagnant,circadian,indemnity,sensibilities,musicology,prefects,serfs,metra,lillehammer,carmarthenshire,kiosks,welland,barbican,alkyl,tillandsia,gatherers,asociacion,showings,bharati,brandywine,subversion,scalable,pfizer,dawla,barium,dardanelles,nsdap,konig,ayutthaya,hodgkin,sedimentation,completions,purchasers,sponsorships,maximizing,banked,taoism,minot,enrolls,fructose,aspired,capuchin,outages,artois,carrollton,totality,osceola,pawtucket,fontainebleau,converged,queretaro,competencies,botha,allotments,sheaf,shastri,obliquely,banding,catharines,outwardly,monchengladbach,driest,contemplative,cassini,ranga,pundit,kenilworth,tiananmen,disulfide,formula_35,townlands,codice_3,looping,caravans,rachmaninoff,segmentation,fluorine,anglicised,gnostic,dessau,discern,reconfigured,altrincham,rebounding,battlecruiser,ramblers,1770s,convective,triomphe,miyagi,mourners,instagram,aloft,breastfeeding,courtyards,folkestone,changsha,kumamoto,saarland,grayish,provisionally,appomattox,uncial,classicism,mahindra,elapsed,supremes,monophyletic,cautioned,formula_36,noblewoman,kernels,sucre,swaps,bengaluru,grenfell,epicenter,rockhampton,worshipful,licentiate,metaphorical,malankara,amputated,wattle,palawan,tankobon,nobunaga,polyhedra,transduction,jilin,syrians,affinities,fluently,emanating,anglicized,sportscar,botanists,altona,dravida,chorley,allocations,kunming,luanda,premiering,outlived,mesoamerica,lingual,dissipating,impairments,attenborough,balustrade,emulator,bakhsh,cladding,increments,ascents,workington,qal'eh,winless,categorical,petrel,emphasise,dormer,toros,hijackers,telescopic,solidly,jankovic,cession,gurus,madoff,newry,subsystems,northside,talib,englishmen,farnese,holographic,electives,argonne,scrivener,predated,brugge,nauvoo,catalyses,soared,siddeley,graphically,powerlifting,funicular,sungai,coercive,fusing,uncertainties,locos,acetic,diverge,wedgwood,dressings,tiebreaker,didactic,vyacheslav,acreage,interplanetary,battlecruisers,sunbury,alkaloids,hairpin,automata,wielkie,interdiction,plugins,monkees,nudibranch,esporte,approximations,disabling,powering,characterisation,ecologically,martinsville,termen,perpetuated,lufthansa,ascendancy,motherboard,bolshoi,athanasius,prunus,dilution,invests,nonzero,mendocino,charan,banque,shaheed,counterculture,unita,voivode,hospitalization,vapour,supermarine,resistor,steppes,osnabruck,intermediates,benzodiazepines,sunnyside,privatized,geopolitical,ponta,beersheba,kievan,embody,theoretic,sangh,cartographer,blige,rotors,thruway,battlefields,discernible,demobilized,broodmare,colouration,sagas,policymakers,serialization,augmentation,hoare,frankfurter,transnistria,kinases,detachable,generational,converging,antiaircraft,khaki,bimonthly,coadjutor,arkhangelsk,kannur,buffers,livonian,northwich,enveloped,cysts,yokozuna,herne,beeching,enron,virginian,woollen,excepting,competitively,outtakes,recombinant,hillcrest,clearances,pathe,cumbersome,brasov,u.s.a,likud,christiania,cruciform,hierarchies,wandsworth,lupin,resins,voiceover,sitar,electrochemical,mediacorp,typhus,grenadiers,hepatic,pompeii,weightlifter,bosniak,oxidoreductase,undersecretary,rescuers,ranji,seleucid,analysing,exegesis,tenancy,toure,kristiansand,110th,carillon,minesweepers,poitou,acceded,palladian,redevelop,naismith,rifled,proletariat,shojo,hackensack,harvests,endpoint,kuban,rosenborg,stonehenge,authorisation,jacobean,revocation,compatriots,colliding,undetermined,okayama,acknowledgment,angelou,fresnel,chahar,ethereal,mg/kg,emmet,mobilised,unfavourable,cultura,characterizing,parsonage,skeptics,expressways,rabaul,medea,guardsmen,visakhapatnam,caddo,homophobic,elmwood,encircling,coexistence,contending,seljuk,mycologist,infertility,moliere,insolvent,covenants,underpass,holme,landesliga,workplaces,delinquency,methamphetamine,contrived,tableau,tithes,overlying,usurped,contingents,spares,oligocene,molde,beatification,mordechai,balloting,pampanga,navigators,flowered,debutant,codec,orogeny,newsletters,solon,ambivalent,ubisoft,archdeaconry,harpers,kirkus,jabal,castings,kazhagam,sylhet,yuwen,barnstaple,amidships,causative,isuzu,watchtower,granules,canaveral,remuneration,insurer,payout,horizonte,integrative,attributing,kiwis,skanderbeg,asymmetry,gannett,urbanism,disassembled,unaltered,precluded,melodifestivalen,ascends,plugin,gurkha,bisons,stakeholder,industrialisation,abbotsford,sextet,bustling,uptempo,slavia,choreographers,midwives,haram,javed,gazetteer,subsection,natively,weighting,lysine,meera,redbridge,muchmusic,abruzzo,adjoins,unsustainable,foresters,kbit/s,cosmopterigidae,secularism,poetics,causality,phonograph,estudiantes,ceausescu,universitario,adjoint,applicability,gastropods,nagaland,kentish,mechelen,atalanta,woodpeckers,lombards,gatineau,romansh,avraham,acetylcholine,perturbation,galois,wenceslaus,fuzhou,meandering,dendritic,sacristy,accented,katha,therapeutics,perceives,unskilled,greenhouses,analogues,chaldean,timbre,sloped,volodymyr,sadiq,maghreb,monogram,rearguard,caucuses,mures,metabolite,uyezd,determinism,theosophical,corbet,gaels,disruptions,bicameral,ribosomal,wolseley,clarksville,watersheds,tarsi,radon,milanese,discontinuous,aristotelian,whistleblower,representational,hashim,modestly,localised,atrial,hazara,ravana,troyes,appointees,rubus,morningside,amity,aberdare,ganglia,wests,zbigniew,aerobatic,depopulated,corsican,introspective,twinning,hardtop,shallower,cataract,mesolithic,emblematic,graced,lubrication,republicanism,voronezh,bastions,meissen,irkutsk,oboes,hokkien,sprites,tenet,individualist,capitulated,oakville,dysentery,orientalist,hillsides,keywords,elicited,incised,lagging,apoel,lengthening,attractiveness,marauders,sportswriter,decentralization,boltzmann,contradicts,draftsman,precipitate,solihull,norske,consorts,hauptmann,riflemen,adventists,syndromes,demolishing,customize,continuo,peripherals,seamlessly,linguistically,bhushan,orphanages,paraul,lessened,devanagari,quarto,responders,patronymic,riemannian,altoona,canonization,honouring,geodetic,exemplifies,republica,enzymatic,porters,fairmount,pampa,sufferers,kamchatka,conjugated,coachella,uthman,repositories,copious,headteacher,awami,phoneme,homomorphism,franconian,moorland,davos,quantified,kamloops,quarks,mayoralty,weald,peacekeepers,valerian,particulate,insiders,perthshire,caches,guimaraes,piped,grenadines,kosciuszko,trombonist,artemisia,covariance,intertidal,soybeans,beatified,ellipse,fruiting,deafness,dnipropetrovsk,accrued,zealous,mandala,causation,junius,kilowatt,bakeries,montpelier,airdrie,rectified,bungalows,toleration,debian,pylon,trotskyist,posteriorly,two-and-a-half,herbivorous,islamists,poetical,donne,wodehouse,frome,allium,assimilate,phonemic,minaret,unprofitable,darpa,untenable,leaflet,bitcoin,zahir,thresholds,argentino,jacopo,bespoke,stratified,wellbeing,shiite,basaltic,timberwolves,secrete,taunts,marathons,isomers,carre,consecrators,penobscot,pitcairn,sakha,crosstown,inclusions,impassable,fenders,indre,uscgc,jordi,retinue,logarithmic,pilgrimages,railcar,cashel,blackrock,macroscopic,aligning,tabla,trestle,certify,ronson,palps,dissolves,thickened,silicate,taman,walsingham,hausa,lowestoft,rondo,oleksandr,cuyahoga,retardation,countering,cricketing,holborn,identifiers,hells,geophysics,infighting,sculpting,balaji,webbed,irradiation,runestone,trusses,oriya,sojourn,forfeiture,colonize,exclaimed,eucharistic,lackluster,glazing,northridge,gutenberg,stipulates,macroeconomic,priori,outermost,annular,udinese,insulating,headliner,godel,polytope,megalithic,salix,sharapova,derided,muskegon,braintree,plateaus,confers,autocratic,isomer,interstitial,stamping,omits,kirtland,hatchery,evidences,intifada,111th,podgorica,capua,motivating,nuneaton,jakub,korsakov,amitabh,mundial,monrovia,gluten,predictor,marshalling,d'orleans,levers,touchscreen,brantford,fricative,banishment,descendent,antagonism,ludovico,loudspeakers,formula_37,livelihoods,manassas,steamships,dewsbury,uppermost,humayun,lures,pinnacles,dependents,lecce,clumps,observatories,paleozoic,dedicating,samiti,draughtsman,gauls,incite,infringing,nepean,pythagorean,convents,triumvirate,seigneur,gaiman,vagrant,fossa,byproduct,serrated,renfrewshire,sheltering,achaemenid,dukedom,catchers,sampdoria,platelet,bielefeld,fluctuating,phenomenology,strikeout,ethnology,prospectors,woodworking,tatra,wildfires,meditations,agrippa,fortescue,qureshi,wojciech,methyltransferase,accusative,saatchi,amerindian,volcanism,zeeland,toyama,vladimirovich,allege,polygram,redox,budgeted,advisories,nematode,chipset,starscream,tonbridge,hardening,shales,accompanist,paraded,phonographic,whitefish,sportive,audiobook,kalisz,hibernation,latif,duels,ps200,coxeter,nayak,safeguarding,cantabria,minesweeping,zeiss,dunams,catholicos,sawtooth,ontological,nicobar,bridgend,unclassified,intrinsically,hanoverian,rabbitohs,kenseth,alcalde,northumbrian,raritan,septuagint,presse,sevres,origen,dandenong,peachtree,intersected,impeded,usages,hippodrome,novara,trajectories,customarily,yardage,inflected,yanow,kalan,taverns,liguria,librettist,intermarriage,1760s,courant,gambier,infanta,ptolemaic,ukulele,haganah,sceptical,manchukuo,plexus,implantation,hilal,intersex,efficiencies,arbroath,hagerstown,adelphi,diario,marais,matti,lifes,coining,modalities,divya,bletchley,conserving,ivorian,mithridates,generative,strikeforce,laymen,toponymy,pogrom,satya,meticulously,agios,dufferin,yaakov,fortnightly,cargoes,deterrence,prefrontal,przemysl,mitterrand,commemorations,chatsworth,gurdwara,abuja,chakraborty,badajoz,geometries,artiste,diatonic,ganglion,presides,marymount,nanak,cytokines,feudalism,storks,rowers,widens,politico,evangelicals,assailants,pittsfield,allowable,bijapur,telenovelas,dichomeris,glenelg,herbivores,keita,inked,radom,fundraisers,constantius,boheme,portability,komnenos,crystallography,derrida,moderates,tavistock,fateh,spacex,disjoint,bristles,commercialized,interwoven,empirically,regius,bulacan,newsday,showa,radicalism,yarrow,pleura,sayed,structuring,cotes,reminiscences,acetyl,edicts,escalators,aomori,encapsulated,legacies,bunbury,placings,fearsome,postscript,powerfully,keighley,hildesheim,amicus,crevices,deserters,benelux,aurangabad,freeware,ioannis,carpathians,chirac,seceded,prepaid,landlocked,naturalised,yanukovych,soundscan,blotch,phenotypic,determinants,twente,dictatorial,giessen,composes,recherche,pathophysiology,inventories,ayurveda,elevating,gravestone,degeneres,vilayet,popularizing,spartanburg,bloemfontein,previewed,renunciation,genotype,ogilvy,tracery,blacklisted,emissaries,diploid,disclosures,tupolev,shinjuku,antecedents,pennine,braganza,bhattacharya,countable,spectroscopic,ingolstadt,theseus,corroborated,compounding,thrombosis,extremadura,medallions,hasanabad,lambton,perpetuity,glycol,besancon,palaiologos,pandey,caicos,antecedent,stratum,laserdisc,novitiate,crowdfunding,palatal,sorceress,dassault,toughness,celle,cezanne,vientiane,tioga,hander,crossbar,gisborne,cursor,inspectorate,serif,praia,sphingidae,nameplate,psalter,ivanovic,sitka,equalised,mutineers,sergius,outgrowth,creationism,haredi,rhizomes,predominate,undertakings,vulgate,hydrothermal,abbeville,geodesic,kampung,physiotherapy,unauthorised,asteraceae,conservationist,minoan,supersport,mohammadabad,cranbrook,mentorship,legitimately,marshland,datuk,louvain,potawatomi,carnivores,levies,lyell,hymnal,regionals,tinto,shikoku,conformal,wanganui,beira,lleida,standstill,deloitte,formula_40,corbusier,chancellery,mixtapes,airtime,muhlenberg,formula_39,bracts,thrashers,prodigious,gironde,chickamauga,uyghurs,substitutions,pescara,batangas,gregarious,gijon,paleo,mathura,pumas,proportionally,hawkesbury,yucca,kristiania,funimation,fluted,eloquence,mohun,aftermarket,chroniclers,futurist,nonconformist,branko,mannerisms,lesnar,opengl,altos,retainers,ashfield,shelbourne,sulaiman,divisie,gwent,locarno,lieder,minkowski,bivalve,redeployed,cartography,seaway,bookings,decays,ostend,antiquaries,pathogenesis,formula_38,chrysalis,esperance,valli,motogp,homelands,bridged,bloor,ghazal,vulgaris,baekje,prospector,calculates,debtors,hesperiidae,titian,returner,landgrave,frontenac,kelowna,pregame,castelo,caius,canoeist,watercolours,winterthur,superintendents,dissonance,dubstep,adorn,matic,salih,hillel,swordsman,flavoured,emitter,assays,monongahela,deeded,brazzaville,sufferings,babylonia,fecal,umbria,astrologer,gentrification,frescos,phasing,zielona,ecozone,candido,manoj,quadrilateral,gyula,falsetto,prewar,puntland,infinitive,contraceptive,bakhtiari,ohrid,socialization,tailplane,evoking,havelock,macapagal,plundering,104th,keynesian,templars,phrasing,morphologically,czestochowa,humorously,catawba,burgas,chiswick,ellipsoid,kodansha,inwards,gautama,katanga,orthopaedic,heilongjiang,sieges,outsourced,subterminal,vijayawada,hares,oration,leitrim,ravines,manawatu,cryogenic,tracklisting,about.com,ambedkar,degenerated,hastened,venturing,lobbyists,shekhar,typefaces,northcote,rugen,'good,ornithology,asexual,hemispheres,unsupported,glyphs,spoleto,epigenetic,musicianship,donington,diogo,kangxi,bisected,polymorphism,megawatt,salta,embossed,cheetahs,cruzeiro,unhcr,aristide,rayleigh,maturing,indonesians,noire,llano,ffffff,camus,purges,annales,convair,apostasy,algol,phage,apaches,marketers,aldehyde,pompidou,kharkov,forgeries,praetorian,divested,retrospectively,gornji,scutellum,bitumen,pausanias,magnification,imitations,nyasaland,geographers,floodlights,athlone,hippolyte,expositions,clarinetist,razak,neutrinos,rotax,sheykh,plush,interconnect,andalus,cladogram,rudyard,resonator,granby,blackfriars,placido,windscreen,sahel,minamoto,haida,cations,emden,blackheath,thematically,blacklist,pawel,disseminating,academical,undamaged,raytheon,harsher,powhatan,ramachandran,saddles,paderborn,capping,zahra,prospecting,glycine,chromatin,profane,banska,helmand,okinawan,dislocation,oscillators,insectivorous,foyle,gilgit,autonomic,tuareg,sluice,pollinated,multiplexed,granary,narcissus,ranchi,staines,nitra,goalscoring,midwifery,pensioners,algorithmic,meetinghouse,biblioteca,besar,narva,angkor,predate,lohan,cyclical,detainee,occipital,eventing,faisalabad,dartmoor,kublai,courtly,resigns,radii,megachilidae,cartels,shortfall,xhosa,unregistered,benchmarks,dystopian,bulkhead,ponsonby,jovanovic,accumulates,papuan,bhutanese,intuitively,gotaland,headliners,recursion,dejan,novellas,diphthongs,imbued,withstood,analgesic,amplify,powertrain,programing,maidan,alstom,affirms,eradicated,summerslam,videogame,molla,severing,foundered,gallium,atmospheres,desalination,shmuel,howmeh,catolica,bossier,reconstructing,isolates,lyase,tweets,unconnected,tidewater,divisible,cohorts,orebro,presov,furnishing,folklorist,simplifying,centrale,notations,factorization,monarchies,deepen,macomb,facilitation,hennepin,declassified,redrawn,microprocessors,preliminaries,enlarging,timeframe,deutschen,shipbuilders,patiala,ferrous,aquariums,genealogies,vieux,unrecognized,bridgwater,tetrahedral,thule,resignations,gondwana,registries,agder,dataset,felled,parva,analyzer,worsen,coleraine,columella,blockaded,polytechnique,reassembled,reentry,narvik,greys,nigra,knockouts,bofors,gniezno,slotted,hamasaki,ferrers,conferring,thirdly,domestication,photojournalist,universality,preclude,ponting,halved,thereupon,photosynthetic,ostrava,mismatch,pangasinan,intermediaries,abolitionists,transited,headings,ustase,radiological,interconnection,dabrowa,invariants,honorius,preferentially,chantilly,marysville,dialectical,antioquia,abstained,gogol,dirichlet,muricidae,symmetries,reproduces,brazos,fatwa,bacillus,ketone,paribas,chowk,multiplicative,dermatitis,mamluks,devotes,adenosine,newbery,meditative,minefields,inflection,oxfam,conwy,bystrica,imprints,pandavas,infinitesimal,conurbation,amphetamine,reestablish,furth,edessa,injustices,frankston,serjeant,4x200,khazar,sihanouk,longchamp,stags,pogroms,coups,upperparts,endpoints,infringed,nuanced,summing,humorist,pacification,ciaran,jamaat,anteriorly,roddick,springboks,faceted,hypoxia,rigorously,cleves,fatimid,ayurvedic,tabled,ratna,senhora,maricopa,seibu,gauguin,holomorphic,campgrounds,amboy,coordinators,ponderosa,casemates,ouachita,nanaimo,mindoro,zealander,rimsky,cluny,tomaszow,meghalaya,caetano,tilak,roussillon,landtag,gravitation,dystrophy,cephalopods,trombones,glens,killarney,denominated,anthropogenic,pssas,roubaix,carcasses,montmorency,neotropical,communicative,rabindranath,ordinated,separable,overriding,surged,sagebrush,conciliation,codice_4,durrani,phosphatase,qadir,votive,revitalized,taiyuan,tyrannosaurus,graze,slovaks,nematodes,environmentalism,blockhouse,illiteracy,schengen,ecotourism,alternation,conic,wields,hounslow,blackfoot,kwame,ambulatory,volhynia,hordaland,croton,piedras,rohit,drava,conceptualized,birla,illustrative,gurgaon,barisal,tutsi,dezong,nasional,polje,chanson,clarinets,krasnoyarsk,aleksandrovich,cosmonaut,d'este,palliative,midseason,silencing,wardens,durer,girders,salamanders,torrington,supersonics,lauda,farid,circumnavigation,embankments,funnels,bajnoksag,lorries,cappadocia,jains,warringah,retirees,burgesses,equalization,cusco,ganesan,algal,amazonian,lineups,allocating,conquerors,usurper,mnemonic,predating,brahmaputra,ahmadabad,maidenhead,numismatic,subregion,encamped,reciprocating,freebsd,irgun,tortoises,governorates,zionists,airfoil,collated,ajmer,fiennes,etymological,polemic,chadian,clerestory,nordiques,fluctuated,calvados,oxidizing,trailhead,massena,quarrels,dordogne,tirunelveli,pyruvate,pulsed,athabasca,sylar,appointee,serer,japonica,andronikos,conferencing,nicolaus,chemin,ascertained,incited,woodbine,helices,hospitalised,emplacements,to/from,orchestre,tyrannical,pannonia,methodism,pop/rock,shibuya,berbers,despot,seaward,westpac,separator,perpignan,alamein,judeo,publicize,quantization,ethniki,gracilis,menlo,offside,oscillating,unregulated,succumbing,finnmark,metrical,suleyman,raith,sovereigns,bundesstrasse,kartli,fiduciary,darshan,foramen,curler,concubines,calvinism,larouche,bukhara,sophomores,mohanlal,lutheranism,monomer,eamonn,'black,uncontested,immersive,tutorials,beachhead,bindings,permeable,postulates,comite,transformative,indiscriminate,hofstra,associacao,amarna,dermatology,lapland,aosta,babur,unambiguous,formatting,schoolboys,gwangju,superconducting,replayed,adherent,aureus,compressors,forcible,spitsbergen,boulevards,budgeting,nossa,annandale,perumal,interregnum,sassoon,kwajalein,greenbrier,caldas,triangulation,flavius,increment,shakhtar,nullified,pinfall,nomen,microfinance,depreciation,cubist,steeper,splendour,gruppe,everyman,chasers,campaigners,bridle,modality,percussive,darkly,capes,velar,picton,triennial,factional,padang,toponym,betterment,norepinephrine,112th,estuarine,diemen,warehousing,morphism,ideologically,pairings,immunization,crassus,exporters,sefer,flocked,bulbous,deseret,booms,calcite,bohol,elven,groot,pulau,citigroup,wyeth,modernizing,layering,pastiche,complies,printmaker,condenser,theropod,cassino,oxyrhynchus,akademie,trainings,lowercase,coxae,parte,chetniks,pentagonal,keselowski,monocoque,morsi,reticulum,meiosis,clapboard,recoveries,tinge,an/fps,revista,sidon,livre,epidermis,conglomerates,kampong,congruent,harlequins,tergum,simplifies,epidemiological,underwriting,tcp/ip,exclusivity,multidimensional,mysql,columbine,ecologist,hayat,sicilies,levees,handset,aesop,usenet,pacquiao,archiving,alexandrian,compensatory,broadsheet,annotation,bahamian,d'affaires,interludes,phraya,shamans,marmara,customizable,immortalized,ambushes,chlorophyll,diesels,emulsion,rheumatoid,voluminous,screenwriters,tailoring,sedis,runcorn,democratization,bushehr,anacostia,constanta,antiquary,sixtus,radiate,advaita,antimony,acumen,barristers,reichsbahn,ronstadt,symbolist,pasig,cursive,secessionist,afrikaner,munnetra,inversely,adsorption,syllabic,moltke,idioms,midline,olimpico,diphosphate,cautions,radziwill,mobilisation,copelatus,trawlers,unicron,bhaskar,financiers,minimalism,derailment,marxists,oireachtas,abdicate,eigenvalue,zafar,vytautas,ganguly,chelyabinsk,telluride,subordination,ferried,dived,vendee,pictish,dimitrov,expiry,carnation,cayley,magnitudes,lismore,gretna,sandwiched,unmasked,sandomierz,swarthmore,tetra,nanyang,pevsner,dehradun,mormonism,rashi,complying,seaplanes,ningbo,cooperates,strathcona,mornington,mestizo,yulia,edgbaston,palisade,ethno,polytopes,espirito,tymoshenko,pronunciations,paradoxical,taichung,chipmunks,erhard,maximise,accretion,kanda,`abdu'l,narrowest,umpiring,mycenaean,divisor,geneticist,ceredigion,barque,hobbyists,equates,auxerre,spinose,cheil,sweetwater,guano,carboxylic,archiv,tannery,cormorant,agonists,fundacion,anbar,tunku,hindrance,meerut,concordat,secunderabad,kachin,achievable,murfreesboro,comprehensively,forges,broadest,synchronised,speciation,scapa,aliyev,conmebol,tirelessly,subjugated,pillaged,udaipur,defensively,lakhs,stateless,haasan,headlamps,patterning,podiums,polyphony,mcmurdo,mujer,vocally,storeyed,mucosa,multivariate,scopus,minimizes,formalised,certiorari,bourges,populate,overhanging,gaiety,unreserved,borromeo,woolworths,isotopic,bashar,purify,vertebra,medan,juxtaposition,earthwork,elongation,chaudhary,schematic,piast,steeped,nanotubes,fouls,achaea,legionnaires,abdur,qmjhl,embraer,hardback,centerville,ilocos,slovan,whitehorse,mauritian,moulding,mapuche,donned,provisioning,gazprom,jonesboro,audley,lightest,calyx,coldwater,trigonometric,petroglyphs,psychoanalyst,congregate,zambezi,fissure,supervises,bexley,etobicoke,wairarapa,tectonics,emphasises,formula_41,debugging,linfield,spatially,ionizing,ungulates,orinoco,clades,erlangen,news/talk,vols.,ceara,yakovlev,finsbury,entanglement,fieldhouse,graphene,intensifying,grigory,keyong,zacatecas,ninian,allgemeine,keswick,societa,snorri,femininity,najib,monoclonal,guyanese,postulate,huntly,abbeys,machinist,yunus,emphasising,ishaq,urmia,bremerton,pretenders,lumiere,thoroughfares,chikara,dramatized,metathorax,taiko,transcendence,wycliffe,retrieves,umpired,steuben,racehorses,taylors,kuznetsov,montezuma,precambrian,canopies,gaozong,propodeum,disestablished,retroactive,shoreham,rhizome,doubleheader,clinician,diwali,quartzite,shabaab,agassiz,despatched,stormwater,luxemburg,callao,universidade,courland,skane,glyph,dormers,witwatersrand,curacy,qualcomm,nansen,entablature,lauper,hausdorff,lusaka,ruthenian,360deg,cityscape,douai,vaishnava,spars,vaulting,rationalist,gygax,sequestration,typology,pollinates,accelerators,leben,colonials,cenotaph,imparted,carthaginians,equaled,rostrum,gobind,bodhisattva,oberst,bicycling,arabi,sangre,biophysics,hainaut,vernal,lunenburg,apportioned,finches,lajos,nenad,repackaged,zayed,nikephoros,r.e.m,swaminarayan,gestalt,unplaced,crags,grohl,sialkot,unsaturated,gwinnett,linemen,forays,palakkad,writs,instrumentalists,aircrews,badged,terrapins,180deg,oneness,commissariat,changi,pupation,circumscribed,contador,isotropic,administrated,fiefs,nimes,intrusions,minoru,geschichte,nadph,tainan,changchun,carbondale,frisia,swapo,evesham,hawai'i,encyclopedic,transporters,dysplasia,formula_42,onsite,jindal,guetta,judgements,narbonne,permissions,paleogene,rationalism,vilna,isometric,subtracted,chattahoochee,lamina,missa,greville,pervez,lattices,persistently,crystallization,timbered,hawaiians,fouling,interrelated,masood,ripening,stasi,gamal,visigothic,warlike,cybernetics,tanjung,forfar,cybernetic,karelian,brooklands,belfort,greifswald,campeche,inexplicably,refereeing,understory,uninterested,prius,collegiately,sefid,sarsfield,categorize,biannual,elsevier,eisteddfod,declension,autonoma,procuring,misrepresentation,novelization,bibliographic,shamanism,vestments,potash,eastleigh,ionized,turan,lavishly,scilly,balanchine,importers,parlance,'that,kanyakumari,synods,mieszko,crossovers,serfdom,conformational,legislated,exclave,heathland,sadar,differentiates,propositional,konstantinos,photoshop,manche,vellore,appalachia,orestes,taiga,exchanger,grozny,invalidated,baffin,spezia,staunchly,eisenach,robustness,virtuosity,ciphers,inlets,bolagh,understandings,bosniaks,parser,typhoons,sinan,luzerne,webcomic,subtraction,jhelum,businessweek,ceske,refrained,firebox,mitigated,helmholtz,dilip,eslamabad,metalwork,lucan,apportionment,provident,gdynia,schooners,casement,danse,hajjiabad,benazir,buttress,anthracite,newsreel,wollaston,dispatching,cadastral,riverboat,provincetown,nantwich,missal,irreverent,juxtaposed,darya,ennobled,electropop,stereoscopic,maneuverability,laban,luhansk,udine,collectibles,haulage,holyrood,materially,supercharger,gorizia,shkoder,townhouses,pilate,layoffs,folkloric,dialectic,exuberant,matures,malla,ceuta,citizenry,crewed,couplet,stopover,transposition,tradesmen,antioxidant,amines,utterance,grahame,landless,isere,diction,appellant,satirist,urbino,intertoto,subiaco,antonescu,nehemiah,ubiquitin,emcee,stourbridge,fencers,103rd,wranglers,monteverdi,watertight,expounded,xiamen,manmohan,pirie,threefold,antidepressant,sheboygan,grieg,cancerous,diverging,bernini,polychrome,fundamentalism,bihari,critiqued,cholas,villers,tendulkar,dafydd,vastra,fringed,evangelization,episcopalian,maliki,sana'a,ashburton,trianon,allegany,heptathlon,insufficiently,panelists,pharrell,hexham,amharic,fertilized,plumes,cistern,stratigraphy,akershus,catalans,karoo,rupee,minuteman,quantification,wigmore,leutnant,metanotum,weeknights,iridescent,extrasolar,brechin,deuterium,kuching,lyricism,astrakhan,brookhaven,euphorbia,hradec,bhagat,vardar,aylmer,positron,amygdala,speculators,unaccompanied,debrecen,slurry,windhoek,disaffected,rapporteur,mellitus,blockers,fronds,yatra,sportsperson,precession,physiologist,weeknight,pidgin,pharma,condemns,standardize,zetian,tibor,glycoprotein,emporia,cormorants,amalie,accesses,leonhard,denbighshire,roald,116th,will.i.am,symbiosis,privatised,meanders,chemnitz,jabalpur,shing,secede,ludvig,krajina,homegrown,snippets,sasanian,euripides,peder,cimarron,streaked,graubunden,kilimanjaro,mbeki,middleware,flensburg,bukovina,lindwall,marsalis,profited,abkhaz,polis,camouflaged,amyloid,morgantown,ovoid,bodleian,morte,quashed,gamelan,juventud,natchitoches,storyboard,freeview,enumeration,cielo,preludes,bulawayo,1600s,olympiads,multicast,faunal,asura,reinforces,puranas,ziegfeld,handicraft,seamount,kheil,noche,hallmarks,dermal,colorectal,encircle,hessen,umbilicus,sunnis,leste,unwin,disclosing,superfund,montmartre,refuelling,subprime,kolhapur,etiology,bismuth,laissez,vibrational,mazar,alcoa,rumsfeld,recurve,ticonderoga,lionsgate,onlookers,homesteads,filesystem,barometric,kingswood,biofuel,belleza,moshav,occidentalis,asymptomatic,northeasterly,leveson,huygens,numan,kingsway,primogeniture,toyotomi,yazoo,limpets,greenbelt,booed,concurrence,dihedral,ventrites,raipur,sibiu,plotters,kitab,109th,trackbed,skilful,berthed,effendi,fairing,sephardi,mikhailovich,lockyer,wadham,invertible,paperbacks,alphabetic,deuteronomy,constitutive,leathery,greyhounds,estoril,beechcraft,poblacion,cossidae,excreted,flamingos,singha,olmec,neurotransmitters,ascoli,nkrumah,forerunners,dualism,disenchanted,benefitted,centrum,undesignated,noida,o'donoghue,collages,egrets,egmont,wuppertal,cleave,montgomerie,pseudomonas,srinivasa,lymphatic,stadia,resold,minima,evacuees,consumerism,ronde,biochemist,automorphism,hollows,smuts,improvisations,vespasian,bream,pimlico,eglin,colne,melancholic,berhad,ousting,saale,notaulices,ouest,hunslet,tiberias,abdomina,ramsgate,stanislas,donbass,pontefract,sucrose,halts,drammen,chelm,l'arc,taming,trolleys,konin,incertae,licensees,scythian,giorgos,dative,tanglewood,farmlands,o'keeffe,caesium,romsdal,amstrad,corte,oglethorpe,huntingdonshire,magnetization,adapts,zamosc,shooto,cuttack,centrepiece,storehouse,winehouse,morbidity,woodcuts,ryazan,buddleja,buoyant,bodmin,estero,austral,verifiable,periyar,christendom,curtail,shura,kaifeng,cotswold,invariance,seafaring,gorica,androgen,usman,seabird,forecourt,pekka,juridical,audacious,yasser,cacti,qianlong,polemical,d'amore,espanyol,distrito,cartographers,pacifism,serpents,backa,nucleophilic,overturning,duplicates,marksman,oriente,vuitton,oberleutnant,gielgud,gesta,swinburne,transfiguration,1750s,retaken,celje,fredrikstad,asuka,cropping,mansard,donates,blacksmiths,vijayanagara,anuradhapura,germinate,betis,foreshore,jalandhar,bayonets,devaluation,frazione,ablaze,abidjan,approvals,homeostasis,corollary,auden,superfast,redcliffe,luxembourgish,datum,geraldton,printings,ludhiana,honoree,synchrotron,invercargill,hurriedly,108th,three-and-a-half,colonist,bexar,limousin,bessemer,ossetian,nunataks,buddhas,rebuked,thais,tilburg,verdicts,interleukin,unproven,dordrecht,solent,acclamation,muammar,dahomey,operettas,4x400,arrears,negotiators,whitehaven,apparitions,armoury,psychoactive,worshipers,sculptured,elphinstone,airshow,kjell,o'callaghan,shrank,professorships,predominance,subhash,coulomb,sekolah,retrofitted,samos,overthrowing,vibrato,resistors,palearctic,datasets,doordarshan,subcutaneous,compiles,immorality,patchwork,trinidadian,glycogen,pronged,zohar,visigoths,freres,akram,justo,agora,intakes,craiova,playwriting,bukhari,militarism,iwate,petitioners,harun,wisla,inefficiency,vendome,ledges,schopenhauer,kashi,entombed,assesses,tenn.,noumea,baguio,carex,o'donovan,filings,hillsdale,conjectures,blotches,annuals,lindisfarne,negated,vivek,angouleme,trincomalee,cofactor,verkhovna,backfield,twofold,automaker,rudra,freighters,darul,gharana,busway,formula_43,plattsburgh,portuguesa,showrunner,roadmap,valenciennes,erdos,biafra,spiritualism,transactional,modifies,carne,107th,cocos,gcses,tiverton,radiotherapy,meadowlands,gunma,srebrenica,foxtel,authenticated,enslavement,classicist,klaipeda,minstrels,searchable,infantrymen,incitement,shiga,nadp+,urals,guilders,banquets,exteriors,counterattacks,visualized,diacritics,patrimony,svensson,transepts,prizren,telegraphy,najaf,emblazoned,coupes,effluent,ragam,omani,greensburg,taino,flintshire,cd/dvd,lobbies,narrating,cacao,seafarers,bicolor,collaboratively,suraj,floodlit,sacral,puppetry,tlingit,malwa,login,motionless,thien,overseers,vihar,golem,specializations,bathhouse,priming,overdubs,winningest,archetypes,uniao,acland,creamery,slovakian,lithographs,maryborough,confidently,excavating,stillborn,ramallah,audiencia,alava,ternary,hermits,rostam,bauxite,gawain,lothair,captions,gulfstream,timelines,receded,mediating,petain,bastia,rudbar,bidders,disclaimer,shrews,tailings,trilobites,yuriy,jamil,demotion,gynecology,rajinikanth,madrigals,ghazni,flycatchers,vitebsk,bizet,computationally,kashgar,refinements,frankford,heralds,europe/africa,levante,disordered,sandringham,queues,ransacked,trebizond,verdes,comedie,primitives,figurine,organists,culminate,gosport,coagulation,ferrying,hoyas,polyurethane,prohibitive,midfielders,ligase,progesterone,defectors,sweetened,backcountry,diodorus,waterside,nieuport,khwaja,jurong,decried,gorkha,ismaili,300th,octahedral,kindergartens,paseo,codification,notifications,disregarding,risque,reconquista,shortland,atolls,texarkana,perceval,d'etudes,kanal,herbicides,tikva,nuova,gatherer,dissented,soweto,dexterity,enver,bacharach,placekicker,carnivals,automate,maynooth,symplectic,chetnik,militaire,upanishads,distributive,strafing,championing,moiety,miliband,blackadder,enforceable,maung,dimer,stadtbahn,diverges,obstructions,coleophoridae,disposals,shamrocks,aural,banca,bahru,coxed,grierson,vanadium,watermill,radiative,ecoregions,berets,hariri,bicarbonate,evacuations,mallee,nairn,rushden,loggia,slupsk,satisfactorily,milliseconds,cariboo,reine,cyclo,pigmentation,postmodernism,aqueducts,vasari,bourgogne,dilemmas,liquefied,fluminense,alloa,ibaraki,tenements,kumasi,humerus,raghu,labours,putsch,soundcloud,bodybuilder,rakyat,domitian,pesaro,translocation,sembilan,homeric,enforcers,tombstones,lectureship,rotorua,salamis,nikolaos,inferences,superfortress,lithgow,surmised,undercard,tarnow,barisan,stingrays,federacion,coldstream,haverford,ornithological,heerenveen,eleazar,jyoti,murali,bamako,riverbed,subsidised,theban,conspicuously,vistas,conservatorium,madrasa,kingfishers,arnulf,credential,syndicalist,sheathed,discontinuity,prisms,tsushima,coastlines,escapees,vitis,optimizing,megapixel,overground,embattled,halide,sprinters,buoys,mpumalanga,peculiarities,106th,roamed,menezes,macao,prelates,papyri,freemen,dissertations,irishmen,pooled,sverre,reconquest,conveyance,subjectivity,asturian,circassian,formula_45,comdr,thickets,unstressed,monro,passively,harmonium,moveable,dinar,carlsson,elysees,chairing,b'nai,confusingly,kaoru,convolution,godolphin,facilitator,saxophones,eelam,jebel,copulation,anions,livres,licensure,pontypridd,arakan,controllable,alessandria,propelling,stellenbosch,tiber,wolka,liberators,yarns,d'azur,tsinghua,semnan,amhara,ablation,melies,tonality,historique,beeston,kahne,intricately,sonoran,robespierre,gyrus,boycotts,defaulted,infill,maranhao,emigres,framingham,paraiba,wilhelmshaven,tritium,skyway,labial,supplementation,possessor,underserved,motets,maldivian,marrakech,quays,wikimedia,turbojet,demobilization,petrarch,encroaching,sloops,masted,karbala,corvallis,agribusiness,seaford,stenosis,hieronymus,irani,superdraft,baronies,cortisol,notability,veena,pontic,cyclin,archeologists,newham,culled,concurring,aeolian,manorial,shouldered,fords,philanthropists,105th,siddharth,gotthard,halim,rajshahi,jurchen,detritus,practicable,earthenware,discarding,travelogue,neuromuscular,elkhart,raeder,zygmunt,metastasis,internees,102nd,vigour,upmarket,summarizing,subjunctive,offsets,elizabethtown,udupi,pardubice,repeaters,instituting,archaea,substandard,technische,linga,anatomist,flourishes,velika,tenochtitlan,evangelistic,fitchburg,springbok,cascading,hydrostatic,avars,occasioned,filipina,perceiving,shimbun,africanus,consternation,tsing,optically,beitar,45deg,abutments,roseville,monomers,huelva,lotteries,hypothalamus,internationalist,electromechanical,hummingbirds,fibreglass,salaried,dramatists,uncovers,invokes,earners,excretion,gelding,ancien,aeronautica,haverhill,stour,ittihad,abramoff,yakov,ayodhya,accelerates,industrially,aeroplanes,deleterious,dwelt,belvoir,harpalus,atpase,maluku,alasdair,proportionality,taran,epistemological,interferometer,polypeptide,adjudged,villager,metastatic,marshalls,madhavan,archduchess,weizmann,kalgoorlie,balan,predefined,sessile,sagaing,brevity,insecticide,psychosocial,africana,steelworks,aether,aquifers,belem,mineiro,almagro,radiators,cenozoic,solute,turbocharger,invicta,guested,buccaneer,idolatry,unmatched,paducah,sinestro,dispossessed,conforms,responsiveness,cyanobacteria,flautist,procurator,complementing,semifinalist,rechargeable,permafrost,cytokine,refuges,boomed,gelderland,franchised,jinan,burnie,doubtless,randomness,colspan=12,angra,ginebra,famers,nuestro,declarative,roughness,lauenburg,motile,rekha,issuer,piney,interceptors,napoca,gipsy,formulaic,formula_44,viswanathan,ebrahim,thessalonica,galeria,muskogee,unsold,html5,taito,mobutu,icann,carnarvon,fairtrade,morphisms,upsilon,nozzles,fabius,meander,murugan,strontium,episcopacy,sandinista,parasol,attenuated,bhima,primeval,panay,ordinator,negara,osteoporosis,glossop,ebook,paradoxically,grevillea,modoc,equating,phonetically,legumes,covariant,dorje,quatre,bruxelles,pyroclastic,shipbuilder,zhaozong,obscuring,sveriges,tremolo,extensible,barrack,multnomah,hakon,chaharmahal,parsing,volumetric,astrophysical,glottal,combinatorics,freestanding,encoder,paralysed,cavalrymen,taboos,heilbronn,orientalis,lockport,marvels,ozawa,dispositions,waders,incurring,saltire,modulate,papilio,phenol,intermedia,rappahannock,plasmid,fortify,phenotypes,transiting,correspondences,leaguer,larnaca,incompatibility,mcenroe,deeming,endeavoured,aboriginals,helmed,salar,arginine,werke,ferrand,expropriated,delimited,couplets,phoenicians,petioles,ouster,anschluss,protectionist,plessis,urchins,orquesta,castleton,juniata,bittorrent,fulani,donji,mykola,rosemont,chandos,scepticism,signer,chalukya,wicketkeeper,coquitlam,programmatic,o'brian,carteret,urology,steelhead,paleocene,konkan,bettered,venkatesh,surfacing,longitudinally,centurions,popularization,yazid,douro,widths,premios,leonards,gristmill,fallujah,arezzo,leftists,ecliptic,glycerol,inaction,disenfranchised,acrimonious,depositing,parashah,cockatoo,marechal,bolzano,chios,cablevision,impartiality,pouches,thickly,equities,bentinck,emotive,boson,ashdown,conquistadors,parsi,conservationists,reductive,newlands,centerline,ornithologists,waveguide,nicene,philological,hemel,setanta,masala,aphids,convening,casco,matrilineal,chalcedon,orthographic,hythe,replete,damming,bolivarian,admixture,embarks,borderlands,conformed,nagarjuna,blenny,chaitanya,suwon,shigeru,tatarstan,lingayen,rejoins,grodno,merovingian,hardwicke,puducherry,prototyping,laxmi,upheavals,headquarter,pollinators,bromine,transom,plantagenet,arbuthnot,chidambaram,woburn,osamu,panelling,coauthored,zhongshu,hyaline,omissions,aspergillus,offensively,electrolytic,woodcut,sodom,intensities,clydebank,piotrkow,supplementing,quipped,focke,harbinger,positivism,parklands,wolfenbuttel,cauca,tryptophan,taunus,curragh,tsonga,remand,obscura,ashikaga,eltham,forelimbs,analogs,trnava,observances,kailash,antithesis,ayumi,abyssinia,dorsally,tralee,pursuers,misadventures,padova,perot,mahadev,tarim,granth,licenced,compania,patuxent,baronial,korda,cochabamba,codices,karna,memorialized,semaphore,playlists,mandibular,halal,sivaji,scherzinger,stralsund,foundries,ribosome,mindfulness,nikolayevich,paraphyletic,newsreader,catalyze,ioannina,thalamus,gbit/s,paymaster,sarab,500th,replenished,gamepro,cracow,formula_46,gascony,reburied,lessing,easement,transposed,meurthe,satires,proviso,balthasar,unbound,cuckoos,durbar,louisbourg,cowes,wholesalers,manet,narita,xiaoping,mohamad,illusory,cathal,reuptake,alkaloid,tahrir,mmorpg,underlies,anglicanism,repton,aharon,exogenous,buchenwald,indigent,odostomia,milled,santorum,toungoo,nevsky,steyr,urbanisation,darkseid,subsonic,canaanite,akiva,eglise,dentition,mediators,cirencester,peloponnesian,malmesbury,durres,oerlikon,tabulated,saens,canaria,ischemic,esterhazy,ringling,centralization,walthamstow,nalanda,lignite,takht,leninism,expiring,circe,phytoplankton,promulgation,integrable,breeches,aalto,menominee,borgo,scythians,skrull,galleon,reinvestment,raglan,reachable,liberec,airframes,electrolysis,geospatial,rubiaceae,interdependence,symmetrically,simulcasts,keenly,mauna,adipose,zaidi,fairport,vestibular,actuators,monochromatic,literatures,congestive,sacramental,atholl,skytrain,tycho,tunings,jamia,catharina,modifier,methuen,tapings,infiltrating,colima,grafting,tauranga,halides,pontificate,phonetics,koper,hafez,grooved,kintetsu,extrajudicial,linkoping,cyberpunk,repetitions,laurentian,parnu,bretton,darko,sverdlovsk,foreshadowed,akhenaten,rehnquist,gosford,coverts,pragmatism,broadleaf,ethiopians,instated,mediates,sodra,opulent,descriptor,enugu,shimla,leesburg,officership,giffard,refectory,lusitania,cybermen,fiume,corus,tydfil,lawrenceville,ocala,leviticus,burghers,ataxia,richthofen,amicably,acoustical,watling,inquired,tiempo,multiracial,parallelism,trenchard,tokyopop,germanium,usisl,philharmonia,shapur,jacobites,latinized,sophocles,remittances,o'farrell,adder,dimitrios,peshwa,dimitar,orlov,outstretched,musume,satish,dimensionless,serialised,baptisms,pagasa,antiviral,1740s,quine,arapaho,bombardments,stratosphere,ophthalmic,injunctions,carbonated,nonviolence,asante,creoles,sybra,boilermakers,abington,bipartite,permissive,cardinality,anheuser,carcinogenic,hohenlohe,surinam,szeged,infanticide,generically,floorball,'white,automakers,cerebellar,homozygous,remoteness,effortlessly,allude,'great,headmasters,minting,manchurian,kinabalu,wemyss,seditious,widgets,marbled,almshouses,bards,subgenres,tetsuya,faulting,kickboxer,gaulish,hoseyn,malton,fluvial,questionnaires,mondale,downplayed,traditionalists,vercelli,sumatran,landfills,gamesradar,exerts,franciszek,unlawfully,huesca,diderot,libertarians,professorial,laane,piecemeal,conidae,taiji,curatorial,perturbations,abstractions,szlachta,watercraft,mullah,zoroastrianism,segmental,khabarovsk,rectors,affordability,scuola,diffused,stena,cyclonic,workpiece,romford,'little,jhansi,stalag,zhongshan,skipton,maracaibo,bernadotte,thanet,groening,waterville,encloses,sahrawi,nuffield,moorings,chantry,annenberg,islay,marchers,tenses,wahid,siegen,furstenberg,basques,resuscitation,seminarians,tympanum,gentiles,vegetarianism,tufted,venkata,fantastical,pterophoridae,machined,superposition,glabrous,kaveri,chicane,executors,phyllonorycter,bidirectional,jasta,undertones,touristic,majapahit,navratilova,unpopularity,barbadian,tinian,webcast,hurdler,rigidly,jarrah,staphylococcus,igniting,irrawaddy,stabilised,airstrike,ragas,wakayama,energetically,ekstraklasa,minibus,largemouth,cultivators,leveraging,waitangi,carnaval,weaves,turntables,heydrich,sextus,excavate,govind,ignaz,pedagogue,uriah,borrowings,gemstones,infractions,mycobacterium,batavian,massing,praetor,subalpine,massoud,passers,geostationary,jalil,trainsets,barbus,impair,budejovice,denbigh,pertain,historicity,fortaleza,nederlandse,lamenting,masterchef,doubs,gemara,conductance,ploiesti,cetaceans,courthouses,bhagavad,mihailovic,occlusion,bremerhaven,bulwark,morava,kaine,drapery,maputo,conquistador,kaduna,famagusta,first-past-the-post,erudite,galton,undated,tangential,filho,dismembered,dashes,criterium,darwen,metabolized,blurring,everard,randwick,mohave,impurity,acuity,ansbach,chievo,surcharge,plantain,algoma,porosity,zirconium,selva,sevenoaks,venizelos,gwynne,golgi,imparting,separatism,courtesan,idiopathic,gravestones,hydroelectricity,babar,orford,purposeful,acutely,shard,ridgewood,viterbo,manohar,expropriation,placenames,brevis,cosine,unranked,richfield,newnham,recoverable,flightless,dispersing,clearfield,abu'l,stranraer,kempe,streamlining,goswami,epidermal,pieta,conciliatory,distilleries,electrophoresis,bonne,tiago,curiosities,candidature,picnicking,perihelion,lintel,povoa,gullies,configure,excision,facies,signers,1730s,insufficiency,semiotics,streatham,deactivation,entomological,skippers,albacete,parodying,escherichia,honorees,singaporeans,counterterrorism,tiruchirappalli,omnivorous,metropole,globalisation,athol,unbounded,codice_5,landforms,classifier,farmhouses,reaffirming,reparation,yomiuri,technologists,mitte,medica,viewable,steampunk,konya,kshatriya,repelling,edgewater,lamiinae,devas,potteries,llandaff,engendered,submits,virulence,uplifted,educationist,metropolitans,frontrunner,dunstable,forecastle,frets,methodius,exmouth,linnean,bouchet,repulsion,computable,equalling,liceo,tephritidae,agave,hydrological,azarenka,fairground,l'homme,enforces,xinhua,cinematographers,cooperstown,sa'id,paiute,christianization,tempos,chippenham,insulator,kotor,stereotyped,dello,cours,hisham,d'souza,eliminations,supercars,passau,rebrand,natures,coote,persephone,rededicated,cleaved,plenum,blistering,indiscriminately,cleese,safed,recursively,compacted,revues,hydration,shillong,echelons,garhwal,pedimented,grower,zwolle,wildflower,annexing,methionine,petah,valens,famitsu,petiole,specialities,nestorian,shahin,tokaido,shearwater,barberini,kinsmen,experimenter,alumnae,cloisters,alumina,pritzker,hardiness,soundgarden,julich,ps300,watercourse,cementing,wordplay,olivet,demesne,chasseurs,amide,zapotec,gaozu,porphyry,absorbers,indium,analogies,devotions,engravers,limestones,catapulted,surry,brickworks,gotra,rodham,landline,paleontologists,shankara,islip,raucous,trollope,arpad,embarkation,morphemes,recites,picardie,nakhchivan,tolerances,formula_47,khorramabad,nichiren,adrianople,kirkuk,assemblages,collider,bikaner,bushfires,roofline,coverings,reredos,bibliotheca,mantras,accentuated,commedia,rashtriya,fluctuation,serhiy,referential,fittipaldi,vesicle,geeta,iraklis,immediacy,chulalongkorn,hunsruck,bingen,dreadnoughts,stonemason,meenakshi,lebesgue,undergrowth,baltistan,paradoxes,parlement,articled,tiflis,dixieland,meriden,tejano,underdogs,barnstable,exemplify,venter,tropes,wielka,kankakee,iskandar,zilina,pharyngeal,spotify,materialised,picts,atlantique,theodoric,prepositions,paramilitaries,pinellas,attlee,actuated,piedmontese,grayling,thucydides,multifaceted,unedited,autonomously,universelle,utricularia,mooted,preto,incubated,underlie,brasenose,nootka,bushland,sensu,benzodiazepine,esteghlal,seagoing,amenhotep,azusa,sappers,culpeper,smokeless,thoroughbreds,dargah,gorda,alumna,mankato,zdroj,deleting,culvert,formula_49,punting,wushu,hindering,immunoglobulin,standardisation,birger,oilfield,quadrangular,ulama,recruiters,netanya,1630s,communaute,istituto,maciej,pathan,meher,vikas,characterizations,playmaker,interagency,intercepts,assembles,horthy,introspection,narada,matra,testes,radnicki,estonians,csiro,instar,mitford,adrenergic,crewmembers,haaretz,wasatch,lisburn,rangefinder,ordre,condensate,reforestation,corregidor,spvgg,modulator,mannerist,faulted,aspires,maktoum,squarepants,aethelred,piezoelectric,mulatto,dacre,progressions,jagiellonian,norge,samaria,sukhoi,effingham,coxless,hermetic,humanists,centrality,litters,stirlingshire,beaconsfield,sundanese,geometrically,caretakers,habitually,bandra,pashtuns,bradenton,arequipa,laminar,brickyard,hitchin,sustains,shipboard,ploughing,trechus,wheelers,bracketed,ilyushin,subotica,d'hondt,reappearance,bridgestone,intermarried,fulfilment,aphasia,birkbeck,transformational,strathmore,hornbill,millstone,lacan,voids,solothurn,gymnasiums,laconia,viaducts,peduncle,teachta,edgware,shinty,supernovae,wilfried,exclaim,parthia,mithun,flashpoint,moksha,cumbia,metternich,avalanches,militancy,motorist,rivadavia,chancellorsville,federals,gendered,bounding,footy,gauri,caliphs,lingam,watchmaker,unrecorded,riverina,unmodified,seafloor,droit,pfalz,chrysostom,gigabit,overlordship,besiege,espn2,oswestry,anachronistic,ballymena,reactivation,duchovny,ghani,abacetus,duller,legio,watercourses,nord-pas-de-calais,leiber,optometry,swarms,installer,sancti,adverbs,iheartmedia,meiningen,zeljko,kakheti,notional,circuses,patrilineal,acrobatics,infrastructural,sheva,oregonian,adjudication,aamir,wloclawek,overfishing,obstructive,subtracting,aurobindo,archeologist,newgate,'cause,secularization,tehsils,abscess,fingal,janacek,elkhorn,trims,kraftwerk,mandating,irregulars,faintly,congregationalist,sveti,kasai,mishaps,kennebec,provincially,durkheim,scotties,aicte,rapperswil,imphal,surrenders,morphs,nineveh,hoxha,cotabato,thuringian,metalworking,retold,shogakukan,anthers,proteasome,tippeligaen,disengagement,mockumentary,palatial,erupts,flume,corrientes,masthead,jaroslaw,rereleased,bharti,labors,distilling,tusks,varzim,refounded,enniskillen,melkite,semifinalists,vadodara,bermudian,capstone,grasse,origination,populus,alesi,arrondissements,semigroup,verein,opossum,messrs.,portadown,bulbul,tirupati,mulhouse,tetrahedron,roethlisberger,nonverbal,connexion,warangal,deprecated,gneiss,octet,vukovar,hesketh,chambre,despatch,claes,kargil,hideo,gravelly,tyndale,aquileia,tuners,defensible,tutte,theotokos,constructivist,ouvrage,dukla,polisario,monasticism,proscribed,commutation,testers,nipissing,codon,mesto,olivine,concomitant,exoskeleton,purports,coromandel,eyalet,dissension,hippocrates,purebred,yaounde,composting,oecophoridae,procopius,o'day,angiogenesis,sheerness,intelligencer,articular,felixstowe,aegon,endocrinology,trabzon,licinius,pagodas,zooplankton,hooghly,satie,drifters,sarthe,mercian,neuilly,tumours,canal+,scheldt,inclinations,counteroffensive,roadrunners,tuzla,shoreditch,surigao,predicates,carnot,algeciras,militaries,generalize,bulkheads,gawler,pollutant,celta,rundgren,microrna,gewog,olimpija,placental,lubelski,roxburgh,discerned,verano,kikuchi,musicale,l'enfant,ferocity,dimorphic,antigonus,erzurum,prebendary,recitative,discworld,cyrenaica,stigmella,totnes,sutta,pachuca,ulsan,downton,landshut,castellan,pleural,siedlce,siecle,catamaran,cottbus,utilises,trophic,freeholders,holyhead,u.s.s,chansons,responder,waziristan,suzuka,birding,shogi,asker,acetone,beautification,cytotoxic,dixit,hunterdon,cobblestone,formula_48,kossuth,devizes,sokoto,interlaced,shuttered,kilowatts,assiniboine,isaak,salto,alderney,sugarloaf,franchising,aggressiveness,toponyms,plaintext,antimatter,henin,equidistant,salivary,bilingualism,mountings,obligate,extirpated,irenaeus,misused,pastoralists,aftab,immigrating,warping,tyrolean,seaforth,teesside,soundwave,oligarchy,stelae,pairwise,iupac,tezuka,posht,orchestrations,landmass,ironstone,gallia,hjalmar,carmelites,strafford,elmhurst,palladio,fragility,teleplay,gruffudd,karoly,yerba,potok,espoo,inductance,macaque,nonprofits,pareto,rock'n'roll,spiritualist,shadowed,skateboarder,utterances,generality,congruence,prostrate,deterred,yellowknife,albarn,maldon,battlements,mohsen,insecticides,khulna,avellino,menstruation,glutathione,springdale,parlophone,confraternity,korps,countrywide,bosphorus,preexisting,damodar,astride,alexandrovich,sprinting,crystallized,botev,leaching,interstates,veers,angevin,undaunted,yevgeni,nishapur,northerners,alkmaar,bethnal,grocers,sepia,tornus,exemplar,trobe,charcot,gyeonggi,larne,tournai,lorain,voided,genji,enactments,maxilla,adiabatic,eifel,nazim,transducer,thelonious,pyrite,deportiva,dialectal,bengt,rosettes,labem,sergeyevich,synoptic,conservator,statuette,biweekly,adhesives,bifurcation,rajapaksa,mammootty,republique,yusef,waseda,marshfield,yekaterinburg,minnelli,fundy,fenian,matchups,dungannon,supremacist,panelled,drenthe,iyengar,fibula,narmada,homeport,oceanside,precept,antibacterial,altarpieces,swath,ospreys,lillooet,legnica,lossless,formula_50,galvatron,iorga,stormont,rsfsr,loggers,kutno,phenomenological,medallists,cuatro,soissons,homeopathy,bituminous,injures,syndicates,typesetting,displacements,dethroned,makassar,lucchese,abergavenny,targu,alborz,akb48,boldface,gastronomy,sacra,amenity,accumulator,myrtaceae,cornices,mourinho,denunciation,oxbow,diddley,aargau,arbitrage,bedchamber,gruffydd,zamindar,klagenfurt,caernarfon,slowdown,stansted,abrasion,tamaki,suetonius,dukakis,individualistic,ventrally,hotham,perestroika,ketones,fertilisation,sobriquet,couplings,renderings,misidentified,rundfunk,sarcastically,braniff,concours,dismissals,elegantly,modifiers,crediting,combos,crucially,seafront,lieut,ischemia,manchus,derivations,proteases,aristophanes,adenauer,porting,hezekiah,sante,trulli,hornblower,foreshadowing,ypsilanti,dharwad,khani,hohenstaufen,distillers,cosmodrome,intracranial,turki,salesian,gorzow,jihlava,yushchenko,leichhardt,venables,cassia,eurogamer,airtel,curative,bestsellers,timeform,sortied,grandview,massillon,ceding,pilbara,chillicothe,heredity,elblag,rogaland,ronne,millennial,batley,overuse,bharata,fille,campbelltown,abeyance,counterclockwise,250cc,neurodegenerative,consigned,electromagnetism,sunnah,saheb,exons,coxswain,gleaned,bassoons,worksop,prismatic,immigrate,pickets,takeo,bobsledder,stosur,fujimori,merchantmen,stiftung,forli,endorses,taskforce,thermally,atman,gurps,floodplains,enthalpy,extrinsic,setubal,kennesaw,grandis,scalability,durations,showrooms,prithvi,outro,overruns,andalucia,amanita,abitur,hipper,mozambican,sustainment,arsene,chesham,palaeolithic,reportage,criminality,knowsley,haploid,atacama,shueisha,ridgefield,astern,getafe,lineal,timorese,restyled,hollies,agincourt,unter,justly,tannins,mataram,industrialised,tarnovo,mumtaz,mustapha,stretton,synthetase,condita,allround,putra,stjepan,troughs,aechmea,specialisation,wearable,kadokawa,uralic,aeros,messiaen,existentialism,jeweller,effigies,gametes,fjordane,cochlear,interdependent,demonstrative,unstructured,emplacement,famines,spindles,amplitudes,actuator,tantalum,psilocybe,apnea,monogatari,expulsions,seleucus,tsuen,hospitaller,kronstadt,eclipsing,olympiakos,clann,canadensis,inverter,helio,egyptologist,squamous,resonate,munir,histology,torbay,khans,jcpenney,veterinarians,aintree,microscopes,colonised,reflectors,phosphorylated,pristimantis,tulare,corvinus,multiplexing,midweek,demosthenes,transjordan,ecija,tengku,vlachs,anamorphic,counterweight,radnor,trinitarian,armidale,maugham,njsiaa,futurism,stairways,avicenna,montebello,bridgetown,wenatchee,lyonnais,amass,surinamese,streptococcus,m*a*s*h,hydrogenation,frazioni,proscenium,kalat,pennsylvanian,huracan,tallying,kralove,nucleolar,phrygian,seaports,hyacinthe,ignace,donning,instalment,regnal,fonds,prawn,carell,folktales,goaltending,bracknell,vmware,patriarchy,mitsui,kragujevac,pythagoras,soult,thapa,disproved,suwalki,secures,somoza,l'ecole,divizia,chroma,herders,technologist,deduces,maasai,rampur,paraphrase,raimi,imaged,magsaysay,ivano,turmeric,formula_51,subcommittees,axillary,ionosphere,organically,indented,refurbishing,pequot,violinists,bearn,colle,contralto,silverton,mechanization,etruscans,wittelsbach,pasir,redshirted,marrakesh,scarp,plein,wafers,qareh,teotihuacan,frobenius,sinensis,rehoboth,bundaberg,newbridge,hydrodynamic,traore,abubakar,adjusts,storytellers,dynamos,verbandsliga,concertmaster,exxonmobil,appreciable,sieradz,marchioness,chaplaincy,rechristened,cunxu,overpopulation,apolitical,sequencer,beaked,nemanja,binaries,intendant,absorber,filamentous,indebtedness,nusra,nashik,reprises,psychedelia,abwehr,ligurian,isoform,resistive,pillaging,mahathir,reformatory,lusatia,allerton,ajaccio,tepals,maturin,njcaa,abyssinian,objector,fissures,sinuous,ecclesiastic,dalits,caching,deckers,phosphates,wurlitzer,navigated,trofeo,berea,purefoods,solway,unlockable,grammys,kostroma,vocalizations,basilan,rebuke,abbasi,douala,helsingborg,ambon,bakar,runestones,cenel,tomislav,pigmented,northgate,excised,seconda,kirke,determinations,dedicates,vilas,pueblos,reversion,unexploded,overprinted,ekiti,deauville,masato,anaesthesia,endoplasmic,transponders,aguascalientes,hindley,celluloid,affording,bayeux,piaget,rickshaws,eishockey,camarines,zamalek,undersides,hardwoods,hermitian,mutinied,monotone,blackmails,affixes,jpmorgan,habermas,mitrovica,paleontological,polystyrene,thana,manas,conformist,turbofan,decomposes,logano,castration,metamorphoses,patroness,herbicide,mikolaj,rapprochement,macroeconomics,barranquilla,matsudaira,lintels,femina,hijab,spotsylvania,morpheme,bitola,baluchistan,kurukshetra,otway,extrusion,waukesha,menswear,helder,trung,bingley,protester,boars,overhang,differentials,exarchate,hejaz,kumara,unjustified,timings,sharpness,nuovo,taisho,sundar,etc..,jehan,unquestionably,muscovy,daltrey,canute,paneled,amedeo,metroplex,elaborates,telus,tetrapods,dragonflies,epithets,saffir,parthenon,lucrezia,refitting,pentateuch,hanshin,montparnasse,lumberjacks,sanhedrin,erectile,odors,greenstone,resurgent,leszek,amory,substituents,prototypical,viewfinder,monck,universiteit,joffre,revives,chatillon,seedling,scherzo,manukau,ashdod,gympie,homolog,stalwarts,ruinous,weibo,tochigi,wallenberg,gayatri,munda,satyagraha,storefronts,heterogeneity,tollway,sportswriters,binocular,gendarmes,ladysmith,tikal,ortsgemeinde,ja'far,osmotic,linlithgow,bramley,telecoms,pugin,repose,rupaul,sieur,meniscus,garmisch,reintroduce,400th,shoten,poniatowski,drome,kazakhstani,changeover,astronautics,husserl,herzl,hypertext,katakana,polybius,antananarivo,seong,breguet,reliquary,utada,aggregating,liangshan,sivan,tonawanda,audiobooks,shankill,coulee,phenolic,brockton,bookmakers,handsets,boaters,wylde,commonality,mappings,silhouettes,pennines,maurya,pratchett,singularities,eschewed,pretensions,vitreous,ibero,totalitarianism,poulenc,lingered,directx,seasoning,deputation,interdict,illyria,feedstock,counterbalance,muzik,buganda,parachuted,violist,homogeneity,comix,fjords,corsairs,punted,verandahs,equilateral,laoghaire,magyars,117th,alesund,televoting,mayotte,eateries,refurbish,nswrl,yukio,caragiale,zetas,dispel,codecs,inoperable,outperformed,rejuvenation,elstree,modernise,contributory,pictou,tewkesbury,chechens,ashina,psionic,refutation,medico,overdubbed,nebulae,sandefjord,personages,eccellenza,businessperson,placename,abenaki,perryville,threshing,reshaped,arecibo,burslem,colspan=3|turnout,rebadged,lumia,erinsborough,interactivity,bitmap,indefatigable,theosophy,excitatory,gleizes,edsel,bermondsey,korce,saarinen,wazir,diyarbakir,cofounder,liberalisation,onsen,nighthawks,siting,retirements,semyon,d'histoire,114th,redditch,venetia,praha,'round,valdosta,hieroglyphic,postmedial,edirne,miscellany,savona,cockpits,minimization,coupler,jacksonian,appeasement,argentines,saurashtra,arkwright,hesiod,folios,fitzalan,publica,rivaled,civitas,beermen,constructivism,ribeira,zeitschrift,solanum,todos,deformities,chilliwack,verdean,meagre,bishoprics,gujrat,yangzhou,reentered,inboard,mythologies,virtus,unsurprisingly,rusticated,museu,symbolise,proportionate,thesaban,symbian,aeneid,mitotic,veliki,compressive,cisterns,abies,winemaker,massenet,bertolt,ahmednagar,triplemania,armorial,administracion,tenures,smokehouse,hashtag,fuerza,regattas,gennady,kanazawa,mahmudabad,crustal,asaph,valentinian,ilaiyaraaja,honeyeater,trapezoidal,cooperatively,unambiguously,mastodon,inhospitable,harnesses,riverton,renewables,djurgardens,haitians,airings,humanoids,boatswain,shijiazhuang,faints,veera,punjabis,steepest,narain,karlovy,serre,sulcus,collectives,1500m,arion,subarctic,liberally,apollonius,ostia,droplet,headstones,norra,robusta,maquis,veronese,imola,primers,luminance,escadrille,mizuki,irreconcilable,stalybridge,temur,paraffin,stuccoed,parthians,counsels,fundamentalists,vivendi,polymath,sugababes,mikko,yonne,fermions,vestfold,pastoralist,kigali,unseeded,glarus,cusps,amasya,northwesterly,minorca,astragalus,verney,trevelyan,antipathy,wollstonecraft,bivalves,boulez,royle,divisao,quranic,bareilly,coronal,deviates,lulea,erectus,petronas,chandan,proxies,aeroflot,postsynaptic,memoriam,moyne,gounod,kuznetsova,pallava,ordinating,reigate,'first,lewisburg,exploitative,danby,academica,bailiwick,brahe,injective,stipulations,aeschylus,computes,gulden,hydroxylase,liveries,somalis,underpinnings,muscovite,kongsberg,domus,overlain,shareware,variegated,jalalabad,agence,ciphertext,insectivores,dengeki,menuhin,cladistic,baerum,betrothal,tokushima,wavelet,expansionist,pottsville,siyuan,prerequisites,carpi,nemzeti,nazar,trialled,eliminator,irrorated,homeward,redwoods,undeterred,strayed,lutyens,multicellular,aurelian,notated,lordships,alsatian,idents,foggia,garros,chalukyas,lillestrom,podlaski,pessimism,hsien,demilitarized,whitewashed,willesden,kirkcaldy,sanctorum,lamia,relaying,escondido,paediatric,contemplates,demarcated,bluestone,betula,penarol,capitalise,kreuznach,kenora,115th,hold'em,reichswehr,vaucluse,m.i.a,windings,boys/girls,cajon,hisar,predictably,flemington,ysgol,mimicked,clivina,grahamstown,ionia,glyndebourne,patrese,aquaria,sleaford,dayal,sportscenter,malappuram,m.b.a.,manoa,carbines,solvable,designator,ramanujan,linearity,academicians,sayid,lancastrian,factorial,strindberg,vashem,delos,comyn,condensing,superdome,merited,kabaddi,intransitive,bideford,neuroimaging,duopoly,scorecards,ziggler,heriot,boyars,virology,marblehead,microtubules,westphalian,anticipates,hingham,searchers,harpist,rapides,morricone,convalescent,mises,nitride,metrorail,matterhorn,bicol,drivetrain,marketer,snippet,winemakers,muban,scavengers,halberstadt,herkimer,peten,laborious,stora,montgomeryshire,booklist,shamir,herault,eurostar,anhydrous,spacewalk,ecclesia,calliostoma,highschool,d'oro,suffusion,imparts,overlords,tagus,rectifier,counterinsurgency,ministered,eilean,milecastle,contre,micromollusk,okhotsk,bartoli,matroid,hasidim,thirunal,terme,tarlac,lashkar,presque,thameslink,flyby,troopship,renouncing,fatih,messrs,vexillum,bagration,magnetite,bornholm,androgynous,vehement,tourette,philosophic,gianfranco,tuileries,codice_6,radially,flexion,hants,reprocessing,setae,burne,palaeographically,infantryman,shorebirds,tamarind,moderna,threading,militaristic,crohn,norrkoping,125cc,stadtholder,troms,klezmer,alphanumeric,brome,emmanuelle,tiwari,alchemical,formula_52,onassis,bleriot,bipedal,colourless,hermeneutics,hosni,precipitating,turnstiles,hallucinogenic,panhellenic,wyandotte,elucidated,chita,ehime,generalised,hydrophilic,biota,niobium,rnzaf,gandhara,longueuil,logics,sheeting,bielsko,cuvier,kagyu,trefoil,docent,pancrase,stalinism,postures,encephalopathy,monckton,imbalances,epochs,leaguers,anzio,diminishes,pataki,nitrite,amuro,nabil,maybach,l'aquila,babbler,bacolod,thutmose,evora,gaudi,breakage,recur,preservative,60deg,mendip,functionaries,columnar,maccabiah,chert,verden,bromsgrove,clijsters,dengue,pastorate,phuoc,principia,viareggio,kharagpur,scharnhorst,anyang,bosons,l'art,criticises,ennio,semarang,brownian,mirabilis,asperger,calibers,typographical,cartooning,minos,disembark,supranational,undescribed,etymologically,alappuzha,vilhelm,lanao,pakenham,bhagavata,rakoczi,clearings,astrologers,manitowoc,bunuel,acetylene,scheduler,defamatory,trabzonspor,leaded,scioto,pentathlete,abrahamic,minigames,aldehydes,peerages,legionary,1640s,masterworks,loudness,bryansk,likeable,genocidal,vegetated,towpath,declination,pyrrhus,divinely,vocations,rosebery,associazione,loaders,biswas,oeste,tilings,xianzong,bhojpuri,annuities,relatedness,idolator,psers,constriction,chuvash,choristers,hanafi,fielders,grammarian,orpheum,asylums,millbrook,gyatso,geldof,stabilise,tableaux,diarist,kalahari,panini,cowdenbeath,melanin,4x100m,resonances,pinar,atherosclerosis,sheringham,castlereagh,aoyama,larks,pantograph,protrude,natak,gustafsson,moribund,cerevisiae,cleanly,polymeric,holkar,cosmonauts,underpinning,lithosphere,firuzabad,languished,mingled,citrate,spadina,lavas,daejeon,fibrillation,porgy,pineville,ps1000,cobbled,emamzadeh,mukhtar,dampers,indelible,salonika,nanoscale,treblinka,eilat,purporting,fluctuate,mesic,hagiography,cutscenes,fondation,barrens,comically,accrue,ibrox,makerere,defections,'there,hollandia,skene,grosseto,reddit,objectors,inoculation,rowdies,playfair,calligrapher,namor,sibenik,abbottabad,propellants,hydraulically,chloroplasts,tablelands,tecnico,schist,klasse,shirvan,bashkortostan,bullfighting,north/south,polski,hanns,woodblock,kilmore,ejecta,ignacy,nanchang,danubian,commendations,snohomish,samaritans,argumentation,vasconcelos,hedgehogs,vajrayana,barents,kulkarni,kumbakonam,identifications,hillingdon,weirs,nayanar,beauvoir,messe,divisors,atlantiques,broods,affluence,tegucigalpa,unsuited,autodesk,akash,princeps,culprits,kingstown,unassuming,goole,visayan,asceticism,blagojevich,irises,paphos,unsound,maurier,pontchartrain,desertification,sinfonietta,latins,especial,limpet,valerenga,glial,brainstem,mitral,parables,sauropod,judean,iskcon,sarcoma,venlo,justifications,zhuhai,blavatsky,alleviated,usafe,steppenwolf,inversions,janko,chagall,secretory,basildon,saguenay,pergamon,hemispherical,harmonized,reloading,franjo,domaine,extravagance,relativism,metamorphosed,labuan,baloncesto,gmail,byproducts,calvinists,counterattacked,vitus,bubonic,120th,strachey,ritually,brookwood,selectable,savinja,incontinence,meltwater,jinja,1720s,brahmi,morgenthau,sheaves,sleeved,stratovolcano,wielki,utilisation,avoca,fluxus,panzergrenadier,philately,deflation,podlaska,prerogatives,kuroda,theophile,zhongzong,gascoyne,magus,takao,arundell,fylde,merdeka,prithviraj,venkateswara,liepaja,daigo,dreamland,reflux,sunnyvale,coalfields,seacrest,soldering,flexor,structuralism,alnwick,outweighed,unaired,mangeshkar,batons,glaad,banshees,irradiated,organelles,biathlete,cabling,chairlift,lollapalooza,newsnight,capacitive,succumbs,flatly,miramichi,burwood,comedienne,charteris,biotic,workspace,aficionados,sokolka,chatelet,o'shaughnessy,prosthesis,neoliberal,refloated,oppland,hatchlings,econometrics,loess,thieu,androids,appalachians,jenin,pterostichinae,downsized,foils,chipsets,stencil,danza,narrate,maginot,yemenite,bisects,crustacean,prescriptive,melodious,alleviation,empowers,hansson,autodromo,obasanjo,osmosis,daugava,rheumatism,moraes,leucine,etymologies,chepstow,delaunay,bramall,bajaj,flavoring,approximates,marsupials,incisive,microcomputer,tactically,waals,wilno,fisichella,ursus,hindmarsh,mazarin,lomza,xenophobia,lawlessness,annecy,wingers,gornja,gnaeus,superieur,tlaxcala,clasps,symbolises,slats,rightist,effector,blighted,permanence,divan,progenitors,kunsthalle,anointing,excelling,coenzyme,indoctrination,dnipro,landholdings,adriaan,liturgies,cartan,ethmia,attributions,sanctus,trichy,chronicon,tancred,affinis,kampuchea,gantry,pontypool,membered,distrusted,fissile,dairies,hyposmocoma,craigie,adarsh,martinsburg,taxiway,30deg,geraint,vellum,bencher,khatami,formula_53,zemun,teruel,endeavored,palmares,pavements,u.s..,internationalization,satirized,carers,attainable,wraparound,muang,parkersburg,extinctions,birkenfeld,wildstorm,payers,cohabitation,unitas,culloden,capitalizing,clwyd,daoist,campinas,emmylou,orchidaceae,halakha,orientales,fealty,domnall,chiefdom,nigerians,ladislav,dniester,avowed,ergonomics,newsmagazine,kitsch,cantilevered,benchmarking,remarriage,alekhine,coldfield,taupo,almirante,substations,apprenticeships,seljuq,levelling,eponym,symbolising,salyut,opioids,underscore,ethnologue,mohegan,marikina,libro,bassano,parse,semantically,disjointed,dugdale,padraig,tulsi,modulating,xfinity,headlands,mstislav,earthworms,bourchier,lgbtq,embellishments,pennants,rowntree,betel,motet,mulla,catenary,washoe,mordaunt,dorking,colmar,girardeau,glentoran,grammatically,samad,recreations,technion,staccato,mikoyan,spoilers,lyndhurst,victimization,chertsey,belafonte,tondo,tonsberg,narrators,subcultures,malformations,edina,augmenting,attests,euphemia,cabriolet,disguising,1650s,navarrese,demoralized,cardiomyopathy,welwyn,wallachian,smoothness,planktonic,voles,issuers,sardasht,survivability,cuauhtemoc,thetis,extruded,signet,raghavan,lombok,eliyahu,crankcase,dissonant,stolberg,trencin,desktops,bursary,collectivization,charlottenburg,triathlete,curvilinear,involuntarily,mired,wausau,invades,sundaram,deletions,bootstrap,abellio,axiomatic,noguchi,setups,malawian,visalia,materialist,kartuzy,wenzong,plotline,yeshivas,parganas,tunica,citric,conspecific,idlib,superlative,reoccupied,blagoevgrad,masterton,immunological,hatta,courbet,vortices,swallowtail,delves,haridwar,diptera,boneh,bahawalpur,angering,mardin,equipments,deployable,guanine,normality,rimmed,artisanal,boxset,chandrasekhar,jools,chenar,tanakh,carcassonne,belatedly,millville,anorthosis,reintegration,velde,surfactant,kanaan,busoni,glyphipterix,personas,fullness,rheims,tisza,stabilizers,bharathi,joost,spinola,mouldings,perching,esztergom,afzal,apostate,lustre,s.league,motorboat,monotheistic,armature,barat,asistencia,bloomsburg,hippocampal,fictionalised,defaults,broch,hexadecimal,lusignan,ryanair,boccaccio,breisgau,southbank,bskyb,adjoined,neurobiology,aforesaid,sadhu,langue,headship,wozniacki,hangings,regulus,prioritized,dynamism,allier,hannity,shimin,antoninus,gymnopilus,caledon,preponderance,melayu,electrodynamics,syncopated,ibises,krosno,mechanistic,morpeth,harbored,albini,monotheism,'real,hyperactivity,haveli,writer/director,minato,nimoy,caerphilly,chitral,amirabad,fanshawe,l'oreal,lorde,mukti,authoritarianism,valuing,spyware,hanbury,restarting,stato,embed,suiza,empiricism,stabilisation,stari,castlemaine,orbis,manufactory,mauritanian,shoji,taoyuan,prokaryotes,oromia,ambiguities,embodying,slims,frente,innovate,ojibwa,powdery,gaeltacht,argentinos,quatermass,detergents,fijians,adaptor,tokai,chileans,bulgars,oxidoreductases,bezirksliga,conceicao,myosin,nellore,500cc,supercomputers,approximating,glyndwr,polypropylene,haugesund,cockerell,tudman,ashbourne,hindemith,bloodlines,rigveda,etruria,romanos,steyn,oradea,deceleration,manhunter,laryngeal,fraudulently,janez,wendover,haplotype,janaki,naoki,belizean,mellencamp,cartographic,sadhana,tricolour,pseudoscience,satara,bytow,s.p.a.,jagdgeschwader,arcot,omagh,sverdrup,masterplan,surtees,apocrypha,ahvaz,d'amato,socratic,leumit,unnumbered,nandini,witold,marsupial,coalesced,interpolated,gimnasia,karadzic,keratin,mamoru,aldeburgh,speculator,escapement,irfan,kashyap,satyajit,haddington,solver,rothko,ashkelon,kickapoo,yeomen,superbly,bloodiest,greenlandic,lithic,autofocus,yardbirds,poona,keble,javan,sufis,expandable,tumblr,ursuline,swimwear,winwood,counsellors,aberrations,marginalised,befriending,workouts,predestination,varietal,siddhartha,dunkeld,judaic,esquimalt,shabab,ajith,telefonica,stargard,hoysala,radhakrishnan,sinusoidal,strada,hiragana,cebuano,monoid,independencia,floodwaters,mildura,mudflats,ottokar,translit,radix,wigner,philosophically,tephritid,synthesizing,castletown,installs,stirner,resettle,bushfire,choirmaster,kabbalistic,shirazi,lightship,rebus,colonizers,centrifuge,leonean,kristofferson,thymus,clackamas,ratnam,rothesay,municipally,centralia,thurrock,gulfport,bilinear,desirability,merite,psoriasis,macaw,erigeron,consignment,mudstone,distorting,karlheinz,ramen,tailwheel,vitor,reinsurance,edifices,superannuation,dormancy,contagion,cobden,rendezvoused,prokaryotic,deliberative,patricians,feigned,degrades,starlings,sopot,viticultural,beaverton,overflowed,convener,garlands,michiel,ternopil,naturelle,biplanes,bagot,gamespy,ventspils,disembodied,flattening,profesional,londoners,arusha,scapular,forestall,pyridine,ulema,eurodance,aruna,callus,periodontal,coetzee,immobilized,o'meara,maharani,katipunan,reactants,zainab,microgravity,saintes,britpop,carrefour,constrain,adversarial,firebirds,brahmo,kashima,simca,surety,surpluses,superconductivity,gipuzkoa,cumans,tocantins,obtainable,humberside,roosting,'king,formula_54,minelayer,bessel,sulayman,cycled,biomarkers,annealing,shusha,barda,cassation,djing,polemics,tuple,directorates,indomitable,obsolescence,wilhelmine,pembina,bojan,tambo,dioecious,pensioner,magnificat,1660s,estrellas,southeasterly,immunodeficiency,railhead,surreptitiously,codeine,encores,religiosity,tempera,camberley,efendi,boardings,malleable,hagia,input/output,lucasfilm,ujjain,polymorphisms,creationist,berners,mickiewicz,irvington,linkedin,endures,kinect,munition,apologetics,fairlie,predicated,reprinting,ethnographer,variances,levantine,mariinsky,jadid,jarrow,asia/oceania,trinamool,waveforms,bisexuality,preselection,pupae,buckethead,hieroglyph,lyricists,marionette,dunbartonshire,restorer,monarchical,pazar,kickoffs,cabildo,savannas,gliese,dench,spoonbills,novelette,diliman,hypersensitivity,authorising,montefiore,mladen,qu'appelle,theistic,maruti,laterite,conestoga,saare,californica,proboscis,carrickfergus,imprecise,hadassah,baghdadi,jolgeh,deshmukh,amusements,heliopolis,berle,adaptability,partenkirchen,separations,baikonur,cardamom,southeastward,southfield,muzaffar,adequacy,metropolitana,rajkot,kiyoshi,metrobus,evictions,reconciles,librarianship,upsurge,knightley,badakhshan,proliferated,spirituals,burghley,electroacoustic,professing,featurette,reformists,skylab,descriptors,oddity,greyfriars,injects,salmond,lanzhou,dauntless,subgenera,underpowered,transpose,mahinda,gatos,aerobatics,seaworld,blocs,waratahs,joris,giggs,perfusion,koszalin,mieczyslaw,ayyubid,ecologists,modernists,sant'angelo,quicktime,him/her,staves,sanyo,melaka,acrocercops,qigong,iterated,generalizes,recuperation,vihara,circassians,psychical,chavo,memoires,infiltrates,notaries,pelecaniformesfamily,strident,chivalric,pierrepont,alleviating,broadsides,centipede,b.tech,reinterpreted,sudetenland,hussite,covenanters,radhika,ironclads,gainsbourg,testis,penarth,plantar,azadegan,beano,espn.com,leominster,autobiographies,nbcuniversal,eliade,khamenei,montferrat,undistinguished,ethnological,wenlock,fricatives,polymorphic,biome,joule,sheaths,astrophysicist,salve,neoclassicism,lovat,downwind,belisarius,forma,usurpation,freie,depopulation,backbench,ascenso,'high,aagpbl,gdanski,zalman,mouvement,encapsulation,bolshevism,statny,voyageurs,hywel,vizcaya,mazra'eh,narthex,azerbaijanis,cerebrospinal,mauretania,fantail,clearinghouse,bolingbroke,pequeno,ansett,remixing,microtubule,wrens,jawahar,palembang,gambian,hillsong,fingerboard,repurposed,sundry,incipient,veolia,theologically,ulaanbaatar,atsushi,foundling,resistivity,myeloma,factbook,mazowiecka,diacritic,urumqi,clontarf,provokes,intelsat,professes,materialise,portobello,benedictines,panionios,introverted,reacquired,bridport,mammary,kripke,oratorios,vlore,stoning,woredas,unreported,antti,togolese,fanzines,heuristics,conservatories,carburetors,clitheroe,cofounded,formula_57,erupting,quinnipiac,bootle,ghostface,sittings,aspinall,sealift,transferase,boldklub,siskiyou,predominated,francophonie,ferruginous,castrum,neogene,sakya,madama,precipitous,'love,posix,bithynia,uttara,avestan,thrushes,seiji,memorably,septimius,libri,cibernetico,hyperinflation,dissuaded,cuddalore,peculiarity,vaslui,grojec,albumin,thurles,casks,fasteners,fluidity,buble,casals,terek,gnosticism,cognates,ulnar,radwanska,babylonians,majuro,oxidizer,excavators,rhythmically,liffey,gorakhpur,eurydice,underscored,arborea,lumumba,tuber,catholique,grama,galilei,scrope,centreville,jacobin,bequests,ardeche,polygamous,montauban,terai,weatherboard,readability,attainder,acraea,transversely,rivets,winterbottom,reassures,bacteriology,vriesea,chera,andesite,dedications,homogenous,reconquered,bandon,forrestal,ukiyo,gurdjieff,tethys,sparc,muscogee,grebes,belchatow,mansa,blantyre,palliser,sokolow,fibroblasts,exmoor,misaki,soundscapes,housatonic,middelburg,convenor,leyla,antipope,histidine,okeechobee,alkenes,sombre,alkene,rubik,macaques,calabar,trophee,pinchot,'free,frusciante,chemins,falaise,vasteras,gripped,schwarzenberg,cumann,kanchipuram,acoustically,silverbacks,fangio,inset,plympton,kuril,vaccinations,recep,theropods,axils,stavropol,encroached,apoptotic,papandreou,wailers,moonstone,assizes,micrometers,hornchurch,truncation,annapurna,egyptologists,rheumatic,promiscuity,satiric,fleche,caloptilia,anisotropy,quaternions,gruppo,viscounts,awardees,aftershocks,sigint,concordance,oblasts,gaumont,stent,commissars,kesteven,hydroxy,vijayanagar,belorussian,fabricius,watermark,tearfully,mamet,leukaemia,sorkh,milepost,tattooing,vosta,abbasids,uncompleted,hedong,woodwinds,extinguishing,malus,multiplexes,francoist,pathet,responsa,bassists,'most,postsecondary,ossory,grampian,saakashvili,alito,strasberg,impressionistic,volador,gelatinous,vignette,underwing,campanian,abbasabad,albertville,hopefuls,nieuwe,taxiways,reconvened,recumbent,pathologists,unionized,faversham,asymptotically,romulo,culling,donja,constricted,annesley,duomo,enschede,lovech,sharpshooter,lansky,dhamma,papillae,alanine,mowat,delius,wrest,mcluhan,podkarpackie,imitators,bilaspur,stunting,pommel,casemate,handicaps,nagas,testaments,hemings,necessitate,rearward,locative,cilla,klitschko,lindau,merion,consequential,antic,soong,copula,berthing,chevrons,rostral,sympathizer,budokan,ranulf,beria,stilt,replying,conflated,alcibiades,painstaking,yamanashi,calif.,arvid,ctesiphon,xizong,rajas,caxton,downbeat,resurfacing,rudders,miscegenation,deathmatch,foregoing,arthropod,attestation,karts,reapportionment,harnessing,eastlake,schola,dosing,postcolonial,imtiaz,formula_55,insulators,gunung,accumulations,pampas,llewelyn,bahnhof,cytosol,grosjean,teaneck,briarcliff,arsenio,canara,elaborating,passchendaele,searchlights,holywell,mohandas,preventable,gehry,mestizos,ustinov,cliched,'national,heidfeld,tertullian,jihadist,tourer,miletus,semicircle,outclassed,bouillon,cardinalate,clarifies,dakshina,bilayer,pandyan,unrwa,chandragupta,formula_56,portola,sukumaran,lactation,islamia,heikki,couplers,misappropriation,catshark,montt,ploughs,carib,stator,leaderboard,kenrick,dendrites,scape,tillamook,molesworth,mussorgsky,melanesia,restated,troon,glycoside,truckee,headwater,mashup,sectoral,gangwon,docudrama,skirting,psychopathology,dramatised,ostroleka,infestations,thabo,depolarization,wideroe,eisenbahn,thomond,kumaon,upendra,foreland,acronyms,yaqui,retaking,raphaelite,specie,dupage,villars,lucasarts,chloroplast,werribee,balsa,ascribe,havant,flava,khawaja,tyumen,subtract,interrogators,reshaping,buzzcocks,eesti,campanile,potemkin,apertures,snowboarder,registrars,handbooks,boyar,contaminant,depositors,proximate,jeunesse,zagora,pronouncements,mists,nihilism,deified,margraviate,pietersen,moderators,amalfi,adjectival,copepods,magnetosphere,pallets,clemenceau,castra,perforation,granitic,troilus,grzegorz,luthier,dockyards,antofagasta,ffestiniog,subroutine,afterword,waterwheel,druce,nitin,undifferentiated,emacs,readmitted,barneveld,tapers,hittites,infomercials,infirm,braathens,heligoland,carpark,geomagnetic,musculoskeletal,nigerien,machinima,harmonize,repealing,indecency,muskoka,verite,steubenville,suffixed,cytoskeleton,surpasses,harmonia,imereti,ventricles,heterozygous,envisions,otsego,ecoles,warrnambool,burgenland,seria,rawat,capistrano,welby,kirin,enrollments,caricom,dragonlance,schaffhausen,expanses,photojournalism,brienne,etude,referent,jamtland,schemas,xianbei,cleburne,bicester,maritima,shorelines,diagonals,bjelke,nonpublic,aliasing,m.f.a,ovals,maitreya,skirmishing,grothendieck,sukhothai,angiotensin,bridlington,durgapur,contras,gakuen,skagit,rabbinate,tsunamis,haphazard,tyldesley,microcontroller,discourages,hialeah,compressing,septimus,larvik,condoleezza,psilocybin,protectionism,songbirds,clandestinely,selectmen,wargame,cinemascope,khazars,agronomy,melzer,latifah,cherokees,recesses,assemblymen,basescu,banaras,bioavailability,subchannels,adenine,o'kelly,prabhakar,leonese,dimethyl,testimonials,geoffroy,oxidant,universiti,gheorghiu,bohdan,reversals,zamorin,herbivore,jarre,sebastiao,infanterie,dolmen,teddington,radomsko,spaceships,cuzco,recapitulation,mahoning,bainimarama,myelin,aykroyd,decals,tokelau,nalgonda,rajasthani,121st,quelled,tambov,illyrians,homilies,illuminations,hypertrophy,grodzisk,inundation,incapacity,equilibria,combats,elihu,steinitz,berengar,gowda,canwest,khosrau,maculata,houten,kandinsky,onside,leatherhead,heritable,belvidere,federative,chukchi,serling,eruptive,patan,entitlements,suffragette,evolutions,migrates,demobilisation,athleticism,trope,sarpsborg,kensal,translink,squamish,concertgebouw,energon,timestamp,competences,zalgiris,serviceman,codice_7,spoofing,assange,mahadevan,skien,suceava,augustan,revisionism,unconvincing,hollande,drina,gottlob,lippi,broglie,darkening,tilapia,eagerness,nacht,kolmogorov,photometric,leeuwarden,jrotc,haemorrhage,almanack,cavalli,repudiation,galactose,zwickau,cetinje,houbraken,heavyweights,gabonese,ordinals,noticias,museveni,steric,charaxes,amjad,resection,joinville,leczyca,anastasius,purbeck,subtribe,dalles,leadoff,monoamine,jettisoned,kaori,anthologized,alfreton,indic,bayezid,tottori,colonizing,assassinating,unchanging,eusebian,d'estaing,tsingtao,toshio,transferases,peronist,metrology,equus,mirpur,libertarianism,kovil,indole,'green,abstention,quantitatively,icebreakers,tribals,mainstays,dryandra,eyewear,nilgiri,chrysanthemum,inositol,frenetic,merchantman,hesar,physiotherapist,transceiver,dancefloor,rankine,neisse,marginalization,lengthen,unaided,rework,pageantry,savio,striated,funen,witton,illuminates,frass,hydrolases,akali,bistrita,copywriter,firings,handballer,tachinidae,dmytro,coalesce,neretva,menem,moraines,coatbridge,crossrail,spoofed,drosera,ripen,protour,kikuyu,boleslav,edwardes,troubadours,haplogroups,wrasse,educationalist,sroda,khaneh,dagbladet,apennines,neuroscientist,deplored,terje,maccabees,daventry,spaceport,lessening,ducats,singer/guitarist,chambersburg,yeong,configurable,ceremonially,unrelenting,caffe,graaf,denizens,kingsport,ingush,panhard,synthesised,tumulus,homeschooled,bozorg,idiomatic,thanhouser,queensway,radek,hippolytus,inking,banovina,peacocks,piaui,handsworth,pantomimes,abalone,thera,kurzweil,bandura,augustinians,bocelli,ferrol,jiroft,quadrature,contravention,saussure,rectification,agrippina,angelis,matanzas,nidaros,palestrina,latium,coriolis,clostridium,ordain,uttering,lanchester,proteolytic,ayacucho,merseburg,holbein,sambalpur,algebraically,inchon,ostfold,savoia,calatrava,lahiri,judgeship,ammonite,masaryk,meyerbeer,hemorrhagic,superspeedway,ningxia,panicles,encircles,khmelnytsky,profusion,esher,babol,inflationary,anhydride,gaspe,mossy,periodicity,nacion,meteorologists,mahjong,interventional,sarin,moult,enderby,modell,palgrave,warners,montcalm,siddha,functionalism,rilke,politicized,broadmoor,kunste,orden,brasileira,araneta,eroticism,colquhoun,mamba,blacktown,tubercle,seagrass,manoel,camphor,neoregelia,llandudno,annexe,enplanements,kamien,plovers,statisticians,iturbide,madrasah,nontrivial,publican,landholders,manama,uninhabitable,revivalist,trunkline,friendliness,gurudwara,rocketry,unido,tripos,besant,braque,evolutionarily,abkhazian,staffel,ratzinger,brockville,bohemond,intercut,djurgarden,utilitarianism,deploys,sastri,absolutism,subhas,asghar,fictions,sepinwall,proportionately,titleholders,thereon,foursquare,machinegun,knightsbridge,siauliai,aqaba,gearboxes,castaways,weakens,phallic,strzelce,buoyed,ruthenia,pharynx,intractable,neptunes,koine,leakey,netherlandish,preempted,vinay,terracing,instigating,alluvium,prosthetics,vorarlberg,politiques,joinery,reduplication,nebuchadnezzar,lenticular,banka,seaborne,pattinson,helpline,aleph,beckenham,californians,namgyal,franziska,aphid,branagh,transcribe,appropriateness,surakarta,takings,propagates,juraj,b0d3fb,brera,arrayed,tailback,falsehood,hazleton,prosody,egyptology,pinnate,tableware,ratan,camperdown,ethnologist,tabari,classifiers,biogas,126th,kabila,arbitron,apuestas,membranous,kincardine,oceana,glories,natick,populism,synonymy,ghalib,mobiles,motherboards,stationers,germinal,patronised,formula_58,gaborone,torts,jeezy,interleague,novaya,batticaloa,offshoots,wilbraham,filename,nswrfl,'well,trilobite,pythons,optimally,scientologists,rhesus,pilsen,backdrops,batang,unionville,hermanos,shrikes,fareham,outlawing,discontinuing,boisterous,shamokin,scanty,southwestward,exchangers,unexpired,mewar,h.m.s,saldanha,pawan,condorcet,turbidity,donau,indulgences,coincident,cliques,weeklies,bardhaman,violators,kenai,caspase,xperia,kunal,fistula,epistemic,cammell,nephi,disestablishment,rotator,germaniawerft,pyaar,chequered,jigme,perlis,anisotropic,popstars,kapil,appendices,berat,defecting,shacks,wrangel,panchayath,gorna,suckling,aerosols,sponheim,talal,borehole,encodings,enlai,subduing,agong,nadar,kitsap,syrmia,majumdar,pichilemu,charleville,embryology,booting,literati,abutting,basalts,jussi,repubblica,hertogenbosch,digitization,relents,hillfort,wiesenthal,kirche,bhagwan,bactrian,oases,phyla,neutralizing,helsing,ebooks,spearheading,margarine,'golden,phosphor,picea,stimulants,outliers,timescale,gynaecology,integrator,skyrocketed,bridgnorth,senecio,ramachandra,suffragist,arrowheads,aswan,inadvertent,microelectronics,118th,sofer,kubica,melanesian,tuanku,balkh,vyborg,crystallographic,initiators,metamorphism,ginzburg,looters,unimproved,finistere,newburyport,norges,immunities,franchisees,asterism,kortrijk,camorra,komsomol,fleurs,draughts,patagonian,voracious,artin,collaborationist,revolucion,revitalizing,xaver,purifying,antipsychotic,disjunct,pompeius,dreamwave,juvenal,beinn,adiyaman,antitank,allama,boletus,melanogaster,dumitru,caproni,aligns,athabaskan,stobart,phallus,veikkausliiga,hornsey,buffering,bourbons,dobruja,marga,borax,electrics,gangnam,motorcyclist,whidbey,draconian,lodger,galilean,sanctification,imitates,boldness,underboss,wheatland,cantabrian,terceira,maumee,redefining,uppercase,ostroda,characterise,universalism,equalized,syndicalism,haringey,masovia,deleuze,funkadelic,conceals,thuan,minsky,pluralistic,ludendorff,beekeeping,bonfires,endoscopic,abuts,prebend,jonkoping,amami,tribunes,yup'ik,awadh,gasification,pforzheim,reforma,antiwar,vaishnavism,maryville,inextricably,margrethe,empresa,neutrophils,sanctified,ponca,elachistidae,curiae,quartier,mannar,hyperplasia,wimax,busing,neologism,florins,underrepresented,digitised,nieuw,cooch,howards,frege,hughie,plied,swale,kapellmeister,vajpayee,quadrupled,aeronautique,dushanbe,custos,saltillo,kisan,tigray,manaus,epigrams,shamanic,peppered,frosts,promotion/relegation,concedes,zwingli,charentes,whangarei,hyung,spring/summer,sobre,eretz,initialization,sawai,ephemera,grandfathered,arnaldo,customised,permeated,parapets,growths,visegrad,estudios,altamont,provincia,apologises,stoppard,carburettor,rifts,kinematic,zhengzhou,eschatology,prakrit,folate,yvelines,scapula,stupas,rishon,reconfiguration,flutist,1680s,apostolate,proudhon,lakshman,articulating,stortford,faithfull,bitterns,upwelling,qur'anic,lidar,interferometry,waterlogged,koirala,ditton,wavefunction,fazal,babbage,antioxidants,lemberg,deadlocked,tolled,ramapo,mathematica,leiria,topologies,khali,photonic,balti,1080p,corrects,recommenced,polyglot,friezes,tiebreak,copacabana,cholmondeley,armband,abolishment,sheamus,buttes,glycolysis,cataloged,warrenton,sassari,kishan,foodservice,cryptanalysis,holmenkollen,cosplay,machi,yousuf,mangal,allying,fertiliser,otomi,charlevoix,metallurg,parisians,bottlenose,oakleigh,debug,cidade,accede,ligation,madhava,pillboxes,gatefold,aveyron,sorin,thirsk,immemorial,menelik,mehra,domingos,underpinned,fleshed,harshness,diphthong,crestwood,miskolc,dupri,pyrausta,muskingum,tuoba,prodi,incidences,waynesboro,marquesas,heydar,artesian,calinescu,nucleation,funders,covalently,compaction,derbies,seaters,sodor,tabular,amadou,peckinpah,o'halloran,zechariah,libyans,kartik,daihatsu,chandran,erzhu,heresies,superheated,yarder,dorde,tanjore,abusers,xuanwu,juniperus,moesia,trusteeship,birdwatching,beatz,moorcock,harbhajan,sanga,choreographic,photonics,boylston,amalgamate,prawns,electrifying,sarath,inaccurately,exclaims,powerpoint,chaining,cpusa,adulterous,saccharomyces,glogow,vfl/afl,syncretic,simla,persisting,functors,allosteric,euphorbiaceae,juryo,mlada,moana,gabala,thornycroft,kumanovo,ostrovsky,sitio,tutankhamun,sauropods,kardzhali,reinterpretation,sulpice,rosyth,originators,halesowen,delineation,asesoria,abatement,gardai,elytra,taillights,overlays,monsoons,sandpipers,ingmar,henrico,inaccuracy,irwell,arenabowl,elche,pressburg,signalman,interviewees,sinkhole,pendle,ecommerce,cellos,nebria,organometallic,surrealistic,propagandist,interlaken,canandaigua,aerials,coutinho,pascagoula,tonopah,letterkenny,gropius,carbons,hammocks,childe,polities,hosiery,donitz,suppresses,diaghilev,stroudsburg,bagram,pistoia,regenerating,unitarians,takeaway,offstage,vidin,glorification,bakunin,yavapai,lutzow,sabercats,witney,abrogated,gorlitz,validating,dodecahedron,stubbornly,telenor,glaxosmithkline,solapur,undesired,jellicoe,dramatization,four-and-a-half,seawall,waterpark,artaxerxes,vocalization,typographic,byung,sachsenhausen,shepparton,kissimmee,konnan,belsen,dhawan,khurd,mutagenesis,vejle,perrot,estradiol,formula_60,saros,chiloe,misiones,lamprey,terrains,speke,miasto,eigenvectors,haydock,reservist,corticosteroids,savitri,shinawatra,developmentally,yehudi,berates,janissaries,recapturing,rancheria,subplots,gresley,nikkatsu,oryol,cosmas,boavista,formula_59,playfully,subsections,commentated,kathakali,dorid,vilaine,seepage,hylidae,keiji,kazakhs,triphosphate,1620s,supersede,monarchists,falla,miyako,notching,bhumibol,polarizing,secularized,shingled,bronislaw,lockerbie,soleyman,bundesbahn,latakia,redoubts,boult,inwardly,invents,ondrej,minangkabau,newquay,permanente,alhaji,madhav,malini,ellice,bookmaker,mankiewicz,etihad,o'dea,interrogative,mikawa,wallsend,canisius,bluesy,vitruvius,noord,ratifying,mixtec,gujranwala,subprefecture,keelung,goiania,nyssa,shi'ite,semitone,ch'uan,computerised,pertuan,catapults,nepomuk,shruti,millstones,buskerud,acolytes,tredegar,sarum,armia,dell'arte,devises,custodians,upturned,gallaudet,disembarking,thrashed,sagrada,myeon,undeclared,qumran,gaiden,tepco,janesville,showground,condense,chalon,unstaffed,pasay,undemocratic,hauts,viridis,uninjured,escutcheon,gymkhana,petaling,hammam,dislocations,tallaght,rerum,shias,indios,guaranty,simplicial,benares,benediction,tajiri,prolifically,huawei,onerous,grantee,ferencvaros,otranto,carbonates,conceit,digipak,qadri,masterclasses,swamiji,cradock,plunket,helmsman,119th,salutes,tippecanoe,murshidabad,intelligibility,mittal,diversifying,bidar,asansol,crowdsourcing,rovere,karakoram,grindcore,skylights,tulagi,furrows,ligne,stuka,sumer,subgraph,amata,regionalist,bulkeley,teletext,glorify,readied,lexicographer,sabadell,predictability,quilmes,phenylalanine,bandaranaike,pyrmont,marksmen,quisling,viscountess,sociopolitical,afoul,pediments,swazi,martyrology,nullify,panagiotis,superconductors,veldenz,jujuy,l'isle,hematopoietic,shafi,subsea,hattiesburg,jyvaskyla,kebir,myeloid,landmine,derecho,amerindians,birkenau,scriabin,milhaud,mucosal,nikaya,freikorps,theoretician,proconsul,o'hanlon,clerked,bactria,houma,macular,topologically,shrubby,aryeh,ghazali,afferent,magalhaes,moduli,ashtabula,vidarbha,securitate,ludwigsburg,adoor,varun,shuja,khatun,chengde,bushels,lascelles,professionnelle,elfman,rangpur,unpowered,citytv,chojnice,quaternion,stokowski,aschaffenburg,commutes,subramaniam,methylene,satrap,gharb,namesakes,rathore,helier,gestational,heraklion,colliers,giannis,pastureland,evocation,krefeld,mahadeva,churchmen,egret,yilmaz,galeazzo,pudukkottai,artigas,generalitat,mudslides,frescoed,enfeoffed,aphorisms,melilla,montaigne,gauliga,parkdale,mauboy,linings,prema,sapir,xylophone,kushan,rockne,sequoyah,vasyl,rectilinear,vidyasagar,microcosm,san'a,carcinogen,thicknesses,aleut,farcical,moderating,detested,hegemonic,instalments,vauban,verwaltungsgemeinschaft,picayune,razorback,magellanic,moluccas,pankhurst,exportation,waldegrave,sufferer,bayswater,1up.com,rearmament,orangutans,varazdin,b.o.b,elucidate,harlingen,erudition,brankovic,lapis,slipway,urraca,shinde,unwell,elwes,euboea,colwyn,srivijaya,grandstands,hortons,generalleutnant,fluxes,peterhead,gandhian,reals,alauddin,maximized,fairhaven,endow,ciechanow,perforations,darters,panellist,manmade,litigants,exhibitor,tirol,caracalla,conformance,hotelier,stabaek,hearths,borac,frisians,ident,veliko,emulators,schoharie,uzbeks,samarra,prestwick,wadia,universita,tanah,bucculatrix,predominates,genotypes,denounces,roadsides,ganassi,keokuk,philatelist,tomic,ingots,conduits,samplers,abdus,johar,allegories,timaru,wolfpacks,secunda,smeaton,sportivo,inverting,contraindications,whisperer,moradabad,calamities,bakufu,soundscape,smallholders,nadeem,crossroad,xenophobic,zakir,nationalliga,glazes,retroflex,schwyz,moroder,rubra,quraysh,theodoros,endemol,infidels,km/hr,repositioned,portraitist,lluis,answerable,arges,mindedness,coarser,eyewall,teleported,scolds,uppland,vibraphone,ricoh,isenburg,bricklayer,cuttlefish,abstentions,communicable,cephalopod,stockyards,balto,kinston,armbar,bandini,elphaba,maxims,bedouins,sachsen,friedkin,tractate,pamir,ivanovo,mohini,kovalainen,nambiar,melvyn,orthonormal,matsuyama,cuernavaca,veloso,overstated,streamer,dravid,informers,analyte,sympathized,streetscape,gosta,thomasville,grigore,futuna,depleting,whelks,kiedis,armadale,earner,wynyard,dothan,animating,tridentine,sabri,immovable,rivoli,ariege,parley,clinker,circulates,junagadh,fraunhofer,congregants,180th,buducnost,formula_62,olmert,dedekind,karnak,bayernliga,mazes,sandpiper,ecclestone,yuvan,smallmouth,decolonization,lemmy,adjudicated,retiro,legia,benue,posit,acidification,wahab,taconic,floatplane,perchlorate,atria,wisbech,divestment,dallara,phrygia,palustris,cybersecurity,rebates,facie,mineralogical,substituent,proteges,fowey,mayenne,smoothbore,cherwell,schwarzschild,junin,murrumbidgee,smalltalk,d'orsay,emirati,calaveras,titusville,theremin,vikramaditya,wampanoag,burra,plaines,onegin,emboldened,whampoa,langa,soderbergh,arnaz,sowerby,arendal,godunov,pathanamthitta,damselfly,bestowing,eurosport,iconoclasm,outfitters,acquiesced,badawi,hypotension,ebbsfleet,annulus,sohrab,thenceforth,chagatai,necessitates,aulus,oddities,toynbee,uniontown,innervation,populaire,indivisible,rossellini,minuet,cyrene,gyeongju,chania,cichlids,harrods,1690s,plunges,abdullahi,gurkhas,homebuilt,sortable,bangui,rediff,incrementally,demetrios,medaille,sportif,svend,guttenberg,tubules,carthusian,pleiades,torii,hoppus,phenyl,hanno,conyngham,teschen,cronenberg,wordless,melatonin,distinctiveness,autos,freising,xuanzang,dunwich,satanism,sweyn,predrag,contractually,pavlovic,malaysians,micrometres,expertly,pannonian,abstaining,capensis,southwesterly,catchphrases,commercialize,frankivsk,normanton,hibernate,verso,deportees,dubliners,codice_8,condors,zagros,glosses,leadville,conscript,morrisons,usury,ossian,oulton,vaccinium,civet,ayman,codrington,hadron,nanometers,geochemistry,extractor,grigori,tyrrhenian,neocollyris,drooping,falsification,werft,courtauld,brigantine,orhan,chapultepec,supercopa,federalized,praga,havering,encampments,infallibility,sardis,pawar,undirected,reconstructionist,ardrossan,varuna,pastimes,archdiocesan,fledging,shenhua,molise,secondarily,stagnated,replicates,ciencias,duryodhana,marauding,ruislip,ilyich,intermixed,ravenswood,shimazu,mycorrhizal,icosahedral,consents,dunblane,follicular,pekin,suffield,muromachi,kinsale,gauche,businesspeople,thereto,watauga,exaltation,chelmno,gorse,proliferate,drainages,burdwan,kangra,transducers,inductor,duvalier,maguindanao,moslem,uncaf,givenchy,plantarum,liturgics,telegraphs,lukashenko,chenango,andante,novae,ironwood,faubourg,torme,chinensis,ambala,pietermaritzburg,virginians,landform,bottlenecks,o'driscoll,darbhanga,baptistery,ameer,needlework,naperville,auditoriums,mullingar,starrer,animatronic,topsoil,madura,cannock,vernet,santurce,catocala,ozeki,pontevedra,multichannel,sundsvall,strategists,medio,135th,halil,afridi,trelawny,caloric,ghraib,allendale,hameed,ludwigshafen,spurned,pavlo,palmar,strafed,catamarca,aveiro,harmonization,surah,predictors,solvay,mande,omnipresent,parenthesis,echolocation,equaling,experimenters,acyclic,lithographic,sepoys,katarzyna,sridevi,impoundment,khosrow,caesarean,nacogdoches,rockdale,lawmaker,caucasians,bahman,miyan,rubric,exuberance,bombastic,ductile,snowdonia,inlays,pinyon,anemones,hurries,hospitallers,tayyip,pulleys,treme,photovoltaics,testbed,polonium,ryszard,osgoode,profiting,ironwork,unsurpassed,nepticulidae,makai,lumbini,preclassic,clarksburg,egremont,videography,rehabilitating,ponty,sardonic,geotechnical,khurasan,solzhenitsyn,henna,phoenicia,rhyolite,chateaux,retorted,tomar,deflections,repressions,harborough,renan,brumbies,vandross,storia,vodou,clerkenwell,decking,universo,salon.com,imprisoning,sudwest,ghaziabad,subscribing,pisgah,sukhumi,econometric,clearest,pindar,yildirim,iulia,atlases,cements,remaster,dugouts,collapsible,resurrecting,batik,unreliability,thiers,conjunctions,colophon,marcher,placeholder,flagella,wolds,kibaki,viviparous,twelver,screenshots,aroostook,khadr,iconographic,itasca,jaume,basti,propounded,varro,be'er,jeevan,exacted,shrublands,creditable,brocade,boras,bittern,oneonta,attentional,herzliya,comprehensible,lakeville,discards,caxias,frankland,camerata,satoru,matlab,commutator,interprovincial,yorkville,benefices,nizami,edwardsville,amigaos,cannabinoid,indianola,amateurliga,pernicious,ubiquity,anarchic,novelties,precondition,zardari,symington,sargodha,headphone,thermopylae,mashonaland,zindagi,thalberg,loewe,surfactants,dobro,crocodilians,samhita,diatoms,haileybury,berwickshire,supercritical,sofie,snorna,slatina,intramolecular,agung,osteoarthritis,obstetric,teochew,vakhtang,connemara,deformations,diadem,ferruccio,mainichi,qualitatively,refrigerant,rerecorded,methylated,karmapa,krasinski,restatement,rouvas,cubitt,seacoast,schwarzkopf,homonymous,shipowner,thiamine,approachable,xiahou,160th,ecumenism,polistes,internazionali,fouad,berar,biogeography,texting,inadequately,'when,4kids,hymenoptera,emplaced,cognomen,bellefonte,supplant,michaelmas,uriel,tafsir,morazan,schweinfurt,chorister,ps400,nscaa,petipa,resolutely,ouagadougou,mascarene,supercell,konstanz,bagrat,harmonix,bergson,shrimps,resonators,veneta,camas,mynydd,rumford,generalmajor,khayyam,web.com,pappus,halfdan,tanana,suomen,yutaka,bibliographical,traian,silat,noailles,contrapuntal,agaricus,'special,minibuses,1670s,obadiah,deepa,rorschach,malolos,lymington,valuations,imperials,caballeros,ambroise,judicature,elegiac,sedaka,shewa,checksum,gosforth,legionaries,corneille,microregion,friedrichshafen,antonis,surnamed,mycelium,cantus,educations,topmost,outfitting,ivica,nankai,gouda,anthemic,iosif,supercontinent,antifungal,belarusians,mudaliar,mohawks,caversham,glaciated,basemen,stevan,clonmel,loughton,deventer,positivist,manipuri,tensors,panipat,changeup,impermeable,dubbo,elfsborg,maritimo,regimens,bikram,bromeliad,substratum,norodom,gaultier,queanbeyan,pompeo,redacted,eurocopter,mothballed,centaurs,borno,copra,bemidji,'home,sopron,neuquen,passo,cineplex,alexandrov,wysokie,mammoths,yossi,sarcophagi,congreve,petkovic,extraneous,waterbirds,slurs,indias,phaeton,discontented,prefaced,abhay,prescot,interoperable,nordisk,bicyclists,validly,sejong,litovsk,zanesville,kapitanleutnant,kerch,changeable,mcclatchy,celebi,attesting,maccoll,sepahan,wayans,veined,gaudens,markt,dansk,soane,quantized,petersham,forebears,nayarit,frenzied,queuing,bygone,viggo,ludwik,tanka,hanssen,brythonic,cornhill,primorsky,stockpiles,conceptualization,lampeter,hinsdale,mesoderm,bielsk,rosenheim,ultron,joffrey,stanwyck,khagan,tiraspol,pavelic,ascendant,empoli,metatarsal,descentralizado,masada,ligier,huseyin,ramadi,waratah,tampines,ruthenium,statoil,mladost,liger,grecian,multiparty,digraph,maglev,reconsideration,radiography,cartilaginous,taizu,wintered,anabaptist,peterhouse,shoghi,assessors,numerator,paulet,painstakingly,halakhic,rocroi,motorcycling,gimel,kryptonian,emmeline,cheeked,drawdown,lelouch,dacians,brahmana,reminiscence,disinfection,optimizations,golders,extensor,tsugaru,tolling,liman,gulzar,unconvinced,crataegus,oppositional,dvina,pyrolysis,mandan,alexius,prion,stressors,loomed,moated,dhivehi,recyclable,relict,nestlings,sarandon,kosovar,solvers,czeslaw,kenta,maneuverable,middens,berkhamsted,comilla,folkways,loxton,beziers,batumi,petrochemicals,optimised,sirjan,rabindra,musicality,rationalisation,drillers,subspaces,'live,bbwaa,outfielders,tsung,danske,vandalised,norristown,striae,kanata,gastroenterology,steadfastly,equalising,bootlegging,mannerheim,notodontidae,lagoa,commentating,peninsulas,chishti,seismology,modigliani,preceptor,canonically,awardee,boyaca,hsinchu,stiffened,nacelle,bogor,dryness,unobstructed,yaqub,scindia,peeters,irritant,ammonites,ferromagnetic,speechwriter,oxygenated,walesa,millais,canarian,faience,calvinistic,discriminant,rasht,inker,annexes,howth,allocates,conditionally,roused,regionalism,regionalbahn,functionary,nitrates,bicentenary,recreates,saboteurs,koshi,plasmids,thinned,124th,plainview,kardashian,neuville,victorians,radiates,127th,vieques,schoolmates,petru,tokusatsu,keying,sunaina,flamethrower,'bout,demersal,hosokawa,corelli,omniscient,o'doherty,niksic,reflectivity,transdev,cavour,metronome,temporally,gabba,nsaids,geert,mayport,hematite,boeotia,vaudreuil,torshavn,sailplane,mineralogist,eskisehir,practises,gallifrey,takumi,unease,slipstream,hedmark,paulinus,ailsa,wielkopolska,filmworks,adamantly,vinaya,facelifted,franchisee,augustana,toppling,velvety,crispa,stonington,histological,genealogist,tactician,tebow,betjeman,nyingma,overwinter,oberoi,rampal,overwinters,petaluma,lactarius,stanmore,balikpapan,vasant,inclines,laminate,munshi,sociedade,rabbah,septal,boyband,ingrained,faltering,inhumans,nhtsa,affix,l'ordre,kazuki,rossendale,mysims,latvians,slaveholders,basilicata,neuburg,assize,manzanillo,scrobipalpa,formula_61,belgique,pterosaurs,privateering,vaasa,veria,northport,pressurised,hobbyist,austerlitz,sahih,bhadra,siliguri,bistrica,bursaries,wynton,corot,lepidus,lully,libor,libera,olusegun,choline,mannerism,lymphocyte,chagos,duxbury,parasitism,ecowas,morotai,cancion,coniston,aggrieved,sputnikmusic,parle,ammonian,civilisations,malformation,cattaraugus,skyhawks,d'arc,demerara,bronfman,midwinter,piscataway,jogaila,threonine,matins,kohlberg,hubli,pentatonic,camillus,nigam,potro,unchained,chauvel,orangeville,cistercians,redeployment,xanthi,manju,carabinieri,pakeha,nikolaevich,kantakouzenos,sesquicentennial,gunships,symbolised,teramo,ballo,crusading,l'oeil,bharatpur,lazier,gabrovo,hysteresis,rothbard,chaumont,roundel,ma'mun,sudhir,queried,newts,shimane,presynaptic,playfield,taxonomists,sensitivities,freleng,burkinabe,orfeo,autovia,proselytizing,bhangra,pasok,jujutsu,heung,pivoting,hominid,commending,formula_64,epworth,christianized,oresund,hantuchova,rajputana,hilversum,masoretic,dayak,bakri,assen,magog,macromolecules,waheed,qaida,spassky,rumped,protrudes,preminger,misogyny,glencairn,salafi,lacunae,grilles,racemes,areva,alighieri,inari,epitomized,photoshoot,one-of-a-kind,tring,muralist,tincture,backwaters,weaned,yeasts,analytically,smaland,caltrans,vysocina,jamuna,mauthausen,175th,nouvelles,censoring,reggina,christology,gilad,amplifying,mehmood,johnsons,redirects,eastgate,sacrum,meteoric,riverbanks,guidebooks,ascribes,scoparia,iconoclastic,telegraphic,chine,merah,mistico,lectern,sheung,aethelstan,capablanca,anant,uspto,albatrosses,mymensingh,antiretroviral,clonal,coorg,vaillant,liquidator,gigas,yokai,eradicating,motorcyclists,waitakere,tandon,nears,montenegrins,250th,tatsuya,yassin,atheistic,syncretism,nahum,berisha,transcended,owensboro,lakshmana,abteilung,unadorned,nyack,overflows,harrisonburg,complainant,uematsu,frictional,worsens,sangguniang,abutment,bulwer,sarma,apollinaire,shippers,lycia,alentejo,porpoises,optus,trawling,augustow,blackwall,workbench,westmount,leaped,sikandar,conveniences,stornoway,culverts,zoroastrians,hristo,ansgar,assistive,reassert,fanned,compasses,delgada,maisons,arima,plonsk,verlaine,starstruck,rakhine,befell,spirally,wyclef,expend,colloquium,formula_63,albertus,bellarmine,handedness,holon,introns,movimiento,profitably,lohengrin,discoverers,awash,erste,pharisees,dwarka,oghuz,hashing,heterodox,uloom,vladikavkaz,linesman,rehired,nucleophile,germanicus,gulshan,songz,bayerische,paralympian,crumlin,enjoined,khanum,prahran,penitent,amersfoort,saranac,semisimple,vagrants,compositing,tualatin,oxalate,lavra,ironi,ilkeston,umpqua,calum,stretford,zakat,guelders,hydrazine,birkin,spurring,modularity,aspartate,sodermanland,hopital,bellary,legazpi,clasico,cadfael,hypersonic,volleys,pharmacokinetics,carotene,orientale,pausini,bataille,lunga,retailed,m.phil,mazowieckie,vijayan,rawal,sublimation,promissory,estimators,ploughed,conflagration,penda,segregationist,otley,amputee,coauthor,sopra,pellew,wreckers,tollywood,circumscription,permittivity,strabane,landward,articulates,beaverbrook,rutherglen,coterminous,whistleblowers,colloidal,surbiton,atlante,oswiecim,bhasa,lampooned,chanter,saarc,landkreis,tribulation,tolerates,daiichi,hatun,cowries,dyschirius,abercromby,attock,aldwych,inflows,absolutist,l'histoire,committeeman,vanbrugh,headstock,westbourne,appenzell,hoxton,oculus,westfalen,roundabouts,nickelback,trovatore,quenching,summarises,conservators,transmutation,talleyrand,barzani,unwillingly,axonal,'blue,opining,enveloping,fidesz,rafah,colborne,flickr,lozenge,dulcimer,ndebele,swaraj,oxidize,gonville,resonated,gilani,superiore,endeared,janakpur,shepperton,solidifying,memoranda,sochaux,kurnool,rewari,emirs,kooning,bruford,unavailability,kayseri,judicious,negating,pterosaur,cytosolic,chernihiv,variational,sabretooth,seawolves,devalued,nanded,adverb,volunteerism,sealers,nemours,smederevo,kashubian,bartin,animax,vicomte,polotsk,polder,archiepiscopal,acceptability,quidditch,tussock,seminaire,immolation,belge,coves,wellingborough,khaganate,mckellen,nayaka,brega,kabhi,pontoons,bascule,newsreels,injectors,cobol,weblog,diplo,biggar,wheatbelt,erythrocytes,pedra,showgrounds,bogdanovich,eclecticism,toluene,elegies,formalize,andromedae,airworthiness,springville,mainframes,overexpression,magadha,bijelo,emlyn,glutamine,accenture,uhuru,metairie,arabidopsis,patanjali,peruvians,berezovsky,accion,astrolabe,jayanti,earnestly,sausalito,recurved,1500s,ramla,incineration,galleons,laplacian,shiki,smethwick,isomerase,dordevic,janow,jeffersonville,internationalism,penciled,styrene,ashur,nucleoside,peristome,horsemanship,sedges,bachata,medes,kristallnacht,schneerson,reflectance,invalided,strutt,draupadi,destino,partridges,tejas,quadrennial,aurel,halych,ethnomusicology,autonomist,radyo,rifting,shi'ar,crvena,telefilm,zawahiri,plana,sultanates,theodorus,subcontractors,pavle,seneschal,teleports,chernivtsi,buccal,brattleboro,stankovic,safar,dunhuang,electrocution,chastised,ergonomic,midsomer,130th,zomba,nongovernmental,escapist,localize,xuzhou,kyrie,carinthian,karlovac,nisan,kramnik,pilipino,digitisation,khasi,andronicus,highwayman,maior,misspelling,sebastopol,socon,rhaetian,archimandrite,partway,positivity,otaku,dingoes,tarski,geopolitics,disciplinarian,zulfikar,kenzo,globose,electrophilic,modele,storekeeper,pohang,wheldon,washers,interconnecting,digraphs,intrastate,campy,helvetic,frontispiece,ferrocarril,anambra,petraeus,midrib,endometrial,dwarfism,mauryan,endocytosis,brigs,percussionists,furtherance,synergistic,apocynaceae,krona,berthier,circumvented,casal,siltstone,precast,ethnikos,realists,geodesy,zarzuela,greenback,tripathi,persevered,interments,neutralization,olbermann,departements,supercomputing,demobilised,cassavetes,dunder,ministering,veszprem,barbarism,'world,pieve,apologist,frentzen,sulfides,firewalls,pronotum,staatsoper,hachette,makhachkala,oberland,phonon,yoshihiro,instars,purnima,winslet,mutsu,ergative,sajid,nizamuddin,paraphrased,ardeidae,kodagu,monooxygenase,skirmishers,sportiva,o'byrne,mykolaiv,ophir,prieta,gyllenhaal,kantian,leche,copan,herero,ps250,gelsenkirchen,shalit,sammarinese,chetwynd,wftda,travertine,warta,sigmaringen,concerti,namespace,ostergotland,biomarker,universals,collegio,embarcadero,wimborne,fiddlers,likening,ransomed,stifled,unabated,kalakaua,khanty,gongs,goodrem,countermeasure,publicizing,geomorphology,swedenborg,undefended,catastrophes,diverts,storyboards,amesbury,contactless,placentia,festivity,authorise,terrane,thallium,stradivarius,antonine,consortia,estimations,consecrate,supergiant,belichick,pendants,butyl,groza,univac,afire,kavala,studi,teletoon,paucity,gonbad,koninklijke,128th,stoichiometric,multimodal,facundo,anatomic,melamine,creuse,altan,brigands,mcguinty,blomfield,tsvangirai,protrusion,lurgan,warminster,tenzin,russellville,discursive,definable,scotrail,lignin,reincorporated,o'dell,outperform,redland,multicolored,evaporates,dimitrie,limbic,patapsco,interlingua,surrogacy,cutty,potrero,masud,cahiers,jintao,ardashir,centaurus,plagiarized,minehead,musings,statuettes,logarithms,seaview,prohibitively,downforce,rivington,tomorrowland,microbiologist,ferric,morag,capsid,kucinich,clairvaux,demotic,seamanship,cicada,painterly,cromarty,carbonic,tupou,oconee,tehuantepec,typecast,anstruther,internalized,underwriters,tetrahedra,flagrant,quakes,pathologies,ulrik,nahal,tarquini,dongguan,parnassus,ryoko,senussi,seleucia,airasia,einer,sashes,d'amico,matriculating,arabesque,honved,biophysical,hardinge,kherson,mommsen,diels,icbms,reshape,brasiliensis,palmach,netaji,oblate,functionalities,grigor,blacksburg,recoilless,melanchthon,reales,astrodome,handcrafted,memes,theorizes,isma'il,aarti,pirin,maatschappij,stabilizes,honiara,ashbury,copts,rootes,defensed,queiroz,mantegna,galesburg,coraciiformesfamily,cabrillo,tokio,antipsychotics,kanon,173rd,apollonia,finial,lydian,hadamard,rangi,dowlatabad,monolingual,platformer,subclasses,chiranjeevi,mirabeau,newsgroup,idmanyurdu,kambojas,walkover,zamoyski,generalist,khedive,flanges,knowle,bande,157th,alleyn,reaffirm,pininfarina,zuckerberg,hakodate,131st,aditi,bellinzona,vaulter,planking,boscombe,colombians,lysis,toppers,metered,nahyan,queensryche,minho,nagercoil,firebrand,foundress,bycatch,mendota,freeform,antena,capitalisation,martinus,overijssel,purists,interventionist,zgierz,burgundians,hippolyta,trompe,umatilla,moroccans,dictionnaire,hydrography,changers,chota,rimouski,aniline,bylaw,grandnephew,neamt,lemnos,connoisseurs,tractive,rearrangements,fetishism,finnic,apalachicola,landowning,calligraphic,circumpolar,mansfeld,legible,orientalism,tannhauser,blamey,maximization,noinclude,blackbirds,angara,ostersund,pancreatitis,glabra,acleris,juried,jungian,triumphantly,singlet,plasmas,synesthesia,yellowhead,unleashes,choiseul,quanzhong,brookville,kaskaskia,igcse,skatepark,jatin,jewellers,scaritinae,techcrunch,tellurium,lachaise,azuma,codeshare,dimensionality,unidirectional,scolaire,macdill,camshafts,unassisted,verband,kahlo,eliya,prelature,chiefdoms,saddleback,sockers,iommi,coloratura,llangollen,biosciences,harshest,maithili,k'iche,plical,multifunctional,andreu,tuskers,confounding,sambre,quarterdeck,ascetics,berdych,transversal,tuolumne,sagami,petrobras,brecker,menxia,instilling,stipulating,korra,oscillate,deadpan,v/line,pyrotechnic,stoneware,prelims,intracoastal,retraining,ilija,berwyn,encrypt,achievers,zulfiqar,glycoproteins,khatib,farmsteads,occultist,saman,fionn,derulo,khilji,obrenovic,argosy,toowong,dementieva,sociocultural,iconostasis,craigslist,festschrift,taifa,intercalated,tanjong,penticton,sharad,marxian,extrapolation,guises,wettin,prabang,exclaiming,kosta,famas,conakry,wanderings,'aliabad,macleay,exoplanet,bancorp,besiegers,surmounting,checkerboard,rajab,vliet,tarek,operable,wargaming,haldimand,fukuyama,uesugi,aggregations,erbil,brachiopods,tokyu,anglais,unfavorably,ujpest,escorial,armagnac,nagara,funafuti,ridgeline,cocking,o'gorman,compactness,retardant,krajowa,barua,coking,bestows,thampi,chicagoland,variably,o'loughlin,minnows,schwa,shaukat,polycarbonate,chlorinated,godalming,gramercy,delved,banqueting,enlil,sarada,prasanna,domhnall,decadal,regressive,lipoprotein,collectable,surendra,zaporizhia,cycliste,suchet,offsetting,formula_65,pudong,d'arte,blyton,quonset,osmania,tientsin,manorama,proteomics,bille,jalpaiguri,pertwee,barnegat,inventiveness,gollancz,euthanized,henricus,shortfalls,wuxia,chlorides,cerrado,polyvinyl,folktale,straddled,bioengineering,eschewing,greendale,recharged,olave,ceylonese,autocephalous,peacebuilding,wrights,guyed,rosamund,abitibi,bannockburn,gerontology,scutari,souness,seagram,codice_9,'open,xhtml,taguig,purposed,darbar,orthopedics,unpopulated,kisumu,tarrytown,feodor,polyhedral,monadnock,gottorp,priam,redesigning,gasworks,elfin,urquiza,homologation,filipovic,bohun,manningham,gornik,soundness,shorea,lanus,gelder,darke,sandgate,criticality,paranaense,153rd,vieja,lithograph,trapezoid,tiebreakers,convalescence,yan'an,actuaries,balad,altimeter,thermoelectric,trailblazer,previn,tenryu,ancaster,endoscopy,nicolet,discloses,fracking,plaine,salado,americanism,placards,absurdist,propylene,breccia,jirga,documenta,ismailis,161st,brentano,dallas/fort,embellishment,calipers,subscribes,mahavidyalaya,wednesbury,barnstormers,miwok,schembechler,minigame,unterberger,dopaminergic,inacio,nizamabad,overridden,monotype,cavernous,stichting,sassafras,sotho,argentinean,myrrh,rapidity,flatts,gowrie,dejected,kasaragod,cyprinidae,interlinked,arcseconds,degeneracy,infamously,incubate,substructure,trigeminal,sectarianism,marshlands,hooliganism,hurlers,isolationist,urania,burrard,switchover,lecco,wilts,interrogator,strived,ballooning,volterra,raciborz,relegating,gilding,cybele,dolomites,parachutist,lochaber,orators,raeburn,backend,benaud,rallycross,facings,banga,nuclides,defencemen,futurity,emitters,yadkin,eudonia,zambales,manasseh,sirte,meshes,peculiarly,mcminnville,roundly,boban,decrypt,icelanders,sanam,chelan,jovian,grudgingly,penalised,subscript,gambrinus,poaceae,infringements,maleficent,runciman,148th,supersymmetry,granites,liskeard,eliciting,involution,hallstatt,kitzbuhel,shankly,sandhills,inefficiencies,yishuv,psychotropic,nightjars,wavell,sangamon,vaikundar,choshu,retrospectives,pitesti,gigantea,hashemi,bosna,gakuin,siochana,arrangers,baronetcies,narayani,temecula,creston,koscierzyna,autochthonous,wyandot,anniston,igreja,mobilise,buzau,dunster,musselburgh,wenzhou,khattak,detoxification,decarboxylase,manlius,campbells,coleoptera,copyist,sympathisers,suisun,eminescu,defensor,transshipment,thurgau,somerton,fluctuates,ambika,weierstrass,lukow,giambattista,volcanics,romanticized,innovated,matabeleland,scotiabank,garwolin,purine,d'auvergne,borderland,maozhen,pricewaterhousecoopers,testator,pallium,scout.com,mv/pi,nazca,curacies,upjohn,sarasvati,monegasque,ketrzyn,malory,spikelets,biomechanics,haciendas,rapped,dwarfed,stews,nijinsky,subjection,matsu,perceptible,schwarzburg,midsection,entertains,circuitous,epiphytic,wonsan,alpini,bluefield,sloths,transportable,braunfels,dictum,szczecinek,jukka,wielun,wejherowo,hucknall,grameen,duodenum,ribose,deshpande,shahar,nexstar,injurious,dereham,lithographer,dhoni,structuralist,progreso,deschutes,christus,pulteney,quoins,yitzchak,gyeongsang,breviary,makkah,chiyoda,jutting,vineland,angiosperms,necrotic,novelisation,redistribute,tirumala,140th,featureless,mafic,rivaling,toyline,2/1st,martius,saalfeld,monthan,texian,kathak,melodramas,mithila,regierungsbezirk,509th,fermenting,schoolmate,virtuosic,briain,kokoda,heliocentric,handpicked,kilwinning,sonically,dinars,kasim,parkways,bogdanov,luxembourgian,halland,avesta,bardic,daugavpils,excavator,qwest,frustrate,physiographic,majoris,'ndrangheta,unrestrained,firmness,montalban,abundances,preservationists,adare,executioners,guardsman,bonnaroo,neglects,nazrul,pro12,hoorn,abercorn,refuting,kabud,cationic,parapsychology,troposphere,venezuelans,malignancy,khoja,unhindered,accordionist,medak,visby,ejercito,laparoscopic,dinas,umayyads,valmiki,o'dowd,saplings,stranding,incisions,illusionist,avocets,buccleuch,amazonia,fourfold,turboprops,roosts,priscus,turnstile,areal,certifies,pocklington,spoofs,viseu,commonalities,dabrowka,annam,homesteaders,daredevils,mondrian,negotiates,fiestas,perennials,maximizes,lubavitch,ravindra,scrapers,finials,kintyre,violas,snoqualmie,wilders,openbsd,mlawa,peritoneal,devarajan,congke,leszno,mercurial,fakir,joannes,bognor,overloading,unbuilt,gurung,scuttle,temperaments,bautzen,jardim,tradesman,visitations,barbet,sagamore,graaff,forecasters,wilsons,assis,l'air,shariah,sochaczew,russa,dirge,biliary,neuve,heartbreakers,strathearn,jacobian,overgrazing,edrich,anticline,parathyroid,petula,lepanto,decius,channelled,parvathi,puppeteers,communicators,francorchamps,kahane,longus,panjang,intron,traite,xxvii,matsuri,amrit,katyn,disheartened,cacak,omonia,alexandrine,partaking,wrangling,adjuvant,haskovo,tendrils,greensand,lammermoor,otherworld,volusia,stabling,one-and-a-half,bresson,zapatista,eotvos,ps150,webisodes,stepchildren,microarray,braganca,quanta,dolne,superoxide,bellona,delineate,ratha,lindenwood,bruhl,cingulate,tallies,bickerton,helgi,bevin,takoma,tsukuba,statuses,changeling,alister,bytom,dibrugarh,magnesia,duplicating,outlier,abated,goncalo,strelitz,shikai,mardan,musculature,ascomycota,springhill,tumuli,gabaa,odenwald,reformatted,autocracy,theresienstadt,suplex,chattopadhyay,mencken,congratulatory,weatherfield,systema,solemnity,projekt,quanzhou,kreuzberg,postbellum,nobuo,mediaworks,finisterre,matchplay,bangladeshis,kothen,oocyte,hovered,aromas,afshar,browed,teases,chorlton,arshad,cesaro,backbencher,iquique,vulcans,padmini,unabridged,cyclase,despotic,kirilenko,achaean,queensberry,debre,octahedron,iphigenia,curbing,karimnagar,sagarmatha,smelters,surrealists,sanada,shrestha,turridae,leasehold,jiedushi,eurythmics,appropriating,correze,thimphu,amery,musicomh,cyborgs,sandwell,pushcart,retorts,ameliorate,deteriorates,stojanovic,spline,entrenchments,bourse,chancellorship,pasolini,lendl,personage,reformulated,pubescens,loiret,metalurh,reinvention,nonhuman,eilema,tarsal,complutense,magne,broadview,metrodome,outtake,stouffville,seinen,bataillon,phosphoric,ostensible,opatow,aristides,beefheart,glorifying,banten,romsey,seamounts,fushimi,prophylaxis,sibylla,ranjith,goslar,balustrades,georgiev,caird,lafitte,peano,canso,bankura,halfpenny,segregate,caisson,bizerte,jamshedpur,euromaidan,philosophie,ridged,cheerfully,reclassification,aemilius,visionaries,samoans,wokingham,chemung,wolof,unbranched,cinerea,bhosle,ourense,immortalised,cornerstones,sourcebook,khufu,archimedean,universitatea,intermolecular,fiscally,suffices,metacomet,adjudicator,stablemate,specks,glace,inowroclaw,patristic,muharram,agitating,ashot,neurologic,didcot,gamla,ilves,putouts,siraj,laski,coaling,diarmuid,ratnagiri,rotulorum,liquefaction,morbihan,harel,aftershock,gruiformesfamily,bonnier,falconiformesfamily,adorns,wikis,maastrichtian,stauffenberg,bishopsgate,fakhr,sevenfold,ponders,quantifying,castiel,opacity,depredations,lenten,gravitated,o'mahony,modulates,inuktitut,paston,kayfabe,vagus,legalised,balked,arianism,tendering,sivas,birthdate,awlaki,khvajeh,shahab,samtgemeinde,bridgeton,amalgamations,biogenesis,recharging,tsukasa,mythbusters,chamfered,enthronement,freelancers,maharana,constantia,sutil,messines,monkton,okanogan,reinvigorated,apoplexy,tanahashi,neues,valiants,harappan,russes,carding,volkoff,funchal,statehouse,imitative,intrepidity,mellotron,samaras,turkana,besting,longitudes,exarch,diarrhoea,transcending,zvonareva,darna,ramblin,disconnection,137th,refocused,diarmait,agricole,ba'athist,turenne,contrabass,communis,daviess,fatimids,frosinone,fittingly,polyphyletic,qanat,theocratic,preclinical,abacha,toorak,marketplaces,conidia,seiya,contraindicated,retford,bundesautobahn,rebuilds,climatology,seaworthy,starfighter,qamar,categoria,malai,hellinsia,newstead,airworthy,catenin,avonmouth,arrhythmias,ayyavazhi,downgrade,ashburnham,ejector,kinematics,petworth,rspca,filmation,accipitridae,chhatrapati,g/mol,bacau,agama,ringtone,yudhoyono,orchestrator,arbitrators,138th,powerplants,cumbernauld,alderley,misamis,hawai`i,cuando,meistriliiga,jermyn,alans,pedigrees,ottavio,approbation,omnium,purulia,prioress,rheinland,lymphoid,lutsk,oscilloscope,ballina,iliac,motorbikes,modernising,uffizi,phylloxera,kalevala,bengalis,amravati,syntheses,interviewers,inflectional,outflank,maryhill,unhurt,profiler,nacelles,heseltine,personalised,guarda,herpetologist,airpark,pigot,margaretha,dinos,peleliu,breakbeat,kastamonu,shaivism,delamere,kingsville,epigram,khlong,phospholipids,journeying,lietuvos,congregated,deviance,celebes,subsoil,stroma,kvitova,lubricating,layoff,alagoas,olafur,doron,interuniversity,raycom,agonopterix,uzice,nanna,springvale,raimundo,wrested,pupal,talat,skinheads,vestige,unpainted,handan,odawara,ammar,attendee,lapped,myotis,gusty,ciconiiformesfamily,traversal,subfield,vitaphone,prensa,hasidism,inwood,carstairs,kropotkin,turgenev,dobra,remittance,purim,tannin,adige,tabulation,lethality,pacha,micronesian,dhruva,defensemen,tibeto,siculus,radioisotope,sodertalje,phitsanulok,euphonium,oxytocin,overhangs,skinks,fabrica,reinterred,emulates,bioscience,paragliding,raekwon,perigee,plausibility,frolunda,erroll,aznar,vyasa,albinus,trevally,confederacion,terse,sixtieth,1530s,kendriya,skateboarders,frontieres,muawiyah,easements,shehu,conservatively,keystones,kasem,brutalist,peekskill,cowry,orcas,syllabary,paltz,elisabetta,denticles,hampering,dolni,eidos,aarau,lermontov,yankton,shahbaz,barrages,kongsvinger,reestablishment,acetyltransferase,zulia,mrnas,slingsby,eucalypt,efficacious,weybridge,gradation,cinematheque,malthus,bampton,coexisted,cisse,hamdi,cupertino,saumarez,chionodes,libertine,formers,sakharov,pseudonymous,vol.1,mcduck,gopalakrishnan,amberley,jorhat,grandmasters,rudiments,dwindle,param,bukidnon,menander,americanus,multipliers,pulawy,homoerotic,pillbox,cd+dvd,epigraph,aleksandrow,extrapolated,horseshoes,contemporain,angiography,hasselt,shawinigan,memorization,legitimized,cyclades,outsold,rodolphe,kelis,powerball,dijkstra,analyzers,incompressible,sambar,orangeburg,osten,reauthorization,adamawa,sphagnum,hypermarket,millipedes,zoroaster,madea,ossuary,murrayfield,pronominal,gautham,resellers,ethers,quarrelled,dolna,stragglers,asami,tangut,passos,educacion,sharaf,texel,berio,bethpage,bezalel,marfa,noronha,36ers,genteel,avram,shilton,compensates,sweetener,reinstalled,disables,noether,1590s,balakrishnan,kotaro,northallerton,cataclysm,gholam,cancellara,schiphol,commends,longinus,albinism,gemayel,hamamatsu,volos,islamism,sidereal,pecuniary,diggings,townsquare,neosho,lushan,chittoor,akhil,disputation,desiccation,cambodians,thwarting,deliberated,ellipsis,bahini,susumu,separators,kohneh,plebeians,kultur,ogaden,pissarro,trypeta,latur,liaodong,vetting,datong,sohail,alchemists,lengthwise,unevenly,masterly,microcontrollers,occupier,deviating,farringdon,baccalaureat,theocracy,chebyshev,archivists,jayaram,ineffectiveness,scandinavians,jacobins,encomienda,nambu,g/cm3,catesby,paavo,heeded,rhodium,idealised,10deg,infective,mecyclothorax,halevy,sheared,minbari,audax,lusatian,rebuffs,hitfix,fastener,subjugate,tarun,binet,compuserve,synthesiser,keisuke,amalric,ligatures,tadashi,ignazio,abramovich,groundnut,otomo,maeve,mortlake,ostrogoths,antillean,todor,recto,millimetre,espousing,inaugurate,paracetamol,galvanic,harpalinae,jedrzejow,reassessment,langlands,civita,mikan,stikine,bijar,imamate,istana,kaiserliche,erastus,federale,cytosine,expansionism,hommes,norrland,smriti,snapdragon,gulab,taleb,lossy,khattab,urbanised,sesto,rekord,diffuser,desam,morganatic,silting,pacts,extender,beauharnais,purley,bouches,halfpipe,discontinuities,houthi,farmville,animism,horni,saadi,interpretative,blockades,symeon,biogeographic,transcaucasian,jetties,landrieu,astrocytes,conjunto,stumpings,weevils,geysers,redux,arching,romanus,tazeh,marcellinus,casein,opava,misrata,anare,sattar,declarer,dreux,oporto,venta,vallis,icosahedron,cortona,lachine,mohammedan,sandnes,zynga,clarin,diomedes,tsuyoshi,pribram,gulbarga,chartist,superettan,boscawen,altus,subang,gating,epistolary,vizianagaram,ogdensburg,panna,thyssen,tarkovsky,dzogchen,biograph,seremban,unscientific,nightjar,legco,deism,n.w.a,sudha,siskel,sassou,flintlock,jovial,montbeliard,pallida,formula_66,tranquillity,nisei,adornment,'people,yamhill,hockeyallsvenskan,adopters,appian,lowicz,haplotypes,succinctly,starogard,presidencies,kheyrabad,sobibor,kinesiology,cowichan,militum,cromwellian,leiningen,ps1.5,concourses,dalarna,goldfield,brzeg,faeces,aquarii,matchless,harvesters,181st,numismatics,korfball,sectioned,transpires,facultative,brandishing,kieron,forages,menai,glutinous,debarge,heathfield,1580s,malang,photoelectric,froome,semiotic,alwar,grammophon,chiaroscuro,mentalist,maramures,flacco,liquors,aleutians,marvell,sutlej,patnaik,qassam,flintoff,bayfield,haeckel,sueno,avicii,exoplanets,hoshi,annibale,vojislav,honeycombs,celebrant,rendsburg,veblen,quails,141st,carronades,savar,narrations,jeeva,ontologies,hedonistic,marinette,godot,munna,bessarabian,outrigger,thame,gravels,hoshino,falsifying,stereochemistry,nacionalista,medially,radula,ejecting,conservatorio,odile,ceiba,jaina,essonne,isometry,allophones,recidivism,iveco,ganda,grammarians,jagan,signposted,uncompressed,facilitators,constancy,ditko,propulsive,impaling,interbank,botolph,amlaib,intergroup,sorbus,cheka,debye,praca,adorning,presbyteries,dormition,strategos,qarase,pentecostals,beehives,hashemite,goldust,euronext,egress,arpanet,soames,jurchens,slovenska,copse,kazim,appraisals,marischal,mineola,sharada,caricaturist,sturluson,galba,faizabad,overwintering,grete,uyezds,didsbury,libreville,ablett,microstructure,anadolu,belenenses,elocution,cloaks,timeslots,halden,rashidun,displaces,sympatric,germanus,tuples,ceska,equalize,disassembly,krautrock,babangida,memel,deild,gopala,hematology,underclass,sangli,wawrinka,assur,toshack,refrains,nicotinic,bhagalpur,badami,racetracks,pocatello,walgreens,nazarbayev,occultation,spinnaker,geneon,josias,hydrolyzed,dzong,corregimiento,waistcoat,thermoplastic,soldered,anticancer,lactobacillus,shafi'i,carabus,adjournment,schlumberger,triceratops,despotate,mendicant,krishnamurti,bahasa,earthworm,lavoisier,noetherian,kalki,fervently,bhawan,saanich,coquille,gannet,motagua,kennels,mineralization,fitzherbert,svein,bifurcated,hairdressing,felis,abounded,dimers,fervour,hebdo,bluffton,aetna,corydon,clevedon,carneiro,subjectively,deutz,gastropoda,overshot,concatenation,varman,carolla,maharshi,mujib,inelastic,riverhead,initialized,safavids,rohini,caguas,bulges,fotbollforbund,hefei,spithead,westville,maronites,lytham,americo,gediminas,stephanus,chalcolithic,hijra,gnu/linux,predilection,rulership,sterility,haidar,scarlatti,saprissa,sviatoslav,pointedly,sunroof,guarantor,thevar,airstrips,pultusk,sture,129th,divinities,daizong,dolichoderus,cobourg,maoists,swordsmanship,uprated,bohme,tashi,largs,chandi,bluebeard,householders,richardsonian,drepanidae,antigonish,elbasan,occultism,marca,hypergeometric,oirat,stiglitz,ignites,dzungar,miquelon,pritam,d'automne,ulidiid,niamey,vallecano,fondo,billiton,incumbencies,raceme,chambery,cadell,barenaked,kagame,summerside,haussmann,hatshepsut,apothecaries,criollo,feint,nasals,timurid,feltham,plotinus,oxygenation,marginata,officinalis,salat,participations,ising,downe,izumo,unguided,pretence,coursed,haruna,viscountcy,mainstage,justicia,powiat,takara,capitoline,implacable,farben,stopford,cosmopterix,tuberous,kronecker,galatians,kweli,dogmas,exhorted,trebinje,skanda,newlyn,ablative,basidia,bhiwani,encroachments,stranglers,regrouping,tubal,shoestring,wawel,anionic,mesenchymal,creationists,pyrophosphate,moshi,despotism,powerbook,fatehpur,rupiah,segre,ternate,jessore,b.i.g,shevardnadze,abounds,gliwice,densest,memoria,suborbital,vietcong,ratepayers,karunanidhi,toolbar,descents,rhymney,exhortation,zahedan,carcinomas,hyperbaric,botvinnik,billets,neuropsychological,tigranes,hoards,chater,biennially,thistles,scotus,wataru,flotillas,hungama,monopolistic,payouts,vetch,generalissimo,caries,naumburg,piran,blizzards,escalates,reactant,shinya,theorize,rizzoli,transitway,ecclesiae,streptomyces,cantal,nisibis,superconductor,unworkable,thallus,roehampton,scheckter,viceroys,makuuchi,ilkley,superseding,takuya,klodzko,borbon,raspberries,operand,w.a.k.o,sarabande,factionalism,egalitarianism,temasek,torbat,unscripted,jorma,westerner,perfective,vrije,underlain,goldfrapp,blaenau,jomon,barthes,drivetime,bassa,bannock,umaga,fengxiang,zulus,sreenivasan,farces,codice_10,freeholder,poddebice,imperialists,deregulated,wingtip,o'hagan,pillared,overtone,hofstadter,149th,kitano,saybrook,standardizing,aldgate,staveley,o'flaherty,hundredths,steerable,soltan,empted,cruyff,intramuros,taluks,cotonou,marae,karur,figueres,barwon,lucullus,niobe,zemlya,lathes,homeported,chaux,amyotrophic,opines,exemplars,bhamo,homomorphisms,gauleiter,ladin,mafiosi,airdrieonians,b/soul,decal,transcaucasia,solti,defecation,deaconess,numidia,sampradaya,normalised,wingless,schwaben,alnus,cinerama,yakutsk,ketchikan,orvieto,unearned,monferrato,rotem,aacsb,loong,decoders,skerries,cardiothoracic,repositioning,pimpernel,yohannan,tenebrionoidea,nargis,nouvel,costliest,interdenominational,noize,redirecting,zither,morcha,radiometric,frequenting,irtysh,gbagbo,chakri,litvinenko,infotainment,ravensbruck,harith,corbels,maegashira,jousting,natan,novus,falcao,minis,railed,decile,rauma,ramaswamy,cavitation,paranaque,berchtesgaden,reanimated,schomberg,polysaccharides,exclusionary,cleon,anurag,ravaging,dhanush,mitchells,granule,contemptuous,keisei,rolleston,atlantean,yorkist,daraa,wapping,micrometer,keeneland,comparably,baranja,oranje,schlafli,yogic,dinajpur,unimpressive,masashi,recreativo,alemannic,petersfield,naoko,vasudeva,autosport,rajat,marella,busko,wethersfield,ssris,soulcalibur,kobani,wildland,rookery,hoffenheim,kauri,aliphatic,balaclava,ferrite,publicise,victorias,theism,quimper,chapbook,functionalist,roadbed,ulyanovsk,cupen,purpurea,calthorpe,teofilo,mousavi,cochlea,linotype,detmold,ellerslie,gakkai,telkom,southsea,subcontractor,inguinal,philatelists,zeebrugge,piave,trochidae,dempo,spoilt,saharanpur,mihrab,parasympathetic,barbarous,chartering,antiqua,katsina,bugis,categorizes,altstadt,kandyan,pambansa,overpasses,miters,assimilating,finlandia,uneconomic,am/fm,harpsichordist,dresdner,luminescence,authentically,overpowers,magmatic,cliftonville,oilfields,skirted,berthe,cuman,oakham,frelimo,glockenspiel,confection,saxophonists,piaseczno,multilevel,antipater,levying,maltreatment,velho,opoczno,harburg,pedophilia,unfunded,palettes,plasterwork,breve,dharmendra,auchinleck,nonesuch,blackmun,libretti,rabbani,145th,hasselbeck,kinnock,malate,vanden,cloverdale,ashgabat,nares,radians,steelworkers,sabor,possums,catterick,hemispheric,ostra,outpaced,dungeness,almshouse,penryn,texians,1000m,franchitti,incumbency,texcoco,newar,tramcars,toroidal,meitetsu,spellbound,agronomist,vinifera,riata,bunko,pinas,ba'al,github,vasilyevich,obsolescent,geodesics,ancestries,tujue,capitalised,unassigned,throng,unpaired,psychometric,skegness,exothermic,buffered,kristiansund,tongued,berenger,basho,alitalia,prolongation,archaeologically,fractionation,cyprinid,echinoderms,agriculturally,justiciar,sonam,ilium,baits,danceable,grazer,ardahan,grassed,preemption,glassworks,hasina,ugric,umbra,wahhabi,vannes,tinnitus,capitaine,tikrit,lisieux,scree,hormuz,despenser,jagiellon,maisonneuve,gandaki,santarem,basilicas,lancing,landskrona,weilburg,fireside,elysian,isleworth,krishnamurthy,filton,cynon,tecmo,subcostal,scalars,triglycerides,hyperplane,farmingdale,unione,meydan,pilings,mercosur,reactivate,akiba,fecundity,jatra,natsume,zarqawi,preta,masao,presbyter,oakenfold,rhodri,ferran,ruizong,cloyne,nelvana,epiphanius,borde,scutes,strictures,troughton,whitestone,sholom,toyah,shingon,kutuzov,abelard,passant,lipno,cafeterias,residuals,anabaptists,paratransit,criollos,pleven,radiata,destabilizing,hadiths,bazaars,mannose,taiyo,crookes,welbeck,baoding,archelaus,nguesso,alberni,wingtips,herts,viasat,lankans,evreux,wigram,fassbinder,ryuichi,storting,reducible,olesnica,znojmo,hyannis,theophanes,flatiron,mustering,rajahmundry,kadir,wayang,prome,lethargy,zubin,illegality,conall,dramedy,beerbohm,hipparchus,ziarat,ryuji,shugo,glenorchy,microarchitecture,morne,lewinsky,cauvery,battenberg,hyksos,wayanad,hamilcar,buhari,brazo,bratianu,solms,aksaray,elamite,chilcotin,bloodstock,sagara,dolny,reunified,umlaut,proteaceae,camborne,calabrian,dhanbad,vaxjo,cookware,potez,rediffusion,semitones,lamentations,allgau,guernica,suntory,pleated,stationing,urgell,gannets,bertelsmann,entryway,raphitomidae,acetaldehyde,nephrology,categorizing,beiyang,permeate,tourney,geosciences,khana,masayuki,crucis,universitaria,slaskie,khaimah,finno,advani,astonishingly,tubulin,vampiric,jeolla,sociale,cleethorpes,badri,muridae,suzong,debater,decimation,kenyans,mutualism,pontifex,middlemen,insee,halevi,lamentation,psychopathy,brassey,wenders,kavya,parabellum,prolactin,inescapable,apses,malignancies,rinzai,stigmatized,menahem,comox,ateliers,welshpool,setif,centimetre,truthfulness,downfield,drusus,woden,glycosylation,emanated,agulhas,dalkeith,jazira,nucky,unifil,jobim,operon,oryzomys,heroically,seances,supernumerary,backhouse,hashanah,tatler,imago,invert,hayato,clockmaker,kingsmill,swiecie,analogously,golconda,poste,tacitly,decentralised,ge'ez,diplomatically,fossiliferous,linseed,mahavira,pedestals,archpriest,byelection,domiciled,jeffersonian,bombus,winegrowing,waukegan,uncultivated,haverfordwest,saumur,communally,disbursed,cleeve,zeljeznicar,speciosa,vacationers,sigur,vaishali,zlatko,iftikhar,cropland,transkei,incompleteness,bohra,subantarctic,slieve,physiologic,similis,klerk,replanted,'right,chafee,reproducible,bayburt,regicide,muzaffarpur,plurals,hanyu,orthologs,diouf,assailed,kamui,tarik,dodecanese,gorne,on/off,179th,shimoga,granaries,carlists,valar,tripolitania,sherds,simmern,dissociated,isambard,polytechnical,yuvraj,brabazon,antisense,pubmed,glans,minutely,masaaki,raghavendra,savoury,podcasting,tachi,bienville,gongsun,ridgely,deform,yuichi,binders,canna,carcetti,llobregat,implored,berri,njegos,intermingled,offload,athenry,motherhouse,corpora,kakinada,dannebrog,imperio,prefaces,musicologists,aerospatiale,shirai,nagapattinam,servius,cristoforo,pomfret,reviled,entebbe,stane,east/west,thermometers,matriarchal,siglo,bodil,legionnaire,ze'ev,theorizing,sangeetha,horticulturist,uncountable,lookalike,anoxic,ionospheric,genealogists,chicopee,imprinting,popish,crematoria,diamondback,cyathea,hanzhong,cameramen,halogaland,naklo,waclaw,storehouses,flexed,comuni,frits,glauca,nilgiris,compresses,nainital,continuations,albay,hypoxic,samajwadi,dunkerque,nanticoke,sarwar,interchanged,jubal,corba,jalgaon,derleth,deathstroke,magny,vinnytsia,hyphenated,rimfire,sawan,boehner,disrepute,normalize,aromanian,dualistic,approximant,chama,karimabad,barnacles,sanok,stipends,dyfed,rijksmuseum,reverberation,suncorp,fungicides,reverie,spectrograph,stereophonic,niazi,ordos,alcan,karaite,lautrec,tableland,lamellar,rieti,langmuir,russula,webern,tweaks,hawick,southerner,morphy,naturalisation,enantiomer,michinoku,barbettes,relieves,carburettors,redruth,oblates,vocabularies,mogilev,bagmati,galium,reasserted,extolled,symon,eurosceptic,inflections,tirtha,recompense,oruro,roping,gouverneur,pared,yayoi,watermills,retooled,leukocytes,jubilant,mazhar,nicolau,manheim,touraine,bedser,hambledon,kohat,powerhouses,tlemcen,reuven,sympathetically,afrikaners,interes,handcrafts,etcher,baddeley,wodonga,amaury,155th,vulgarity,pompadour,automorphisms,1540s,oppositions,prekmurje,deryni,fortifying,arcuate,mahila,bocage,uther,nozze,slashes,atlantica,hadid,rhizomatous,azeris,'with,osmena,lewisville,innervated,bandmaster,outcropping,parallelogram,dominicana,twang,ingushetia,extensional,ladino,sastry,zinoviev,relatable,nobilis,cbeebies,hitless,eulima,sporangia,synge,longlisted,criminalized,penitential,weyden,tubule,volyn,priestesses,glenbrook,kibbutzim,windshaft,canadair,falange,zsolt,bonheur,meine,archangels,safeguarded,jamaicans,malarial,teasers,badging,merseyrail,operands,pulsars,gauchos,biotin,bambara,necaxa,egmond,tillage,coppi,anxiolytic,preah,mausoleums,plautus,feroz,debunked,187th,belediyespor,mujibur,wantage,carboxyl,chettiar,murnau,vagueness,racemic,backstretch,courtland,municipio,palpatine,dezful,hyperbola,sreekumar,chalons,altay,arapahoe,tudors,sapieha,quilon,burdensome,kanya,xxviii,recension,generis,siphuncle,repressor,bitrate,mandals,midhurst,dioxin,democratique,upholds,rodez,cinematographic,epoque,jinping,rabelais,zhytomyr,glenview,rebooted,khalidi,reticulata,122nd,monnaie,passersby,ghazals,europaea,lippmann,earthbound,tadic,andorran,artvin,angelicum,banksy,epicentre,resemblances,shuttled,rathaus,bernt,stonemasons,balochi,siang,tynemouth,cygni,biosynthetic,precipitates,sharecroppers,d'annunzio,softbank,shiji,apeldoorn,polycyclic,wenceslas,wuchang,samnites,tamarack,silmarillion,madinah,palaeontology,kirchberg,sculpin,rohtak,aquabats,oviparous,thynne,caney,blimps,minimalistic,whatcom,palatalization,bardstown,direct3d,paramagnetic,kamboja,khash,globemaster,lengua,matej,chernigov,swanage,arsenals,cascadia,cundinamarca,tusculum,leavers,organics,warplanes,'three,exertions,arminius,gandharva,inquires,comercio,kuopio,chabahar,plotlines,mersenne,anquetil,paralytic,buckminster,ambit,acrolophus,quantifiers,clacton,ciliary,ansaldo,fergana,egoism,thracians,chicoutimi,northbrook,analgesia,brotherhoods,hunza,adriaen,fluoridation,snowfalls,soundboard,fangoria,cannibalistic,orthogonius,chukotka,dindigul,manzoni,chainz,macromedia,beltline,muruga,schistura,provable,litex,initio,pneumoniae,infosys,cerium,boonton,cannonballs,d'une,solvency,mandurah,houthis,dolmens,apologists,radioisotopes,blaxploitation,poroshenko,stawell,coosa,maximilien,tempelhof,espouse,declaratory,hambro,xalapa,outmoded,mihiel,benefitting,desirous,archeparchy,repopulated,telescoping,captor,mackaye,disparaged,ramanathan,crowne,tumbled,technetium,silted,chedi,nievre,hyeon,cartoonish,interlock,infocom,rediff.com,dioramas,timekeeping,concertina,kutaisi,cesky,lubomirski,unapologetic,epigraphic,stalactites,sneha,biofilm,falconry,miraflores,catena,'outstanding,prospekt,apotheosis,o'odham,pacemakers,arabica,gandhinagar,reminisces,iroquoian,ornette,tilling,neoliberalism,chameleons,pandava,prefontaine,haiyan,gneisenau,utama,bando,reconstitution,azaria,canola,paratroops,ayckbourn,manistee,stourton,manifestos,lympne,denouement,tractatus,rakim,bellflower,nanometer,sassanids,turlough,presbyterianism,varmland,20deg,phool,nyerere,almohad,manipal,vlaanderen,quickness,removals,makow,circumflex,eatery,morane,fondazione,alkylation,unenforceable,galliano,silkworm,junior/senior,abducts,phlox,konskie,lofoten,buuren,glyphosate,faired,naturae,cobbles,taher,skrulls,dostoevsky,walkout,wagnerian,orbited,methodically,denzil,sarat,extraterritorial,kohima,d'armor,brinsley,rostropovich,fengtian,comitatus,aravind,moche,wrangell,giscard,vantaa,viljandi,hakoah,seabees,muscatine,ballade,camanachd,sothern,mullioned,durad,margraves,maven,arete,chandni,garifuna,142nd,reading/literature,thickest,intensifies,trygve,khaldun,perinatal,asana,powerline,acetylation,nureyev,omiya,montesquieu,riverwalk,marly,correlating,intermountain,bulgar,hammerheads,underscores,wiretapping,quatrain,ruisseau,newsagent,tuticorin,polygyny,hemsworth,partisanship,banna,istrian,evaporator".split(","),
74280female_names:"mary,patricia,linda,barbara,elizabeth,jennifer,maria,susan,margaret,dorothy,lisa,nancy,karen,betty,helen,sandra,donna,carol,ruth,sharon,michelle,laura,sarah,kimberly,deborah,jessica,shirley,cynthia,angela,melissa,brenda,amy,anna,rebecca,virginia,kathleen,pamela,martha,debra,amanda,stephanie,carolyn,christine,marie,janet,catherine,frances,ann,joyce,diane,alice,julie,heather,teresa,doris,gloria,evelyn,jean,cheryl,mildred,katherine,joan,ashley,judith,rose,janice,kelly,nicole,judy,christina,kathy,theresa,beverly,denise,tammy,irene,jane,lori,rachel,marilyn,andrea,kathryn,louise,sara,anne,jacqueline,wanda,bonnie,julia,ruby,lois,tina,phyllis,norma,paula,diana,annie,lillian,emily,robin,peggy,crystal,gladys,rita,dawn,connie,florence,tracy,edna,tiffany,carmen,rosa,cindy,grace,wendy,victoria,edith,kim,sherry,sylvia,josephine,thelma,shannon,sheila,ethel,ellen,elaine,marjorie,carrie,charlotte,monica,esther,pauline,emma,juanita,anita,rhonda,hazel,amber,eva,debbie,april,leslie,clara,lucille,jamie,joanne,eleanor,valerie,danielle,megan,alicia,suzanne,michele,gail,bertha,darlene,veronica,jill,erin,geraldine,lauren,cathy,joann,lorraine,lynn,sally,regina,erica,beatrice,dolores,bernice,audrey,yvonne,annette,marion,dana,stacy,ana,renee,ida,vivian,roberta,holly,brittany,melanie,loretta,yolanda,jeanette,laurie,katie,kristen,vanessa,alma,sue,elsie,beth,jeanne,vicki,carla,tara,rosemary,eileen,terri,gertrude,lucy,tonya,ella,stacey,wilma,gina,kristin,jessie,natalie,agnes,vera,charlene,bessie,delores,melinda,pearl,arlene,maureen,colleen,allison,tamara,joy,georgia,constance,lillie,claudia,jackie,marcia,tanya,nellie,minnie,marlene,heidi,glenda,lydia,viola,courtney,marian,stella,caroline,dora,vickie,mattie,maxine,irma,mabel,marsha,myrtle,lena,christy,deanna,patsy,hilda,gwendolyn,jennie,nora,margie,nina,cassandra,leah,penny,kay,priscilla,naomi,carole,olga,billie,dianne,tracey,leona,jenny,felicia,sonia,miriam,velma,becky,bobbie,violet,kristina,toni,misty,mae,shelly,daisy,ramona,sherri,erika,katrina,claire,lindsey,lindsay,geneva,guadalupe,belinda,margarita,sheryl,cora,faye,ada,sabrina,isabel,marguerite,hattie,harriet,molly,cecilia,kristi,brandi,blanche,sandy,rosie,joanna,iris,eunice,angie,inez,lynda,madeline,amelia,alberta,genevieve,monique,jodi,janie,kayla,sonya,jan,kristine,candace,fannie,maryann,opal,alison,yvette,melody,luz,susie,olivia,flora,shelley,kristy,mamie,lula,lola,verna,beulah,antoinette,candice,juana,jeannette,pam,kelli,whitney,bridget,karla,celia,latoya,patty,shelia,gayle,della,vicky,lynne,sheri,marianne,kara,jacquelyn,erma,blanca,myra,leticia,pat,krista,roxanne,angelica,robyn,adrienne,rosalie,alexandra,brooke,bethany,sadie,bernadette,traci,jody,kendra,nichole,rachael,mable,ernestine,muriel,marcella,elena,krystal,angelina,nadine,kari,estelle,dianna,paulette,lora,mona,doreen,rosemarie,desiree,antonia,janis,betsy,christie,freda,meredith,lynette,teri,cristina,eula,leigh,meghan,sophia,eloise,rochelle,gretchen,cecelia,raquel,henrietta,alyssa,jana,gwen,jenna,tricia,laverne,olive,tasha,silvia,elvira,delia,kate,patti,lorena,kellie,sonja,lila,lana,darla,mindy,essie,mandy,lorene,elsa,josefina,jeannie,miranda,dixie,lucia,marta,faith,lela,johanna,shari,camille,tami,shawna,elisa,ebony,melba,ora,nettie,tabitha,ollie,winifred,kristie,alisha,aimee,rena,myrna,marla,tammie,latasha,bonita,patrice,ronda,sherrie,addie,francine,deloris,stacie,adriana,cheri,abigail,celeste,jewel,cara,adele,rebekah,lucinda,dorthy,effie,trina,reba,sallie,aurora,lenora,etta,lottie,kerri,trisha,nikki,estella,francisca,josie,tracie,marissa,karin,brittney,janelle,lourdes,laurel,helene,fern,elva,corinne,kelsey,ina,bettie,elisabeth,aida,caitlin,ingrid,iva,eugenia,christa,goldie,maude,jenifer,therese,dena,lorna,janette,latonya,candy,consuelo,tamika,rosetta,debora,cherie,polly,dina,jewell,fay,jillian,dorothea,nell,trudy,esperanza,patrica,kimberley,shanna,helena,cleo,stefanie,rosario,ola,janine,mollie,lupe,alisa,lou,maribel,susanne,bette,susana,elise,cecile,isabelle,lesley,jocelyn,paige,joni,rachelle,leola,daphne,alta,ester,petra,graciela,imogene,jolene,keisha,lacey,glenna,gabriela,keri,ursula,lizzie,kirsten,shana,adeline,mayra,jayne,jaclyn,gracie,sondra,carmela,marisa,rosalind,charity,tonia,beatriz,marisol,clarice,jeanine,sheena,angeline,frieda,lily,shauna,millie,claudette,cathleen,angelia,gabrielle,autumn,katharine,jodie,staci,lea,christi,justine,elma,luella,margret,dominique,socorro,martina,margo,mavis,callie,bobbi,maritza,lucile,leanne,jeannine,deana,aileen,lorie,ladonna,willa,manuela,gale,selma,dolly,sybil,abby,ivy,dee,winnie,marcy,luisa,jeri,magdalena,ofelia,meagan,audra,matilda,leila,cornelia,bianca,simone,bettye,randi,virgie,latisha,barbra,georgina,eliza,leann,bridgette,rhoda,haley,adela,nola,bernadine,flossie,ila,greta,ruthie,nelda,minerva,lilly,terrie,letha,hilary,estela,valarie,brianna,rosalyn,earline,catalina,ava,mia,clarissa,lidia,corrine,alexandria,concepcion,tia,sharron,rae,dona,ericka,jami,elnora,chandra,lenore,neva,marylou,melisa,tabatha,serena,avis,allie,sofia,jeanie,odessa,nannie,harriett,loraine,penelope,milagros,emilia,benita,allyson,ashlee,tania,esmeralda,eve,pearlie,zelma,malinda,noreen,tameka,saundra,hillary,amie,althea,rosalinda,lilia,alana,clare,alejandra,elinor,lorrie,jerri,darcy,earnestine,carmella,noemi,marcie,liza,annabelle,louisa,earlene,mallory,carlene,nita,selena,tanisha,katy,julianne,lakisha,edwina,maricela,margery,kenya,dollie,roxie,roslyn,kathrine,nanette,charmaine,lavonne,ilene,tammi,suzette,corine,kaye,chrystal,lina,deanne,lilian,juliana,aline,luann,kasey,maryanne,evangeline,colette,melva,lawanda,yesenia,nadia,madge,kathie,ophelia,valeria,nona,mitzi,mari,georgette,claudine,fran,alissa,roseann,lakeisha,susanna,reva,deidre,chasity,sheree,elvia,alyce,deirdre,gena,briana,araceli,katelyn,rosanne,wendi,tessa,berta,marva,imelda,marietta,marci,leonor,arline,sasha,madelyn,janna,juliette,deena,aurelia,josefa,augusta,liliana,lessie,amalia,savannah,anastasia,vilma,natalia,rosella,lynnette,corina,alfreda,leanna,amparo,coleen,tamra,aisha,wilda,karyn,maura,mai,evangelina,rosanna,hallie,erna,enid,mariana,lacy,juliet,jacklyn,freida,madeleine,mara,cathryn,lelia,casandra,bridgett,angelita,jannie,dionne,annmarie,katina,beryl,millicent,katheryn,diann,carissa,maryellen,liz,lauri,helga,gilda,rhea,marquita,hollie,tisha,tamera,angelique,francesca,kaitlin,lolita,florine,rowena,reyna,twila,fanny,janell,ines,concetta,bertie,alba,brigitte,alyson,vonda,pansy,elba,noelle,letitia,deann,brandie,louella,leta,felecia,sharlene,lesa,beverley,isabella,herminia,terra,celina,tori,octavia,jade,denice,germaine,michell,cortney,nelly,doretha,deidra,monika,lashonda,judi,chelsey,antionette,margot,adelaide,leeann,elisha,dessie,libby,kathi,gayla,latanya,mina,mellisa,kimberlee,jasmin,renae,zelda,elda,justina,gussie,emilie,camilla,abbie,rocio,kaitlyn,edythe,ashleigh,selina,lakesha,geri,allene,pamala,michaela,dayna,caryn,rosalia,jacquline,rebeca,marybeth,krystle,iola,dottie,belle,griselda,ernestina,elida,adrianne,demetria,delma,jaqueline,arleen,virgina,retha,fatima,tillie,eleanore,cari,treva,wilhelmina,rosalee,maurine,latrice,jena,taryn,elia,debby,maudie,jeanna,delilah,catrina,shonda,hortencia,theodora,teresita,robbin,danette,delphine,brianne,nilda,danna,cindi,bess,iona,winona,vida,rosita,marianna,racheal,guillermina,eloisa,celestine,caren,malissa,lona,chantel,shellie,marisela,leora,agatha,soledad,migdalia,ivette,christen,athena,janel,veda,pattie,tessie,tera,marilynn,lucretia,karrie,dinah,daniela,alecia,adelina,vernice,shiela,portia,merry,lashawn,dara,tawana,verda,alene,zella,sandi,rafaela,maya,kira,candida,alvina,suzan,shayla,lettie,samatha,oralia,matilde,larissa,vesta,renita,delois,shanda,phillis,lorri,erlinda,cathrine,barb,isabell,ione,gisela,roxanna,mayme,kisha,ellie,mellissa,dorris,dalia,bella,annetta,zoila,reta,reina,lauretta,kylie,christal,pilar,charla,elissa,tiffani,tana,paulina,leota,breanna,jayme,carmel,vernell,tomasa,mandi,dominga,santa,melodie,lura,alexa,tamela,mirna,kerrie,venus,felicita,cristy,carmelita,berniece,annemarie,tiara,roseanne,missy,cori,roxana,pricilla,kristal,jung,elyse,haydee,aletha,bettina,marge,gillian,filomena,zenaida,harriette,caridad,vada,aretha,pearline,marjory,marcela,flor,evette,elouise,alina,damaris,catharine,belva,nakia,marlena,luanne,lorine,karon,dorene,danita,brenna,tatiana,louann,julianna,andria,philomena,lucila,leonora,dovie,romona,mimi,jacquelin,gaye,tonja,misti,chastity,stacia,roxann,micaela,velda,marlys,johnna,aura,ivonne,hayley,nicki,majorie,herlinda,yadira,perla,gregoria,antonette,shelli,mozelle,mariah,joelle,cordelia,josette,chiquita,trista,laquita,georgiana,candi,shanon,hildegard,stephany,magda,karol,gabriella,tiana,roma,richelle,oleta,jacque,idella,alaina,suzanna,jovita,tosha,nereida,marlyn,kyla,delfina,tena,stephenie,sabina,nathalie,marcelle,gertie,darleen,thea,sharonda,shantel,belen,venessa,rosalina,genoveva,clementine,rosalba,renate,renata,georgianna,floy,dorcas,ariana,tyra,theda,mariam,juli,jesica,vikki,verla,roselyn,melvina,jannette,ginny,debrah,corrie,violeta,myrtis,latricia,collette,charleen,anissa,viviana,twyla,nedra,latonia,hellen,fabiola,annamarie,adell,sharyn,chantal,niki,maud,lizette,lindy,kesha,jeana,danelle,charline,chanel,valorie,dortha,cristal,sunny,leone,leilani,gerri,debi,andra,keshia,eulalia,easter,dulce,natividad,linnie,kami,georgie,catina,brook,alda,winnifred,sharla,ruthann,meaghan,magdalene,lissette,adelaida,venita,trena,shirlene,shameka,elizebeth,dian,shanta,latosha,carlotta,windy,rosina,mariann,leisa,jonnie,dawna,cathie,astrid,laureen,janeen,holli,fawn,vickey,teressa,shante,rubye,marcelina,chanda,terese,scarlett,marnie,lulu,lisette,jeniffer,elenor,dorinda,donita,carman,bernita,altagracia,aleta,adrianna,zoraida,lyndsey,janina,starla,phylis,phuong,kyra,charisse,blanch,sanjuanita,rona,nanci,marilee,maranda,brigette,sanjuana,marita,kassandra,joycelyn,felipa,chelsie,bonny,mireya,lorenza,kyong,ileana,candelaria,sherie,lucie,leatrice,lakeshia,gerda,edie,bambi,marylin,lavon,hortense,garnet,evie,tressa,shayna,lavina,kyung,jeanetta,sherrill,shara,phyliss,mittie,anabel,alesia,thuy,tawanda,joanie,tiffanie,lashanda,karissa,enriqueta,daria,daniella,corinna,alanna,abbey,roxane,roseanna,magnolia,lida,joellen,coral,carleen,tresa,peggie,novella,nila,maybelle,jenelle,carina,nova,melina,marquerite,margarette,josephina,evonne,cinthia,albina,toya,tawnya,sherita,myriam,lizabeth,lise,keely,jenni,giselle,cheryle,ardith,ardis,alesha,adriane,shaina,linnea,karolyn,felisha,dori,darci,artie,armida,zola,xiomara,vergie,shamika,nena,nannette,maxie,lovie,jeane,jaimie,inge,farrah,elaina,caitlyn,felicitas,cherly,caryl,yolonda,yasmin,teena,prudence,pennie,nydia,mackenzie,orpha,marvel,lizbeth,laurette,jerrie,hermelinda,carolee,tierra,mirian,meta,melony,kori,jennette,jamila,yoshiko,susannah,salina,rhiannon,joleen,cristine,ashton,aracely,tomeka,shalonda,marti,lacie,kala,jada,ilse,hailey,brittani,zona,syble,sherryl,nidia,marlo,kandice,kandi,alycia,ronna,norene,mercy,ingeborg,giovanna,gemma,christel,audry,zora,vita,trish,stephaine,shirlee,shanika,melonie,mazie,jazmin,inga,hettie,geralyn,fonda,estrella,adella,sarita,rina,milissa,maribeth,golda,evon,ethelyn,enedina,cherise,chana,velva,tawanna,sade,mirta,karie,jacinta,elna,davina,cierra,ashlie,albertha,tanesha,nelle,mindi,lorinda,larue,florene,demetra,dedra,ciara,chantelle,ashly,suzy,rosalva,noelia,lyda,leatha,krystyna,kristan,karri,darline,darcie,cinda,cherrie,awilda,almeda,rolanda,lanette,jerilyn,gisele,evalyn,cyndi,cleta,carin,zina,zena,velia,tanika,charissa,talia,margarete,lavonda,kaylee,kathlene,jonna,irena,ilona,idalia,candis,candance,brandee,anitra,alida,sigrid,nicolette,maryjo,linette,hedwig,christiana,alexia,tressie,modesta,lupita,lita,gladis,evelia,davida,cherri,cecily,ashely,annabel,agustina,wanita,shirly,rosaura,hulda,yetta,verona,thomasina,sibyl,shannan,mechelle,leandra,lani,kylee,kandy,jolynn,ferne,eboni,corene,alysia,zula,nada,moira,lyndsay,lorretta,jammie,hortensia,gaynell,adria,vina,vicenta,tangela,stephine,norine,nella,liana,leslee,kimberely,iliana,glory,felica,emogene,elfriede,eden,eartha,carma,ocie,lennie,kiara,jacalyn,carlota,arielle,otilia,kirstin,kacey,johnetta,joetta,jeraldine,jaunita,elana,dorthea,cami,amada,adelia,vernita,tamar,siobhan,renea,rashida,ouida,nilsa,meryl,kristyn,julieta,danica,breanne,aurea,anglea,sherron,odette,malia,lorelei,leesa,kenna,kathlyn,fiona,charlette,suzie,shantell,sabra,racquel,myong,mira,martine,lucienne,lavada,juliann,elvera,delphia,christiane,charolette,carri,asha,angella,paola,ninfa,leda,stefani,shanell,palma,machelle,lissa,kecia,kathryne,karlene,julissa,jettie,jenniffer,corrina,carolann,alena,rosaria,myrtice,marylee,liane,kenyatta,judie,janey,elmira,eldora,denna,cristi,cathi,zaida,vonnie,viva,vernie,rosaline,mariela,luciana,lesli,karan,felice,deneen,adina,wynona,tarsha,sheron,shanita,shani,shandra,randa,pinkie,nelida,marilou,lyla,laurene,laci,janene,dorotha,daniele,dani,carolynn,carlyn,berenice,ayesha,anneliese,alethea,thersa,tamiko,rufina,oliva,mozell,marylyn,kristian,kathyrn,kasandra,kandace,janae,domenica,debbra,dannielle,chun,arcelia,zenobia,sharen,sharee,lavinia,kacie,jackeline,huong,felisa,emelia,eleanora,cythia,cristin,claribel,anastacia,zulma,zandra,yoko,tenisha,susann,sherilyn,shay,shawanda,romana,mathilda,linsey,keiko,joana,isela,gretta,georgetta,eugenie,desirae,delora,corazon,antonina,anika,willene,tracee,tamatha,nichelle,mickie,maegan,luana,lanita,kelsie,edelmira,bree,afton,teodora,tamie,shena,linh,keli,kaci,danyelle,arlette,albertine,adelle,tiffiny,simona,nicolasa,nichol,nakisha,maira,loreen,kizzy,fallon,christene,bobbye,ying,vincenza,tanja,rubie,roni,queenie,margarett,kimberli,irmgard,idell,hilma,evelina,esta,emilee,dennise,dania,carie,risa,rikki,particia,masako,luvenia,loree,loni,lien,gigi,florencia,denita,billye,tomika,sharita,rana,nikole,neoma,margarite,madalyn,lucina,laila,kali,jenette,gabriele,evelyne,elenora,clementina,alejandrina,zulema,violette,vannessa,thresa,retta,patience,noella,nickie,jonell,chaya,camelia,bethel,anya,suzann,mila,lilla,laverna,keesha,kattie,georgene,eveline,estell,elizbeth,vivienne,vallie,trudie,stephane,magaly,madie,kenyetta,karren,janetta,hermine,drucilla,debbi,celestina,candie,britni,beckie,amina,zita,yolande,vivien,vernetta,trudi,pearle,patrina,ossie,nicolle,loyce,letty,katharina,joselyn,jonelle,jenell,iesha,heide,florinda,florentina,elodia,dorine,brunilda,brigid,ashli,ardella,twana,tarah,shavon,serina,rayna,ramonita,margurite,lucrecia,kourtney,kati,jesenia,crista,ayana,alica,alia,vinnie,suellen,romelia,rachell,olympia,michiko,kathaleen,jolie,jessi,janessa,hana,elease,carletta,britany,shona,salome,rosamond,regena,raina,ngoc,nelia,louvenia,lesia,latrina,laticia,larhonda,jina,jacki,emmy,deeann,coretta,arnetta,thalia,shanice,neta,mikki,micki,lonna,leana,lashunda,kiley,joye,jacqulyn,ignacia,hyun,hiroko,henriette,elayne,delinda,dahlia,coreen,consuela,conchita,babette,ayanna,anette,albertina,shawnee,shaneka,quiana,pamelia,merri,merlene,margit,kiesha,kiera,kaylene,jodee,jenise,erlene,emmie,dalila,daisey,casie,belia,babara,versie,vanesa,shelba,shawnda,nikia,naoma,marna,margeret,madaline,lawana,kindra,jutta,jazmine,janett,hannelore,glendora,gertrud,garnett,freeda,frederica,florance,flavia,carline,beverlee,anjanette,valda,tamala,shonna,sarina,oneida,merilyn,marleen,lurline,lenna,katherin,jeni,gracia,glady,farah,enola,dominque,devona,delana,cecila,caprice,alysha,alethia,vena,theresia,tawny,shakira,samara,sachiko,rachele,pamella,marni,mariel,maren,malisa,ligia,lera,latoria,larae,kimber,kathern,karey,jennefer,janeth,halina,fredia,delisa,debroah,ciera,angelika,andree,altha,vivan,terresa,tanna,sudie,signe,salena,ronni,rebbecca,myrtie,malika,maida,leonarda,kayleigh,ethyl,ellyn,dayle,cammie,brittni,birgit,avelina,asuncion,arianna,akiko,venice,tyesha,tonie,tiesha,takisha,steffanie,sindy,meghann,manda,macie,kellye,kellee,joslyn,inger,indira,glinda,glennis,fernanda,faustina,eneida,elicia,digna,dell,arletta,willia,tammara,tabetha,sherrell,sari,rebbeca,pauletta,natosha,nakita,mammie,kenisha,kazuko,kassie,earlean,daphine,corliss,clotilde,carolyne,bernetta,augustina,audrea,annis,annabell,tennille,tamica,selene,rosana,regenia,qiana,markita,macy,leeanne,laurine,jessenia,janita,georgine,genie,emiko,elvie,deandra,dagmar,corie,collen,cherish,romaine,porsha,pearlene,micheline,merna,margorie,margaretta,lore,jenine,hermina,fredericka,elke,drusilla,dorathy,dione,celena,brigida,allegra,tamekia,synthia,sook,slyvia,rosann,reatha,raye,marquetta,margart,ling,layla,kymberly,kiana,kayleen,katlyn,karmen,joella,emelda,eleni,detra,clemmie,cheryll,chantell,cathey,arnita,arla,angle,angelic,alyse,zofia,thomasine,tennie,sherly,sherley,sharyl,remedios,petrina,nickole,myung,myrle,mozella,louanne,lisha,latia,krysta,julienne,jeanene,jacqualine,isaura,gwenda,earleen,cleopatra,carlie,audie,antonietta,alise,verdell,tomoko,thao,talisha,shemika,savanna,santina,rosia,raeann,odilia,nana,minna,magan,lynelle,karma,joeann,ivana,inell,ilana,gudrun,dreama,crissy,chante,carmelina,arvilla,annamae,alvera,aleida,yanira,vanda,tianna,stefania,shira,nicol,nancie,monserrate,melynda,melany,lovella,laure,kacy,jacquelynn,hyon,gertha,eliana,christena,christeen,charise,caterina,carley,candyce,arlena,ammie,willette,vanita,tuyet,syreeta,penney,nyla,maryam,marya,magen,ludie,loma,livia,lanell,kimberlie,julee,donetta,diedra,denisha,deane,dawne,clarine,cherryl,bronwyn,alla,valery,tonda,sueann,soraya,shoshana,shela,sharleen,shanelle,nerissa,meridith,mellie,maye,maple,magaret,lili,leonila,leonie,leeanna,lavonia,lavera,kristel,kathey,kathe,jann,ilda,hildred,hildegarde,genia,fumiko,evelin,ermelinda,elly,dung,doloris,dionna,danae,berneice,annice,alix,verena,verdie,shawnna,shawana,shaunna,rozella,randee,ranae,milagro,lynell,luise,loida,lisbeth,karleen,junita,jona,isis,hyacinth,hedy,gwenn,ethelene,erline,donya,domonique,delicia,dannette,cicely,branda,blythe,bethann,ashlyn,annalee,alline,yuko,vella,trang,towanda,tesha,sherlyn,narcisa,miguelina,meri,maybell,marlana,marguerita,madlyn,lory,loriann,leonore,leighann,laurice,latesha,laronda,katrice,kasie,kaley,jadwiga,glennie,gearldine,francina,epifania,dyan,dorie,diedre,denese,demetrice,delena,cristie,cleora,catarina,carisa,barbera,almeta,trula,tereasa,solange,sheilah,shavonne,sanora,rochell,mathilde,margareta,maia,lynsey,lawanna,launa,kena,keena,katia,glynda,gaylene,elvina,elanor,danuta,danika,cristen,cordie,coletta,clarita,carmon,brynn,azucena,aundrea,angele,verlie,verlene,tamesha,silvana,sebrina,samira,reda,raylene,penni,norah,noma,mireille,melissia,maryalice,laraine,kimbery,karyl,karine,jolanda,johana,jesusa,jaleesa,jacquelyne,iluminada,hilaria,hanh,gennie,francie,floretta,exie,edda,drema,delpha,barbar,assunta,ardell,annalisa,alisia,yukiko,yolando,wonda,waltraud,veta,temeka,tameika,shirleen,shenita,piedad,ozella,mirtha,marilu,kimiko,juliane,jenice,janay,jacquiline,hilde,elois,echo,devorah,chau,brinda,betsey,arminda,aracelis,apryl,annett,alishia,veola,usha,toshiko,theola,tashia,talitha,shery,renetta,reiko,rasheeda,obdulia,mika,melaine,meggan,marlen,marget,marceline,mana,magdalen,librada,lezlie,latashia,lasandra,kelle,isidra,inocencia,gwyn,francoise,erminia,erinn,dimple,devora,criselda,armanda,arie,ariane,angelena,aliza,adriene,adaline,xochitl,twanna,tomiko,tamisha,taisha,susy,rutha,rhona,noriko,natashia,merrie,marinda,mariko,margert,loris,lizzette,leisha,kaila,joannie,jerrica,jene,jannet,janee,jacinda,herta,elenore,doretta,delaine,daniell,claudie,britta,apolonia,amberly,alease,yuri,waneta,tomi,sharri,sandie,roselle,reynalda,raguel,phylicia,patria,olimpia,odelia,mitzie,minda,mignon,mica,mendy,marivel,maile,lynetta,lavette,lauryn,latrisha,lakiesha,kiersten,kary,josphine,jolyn,jetta,janise,jacquie,ivelisse,glynis,gianna,gaynelle,danyell,danille,dacia,coralee,cher,ceola,arianne,aleshia,yung,williemae,trinh,thora,sherika,shemeka,shaunda,roseline,ricki,melda,mallie,lavonna,latina,laquanda,lala,lachelle,klara,kandis,johna,jeanmarie,jaye,grayce,gertude,emerita,ebonie,clorinda,ching,chery,carola,breann,blossom,bernardine,becki,arletha,argelia,alita,yulanda,yessenia,tobi,tasia,sylvie,shirl,shirely,shella,shantelle,sacha,rebecka,providencia,paulene,misha,miki,marline,marica,lorita,latoyia,lasonya,kerstin,kenda,keitha,kathrin,jaymie,gricelda,ginette,eryn,elina,elfrieda,danyel,cheree,chanelle,barrie,aurore,annamaria,alleen,ailene,aide,yasmine,vashti,treasa,tiffaney,sheryll,sharie,shanae,raisa,neda,mitsuko,mirella,milda,maryanna,maragret,mabelle,luetta,lorina,letisha,latarsha,lanelle,lajuana,krissy,karly,karena,jessika,jerica,jeanelle,jalisa,jacelyn,izola,euna,etha,domitila,dominica,daina,creola,carli,camie,brittny,ashanti,anisha,aleen,adah,yasuko,valrie,tona,tinisha,terisa,taneka,simonne,shalanda,serita,ressie,refugia,olene,margherita,mandie,maire,lyndia,luci,lorriane,loreta,leonia,lavona,lashawnda,lakia,kyoko,krystina,krysten,kenia,kelsi,jeanice,isobel,georgiann,genny,felicidad,eilene,deloise,deedee,conception,clora,cherilyn,calandra,armandina,anisa,tiera,theressa,stephania,sima,shyla,shonta,shera,shaquita,shala,rossana,nohemi,nery,moriah,melita,melida,melani,marylynn,marisha,mariette,malorie,madelene,ludivina,loria,lorette,loralee,lianne,lavenia,laurinda,lashon,kimi,keila,katelynn,jone,joane,jayna,janella,hertha,francene,elinore,despina,delsie,deedra,clemencia,carolin,bulah,brittanie,blondell,bibi,beaulah,beata,annita,agripina,virgen,valene,twanda,tommye,tarra,tari,tammera,shakia,sadye,ruthanne,rochel,rivka,pura,nenita,natisha,ming,merrilee,melodee,marvis,lucilla,leena,laveta,larita,lanie,keren,ileen,georgeann,genna,frida,eufemia,emely,edyth,deonna,deadra,darlena,chanell,cathern,cassondra,cassaundra,bernarda,berna,arlinda,anamaria,vertie,valeri,torri,stasia,sherise,sherill,sanda,ruthe,rosy,robbi,ranee,quyen,pearly,palmira,onita,nisha,niesha,nida,merlyn,mayola,marylouise,marth,margene,madelaine,londa,leontine,leoma,leia,lauralee,lanora,lakita,kiyoko,keturah,katelin,kareen,jonie,johnette,jenee,jeanett,izetta,hiedi,heike,hassie,giuseppina,georgann,fidela,fernande,elwanda,ellamae,eliz,dusti,dotty,cyndy,coralie,celesta,alverta,xenia,wava,vanetta,torrie,tashina,tandy,tambra,tama,stepanie,shila,shaunta,sharan,shaniqua,shae,setsuko,serafina,sandee,rosamaria,priscila,olinda,nadene,muoi,michelina,mercedez,maryrose,marcene,magali,mafalda,lannie,kayce,karoline,kamilah,kamala,justa,joline,jennine,jacquetta,iraida,georgeanna,franchesca,emeline,elane,ehtel,earlie,dulcie,dalene,classie,chere,charis,caroyln,carmina,carita,bethanie,ayako,arica,alysa,alessandra,akilah,adrien,zetta,youlanda,yelena,yahaira,xuan,wendolyn,tijuana,terina,teresia,suzi,sherell,shavonda,shaunte,sharda,shakita,sena,ryann,rubi,riva,reginia,rachal,parthenia,pamula,monnie,monet,michaele,melia,malka,maisha,lisandra,lekisha,lean,lakendra,krystin,kortney,kizzie,kittie,kera,kendal,kemberly,kanisha,julene,jule,johanne,jamee,halley,gidget,fredricka,fleta,fatimah,eusebia,elza,eleonore,dorthey,doria,donella,dinorah,delorse,claretha,christinia,charlyn,bong,belkis,azzie,andera,aiko,adena,yajaira,vania,ulrike,toshia,tifany,stefany,shizue,shenika,shawanna,sharolyn,sharilyn,shaquana,shantay,rozanne,roselee,remona,reanna,raelene,phung,petronila,natacha,nancey,myrl,miyoko,miesha,merideth,marvella,marquitta,marhta,marchelle,lizeth,libbie,lahoma,ladawn,kina,katheleen,katharyn,karisa,kaleigh,junie,julieann,johnsie,janean,jaimee,jackqueline,hisako,herma,helaine,gwyneth,gita,eustolia,emelina,elin,edris,donnette,donnetta,dierdre,denae,darcel,clarisa,cinderella,chia,charlesetta,charita,celsa,cassy,cassi,carlee,bruna,brittaney,brande,billi,antonetta,angla,angelyn,analisa,alane,wenona,wendie,veronique,vannesa,tobie,tempie,sumiko,sulema,somer,sheba,sharice,shanel,shalon,rosio,roselia,renay,rema,reena,ozie,oretha,oralee,ngan,nakesha,milly,marybelle,margrett,maragaret,manie,lurlene,lillia,lieselotte,lavelle,lashaunda,lakeesha,kaycee,kalyn,joya,joette,jenae,janiece,illa,grisel,glayds,genevie,gala,fredda,eleonor,debera,deandrea,corrinne,cordia,contessa,colene,cleotilde,chantay,cecille,beatris,azalee,arlean,ardath,anjelica,anja,alfredia,aleisha,zada,yuonne,xiao,willodean,vennie,vanna,tyisha,tova,torie,tonisha,tilda,tien,sirena,sherril,shanti,shan,senaida,samella,robbyn,renda,reita,phebe,paulita,nobuko,nguyet,neomi,mikaela,melania,maximina,marg,maisie,lynna,lilli,lashaun,lakenya,lael,kirstie,kathline,kasha,karlyn,karima,jovan,josefine,jennell,jacqui,jackelyn,hien,grazyna,florrie,floria,eleonora,dwana,dorla,delmy,deja,dede,dann,crysta,clelia,claris,chieko,cherlyn,cherelle,charmain,chara,cammy,arnette,ardelle,annika,amiee,amee,allena,yvone,yuki,yoshie,yevette,yael,willetta,voncile,venetta,tula,tonette,timika,temika,telma,teisha,taren,stacee,shawnta,saturnina,ricarda,pasty,onie,nubia,marielle,mariella,marianela,mardell,luanna,loise,lisabeth,lindsy,lilliana,lilliam,lelah,leigha,leanora,kristeen,khalilah,keeley,kandra,junko,joaquina,jerlene,jani,jamika,hsiu,hermila,genevive,evia,eugena,emmaline,elfreda,elene,donette,delcie,deeanna,darcey,clarinda,cira,chae,celinda,catheryn,casimira,carmelia,camellia,breana,bobette,bernardina,bebe,basilia,arlyne,amal,alayna,zonia,zenia,yuriko,yaeko,wynell,willena,vernia,tora,terrilyn,terica,tenesha,tawna,tajuana,taina,stephnie,sona,sina,shondra,shizuko,sherlene,sherice,sharika,rossie,rosena,rima,rheba,renna,natalya,nancee,melodi,meda,matha,marketta,maricruz,marcelene,malvina,luba,louetta,leida,lecia,lauran,lashawna,laine,khadijah,katerine,kasi,kallie,julietta,jesusita,jestine,jessia,jeffie,janyce,isadora,georgianne,fidelia,evita,eura,eulah,estefana,elsy,eladia,dodie,denisse,deloras,delila,daysi,crystle,concha,claretta,charlsie,charlena,carylon,bettyann,asley,ashlea,amira,agueda,agnus,yuette,vinita,victorina,tynisha,treena,toccara,tish,thomasena,tegan,soila,shenna,sharmaine,shantae,shandi,saran,sarai,sana,rosette,rolande,regine,otelia,olevia,nicholle,necole,naida,myrta,myesha,mitsue,minta,mertie,margy,mahalia,madalene,loura,lorean,lesha,leonida,lenita,lavone,lashell,lashandra,lamonica,kimbra,katherina,karry,kanesha,jong,jeneva,jaquelyn,gilma,ghislaine,gertrudis,fransisca,fermina,ettie,etsuko,ellan,elidia,edra,dorethea,doreatha,denyse,deetta,daine,cyrstal,corrin,cayla,carlita,camila,burma,bula,buena,barabara,avril,alaine,zana,wilhemina,wanetta,verline,vasiliki,tonita,tisa,teofila,tayna,taunya,tandra,takako,sunni,suanne,sixta,sharell,seema,rosenda,robena,raymonde,pamila,ozell,neida,mistie,micha,merissa,maurita,maryln,maryetta,marcell,malena,makeda,lovetta,lourie,lorrine,lorilee,laurena,lashay,larraine,laree,lacresha,kristle,keva,keira,karole,joie,jinny,jeannetta,jama,heidy,gilberte,gema,faviola,evelynn,enda,elli,ellena,divina,dagny,collene,codi,cindie,chassidy,chasidy,catrice,catherina,cassey,caroll,carlena,candra,calista,bryanna,britteny,beula,bari,audrie,audria,ardelia,annelle,angila,alona,allyn".split(","),surnames:"smith,johnson,williams,jones,brown,davis,miller,wilson,moore,taylor,anderson,jackson,white,harris,martin,thompson,garcia,martinez,robinson,clark,rodriguez,lewis,lee,walker,hall,allen,young,hernandez,king,wright,lopez,hill,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,watson,brooks,sanders,price,bennett,wood,barnes,ross,henderson,coleman,jenkins,perry,powell,long,patterson,hughes,flores,washington,butler,simmons,foster,gonzales,bryant,alexander,griffin,diaz,hayes,myers,ford,hamilton,graham,sullivan,wallace,woods,cole,west,owens,reynolds,fisher,ellis,harrison,gibson,mcdonald,cruz,marshall,ortiz,gomez,murray,freeman,wells,webb,simpson,stevens,tucker,porter,hicks,crawford,boyd,mason,morales,kennedy,warren,dixon,ramos,reyes,burns,gordon,shaw,holmes,rice,robertson,hunt,black,daniels,palmer,mills,nichols,grant,knight,ferguson,stone,hawkins,dunn,perkins,hudson,spencer,gardner,stephens,payne,pierce,berry,matthews,arnold,wagner,willis,watkins,olson,carroll,duncan,snyder,hart,cunningham,lane,andrews,ruiz,harper,fox,riley,armstrong,carpenter,weaver,greene,elliott,chavez,sims,peters,kelley,franklin,lawson,fields,gutierrez,schmidt,carr,vasquez,castillo,wheeler,chapman,montgomery,richards,williamson,johnston,banks,meyer,bishop,mccoy,howell,alvarez,morrison,hansen,fernandez,garza,harvey,burton,nguyen,jacobs,reid,fuller,lynch,garrett,romero,welch,larson,frazier,burke,hanson,mendoza,moreno,bowman,medina,fowler,brewer,hoffman,carlson,silva,pearson,holland,fleming,jensen,vargas,byrd,davidson,hopkins,herrera,wade,soto,walters,neal,caldwell,lowe,jennings,barnett,graves,jimenez,horton,shelton,barrett,obrien,castro,sutton,mckinney,lucas,miles,rodriquez,chambers,holt,lambert,fletcher,watts,bates,hale,rhodes,pena,beck,newman,haynes,mcdaniel,mendez,bush,vaughn,parks,dawson,santiago,norris,hardy,steele,curry,powers,schultz,barker,guzman,page,munoz,ball,keller,chandler,weber,walsh,lyons,ramsey,wolfe,schneider,mullins,benson,sharp,bowen,barber,cummings,hines,baldwin,griffith,valdez,hubbard,salazar,reeves,warner,stevenson,burgess,santos,tate,cross,garner,mann,mack,moss,thornton,mcgee,farmer,delgado,aguilar,vega,glover,manning,cohen,harmon,rodgers,robbins,newton,blair,higgins,ingram,reese,cannon,strickland,townsend,potter,goodwin,walton,rowe,hampton,ortega,patton,swanson,goodman,maldonado,yates,becker,erickson,hodges,rios,conner,adkins,webster,malone,hammond,flowers,cobb,moody,quinn,pope,osborne,mccarthy,guerrero,estrada,sandoval,gibbs,gross,fitzgerald,stokes,doyle,saunders,wise,colon,gill,alvarado,greer,padilla,waters,nunez,ballard,schwartz,mcbride,houston,christensen,klein,pratt,briggs,parsons,mclaughlin,zimmerman,buchanan,moran,copeland,pittman,brady,mccormick,holloway,brock,poole,logan,bass,marsh,drake,wong,jefferson,morton,abbott,sparks,norton,huff,massey,figueroa,carson,bowers,roberson,barton,tran,lamb,harrington,boone,cortez,clarke,mathis,singleton,wilkins,cain,underwood,hogan,mckenzie,collier,luna,phelps,mcguire,bridges,wilkerson,nash,summers,atkins,wilcox,pitts,conley,marquez,burnett,cochran,chase,davenport,hood,gates,ayala,sawyer,vazquez,dickerson,hodge,acosta,flynn,espinoza,nicholson,monroe,wolf,morrow,whitaker,oconnor,skinner,ware,molina,kirby,huffman,gilmore,dominguez,oneal,lang,combs,kramer,hancock,gallagher,gaines,shaffer,wiggins,mathews,mcclain,fischer,wall,melton,hensley,bond,dyer,grimes,contreras,wyatt,baxter,snow,mosley,shepherd,larsen,hoover,beasley,petersen,whitehead,meyers,garrison,shields,horn,savage,olsen,schroeder,hartman,woodard,mueller,kemp,deleon,booth,patel,calhoun,wiley,eaton,cline,navarro,harrell,humphrey,parrish,duran,hutchinson,hess,dorsey,bullock,robles,beard,dalton,avila,rich,blackwell,johns,blankenship,trevino,salinas,campos,pruitt,callahan,montoya,hardin,guerra,mcdowell,stafford,gallegos,henson,wilkinson,booker,merritt,atkinson,orr,decker,hobbs,tanner,knox,pacheco,stephenson,glass,rojas,serrano,marks,hickman,sweeney,strong,mcclure,conway,roth,maynard,farrell,lowery,hurst,nixon,weiss,trujillo,ellison,sloan,juarez,winters,mclean,boyer,villarreal,mccall,gentry,carrillo,ayers,lara,sexton,pace,hull,leblanc,browning,velasquez,leach,chang,sellers,herring,noble,foley,bartlett,mercado,landry,durham,walls,barr,mckee,bauer,rivers,bradshaw,pugh,velez,rush,estes,dodson,morse,sheppard,weeks,camacho,bean,barron,livingston,middleton,spears,branch,blevins,chen,kerr,mcconnell,hatfield,harding,solis,frost,giles,blackburn,pennington,woodward,finley,mcintosh,koch,mccullough,blanchard,rivas,brennan,mejia,kane,benton,buckley,valentine,maddox,russo,mcknight,buck,moon,mcmillan,crosby,berg,dotson,mays,roach,chan,richmond,meadows,faulkner,oneill,knapp,kline,ochoa,jacobson,gay,hendricks,horne,shepard,hebert,cardenas,mcintyre,waller,holman,donaldson,cantu,morin,gillespie,fuentes,tillman,bentley,peck,key,salas,rollins,gamble,dickson,santana,cabrera,cervantes,howe,hinton,hurley,spence,zamora,yang,mcneil,suarez,petty,gould,mcfarland,sampson,carver,bray,macdonald,stout,hester,melendez,dillon,farley,hopper,galloway,potts,joyner,stein,aguirre,osborn,mercer,bender,franco,rowland,sykes,pickett,sears,mayo,dunlap,hayden,wilder,mckay,coffey,mccarty,ewing,cooley,vaughan,bonner,cotton,holder,stark,ferrell,cantrell,fulton,lott,calderon,pollard,hooper,burch,mullen,fry,riddle,levy,duke,odonnell,britt,daugherty,berger,dillard,alston,frye,riggs,chaney,odom,duffy,fitzpatrick,valenzuela,mayer,alford,mcpherson,acevedo,barrera,cote,reilly,compton,mooney,mcgowan,craft,clemons,wynn,nielsen,baird,stanton,snider,rosales,bright,witt,hays,holden,rutledge,kinney,clements,castaneda,slater,hahn,burks,delaney,pate,lancaster,sharpe,whitfield,talley,macias,burris,ratliff,mccray,madden,kaufman,beach,goff,cash,bolton,mcfadden,levine,byers,kirkland,kidd,workman,carney,mcleod,holcomb,finch,sosa,haney,franks,sargent,nieves,downs,rasmussen,bird,hewitt,foreman,valencia,oneil,delacruz,vinson,dejesus,hyde,forbes,gilliam,guthrie,wooten,huber,barlow,boyle,mcmahon,buckner,rocha,puckett,langley,knowles,cooke,velazquez,whitley,vang,shea,rouse,hartley,mayfield,elder,rankin,hanna,cowan,lucero,arroyo,slaughter,haas,oconnell,minor,boucher,archer,boggs,dougherty,andersen,newell,crowe,wang,friedman,bland,swain,holley,pearce,childs,yarbrough,galvan,proctor,meeks,lozano,mora,rangel,bacon,villanueva,schaefer,rosado,helms,boyce,goss,stinson,ibarra,hutchins,covington,crowley,hatcher,mackey,bunch,womack,polk,dodd,childress,childers,villa,springer,mahoney,dailey,belcher,lockhart,griggs,costa,brandt,walden,moser,tatum,mccann,akers,lutz,pryor,orozco,mcallister,lugo,davies,shoemaker,rutherford,newsome,magee,chamberlain,blanton,simms,godfrey,flanagan,crum,cordova,escobar,downing,sinclair,donahue,krueger,mcginnis,gore,farris,webber,corbett,andrade,starr,lyon,yoder,hastings,mcgrath,spivey,krause,harden,crabtree,kirkpatrick,arrington,ritter,mcghee,bolden,maloney,gagnon,dunbar,ponce,pike,mayes,beatty,mobley,kimball,butts,montes,eldridge,braun,hamm,gibbons,moyer,manley,herron,plummer,elmore,cramer,rucker,pierson,fontenot,rubio,goldstein,elkins,wills,novak,hickey,worley,gorman,katz,dickinson,broussard,woodruff,crow,britton,nance,lehman,bingham,zuniga,whaley,shafer,coffman,steward,delarosa,neely,mata,davila,mccabe,kessler,hinkle,welsh,pagan,goldberg,goins,crouch,cuevas,quinones,mcdermott,hendrickson,samuels,denton,bergeron,ivey,locke,haines,snell,hoskins,byrne,arias,corbin,beltran,chappell,downey,dooley,tuttle,couch,payton,mcelroy,crockett,groves,cartwright,dickey,mcgill,dubois,muniz,tolbert,dempsey,cisneros,sewell,latham,vigil,tapia,rainey,norwood,stroud,meade,tipton,kuhn,hilliard,bonilla,teague,gunn,greenwood,correa,reece,pineda,phipps,frey,kaiser,ames,gunter,schmitt,milligan,espinosa,bowden,vickers,lowry,pritchard,costello,piper,mcclellan,lovell,sheehan,hatch,dobson,singh,jeffries,hollingsworth,sorensen,meza,fink,donnelly,burrell,tomlinson,colbert,billings,ritchie,helton,sutherland,peoples,mcqueen,thomason,givens,crocker,vogel,robison,dunham,coker,swartz,keys,ladner,richter,hargrove,edmonds,brantley,albright,murdock,boswell,muller,quintero,padgett,kenney,daly,connolly,inman,quintana,lund,barnard,villegas,simons,huggins,tidwell,sanderson,bullard,mcclendon,duarte,draper,marrero,dwyer,abrams,stover,goode,fraser,crews,bernal,godwin,conklin,mcneal,baca,esparza,crowder,bower,brewster,mcneill,rodrigues,leal,coates,raines,mccain,mccord,miner,holbrook,swift,dukes,carlisle,aldridge,ackerman,starks,ricks,holliday,ferris,hairston,sheffield,lange,fountain,doss,betts,kaplan,carmichael,bloom,ruffin,penn,kern,bowles,sizemore,larkin,dupree,seals,metcalf,hutchison,henley,farr,mccauley,hankins,gustafson,curran,waddell,ramey,cates,pollock,cummins,messer,heller,funk,cornett,palacios,galindo,cano,hathaway,pham,enriquez,salgado,pelletier,painter,wiseman,blount,feliciano,houser,doherty,mead,mcgraw,swan,capps,blanco,blackmon,thomson,mcmanus,burkett,gleason,dickens,cormier,voss,rushing,rosenberg,hurd,dumas,benitez,arellano,marin,caudill,bragg,jaramillo,huerta,gipson,colvin,biggs,vela,platt,cassidy,tompkins,mccollum,dolan,daley,crump,sneed,kilgore,grove,grimm,davison,brunson,prater,marcum,devine,dodge,stratton,rosas,choi,tripp,ledbetter,hightower,feldman,epps,yeager,posey,scruggs,cope,stubbs,richey,overton,trotter,sprague,cordero,butcher,stiles,burgos,woodson,horner,bassett,purcell,haskins,akins,ziegler,spaulding,hadley,grubbs,sumner,murillo,zavala,shook,lockwood,driscoll,dahl,thorpe,redmond,putnam,mcwilliams,mcrae,romano,joiner,sadler,hedrick,hager,hagen,fitch,coulter,thacker,mansfield,langston,guidry,ferreira,corley,conn,rossi,lackey,baez,saenz,mcnamara,mcmullen,mckenna,mcdonough,link,engel,browne,roper,peacock,eubanks,drummond,stringer,pritchett,parham,mims,landers,grayson,schafer,egan,timmons,ohara,keen,hamlin,finn,cortes,mcnair,nadeau,moseley,michaud,rosen,oakes,kurtz,jeffers,calloway,beal,bautista,winn,suggs,stern,stapleton,lyles,laird,montano,dawkins,hagan,goldman,bryson,barajas,lovett,segura,metz,lockett,langford,hinson,eastman,hooks,smallwood,shapiro,crowell,whalen,triplett,chatman,aldrich,cahill,youngblood,ybarra,stallings,sheets,reeder,connelly,bateman,abernathy,winkler,wilkes,masters,hackett,granger,gillis,schmitz,sapp,napier,souza,lanier,gomes,weir,otero,ledford,burroughs,babcock,ventura,siegel,dugan,bledsoe,atwood,wray,varner,spangler,anaya,staley,kraft,fournier,belanger,wolff,thorne,bynum,burnette,boykin,swenson,purvis,pina,khan,duvall,darby,xiong,kauffman,healy,engle,benoit,valle,steiner,spicer,shaver,randle,lundy,chin,calvert,staton,neff,kearney,darden,oakley,medeiros,mccracken,crenshaw,perdue,dill,whittaker,tobin,washburn,hogue,goodrich,easley,bravo,dennison,shipley,kerns,jorgensen,crain,villalobos,maurer,longoria,keene,coon,witherspoon,staples,pettit,kincaid,eason,madrid,echols,lusk,stahl,currie,thayer,shultz,mcnally,seay,maher,gagne,barrow,nava,moreland,honeycutt,hearn,diggs,caron,whitten,westbrook,stovall,ragland,munson,meier,looney,kimble,jolly,hobson,goddard,culver,burr,presley,negron,connell,tovar,huddleston,ashby,salter,root,pendleton,oleary,nickerson,myrick,judd,jacobsen,bain,adair,starnes,matos,busby,herndon,hanley,bellamy,doty,bartley,yazzie,rowell,parson,gifford,cullen,christiansen,benavides,barnhart,talbot,mock,crandall,connors,bonds,whitt,gage,bergman,arredondo,addison,lujan,dowdy,jernigan,huynh,bouchard,dutton,rhoades,ouellette,kiser,herrington,hare,blackman,babb,allred,rudd,paulson,ogden,koenig,geiger,begay,parra,lassiter,hawk,esposito,waldron,ransom,prather,chacon,vick,sands,roark,parr,mayberry,greenberg,coley,bruner,whitman,skaggs,shipman,leary,hutton,romo,medrano,ladd,kruse,askew,schulz,alfaro,tabor,mohr,gallo,bermudez,pereira,bliss,reaves,flint,comer,woodall,naquin,guevara,delong,carrier,pickens,tilley,schaffer,knutson,fenton,doran,vogt,vann,prescott,mclain,landis,corcoran,zapata,hyatt,hemphill,faulk,dove,boudreaux,aragon,whitlock,trejo,tackett,shearer,saldana,hanks,mckinnon,koehler,bourgeois,keyes,goodson,foote,lunsford,goldsmith,flood,winslow,sams,reagan,mccloud,hough,esquivel,naylor,loomis,coronado,ludwig,braswell,bearden,huang,fagan,ezell,edmondson,cronin,nunn,lemon,guillory,grier,dubose,traylor,ryder,dobbins,coyle,aponte,whitmore,smalls,rowan,malloy,cardona,braxton,borden,humphries,carrasco,ruff,metzger,huntley,hinojosa,finney,madsen,ernst,dozier,burkhart,bowser,peralta,daigle,whittington,sorenson,saucedo,roche,redding,fugate,avalos,waite,lind,huston,hawthorne,hamby,boyles,boles,regan,faust,crook,beam,barger,hinds,gallardo,willoughby,willingham,eckert,busch,zepeda,worthington,tinsley,hoff,hawley,carmona,varela,rector,newcomb,kinsey,dube,whatley,ragsdale,bernstein,becerra,yost,mattson,felder,cheek,handy,grossman,gauthier,escobedo,braden,beckman,mott,hillman,flaherty,dykes,stockton,stearns,lofton,coats,cavazos,beavers,barrios,tang,mosher,cardwell,coles,burnham,weller,lemons,beebe,aguilera,parnell,harman,couture,alley,schumacher,redd,dobbs,blum,blalock,merchant,ennis,denson,cottrell,brannon,bagley,aviles,watt,sousa,rosenthal,rooney,dietz,blank,paquette,mcclelland,duff,velasco,lentz,grubb,burrows,barbour,ulrich,shockley,rader,beyer,mixon,layton,altman,weathers,stoner,squires,shipp,priest,lipscomb,cutler,caballero,zimmer,willett,thurston,storey,medley,epperson,shah,mcmillian,baggett,torrez,hirsch,dent,poirier,peachey,farrar,creech,barth,trimble,dupre,albrecht,sample,lawler,crisp,conroy,wetzel,nesbitt,murry,jameson,wilhelm,patten,minton,matson,kimbrough,guinn,croft,toth,pulliam,nugent,newby,littlejohn,dias,canales,bernier,baron,singletary,renteria,pruett,mchugh,mabry,landrum,brower,stoddard,cagle,stjohn,scales,kohler,kellogg,hopson,gant,tharp,gann,zeigler,pringle,hammons,fairchild,deaton,chavis,carnes,rowley,matlock,kearns,irizarry,carrington,starkey,lopes,jarrell,craven,baum,littlefield,linn,humphreys,etheridge,cuellar,chastain,bundy,speer,skelton,quiroz,pyle,portillo,ponder,moulton,machado,killian,hutson,hitchcock,dowling,cloud,burdick,spann,pedersen,levin,leggett,hayward,dietrich,beaulieu,barksdale,wakefield,snowden,briscoe,bowie,berman,ogle,mcgregor,laughlin,helm,burden,wheatley,schreiber,pressley,parris,alaniz,agee,swann,snodgrass,schuster,radford,monk,mattingly,harp,girard,cheney,yancey,wagoner,ridley,lombardo,hudgins,gaskins,duckworth,coburn,willey,prado,newberry,magana,hammonds,elam,whipple,slade,serna,ojeda,liles,dorman,diehl,upton,reardon,michaels,goetz,eller,bauman,baer,layne,hummel,brenner,amaya,adamson,ornelas,dowell,cloutier,castellanos,wellman,saylor,orourke,moya,montalvo,kilpatrick,durbin,shell,oldham,kang,garvin,foss,branham,bartholomew,templeton,maguire,holton,rider,monahan,mccormack,beaty,anders,streeter,nieto,nielson,moffett,lankford,keating,heck,gatlin,delatorre,callaway,adcock,worrell,unger,robinette,nowak,jeter,brunner,steen,parrott,overstreet,nobles,montanez,clevenger,brinkley,trahan,quarles,pickering,pederson,jansen,grantham,gilchrist,crespo,aiken,schell,schaeffer,lorenz,leyva,harms,dyson,wallis,pease,leavitt,cheng,cavanaugh,batts,warden,seaman,rockwell,quezada,paxton,linder,houck,fontaine,durant,caruso,adler,pimentel,mize,lytle,cleary,cason,acker,switzer,isaacs,higginbotham,waterman,vandyke,stamper,sisk,shuler,riddick,mcmahan,levesque,hatton,bronson,bollinger,arnett,okeefe,gerber,gannon,farnsworth,baughman,silverman,satterfield,mccrary,kowalski,grigsby,greco,cabral,trout,rinehart,mahon,linton,gooden,curley,baugh,wyman,weiner,schwab,schuler,morrissey,mahan,bunn,thrasher,spear,waggoner,qualls,purdy,mcwhorter,mauldin,gilman,perryman,newsom,menard,martino,graf,billingsley,artis,simpkins,salisbury,quintanilla,gilliland,fraley,foust,crouse,scarborough,grissom,fultz,marlow,markham,madrigal,lawton,barfield,whiting,varney,schwarz,gooch,arce,wheat,truong,poulin,hurtado,selby,gaither,fortner,culpepper,coughlin,brinson,boudreau,bales,stepp,holm,schilling,morrell,kahn,heaton,gamez,causey,turpin,shanks,schrader,meek,isom,hardison,carranza,yanez,scroggins,schofield,runyon,ratcliff,murrell,moeller,irby,currier,butterfield,ralston,pullen,pinson,estep,carbone,hawks,ellington,casillas,spurlock,sikes,motley,mccartney,kruger,isbell,houle,burk,tomlin,quigley,neumann,lovelace,fennell,cheatham,bustamante,skidmore,hidalgo,forman,culp,bowens,betancourt,aquino,robb,milner,martel,gresham,wiles,ricketts,dowd,collazo,bostic,blakely,sherrod,kenyon,gandy,ebert,deloach,allard,sauer,robins,olivares,gillette,chestnut,bourque,paine,hite,hauser,devore,crawley,chapa,talbert,poindexter,meador,mcduffie,mattox,kraus,harkins,choate,wren,sledge,sanborn,kinder,geary,cornwell,barclay,abney,seward,rhoads,howland,fortier,benner,vines,tubbs,troutman,rapp,mccurdy,deluca,westmoreland,havens,guajardo,clary,seal,meehan,herzog,guillen,ashcraft,waugh,renner,milam,elrod,churchill,breaux,bolin,asher,windham,tirado,pemberton,nolen,noland,knott,emmons,cornish,christenson,brownlee,barbee,waldrop,pitt,olvera,lombardi,gruber,gaffney,eggleston,banda,archuleta,slone,prewitt,pfeiffer,nettles,mena,mcadams,henning,gardiner,cromwell,chisholm,burleson,vest,oglesby,mccarter,lumpkin,wofford,vanhorn,thorn,teel,swafford,stclair,stanfield,ocampo,herrmann,hannon,arsenault,roush,mcalister,hiatt,gunderson,forsythe,duggan,delvalle,cintron,wilks,weinstein,uribe,rizzo,noyes,mclendon,gurley,bethea,winstead,maples,guyton,giordano,alderman,valdes,polanco,pappas,lively,grogan,griffiths,bobo,arevalo,whitson,sowell,rendon,fernandes,farrow,benavidez,ayres,alicea,stump,smalley,seitz,schulte,gilley,gallant,canfield,wolford,omalley,mcnutt,mcnulty,mcgovern,hardman,harbin,cowart,chavarria,brink,beckett,bagwell,armstead,anglin,abreu,reynoso,krebs,jett,hoffmann,greenfield,forte,burney,broome,sisson,trammell,partridge,mace,lomax,lemieux,gossett,frantz,fogle,cooney,broughton,pence,paulsen,muncy,mcarthur,hollins,beauchamp,withers,osorio,mulligan,hoyle,dockery,cockrell,begley,amador,roby,rains,lindquist,gentile,everhart,bohannon,wylie,sommers,purnell,fortin,dunning,breeden,vail,phelan,phan,marx,cosby,colburn,boling,biddle,ledesma,gaddis,denney,chow,bueno,berrios,wicker,tolliver,thibodeaux,nagle,lavoie,fisk,crist,barbosa,reedy,locklear,kolb,himes,behrens,beckwith,weems,wahl,shorter,shackelford,rees,muse,cerda,valadez,thibodeau,saavedra,ridgeway,reiter,mchenry,majors,lachance,keaton,ferrara,clemens,blocker,applegate,needham,mojica,kuykendall,hamel,escamilla,doughty,burchett,ainsworth,vidal,upchurch,thigpen,strauss,spruill,sowers,riggins,ricker,mccombs,harlow,buffington,sotelo,olivas,negrete,morey,macon,logsdon,lapointe,bigelow,bello,westfall,stubblefield,lindley,hein,hawes,farrington,breen,birch,wilde,steed,sepulveda,reinhardt,proffitt,minter,messina,mcnabb,maier,keeler,gamboa,donohue,basham,shinn,crooks,cota,borders,bills,bachman,tisdale,tavares,schmid,pickard,gulley,fonseca,delossantos,condon,batista,wicks,wadsworth,martell,littleton,ison,haag,folsom,brumfield,broyles,brito,mireles,mcdonnell,leclair,hamblin,gough,fanning,binder,winfield,whitworth,soriano,palumbo,newkirk,mangum,hutcherson,comstock,carlin,beall,bair,wendt,watters,walling,putman,otoole,morley,mares,lemus,keener,hundley,dial,damico,billups,strother,mcfarlane,lamm,eaves,crutcher,caraballo,canty,atwell,taft,siler,rust,rawls,rawlings,prieto,mcneely,mcafee,hulsey,hackney,galvez,escalante,delagarza,crider,bandy,wilbanks,stowe,steinberg,renfro,masterson,massie,lanham,haskell,hamrick,dehart,burdette,branson,bourne,babin,aleman,worthy,tibbs,smoot,slack,paradis,mull,luce,houghton,gantt,furman,danner,christianson,burge,ashford,arndt,almeida,stallworth,shade,searcy,sager,noonan,mclemore,mcintire,maxey,lavigne,jobe,ferrer,falk,coffin,byrnes,aranda,apodaca,stamps,rounds,peek,olmstead,lewandowski,kaminski,dunaway,bruns,brackett,amato,reich,mcclung,lacroix,koontz,herrick,hardesty,flanders,cousins,cato,cade,vickery,shank,nagel,dupuis,croteau,cotter,stuckey,stine,porterfield,pauley,moffitt,knudsen,hardwick,goforth,dupont,blunt,barrows,barnhill,shull,rash,loftis,lemay,kitchens,horvath,grenier,fuchs,fairbanks,culbertson,calkins,burnside,beattie,ashworth,albertson,wertz,vaught,vallejo,turk,tuck,tijerina,sage,peterman,marroquin,marr,lantz,hoang,demarco,cone,berube,barnette,wharton,stinnett,slocum,scanlon,sander,pinto,mancuso,lima,headley,epstein,counts,clarkson,carnahan,boren,arteaga,adame,zook,whittle,whitehurst,wenzel,saxton,reddick,puente,handley,haggerty,earley,devlin,chaffin,cady,acuna,solano,sigler,pollack,pendergrass,ostrander,janes,francois,crutchfield,chamberlin,brubaker,baptiste,willson,reis,neeley,mullin,mercier,lira,layman,keeling,higdon,espinal,chapin,warfield,toledo,pulido,peebles,nagy,montague,mello,lear,jaeger,hogg,graff,furr,soliz,poore,mendenhall,mclaurin,maestas,gable,barraza,tillery,snead,pond,neill,mcculloch,mccorkle,lightfoot,hutchings,holloman,harness,dorn,bock,zielinski,turley,treadwell,stpierre,starling,somers,oswald,merrick,easterling,bivens,truitt,poston,parry,ontiveros,olivarez,moreau,medlin,lenz,knowlton,fairley,cobbs,chisolm,bannister,woodworth,toler,ocasio,noriega,neuman,moye,milburn,mcclanahan,lilley,hanes,flannery,dellinger,danielson,conti,blodgett,beers,weatherford,strain,karr,hitt,denham,custer,coble,clough,casteel,bolduc,batchelor,ammons,whitlow,tierney,staten,sibley,seifert,schubert,salcedo,mattison,laney,haggard,grooms,dees,cromer,cooks,colson,caswell,zarate,swisher,shin,ragan,pridgen,mcvey,matheny,lafleur,franz,ferraro,dugger,whiteside,rigsby,mcmurray,lehmann,jacoby,hildebrand,hendrick,headrick,goad,fincher,drury,borges,archibald,albers,woodcock,trapp,soares,seaton,monson,luckett,lindberg,kopp,keeton,healey,garvey,gaddy,fain,burchfield,wentworth,strand,stack,spooner,saucier,ricci,plunkett,pannell,ness,leger,freitas,fong,elizondo,duval,beaudoin,urbina,rickard,partin,mcgrew,mcclintock,ledoux,forsyth,faison,devries,bertrand,wasson,tilton,scarbrough,leung,irvine,garber,denning,corral,colley,castleberry,bowlin,bogan,beale,baines,trice,rayburn,parkinson,nunes,mcmillen,leahy,kimmel,higgs,fulmer,carden,bedford,taggart,spearman,prichard,morrill,koonce,heinz,hedges,guenther,grice,findley,dover,creighton,boothe,bayer,arreola,vitale,valles,raney,osgood,hanlon,burley,bounds,worden,weatherly,vetter,tanaka,stiltner,nevarez,mosby,montero,melancon,harter,hamer,goble,gladden,gist,ginn,akin,zaragoza,tarver,sammons,royster,oreilly,muir,morehead,luster,kingsley,kelso,grisham,glynn,baumann,alves,yount,tamayo,paterson,oates,menendez,longo,hargis,gillen,desantis,conover,breedlove,sumpter,scherer,rupp,reichert,heredia,creel,cohn,clemmons,casas,bickford,belton,bach,williford,whitcomb,tennant,sutter,stull,mccallum,langlois,keel,keegan,dangelo,dancy,damron,clapp,clanton,bankston,oliveira,mintz,mcinnis,martens,mabe,laster,jolley,hildreth,hefner,glaser,duckett,demers,brockman,blais,alcorn,agnew,toliver,tice,seeley,najera,musser,mcfall,laplante,galvin,fajardo,doan,coyne,copley,clawson,cheung,barone,wynne,woodley,tremblay,stoll,sparrow,sparkman,schweitzer,sasser,samples,roney,legg,heim,farias,colwell,christman,bratcher,winchester,upshaw,southerland,sorrell,sells,mccloskey,martindale,luttrell,loveless,lovejoy,linares,latimer,embry,coombs,bratton,bostick,venable,tuggle,toro,staggs,sandlin,jefferies,heckman,griffis,crayton,clem,browder,thorton,sturgill,sprouse,royer,rousseau,ridenour,pogue,perales,peeples,metzler,mesa,mccutcheon,mcbee,hornsby,heffner,corrigan,armijo,plante,peyton,paredes,macklin,hussey,hodgson,granados,frias,becnel,batten,almanza,turney,teal,sturgeon,meeker,mcdaniels,limon,keeney,hutto,holguin,gorham,fishman,fierro,blanchette,rodrigue,reddy,osburn,oden,lerma,kirkwood,keefer,haugen,hammett,chalmers,brinkman,baumgartner,zhang,valerio,tellez,steffen,shumate,sauls,ripley,kemper,guffey,evers,craddock,carvalho,blaylock,banuelos,balderas,wheaton,turnbull,shuman,pointer,mosier,mccue,ligon,kozlowski,johansen,ingle,herr,briones,snipes,rickman,pipkin,pantoja,orosco,moniz,lawless,kunkel,hibbard,galarza,enos,bussey,schott,salcido,perreault,mcdougal,mccool,haight,garris,easton,conyers,atherton,wimberly,utley,spellman,smithson,slagle,ritchey,rand,petit,osullivan,oaks,nutt,mcvay,mccreary,mayhew,knoll,jewett,harwood,cardoza,ashe,arriaga,zeller,wirth,whitmire,stauffer,rountree,redden,mccaffrey,martz,larose,langdon,humes,gaskin,faber,devito,cass,almond,wingfield,wingate,villareal,tyner,smothers,severson,reno,pennell,maupin,leighton,janssen,hassell,hallman,halcomb,folse,fitzsimmons,fahey,cranford,bolen,battles,battaglia,wooldridge,trask,rosser,regalado,mcewen,keefe,fuqua,echevarria,caro,boynton,andrus,viera,vanmeter,taber,spradlin,seibert,provost,prentice,oliphant,laporte,hwang,hatchett,hass,greiner,freedman,covert,chilton,byars,wiese,venegas,swank,shrader,roberge,mullis,mortensen,mccune,marlowe,kirchner,keck,isaacson,hostetler,halverson,gunther,griswold,fenner,durden,blackwood,ahrens,sawyers,savoy,nabors,mcswain,mackay,lavender,lash,labbe,jessup,fullerton,cruse,crittenden,correia,centeno,caudle,canady,callender,alarcon,ahern,winfrey,tribble,salley,roden,musgrove,minnick,fortenberry,carrion,bunting,batiste,whited,underhill,stillwell,rauch,pippin,perrin,messenger,mancini,lister,kinard,hartmann,fleck,wilt,treadway,thornhill,spalding,rafferty,pitre,patino,ordonez,linkous,kelleher,homan,galbraith,feeney,curtin,coward,camarillo,buss,bunnell,bolt,beeler,autry,alcala,witte,wentz,stidham,shively,nunley,meacham,martins,lemke,lefebvre,hynes,horowitz,hoppe,holcombe,dunne,derr,cochrane,brittain,bedard,beauregard,torrence,strunk,soria,simonson,shumaker,scoggins,oconner,moriarty,kuntz,ives,hutcheson,horan,hales,garmon,fitts,bohn,atchison,wisniewski,vanwinkle,sturm,sallee,prosser,moen,lundberg,kunz,kohl,keane,jorgenson,jaynes,funderburk,freed,durr,creamer,cosgrove,batson,vanhoose,thomsen,teeter,smyth,redmon,orellana,maness,heflin,goulet,frick,forney,bunker,asbury,aguiar,talbott,southard,mowery,mears,lemmon,krieger,hickson,elston,duong,delgadillo,dayton,dasilva,conaway,catron,bruton,bradbury,bordelon,bivins,bittner,bergstrom,beals,abell,whelan,tejada,pulley,pino,norfleet,nealy,maes,loper,gatewood,frierson,freund,finnegan,cupp,covey,catalano,boehm,bader,yoon,walston,tenney,sipes,rawlins,medlock,mccaskill,mccallister,marcotte,maclean,hughey,henke,harwell,gladney,gilson,chism,caskey,brandenburg,baylor,villasenor,veal,thatcher,stegall,petrie,nowlin,navarrete,lombard,loftin,lemaster,kroll,kovach,kimbrell,kidwell,hershberger,fulcher,cantwell,bustos,boland,bobbitt,binkley,wester,weis,verdin,tong,tiller,sisco,sharkey,seymore,rosenbaum,rohr,quinonez,pinkston,malley,logue,lessard,lerner,lebron,krauss,klinger,halstead,haller,getz,burrow,alger,shores,pfeifer,perron,nelms,munn,mcmaster,mckenney,manns,knudson,hutchens,huskey,goebel,flagg,cushman,click,castellano,carder,bumgarner,wampler,spinks,robson,neel,mcreynolds,mathias,maas,loera,jenson,florez,coons,buckingham,brogan,berryman,wilmoth,wilhite,thrash,shephard,seidel,schulze,roldan,pettis,obryan,maki,mackie,hatley,frazer,fiore,chesser,bottoms,bisson,benefield,allman,wilke,trudeau,timm,shifflett,mundy,milliken,mayers,leake,kohn,huntington,horsley,hermann,guerin,fryer,frizzell,foret,flemming,fife,criswell,carbajal,bozeman,boisvert,angulo,wallen,tapp,silvers,ramsay,oshea,orta,moll,mckeever,mcgehee,linville,kiefer,ketchum,howerton,groce,gass,fusco,corbitt,betz,bartels,amaral,aiello,weddle,sperry,seiler,runyan,raley,overby,osteen,olds,mckeown,matney,lauer,lattimore,hindman,hartwell,fredrickson,fredericks,espino,clegg,carswell,cambell,burkholder,woodbury,welker,totten,thornburg,theriault,stitt,stamm,stackhouse,scholl,saxon,rife,razo,quinlan,pinkerton,olivo,nesmith,nall,mattos,lafferty,justus,giron,geer,fielder,drayton,dortch,conners,conger,boatwright,billiot,barden,armenta,tibbetts,steadman,slattery,rinaldi,raynor,pinckney,pettigrew,milne,matteson,halsey,gonsalves,fellows,durand,desimone,cowley,cowles,brill,barham,barela,barba,ashmore,withrow,valenti,tejeda,spriggs,sayre,salerno,peltier,peel,merriman,matheson,lowman,lindstrom,hyland,giroux,earls,dugas,dabney,collado,briseno,baxley,whyte,wenger,vanover,vanburen,thiel,schindler,schiller,rigby,pomeroy,passmore,marble,manzo,mahaffey,lindgren,laflamme,greathouse,fite,calabrese,bayne,yamamoto,wick,townes,thames,reinhart,peeler,naranjo,montez,mcdade,mast,markley,marchand,leeper,kellum,hudgens,hennessey,hadden,gainey,coppola,borrego,bolling,beane,ault,slaton,pape,null,mulkey,lightner,langer,hillard,ethridge,enright,derosa,baskin,weinberg,turman,somerville,pardo,noll,lashley,ingraham,hiller,hendon,glaze,cothran,cooksey,conte,carrico,abner,wooley,swope,summerlin,sturgis,sturdivant,stott,spurgeon,spillman,speight,roussel,popp,nutter,mckeon,mazza,magnuson,lanning,kozak,jankowski,heyward,forster,corwin,callaghan,bays,wortham,usher,theriot,sayers,sabo,poling,loya,lieberman,laroche,labelle,howes,harr,garay,fogarty,everson,durkin,dominquez,chaves,chambliss,witcher,vieira,vandiver,terrill,stoker,schreiner,moorman,liddell,lawhorn,krug,irons,hylton,hollenbeck,herrin,hembree,goolsby,goodin,gilmer,foltz,dinkins,daughtry,caban,brim,briley,bilodeau,wyant,vergara,tallent,swearingen,stroup,scribner,quillen,pitman,mccants,maxfield,martinson,holtz,flournoy,brookins,brody,baumgardner,straub,sills,roybal,roundtree,oswalt,mcgriff,mcdougall,mccleary,maggard,gragg,gooding,godinez,doolittle,donato,cowell,cassell,bracken,appel,zambrano,reuter,perea,nakamura,monaghan,mickens,mcclinton,mcclary,marler,kish,judkins,gilbreath,freese,flanigan,felts,erdmann,dodds,chew,brownell,boatright,barreto,slayton,sandberg,saldivar,pettway,odum,narvaez,moultrie,montemayor,merrell,lees,keyser,hoke,hardaway,hannan,gilbertson,fogg,dumont,deberry,coggins,buxton,bucher,broadnax,beeson,araujo,appleton,amundson,aguayo,ackley,yocum,worsham,shivers,sanches,sacco,robey,rhoden,pender,ochs,mccurry,madera,luong,knotts,jackman,heinrich,hargrave,gault,comeaux,chitwood,caraway,boettcher,bernhardt,barrientos,zink,wickham,whiteman,thorp,stillman,settles,schoonover,roque,riddell,pilcher,phifer,novotny,macleod,hardee,haase,grider,doucette,clausen,bevins,beamon,badillo,tolley,tindall,soule,snook,seale,pinkney,pellegrino,nowell,nemeth,mondragon,mclane,lundgren,ingalls,hudspeth,hixson,gearhart,furlong,downes,dibble,deyoung,cornejo,camara,brookshire,boyette,wolcott,surratt,sellars,segal,salyer,reeve,rausch,labonte,haro,gower,freeland,fawcett,eads,driggers,donley,collett,bromley,boatman,ballinger,baldridge,volz,trombley,stonge,shanahan,rivard,rhyne,pedroza,matias,jamieson,hedgepeth,hartnett,estevez,eskridge,denman,chiu,chinn,catlett,carmack,buie,bechtel,beardsley,bard,ballou,ulmer,skeen,robledo,rincon,reitz,piazza,munger,moten,mcmichael,loftus,ledet,kersey,groff,fowlkes,crumpton,clouse,bettis,villagomez,timmerman,strom,santoro,roddy,penrod,musselman,macpherson,leboeuf,harless,haddad,guido,golding,fulkerson,fannin,dulaney,dowdell,cottle,ceja,cate,bosley,benge,albritton,voigt,trowbridge,soileau,seely,rohde,pearsall,paulk,orth,nason,mota,mcmullin,marquardt,madigan,hoag,gillum,gabbard,fenwick,danforth,cushing,cress,creed,cazares,bettencourt,barringer,baber,stansberry,schramm,rutter,rivero,oquendo,necaise,mouton,montenegro,miley,mcgough,marra,macmillan,lamontagne,jasso,horst,hetrick,heilman,gaytan,gall,fortney,dingle,desjardins,dabbs,burbank,brigham,breland,beaman,arriola,yarborough,wallin,toscano,stowers,reiss,pichardo,orton,michels,mcnamee,mccrory,leatherman,kell,keister,horning,hargett,guay,ferro,deboer,dagostino,carper,blanks,beaudry,towle,tafoya,stricklin,strader,soper,sonnier,sigmon,schenk,saddler,pedigo,mendes,lunn,lohr,lahr,kingsbury,jarman,hume,holliman,hofmann,haworth,harrelson,hambrick,flick,edmunds,dacosta,crossman,colston,chaplin,carrell,budd,weiler,waits,valentino,trantham,tarr,solorio,roebuck,powe,plank,pettus,pagano,mink,luker,leathers,joslin,hartzell,gambrell,cepeda,carty,caputo,brewington,bedell,ballew,applewhite,warnock,walz,urena,tudor,reel,pigg,parton,mickelson,meagher,mclellan,mcculley,mandel,leech,lavallee,kraemer,kling,kipp,kehoe,hochstetler,harriman,gregoire,grabowski,gosselin,gammon,fancher,edens,desai,brannan,armendariz,woolsey,whitehouse,whetstone,ussery,towne,testa,tallman,studer,strait,steinmetz,sorrells,sauceda,rolfe,paddock,mitchem,mcginn,mccrea,lovato,hazen,gilpin,gaynor,fike,devoe,delrio,curiel,burkhardt,bode,backus,zinn,watanabe,wachter,vanpelt,turnage,shaner,schroder,sato,riordan,quimby,portis,natale,mckoy,mccown,kilmer,hotchkiss,hesse,halbert,gwinn,godsey,delisle,chrisman,canter,arbogast,angell,acree,yancy,woolley,wesson,weatherspoon,trainor,stockman,spiller,sipe,rooks,reavis,propst,porras,neilson,mullens,loucks,llewellyn,kumar,koester,klingensmith,kirsch,kester,honaker,hodson,hennessy,helmick,garrity,garibay,drain,casarez,callis,botello,aycock,avant,wingard,wayman,tully,theisen,szymanski,stansbury,segovia,rainwater,preece,pirtle,padron,mincey,mckelvey,mathes,larrabee,kornegay,klug,ingersoll,hecht,germain,eggers,dykstra,deering,decoteau,deason,dearing,cofield,carrigan,bonham,bahr,aucoin,appleby,almonte,yager,womble,wimmer,weimer,vanderpool,stancil,sprinkle,romine,remington,pfaff,peckham,olivera,meraz,maze,lathrop,koehn,hazelton,halvorson,hallock,haddock,ducharme,dehaven,caruthers,brehm,bosworth,bost,bias,beeman,basile,bane,aikens,wold,walther,tabb,suber,strawn,stocker,shirey,schlosser,riedel,rembert,reimer,pyles,peele,merriweather,letourneau,latta,kidder,hixon,hillis,hight,herbst,henriquez,haygood,hamill,gabel,fritts,eubank,dawes,correll,bushey,buchholz,brotherton,botts,barnwell,auger,atchley,westphal,veilleux,ulloa,stutzman,shriver,ryals,pilkington,moyers,marrs,mangrum,maddux,lockard,laing,kuhl,harney,hammock,hamlett,felker,doerr,depriest,carrasquillo,carothers,bogle,bischoff,bergen,albanese,wyckoff,vermillion,vansickle,thibault,tetreault,stickney,shoemake,ruggiero,rawson,racine,philpot,paschal,mcelhaney,mathison,legrand,lapierre,kwan,kremer,jiles,hilbert,geyer,faircloth,ehlers,egbert,desrosiers,dalrymple,cotten,cashman,cadena,boardman,alcaraz,wyrick,therrien,tankersley,strickler,puryear,plourde,pattison,pardue,mcginty,mcevoy,landreth,kuhns,koon,hewett,giddens,emerick,eades,deangelis,cosme,ceballos,birdsong,benham,bemis,armour,anguiano,welborn,tsosie,storms,shoup,sessoms,samaniego,rood,rojo,rhinehart,raby,northcutt,myer,munguia,morehouse,mcdevitt,mallett,lozada,lemoine,kuehn,hallett,grim,gillard,gaylor,garman,gallaher,feaster,faris,darrow,dardar,coney,carreon,braithwaite,boylan,boyett,bixler,bigham,benford,barragan,barnum,zuber,wyche,westcott,vining,stoltzfus,simonds,shupe,sabin,ruble,rittenhouse,richman,perrone,mulholland,millan,lomeli,kite,jemison,hulett,holler,hickerson,herold,hazelwood,griffen,gause,forde,eisenberg,dilworth,charron,chaisson,bristow,breunig,brace,boutwell,bentz,belk,bayless,batchelder,baran,baeza,zimmermann,weathersby,volk,toole,theis,tedesco,searle,schenck,satterwhite,ruelas,rankins,partida,nesbit,morel,menchaca,levasseur,kaylor,johnstone,hulse,hollar,hersey,harrigan,harbison,guyer,gish,giese,gerlach,geller,geisler,falcone,elwell,doucet,deese,darr,corder,chafin,byler,bussell,burdett,brasher,bowe,bellinger,bastian,barner,alleyne,wilborn,weil,wegner,tatro,spitzer,smithers,schoen,resendez,parisi,overman,obrian,mudd,mahler,maggio,lindner,lalonde,lacasse,laboy,killion,kahl,jessen,jamerson,houk,henshaw,gustin,graber,durst,duenas,davey,cundiff,conlon,colunga,coakley,chiles,capers,buell,bricker,bissonnette,bartz,bagby,zayas,volpe,treece,toombs,thom,terrazas,swinney,skiles,silveira,shouse,senn,ramage,moua,langham,kyles,holston,hoagland,herd,feller,denison,carraway,burford,bickel,ambriz,abercrombie,yamada,weidner,waddle,verduzco,thurmond,swindle,schrock,sanabria,rosenberger,probst,peabody,olinger,nazario,mccafferty,mcbroom,mcabee,mazur,matherne,mapes,leverett,killingsworth,heisler,griego,gosnell,frankel,franke,ferrante,fenn,ehrlich,christopherso,chasse,caton,brunelle,bloomfield,babbitt,azevedo,abramson,ables,abeyta,youmans,wozniak,wainwright,stowell,smitherman,samuelson,runge,rothman,rosenfeld,peake,owings,olmos,munro,moreira,leatherwood,larkins,krantz,kovacs,kizer,kindred,karnes,jaffe,hubbell,hosey,hauck,goodell,erdman,dvorak,doane,cureton,cofer,buehler,bierman,berndt,banta,abdullah,warwick,waltz,turcotte,torrey,stith,seger,sachs,quesada,pinder,peppers,pascual,paschall,parkhurst,ozuna,oster,nicholls,lheureux,lavalley,kimura,jablonski,haun,gourley,gilligan,croy,cotto,cargill,burwell,burgett,buckman,booher,adorno,wrenn,whittemore,urias,szabo,sayles,saiz,rutland,rael,pharr,pelkey,ogrady,nickell,musick,moats,mather,massa,kirschner,kieffer,kellar,hendershot,gott,godoy,gadson,furtado,fiedler,erskine,dutcher,dever,daggett,chevalier,brake,ballesteros,amerson,wingo,waldon,trott,silvey,showers,schlegel,ritz,pepin,pelayo,parsley,palermo,moorehead,mchale,lett,kocher,kilburn,iglesias,humble,hulbert,huckaby,hartford,hardiman,gurney,grigg,grasso,goings,fillmore,farber,depew,dandrea,cowen,covarrubias,burrus,bracy,ardoin,thompkins,standley,radcliffe,pohl,persaud,parenteau,pabon,newson,newhouse,napolitano,mulcahy,malave,keim,hooten,hernandes,heffernan,hearne,greenleaf,glick,fuhrman,fetter,faria,dishman,dickenson,crites,criss,clapper,chenault,castor,casto,bugg,bove,bonney,anderton,allgood,alderson,woodman,warrick,toomey,tooley,tarrant,summerville,stebbins,sokol,searles,schutz,schumann,scheer,remillard,raper,proulx,palmore,monroy,messier,melo,melanson,mashburn,manzano,lussier,jenks,huneycutt,hartwig,grimsley,fulk,fielding,fidler,engstrom,eldred,dantzler,crandell,calder,brumley,breton,brann,bramlett,boykins,bianco,bancroft,almaraz,alcantar,whitmer,whitener,welton,vineyard,rahn,paquin,mizell,mcmillin,mckean,marston,maciel,lundquist,liggins,lampkin,kranz,koski,kirkham,jiminez,hazzard,harrod,graziano,grammer,gendron,garrido,fordham,englert,dryden,demoss,deluna,crabb,comeau,brummett,blume,benally,wessel,vanbuskirk,thorson,stumpf,stockwell,reams,radtke,rackley,pelton,niemi,newland,nelsen,morrissette,miramontes,mcginley,mccluskey,marchant,luevano,lampe,lail,jeffcoat,infante,hinman,gaona,eady,desmarais,decosta,dansby,cisco,choe,breckenridge,bostwick,borg,bianchi,alberts,wilkie,whorton,vargo,tait,soucy,schuman,ousley,mumford,lippert,leath,lavergne,laliberte,kirksey,kenner,johnsen,izzo,hiles,gullett,greenwell,gaspar,galbreath,gaitan,ericson,delapaz,croom,cottingham,clift,bushnell,bice,beason,arrowood,waring,voorhees,truax,shreve,shockey,schatz,sandifer,rubino,rozier,roseberry,pieper,peden,nester,nave,murphey,malinowski,macgregor,lafrance,kunkle,kirkman,hipp,hasty,haddix,gervais,gerdes,gamache,fouts,fitzwater,dillingham,deming,deanda,cedeno,cannady,burson,bouldin,arceneaux,woodhouse,whitford,wescott,welty,weigel,torgerson,toms,surber,sunderland,sterner,setzer,riojas,pumphrey,puga,metts,mcgarry,mccandless,magill,lupo,loveland,llamas,leclerc,koons,kahler,huss,holbert,heintz,haupt,grimmett,gaskill,ellingson,dorr,dingess,deweese,desilva,crossley,cordeiro,converse,conde,caldera,cairns,burmeister,burkhalter,brawner,bott,youngs,vierra,valladares,shrum,shropshire,sevilla,rusk,rodarte,pedraza,nino,merino,mcminn,markle,mapp,lajoie,koerner,kittrell,kato,hyder,hollifield,heiser,hazlett,greenwald,fant,eldredge,dreher,delafuente,cravens,claypool,beecher,aronson,alanis,worthen,wojcik,winger,whitacre,valverde,valdivia,troupe,thrower,swindell,suttles,stroman,spires,slate,shealy,sarver,sartin,sadowski,rondeau,rolon,rascon,priddy,paulino,nolte,munroe,molloy,mciver,lykins,loggins,lenoir,klotz,kempf,hupp,hollowell,hollander,haynie,harkness,harker,gottlieb,frith,eddins,driskell,doggett,densmore,charette,cassady,byrum,burcham,buggs,benn,whitted,warrington,vandusen,vaillancourt,steger,siebert,scofield,quirk,purser,plumb,orcutt,nordstrom,mosely,michalski,mcphail,mcdavid,mccraw,marchese,mannino,lefevre,largent,lanza,kress,isham,hunsaker,hoch,hildebrandt,guarino,grijalva,graybill,fick,ewell,ewald,cusick,crumley,coston,cathcart,carruthers,bullington,bowes,blain,blackford,barboza,yingling,wert,weiland,varga,silverstein,sievers,shuster,shumway,runnels,rumsey,renfroe,provencher,polley,mohler,middlebrooks,kutz,koster,groth,glidden,fazio,deen,chipman,chenoweth,champlin,cedillo,carrero,carmody,buckles,brien,boutin,bosch,berkowitz,altamirano,wilfong,wiegand,waites,truesdale,toussaint,tobey,tedder,steelman,sirois,schnell,robichaud,richburg,plumley,pizarro,piercy,ortego,oberg,neace,mertz,mcnew,matta,lapp,lair,kibler,howlett,hollister,hofer,hatten,hagler,falgoust,engelhardt,eberle,dombrowski,dinsmore,daye,casares,braud,balch,autrey,wendel,tyndall,strobel,stoltz,spinelli,serrato,reber,rathbone,palomino,nickels,mayle,mathers,mach,loeffler,littrell,levinson,leong,lemire,lejeune,lazo,lasley,koller,kennard,hoelscher,hintz,hagerman,greaves,fore,eudy,engler,corrales,cordes,brunet,bidwell,bennet,tyrrell,tharpe,swinton,stribling,southworth,sisneros,savoie,samons,ruvalcaba,ries,ramer,omara,mosqueda,millar,mcpeak,macomber,luckey,litton,lehr,lavin,hubbs,hoard,hibbs,hagans,futrell,exum,evenson,culler,carbaugh,callen,brashear,bloomer,blakeney,bigler,addington,woodford,unruh,tolentino,sumrall,stgermain,smock,sherer,rayner,pooler,oquinn,nero,mcglothlin,linden,kowal,kerrigan,ibrahim,harvell,hanrahan,goodall,geist,fussell,fung,ferebee,eley,eggert,dorsett,dingman,destefano,colucci,clemmer,burnell,brumbaugh,boddie,berryhill,avelar,alcantara,winder,winchell,vandenberg,trotman,thurber,thibeault,stlouis,stilwell,sperling,shattuck,sarmiento,ruppert,rumph,renaud,randazzo,rademacher,quiles,pearman,palomo,mercurio,lowrey,lindeman,lawlor,larosa,lander,labrecque,hovis,holifield,henninger,hawkes,hartfield,hann,hague,genovese,garrick,fudge,frink,eddings,dinh,cribbs,calvillo,bunton,brodeur,bolding,blanding,agosto,zahn,wiener,trussell,tello,teixeira,speck,sharma,shanklin,sealy,scanlan,santamaria,roundy,robichaux,ringer,rigney,prevost,polson,nord,moxley,medford,mccaslin,mcardle,macarthur,lewin,lasher,ketcham,keiser,heine,hackworth,grose,grizzle,gillman,gartner,frazee,fleury,edson,edmonson,derry,cronk,conant,burress,burgin,broom,brockington,bolick,boger,birchfield,billington,baily,bahena,armbruster,anson,yoho,wilcher,tinney,timberlake,thielen,sutphin,stultz,sikora,serra,schulman,scheffler,santillan,rego,preciado,pinkham,mickle,lomas,lizotte,lent,kellerman,keil,johanson,hernadez,hartsfield,haber,gorski,farkas,eberhardt,duquette,delano,cropper,cozart,cockerham,chamblee,cartagena,cahoon,buzzell,brister,brewton,blackshear,benfield,aston,ashburn,arruda,wetmore,weise,vaccaro,tucci,sudduth,stromberg,stoops,showalter,shears,runion,rowden,rosenblum,riffle,renfrow,peres,obryant,leftwich,lark,landeros,kistler,killough,kerley,kastner,hoggard,hartung,guertin,govan,gatling,gailey,fullmer,fulford,flatt,esquibel,endicott,edmiston,edelstein,dufresne,dressler,dickman,chee,busse,bonnett,berard,yoshida,velarde,veach,vanhouten,vachon,tolson,tolman,tennyson,stites,soler,shutt,ruggles,rhone,pegues,neese,muro,moncrief,mefford,mcphee,mcmorris,mceachern,mcclurg,mansour,mader,leija,lecompte,lafountain,labrie,jaquez,heald,hash,hartle,gainer,frisby,farina,eidson,edgerton,dyke,durrett,duhon,cuomo,cobos,cervantez,bybee,brockway,borowski,binion,beery,arguello,amaro,acton,yuen,winton,wigfall,weekley,vidrine,vannoy,tardiff,shoop,shilling,schick,safford,prendergast,pilgrim,pellerin,osuna,nissen,nalley,moller,messner,messick,merrifield,mcguinness,matherly,marcano,mahone,lemos,lebrun,jara,hoffer,herren,hecker,haws,haug,gwin,gober,gilliard,fredette,favela,echeverria,downer,donofrio,desrochers,crozier,corson,bechtold,argueta,aparicio,zamudio,westover,westerman,utter,troyer,thies,tapley,slavin,shirk,sandler,roop,rimmer,raymer,radcliff,otten,moorer,millet,mckibben,mccutchen,mcavoy,mcadoo,mayorga,mastin,martineau,marek,madore,leflore,kroeger,kennon,jimerson,hostetter,hornback,hendley,hance,guardado,granado,gowen,goodale,flinn,fleetwood,fitz,durkee,duprey,dipietro,dilley,clyburn,brawley,beckley,arana,weatherby,vollmer,vestal,tunnell,trigg,tingle,takahashi,sweatt,storer,snapp,shiver,rooker,rathbun,poisson,perrine,perri,parmer,parke,pare,papa,palmieri,midkiff,mecham,mccomas,mcalpine,lovelady,lillard,lally,knopp,kile,kiger,haile,gupta,goldsberry,gilreath,fulks,friesen,franzen,flack,findlay,ferland,dreyer,dore,dennard,deckard,debose,crim,coulombe,chancey,cantor,branton,bissell,barns,woolard,witham,wasserman,spiegel,shoffner,scholz,ruch,rossman,petry,palacio,paez,neary,mortenson,millsap,miele,menke,mckim,mcanally,martines,lemley,larochelle,klaus,klatt,kaufmann,kapp,helmer,hedge,halloran,glisson,frechette,fontana,eagan,distefano,danley,creekmore,chartier,chaffee,carillo,burg,bolinger,berkley,benz,basso,bash,zelaya,woodring,witkowski,wilmot,wilkens,wieland,verdugo,urquhart,tsai,timms,swiger,swaim,sussman,pires,molnar,mcatee,lowder,loos,linker,landes,kingery,hufford,higa,hendren,hammack,hamann,gillam,gerhardt,edelman,delk,deans,curl,constantine,cleaver,claar,casiano,carruth,carlyle,brophy,bolanos,bibbs,bessette,beggs,baugher,bartel,averill,andresen,amin,adames,valente,turnbow,swink,sublett,stroh,stringfellow,ridgway,pugliese,poteat,ohare,neubauer,murchison,mingo,lemmons,kwon,kellam,kean,jarmon,hyden,hudak,hollinger,henkel,hemingway,hasson,hansel,halter,haire,ginsberg,gillispie,fogel,flory,etter,elledge,eckman,deas,currin,crafton,coomer,colter,claxton,bulter,braddock,bowyer,binns,bellows,baskerville,barros,ansley,woolf,wight,waldman,wadley,tull,trull,tesch,stouffer,stadler,slay,shubert,sedillo,santacruz,reinke,poynter,neri,neale,mowry,moralez,monger,mitchum,merryman,manion,macdougall,litchfield,levitt,lepage,lasalle,khoury,kavanagh,karns,ivie,huebner,hodgkins,halpin,garica,eversole,dutra,dunagan,duffey,dillman,dillion,deville,dearborn,damato,courson,coulson,burdine,bousquet,bonin,bish,atencio,westbrooks,wages,vaca,toner,tillis,swett,struble,stanfill,solorzano,slusher,sipple,silvas,shults,schexnayder,saez,rodas,rager,pulver,penton,paniagua,meneses,mcfarlin,mcauley,matz,maloy,magruder,lohman,landa,lacombe,jaimes,holzer,holst,heil,hackler,grundy,gilkey,farnham,durfee,dunton,dunston,duda,dews,craver,corriveau,conwell,colella,chambless,bremer,boutte,bourassa,blaisdell,backman,babineaux,audette,alleman,towner,taveras,tarango,sullins,suiter,stallard,solberg,schlueter,poulos,pimental,owsley,okelley,moffatt,metcalfe,meekins,medellin,mcglynn,mccowan,marriott,marable,lennox,lamoureux,koss,kerby,karp,isenberg,howze,hockenberry,highsmith,hallmark,gusman,greeley,giddings,gaudet,gallup,fleenor,eicher,edington,dimaggio,dement,demello,decastro,bushman,brundage,brooker,bourg,blackstock,bergmann,beaton,banister,argo,appling,wortman,watterson,villalpando,tillotson,tighe,sundberg,sternberg,stamey,shipe,seeger,scarberry,sattler,sain,rothstein,poteet,plowman,pettiford,penland,partain,pankey,oyler,ogletree,ogburn,moton,merkel,lucier,lakey,kratz,kinser,kershaw,josephson,imhoff,hendry,hammon,frisbie,frawley,fraga,forester,eskew,emmert,drennan,doyon,dandridge,cawley,carvajal,bracey,belisle,batey,ahner,wysocki,weiser,veliz,tincher,sansone,sankey,sandstrom,rohrer,risner,pridemore,pfeffer,persinger,peery,oubre,nowicki,musgrave,murdoch,mullinax,mccary,mathieu,livengood,kyser,klink,kimes,kellner,kavanaugh,kasten,imes,hoey,hinshaw,hake,gurule,grube,grillo,geter,gatto,garver,garretson,farwell,eiland,dunford,decarlo,corso,colman,collard,cleghorn,chasteen,cavender,carlile,calvo,byerly,brogdon,broadwater,breault,bono,bergin,behr,ballenger,amick,tamez,stiffler,steinke,simmon,shankle,schaller,salmons,sackett,saad,rideout,ratcliffe,ranson,plascencia,petterson,olszewski,olney,olguin,nilsson,nevels,morelli,montiel,monge,michaelson,mertens,mcchesney,mcalpin,mathewson,loudermilk,lineberry,liggett,kinlaw,kight,jost,hereford,hardeman,halpern,halliday,hafer,gaul,friel,freitag,forsberg,evangelista,doering,dicarlo,dendy,delp,deguzman,dameron,curtiss,cosper,cauthen,bradberry,bouton,bonnell,bixby,bieber,beveridge,bedwell,barhorst,bannon,baltazar,baier,ayotte,attaway,arenas,abrego,turgeon,tunstall,thaxton,tenorio,stotts,sthilaire,shedd,seabolt,scalf,salyers,ruhl,rowlett,robinett,pfister,perlman,pepe,parkman,nunnally,norvell,napper,modlin,mckellar,mcclean,mascarenas,leibowitz,ledezma,kuhlman,kobayashi,hunley,holmquist,hinkley,hazard,hartsell,gribble,gravely,fifield,eliason,doak,crossland,carleton,bridgeman,bojorquez,boggess,auten,woosley,whiteley,wexler,twomey,tullis,townley,standridge,santoyo,rueda,riendeau,revell,pless,ottinger,nigro,nickles,mulvey,menefee,mcshane,mcloughlin,mckinzie,markey,lockridge,lipsey,knisley,knepper,kitts,kiel,jinks,hathcock,godin,gallego,fikes,fecteau,estabrook,ellinger,dunlop,dudek,countryman,chauvin,chatham,bullins,brownfield,boughton,bloodworth,bibb,baucom,barbieri,aubin,armitage,alessi,absher,abbate,zito,woolery,wiggs,wacker,tynes,tolle,telles,tarter,swarey,strode,stockdale,stalnaker,spina,schiff,saari,risley,rameriz,rakes,pettaway,penner,paulus,palladino,omeara,montelongo,melnick,mehta,mcgary,mccourt,mccollough,marchetti,manzanares,lowther,leiva,lauderdale,lafontaine,kowalczyk,knighton,joubert,jaworski,huth,hurdle,housley,hackman,gulick,gordy,gilstrap,gehrke,gebhart,gaudette,foxworth,endres,dunkle,cimino,caddell,brauer,braley,bodine,blackmore,belden,backer,ayer,andress,wisner,vuong,valliere,twigg,tavarez,strahan,steib,staub,sowder,seiber,schutt,scharf,schade,rodriques,risinger,renshaw,rahman,presnell,piatt,nieman,nevins,mcilwain,mcgaha,mccully,mccomb,massengale,macedo,lesher,kearse,jauregui,husted,hudnall,holmberg,hertel,hardie,glidewell,frausto,fassett,dalessandro,dahlgren,corum,constantino,conlin,colquitt,colombo,claycomb,cardin,buller,boney,bocanegra,biggers,benedetto,araiza,andino,albin,zorn,werth,weisman,walley,vanegas,ulibarri,towe,tedford,teasley,suttle,steffens,stcyr,squire,singley,sifuentes,shuck,schram,sass,rieger,ridenhour,rickert,richerson,rayborn,rabe,raab,pendley,pastore,ordway,moynihan,mellott,mckissick,mcgann,mccready,mauney,marrufo,lenhart,lazar,lafave,keele,kautz,jardine,jahnke,jacobo,hord,hardcastle,hageman,giglio,gehring,fortson,duque,duplessis,dicken,derosier,deitz,dalessio,cram,castleman,candelario,callison,caceres,bozarth,biles,bejarano,bashaw,avina,armentrout,alverez,acord,waterhouse,vereen,vanlandingham,strawser,shotwell,severance,seltzer,schoonmaker,schock,schaub,schaffner,roeder,rodrigez,riffe,rasberry,rancourt,railey,quade,pursley,prouty,perdomo,oxley,osterman,nickens,murphree,mounts,merida,maus,mattern,masse,martinelli,mangan,lutes,ludwick,loney,laureano,lasater,knighten,kissinger,kimsey,kessinger,honea,hollingshead,hockett,heyer,heron,gurrola,gove,glasscock,gillett,galan,featherstone,eckhardt,duron,dunson,dasher,culbreth,cowden,cowans,claypoole,churchwell,chabot,caviness,cater,caston,callan,byington,burkey,boden,beckford,atwater,archambault,alvey,alsup,whisenant,weese,voyles,verret,tsang,tessier,sweitzer,sherwin,shaughnessy,revis,remy,prine,philpott,peavy,paynter,parmenter,ovalle,offutt,nightingale,newlin,nakano,myatt,muth,mohan,mcmillon,mccarley,mccaleb,maxson,marinelli,maley,liston,letendre,kain,huntsman,hirst,hagerty,gulledge,greenway,grajeda,gorton,goines,gittens,frederickson,fanelli,embree,eichelberger,dunkin,dixson,dillow,defelice,chumley,burleigh,borkowski,binette,biggerstaff,berglund,beller,audet,arbuckle,allain,alfano,youngman,wittman,weintraub,vanzant,vaden,twitty,stollings,standifer,sines,shope,scalise,saville,posada,pisano,otte,nolasco,mier,merkle,mendiola,melcher,mejias,mcmurry,mccalla,markowitz,manis,mallette,macfarlane,lough,looper,landin,kittle,kinsella,kinnard,hobart,helman,hellman,hartsock,halford,hage,gordan,glasser,gayton,gattis,gastelum,gaspard,frisch,fitzhugh,eckstein,eberly,dowden,despain,crumpler,crotty,cornelison,chouinard,chamness,catlin,cann,bumgardner,budde,branum,bradfield,braddy,borst,birdwell,bazan,banas,bade,arango,ahearn,addis,zumwalt,wurth,wilk,widener,wagstaff,urrutia,terwilliger,tart,steinman,staats,sloat,rives,riggle,revels,reichard,prickett,poff,pitzer,petro,pell,northrup,nicks,moline,mielke,maynor,mallon,magness,lingle,lindell,lieb,lesko,lebeau,lammers,lafond,kiernan,ketron,jurado,holmgren,hilburn,hayashi,hashimoto,harbaugh,guillot,gard,froehlich,feinberg,falco,dufour,drees,doney,diep,delao,daves,dail,crowson,coss,congdon,carner,camarena,butterworth,burlingame,bouffard,bloch,bilyeu,barta,bakke,baillargeon,avent,aquilar,zeringue,yarber,wolfson,vogler,voelker,truss,troxell,thrift,strouse,spielman,sistrunk,sevigny,schuller,schaaf,ruffner,routh,roseman,ricciardi,peraza,pegram,overturf,olander,odaniel,millner,melchor,maroney,machuca,macaluso,livesay,layfield,laskowski,kwiatkowski,kilby,hovey,heywood,hayman,havard,harville,haigh,hagood,grieco,glassman,gebhardt,fleischer,fann,elson,eccles,cunha,crumb,blakley,bardwell,abshire,woodham,wines,welter,wargo,varnado,tutt,traynor,swaney,stricker,stoffel,stambaugh,sickler,shackleford,selman,seaver,sansom,sanmiguel,royston,rourke,rockett,rioux,puleo,pitchford,nardi,mulvaney,middaugh,malek,leos,lathan,kujawa,kimbro,killebrew,houlihan,hinckley,herod,hepler,hamner,hammel,hallowell,gonsalez,gingerich,gambill,funkhouser,fricke,fewell,falkner,endsley,dulin,drennen,deaver,dambrosio,chadwell,castanon,burkes,brune,brisco,brinker,bowker,boldt,berner,beaumont,beaird,bazemore,barrick,albano,younts,wunderlich,weidman,vanness,toland,theobald,stickler,steiger,stanger,spies,spector,sollars,smedley,seibel,scoville,saito,rummel,rowles,rouleau,roos,rogan,roemer,ream,raya,purkey,priester,perreira,penick,paulin,parkins,overcash,oleson,neves,muldrow,minard,midgett,michalak,melgar,mcentire,mcauliffe,marte,lydon,lindholm,leyba,langevin,lagasse,lafayette,kesler,kelton,kaminsky,jaggers,humbert,huck,howarth,hinrichs,higley,gupton,guimond,gravois,giguere,fretwell,fontes,feeley,faucher,eichhorn,ecker,earp,dole,dinger,derryberry,demars,deel,copenhaver,collinsworth,colangelo,cloyd,claiborne,caulfield,carlsen,calzada,caffey,broadus,brenneman,bouie,bodnar,blaney,blanc,beltz,behling,barahona,yockey,winkle,windom,wimer,villatoro,trexler,teran,taliaferro,sydnor,swinson,snelling,smtih,simonton,simoneaux,simoneau,sherrer,seavey,scheel,rushton,rupe,ruano,rippy,reiner,reiff,rabinowitz,quach,penley,odle,nock,minnich,mckown,mccarver,mcandrew,longley,laux,lamothe,lafreniere,kropp,krick,kates,jepson,huie,howse,howie,henriques,haydon,haught,hatter,hartzog,harkey,grimaldo,goshorn,gormley,gluck,gilroy,gillenwater,giffin,fluker,feder,eyre,eshelman,eakins,detwiler,delrosario,davisson,catalan,canning,calton,brammer,botelho,blakney,bartell,averett,askins,aker,witmer,winkelman,widmer,whittier,weitzel,wardell,wagers,ullman,tupper,tingley,tilghman,talton,simard,seda,scheller,sala,rundell,rost,ribeiro,rabideau,primm,pinon,peart,ostrom,ober,nystrom,nussbaum,naughton,murr,moorhead,monti,monteiro,melson,meissner,mclin,mcgruder,marotta,makowski,majewski,madewell,lunt,lukens,leininger,lebel,lakin,kepler,jaques,hunnicutt,hungerford,hoopes,hertz,heins,halliburton,grosso,gravitt,glasper,gallman,gallaway,funke,fulbright,falgout,eakin,dostie,dorado,dewberry,derose,cutshall,crampton,costanzo,colletti,cloninger,claytor,chiang,campagna,burd,brokaw,broaddus,bretz,brainard,binford,bilbrey,alpert,aitken,ahlers,zajac,woolfolk,witten,windle,wayland,tramel,tittle,talavera,suter,straley,specht,sommerville,soloman,skeens,sigman,sibert,shavers,schuck,schmit,sartain,sabol,rosenblatt,rollo,rashid,rabb,polston,nyberg,northrop,navarra,muldoon,mikesell,mcdougald,mcburney,mariscal,lozier,lingerfelt,legere,latour,lagunas,lacour,kurth,killen,kiely,kayser,kahle,isley,huertas,hower,hinz,haugh,gumm,galicia,fortunato,flake,dunleavy,duggins,doby,digiovanni,devaney,deltoro,cribb,corpuz,coronel,coen,charbonneau,caine,burchette,blakey,blakemore,bergquist,beene,beaudette,bayles,ballance,bakker,bailes,asberry,arwood,zucker,willman,whitesell,wald,walcott,vancleave,trump,strasser,simas,shick,schleicher,schaal,saleh,rotz,resnick,rainer,partee,ollis,oller,oday,noles,munday,mong,millican,merwin,mazzola,mansell,magallanes,llanes,lewellen,lepore,kisner,keesee,jeanlouis,ingham,hornbeck,hawn,hartz,harber,haffner,gutshall,guth,grays,gowan,finlay,finkelstein,eyler,enloe,dungan,diez,dearman,cull,crosson,chronister,cassity,campion,callihan,butz,breazeale,blumenthal,berkey,batty,batton,arvizu,alderete,aldana,albaugh,abernethy,wolter,wille,tweed,tollefson,thomasson,teter,testerman,sproul,spates,southwick,soukup,skelly,senter,sealey,sawicki,sargeant,rossiter,rosemond,repp,pifer,ormsby,nickelson,naumann,morabito,monzon,millsaps,millen,mcelrath,marcoux,mantooth,madson,macneil,mackinnon,louque,leister,lampley,kushner,krouse,kirwan,jessee,janson,jahn,jacquez,islas,hutt,holladay,hillyer,hepburn,hensel,harrold,gingrich,geis,gales,fults,finnell,ferri,featherston,epley,ebersole,eames,dunigan,drye,dismuke,devaughn,delorenzo,damiano,confer,collum,clower,clow,claussen,clack,caylor,cawthon,casias,carreno,bluhm,bingaman,bewley,belew,beckner,auld,amey,wolfenbarger,wilkey,wicklund,waltman,villalba,valero,valdovinos,ullrich,tyus,twyman,trost,tardif,tanguay,stripling,steinbach,shumpert,sasaki,sappington,sandusky,reinhold,reinert,quijano,placencia,pinkard,phinney,perrotta,pernell,parrett,oxendine,owensby,orman,nuno,mori,mcroberts,mcneese,mckamey,mccullum,markel,mardis,maines,lueck,lubin,lefler,leffler,larios,labarbera,kershner,josey,jeanbaptiste,izaguirre,hermosillo,haviland,hartshorn,hafner,ginter,getty,franck,fiske,dufrene,doody,davie,dangerfield,dahlberg,cuthbertson,crone,coffelt,chidester,chesson,cauley,caudell,cantara,campo,caines,bullis,bucci,brochu,bogard,bickerstaff,benning,arzola,antonelli,adkinson,zellers,wulf,worsley,woolridge,whitton,westerfield,walczak,vassar,truett,trueblood,trawick,townsley,topping,tobar,telford,steverson,stagg,sitton,sill,sergent,schoenfeld,sarabia,rutkowski,rubenstein,rigdon,prentiss,pomerleau,plumlee,philbrick,patnode,oloughlin,obregon,nuss,morell,mikell,mele,mcinerney,mcguigan,mcbrayer,lollar,kuehl,kinzer,kamp,joplin,jacobi,howells,holstein,hedden,hassler,harty,halle,greig,gouge,goodrum,gerhart,geier,geddes,gast,forehand,ferree,fendley,feltner,esqueda,encarnacion,eichler,egger,edmundson,eatmon,doud,donohoe,donelson,dilorenzo,digiacomo,diggins,delozier,dejong,danford,crippen,coppage,cogswell,clardy,cioffi,cabe,brunette,bresnahan,blomquist,blackstone,biller,bevis,bevan,bethune,benbow,baty,basinger,balcom,andes,aman,aguero,adkisson,yandell,wilds,whisenhunt,weigand,weeden,voight,villar,trottier,tillett,suazo,setser,scurry,schuh,schreck,schauer,samora,roane,rinker,reimers,ratchford,popovich,parkin,natal,melville,mcbryde,magdaleno,loehr,lockman,lingo,leduc,larocca,lamere,laclair,krall,korte,koger,jalbert,hughs,higbee,henton,heaney,haith,gump,greeson,goodloe,gholston,gasper,gagliardi,fregoso,farthing,fabrizio,ensor,elswick,elgin,eklund,eaddy,drouin,dorton,dizon,derouen,deherrera,davy,dampier,cullum,culley,cowgill,cardoso,cardinale,brodsky,broadbent,brimmer,briceno,branscum,bolyard,boley,bennington,beadle,baur,ballentine,azure,aultman,arciniega,aguila,aceves,yepez,woodrum,wethington,weissman,veloz,trusty,troup,trammel,tarpley,stivers,steck,sprayberry,spraggins,spitler,spiers,sohn,seagraves,schiffman,rudnick,rizo,riccio,rennie,quackenbush,puma,plott,pearcy,parada,paiz,munford,moskowitz,mease,mcnary,mccusker,lozoya,longmire,loesch,lasky,kuhlmann,krieg,koziol,kowalewski,konrad,kindle,jowers,jolin,jaco,horgan,hine,hileman,hepner,heise,heady,hawkinson,hannigan,haberman,guilford,grimaldi,garton,gagliano,fruge,follett,fiscus,ferretti,ebner,easterday,eanes,dirks,dimarco,depalma,deforest,cruce,craighead,christner,candler,cadwell,burchell,buettner,brinton,brazier,brannen,brame,bova,bomar,blakeslee,belknap,bangs,balzer,athey,armes,alvis,alverson,alvardo,yeung,wheelock,westlund,wessels,volkman,threadgill,thelen,tague,symons,swinford,sturtevant,straka,stier,stagner,segarra,seawright,rutan,roux,ringler,riker,ramsdell,quattlebaum,purifoy,poulson,permenter,peloquin,pasley,pagel,osman,obannon,nygaard,newcomer,munos,motta,meadors,mcquiston,mcniel,mcmann,mccrae,mayne,matte,legault,lechner,kucera,krohn,kratzer,koopman,jeske,horrocks,hock,hibbler,hesson,hersh,harvin,halvorsen,griner,grindle,gladstone,garofalo,frampton,forbis,eddington,diorio,dingus,dewar,desalvo,curcio,creasy,cortese,cordoba,connally,cluff,cascio,capuano,canaday,calabro,bussard,brayton,borja,bigley,arnone,arguelles,acuff,zamarripa,wooton,widner,wideman,threatt,thiele,templin,teeters,synder,swint,swick,sturges,stogner,stedman,spratt,siegfried,shetler,scull,savino,sather,rothwell,rook,rone,rhee,quevedo,privett,pouliot,poche,pickel,petrillo,pellegrini,peaslee,partlow,otey,nunnery,morelock,morello,meunier,messinger,mckie,mccubbin,mccarron,lerch,lavine,laverty,lariviere,lamkin,kugler,krol,kissel,keeter,hubble,hickox,hetzel,hayner,hagy,hadlock,groh,gottschalk,goodsell,gassaway,garrard,galligan,firth,fenderson,feinstein,etienne,engleman,emrick,ellender,drews,doiron,degraw,deegan,dart,crissman,corr,cookson,coil,cleaves,charest,chapple,chaparro,castano,carpio,byer,bufford,bridgewater,bridgers,brandes,borrero,bonanno,aube,ancheta,abarca,abad,wooster,wimbush,willhite,willams,wigley,weisberg,wardlaw,vigue,vanhook,unknow,torre,tasker,tarbox,strachan,slover,shamblin,semple,schuyler,schrimsher,sayer,salzman,rubalcava,riles,reneau,reichel,rayfield,rabon,pyatt,prindle,poss,polito,plemmons,pesce,perrault,pereyra,ostrowski,nilsen,niemeyer,munsey,mundell,moncada,miceli,meader,mcmasters,mckeehan,matsumoto,marron,marden,lizarraga,lingenfelter,lewallen,langan,lamanna,kovac,kinsler,kephart,keown,kass,kammerer,jeffreys,hysell,hosmer,hardnett,hanner,guyette,greening,glazer,ginder,fromm,fluellen,finkle,fessler,essary,eisele,duren,dittmer,crochet,cosentino,cogan,coelho,cavin,carrizales,campuzano,brough,bopp,bookman,bobb,blouin,beesley,battista,bascom,bakken,badgett,arneson,anselmo,albino,ahumada,woodyard,wolters,wireman,willison,warman,waldrup,vowell,vantassel,twombly,toomer,tennison,teets,tedeschi,swanner,stutz,stelly,sheehy,schermerhorn,scala,sandidge,salters,salo,saechao,roseboro,rolle,ressler,renz,renn,redford,raposa,rainbolt,pelfrey,orndorff,oney,nolin,nimmons,nardone,myhre,morman,menjivar,mcglone,mccammon,maxon,marciano,manus,lowrance,lorenzen,lonergan,lollis,littles,lindahl,lamas,lach,kuster,krawczyk,knuth,knecht,kirkendall,keitt,keever,kantor,jarboe,hoye,houchens,holter,holsinger,hickok,helwig,helgeson,hassett,harner,hamman,hames,hadfield,goree,goldfarb,gaughan,gaudreau,gantz,gallion,frady,foti,flesher,ferrin,faught,engram,donegan,desouza,degroot,cutright,crowl,criner,coan,clinkscales,chewning,chavira,catchings,carlock,bulger,buenrostro,bramblett,brack,boulware,bookout,bitner,birt,baranowski,baisden,allmon,acklin,yoakum,wilbourn,whisler,weinberger,washer,vasques,vanzandt,vanatta,troxler,tomes,tindle,tims,throckmorton,thach,stpeter,stlaurent,stenson,spry,spitz,songer,snavely,shroyer,shortridge,shenk,sevier,seabrook,scrivner,saltzman,rosenberry,rockwood,robeson,roan,reiser,ramires,raber,posner,popham,piotrowski,pinard,peterkin,pelham,peiffer,peay,nadler,musso,millett,mestas,mcgowen,marques,marasco,manriquez,manos,mair,lipps,leiker,krumm,knorr,kinslow,kessel,kendricks,kelm,irick,ickes,hurlburt,horta,hoekstra,heuer,helmuth,heatherly,hampson,hagar,haga,greenlaw,grau,godbey,gingras,gillies,gibb,gayden,gauvin,garrow,fontanez,florio,finke,fasano,ezzell,ewers,eveland,eckenrode,duclos,drumm,dimmick,delancey,defazio,dashiell,cusack,crowther,crigger,cray,coolidge,coldiron,cleland,chalfant,cassel,camire,cabrales,broomfield,brittingham,brisson,brickey,braziel,brazell,bragdon,boulanger,boman,bohannan,beem,barre,azar,ashbaugh,armistead,almazan,adamski,zendejas,winburn,willaims,wilhoit,westberry,wentzel,wendling,visser,vanscoy,vankirk,vallee,tweedy,thornberry,sweeny,spradling,spano,smelser,shim,sechrist,schall,scaife,rugg,rothrock,roesler,riehl,ridings,render,ransdell,radke,pinero,petree,pendergast,peluso,pecoraro,pascoe,panek,oshiro,navarrette,murguia,moores,moberg,michaelis,mcwhirter,mcsweeney,mcquade,mccay,mauk,mariani,marceau,mandeville,maeda,lunde,ludlow,loeb,lindo,linderman,leveille,leith,larock,lambrecht,kulp,kinsley,kimberlin,kesterson,hoyos,helfrich,hanke,grisby,goyette,gouveia,glazier,gile,gerena,gelinas,gasaway,funches,fujimoto,flynt,fenske,fellers,fehr,eslinger,escalera,enciso,duley,dittman,dineen,diller,devault,collings,clymer,clowers,chavers,charland,castorena,castello,camargo,bunce,bullen,boyes,borchers,borchardt,birnbaum,birdsall,billman,benites,bankhead,ange,ammerman,adkison,winegar,wickman,warr,warnke,villeneuve,veasey,vassallo,vannatta,vadnais,twilley,towery,tomblin,tippett,theiss,talkington,talamantes,swart,swanger,streit,stines,stabler,spurling,sobel,sine,simmers,shippy,shiflett,shearin,sauter,sanderlin,rusch,runkle,ruckman,rorie,roesch,richert,rehm,randel,ragin,quesenberry,puentes,plyler,plotkin,paugh,oshaughnessy,ohalloran,norsworthy,niemann,nader,moorefield,mooneyham,modica,miyamoto,mickel,mebane,mckinnie,mazurek,mancilla,lukas,lovins,loughlin,lotz,lindsley,liddle,levan,lederman,leclaire,lasseter,lapoint,lamoreaux,lafollette,kubiak,kirtley,keffer,kaczmarek,housman,hiers,hibbert,herrod,hegarty,hathorn,greenhaw,grafton,govea,futch,furst,franko,forcier,foran,flickinger,fairfield,eure,emrich,embrey,edgington,ecklund,eckard,durante,deyo,delvecchio,dade,currey,creswell,cottrill,casavant,cartier,cargile,capel,cammack,calfee,burse,burruss,brust,brousseau,bridwell,braaten,borkholder,bloomquist,bjork,bartelt,amburgey,yeary,whitefield,vinyard,vanvalkenburg,twitchell,timmins,tapper,stringham,starcher,spotts,slaugh,simonsen,sheffer,sequeira,rosati,rhymes,quint,pollak,peirce,patillo,parkerson,paiva,nilson,nevin,narcisse,mitton,merriam,merced,meiners,mckain,mcelveen,mcbeth,marsden,marez,manke,mahurin,mabrey,luper,krull,hunsicker,hornbuckle,holtzclaw,hinnant,heston,hering,hemenway,hegwood,hearns,halterman,guiterrez,grote,granillo,grainger,glasco,gilder,garren,garlock,garey,fryar,fredricks,fraizer,foshee,ferrel,felty,everitt,evens,esser,elkin,eberhart,durso,duguay,driskill,doster,dewall,deveau,demps,demaio,delreal,deleo,darrah,cumberbatch,culberson,cranmer,cordle,colgan,chesley,cavallo,castellon,castelli,carreras,carnell,carlucci,bontrager,blumberg,blasingame,becton,artrip,andujar,alkire,alder,zukowski,zuckerman,wroblewski,wrigley,woodside,wigginton,westman,westgate,werts,washam,wardlow,walser,waiters,tadlock,stringfield,stimpson,stickley,standish,spurlin,spindler,speller,spaeth,sotomayor,sluder,shryock,shepardson,shatley,scannell,santistevan,rosner,resto,reinhard,rathburn,prisco,poulsen,pinney,phares,pennock,pastrana,oviedo,ostler,nauman,mulford,moise,moberly,mirabal,metoyer,metheny,mentzer,meldrum,mcinturff,mcelyea,mcdougle,massaro,lumpkins,loveday,lofgren,lirette,lesperance,lefkowitz,ledger,lauzon,lachapelle,klassen,keough,kempton,kaelin,jeffords,hsieh,hoyer,horwitz,hoeft,hennig,haskin,gourdine,golightly,girouard,fulgham,fritsch,freer,frasher,foulk,firestone,fiorentino,fedor,ensley,englehart,eells,dunphy,donahoe,dileo,dibenedetto,dabrowski,crick,coonrod,conder,coddington,chunn,chaput,cerna,carreiro,calahan,braggs,bourdon,bollman,bittle,bauder,barreras,aubuchon,anzalone,adamo,zerbe,willcox,westberg,weikel,waymire,vroman,vinci,vallejos,truesdell,troutt,trotta,tollison,toles,tichenor,symonds,surles,strayer,stgeorge,sroka,sorrentino,solares,snelson,silvestri,sikorski,shawver,schumaker,schorr,schooley,scates,satterlee,satchell,rymer,roselli,robitaille,riegel,regis,reames,provenzano,priestley,plaisance,pettey,palomares,nowakowski,monette,minyard,mclamb,mchone,mccarroll,masson,magoon,maddy,lundin,licata,leonhardt,landwehr,kircher,kinch,karpinski,johannsen,hussain,houghtaling,hoskinson,hollaway,holeman,hobgood,hiebert,goggin,geissler,gadbois,gabaldon,fleshman,flannigan,fairman,eilers,dycus,dunmire,duffield,dowler,deloatch,dehaan,deemer,clayborn,christofferso,chilson,chesney,chatfield,carron,canale,brigman,branstetter,bosse,borton,bonar,biron,barroso,arispe,zacharias,zabel,yaeger,woolford,whetzel,weakley,veatch,vandeusen,tufts,troxel,troche,traver,townsel,talarico,swilley,sterrett,stenger,speakman,sowards,sours,souders,souder,soles,sobers,snoddy,smither,shute,shoaf,shahan,schuetz,scaggs,santini,rosson,rolen,robidoux,rentas,recio,pixley,pawlowski,pawlak,paull,overbey,orear,oliveri,oldenburg,nutting,naugle,mossman,misner,milazzo,michelson,mcentee,mccullar,mccree,mcaleer,mazzone,mandell,manahan,malott,maisonet,mailloux,lumley,lowrie,louviere,lipinski,lindemann,leppert,leasure,labarge,kubik,knisely,knepp,kenworthy,kennelly,kelch,kanter,houchin,hosley,hosler,hollon,holleman,heitman,haggins,gwaltney,goulding,gorden,geraci,gathers,frison,feagin,falconer,espada,erving,erikson,eisenhauer,ebeling,durgin,dowdle,dinwiddie,delcastillo,dedrick,crimmins,covell,cournoyer,coria,cohan,cataldo,carpentier,canas,campa,brode,brashears,blaser,bicknell,bednar,barwick,ascencio,althoff,almodovar,alamo,zirkle,zabala,wolverton,winebrenner,wetherell,westlake,wegener,weddington,tuten,trosclair,tressler,theroux,teske,swinehart,swensen,sundquist,southall,socha,sizer,silverberg,shortt,shimizu,sherrard,shaeffer,scheid,scheetz,saravia,sanner,rubinstein,rozell,romer,rheaume,reisinger,randles,pullum,petrella,payan,nordin,norcross,nicoletti,nicholes,newbold,nakagawa,monteith,milstead,milliner,mellen,mccardle,liptak,leitch,latimore,larrison,landau,laborde,koval,izquierdo,hymel,hoskin,holte,hoefer,hayworth,hausman,harrill,harrel,hardt,gully,groover,grinnell,greenspan,graver,grandberry,gorrell,goldenberg,goguen,gilleland,fuson,feldmann,everly,dyess,dunnigan,downie,dolby,deatherage,cosey,cheever,celaya,caver,cashion,caplinger,cansler,byrge,bruder,breuer,breslin,brazelton,botkin,bonneau,bondurant,bohanan,bogue,bodner,boatner,blatt,bickley,belliveau,beiler,beier,beckstead,bachmann,atkin,altizer,alloway,allaire,albro,abron,zellmer,yetter,yelverton,wiens,whidden,viramontes,vanwormer,tarantino,tanksley,sumlin,strauch,strang,stice,spahn,sosebee,sigala,shrout,seamon,schrum,schneck,schantz,ruddy,romig,roehl,renninger,reding,polak,pohlman,pasillas,oldfield,oldaker,ohanlon,ogilvie,norberg,nolette,neufeld,nellis,mummert,mulvihill,mullaney,monteleone,mendonca,meisner,mcmullan,mccluney,mattis,massengill,manfredi,luedtke,lounsbury,liberatore,lamphere,laforge,jourdan,iorio,iniguez,ikeda,hubler,hodgdon,hocking,heacock,haslam,haralson,hanshaw,hannum,hallam,haden,garnes,garces,gammage,gambino,finkel,faucett,ehrhardt,eggen,dusek,durrant,dubay,dones,depasquale,delucia,degraff,decamp,davalos,cullins,conard,clouser,clontz,cifuentes,chappel,chaffins,celis,carwile,byram,bruggeman,bressler,brathwaite,brasfield,bradburn,boose,bodie,blosser,bertsch,bernardi,bernabe,bengtson,barrette,astorga,alday,albee,abrahamson,yarnell,wiltse,wiebe,waguespack,vasser,upham,turek,traxler,torain,tomaszewski,tinnin,tiner,tindell,styron,stahlman,staab,skiba,sheperd,seidl,secor,schutte,sanfilippo,ruder,rondon,rearick,procter,prochaska,pettengill,pauly,neilsen,nally,mullenax,morano,meads,mcnaughton,mcmurtry,mcmath,mckinsey,matthes,massenburg,marlar,margolis,malin,magallon,mackin,lovette,loughran,loring,longstreet,loiselle,lenihan,kunze,koepke,kerwin,kalinowski,kagan,innis,innes,holtzman,heinemann,harshman,haider,haack,grondin,grissett,greenawalt,goudy,goodlett,goldston,gokey,gardea,galaviz,gafford,gabrielson,furlow,fritch,fordyce,folger,elizalde,ehlert,eckhoff,eccleston,ealey,dubin,diemer,deschamps,delapena,decicco,debolt,cullinan,crittendon,crase,cossey,coppock,coots,colyer,cluck,chamberland,burkhead,bumpus,buchan,borman,birkholz,berardi,benda,behnke,barter,amezquita,wotring,wirtz,wingert,wiesner,whitesides,weyant,wainscott,venezia,varnell,tussey,thurlow,tabares,stiver,stell,starke,stanhope,stanek,sisler,sinnott,siciliano,shehan,selph,seager,scurlock,scranton,santucci,santangelo,saltsman,rogge,rettig,renwick,reidy,reider,redfield,premo,parente,paolucci,palmquist,ohler,netherton,mutchler,morita,mistretta,minnis,middendorf,menzel,mendosa,mendelson,meaux,mcspadden,mcquaid,mcnatt,manigault,maney,mager,lukes,lopresti,liriano,letson,lechuga,lazenby,lauria,larimore,krupp,krupa,kopec,kinchen,kifer,kerney,kerner,kennison,kegley,karcher,justis,johson,jellison,janke,huskins,holzman,hinojos,hefley,hatmaker,harte,halloway,hallenbeck,goodwyn,glaspie,geise,fullwood,fryman,frakes,fraire,farrer,enlow,engen,ellzey,eckles,earles,dunkley,drinkard,dreiling,draeger,dinardo,dills,desroches,desantiago,curlee,crumbley,critchlow,coury,courtright,coffield,cleek,charpentier,cardone,caples,cantin,buntin,bugbee,brinkerhoff,brackin,bourland,blassingame,beacham,banning,auguste,andreasen,amann,almon,alejo,adelman,abston,yerger,wymer,woodberry,windley,whiteaker,westfield,weibel,wanner,waldrep,villani,vanarsdale,utterback,updike,triggs,topete,tolar,tigner,thoms,tauber,tarvin,tally,swiney,sweatman,studebaker,stennett,starrett,stannard,stalvey,sonnenberg,smithey,sieber,sickles,shinault,segars,sanger,salmeron,rothe,rizzi,restrepo,ralls,ragusa,quiroga,papenfuss,oropeza,okane,mudge,mozingo,molinaro,mcvicker,mcgarvey,mcfalls,mccraney,matus,magers,llanos,livermore,linehan,leitner,laymon,lawing,lacourse,kwong,kollar,kneeland,kennett,kellett,kangas,janzen,hutter,huling,hofmeister,hewes,harjo,habib,guice,grullon,greggs,grayer,granier,grable,gowdy,giannini,getchell,gartman,garnica,ganey,gallimore,fetters,fergerson,farlow,fagundes,exley,esteves,enders,edenfield,easterwood,drakeford,dipasquale,desousa,deshields,deeter,dedmon,debord,daughtery,cutts,courtemanche,coursey,copple,coomes,collis,cogburn,clopton,choquette,chaidez,castrejon,calhoon,burbach,bulloch,buchman,bruhn,bohon,blough,baynes,barstow,zeman,zackery,yardley,yamashita,wulff,wilken,wiliams,wickersham,wible,whipkey,wedgeworth,walmsley,walkup,vreeland,verrill,umana,traub,swingle,summey,stroupe,stockstill,steffey,stefanski,statler,stapp,speights,solari,soderberg,shunk,shorey,shewmaker,sheilds,schiffer,schank,schaff,sagers,rochon,riser,rickett,reale,raglin,polen,plata,pitcock,percival,palen,orona,oberle,nocera,navas,nault,mullings,montejano,monreal,minick,middlebrook,meece,mcmillion,mccullen,mauck,marshburn,maillet,mahaney,magner,maclin,lucey,litteral,lippincott,leite,leaks,lamarre,jurgens,jerkins,jager,hurwitz,hughley,hotaling,horstman,hohman,hocker,hively,hipps,hessler,hermanson,hepworth,helland,hedlund,harkless,haigler,gutierez,grindstaff,glantz,giardina,gerken,gadsden,finnerty,farnum,encinas,drakes,dennie,cutlip,curtsinger,couto,cortinas,corby,chiasson,carle,carballo,brindle,borum,bober,blagg,berthiaume,beahm,batres,basnight,backes,axtell,atterberry,alvares,alegria,woodell,wojciechowski,winfree,winbush,wiest,wesner,wamsley,wakeman,verner,truex,trafton,toman,thorsen,theus,tellier,tallant,szeto,strope,stills,simkins,shuey,shaul,servin,serio,serafin,salguero,ryerson,rudder,ruark,rother,rohrbaugh,rohrbach,rohan,rogerson,risher,reeser,pryce,prokop,prins,priebe,prejean,pinheiro,petrone,petri,penson,pearlman,parikh,natoli,murakami,mullikin,mullane,motes,morningstar,mcveigh,mcgrady,mcgaughey,mccurley,marchan,manske,lusby,linde,likens,licon,leroux,lemaire,legette,laskey,laprade,laplant,kolar,kittredge,kinley,kerber,kanagy,jetton,janik,ippolito,inouye,hunsinger,howley,howery,horrell,holthaus,hiner,hilson,hilderbrand,hartzler,harnish,harada,hansford,halligan,hagedorn,gwynn,gudino,greenstein,greear,gracey,goudeau,goodner,ginsburg,gerth,gerner,fujii,frier,frenette,folmar,fleisher,fleischmann,fetzer,eisenman,earhart,dupuy,dunkelberger,drexler,dillinger,dilbeck,dewald,demby,deford,craine,chesnut,casady,carstens,carrick,carino,carignan,canchola,bushong,burman,buono,brownlow,broach,britten,brickhouse,boyden,boulton,borland,bohrer,blubaugh,bever,berggren,benevides,arocho,arends,amezcua,almendarez,zalewski,witzel,winkfield,wilhoite,vangundy,vanfleet,vanetten,vandergriff,urbanski,troiano,thibodaux,straus,stoneking,stjean,stillings,stange,speicher,speegle,smeltzer,slawson,simmonds,shuttleworth,serpa,senger,seidman,schweiger,schloss,schimmel,schechter,sayler,sabatini,ronan,rodiguez,riggleman,richins,reamer,prunty,porath,plunk,piland,philbrook,pettitt,perna,peralez,pascale,padula,oboyle,nivens,nickols,mundt,munden,montijo,mcmanis,mcgrane,mccrimmon,manzi,mangold,malick,mahar,maddock,losey,litten,leedy,leavell,ladue,krahn,kluge,junker,iversen,imler,hurtt,huizar,hubbert,howington,hollomon,holdren,hoisington,heiden,hauge,hartigan,gutirrez,griffie,greenhill,gratton,granata,gottfried,gertz,gautreaux,furry,furey,funderburg,flippen,fitzgibbon,drucker,donoghue,dildy,devers,detweiler,despres,denby,degeorge,cueto,cranston,courville,clukey,cirillo,chivers,caudillo,butera,bulluck,buckmaster,braunstein,bracamonte,bourdeau,bonnette".split(","),
74281us_tv_and_film:"you,i,to,that,it,me,what,this,know,i'm,no,have,my,don't,just,not,do,be,your,we,it's,so,but,all,well,oh,about,right,you're,get,here,out,going,like,yeah,if,can,up,want,think,that's,now,go,him,how,got,did,why,see,come,good,really,look,will,okay,back,can't,mean,tell,i'll,hey,he's,could,didn't,yes,something,because,say,take,way,little,make,need,gonna,never,we're,too,she's,i've,sure,our,sorry,what's,let,thing,maybe,down,man,very,there's,should,anything,said,much,any,even,off,please,doing,thank,give,thought,help,talk,god,still,wait,find,nothing,again,things,let's,doesn't,call,told,great,better,ever,night,away,believe,feel,everything,you've,fine,last,keep,does,put,around,stop,they're,i'd,guy,isn't,always,listen,wanted,guys,huh,those,big,lot,happened,thanks,won't,trying,kind,wrong,talking,guess,care,bad,mom,remember,getting,we'll,together,dad,leave,understand,wouldn't,actually,hear,baby,nice,father,else,stay,done,wasn't,course,might,mind,every,enough,try,hell,came,someone,you'll,whole,yourself,idea,ask,must,coming,looking,woman,room,knew,tonight,real,son,hope,went,hmm,happy,pretty,saw,girl,sir,friend,already,saying,next,job,problem,minute,thinking,haven't,heard,honey,matter,myself,couldn't,exactly,having,probably,happen,we've,hurt,boy,dead,gotta,alone,excuse,start,kill,hard,you'd,today,car,ready,without,wants,hold,wanna,yet,seen,deal,once,gone,morning,supposed,friends,head,stuff,worry,live,truth,face,forget,true,cause,soon,knows,telling,wife,who's,chance,run,move,anyone,person,bye,somebody,heart,miss,making,meet,anyway,phone,reason,damn,lost,looks,bring,case,turn,wish,tomorrow,kids,trust,check,change,anymore,least,aren't,working,makes,taking,means,brother,hate,ago,says,beautiful,gave,fact,crazy,sit,afraid,important,rest,fun,kid,word,watch,glad,everyone,sister,minutes,everybody,bit,couple,whoa,either,mrs,feeling,daughter,wow,gets,asked,break,promise,door,close,hand,easy,question,tried,far,walk,needs,mine,killed,hospital,anybody,alright,wedding,shut,able,die,perfect,stand,comes,hit,waiting,dinner,funny,husband,almost,pay,answer,cool,eyes,news,child,shouldn't,yours,moment,sleep,read,where's,sounds,sonny,pick,sometimes,bed,date,plan,hours,lose,hands,serious,shit,behind,inside,ahead,week,wonderful,fight,past,cut,quite,he'll,sick,it'll,eat,nobody,goes,save,seems,finally,lives,worried,upset,carly,met,brought,seem,sort,safe,weren't,leaving,front,shot,loved,asking,running,clear,figure,hot,felt,parents,drink,absolutely,how's,daddy,sweet,alive,sense,meant,happens,bet,blood,ain't,kidding,lie,meeting,dear,seeing,sound,fault,ten,buy,hour,speak,lady,jen,thinks,christmas,outside,hang,possible,worse,mistake,ooh,handle,spend,totally,giving,here's,marriage,realize,unless,sex,send,needed,scared,picture,talked,ass,hundred,changed,completely,explain,certainly,sign,boys,relationship,loves,hair,lying,choice,anywhere,future,weird,luck,she'll,turned,touch,kiss,crane,questions,obviously,wonder,pain,calling,somewhere,throw,straight,cold,fast,words,food,none,drive,feelings,they'll,marry,drop,cannot,dream,protect,twenty,surprise,sweetheart,poor,looked,mad,except,gun,y'know,dance,takes,appreciate,especially,situation,besides,pull,hasn't,worth,sheridan,amazing,expect,swear,piece,busy,happening,movie,we'd,catch,perhaps,step,fall,watching,kept,darling,dog,honor,moving,till,admit,problems,murder,he'd,evil,definitely,feels,honest,eye,broke,missed,longer,dollars,tired,evening,starting,entire,trip,niles,suppose,calm,imagine,fair,caught,blame,sitting,favor,apartment,terrible,clean,learn,frasier,relax,accident,wake,prove,smart,message,missing,forgot,interested,table,nbsp,mouth,pregnant,ring,careful,shall,dude,ride,figured,wear,shoot,stick,follow,angry,write,stopped,ran,standing,forgive,jail,wearing,ladies,kinda,lunch,cristian,greenlee,gotten,hoping,phoebe,thousand,ridge,paper,tough,tape,count,boyfriend,proud,agree,birthday,they've,share,offer,hurry,feet,wondering,decision,ones,finish,voice,herself,would've,mess,deserve,evidence,cute,dress,interesting,hotel,enjoy,quiet,concerned,staying,beat,sweetie,mention,clothes,fell,neither,mmm,fix,respect,prison,attention,holding,calls,surprised,bar,keeping,gift,hadn't,putting,dark,owe,ice,helping,normal,aunt,lawyer,apart,plans,jax,girlfriend,floor,whether,everything's,box,judge,upstairs,sake,mommy,possibly,worst,acting,accept,blow,strange,saved,conversation,plane,mama,yesterday,lied,quick,lately,stuck,difference,store,she'd,bought,doubt,listening,walking,cops,deep,dangerous,buffy,sleeping,chloe,rafe,join,card,crime,gentlemen,willing,window,walked,guilty,likes,fighting,difficult,soul,joke,favorite,uncle,promised,bother,seriously,cell,knowing,broken,advice,somehow,paid,losing,push,helped,killing,boss,liked,innocent,rules,learned,thirty,risk,letting,speaking,ridiculous,afternoon,apologize,nervous,charge,patient,boat,how'd,hide,detective,planning,huge,breakfast,horrible,awful,pleasure,driving,hanging,picked,sell,quit,apparently,dying,notice,congratulations,visit,could've,c'mon,letter,decide,forward,fool,showed,smell,seemed,spell,memory,pictures,slow,seconds,hungry,hearing,kitchen,ma'am,should've,realized,kick,grab,discuss,fifty,reading,idiot,suddenly,agent,destroy,bucks,shoes,peace,arms,demon,livvie,consider,papers,incredible,witch,drunk,attorney,tells,knock,ways,gives,nose,skye,turns,keeps,jealous,drug,sooner,cares,plenty,extra,outta,weekend,matters,gosh,opportunity,impossible,waste,pretend,jump,eating,proof,slept,arrest,breathe,perfectly,warm,pulled,twice,easier,goin,dating,suit,romantic,drugs,comfortable,finds,checked,divorce,begin,ourselves,closer,ruin,smile,laugh,treat,fear,what'd,otherwise,excited,mail,hiding,stole,pacey,noticed,fired,excellent,bringing,bottom,note,sudden,bathroom,honestly,sing,foot,remind,charges,witness,finding,tree,dare,hardly,that'll,steal,silly,contact,teach,shop,plus,colonel,fresh,trial,invited,roll,reach,dirty,choose,emergency,dropped,butt,credit,obvious,locked,loving,nuts,agreed,prue,goodbye,condition,guard,fuckin,grow,cake,mood,crap,crying,belong,partner,trick,pressure,dressed,taste,neck,nurse,raise,lots,carry,whoever,drinking,they'd,breaking,file,lock,wine,spot,paying,assume,asleep,turning,viki,bedroom,shower,nikolas,camera,fill,reasons,forty,bigger,nope,breath,doctors,pants,freak,movies,folks,cream,wild,truly,desk,convince,client,threw,hurts,spending,answers,shirt,chair,rough,doin,sees,ought,empty,wind,aware,dealing,pack,tight,hurting,guest,arrested,salem,confused,surgery,expecting,deacon,unfortunately,goddamn,bottle,beyond,whenever,pool,opinion,starts,jerk,secrets,falling,necessary,barely,dancing,tests,copy,cousin,ahem,twelve,tess,skin,fifteen,speech,orders,complicated,nowhere,escape,biggest,restaurant,grateful,usual,burn,address,someplace,screw,everywhere,regret,goodness,mistakes,details,responsibility,suspect,corner,hero,dumb,terrific,whoo,hole,memories,o'clock,teeth,ruined,bite,stenbeck,liar,showing,cards,desperate,search,pathetic,spoke,scare,marah,afford,settle,stayed,checking,hired,heads,concern,blew,alcazar,champagne,connection,tickets,happiness,saving,kissing,hated,personally,suggest,prepared,onto,downstairs,ticket,it'd,loose,holy,duty,convinced,throwing,kissed,legs,loud,saturday,babies,where'd,warning,miracle,carrying,blind,ugly,shopping,hates,sight,bride,coat,clearly,celebrate,brilliant,wanting,forrester,lips,custody,screwed,buying,toast,thoughts,reality,lexie,attitude,advantage,grandfather,sami,grandma,someday,roof,marrying,powerful,grown,grandmother,fake,must've,ideas,exciting,familiar,bomb,bout,harmony,schedule,capable,practically,correct,clue,forgotten,appointment,deserves,threat,bloody,lonely,shame,jacket,hook,scary,investigation,invite,shooting,lesson,criminal,victim,funeral,considering,burning,strength,harder,sisters,pushed,shock,pushing,heat,chocolate,miserable,corinthos,nightmare,brings,zander,crash,chances,sending,recognize,healthy,boring,feed,engaged,headed,treated,knife,drag,badly,hire,paint,pardon,behavior,closet,warn,gorgeous,milk,survive,ends,dump,rent,remembered,thanksgiving,rain,revenge,prefer,spare,pray,disappeared,aside,statement,sometime,meat,fantastic,breathing,laughing,stood,affair,ours,depends,protecting,jury,brave,fingers,murdered,explanation,picking,blah,stronger,handsome,unbelievable,anytime,shake,oakdale,wherever,pulling,facts,waited,lousy,circumstances,disappointed,weak,trusted,license,nothin,trash,understanding,slip,sounded,awake,friendship,stomach,weapon,threatened,mystery,vegas,understood,basically,switch,frankly,cheap,lifetime,deny,clock,garbage,why'd,tear,ears,indeed,changing,singing,tiny,decent,avoid,messed,filled,touched,disappear,exact,pills,kicked,harm,fortune,pretending,insurance,fancy,drove,cared,belongs,nights,lorelai,lift,timing,guarantee,chest,woke,burned,watched,heading,selfish,drinks,doll,committed,elevator,freeze,noise,wasting,ceremony,uncomfortable,staring,files,bike,stress,permission,thrown,possibility,borrow,fabulous,doors,screaming,bone,xander,what're,meal,apology,anger,honeymoon,bail,parking,fixed,wash,stolen,sensitive,stealing,photo,chose,lets,comfort,worrying,pocket,mateo,bleeding,shoulder,ignore,talent,tied,garage,dies,demons,dumped,witches,rude,crack,bothering,radar,soft,meantime,gimme,kinds,fate,concentrate,throat,prom,messages,intend,ashamed,somethin,manage,guilt,interrupt,guts,tongue,shoe,basement,sentence,purse,glasses,cabin,universe,repeat,mirror,wound,travers,tall,engagement,therapy,emotional,jeez,decisions,soup,thrilled,stake,chef,moves,extremely,moments,expensive,counting,shots,kidnapped,cleaning,shift,plate,impressed,smells,trapped,aidan,knocked,charming,attractive,argue,puts,whip,embarrassed,package,hitting,bust,stairs,alarm,pure,nail,nerve,incredibly,walks,dirt,stamp,terribly,friendly,damned,jobs,suffering,disgusting,stopping,deliver,riding,helps,disaster,bars,crossed,trap,talks,eggs,chick,threatening,spoken,introduce,confession,embarrassing,bags,impression,gate,reputation,presents,chat,suffer,argument,talkin,crowd,homework,coincidence,cancel,pride,solve,hopefully,pounds,pine,mate,illegal,generous,outfit,maid,bath,punch,freaked,begging,recall,enjoying,prepare,wheel,defend,signs,painful,yourselves,maris,that'd,suspicious,cooking,button,warned,sixty,pity,yelling,awhile,confidence,offering,pleased,panic,hers,gettin,refuse,grandpa,testify,choices,cruel,mental,gentleman,coma,cutting,proteus,guests,expert,benefit,faces,jumped,toilet,sneak,halloween,privacy,smoking,reminds,twins,swing,solid,options,commitment,crush,ambulance,wallet,gang,eleven,option,laundry,assure,stays,skip,fail,discussion,clinic,betrayed,sticking,bored,mansion,soda,sheriff,suite,handled,busted,load,happier,studying,romance,procedure,commit,assignment,suicide,minds,swim,yell,llanview,chasing,proper,believes,humor,hopes,lawyers,giant,latest,escaped,parent,tricks,insist,dropping,cheer,medication,flesh,routine,sandwich,handed,false,beating,warrant,awfully,odds,treating,thin,suggesting,fever,sweat,silent,clever,sweater,mall,sharing,assuming,judgment,goodnight,divorced,surely,steps,confess,math,listened,comin,answered,vulnerable,bless,dreaming,chip,zero,pissed,nate,kills,tears,knees,chill,brains,unusual,packed,dreamed,cure,lookin,grave,cheating,breaks,locker,gifts,awkward,thursday,joking,reasonable,dozen,curse,quartermaine,millions,dessert,rolling,detail,alien,delicious,closing,vampires,wore,tail,secure,salad,murderer,spit,offense,dust,conscience,bread,answering,lame,invitation,grief,smiling,pregnancy,prisoner,delivery,guards,virus,shrink,freezing,wreck,massimo,wire,technically,blown,anxious,cave,holidays,cleared,wishes,caring,candles,bound,charm,pulse,jumping,jokes,boom,occasion,silence,nonsense,frightened,slipped,dimera,blowing,relationships,kidnapping,spin,tool,roxy,packing,blaming,wrap,obsessed,fruit,torture,personality,there'll,fairy,necessarily,seventy,print,motel,underwear,grams,exhausted,believing,freaking,carefully,trace,touching,messing,recovery,intention,consequences,belt,sacrifice,courage,enjoyed,attracted,remove,testimony,intense,heal,defending,unfair,relieved,loyal,slowly,buzz,alcohol,surprises,psychiatrist,plain,attic,who'd,uniform,terrified,cleaned,zach,threaten,fella,enemies,satisfied,imagination,hooked,headache,forgetting,counselor,andie,acted,badge,naturally,frozen,sakes,appropriate,trunk,dunno,costume,sixteen,impressive,kicking,junk,grabbed,understands,describe,clients,owns,affect,witnesses,starving,instincts,happily,discussing,deserved,strangers,surveillance,admire,questioning,dragged,barn,deeply,wrapped,wasted,tense,hoped,fellas,roommate,mortal,fascinating,stops,arrangements,agenda,literally,propose,honesty,underneath,sauce,promises,lecture,eighty,torn,shocked,backup,differently,ninety,deck,biological,pheebs,ease,creep,waitress,telephone,ripped,raising,scratch,rings,prints,thee,arguing,ephram,asks,oops,diner,annoying,taggert,sergeant,blast,towel,clown,habit,creature,bermuda,snap,react,paranoid,handling,eaten,therapist,comment,sink,reporter,nurses,beats,priority,interrupting,warehouse,loyalty,inspector,pleasant,excuses,threats,guessing,tend,praying,motive,unconscious,mysterious,unhappy,tone,switched,rappaport,sookie,neighbor,loaded,swore,piss,balance,toss,misery,thief,squeeze,lobby,goa'uld,geez,exercise,forth,booked,sandburg,poker,eighteen,d'you,bury,everyday,digging,creepy,wondered,liver,hmmm,magical,fits,discussed,moral,helpful,searching,flew,depressed,aisle,cris,amen,vows,neighbors,darn,cents,arrange,annulment,useless,adventure,resist,fourteen,celebrating,inch,debt,violent,sand,teal'c,celebration,reminded,phones,paperwork,emotions,stubborn,pound,tension,stroke,steady,overnight,chips,beef,suits,boxes,cassadine,collect,tragedy,spoil,realm,wipe,surgeon,stretch,stepped,nephew,neat,limo,confident,perspective,climb,punishment,finest,springfield,hint,furniture,blanket,twist,proceed,fries,worries,niece,gloves,soap,signature,disappoint,crawl,convicted,flip,counsel,doubts,crimes,accusing,shaking,remembering,hallway,halfway,bothered,madam,gather,cameras,blackmail,symptoms,rope,ordinary,imagined,cigarette,supportive,explosion,trauma,ouch,furious,cheat,avoiding,whew,thick,oooh,boarding,approve,urgent,shhh,misunderstanding,drawer,phony,interfere,catching,bargain,tragic,respond,punish,penthouse,thou,rach,ohhh,insult,bugs,beside,begged,absolute,strictly,socks,senses,sneaking,reward,polite,checks,tale,physically,instructions,fooled,blows,tabby,bitter,adorable,y'all,tested,suggestion,jewelry,alike,jacks,distracted,shelter,lessons,constable,circus,audition,tune,shoulders,mask,helpless,feeding,explains,sucked,robbery,objection,behave,valuable,shadows,courtroom,confusing,talented,smarter,mistaken,customer,bizarre,scaring,motherfucker,alert,vecchio,reverend,foolish,compliment,bastards,worker,wheelchair,protective,gentle,reverse,picnic,knee,cage,wives,wednesday,voices,toes,stink,scares,pour,cheated,slide,ruining,filling,exit,cottage,upside,proves,parked,diary,complaining,confessed,pipe,merely,massage,chop,spill,prayer,betray,waiter,scam,rats,fraud,brush,tables,sympathy,pill,filthy,seventeen,employee,bracelet,pays,fairly,deeper,arrive,tracking,spite,shed,recommend,oughta,nanny,menu,diet,corn,roses,patch,dime,devastated,subtle,bullets,beans,pile,confirm,strings,parade,borrowed,toys,straighten,steak,premonition,planted,honored,exam,convenient,traveling,laying,insisted,dish,aitoro,kindly,grandson,donor,temper,teenager,proven,mothers,denial,backwards,tent,swell,noon,happiest,drives,thinkin,spirits,potion,holes,fence,whatsoever,rehearsal,overheard,lemme,hostage,bench,tryin,taxi,shove,moron,impress,needle,intelligent,instant,disagree,stinks,rianna,recover,groom,gesture,constantly,bartender,suspects,sealed,legally,hears,dresses,sheet,psychic,teenage,knocking,judging,accidentally,waking,rumor,manners,homeless,hollow,desperately,tapes,referring,item,genoa,gear,majesty,cried,tons,spells,instinct,quote,motorcycle,convincing,fashioned,aids,accomplished,grip,bump,upsetting,needing,invisible,forgiveness,feds,compare,bothers,tooth,inviting,earn,compromise,cocktail,tramp,jabot,intimate,dignity,dealt,souls,informed,gods,dressing,cigarettes,alistair,leak,fond,corky,seduce,liquor,fingerprints,enchantment,butters,stuffed,stavros,emotionally,transplant,tips,oxygen,nicely,lunatic,drill,complain,announcement,unfortunate,slap,prayers,plug,opens,oath,o'neill,mutual,yacht,remembers,fried,extraordinary,bait,warton,sworn,stare,safely,reunion,burst,might've,dive,aboard,expose,buddies,trusting,booze,sweep,sore,scudder,properly,parole,ditch,canceled,speaks,glow,wears,thirsty,skull,ringing,dorm,dining,bend,unexpected,pancakes,harsh,flattered,ahhh,troubles,fights,favourite,eats,rage,undercover,spoiled,sloane,shine,destroying,deliberately,conspiracy,thoughtful,sandwiches,plates,nails,miracles,fridge,drank,contrary,beloved,allergic,washed,stalking,solved,sack,misses,forgiven,bent,maciver,involve,dragging,cooked,pointing,foul,dull,beneath,heels,faking,deaf,stunt,jealousy,hopeless,fears,cuts,scenario,necklace,crashed,accuse,restraining,homicide,helicopter,firing,safer,auction,videotape,tore,reservations,pops,appetite,wounds,vanquish,ironic,fathers,excitement,anyhow,tearing,sends,rape,laughed,belly,dealer,cooperate,accomplish,wakes,spotted,sorts,reservation,ashes,tastes,supposedly,loft,intentions,integrity,wished,towels,suspected,investigating,inappropriate,lipstick,lawn,compassion,cafeteria,scarf,precisely,obsession,loses,lighten,infection,granddaughter,explode,balcony,this'll,spying,publicity,depend,cracked,conscious,ally,absurd,vicious,invented,forbid,directions,defendant,bare,announce,screwing,salesman,robbed,leap,lakeview,insanity,reveal,possibilities,kidnap,gown,chairs,wishing,setup,punished,criminals,regrets,raped,quarters,lamp,dentist,anyways,anonymous,semester,risks,owes,lungs,explaining,delicate,tricked,eager,doomed,adoption,stab,sickness,scum,floating,envelope,vault,sorel,pretended,potatoes,plea,photograph,payback,misunderstood,kiddo,healing,cascade,capeside,stabbed,remarkable,brat,privilege,passionate,nerves,lawsuit,kidney,disturbed,cozy,tire,shirts,oven,ordering,delay,risky,monsters,honorable,grounded,closest,breakdown,bald,abandon,scar,collar,worthless,sucking,enormous,disturbing,disturb,distract,deals,conclusions,vodka,dishes,crawling,briefcase,wiped,whistle,sits,roast,rented,pigs,flirting,deposit,bottles,topic,riot,overreacting,logical,hostile,embarrass,casual,beacon,amusing,altar,claus,survival,skirt,shave,porch,ghosts,favors,drops,dizzy,chili,advise,strikes,rehab,photographer,peaceful,leery,heavens,fortunately,fooling,expectations,cigar,weakness,ranch,practicing,examine,cranes,bribe,sail,prescription,hush,fragile,forensics,expense,drugged,cows,bells,visitor,suitcase,sorta,scan,manticore,insecure,imagining,hardest,clerk,wrist,what'll,starters,silk,pump,pale,nicer,haul,flies,boot,thumb,there'd,how're,elders,quietly,pulls,idiots,erase,denying,ankle,amnesia,accepting,heartbeat,devane,confront,minus,legitimate,fixing,arrogant,tuna,supper,slightest,sins,sayin,recipe,pier,paternity,humiliating,genuine,snack,rational,minded,guessed,weddings,tumor,humiliated,aspirin,spray,picks,eyed,drowning,contacts,ritual,perfume,hiring,hating,docks,creatures,visions,thanking,thankful,sock,nineteen,fork,throws,teenagers,stressed,slice,rolls,plead,ladder,kicks,detectives,assured,tellin,shallow,responsibilities,repay,howdy,girlfriends,deadly,comforting,ceiling,verdict,insensitive,spilled,respected,messy,interrupted,halliwell,blond,bleed,wardrobe,takin,murders,backs,underestimate,justify,harmless,frustrated,fold,enzo,communicate,bugging,arson,whack,salary,rumors,obligation,liking,dearest,congratulate,vengeance,rack,puzzle,fires,courtesy,caller,blamed,tops,quiz,prep,curiosity,circles,barbecue,sunnydale,spinning,psychotic,cough,accusations,resent,laughs,freshman,envy,drown,bartlet,asses,sofa,poster,highness,dock,apologies,theirs,stat,stall,realizes,psych,mmmm,fools,understandable,treats,succeed,stir,relaxed,makin,gratitude,faithful,accent,witter,wandering,locate,inevitable,gretel,deed,crushed,controlling,smelled,robe,gossip,gambling,cosmetics,accidents,surprising,stiff,sincere,rushed,refrigerator,preparing,nightmares,mijo,ignoring,hunch,fireworks,drowned,brass,whispering,sophisticated,luggage,hike,explore,emotion,crashing,contacted,complications,shining,rolled,righteous,reconsider,goody,geek,frightening,ethics,creeps,courthouse,camping,affection,smythe,haircut,essay,baked,apologized,vibe,respects,receipt,mami,hats,destructive,adore,adopt,tracked,shorts,reminding,dough,creations,cabot,barrel,snuck,slight,reporters,pressing,magnificent,madame,lazy,glorious,fiancee,bits,visitation,sane,kindness,shoulda,rescued,mattress,lounge,lifted,importantly,glove,enterprises,disappointment,condo,beings,admitting,yelled,waving,spoon,screech,satisfaction,reads,nailed,worm,tick,resting,marvelous,fuss,cortlandt,chased,pockets,luckily,lilith,filing,conversations,consideration,consciousness,worlds,innocence,forehead,aggressive,trailer,slam,quitting,inform,delighted,daylight,danced,confidential,aunts,washing,tossed,spectra,marrow,lined,implying,hatred,grill,corpse,clues,sober,offended,morgue,infected,humanity,distraction,cart,wired,violation,promising,harassment,glue,d'angelo,cursed,brutal,warlocks,wagon,unpleasant,proving,priorities,mustn't,lease,flame,disappearance,depressing,thrill,sitter,ribs,flush,earrings,deadline,corporal,collapsed,update,snapped,smack,melt,figuring,delusional,coulda,burnt,tender,sperm,realise,pork,popped,interrogation,esteem,choosing,undo,pres,prayed,plague,manipulate,insulting,detention,delightful,coffeehouse,betrayal,apologizing,adjust,wrecked,wont,whipped,rides,reminder,monsieur,faint,bake,distress,correctly,complaint,blocked,tortured,risking,pointless,handing,dumping,cups,alibi,struggling,shiny,risked,mummy,mint,hose,hobby,fortunate,fleischman,fitting,curtain,counseling,rode,puppet,modeling,memo,irresponsible,humiliation,hiya,freakin,felony,choke,blackmailing,appreciated,tabloid,suspicion,recovering,pledge,panicked,nursery,louder,jeans,investigator,homecoming,frustrating,buys,busting,buff,sleeve,irony,dope,declare,autopsy,workin,torch,prick,limb,hysterical,goddamnit,fetch,dimension,crowded,clip,climbing,bonding,woah,trusts,negotiate,lethal,iced,fantasies,deeds,bore,babysitter,questioned,outrageous,kiriakis,insulted,grudge,driveway,deserted,definite,beep,wires,suggestions,searched,owed,lend,drunken,demanding,costanza,conviction,bumped,weigh,touches,tempted,shout,resolve,relate,poisoned,meals,invitations,haunted,bogus,autograph,affects,tolerate,stepping,spontaneous,sleeps,probation,manny,fist,spectacular,hostages,heroin,havin,habits,encouraging,consult,burgers,boyfriends,bailed,baggage,watches,troubled,torturing,teasing,sweetest,qualities,postpone,overwhelmed,malkovich,impulse,classy,charging,amazed,policeman,hypocrite,humiliate,hideous,d'ya,costumes,bluffing,betting,bein,bedtime,alcoholic,vegetable,tray,suspicions,spreading,splendid,shrimp,shouting,pressed,nooo,grieving,gladly,fling,eliminate,cereal,aaah,sonofabitch,paralyzed,lotta,locks,guaranteed,dummy,despise,dental,briefing,bluff,batteries,whatta,sounding,servants,presume,handwriting,fainted,dried,allright,acknowledge,whacked,toxic,reliable,quicker,overwhelming,lining,harassing,fatal,endless,dolls,convict,whatcha,unlikely,shutting,positively,overcome,goddam,essence,dose,diagnosis,cured,bully,ahold,yearbook,tempting,shelf,prosecution,pouring,possessed,greedy,wonders,thorough,spine,rath,psychiatric,meaningless,latte,jammed,ignored,fiance,evidently,contempt,compromised,cans,weekends,urge,theft,suing,shipment,scissors,responding,proposition,noises,matching,hormones,hail,grandchildren,gently,smashed,sexually,sentimental,nicest,manipulated,intern,handcuffs,framed,errands,entertaining,crib,carriage,barge,spends,slipping,seated,rubbing,rely,reject,recommendation,reckon,headaches,float,embrace,corners,whining,sweating,skipped,mountie,motives,listens,cristobel,cleaner,cheerleader,balsom,unnecessary,stunning,scent,quartermaines,pose,montega,loosen,info,hottest,haunt,gracious,forgiving,errand,cakes,blames,abortion,sketch,shifts,plotting,perimeter,pals,mere,mattered,lonigan,interference,eyewitness,enthusiasm,diapers,strongest,shaken,punched,portal,catches,backyard,terrorists,sabotage,organs,needy,cuff,civilization,woof,who'll,prank,obnoxious,mates,hereby,gabby,faked,cellar,whitelighter,void,strangle,sour,muffins,interfering,demonic,clearing,boutique,barrington,terrace,smoked,righty,quack,petey,pact,knot,ketchup,disappearing,cordy,uptight,ticking,terrifying,tease,swamp,secretly,rejection,reflection,realizing,rays,mentally,marone,doubted,deception,congressman,cheesy,toto,stalling,scoop,ribbon,immune,expects,destined,bets,bathing,appreciation,accomplice,wander,shoved,sewer,scroll,retire,lasts,fugitive,freezer,discount,cranky,crank,clearance,bodyguard,anxiety,accountant,whoops,volunteered,talents,stinking,remotely,garlic,decency,cord,beds,altogether,uniforms,tremendous,popping,outa,observe,lung,hangs,feelin,dudes,donation,disguise,curb,bites,antique,toothbrush,realistic,predict,landlord,hourglass,hesitate,consolation,babbling,tipped,stranded,smartest,repeating,puke,psst,paycheck,overreacted,macho,juvenile,grocery,freshen,disposal,cuffs,caffeine,vanished,unfinished,ripping,pinch,flattering,expenses,dinners,colleague,ciao,belthazor,attorneys,woulda,whereabouts,waitin,truce,tripped,tasted,steer,poisoning,manipulative,immature,husbands,heel,granddad,delivering,condoms,addict,trashed,raining,pasta,needles,leaning,detector,coolest,batch,appointments,almighty,vegetables,spark,perfection,pains,momma,mole,meow,hairs,getaway,cracking,compliments,behold,verge,tougher,timer,tapped,taped,specialty,snooping,shoots,rendezvous,pentagon,leverage,jeopardize,janitor,grandparents,forbidden,clueless,bidding,ungrateful,unacceptable,tutor,serum,scuse,pajamas,mouths,lure,irrational,doom,cries,beautifully,arresting,approaching,traitor,sympathetic,smug,smash,rental,prostitute,premonitions,jumps,inventory,darlin,committing,banging,asap,worms,violated,vent,traumatic,traced,sweaty,shaft,overboard,insight,healed,grasp,experiencing,crappy,crab,chunk,awww,stain,shack,reacted,pronounce,poured,moms,marriages,jabez,handful,flipped,fireplace,embarrassment,disappears,concussion,bruises,brakes,twisting,swept,summon,splitting,sloppy,settling,reschedule,notch,hooray,grabbing,exquisite,disrespect,thornhart,straw,slapped,shipped,shattered,ruthless,refill,payroll,numb,mourning,manly,hunk,entertain,drift,dreadful,doorstep,confirmation,chops,appreciates,vague,tires,stressful,stashed,stash,sensed,preoccupied,predictable,noticing,madly,gunshot,dozens,dork,confuse,cleaners,charade,chalk,cappuccino,bouquet,amulet,addiction,who've,warming,unlock,satisfy,sacrificed,relaxing,lone,blocking,blend,blankets,addicted,yuck,hunger,hamburger,greeting,greet,gravy,gram,dreamt,dice,caution,backpack,agreeing,whale,taller,supervisor,sacrifices,phew,ounce,irrelevant,gran,felon,favorites,farther,fade,erased,easiest,convenience,compassionate,cane,backstage,agony,adores,veins,tweek,thieves,surgical,strangely,stetson,recital,proposing,productive,meaningful,immunity,hassle,goddamned,frighten,dearly,cease,ambition,wage,unstable,salvage,richer,refusing,raging,pumping,pressuring,mortals,lowlife,intimidated,intentionally,inspire,forgave,devotion,despicable,deciding,dash,comfy,breach,bark,aaaah,switching,swallowed,stove,screamed,scars,russians,pounding,poof,pipes,pawn,legit,invest,farewell,curtains,civilized,caviar,boost,token,superstition,supernatural,sadness,recorder,psyched,motivated,microwave,hallelujah,fraternity,dryer,cocoa,chewing,acceptable,unbelievably,smiled,smelling,simpler,respectable,remarks,khasinau,indication,gutter,grabs,fulfill,flashlight,ellenor,blooded,blink,blessings,beware,uhhh,turf,swings,slips,shovel,shocking,puff,mirrors,locking,heartless,fras,childish,cardiac,utterly,tuscany,ticked,stunned,statesville,sadly,purely,kiddin,jerks,hitch,flirt,fare,equals,dismiss,christening,casket,c'mere,breakup,biting,antibiotics,accusation,abducted,witchcraft,thread,runnin,punching,paramedics,newest,murdering,masks,lawndale,initials,grampa,choking,charms,careless,bushes,buns,bummed,shred,saves,saddle,rethink,regards,precinct,persuade,meds,manipulating,llanfair,leash,hearted,guarantees,fucks,disgrace,deposition,bookstore,boil,vitals,veil,trespassing,sidewalk,sensible,punishing,overtime,optimistic,obsessing,notify,mornin,jeopardy,jaffa,injection,hilarious,desires,confide,cautious,yada,where're,vindictive,vial,teeny,stroll,sittin,scrub,rebuild,posters,ordeal,nuns,intimacy,inheritance,exploded,donate,distracting,despair,crackers,wildwind,virtue,thoroughly,tails,spicy,sketches,sights,sheer,shaving,seize,scarecrow,refreshing,prosecute,platter,napkin,misplaced,merchandise,loony,jinx,heroic,frankenstein,ambitious,syrup,solitary,resemblance,reacting,premature,lavery,flashes,cheque,awright,acquainted,wrapping,untie,salute,realised,priceless,partying,lightly,lifting,kasnoff,insisting,glowing,generator,explosives,cutie,confronted,buts,blouse,ballistic,antidote,analyze,allowance,adjourned,unto,understatement,tucked,touchy,subconscious,screws,sarge,roommates,rambaldi,offend,nerd,knives,irresistible,incapable,hostility,goddammit,fuse,frat,curfew,blackmailed,walkin,starve,sleigh,sarcastic,recess,rebound,pinned,parlor,outfits,livin,heartache,haired,fundraiser,doorman,discreet,dilucca,cracks,considerate,climbed,catering,apophis,zoey,urine,strung,stitches,sordid,sark,protector,phoned,pets,hostess,flaw,flavor,deveraux,consumed,confidentiality,bourbon,straightened,specials,spaghetti,prettier,powerless,playin,playground,paranoia,instantly,havoc,exaggerating,eavesdropping,doughnuts,diversion,deepest,cutest,comb,bela,behaving,anyplace,accessory,workout,translate,stuffing,speeding,slime,royalty,polls,marital,lurking,lottery,imaginary,greetings,fairwinds,elegant,elbow,credibility,credentials,claws,chopped,bridal,bedside,babysitting,witty,unforgivable,underworld,tempt,tabs,sophomore,selfless,secrecy,restless,okey,movin,metaphor,messes,meltdown,lecter,incoming,gasoline,diefenbaker,buckle,admired,adjustment,warmth,throats,seduced,queer,parenting,noses,luckiest,graveyard,gifted,footsteps,dimeras,cynical,wedded,verbal,unpredictable,tuned,stoop,slides,sinking,rigged,plumbing,lingerie,hankey,greed,everwood,elope,dresser,chauffeur,bulletin,bugged,bouncing,temptation,strangest,slammed,sarcasm,pending,packages,orderly,obsessive,murderers,meteor,inconvenience,glimpse,froze,execute,courageous,consulate,closes,bosses,bees,amends,wuss,wolfram,wacky,unemployed,testifying,syringe,stew,startled,sorrow,sleazy,shaky,screams,rsquo,remark,poke,nutty,mentioning,mend,inspiring,impulsive,housekeeper,foam,fingernails,conditioning,baking,whine,thug,starved,sniffing,sedative,programmed,picket,paged,hound,homosexual,homo,hips,forgets,flipping,flea,flatter,dwell,dumpster,choo,assignments,ants,vile,unreasonable,tossing,thanked,steals,souvenir,scratched,psychopath,outs,obstruction,obey,lump,insists,harass,gloat,filth,edgy,didn,coroner,confessing,bruise,betraying,bailing,appealing,adebisi,wrath,wandered,waist,vain,traps,stepfather,poking,obligated,heavenly,dilemma,crazed,contagious,coaster,cheering,bundle,vomit,thingy,speeches,robbing,raft,pumped,pillows,peep,packs,neglected,m'kay,loneliness,intrude,helluva,gardener,forresters,drooling,betcha,vase,supermarket,squat,spitting,rhyme,relieve,receipts,racket,pictured,pause,overdue,motivation,morgendorffer,kidnapper,insect,horns,feminine,eyeballs,dumps,disappointing,crock,convertible,claw,clamp,canned,cambias,bathtub,avanya,artery,weep,warmer,suspense,summoned,spiders,reiber,raving,pushy,postponed,ohhhh,noooo,mold,laughter,incompetent,hugging,groceries,drip,communicating,auntie,adios,wraps,wiser,willingly,weirdest,timmih,thinner,swelling,swat,steroids,sensitivity,scrape,rehearse,prophecy,ledge,justified,insults,hateful,handles,doorway,chatting,buyer,buckaroo,bedrooms,askin,ammo,tutoring,subpoena,scratching,privileges,pager,mart,intriguing,idiotic,grape,enlighten,corrupt,brunch,bridesmaid,barking,applause,acquaintance,wretched,superficial,soak,smoothly,sensing,restraint,posing,pleading,payoff,oprah,nemo,morals,loaf,jumpy,ignorant,herbal,hangin,germs,generosity,flashing,doughnut,clumsy,chocolates,captive,behaved,apologise,vanity,stumbled,preview,poisonous,perjury,parental,onboard,mugged,minding,linen,knots,interviewing,humour,grind,greasy,goons,drastic,coop,comparing,cocky,clearer,bruised,brag,bind,worthwhile,whoop,vanquishing,tabloids,sprung,spotlight,sentencing,racist,provoke,pining,overly,locket,imply,impatient,hovering,hotter,fest,endure,dots,doren,debts,crawled,chained,brit,breaths,weirdo,warmed,wand,troubling,tok'ra,strapped,soaked,skipping,scrambled,rattle,profound,musta,mocking,misunderstand,limousine,kacl,hustle,forensic,enthusiastic,duct,drawers,devastating,conquer,clarify,chores,cheerleaders,cheaper,callin,blushing,barging,abused,yoga,wrecking,wits,waffles,virginity,vibes,uninvited,unfaithful,teller,strangled,scheming,ropes,rescuing,rave,postcard,o'reily,morphine,lotion,lads,kidneys,judgement,itch,indefinitely,grenade,glamorous,genetically,freud,discretion,delusions,crate,competent,bakery,argh,ahhhh,wedge,wager,unfit,tripping,torment,superhero,stirring,spinal,sorority,seminar,scenery,rabble,pneumonia,perks,override,ooooh,mija,manslaughter,mailed,lime,lettuce,intimidate,guarded,grieve,grad,frustration,doorbell,chinatown,authentic,arraignment,annulled,allergies,wanta,verify,vegetarian,tighter,telegram,stalk,spared,shoo,satisfying,saddam,requesting,pens,overprotective,obstacles,notified,nasedo,grandchild,genuinely,flushed,fluids,floss,escaping,ditched,cramp,corny,bunk,bitten,billions,bankrupt,yikes,wrists,ultrasound,ultimatum,thirst,sniff,shakes,salsa,retrieve,reassuring,pumps,neurotic,negotiating,needn't,monitors,millionaire,lydecker,limp,incriminating,hatchet,gracias,gordie,fills,feeds,doubting,decaf,biopsy,whiz,voluntarily,ventilator,unpack,unload,toad,spooked,snitch,schillinger,reassure,persuasive,mystical,mysteries,matrimony,mails,jock,headline,explanations,dispatch,curly,cupid,condolences,comrade,cassadines,bulb,bragging,awaits,assaulted,ambush,adolescent,abort,yank,whit,vaguely,undermine,tying,swamped,stabbing,slippers,slash,sincerely,sigh,setback,secondly,rotting,precaution,pcpd,melting,liaison,hots,hooking,headlines,haha,ganz,fury,felicity,fangs,encouragement,earring,dreidel,dory,donut,dictate,decorating,cocktails,bumps,blueberry,believable,backfired,backfire,apron,adjusting,vous,vouch,vitamins,ummm,tattoos,slimy,sibling,shhhh,renting,peculiar,parasite,paddington,marries,mailbox,magically,lovebirds,knocks,informant,exits,drazen,distractions,disconnected,dinosaurs,dashwood,crooked,conveniently,wink,warped,underestimated,tacky,shoving,seizure,reset,pushes,opener,mornings,mash,invent,indulge,horribly,hallucinating,festive,eyebrows,enjoys,desperation,dealers,darkest,daph,boragora,belts,bagel,authorization,auditions,agitated,wishful,wimp,vanish,unbearable,tonic,suffice,suction,slaying,safest,rocking,relive,puttin,prettiest,noisy,newlyweds,nauseous,misguided,mildly,midst,liable,judgmental,indy,hunted,givin,fascinated,elephants,dislike,deluded,decorate,crummy,contractions,carve,bottled,bonded,bahamas,unavailable,twenties,trustworthy,surgeons,stupidity,skies,remorse,preferably,pies,nausea,napkins,mule,mourn,melted,mashed,inherit,greatness,golly,excused,dumbo,drifting,delirious,damaging,cubicle,compelled,comm,chooses,checkup,boredom,bandages,alarms,windshield,who're,whaddya,transparent,surprisingly,sunglasses,slit,roar,reade,prognosis,probe,pitiful,persistent,peas,nosy,nagging,morons,masterpiece,martinis,limbo,liars,irritating,inclined,hump,hoynes,fiasco,eatin,cubans,concentrating,colorful,clam,cider,brochure,barto,bargaining,wiggle,welcoming,weighing,vanquished,stains,sooo,snacks,smear,sire,resentment,psychologist,pint,overhear,morality,landingham,kisser,hoot,holling,handshake,grilled,formality,elevators,depths,confirms,boathouse,accidental,westbridge,wacko,ulterior,thugs,thighs,tangled,stirred,snag,sling,sleaze,rumour,ripe,remarried,puddle,pins,perceptive,miraculous,longing,lockup,librarian,impressions,immoral,hypothetically,guarding,gourmet,gabe,faxed,extortion,downright,digest,cranberry,bygones,buzzing,burying,bikes,weary,taping,takeout,sweeping,stepmother,stale,senor,seaborn,pros,pepperoni,newborn,ludicrous,injected,geeks,forged,faults,drue,dire,dief,desi,deceiving,caterer,calmed,budge,ankles,vending,typing,tribbiani,there're,squared,snowing,shades,sexist,rewrite,regretted,raises,picky,orphan,mural,misjudged,miscarriage,memorize,leaking,jitters,invade,interruption,illegally,handicapped,glitch,gittes,finer,distraught,dispose,dishonest,digs,dads,cruelty,circling,canceling,butterflies,belongings,barbrady,amusement,alias,zombies,where've,unborn,swearing,stables,squeezed,sensational,resisting,radioactive,questionable,privileged,portofino,owning,overlook,orson,oddly,interrogate,imperative,impeccable,hurtful,hors,heap,graders,glance,disgust,devious,destruct,crazier,countdown,chump,cheeseburger,burglar,berries,ballroom,assumptions,annoyed,allergy,admirer,admirable,activate,underpants,twit,tack,strokes,stool,sham,scrap,retarded,resourceful,remarkably,refresh,pressured,precautions,pointy,nightclub,mustache,maui,lace,hunh,hubby,flare,dont,dokey,dangerously,crushing,clinging,choked,chem,cheerleading,checkbook,cashmere,calmly,blush,believer,amazingly,alas,what've,toilets,tacos,stairwell,spirited,sewing,rubbed,punches,protects,nuisance,motherfuckers,mingle,kynaston,knack,kinkle,impose,gullible,godmother,funniest,friggin,folding,fashions,eater,dysfunctional,drool,dripping,ditto,cruising,criticize,conceive,clone,cedars,caliber,brighter,blinded,birthdays,banquet,anticipate,annoy,whim,whichever,volatile,veto,vested,shroud,rests,reindeer,quarantine,pleases,painless,orphans,orphanage,offence,obliged,negotiation,narcotics,mistletoe,meddling,manifest,lookit,lilah,intrigued,injustice,homicidal,gigantic,exposing,elves,disturbance,disastrous,depended,demented,correction,cooped,cheerful,buyers,brownies,beverage,basics,arvin,weighs,upsets,unethical,swollen,sweaters,stupidest,sensation,scalpel,props,prescribed,pompous,objections,mushrooms,mulwray,manipulation,lured,internship,insignificant,inmate,incentive,fulfilled,disagreement,crypt,cornered,copied,brightest,beethoven,attendant,amaze,yogurt,wyndemere,vocabulary,tulsa,tactic,stuffy,respirator,pretends,polygraph,pennies,ordinarily,olives,necks,morally,martyr,leftovers,joints,hopping,homey,hints,heartbroken,forge,florist,firsthand,fiend,dandy,crippled,corrected,conniving,conditioner,clears,chemo,bubbly,bladder,beeper,baptism,wiring,wench,weaknesses,volunteering,violating,unlocked,tummy,surrogate,subid,stray,startle,specifics,slowing,scoot,robbers,rightful,richest,qfxmjrie,puffs,pierced,pencils,paralysis,makeover,luncheon,linksynergy,jerky,jacuzzi,hitched,hangover,fracture,flock,firemen,disgusted,darned,clams,borrowing,banged,wildest,weirder,unauthorized,stunts,sleeves,sixties,shush,shalt,retro,quits,pegged,painfully,paging,omelet,memorized,lawfully,jackets,intercept,ingredient,grownup,glued,fulfilling,enchanted,delusion,daring,compelling,carton,bridesmaids,bribed,boiling,bathrooms,bandage,awaiting,assign,arrogance,antiques,ainsley,turkeys,trashing,stockings,stalked,stabilized,skates,sedated,robes,respecting,psyche,presumptuous,prejudice,paragraph,mocha,mints,mating,mantan,lorne,loads,listener,itinerary,hepatitis,heave,guesses,fading,examining,dumbest,dishwasher,deceive,cunning,cripple,convictions,confided,compulsive,compromising,burglary,bumpy,brainwashed,benes,arnie,affirmative,adrenaline,adamant,watchin,waitresses,transgenic,toughest,tainted,surround,stormed,spree,spilling,spectacle,soaking,shreds,sewers,severed,scarce,scamming,scalp,rewind,rehearsing,pretentious,potions,overrated,obstacle,nerds,meems,mcmurphy,maternity,maneuver,loathe,fertility,eloping,ecstatic,ecstasy,divorcing,dignan,costing,clubhouse,clocks,candid,bursting,breather,braces,bending,arsonist,adored,absorb,valiant,uphold,unarmed,topolsky,thrilling,thigh,terminate,sustain,spaceship,snore,sneeze,smuggling,salty,quaint,patronize,patio,morbid,mamma,kettle,joyous,invincible,interpret,insecurities,impulses,illusions,holed,exploit,drivin,defenseless,dedicate,cradle,coupon,countless,conjure,cardboard,booking,backseat,accomplishment,wordsworth,wisely,valet,vaccine,urges,unnatural,unlucky,truths,traumatized,tasting,swears,strawberries,steaks,stats,skank,seducing,secretive,scumbag,screwdriver,schedules,rooting,rightfully,rattled,qualifies,puppets,prospects,pronto,posse,polling,pedestal,palms,muddy,morty,microscope,merci,lecturing,inject,incriminate,hygiene,grapefruit,gazebo,funnier,cuter,bossy,booby,aides,zende,winthrop,warrants,valentines,undressed,underage,truthfully,tampered,suffers,speechless,sparkling,sidelines,shrek,railing,puberty,pesky,outrage,outdoors,motions,moods,lunches,litter,kidnappers,itching,intuition,imitation,humility,hassling,gallons,drugstore,dosage,disrupt,dipping,deranged,debating,cuckoo,cremated,craziness,cooperating,circumstantial,chimney,blinking,biscuits,admiring,weeping,triad,trashy,soothing,slumber,slayers,skirts,siren,shindig,sentiment,rosco,riddance,quaid,purity,proceeding,pretzels,panicking,mckechnie,lovin,leaked,intruding,impersonating,ignorance,hamburgers,footprints,fluke,fleas,festivities,fences,feisty,evacuate,emergencies,deceived,creeping,craziest,corpses,conned,coincidences,bounced,bodyguards,blasted,bitterness,baloney,ashtray,apocalypse,zillion,watergate,wallpaper,telesave,sympathize,sweeter,startin,spades,sodas,snowed,sleepover,signor,seein,retainer,restroom,rested,repercussions,reliving,reconcile,prevail,preaching,overreact,o'neil,noose,moustache,manicure,maids,landlady,hypothetical,hopped,homesick,hives,hesitation,herbs,hectic,heartbreak,haunting,gangs,frown,fingerprint,exhausting,everytime,disregard,cling,chevron,chaperone,blinding,bitty,beads,battling,badgering,anticipation,upstanding,unprofessional,unhealthy,turmoil,truthful,toothpaste,tippin,thoughtless,tagataya,shooters,senseless,rewarding,propane,preposterous,pigeons,pastry,overhearing,obscene,negotiable,loner,jogging,itchy,insinuating,insides,hospitality,hormone,hearst,forthcoming,fists,fifties,etiquette,endings,destroys,despises,deprived,cuddy,crust,cloak,circumstance,chewed,casserole,bidder,bearer,artoo,applaud,appalling,vowed,virgins,vigilante,undone,throttle,testosterone,tailor,symptom,swoop,suitcases,stomp,sticker,stakeout,spoiling,snatched,smoochy,smitten,shameless,restraints,researching,renew,refund,reclaim,raoul,puzzles,purposely,punks,prosecuted,plaid,picturing,pickin,parasites,mysteriously,multiply,mascara,jukebox,interruptions,gunfire,furnace,elbows,duplicate,drapes,deliberate,decoy,cryptic,coupla,condemn,complicate,colossal,clerks,clarity,brushed,banished,argon,alarmed,worships,versa,uncanny,technicality,sundae,stumble,stripping,shuts,schmuck,satin,saliva,robber,relentless,reconnect,recipes,rearrange,rainy,psychiatrists,policemen,plunge,plugged,patched,overload,o'malley,mindless,menus,lullaby,lotte,leavin,killin,karinsky,invalid,hides,grownups,griff,flaws,flashy,flaming,fettes,evicted,dread,degrassi,dealings,dangers,cushion,bowel,barged,abide,abandoning,wonderfully,wait'll,violate,suicidal,stayin,sorted,slamming,sketchy,shoplifting,raiser,quizmaster,prefers,needless,motherhood,momentarily,migraine,lifts,leukemia,leftover,keepin,hinks,hellhole,gowns,goodies,gallon,futures,entertained,eighties,conspiring,cheery,benign,apiece,adjustments,abusive,abduction,wiping,whipping,welles,unspeakable,unidentified,trivial,transcripts,textbook,supervise,superstitious,stricken,stimulating,spielberg,slices,shelves,scratches,sabotaged,retrieval,repressed,rejecting,quickie,ponies,peeking,outraged,o'connell,moping,moaning,mausoleum,licked,kovich,klutz,interrogating,interfered,insulin,infested,incompetence,hyper,horrified,handedly,gekko,fraid,fractured,examiner,eloped,disoriented,dashing,crashdown,courier,cockroach,chipped,brushing,bombed,bolts,baths,baptized,astronaut,assurance,anemia,abuela,abiding,withholding,weave,wearin,weaker,suffocating,straws,straightforward,stench,steamed,starboard,sideways,shrinks,shortcut,scram,roasted,roaming,riviera,respectfully,repulsive,psychiatry,provoked,penitentiary,painkillers,ninotchka,mitzvah,milligrams,midge,marshmallows,looky,lapse,kubelik,intellect,improvise,implant,goa'ulds,giddy,geniuses,fruitcake,footing,fightin,drinkin,doork,detour,cuddle,crashes,combo,colonnade,cheats,cetera,bailiff,auditioning,assed,amused,alienate,aiding,aching,unwanted,topless,tongues,tiniest,superiors,soften,sheldrake,rawley,raisins,presses,plaster,nessa,narrowed,minions,merciful,lawsuits,intimidating,infirmary,inconvenient,imposter,hugged,honoring,holdin,hades,godforsaken,fumes,forgery,foolproof,folder,flattery,fingertips,exterminator,explodes,eccentric,dodging,disguised,crave,constructive,concealed,compartment,chute,chinpokomon,bodily,astronauts,alimony,accustomed,abdominal,wrinkle,wallow,valium,untrue,uncover,trembling,treasures,torched,toenails,timed,termites,telly,taunting,taransky,talker,succubus,smarts,sliding,sighting,semen,seizures,scarred,savvy,sauna,saddest,sacrificing,rubbish,riled,ratted,rationally,provenance,phonse,perky,pedal,overdose,nasal,nanites,mushy,movers,missus,midterm,merits,melodramatic,manure,knitting,invading,interpol,incapacitated,hotline,hauling,gunpoint,grail,ganza,framing,flannel,faded,eavesdrop,desserts,calories,breathtaking,bleak,blacked,batter,aggravated,yanked,wigand,whoah,unwind,undoubtedly,unattractive,twitch,trimester,torrance,timetable,taxpayers,strained,stared,slapping,sincerity,siding,shenanigans,shacking,sappy,samaritan,poorer,politely,paste,oysters,overruled,nightcap,mosquito,millimeter,merrier,manhood,lucked,kilos,ignition,hauled,harmed,goodwill,freshmen,fenmore,fasten,farce,exploding,erratic,drunks,ditching,d'artagnan,cramped,contacting,closets,clientele,chimp,bargained,arranging,anesthesia,amuse,altering,afternoons,accountable,abetting,wolek,waved,uneasy,toddy,tattooed,spauldings,sliced,sirens,schibetta,scatter,rinse,remedy,redemption,pleasures,optimism,oblige,mmmmm,masked,malicious,mailing,kosher,kiddies,judas,isolate,insecurity,incidentally,heals,headlights,growl,grilling,glazed,flunk,floats,fiery,fairness,exercising,excellency,disclosure,cupboard,counterfeit,condescending,conclusive,clicked,cleans,cholesterol,cashed,broccoli,brats,blueprints,blindfold,billing,attach,appalled,alrighty,wynant,unsolved,unreliable,toots,tighten,sweatshirt,steinbrenner,steamy,spouse,sonogram,slots,sleepless,shines,retaliate,rephrase,redeem,rambling,quilt,quarrel,prying,proverbial,priced,prescribe,prepped,pranks,possessive,plaintiff,pediatrics,overlooked,outcast,nightgown,mumbo,mediocre,mademoiselle,lunchtime,lifesaver,leaned,lambs,interns,hounding,hellmouth,hahaha,goner,ghoul,gardening,frenzy,foyer,extras,exaggerate,everlasting,enlightened,dialed,devote,deceitful,d'oeuvres,cosmetic,contaminated,conspired,conning,cavern,carving,butting,boiled,blurry,babysit,ascension,aaaaah,wildly,whoopee,whiny,weiskopf,walkie,vultures,vacations,upfront,unresolved,tampering,stockholders,snaps,sleepwalking,shrunk,sermon,seduction,scams,revolve,phenomenal,patrolling,paranormal,ounces,omigod,nightfall,lashing,innocents,infierno,incision,humming,haunts,gloss,gloating,frannie,fetal,feeny,entrapment,discomfort,detonator,dependable,concede,complication,commotion,commence,chulak,caucasian,casually,brainer,bolie,ballpark,anwar,analyzing,accommodations,youse,wring,wallowing,transgenics,thrive,tedious,stylish,strippers,sterile,squeezing,squeaky,sprained,solemn,snoring,shattering,shabby,seams,scrawny,revoked,residue,reeks,recite,ranting,quoting,predicament,plugs,pinpoint,petrified,pathological,passports,oughtta,nighter,navigate,kippie,intrigue,intentional,insufferable,hunky,how've,horrifying,hearty,hamptons,grazie,funerals,forks,fetched,excruciating,enjoyable,endanger,dumber,drying,diabolical,crossword,corry,comprehend,clipped,classmates,candlelight,brutally,brutality,boarded,bathrobe,authorize,assemble,aerobics,wholesome,whiff,vermin,trophies,trait,tragically,toying,testy,tasteful,stocked,spinach,sipping,sidetracked,scrubbing,scraping,sanctity,robberies,ridin,retribution,refrain,realities,radiant,protesting,projector,plutonium,payin,parting,o'reilly,nooooo,motherfucking,measly,manic,lalita,juggling,jerking,intro,inevitably,hypnosis,huddle,horrendous,hobbies,heartfelt,harlin,hairdresser,gonorrhea,fussing,furtwangler,fleeting,flawless,flashed,fetus,eulogy,distinctly,disrespectful,denies,crossbow,cregg,crabs,cowardly,contraction,contingency,confirming,condone,coffins,cleansing,cheesecake,certainty,cages,c'est,briefed,bravest,bosom,boils,binoculars,bachelorette,appetizer,ambushed,alerted,woozy,withhold,vulgar,utmost,unleashed,unholy,unhappiness,unconditional,typewriter,typed,twists,supermodel,subpoenaed,stringing,skeptical,schoolgirl,romantically,rocked,revoir,reopen,puncture,preach,polished,planetarium,penicillin,peacefully,nurturing,more'n,mmhmm,midgets,marklar,lodged,lifeline,jellyfish,infiltrate,hutch,horseback,heist,gents,frickin,freezes,forfeit,flakes,flair,fathered,eternally,epiphany,disgruntled,discouraged,delinquent,decipher,danvers,cubes,credible,coping,chills,cherished,catastrophe,bombshell,birthright,billionaire,ample,affections,admiration,abbotts,whatnot,watering,vinegar,unthinkable,unseen,unprepared,unorthodox,underhanded,uncool,timeless,thump,thermometer,theoretically,tapping,tagged,swung,stares,spiked,solves,smuggle,scarier,saucer,quitter,prudent,powdered,poked,pointers,peril,penetrate,penance,opium,nudge,nostrils,neurological,mockery,mobster,medically,loudly,insights,implicate,hypocritical,humanly,holiness,healthier,hammered,haldeman,gunman,gloom,freshly,francs,flunked,flawed,emptiness,drugging,dozer,derevko,deprive,deodorant,cryin,crocodile,coloring,colder,cognac,clocked,clippings,charades,chanting,certifiable,caterers,brute,brochures,botched,blinders,bitchin,banter,woken,ulcer,tread,thankfully,swine,swimsuit,swans,stressing,steaming,stamped,stabilize,squirm,snooze,shuffle,shredded,seafood,scratchy,savor,sadistic,rhetorical,revlon,realist,prosecuting,prophecies,polyester,petals,persuasion,paddles,o'leary,nuthin,neighbour,negroes,muster,meningitis,matron,lockers,letterman,legged,indictment,hypnotized,housekeeping,hopelessly,hallucinations,grader,goldilocks,girly,flask,envelopes,downside,doves,dissolve,discourage,disapprove,diabetic,deliveries,decorator,crossfire,criminally,containment,comrades,complimentary,chatter,catchy,cashier,cartel,caribou,cardiologist,brawl,booted,barbershop,aryan,angst,administer,zellie,wreak,whistles,vandalism,vamps,uterus,upstate,unstoppable,understudy,tristin,transcript,tranquilizer,toxins,tonsils,stempel,spotting,spectator,spatula,softer,snotty,slinging,showered,sexiest,sensual,sadder,rimbaud,restrain,resilient,remission,reinstate,rehash,recollection,rabies,popsicle,plausible,pediatric,patronizing,ostrich,ortolani,oooooh,omelette,mistrial,marseilles,loophole,laughin,kevvy,irritated,infidelity,hypothermia,horrific,groupie,grinding,graceful,goodspeed,gestures,frantic,extradition,echelon,disks,dawnie,dared,damsel,curled,collateral,collage,chant,calculating,bumping,bribes,boardwalk,blinds,blindly,bleeds,bickering,beasts,backside,avenge,apprehended,anguish,abusing,youthful,yells,yanking,whomever,when'd,vomiting,vengeful,unpacking,unfamiliar,undying,tumble,trolls,treacherous,tipping,tantrum,tanked,summons,straps,stomped,stinkin,stings,staked,squirrels,sprinkles,speculate,sorting,skinned,sicko,sicker,shootin,shatter,seeya,schnapps,s'posed,ronee,respectful,regroup,regretting,reeling,reckoned,ramifications,puddy,projections,preschool,plissken,platonic,permalash,outdone,outburst,mutants,mugging,misfortune,miserably,miraculously,medications,margaritas,manpower,lovemaking,logically,leeches,latrine,kneel,inflict,impostor,hypocrisy,hippies,heterosexual,heightened,hecuba,healer,gunned,grooming,groin,gooey,gloomy,frying,friendships,fredo,firepower,fathom,exhaustion,evils,endeavor,eggnog,dreaded,d'arcy,crotch,coughing,coronary,cookin,consummate,congrats,companionship,caved,caspar,bulletproof,brilliance,breakin,brash,blasting,aloud,airtight,advising,advertise,adultery,aches,wronged,upbeat,trillion,thingies,tending,tarts,surreal,specs,specialize,spade,shrew,shaping,selves,schoolwork,roomie,recuperating,rabid,quart,provocative,proudly,pretenses,prenatal,pharmaceuticals,pacing,overworked,originals,nicotine,murderous,mileage,mayonnaise,massages,losin,interrogated,injunction,impartial,homing,heartbreaker,hacks,glands,giver,fraizh,flips,flaunt,englishman,electrocuted,dusting,ducking,drifted,donating,cylon,crutches,crates,cowards,comfortably,chummy,chitchat,childbirth,businesswoman,brood,blatant,bethy,barring,bagged,awakened,asbestos,airplanes,worshipped,winnings,why're,visualize,unprotected,unleash,trays,thicker,therapists,takeoff,streisand,storeroom,stethoscope,stacked,spiteful,sneaks,snapping,slaughtered,slashed,simplest,silverware,shits,secluded,scruples,scrubs,scraps,ruptured,roaring,receptionist,recap,raditch,radiator,pushover,plastered,pharmacist,perverse,perpetrator,ornament,ointment,nineties,napping,nannies,mousse,moors,momentary,misunderstandings,manipulator,malfunction,laced,kivar,kickin,infuriating,impressionable,holdup,hires,hesitated,headphones,hammering,groundwork,grotesque,graces,gauze,gangsters,frivolous,freeing,fours,forwarding,ferrars,faulty,fantasizing,extracurricular,empathy,divorces,detonate,depraved,demeaning,deadlines,dalai,cursing,cufflink,crows,coupons,comforted,claustrophobic,casinos,camped,busboy,bluth,bennetts,baskets,attacker,aplastic,angrier,affectionate,zapped,wormhole,weaken,unrealistic,unravel,unimportant,unforgettable,twain,suspend,superbowl,stutter,stewardess,stepson,standin,spandex,souvenirs,sociopath,skeletons,shivering,sexier,selfishness,scrapbook,ritalin,ribbons,reunite,remarry,relaxation,rattling,rapist,psychosis,prepping,poses,pleasing,pisses,piling,persecuted,padded,operatives,negotiator,natty,menopause,mennihan,martimmys,loyalties,laynie,lando,justifies,intimately,inexperienced,impotent,immortality,horrors,hooky,hinges,heartbreaking,handcuffed,gypsies,guacamole,grovel,graziella,goggles,gestapo,fussy,ferragamo,feeble,eyesight,explosions,experimenting,enchanting,doubtful,dizziness,dismantle,detectors,deserving,defective,dangling,dancin,crumble,creamed,cramping,conceal,clockwork,chrissakes,chrissake,chopping,cabinets,brooding,bonfire,blurt,bloated,blackmailer,beforehand,bathed,bathe,barcode,banish,badges,babble,await,attentive,aroused,antibodies,animosity,ya'll,wrinkled,wonderland,willed,whisk,waltzing,waitressing,vigilant,upbringing,unselfish,uncles,trendy,trajectory,striped,stamina,stalled,staking,stacks,spoils,snuff,snooty,snide,shrinking,senora,secretaries,scoundrel,saline,salads,rundown,riddles,relapse,recommending,raspberry,plight,pecan,pantry,overslept,ornaments,niner,negligent,negligence,nailing,mucho,mouthed,monstrous,malpractice,lowly,loitering,logged,lingering,lettin,lattes,kamal,juror,jillefsky,jacked,irritate,intrusion,insatiable,infect,impromptu,icing,hmmmm,hefty,gasket,frightens,flapping,firstborn,faucet,estranged,envious,dopey,doesn,disposition,disposable,disappointments,dipped,dignified,deceit,dealership,deadbeat,curses,coven,counselors,concierge,clutches,casbah,callous,cahoots,brotherly,britches,brides,bethie,beige,autographed,attendants,attaboy,astonishing,appreciative,antibiotic,aneurysm,afterlife,affidavit,zoning,whats,whaddaya,vasectomy,unsuspecting,toula,topanga,tonio,toasted,tiring,terrorized,tenderness,tailing,sweats,suffocated,sucky,subconsciously,starvin,sprouts,spineless,sorrows,snowstorm,smirk,slicery,sledding,slander,simmer,signora,sigmund,seventies,sedate,scented,sandals,rollers,retraction,resigning,recuperate,receptive,racketeering,queasy,provoking,priors,prerogative,premed,pinched,pendant,outsiders,orbing,opportunist,olanov,neurologist,nanobot,mommies,molested,misread,mannered,laundromat,intercom,inspect,insanely,infatuation,indulgent,indiscretion,inconsiderate,hurrah,howling,herpes,hasta,harassed,hanukkah,groveling,groosalug,gander,galactica,futile,fridays,flier,fixes,exploiting,exorcism,evasive,endorse,emptied,dreary,dreamy,downloaded,dodged,doctored,disobeyed,disneyland,disable,dehydrated,contemplating,coconuts,cockroaches,clogged,chilling,chaperon,cameraman,bulbs,bucklands,bribing,brava,bracelets,bowels,bluepoint,appetizers,appendix,antics,anointed,analogy,almonds,yammering,winch,weirdness,wangler,vibrations,vendor,unmarked,unannounced,twerp,trespass,travesty,transfusion,trainee,towelie,tiresome,straightening,staggering,sonar,socializing,sinus,sinners,shambles,serene,scraped,scones,scepter,sarris,saberhagen,ridiculously,ridicule,rents,reconciled,radios,publicist,pubes,prune,prude,precrime,postponing,pluck,perish,peppermint,peeled,overdo,nutshell,nostalgic,mulan,mouthing,mistook,meddle,maybourne,martimmy,lobotomy,livelihood,lippman,likeness,kindest,kaffee,jocks,jerked,jeopardizing,jazzed,insured,inquisition,inhale,ingenious,holier,helmets,heirloom,heinous,haste,harmsway,hardship,hanky,gutters,gruesome,groping,goofing,godson,glare,finesse,figuratively,ferrie,endangerment,dreading,dozed,dorky,dmitri,divert,discredit,dialing,cufflinks,crutch,craps,corrupted,cocoon,cleavage,cannery,bystander,brushes,bruising,bribery,brainstorm,bolted,binge,ballistics,astute,arroway,adventurous,adoptive,addicts,addictive,yadda,whitelighters,wematanye,weeds,wedlock,wallets,vulnerability,vroom,vents,upped,unsettling,unharmed,trippin,trifle,tracing,tormenting,thats,syphilis,subtext,stickin,spices,sores,smacked,slumming,sinks,signore,shitting,shameful,shacked,septic,seedy,righteousness,relish,rectify,ravishing,quickest,phoebs,perverted,peeing,pedicure,pastrami,passionately,ozone,outnumbered,oregano,offender,nukes,nosed,nighty,nifty,mounties,motivate,moons,misinterpreted,mercenary,mentality,marsellus,lupus,lumbar,lovesick,lobsters,leaky,laundering,latch,jafar,instinctively,inspires,indoors,incarcerated,hundredth,handkerchief,gynecologist,guittierez,groundhog,grinning,goodbyes,geese,fullest,eyelashes,eyelash,enquirer,endlessly,elusive,disarm,detest,deluding,dangle,cotillion,corsage,conjugal,confessional,cones,commandment,coded,coals,chuckle,christmastime,cheeseburgers,chardonnay,celery,campfire,calming,burritos,brundle,broflovski,brighten,borderline,blinked,bling,beauties,bauers,battered,articulate,alienated,ahhhhh,agamemnon,accountants,y'see,wrongful,wrapper,workaholic,winnebago,whispered,warts,vacate,unworthy,unanswered,tonane,tolerated,throwin,throbbing,thrills,thorns,thereof,there've,tarot,sunscreen,stretcher,stereotype,soggy,sobbing,sizable,sightings,shucks,shrapnel,sever,senile,seaboard,scorned,saver,rebellious,rained,putty,prenup,pores,pinching,pertinent,peeping,paints,ovulating,opposites,occult,nutcracker,nutcase,newsstand,newfound,mocked,midterms,marshmallow,marbury,maclaren,leans,krudski,knowingly,keycard,junkies,juilliard,jolinar,irritable,invaluable,inuit,intoxicating,instruct,insolent,inexcusable,incubator,illustrious,hunsecker,houseguest,homosexuals,homeroom,hernia,harming,handgun,hallways,hallucination,gunshots,groupies,groggy,goiter,gingerbread,giggling,frigging,fledged,fedex,fairies,exchanging,exaggeration,esteemed,enlist,drags,dispense,disloyal,disconnect,desks,dentists,delacroix,degenerate,daydreaming,cushions,cuddly,corroborate,complexion,compensated,cobbler,closeness,chilled,checkmate,channing,carousel,calms,bylaws,benefactor,ballgame,baiting,backstabbing,artifact,airspace,adversary,actin,accuses,accelerant,abundantly,abstinence,zissou,zandt,yapping,witchy,willows,whadaya,vilandra,veiled,undress,undivided,underestimating,ultimatums,twirl,truckload,tremble,toasting,tingling,tents,tempered,sulking,stunk,sponges,spills,softly,snipers,scourge,rooftop,riana,revolting,revisit,refreshments,redecorating,recapture,raysy,pretense,prejudiced,precogs,pouting,poofs,pimple,piles,pediatrician,padre,packets,paces,orvelle,oblivious,objectivity,nighttime,nervosa,mexicans,meurice,melts,matchmaker,maeby,lugosi,lipnik,leprechaun,kissy,kafka,introductions,intestines,inspirational,insightful,inseparable,injections,inadvertently,hussy,huckabees,hittin,hemorrhaging,headin,haystack,hallowed,grudges,granilith,grandkids,grading,gracefully,godsend,gobbles,fragrance,fliers,finchley,farts,eyewitnesses,expendable,existential,dorms,delaying,degrading,deduction,darlings,danes,cylons,counsellor,contraire,consciously,conjuring,congratulating,cokes,buffay,brooch,bitching,bistro,bijou,bewitched,benevolent,bends,bearings,barren,aptitude,amish,amazes,abomination,worldly,whispers,whadda,wayward,wailing,vanishing,upscale,untouchable,unspoken,uncontrollable,unavoidable,unattended,trite,transvestite,toupee,timid,timers,terrorizing,swana,stumped,strolling,storybook,storming,stomachs,stoked,stationery,springtime,spontaneity,spits,spins,soaps,sentiments,scramble,scone,rooftops,retract,reflexes,rawdon,ragged,quirky,quantico,psychologically,prodigal,pounce,potty,pleasantries,pints,petting,perceive,onstage,notwithstanding,nibble,newmans,neutralize,mutilated,millionaires,mayflower,masquerade,mangy,macreedy,lunatics,lovable,locating,limping,lasagna,kwang,keepers,juvie,jaded,ironing,intuitive,intensely,insure,incantation,hysteria,hypnotize,humping,happenin,griet,grasping,glorified,ganging,g'night,focker,flunking,flimsy,flaunting,fixated,fitzwallace,fainting,eyebrow,exonerated,ether,electrician,egotistical,earthly,dusted,dignify,detonation,debrief,dazzling,dan'l,damnedest,daisies,crushes,crucify,contraband,confronting,collapsing,cocked,clicks,cliche,circled,chandelier,carburetor,callers,broads,breathes,bloodshed,blindsided,blabbing,bialystock,bashing,ballerina,aviva,arteries,anomaly,airstrip,agonizing,adjourn,aaaaa,yearning,wrecker,witnessing,whence,warhead,unsure,unheard,unfreeze,unfold,unbalanced,ugliest,troublemaker,toddler,tiptoe,threesome,thirties,thermostat,swipe,surgically,subtlety,stung,stumbling,stubs,stride,strangling,sprayed,socket,smuggled,showering,shhhhh,sabotaging,rumson,rounding,risotto,repairman,rehearsed,ratty,ragging,radiology,racquetball,racking,quieter,quicksand,prowl,prompt,premeditated,prematurely,prancing,porcupine,plated,pinocchio,peeked,peddle,panting,overweight,overrun,outing,outgrown,obsess,nursed,nodding,negativity,negatives,musketeers,mugger,motorcade,merrily,matured,masquerading,marvellous,maniacs,lovey,louse,linger,lilies,lawful,kudos,knuckle,juices,judgments,itches,intolerable,intermission,inept,incarceration,implication,imaginative,huckleberry,holster,heartburn,gunna,groomed,graciously,fulfillment,fugitives,forsaking,forgives,foreseeable,flavors,flares,fixation,fickle,fantasize,famished,fades,expiration,exclamation,erasing,eiffel,eerie,earful,duped,dulles,dissing,dissect,dispenser,dilated,detergent,desdemona,debriefing,damper,curing,crispina,crackpot,courting,cordial,conflicted,comprehension,commie,cleanup,chiropractor,charmer,chariot,cauldron,catatonic,bullied,buckets,brilliantly,breathed,booths,boardroom,blowout,blindness,blazing,biologically,bibles,biased,beseech,barbaric,balraj,audacity,anticipating,alcoholics,airhead,agendas,admittedly,absolution,youre,yippee,wittlesey,withheld,willful,whammy,weakest,washes,virtuous,videotapes,vials,unplugged,unpacked,unfairly,turbulence,tumbling,tricking,tremendously,traitors,torches,tinga,thyroid,teased,tawdry,taker,sympathies,swiped,sundaes,suave,strut,stepdad,spewing,spasm,socialize,slither,simulator,shutters,shrewd,shocks,semantics,schizophrenic,scans,savages,rya'c,runny,ruckus,royally,roadblocks,rewriting,revoke,repent,redecorate,recovers,recourse,ratched,ramali,racquet,quince,quiche,puppeteer,puking,puffed,problemo,praises,pouch,postcards,pooped,poised,piled,phoney,phobia,patching,parenthood,pardner,oozing,ohhhhh,numbing,nostril,nosey,neatly,nappa,nameless,mortuary,moronic,modesty,midwife,mcclane,matuka,maitre,lumps,lucid,loosened,loins,lawnmower,lamotta,kroehner,jinxy,jessep,jamming,jailhouse,jacking,intruders,inhuman,infatuated,indigestion,implore,implanted,hormonal,hoboken,hillbilly,heartwarming,headway,hatched,hartmans,harping,grapevine,gnome,forties,flyin,flirted,fingernail,exhilarating,enjoyment,embark,dumper,dubious,drell,docking,disillusioned,dishonor,disbarred,dicey,custodial,counterproductive,corned,cords,contemplate,concur,conceivable,cobblepot,chickened,checkout,carpe,cap'n,campers,buyin,bullies,braid,boxed,bouncy,blueberries,blubbering,bloodstream,bigamy,beeped,bearable,autographs,alarming,wretch,wimps,widower,whirlwind,whirl,warms,vandelay,unveiling,undoing,unbecoming,turnaround,touche,togetherness,tickles,ticker,teensy,taunt,sweethearts,stitched,standpoint,staffers,spotless,soothe,smothered,sickening,shouted,shepherds,shawl,seriousness,schooled,schoolboy,s'mores,roped,reminders,raggedy,preemptive,plucked,pheromones,particulars,pardoned,overpriced,overbearing,outrun,ohmigod,nosing,nicked,neanderthal,mosquitoes,mortified,milky,messin,mecha,markinson,marivellas,mannequin,manderley,madder,macready,lookie,locusts,lifetimes,lanna,lakhi,kholi,impersonate,hyperdrive,horrid,hopin,hogging,hearsay,harpy,harboring,hairdo,hafta,grasshopper,gobble,gatehouse,foosball,floozy,fished,firewood,finalize,felons,euphemism,entourage,elitist,elegance,drokken,drier,dredge,dossier,diseased,diarrhea,diagnose,despised,defuse,d'amour,contesting,conserve,conscientious,conjured,collars,clogs,chenille,chatty,chamomile,casing,calculator,brittle,breached,blurted,birthing,bikinis,astounding,assaulting,aroma,appliance,antsy,amnio,alienating,aliases,adolescence,xerox,wrongs,workload,willona,whistling,werewolves,wallaby,unwelcome,unseemly,unplug,undermining,ugliness,tyranny,tuesdays,trumpets,transference,ticks,tangible,tagging,swallowing,superheroes,studs,strep,stowed,stomping,steffy,sprain,spouting,sponsoring,sneezing,smeared,slink,shakin,sewed,seatbelt,scariest,scammed,sanctimonious,roasting,rightly,retinal,rethinking,resented,reruns,remover,racks,purest,progressing,presidente,preeclampsia,postponement,portals,poppa,pliers,pinning,pelvic,pampered,padding,overjoyed,ooooo,one'll,octavius,nonono,nicknames,neurosurgeon,narrows,misled,mislead,mishap,milltown,milking,meticulous,mediocrity,meatballs,machete,lurch,layin,knockin,khruschev,jurors,jumpin,jugular,jeweler,intellectually,inquiries,indulging,indestructible,indebted,imitate,ignores,hyperventilating,hyenas,hurrying,hermano,hellish,heheh,harshly,handout,grunemann,glances,giveaway,getup,gerome,furthest,frosting,frail,forwarded,forceful,flavored,flammable,flaky,fingered,fatherly,ethic,embezzlement,duffel,dotted,distressed,disobey,disappearances,dinky,diminish,diaphragm,deuces,creme,courteous,comforts,coerced,clots,clarification,chunks,chickie,chases,chaperoning,cartons,caper,calves,caged,bustin,bulging,bringin,boomhauer,blowin,blindfolded,biscotti,ballplayer,bagging,auster,assurances,aschen,arraigned,anonymity,alters,albatross,agreeable,adoring,abduct,wolfi,weirded,watchers,washroom,warheads,vincennes,urgency,understandably,uncomplicated,uhhhh,twitching,treadmill,thermos,tenorman,tangle,talkative,swarm,surrendering,summoning,strive,stilts,stickers,squashed,spraying,sparring,soaring,snort,sneezed,slaps,skanky,singin,sidle,shreck,shortness,shorthand,sharper,shamed,sadist,rydell,rusik,roulette,resumes,respiration,recount,reacts,purgatory,princesses,presentable,ponytail,plotted,pinot,pigtails,phillippe,peddling,paroled,orbed,offends,o'hara,moonlit,minefield,metaphors,malignant,mainframe,magicks,maggots,maclaine,loathing,leper,leaps,leaping,lashed,larch,larceny,lapses,ladyship,juncture,jiffy,jakov,invoke,infantile,inadmissible,horoscope,hinting,hideaway,hesitating,heddy,heckles,hairline,gripe,gratifying,governess,goebbels,freddo,foresee,fascination,exemplary,executioner,etcetera,escorts,endearing,eaters,earplugs,draped,disrupting,disagrees,dimes,devastate,detain,depositions,delicacy,darklighter,cynicism,cyanide,cutters,cronus,continuance,conquering,confiding,compartments,combing,cofell,clingy,cleanse,christmases,cheered,cheekbones,buttle,burdened,bruenell,broomstick,brained,bozos,bontecou,bluntman,blazes,blameless,bizarro,bellboy,beaucoup,barkeep,awaken,astray,assailant,appease,aphrodisiac,alleys,yesss,wrecks,woodpecker,wondrous,wimpy,willpower,wheeling,weepy,waxing,waive,videotaped,veritable,untouched,unlisted,unfounded,unforeseen,twinge,triggers,traipsing,toxin,tombstone,thumping,therein,testicles,telephones,tarmac,talby,tackled,swirling,suicides,suckered,subtitles,sturdy,strangler,stockbroker,stitching,steered,standup,squeal,sprinkler,spontaneously,splendor,spiking,spender,snipe,snagged,skimming,siddown,showroom,shovels,shotguns,shoelaces,shitload,shellfish,sharpest,shadowy,seizing,scrounge,scapegoat,sayonara,saddled,rummaging,roomful,renounce,reconsidered,recharge,realistically,radioed,quirks,quadrant,punctual,practising,pours,poolhouse,poltergeist,pocketbook,plainly,picnics,pesto,pawing,passageway,partied,oneself,numero,nostalgia,nitwit,neuro,mixer,meanest,mcbeal,matinee,margate,marce,manipulations,manhunt,manger,magicians,loafers,litvack,lightheaded,lifeguard,lawns,laughingstock,ingested,indignation,inconceivable,imposition,impersonal,imbecile,huddled,housewarming,horizons,homicides,hiccups,hearse,hardened,gushing,gushie,greased,goddamit,freelancer,forging,fondue,flustered,flung,flinch,flicker,fixin,festivus,fertilizer,farted,faggots,exonerate,evict,enormously,encrypted,emdash,embracing,duress,dupres,dowser,doormat,disfigured,disciplined,dibbs,depository,deathbed,dazzled,cuttin,cures,crowding,crepe,crammed,copycat,contradict,confidant,condemning,conceited,commute,comatose,clapping,circumference,chuppah,chore,choksondik,chestnuts,briault,bottomless,bonnet,blokes,berluti,beret,beggars,bankroll,bania,athos,arsenic,apperantly,ahhhhhh,afloat,accents,zipped,zeros,zeroes,zamir,yuppie,youngsters,yorkers,wisest,wipes,wield,whyn't,weirdos,wednesdays,vicksburg,upchuck,untraceable,unsupervised,unpleasantness,unhook,unconscionable,uncalled,trappings,tragedies,townie,thurgood,things'll,thine,tetanus,terrorize,temptations,tanning,tampons,swarming,straitjacket,steroid,startling,starry,squander,speculating,sollozzo,sneaked,slugs,skedaddle,sinker,silky,shortcomings,sellin,seasoned,scrubbed,screwup,scrapes,scarves,sandbox,salesmen,rooming,romances,revere,reproach,reprieve,rearranging,ravine,rationalize,raffle,punchy,psychobabble,provocation,profoundly,prescriptions,preferable,polishing,poached,pledges,pirelli,perverts,oversized,overdressed,outdid,nuptials,nefarious,mouthpiece,motels,mopping,mongrel,missin,metaphorically,mertin,memos,melodrama,melancholy,measles,meaner,mantel,maneuvering,mailroom,luring,listenin,lifeless,licks,levon,legwork,kneecaps,kippur,kiddie,kaput,justifiable,insistent,insidious,innuendo,innit,indecent,imaginable,horseshit,hemorrhoid,hella,healthiest,haywire,hamsters,hairbrush,grouchy,grisly,gratuitous,glutton,glimmer,gibberish,ghastly,gentler,generously,geeky,fuhrer,fronting,foolin,faxes,faceless,extinguisher,expel,etched,endangering,ducked,dodgeball,dives,dislocated,discrepancy,devour,derail,dementia,daycare,cynic,crumbling,cowardice,covet,cornwallis,corkscrew,cookbook,commandments,coincidental,cobwebs,clouded,clogging,clicking,clasp,chopsticks,chefs,chaps,cashing,carat,calmer,brazen,brainwashing,bradys,bowing,boned,bloodsucking,bleachers,bleached,bedpan,bearded,barrenger,bachelors,awwww,assures,assigning,asparagus,apprehend,anecdote,amoral,aggravation,afoot,acquaintances,accommodating,yakking,worshipping,wladek,willya,willies,wigged,whoosh,whisked,watered,warpath,volts,violates,valuables,uphill,unwise,untimely,unsavory,unresponsive,unpunished,unexplained,tubby,trolling,toxicology,tormented,toothache,tingly,timmiihh,thursdays,thoreau,terrifies,temperamental,telegrams,talkie,takers,symbiote,swirl,suffocate,stupider,strapping,steckler,springing,someway,sleepyhead,sledgehammer,slant,slams,showgirl,shoveling,shmoopy,sharkbait,shan't,scrambling,schematics,sandeman,sabbatical,rummy,reykjavik,revert,responsive,rescheduled,requisition,relinquish,rejoice,reckoning,recant,rebadow,reassurance,rattlesnake,ramble,primed,pricey,prance,pothole,pocus,persist,perpetrated,pekar,peeling,pastime,parmesan,pacemaker,overdrive,ominous,observant,nothings,noooooo,nonexistent,nodded,nieces,neglecting,nauseating,mutated,musket,mumbling,mowing,mouthful,mooseport,monologue,mistrust,meetin,masseuse,mantini,mailer,madre,lowlifes,locksmith,livid,liven,limos,liberating,lhasa,leniency,leering,laughable,lashes,lasagne,laceration,korben,katan,kalen,jittery,jammies,irreplaceable,intubate,intolerant,inhaler,inhaled,indifferent,indifference,impound,impolite,humbly,heroics,heigh,guillotine,guesthouse,grounding,grips,gossiping,goatee,gnomes,gellar,frutt,frobisher,freudian,foolishness,flagged,femme,fatso,fatherhood,fantasized,fairest,faintest,eyelids,extravagant,extraterrestrial,extraordinarily,escalator,elevate,drivel,dissed,dismal,disarray,dinnertime,devastation,dermatologist,delicately,defrost,debutante,debacle,damone,dainty,cuvee,culpa,crucified,creeped,crayons,courtship,convene,congresswoman,concocted,compromises,comprende,comma,coleslaw,clothed,clinically,chickenshit,checkin,cesspool,caskets,calzone,brothel,boomerang,bodega,blasphemy,bitsy,bicentennial,berlini,beatin,beards,barbas,barbarians,backpacking,arrhythmia,arousing,arbitrator,antagonize,angling,anesthetic,altercation,aggressor,adversity,acathla,aaahhh,wreaking,workup,wonderin,wither,wielding,what'm,what'cha,waxed,vibrating,veterinarian,venting,vasey,valor,validate,upholstery,untied,unscathed,uninterrupted,unforgiving,undies,uncut,twinkies,tucking,treatable,treasured,tranquility,townspeople,torso,tomei,tipsy,tinsel,tidings,thirtieth,tantrums,tamper,talky,swayed,swapping,suitor,stylist,stirs,standoff,sprinklers,sparkly,snobby,snatcher,smoother,sleepin,shrug,shoebox,sheesh,shackles,setbacks,sedatives,screeching,scorched,scanned,satyr,roadblock,riverbank,ridiculed,resentful,repellent,recreate,reconvene,rebuttal,realmedia,quizzes,questionnaire,punctured,pucker,prolong,professionalism,pleasantly,pigsty,penniless,paychecks,patiently,parading,overactive,ovaries,orderlies,oracles,oiled,offending,nudie,neonatal,neighborly,moops,moonlighting,mobilize,mmmmmm,milkshake,menial,meats,mayan,maxed,mangled,magua,lunacy,luckier,liters,lansbury,kooky,knowin,jeopardized,inkling,inhalation,inflated,infecting,incense,inbound,impractical,impenetrable,idealistic,i'mma,hypocrites,hurtin,humbled,hologram,hokey,hocus,hitchhiking,hemorrhoids,headhunter,hassled,harts,hardworking,haircuts,hacksaw,genitals,gazillion,gammy,gamesphere,fugue,footwear,folly,flashlights,fives,filet,extenuating,estrogen,entails,embezzled,eloquent,egomaniac,ducts,drowsy,drones,doree,donovon,disguises,diggin,deserting,depriving,defying,deductible,decorum,decked,daylights,daybreak,dashboard,damnation,cuddling,crunching,crickets,crazies,councilman,coughed,conundrum,complimented,cohaagen,clutching,clued,clader,cheques,checkpoint,chats,channeling,ceases,carasco,capisce,cantaloupe,cancelling,campsite,burglars,breakfasts,bra'tac,blueprint,bleedin,blabbed,beneficiary,basing,avert,atone,arlyn,approves,apothecary,antiseptic,aleikuum,advisement,zadir,wobbly,withnail,whattaya,whacking,wedged,wanders,vaginal,unimaginable,undeniable,unconditionally,uncharted,unbridled,tweezers,tvmegasite,trumped,triumphant,trimming,treading,tranquilizers,toontown,thunk,suture,suppressing,strays,stonewall,stogie,stepdaughter,stace,squint,spouses,splashed,speakin,sounder,sorrier,sorrel,sombrero,solemnly,softened,snobs,snippy,snare,smoothing,slump,slimeball,slaving,silently,shiller,shakedown,sensations,scrying,scrumptious,screamin,saucy,santoses,roundup,roughed,rosary,robechaux,retrospect,rescind,reprehensible,repel,remodeling,reconsidering,reciprocate,railroaded,psychics,promos,prob'ly,pristine,printout,priestess,prenuptial,precedes,pouty,phoning,peppy,pariah,parched,panes,overloaded,overdoing,nymphs,nother,notebooks,nearing,nearer,monstrosity,milady,mieke,mephesto,medicated,marshals,manilow,mammogram,m'lady,lotsa,loopy,lesion,lenient,learner,laszlo,kross,kinks,jinxed,involuntary,insubordination,ingrate,inflatable,incarnate,inane,hypoglycemia,huntin,humongous,hoodlum,honking,hemorrhage,helpin,hathor,hatching,grotto,grandmama,gorillas,godless,girlish,ghouls,gershwin,frosted,flutter,flagpole,fetching,fatter,faithfully,exert,evasion,escalate,enticing,enchantress,elopement,drills,downtime,downloading,dorks,doorways,divulge,dissociative,disgraceful,disconcerting,deteriorate,destinies,depressive,dented,denim,decruz,decidedly,deactivate,daydreams,curls,culprit,cruelest,crippling,cranberries,corvis,copped,commend,coastguard,cloning,cirque,churning,chock,chivalry,catalogues,cartwheels,carols,canister,buttered,bundt,buljanoff,bubbling,brokers,broaden,brimstone,brainless,bores,badmouthing,autopilot,ascertain,aorta,ampata,allenby,accosted,absolve,aborted,aaagh,aaaaaah,yonder,yellin,wyndham,wrongdoing,woodsboro,wigging,wasteland,warranty,waltzed,walnuts,vividly,veggie,unnecessarily,unloaded,unicorns,understated,unclean,umbrellas,twirling,turpentine,tupperware,triage,treehouse,tidbit,tickled,threes,thousandth,thingie,terminally,teething,tassel,talkies,swoon,switchboard,swerved,suspiciously,subsequentlyne,subscribe,strudel,stroking,strictest,stensland,starin,stannart,squirming,squealing,sorely,softie,snookums,sniveling,smidge,sloth,skulking,simian,sightseeing,siamese,shudder,shoppers,sharpen,shannen,semtex,secondhand,seance,scowl,scorn,safekeeping,russe,rummage,roshman,roomies,roaches,rinds,retrace,retires,resuscitate,rerun,reputations,rekall,refreshment,reenactment,recluse,ravioli,raves,raking,purses,punishable,punchline,puked,prosky,previews,poughkeepsie,poppins,polluted,placenta,pissy,petulant,perseverance,pears,pawns,pastries,partake,panky,palate,overzealous,orchids,obstructing,objectively,obituaries,obedient,nothingness,musty,motherly,mooning,momentous,mistaking,minutemen,milos,microchip,meself,merciless,menelaus,mazel,masturbate,mahogany,lysistrata,lillienfield,likable,liberate,leveled,letdown,larynx,lardass,lainey,lagged,klorel,kidnappings,keyed,karmic,jeebies,irate,invulnerable,intrusive,insemination,inquire,injecting,informative,informants,impure,impasse,imbalance,illiterate,hurled,hunts,hematoma,headstrong,handmade,handiwork,growling,gorky,getcha,gesundheit,gazing,galley,foolishly,fondness,floris,ferocious,feathered,fateful,fancies,fakes,faker,expire,ever'body,essentials,eskimos,enlightening,enchilada,emissary,embolism,elsinore,ecklie,drenched,drazi,doped,dogging,doable,dislikes,dishonesty,disengage,discouraging,derailed,deformed,deflect,defer,deactivated,crips,constellations,congressmen,complimenting,clubbing,clawing,chromium,chimes,chews,cheatin,chaste,cellblock,caving,catered,catacombs,calamari,bucking,brulee,brits,brisk,breezes,bounces,boudoir,binks,better'n,bellied,behrani,behaves,bedding,balmy,badmouth,backers,avenging,aromatherapy,armpit,armoire,anythin,anonymously,anniversaries,aftershave,affliction,adrift,admissible,adieu,acquittal,yucky,yearn,whitter,whirlpool,wendigo,watchdog,wannabes,wakey,vomited,voicemail,valedictorian,uttered,unwed,unrequited,unnoticed,unnerving,unkind,unjust,uniformed,unconfirmed,unadulterated,unaccounted,uglier,turnoff,trampled,tramell,toads,timbuktu,throwback,thimble,tasteless,tarantula,tamale,takeovers,swish,supposing,streaking,stargher,stanzi,stabs,squeamish,splattered,spiritually,spilt,speciality,smacking,skywire,skips,skaara,simpatico,shredding,showin,shortcuts,shite,shielding,shamelessly,serafine,sentimentality,seasick,schemer,scandalous,sainted,riedenschneider,rhyming,revel,retractor,retards,resurrect,remiss,reminiscing,remanded,reiben,regains,refuel,refresher,redoing,redheaded,reassured,rearranged,rapport,qumar,prowling,prejudices,precarious,powwow,pondering,plunger,plunged,pleasantville,playpen,phlegm,perfected,pancreas,paley,ovary,outbursts,oppressed,ooohhh,omoroca,offed,o'toole,nurture,nursemaid,nosebleed,necktie,muttering,munchies,mucking,mogul,mitosis,misdemeanor,miscarried,millionth,migraines,midler,manicurist,mandelbaum,manageable,malfunctioned,magnanimous,loudmouth,longed,lifestyles,liddy,lickety,leprechauns,komako,klute,kennel,justifying,irreversible,inventing,intergalactic,insinuate,inquiring,ingenuity,inconclusive,incessant,improv,impersonation,hyena,humperdinck,hubba,housework,hoffa,hither,hissy,hippy,hijacked,heparin,hellooo,hearth,hassles,hairstyle,hahahaha,hadda,guys'll,gutted,gulls,gritty,grievous,graft,gossamer,gooder,gambled,gadgets,fundamentals,frustrations,frolicking,frock,frilly,foreseen,footloose,fondly,flirtation,flinched,flatten,farthest,exposer,evading,escrow,empathize,embryos,embodiment,ellsberg,ebola,dulcinea,dreamin,drawbacks,doting,doose,doofy,disturbs,disorderly,disgusts,detox,denominator,demeanor,deliriously,decode,debauchery,croissant,cravings,cranked,coworkers,councilor,confuses,confiscate,confines,conduit,compress,combed,clouding,clamps,cinch,chinnery,celebratory,catalogs,carpenters,carnal,canin,bundys,bulldozer,buggers,bueller,brainy,booming,bookstores,bloodbath,bittersweet,bellhop,beeping,beanstalk,beady,baudelaire,bartenders,bargains,averted,armadillo,appreciating,appraised,antlers,aloof,allowances,alleyway,affleck,abject,zilch,youore,xanax,wrenching,wouldn,witted,wicca,whorehouse,whooo,whips,vouchers,victimized,vicodin,untested,unsolicited,unfocused,unfettered,unfeeling,unexplainable,understaffed,underbelly,tutorial,tryst,trampoline,towering,tirade,thieving,thang,swimmin,swayzak,suspecting,superstitions,stubbornness,streamers,strattman,stonewalling,stiffs,stacking,spout,splice,sonrisa,smarmy,slows,slicing,sisterly,shrill,shined,seeming,sedley,seatbelts,scour,scold,schoolyard,scarring,salieri,rustling,roxbury,rewire,revved,retriever,reputable,remodel,reins,reincarnation,rance,rafters,rackets,quail,pumbaa,proclaim,probing,privates,pried,prewedding,premeditation,posturing,posterity,pleasurable,pizzeria,pimps,penmanship,penchant,pelvis,overturn,overstepped,overcoat,ovens,outsmart,outed,ooohh,oncologist,omission,offhand,odour,nyazian,notarized,nobody'll,nightie,navel,nabbed,mystique,mover,mortician,morose,moratorium,mockingbird,mobsters,mingling,methinks,messengered,merde,masochist,martouf,martians,marinara,manray,majorly,magnifying,mackerel,lurid,lugging,lonnegan,loathsome,llantano,liberace,leprosy,latinos,lanterns,lamest,laferette,kraut,intestine,innocencia,inhibitions,ineffectual,indisposed,incurable,inconvenienced,inanimate,improbable,implode,hydrant,hustling,hustled,huevos,how'm,hooey,hoods,honcho,hinge,hijack,heimlich,hamunaptra,haladki,haiku,haggle,gutsy,grunting,grueling,gribbs,greevy,grandstanding,godparents,glows,glistening,gimmick,gaping,fraiser,formalities,foreigner,folders,foggy,fitty,fiends,fe'nos,favours,eyeing,extort,expedite,escalating,epinephrine,entitles,entice,eminence,eights,earthlings,eagerly,dunville,dugout,doublemeat,doling,dispensing,dispatcher,discoloration,diners,diddly,dictates,diazepam,derogatory,delights,defies,decoder,dealio,danson,cutthroat,crumbles,croissants,crematorium,craftsmanship,could'a,cordless,cools,conked,confine,concealing,complicates,communique,cockamamie,coasters,clobbered,clipping,clipboard,clemenza,cleanser,circumcision,chanukah,certainaly,cellmate,cancels,cadmium,buzzed,bumstead,bucko,browsing,broth,braver,boggling,bobbing,blurred,birkhead,benet,belvedere,bellies,begrudge,beckworth,banky,baldness,baggy,babysitters,aversion,astonished,assorted,appetites,angina,amiss,ambulances,alibis,airway,admires,adhesive,yoyou,xxxxxx,wreaked,wracking,woooo,wooing,wised,wilshire,wedgie,waging,violets,vincey,uplifting,untrustworthy,unmitigated,uneventful,undressing,underprivileged,unburden,umbilical,tweaking,turquoise,treachery,tosses,torching,toothpick,toasts,thickens,tereza,tenacious,teldar,taint,swill,sweatin,subtly,subdural,streep,stopwatch,stockholder,stillwater,stalkers,squished,squeegee,splinters,spliced,splat,spied,spackle,sophistication,snapshots,smite,sluggish,slithered,skeeters,sidewalks,sickly,shrugs,shrubbery,shrieking,shitless,settin,sentinels,selfishly,scarcely,sangria,sanctum,sahjhan,rustle,roving,rousing,rosomorf,riddled,responsibly,renoir,remoray,remedial,refundable,redirect,recheck,ravenwood,rationalizing,ramus,ramelle,quivering,pyjamas,psychos,provocations,prouder,protestors,prodded,proctologist,primordial,pricks,prickly,precedents,pentangeli,pathetically,parka,parakeet,panicky,overthruster,outsmarted,orthopedic,oncoming,offing,nutritious,nuthouse,nourishment,nibbling,newlywed,narcissist,mutilation,mundane,mummies,mumble,mowed,morvern,mortem,mopes,molasses,misplace,miscommunication,miney,midlife,menacing,memorizing,massaging,masking,magnets,luxuries,lounging,lothario,liposuction,lidocaine,libbets,levitate,leeway,launcelot,larek,lackeys,kumbaya,kryptonite,knapsack,keyhole,katarangura,juiced,jakey,ironclad,invoice,intertwined,interlude,interferes,injure,infernal,indeedy,incur,incorrigible,incantations,impediment,igloo,hysterectomy,hounded,hollering,hindsight,heebie,havesham,hasenfuss,hankering,hangers,hakuna,gutless,gusto,grubbing,grrrr,grazed,gratification,grandeur,gorak,godammit,gnawing,glanced,frostbite,frees,frazzled,fraulein,fraternizing,fortuneteller,formaldehyde,followup,foggiest,flunky,flickering,firecrackers,figger,fetuses,fates,eyeliner,extremities,extradited,expires,exceedingly,evaporate,erupt,epileptic,entrails,emporium,egregious,eggshells,easing,duwayne,droll,dreyfuss,dovey,doubly,doozy,donkeys,donde,distrust,distressing,disintegrate,discreetly,decapitated,dealin,deader,dashed,darkroom,dares,daddies,dabble,cushy,cupcakes,cuffed,croupier,croak,crapped,coursing,coolers,contaminate,consummated,construed,condos,concoction,compulsion,commish,coercion,clemency,clairvoyant,circulate,chesterton,checkered,charlatan,chaperones,categorically,cataracts,carano,capsules,capitalize,burdon,bullshitting,brewed,breathless,breasted,brainstorming,bossing,borealis,bonsoir,bobka,boast,blimp,bleep,bleeder,blackouts,bisque,billboards,beatings,bayberry,bashed,bamboozled,balding,baklava,baffled,backfires,babak,awkwardness,attest,attachments,apologizes,anyhoo,antiquated,alcante,advisable,aahhh,aaahh,zatarc,yearbooks,wuddya,wringing,womanhood,witless,winging,whatsa,wetting,waterproof,wastin,vogelman,vocation,vindicated,vigilance,vicariously,venza,vacuuming,utensils,uplink,unveil,unloved,unloading,uninhibited,unattached,tweaked,turnips,trinkets,toughen,toting,topside,terrors,terrify,technologically,tarnish,tagliati,szpilman,surly,supple,summation,suckin,stepmom,squeaking,splashmore,souffle,solitaire,solicitation,solarium,smokers,slugged,slobbering,skylight,skimpy,sinuses,silenced,sideburns,shrinkage,shoddy,shhhhhh,shelled,shareef,shangri,seuss,serenade,scuffle,scoff,scanners,sauerkraut,sardines,sarcophagus,salvy,rusted,russells,rowboat,rolfsky,ringside,respectability,reparations,renegotiate,reminisce,reimburse,regimen,raincoat,quibble,puzzled,purposefully,pubic,proofing,prescribing,prelim,poisons,poaching,personalized,personable,peroxide,pentonville,payphone,payoffs,paleontology,overflowing,oompa,oddest,objecting,o'hare,o'daniel,notches,nobody'd,nightstand,neutralized,nervousness,nerdy,needlessly,naquadah,nappy,nantucket,nambla,mountaineer,motherfuckin,morrie,monopolizing,mohel,mistreated,misreading,misbehave,miramax,minivan,milligram,milkshakes,metamorphosis,medics,mattresses,mathesar,matchbook,matata,marys,malucci,magilla,lymphoma,lowers,lordy,linens,lindenmeyer,limelight,leapt,laxative,lather,lapel,lamppost,laguardia,kindling,kegger,kawalsky,juries,jokin,jesminder,interning,innermost,injun,infallible,industrious,indulgence,incinerator,impossibility,impart,illuminate,iguanas,hypnotic,hyped,hospitable,hoses,homemaker,hirschmuller,helpers,headset,guardianship,guapo,grubby,granola,granddaddy,goren,goblet,gluttony,globes,giorno,getter,geritol,gassed,gaggle,foxhole,fouled,foretold,floorboards,flippers,flaked,fireflies,feedings,fashionably,farragut,fallback,facials,exterminate,excites,everything'll,evenin,ethically,ensue,enema,empath,eluded,eloquently,eject,edema,dumpling,droppings,dolled,distasteful,disputing,displeasure,disdain,deterrent,dehydration,defied,decomposing,dawned,dailies,custodian,crusts,crucifix,crowning,crier,crept,craze,crawls,couldn,correcting,corkmaster,copperfield,cooties,contraption,consumes,conspire,consenting,consented,conquers,congeniality,complains,communicator,commendable,collide,coladas,colada,clout,clooney,classifieds,clammy,civility,cirrhosis,chink,catskills,carvers,carpool,carelessness,cardio,carbs,capades,butabi,busmalis,burping,burdens,bunks,buncha,bulldozers,browse,brockovich,breakthroughs,bravado,boogety,blossoms,blooming,bloodsucker,blight,betterton,betrayer,belittle,beeps,bawling,barts,bartending,bankbooks,babish,atropine,assertive,armbrust,anyanka,annoyance,anemic,anago,airwaves,aimlessly,aaargh,aaand,yoghurt,writhing,workable,winking,winded,widen,whooping,whiter,whatya,wazoo,voila,virile,vests,vestibule,versed,vanishes,urkel,uproot,unwarranted,unscheduled,unparalleled,undergrad,tweedle,turtleneck,turban,trickery,transponder,toyed,townhouse,thyself,thunderstorm,thinning,thawed,tether,technicalities,tau'ri,tarnished,taffeta,tacked,systolic,swerve,sweepstakes,swabs,suspenders,superwoman,sunsets,succulent,subpoenas,stumper,stosh,stomachache,stewed,steppin,stepatech,stateside,spicoli,sparing,soulless,sonnets,sockets,snatching,smothering,slush,sloman,slashing,sitters,simpleton,sighs,sidra,sickens,shunned,shrunken,showbiz,shopped,shimmering,shagging,semblance,segue,sedation,scuzzlebutt,scumbags,screwin,scoundrels,scarsdale,scabs,saucers,saintly,saddened,runaways,runaround,rheya,resenting,rehashing,rehabilitated,regrettable,refreshed,redial,reconnecting,ravenous,raping,rafting,quandary,pylea,putrid,puffing,psychopathic,prunes,probate,prayin,pomegranate,plummeting,planing,plagues,pinata,pithy,perversion,personals,perched,peeps,peckish,pavarotti,pajama,packin,pacifier,overstepping,okama,obstetrician,nutso,nuance,normalcy,nonnegotiable,nomak,ninny,nines,nicey,newsflash,neutered,nether,negligee,necrosis,navigating,narcissistic,mylie,muses,momento,moisturizer,moderation,misinformed,misconception,minnifield,mikkos,methodical,mebbe,meager,maybes,matchmaking,masry,markovic,malakai,luzhin,lusting,lumberjack,loopholes,loaning,lightening,leotard,launder,lamaze,kubla,kneeling,kibosh,jumpsuit,joliet,jogger,janover,jakovasaurs,irreparable,innocently,inigo,infomercial,inexplicable,indispensable,impregnated,impossibly,imitating,hunches,hummus,houmfort,hothead,hostiles,hooves,hooligans,homos,homie,hisself,heyyy,hesitant,hangout,handsomest,handouts,hairless,gwennie,guzzling,guinevere,grungy,goading,glaring,gavel,gardino,gangrene,fruitful,friendlier,freckle,freakish,forthright,forearm,footnote,flops,fixer,firecracker,finito,figgered,fezzik,fastened,farfetched,fanciful,familiarize,faire,fahrenheit,extravaganza,exploratory,explanatory,everglades,eunuch,estas,escapade,erasers,emptying,embarassing,dweeb,dutiful,dumplings,dries,drafty,dollhouse,dismissing,disgraced,discrepancies,disbelief,disagreeing,digestion,didnt,deviled,deviated,demerol,delectable,decaying,decadent,dears,dateless,d'algout,cultivating,cryto,crumpled,crumbled,cronies,crease,craves,cozying,corduroy,congratulated,confidante,compressions,complicating,compadre,coerce,classier,chums,chumash,chivalrous,chinpoko,charred,chafing,celibacy,carted,carryin,carpeting,carotid,cannibals,candor,butterscotch,busts,busier,bullcrap,buggin,brookside,brodski,brassiere,brainwash,brainiac,botrelle,bonbon,boatload,blimey,blaring,blackness,bipartisan,bimbos,bigamist,biebe,biding,betrayals,bestow,bellerophon,bedpans,bassinet,basking,barzini,barnyard,barfed,backups,audited,asinine,asalaam,arouse,applejack,annoys,anchovies,ampule,alameida,aggravate,adage,accomplices,yokel,y'ever,wringer,witwer,withdrawals,windward,willfully,whorfin,whimsical,whimpering,weddin,weathered,warmest,wanton,volant,visceral,vindication,veggies,urinate,uproar,unwritten,unwrap,unsung,unsubstantiated,unspeakably,unscrupulous,unraveling,unquote,unqualified,unfulfilled,undetectable,underlined,unattainable,unappreciated,ummmm,ulcers,tylenol,tweak,turnin,tuatha,tropez,trellis,toppings,tootin,toodle,tinkering,thrives,thespis,theatrics,thatherton,tempers,tavington,tartar,tampon,swelled,sutures,sustenance,sunflowers,sublet,stubbins,strutting,strewn,stowaway,stoic,sternin,stabilizing,spiraling,spinster,speedometer,speakeasy,soooo,soiled,sneakin,smithereens,smelt,smacks,slaughterhouse,slacks,skids,sketching,skateboards,sizzling,sixes,sirree,simplistic,shouts,shorted,shoelace,sheeit,shards,shackled,sequestered,selmak,seduces,seclusion,seamstress,seabeas,scoops,scooped,scavenger,satch,s'more,rudeness,romancing,rioja,rifkin,rieper,revise,reunions,repugnant,replicating,repaid,renewing,relaxes,rekindle,regrettably,regenerate,reels,reciting,reappear,readin,ratting,rapes,rancher,rammed,rainstorm,railroading,queers,punxsutawney,punishes,pssst,prudy,proudest,protectors,procrastinating,proactive,priss,postmortem,pompoms,poise,pickings,perfectionist,peretti,people'll,pecking,patrolman,paralegal,paragraphs,paparazzi,pankot,pampering,overstep,overpower,outweigh,omnipotent,odious,nuwanda,nurtured,newsroom,neeson,needlepoint,necklaces,neato,muggers,muffler,mousy,mourned,mosey,mopey,mongolians,moldy,misinterpret,minibar,microfilm,mendola,mended,melissande,masturbating,masbath,manipulates,maimed,mailboxes,magnetism,m'lord,m'honey,lymph,lunge,lovelier,lefferts,leezak,ledgers,larraby,laloosh,kundun,kozinski,knockoff,kissin,kiosk,kennedys,kellman,karlo,kaleidoscope,jeffy,jaywalking,instructing,infraction,informer,infarction,impulsively,impressing,impersonated,impeach,idiocy,hyperbole,hurray,humped,huhuh,hsing,hordes,hoodlums,honky,hitchhiker,hideously,heaving,heathcliff,headgear,headboard,hazing,harem,handprint,hairspray,gutiurrez,goosebumps,gondola,glitches,gasping,frolic,freeways,frayed,fortitude,forgetful,forefathers,fonder,foiled,foaming,flossing,flailing,fitzgeralds,firehouse,finders,fiftieth,fellah,fawning,farquaad,faraway,fancied,extremists,exorcist,exhale,ethros,entrust,ennui,energized,encephalitis,embezzling,elster,elixir,electrolytes,duplex,dryers,drexl,dredging,drawback,don'ts,dobisch,divorcee,disrespected,disprove,disobeying,disinfectant,dingy,digress,dieting,dictating,devoured,devise,detonators,desist,deserter,derriere,deron,deceptive,debilitating,deathwok,daffodils,curtsy,cursory,cuppa,cumin,cronkite,cremation,credence,cranking,coverup,courted,countin,counselling,cornball,contentment,consensual,compost,cluett,cleverly,cleansed,cleanliness,chopec,chomp,chins,chime,cheswick,chessler,cheapest,chatted,cauliflower,catharsis,catchin,caress,camcorder,calorie,cackling,bystanders,buttoned,buttering,butted,buries,burgel,buffoon,brogna,bragged,boutros,bogeyman,blurting,blurb,blowup,bloodhound,blissful,birthmark,bigot,bestest,belted,belligerent,beggin,befall,beeswax,beatnik,beaming,barricade,baggoli,badness,awoke,artsy,artful,aroun,armpits,arming,annihilate,anise,angiogram,anaesthetic,amorous,ambiance,alligators,adoration,admittance,adama,abydos,zonked,zhivago,yorkin,wrongfully,writin,wrappers,worrywart,woops,wonderfalls,womanly,wickedness,whoopie,wholeheartedly,whimper,which'll,wheelchairs,what'ya,warranted,wallop,wading,wacked,virginal,vermouth,vermeil,verger,ventriss,veneer,vampira,utero,ushers,urgently,untoward,unshakable,unsettled,unruly,unlocks,ungodly,undue,uncooperative,uncontrollably,unbeatable,twitchy,tumbler,truest,triumphs,triplicate,tribbey,tortures,tongaree,tightening,thorazine,theres,testifies,teenaged,tearful,taxing,taldor,syllabus,swoops,swingin,suspending,sunburn,stuttering,stupor,strides,strategize,strangulation,stooped,stipulation,stingy,stapled,squeaks,squawking,spoilsport,splicing,spiel,spencers,spasms,spaniard,softener,sodding,soapbox,smoldering,smithbauer,skittish,sifting,sickest,sicilians,shuffling,shrivel,segretti,seeping,securely,scurrying,scrunch,scrote,screwups,schenkman,sawing,savin,satine,sapiens,salvaging,salmonella,sacrilege,rumpus,ruffle,roughing,rotted,rondall,ridding,rickshaw,rialto,rhinestone,restrooms,reroute,requisite,repress,rednecks,redeeming,rayed,ravell,raked,raincheck,raffi,racked,pushin,profess,prodding,procure,presuming,preppy,prednisone,potted,posttraumatic,poorhouse,podiatrist,plowed,pledging,playroom,plait,placate,pinback,picketing,photographing,pharoah,petrak,petal,persecuting,perchance,pellets,peeved,peerless,payable,pauses,pathologist,pagliacci,overwrought,overreaction,overqualified,overheated,outcasts,otherworldly,opinionated,oodles,oftentimes,occured,obstinate,nutritionist,numbness,nubile,nooooooo,nobodies,nepotism,neanderthals,mushu,mucus,mothering,mothballs,monogrammed,molesting,misspoke,misspelled,misconstrued,miscalculated,minimums,mince,mildew,mighta,middleman,mementos,mellowed,mayol,mauled,massaged,marmalade,mardi,makings,lundegaard,lovingly,loudest,lotto,loosing,loompa,looming,longs,loathes,littlest,littering,lifelike,legalities,laundered,lapdog,lacerations,kopalski,knobs,knitted,kittridge,kidnaps,kerosene,karras,jungles,jockeys,iranoff,invoices,invigorating,insolence,insincere,insectopia,inhumane,inhaling,ingrates,infestation,individuality,indeterminate,incomprehensible,inadequacy,impropriety,importer,imaginations,illuminating,ignite,hysterics,hypodermic,hyperventilate,hyperactive,humoring,honeymooning,honed,hoist,hoarding,hitching,hiker,hightail,hemoglobin,hell'd,heinie,growin,grasped,grandparent,granddaughters,gouged,goblins,gleam,glades,gigantor,get'em,geriatric,gatekeeper,gargoyles,gardenias,garcon,garbo,gallows,gabbing,futon,fulla,frightful,freshener,fortuitous,forceps,fogged,fodder,foamy,flogging,flaun,flared,fireplaces,feverish,favell,fattest,fattening,fallow,extraordinaire,evacuating,errant,envied,enchant,enamored,egocentric,dussander,dunwitty,dullest,dropout,dredged,dorsia,doornail,donot,dongs,dogged,dodgy,ditty,dishonorable,discriminating,discontinue,dings,dilly,dictation,dialysis,delly,delightfully,daryll,dandruff,cruddy,croquet,cringe,crimp,credo,crackling,courtside,counteroffer,counterfeiting,corrupting,copping,conveyor,contusions,contusion,conspirator,consoling,connoisseur,confetti,composure,compel,colic,coddle,cocksuckers,coattails,cloned,claustrophobia,clamoring,churn,chugga,chirping,chasin,chapped,chalkboard,centimeter,caymans,catheter,casings,caprica,capelli,cannolis,cannoli,camogli,camembert,butchers,butchered,busboys,bureaucrats,buckled,bubbe,brownstone,bravely,brackley,bouquets,botox,boozing,boosters,bodhi,blunders,blunder,blockage,biocyte,betrays,bested,beryllium,beheading,beggar,begbie,beamed,bastille,barstool,barricades,barbecues,barbecued,bandwagon,backfiring,bacarra,avenged,autopsies,aunties,associating,artichoke,arrowhead,appendage,apostrophe,antacid,ansel,annul,amuses,amped,amicable,amberg,alluring,adversaries,admirers,adlai,acupuncture,abnormality,aaaahhhh,zooming,zippity,zipping,zeroed,yuletide,yoyodyne,yengeese,yeahhh,wrinkly,wracked,withered,winks,windmills,whopping,wendle,weigart,waterworks,waterbed,watchful,wantin,wagging,waaah,vying,ventricle,varnish,vacuumed,unreachable,unprovoked,unmistakable,unfriendly,unfolding,underpaid,uncuff,unappealing,unabomber,typhoid,tuxedos,tushie,turds,tumnus,troubadour,trinium,treaters,treads,transpired,transgression,tought,thready,thins,thinners,techs,teary,tattaglia,tassels,tarzana,tanking,tablecloths,synchronize,symptomatic,sycophant,swimmingly,sweatshop,surfboard,superpowers,sunroom,sunblock,sugarplum,stupidly,strumpet,strapless,stooping,stools,stealthy,stalks,stairmaster,staffer,sshhh,squatting,squatters,spectacularly,sorbet,socked,sociable,snubbed,snorting,sniffles,snazzy,snakebite,smuggler,smorgasbord,smooching,slurping,slouch,slingshot,slaved,skimmed,sisterhood,silliest,sidarthur,sheraton,shebang,sharpening,shanghaied,shakers,sendoff,scurvy,scoliosis,scaredy,scagnetti,sawchuk,saugus,sasquatch,sandbag,saltines,s'pose,roston,rostle,riveting,ristle,rifling,revulsion,reverently,retrograde,restful,resents,reptilian,reorganize,renovating,reiterate,reinvent,reinmar,reibers,reechard,recuse,reconciling,recognizance,reclaiming,recitation,recieved,rebate,reacquainted,rascals,railly,quintuplets,quahog,pygmies,puzzling,punctuality,prosthetic,proms,probie,preys,preserver,preppie,poachers,plummet,plumbers,plannin,pitying,pitfalls,piqued,pinecrest,pinches,pillage,pigheaded,physique,pessimistic,persecute,perjure,percentile,pentothal,pensky,penises,peini,pazzi,pastels,parlour,paperweight,pamper,pained,overwhelm,overalls,outrank,outpouring,outhouse,outage,ouija,obstructed,obsessions,obeying,obese,o'riley,o'higgins,nosebleeds,norad,noooooooo,nononono,nonchalant,nippy,neurosis,nekhorvich,necronomicon,naquada,n'est,mystik,mystified,mumps,muddle,mothership,moped,monumentally,monogamous,mondesi,misogynistic,misinterpreting,mindlock,mending,megaphone,meeny,medicating,meanie,masseur,markstrom,marklars,margueritas,manifesting,maharajah,lukewarm,loveliest,loran,lizardo,liquored,lipped,lingers,limey,lemkin,leisurely,lathe,latched,lapping,ladle,krevlorneswath,kosygin,khakis,kenaru,keats,kaitlan,julliard,jollies,jaundice,jargon,jackals,invisibility,insipid,inflamed,inferiority,inexperience,incinerated,incinerate,incendiary,incan,inbred,implicating,impersonator,hunks,horsing,hooded,hippopotamus,hiked,hetson,hetero,hessian,henslowe,hendler,hellstrom,headstone,hayloft,harbucks,handguns,hallucinate,haldol,haggling,gynaecologist,gulag,guilder,guaranteeing,groundskeeper,grindstone,grimoir,grievance,griddle,gribbit,greystone,graceland,gooders,goeth,gentlemanly,gelatin,gawking,ganged,fukes,fromby,frenchmen,foursome,forsley,forbids,footwork,foothold,floater,flinging,flicking,fittest,fistfight,fireballs,fillings,fiddling,fennyman,felonious,felonies,feces,favoritism,fatten,fanatics,faceman,excusing,excepted,entwined,entree,ensconced,eladio,ehrlichman,easterland,dueling,dribbling,drape,downtrodden,doused,dosed,dorleen,dokie,distort,displeased,disown,dismount,disinherited,disarmed,disapproves,diperna,dined,diligent,dicaprio,depress,decoded,debatable,dealey,darsh,damsels,damning,dad'll,d'oeuvre,curlers,curie,cubed,crikey,crepes,countrymen,cornfield,coppers,copilot,copier,cooing,conspiracies,consigliere,condoning,commoner,commies,combust,comas,colds,clawed,clamped,choosy,chomping,chimps,chigorin,chianti,cheep,checkups,cheaters,celibate,cautiously,cautionary,castell,carpentry,caroling,carjacking,caritas,caregiver,cardiology,candlesticks,canasta,cain't,burro,burnin,bunking,bumming,bullwinkle,brummel,brooms,brews,breathin,braslow,bracing,botulism,boorish,bloodless,blayne,blatantly,blankie,bedbugs,becuase,barmaid,bared,baracus,banal,bakes,backpacks,attentions,atrocious,ativan,athame,asunder,astound,assuring,aspirins,asphyxiation,ashtrays,aryans,arnon,apprehension,applauding,anvil,antiquing,antidepressants,annoyingly,amputate,altruistic,alotta,alerting,afterthought,affront,affirm,actuality,abysmal,absentee,yeller,yakushova,wuzzy,wriggle,worrier,woogyman,womanizer,windpipe,windbag,willin,whisking,whimsy,wendall,weeny,weensy,weasels,watery,watcha,wasteful,waski,washcloth,waaay,vouched,viznick,ventriloquist,vendettas,veils,vayhue,vamanos,vadimus,upstage,uppity,unsaid,unlocking,unintentionally,undetected,undecided,uncaring,unbearably,tween,tryout,trotting,trini,trimmings,trickier,treatin,treadstone,trashcan,transcendent,tramps,townsfolk,torturous,torrid,toothpicks,tolerable,tireless,tiptoeing,timmay,tillinghouse,tidying,tibia,thumbing,thrusters,thrashing,these'll,thatos,testicular,teriyaki,tenors,tenacity,tellers,telemetry,tarragon,switchblade,swicker,swells,sweatshirts,swatches,surging,supremely,sump'n,succumb,subsidize,stumbles,stuffs,stoppin,stipulate,stenographer,steamroll,stasis,stagger,squandered,splint,splendidly,splashy,splashing,specter,sorcerers,somewheres,somber,snuggled,snowmobile,sniffed,snags,smugglers,smudged,smirking,smearing,slings,sleet,sleepovers,sleek,slackers,siree,siphoning,singed,sincerest,sickened,shuffled,shriveled,shorthanded,shittin,shish,shipwrecked,shins,sheetrock,shawshank,shamu,sha're,servitude,sequins,seascape,scrapings,scoured,scorching,sandpaper,saluting,salud,ruffled,roughnecks,rougher,rosslyn,rosses,roost,roomy,romping,revolutionize,reprimanded,refute,refrigerated,reeled,redundancies,rectal,recklessly,receding,reassignment,reapers,readout,ration,raring,ramblings,raccoons,quarantined,purging,punters,psychically,premarital,pregnancies,predisposed,precautionary,pollute,podunk,plums,plaything,pixilated,pitting,piranhas,pieced,piddles,pickled,photogenic,phosphorous,pffft,pestilence,pessimist,perspiration,perps,penticoff,passageways,pardons,panics,pancamo,paleontologist,overwhelms,overstating,overpaid,overdid,outlive,orthodontist,orgies,oreos,ordover,ordinates,ooooooh,oooohhh,omelettes,officiate,obtuse,obits,nymph,novocaine,noooooooooo,nipping,nilly,nightstick,negate,neatness,natured,narcotic,narcissism,namun,nakatomi,murky,muchacho,mouthwash,motzah,morsel,morph,morlocks,mooch,moloch,molest,mohra,modus,modicum,mockolate,misdemeanors,miscalculation,middies,meringue,mercilessly,meditating,mayakovsky,maximillian,marlee,markovski,maniacal,maneuvered,magnificence,maddening,lutze,lunged,lovelies,lorry,loosening,lookee,littered,lilac,lightened,laces,kurzon,kurtzweil,kind've,kimono,kenji,kembu,keanu,kazuo,jonesing,jilted,jiggling,jewelers,jewbilee,jacqnoud,jacksons,ivories,insurmountable,innocuous,innkeeper,infantery,indulged,indescribable,incoherent,impervious,impertinent,imperfections,hunnert,huffy,horsies,horseradish,hollowed,hogwash,hockley,hissing,hiromitsu,hidin,hereafter,helpmann,hehehe,haughty,happenings,hankie,handsomely,halliwells,haklar,haise,gunsights,grossly,grope,grocer,grits,gripping,grabby,glorificus,gizzard,gilardi,gibarian,geminon,gasses,garnish,galloping,gairwyn,futterman,futility,fumigated,fruitless,friendless,freon,foregone,forego,floored,flighty,flapjacks,fizzled,ficus,festering,farbman,fabricate,eyghon,extricate,exalted,eventful,esophagus,enterprising,entail,endor,emphatically,embarrasses,electroshock,easel,duffle,drumsticks,dissection,dissected,disposing,disparaging,disorientation,disintegrated,disarming,devoting,dessaline,deprecating,deplorable,delve,degenerative,deduct,decomposed,deathly,dearie,daunting,dankova,cyclotron,cyberspace,cutbacks,culpable,cuddled,crumpets,cruelly,crouching,cranium,cramming,cowering,couric,cordesh,conversational,conclusively,clung,clotting,cleanest,chipping,chimpanzee,chests,cheapen,chainsaws,censure,catapult,caravaggio,carats,captivating,calrissian,butlers,busybody,bussing,bunion,bulimic,budging,brung,browbeat,brokenhearted,brecher,breakdowns,bracebridge,boning,blowhard,blisters,blackboard,bigotry,bialy,bhamra,bended,begat,battering,baste,basquiat,barricaded,barometer,balled,baited,badenweiler,backhand,ascenscion,argumentative,appendicitis,apparition,anxiously,antagonistic,angora,anacott,amniotic,ambience,alonna,aleck,akashic,ageless,abouts,aawwww,aaaaarrrrrrggghhh,aaaaaa,zendi,yuppies,yodel,y'hear,wrangle,wombosi,wittle,withstanding,wisecracks,wiggling,wierd,whittlesley,whipper,whattya,whatsamatter,whatchamacallit,whassup,whad'ya,weakling,warfarin,waponis,wampum,wadn't,vorash,vizzini,virtucon,viridiana,veracity,ventilated,varicose,varcon,vandalized,vamos,vamoose,vaccinated,vacationing,usted,urinal,uppers,unwittingly,unsealed,unplanned,unhinged,unhand,unfathomable,unequivocally,unbreakable,unadvisedly,udall,tynacorp,tuxes,tussle,turati,tunic,tsavo,trussed,troublemakers,trollop,tremors,transsexual,transfusions,toothbrushes,toned,toddlers,tinted,tightened,thundering,thorpey,this'd,thespian,thaddius,tenuous,tenths,tenement,telethon,teleprompter,teaspoon,taunted,tattle,tardiness,taraka,tappy,tapioca,tapeworm,talcum,tacks,swivel,swaying,superpower,summarize,sumbitch,sultry,suburbia,styrofoam,stylings,strolls,strobe,stockpile,stewardesses,sterilized,sterilize,stealin,stakeouts,squawk,squalor,squabble,sprinkled,sportsmanship,spokes,spiritus,sparklers,spareribs,sowing,sororities,sonovabitch,solicit,softy,softness,softening,snuggling,snatchers,snarling,snarky,snacking,smears,slumped,slowest,slithering,sleazebag,slayed,slaughtering,skidded,skated,sivapathasundaram,sissies,silliness,silences,sidecar,sicced,shylock,shtick,shrugged,shriek,shoves,should'a,shortcake,shockingly,shirking,shaves,shatner,sharpener,shapely,shafted,sexless,septum,selflessness,seabea,scuff,screwball,scoping,scooch,scolding,schnitzel,schemed,scalper,santy,sankara,sanest,salesperson,sakulos,safehouse,sabers,runes,rumblings,rumbling,ruijven,ringers,righto,rhinestones,retrieving,reneging,remodelling,relentlessly,regurgitate,refills,reeking,reclusive,recklessness,recanted,ranchers,rafer,quaking,quacks,prophesied,propensity,profusely,problema,prided,prays,postmark,popsicles,poodles,pollyanna,polaroids,pokes,poconos,pocketful,plunging,plugging,pleeease,platters,pitied,pinetti,piercings,phooey,phonies,pestering,periscope,pentagram,pelts,patronized,paramour,paralyze,parachutes,pales,paella,paducci,owatta,overdone,overcrowded,overcompensating,ostracized,ordinate,optometrist,operandi,omens,okayed,oedipal,nuttier,nuptial,nunheim,noxious,nourish,notepad,nitroglycerin,nibblet,neuroses,nanosecond,nabbit,mythic,munchkins,multimillion,mulroney,mucous,muchas,mountaintop,morlin,mongorians,moneybags,mom'll,molto,mixup,misgivings,mindset,michalchuk,mesmerized,merman,mensa,meaty,mbwun,materialize,materialistic,masterminded,marginally,mapuhe,malfunctioning,magnify,macnamara,macinerney,machinations,macadamia,lysol,lurks,lovelorn,lopsided,locator,litback,litany,linea,limousines,limes,lighters,liebkind,levity,levelheaded,letterhead,lesabre,leron,lepers,lefts,leftenant,laziness,layaway,laughlan,lascivious,laryngitis,lapsed,landok,laminated,kurten,kobol,knucklehead,knowed,knotted,kirkeby,kinsa,karnovsky,jolla,jimson,jettison,jeric,jawed,jankis,janitors,jango,jalopy,jailbreak,jackers,jackasses,invalidate,intercepting,intercede,insinuations,infertile,impetuous,impaled,immerse,immaterial,imbeciles,imagines,idyllic,idolized,icebox,i'd've,hypochondriac,hyphen,hurtling,hurried,hunchback,hullo,horsting,hoooo,homeboys,hollandaise,hoity,hijinks,hesitates,herrero,herndorff,helplessly,heeyy,heathen,hearin,headband,harrassment,harpies,halstrom,hahahahaha,hacer,grumbling,grimlocks,grift,greets,grandmothers,grander,grafts,gordievsky,gondorff,godorsky,glscripts,gaudy,gardeners,gainful,fuses,fukienese,frizzy,freshness,freshening,fraught,frantically,foxbooks,fortieth,forked,foibles,flunkies,fleece,flatbed,fisted,firefight,fingerpaint,filibuster,fhloston,fenceline,femur,fatigues,fanucci,fantastically,familiars,falafel,fabulously,eyesore,expedient,ewwww,eviscerated,erogenous,epidural,enchante,embarassed,embarass,embalming,elude,elspeth,electrocute,eigth,eggshell,echinacea,eases,earpiece,earlobe,dumpsters,dumbshit,dumbasses,duloc,duisberg,drummed,drinkers,dressy,dorma,doily,divvy,diverting,dissuade,disrespecting,displace,disorganized,disgustingly,discord,disapproving,diligence,didja,diced,devouring,detach,destructing,desolate,demerits,delude,delirium,degrade,deevak,deemesa,deductions,deduce,debriefed,deadbeats,dateline,darndest,damnable,dalliance,daiquiri,d'agosta,cussing,cryss,cripes,cretins,crackerjack,cower,coveting,couriers,countermission,cotswolds,convertibles,conversationalist,consorting,consoled,consarn,confides,confidentially,commited,commiserate,comme,comforter,comeuppance,combative,comanches,colosseum,colling,coexist,coaxing,cliffside,chutes,chucked,chokes,childlike,childhoods,chickening,chenowith,charmingly,changin,catsup,captioning,capsize,cappucino,capiche,candlewell,cakewalk,cagey,caddie,buxley,bumbling,bulky,buggered,brussel,brunettes,brumby,brotha,bronck,brisket,bridegroom,braided,bovary,bookkeeper,bluster,bloodline,blissfully,blase,billionaires,bicker,berrisford,bereft,berating,berate,bendy,belive,belated,beikoku,beens,bedspread,bawdy,barreling,baptize,banya,balthazar,balmoral,bakshi,bails,badgered,backstreet,awkwardly,auras,attuned,atheists,astaire,assuredly,arrivederci,appetit,appendectomy,apologetic,antihistamine,anesthesiologist,amulets,albie,alarmist,aiight,adstream,admirably,acquaint,abound,abominable,aaaaaaah,zekes,zatunica,wussy,worded,wooed,woodrell,wiretap,windowsill,windjammer,windfall,whisker,whims,whatiya,whadya,weirdly,weenies,waunt,washout,wanto,waning,victimless,verdad,veranda,vandaley,vancomycin,valise,vaguest,upshot,unzip,unwashed,untrained,unstuck,unprincipled,unmentionables,unjustly,unfolds,unemployable,uneducated,unduly,undercut,uncovering,unconsciousness,unconsciously,tyndareus,turncoat,turlock,tulle,tryouts,trouper,triplette,trepkos,tremor,treeger,trapeze,traipse,tradeoff,trach,torin,tommorow,tollan,toity,timpani,thumbprint,thankless,tell'em,telepathy,telemarketing,telekinesis,teevee,teeming,tarred,tambourine,talentless,swooped,switcheroo,swirly,sweatpants,sunstroke,suitors,sugarcoat,subways,subterfuge,subservient,subletting,stunningly,strongbox,striptease,stravanavitch,stradling,stoolie,stodgy,stocky,stifle,stealer,squeezes,squatter,squarely,sprouted,spool,spindly,speedos,soups,soundly,soulmates,somebody'll,soliciting,solenoid,sobering,snowflakes,snowballs,snores,slung,slimming,skulk,skivvies,skewered,skewer,sizing,sistine,sidebar,sickos,shushing,shunt,shugga,shone,shol'va,sharpened,shapeshifter,shadowing,shadoe,selectman,sefelt,seared,scrounging,scribbling,scooping,scintillating,schmoozing,scallops,sapphires,sanitarium,sanded,safes,rudely,roust,rosebush,rosasharn,rondell,roadhouse,riveted,rewrote,revamp,retaliatory,reprimand,replicators,replaceable,remedied,relinquishing,rejoicing,reincarnated,reimbursed,reevaluate,redid,redefine,recreating,reconnected,rebelling,reassign,rearview,rayne,ravings,ratso,rambunctious,radiologist,quiver,quiero,queef,qualms,pyrotechnics,pulsating,psychosomatic,proverb,promiscuous,profanity,prioritize,preying,predisposition,precocious,precludes,prattling,prankster,povich,potting,postpartum,porridge,polluting,plowing,pistachio,pissin,pickpocket,physicals,peruse,pertains,personified,personalize,perjured,perfecting,pepys,pepperdine,pembry,peering,peels,pedophile,patties,passkey,paratrooper,paraphernalia,paralyzing,pandering,paltry,palpable,pagers,pachyderm,overstay,overestimated,overbite,outwit,outgrow,outbid,ooops,oomph,oohhh,oldie,obliterate,objectionable,nygma,notting,noches,nitty,nighters,newsstands,newborns,neurosurgery,nauseated,nastiest,narcolepsy,mutilate,muscled,murmur,mulva,mulling,mukada,muffled,morgues,moonbeams,monogamy,molester,molestation,molars,moans,misprint,mismatched,mirth,mindful,mimosas,millander,mescaline,menstrual,menage,mellowing,medevac,meddlesome,matey,manicures,malevolent,madmen,macaroons,lydell,lycra,lunchroom,lunching,lozenges,looped,litigious,liquidate,linoleum,lingk,limitless,limber,lilacs,ligature,liftoff,lemmiwinks,leggo,learnin,lazarre,lawyered,lactose,knelt,kenosha,kemosabe,jussy,junky,jordy,jimmies,jeriko,jakovasaur,issacs,isabela,irresponsibility,ironed,intoxication,insinuated,inherits,ingest,ingenue,inflexible,inflame,inevitability,inedible,inducement,indignant,indictments,indefensible,incomparable,incommunicado,improvising,impounded,illogical,ignoramus,hydrochloric,hydrate,hungover,humorless,humiliations,hugest,hoverdrone,hovel,hmmph,hitchhike,hibernating,henchman,helloooo,heirlooms,heartsick,headdress,hatches,harebrained,hapless,hanen,handsomer,hallows,habitual,guten,gummy,guiltier,guidebook,gstaad,gruff,griss,grieved,grata,gorignak,goosed,goofed,glowed,glitz,glimpses,glancing,gilmores,gianelli,geraniums,garroway,gangbusters,gamblers,galls,fuddy,frumpy,frowning,frothy,fro'tak,frere,fragrances,forgettin,follicles,flowery,flophouse,floatin,flirts,flings,flatfoot,fingerprinting,fingerprinted,fingering,finald,fillet,fianc,femoral,federales,fawkes,fascinates,farfel,fambly,falsified,fabricating,exterminators,expectant,excusez,excrement,excercises,evian,etins,esophageal,equivalency,equate,equalizer,entrees,enquire,endearment,empathetic,emailed,eggroll,earmuffs,dyslexic,duper,duesouth,drunker,druggie,dreadfully,dramatics,dragline,downplay,downers,dominatrix,doers,docket,docile,diversify,distracts,disloyalty,disinterested,discharging,disagreeable,dirtier,dinghy,dimwitted,dimoxinil,dimmy,diatribe,devising,deviate,detriment,desertion,depressants,depravity,deniability,delinquents,defiled,deepcore,deductive,decimate,deadbolt,dauthuille,dastardly,daiquiris,daggers,dachau,curiouser,curdled,cucamonga,cruller,cruces,crosswalk,crinkle,crescendo,cremate,counseled,couches,cornea,corday,copernicus,contrition,contemptible,constipated,conjoined,confounded,condescend,concoct,conch,compensating,committment,commandeered,comely,coddled,cockfight,cluttered,clunky,clownfish,cloaked,clenched,cleanin,civilised,circumcised,cimmeria,cilantro,chutzpah,chucking,chiseled,chicka,chattering,cervix,carrey,carpal,carnations,cappuccinos,candied,calluses,calisthenics,bushy,burners,budington,buchanans,brimming,braids,boycotting,bouncers,botticelli,botherin,bookkeeping,bogyman,bogged,bloodthirsty,blintzes,blanky,binturong,billable,bigboote,bewildered,betas,bequeath,behoove,befriend,bedpost,bedded,baudelaires,barreled,barboni,barbeque,bangin,baltus,bailout,backstabber,baccarat,awning,augie,arguillo,archway,apricots,apologising,annyong,anchorman,amenable,amazement,allspice,alannis,airfare,airbags,ahhhhhhhhh,ahhhhhhhh,ahhhhhhh,agitator,adrenal,acidosis,achoo,accessorizing,accentuate,abrasions,abductor,aaaahhh,aaaaaaaa,aaaaaaa,zeroing,zelner,zeldy,yevgeny,yeska,yellows,yeesh,yeahh,yamuri,wouldn't've,workmanship,woodsman,winnin,winked,wildness,whoring,whitewash,whiney,when're,wheezer,wheelman,wheelbarrow,westerburg,weeding,watermelons,washboard,waltzes,wafting,voulez,voluptuous,vitone,vigilantes,videotaping,viciously,vices,veruca,vermeer,verifying,vasculitis,valets,upholstered,unwavering,untold,unsympathetic,unromantic,unrecognizable,unpredictability,unmask,unleashing,unintentional,unglued,unequivocal,underrated,underfoot,unchecked,unbutton,unbind,unbiased,unagi,uhhhhh,tugging,triads,trespasses,treehorn,traviata,trappers,transplants,trannie,tramping,tracheotomy,tourniquet,tooty,toothless,tomarrow,toasters,thruster,thoughtfulness,thornwood,tengo,tenfold,telltale,telephoto,telephoned,telemarketer,tearin,tastic,tastefully,tasking,taser,tamed,tallow,taketh,taillight,tadpoles,tachibana,syringes,sweated,swarthy,swagger,surges,supermodels,superhighway,sunup,sun'll,sulfa,sugarless,sufficed,subside,strolled,stringy,strengthens,straightest,straightens,storefront,stopper,stockpiling,stimulant,stiffed,steyne,sternum,stepladder,stepbrother,steers,steelheads,steakhouse,stathis,stankylecartmankennymr,standoffish,stalwart,squirted,spritz,sprig,sprawl,spousal,sphincter,spenders,spearmint,spatter,spangled,southey,soured,sonuvabitch,somethng,snuffed,sniffs,smokescreen,smilin,slobs,sleepwalker,sleds,slays,slayage,skydiving,sketched,skanks,sixed,siphoned,siphon,simpering,sigfried,sidearm,siddons,sickie,shuteye,shuffleboard,shrubberies,shrouded,showmanship,shouldn't've,shoplift,shiatsu,sentries,sentance,sensuality,seething,secretions,searing,scuttlebutt,sculpt,scowling,scouring,scorecard,schoolers,schmucks,scepters,scaly,scalps,scaffolding,sauces,sartorius,santen,salivating,sainthood,saget,saddens,rygalski,rusting,ruination,rueland,rudabaga,rottweiler,roofies,romantics,rollerblading,roldy,roadshow,rickets,rible,rheza,revisiting,retentive,resurface,restores,respite,resounding,resorting,resists,repulse,repressing,repaying,reneged,refunds,rediscover,redecorated,reconstructive,recommitted,recollect,receptacle,reassess,reanimation,realtors,razinin,rationalization,ratatouille,rashum,rasczak,rancheros,rampler,quizzing,quips,quartered,purring,pummeling,puede,proximo,prospectus,pronouncing,prolonging,procreation,proclamations,principled,prides,preoccupation,prego,precog,prattle,pounced,potshots,potpourri,porque,pomegranates,polenta,plying,pluie,plesac,playmates,plantains,pillowcase,piddle,pickers,photocopied,philistine,perpetuate,perpetually,perilous,pawned,pausing,pauper,parter,parlez,parlay,pally,ovulation,overtake,overstate,overpowering,overpowered,overconfident,overbooked,ovaltine,outweighs,outings,ottos,orrin,orifice,orangutan,oopsy,ooooooooh,oooooo,ooohhhh,ocular,obstruct,obscenely,o'dwyer,nutjob,nunur,notifying,nostrand,nonny,nonfat,noblest,nimble,nikes,nicht,newsworthy,nestled,nearsighted,ne'er,nastier,narco,nakedness,muted,mummified,mudda,mozzarella,moxica,motivator,motility,mothafucka,mortmain,mortgaged,mores,mongers,mobbed,mitigating,mistah,misrepresented,mishke,misfortunes,misdirection,mischievous,mineshaft,millaney,microwaves,metzenbaum,mccovey,masterful,masochistic,marliston,marijawana,manya,mantumbi,malarkey,magnifique,madrona,madox,machida,m'hidi,lullabies,loveliness,lotions,looka,lompoc,litterbug,litigator,lithe,liquorice,linds,limericks,lightbulb,lewises,letch,lemec,layover,lavatory,laurels,lateness,laparotomy,laboring,kuato,kroff,krispy,krauts,knuckleheads,kitschy,kippers,kimbrow,keypad,keepsake,kebab,karloff,junket,judgemental,jointed,jezzie,jetting,jeeze,jeeter,jeesus,jeebs,janeane,jails,jackhammer,ixnay,irritates,irritability,irrevocable,irrefutable,irked,invoking,intricacies,interferon,intents,insubordinate,instructive,instinctive,inquisitive,inlay,injuns,inebriated,indignity,indecisive,incisors,incacha,inalienable,impresses,impregnate,impregnable,implosion,idolizes,hypothyroidism,hypoglycemic,huseni,humvee,huddling,honing,hobnobbing,hobnob,histrionics,histamine,hirohito,hippocratic,hindquarters,hikita,hikes,hightailed,hieroglyphics,heretofore,herbalist,hehey,hedriks,heartstrings,headmistress,headlight,hardheaded,happend,handlebars,hagitha,habla,gyroscope,guys'd,guy'd,guttersnipe,grump,growed,grovelling,groan,greenbacks,gravedigger,grating,grasshoppers,grandiose,grandest,grafted,gooood,goood,gooks,godsakes,goaded,glamorama,giveth,gingham,ghostbusters,germane,georgy,gazzo,gazelles,gargle,garbled,galgenstein,gaffe,g'day,fyarl,furnish,furies,fulfills,frowns,frowned,frighteningly,freebies,freakishly,forewarned,foreclose,forearms,fordson,fonics,flushes,flitting,flemmer,flabby,fishbowl,fidgeting,fevers,feigning,faxing,fatigued,fathoms,fatherless,fancier,fanatical,factored,eyelid,eyeglasses,expresso,expletive,expectin,excruciatingly,evidentiary,ever'thing,eurotrash,eubie,estrangement,erlich,epitome,entrap,enclose,emphysema,embers,emasculating,eighths,eardrum,dyslexia,duplicitous,dumpty,dumbledore,dufus,duddy,duchamp,drunkenness,drumlin,drowns,droid,drinky,drifts,drawbridge,dramamine,douggie,douchebag,dostoyevsky,doodling,don'tcha,domineering,doings,dogcatcher,doctoring,ditzy,dissimilar,dissecting,disparage,disliking,disintegrating,dishwalla,dishonored,dishing,disengaged,disavowed,dippy,diorama,dimmed,dilate,digitalis,diggory,dicing,diagnosing,devola,desolation,dennings,denials,deliverance,deliciously,delicacies,degenerates,degas,deflector,defile,deference,decrepit,deciphered,dawdle,dauphine,daresay,dangles,dampen,damndest,cucumbers,cucaracha,cryogenically,croaks,croaked,criticise,crisper,creepiest,creams,crackle,crackin,covertly,counterintelligence,corrosive,cordially,cops'll,convulsions,convoluted,conversing,conga,confrontational,confab,condolence,condiments,complicit,compiegne,commodus,comings,cometh,collusion,collared,cockeyed,clobber,clemonds,clarithromycin,cienega,christmasy,christmassy,chloroform,chippie,chested,cheeco,checklist,chauvinist,chandlers,chambermaid,chakras,cellophane,caveat,cataloguing,cartmanland,carples,carny,carded,caramels,cappy,caped,canvassing,callback,calibrated,calamine,buttermilk,butterfingers,bunsen,bulimia,bukatari,buildin,budged,brobich,bringer,brendell,brawling,bratty,braised,boyish,boundless,botch,boosh,bookies,bonbons,bodes,bobunk,bluntly,blossoming,bloomers,bloodstains,bloodhounds,blech,biter,biometric,bioethics,bijan,bigoted,bicep,bereaved,bellowing,belching,beholden,beached,batmobile,barcodes,barch,barbecuing,bandanna,backwater,backtrack,backdraft,augustino,atrophy,atrocity,atley,atchoo,asthmatic,assoc,armchair,arachnids,aptly,appetizing,antisocial,antagonizing,anorexia,anini,andersons,anagram,amputation,alleluia,airlock,aimless,agonized,agitate,aggravating,aerosol,acing,accomplishing,accidently,abuser,abstain,abnormally,aberration,aaaaahh,zlotys,zesty,zerzura,zapruder,zantopia,yelburton,yeess,y'knowwhati'msayin,wwhat,wussies,wrenched,would'a,worryin,wormser,wooooo,wookiee,wolchek,wishin,wiseguys,windbreaker,wiggy,wieners,wiedersehen,whoopin,whittled,wherefore,wharvey,welts,wellstone,wedges,wavered,watchit,wastebasket,wango,waken,waitressed,wacquiem,vrykolaka,voula,vitally,visualizing,viciousness,vespers,vertes,verily,vegetarians,vater,vaporize,vannacutt,vallens,ussher,urinating,upping,unwitting,untangle,untamed,unsanitary,unraveled,unopened,unisex,uninvolved,uninteresting,unintelligible,unimaginative,undeserving,undermines,undergarments,unconcerned,tyrants,typist,tykes,tybalt,twosome,twits,tutti,turndown,tularemia,tuberculoma,tsimshian,truffaut,truer,truant,trove,triumphed,tripe,trigonometry,trifled,trifecta,tribulations,tremont,tremoille,transcends,trafficker,touchin,tomfoolery,tinkered,tinfoil,tightrope,thousan,thoracotomy,thesaurus,thawing,thatta,tessio,temps,taxidermist,tator,tachycardia,t'akaya,swelco,sweetbreads,swatting,supercollider,sunbathing,summarily,suffocation,sueleen,succinct,subsided,submissive,subjecting,subbing,subatomic,stupendous,stunted,stubble,stubbed,streetwalker,strategizing,straining,straightaway,stoli,stiffer,stickup,stens,steamroller,steadwell,steadfast,stateroom,stans,sshhhh,squishing,squinting,squealed,sprouting,sprimp,spreadsheets,sprawled,spotlights,spooning,spirals,speedboat,spectacles,speakerphone,southglen,souse,soundproof,soothsayer,sommes,somethings,solidify,soars,snorted,snorkeling,snitches,sniping,snifter,sniffin,snickering,sneer,snarl,smila,slinking,slanted,slanderous,slammin,skimp,skilosh,siteid,sirloin,singe,sighing,sidekicks,sicken,showstopper,shoplifter,shimokawa,sherborne,shavadai,sharpshooters,sharking,shagged,shaddup,senorita,sesterces,sensuous,seahaven,scullery,scorcher,schotzie,schnoz,schmooze,schlep,schizo,scents,scalping,scalped,scallop,scalding,sayeth,saybrooke,sawed,savoring,sardine,sandstorm,sandalwood,salutations,sagman,s'okay,rsvp'd,rousted,rootin,romper,romanovs,rollercoaster,rolfie,robinsons,ritzy,ritualistic,ringwald,rhymed,rheingold,rewrites,revoking,reverts,retrofit,retort,retinas,respirations,reprobate,replaying,repaint,renquist,renege,relapsing,rekindled,rejuvenating,rejuvenated,reinstating,recriminations,rechecked,reassemble,rears,reamed,reacquaint,rayanne,ravish,rathole,raspail,rarest,rapists,rants,racketeer,quittin,quitters,quintessential,queremos,quellek,quelle,quasimodo,pyromaniac,puttanesca,puritanical,purer,puree,pungent,pummel,puedo,psychotherapist,prosecutorial,prosciutto,propositioning,procrastination,probationary,primping,preventative,prevails,preservatives,preachy,praetorians,practicality,powders,potus,postop,positives,poser,portolano,portokalos,poolside,poltergeists,pocketed,poach,plummeted,plucking,plimpton,playthings,plastique,plainclothes,pinpointed,pinkus,pinks,pigskin,piffle,pictionary,piccata,photocopy,phobias,perignon,perfumes,pecks,pecked,patently,passable,parasailing,paramus,papier,paintbrush,pacer,paaiint,overtures,overthink,overstayed,overrule,overestimate,overcooked,outlandish,outgrew,outdoorsy,outdo,orchestrate,oppress,opposable,oooohh,oomupwah,okeydokey,okaaay,ohashi,of'em,obscenities,oakie,o'gar,nurection,nostradamus,norther,norcom,nooch,nonsensical,nipped,nimbala,nervously,neckline,nebbleman,narwhal,nametag,n'n't,mycenae,muzak,muumuu,mumbled,mulvehill,muggings,muffet,mouthy,motivates,motaba,moocher,mongi,moley,moisturize,mohair,mocky,mmkay,mistuh,missis,misdeeds,mincemeat,miggs,miffed,methadone,messieur,menopausal,menagerie,mcgillicuddy,mayflowers,matrimonial,matick,masai,marzipan,maplewood,manzelle,mannequins,manhole,manhandle,malfunctions,madwoman,machiavelli,lynley,lynched,lurconis,lujack,lubricant,looove,loons,loofah,lonelyhearts,lollipops,lineswoman,lifers,lexter,lepner,lemony,leggy,leafy,leadeth,lazerus,lazare,lawford,languishing,lagoda,ladman,kundera,krinkle,krendler,kreigel,kowolski,knockdown,knifed,kneed,kneecap,kids'll,kennie,kenmore,keeled,kazootie,katzenmoyer,kasdan,karak,kapowski,kakistos,julyan,jockstrap,jobless,jiggly,jaunt,jarring,jabbering,irrigate,irrevocably,irrationally,ironies,invitro,intimated,intently,intentioned,intelligently,instill,instigator,instep,inopportune,innuendoes,inflate,infects,infamy,indiscretions,indiscreet,indio,indignities,indict,indecision,inconspicuous,inappropriately,impunity,impudent,impotence,implicates,implausible,imperfection,impatience,immutable,immobilize,idealist,iambic,hysterically,hyperspace,hygienist,hydraulics,hydrated,huzzah,husks,hunched,huffed,hubris,hubbub,hovercraft,houngan,hosed,horoscopes,hopelessness,hoodwinked,honorably,honeysuckle,homegirl,holiest,hippity,hildie,hieroglyphs,hexton,herein,heckle,heaping,healthilizer,headfirst,hatsue,harlot,hardwired,halothane,hairstyles,haagen,haaaaa,gutting,gummi,groundless,groaning,gristle,grills,graynamore,grabbin,goodes,goggle,glittering,glint,gleaming,glassy,girth,gimbal,giblets,gellers,geezers,geeze,garshaw,gargantuan,garfunkel,gangway,gandarium,gamut,galoshes,gallivanting,gainfully,gachnar,fusionlips,fusilli,furiously,frugal,fricking,frederika,freckling,frauds,fountainhead,forthwith,forgo,forgettable,foresight,foresaw,fondling,fondled,fondle,folksy,fluttering,fluffing,floundering,flirtatious,flexing,flatterer,flaring,fixating,finchy,figurehead,fiendish,fertilize,ferment,fending,fellahs,feelers,fascinate,fantabulous,falsify,fallopian,faithless,fairer,fainter,failings,facetious,eyepatch,exxon,extraterrestrials,extradite,extracurriculars,extinguish,expunged,expelling,exorbitant,exhilarated,exertion,exerting,excercise,everbody,evaporated,escargot,escapee,erases,epizootics,epithelials,ephrum,entanglements,enslave,engrossed,emphatic,emeralds,ember,emancipated,elevates,ejaculate,effeminate,eccentricities,easygoing,earshot,dunks,dullness,dulli,dulled,drumstick,dropper,driftwood,dregs,dreck,dreamboat,draggin,downsizing,donowitz,dominoes,diversions,distended,dissipate,disraeli,disqualify,disowned,dishwashing,disciplining,discerning,disappoints,dinged,digested,dicking,detonating,despising,depressor,depose,deport,dents,defused,deflecting,decryption,decoys,decoupage,decompress,decibel,decadence,deafening,dawning,dater,darkened,dappy,dallying,dagon,czechoslovakians,cuticles,cuteness,cupboards,culottes,cruisin,crosshairs,cronyn,criminalistics,creatively,creaming,crapping,cranny,cowed,contradicting,constipation,confining,confidences,conceiving,conceivably,concealment,compulsively,complainin,complacent,compels,communing,commode,comming,commensurate,columnists,colonoscopy,colchicine,coddling,clump,clubbed,clowning,cliffhanger,clang,cissy,choosers,choker,chiffon,channeled,chalet,cellmates,cathartic,caseload,carjack,canvass,canisters,candlestick,candlelit,camry,calzones,calitri,caldy,byline,butterball,bustier,burlap,bureaucrat,buffoons,buenas,brookline,bronzed,broiled,broda,briss,brioche,briar,breathable,brays,brassieres,boysenberry,bowline,boooo,boonies,booklets,bookish,boogeyman,boogey,bogas,boardinghouse,bluuch,blundering,bluer,blowed,blotchy,blossomed,bloodwork,bloodied,blithering,blinks,blathering,blasphemous,blacking,birdson,bings,bfmid,bfast,bettin,berkshires,benjamins,benevolence,benched,benatar,bellybutton,belabor,behooves,beddy,beaujolais,beattle,baxworth,baseless,barfing,bannish,bankrolled,banek,ballsy,ballpoint,baffling,badder,badda,bactine,backgammon,baako,aztreonam,authoritah,auctioning,arachtoids,apropos,aprons,apprised,apprehensive,anythng,antivenin,antichrist,anorexic,anoint,anguished,angioplasty,angio,amply,ampicillin,amphetamines,alternator,alcove,alabaster,airlifted,agrabah,affidavits,admonished,admonish,addled,addendum,accuser,accompli,absurdity,absolved,abrusso,abreast,aboot,abductions,abducting,aback,ababwa,aaahhhh,zorin,zinthar,zinfandel,zillions,zephyrs,zatarcs,zacks,youuu,yokels,yardstick,yammer,y'understand,wynette,wrung,wreaths,wowed,wouldn'ta,worming,wormed,workday,woodsy,woodshed,woodchuck,wojadubakowski,withering,witching,wiseass,wiretaps,wining,willoby,wiccaning,whupped,whoopi,whoomp,wholesaler,whiteness,whiner,whatchya,wharves,wenus,weirdoes,weaning,watusi,waponi,waistband,wackos,vouching,votre,vivica,viveca,vivant,vivacious,visor,visitin,visage,vicrum,vetted,ventriloquism,venison,varnsen,vaporized,vapid,vanstock,uuuuh,ushering,urologist,urination,upstart,uprooted,unsubtitled,unspoiled,unseat,unseasonably,unseal,unsatisfying,unnerve,unlikable,unleaded,uninsured,uninspired,unicycle,unhooked,unfunny,unfreezing,unflattering,unfairness,unexpressed,unending,unencumbered,unearth,undiscovered,undisciplined,understan,undershirt,underlings,underline,undercurrent,uncivilized,uncharacteristic,umpteenth,uglies,tuney,trumps,truckasaurus,trubshaw,trouser,tringle,trifling,trickster,trespassers,trespasser,traumas,trattoria,trashes,transgressions,trampling,tp'ed,toxoplasmosis,tounge,tortillas,topsy,topple,topnotch,tonsil,tions,timmuh,timithious,tilney,tighty,tightness,tightens,tidbits,ticketed,thyme,threepio,thoughtfully,thorkel,thommo,thing'll,thefts,that've,thanksgivings,tetherball,testikov,terraforming,tepid,tendonitis,tenboom,telex,teenybopper,tattered,tattaglias,tanneke,tailspin,tablecloth,swooping,swizzle,swiping,swindled,swilling,swerving,sweatshops,swaddling,swackhammer,svetkoff,supossed,superdad,sumptuous,sugary,sugai,subvert,substantiate,submersible,sublimating,subjugation,stymied,strychnine,streetlights,strassmans,stranglehold,strangeness,straddling,straddle,stowaways,stotch,stockbrokers,stifling,stepford,steerage,steena,statuary,starlets,staggeringly,ssshhh,squaw,spurt,spungeon,spritzer,sprightly,sprays,sportswear,spoonful,splittin,splitsville,speedily,specialise,spastic,sparrin,souvlaki,southie,sourpuss,soupy,soundstage,soothes,somebody'd,softest,sociopathic,socialized,snyders,snowmobiles,snowballed,snatches,smugness,smoothest,smashes,sloshed,sleight,skyrocket,skied,skewed,sixpence,sipowicz,singling,simulates,shyness,shuvanis,showoff,shortsighted,shopkeeper,shoehorn,shithouse,shirtless,shipshape,shifu,shelve,shelbyville,sheepskin,sharpens,shaquille,shanshu,servings,sequined,seizes,seashells,scrambler,scopes,schnauzer,schmo,schizoid,scampered,savagely,saudis,santas,sandovals,sanding,saleswoman,sagging,s'cuse,rutting,ruthlessly,runneth,ruffians,rubes,rosalita,rollerblades,rohypnol,roasts,roadies,ritten,rippling,ripples,rigoletto,richardo,rethought,reshoot,reserving,reseda,rescuer,reread,requisitions,repute,reprogram,replenish,repetitious,reorganizing,reinventing,reinvented,reheat,refrigerators,reenter,recruiter,recliner,rawdy,rashes,rajeski,raison,raisers,rages,quinine,questscape,queller,pygmalion,pushers,pusan,purview,pumpin,pubescent,prudes,provolone,propriety,propped,procrastinate,processional,preyed,pretrial,portent,pooling,poofy,polloi,policia,poacher,pluses,pleasuring,platitudes,plateaued,plaguing,pittance,pinheads,pincushion,pimply,pimped,piggyback,piecing,phillipe,philipse,philby,pharaohs,petyr,petitioner,peshtigo,pesaram,persnickety,perpetrate,percolating,pepto,penne,penell,pemmican,peeks,pedaling,peacemaker,pawnshop,patting,pathologically,patchouli,pasts,pasties,passin,parlors,paltrow,palamon,padlock,paddling,oversleep,overheating,overdosed,overcharge,overblown,outrageously,ornery,opportune,oooooooooh,oohhhh,ohhhhhh,ogres,odorless,obliterated,nyong,nymphomaniac,ntozake,novocain,nough,nonnie,nonissue,nodules,nightmarish,nightline,niceties,newsman,needra,nedry,necking,navour,nauseam,nauls,narim,namath,nagged,naboo,n'sync,myslexia,mutator,mustafi,musketeer,murtaugh,murderess,munching,mumsy,muley,mouseville,mortifying,morgendorffers,moola,montel,mongoloid,molestered,moldings,mocarbies,mo'ss,mixers,misrell,misnomer,misheard,mishandled,miscreant,misconceptions,miniscule,millgate,mettle,metricconverter,meteors,menorah,mengele,melding,meanness,mcgruff,mcarnold,matzoh,matted,mastectomy,massager,marveling,marooned,marmaduke,marick,manhandled,manatees,man'll,maltin,maliciously,malfeasance,malahide,maketh,makeovers,maiming,machismo,lumpectomy,lumbering,lucci,lording,lorca,lookouts,loogie,loners,loathed,lissen,lighthearted,lifer,lickin,lewen,levitation,lestercorp,lessee,lentils,legislate,legalizing,lederhosen,lawmen,lasskopf,lardner,lambeau,lamagra,ladonn,lactic,lacquer,labatier,krabappel,kooks,knickknacks,klutzy,kleynach,klendathu,kinross,kinkaid,kind'a,ketch,kesher,karikos,karenina,kanamits,junshi,jumbled,joust,jotted,jobson,jingling,jigalong,jerries,jellies,jeeps,javna,irresistable,internist,intercranial,inseminated,inquisitor,infuriate,inflating,infidelities,incessantly,incensed,incase,incapacitate,inasmuch,inaccuracies,imploding,impeding,impediments,immaturity,illegible,iditarod,icicles,ibuprofen,i'i'm,hymie,hydrolase,hunker,humps,humons,humidor,humdinger,humbling,huggin,huffing,housecleaning,hothouse,hotcakes,hosty,hootenanny,hootchie,hoosegow,honks,honeymooners,homily,homeopathic,hitchhikers,hissed,hillnigger,hexavalent,hewwo,hershe,hermey,hergott,henny,hennigans,henhouse,hemolytic,helipad,heifer,hebrews,hebbing,heaved,headlock,harrowing,harnessed,hangovers,handi,handbasket,halfrek,hacene,gyges,guys're,gundersons,gumption,gruntmaster,grubs,grossie,groped,grins,greaseball,gravesite,gratuity,granma,grandfathers,grandbaby,gradski,gracing,gossips,gooble,goners,golitsyn,gofer,godsake,goddaughter,gnats,gluing,glares,givers,ginza,gimmie,gimmee,gennero,gemme,gazpacho,gazed,gassy,gargling,gandhiji,galvanized,gallbladder,gaaah,furtive,fumigation,fucka,fronkonsteen,frills,freezin,freewald,freeloader,frailty,forger,foolhardy,fondest,fomin,followin,follicle,flotation,flopping,floodgates,flogged,flicked,flenders,fleabag,fixings,fixable,fistful,firewater,firelight,fingerbang,finalizing,fillin,filipov,fiderer,felling,feldberg,feign,faunia,fatale,farkus,fallible,faithfulness,factoring,eyeful,extramarital,exterminated,exhume,exasperated,eviscerate,estoy,esmerelda,escapades,epoxy,enticed,enthused,entendre,engrossing,endorphins,emptive,emmys,eminently,embezzler,embarressed,embarrassingly,embalmed,eludes,eling,elated,eirie,egotitis,effecting,eerily,eecom,eczema,earthy,earlobes,eally,dyeing,dwells,duvet,duncans,dulcet,droves,droppin,drools,drey'auc,downriver,domesticity,dollop,doesnt,dobler,divulged,diversionary,distancing,dispensers,disorienting,disneyworld,dismissive,disingenuous,disheveled,disfiguring,dinning,dimming,diligently,dilettante,dilation,dickensian,diaphragms,devastatingly,destabilize,desecrate,deposing,deniece,demony,delving,delicates,deigned,defraud,deflower,defibrillator,defiantly,defenceless,defacing,deconstruction,decompose,deciphering,decibels,deceptively,deceptions,decapitation,debutantes,debonair,deadlier,dawdling,davic,darwinism,darnit,darks,danke,danieljackson,dangled,cytoxan,cutout,cutlery,curveball,curfews,cummerbund,crunches,crouched,crisps,cripples,crilly,cribs,crewman,creepin,creeds,credenza,creak,crawly,crawlin,crawlers,crated,crackheads,coworker,couldn't've,corwins,coriander,copiously,convenes,contraceptives,contingencies,contaminating,conniption,condiment,concocting,comprehending,complacency,commendatore,comebacks,com'on,collarbone,colitis,coldly,coiffure,coffers,coeds,codependent,cocksucking,cockney,cockles,clutched,closeted,cloistered,cleve,cleats,clarifying,clapped,cinnabar,chunnel,chumps,cholinesterase,choirboy,chocolatey,chlamydia,chigliak,cheesie,chauvinistic,chasm,chartreuse,charo,charnier,chapil,chalked,chadway,certifiably,cellulite,celled,cavalcade,cataloging,castrated,cassio,cashews,cartouche,carnivore,carcinogens,capulet,captivated,capt'n,cancellations,campin,callate,callar,caffeinated,cadavers,cacophony,cackle,buzzes,buttoning,busload,burglaries,burbs,buona,bunions,bullheaded,buffs,bucyk,buckling,bruschetta,browbeating,broomsticks,broody,bromly,brolin,briefings,brewskies,breathalyzer,breakups,bratwurst,brania,braiding,brags,braggin,bradywood,bottomed,bossa,bordello,bookshelf,boogida,bondsman,bolder,boggles,bludgeoned,blowtorch,blotter,blips,blemish,bleaching,blainetologists,blading,blabbermouth,birdseed,bimmel,biloxi,biggly,bianchinni,betadine,berenson,belus,belloq,begets,befitting,beepers,beelzebub,beefed,bedridden,bedevere,beckons,beaded,baubles,bauble,battleground,bathrobes,basketballs,basements,barroom,barnacle,barkin,barked,baretta,bangles,bangler,banality,bambang,baltar,ballplayers,bagman,baffles,backroom,babysat,baboons,averse,audiotape,auctioneer,atten,atcha,astonishment,arugula,arroz,antihistamines,annoyances,anesthesiology,anatomically,anachronism,amiable,amaretto,allahu,alight,aimin,ailment,afterglow,affronte,advil,adrenals,actualization,acrost,ached,accursed,accoutrements,absconded,aboveboard,abetted,aargh,aaaahh,zuwicky,zolda,ziploc,zakamatak,youve,yippie,yesterdays,yella,yearns,yearnings,yearned,yawning,yalta,yahtzee,y'mean,y'are,wuthering,wreaks,worrisome,workiiing,wooooooo,wonky,womanizing,wolodarsky,wiwith,withdraws,wishy,wisht,wipers,wiper,winos,windthorne,windsurfing,windermere,wiggled,wiggen,whwhat,whodunit,whoaaa,whittling,whitesnake,whereof,wheezing,wheeze,whatd'ya,whataya,whammo,whackin,wellll,weightless,weevil,wedgies,webbing,weasly,wayside,waxes,waturi,washy,washrooms,wandell,waitaminute,waddya,waaaah,vornac,vishnoor,virulent,vindictiveness,vinceres,villier,vigeous,vestigial,ventilate,vented,venereal,veering,veered,veddy,vaslova,valosky,vailsburg,vaginas,vagas,urethra,upstaged,uploading,unwrapping,unwieldy,untapped,unsatisfied,unquenchable,unnerved,unmentionable,unlovable,unknowns,uninformed,unimpressed,unhappily,unguarded,unexplored,undergarment,undeniably,unclench,unclaimed,uncharacteristically,unbuttoned,unblemished,ululd,uhhhm,tweeze,tutsami,tushy,tuscarora,turkle,turghan,turbinium,tubers,trucoat,troxa,tropicana,triquetra,trimmers,triceps,trespassed,traya,traumatizing,transvestites,trainors,tradin,trackers,townies,tourelles,toucha,tossin,tortious,topshop,topes,tonics,tongs,tomsk,tomorrows,toiling,toddle,tizzy,tippers,timmi,thwap,thusly,ththe,thrusts,throwers,throwed,throughway,thickening,thermonuclear,thelwall,thataway,terrifically,tendons,teleportation,telepathically,telekinetic,teetering,teaspoons,tarantulas,tapas,tanned,tangling,tamales,tailors,tahitian,tactful,tachy,tablespoon,syrah,synchronicity,synch,synapses,swooning,switchman,swimsuits,sweltering,sweetly,suvolte,suslov,surfed,supposition,suppertime,supervillains,superfluous,superego,sunspots,sunning,sunless,sundress,suckah,succotash,sublevel,subbasement,studious,striping,strenuously,straights,stonewalled,stillness,stilettos,stevesy,steno,steenwyck,stargates,stammering,staedert,squiggly,squiggle,squashing,squaring,spreadsheet,spramp,spotters,sporto,spooking,splendido,spittin,spirulina,spiky,spate,spartacus,spacerun,soonest,something'll,someth,somepin,someone'll,sofas,soberly,sobered,snowmen,snowbank,snowballing,snivelling,sniffling,snakeskin,snagging,smush,smooter,smidgen,smackers,slumlord,slossum,slimmer,slighted,sleepwalk,sleazeball,skokie,skeptic,sitarides,sistah,sipped,sindell,simpletons,simony,silkwood,silks,silken,sightless,sideboard,shuttles,shrugging,shrouds,showy,shoveled,shouldn'ta,shoplifters,shitstorm,sheeny,shapetype,shaming,shallows,shackle,shabbily,shabbas,seppuku,senility,semite,semiautomatic,selznick,secretarial,sebacio,scuzzy,scummy,scrutinized,scrunchie,scribbled,scotches,scolded,scissor,schlub,scavenging,scarin,scarfing,scallions,scald,savour,savored,saute,sarcoidosis,sandbar,saluted,salish,saith,sailboats,sagittarius,sacre,saccharine,sacamano,rushdie,rumpled,rumba,rulebook,rubbers,roughage,rotisserie,rootie,roofy,roofie,romanticize,rittle,ristorante,rippin,rinsing,ringin,rincess,rickety,reveling,retest,retaliating,restorative,reston,restaurateur,reshoots,resetting,resentments,reprogramming,repossess,repartee,renzo,remore,remitting,remeber,relaxants,rejuvenate,rejections,regenerated,refocus,referrals,reeno,recycles,recrimination,reclining,recanting,reattach,reassigning,razgul,raved,rattlesnakes,rattles,rashly,raquetball,ransack,raisinettes,raheem,radisson,radishes,raban,quoth,qumari,quints,quilts,quilting,quien,quarreled,purty,purblind,punchbowl,publically,psychotics,psychopaths,psychoanalyze,pruning,provasik,protectin,propping,proportioned,prophylactic,proofed,prompter,procreate,proclivities,prioritizing,prinze,pricked,press'll,presets,prescribes,preocupe,prejudicial,prefex,preconceived,precipice,pralines,pragmatist,powerbar,pottie,pottersville,potsie,potholes,posses,posies,portkey,porterhouse,pornographers,poring,poppycock,poppers,pomponi,pokin,poitier,podiatry,pleeze,pleadings,playbook,platelets,plane'arium,placebos,place'll,pistachios,pirated,pinochle,pineapples,pinafore,pimples,piggly,piddling,picon,pickpockets,picchu,physiologically,physic,phobic,philandering,phenomenally,pheasants,pewter,petticoat,petronis,petitioning,perturbed,perpetuating,permutat,perishable,perimeters,perfumed,percocet,per'sus,pepperjack,penalize,pelting,pellet,peignoir,pedicures,peckers,pecans,pawning,paulsson,pattycake,patrolmen,patois,pathos,pasted,parishioner,parcheesi,parachuting,papayas,pantaloons,palpitations,palantine,paintballing,overtired,overstress,oversensitive,overnights,overexcited,overanxious,overachiever,outwitted,outvoted,outnumber,outlast,outlander,out've,orphey,orchestrating,openers,ooooooo,okies,ohhhhhhhhh,ohhhhhhhh,ogling,offbeat,obsessively,obeyed,o'hana,o'bannon,o'bannion,numpce,nummy,nuked,nuances,nourishing,nosedive,norbu,nomlies,nomine,nixed,nihilist,nightshift,newmeat,neglectful,neediness,needin,naphthalene,nanocytes,nanite,naivete,n'yeah,mystifying,myhnegon,mutating,musing,mulled,muggy,muerto,muckraker,muchachos,mountainside,motherless,mosquitos,morphed,mopped,moodoo,moncho,mollem,moisturiser,mohicans,mocks,mistresses,misspent,misinterpretation,miscarry,minuses,mindee,mimes,millisecond,milked,mightn't,mightier,mierzwiak,microchips,meyerling,mesmerizing,mershaw,meecrob,medicate,meddled,mckinnons,mcgewan,mcdunnough,mcats,mbien,matzah,matriarch,masturbated,masselin,martialed,marlboros,marksmanship,marinate,marchin,manicured,malnourished,malign,majorek,magnon,magnificently,macking,machiavellian,macdougal,macchiato,macaws,macanaw,m'self,lydells,lusts,lucite,lubricants,lopper,lopped,loneliest,lonelier,lomez,lojack,loath,liquefy,lippy,limps,likin,lightness,liesl,liebchen,licious,libris,libation,lhamo,leotards,leanin,laxatives,lavished,latka,lanyard,lanky,landmines,lameness,laddies,lacerated,labored,l'amour,kreskin,kovitch,kournikova,kootchy,konoss,knknow,knickety,knackety,kmart,klicks,kiwanis,kissable,kindergartners,kilter,kidnet,kid'll,kicky,kickbacks,kickback,kholokov,kewpie,kendo,katra,kareoke,kafelnikov,kabob,junjun,jumba,julep,jordie,jondy,jolson,jenoff,jawbone,janitorial,janiro,ipecac,invigorated,intruded,intros,intravenously,interruptus,interrogations,interject,interfacing,interestin,insuring,instilled,insensitivity,inscrutable,inroads,innards,inlaid,injector,ingratitude,infuriates,infra,infliction,indelicate,incubators,incrimination,inconveniencing,inconsolable,incestuous,incas,incarcerate,inbreeding,impudence,impressionists,impeached,impassioned,imipenem,idling,idiosyncrasies,icebergs,hypotensive,hydrochloride,hushed,humus,humph,hummm,hulking,hubcaps,hubald,howya,howbout,how'll,housebroken,hotwire,hotspots,hotheaded,horrace,hopsfield,honto,honkin,honeymoons,homewrecker,hombres,hollers,hollerin,hoedown,hoboes,hobbling,hobble,hoarse,hinky,highlighters,hexes,heru'ur,hernias,heppleman,hell're,heighten,heheheheheh,heheheh,hedging,heckling,heckled,heavyset,heatshield,heathens,heartthrob,headpiece,hayseed,haveo,hauls,hasten,harridan,harpoons,hardens,harcesis,harbouring,hangouts,halkein,haleh,halberstam,hairnet,hairdressers,hacky,haaaa,h'yah,gusta,gushy,gurgling,guilted,gruel,grudging,grrrrrr,grosses,groomsmen,griping,gravest,gratified,grated,goulash,goopy,goona,goodly,godliness,godawful,godamn,glycerin,glutes,glowy,globetrotters,glimpsed,glenville,glaucoma,girlscout,giraffes,gilbey,gigglepuss,ghora,gestating,gelato,geishas,gearshift,gayness,gasped,gaslighting,garretts,garba,gablyczyck,g'head,fumigating,fumbling,fudged,fuckwad,fuck're,fuchsia,fretting,freshest,frenchies,freezers,fredrica,fraziers,fraidy,foxholes,fourty,fossilized,forsake,forfeits,foreclosed,foreal,footsies,florists,flopped,floorshow,floorboard,flinching,flecks,flaubert,flatware,flatulence,flatlined,flashdance,flail,flagging,fiver,fitzy,fishsticks,finetti,finelli,finagle,filko,fieldstone,fibber,ferrini,feedin,feasting,favore,fathering,farrouhk,farmin,fairytale,fairservice,factoid,facedown,fabled,eyeballin,extortionist,exquisitely,expedited,exorcise,existentialist,execs,exculpatory,exacerbate,everthing,eventuality,evander,euphoric,euphemisms,estamos,erred,entitle,enquiries,enormity,enfants,endive,encyclopedias,emulating,embittered,effortless,ectopic,ecirc,easely,earphones,earmarks,dweller,durslar,durned,dunois,dunking,dunked,dumdum,dullard,dudleys,druthers,druggist,drossos,drooled,driveways,drippy,dreamless,drawstring,drang,drainpipe,dozing,dotes,dorkface,doorknobs,doohickey,donnatella,doncha,domicile,dokos,dobermans,dizzying,divola,ditsy,distaste,disservice,dislodged,dislodge,disinherit,disinformation,discounting,dinka,dimly,digesting,diello,diddling,dictatorships,dictators,diagnostician,devours,devilishly,detract,detoxing,detours,detente,destructs,desecrated,derris,deplore,deplete,demure,demolitions,demean,delish,delbruck,delaford,degaulle,deftly,deformity,deflate,definatly,defector,decrypted,decontamination,decapitate,decanter,dardis,dampener,damme,daddy'll,dabbling,dabbled,d'etre,d'argent,d'alene,d'agnasti,czechoslovakian,cymbal,cyberdyne,cutoffs,cuticle,curvaceous,curiousity,crowing,crowed,croutons,cropped,criminy,crescentis,crashers,cranwell,coverin,courtrooms,countenance,cosmically,cosign,corroboration,coroners,cornflakes,copperpot,copperhead,copacetic,coordsize,convulsing,consults,conjures,congenial,concealer,compactor,commercialism,cokey,cognizant,clunkers,clumsily,clucking,cloves,cloven,cloths,clothe,clods,clocking,clings,clavicle,classless,clashing,clanking,clanging,clamping,civvies,citywide,circulatory,circuited,chronisters,chromic,choos,chloroformed,chillun,cheesed,chatterbox,chaperoned,channukah,cerebellum,centerpieces,centerfold,ceecee,ccedil,cavorting,cavemen,cauterized,cauldwell,catting,caterine,cassiopeia,carves,cartwheel,carpeted,carob,caressing,carelessly,careening,capricious,capitalistic,capillaries,candidly,camaraderie,callously,calfskin,caddies,buttholes,busywork,busses,burps,burgomeister,bunkhouse,bungchow,bugler,buffets,buffed,brutish,brusque,bronchitis,bromden,brolly,broached,brewskis,brewin,brean,breadwinner,brana,bountiful,bouncin,bosoms,borgnine,bopping,bootlegs,booing,bombosity,bolting,boilerplate,bluey,blowback,blouses,bloodsuckers,bloodstained,bloat,bleeth,blackface,blackest,blackened,blacken,blackballed,blabs,blabbering,birdbrain,bipartisanship,biodegradable,biltmore,bilked,big'uns,bidet,besotted,bernheim,benegas,bendiga,belushi,bellboys,belittling,behinds,begone,bedsheets,beckoning,beaute,beaudine,beastly,beachfront,bathes,batak,baser,baseballs,barbella,bankrolling,bandaged,baerly,backlog,backin,babying,azkaban,awwwww,aviary,authorizes,austero,aunty,attics,atreus,astounded,astonish,artemus,arses,arintero,appraiser,apathetic,anybody'd,anxieties,anticlimactic,antar,anglos,angleman,anesthetist,androscoggin,andolini,andale,amway,amuck,amniocentesis,amnesiac,americano,amara,alvah,altruism,alternapalooza,alphabetize,alpaca,allus,allergist,alexandros,alaikum,akimbo,agoraphobia,agides,aggrhh,aftertaste,adoptions,adjuster,addictions,adamantium,activator,accomplishes,aberrant,aaaaargh,aaaaaaaaaaaaa,a'ight,zzzzzzz,zucchini,zookeeper,zirconia,zippers,zequiel,zellary,zeitgeist,zanuck,zagat,you'n,ylang,yes'm,yenta,yecchh,yecch,yawns,yankin,yahdah,yaaah,y'got,xeroxed,wwooww,wristwatch,wrangled,wouldst,worthiness,worshiping,wormy,wormtail,wormholes,woosh,wollsten,wolfing,woefully,wobbling,wintry,wingding,windstorm,windowtext,wiluna,wilting,wilted,willick,willenholly,wildflowers,wildebeest,whyyy,whoppers,whoaa,whizzing,whizz,whitest,whistled,whist,whinny,wheelies,whazzup,whatwhatwhaaat,whato,whatdya,what'dya,whacks,wewell,wetsuit,welluh,weeps,waylander,wavin,wassail,wasnt,warneford,warbucks,waltons,wallbanger,waiving,waitwait,vowing,voucher,vornoff,vorhees,voldemort,vivre,vittles,vindaloo,videogames,vichyssoise,vicarious,vesuvius,verguenza,ven't,velveteen,velour,velociraptor,vastness,vasectomies,vapors,vanderhof,valmont,validates,valiantly,vacuums,usurp,usernum,us'll,urinals,unyielding,unvarnished,unturned,untouchables,untangled,unsecured,unscramble,unreturned,unremarkable,unpretentious,unnerstand,unmade,unimpeachable,unfashionable,underwrite,underlining,underling,underestimates,underappreciated,uncouth,uncork,uncommonly,unclog,uncircumcised,unchallenged,uncas,unbuttoning,unapproved,unamerican,unafraid,umpteen,umhmm,uhwhy,ughuh,typewriters,twitches,twitched,twirly,twinkling,twinges,twiddling,turners,turnabout,tumblin,tryed,trowel,trousseau,trivialize,trifles,tribianni,trenchcoat,trembled,traumatize,transitory,transients,transfuse,transcribing,tranq,trampy,traipsed,trainin,trachea,traceable,touristy,toughie,toscanini,tortola,tortilla,torreon,toreador,tommorrow,tollbooth,tollans,toidy,togas,tofurkey,toddling,toddies,toasties,toadstool,to've,tingles,timin,timey,timetables,tightest,thuggee,thrusting,thrombus,throes,thrifty,thornharts,thinnest,thicket,thetas,thesulac,tethered,testaburger,tersenadine,terrif,terdlington,tepui,temping,tector,taxidermy,tastebuds,tartlets,tartabull,tar'd,tantamount,tangy,tangles,tamer,tabula,tabletops,tabithia,szechwan,synthedyne,svenjolly,svengali,survivalists,surmise,surfboards,surefire,suprise,supremacists,suppositories,superstore,supercilious,suntac,sunburned,summercliff,sullied,sugared,suckle,subtleties,substantiated,subsides,subliminal,subhuman,strowman,stroked,stroganoff,streetlight,straying,strainer,straighter,straightener,stoplight,stirrups,stewing,stereotyping,stepmommy,stephano,stashing,starshine,stairwells,squatsie,squandering,squalid,squabbling,squab,sprinkling,spreader,spongy,spokesmen,splintered,spittle,spitter,spiced,spews,spendin,spect,spearchucker,spatulas,southtown,soused,soshi,sorter,sorrowful,sooth,some'in,soliloquy,soiree,sodomized,sobriki,soaping,snows,snowcone,snitching,snitched,sneering,snausages,snaking,smoothed,smoochies,smarten,smallish,slushy,slurring,sluman,slithers,slippin,sleuthing,sleeveless,skinless,skillfully,sketchbook,skagnetti,sista,sinning,singularly,sinewy,silverlake,siguto,signorina,sieve,sidearms,shying,shunning,shtud,shrieks,shorting,shortbread,shopkeepers,shmancy,shizzit,shitheads,shitfaced,shipmates,shiftless,shelving,shedlow,shavings,shatters,sharifa,shampoos,shallots,shafter,sha'nauc,sextant,serviceable,sepsis,senores,sendin,semis,semanski,selflessly,seinfelds,seers,seeps,seductress,secaucus,sealant,scuttling,scusa,scrunched,scissorhands,schreber,schmancy,scamps,scalloped,savoir,savagery,sarong,sarnia,santangel,samool,sallow,salino,safecracker,sadism,sacrilegious,sabrini,sabath,s'aright,ruttheimer,rudest,rubbery,rousting,rotarian,roslin,roomed,romari,romanica,rolltop,rolfski,rockettes,roared,ringleader,riffing,ribcage,rewired,retrial,reting,resuscitated,restock,resale,reprogrammed,replicant,repentant,repellant,repays,repainting,renegotiating,rendez,remem,relived,relinquishes,relearn,relaxant,rekindling,rehydrate,refueled,refreshingly,refilling,reexamine,reeseman,redness,redeemable,redcoats,rectangles,recoup,reciprocated,reassessing,realy,realer,reachin,re'kali,rawlston,ravages,rappaports,ramoray,ramming,raindrops,rahesh,radials,racists,rabartu,quiches,quench,quarreling,quaintly,quadrants,putumayo,put'em,purifier,pureed,punitis,pullout,pukin,pudgy,puddings,puckering,pterodactyl,psychodrama,psats,protestations,protectee,prosaic,propositioned,proclivity,probed,printouts,prevision,pressers,preset,preposition,preempt,preemie,preconceptions,prancan,powerpuff,potties,potpie,poseur,porthole,poops,pooping,pomade,polyps,polymerized,politeness,polisher,polack,pocketknife,poatia,plebeian,playgroup,platonically,platitude,plastering,plasmapheresis,plaids,placemats,pizzazz,pintauro,pinstripes,pinpoints,pinkner,pincer,pimento,pileup,pilates,pigmen,pieeee,phrased,photocopies,phoebes,philistines,philanderer,pheromone,phasers,pfeffernuesse,pervs,perspire,personify,perservere,perplexed,perpetrating,perkiness,perjurer,periodontist,perfunctory,perdido,percodan,pentameter,pentacle,pensive,pensione,pennybaker,pennbrooke,penhall,pengin,penetti,penetrates,pegnoir,peeve,peephole,pectorals,peckin,peaky,peaksville,paxcow,paused,patted,parkishoff,parkers,pardoning,paraplegic,paraphrasing,paperers,papered,pangs,paneling,palooza,palmed,palmdale,palatable,pacify,pacified,owwwww,oversexed,overrides,overpaying,overdrawn,overcompensate,overcomes,overcharged,outmaneuver,outfoxed,oughtn't,ostentatious,oshun,orthopedist,or'derves,ophthalmologist,operagirl,oozes,oooooooh,onesie,omnis,omelets,oktoberfest,okeydoke,ofthe,ofher,obstetrical,obeys,obeah,o'henry,nyquil,nyanyanyanyah,nuttin,nutsy,nutball,nurhachi,numbskull,nullifies,nullification,nucking,nubbin,nourished,nonspecific,noing,noinch,nohoho,nobler,nitwits,newsprint,newspaperman,newscaster,neuropathy,netherworld,neediest,navasky,narcissists,napped,nafta,mache,mykonos,mutilating,mutherfucker,mutha,mutates,mutate,musn't,murchy,multitasking,mujeeb,mudslinging,muckraking,mousetrap,mourns,mournful,motherf,mostro,morphing,morphate,moralistic,moochy,mooching,monotonous,monopolize,monocle,molehill,moland,mofet,mockup,mobilizing,mmmmmmm,mitzvahs,mistreating,misstep,misjudge,misinformation,misdirected,miscarriages,miniskirt,mindwarped,minced,milquetoast,miguelito,mightily,midstream,midriff,mideast,microbe,methuselah,mesdames,mescal,men'll,memma,megaton,megara,megalomaniac,meeee,medulla,medivac,meaninglessness,mcnuggets,mccarthyism,maypole,may've,mauve,mateys,marshack,markles,marketable,mansiere,manservant,manse,manhandling,mallomars,malcontent,malaise,majesties,mainsail,mailmen,mahandra,magnolias,magnified,magev,maelstrom,machu,macado,m'boy,m'appelle,lustrous,lureen,lunges,lumped,lumberyard,lulled,luego,lucks,lubricated,loveseat,loused,lounger,loski,lorre,loora,looong,loonies,loincloth,lofts,lodgers,lobbing,loaner,livered,liqueur,ligourin,lifesaving,lifeguards,lifeblood,liaisons,let'em,lesbianism,lence,lemonlyman,legitimize,leadin,lazars,lazarro,lawyering,laugher,laudanum,latrines,lations,laters,lapels,lakefront,lahit,lafortunata,lachrymose,l'italien,kwaini,kruczynski,kramerica,kowtow,kovinsky,korsekov,kopek,knowakowski,knievel,knacks,kiowas,killington,kickball,keyworth,keymaster,kevie,keveral,kenyons,keggers,keepsakes,kechner,keaty,kavorka,karajan,kamerev,kaggs,jujyfruit,jostled,jonestown,jokey,joists,jocko,jimmied,jiggled,jests,jenzen,jenko,jellyman,jedediah,jealitosis,jaunty,jarmel,jankle,jagoff,jagielski,jackrabbits,jabbing,jabberjaw,izzat,irresponsibly,irrepressible,irregularity,irredeemable,inuvik,intuitions,intubated,intimates,interminable,interloper,intercostal,instyle,instigate,instantaneously,ining,ingrown,ingesting,infusing,infringe,infinitum,infact,inequities,indubitably,indisputable,indescribably,indentation,indefinable,incontrovertible,inconsequential,incompletes,incoherently,inclement,incidentals,inarticulate,inadequacies,imprudent,improprieties,imprison,imprinted,impressively,impostors,importante,imperious,impale,immodest,immobile,imbedded,imbecilic,illegals,idn't,hysteric,hypotenuse,hygienic,hyeah,hushpuppies,hunhh,humpback,humored,hummed,humiliates,humidifier,huggy,huggers,huckster,hotbed,hosing,hosers,horsehair,homebody,homebake,holing,holies,hoisting,hogwallop,hocks,hobbits,hoaxes,hmmmmm,hisses,hippest,hillbillies,hilarity,heurh,herniated,hermaphrodite,hennifer,hemlines,hemline,hemery,helplessness,helmsley,hellhound,heheheheh,heeey,hedda,heartbeats,heaped,healers,headstart,headsets,headlong,hawkland,havta,haulin,harvey'll,hanta,hansom,hangnail,handstand,handrail,handoff,hallucinogen,hallor,halitosis,haberdashery,gypped,guy'll,gumbel,guerillas,guava,guardrail,grunther,grunick,groppi,groomer,grodin,gripes,grinds,grifters,gretch,greevey,greasing,graveyards,grandkid,grainy,gouging,gooney,googly,goldmuff,goldenrod,goingo,godly,gobbledygook,gobbledegook,glues,gloriously,glengarry,glassware,glamor,gimmicks,giggly,giambetti,ghoulish,ghettos,ghali,gether,geriatrics,gerbils,geosynchronous,georgio,gente,gendarme,gelbman,gazillionth,gayest,gauging,gastro,gaslight,gasbag,garters,garish,garas,gantu,gangy,gangly,gangland,galling,gadda,furrowed,funnies,funkytown,fugimotto,fudging,fuckeen,frustrates,froufrou,froot,fromberge,frizzies,fritters,frightfully,friendliest,freeloading,freelancing,freakazoid,fraternization,framers,fornication,fornicating,forethought,footstool,foisting,focussing,focking,flurries,fluffed,flintstones,fledermaus,flayed,flawlessly,flatters,flashbang,flapped,fishies,firmer,fireproof,firebug,fingerpainting,finessed,findin,financials,finality,fillets,fiercest,fiefdom,fibbing,fervor,fentanyl,fenelon,fedorchuk,feckless,feathering,faucets,farewells,fantasyland,fanaticism,faltered,faggy,faberge,extorting,extorted,exterminating,exhumation,exhilaration,exhausts,exfoliate,excels,exasperating,exacting,everybody'd,evasions,espressos,esmail,errrr,erratically,eroding,ernswiler,epcot,enthralled,ensenada,enriching,enrage,enhancer,endear,encrusted,encino,empathic,embezzle,emanates,electricians,eking,egomaniacal,egging,effacing,ectoplasm,eavesdropped,dummkopf,dugray,duchaisne,drunkard,drudge,droop,droids,drips,dripped,dribbles,drazens,downy,downsize,downpour,dosages,doppelganger,dopes,doohicky,dontcha,doneghy,divining,divest,diuretics,diuretic,distrustful,disrupts,dismemberment,dismember,disinfect,disillusionment,disheartening,discourteous,discotheque,discolored,dirtiest,diphtheria,dinks,dimpled,didya,dickwad,diatribes,diathesis,diabetics,deviants,detonates,detests,detestable,detaining,despondent,desecration,derision,derailing,deputized,depressors,dependant,dentures,denominators,demur,demonology,delts,dellarte,delacour,deflated,defib,defaced,decorators,deaqon,davola,datin,darwinian,darklighters,dandelions,dampened,damaskinos,dalrimple,d'peshu,d'hoffryn,d'astier,cynics,cutesy,cutaway,curmudgeon,curdle,culpability,cuisinart,cuffing,crypts,cryptid,crunched,crumblers,crudely,crosscheck,croon,crissake,crevasse,creswood,creepo,creases,creased,creaky,cranks,crabgrass,coveralls,couple'a,coughs,coslaw,corporeal,cornucopia,cornering,corks,cordoned,coolly,coolin,cookbooks,contrite,contented,constrictor,confound,confit,confiscating,condoned,conditioners,concussions,comprendo,comers,combustible,combusted,collingswood,coldness,coitus,codicil,coasting,clydesdale,cluttering,clunker,clunk,clumsiness,clotted,clothesline,clinches,clincher,cleverness,clench,clein,cleanses,claymores,clammed,chugging,chronically,christsakes,choque,chompers,chiseling,chirpy,chirp,chinks,chingachgook,chickenpox,chickadee,chewin,chessboard,chargin,chanteuse,chandeliers,chamdo,chagrined,chaff,certs,certainties,cerreno,cerebrum,censured,cemetary,caterwauling,cataclysmic,casitas,cased,carvel,carting,carrear,carolling,carolers,carnie,cardiogram,carbuncle,capulets,canines,candaules,canape,caldecott,calamitous,cadillacs,cachet,cabeza,cabdriver,buzzards,butai,businesswomen,bungled,bumpkins,bummers,bulldoze,buffybot,bubut,bubbies,brrrrr,brownout,brouhaha,bronzing,bronchial,broiler,briskly,briefcases,bricked,breezing,breeher,breakable,breadstick,bravenet,braved,brandies,brainwaves,brainiest,braggart,bradlee,boys're,boys'll,boys'd,boutonniere,bossed,bosomy,borans,boosts,bookshelves,bookends,boneless,bombarding,bollo,boinked,boink,bluest,bluebells,bloodshot,blockhead,blockbusters,blithely,blather,blankly,bladders,blackbeard,bitte,bippy,biogenetics,bilge,bigglesworth,bicuspids,beususe,betaseron,besmirch,bernece,bereavement,bentonville,benchley,benching,bembe,bellyaching,bellhops,belie,beleaguered,behrle,beginnin,begining,beenie,beefs,beechwood,becau,beaverhausen,beakers,bazillion,baudouin,barrytown,barringtons,barneys,barbs,barbers,barbatus,bankrupted,bailiffs,backslide,baby'd,baaad,b'fore,awwwk,aways,awakes,automatics,authenticate,aught,aubyn,attired,attagirl,atrophied,asystole,astroturf,assertiveness,artichokes,arquillians,aright,archenemy,appraise,appeased,antin,anspaugh,anesthetics,anaphylactic,amscray,ambivalence,amalio,alriiight,alphabetized,alpena,alouette,allora,alliteration,allenwood,allegiances,algerians,alcerro,alastor,ahaha,agitators,aforethought,advertises,admonition,adirondacks,adenoids,acupuncturist,acula,actuarial,activators,actionable,achingly,accusers,acclimated,acclimate,absurdly,absorbent,absolvo,absolutes,absences,abdomenizer,aaaaaaaaah,aaaaaaaaaa,a'right".split(","),
74282male_names:"james,john,robert,michael,william,david,richard,charles,joseph,thomas,christopher,daniel,paul,mark,donald,george,kenneth,steven,edward,brian,ronald,anthony,kevin,jason,matthew,gary,timothy,jose,larry,jeffrey,frank,scott,eric,stephen,andrew,raymond,gregory,joshua,jerry,dennis,walter,patrick,peter,harold,douglas,henry,carl,arthur,ryan,roger,joe,juan,jack,albert,jonathan,justin,terry,gerald,keith,samuel,willie,ralph,lawrence,nicholas,roy,benjamin,bruce,brandon,adam,harry,fred,wayne,billy,steve,louis,jeremy,aaron,randy,eugene,carlos,russell,bobby,victor,ernest,phillip,todd,jesse,craig,alan,shawn,clarence,sean,philip,chris,johnny,earl,jimmy,antonio,danny,bryan,tony,luis,mike,stanley,leonard,nathan,dale,manuel,rodney,curtis,norman,marvin,vincent,glenn,jeffery,travis,jeff,chad,jacob,melvin,alfred,kyle,francis,bradley,jesus,herbert,frederick,ray,joel,edwin,don,eddie,ricky,troy,randall,barry,bernard,mario,leroy,francisco,marcus,micheal,theodore,clifford,miguel,oscar,jay,jim,tom,calvin,alex,jon,ronnie,bill,lloyd,tommy,leon,derek,darrell,jerome,floyd,leo,alvin,tim,wesley,dean,greg,jorge,dustin,pedro,derrick,dan,zachary,corey,herman,maurice,vernon,roberto,clyde,glen,hector,shane,ricardo,sam,rick,lester,brent,ramon,tyler,gilbert,gene,marc,reginald,ruben,brett,nathaniel,rafael,edgar,milton,raul,ben,cecil,duane,andre,elmer,brad,gabriel,ron,roland,jared,adrian,karl,cory,claude,erik,darryl,neil,christian,javier,fernando,clinton,ted,mathew,tyrone,darren,lonnie,lance,cody,julio,kurt,allan,clayton,hugh,max,dwayne,dwight,armando,felix,jimmie,everett,ian,ken,bob,jaime,casey,alfredo,alberto,dave,ivan,johnnie,sidney,byron,julian,isaac,clifton,willard,daryl,virgil,andy,salvador,kirk,sergio,seth,kent,terrance,rene,eduardo,terrence,enrique,freddie,stuart,fredrick,arturo,alejandro,joey,nick,luther,wendell,jeremiah,evan,julius,donnie,otis,trevor,luke,homer,gerard,doug,kenny,hubert,angelo,shaun,lyle,matt,alfonso,orlando,rex,carlton,ernesto,pablo,lorenzo,omar,wilbur,blake,horace,roderick,kerry,abraham,rickey,ira,andres,cesar,johnathan,malcolm,rudolph,damon,kelvin,rudy,preston,alton,archie,marco,pete,randolph,garry,geoffrey,jonathon,felipe,bennie,gerardo,dominic,loren,delbert,colin,guillermo,earnest,benny,noel,rodolfo,myron,edmund,salvatore,cedric,lowell,gregg,sherman,devin,sylvester,roosevelt,israel,jermaine,forrest,wilbert,leland,simon,irving,owen,rufus,woodrow,sammy,kristopher,levi,marcos,gustavo,jake,lionel,marty,gilberto,clint,nicolas,laurence,ismael,orville,drew,ervin,dewey,wilfred,josh,hugo,ignacio,caleb,tomas,sheldon,erick,frankie,darrel,rogelio,terence,alonzo,elias,bert,elbert,ramiro,conrad,noah,grady,phil,cornelius,lamar,rolando,clay,percy,bradford,merle,darin,amos,terrell,moses,irvin,saul,roman,darnell,randal,tommie,timmy,darrin,brendan,toby,van,abel,dominick,emilio,elijah,cary,domingo,aubrey,emmett,marlon,emanuel,jerald,edmond,emil,dewayne,otto,teddy,reynaldo,bret,jess,trent,humberto,emmanuel,stephan,louie,vicente,lamont,garland,micah,efrain,heath,rodger,demetrius,ethan,eldon,rocky,pierre,eli,bryce,antoine,robbie,kendall,royce,sterling,grover,elton,cleveland,dylan,chuck,damian,reuben,stan,leonardo,russel,erwin,benito,hans,monte,blaine,ernie,curt,quentin,agustin,jamal,devon,adolfo,tyson,wilfredo,bart,jarrod,vance,denis,damien,joaquin,harlan,desmond,elliot,darwin,gregorio,kermit,roscoe,esteban,anton,solomon,norbert,elvin,nolan,carey,rod,quinton,hal,brain,rob,elwood,kendrick,darius,moises,marlin,fidel,thaddeus,cliff,marcel,ali,raphael,bryon,armand,alvaro,jeffry,dane,joesph,thurman,ned,sammie,rusty,michel,monty,rory,fabian,reggie,kris,isaiah,gus,avery,loyd,diego,adolph,millard,rocco,gonzalo,derick,rodrigo,gerry,rigoberto,alphonso,rickie,noe,vern,elvis,bernardo,mauricio,hiram,donovan,basil,nickolas,scot,vince,quincy,eddy,sebastian,federico,ulysses,heriberto,donnell,denny,gavin,emery,romeo,jayson,dion,dante,clement,coy,odell,jarvis,bruno,issac,dudley,sanford,colby,carmelo,nestor,hollis,stefan,donny,linwood,beau,weldon,galen,isidro,truman,delmar,johnathon,silas,frederic,irwin,merrill,charley,marcelino,carlo,trenton,kurtis,aurelio,winfred,vito,collin,denver,leonel,emory,pasquale,mohammad,mariano,danial,landon,dirk,branden,adan,numbers,clair,buford,bernie,wilmer,emerson,zachery,jacques,errol,josue,edwardo,wilford,theron,raymundo,daren,tristan,robby,lincoln,jame,genaro,octavio,cornell,hung,arron,antony,herschel,alva,giovanni,garth,cyrus,cyril,ronny,stevie,lon,kennith,carmine,augustine,erich,chadwick,wilburn,russ,myles,jonas,mitchel,mervin,zane,jamel,lazaro,alphonse,randell,johnie,jarrett,ariel,abdul,dusty,luciano,seymour,scottie,eugenio,mohammed,arnulfo,lucien,ferdinand,thad,ezra,aldo,rubin,mitch,earle,abe,marquis,lanny,kareem,jamar,boris,isiah,emile,elmo,aron,leopoldo,everette,josef,eloy,dorian,rodrick,reinaldo,lucio,jerrod,weston,hershel,lemuel,lavern,burt,jules,gil,eliseo,ahmad,nigel,efren,antwan,alden,margarito,refugio,dino,osvaldo,les,deandre,normand,kieth,ivory,trey,norberto,napoleon,jerold,fritz,rosendo,milford,sang,deon,christoper,alfonzo,lyman,josiah,brant,wilton,rico,jamaal,dewitt,brenton,yong,olin,faustino,claudio,judson,gino,edgardo,alec,jarred,donn,trinidad,tad,porfirio,odis,lenard,chauncey,tod,mel,marcelo,kory,augustus,keven,hilario,bud,sal,orval,mauro,dannie,zachariah,olen,anibal,milo,jed,thanh,amado,lenny,tory,richie,horacio,brice,mohamed,delmer,dario,mac,jonah,jerrold,robt,hank,sung,rupert,rolland,kenton,damion,chi,antone,waldo,fredric,bradly,kip,burl,tyree,jefferey,ahmed,willy,stanford,oren,moshe,mikel,enoch,brendon,quintin,jamison,florencio,darrick,tobias,minh,hassan,giuseppe,demarcus,cletus,tyrell,lyndon,keenan,werner,theo,geraldo,columbus,chet,bertram,markus,huey,hilton,dwain,donte,tyron,omer,isaias,hipolito,fermin,chung,adalberto,jamey,teodoro,mckinley,maximo,raleigh,lawerence,abram,rashad,emmitt,daron,chong,samual,otha,miquel,eusebio,dong,domenic,darron,wilber,renato,hoyt,haywood,ezekiel,chas,florentino,elroy,clemente,arden,neville,edison,deshawn,carrol,shayne,nathanial,jordon,danilo,claud,sherwood,raymon,rayford,cristobal,ambrose,titus,hyman,felton,ezequiel,erasmo,lonny,milan,lino,jarod,herb,andreas,rhett,jude,douglass,cordell,oswaldo,ellsworth,virgilio,toney,nathanael,benedict,mose,hong,isreal,garret,fausto,arlen,zack,modesto,francesco,manual,gaylord,gaston,filiberto,deangelo,michale,granville,malik,zackary,tuan,nicky,cristopher,antione,malcom,korey,jospeh,colton,waylon,hosea,shad,santo,rudolf,rolf,renaldo,marcellus,lucius,kristofer,harland,arnoldo,rueben,leandro,kraig,jerrell,jeromy,hobert,cedrick,arlie,winford,wally,luigi,keneth,jacinto,graig,franklyn,edmundo,leif,jeramy,willian,vincenzo,shon,michal,lynwood,jere,elden,darell,broderick,alonso".split(",")},module.exports=frequency_lists;
74283
74284},{}],4:[function(require,module,exports){
74285var feedback,matching,scoring,time,time_estimates,zxcvbn;matching=require("./matching"),scoring=require("./scoring"),time_estimates=require("./time_estimates"),feedback=require("./feedback"),time=function(){return(new Date).getTime()},zxcvbn=function(e,t){var i,n,c,s,a,r,m,o,u,g,_;for(null==t&&(t=[]),g=time(),u=[],c=0,s=t.length;c<s;c++)i=t[c],"string"!=(m=typeof i)&&"number"!==m&&"boolean"!==m||u.push(i.toString().toLowerCase());matching.set_user_input_dictionary(u),a=matching.omnimatch(e),o=scoring.most_guessable_match_sequence(e,a),o.calc_time=time()-g,n=time_estimates.estimate_attack_times(o.guesses);for(r in n)_=n[r],o[r]=_;return o.feedback=feedback.get_feedback(o.score,o.sequence),o},module.exports=zxcvbn;
74286
74287},{"./feedback":2,"./matching":5,"./scoring":6,"./time_estimates":7}],5:[function(require,module,exports){
74288var DATE_MAX_YEAR,DATE_MIN_YEAR,DATE_SPLITS,GRAPHS,L33T_TABLE,RANKED_DICTIONARIES,REGEXEN,adjacency_graphs,build_ranked_dict,frequency_lists,lst,matching,name,scoring;frequency_lists=require("./frequency_lists"),adjacency_graphs=require("./adjacency_graphs"),scoring=require("./scoring"),build_ranked_dict=function(e){var t,n,r,i,a;for(i={},t=1,r=0,n=e.length;r<n;r++)a=e[r],i[a]=t,t+=1;return i},RANKED_DICTIONARIES={};for(name in frequency_lists)lst=frequency_lists[name],RANKED_DICTIONARIES[name]=build_ranked_dict(lst);GRAPHS={qwerty:adjacency_graphs.qwerty,dvorak:adjacency_graphs.dvorak,keypad:adjacency_graphs.keypad,mac_keypad:adjacency_graphs.mac_keypad},L33T_TABLE={a:["4","@"],b:["8"],c:["(","{","[","<"],e:["3"],g:["6","9"],i:["1","!","|"],l:["1","|","7"],o:["0"],s:["$","5"],t:["+","7"],x:["%"],z:["2"]},REGEXEN={recent_year:/19\d\d|200\d|201\d/g},DATE_MAX_YEAR=2050,DATE_MIN_YEAR=1e3,DATE_SPLITS={4:[[1,2],[2,3]],5:[[1,3],[2,3]],6:[[1,2],[2,4],[4,5]],7:[[1,3],[2,3],[4,5],[4,6]],8:[[2,4],[4,6]]},matching={empty:function(e){var t;return 0===function(){var n;n=[];for(t in e)n.push(t);return n}().length},extend:function(e,t){return e.push.apply(e,t)},translate:function(e,t){var n;return function(){var r,i,a,s;for(a=e.split(""),s=[],i=0,r=a.length;i<r;i++)n=a[i],s.push(t[n]||n);return s}().join("")},mod:function(e,t){return(e%t+t)%t},sorted:function(e){return e.sort(function(e,t){return e.i-t.i||e.j-t.j})},omnimatch:function(e){var t,n,r,i,a;for(i=[],r=[this.dictionary_match,this.reverse_dictionary_match,this.l33t_match,this.spatial_match,this.repeat_match,this.sequence_match,this.regex_match,this.date_match],a=0,t=r.length;a<t;a++)n=r[a],this.extend(i,n.call(this,e));return this.sorted(i)},dictionary_match:function(e,t){var n,r,i,a,s,o,h,u,c,l,_,f,d,p;null==t&&(t=RANKED_DICTIONARIES),s=[],a=e.length,u=e.toLowerCase();for(n in t)for(l=t[n],r=o=0,_=a;0<=_?o<_:o>_;r=0<=_?++o:--o)for(i=h=f=r,d=a;f<=d?h<d:h>d;i=f<=d?++h:--h)u.slice(r,+i+1||9e9)in l&&(p=u.slice(r,+i+1||9e9),c=l[p],s.push({pattern:"dictionary",i:r,j:i,token:e.slice(r,+i+1||9e9),matched_word:p,rank:c,dictionary_name:n,reversed:!1,l33t:!1}));return this.sorted(s)},reverse_dictionary_match:function(e,t){var n,r,i,a,s,o;for(null==t&&(t=RANKED_DICTIONARIES),o=e.split("").reverse().join(""),i=this.dictionary_match(o,t),a=0,n=i.length;a<n;a++)r=i[a],r.token=r.token.split("").reverse().join(""),r.reversed=!0,s=[e.length-1-r.j,e.length-1-r.i],r.i=s[0],r.j=s[1];return this.sorted(i)},set_user_input_dictionary:function(e){return RANKED_DICTIONARIES.user_inputs=build_ranked_dict(e.slice())},relevant_l33t_subtable:function(e,t){var n,r,i,a,s,o,h,u,c,l;for(s={},o=e.split(""),a=0,r=o.length;a<r;a++)n=o[a],s[n]=!0;l={};for(i in t)c=t[i],h=function(){var e,t,n;for(n=[],t=0,e=c.length;t<e;t++)u=c[t],u in s&&n.push(u);return n}(),h.length>0&&(l[i]=h);return l},enumerate_l33t_subs:function(e){var t,n,r,i,a,s,o,h,u,c,l,_,f,d,p;a=function(){var t;t=[];for(i in e)t.push(i);return t}(),p=[[]],n=function(e){var t,n,r,a,s,o,h,u;for(n=[],s={},o=0,a=e.length;o<a;o++)h=e[o],t=function(){var e,t,n;for(n=[],u=t=0,e=h.length;t<e;u=++t)i=h[u],n.push([i,u]);return n}(),t.sort(),r=function(){var e,n,r;for(r=[],u=n=0,e=t.length;n<e;u=++n)i=t[u],r.push(i+","+u);return r}().join("-"),r in s||(s[r]=!0,n.push(h));return n},r=function(t){var i,a,s,o,h,u,c,l,_,f,d,g,m,A,E,y;if(t.length){for(a=t[0],m=t.slice(1),c=[],d=e[a],l=0,h=d.length;l<h;l++)for(o=d[l],_=0,u=p.length;_<u;_++){for(A=p[_],i=-1,s=f=0,g=A.length;0<=g?f<g:f>g;s=0<=g?++f:--f)if(A[s][0]===o){i=s;break}i===-1?(y=A.concat([[o,a]]),c.push(y)):(E=A.slice(0),E.splice(i,1),E.push([o,a]),c.push(A),c.push(E))}return p=n(c),r(m)}},r(a),d=[];for(u=0,o=p.length;u<o;u++){for(_=p[u],f={},c=0,h=_.length;c<h;c++)l=_[c],s=l[0],t=l[1],f[s]=t;d.push(f)}return d},l33t_match:function(e,t,n){var r,i,a,s,o,h,u,c,l,_,f,d,p,g,m,A;for(null==t&&(t=RANKED_DICTIONARIES),null==n&&(n=L33T_TABLE),u=[],_=this.enumerate_l33t_subs(this.relevant_l33t_subtable(e,n)),c=0,a=_.length;c<a&&(d=_[c],!this.empty(d));c++)for(g=this.translate(e,d),f=this.dictionary_match(g,t),l=0,s=f.length;l<s;l++)if(o=f[l],m=e.slice(o.i,+o.j+1||9e9),m.toLowerCase()!==o.matched_word){h={};for(p in d)r=d[p],m.indexOf(p)!==-1&&(h[p]=r);o.l33t=!0,o.token=m,o.sub=h,o.sub_display=function(){var e;e=[];for(i in h)A=h[i],e.push(i+" -> "+A);return e}().join(", "),u.push(o)}return this.sorted(u.filter(function(e){return e.token.length>1}))},spatial_match:function(e,t){var n,r,i;null==t&&(t=GRAPHS),i=[];for(r in t)n=t[r],this.extend(i,this.spatial_match_helper(e,n,r));return this.sorted(i)},SHIFTED_RX:/[~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?]/,spatial_match_helper:function(e,t,n){var r,i,a,s,o,h,u,c,l,_,f,d,p,g,m;for(f=[],u=0;u<e.length-1;)for(c=u+1,l=null,m=0,g="qwerty"!==n&&"dvorak"!==n||!this.SHIFTED_RX.exec(e.charAt(u))?0:1;;){if(p=e.charAt(c-1),o=!1,h=-1,s=-1,i=t[p]||[],c<e.length)for(a=e.charAt(c),d=0,_=i.length;d<_;d++)if(r=i[d],s+=1,r&&r.indexOf(a)!==-1){o=!0,h=s,1===r.indexOf(a)&&(g+=1),l!==h&&(m+=1,l=h);break}if(!o){c-u>2&&f.push({pattern:"spatial",i:u,j:c-1,token:e.slice(u,c),graph:n,turns:m,shifted_count:g}),u=c;break}c+=1}return f},repeat_match:function(e){var t,n,r,i,a,s,o,h,u,c,l,_,f,d,p;for(d=[],a=/(.+)\1+/g,c=/(.+?)\1+/g,l=/^(.+?)\1+$/,u=0;u<e.length&&(a.lastIndex=c.lastIndex=u,s=a.exec(e),_=c.exec(e),null!=s);)s[0].length>_[0].length?(f=s,i=l.exec(f[0])[1]):(f=_,i=f[1]),p=[f.index,f.index+f[0].length-1],o=p[0],h=p[1],t=scoring.most_guessable_match_sequence(i,this.omnimatch(i)),r=t.sequence,n=t.guesses,d.push({pattern:"repeat",i:o,j:h,token:f[0],base_token:i,base_guesses:n,base_matches:r,repeat_count:f[0].length/i.length}),u=h+1;return d},MAX_DELTA:5,sequence_match:function(e){var t,n,r,i,a,s,o,h,u;if(1===e.length)return[];for(u=function(t){return function(n,r,i){var a,s,o,u;if((r-n>1||1===Math.abs(i))&&0<(a=Math.abs(i))&&a<=t.MAX_DELTA)return u=e.slice(n,+r+1||9e9),/^[a-z]+$/.test(u)?(s="lower",o=26):/^[A-Z]+$/.test(u)?(s="upper",o=26):/^\d+$/.test(u)?(s="digits",o=10):(s="unicode",o=26),h.push({pattern:"sequence",i:n,j:r,token:e.slice(n,+r+1||9e9),sequence_name:s,sequence_space:o,ascending:i>0})}}(this),h=[],n=0,a=null,i=s=1,o=e.length;1<=o?s<o:s>o;i=1<=o?++s:--s)t=e.charCodeAt(i)-e.charCodeAt(i-1),null==a&&(a=t),t!==a&&(r=i-1,u(n,r,a),n=r,a=t);return u(n,e.length-1,a),h},regex_match:function(e,t){var n,r,i,a;null==t&&(t=REGEXEN),n=[];for(name in t)for(r=t[name],r.lastIndex=0;i=r.exec(e);)a=i[0],n.push({pattern:"regex",token:a,i:i.index,j:i.index+i[0].length-1,regex_name:name,regex_match:i});return this.sorted(n)},date_match:function(e){var t,n,r,i,a,s,o,h,u,c,l,_,f,d,p,g,m,A,E,y,v,I,R,T,D,k,x,j,b,N,S,q,L,M;for(_=[],f=/^\d{4,8}$/,d=/^(\d{1,4})([\s\/\\_.-])(\d{1,2})\2(\d{1,4})$/,s=m=0,v=e.length-4;0<=v?m<=v:m>=v;s=0<=v?++m:--m)for(o=A=I=s+3,R=s+7;(I<=R?A<=R:A>=R)&&!(o>=e.length);o=I<=R?++A:--A)if(M=e.slice(s,+o+1||9e9),f.exec(M)){for(r=[],T=DATE_SPLITS[M.length],E=0,c=T.length;E<c;E++)D=T[E],h=D[0],u=D[1],a=this.map_ints_to_dmy([parseInt(M.slice(0,h)),parseInt(M.slice(h,u)),parseInt(M.slice(u))]),null!=a&&r.push(a);if(r.length>0){for(t=r[0],p=function(e){return Math.abs(e.year-scoring.REFERENCE_YEAR)},g=p(r[0]),k=r.slice(1),y=0,l=k.length;y<l;y++)n=k[y],i=p(n),i<g&&(x=[n,i],t=x[0],g=x[1]);_.push({pattern:"date",token:M,i:s,j:o,separator:"",year:t.year,month:t.month,day:t.day})}}for(s=q=0,j=e.length-6;0<=j?q<=j:q>=j;s=0<=j?++q:--q)for(o=L=b=s+5,N=s+9;(b<=N?L<=N:L>=N)&&!(o>=e.length);o=b<=N?++L:--L)M=e.slice(s,+o+1||9e9),S=d.exec(M),null!=S&&(a=this.map_ints_to_dmy([parseInt(S[1]),parseInt(S[3]),parseInt(S[4])]),null!=a&&_.push({pattern:"date",token:M,i:s,j:o,separator:S[2],year:a.year,month:a.month,day:a.day}));return this.sorted(_.filter(function(e){var t,n,r,i;for(t=!1,i=0,n=_.length;i<n;i++)if(r=_[i],e!==r&&r.i<=e.i&&r.j>=e.j){t=!0;break}return!t}))},map_ints_to_dmy:function(e){var t,n,r,i,a,s,o,h,u,c,l,_,f,d,p,g;if(!(e[1]>31||e[1]<=0)){for(o=0,h=0,p=0,s=0,r=e.length;s<r;s++){if(n=e[s],99<n&&n<DATE_MIN_YEAR||n>DATE_MAX_YEAR)return;n>31&&(h+=1),n>12&&(o+=1),n<=0&&(p+=1)}if(!(h>=2||3===o||p>=2)){for(c=[[e[2],e.slice(0,2)],[e[0],e.slice(1,3)]],u=0,i=c.length;u<i;u++)if(_=c[u],g=_[0],d=_[1],DATE_MIN_YEAR<=g&&g<=DATE_MAX_YEAR)return t=this.map_ints_to_dm(d),null!=t?{year:g,month:t.month,day:t.day}:void 0;for(l=0,a=c.length;l<a;l++)if(f=c[l],g=f[0],d=f[1],t=this.map_ints_to_dm(d),null!=t)return g=this.two_to_four_digit_year(g),{year:g,month:t.month,day:t.day}}}},map_ints_to_dm:function(e){var t,n,r,i,a,s;for(a=[e,e.slice().reverse()],i=0,n=a.length;i<n;i++)if(s=a[i],t=s[0],r=s[1],1<=t&&t<=31&&1<=r&&r<=12)return{day:t,month:r}},two_to_four_digit_year:function(e){return e>99?e:e>50?e+1900:e+2e3}},module.exports=matching;
74289
74290},{"./adjacency_graphs":1,"./frequency_lists":3,"./scoring":6}],6:[function(require,module,exports){
74291var BRUTEFORCE_CARDINALITY,MIN_GUESSES_BEFORE_GROWING_SEQUENCE,MIN_SUBMATCH_GUESSES_MULTI_CHAR,MIN_SUBMATCH_GUESSES_SINGLE_CHAR,adjacency_graphs,calc_average_degree,k,scoring,v;adjacency_graphs=require("./adjacency_graphs"),calc_average_degree=function(e){var t,r,n,s,a,u;t=0;for(n in e)a=e[n],t+=function(){var e,t,r;for(r=[],t=0,e=a.length;t<e;t++)s=a[t],s&&r.push(s);return r}().length;return t/=function(){var t;t=[];for(r in e)u=e[r],t.push(r);return t}().length},BRUTEFORCE_CARDINALITY=10,MIN_GUESSES_BEFORE_GROWING_SEQUENCE=1e4,MIN_SUBMATCH_GUESSES_SINGLE_CHAR=10,MIN_SUBMATCH_GUESSES_MULTI_CHAR=50,scoring={nCk:function(e,t){var r,n,s,a;if(t>e)return 0;if(0===t)return 1;for(s=1,r=n=1,a=t;1<=a?n<=a:n>=a;r=1<=a?++n:--n)s*=e,s/=r,e-=1;return s},log10:function(e){return Math.log(e)/Math.log(10)},log2:function(e){return Math.log(e)/Math.log(2)},factorial:function(e){var t,r,n,s;if(e<2)return 1;for(t=1,r=n=2,s=e;2<=s?n<=s:n>=s;r=2<=s?++n:--n)t*=r;return t},most_guessable_match_sequence:function(e,t,r){var n,s,a,u,i,_,o,h,E,c,g,f,l,p,A,S,R,v,I,M,N,C,U,T;for(null==r&&(r=!1),l=e.length,f=function(){var e,t,r;for(r=[],n=e=0,t=l;0<=t?e<t:e>t;n=0<=t?++e:--e)r.push([]);return r}(),p=0,_=t.length;p<_;p++)c=t[p],f[c.j].push(c);for(v=0,o=f.length;v<o;v++)E=f[v],E.sort(function(e,t){return e.i-t.i});for(A={m:function(){var e,t,r;for(t=[],n=r=0,e=l;0<=e?r<e:r>e;n=0<=e?++r:--r)t.push({});return t}(),pi:function(){var e,t,r;for(t=[],n=r=0,e=l;0<=e?r<e:r>e;n=0<=e?++r:--r)t.push({});return t}(),g:function(){var e,t,r;for(t=[],n=r=0,e=l;0<=e?r<e:r>e;n=0<=e?++r:--r)t.push({});return t}()},U=function(t){return function(n,s){var a,u,i,_,o,h;_=n.j,o=t.estimate_guesses(n,e),s>1&&(o*=A.pi[n.i-1][s-1]),i=t.factorial(s)*o,r||(i+=Math.pow(MIN_GUESSES_BEFORE_GROWING_SEQUENCE,s-1)),h=A.g[_];for(u in h)if(a=h[u],!(u>s)&&a<=i)return;return A.g[_][s]=i,A.m[_][s]=n,A.pi[_][s]=o}}(this),s=function(e){return function(e){var t,r,n,s,a,u;for(c=g(0,e),U(c,1),a=[],t=u=1,s=e;1<=s?u<=s:u>=s;t=1<=s?++u:--u)c=g(t,e),a.push(function(){var e,s;e=A.m[t-1],s=[];for(r in e)n=e[r],r=parseInt(r),"bruteforce"!==n.pattern&&s.push(U(c,r+1));return s}());return a}}(this),g=function(t){return function(t,r){return{pattern:"bruteforce",token:e.slice(t,+r+1||9e9),i:t,j:r}}}(this),C=function(e){return function(e){var t,r,n,s,a,u,i;u=[],s=e-1,a=void 0,n=1/0,i=A.g[s];for(r in i)t=i[r],t<n&&(a=r,n=t);for(;s>=0;)c=A.m[s][a],u.unshift(c),s=c.i-1,a--;return u}}(this),u=N=0,I=l;0<=I?N<I:N>I;u=0<=I?++N:--N){for(M=f[u],T=0,h=M.length;T<h;T++)if(c=M[T],c.i>0)for(i in A.m[c.i-1])i=parseInt(i),U(c,i+1);else U(c,1);s(u)}return R=C(l),S=R.length,a=0===e.length?1:A.g[l-1][S],{password:e,guesses:a,guesses_log10:this.log10(a),sequence:R}},estimate_guesses:function(e,t){var r,n,s;return null!=e.guesses?e.guesses:(s=1,e.token.length<t.length&&(s=1===e.token.length?MIN_SUBMATCH_GUESSES_SINGLE_CHAR:MIN_SUBMATCH_GUESSES_MULTI_CHAR),r={bruteforce:this.bruteforce_guesses,dictionary:this.dictionary_guesses,spatial:this.spatial_guesses,repeat:this.repeat_guesses,sequence:this.sequence_guesses,regex:this.regex_guesses,date:this.date_guesses},n=r[e.pattern].call(this,e),e.guesses=Math.max(n,s),e.guesses_log10=this.log10(e.guesses),e.guesses)},bruteforce_guesses:function(e){var t,r;return t=Math.pow(BRUTEFORCE_CARDINALITY,e.token.length),r=1===e.token.length?MIN_SUBMATCH_GUESSES_SINGLE_CHAR+1:MIN_SUBMATCH_GUESSES_MULTI_CHAR+1,Math.max(t,r)},repeat_guesses:function(e){return e.base_guesses*e.repeat_count},sequence_guesses:function(e){var t,r;return r=e.token.charAt(0),t="a"===r||"A"===r||"z"===r||"Z"===r||"0"===r||"1"===r||"9"===r?4:r.match(/\d/)?10:26,e.ascending||(t*=2),t*e.token.length},MIN_YEAR_SPACE:20,REFERENCE_YEAR:2016,regex_guesses:function(e){var t,r;if(t={alpha_lower:26,alpha_upper:26,alpha:52,alphanumeric:62,digits:10,symbols:33},e.regex_name in t)return Math.pow(t[e.regex_name],e.token.length);switch(e.regex_name){case"recent_year":return r=Math.abs(parseInt(e.regex_match[0])-this.REFERENCE_YEAR),r=Math.max(r,this.MIN_YEAR_SPACE)}},date_guesses:function(e){var t,r;return r=Math.max(Math.abs(e.year-this.REFERENCE_YEAR),this.MIN_YEAR_SPACE),t=365*r,e.separator&&(t*=4),t},KEYBOARD_AVERAGE_DEGREE:calc_average_degree(adjacency_graphs.qwerty),KEYPAD_AVERAGE_DEGREE:calc_average_degree(adjacency_graphs.keypad),KEYBOARD_STARTING_POSITIONS:function(){var e,t;e=adjacency_graphs.qwerty,t=[];for(k in e)v=e[k],t.push(k);return t}().length,KEYPAD_STARTING_POSITIONS:function(){var e,t;e=adjacency_graphs.keypad,t=[];for(k in e)v=e[k],t.push(k);return t}().length,spatial_guesses:function(e){var t,r,n,s,a,u,i,_,o,h,E,c,g,f,l,p,A,S;for("qwerty"===(E=e.graph)||"dvorak"===E?(l=this.KEYBOARD_STARTING_POSITIONS,s=this.KEYBOARD_AVERAGE_DEGREE):(l=this.KEYPAD_STARTING_POSITIONS,s=this.KEYPAD_AVERAGE_DEGREE),a=0,t=e.token.length,A=e.turns,u=_=2,c=t;2<=c?_<=c:_>=c;u=2<=c?++_:--_)for(o=Math.min(A,u-1),i=h=1,g=o;1<=g?h<=g:h>=g;i=1<=g?++h:--h)a+=this.nCk(u-1,i-1)*l*Math.pow(s,i);if(e.shifted_count)if(r=e.shifted_count,n=e.token.length-e.shifted_count,0===r||0===n)a*=2;else{for(p=0,u=S=1,f=Math.min(r,n);1<=f?S<=f:S>=f;u=1<=f?++S:--S)p+=this.nCk(r+n,u);a*=p}return a},dictionary_guesses:function(e){var t;return e.base_guesses=e.rank,e.uppercase_variations=this.uppercase_variations(e),e.l33t_variations=this.l33t_variations(e),t=e.reversed&&2||1,e.base_guesses*e.uppercase_variations*e.l33t_variations*t},START_UPPER:/^[A-Z][^A-Z]+$/,END_UPPER:/^[^A-Z]+[A-Z]$/,ALL_UPPER:/^[^a-z]+$/,ALL_LOWER:/^[^A-Z]+$/,uppercase_variations:function(e){var t,r,n,s,a,u,i,_,o,h,E,c;if(c=e.token,c.match(this.ALL_LOWER)||c.toLowerCase()===c)return 1;for(_=[this.START_UPPER,this.END_UPPER,this.ALL_UPPER],u=0,a=_.length;u<a;u++)if(h=_[u],c.match(h))return 2;for(r=function(){var e,t,r,s;for(r=c.split(""),s=[],t=0,e=r.length;t<e;t++)n=r[t],n.match(/[A-Z]/)&&s.push(n);return s}().length,t=function(){var e,t,r,s;for(r=c.split(""),s=[],t=0,e=r.length;t<e;t++)n=r[t],n.match(/[a-z]/)&&s.push(n);return s}().length,E=0,s=i=1,o=Math.min(r,t);1<=o?i<=o:i>=o;s=1<=o?++i:--i)E+=this.nCk(r+t,s);return E},l33t_variations:function(e){var t,r,n,s,a,u,i,_,o,h,E,c,g;if(!e.l33t)return 1;g=1,o=e.sub;for(E in o)if(c=o[E],s=e.token.toLowerCase().split(""),t=function(){var e,t,r;for(r=[],t=0,e=s.length;t<e;t++)n=s[t],n===E&&r.push(n);return r}().length,r=function(){var e,t,r;for(r=[],t=0,e=s.length;t<e;t++)n=s[t],n===c&&r.push(n);return r}().length,0===t||0===r)g*=2;else{for(i=Math.min(r,t),_=0,a=u=1,h=i;1<=h?u<=h:u>=h;a=1<=h?++u:--u)_+=this.nCk(r+t,a);g*=_}return g}},module.exports=scoring;
74292
74293},{"./adjacency_graphs":1}],7:[function(require,module,exports){
74294var time_estimates;time_estimates={estimate_attack_times:function(e){var t,n,s,o;n={online_throttling_100_per_hour:e/(100/3600),online_no_throttling_10_per_second:e/10,offline_slow_hashing_1e4_per_second:e/1e4,offline_fast_hashing_1e10_per_second:e/1e10},t={};for(s in n)o=n[s],t[s]=this.display_time(o);return{crack_times_seconds:n,crack_times_display:t,score:this.guesses_to_score(e)}},guesses_to_score:function(e){var t;return t=5,e<1e3+t?0:e<1e6+t?1:e<1e8+t?2:e<1e10+t?3:4},display_time:function(e){var t,n,s,o,_,r,i,a,u,c;return i=60,r=60*i,s=24*r,a=31*s,c=12*a,n=100*c,u=e<1?[null,"less than a second"]:e<i?(t=Math.round(e),[t,t+" second"]):e<r?(t=Math.round(e/i),[t,t+" minute"]):e<s?(t=Math.round(e/r),[t,t+" hour"]):e<a?(t=Math.round(e/s),[t,t+" day"]):e<c?(t=Math.round(e/a),[t,t+" month"]):e<n?(t=Math.round(e/c),[t,t+" year"]):[null,"centuries"],o=u[0],_=u[1],null!=o&&1!==o&&(_+="s"),_}},module.exports=time_estimates;
74295
74296},{}]},{},[4])(4)
74297});
74298
74299</script>
74300 <script>/*
74301 * Detects entropy from a string.
74302 *
74303 * Formats include:
74304 * binary [0-1]
74305 * base 6 [0-5]
74306 * dice 6 [1-6]
74307 * decimal [0-9]
74308 * hexadecimal [0-9A-F]
74309 * card [A2-9TJQK][CDHS]
74310 *
74311 * Automatically uses lowest entropy to avoid issues such as interpretting 0101
74312 * as hexadecimal which would be 16 bits when really it's only 4 bits of binary
74313 * entropy.
74314 */
74315
74316window.Entropy = new (function() {
74317
74318 var TWO = new BigInteger(2);
74319
74320 // matchers returns an array of the matched events for each type of entropy.
74321 // eg
74322 // matchers.binary("010") returns ["0", "1", "0"]
74323 // matchers.binary("a10") returns ["1", "0"]
74324 // matchers.hex("a10") returns ["a", "1", "0"]
74325 var matchers = {
74326 binary: function(str) {
74327 return str.match(/[0-1]/gi) || [];
74328 },
74329 base6: function(str) {
74330 return str.match(/[0-5]/gi) || [];
74331 },
74332 dice: function(str) {
74333 return str.match(/[1-6]/gi) || []; // ie dice numbers
74334 },
74335 base10: function(str) {
74336 return str.match(/[0-9]/gi) || [];
74337 },
74338 hex: function(str) {
74339 return str.match(/[0-9A-F]/gi) || [];
74340 },
74341 card: function(str) {
74342 // Format is NumberSuit, eg
74343 // AH ace of hearts
74344 // 8C eight of clubs
74345 // TD ten of diamonds
74346 // JS jack of spades
74347 // QH queen of hearts
74348 // KC king of clubs
74349 return str.match(/([A2-9TJQK][CDHS])/gi) || [];
74350 }
74351 }
74352
74353 // Convert array of cards from ["ac", "4d", "ks"]
74354 // to numbers between 0 and 51 [0, 16, 51]
74355 function convertCardsToInts(cards) {
74356 var ints = [];
74357 var values = "a23456789tjqk";
74358 var suits = "cdhs";
74359 for (var i=0; i<cards.length; i++) {
74360 var card = cards[i].toLowerCase();
74361 var value = card[0];
74362 var suit = card[1];
74363 var asInt = 13 * suits.indexOf(suit) + values.indexOf(value);
74364 ints.push(asInt);
74365 }
74366 return ints;
74367 }
74368
74369 this.fromString = function(rawEntropyStr) {
74370 // Find type of entropy being used (binary, hex, dice etc)
74371 var base = getBase(rawEntropyStr);
74372 // Convert dice to base6 entropy (ie 1-6 to 0-5)
74373 // This is done by changing all 6s to 0s
74374 if (base.str == "dice") {
74375 var newParts = [];
74376 var newInts = [];
74377 for (var i=0; i<base.parts.length; i++) {
74378 var c = base.parts[i];
74379 if ("12345".indexOf(c) > -1) {
74380 newParts[i] = base.parts[i];
74381 newInts[i] = base.ints[i];
74382 }
74383 else {
74384 newParts[i] = "0";
74385 newInts[i] = 0;
74386 }
74387 }
74388 base.str = "base 6 (dice)";
74389 base.ints = newInts;
74390 base.parts = newParts;
74391 base.matcher = matchers.base6;
74392 }
74393 // Detect empty entropy
74394 if (base.parts.length == 0) {
74395 return {
74396 binaryStr: "",
74397 cleanStr: "",
74398 cleanHtml: "",
74399 base: base,
74400 };
74401 }
74402 // Convert base.ints to BigInteger.
74403 // Due to using unusual bases, eg cards of base52, this is not as simple as
74404 // using BigInteger.parse()
74405 var entropyInt = BigInteger.ZERO;
74406 for (var i=base.ints.length-1; i>=0; i--) {
74407 var thisInt = BigInteger.parse(base.ints[i]);
74408 var power = (base.ints.length - 1) - i;
74409 var additionalEntropy = BigInteger.parse(base.asInt).pow(power).multiply(thisInt);
74410 entropyInt = entropyInt.add(additionalEntropy);
74411 }
74412 // Convert entropy to binary
74413 var entropyBin = entropyInt.toString(2);
74414 // If the first integer is small, it must be padded with zeros.
74415 // Otherwise the chance of the first bit being 1 is 100%, which is
74416 // obviously incorrect.
74417 // This is not perfect for non-2^n bases.
74418 var expectedBits = Math.floor(base.parts.length * Math.log2(base.asInt));
74419 while (entropyBin.length < expectedBits) {
74420 entropyBin = "0" + entropyBin;
74421 }
74422 // Calculate the number of bits per event
74423 var bitsPerEvent = Math.log2(base.asInt);
74424 // Cards binary must be handled differently, since they're not replaced
74425 if (base.asInt == 52) {
74426 var cardEntropy = processCardEntropy(base.parts);
74427 entropyBin = cardEntropy.binaryStr;
74428 bitsPerEvent = cardEntropy.bitsPerEvent;
74429 }
74430 // Supply a 'filtered' entropy string for display purposes
74431 var entropyClean = base.parts.join("");
74432 var entropyHtml = base.parts.join("");
74433 if (base.asInt == 52) {
74434 entropyClean = base.parts.join(" ").toUpperCase();
74435 entropyClean = entropyClean.replace(/C/g, "\u2663");
74436 entropyClean = entropyClean.replace(/D/g, "\u2666");
74437 entropyClean = entropyClean.replace(/H/g, "\u2665");
74438 entropyClean = entropyClean.replace(/S/g, "\u2660");
74439 entropyHtml = base.parts.join(" ").toUpperCase();
74440 entropyHtml = entropyHtml.replace(/C/g, "<span class='card-suit club'>\u2663</span>");
74441 entropyHtml = entropyHtml.replace(/D/g, "<span class='card-suit diamond'>\u2666</span>");
74442 entropyHtml = entropyHtml.replace(/H/g, "<span class='card-suit heart'>\u2665</span>");
74443 entropyHtml = entropyHtml.replace(/S/g, "<span class='card-suit spade'>\u2660</span>");
74444 }
74445 // Return the result
74446 var e = {
74447 binaryStr: entropyBin,
74448 cleanStr: entropyClean,
74449 cleanHtml: entropyHtml,
74450 bitsPerEvent: bitsPerEvent,
74451 base: base,
74452 }
74453 return e;
74454 }
74455
74456 function getSortedDeck() {
74457 var s = [];
74458 var suits = "CDHS";
74459 var values = "A23456789TJQK";
74460 for (var i=0; i<suits.length; i++) {
74461 for (var j=0; j<values.length; j++) {
74462 s.push(values[j]+suits[i]);
74463 }
74464 }
74465 return s;
74466 }
74467
74468 function getBase(str) {
74469 // Need to get the lowest base for the supplied entropy.
74470 // This prevents interpreting, say, dice rolls as hexadecimal.
74471 var binaryMatches = matchers.binary(str);
74472 var hexMatches = matchers.hex(str);
74473 // Find the lowest base that can be used, whilst ignoring any irrelevant chars
74474 if (binaryMatches.length == hexMatches.length && hexMatches.length > 0) {
74475 var ints = binaryMatches.map(function(i) { return parseInt(i, 2) });
74476 return {
74477 ints: ints,
74478 parts: binaryMatches,
74479 matcher: matchers.binary,
74480 asInt: 2,
74481 str: "binary",
74482 }
74483 }
74484 var cardMatches = matchers.card(str);
74485 if (cardMatches.length >= hexMatches.length / 2) {
74486 var ints = convertCardsToInts(cardMatches);
74487 return {
74488 ints: ints,
74489 parts: cardMatches,
74490 matcher: matchers.card,
74491 asInt: 52,
74492 str: "card",
74493 }
74494 }
74495 var diceMatches = matchers.dice(str);
74496 if (diceMatches.length == hexMatches.length && hexMatches.length > 0) {
74497 var ints = diceMatches.map(function(i) { return parseInt(i) });
74498 return {
74499 ints: ints,
74500 parts: diceMatches,
74501 matcher: matchers.dice,
74502 asInt: 6,
74503 str: "dice",
74504 }
74505 }
74506 var base6Matches = matchers.base6(str);
74507 if (base6Matches.length == hexMatches.length && hexMatches.length > 0) {
74508 var ints = base6Matches.map(function(i) { return parseInt(i) });
74509 return {
74510 ints: ints,
74511 parts: base6Matches,
74512 matcher: matchers.base6,
74513 asInt: 6,
74514 str: "base 6",
74515 }
74516 }
74517 var base10Matches = matchers.base10(str);
74518 if (base10Matches.length == hexMatches.length && hexMatches.length > 0) {
74519 var ints = base10Matches.map(function(i) { return parseInt(i) });
74520 return {
74521 ints: ints,
74522 parts: base10Matches,
74523 matcher: matchers.base10,
74524 asInt: 10,
74525 str: "base 10",
74526 }
74527 }
74528 var ints = hexMatches.map(function(i) { return parseInt(i, 16) });
74529 return {
74530 ints: ints,
74531 parts: hexMatches,
74532 matcher: matchers.hex,
74533 asInt: 16,
74534 str: "hexadecimal",
74535 }
74536 }
74537
74538 // Assume cards are NOT replaced.
74539 // Additional entropy decreases as more cards are used. This means
74540 // total possible entropy is measured using n!, not base^n.
74541 // eg the second last card can be only one of two, not one of fifty two
74542 // so the added entropy for that card is only one bit at most
74543 function processCardEntropy(cards) {
74544 // Track how many instances of each card have been used, and thus
74545 // how many decks are in use.
74546 var cardCounts = {};
74547 var numberOfDecks = 0;
74548 // Work out number of decks by max(duplicates)
74549 for (var i=0; i<cards.length; i++) {
74550 // Get the card that was drawn
74551 var cardLower = cards[i];
74552 var card = cardLower.toUpperCase();
74553 // Initialize the count for this card if needed
74554 if (!(card in cardCounts)) {
74555 cardCounts[card] = 0;
74556 }
74557 cardCounts[card] += 1;
74558 // See if this is max(duplicates)
74559 if (cardCounts[card] > numberOfDecks) {
74560 numberOfDecks = cardCounts[card];
74561 }
74562 }
74563 // Work out the total number of bits for this many decks
74564 // See http://crypto.stackexchange.com/q/41886
74565 var gainedBits = 0;
74566 // Equivalent of Math.log2(factorial(52*numberOfDecks))
74567 // which becomes infinity for numberOfDecks > 4
74568 for (var i=1; i<=52*numberOfDecks; i++) {
74569 gainedBits = gainedBits + Math.log2(i);
74570 }
74571 var lostBits = 52 * Math.log2(factorial(numberOfDecks));
74572 var maxBits = gainedBits - lostBits;
74573 // Convert the drawn cards to a binary representation.
74574 // The exact technique for doing this is unclear.
74575 // See
74576 // http://crypto.stackexchange.com/a/41896
74577 // "I even doubt that this is well defined (only the average entropy
74578 // is, I believe)."
74579 // See
74580 // https://github.com/iancoleman/bip39/issues/33#issuecomment-263021856
74581 // "The binary representation can be the first log(permutations,2) bits
74582 // of the sha-2 hash of the normalized deck string."
74583 //
74584 // In this specific implementation, the first N bits of the hash of the
74585 // normalized cards string is being used. Uppercase, no spaces; eg
74586 // sha256("AH8DQSTC2H")
74587 var totalCards = numberOfDecks * 52;
74588 var percentUsed = cards.length / totalCards;
74589 // Calculate the average number of bits of entropy for the number of
74590 // cards drawn.
74591 var numberOfBits = Math.floor(maxBits * percentUsed);
74592 // Create a normalized string of the selected cards
74593 var normalizedCards = cards.join("").toUpperCase();
74594 // Convert to binary using the SHA256 hash of the normalized cards.
74595 // If the number of bits is more than 256, multiple hashes
74596 // are used until the required number of bits is reached.
74597 var entropyBin = "";
74598 var iterations = 0;
74599 while (entropyBin.length < numberOfBits) {
74600 var hashedCards = sjcl.hash.sha256.hash(normalizedCards + ":" + iterations);
74601 var hashHex = sjcl.codec.hex.fromBits(hashedCards);
74602 for (var i=0; i<hashHex.length; i++) {
74603 var decimal = parseInt(hashHex[i], 16);
74604 var binary = decimal.toString(2);
74605 while (binary.length < 4) {
74606 binary = "0" + binary;
74607 }
74608 entropyBin = entropyBin + binary;
74609 }
74610 iterations = iterations + 1;
74611 }
74612 // Truncate to the appropriate number of bits.
74613 entropyBin = entropyBin.substring(0, numberOfBits);
74614 // Get the number of bits per event
74615 bitsPerEvent = maxBits / totalCards;
74616 return {
74617 binaryStr: entropyBin,
74618 bitsPerEvent: bitsPerEvent,
74619 }
74620 }
74621
74622 // Polyfill for Math.log2
74623 // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2#Polyfill
74624 Math.log2 = Math.log2 || function(x) {
74625 // The polyfill isn't good enough because of the poor accuracy of
74626 // Math.LOG2E
74627 // log2(8) gave 2.9999999999999996 which when floored causes issues.
74628 // So instead use the BigInteger library to get it right.
74629 return BigInteger.log(x) / BigInteger.log(2);
74630 };
74631
74632 // Depends on BigInteger
74633 function factorial(n) {
74634 if (n == 0) {
74635 return 1;
74636 }
74637 f = BigInteger.ONE;
74638 for (var i=1; i<=n; i++) {
74639 f = f.multiply(new BigInteger(i));
74640 }
74641 return f;
74642 }
74643
74644})();
74645</script>
74646 <script>(function() {
74647
74648 // mnemonics is populated as required by getLanguage
74649 var mnemonics = { "english": new Mnemonic("english") };
74650 var mnemonic = mnemonics["english"];
74651 var seed = null;
74652 var bip32RootKey = null;
74653 var bip32ExtendedKey = null;
74654 var network = bitcoinjs.bitcoin.networks.bitcoin;
74655 var addressRowTemplate = $("#address-row-template");
74656
74657 var showIndex = true;
74658 var showAddress = true;
74659 var showPubKey = true;
74660 var showPrivKey = true;
74661 var showQr = false;
74662 var litecoinUseLtub = true;
74663
74664 var entropyChangeTimeoutEvent = null;
74665 var phraseChangeTimeoutEvent = null;
74666 var rootKeyChangedTimeoutEvent = null;
74667
74668 var generationProcesses = [];
74669
74670 var DOM = {};
74671 DOM.network = $(".network");
74672 DOM.bip32Client = $("#bip32-client");
74673 DOM.phraseNetwork = $("#network-phrase");
74674 DOM.useEntropy = $(".use-entropy");
74675 DOM.entropyContainer = $(".entropy-container");
74676 DOM.entropy = $(".entropy");
74677 DOM.entropyFiltered = DOM.entropyContainer.find(".filtered");
74678 DOM.entropyType = DOM.entropyContainer.find(".type");
74679 DOM.entropyCrackTime = DOM.entropyContainer.find(".crack-time");
74680 DOM.entropyEventCount = DOM.entropyContainer.find(".event-count");
74681 DOM.entropyBits = DOM.entropyContainer.find(".bits");
74682 DOM.entropyBitsPerEvent = DOM.entropyContainer.find(".bits-per-event");
74683 DOM.entropyWordCount = DOM.entropyContainer.find(".word-count");
74684 DOM.entropyBinary = DOM.entropyContainer.find(".binary");
74685 DOM.entropyWordIndexes = DOM.entropyContainer.find(".word-indexes");
74686 DOM.entropyMnemonicLength = DOM.entropyContainer.find(".mnemonic-length");
74687 DOM.entropyFilterWarning = DOM.entropyContainer.find(".filter-warning");
74688 DOM.phrase = $(".phrase");
74689 DOM.passphrase = $(".passphrase");
74690 DOM.generateContainer = $(".generate-container");
74691 DOM.generate = $(".generate");
74692 DOM.seed = $(".seed");
74693 DOM.rootKey = $(".root-key");
74694 DOM.litecoinLtubContainer = $(".litecoin-ltub-container");
74695 DOM.litecoinUseLtub = $(".litecoin-use-ltub");
74696 DOM.extendedPrivKey = $(".extended-priv-key");
74697 DOM.extendedPubKey = $(".extended-pub-key");
74698 DOM.bip32tab = $("#bip32-tab");
74699 DOM.bip44tab = $("#bip44-tab");
74700 DOM.bip49tab = $("#bip49-tab");
74701 DOM.bip84tab = $("#bip84-tab");
74702 DOM.bip141tab = $("#bip141-tab");
74703 DOM.bip32panel = $("#bip32");
74704 DOM.bip44panel = $("#bip44");
74705 DOM.bip49panel = $("#bip49");
74706 DOM.bip32path = $("#bip32-path");
74707 DOM.bip44path = $("#bip44-path");
74708 DOM.bip44purpose = $("#bip44 .purpose");
74709 DOM.bip44coin = $("#bip44 .coin");
74710 DOM.bip44account = $("#bip44 .account");
74711 DOM.bip44accountXprv = $("#bip44 .account-xprv");
74712 DOM.bip44accountXpub = $("#bip44 .account-xpub");
74713 DOM.bip44change = $("#bip44 .change");
74714 DOM.bip49unavailable = $("#bip49 .unavailable");
74715 DOM.bip49available = $("#bip49 .available");
74716 DOM.bip49path = $("#bip49-path");
74717 DOM.bip49purpose = $("#bip49 .purpose");
74718 DOM.bip49coin = $("#bip49 .coin");
74719 DOM.bip49account = $("#bip49 .account");
74720 DOM.bip49accountXprv = $("#bip49 .account-xprv");
74721 DOM.bip49accountXpub = $("#bip49 .account-xpub");
74722 DOM.bip49change = $("#bip49 .change");
74723 DOM.bip84path = $("#bip84-path");
74724 DOM.bip84purpose = $("#bip84 .purpose");
74725 DOM.bip84coin = $("#bip84 .coin");
74726 DOM.bip84account = $("#bip84 .account");
74727 DOM.bip84accountXprv = $("#bip84 .account-xprv");
74728 DOM.bip84accountXpub = $("#bip84 .account-xpub");
74729 DOM.bip84change = $("#bip84 .change");
74730 DOM.bip141unavailable = $("#bip141 .unavailable");
74731 DOM.bip141available = $("#bip141 .available");
74732 DOM.bip141path = $("#bip141-path");
74733 DOM.bip141semantics = $(".bip141-semantics");
74734 DOM.generatedStrength = $(".generate-container .strength");
74735 DOM.hardenedAddresses = $(".hardened-addresses");
74736 DOM.useBitpayAddressesContainer = $(".use-bitpay-addresses-container");
74737 DOM.useBitpayAddresses = $(".use-bitpay-addresses");
74738 DOM.addresses = $(".addresses");
74739 DOM.csvTab = $("#csv-tab a");
74740 DOM.csv = $(".csv");
74741 DOM.rowsToAdd = $(".rows-to-add");
74742 DOM.more = $(".more");
74743 DOM.moreRowsStartIndex = $(".more-rows-start-index");
74744 DOM.feedback = $(".feedback");
74745 DOM.tab = $(".derivation-type a");
74746 DOM.indexToggle = $(".index-toggle");
74747 DOM.addressToggle = $(".address-toggle");
74748 DOM.publicKeyToggle = $(".public-key-toggle");
74749 DOM.privateKeyToggle = $(".private-key-toggle");
74750 DOM.languages = $(".languages a");
74751 DOM.qrContainer = $(".qr-container");
74752 DOM.qrHider = DOM.qrContainer.find(".qr-hider");
74753 DOM.qrImage = DOM.qrContainer.find(".qr-image");
74754 DOM.qrHint = DOM.qrContainer.find(".qr-hint");
74755 DOM.showQrEls = $("[data-show-qr]");
74756
74757 function init() {
74758 // Events
74759 DOM.network.on("change", networkChanged);
74760 DOM.bip32Client.on("change", bip32ClientChanged);
74761 DOM.useEntropy.on("change", setEntropyVisibility);
74762 DOM.entropy.on("input", delayedEntropyChanged);
74763 DOM.entropyMnemonicLength.on("change", entropyChanged);
74764 DOM.phrase.on("input", delayedPhraseChanged);
74765 DOM.passphrase.on("input", delayedPhraseChanged);
74766 DOM.generate.on("click", generateClicked);
74767 DOM.more.on("click", showMore);
74768 DOM.rootKey.on("input", delayedRootKeyChanged);
74769 DOM.litecoinUseLtub.on("change", litecoinUseLtubChanged);
74770 DOM.bip32path.on("input", calcForDerivationPath);
74771 DOM.bip44account.on("input", calcForDerivationPath);
74772 DOM.bip44change.on("input", calcForDerivationPath);
74773 DOM.bip49account.on("input", calcForDerivationPath);
74774 DOM.bip49change.on("input", calcForDerivationPath);
74775 DOM.bip84account.on("input", calcForDerivationPath);
74776 DOM.bip84change.on("input", calcForDerivationPath);
74777 DOM.bip141path.on("input", calcForDerivationPath);
74778 DOM.bip141semantics.on("change", tabChanged);
74779 DOM.tab.on("shown.bs.tab", tabChanged);
74780 DOM.hardenedAddresses.on("change", calcForDerivationPath);
74781 DOM.indexToggle.on("click", toggleIndexes);
74782 DOM.addressToggle.on("click", toggleAddresses);
74783 DOM.publicKeyToggle.on("click", togglePublicKeys);
74784 DOM.privateKeyToggle.on("click", togglePrivateKeys);
74785 DOM.csvTab.on("click", updateCsv);
74786 DOM.languages.on("click", languageChanged);
74787 DOM.useBitpayAddresses.on("change", useBitpayAddressesChange);
74788 setQrEvents(DOM.showQrEls);
74789 disableForms();
74790 hidePending();
74791 hideValidationError();
74792 populateNetworkSelect();
74793 populateClientSelect();
74794 }
74795
74796 // Event handlers
74797
74798 function networkChanged(e) {
74799 clearDerivedKeys();
74800 clearAddressesList();
74801 DOM.litecoinLtubContainer.addClass("hidden");
74802 DOM.useBitpayAddressesContainer.addClass("hidden");
74803 var networkIndex = e.target.value;
74804 var network = networks[networkIndex];
74805 network.onSelect();
74806 if (network.segwitAvailable) {
74807 adjustNetworkForSegwit();
74808 showSegwitAvailable();
74809 }
74810 else {
74811 showSegwitUnavailable();
74812 }
74813 if (seed != null) {
74814 phraseChanged();
74815 }
74816 else {
74817 rootKeyChanged();
74818 }
74819 }
74820
74821 function bip32ClientChanged(e) {
74822 var clientIndex = DOM.bip32Client.val();
74823 if (clientIndex == "custom") {
74824 DOM.bip32path.prop("readonly", false);
74825 }
74826 else {
74827 DOM.bip32path.prop("readonly", true);
74828 clients[clientIndex].onSelect();
74829 if (seed != null) {
74830 phraseChanged();
74831 }
74832 else {
74833 rootKeyChanged();
74834 }
74835 }
74836 }
74837
74838 function setEntropyVisibility() {
74839 if (isUsingOwnEntropy()) {
74840 DOM.entropyContainer.removeClass("hidden");
74841 DOM.generateContainer.addClass("hidden");
74842 DOM.phrase.prop("readonly", true);
74843 DOM.entropy.focus();
74844 entropyChanged();
74845 }
74846 else {
74847 DOM.entropyContainer.addClass("hidden");
74848 DOM.generateContainer.removeClass("hidden");
74849 DOM.phrase.prop("readonly", false);
74850 hidePending();
74851 }
74852 }
74853
74854 function delayedPhraseChanged() {
74855 hideValidationError();
74856 seed = null;
74857 bip32RootKey = null;
74858 bip32ExtendedKey = null;
74859 clearAddressesList();
74860 showPending();
74861 if (phraseChangeTimeoutEvent != null) {
74862 clearTimeout(phraseChangeTimeoutEvent);
74863 }
74864 phraseChangeTimeoutEvent = setTimeout(phraseChanged, 400);
74865 }
74866
74867 function phraseChanged() {
74868 showPending();
74869 setMnemonicLanguage();
74870 // Get the mnemonic phrase
74871 var phrase = DOM.phrase.val();
74872 var errorText = findPhraseErrors(phrase);
74873 if (errorText) {
74874 showValidationError(errorText);
74875 return;
74876 }
74877 // Calculate and display
74878 var passphrase = DOM.passphrase.val();
74879 calcBip32RootKeyFromSeed(phrase, passphrase);
74880 calcForDerivationPath();
74881 // Show the word indexes
74882 showWordIndexes();
74883 }
74884
74885 function tabChanged() {
74886 showPending();
74887 adjustNetworkForSegwit();
74888 var phrase = DOM.phrase.val();
74889 if (phrase != "") {
74890 // Calculate and display for mnemonic
74891 var errorText = findPhraseErrors(phrase);
74892 if (errorText) {
74893 showValidationError(errorText);
74894 return;
74895 }
74896 // Calculate and display
74897 var passphrase = DOM.passphrase.val();
74898 calcBip32RootKeyFromSeed(phrase, passphrase);
74899 }
74900 else {
74901 // Calculate and display for root key
74902 var rootKeyBase58 = DOM.rootKey.val();
74903 var errorText = validateRootKey(rootKeyBase58);
74904 if (errorText) {
74905 showValidationError(errorText);
74906 return;
74907 }
74908 // Calculate and display
74909 calcBip32RootKeyFromBase58(rootKeyBase58);
74910 }
74911 calcForDerivationPath();
74912 }
74913
74914 function delayedEntropyChanged() {
74915 hideValidationError();
74916 showPending();
74917 if (entropyChangeTimeoutEvent != null) {
74918 clearTimeout(entropyChangeTimeoutEvent);
74919 }
74920 entropyChangeTimeoutEvent = setTimeout(entropyChanged, 400);
74921 }
74922
74923 function entropyChanged() {
74924 // If blank entropy, clear mnemonic, addresses, errors
74925 if (DOM.entropy.val().trim().length == 0) {
74926 clearDisplay();
74927 clearEntropyFeedback();
74928 DOM.phrase.val("");
74929 showValidationError("Blank entropy");
74930 return;
74931 }
74932 // Get the current phrase to detect changes
74933 var phrase = DOM.phrase.val();
74934 // Set the phrase from the entropy
74935 setMnemonicFromEntropy();
74936 // Recalc addresses if the phrase has changed
74937 var newPhrase = DOM.phrase.val();
74938 if (newPhrase != phrase) {
74939 if (newPhrase.length == 0) {
74940 clearDisplay();
74941 }
74942 else {
74943 phraseChanged();
74944 }
74945 }
74946 else {
74947 hidePending();
74948 }
74949 }
74950
74951 function delayedRootKeyChanged() {
74952 // Warn if there is an existing mnemonic or passphrase.
74953 if (DOM.phrase.val().length > 0 || DOM.passphrase.val().length > 0) {
74954 if (!confirm("This will clear existing mnemonic and passphrase")) {
74955 DOM.rootKey.val(bip32RootKey);
74956 return
74957 }
74958 }
74959 hideValidationError();
74960 showPending();
74961 // Clear existing mnemonic and passphrase
74962 DOM.phrase.val("");
74963 DOM.passphrase.val("");
74964 seed = null;
74965 if (rootKeyChangedTimeoutEvent != null) {
74966 clearTimeout(rootKeyChangedTimeoutEvent);
74967 }
74968 rootKeyChangedTimeoutEvent = setTimeout(rootKeyChanged, 400);
74969 }
74970
74971 function rootKeyChanged() {
74972 showPending();
74973 hideValidationError();
74974 var rootKeyBase58 = DOM.rootKey.val();
74975 var errorText = validateRootKey(rootKeyBase58);
74976 if (errorText) {
74977 showValidationError(errorText);
74978 return;
74979 }
74980 // Calculate and display
74981 calcBip32RootKeyFromBase58(rootKeyBase58);
74982 calcForDerivationPath();
74983 }
74984
74985 function litecoinUseLtubChanged() {
74986 litecoinUseLtub = DOM.litecoinUseLtub.prop("checked");
74987 if (litecoinUseLtub) {
74988 network = bitcoinjs.bitcoin.networks.litecoin;
74989 }
74990 else {
74991 network = bitcoinjs.bitcoin.networks.litecoinXprv;
74992 }
74993 phraseChanged();
74994 }
74995
74996 function calcForDerivationPath() {
74997 clearDerivedKeys();
74998 clearAddressesList();
74999 showPending();
75000 // Don't show segwit if it's selected but network doesn't support it
75001 if (segwitSelected() && !networkHasSegwit()) {
75002 return;
75003 }
75004 // Get the derivation path
75005 var derivationPath = getDerivationPath();
75006 var errorText = findDerivationPathErrors(derivationPath);
75007 if (errorText) {
75008 showValidationError(errorText);
75009 return;
75010 }
75011 bip32ExtendedKey = calcBip32ExtendedKey(derivationPath);
75012 if (bip44TabSelected()) {
75013 displayBip44Info();
75014 }
75015 else if (bip49TabSelected()) {
75016 displayBip49Info();
75017 }
75018 else if (bip84TabSelected()) {
75019 displayBip84Info();
75020 }
75021 displayBip32Info();
75022 }
75023
75024 function generateClicked() {
75025 if (isUsingOwnEntropy()) {
75026 return;
75027 }
75028 clearDisplay();
75029 showPending();
75030 setTimeout(function() {
75031 setMnemonicLanguage();
75032 var phrase = generateRandomPhrase();
75033 if (!phrase) {
75034 return;
75035 }
75036 phraseChanged();
75037 }, 50);
75038 }
75039
75040 function languageChanged() {
75041 setTimeout(function() {
75042 setMnemonicLanguage();
75043 if (DOM.phrase.val().length > 0) {
75044 var newPhrase = convertPhraseToNewLanguage();
75045 DOM.phrase.val(newPhrase);
75046 phraseChanged();
75047 }
75048 else {
75049 DOM.generate.trigger("click");
75050 }
75051 }, 50);
75052 }
75053
75054 function useBitpayAddressesChange() {
75055 setBitcoinCashNetworkValues();
75056 phraseChanged();
75057 }
75058
75059 function toggleIndexes() {
75060 showIndex = !showIndex;
75061 $("td.index span").toggleClass("invisible");
75062 }
75063
75064 function toggleAddresses() {
75065 showAddress = !showAddress;
75066 $("td.address span").toggleClass("invisible");
75067 }
75068
75069 function togglePublicKeys() {
75070 showPubKey = !showPubKey;
75071 $("td.pubkey span").toggleClass("invisible");
75072 }
75073
75074 function togglePrivateKeys() {
75075 showPrivKey = !showPrivKey;
75076 $("td.privkey span").toggleClass("invisible");
75077 }
75078
75079 // Private methods
75080
75081 function generateRandomPhrase() {
75082 if (!hasStrongRandom()) {
75083 var errorText = "This browser does not support strong randomness";
75084 showValidationError(errorText);
75085 return;
75086 }
75087 // get the amount of entropy to use
75088 var numWords = parseInt(DOM.generatedStrength.val());
75089 var strength = numWords / 3 * 32;
75090 var buffer = new Uint8Array(strength / 8);
75091 // create secure entropy
75092 var data = crypto.getRandomValues(buffer);
75093 // show the words
75094 var words = mnemonic.toMnemonic(data);
75095 DOM.phrase.val(words);
75096 // show the entropy
75097 var entropyHex = uint8ArrayToHex(data);
75098 DOM.entropy.val(entropyHex);
75099 // ensure entropy fields are consistent with what is being displayed
75100 DOM.entropyMnemonicLength.val("raw");
75101 return words;
75102 }
75103
75104 function calcBip32RootKeyFromSeed(phrase, passphrase) {
75105 seed = mnemonic.toSeed(phrase, passphrase);
75106 bip32RootKey = bitcoinjs.bitcoin.HDNode.fromSeedHex(seed, network);
75107 }
75108
75109 function calcBip32RootKeyFromBase58(rootKeyBase58) {
75110 bip32RootKey = bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, network);
75111 }
75112
75113 function calcBip32ExtendedKey(path) {
75114 // Check there's a root key to derive from
75115 if (!bip32RootKey) {
75116 return bip32RootKey;
75117 }
75118 var extendedKey = bip32RootKey;
75119 // Derive the key from the path
75120 var pathBits = path.split("/");
75121 for (var i=0; i<pathBits.length; i++) {
75122 var bit = pathBits[i];
75123 var index = parseInt(bit);
75124 if (isNaN(index)) {
75125 continue;
75126 }
75127 var hardened = bit[bit.length-1] == "'";
75128 var isPriv = !(extendedKey.isNeutered());
75129 var invalidDerivationPath = hardened && !isPriv;
75130 if (invalidDerivationPath) {
75131 extendedKey = null;
75132 }
75133 else if (hardened) {
75134 extendedKey = extendedKey.deriveHardened(index);
75135 }
75136 else {
75137 extendedKey = extendedKey.derive(index);
75138 }
75139 }
75140 return extendedKey
75141 }
75142
75143 function showValidationError(errorText) {
75144 DOM.feedback
75145 .text(errorText)
75146 .show();
75147 }
75148
75149 function hideValidationError() {
75150 DOM.feedback
75151 .text("")
75152 .hide();
75153 }
75154
75155 function findPhraseErrors(phrase) {
75156 // Preprocess the words
75157 phrase = mnemonic.normalizeString(phrase);
75158 var words = phraseToWordArray(phrase);
75159 // Detect blank phrase
75160 if (words.length == 0) {
75161 return "Blank mnemonic";
75162 }
75163 // Check each word
75164 for (var i=0; i<words.length; i++) {
75165 var word = words[i];
75166 var language = getLanguage();
75167 if (WORDLISTS[language].indexOf(word) == -1) {
75168 console.log("Finding closest match to " + word);
75169 var nearestWord = findNearestWord(word);
75170 return word + " not in wordlist, did you mean " + nearestWord + "?";
75171 }
75172 }
75173 // Check the words are valid
75174 var properPhrase = wordArrayToPhrase(words);
75175 var isValid = mnemonic.check(properPhrase);
75176 if (!isValid) {
75177 return "Invalid mnemonic";
75178 }
75179 return false;
75180 }
75181
75182 function validateRootKey(rootKeyBase58) {
75183 try {
75184 bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, network);
75185 }
75186 catch (e) {
75187 return "Invalid root key";
75188 }
75189 return "";
75190 }
75191
75192 function getDerivationPath() {
75193 if (bip44TabSelected()) {
75194 var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
75195 var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
75196 var account = parseIntNoNaN(DOM.bip44account.val(), 0);
75197 var change = parseIntNoNaN(DOM.bip44change.val(), 0);
75198 var path = "m/";
75199 path += purpose + "'/";
75200 path += coin + "'/";
75201 path += account + "'/";
75202 path += change;
75203 DOM.bip44path.val(path);
75204 var derivationPath = DOM.bip44path.val();
75205 console.log("Using derivation path from BIP44 tab: " + derivationPath);
75206 return derivationPath;
75207 }
75208 else if (bip49TabSelected()) {
75209 var purpose = parseIntNoNaN(DOM.bip49purpose.val(), 49);
75210 var coin = parseIntNoNaN(DOM.bip49coin.val(), 0);
75211 var account = parseIntNoNaN(DOM.bip49account.val(), 0);
75212 var change = parseIntNoNaN(DOM.bip49change.val(), 0);
75213 var path = "m/";
75214 path += purpose + "'/";
75215 path += coin + "'/";
75216 path += account + "'/";
75217 path += change;
75218 DOM.bip49path.val(path);
75219 var derivationPath = DOM.bip49path.val();
75220 console.log("Using derivation path from BIP49 tab: " + derivationPath);
75221 return derivationPath;
75222 }
75223 else if (bip84TabSelected()) {
75224 var purpose = parseIntNoNaN(DOM.bip84purpose.val(), 84);
75225 var coin = parseIntNoNaN(DOM.bip84coin.val(), 0);
75226 var account = parseIntNoNaN(DOM.bip84account.val(), 0);
75227 var change = parseIntNoNaN(DOM.bip84change.val(), 0);
75228 var path = "m/";
75229 path += purpose + "'/";
75230 path += coin + "'/";
75231 path += account + "'/";
75232 path += change;
75233 DOM.bip84path.val(path);
75234 var derivationPath = DOM.bip84path.val();
75235 console.log("Using derivation path from BIP84 tab: " + derivationPath);
75236 return derivationPath;
75237 }
75238 else if (bip32TabSelected()) {
75239 var derivationPath = DOM.bip32path.val();
75240 console.log("Using derivation path from BIP32 tab: " + derivationPath);
75241 return derivationPath;
75242 }
75243 else if (bip141TabSelected()) {
75244 var derivationPath = DOM.bip141path.val();
75245 console.log("Using derivation path from BIP141 tab: " + derivationPath);
75246 return derivationPath;
75247 }
75248 else {
75249 console.log("Unknown derivation path");
75250 }
75251 }
75252
75253 function findDerivationPathErrors(path) {
75254 // TODO is not perfect but is better than nothing
75255 // Inspired by
75256 // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#test-vectors
75257 // and
75258 // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#extended-keys
75259 var maxDepth = 255; // TODO verify this!!
75260 var maxIndexValue = Math.pow(2, 31); // TODO verify this!!
75261 if (path[0] != "m") {
75262 return "First character must be 'm'";
75263 }
75264 if (path.length > 1) {
75265 if (path[1] != "/") {
75266 return "Separator must be '/'";
75267 }
75268 var indexes = path.split("/");
75269 if (indexes.length > maxDepth) {
75270 return "Derivation depth is " + indexes.length + ", must be less than " + maxDepth;
75271 }
75272 for (var depth = 1; depth<indexes.length; depth++) {
75273 var index = indexes[depth];
75274 var invalidChars = index.replace(/^[0-9]+'?$/g, "")
75275 if (invalidChars.length > 0) {
75276 return "Invalid characters " + invalidChars + " found at depth " + depth;
75277 }
75278 var indexValue = parseInt(index.replace("'", ""));
75279 if (isNaN(depth)) {
75280 return "Invalid number at depth " + depth;
75281 }
75282 if (indexValue > maxIndexValue) {
75283 return "Value of " + indexValue + " at depth " + depth + " must be less than " + maxIndexValue;
75284 }
75285 }
75286 }
75287 // Check root key exists or else derivation path is useless!
75288 if (!bip32RootKey) {
75289 return "No root key";
75290 }
75291 // Check no hardened derivation path when using xpub keys
75292 var hardenedPath = path.indexOf("'") > -1;
75293 var hardenedAddresses = bip32TabSelected() && DOM.hardenedAddresses.prop("checked");
75294 var hardened = hardenedPath || hardenedAddresses;
75295 var isXpubkey = bip32RootKey.isNeutered();
75296 if (hardened && isXpubkey) {
75297 return "Hardened derivation path is invalid with xpub key";
75298 }
75299 return false;
75300 }
75301
75302 function displayBip44Info() {
75303 // Get the derivation path for the account
75304 var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
75305 var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
75306 var account = parseIntNoNaN(DOM.bip44account.val(), 0);
75307 var path = "m/";
75308 path += purpose + "'/";
75309 path += coin + "'/";
75310 path += account + "'/";
75311 // Calculate the account extended keys
75312 var accountExtendedKey = calcBip32ExtendedKey(path);
75313 var accountXprv = accountExtendedKey.toBase58();
75314 var accountXpub = accountExtendedKey.neutered().toBase58();
75315 // Display the extended keys
75316 DOM.bip44accountXprv.val(accountXprv);
75317 DOM.bip44accountXpub.val(accountXpub);
75318 }
75319
75320 function displayBip49Info() {
75321 // Get the derivation path for the account
75322 var purpose = parseIntNoNaN(DOM.bip49purpose.val(), 49);
75323 var coin = parseIntNoNaN(DOM.bip49coin.val(), 0);
75324 var account = parseIntNoNaN(DOM.bip49account.val(), 0);
75325 var path = "m/";
75326 path += purpose + "'/";
75327 path += coin + "'/";
75328 path += account + "'/";
75329 // Calculate the account extended keys
75330 var accountExtendedKey = calcBip32ExtendedKey(path);
75331 var accountXprv = accountExtendedKey.toBase58();
75332 var accountXpub = accountExtendedKey.neutered().toBase58();
75333 // Display the extended keys
75334 DOM.bip49accountXprv.val(accountXprv);
75335 DOM.bip49accountXpub.val(accountXpub);
75336 }
75337
75338 function displayBip84Info() {
75339 // Get the derivation path for the account
75340 var purpose = parseIntNoNaN(DOM.bip84purpose.val(), 84);
75341 var coin = parseIntNoNaN(DOM.bip84coin.val(), 0);
75342 var account = parseIntNoNaN(DOM.bip84account.val(), 0);
75343 var path = "m/";
75344 path += purpose + "'/";
75345 path += coin + "'/";
75346 path += account + "'/";
75347 // Calculate the account extended keys
75348 var accountExtendedKey = calcBip32ExtendedKey(path);
75349 var accountXprv = accountExtendedKey.toBase58();
75350 var accountXpub = accountExtendedKey.neutered().toBase58();
75351 // Display the extended keys
75352 DOM.bip84accountXprv.val(accountXprv);
75353 DOM.bip84accountXpub.val(accountXpub);
75354 }
75355
75356 function displayBip32Info() {
75357 // Display the key
75358 DOM.seed.val(seed);
75359 var rootKey = bip32RootKey.toBase58();
75360 DOM.rootKey.val(rootKey);
75361 var xprvkeyB58 = "NA";
75362 if (!bip32ExtendedKey.isNeutered()) {
75363 xprvkeyB58 = bip32ExtendedKey.toBase58();
75364 }
75365 var extendedPrivKey = xprvkeyB58;
75366 DOM.extendedPrivKey.val(extendedPrivKey);
75367 var extendedPubKey = bip32ExtendedKey.neutered().toBase58();
75368 DOM.extendedPubKey.val(extendedPubKey);
75369 // Display the addresses and privkeys
75370 clearAddressesList();
75371 displayAddresses(0, 20);
75372 }
75373
75374 function displayAddresses(start, total) {
75375 generationProcesses.push(new (function() {
75376
75377 var rows = [];
75378
75379 this.stop = function() {
75380 for (var i=0; i<rows.length; i++) {
75381 rows[i].shouldGenerate = false;
75382 }
75383 hidePending();
75384 }
75385
75386 for (var i=0; i<total; i++) {
75387 var index = i + start;
75388 var isLast = i == total - 1;
75389 rows.push(new TableRow(index, isLast));
75390 }
75391
75392 })());
75393 }
75394
75395 function segwitSelected() {
75396 return bip49TabSelected() || bip84TabSelected() || bip141TabSelected();
75397 }
75398
75399 function p2wpkhSelected() {
75400 return bip84TabSelected() ||
75401 bip141TabSelected() && DOM.bip141semantics.val() == "p2wpkh";
75402 }
75403
75404 function p2wpkhInP2shSelected() {
75405 return bip49TabSelected() ||
75406 (bip141TabSelected() && DOM.bip141semantics.val() == "p2wpkh-p2sh");
75407 }
75408
75409 function TableRow(index, isLast) {
75410
75411 var self = this;
75412 this.shouldGenerate = true;
75413 var useHardenedAddresses = DOM.hardenedAddresses.prop("checked");
75414 var isSegwit = segwitSelected();
75415 var segwitAvailable = networkHasSegwit();
75416 var isP2wpkh = p2wpkhSelected();
75417 var isP2wpkhInP2sh = p2wpkhInP2shSelected();
75418
75419 function init() {
75420 calculateValues();
75421 }
75422
75423 function calculateValues() {
75424 setTimeout(function() {
75425 if (!self.shouldGenerate) {
75426 return;
75427 }
75428 var key = "NA";
75429 if (useHardenedAddresses) {
75430 key = bip32ExtendedKey.deriveHardened(index);
75431 }
75432 else {
75433 key = bip32ExtendedKey.derive(index);
75434 }
75435 var address = key.getAddress().toString();
75436 var privkey = "NA";
75437 if (!key.isNeutered()) {
75438 privkey = key.keyPair.toWIF(network);
75439 }
75440 var pubkey = key.getPublicKeyBuffer().toString('hex');
75441 var indexText = getDerivationPath() + "/" + index;
75442 if (useHardenedAddresses) {
75443 indexText = indexText + "'";
75444 }
75445 // Ethereum values are different
75446 if (networks[DOM.network.val()].name == "ETH - Ethereum") {
75447 var privKeyBuffer = key.keyPair.d.toBuffer();
75448 privkey = privKeyBuffer.toString('hex');
75449 var addressBuffer = ethUtil.privateToAddress(privKeyBuffer);
75450 var hexAddress = addressBuffer.toString('hex');
75451 var checksumAddress = ethUtil.toChecksumAddress(hexAddress);
75452 address = ethUtil.addHexPrefix(checksumAddress);
75453 privkey = ethUtil.addHexPrefix(privkey);
75454 pubkey = ethUtil.addHexPrefix(pubkey);
75455 }
75456 // Ripple values are different
75457 if (networks[DOM.network.val()].name == "XRP - Ripple") {
75458 privkey = convertRipplePriv(privkey);
75459 address = convertRippleAdrr(address);
75460 }
75461 // Segwit addresses are different
75462 if (isSegwit) {
75463 if (!segwitAvailable) {
75464 return;
75465 }
75466 if (isP2wpkh) {
75467 var keyhash = bitcoinjs.bitcoin.crypto.hash160(key.getPublicKeyBuffer());
75468 var scriptpubkey = bitcoinjs.bitcoin.script.witnessPubKeyHash.output.encode(keyhash);
75469 address = bitcoinjs.bitcoin.address.fromOutputScript(scriptpubkey, network)
75470 }
75471 else if (isP2wpkhInP2sh) {
75472 var keyhash = bitcoinjs.bitcoin.crypto.hash160(key.getPublicKeyBuffer());
75473 var scriptsig = bitcoinjs.bitcoin.script.witnessPubKeyHash.output.encode(keyhash);
75474 var addressbytes = bitcoinjs.bitcoin.crypto.hash160(scriptsig);
75475 var scriptpubkey = bitcoinjs.bitcoin.script.scriptHash.output.encode(addressbytes);
75476 address = bitcoinjs.bitcoin.address.fromOutputScript(scriptpubkey, network)
75477 }
75478 }
75479 addAddressToList(indexText, address, pubkey, privkey);
75480 if (isLast) {
75481 hidePending();
75482 updateCsv();
75483 }
75484 }, 50)
75485 }
75486
75487 init();
75488
75489 }
75490
75491 function showMore() {
75492 var rowsToAdd = parseInt(DOM.rowsToAdd.val());
75493 if (isNaN(rowsToAdd)) {
75494 rowsToAdd = 20;
75495 DOM.rowsToAdd.val("20");
75496 }
75497 var start = parseInt(DOM.moreRowsStartIndex.val())
75498 if (isNaN(start)) {
75499 start = lastIndexInTable() + 1;
75500 }
75501 else {
75502 var newStart = start + rowsToAdd;
75503 DOM.moreRowsStartIndex.val(newStart);
75504 }
75505 if (rowsToAdd > 200) {
75506 var msg = "Generating " + rowsToAdd + " rows could take a while. ";
75507 msg += "Do you want to continue?";
75508 if (!confirm(msg)) {
75509 return;
75510 }
75511 }
75512 displayAddresses(start, rowsToAdd);
75513 }
75514
75515 function clearDisplay() {
75516 clearAddressesList();
75517 clearKeys();
75518 hideValidationError();
75519 }
75520
75521 function clearAddressesList() {
75522 DOM.addresses.empty();
75523 DOM.csv.val("");
75524 stopGenerating();
75525 }
75526
75527 function stopGenerating() {
75528 while (generationProcesses.length > 0) {
75529 var generation = generationProcesses.shift();
75530 generation.stop();
75531 }
75532 }
75533
75534 function clearKeys() {
75535 clearRootKey();
75536 clearDerivedKeys();
75537 }
75538
75539 function clearRootKey() {
75540 DOM.rootKey.val("");
75541 }
75542
75543 function clearDerivedKeys() {
75544 DOM.extendedPrivKey.val("");
75545 DOM.extendedPubKey.val("");
75546 DOM.bip44accountXprv.val("");
75547 DOM.bip44accountXpub.val("");
75548 }
75549
75550 function addAddressToList(indexText, address, pubkey, privkey) {
75551 var row = $(addressRowTemplate.html());
75552 // Elements
75553 var indexCell = row.find(".index span");
75554 var addressCell = row.find(".address span");
75555 var pubkeyCell = row.find(".pubkey span");
75556 var privkeyCell = row.find(".privkey span");
75557 // Content
75558 indexCell.text(indexText);
75559 addressCell.text(address);
75560 pubkeyCell.text(pubkey);
75561 privkeyCell.text(privkey);
75562 // Visibility
75563 if (!showIndex) {
75564 indexCell.addClass("invisible");
75565 }
75566 if (!showAddress) {
75567 addressCell.addClass("invisible");
75568 }
75569 if (!showPubKey) {
75570 pubkeyCell.addClass("invisible");
75571 }
75572 if (!showPrivKey) {
75573 privkeyCell.addClass("invisible");
75574 }
75575 DOM.addresses.append(row);
75576 var rowShowQrEls = row.find("[data-show-qr]");
75577 setQrEvents(rowShowQrEls);
75578 }
75579
75580 function hasStrongRandom() {
75581 return 'crypto' in window && window['crypto'] !== null;
75582 }
75583
75584 function disableForms() {
75585 $("form").on("submit", function(e) {
75586 e.preventDefault();
75587 });
75588 }
75589
75590 function parseIntNoNaN(val, defaultVal) {
75591 var v = parseInt(val);
75592 if (isNaN(v)) {
75593 return defaultVal;
75594 }
75595 return v;
75596 }
75597
75598 function showPending() {
75599 DOM.feedback
75600 .text("Calculating...")
75601 .show();
75602 }
75603
75604 function findNearestWord(word) {
75605 var language = getLanguage();
75606 var words = WORDLISTS[language];
75607 var minDistance = 99;
75608 var closestWord = words[0];
75609 for (var i=0; i<words.length; i++) {
75610 var comparedTo = words[i];
75611 if (comparedTo.indexOf(word) == 0) {
75612 return comparedTo;
75613 }
75614 var distance = Levenshtein.get(word, comparedTo);
75615 if (distance < minDistance) {
75616 closestWord = comparedTo;
75617 minDistance = distance;
75618 }
75619 }
75620 return closestWord;
75621 }
75622
75623 function hidePending() {
75624 DOM.feedback
75625 .text("")
75626 .hide();
75627 }
75628
75629 function populateNetworkSelect() {
75630 for (var i=0; i<networks.length; i++) {
75631 var network = networks[i];
75632 var option = $("<option>");
75633 option.attr("value", i);
75634 option.text(network.name);
75635 if (network.name == "BTC - Bitcoin") {
75636 option.prop("selected", true);
75637 }
75638 DOM.phraseNetwork.append(option);
75639 }
75640 }
75641
75642 function populateClientSelect() {
75643 for (var i=0; i<clients.length; i++) {
75644 var client = clients[i];
75645 var option = $("<option>");
75646 option.attr("value", i);
75647 option.text(client.name);
75648 DOM.bip32Client.append(option);
75649 }
75650 }
75651
75652 function getLanguage() {
75653 var defaultLanguage = "english";
75654 // Try to get from existing phrase
75655 var language = getLanguageFromPhrase();
75656 // Try to get from url if not from phrase
75657 if (language.length == 0) {
75658 language = getLanguageFromUrl();
75659 }
75660 // Default to English if no other option
75661 if (language.length == 0) {
75662 language = defaultLanguage;
75663 }
75664 return language;
75665 }
75666
75667 function getLanguageFromPhrase(phrase) {
75668 // Check if how many words from existing phrase match a language.
75669 var language = "";
75670 if (!phrase) {
75671 phrase = DOM.phrase.val();
75672 }
75673 if (phrase.length > 0) {
75674 var words = phraseToWordArray(phrase);
75675 var languageMatches = {};
75676 for (l in WORDLISTS) {
75677 // Track how many words match in this language
75678 languageMatches[l] = 0;
75679 for (var i=0; i<words.length; i++) {
75680 var wordInLanguage = WORDLISTS[l].indexOf(words[i]) > -1;
75681 if (wordInLanguage) {
75682 languageMatches[l]++;
75683 }
75684 }
75685 // Find languages with most word matches.
75686 // This is made difficult due to commonalities between Chinese
75687 // simplified vs traditional.
75688 var mostMatches = 0;
75689 var mostMatchedLanguages = [];
75690 for (var l in languageMatches) {
75691 var numMatches = languageMatches[l];
75692 if (numMatches > mostMatches) {
75693 mostMatches = numMatches;
75694 mostMatchedLanguages = [l];
75695 }
75696 else if (numMatches == mostMatches) {
75697 mostMatchedLanguages.push(l);
75698 }
75699 }
75700 }
75701 if (mostMatchedLanguages.length > 0) {
75702 // Use first language and warn if multiple detected
75703 language = mostMatchedLanguages[0];
75704 if (mostMatchedLanguages.length > 1) {
75705 console.warn("Multiple possible languages");
75706 console.warn(mostMatchedLanguages);
75707 }
75708 }
75709 }
75710 return language;
75711 }
75712
75713 function getLanguageFromUrl() {
75714 for (var language in WORDLISTS) {
75715 if (window.location.hash.indexOf(language) > -1) {
75716 return language;
75717 }
75718 }
75719 return "";
75720 }
75721
75722 function setMnemonicLanguage() {
75723 var language = getLanguage();
75724 // Load the bip39 mnemonic generator for this language if required
75725 if (!(language in mnemonics)) {
75726 mnemonics[language] = new Mnemonic(language);
75727 }
75728 mnemonic = mnemonics[language];
75729 }
75730
75731 function convertPhraseToNewLanguage() {
75732 var oldLanguage = getLanguageFromPhrase();
75733 var newLanguage = getLanguageFromUrl();
75734 var oldPhrase = DOM.phrase.val();
75735 var oldWords = phraseToWordArray(oldPhrase);
75736 var newWords = [];
75737 for (var i=0; i<oldWords.length; i++) {
75738 var oldWord = oldWords[i];
75739 var index = WORDLISTS[oldLanguage].indexOf(oldWord);
75740 var newWord = WORDLISTS[newLanguage][index];
75741 newWords.push(newWord);
75742 }
75743 newPhrase = wordArrayToPhrase(newWords);
75744 return newPhrase;
75745 }
75746
75747 // TODO look at jsbip39 - mnemonic.splitWords
75748 function phraseToWordArray(phrase) {
75749 var words = phrase.split(/\s/g);
75750 var noBlanks = [];
75751 for (var i=0; i<words.length; i++) {
75752 var word = words[i];
75753 if (word.length > 0) {
75754 noBlanks.push(word);
75755 }
75756 }
75757 return noBlanks;
75758 }
75759
75760 // TODO look at jsbip39 - mnemonic.joinWords
75761 function wordArrayToPhrase(words) {
75762 var phrase = words.join(" ");
75763 var language = getLanguageFromPhrase(phrase);
75764 if (language == "japanese") {
75765 phrase = words.join("\u3000");
75766 }
75767 return phrase;
75768 }
75769
75770 function isUsingOwnEntropy() {
75771 return DOM.useEntropy.prop("checked");
75772 }
75773
75774 function setMnemonicFromEntropy() {
75775 clearEntropyFeedback();
75776 // Get entropy value
75777 var entropyStr = DOM.entropy.val();
75778 // Work out minimum base for entropy
75779 var entropy = Entropy.fromString(entropyStr);
75780 if (entropy.binaryStr.length == 0) {
75781 return;
75782 }
75783 // Show entropy details
75784 showEntropyFeedback(entropy);
75785 // Use entropy hash if not using raw entropy
75786 var bits = entropy.binaryStr;
75787 var mnemonicLength = DOM.entropyMnemonicLength.val();
75788 if (mnemonicLength != "raw") {
75789 // Get bits by hashing entropy with SHA256
75790 var hash = sjcl.hash.sha256.hash(entropy.cleanStr);
75791 var hex = sjcl.codec.hex.fromBits(hash);
75792 bits = BigInteger.parse(hex, 16).toString(2);
75793 while (bits.length % 256 != 0) {
75794 bits = "0" + bits;
75795 }
75796 // Truncate hash to suit number of words
75797 mnemonicLength = parseInt(mnemonicLength);
75798 var numberOfBits = 32 * mnemonicLength / 3;
75799 bits = bits.substring(0, numberOfBits);
75800 }
75801 // Discard trailing entropy
75802 var bitsToUse = Math.floor(bits.length / 32) * 32;
75803 var start = bits.length - bitsToUse;
75804 var binaryStr = bits.substring(start);
75805 // Convert entropy string to numeric array
75806 var entropyArr = [];
75807 for (var i=0; i<binaryStr.length / 8; i++) {
75808 var byteAsBits = binaryStr.substring(i*8, i*8+8);
75809 var entropyByte = parseInt(byteAsBits, 2);
75810 entropyArr.push(entropyByte)
75811 }
75812 // Convert entropy array to mnemonic
75813 var phrase = mnemonic.toMnemonic(entropyArr);
75814 // Set the mnemonic in the UI
75815 DOM.phrase.val(phrase);
75816 // Show the word indexes
75817 showWordIndexes();
75818 }
75819
75820 function clearEntropyFeedback() {
75821 DOM.entropyCrackTime.text("...");
75822 DOM.entropyType.text("");
75823 DOM.entropyWordCount.text("0");
75824 DOM.entropyEventCount.text("0");
75825 DOM.entropyBitsPerEvent.text("0");
75826 DOM.entropyBits.text("0");
75827 DOM.entropyFiltered.html("&nbsp;");
75828 DOM.entropyBinary.html("&nbsp;");
75829 }
75830
75831 function showEntropyFeedback(entropy) {
75832 var numberOfBits = entropy.binaryStr.length;
75833 var timeToCrack = "unknown";
75834 try {
75835 var z = zxcvbn(entropy.base.parts.join(""));
75836 timeToCrack = z.crack_times_display.offline_fast_hashing_1e10_per_second;
75837 if (z.feedback.warning != "") {
75838 timeToCrack = timeToCrack + " - " + z.feedback.warning;
75839 };
75840 }
75841 catch (e) {
75842 console.log("Error detecting entropy strength with zxcvbn:");
75843 console.log(e);
75844 }
75845 var entropyTypeStr = getEntropyTypeStr(entropy);
75846 var wordCount = Math.floor(numberOfBits / 32) * 3;
75847 var bitsPerEvent = entropy.bitsPerEvent.toFixed(2);
75848 DOM.entropyFiltered.html(entropy.cleanHtml);
75849 DOM.entropyType.text(entropyTypeStr);
75850 DOM.entropyCrackTime.text(timeToCrack);
75851 DOM.entropyEventCount.text(entropy.base.ints.length);
75852 DOM.entropyBits.text(numberOfBits);
75853 DOM.entropyWordCount.text(wordCount);
75854 DOM.entropyBinary.text(entropy.binaryStr);
75855 DOM.entropyBitsPerEvent.text(bitsPerEvent);
75856 // detect and warn of filtering
75857 var rawNoSpaces = DOM.entropy.val().replace(/\s/g, "");
75858 var cleanNoSpaces = entropy.cleanStr.replace(/\s/g, "");
75859 var isFiltered = rawNoSpaces.length != cleanNoSpaces.length;
75860 if (isFiltered) {
75861 DOM.entropyFilterWarning.removeClass('hidden');
75862 }
75863 else {
75864 DOM.entropyFilterWarning.addClass('hidden');
75865 }
75866 }
75867
75868 function getEntropyTypeStr(entropy) {
75869 var typeStr = entropy.base.str;
75870 // Add some detail if these are cards
75871 if (entropy.base.asInt == 52) {
75872 var cardDetail = []; // array of message strings
75873 // Detect duplicates
75874 var dupes = [];
75875 var dupeTracker = {};
75876 for (var i=0; i<entropy.base.parts.length; i++) {
75877 var card = entropy.base.parts[i];
75878 var cardUpper = card.toUpperCase();
75879 if (cardUpper in dupeTracker) {
75880 dupes.push(card);
75881 }
75882 dupeTracker[cardUpper] = true;
75883 }
75884 if (dupes.length > 0) {
75885 var dupeWord = "duplicates";
75886 if (dupes.length == 1) {
75887 dupeWord = "duplicate";
75888 }
75889 var msg = dupes.length + " " + dupeWord + ": " + dupes.slice(0,3).join(" ");
75890 if (dupes.length > 3) {
75891 msg += "...";
75892 }
75893 cardDetail.push(msg);
75894 }
75895 // Detect full deck
75896 var uniqueCards = [];
75897 for (var uniqueCard in dupeTracker) {
75898 uniqueCards.push(uniqueCard);
75899 }
75900 if (uniqueCards.length == 52) {
75901 cardDetail.unshift("full deck");
75902 }
75903 // Detect missing cards
75904 var values = "A23456789TJQK";
75905 var suits = "CDHS";
75906 var missingCards = [];
75907 for (var i=0; i<suits.length; i++) {
75908 for (var j=0; j<values.length; j++) {
75909 var card = values[j] + suits[i];
75910 if (!(card in dupeTracker)) {
75911 missingCards.push(card);
75912 }
75913 }
75914 }
75915 // Display missing cards if six or less, ie clearly going for full deck
75916 if (missingCards.length > 0 && missingCards.length <= 6) {
75917 var msg = missingCards.length + " missing: " + missingCards.slice(0,3).join(" ");
75918 if (missingCards.length > 3) {
75919 msg += "...";
75920 }
75921 cardDetail.push(msg);
75922 }
75923 // Add card details to typeStr
75924 if (cardDetail.length > 0) {
75925 typeStr += " (" + cardDetail.join(", ") + ")";
75926 }
75927 }
75928 return typeStr;
75929 }
75930
75931 function setQrEvents(els) {
75932 els.on("mouseenter", createQr);
75933 els.on("mouseleave", destroyQr);
75934 els.on("click", toggleQr);
75935 }
75936
75937 function createQr(e) {
75938 var content = e.target.textContent || e.target.value;
75939 if (content) {
75940 var qrEl = kjua({
75941 text: content,
75942 render: "canvas",
75943 size: 310,
75944 ecLevel: 'H',
75945 });
75946 DOM.qrImage.append(qrEl);
75947 if (!showQr) {
75948 DOM.qrHider.addClass("hidden");
75949 }
75950 else {
75951 DOM.qrHider.removeClass("hidden");
75952 }
75953 DOM.qrContainer.removeClass("hidden");
75954 }
75955 }
75956
75957 function destroyQr() {
75958 DOM.qrImage.text("");
75959 DOM.qrContainer.addClass("hidden");
75960 }
75961
75962 function toggleQr() {
75963 showQr = !showQr;
75964 DOM.qrHider.toggleClass("hidden");
75965 DOM.qrHint.toggleClass("hidden");
75966 }
75967
75968 function bip44TabSelected() {
75969 return DOM.bip44tab.hasClass("active");
75970 }
75971
75972 function bip32TabSelected() {
75973 return DOM.bip32tab.hasClass("active");
75974 }
75975
75976 function networkHasSegwit() {
75977 return networks[DOM.network.val()].segwitAvailable;
75978 }
75979
75980 function bip49TabSelected() {
75981 return DOM.bip49tab.hasClass("active");
75982 }
75983
75984 function bip84TabSelected() {
75985 return DOM.bip84tab.hasClass("active");
75986 }
75987
75988 function bip141TabSelected() {
75989 return DOM.bip141tab.hasClass("active");
75990 }
75991
75992 function setHdCoin(coinValue) {
75993 DOM.bip44coin.val(coinValue);
75994 DOM.bip49coin.val(coinValue);
75995 DOM.bip84coin.val(coinValue);
75996 }
75997
75998 function showSegwitAvailable() {
75999 DOM.bip49unavailable.addClass("hidden");
76000 DOM.bip49available.removeClass("hidden");
76001 DOM.bip141unavailable.addClass("hidden");
76002 DOM.bip141available.removeClass("hidden");
76003 }
76004
76005 function showSegwitUnavailable() {
76006 DOM.bip49available.addClass("hidden");
76007 DOM.bip49unavailable.removeClass("hidden");
76008 DOM.bip141available.addClass("hidden");
76009 DOM.bip141unavailable.removeClass("hidden");
76010 }
76011
76012 function useBitpayAddresses() {
76013 return !(DOM.useBitpayAddresses.prop("checked"));
76014 }
76015
76016 function setBitcoinCashNetworkValues() {
76017 if (useBitpayAddresses()) {
76018 network = bitcoinjs.bitcoin.networks.bitcoin;
76019 }
76020 else {
76021 network = bitcoinjs.bitcoin.networks.bitcoinCashBitbpay;
76022 }
76023 }
76024
76025 function adjustNetworkForSegwit() {
76026 // If segwit is selected the xpub/xprv prefixes need to be adjusted
76027 // to avoid accidentally importing BIP49 xpub to BIP44 watch only
76028 // wallet.
76029 // See https://github.com/iancoleman/bip39/issues/125
76030 var segwitNetworks = null;
76031 // if a segwit network is alread selected, need to use base network to
76032 // look up new parameters
76033 if ("baseNetwork" in network) {
76034 network = bitcoinjs.bitcoin.networks[network.baseNetwork];
76035 }
76036 // choose the right segwit params
76037 if (p2wpkhSelected() && "p2wpkh" in network) {
76038 network = network.p2wpkh;
76039 }
76040 else if (p2wpkhInP2shSelected() && "p2wpkhInP2sh" in network) {
76041 network = network.p2wpkhInP2sh;
76042 }
76043 }
76044
76045 function lastIndexInTable() {
76046 var pathText = DOM.addresses.find(".index").last().text();
76047 var pathBits = pathText.split("/");
76048 var lastBit = pathBits[pathBits.length-1];
76049 var lastBitClean = lastBit.replace("'", "");
76050 return parseInt(lastBitClean);
76051 }
76052
76053 function uint8ArrayToHex(a) {
76054 var s = ""
76055 for (var i=0; i<a.length; i++) {
76056 var h = a[i].toString(16);
76057 while (h.length < 2) {
76058 h = "0" + h;
76059 }
76060 s = s + h;
76061 }
76062 return s;
76063 }
76064
76065 function showWordIndexes() {
76066 var phrase = DOM.phrase.val();
76067 var words = phraseToWordArray(phrase);
76068 var wordIndexes = [];
76069 var language = getLanguage();
76070 for (var i=0; i<words.length; i++) {
76071 var word = words[i];
76072 var wordIndex = WORDLISTS[language].indexOf(word);
76073 wordIndexes.push(wordIndex);
76074 }
76075 var wordIndexesStr = wordIndexes.join(", ");
76076 DOM.entropyWordIndexes.text(wordIndexesStr);
76077 }
76078
76079 function updateCsv() {
76080 var tableCsv = "path,address,public key,private key\n";
76081 var rows = DOM.addresses.find("tr");
76082 for (var i=0; i<rows.length; i++) {
76083 var row = $(rows[i]);
76084 var cells = row.find("td");
76085 for (var j=0; j<cells.length; j++) {
76086 var cell = $(cells[j]);
76087 if (!cell.children().hasClass("invisible")) {
76088 tableCsv = tableCsv + cell.text();
76089 }
76090 if (j != cells.length - 1) {
76091 tableCsv = tableCsv + ",";
76092 }
76093 }
76094 tableCsv = tableCsv + "\n";
76095 }
76096 DOM.csv.val(tableCsv);
76097 }
76098
76099 var networks = [
76100 {
76101 name: "BCH - Bitcoin Cash",
76102 segwitAvailable: false,
76103 onSelect: function() {
76104 DOM.useBitpayAddressesContainer.removeClass("hidden");
76105 setBitcoinCashNetworkValues();
76106 setHdCoin(145);
76107 },
76108 },
76109 {
76110 name: "BTC - Bitcoin",
76111 segwitAvailable: true,
76112 onSelect: function() {
76113 network = bitcoinjs.bitcoin.networks.bitcoin;
76114 setHdCoin(0);
76115 },
76116 },
76117 {
76118 name: "BTC - Bitcoin Testnet",
76119 segwitAvailable: true,
76120 onSelect: function() {
76121 network = bitcoinjs.bitcoin.networks.testnet;
76122 setHdCoin(1);
76123 },
76124 },
76125 {
76126 name: "BTG - Bitcoin Gold",
76127 segwitAvailable: true,
76128 onSelect: function() {
76129 network = bitcoinjs.bitcoin.networks.bgold;
76130 setHdCoin(0);
76131 },
76132 },
76133 {
76134 name: "CLAM - Clams",
76135 segwitAvailable: false,
76136 onSelect: function() {
76137 network = bitcoinjs.bitcoin.networks.clam;
76138 setHdCoin(23);
76139 },
76140 },
76141 {
76142 name: "CRW - Crown",
76143 segwitAvailable: false,
76144 onSelect: function() {
76145 network = bitcoinjs.bitcoin.networks.crown;
76146 setHdCoin(72);
76147 },
76148 },
76149 {
76150 name: "DASH - Dash",
76151 segwitAvailable: false,
76152 onSelect: function() {
76153 network = bitcoinjs.bitcoin.networks.dash;
76154 setHdCoin(5);
76155 },
76156 },
76157 {
76158 name: "DASH - Dash Testnet",
76159 segwitAvailable: false,
76160 onSelect: function() {
76161 network = bitcoinjs.bitcoin.networks.dashtn;
76162 setHdCoin(1);
76163 },
76164 },
76165 {
76166 name: "DOGE - Dogecoin",
76167 segwitAvailable: false,
76168 onSelect: function() {
76169 network = bitcoinjs.bitcoin.networks.dogecoin;
76170 setHdCoin(3);
76171 },
76172 },
76173 {
76174 name: "ETH - Ethereum",
76175 segwitAvailable: false,
76176 onSelect: function() {
76177 network = bitcoinjs.bitcoin.networks.bitcoin;
76178 setHdCoin(60);
76179 },
76180 },
76181 {
76182 name: "FJC - Fujicoin",
76183 segwitAvailable: false,
76184 onSelect: function() {
76185 network = bitcoinjs.bitcoin.networks.fujicoin;
76186 setHdCoin(75);
76187 },
76188 },
76189 {
76190 name: "GAME - GameCredits",
76191 segwitAvailable: false,
76192 onSelect: function() {
76193 network = bitcoinjs.bitcoin.networks.game;
76194 setHdCoin(101);
76195 },
76196 },
76197 {
76198 name: "JBS - Jumbucks",
76199 segwitAvailable: false,
76200 onSelect: function() {
76201 network = bitcoinjs.bitcoin.networks.jumbucks;
76202 setHdCoin(26);
76203 },
76204 },
76205 {
76206 name: "KMD - Komodo",
76207 bip49available: false,
76208 onSelect: function() {
76209 network = bitcoinjs.bitcoin.networks.komodo;
76210 setHdCoin(141);
76211 },
76212 },
76213 {
76214 name: "LTC - Litecoin",
76215 segwitAvailable: true,
76216 onSelect: function() {
76217 network = bitcoinjs.bitcoin.networks.litecoin;
76218 setHdCoin(2);
76219 DOM.litecoinLtubContainer.removeClass("hidden");
76220 },
76221 },
76222 {
76223 name: "MAZA - Maza",
76224 segwitAvailable: false,
76225 onSelect: function() {
76226 network = bitcoinjs.bitcoin.networks.maza;
76227 setHdCoin(13);
76228 },
76229 },
76230 {
76231 name: "MONA - Monacoin",
76232 segwitAvailable: true,
76233 onSelect: function() {
76234 network = bitcoinjs.bitcoin.networks.monacoin,
76235 setHdCoin(22);
76236 },
76237 },
76238 {
76239 name: "NMC - Namecoin",
76240 segwitAvailable: false,
76241 onSelect: function() {
76242 network = bitcoinjs.bitcoin.networks.namecoin;
76243 setHdCoin(7);
76244 },
76245 },
76246 {
76247 name: "ONX - Onixcoin",
76248 segwitAvailable: false,
76249 onSelect: function() {
76250 network = bitcoinjs.bitcoin.networks.onixcoin;
76251 setHdCoin(174);
76252 },
76253 },
76254 {
76255 name: "PIVX - PIVX",
76256 segwitAvailable: false,
76257 onSelect: function() {
76258 network = bitcoinjs.bitcoin.networks.pivx;
76259 setHdCoin(119);
76260 },
76261 },
76262 {
76263 name: "PIVX - PIVX Testnet",
76264 segwitAvailable: false,
76265 onSelect: function() {
76266 network = bitcoinjs.bitcoin.networks.pivxtestnet;
76267 setHdCoin(1);
76268 },
76269 },
76270 {
76271 name: "PPC - Peercoin",
76272 segwitAvailable: false,
76273 onSelect: function() {
76274 network = bitcoinjs.bitcoin.networks.peercoin;
76275 setHdCoin(6);
76276 },
76277 },
76278 {
76279 name: "SDC - ShadowCash",
76280 segwitAvailable: false,
76281 onSelect: function() {
76282 network = bitcoinjs.bitcoin.networks.shadow;
76283 setHdCoin(35);
76284 },
76285 },
76286 {
76287 name: "SDC - ShadowCash Testnet",
76288 segwitAvailable: false,
76289 onSelect: function() {
76290 network = bitcoinjs.bitcoin.networks.shadowtn;
76291 setHdCoin(1);
76292 },
76293 },
76294 {
76295 name: "SLM - Slimcoin",
76296 segwitAvailable: false,
76297 onSelect: function() {
76298 network = bitcoinjs.bitcoin.networks.slimcoin;
76299 setHdCoin(63);
76300 },
76301 },
76302 {
76303 name: "SLM - Slimcoin Testnet",
76304 segwitAvailable: false,
76305 onSelect: function() {
76306 network = bitcoinjs.bitcoin.networks.slimcointn;
76307 setHdCoin(111);
76308 },
76309 },
76310 {
76311 name: "USNBT - NuBits",
76312 segwitAvailable: false,
76313 onSelect: function() {
76314 network = bitcoinjs.bitcoin.networks.nubits;
76315 setHdCoin(12);
76316 },
76317 },
76318 {
76319 name: "VIA - Viacoin",
76320 segwitAvailable: false,
76321 onSelect: function() {
76322 network = bitcoinjs.bitcoin.networks.viacoin;
76323 setHdCoin(14);
76324 },
76325 },
76326 {
76327 name: "VIA - Viacoin Testnet",
76328 segwitAvailable: false,
76329 onSelect: function() {
76330 network = bitcoinjs.bitcoin.networks.viacointestnet;
76331 setHdCoin(1);
76332 },
76333 },
76334 {
76335 name: "XMY - Myriadcoin",
76336 segwitAvailable: false,
76337 onSelect: function() {
76338 network = bitcoinjs.bitcoin.networks.myriadcoin;
76339 setHdCoin(90);
76340 },
76341 },
76342 {
76343 name: "XRP - Ripple",
76344 segwitAvailable: false,
76345 onSelect: function() {
76346 network = bitcoinjs.bitcoin.networks.bitcoin;
76347 setHdCoin(144);
76348 },
76349 }
76350 ]
76351
76352 var clients = [
76353 {
76354 name: "Bitcoin Core",
76355 onSelect: function() {
76356 DOM.bip32path.val("m/0'/0'");
76357 DOM.hardenedAddresses.prop('checked', true);
76358 },
76359 },
76360 {
76361 name: "blockchain.info",
76362 onSelect: function() {
76363 DOM.bip32path.val("m/44'/0'/0'");
76364 DOM.hardenedAddresses.prop('checked', false);
76365 },
76366 },
76367 {
76368 name: "MultiBit HD",
76369 onSelect: function() {
76370 DOM.bip32path.val("m/0'/0");
76371 DOM.hardenedAddresses.prop('checked', false);
76372 },
76373 }
76374 ]
76375
76376 init();
76377
76378})();
76379</script>
76380 </body>
76381</html>
diff --git a/changelog.md b/changelog.md
index 19049b0..f539fba 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,83 @@
1# 0.3.9
2
3* Update BTG signing message
4* Add segwit parameters for BTG
5* Add segwit parameters for DigiByte
6* Add Stash network (see 0.3.8s below)
7* Add Salus network
8* Add Cryptoescudo network
9* Add ExchangeCoin network
10* Add Artax network
11* Add BitCloud network
12* Add Megacoin network
13* Add Bitcoin Green network
14* Add ANON network
15* Add ProjectCoin network
16* Reword the 'generate' inputs and words
17* Add note for running http server in python 2
18* Adjust test to run reliably on slow computers
19
20# 0.3.8s
21
22* Add Stash network
23
24# 0.3.8
25
26* Add p2wpkh for litecoin
27* Add more networks - TSTRAT, Hush, ETC, PIRL, CLO, MIX, MUSIC, POA, EXP
28* Add coinomi/ledger client to BIP32 tab
29* Fix SYSCOIN and BTX parameters
30* Remove bip39-standalone.html from repository
31* Remove duplicate id properties on html elements
32
33# 0.3.7
34
35* Update AXE network parameters
36* Add new networks - Xuez, BTCP, BTCZ, ZCL, ZEN
37* Add litecoin bech32 params
38* Fix BIP38 for altcoins
39* Fix missing span closing tag
40* Add indicator to UI for when BIP84 is unavailable
41* Replace hasSegwit variable with test for segwit params
42* Allow xpub to be used as root key for segwit derivations
43* Add visual privacy safeguard
44
45# 0.3.6
46
47* Add Kobocoin
48* Update Vertcoin version byte and segwit support
49* Add Zcash
50* Korean mnemonics use ascii spaces
51* Add CashAddr address format for bitcoin cash
52
53# 0.3.5
54
55* Fix typo
56* Add Neblio network
57* Update bitcoinjs-lib from 3.3.0 to 3.3.2
58* Add Beetle Coin
59* Add segwit for bitcoin testnet and Fujicoin
60* Set coin number for Bitcoin God to 156
61* Add coins supported by coinomi
62* Warn when generating low entropy mnemonics
63* Warn when overriding weak entropy with a strong mnemonic length
64
65# 0.3.4
66
67* Add BlackCoin
68* Add Denarius
69* Raw entropy shows groupings with space every 11 bits
70* Checksum shown in entropy details
71* Warn that entropy values should exclude checksum
72* Add Korean language
73
74# 0.3.3
75
76* Add AXE network
77* Ethereum private key generation bugfix
78* Add BIP38 support
79* Allow initial number of rows to be set by the user
80
1# 0.3.2 81# 0.3.2
2 82
3* Add Onixcoin 83* Add Onixcoin
diff --git a/readme.md b/readme.md
index b22d4e3..269743c 100644
--- a/readme.md
+++ b/readme.md
@@ -74,6 +74,9 @@ Before running tests, the site must be served at http://localhost:8000.
74``` 74```
75$ cd /path/to/bip39/src 75$ cd /path/to/bip39/src
76$ python -m http.server 76$ python -m http.server
77
78or for python2
79$ python -m SimpleHTTPServer
77``` 80```
78 81
79Run tests from the command-line 82Run tests from the command-line
diff --git a/src/css/app.css b/src/css/app.css
index 71109ef..576b7d7 100644
--- a/src/css/app.css
+++ b/src/css/app.css
@@ -103,3 +103,6 @@ body {
103 overflow-x: scroll; 103 overflow-x: scroll;
104 font-family: monospace; 104 font-family: monospace;
105} 105}
106.visual-privacy .private-data {
107 display: none;
108}
diff --git a/src/index.html b/src/index.html
index d3333b5..a3d6c0c 100644
--- a/src/index.html
+++ b/src/index.html
@@ -15,7 +15,7 @@
15 <div class="container"> 15 <div class="container">
16 16
17 <h1 class="text-center">Mnemonic Code Converter</h1> 17 <h1 class="text-center">Mnemonic Code Converter</h1>
18 <p class="version">v0.3.2</p> 18 <p class="version">v0.3.9</p>
19 <hr> 19 <hr>
20 <div class="row"> 20 <div class="row">
21 <div class="col-md-12"> 21 <div class="col-md-12">
@@ -36,8 +36,8 @@
36 <div class="col-sm-10"> 36 <div class="col-sm-10">
37 <div class="form-inline"> 37 <div class="form-inline">
38 <div class="input-group-inline"> 38 <div class="input-group-inline">
39 <span>Generate a random mnemonic, or enter your own below</span>: 39 <span>Generate a random mnemonic</span>:
40 <button class="btn generate">Generate</button> 40 <button class="btn generate" ><b>GENERATE</b></button>
41 <select id="strength" class="strength form-control"> 41 <select id="strength" class="strength form-control">
42 <option value="3">3</option> 42 <option value="3">3</option>
43 <option value="6">6</option> 43 <option value="6">6</option>
@@ -48,7 +48,12 @@
48 <option value="21">21</option> 48 <option value="21">21</option>
49 <option value="24">24</option> 49 <option value="24">24</option>
50 </select> 50 </select>
51 <span>words</span> 51 <span>words, or enter your own below</span>.
52 <p class="warning help-block hidden">
53 <span class="text-danger">
54 Mnemonics with less than 12 words have low entropy and may be guessed by an attacker.
55 </span>
56 </p>
52 </div> 57 </div>
53 </div> 58 </div>
54 </div> 59 </div>
@@ -64,7 +69,7 @@
64 <div class="form-group"> 69 <div class="form-group">
65 <label for="entropy" class="col-sm-2 control-label">Entropy</label> 70 <label for="entropy" class="col-sm-2 control-label">Entropy</label>
66 <div class="col-sm-7"> 71 <div class="col-sm-7">
67 <textarea id="entropy" rows="2" class="entropy form-control" placeholder="Accepts either binary, base 6, 6-sided dice, base 10, hexadecimal or cards"></textarea> 72 <textarea id="entropy" rows="2" class="entropy private-data form-control" placeholder="Accepts either binary, base 6, 6-sided dice, base 10, hexadecimal or cards"></textarea>
68 <div class="row filter-warning text-danger hidden"> 73 <div class="row filter-warning text-danger hidden">
69 <p class="col-sm-12"> 74 <p class="col-sm-12">
70 <strong> 75 <strong>
@@ -91,21 +96,28 @@
91 <div class="bits col-sm-3 form-control-static"></div> 96 <div class="bits col-sm-3 form-control-static"></div>
92 </div> 97 </div>
93 <label class="col-sm-3 control-label">Filtered Entropy</label> 98 <label class="col-sm-3 control-label">Filtered Entropy</label>
94 <div class="filtered col-sm-9 form-control-static"></div> 99 <div class="filtered private-data col-sm-9 form-control-static"></div>
95 <label class="col-sm-3 control-label">Raw Binary</label> 100 <label class="col-sm-3 control-label">Raw Binary</label>
96 <div class="binary col-sm-9 form-control-static"></div> 101 <div class="binary private-data col-sm-9 form-control-static"></div>
102 <label class="col-sm-3 control-label">Binary Checksum</label>
103 <div class="checksum private-data col-sm-9 form-control-static">&nbsp;</div>
97 <label class="col-sm-3 control-label">Word Indexes</label> 104 <label class="col-sm-3 control-label">Word Indexes</label>
98 <div class="word-indexes col-sm-9 form-control-static">&nbsp;</div> 105 <div class="word-indexes private-data col-sm-9 form-control-static">&nbsp;</div>
99 <label class="col-sm-3 control-label">Mnemonic Length</label> 106 <label class="col-sm-3 control-label">Mnemonic Length</label>
100 <div class="col-sm-9"> 107 <div class="col-sm-9">
101 <select class="mnemonic-length form-control"> 108 <select class="mnemonic-length form-control">
102 <option value="raw" selected>Use Raw Entropy (3 words per 32 bits)</option> 109 <option value="raw" selected>Use Raw Entropy (3 words per 32 bits)</option>
103 <option value="12">12 <span>Words</span></option> 110 <option value="12">12 <span>Words</span></option>
104 <option value="15">15 <span>Words</option> 111 <option value="15">15 <span>Words</span></option>
105 <option value="18">18 <span>Words</span></option> 112 <option value="18">18 <span>Words</span></option>
106 <option value="21">21 <span>Words</span></option> 113 <option value="21">21 <span>Words</span></option>
107 <option value="24">24 <span>Words</span></option> 114 <option value="24">24 <span>Words</span></option>
108 </select> 115 </select>
116 <p class="weak-entropy-override-warning hidden">
117 <span class="text-danger">
118 The mnemonic will appear more secure than it really is.
119 </span>
120 </p>
109 </div> 121 </div>
110 </div> 122 </div>
111 <div class="col-sm-3"> 123 <div class="col-sm-3">
@@ -131,6 +143,15 @@
131 </div> 143 </div>
132 </div> 144 </div>
133 <div class="form-group"> 145 <div class="form-group">
146 <div class="col-sm-2"></div>
147 <div class="col-sm-10 checkbox">
148 <label>
149 <input type="checkbox" class="privacy-screen-toggle">
150 <span>Hide all private info</span>
151 </label>
152 </div>
153 </div>
154 <div class="form-group">
134 <label class="col-sm-2 control-label">Mnemonic Language</label> 155 <label class="col-sm-2 control-label">Mnemonic Language</label>
135 <div class="col-sm-10 languages"> 156 <div class="col-sm-10 languages">
136 <div class="form-control no-border"> 157 <div class="form-control no-border">
@@ -141,25 +162,26 @@
141 <a href="#chinese_traditional" title="Chinese (Traditional)">中文(繁體)</a> 162 <a href="#chinese_traditional" title="Chinese (Traditional)">中文(繁體)</a>
142 <a href="#french" title="French">Français</a> 163 <a href="#french" title="French">Français</a>
143 <a href="#italian" title="Italian">Italiano</a> 164 <a href="#italian" title="Italian">Italiano</a>
165 <a href="#korean" title="Korean">한국어</a>
144 </div> 166 </div>
145 </div> 167 </div>
146 </div> 168 </div>
147 <div class="form-group"> 169 <div class="form-group">
148 <label for="phrase" class="col-sm-2 control-label">BIP39 Mnemonic</label> 170 <label for="phrase" class="col-sm-2 control-label">BIP39 Mnemonic</label>
149 <div class="col-sm-10"> 171 <div class="col-sm-10">
150 <textarea id="phrase" class="phrase form-control" data-show-qr></textarea> 172 <textarea id="phrase" class="phrase private-data form-control" data-show-qr></textarea>
151 </div> 173 </div>
152 </div> 174 </div>
153 <div class="form-group"> 175 <div class="form-group">
154 <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label> 176 <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label>
155 <div class="col-sm-10"> 177 <div class="col-sm-10">
156 <textarea id="passphrase" class="passphrase form-control"></textarea> 178 <textarea id="passphrase" class="passphrase private-data form-control"></textarea>
157 </div> 179 </div>
158 </div> 180 </div>
159 <div class="form-group"> 181 <div class="form-group">
160 <label for="seed" class="col-sm-2 control-label">BIP39 Seed</label> 182 <label for="seed" class="col-sm-2 control-label">BIP39 Seed</label>
161 <div class="col-sm-10"> 183 <div class="col-sm-10">
162 <textarea id="seed" class="seed form-control" readonly="readonly" data-show-qr></textarea> 184 <textarea id="seed" class="seed private-data form-control" readonly="readonly" data-show-qr></textarea>
163 </div> 185 </div>
164 </div> 186 </div>
165 <div class="form-group"> 187 <div class="form-group">
@@ -173,7 +195,7 @@
173 <div class="form-group"> 195 <div class="form-group">
174 <label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label> 196 <label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label>
175 <div class="col-sm-10"> 197 <div class="col-sm-10">
176 <textarea id="root-key" class="root-key form-control" data-show-qr></textarea> 198 <textarea id="root-key" class="root-key private-data form-control" data-show-qr></textarea>
177 </div> 199 </div>
178 </div> 200 </div>
179 <div class="form-group litecoin-ltub-container hidden"> 201 <div class="form-group litecoin-ltub-container hidden">
@@ -223,35 +245,35 @@
223 </p> 245 </p>
224 </div> 246 </div>
225 <div class="form-group"> 247 <div class="form-group">
226 <label for="purpose" class="col-sm-2 control-label"> 248 <label for="purpose-bip44" class="col-sm-2 control-label">
227 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a> 249 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a>
228 </label> 250 </label>
229 <div class="col-sm-10"> 251 <div class="col-sm-10">
230 <input id="purpose" type="text" class="purpose form-control" value="44" readonly> 252 <input id="purpose-bip44" type="text" class="purpose form-control" value="44" readonly>
231 </div> 253 </div>
232 </div> 254 </div>
233 <div class="form-group"> 255 <div class="form-group">
234 <label for="coin" class="col-sm-2 control-label"> 256 <label for="coin-bip44" class="col-sm-2 control-label">
235 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a> 257 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a>
236 </label> 258 </label>
237 <div class="col-sm-10"> 259 <div class="col-sm-10">
238 <input id="coin" type="text" class="coin form-control" value="0" readonly> 260 <input id="coin-bip44" type="text" class="coin form-control" value="0" readonly>
239 </div> 261 </div>
240 </div> 262 </div>
241 <div class="form-group"> 263 <div class="form-group">
242 <label for="account" class="col-sm-2 control-label"> 264 <label for="account-bip44" class="col-sm-2 control-label">
243 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a> 265 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a>
244 </label> 266 </label>
245 <div class="col-sm-10"> 267 <div class="col-sm-10">
246 <input id="account" type="text" class="account form-control" value="0"> 268 <input id="account-bip44" type="text" class="account form-control" value="0">
247 </div> 269 </div>
248 </div> 270 </div>
249 <div class="form-group"> 271 <div class="form-group">
250 <label for="change" class="col-sm-2 control-label"> 272 <label for="change-bip44" class="col-sm-2 control-label">
251 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a> 273 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
252 </label> 274 </label>
253 <div class="col-sm-10"> 275 <div class="col-sm-10">
254 <input id="change" type="text" class="change form-control" value="0"> 276 <input id="change-bip44" type="text" class="change form-control" value="0">
255 </div> 277 </div>
256 </div> 278 </div>
257 <div class="form-group"> 279 <div class="form-group">
@@ -266,7 +288,7 @@
266 <span>Account Extended Private Key</span> 288 <span>Account Extended Private Key</span>
267 </label> 289 </label>
268 <div class="col-sm-10"> 290 <div class="col-sm-10">
269 <textarea id="account-xprv" type="text" class="account-xprv form-control" readonly data-show-qr></textarea> 291 <textarea id="account-xprv-bip44" type="text" class="account-xprv private-data form-control" readonly data-show-qr></textarea>
270 </div> 292 </div>
271 </div> 293 </div>
272 <div class="form-group"> 294 <div class="form-group">
@@ -274,7 +296,7 @@
274 <span>Account Extended Public Key</span> 296 <span>Account Extended Public Key</span>
275 </label> 297 </label>
276 <div class="col-sm-10"> 298 <div class="col-sm-10">
277 <textarea id="account-xpub" type="text" class="account-xpub form-control" readonly data-show-qr></textarea> 299 <textarea id="account-xpub-bip44" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
278 </div> 300 </div>
279 </div> 301 </div>
280 <div class="form-group"> 302 <div class="form-group">
@@ -383,35 +405,35 @@
383 </p> 405 </p>
384 </div> 406 </div>
385 <div class="form-group"> 407 <div class="form-group">
386 <label for="purpose" class="col-sm-2 control-label"> 408 <label for="purpose-bip49" class="col-sm-2 control-label">
387 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a> 409 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a>
388 </label> 410 </label>
389 <div class="col-sm-10"> 411 <div class="col-sm-10">
390 <input id="purpose" type="text" class="purpose form-control" value="49" readonly> 412 <input id="purpose-bip49" type="text" class="purpose form-control" value="49" readonly>
391 </div> 413 </div>
392 </div> 414 </div>
393 <div class="form-group"> 415 <div class="form-group">
394 <label for="coin" class="col-sm-2 control-label"> 416 <label for="coin-bip49" class="col-sm-2 control-label">
395 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a> 417 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a>
396 </label> 418 </label>
397 <div class="col-sm-10"> 419 <div class="col-sm-10">
398 <input id="coin" type="text" class="coin form-control" value="0" readonly> 420 <input id="coin-bip49" type="text" class="coin form-control" value="0" readonly>
399 </div> 421 </div>
400 </div> 422 </div>
401 <div class="form-group"> 423 <div class="form-group">
402 <label for="account" class="col-sm-2 control-label"> 424 <label for="account-bip49" class="col-sm-2 control-label">
403 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a> 425 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a>
404 </label> 426 </label>
405 <div class="col-sm-10"> 427 <div class="col-sm-10">
406 <input id="account" type="text" class="account form-control" value="0"> 428 <input id="account-bip49" type="text" class="account form-control" value="0">
407 </div> 429 </div>
408 </div> 430 </div>
409 <div class="form-group"> 431 <div class="form-group">
410 <label for="change" class="col-sm-2 control-label"> 432 <label for="change-bip49" class="col-sm-2 control-label">
411 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a> 433 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
412 </label> 434 </label>
413 <div class="col-sm-10"> 435 <div class="col-sm-10">
414 <input id="change" type="text" class="change form-control" value="0"> 436 <input id="change-bip49" type="text" class="change form-control" value="0">
415 </div> 437 </div>
416 </div> 438 </div>
417 <div class="form-group"> 439 <div class="form-group">
@@ -426,7 +448,7 @@
426 <span>Account Extended Private Key</span> 448 <span>Account Extended Private Key</span>
427 </label> 449 </label>
428 <div class="col-sm-10"> 450 <div class="col-sm-10">
429 <textarea id="account-xprv" type="text" class="account-xprv form-control" readonly data-show-qr></textarea> 451 <textarea id="account-xprv-bip49" type="text" class="account-xprv private-data form-control" readonly data-show-qr></textarea>
430 </div> 452 </div>
431 </div> 453 </div>
432 <div class="form-group"> 454 <div class="form-group">
@@ -434,7 +456,7 @@
434 <span>Account Extended Public Key</span> 456 <span>Account Extended Public Key</span>
435 </label> 457 </label>
436 <div class="col-sm-10"> 458 <div class="col-sm-10">
437 <textarea id="account-xpub" type="text" class="account-xpub form-control" readonly data-show-qr></textarea> 459 <textarea id="account-xpub-bip49" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
438 </div> 460 </div>
439 </div> 461 </div>
440 <div class="form-group"> 462 <div class="form-group">
@@ -493,79 +515,89 @@
493 <div id="bip84" class="tab-pane"> 515 <div id="bip84" class="tab-pane">
494 <form class="form-horizontal" role="form"> 516 <form class="form-horizontal" role="form">
495 <br> 517 <br>
496 <div class="col-sm-2"></div> 518 <div class="unavailable hidden">
497 <div class="col-sm-10"> 519 <div class="form-group">
498 <p> 520 <div class="col-sm-2"></div>
499 For more info see the 521 <div class="col-sm-10">
500 <a href="https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki" target="_blank">BIP84 spec</a>. 522 <p>BIP84 is unavailable for this coin.</p>
501 </p> 523 </div>
502 </div>
503 <div class="form-group">
504 <label for="purpose" class="col-sm-2 control-label">
505 Purpose
506 </label>
507 <div class="col-sm-10">
508 <input id="purpose" type="text" class="purpose form-control" value="84" readonly>
509 </div> 524 </div>
510 </div> 525 </div>
511 <div class="form-group"> 526 <div class="available">
512 <label for="coin" class="col-sm-2 control-label"> 527 <div class="col-sm-2"></div>
513 Coin
514 </label>
515 <div class="col-sm-10"> 528 <div class="col-sm-10">
516 <input id="coin" type="text" class="coin form-control" value="0" readonly> 529 <p>
530 For more info see the
531 <a href="https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki" target="_blank">BIP84 spec</a>.
532 </p>
517 </div> 533 </div>
518 </div> 534 <div class="form-group">
519 <div class="form-group"> 535 <label for="purpose-bip84" class="col-sm-2 control-label">
520 <label for="account" class="col-sm-2 control-label"> 536 Purpose
521 Account 537 </label>
522 </label> 538 <div class="col-sm-10">
523 <div class="col-sm-10"> 539 <input id="purpose-bip84" type="text" class="purpose form-control" value="84" readonly>
524 <input id="account" type="text" class="account form-control" value="0"> 540 </div>
525 </div> 541 </div>
526 </div> 542 <div class="form-group">
527 <div class="form-group"> 543 <label for="coin-bip84" class="col-sm-2 control-label">
528 <label for="change" class="col-sm-2 control-label"> 544 Coin
529 External / Internal 545 </label>
530 </label> 546 <div class="col-sm-10">
531 <div class="col-sm-10"> 547 <input id="coin-bip84" type="text" class="coin form-control" value="0" readonly>
532 <input id="change" type="text" class="change form-control" value="0"> 548 </div>
533 </div> 549 </div>
534 </div> 550 <div class="form-group">
535 <div class="form-group"> 551 <label for="account-bip84" class="col-sm-2 control-label">
536 <label class="col-sm-2 control-label"> 552 Account
537 </label> 553 </label>
538 <div class="col-sm-10"> 554 <div class="col-sm-10">
539 <p>The account extended keys can be used for importing to most BIP84 compatible wallets.</p> 555 <input id="account-bip84" type="text" class="account form-control" value="0">
556 </div>
540 </div> 557 </div>
541 </div> 558 <div class="form-group">
542 <div class="form-group"> 559 <label for="change-bip84" class="col-sm-2 control-label">
543 <label for="account-xprv" class="col-sm-2 control-label"> 560 External / Internal
544 <span>Account Extended Private Key</span> 561 </label>
545 </label> 562 <div class="col-sm-10">
546 <div class="col-sm-10"> 563 <input id="change-bip84" type="text" class="change form-control" value="0">
547 <textarea id="account-xprv" type="text" class="account-xprv form-control" readonly data-show-qr></textarea> 564 </div>
548 </div> 565 </div>
549 </div> 566 <div class="form-group">
550 <div class="form-group"> 567 <label class="col-sm-2 control-label">
551 <label for="account-xpub" class="col-sm-2 control-label"> 568 </label>
552 <span>Account Extended Public Key</span> 569 <div class="col-sm-10">
553 </label> 570 <p>The account extended keys can be used for importing to most BIP84 compatible wallets.</p>
554 <div class="col-sm-10"> 571 </div>
555 <textarea id="account-xpub" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
556 </div> 572 </div>
557 </div> 573 <div class="form-group">
558 <div class="form-group"> 574 <label for="account-xprv" class="col-sm-2 control-label">
559 <label class="col-sm-2 control-label"> 575 <span>Account Extended Private Key</span>
560 </label> 576 </label>
561 <div class="col-sm-10"> 577 <div class="col-sm-10">
562 <p>The BIP32 derivation path and extended keys are the basis for the derived addresses.</p> 578 <textarea id="account-xprv-bip84" type="text" class="account-xprv private-data form-control" readonly data-show-qr></textarea>
579 </div>
563 </div> 580 </div>
564 </div> 581 <div class="form-group">
565 <div class="form-group"> 582 <label for="account-xpub" class="col-sm-2 control-label">
566 <label for="bip84-path" class="col-sm-2 control-label">BIP32 Derivation Path</label> 583 <span>Account Extended Public Key</span>
567 <div class="col-sm-10"> 584 </label>
568 <input id="bip84-path" type="text" class="path form-control" value="m/84'/0'/0'/0" readonly="readonly"> 585 <div class="col-sm-10">
586 <textarea id="account-xpub-bip84" type="text" class="account-xpub form-control" readonly data-show-qr></textarea>
587 </div>
588 </div>
589 <div class="form-group">
590 <label class="col-sm-2 control-label">
591 </label>
592 <div class="col-sm-10">
593 <p>The BIP32 derivation path and extended keys are the basis for the derived addresses.</p>
594 </div>
595 </div>
596 <div class="form-group">
597 <label for="bip84-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
598 <div class="col-sm-10">
599 <input id="bip84-path" type="text" class="path form-control" value="m/84'/0'/0'/0" readonly="readonly">
600 </div>
569 </div> 601 </div>
570 </div> 602 </div>
571 </form> 603 </form>
@@ -575,7 +607,7 @@
575 <div class="form-group"> 607 <div class="form-group">
576 <label for="extended-priv-key" class="col-sm-2 control-label">BIP32 Extended Private Key</label> 608 <label for="extended-priv-key" class="col-sm-2 control-label">BIP32 Extended Private Key</label>
577 <div class="col-sm-10"> 609 <div class="col-sm-10">
578 <textarea id="extended-priv-key" class="extended-priv-key form-control" readonly="readonly" data-show-qr></textarea> 610 <textarea id="extended-priv-key" class="extended-priv-key private-data form-control" readonly="readonly" data-show-qr></textarea>
579 </div> 611 </div>
580 </div> 612 </div>
581 <div class="form-group"> 613 <div class="form-group">
@@ -595,13 +627,35 @@
595 <h2>Derived Addresses</h2> 627 <h2>Derived Addresses</h2>
596 <p>Note these addresses are derived from the BIP32 Extended Key</p> 628 <p>Note these addresses are derived from the BIP32 Extended Key</p>
597 </div> 629 </div>
598 <div class="col-md-12 use-bitpay-addresses-container hidden"> 630 <div class="col-md-12 bch-addr-type-container hidden">
599 <div class="checkbox"> 631 <div class="radio">
632 <label>
633 <input type="radio" value="cashaddr" name="bch-addr-type" class="use-bch-cashaddr-addresses" checked="checked">
634 <span>Use CashAddr addresses for Bitcoin Cash (ie starting with 'q' instead of '1')</span>
635 </label>
636 </div>
637 <div class="radio">
600 <label> 638 <label>
601 <input type="checkbox" class="use-bitpay-addresses"> 639 <input type="radio" value="bitpay" name="bch-addr-type" class="use-bch-bitpay-addresses">
602 <span>Use BitPay-style addresses for Bitcoin Cash (ie starting with 'C' instead of '1')</span> 640 <span>Use BitPay-style addresses for Bitcoin Cash (ie starting with 'C' instead of '1')</span>
603 </label> 641 </label>
604 </div> 642 </div>
643 <div class="radio">
644 <label>
645 <input type="radio" value="legacy" name="bch-addr-type" class="use-bch-legacy-addresses">
646 <span>Use legacy addresses for Bitcoin Cash (ie starting with '1')</span>
647 </label>
648 </div>
649 </div>
650 <div class="col-md-12">
651 <div class="checkbox">
652 <label>
653 <input type="checkbox" class="use-bip38">
654 <span>Encrypt private keys using BIP38 and this password:</span>
655 </label>
656 <input class="bip38-password private-data">
657 <span>Enabling BIP38 means each key will take several minutes to generate.</span>
658 </div>
605 </div> 659 </div>
606 <ul class="addresses-type nav nav-tabs" role="tablist"> 660 <ul class="addresses-type nav nav-tabs" role="tablist">
607 <li id="table-tab" class="active"> 661 <li id="table-tab" class="active">
@@ -704,6 +758,9 @@
704 </p> 758 </p>
705 <h3 id="entropy-notes">Entropy</h3> 759 <h3 id="entropy-notes">Entropy</h3>
706 <p> 760 <p>
761 <span>Entropy values should not include the BIP39 checksum. This is automatically added by the tool.</span>
762 </p>
763 <p>
707 <span> 764 <span>
708 Entropy values must be sourced from a 765 Entropy values must be sourced from a
709 <a href="https://en.wikipedia.org/wiki/Random_number_generation" target="_blank">strong source of randomness</a>. 766 <a href="https://en.wikipedia.org/wiki/Random_number_generation" target="_blank">strong source of randomness</a>.
@@ -861,7 +918,7 @@
861 <td class="index"><span></span></td> 918 <td class="index"><span></span></td>
862 <td class="address"><span data-show-qr></span></td> 919 <td class="address"><span data-show-qr></span></td>
863 <td class="pubkey"><span data-show-qr></span></td> 920 <td class="pubkey"><span data-show-qr></span></td>
864 <td class="privkey"><span data-show-qr></span></td> 921 <td class="privkey private-data"><span data-show-qr></span></td>
865 </tr> 922 </tr>
866 </script> 923 </script>
867 <script src="js/polyfill.es6.js"></script> 924 <script src="js/polyfill.es6.js"></script>
@@ -871,11 +928,13 @@
871 <script src="js/bootstrap-3.3.7.js"></script> 928 <script src="js/bootstrap-3.3.7.js"></script>
872 <script src="js/levenshtein.js"></script> 929 <script src="js/levenshtein.js"></script>
873 <script src="js/kjua-0.1.1.min.js"></script> 930 <script src="js/kjua-0.1.1.min.js"></script>
874 <script src="js/bitcoinjs-3.3.0.js"></script> 931 <script src="js/bitcoinjs-3.3.2.js"></script>
875 <script src="js/bitcoinjs-extensions.js"></script> 932 <script src="js/bitcoinjs-extensions.js"></script>
933 <script src="js/bitcoinjs-bip38-2.0.2.js"></script>
876 <script src="js/segwit-parameters.js"></script> 934 <script src="js/segwit-parameters.js"></script>
877 <script src="js/ethereumjs-util.js"></script> 935 <script src="js/ethereumjs-util.js"></script>
878 <script src="js/ripple-util.js"></script> 936 <script src="js/ripple-util.js"></script>
937 <script src="js/bchaddrjs-0.2.1.js"></script>
879 <script src="js/sjcl-bip39.js"></script> 938 <script src="js/sjcl-bip39.js"></script>
880 <script src="js/wordlist_english.js"></script> 939 <script src="js/wordlist_english.js"></script>
881 <script src="js/wordlist_japanese.js"></script> 940 <script src="js/wordlist_japanese.js"></script>
@@ -884,6 +943,7 @@
884 <script src="js/wordlist_chinese_traditional.js"></script> 943 <script src="js/wordlist_chinese_traditional.js"></script>
885 <script src="js/wordlist_french.js"></script> 944 <script src="js/wordlist_french.js"></script>
886 <script src="js/wordlist_italian.js"></script> 945 <script src="js/wordlist_italian.js"></script>
946 <script src="js/wordlist_korean.js"></script>
887 <script src="js/jsbip39.js"></script> 947 <script src="js/jsbip39.js"></script>
888 <script src="js/biginteger.js"></script> 948 <script src="js/biginteger.js"></script>
889 <script src="js/zxcvbn.js"></script> 949 <script src="js/zxcvbn.js"></script>
diff --git a/src/js/bchaddrjs-0.2.1.js b/src/js/bchaddrjs-0.2.1.js
new file mode 100644
index 0000000..8356f10
--- /dev/null
+++ b/src/js/bchaddrjs-0.2.1.js
@@ -0,0 +1,9328 @@
1(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.bchaddr = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2// base-x encoding
3// Forked from https://github.com/cryptocoinjs/bs58
4// Originally written by Mike Hearn for BitcoinJ
5// Copyright (c) 2011 Google Inc
6// Ported to JavaScript by Stefan Thomas
7// Merged Buffer refactorings from base58-native by Stephen Pair
8// Copyright (c) 2013 BitPay Inc
9
10var Buffer = require('safe-buffer').Buffer
11
12module.exports = function base (ALPHABET) {
13 var ALPHABET_MAP = {}
14 var BASE = ALPHABET.length
15 var LEADER = ALPHABET.charAt(0)
16
17 // pre-compute lookup table
18 for (var z = 0; z < ALPHABET.length; z++) {
19 var x = ALPHABET.charAt(z)
20
21 if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')
22 ALPHABET_MAP[x] = z
23 }
24
25 function encode (source) {
26 if (source.length === 0) return ''
27
28 var digits = [0]
29 for (var i = 0; i < source.length; ++i) {
30 for (var j = 0, carry = source[i]; j < digits.length; ++j) {
31 carry += digits[j] << 8
32 digits[j] = carry % BASE
33 carry = (carry / BASE) | 0
34 }
35
36 while (carry > 0) {
37 digits.push(carry % BASE)
38 carry = (carry / BASE) | 0
39 }
40 }
41
42 var string = ''
43
44 // deal with leading zeros
45 for (var k = 0; source[k] === 0 && k < source.length - 1; ++k) string += LEADER
46 // convert digits to a string
47 for (var q = digits.length - 1; q >= 0; --q) string += ALPHABET[digits[q]]
48
49 return string
50 }
51
52 function decodeUnsafe (string) {
53 if (typeof string !== 'string') throw new TypeError('Expected String')
54 if (string.length === 0) return Buffer.allocUnsafe(0)
55
56 var bytes = [0]
57 for (var i = 0; i < string.length; i++) {
58 var value = ALPHABET_MAP[string[i]]
59 if (value === undefined) return
60
61 for (var j = 0, carry = value; j < bytes.length; ++j) {
62 carry += bytes[j] * BASE
63 bytes[j] = carry & 0xff
64 carry >>= 8
65 }
66
67 while (carry > 0) {
68 bytes.push(carry & 0xff)
69 carry >>= 8
70 }
71 }
72
73 // deal with leading zeros
74 for (var k = 0; string[k] === LEADER && k < string.length - 1; ++k) {
75 bytes.push(0)
76 }
77
78 return Buffer.from(bytes.reverse())
79 }
80
81 function decode (string) {
82 var buffer = decodeUnsafe(string)
83 if (buffer) return buffer
84
85 throw new Error('Non-base' + BASE + ' character')
86 }
87
88 return {
89 encode: encode,
90 decodeUnsafe: decodeUnsafe,
91 decode: decode
92 }
93}
94
95},{"safe-buffer":40}],2:[function(require,module,exports){
96'use strict'
97
98exports.byteLength = byteLength
99exports.toByteArray = toByteArray
100exports.fromByteArray = fromByteArray
101
102var lookup = []
103var revLookup = []
104var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
105
106var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
107for (var i = 0, len = code.length; i < len; ++i) {
108 lookup[i] = code[i]
109 revLookup[code.charCodeAt(i)] = i
110}
111
112revLookup['-'.charCodeAt(0)] = 62
113revLookup['_'.charCodeAt(0)] = 63
114
115function placeHoldersCount (b64) {
116 var len = b64.length
117 if (len % 4 > 0) {
118 throw new Error('Invalid string. Length must be a multiple of 4')
119 }
120
121 // the number of equal signs (place holders)
122 // if there are two placeholders, than the two characters before it
123 // represent one byte
124 // if there is only one, then the three characters before it represent 2 bytes
125 // this is just a cheap hack to not do indexOf twice
126 return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
127}
128
129function byteLength (b64) {
130 // base64 is 4/3 + up to two characters of the original data
131 return (b64.length * 3 / 4) - placeHoldersCount(b64)
132}
133
134function toByteArray (b64) {
135 var i, l, tmp, placeHolders, arr
136 var len = b64.length
137 placeHolders = placeHoldersCount(b64)
138
139 arr = new Arr((len * 3 / 4) - placeHolders)
140
141 // if there are placeholders, only get up to the last complete 4 chars
142 l = placeHolders > 0 ? len - 4 : len
143
144 var L = 0
145
146 for (i = 0; i < l; i += 4) {
147 tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
148 arr[L++] = (tmp >> 16) & 0xFF
149 arr[L++] = (tmp >> 8) & 0xFF
150 arr[L++] = tmp & 0xFF
151 }
152
153 if (placeHolders === 2) {
154 tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
155 arr[L++] = tmp & 0xFF
156 } else if (placeHolders === 1) {
157 tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
158 arr[L++] = (tmp >> 8) & 0xFF
159 arr[L++] = tmp & 0xFF
160 }
161
162 return arr
163}
164
165function tripletToBase64 (num) {
166 return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
167}
168
169function encodeChunk (uint8, start, end) {
170 var tmp
171 var output = []
172 for (var i = start; i < end; i += 3) {
173 tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
174 output.push(tripletToBase64(tmp))
175 }
176 return output.join('')
177}
178
179function fromByteArray (uint8) {
180 var tmp
181 var len = uint8.length
182 var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
183 var output = ''
184 var parts = []
185 var maxChunkLength = 16383 // must be multiple of 3
186
187 // go through the array every three bytes, we'll deal with trailing stuff later
188 for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
189 parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
190 }
191
192 // pad the end with zeros, but make sure to not forget the extra bytes
193 if (extraBytes === 1) {
194 tmp = uint8[len - 1]
195 output += lookup[tmp >> 2]
196 output += lookup[(tmp << 4) & 0x3F]
197 output += '=='
198 } else if (extraBytes === 2) {
199 tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
200 output += lookup[tmp >> 10]
201 output += lookup[(tmp >> 4) & 0x3F]
202 output += lookup[(tmp << 2) & 0x3F]
203 output += '='
204 }
205
206 parts.push(output)
207
208 return parts.join('')
209}
210
211},{}],3:[function(require,module,exports){
212var bigInt = (function (undefined) {
213 "use strict";
214
215 var BASE = 1e7,
216 LOG_BASE = 7,
217 MAX_INT = 9007199254740992,
218 MAX_INT_ARR = smallToArray(MAX_INT),
219 LOG_MAX_INT = Math.log(MAX_INT);
220
221 function Integer(v, radix) {
222 if (typeof v === "undefined") return Integer[0];
223 if (typeof radix !== "undefined") return +radix === 10 ? parseValue(v) : parseBase(v, radix);
224 return parseValue(v);
225 }
226
227 function BigInteger(value, sign) {
228 this.value = value;
229 this.sign = sign;
230 this.isSmall = false;
231 }
232 BigInteger.prototype = Object.create(Integer.prototype);
233
234 function SmallInteger(value) {
235 this.value = value;
236 this.sign = value < 0;
237 this.isSmall = true;
238 }
239 SmallInteger.prototype = Object.create(Integer.prototype);
240
241 function isPrecise(n) {
242 return -MAX_INT < n && n < MAX_INT;
243 }
244
245 function smallToArray(n) { // For performance reasons doesn't reference BASE, need to change this function if BASE changes
246 if (n < 1e7)
247 return [n];
248 if (n < 1e14)
249 return [n % 1e7, Math.floor(n / 1e7)];
250 return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];
251 }
252
253 function arrayToSmall(arr) { // If BASE changes this function may need to change
254 trim(arr);
255 var length = arr.length;
256 if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {
257 switch (length) {
258 case 0: return 0;
259 case 1: return arr[0];
260 case 2: return arr[0] + arr[1] * BASE;
261 default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE;
262 }
263 }
264 return arr;
265 }
266
267 function trim(v) {
268 var i = v.length;
269 while (v[--i] === 0);
270 v.length = i + 1;
271 }
272
273 function createArray(length) { // function shamelessly stolen from Yaffle's library https://github.com/Yaffle/BigInteger
274 var x = new Array(length);
275 var i = -1;
276 while (++i < length) {
277 x[i] = 0;
278 }
279 return x;
280 }
281
282 function truncate(n) {
283 if (n > 0) return Math.floor(n);
284 return Math.ceil(n);
285 }
286
287 function add(a, b) { // assumes a and b are arrays with a.length >= b.length
288 var l_a = a.length,
289 l_b = b.length,
290 r = new Array(l_a),
291 carry = 0,
292 base = BASE,
293 sum, i;
294 for (i = 0; i < l_b; i++) {
295 sum = a[i] + b[i] + carry;
296 carry = sum >= base ? 1 : 0;
297 r[i] = sum - carry * base;
298 }
299 while (i < l_a) {
300 sum = a[i] + carry;
301 carry = sum === base ? 1 : 0;
302 r[i++] = sum - carry * base;
303 }
304 if (carry > 0) r.push(carry);
305 return r;
306 }
307
308 function addAny(a, b) {
309 if (a.length >= b.length) return add(a, b);
310 return add(b, a);
311 }
312
313 function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT
314 var l = a.length,
315 r = new Array(l),
316 base = BASE,
317 sum, i;
318 for (i = 0; i < l; i++) {
319 sum = a[i] - base + carry;
320 carry = Math.floor(sum / base);
321 r[i] = sum - carry * base;
322 carry += 1;
323 }
324 while (carry > 0) {
325 r[i++] = carry % base;
326 carry = Math.floor(carry / base);
327 }
328 return r;
329 }
330
331 BigInteger.prototype.add = function (v) {
332 var n = parseValue(v);
333 if (this.sign !== n.sign) {
334 return this.subtract(n.negate());
335 }
336 var a = this.value, b = n.value;
337 if (n.isSmall) {
338 return new BigInteger(addSmall(a, Math.abs(b)), this.sign);
339 }
340 return new BigInteger(addAny(a, b), this.sign);
341 };
342 BigInteger.prototype.plus = BigInteger.prototype.add;
343
344 SmallInteger.prototype.add = function (v) {
345 var n = parseValue(v);
346 var a = this.value;
347 if (a < 0 !== n.sign) {
348 return this.subtract(n.negate());
349 }
350 var b = n.value;
351 if (n.isSmall) {
352 if (isPrecise(a + b)) return new SmallInteger(a + b);
353 b = smallToArray(Math.abs(b));
354 }
355 return new BigInteger(addSmall(b, Math.abs(a)), a < 0);
356 };
357 SmallInteger.prototype.plus = SmallInteger.prototype.add;
358
359 function subtract(a, b) { // assumes a and b are arrays with a >= b
360 var a_l = a.length,
361 b_l = b.length,
362 r = new Array(a_l),
363 borrow = 0,
364 base = BASE,
365 i, difference;
366 for (i = 0; i < b_l; i++) {
367 difference = a[i] - borrow - b[i];
368 if (difference < 0) {
369 difference += base;
370 borrow = 1;
371 } else borrow = 0;
372 r[i] = difference;
373 }
374 for (i = b_l; i < a_l; i++) {
375 difference = a[i] - borrow;
376 if (difference < 0) difference += base;
377 else {
378 r[i++] = difference;
379 break;
380 }
381 r[i] = difference;
382 }
383 for (; i < a_l; i++) {
384 r[i] = a[i];
385 }
386 trim(r);
387 return r;
388 }
389
390 function subtractAny(a, b, sign) {
391 var value;
392 if (compareAbs(a, b) >= 0) {
393 value = subtract(a,b);
394 } else {
395 value = subtract(b, a);
396 sign = !sign;
397 }
398 value = arrayToSmall(value);
399 if (typeof value === "number") {
400 if (sign) value = -value;
401 return new SmallInteger(value);
402 }
403 return new BigInteger(value, sign);
404 }
405
406 function subtractSmall(a, b, sign) { // assumes a is array, b is number with 0 <= b < MAX_INT
407 var l = a.length,
408 r = new Array(l),
409 carry = -b,
410 base = BASE,
411 i, difference;
412 for (i = 0; i < l; i++) {
413 difference = a[i] + carry;
414 carry = Math.floor(difference / base);
415 difference %= base;
416 r[i] = difference < 0 ? difference + base : difference;
417 }
418 r = arrayToSmall(r);
419 if (typeof r === "number") {
420 if (sign) r = -r;
421 return new SmallInteger(r);
422 } return new BigInteger(r, sign);
423 }
424
425 BigInteger.prototype.subtract = function (v) {
426 var n = parseValue(v);
427 if (this.sign !== n.sign) {
428 return this.add(n.negate());
429 }
430 var a = this.value, b = n.value;
431 if (n.isSmall)
432 return subtractSmall(a, Math.abs(b), this.sign);
433 return subtractAny(a, b, this.sign);
434 };
435 BigInteger.prototype.minus = BigInteger.prototype.subtract;
436
437 SmallInteger.prototype.subtract = function (v) {
438 var n = parseValue(v);
439 var a = this.value;
440 if (a < 0 !== n.sign) {
441 return this.add(n.negate());
442 }
443 var b = n.value;
444 if (n.isSmall) {
445 return new SmallInteger(a - b);
446 }
447 return subtractSmall(b, Math.abs(a), a >= 0);
448 };
449 SmallInteger.prototype.minus = SmallInteger.prototype.subtract;
450
451 BigInteger.prototype.negate = function () {
452 return new BigInteger(this.value, !this.sign);
453 };
454 SmallInteger.prototype.negate = function () {
455 var sign = this.sign;
456 var small = new SmallInteger(-this.value);
457 small.sign = !sign;
458 return small;
459 };
460
461 BigInteger.prototype.abs = function () {
462 return new BigInteger(this.value, false);
463 };
464 SmallInteger.prototype.abs = function () {
465 return new SmallInteger(Math.abs(this.value));
466 };
467
468 function multiplyLong(a, b) {
469 var a_l = a.length,
470 b_l = b.length,
471 l = a_l + b_l,
472 r = createArray(l),
473 base = BASE,
474 product, carry, i, a_i, b_j;
475 for (i = 0; i < a_l; ++i) {
476 a_i = a[i];
477 for (var j = 0; j < b_l; ++j) {
478 b_j = b[j];
479 product = a_i * b_j + r[i + j];
480 carry = Math.floor(product / base);
481 r[i + j] = product - carry * base;
482 r[i + j + 1] += carry;
483 }
484 }
485 trim(r);
486 return r;
487 }
488
489 function multiplySmall(a, b) { // assumes a is array, b is number with |b| < BASE
490 var l = a.length,
491 r = new Array(l),
492 base = BASE,
493 carry = 0,
494 product, i;
495 for (i = 0; i < l; i++) {
496 product = a[i] * b + carry;
497 carry = Math.floor(product / base);
498 r[i] = product - carry * base;
499 }
500 while (carry > 0) {
501 r[i++] = carry % base;
502 carry = Math.floor(carry / base);
503 }
504 return r;
505 }
506
507 function shiftLeft(x, n) {
508 var r = [];
509 while (n-- > 0) r.push(0);
510 return r.concat(x);
511 }
512
513 function multiplyKaratsuba(x, y) {
514 var n = Math.max(x.length, y.length);
515
516 if (n <= 30) return multiplyLong(x, y);
517 n = Math.ceil(n / 2);
518
519 var b = x.slice(n),
520 a = x.slice(0, n),
521 d = y.slice(n),
522 c = y.slice(0, n);
523
524 var ac = multiplyKaratsuba(a, c),
525 bd = multiplyKaratsuba(b, d),
526 abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));
527
528 var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));
529 trim(product);
530 return product;
531 }
532
533 // The following function is derived from a surface fit of a graph plotting the performance difference
534 // between long multiplication and karatsuba multiplication versus the lengths of the two arrays.
535 function useKaratsuba(l1, l2) {
536 return -0.012 * l1 - 0.012 * l2 + 0.000015 * l1 * l2 > 0;
537 }
538
539 BigInteger.prototype.multiply = function (v) {
540 var n = parseValue(v),
541 a = this.value, b = n.value,
542 sign = this.sign !== n.sign,
543 abs;
544 if (n.isSmall) {
545 if (b === 0) return Integer[0];
546 if (b === 1) return this;
547 if (b === -1) return this.negate();
548 abs = Math.abs(b);
549 if (abs < BASE) {
550 return new BigInteger(multiplySmall(a, abs), sign);
551 }
552 b = smallToArray(abs);
553 }
554 if (useKaratsuba(a.length, b.length)) // Karatsuba is only faster for certain array sizes
555 return new BigInteger(multiplyKaratsuba(a, b), sign);
556 return new BigInteger(multiplyLong(a, b), sign);
557 };
558
559 BigInteger.prototype.times = BigInteger.prototype.multiply;
560
561 function multiplySmallAndArray(a, b, sign) { // a >= 0
562 if (a < BASE) {
563 return new BigInteger(multiplySmall(b, a), sign);
564 }
565 return new BigInteger(multiplyLong(b, smallToArray(a)), sign);
566 }
567 SmallInteger.prototype._multiplyBySmall = function (a) {
568 if (isPrecise(a.value * this.value)) {
569 return new SmallInteger(a.value * this.value);
570 }
571 return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);
572 };
573 BigInteger.prototype._multiplyBySmall = function (a) {
574 if (a.value === 0) return Integer[0];
575 if (a.value === 1) return this;
576 if (a.value === -1) return this.negate();
577 return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);
578 };
579 SmallInteger.prototype.multiply = function (v) {
580 return parseValue(v)._multiplyBySmall(this);
581 };
582 SmallInteger.prototype.times = SmallInteger.prototype.multiply;
583
584 function square(a) {
585 var l = a.length,
586 r = createArray(l + l),
587 base = BASE,
588 product, carry, i, a_i, a_j;
589 for (i = 0; i < l; i++) {
590 a_i = a[i];
591 for (var j = 0; j < l; j++) {
592 a_j = a[j];
593 product = a_i * a_j + r[i + j];
594 carry = Math.floor(product / base);
595 r[i + j] = product - carry * base;
596 r[i + j + 1] += carry;
597 }
598 }
599 trim(r);
600 return r;
601 }
602
603 BigInteger.prototype.square = function () {
604 return new BigInteger(square(this.value), false);
605 };
606
607 SmallInteger.prototype.square = function () {
608 var value = this.value * this.value;
609 if (isPrecise(value)) return new SmallInteger(value);
610 return new BigInteger(square(smallToArray(Math.abs(this.value))), false);
611 };
612
613 function divMod1(a, b) { // Left over from previous version. Performs faster than divMod2 on smaller input sizes.
614 var a_l = a.length,
615 b_l = b.length,
616 base = BASE,
617 result = createArray(b.length),
618 divisorMostSignificantDigit = b[b_l - 1],
619 // normalization
620 lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)),
621 remainder = multiplySmall(a, lambda),
622 divisor = multiplySmall(b, lambda),
623 quotientDigit, shift, carry, borrow, i, l, q;
624 if (remainder.length <= a_l) remainder.push(0);
625 divisor.push(0);
626 divisorMostSignificantDigit = divisor[b_l - 1];
627 for (shift = a_l - b_l; shift >= 0; shift--) {
628 quotientDigit = base - 1;
629 if (remainder[shift + b_l] !== divisorMostSignificantDigit) {
630 quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);
631 }
632 // quotientDigit <= base - 1
633 carry = 0;
634 borrow = 0;
635 l = divisor.length;
636 for (i = 0; i < l; i++) {
637 carry += quotientDigit * divisor[i];
638 q = Math.floor(carry / base);
639 borrow += remainder[shift + i] - (carry - q * base);
640 carry = q;
641 if (borrow < 0) {
642 remainder[shift + i] = borrow + base;
643 borrow = -1;
644 } else {
645 remainder[shift + i] = borrow;
646 borrow = 0;
647 }
648 }
649 while (borrow !== 0) {
650 quotientDigit -= 1;
651 carry = 0;
652 for (i = 0; i < l; i++) {
653 carry += remainder[shift + i] - base + divisor[i];
654 if (carry < 0) {
655 remainder[shift + i] = carry + base;
656 carry = 0;
657 } else {
658 remainder[shift + i] = carry;
659 carry = 1;
660 }
661 }
662 borrow += carry;
663 }
664 result[shift] = quotientDigit;
665 }
666 // denormalization
667 remainder = divModSmall(remainder, lambda)[0];
668 return [arrayToSmall(result), arrayToSmall(remainder)];
669 }
670
671 function divMod2(a, b) { // Implementation idea shamelessly stolen from Silent Matt's library http://silentmatt.com/biginteger/
672 // Performs faster than divMod1 on larger input sizes.
673 var a_l = a.length,
674 b_l = b.length,
675 result = [],
676 part = [],
677 base = BASE,
678 guess, xlen, highx, highy, check;
679 while (a_l) {
680 part.unshift(a[--a_l]);
681 trim(part);
682 if (compareAbs(part, b) < 0) {
683 result.push(0);
684 continue;
685 }
686 xlen = part.length;
687 highx = part[xlen - 1] * base + part[xlen - 2];
688 highy = b[b_l - 1] * base + b[b_l - 2];
689 if (xlen > b_l) {
690 highx = (highx + 1) * base;
691 }
692 guess = Math.ceil(highx / highy);
693 do {
694 check = multiplySmall(b, guess);
695 if (compareAbs(check, part) <= 0) break;
696 guess--;
697 } while (guess);
698 result.push(guess);
699 part = subtract(part, check);
700 }
701 result.reverse();
702 return [arrayToSmall(result), arrayToSmall(part)];
703 }
704
705 function divModSmall(value, lambda) {
706 var length = value.length,
707 quotient = createArray(length),
708 base = BASE,
709 i, q, remainder, divisor;
710 remainder = 0;
711 for (i = length - 1; i >= 0; --i) {
712 divisor = remainder * base + value[i];
713 q = truncate(divisor / lambda);
714 remainder = divisor - q * lambda;
715 quotient[i] = q | 0;
716 }
717 return [quotient, remainder | 0];
718 }
719
720 function divModAny(self, v) {
721 var value, n = parseValue(v);
722 var a = self.value, b = n.value;
723 var quotient;
724 if (b === 0) throw new Error("Cannot divide by zero");
725 if (self.isSmall) {
726 if (n.isSmall) {
727 return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];
728 }
729 return [Integer[0], self];
730 }
731 if (n.isSmall) {
732 if (b === 1) return [self, Integer[0]];
733 if (b == -1) return [self.negate(), Integer[0]];
734 var abs = Math.abs(b);
735 if (abs < BASE) {
736 value = divModSmall(a, abs);
737 quotient = arrayToSmall(value[0]);
738 var remainder = value[1];
739 if (self.sign) remainder = -remainder;
740 if (typeof quotient === "number") {
741 if (self.sign !== n.sign) quotient = -quotient;
742 return [new SmallInteger(quotient), new SmallInteger(remainder)];
743 }
744 return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)];
745 }
746 b = smallToArray(abs);
747 }
748 var comparison = compareAbs(a, b);
749 if (comparison === -1) return [Integer[0], self];
750 if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]];
751
752 // divMod1 is faster on smaller input sizes
753 if (a.length + b.length <= 200)
754 value = divMod1(a, b);
755 else value = divMod2(a, b);
756
757 quotient = value[0];
758 var qSign = self.sign !== n.sign,
759 mod = value[1],
760 mSign = self.sign;
761 if (typeof quotient === "number") {
762 if (qSign) quotient = -quotient;
763 quotient = new SmallInteger(quotient);
764 } else quotient = new BigInteger(quotient, qSign);
765 if (typeof mod === "number") {
766 if (mSign) mod = -mod;
767 mod = new SmallInteger(mod);
768 } else mod = new BigInteger(mod, mSign);
769 return [quotient, mod];
770 }
771
772 BigInteger.prototype.divmod = function (v) {
773 var result = divModAny(this, v);
774 return {
775 quotient: result[0],
776 remainder: result[1]
777 };
778 };
779 SmallInteger.prototype.divmod = BigInteger.prototype.divmod;
780
781 BigInteger.prototype.divide = function (v) {
782 return divModAny(this, v)[0];
783 };
784 SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;
785
786 BigInteger.prototype.mod = function (v) {
787 return divModAny(this, v)[1];
788 };
789 SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;
790
791 BigInteger.prototype.pow = function (v) {
792 var n = parseValue(v),
793 a = this.value,
794 b = n.value,
795 value, x, y;
796 if (b === 0) return Integer[1];
797 if (a === 0) return Integer[0];
798 if (a === 1) return Integer[1];
799 if (a === -1) return n.isEven() ? Integer[1] : Integer[-1];
800 if (n.sign) {
801 return Integer[0];
802 }
803 if (!n.isSmall) throw new Error("The exponent " + n.toString() + " is too large.");
804 if (this.isSmall) {
805 if (isPrecise(value = Math.pow(a, b)))
806 return new SmallInteger(truncate(value));
807 }
808 x = this;
809 y = Integer[1];
810 while (true) {
811 if (b & 1 === 1) {
812 y = y.times(x);
813 --b;
814 }
815 if (b === 0) break;
816 b /= 2;
817 x = x.square();
818 }
819 return y;
820 };
821 SmallInteger.prototype.pow = BigInteger.prototype.pow;
822
823 BigInteger.prototype.modPow = function (exp, mod) {
824 exp = parseValue(exp);
825 mod = parseValue(mod);
826 if (mod.isZero()) throw new Error("Cannot take modPow with modulus 0");
827 var r = Integer[1],
828 base = this.mod(mod);
829 while (exp.isPositive()) {
830 if (base.isZero()) return Integer[0];
831 if (exp.isOdd()) r = r.multiply(base).mod(mod);
832 exp = exp.divide(2);
833 base = base.square().mod(mod);
834 }
835 return r;
836 };
837 SmallInteger.prototype.modPow = BigInteger.prototype.modPow;
838
839 function compareAbs(a, b) {
840 if (a.length !== b.length) {
841 return a.length > b.length ? 1 : -1;
842 }
843 for (var i = a.length - 1; i >= 0; i--) {
844 if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1;
845 }
846 return 0;
847 }
848
849 BigInteger.prototype.compareAbs = function (v) {
850 var n = parseValue(v),
851 a = this.value,
852 b = n.value;
853 if (n.isSmall) return 1;
854 return compareAbs(a, b);
855 };
856 SmallInteger.prototype.compareAbs = function (v) {
857 var n = parseValue(v),
858 a = Math.abs(this.value),
859 b = n.value;
860 if (n.isSmall) {
861 b = Math.abs(b);
862 return a === b ? 0 : a > b ? 1 : -1;
863 }
864 return -1;
865 };
866
867 BigInteger.prototype.compare = function (v) {
868 // See discussion about comparison with Infinity:
869 // https://github.com/peterolson/BigInteger.js/issues/61
870 if (v === Infinity) {
871 return -1;
872 }
873 if (v === -Infinity) {
874 return 1;
875 }
876
877 var n = parseValue(v),
878 a = this.value,
879 b = n.value;
880 if (this.sign !== n.sign) {
881 return n.sign ? 1 : -1;
882 }
883 if (n.isSmall) {
884 return this.sign ? -1 : 1;
885 }
886 return compareAbs(a, b) * (this.sign ? -1 : 1);
887 };
888 BigInteger.prototype.compareTo = BigInteger.prototype.compare;
889
890 SmallInteger.prototype.compare = function (v) {
891 if (v === Infinity) {
892 return -1;
893 }
894 if (v === -Infinity) {
895 return 1;
896 }
897
898 var n = parseValue(v),
899 a = this.value,
900 b = n.value;
901 if (n.isSmall) {
902 return a == b ? 0 : a > b ? 1 : -1;
903 }
904 if (a < 0 !== n.sign) {
905 return a < 0 ? -1 : 1;
906 }
907 return a < 0 ? 1 : -1;
908 };
909 SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;
910
911 BigInteger.prototype.equals = function (v) {
912 return this.compare(v) === 0;
913 };
914 SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;
915
916 BigInteger.prototype.notEquals = function (v) {
917 return this.compare(v) !== 0;
918 };
919 SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;
920
921 BigInteger.prototype.greater = function (v) {
922 return this.compare(v) > 0;
923 };
924 SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;
925
926 BigInteger.prototype.lesser = function (v) {
927 return this.compare(v) < 0;
928 };
929 SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;
930
931 BigInteger.prototype.greaterOrEquals = function (v) {
932 return this.compare(v) >= 0;
933 };
934 SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;
935
936 BigInteger.prototype.lesserOrEquals = function (v) {
937 return this.compare(v) <= 0;
938 };
939 SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;
940
941 BigInteger.prototype.isEven = function () {
942 return (this.value[0] & 1) === 0;
943 };
944 SmallInteger.prototype.isEven = function () {
945 return (this.value & 1) === 0;
946 };
947
948 BigInteger.prototype.isOdd = function () {
949 return (this.value[0] & 1) === 1;
950 };
951 SmallInteger.prototype.isOdd = function () {
952 return (this.value & 1) === 1;
953 };
954
955 BigInteger.prototype.isPositive = function () {
956 return !this.sign;
957 };
958 SmallInteger.prototype.isPositive = function () {
959 return this.value > 0;
960 };
961
962 BigInteger.prototype.isNegative = function () {
963 return this.sign;
964 };
965 SmallInteger.prototype.isNegative = function () {
966 return this.value < 0;
967 };
968
969 BigInteger.prototype.isUnit = function () {
970 return false;
971 };
972 SmallInteger.prototype.isUnit = function () {
973 return Math.abs(this.value) === 1;
974 };
975
976 BigInteger.prototype.isZero = function () {
977 return false;
978 };
979 SmallInteger.prototype.isZero = function () {
980 return this.value === 0;
981 };
982 BigInteger.prototype.isDivisibleBy = function (v) {
983 var n = parseValue(v);
984 var value = n.value;
985 if (value === 0) return false;
986 if (value === 1) return true;
987 if (value === 2) return this.isEven();
988 return this.mod(n).equals(Integer[0]);
989 };
990 SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;
991
992 function isBasicPrime(v) {
993 var n = v.abs();
994 if (n.isUnit()) return false;
995 if (n.equals(2) || n.equals(3) || n.equals(5)) return true;
996 if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false;
997 if (n.lesser(25)) return true;
998 // we don't know if it's prime: let the other functions figure it out
999 }
1000
1001 BigInteger.prototype.isPrime = function () {
1002 var isPrime = isBasicPrime(this);
1003 if (isPrime !== undefined) return isPrime;
1004 var n = this.abs(),
1005 nPrev = n.prev();
1006 var a = [2, 3, 5, 7, 11, 13, 17, 19],
1007 b = nPrev,
1008 d, t, i, x;
1009 while (b.isEven()) b = b.divide(2);
1010 for (i = 0; i < a.length; i++) {
1011 x = bigInt(a[i]).modPow(b, n);
1012 if (x.equals(Integer[1]) || x.equals(nPrev)) continue;
1013 for (t = true, d = b; t && d.lesser(nPrev) ; d = d.multiply(2)) {
1014 x = x.square().mod(n);
1015 if (x.equals(nPrev)) t = false;
1016 }
1017 if (t) return false;
1018 }
1019 return true;
1020 };
1021 SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;
1022
1023 BigInteger.prototype.isProbablePrime = function (iterations) {
1024 var isPrime = isBasicPrime(this);
1025 if (isPrime !== undefined) return isPrime;
1026 var n = this.abs();
1027 var t = iterations === undefined ? 5 : iterations;
1028 // use the Fermat primality test
1029 for (var i = 0; i < t; i++) {
1030 var a = bigInt.randBetween(2, n.minus(2));
1031 if (!a.modPow(n.prev(), n).isUnit()) return false; // definitely composite
1032 }
1033 return true; // large chance of being prime
1034 };
1035 SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;
1036
1037 BigInteger.prototype.modInv = function (n) {
1038 var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;
1039 while (!newR.equals(bigInt.zero)) {
1040 q = r.divide(newR);
1041 lastT = t;
1042 lastR = r;
1043 t = newT;
1044 r = newR;
1045 newT = lastT.subtract(q.multiply(newT));
1046 newR = lastR.subtract(q.multiply(newR));
1047 }
1048 if (!r.equals(1)) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime");
1049 if (t.compare(0) === -1) {
1050 t = t.add(n);
1051 }
1052 if (this.isNegative()) {
1053 return t.negate();
1054 }
1055 return t;
1056 };
1057
1058 SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
1059
1060 BigInteger.prototype.next = function () {
1061 var value = this.value;
1062 if (this.sign) {
1063 return subtractSmall(value, 1, this.sign);
1064 }
1065 return new BigInteger(addSmall(value, 1), this.sign);
1066 };
1067 SmallInteger.prototype.next = function () {
1068 var value = this.value;
1069 if (value + 1 < MAX_INT) return new SmallInteger(value + 1);
1070 return new BigInteger(MAX_INT_ARR, false);
1071 };
1072
1073 BigInteger.prototype.prev = function () {
1074 var value = this.value;
1075 if (this.sign) {
1076 return new BigInteger(addSmall(value, 1), true);
1077 }
1078 return subtractSmall(value, 1, this.sign);
1079 };
1080 SmallInteger.prototype.prev = function () {
1081 var value = this.value;
1082 if (value - 1 > -MAX_INT) return new SmallInteger(value - 1);
1083 return new BigInteger(MAX_INT_ARR, true);
1084 };
1085
1086 var powersOfTwo = [1];
1087 while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);
1088 var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];
1089
1090 function shift_isSmall(n) {
1091 return ((typeof n === "number" || typeof n === "string") && +Math.abs(n) <= BASE) ||
1092 (n instanceof BigInteger && n.value.length <= 1);
1093 }
1094
1095 BigInteger.prototype.shiftLeft = function (n) {
1096 if (!shift_isSmall(n)) {
1097 throw new Error(String(n) + " is too large for shifting.");
1098 }
1099 n = +n;
1100 if (n < 0) return this.shiftRight(-n);
1101 var result = this;
1102 while (n >= powers2Length) {
1103 result = result.multiply(highestPower2);
1104 n -= powers2Length - 1;
1105 }
1106 return result.multiply(powersOfTwo[n]);
1107 };
1108 SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;
1109
1110 BigInteger.prototype.shiftRight = function (n) {
1111 var remQuo;
1112 if (!shift_isSmall(n)) {
1113 throw new Error(String(n) + " is too large for shifting.");
1114 }
1115 n = +n;
1116 if (n < 0) return this.shiftLeft(-n);
1117 var result = this;
1118 while (n >= powers2Length) {
1119 if (result.isZero()) return result;
1120 remQuo = divModAny(result, highestPower2);
1121 result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
1122 n -= powers2Length - 1;
1123 }
1124 remQuo = divModAny(result, powersOfTwo[n]);
1125 return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
1126 };
1127 SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;
1128
1129 function bitwise(x, y, fn) {
1130 y = parseValue(y);
1131 var xSign = x.isNegative(), ySign = y.isNegative();
1132 var xRem = xSign ? x.not() : x,
1133 yRem = ySign ? y.not() : y;
1134 var xDigit = 0, yDigit = 0;
1135 var xDivMod = null, yDivMod = null;
1136 var result = [];
1137 while (!xRem.isZero() || !yRem.isZero()) {
1138 xDivMod = divModAny(xRem, highestPower2);
1139 xDigit = xDivMod[1].toJSNumber();
1140 if (xSign) {
1141 xDigit = highestPower2 - 1 - xDigit; // two's complement for negative numbers
1142 }
1143
1144 yDivMod = divModAny(yRem, highestPower2);
1145 yDigit = yDivMod[1].toJSNumber();
1146 if (ySign) {
1147 yDigit = highestPower2 - 1 - yDigit; // two's complement for negative numbers
1148 }
1149
1150 xRem = xDivMod[0];
1151 yRem = yDivMod[0];
1152 result.push(fn(xDigit, yDigit));
1153 }
1154 var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0);
1155 for (var i = result.length - 1; i >= 0; i -= 1) {
1156 sum = sum.multiply(highestPower2).add(bigInt(result[i]));
1157 }
1158 return sum;
1159 }
1160
1161 BigInteger.prototype.not = function () {
1162 return this.negate().prev();
1163 };
1164 SmallInteger.prototype.not = BigInteger.prototype.not;
1165
1166 BigInteger.prototype.and = function (n) {
1167 return bitwise(this, n, function (a, b) { return a & b; });
1168 };
1169 SmallInteger.prototype.and = BigInteger.prototype.and;
1170
1171 BigInteger.prototype.or = function (n) {
1172 return bitwise(this, n, function (a, b) { return a | b; });
1173 };
1174 SmallInteger.prototype.or = BigInteger.prototype.or;
1175
1176 BigInteger.prototype.xor = function (n) {
1177 return bitwise(this, n, function (a, b) { return a ^ b; });
1178 };
1179 SmallInteger.prototype.xor = BigInteger.prototype.xor;
1180
1181 var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;
1182 function roughLOB(n) { // get lowestOneBit (rough)
1183 // SmallInteger: return Min(lowestOneBit(n), 1 << 30)
1184 // BigInteger: return Min(lowestOneBit(n), 1 << 14) [BASE=1e7]
1185 var v = n.value, x = typeof v === "number" ? v | LOBMASK_I : v[0] + v[1] * BASE | LOBMASK_BI;
1186 return x & -x;
1187 }
1188
1189 function max(a, b) {
1190 a = parseValue(a);
1191 b = parseValue(b);
1192 return a.greater(b) ? a : b;
1193 }
1194 function min(a, b) {
1195 a = parseValue(a);
1196 b = parseValue(b);
1197 return a.lesser(b) ? a : b;
1198 }
1199 function gcd(a, b) {
1200 a = parseValue(a).abs();
1201 b = parseValue(b).abs();
1202 if (a.equals(b)) return a;
1203 if (a.isZero()) return b;
1204 if (b.isZero()) return a;
1205 var c = Integer[1], d, t;
1206 while (a.isEven() && b.isEven()) {
1207 d = Math.min(roughLOB(a), roughLOB(b));
1208 a = a.divide(d);
1209 b = b.divide(d);
1210 c = c.multiply(d);
1211 }
1212 while (a.isEven()) {
1213 a = a.divide(roughLOB(a));
1214 }
1215 do {
1216 while (b.isEven()) {
1217 b = b.divide(roughLOB(b));
1218 }
1219 if (a.greater(b)) {
1220 t = b; b = a; a = t;
1221 }
1222 b = b.subtract(a);
1223 } while (!b.isZero());
1224 return c.isUnit() ? a : a.multiply(c);
1225 }
1226 function lcm(a, b) {
1227 a = parseValue(a).abs();
1228 b = parseValue(b).abs();
1229 return a.divide(gcd(a, b)).multiply(b);
1230 }
1231 function randBetween(a, b) {
1232 a = parseValue(a);
1233 b = parseValue(b);
1234 var low = min(a, b), high = max(a, b);
1235 var range = high.subtract(low).add(1);
1236 if (range.isSmall) return low.add(Math.floor(Math.random() * range));
1237 var length = range.value.length - 1;
1238 var result = [], restricted = true;
1239 for (var i = length; i >= 0; i--) {
1240 var top = restricted ? range.value[i] : BASE;
1241 var digit = truncate(Math.random() * top);
1242 result.unshift(digit);
1243 if (digit < top) restricted = false;
1244 }
1245 result = arrayToSmall(result);
1246 return low.add(typeof result === "number" ? new SmallInteger(result) : new BigInteger(result, false));
1247 }
1248 var parseBase = function (text, base) {
1249 var length = text.length;
1250 var i;
1251 var absBase = Math.abs(base);
1252 for(var i = 0; i < length; i++) {
1253 var c = text[i].toLowerCase();
1254 if(c === "-") continue;
1255 if(/[a-z0-9]/.test(c)) {
1256 if(/[0-9]/.test(c) && +c >= absBase) {
1257 if(c === "1" && absBase === 1) continue;
1258 throw new Error(c + " is not a valid digit in base " + base + ".");
1259 } else if(c.charCodeAt(0) - 87 >= absBase) {
1260 throw new Error(c + " is not a valid digit in base " + base + ".");
1261 }
1262 }
1263 }
1264 if (2 <= base && base <= 36) {
1265 if (length <= LOG_MAX_INT / Math.log(base)) {
1266 var result = parseInt(text, base);
1267 if(isNaN(result)) {
1268 throw new Error(c + " is not a valid digit in base " + base + ".");
1269 }
1270 return new SmallInteger(parseInt(text, base));
1271 }
1272 }
1273 base = parseValue(base);
1274 var digits = [];
1275 var isNegative = text[0] === "-";
1276 for (i = isNegative ? 1 : 0; i < text.length; i++) {
1277 var c = text[i].toLowerCase(),
1278 charCode = c.charCodeAt(0);
1279 if (48 <= charCode && charCode <= 57) digits.push(parseValue(c));
1280 else if (97 <= charCode && charCode <= 122) digits.push(parseValue(c.charCodeAt(0) - 87));
1281 else if (c === "<") {
1282 var start = i;
1283 do { i++; } while (text[i] !== ">");
1284 digits.push(parseValue(text.slice(start + 1, i)));
1285 }
1286 else throw new Error(c + " is not a valid character");
1287 }
1288 return parseBaseFromArray(digits, base, isNegative);
1289 };
1290
1291 function parseBaseFromArray(digits, base, isNegative) {
1292 var val = Integer[0], pow = Integer[1], i;
1293 for (i = digits.length - 1; i >= 0; i--) {
1294 val = val.add(digits[i].times(pow));
1295 pow = pow.times(base);
1296 }
1297 return isNegative ? val.negate() : val;
1298 }
1299
1300 function stringify(digit) {
1301 var v = digit.value;
1302 if (typeof v === "number") v = [v];
1303 if (v.length === 1 && v[0] <= 35) {
1304 return "0123456789abcdefghijklmnopqrstuvwxyz".charAt(v[0]);
1305 }
1306 return "<" + v + ">";
1307 }
1308 function toBase(n, base) {
1309 base = bigInt(base);
1310 if (base.isZero()) {
1311 if (n.isZero()) return "0";
1312 throw new Error("Cannot convert nonzero numbers to base 0.");
1313 }
1314 if (base.equals(-1)) {
1315 if (n.isZero()) return "0";
1316 if (n.isNegative()) return new Array(1 - n).join("10");
1317 return "1" + new Array(+n).join("01");
1318 }
1319 var minusSign = "";
1320 if (n.isNegative() && base.isPositive()) {
1321 minusSign = "-";
1322 n = n.abs();
1323 }
1324 if (base.equals(1)) {
1325 if (n.isZero()) return "0";
1326 return minusSign + new Array(+n + 1).join(1);
1327 }
1328 var out = [];
1329 var left = n, divmod;
1330 while (left.isNegative() || left.compareAbs(base) >= 0) {
1331 divmod = left.divmod(base);
1332 left = divmod.quotient;
1333 var digit = divmod.remainder;
1334 if (digit.isNegative()) {
1335 digit = base.minus(digit).abs();
1336 left = left.next();
1337 }
1338 out.push(stringify(digit));
1339 }
1340 out.push(stringify(left));
1341 return minusSign + out.reverse().join("");
1342 }
1343
1344 BigInteger.prototype.toString = function (radix) {
1345 if (radix === undefined) radix = 10;
1346 if (radix !== 10) return toBase(this, radix);
1347 var v = this.value, l = v.length, str = String(v[--l]), zeros = "0000000", digit;
1348 while (--l >= 0) {
1349 digit = String(v[l]);
1350 str += zeros.slice(digit.length) + digit;
1351 }
1352 var sign = this.sign ? "-" : "";
1353 return sign + str;
1354 };
1355
1356 SmallInteger.prototype.toString = function (radix) {
1357 if (radix === undefined) radix = 10;
1358 if (radix != 10) return toBase(this, radix);
1359 return String(this.value);
1360 };
1361 BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function() { return this.toString(); }
1362
1363 BigInteger.prototype.valueOf = function () {
1364 return +this.toString();
1365 };
1366 BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;
1367
1368 SmallInteger.prototype.valueOf = function () {
1369 return this.value;
1370 };
1371 SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;
1372
1373 function parseStringValue(v) {
1374 if (isPrecise(+v)) {
1375 var x = +v;
1376 if (x === truncate(x))
1377 return new SmallInteger(x);
1378 throw "Invalid integer: " + v;
1379 }
1380 var sign = v[0] === "-";
1381 if (sign) v = v.slice(1);
1382 var split = v.split(/e/i);
1383 if (split.length > 2) throw new Error("Invalid integer: " + split.join("e"));
1384 if (split.length === 2) {
1385 var exp = split[1];
1386 if (exp[0] === "+") exp = exp.slice(1);
1387 exp = +exp;
1388 if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error("Invalid integer: " + exp + " is not a valid exponent.");
1389 var text = split[0];
1390 var decimalPlace = text.indexOf(".");
1391 if (decimalPlace >= 0) {
1392 exp -= text.length - decimalPlace - 1;
1393 text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);
1394 }
1395 if (exp < 0) throw new Error("Cannot include negative exponent part for integers");
1396 text += (new Array(exp + 1)).join("0");
1397 v = text;
1398 }
1399 var isValid = /^([0-9][0-9]*)$/.test(v);
1400 if (!isValid) throw new Error("Invalid integer: " + v);
1401 var r = [], max = v.length, l = LOG_BASE, min = max - l;
1402 while (max > 0) {
1403 r.push(+v.slice(min, max));
1404 min -= l;
1405 if (min < 0) min = 0;
1406 max -= l;
1407 }
1408 trim(r);
1409 return new BigInteger(r, sign);
1410 }
1411
1412 function parseNumberValue(v) {
1413 if (isPrecise(v)) {
1414 if (v !== truncate(v)) throw new Error(v + " is not an integer.");
1415 return new SmallInteger(v);
1416 }
1417 return parseStringValue(v.toString());
1418 }
1419
1420 function parseValue(v) {
1421 if (typeof v === "number") {
1422 return parseNumberValue(v);
1423 }
1424 if (typeof v === "string") {
1425 return parseStringValue(v);
1426 }
1427 return v;
1428 }
1429 // Pre-define numbers in range [-999,999]
1430 for (var i = 0; i < 1000; i++) {
1431 Integer[i] = new SmallInteger(i);
1432 if (i > 0) Integer[-i] = new SmallInteger(-i);
1433 }
1434 // Backwards compatibility
1435 Integer.one = Integer[1];
1436 Integer.zero = Integer[0];
1437 Integer.minusOne = Integer[-1];
1438 Integer.max = max;
1439 Integer.min = min;
1440 Integer.gcd = gcd;
1441 Integer.lcm = lcm;
1442 Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger; };
1443 Integer.randBetween = randBetween;
1444
1445 Integer.fromArray = function (digits, base, isNegative) {
1446 return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative);
1447 };
1448
1449 return Integer;
1450})();
1451
1452// Node.js check
1453if (typeof module !== "undefined" && module.hasOwnProperty("exports")) {
1454 module.exports = bigInt;
1455}
1456
1457//amd check
1458if ( typeof define === "function" && define.amd ) {
1459 define( "big-integer", [], function() {
1460 return bigInt;
1461 });
1462}
1463
1464},{}],4:[function(require,module,exports){
1465
1466},{}],5:[function(require,module,exports){
1467var basex = require('base-x')
1468var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
1469
1470module.exports = basex(ALPHABET)
1471
1472},{"base-x":1}],6:[function(require,module,exports){
1473'use strict'
1474
1475var base58 = require('bs58')
1476var Buffer = require('safe-buffer').Buffer
1477
1478module.exports = function (checksumFn) {
1479 // Encode a buffer as a base58-check encoded string
1480 function encode (payload) {
1481 var checksum = checksumFn(payload)
1482
1483 return base58.encode(Buffer.concat([
1484 payload,
1485 checksum
1486 ], payload.length + 4))
1487 }
1488
1489 function decodeRaw (buffer) {
1490 var payload = buffer.slice(0, -4)
1491 var checksum = buffer.slice(-4)
1492 var newChecksum = checksumFn(payload)
1493
1494 if (checksum[0] ^ newChecksum[0] |
1495 checksum[1] ^ newChecksum[1] |
1496 checksum[2] ^ newChecksum[2] |
1497 checksum[3] ^ newChecksum[3]) return
1498
1499 return payload
1500 }
1501
1502 // Decode a base58-check encoded string to a buffer, no result if checksum is wrong
1503 function decodeUnsafe (string) {
1504 var buffer = base58.decodeUnsafe(string)
1505 if (!buffer) return
1506
1507 return decodeRaw(buffer)
1508 }
1509
1510 function decode (string) {
1511 var buffer = base58.decode(string)
1512 var payload = decodeRaw(buffer, checksumFn)
1513 if (!payload) throw new Error('Invalid checksum')
1514 return payload
1515 }
1516
1517 return {
1518 encode: encode,
1519 decode: decode,
1520 decodeUnsafe: decodeUnsafe
1521 }
1522}
1523
1524},{"bs58":5,"safe-buffer":40}],7:[function(require,module,exports){
1525'use strict'
1526
1527var createHash = require('create-hash')
1528var bs58checkBase = require('./base')
1529
1530// SHA256(SHA256(buffer))
1531function sha256x2 (buffer) {
1532 var tmp = createHash('sha256').update(buffer).digest()
1533 return createHash('sha256').update(tmp).digest()
1534}
1535
1536module.exports = bs58checkBase(sha256x2)
1537
1538},{"./base":6,"create-hash":15}],8:[function(require,module,exports){
1539/*!
1540 * The buffer module from node.js, for the browser.
1541 *
1542 * @author Feross Aboukhadijeh <https://feross.org>
1543 * @license MIT
1544 */
1545/* eslint-disable no-proto */
1546
1547'use strict'
1548
1549var base64 = require('base64-js')
1550var ieee754 = require('ieee754')
1551
1552exports.Buffer = Buffer
1553exports.SlowBuffer = SlowBuffer
1554exports.INSPECT_MAX_BYTES = 50
1555
1556var K_MAX_LENGTH = 0x7fffffff
1557exports.kMaxLength = K_MAX_LENGTH
1558
1559/**
1560 * If `Buffer.TYPED_ARRAY_SUPPORT`:
1561 * === true Use Uint8Array implementation (fastest)
1562 * === false Print warning and recommend using `buffer` v4.x which has an Object
1563 * implementation (most compatible, even IE6)
1564 *
1565 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
1566 * Opera 11.6+, iOS 4.2+.
1567 *
1568 * We report that the browser does not support typed arrays if the are not subclassable
1569 * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
1570 * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
1571 * for __proto__ and has a buggy typed array implementation.
1572 */
1573Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
1574
1575if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
1576 typeof console.error === 'function') {
1577 console.error(
1578 'This browser lacks typed array (Uint8Array) support which is required by ' +
1579 '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
1580 )
1581}
1582
1583function typedArraySupport () {
1584 // Can typed array instances can be augmented?
1585 try {
1586 var arr = new Uint8Array(1)
1587 arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
1588 return arr.foo() === 42
1589 } catch (e) {
1590 return false
1591 }
1592}
1593
1594function createBuffer (length) {
1595 if (length > K_MAX_LENGTH) {
1596 throw new RangeError('Invalid typed array length')
1597 }
1598 // Return an augmented `Uint8Array` instance
1599 var buf = new Uint8Array(length)
1600 buf.__proto__ = Buffer.prototype
1601 return buf
1602}
1603
1604/**
1605 * The Buffer constructor returns instances of `Uint8Array` that have their
1606 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
1607 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
1608 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
1609 * returns a single octet.
1610 *
1611 * The `Uint8Array` prototype remains unmodified.
1612 */
1613
1614function Buffer (arg, encodingOrOffset, length) {
1615 // Common case.
1616 if (typeof arg === 'number') {
1617 if (typeof encodingOrOffset === 'string') {
1618 throw new Error(
1619 'If encoding is specified then the first argument must be a string'
1620 )
1621 }
1622 return allocUnsafe(arg)
1623 }
1624 return from(arg, encodingOrOffset, length)
1625}
1626
1627// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
1628if (typeof Symbol !== 'undefined' && Symbol.species &&
1629 Buffer[Symbol.species] === Buffer) {
1630 Object.defineProperty(Buffer, Symbol.species, {
1631 value: null,
1632 configurable: true,
1633 enumerable: false,
1634 writable: false
1635 })
1636}
1637
1638Buffer.poolSize = 8192 // not used by this implementation
1639
1640function from (value, encodingOrOffset, length) {
1641 if (typeof value === 'number') {
1642 throw new TypeError('"value" argument must not be a number')
1643 }
1644
1645 if (isArrayBuffer(value)) {
1646 return fromArrayBuffer(value, encodingOrOffset, length)
1647 }
1648
1649 if (typeof value === 'string') {
1650 return fromString(value, encodingOrOffset)
1651 }
1652
1653 return fromObject(value)
1654}
1655
1656/**
1657 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
1658 * if value is a number.
1659 * Buffer.from(str[, encoding])
1660 * Buffer.from(array)
1661 * Buffer.from(buffer)
1662 * Buffer.from(arrayBuffer[, byteOffset[, length]])
1663 **/
1664Buffer.from = function (value, encodingOrOffset, length) {
1665 return from(value, encodingOrOffset, length)
1666}
1667
1668// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
1669// https://github.com/feross/buffer/pull/148
1670Buffer.prototype.__proto__ = Uint8Array.prototype
1671Buffer.__proto__ = Uint8Array
1672
1673function assertSize (size) {
1674 if (typeof size !== 'number') {
1675 throw new TypeError('"size" argument must be a number')
1676 } else if (size < 0) {
1677 throw new RangeError('"size" argument must not be negative')
1678 }
1679}
1680
1681function alloc (size, fill, encoding) {
1682 assertSize(size)
1683 if (size <= 0) {
1684 return createBuffer(size)
1685 }
1686 if (fill !== undefined) {
1687 // Only pay attention to encoding if it's a string. This
1688 // prevents accidentally sending in a number that would
1689 // be interpretted as a start offset.
1690 return typeof encoding === 'string'
1691 ? createBuffer(size).fill(fill, encoding)
1692 : createBuffer(size).fill(fill)
1693 }
1694 return createBuffer(size)
1695}
1696
1697/**
1698 * Creates a new filled Buffer instance.
1699 * alloc(size[, fill[, encoding]])
1700 **/
1701Buffer.alloc = function (size, fill, encoding) {
1702 return alloc(size, fill, encoding)
1703}
1704
1705function allocUnsafe (size) {
1706 assertSize(size)
1707 return createBuffer(size < 0 ? 0 : checked(size) | 0)
1708}
1709
1710/**
1711 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
1712 * */
1713Buffer.allocUnsafe = function (size) {
1714 return allocUnsafe(size)
1715}
1716/**
1717 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
1718 */
1719Buffer.allocUnsafeSlow = function (size) {
1720 return allocUnsafe(size)
1721}
1722
1723function fromString (string, encoding) {
1724 if (typeof encoding !== 'string' || encoding === '') {
1725 encoding = 'utf8'
1726 }
1727
1728 if (!Buffer.isEncoding(encoding)) {
1729 throw new TypeError('"encoding" must be a valid string encoding')
1730 }
1731
1732 var length = byteLength(string, encoding) | 0
1733 var buf = createBuffer(length)
1734
1735 var actual = buf.write(string, encoding)
1736
1737 if (actual !== length) {
1738 // Writing a hex string, for example, that contains invalid characters will
1739 // cause everything after the first invalid character to be ignored. (e.g.
1740 // 'abxxcd' will be treated as 'ab')
1741 buf = buf.slice(0, actual)
1742 }
1743
1744 return buf
1745}
1746
1747function fromArrayLike (array) {
1748 var length = array.length < 0 ? 0 : checked(array.length) | 0
1749 var buf = createBuffer(length)
1750 for (var i = 0; i < length; i += 1) {
1751 buf[i] = array[i] & 255
1752 }
1753 return buf
1754}
1755
1756function fromArrayBuffer (array, byteOffset, length) {
1757 if (byteOffset < 0 || array.byteLength < byteOffset) {
1758 throw new RangeError('\'offset\' is out of bounds')
1759 }
1760
1761 if (array.byteLength < byteOffset + (length || 0)) {
1762 throw new RangeError('\'length\' is out of bounds')
1763 }
1764
1765 var buf
1766 if (byteOffset === undefined && length === undefined) {
1767 buf = new Uint8Array(array)
1768 } else if (length === undefined) {
1769 buf = new Uint8Array(array, byteOffset)
1770 } else {
1771 buf = new Uint8Array(array, byteOffset, length)
1772 }
1773
1774 // Return an augmented `Uint8Array` instance
1775 buf.__proto__ = Buffer.prototype
1776 return buf
1777}
1778
1779function fromObject (obj) {
1780 if (Buffer.isBuffer(obj)) {
1781 var len = checked(obj.length) | 0
1782 var buf = createBuffer(len)
1783
1784 if (buf.length === 0) {
1785 return buf
1786 }
1787
1788 obj.copy(buf, 0, 0, len)
1789 return buf
1790 }
1791
1792 if (obj) {
1793 if (isArrayBufferView(obj) || 'length' in obj) {
1794 if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
1795 return createBuffer(0)
1796 }
1797 return fromArrayLike(obj)
1798 }
1799
1800 if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
1801 return fromArrayLike(obj.data)
1802 }
1803 }
1804
1805 throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
1806}
1807
1808function checked (length) {
1809 // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
1810 // length is NaN (which is otherwise coerced to zero.)
1811 if (length >= K_MAX_LENGTH) {
1812 throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
1813 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
1814 }
1815 return length | 0
1816}
1817
1818function SlowBuffer (length) {
1819 if (+length != length) { // eslint-disable-line eqeqeq
1820 length = 0
1821 }
1822 return Buffer.alloc(+length)
1823}
1824
1825Buffer.isBuffer = function isBuffer (b) {
1826 return b != null && b._isBuffer === true
1827}
1828
1829Buffer.compare = function compare (a, b) {
1830 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
1831 throw new TypeError('Arguments must be Buffers')
1832 }
1833
1834 if (a === b) return 0
1835
1836 var x = a.length
1837 var y = b.length
1838
1839 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
1840 if (a[i] !== b[i]) {
1841 x = a[i]
1842 y = b[i]
1843 break
1844 }
1845 }
1846
1847 if (x < y) return -1
1848 if (y < x) return 1
1849 return 0
1850}
1851
1852Buffer.isEncoding = function isEncoding (encoding) {
1853 switch (String(encoding).toLowerCase()) {
1854 case 'hex':
1855 case 'utf8':
1856 case 'utf-8':
1857 case 'ascii':
1858 case 'latin1':
1859 case 'binary':
1860 case 'base64':
1861 case 'ucs2':
1862 case 'ucs-2':
1863 case 'utf16le':
1864 case 'utf-16le':
1865 return true
1866 default:
1867 return false
1868 }
1869}
1870
1871Buffer.concat = function concat (list, length) {
1872 if (!Array.isArray(list)) {
1873 throw new TypeError('"list" argument must be an Array of Buffers')
1874 }
1875
1876 if (list.length === 0) {
1877 return Buffer.alloc(0)
1878 }
1879
1880 var i
1881 if (length === undefined) {
1882 length = 0
1883 for (i = 0; i < list.length; ++i) {
1884 length += list[i].length
1885 }
1886 }
1887
1888 var buffer = Buffer.allocUnsafe(length)
1889 var pos = 0
1890 for (i = 0; i < list.length; ++i) {
1891 var buf = list[i]
1892 if (!Buffer.isBuffer(buf)) {
1893 throw new TypeError('"list" argument must be an Array of Buffers')
1894 }
1895 buf.copy(buffer, pos)
1896 pos += buf.length
1897 }
1898 return buffer
1899}
1900
1901function byteLength (string, encoding) {
1902 if (Buffer.isBuffer(string)) {
1903 return string.length
1904 }
1905 if (isArrayBufferView(string) || isArrayBuffer(string)) {
1906 return string.byteLength
1907 }
1908 if (typeof string !== 'string') {
1909 string = '' + string
1910 }
1911
1912 var len = string.length
1913 if (len === 0) return 0
1914
1915 // Use a for loop to avoid recursion
1916 var loweredCase = false
1917 for (;;) {
1918 switch (encoding) {
1919 case 'ascii':
1920 case 'latin1':
1921 case 'binary':
1922 return len
1923 case 'utf8':
1924 case 'utf-8':
1925 case undefined:
1926 return utf8ToBytes(string).length
1927 case 'ucs2':
1928 case 'ucs-2':
1929 case 'utf16le':
1930 case 'utf-16le':
1931 return len * 2
1932 case 'hex':
1933 return len >>> 1
1934 case 'base64':
1935 return base64ToBytes(string).length
1936 default:
1937 if (loweredCase) return utf8ToBytes(string).length // assume utf8
1938 encoding = ('' + encoding).toLowerCase()
1939 loweredCase = true
1940 }
1941 }
1942}
1943Buffer.byteLength = byteLength
1944
1945function slowToString (encoding, start, end) {
1946 var loweredCase = false
1947
1948 // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
1949 // property of a typed array.
1950
1951 // This behaves neither like String nor Uint8Array in that we set start/end
1952 // to their upper/lower bounds if the value passed is out of range.
1953 // undefined is handled specially as per ECMA-262 6th Edition,
1954 // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
1955 if (start === undefined || start < 0) {
1956 start = 0
1957 }
1958 // Return early if start > this.length. Done here to prevent potential uint32
1959 // coercion fail below.
1960 if (start > this.length) {
1961 return ''
1962 }
1963
1964 if (end === undefined || end > this.length) {
1965 end = this.length
1966 }
1967
1968 if (end <= 0) {
1969 return ''
1970 }
1971
1972 // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
1973 end >>>= 0
1974 start >>>= 0
1975
1976 if (end <= start) {
1977 return ''
1978 }
1979
1980 if (!encoding) encoding = 'utf8'
1981
1982 while (true) {
1983 switch (encoding) {
1984 case 'hex':
1985 return hexSlice(this, start, end)
1986
1987 case 'utf8':
1988 case 'utf-8':
1989 return utf8Slice(this, start, end)
1990
1991 case 'ascii':
1992 return asciiSlice(this, start, end)
1993
1994 case 'latin1':
1995 case 'binary':
1996 return latin1Slice(this, start, end)
1997
1998 case 'base64':
1999 return base64Slice(this, start, end)
2000
2001 case 'ucs2':
2002 case 'ucs-2':
2003 case 'utf16le':
2004 case 'utf-16le':
2005 return utf16leSlice(this, start, end)
2006
2007 default:
2008 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
2009 encoding = (encoding + '').toLowerCase()
2010 loweredCase = true
2011 }
2012 }
2013}
2014
2015// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
2016// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
2017// reliably in a browserify context because there could be multiple different
2018// copies of the 'buffer' package in use. This method works even for Buffer
2019// instances that were created from another copy of the `buffer` package.
2020// See: https://github.com/feross/buffer/issues/154
2021Buffer.prototype._isBuffer = true
2022
2023function swap (b, n, m) {
2024 var i = b[n]
2025 b[n] = b[m]
2026 b[m] = i
2027}
2028
2029Buffer.prototype.swap16 = function swap16 () {
2030 var len = this.length
2031 if (len % 2 !== 0) {
2032 throw new RangeError('Buffer size must be a multiple of 16-bits')
2033 }
2034 for (var i = 0; i < len; i += 2) {
2035 swap(this, i, i + 1)
2036 }
2037 return this
2038}
2039
2040Buffer.prototype.swap32 = function swap32 () {
2041 var len = this.length
2042 if (len % 4 !== 0) {
2043 throw new RangeError('Buffer size must be a multiple of 32-bits')
2044 }
2045 for (var i = 0; i < len; i += 4) {
2046 swap(this, i, i + 3)
2047 swap(this, i + 1, i + 2)
2048 }
2049 return this
2050}
2051
2052Buffer.prototype.swap64 = function swap64 () {
2053 var len = this.length
2054 if (len % 8 !== 0) {
2055 throw new RangeError('Buffer size must be a multiple of 64-bits')
2056 }
2057 for (var i = 0; i < len; i += 8) {
2058 swap(this, i, i + 7)
2059 swap(this, i + 1, i + 6)
2060 swap(this, i + 2, i + 5)
2061 swap(this, i + 3, i + 4)
2062 }
2063 return this
2064}
2065
2066Buffer.prototype.toString = function toString () {
2067 var length = this.length
2068 if (length === 0) return ''
2069 if (arguments.length === 0) return utf8Slice(this, 0, length)
2070 return slowToString.apply(this, arguments)
2071}
2072
2073Buffer.prototype.equals = function equals (b) {
2074 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
2075 if (this === b) return true
2076 return Buffer.compare(this, b) === 0
2077}
2078
2079Buffer.prototype.inspect = function inspect () {
2080 var str = ''
2081 var max = exports.INSPECT_MAX_BYTES
2082 if (this.length > 0) {
2083 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
2084 if (this.length > max) str += ' ... '
2085 }
2086 return '<Buffer ' + str + '>'
2087}
2088
2089Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
2090 if (!Buffer.isBuffer(target)) {
2091 throw new TypeError('Argument must be a Buffer')
2092 }
2093
2094 if (start === undefined) {
2095 start = 0
2096 }
2097 if (end === undefined) {
2098 end = target ? target.length : 0
2099 }
2100 if (thisStart === undefined) {
2101 thisStart = 0
2102 }
2103 if (thisEnd === undefined) {
2104 thisEnd = this.length
2105 }
2106
2107 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
2108 throw new RangeError('out of range index')
2109 }
2110
2111 if (thisStart >= thisEnd && start >= end) {
2112 return 0
2113 }
2114 if (thisStart >= thisEnd) {
2115 return -1
2116 }
2117 if (start >= end) {
2118 return 1
2119 }
2120
2121 start >>>= 0
2122 end >>>= 0
2123 thisStart >>>= 0
2124 thisEnd >>>= 0
2125
2126 if (this === target) return 0
2127
2128 var x = thisEnd - thisStart
2129 var y = end - start
2130 var len = Math.min(x, y)
2131
2132 var thisCopy = this.slice(thisStart, thisEnd)
2133 var targetCopy = target.slice(start, end)
2134
2135 for (var i = 0; i < len; ++i) {
2136 if (thisCopy[i] !== targetCopy[i]) {
2137 x = thisCopy[i]
2138 y = targetCopy[i]
2139 break
2140 }
2141 }
2142
2143 if (x < y) return -1
2144 if (y < x) return 1
2145 return 0
2146}
2147
2148// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
2149// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
2150//
2151// Arguments:
2152// - buffer - a Buffer to search
2153// - val - a string, Buffer, or number
2154// - byteOffset - an index into `buffer`; will be clamped to an int32
2155// - encoding - an optional encoding, relevant is val is a string
2156// - dir - true for indexOf, false for lastIndexOf
2157function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
2158 // Empty buffer means no match
2159 if (buffer.length === 0) return -1
2160
2161 // Normalize byteOffset
2162 if (typeof byteOffset === 'string') {
2163 encoding = byteOffset
2164 byteOffset = 0
2165 } else if (byteOffset > 0x7fffffff) {
2166 byteOffset = 0x7fffffff
2167 } else if (byteOffset < -0x80000000) {
2168 byteOffset = -0x80000000
2169 }
2170 byteOffset = +byteOffset // Coerce to Number.
2171 if (numberIsNaN(byteOffset)) {
2172 // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
2173 byteOffset = dir ? 0 : (buffer.length - 1)
2174 }
2175
2176 // Normalize byteOffset: negative offsets start from the end of the buffer
2177 if (byteOffset < 0) byteOffset = buffer.length + byteOffset
2178 if (byteOffset >= buffer.length) {
2179 if (dir) return -1
2180 else byteOffset = buffer.length - 1
2181 } else if (byteOffset < 0) {
2182 if (dir) byteOffset = 0
2183 else return -1
2184 }
2185
2186 // Normalize val
2187 if (typeof val === 'string') {
2188 val = Buffer.from(val, encoding)
2189 }
2190
2191 // Finally, search either indexOf (if dir is true) or lastIndexOf
2192 if (Buffer.isBuffer(val)) {
2193 // Special case: looking for empty string/buffer always fails
2194 if (val.length === 0) {
2195 return -1
2196 }
2197 return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
2198 } else if (typeof val === 'number') {
2199 val = val & 0xFF // Search for a byte value [0-255]
2200 if (typeof Uint8Array.prototype.indexOf === 'function') {
2201 if (dir) {
2202 return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
2203 } else {
2204 return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
2205 }
2206 }
2207 return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
2208 }
2209
2210 throw new TypeError('val must be string, number or Buffer')
2211}
2212
2213function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
2214 var indexSize = 1
2215 var arrLength = arr.length
2216 var valLength = val.length
2217
2218 if (encoding !== undefined) {
2219 encoding = String(encoding).toLowerCase()
2220 if (encoding === 'ucs2' || encoding === 'ucs-2' ||
2221 encoding === 'utf16le' || encoding === 'utf-16le') {
2222 if (arr.length < 2 || val.length < 2) {
2223 return -1
2224 }
2225 indexSize = 2
2226 arrLength /= 2
2227 valLength /= 2
2228 byteOffset /= 2
2229 }
2230 }
2231
2232 function read (buf, i) {
2233 if (indexSize === 1) {
2234 return buf[i]
2235 } else {
2236 return buf.readUInt16BE(i * indexSize)
2237 }
2238 }
2239
2240 var i
2241 if (dir) {
2242 var foundIndex = -1
2243 for (i = byteOffset; i < arrLength; i++) {
2244 if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
2245 if (foundIndex === -1) foundIndex = i
2246 if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
2247 } else {
2248 if (foundIndex !== -1) i -= i - foundIndex
2249 foundIndex = -1
2250 }
2251 }
2252 } else {
2253 if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
2254 for (i = byteOffset; i >= 0; i--) {
2255 var found = true
2256 for (var j = 0; j < valLength; j++) {
2257 if (read(arr, i + j) !== read(val, j)) {
2258 found = false
2259 break
2260 }
2261 }
2262 if (found) return i
2263 }
2264 }
2265
2266 return -1
2267}
2268
2269Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
2270 return this.indexOf(val, byteOffset, encoding) !== -1
2271}
2272
2273Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
2274 return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
2275}
2276
2277Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
2278 return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
2279}
2280
2281function hexWrite (buf, string, offset, length) {
2282 offset = Number(offset) || 0
2283 var remaining = buf.length - offset
2284 if (!length) {
2285 length = remaining
2286 } else {
2287 length = Number(length)
2288 if (length > remaining) {
2289 length = remaining
2290 }
2291 }
2292
2293 // must be an even number of digits
2294 var strLen = string.length
2295 if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
2296
2297 if (length > strLen / 2) {
2298 length = strLen / 2
2299 }
2300 for (var i = 0; i < length; ++i) {
2301 var parsed = parseInt(string.substr(i * 2, 2), 16)
2302 if (numberIsNaN(parsed)) return i
2303 buf[offset + i] = parsed
2304 }
2305 return i
2306}
2307
2308function utf8Write (buf, string, offset, length) {
2309 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
2310}
2311
2312function asciiWrite (buf, string, offset, length) {
2313 return blitBuffer(asciiToBytes(string), buf, offset, length)
2314}
2315
2316function latin1Write (buf, string, offset, length) {
2317 return asciiWrite(buf, string, offset, length)
2318}
2319
2320function base64Write (buf, string, offset, length) {
2321 return blitBuffer(base64ToBytes(string), buf, offset, length)
2322}
2323
2324function ucs2Write (buf, string, offset, length) {
2325 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
2326}
2327
2328Buffer.prototype.write = function write (string, offset, length, encoding) {
2329 // Buffer#write(string)
2330 if (offset === undefined) {
2331 encoding = 'utf8'
2332 length = this.length
2333 offset = 0
2334 // Buffer#write(string, encoding)
2335 } else if (length === undefined && typeof offset === 'string') {
2336 encoding = offset
2337 length = this.length
2338 offset = 0
2339 // Buffer#write(string, offset[, length][, encoding])
2340 } else if (isFinite(offset)) {
2341 offset = offset >>> 0
2342 if (isFinite(length)) {
2343 length = length >>> 0
2344 if (encoding === undefined) encoding = 'utf8'
2345 } else {
2346 encoding = length
2347 length = undefined
2348 }
2349 } else {
2350 throw new Error(
2351 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
2352 )
2353 }
2354
2355 var remaining = this.length - offset
2356 if (length === undefined || length > remaining) length = remaining
2357
2358 if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
2359 throw new RangeError('Attempt to write outside buffer bounds')
2360 }
2361
2362 if (!encoding) encoding = 'utf8'
2363
2364 var loweredCase = false
2365 for (;;) {
2366 switch (encoding) {
2367 case 'hex':
2368 return hexWrite(this, string, offset, length)
2369
2370 case 'utf8':
2371 case 'utf-8':
2372 return utf8Write(this, string, offset, length)
2373
2374 case 'ascii':
2375 return asciiWrite(this, string, offset, length)
2376
2377 case 'latin1':
2378 case 'binary':
2379 return latin1Write(this, string, offset, length)
2380
2381 case 'base64':
2382 // Warning: maxLength not taken into account in base64Write
2383 return base64Write(this, string, offset, length)
2384
2385 case 'ucs2':
2386 case 'ucs-2':
2387 case 'utf16le':
2388 case 'utf-16le':
2389 return ucs2Write(this, string, offset, length)
2390
2391 default:
2392 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
2393 encoding = ('' + encoding).toLowerCase()
2394 loweredCase = true
2395 }
2396 }
2397}
2398
2399Buffer.prototype.toJSON = function toJSON () {
2400 return {
2401 type: 'Buffer',
2402 data: Array.prototype.slice.call(this._arr || this, 0)
2403 }
2404}
2405
2406function base64Slice (buf, start, end) {
2407 if (start === 0 && end === buf.length) {
2408 return base64.fromByteArray(buf)
2409 } else {
2410 return base64.fromByteArray(buf.slice(start, end))
2411 }
2412}
2413
2414function utf8Slice (buf, start, end) {
2415 end = Math.min(buf.length, end)
2416 var res = []
2417
2418 var i = start
2419 while (i < end) {
2420 var firstByte = buf[i]
2421 var codePoint = null
2422 var bytesPerSequence = (firstByte > 0xEF) ? 4
2423 : (firstByte > 0xDF) ? 3
2424 : (firstByte > 0xBF) ? 2
2425 : 1
2426
2427 if (i + bytesPerSequence <= end) {
2428 var secondByte, thirdByte, fourthByte, tempCodePoint
2429
2430 switch (bytesPerSequence) {
2431 case 1:
2432 if (firstByte < 0x80) {
2433 codePoint = firstByte
2434 }
2435 break
2436 case 2:
2437 secondByte = buf[i + 1]
2438 if ((secondByte & 0xC0) === 0x80) {
2439 tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
2440 if (tempCodePoint > 0x7F) {
2441 codePoint = tempCodePoint
2442 }
2443 }
2444 break
2445 case 3:
2446 secondByte = buf[i + 1]
2447 thirdByte = buf[i + 2]
2448 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
2449 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
2450 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
2451 codePoint = tempCodePoint
2452 }
2453 }
2454 break
2455 case 4:
2456 secondByte = buf[i + 1]
2457 thirdByte = buf[i + 2]
2458 fourthByte = buf[i + 3]
2459 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
2460 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
2461 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
2462 codePoint = tempCodePoint
2463 }
2464 }
2465 }
2466 }
2467
2468 if (codePoint === null) {
2469 // we did not generate a valid codePoint so insert a
2470 // replacement char (U+FFFD) and advance only 1 byte
2471 codePoint = 0xFFFD
2472 bytesPerSequence = 1
2473 } else if (codePoint > 0xFFFF) {
2474 // encode to utf16 (surrogate pair dance)
2475 codePoint -= 0x10000
2476 res.push(codePoint >>> 10 & 0x3FF | 0xD800)
2477 codePoint = 0xDC00 | codePoint & 0x3FF
2478 }
2479
2480 res.push(codePoint)
2481 i += bytesPerSequence
2482 }
2483
2484 return decodeCodePointsArray(res)
2485}
2486
2487// Based on http://stackoverflow.com/a/22747272/680742, the browser with
2488// the lowest limit is Chrome, with 0x10000 args.
2489// We go 1 magnitude less, for safety
2490var MAX_ARGUMENTS_LENGTH = 0x1000
2491
2492function decodeCodePointsArray (codePoints) {
2493 var len = codePoints.length
2494 if (len <= MAX_ARGUMENTS_LENGTH) {
2495 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
2496 }
2497
2498 // Decode in chunks to avoid "call stack size exceeded".
2499 var res = ''
2500 var i = 0
2501 while (i < len) {
2502 res += String.fromCharCode.apply(
2503 String,
2504 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
2505 )
2506 }
2507 return res
2508}
2509
2510function asciiSlice (buf, start, end) {
2511 var ret = ''
2512 end = Math.min(buf.length, end)
2513
2514 for (var i = start; i < end; ++i) {
2515 ret += String.fromCharCode(buf[i] & 0x7F)
2516 }
2517 return ret
2518}
2519
2520function latin1Slice (buf, start, end) {
2521 var ret = ''
2522 end = Math.min(buf.length, end)
2523
2524 for (var i = start; i < end; ++i) {
2525 ret += String.fromCharCode(buf[i])
2526 }
2527 return ret
2528}
2529
2530function hexSlice (buf, start, end) {
2531 var len = buf.length
2532
2533 if (!start || start < 0) start = 0
2534 if (!end || end < 0 || end > len) end = len
2535
2536 var out = ''
2537 for (var i = start; i < end; ++i) {
2538 out += toHex(buf[i])
2539 }
2540 return out
2541}
2542
2543function utf16leSlice (buf, start, end) {
2544 var bytes = buf.slice(start, end)
2545 var res = ''
2546 for (var i = 0; i < bytes.length; i += 2) {
2547 res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
2548 }
2549 return res
2550}
2551
2552Buffer.prototype.slice = function slice (start, end) {
2553 var len = this.length
2554 start = ~~start
2555 end = end === undefined ? len : ~~end
2556
2557 if (start < 0) {
2558 start += len
2559 if (start < 0) start = 0
2560 } else if (start > len) {
2561 start = len
2562 }
2563
2564 if (end < 0) {
2565 end += len
2566 if (end < 0) end = 0
2567 } else if (end > len) {
2568 end = len
2569 }
2570
2571 if (end < start) end = start
2572
2573 var newBuf = this.subarray(start, end)
2574 // Return an augmented `Uint8Array` instance
2575 newBuf.__proto__ = Buffer.prototype
2576 return newBuf
2577}
2578
2579/*
2580 * Need to make sure that buffer isn't trying to write out of bounds.
2581 */
2582function checkOffset (offset, ext, length) {
2583 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
2584 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
2585}
2586
2587Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
2588 offset = offset >>> 0
2589 byteLength = byteLength >>> 0
2590 if (!noAssert) checkOffset(offset, byteLength, this.length)
2591
2592 var val = this[offset]
2593 var mul = 1
2594 var i = 0
2595 while (++i < byteLength && (mul *= 0x100)) {
2596 val += this[offset + i] * mul
2597 }
2598
2599 return val
2600}
2601
2602Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
2603 offset = offset >>> 0
2604 byteLength = byteLength >>> 0
2605 if (!noAssert) {
2606 checkOffset(offset, byteLength, this.length)
2607 }
2608
2609 var val = this[offset + --byteLength]
2610 var mul = 1
2611 while (byteLength > 0 && (mul *= 0x100)) {
2612 val += this[offset + --byteLength] * mul
2613 }
2614
2615 return val
2616}
2617
2618Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
2619 offset = offset >>> 0
2620 if (!noAssert) checkOffset(offset, 1, this.length)
2621 return this[offset]
2622}
2623
2624Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
2625 offset = offset >>> 0
2626 if (!noAssert) checkOffset(offset, 2, this.length)
2627 return this[offset] | (this[offset + 1] << 8)
2628}
2629
2630Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
2631 offset = offset >>> 0
2632 if (!noAssert) checkOffset(offset, 2, this.length)
2633 return (this[offset] << 8) | this[offset + 1]
2634}
2635
2636Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
2637 offset = offset >>> 0
2638 if (!noAssert) checkOffset(offset, 4, this.length)
2639
2640 return ((this[offset]) |
2641 (this[offset + 1] << 8) |
2642 (this[offset + 2] << 16)) +
2643 (this[offset + 3] * 0x1000000)
2644}
2645
2646Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
2647 offset = offset >>> 0
2648 if (!noAssert) checkOffset(offset, 4, this.length)
2649
2650 return (this[offset] * 0x1000000) +
2651 ((this[offset + 1] << 16) |
2652 (this[offset + 2] << 8) |
2653 this[offset + 3])
2654}
2655
2656Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
2657 offset = offset >>> 0
2658 byteLength = byteLength >>> 0
2659 if (!noAssert) checkOffset(offset, byteLength, this.length)
2660
2661 var val = this[offset]
2662 var mul = 1
2663 var i = 0
2664 while (++i < byteLength && (mul *= 0x100)) {
2665 val += this[offset + i] * mul
2666 }
2667 mul *= 0x80
2668
2669 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
2670
2671 return val
2672}
2673
2674Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
2675 offset = offset >>> 0
2676 byteLength = byteLength >>> 0
2677 if (!noAssert) checkOffset(offset, byteLength, this.length)
2678
2679 var i = byteLength
2680 var mul = 1
2681 var val = this[offset + --i]
2682 while (i > 0 && (mul *= 0x100)) {
2683 val += this[offset + --i] * mul
2684 }
2685 mul *= 0x80
2686
2687 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
2688
2689 return val
2690}
2691
2692Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
2693 offset = offset >>> 0
2694 if (!noAssert) checkOffset(offset, 1, this.length)
2695 if (!(this[offset] & 0x80)) return (this[offset])
2696 return ((0xff - this[offset] + 1) * -1)
2697}
2698
2699Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
2700 offset = offset >>> 0
2701 if (!noAssert) checkOffset(offset, 2, this.length)
2702 var val = this[offset] | (this[offset + 1] << 8)
2703 return (val & 0x8000) ? val | 0xFFFF0000 : val
2704}
2705
2706Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
2707 offset = offset >>> 0
2708 if (!noAssert) checkOffset(offset, 2, this.length)
2709 var val = this[offset + 1] | (this[offset] << 8)
2710 return (val & 0x8000) ? val | 0xFFFF0000 : val
2711}
2712
2713Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
2714 offset = offset >>> 0
2715 if (!noAssert) checkOffset(offset, 4, this.length)
2716
2717 return (this[offset]) |
2718 (this[offset + 1] << 8) |
2719 (this[offset + 2] << 16) |
2720 (this[offset + 3] << 24)
2721}
2722
2723Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
2724 offset = offset >>> 0
2725 if (!noAssert) checkOffset(offset, 4, this.length)
2726
2727 return (this[offset] << 24) |
2728 (this[offset + 1] << 16) |
2729 (this[offset + 2] << 8) |
2730 (this[offset + 3])
2731}
2732
2733Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
2734 offset = offset >>> 0
2735 if (!noAssert) checkOffset(offset, 4, this.length)
2736 return ieee754.read(this, offset, true, 23, 4)
2737}
2738
2739Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
2740 offset = offset >>> 0
2741 if (!noAssert) checkOffset(offset, 4, this.length)
2742 return ieee754.read(this, offset, false, 23, 4)
2743}
2744
2745Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
2746 offset = offset >>> 0
2747 if (!noAssert) checkOffset(offset, 8, this.length)
2748 return ieee754.read(this, offset, true, 52, 8)
2749}
2750
2751Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
2752 offset = offset >>> 0
2753 if (!noAssert) checkOffset(offset, 8, this.length)
2754 return ieee754.read(this, offset, false, 52, 8)
2755}
2756
2757function checkInt (buf, value, offset, ext, max, min) {
2758 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
2759 if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
2760 if (offset + ext > buf.length) throw new RangeError('Index out of range')
2761}
2762
2763Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
2764 value = +value
2765 offset = offset >>> 0
2766 byteLength = byteLength >>> 0
2767 if (!noAssert) {
2768 var maxBytes = Math.pow(2, 8 * byteLength) - 1
2769 checkInt(this, value, offset, byteLength, maxBytes, 0)
2770 }
2771
2772 var mul = 1
2773 var i = 0
2774 this[offset] = value & 0xFF
2775 while (++i < byteLength && (mul *= 0x100)) {
2776 this[offset + i] = (value / mul) & 0xFF
2777 }
2778
2779 return offset + byteLength
2780}
2781
2782Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
2783 value = +value
2784 offset = offset >>> 0
2785 byteLength = byteLength >>> 0
2786 if (!noAssert) {
2787 var maxBytes = Math.pow(2, 8 * byteLength) - 1
2788 checkInt(this, value, offset, byteLength, maxBytes, 0)
2789 }
2790
2791 var i = byteLength - 1
2792 var mul = 1
2793 this[offset + i] = value & 0xFF
2794 while (--i >= 0 && (mul *= 0x100)) {
2795 this[offset + i] = (value / mul) & 0xFF
2796 }
2797
2798 return offset + byteLength
2799}
2800
2801Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
2802 value = +value
2803 offset = offset >>> 0
2804 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
2805 this[offset] = (value & 0xff)
2806 return offset + 1
2807}
2808
2809Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
2810 value = +value
2811 offset = offset >>> 0
2812 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
2813 this[offset] = (value & 0xff)
2814 this[offset + 1] = (value >>> 8)
2815 return offset + 2
2816}
2817
2818Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
2819 value = +value
2820 offset = offset >>> 0
2821 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
2822 this[offset] = (value >>> 8)
2823 this[offset + 1] = (value & 0xff)
2824 return offset + 2
2825}
2826
2827Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
2828 value = +value
2829 offset = offset >>> 0
2830 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
2831 this[offset + 3] = (value >>> 24)
2832 this[offset + 2] = (value >>> 16)
2833 this[offset + 1] = (value >>> 8)
2834 this[offset] = (value & 0xff)
2835 return offset + 4
2836}
2837
2838Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
2839 value = +value
2840 offset = offset >>> 0
2841 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
2842 this[offset] = (value >>> 24)
2843 this[offset + 1] = (value >>> 16)
2844 this[offset + 2] = (value >>> 8)
2845 this[offset + 3] = (value & 0xff)
2846 return offset + 4
2847}
2848
2849Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
2850 value = +value
2851 offset = offset >>> 0
2852 if (!noAssert) {
2853 var limit = Math.pow(2, (8 * byteLength) - 1)
2854
2855 checkInt(this, value, offset, byteLength, limit - 1, -limit)
2856 }
2857
2858 var i = 0
2859 var mul = 1
2860 var sub = 0
2861 this[offset] = value & 0xFF
2862 while (++i < byteLength && (mul *= 0x100)) {
2863 if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
2864 sub = 1
2865 }
2866 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
2867 }
2868
2869 return offset + byteLength
2870}
2871
2872Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
2873 value = +value
2874 offset = offset >>> 0
2875 if (!noAssert) {
2876 var limit = Math.pow(2, (8 * byteLength) - 1)
2877
2878 checkInt(this, value, offset, byteLength, limit - 1, -limit)
2879 }
2880
2881 var i = byteLength - 1
2882 var mul = 1
2883 var sub = 0
2884 this[offset + i] = value & 0xFF
2885 while (--i >= 0 && (mul *= 0x100)) {
2886 if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
2887 sub = 1
2888 }
2889 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
2890 }
2891
2892 return offset + byteLength
2893}
2894
2895Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
2896 value = +value
2897 offset = offset >>> 0
2898 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
2899 if (value < 0) value = 0xff + value + 1
2900 this[offset] = (value & 0xff)
2901 return offset + 1
2902}
2903
2904Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
2905 value = +value
2906 offset = offset >>> 0
2907 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
2908 this[offset] = (value & 0xff)
2909 this[offset + 1] = (value >>> 8)
2910 return offset + 2
2911}
2912
2913Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
2914 value = +value
2915 offset = offset >>> 0
2916 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
2917 this[offset] = (value >>> 8)
2918 this[offset + 1] = (value & 0xff)
2919 return offset + 2
2920}
2921
2922Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
2923 value = +value
2924 offset = offset >>> 0
2925 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
2926 this[offset] = (value & 0xff)
2927 this[offset + 1] = (value >>> 8)
2928 this[offset + 2] = (value >>> 16)
2929 this[offset + 3] = (value >>> 24)
2930 return offset + 4
2931}
2932
2933Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
2934 value = +value
2935 offset = offset >>> 0
2936 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
2937 if (value < 0) value = 0xffffffff + value + 1
2938 this[offset] = (value >>> 24)
2939 this[offset + 1] = (value >>> 16)
2940 this[offset + 2] = (value >>> 8)
2941 this[offset + 3] = (value & 0xff)
2942 return offset + 4
2943}
2944
2945function checkIEEE754 (buf, value, offset, ext, max, min) {
2946 if (offset + ext > buf.length) throw new RangeError('Index out of range')
2947 if (offset < 0) throw new RangeError('Index out of range')
2948}
2949
2950function writeFloat (buf, value, offset, littleEndian, noAssert) {
2951 value = +value
2952 offset = offset >>> 0
2953 if (!noAssert) {
2954 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
2955 }
2956 ieee754.write(buf, value, offset, littleEndian, 23, 4)
2957 return offset + 4
2958}
2959
2960Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
2961 return writeFloat(this, value, offset, true, noAssert)
2962}
2963
2964Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
2965 return writeFloat(this, value, offset, false, noAssert)
2966}
2967
2968function writeDouble (buf, value, offset, littleEndian, noAssert) {
2969 value = +value
2970 offset = offset >>> 0
2971 if (!noAssert) {
2972 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
2973 }
2974 ieee754.write(buf, value, offset, littleEndian, 52, 8)
2975 return offset + 8
2976}
2977
2978Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
2979 return writeDouble(this, value, offset, true, noAssert)
2980}
2981
2982Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
2983 return writeDouble(this, value, offset, false, noAssert)
2984}
2985
2986// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
2987Buffer.prototype.copy = function copy (target, targetStart, start, end) {
2988 if (!start) start = 0
2989 if (!end && end !== 0) end = this.length
2990 if (targetStart >= target.length) targetStart = target.length
2991 if (!targetStart) targetStart = 0
2992 if (end > 0 && end < start) end = start
2993
2994 // Copy 0 bytes; we're done
2995 if (end === start) return 0
2996 if (target.length === 0 || this.length === 0) return 0
2997
2998 // Fatal error conditions
2999 if (targetStart < 0) {
3000 throw new RangeError('targetStart out of bounds')
3001 }
3002 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
3003 if (end < 0) throw new RangeError('sourceEnd out of bounds')
3004
3005 // Are we oob?
3006 if (end > this.length) end = this.length
3007 if (target.length - targetStart < end - start) {
3008 end = target.length - targetStart + start
3009 }
3010
3011 var len = end - start
3012 var i
3013
3014 if (this === target && start < targetStart && targetStart < end) {
3015 // descending copy from end
3016 for (i = len - 1; i >= 0; --i) {
3017 target[i + targetStart] = this[i + start]
3018 }
3019 } else if (len < 1000) {
3020 // ascending copy from start
3021 for (i = 0; i < len; ++i) {
3022 target[i + targetStart] = this[i + start]
3023 }
3024 } else {
3025 Uint8Array.prototype.set.call(
3026 target,
3027 this.subarray(start, start + len),
3028 targetStart
3029 )
3030 }
3031
3032 return len
3033}
3034
3035// Usage:
3036// buffer.fill(number[, offset[, end]])
3037// buffer.fill(buffer[, offset[, end]])
3038// buffer.fill(string[, offset[, end]][, encoding])
3039Buffer.prototype.fill = function fill (val, start, end, encoding) {
3040 // Handle string cases:
3041 if (typeof val === 'string') {
3042 if (typeof start === 'string') {
3043 encoding = start
3044 start = 0
3045 end = this.length
3046 } else if (typeof end === 'string') {
3047 encoding = end
3048 end = this.length
3049 }
3050 if (val.length === 1) {
3051 var code = val.charCodeAt(0)
3052 if (code < 256) {
3053 val = code
3054 }
3055 }
3056 if (encoding !== undefined && typeof encoding !== 'string') {
3057 throw new TypeError('encoding must be a string')
3058 }
3059 if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
3060 throw new TypeError('Unknown encoding: ' + encoding)
3061 }
3062 } else if (typeof val === 'number') {
3063 val = val & 255
3064 }
3065
3066 // Invalid ranges are not set to a default, so can range check early.
3067 if (start < 0 || this.length < start || this.length < end) {
3068 throw new RangeError('Out of range index')
3069 }
3070
3071 if (end <= start) {
3072 return this
3073 }
3074
3075 start = start >>> 0
3076 end = end === undefined ? this.length : end >>> 0
3077
3078 if (!val) val = 0
3079
3080 var i
3081 if (typeof val === 'number') {
3082 for (i = start; i < end; ++i) {
3083 this[i] = val
3084 }
3085 } else {
3086 var bytes = Buffer.isBuffer(val)
3087 ? val
3088 : new Buffer(val, encoding)
3089 var len = bytes.length
3090 for (i = 0; i < end - start; ++i) {
3091 this[i + start] = bytes[i % len]
3092 }
3093 }
3094
3095 return this
3096}
3097
3098// HELPER FUNCTIONS
3099// ================
3100
3101var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
3102
3103function base64clean (str) {
3104 // Node strips out invalid characters like \n and \t from the string, base64-js does not
3105 str = str.trim().replace(INVALID_BASE64_RE, '')
3106 // Node converts strings with length < 2 to ''
3107 if (str.length < 2) return ''
3108 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
3109 while (str.length % 4 !== 0) {
3110 str = str + '='
3111 }
3112 return str
3113}
3114
3115function toHex (n) {
3116 if (n < 16) return '0' + n.toString(16)
3117 return n.toString(16)
3118}
3119
3120function utf8ToBytes (string, units) {
3121 units = units || Infinity
3122 var codePoint
3123 var length = string.length
3124 var leadSurrogate = null
3125 var bytes = []
3126
3127 for (var i = 0; i < length; ++i) {
3128 codePoint = string.charCodeAt(i)
3129
3130 // is surrogate component
3131 if (codePoint > 0xD7FF && codePoint < 0xE000) {
3132 // last char was a lead
3133 if (!leadSurrogate) {
3134 // no lead yet
3135 if (codePoint > 0xDBFF) {
3136 // unexpected trail
3137 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
3138 continue
3139 } else if (i + 1 === length) {
3140 // unpaired lead
3141 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
3142 continue
3143 }
3144
3145 // valid lead
3146 leadSurrogate = codePoint
3147
3148 continue
3149 }
3150
3151 // 2 leads in a row
3152 if (codePoint < 0xDC00) {
3153 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
3154 leadSurrogate = codePoint
3155 continue
3156 }
3157
3158 // valid surrogate pair
3159 codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
3160 } else if (leadSurrogate) {
3161 // valid bmp char, but last char was a lead
3162 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
3163 }
3164
3165 leadSurrogate = null
3166
3167 // encode utf8
3168 if (codePoint < 0x80) {
3169 if ((units -= 1) < 0) break
3170 bytes.push(codePoint)
3171 } else if (codePoint < 0x800) {
3172 if ((units -= 2) < 0) break
3173 bytes.push(
3174 codePoint >> 0x6 | 0xC0,
3175 codePoint & 0x3F | 0x80
3176 )
3177 } else if (codePoint < 0x10000) {
3178 if ((units -= 3) < 0) break
3179 bytes.push(
3180 codePoint >> 0xC | 0xE0,
3181 codePoint >> 0x6 & 0x3F | 0x80,
3182 codePoint & 0x3F | 0x80
3183 )
3184 } else if (codePoint < 0x110000) {
3185 if ((units -= 4) < 0) break
3186 bytes.push(
3187 codePoint >> 0x12 | 0xF0,
3188 codePoint >> 0xC & 0x3F | 0x80,
3189 codePoint >> 0x6 & 0x3F | 0x80,
3190 codePoint & 0x3F | 0x80
3191 )
3192 } else {
3193 throw new Error('Invalid code point')
3194 }
3195 }
3196
3197 return bytes
3198}
3199
3200function asciiToBytes (str) {
3201 var byteArray = []
3202 for (var i = 0; i < str.length; ++i) {
3203 // Node's code seems to be doing this and not & 0x7F..
3204 byteArray.push(str.charCodeAt(i) & 0xFF)
3205 }
3206 return byteArray
3207}
3208
3209function utf16leToBytes (str, units) {
3210 var c, hi, lo
3211 var byteArray = []
3212 for (var i = 0; i < str.length; ++i) {
3213 if ((units -= 2) < 0) break
3214
3215 c = str.charCodeAt(i)
3216 hi = c >> 8
3217 lo = c % 256
3218 byteArray.push(lo)
3219 byteArray.push(hi)
3220 }
3221
3222 return byteArray
3223}
3224
3225function base64ToBytes (str) {
3226 return base64.toByteArray(base64clean(str))
3227}
3228
3229function blitBuffer (src, dst, offset, length) {
3230 for (var i = 0; i < length; ++i) {
3231 if ((i + offset >= dst.length) || (i >= src.length)) break
3232 dst[i + offset] = src[i]
3233 }
3234 return i
3235}
3236
3237// ArrayBuffers from another context (i.e. an iframe) do not pass the `instanceof` check
3238// but they should be treated as valid. See: https://github.com/feross/buffer/issues/166
3239function isArrayBuffer (obj) {
3240 return obj instanceof ArrayBuffer ||
3241 (obj != null && obj.constructor != null && obj.constructor.name === 'ArrayBuffer' &&
3242 typeof obj.byteLength === 'number')
3243}
3244
3245// Node 0.10 supports `ArrayBuffer` but lacks `ArrayBuffer.isView`
3246function isArrayBufferView (obj) {
3247 return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)
3248}
3249
3250function numberIsNaN (obj) {
3251 return obj !== obj // eslint-disable-line no-self-compare
3252}
3253
3254},{"base64-js":2,"ieee754":20}],9:[function(require,module,exports){
3255/**
3256 * @license
3257 * https://github.com/bitcoincashjs/cashaddr
3258 * Copyright (c) 2017-2018 Emilio Almansi
3259 * Distributed under the MIT software license, see the accompanying
3260 * file LICENSE or http://www.opensource.org/licenses/mit-license.php.
3261 */
3262
3263'use strict';
3264
3265var validate = require('./validation').validate;
3266
3267/**
3268 * Base32 encoding and decoding.
3269 *
3270 * @module base32
3271 */
3272
3273/**
3274 * Charset containing the 32 symbols used in the base32 encoding.
3275 * @private
3276 */
3277var CHARSET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l';
3278
3279/**
3280 * Inverted index mapping each symbol into its index within the charset.
3281 * @private
3282 */
3283var CHARSET_INVERSE_INDEX = {
3284 'q': 0, 'p': 1, 'z': 2, 'r': 3, 'y': 4, '9': 5, 'x': 6, '8': 7,
3285 'g': 8, 'f': 9, '2': 10, 't': 11, 'v': 12, 'd': 13, 'w': 14, '0': 15,
3286 's': 16, '3': 17, 'j': 18, 'n': 19, '5': 20, '4': 21, 'k': 22, 'h': 23,
3287 'c': 24, 'e': 25, '6': 26, 'm': 27, 'u': 28, 'a': 29, '7': 30, 'l': 31,
3288};
3289
3290/**
3291 * Encodes the given array of 5-bit integers as a base32-encoded string.
3292 *
3293 * @static
3294 * @param {Uint8Array} data Array of integers between 0 and 31 inclusive.
3295 * @returns {string}
3296 * @throws {ValidationError}
3297 */
3298function encode(data) {
3299 validate(data instanceof Uint8Array, 'Invalid data: ' + data + '.');
3300 var base32 = '';
3301 for (var i = 0; i < data.length; ++i) {
3302 var value = data[i];
3303 validate(0 <= value && value < 32, 'Invalid value: ' + value + '.');
3304 base32 += CHARSET[value];
3305 }
3306 return base32;
3307}
3308
3309/**
3310 * Decodes the given base32-encoded string into an array of 5-bit integers.
3311 *
3312 * @static
3313 * @param {string} string
3314 * @returns {Uint8Array}
3315 * @throws {ValidationError}
3316 */
3317function decode(string) {
3318 validate(typeof string === 'string', 'Invalid base32-encoded string: ' + string + '.');
3319 var data = new Uint8Array(string.length);
3320 for (var i = 0; i < string.length; ++i) {
3321 var value = string[i];
3322 validate(value in CHARSET_INVERSE_INDEX, 'Invalid value: ' + value + '.');
3323 data[i] = CHARSET_INVERSE_INDEX[value];
3324 }
3325 return data;
3326}
3327
3328module.exports = {
3329 encode: encode,
3330 decode: decode,
3331};
3332
3333},{"./validation":12}],10:[function(require,module,exports){
3334/**
3335 * @license
3336 * https://github.com/bitcoincashjs/cashaddr
3337 * Copyright (c) 2017-2018 Emilio Almansi
3338 * Distributed under the MIT software license, see the accompanying
3339 * file LICENSE or http://www.opensource.org/licenses/mit-license.php.
3340 */
3341
3342'use strict';
3343
3344var base32 = require('./base32');
3345var bigInt = require('big-integer');
3346var convertBits = require('./convertBits');
3347var validation = require('./validation');
3348var validate = validation.validate;
3349
3350/**
3351 * Encoding and decoding of the new Cash Address format for Bitcoin Cash. <br />
3352 * Compliant with the original cashaddr specification:
3353 * {@link https://github.com/Bitcoin-UAHF/spec/blob/master/cashaddr.md}
3354 * @module cashaddr
3355 */
3356
3357/**
3358 * Encodes a hash from a given type into a Bitcoin Cash address with the given prefix.
3359 *
3360 * @static
3361 * @param {string} prefix Network prefix. E.g.: 'bitcoincash'.
3362 * @param {string} type Type of address to generate. Either 'P2PKH' or 'P2SH'.
3363 * @param {Uint8Array} hash Hash to encode represented as an array of 8-bit integers.
3364 * @returns {string}
3365 * @throws {ValidationError}
3366 */
3367function encode(prefix, type, hash) {
3368 validate(typeof prefix === 'string' && isValidPrefix(prefix), 'Invalid prefix: ' + prefix + '.');
3369 validate(typeof type === 'string', 'Invalid type: ' + type + '.');
3370 validate(hash instanceof Uint8Array, 'Invalid hash: ' + hash + '.');
3371 var prefixData = concat(prefixToUint5Array(prefix), new Uint8Array(1));
3372 var versionByte = getTypeBits(type) + getHashSizeBits(hash);
3373 var payloadData = toUint5Array(concat(Uint8Array.of(versionByte), hash));
3374 var checksumData = concat(concat(prefixData, payloadData), new Uint8Array(8));
3375 var payload = concat(payloadData, checksumToUint5Array(polymod(checksumData)));
3376 return prefix + ':' + base32.encode(payload);
3377}
3378
3379/**
3380 * Decodes the given address into its constituting prefix, type and hash. See [#encode()]{@link encode}.
3381 *
3382 * @static
3383 * @param {string} address Address to decode. E.g.: 'bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a'.
3384 * @returns {object}
3385 * @throws {ValidationError}
3386 */
3387function decode(address) {
3388 validate(typeof address === 'string' && hasSingleCase(address), 'Invalid address: ' + address + '.');
3389 var pieces = address.toLowerCase().split(':');
3390 validate(pieces.length === 2, 'Missing prefix: ' + address + '.');
3391 var prefix = pieces[0];
3392 var payload = base32.decode(pieces[1]);
3393 validate(validChecksum(prefix, payload), 'Invalid checksum: ' + address + '.');
3394 var payloadData = fromUint5Array(payload.slice(0, -8));
3395 var versionByte = payloadData[0];
3396 var hash = payloadData.slice(1);
3397 validate(getHashSize(versionByte) === hash.length * 8, 'Invalid hash size: ' + address + '.');
3398 var type = getType(versionByte);
3399 return {
3400 prefix: prefix,
3401 type: type,
3402 hash: hash,
3403 };
3404}
3405
3406/**
3407 * Error thrown when encoding or decoding fail due to invalid input.
3408 *
3409 * @constructor ValidationError
3410 * @param {string} message Error description.
3411 */
3412var ValidationError = validation.ValidationError;
3413
3414/**
3415 * Valid address prefixes.
3416 *
3417 * @private
3418 */
3419var VALID_PREFIXES = ['bitcoincash', 'bchtest', 'bchreg'];
3420
3421/**
3422 * Checks whether a string is a valid prefix; ie., it has a single letter case
3423 * and is one of 'bitcoincash', 'bchtest', or 'bchreg'.
3424 *
3425 * @private
3426 * @param {string} prefix
3427 * @returns {boolean}
3428 */
3429function isValidPrefix(prefix) {
3430 return hasSingleCase(prefix) && VALID_PREFIXES.indexOf(prefix.toLowerCase()) !== -1;
3431}
3432
3433/**
3434 * Derives an array from the given prefix to be used in the computation
3435 * of the address' checksum.
3436 *
3437 * @private
3438 * @param {string} prefix Network prefix. E.g.: 'bitcoincash'.
3439 * @returns {Uint8Array}
3440 */
3441function prefixToUint5Array(prefix) {
3442 var result = new Uint8Array(prefix.length);
3443 for (var i = 0; i < prefix.length; ++i) {
3444 result[i] = prefix[i].charCodeAt(0) & 31;
3445 }
3446 return result;
3447}
3448
3449/**
3450 * Returns an array representation of the given checksum to be encoded
3451 * within the address' payload.
3452 *
3453 * @private
3454 * @param {BigInteger} checksum Computed checksum.
3455 * @returns {Uint8Array}
3456 */
3457function checksumToUint5Array(checksum) {
3458 var result = new Uint8Array(8);
3459 for (var i = 0; i < 8; ++i) {
3460 result[7 - i] = checksum.and(31).toJSNumber();
3461 checksum = checksum.shiftRight(5);
3462 }
3463 return result;
3464}
3465
3466/**
3467 * Returns the bit representation of the given type within the version
3468 * byte.
3469 *
3470 * @private
3471 * @param {string} type Address type. Either 'P2PKH' or 'P2SH'.
3472 * @returns {number}
3473 * @throws {ValidationError}
3474 */
3475function getTypeBits(type) {
3476 switch (type) {
3477 case 'P2PKH':
3478 return 0;
3479 case 'P2SH':
3480 return 8;
3481 default:
3482 throw new ValidationError('Invalid type: ' + type + '.');
3483 }
3484}
3485
3486/**
3487 * Retrieves the address type from its bit representation within the
3488 * version byte.
3489 *
3490 * @private
3491 * @param {number} versionByte
3492 * @returns {string}
3493 * @throws {ValidationError}
3494 */
3495function getType(versionByte) {
3496 switch (versionByte & 120) {
3497 case 0:
3498 return 'P2PKH';
3499 case 8:
3500 return 'P2SH';
3501 default:
3502 throw new ValidationError('Invalid address type in version byte: ' + versionByte + '.');
3503 }
3504}
3505
3506/**
3507 * Returns the bit representation of the length in bits of the given
3508 * hash within the version byte.
3509 *
3510 * @private
3511 * @param {Uint8Array} hash Hash to encode represented as an array of 8-bit integers.
3512 * @returns {number}
3513 * @throws {ValidationError}
3514 */
3515function getHashSizeBits(hash) {
3516 switch (hash.length * 8) {
3517 case 160:
3518 return 0;
3519 case 192:
3520 return 1;
3521 case 224:
3522 return 2;
3523 case 256:
3524 return 3;
3525 case 320:
3526 return 4;
3527 case 384:
3528 return 5;
3529 case 448:
3530 return 6;
3531 case 512:
3532 return 7;
3533 default:
3534 throw new ValidationError('Invalid hash size: ' + hash.length + '.');
3535 }
3536}
3537
3538/**
3539 * Retrieves the the length in bits of the encoded hash from its bit
3540 * representation within the version byte.
3541 *
3542 * @private
3543 * @param {number} versionByte
3544 * @returns {number}
3545 */
3546function getHashSize(versionByte) {
3547 switch (versionByte & 7) {
3548 case 0:
3549 return 160;
3550 case 1:
3551 return 192;
3552 case 2:
3553 return 224;
3554 case 3:
3555 return 256;
3556 case 4:
3557 return 320;
3558 case 5:
3559 return 384;
3560 case 6:
3561 return 448;
3562 case 7:
3563 return 512;
3564 }
3565}
3566
3567/**
3568 * Converts an array of 8-bit integers into an array of 5-bit integers,
3569 * right-padding with zeroes if necessary.
3570 *
3571 * @private
3572 * @param {Uint8Array} data
3573 * @returns {Uint8Array}
3574 */
3575function toUint5Array(data) {
3576 return convertBits(data, 8, 5);
3577}
3578
3579/**
3580 * Converts an array of 5-bit integers back into an array of 8-bit integers,
3581 * removing extra zeroes left from padding if necessary.
3582 * Throws a {@link ValidationError} if input is not a zero-padded array of 8-bit integers.
3583 *
3584 * @private
3585 * @param {Uint8Array} data
3586 * @returns {Uint8Array}
3587 * @throws {ValidationError}
3588 */
3589function fromUint5Array(data) {
3590 return convertBits(data, 5, 8, true);
3591}
3592
3593/**
3594 * Returns the concatenation a and b.
3595 *
3596 * @private
3597 * @param {Uint8Array} a
3598 * @param {Uint8Array} b
3599 * @returns {Uint8Array}
3600 * @throws {ValidationError}
3601 */
3602function concat(a, b) {
3603 var ab = new Uint8Array(a.length + b.length);
3604 ab.set(a);
3605 ab.set(b, a.length);
3606 return ab;
3607}
3608
3609/**
3610 * Computes a checksum from the given input data as specified for the CashAddr
3611 * format: https://github.com/Bitcoin-UAHF/spec/blob/master/cashaddr.md.
3612 *
3613 * @private
3614 * @param {Uint8Array} data Array of 5-bit integers over which the checksum is to be computed.
3615 * @returns {BigInteger}
3616 */
3617function polymod(data) {
3618 var GENERATOR = [0x98f2bc8e61, 0x79b76d99e2, 0xf33e5fb3c4, 0xae2eabe2a8, 0x1e4f43e470];
3619 var checksum = bigInt(1);
3620 for (var i = 0; i < data.length; ++i) {
3621 var value = data[i];
3622 var topBits = checksum.shiftRight(35);
3623 checksum = checksum.and(0x07ffffffff).shiftLeft(5).xor(value);
3624 for (var j = 0; j < GENERATOR.length; ++j) {
3625 if (topBits.shiftRight(j).and(1).equals(1)) {
3626 checksum = checksum.xor(GENERATOR[j]);
3627 }
3628 }
3629 }
3630 return checksum.xor(1);
3631}
3632
3633/**
3634 * Verify that the payload has not been corrupted by checking that the
3635 * checksum is valid.
3636 *
3637 * @private
3638 * @param {string} prefix Network prefix. E.g.: 'bitcoincash'.
3639 * @param {Uint8Array} payload Array of 5-bit integers containing the address' payload.
3640 * @returns {boolean}
3641 */
3642function validChecksum(prefix, payload) {
3643 var prefixData = concat(prefixToUint5Array(prefix), new Uint8Array(1));
3644 var checksumData = concat(prefixData, payload);
3645 return polymod(checksumData).equals(0);
3646}
3647
3648/**
3649 * Returns true if, and only if, the given string contains either uppercase
3650 * or lowercase letters, but not both.
3651 *
3652 * @private
3653 * @param {string} string Input string.
3654 * @returns {boolean}
3655 */
3656function hasSingleCase(string) {
3657 return string === string.toLowerCase() || string === string.toUpperCase();
3658}
3659
3660module.exports = {
3661 encode: encode,
3662 decode: decode,
3663 ValidationError: ValidationError,
3664};
3665
3666},{"./base32":9,"./convertBits":11,"./validation":12,"big-integer":3}],11:[function(require,module,exports){
3667// Copyright (c) 2017-2018 Emilio Almansi
3668// Copyright (c) 2017 Pieter Wuille
3669//
3670// Permission is hereby granted, free of charge, to any person obtaining a copy
3671// of this software and associated documentation files (the "Software"), to deal
3672// in the Software without restriction, including without limitation the rights
3673// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3674// copies of the Software, and to permit persons to whom the Software is
3675// furnished to do so, subject to the following conditions:
3676//
3677// The above copyright notice and this permission notice shall be included in
3678// all copies or substantial portions of the Software.
3679//
3680// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3681// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3682// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3683// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3684// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3685// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
3686// THE SOFTWARE.
3687
3688'use strict';
3689
3690var validate = require('./validation').validate;
3691
3692/**
3693 * Converts an array of integers made up of 'from' bits into an
3694 * array of integers made up of 'to' bits. The output array is
3695 * zero-padded if necessary, unless strict mode is true.
3696 * Throws a {@link ValidationError} if input is invalid.
3697 * Original by Pieter Wuille: https://github.com/sipa/bech32.
3698 *
3699 * @param {Uint8Array} data Array of integers made up of 'from' bits.
3700 * @param {number} from Length in bits of elements in the input array.
3701 * @param {number} to Length in bits of elements in the output array.
3702 * @param {bool} strictMode Require the conversion to be completed without padding.
3703 * @returns {Uint8Array}
3704 */
3705module.exports = function(data, from, to, strictMode) {
3706 var length = strictMode
3707 ? Math.floor(data.length * from / to)
3708 : Math.ceil(data.length * from / to);
3709 var mask = (1 << to) - 1;
3710 var result = new Uint8Array(length);
3711 var index = 0;
3712 var accumulator = 0;
3713 var bits = 0;
3714 for (var i = 0; i < data.length; ++i) {
3715 var value = data[i];
3716 validate(0 <= value && (value >> from) === 0, 'Invalid value: ' + value + '.');
3717 accumulator = (accumulator << from) | value;
3718 bits += from;
3719 while (bits >= to) {
3720 bits -= to;
3721 result[index] = (accumulator >> bits) & mask;
3722 ++index;
3723 }
3724 }
3725 if (!strictMode) {
3726 if (bits > 0) {
3727 result[index] = (accumulator << (to - bits)) & mask;
3728 ++index;
3729 }
3730 } else {
3731 validate(
3732 bits < from && ((accumulator << (to - bits)) & mask) === 0,
3733 'Input cannot be converted to ' + to + ' bits without padding, but strict mode was used.'
3734 );
3735 }
3736 return result;
3737};
3738
3739},{"./validation":12}],12:[function(require,module,exports){
3740/**
3741 * @license
3742 * https://github.com/bitcoincashjs/cashaddr
3743 * Copyright (c) 2017-2018 Emilio Almansi
3744 * Distributed under the MIT software license, see the accompanying
3745 * file LICENSE or http://www.opensource.org/licenses/mit-license.php.
3746 */
3747
3748'use strict';
3749
3750/**
3751 * Validation utility.
3752 *
3753 * @module validation
3754 */
3755
3756/**
3757 * Error thrown when encoding or decoding fail due to invalid input.
3758 *
3759 * @constructor ValidationError
3760 * @param {string} message Error description.
3761 */
3762function ValidationError(message) {
3763 var error = new Error();
3764 this.name = error.name = 'ValidationError';
3765 this.message = error.message = message;
3766 this.stack = error.stack;
3767}
3768
3769ValidationError.prototype = Object.create(Error.prototype);
3770
3771/**
3772 * Validates a given condition, throwing a {@link ValidationError} if
3773 * the given condition does not hold.
3774 *
3775 * @static
3776 * @param {boolean} condition Condition to validate.
3777 * @param {string} message Error message in case the condition does not hold.
3778 */
3779function validate(condition, message) {
3780 if (!condition) {
3781 throw new ValidationError(message);
3782 }
3783}
3784
3785module.exports = {
3786 ValidationError: ValidationError,
3787 validate: validate,
3788};
3789
3790},{}],13:[function(require,module,exports){
3791var Buffer = require('safe-buffer').Buffer
3792var Transform = require('stream').Transform
3793var StringDecoder = require('string_decoder').StringDecoder
3794var inherits = require('inherits')
3795
3796function CipherBase (hashMode) {
3797 Transform.call(this)
3798 this.hashMode = typeof hashMode === 'string'
3799 if (this.hashMode) {
3800 this[hashMode] = this._finalOrDigest
3801 } else {
3802 this.final = this._finalOrDigest
3803 }
3804 if (this._final) {
3805 this.__final = this._final
3806 this._final = null
3807 }
3808 this._decoder = null
3809 this._encoding = null
3810}
3811inherits(CipherBase, Transform)
3812
3813CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
3814 if (typeof data === 'string') {
3815 data = Buffer.from(data, inputEnc)
3816 }
3817
3818 var outData = this._update(data)
3819 if (this.hashMode) return this
3820
3821 if (outputEnc) {
3822 outData = this._toString(outData, outputEnc)
3823 }
3824
3825 return outData
3826}
3827
3828CipherBase.prototype.setAutoPadding = function () {}
3829CipherBase.prototype.getAuthTag = function () {
3830 throw new Error('trying to get auth tag in unsupported state')
3831}
3832
3833CipherBase.prototype.setAuthTag = function () {
3834 throw new Error('trying to set auth tag in unsupported state')
3835}
3836
3837CipherBase.prototype.setAAD = function () {
3838 throw new Error('trying to set aad in unsupported state')
3839}
3840
3841CipherBase.prototype._transform = function (data, _, next) {
3842 var err
3843 try {
3844 if (this.hashMode) {
3845 this._update(data)
3846 } else {
3847 this.push(this._update(data))
3848 }
3849 } catch (e) {
3850 err = e
3851 } finally {
3852 next(err)
3853 }
3854}
3855CipherBase.prototype._flush = function (done) {
3856 var err
3857 try {
3858 this.push(this.__final())
3859 } catch (e) {
3860 err = e
3861 }
3862
3863 done(err)
3864}
3865CipherBase.prototype._finalOrDigest = function (outputEnc) {
3866 var outData = this.__final() || Buffer.alloc(0)
3867 if (outputEnc) {
3868 outData = this._toString(outData, outputEnc, true)
3869 }
3870 return outData
3871}
3872
3873CipherBase.prototype._toString = function (value, enc, fin) {
3874 if (!this._decoder) {
3875 this._decoder = new StringDecoder(enc)
3876 this._encoding = enc
3877 }
3878
3879 if (this._encoding !== enc) throw new Error('can\'t switch encodings')
3880
3881 var out = this._decoder.write(value)
3882 if (fin) {
3883 out += this._decoder.end()
3884 }
3885
3886 return out
3887}
3888
3889module.exports = CipherBase
3890
3891},{"inherits":21,"safe-buffer":40,"stream":49,"string_decoder":50}],14:[function(require,module,exports){
3892(function (Buffer){
3893// Copyright Joyent, Inc. and other Node contributors.
3894//
3895// Permission is hereby granted, free of charge, to any person obtaining a
3896// copy of this software and associated documentation files (the
3897// "Software"), to deal in the Software without restriction, including
3898// without limitation the rights to use, copy, modify, merge, publish,
3899// distribute, sublicense, and/or sell copies of the Software, and to permit
3900// persons to whom the Software is furnished to do so, subject to the
3901// following conditions:
3902//
3903// The above copyright notice and this permission notice shall be included
3904// in all copies or substantial portions of the Software.
3905//
3906// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3907// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3908// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
3909// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
3910// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
3911// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
3912// USE OR OTHER DEALINGS IN THE SOFTWARE.
3913
3914// NOTE: These type checking functions intentionally don't use `instanceof`
3915// because it is fragile and can be easily faked with `Object.create()`.
3916
3917function isArray(arg) {
3918 if (Array.isArray) {
3919 return Array.isArray(arg);
3920 }
3921 return objectToString(arg) === '[object Array]';
3922}
3923exports.isArray = isArray;
3924
3925function isBoolean(arg) {
3926 return typeof arg === 'boolean';
3927}
3928exports.isBoolean = isBoolean;
3929
3930function isNull(arg) {
3931 return arg === null;
3932}
3933exports.isNull = isNull;
3934
3935function isNullOrUndefined(arg) {
3936 return arg == null;
3937}
3938exports.isNullOrUndefined = isNullOrUndefined;
3939
3940function isNumber(arg) {
3941 return typeof arg === 'number';
3942}
3943exports.isNumber = isNumber;
3944
3945function isString(arg) {
3946 return typeof arg === 'string';
3947}
3948exports.isString = isString;
3949
3950function isSymbol(arg) {
3951 return typeof arg === 'symbol';
3952}
3953exports.isSymbol = isSymbol;
3954
3955function isUndefined(arg) {
3956 return arg === void 0;
3957}
3958exports.isUndefined = isUndefined;
3959
3960function isRegExp(re) {
3961 return objectToString(re) === '[object RegExp]';
3962}
3963exports.isRegExp = isRegExp;
3964
3965function isObject(arg) {
3966 return typeof arg === 'object' && arg !== null;
3967}
3968exports.isObject = isObject;
3969
3970function isDate(d) {
3971 return objectToString(d) === '[object Date]';
3972}
3973exports.isDate = isDate;
3974
3975function isError(e) {
3976 return (objectToString(e) === '[object Error]' || e instanceof Error);
3977}
3978exports.isError = isError;
3979
3980function isFunction(arg) {
3981 return typeof arg === 'function';
3982}
3983exports.isFunction = isFunction;
3984
3985function isPrimitive(arg) {
3986 return arg === null ||
3987 typeof arg === 'boolean' ||
3988 typeof arg === 'number' ||
3989 typeof arg === 'string' ||
3990 typeof arg === 'symbol' || // ES6 symbol
3991 typeof arg === 'undefined';
3992}
3993exports.isPrimitive = isPrimitive;
3994
3995exports.isBuffer = Buffer.isBuffer;
3996
3997function objectToString(o) {
3998 return Object.prototype.toString.call(o);
3999}
4000
4001}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
4002},{"../../is-buffer/index.js":22}],15:[function(require,module,exports){
4003(function (Buffer){
4004'use strict'
4005var inherits = require('inherits')
4006var md5 = require('./md5')
4007var RIPEMD160 = require('ripemd160')
4008var sha = require('sha.js')
4009
4010var Base = require('cipher-base')
4011
4012function HashNoConstructor (hash) {
4013 Base.call(this, 'digest')
4014
4015 this._hash = hash
4016 this.buffers = []
4017}
4018
4019inherits(HashNoConstructor, Base)
4020
4021HashNoConstructor.prototype._update = function (data) {
4022 this.buffers.push(data)
4023}
4024
4025HashNoConstructor.prototype._final = function () {
4026 var buf = Buffer.concat(this.buffers)
4027 var r = this._hash(buf)
4028 this.buffers = null
4029
4030 return r
4031}
4032
4033function Hash (hash) {
4034 Base.call(this, 'digest')
4035
4036 this._hash = hash
4037}
4038
4039inherits(Hash, Base)
4040
4041Hash.prototype._update = function (data) {
4042 this._hash.update(data)
4043}
4044
4045Hash.prototype._final = function () {
4046 return this._hash.digest()
4047}
4048
4049module.exports = function createHash (alg) {
4050 alg = alg.toLowerCase()
4051 if (alg === 'md5') return new HashNoConstructor(md5)
4052 if (alg === 'rmd160' || alg === 'ripemd160') return new Hash(new RIPEMD160())
4053
4054 return new Hash(sha(alg))
4055}
4056
4057}).call(this,require("buffer").Buffer)
4058},{"./md5":17,"buffer":8,"cipher-base":13,"inherits":21,"ripemd160":39,"sha.js":42}],16:[function(require,module,exports){
4059(function (Buffer){
4060'use strict'
4061var intSize = 4
4062var zeroBuffer = new Buffer(intSize)
4063zeroBuffer.fill(0)
4064
4065var charSize = 8
4066var hashSize = 16
4067
4068function toArray (buf) {
4069 if ((buf.length % intSize) !== 0) {
4070 var len = buf.length + (intSize - (buf.length % intSize))
4071 buf = Buffer.concat([buf, zeroBuffer], len)
4072 }
4073
4074 var arr = new Array(buf.length >>> 2)
4075 for (var i = 0, j = 0; i < buf.length; i += intSize, j++) {
4076 arr[j] = buf.readInt32LE(i)
4077 }
4078
4079 return arr
4080}
4081
4082module.exports = function hash (buf, fn) {
4083 var arr = fn(toArray(buf), buf.length * charSize)
4084 buf = new Buffer(hashSize)
4085 for (var i = 0; i < arr.length; i++) {
4086 buf.writeInt32LE(arr[i], i << 2, true)
4087 }
4088 return buf
4089}
4090
4091}).call(this,require("buffer").Buffer)
4092},{"buffer":8}],17:[function(require,module,exports){
4093'use strict'
4094/*
4095 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
4096 * Digest Algorithm, as defined in RFC 1321.
4097 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
4098 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
4099 * Distributed under the BSD License
4100 * See http://pajhome.org.uk/crypt/md5 for more info.
4101 */
4102
4103var makeHash = require('./make-hash')
4104
4105/*
4106 * Calculate the MD5 of an array of little-endian words, and a bit length
4107 */
4108function core_md5 (x, len) {
4109 /* append padding */
4110 x[len >> 5] |= 0x80 << ((len) % 32)
4111 x[(((len + 64) >>> 9) << 4) + 14] = len
4112
4113 var a = 1732584193
4114 var b = -271733879
4115 var c = -1732584194
4116 var d = 271733878
4117
4118 for (var i = 0; i < x.length; i += 16) {
4119 var olda = a
4120 var oldb = b
4121 var oldc = c
4122 var oldd = d
4123
4124 a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936)
4125 d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586)
4126 c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819)
4127 b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330)
4128 a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897)
4129 d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426)
4130 c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341)
4131 b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983)
4132 a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416)
4133 d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417)
4134 c = md5_ff(c, d, a, b, x[i + 10], 17, -42063)
4135 b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162)
4136 a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682)
4137 d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101)
4138 c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290)
4139 b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329)
4140
4141 a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510)
4142 d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632)
4143 c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713)
4144 b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302)
4145 a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691)
4146 d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083)
4147 c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335)
4148 b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848)
4149 a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438)
4150 d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690)
4151 c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961)
4152 b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501)
4153 a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467)
4154 d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784)
4155 c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473)
4156 b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734)
4157
4158 a = md5_hh(a, b, c, d, x[i + 5], 4, -378558)
4159 d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463)
4160 c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562)
4161 b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556)
4162 a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060)
4163 d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353)
4164 c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632)
4165 b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640)
4166 a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174)
4167 d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222)
4168 c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979)
4169 b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189)
4170 a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487)
4171 d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835)
4172 c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520)
4173 b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651)
4174
4175 a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844)
4176 d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415)
4177 c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905)
4178 b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055)
4179 a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571)
4180 d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606)
4181 c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523)
4182 b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799)
4183 a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359)
4184 d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744)
4185 c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380)
4186 b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649)
4187 a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070)
4188 d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379)
4189 c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259)
4190 b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551)
4191
4192 a = safe_add(a, olda)
4193 b = safe_add(b, oldb)
4194 c = safe_add(c, oldc)
4195 d = safe_add(d, oldd)
4196 }
4197
4198 return [a, b, c, d]
4199}
4200
4201/*
4202 * These functions implement the four basic operations the algorithm uses.
4203 */
4204function md5_cmn (q, a, b, x, s, t) {
4205 return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
4206}
4207
4208function md5_ff (a, b, c, d, x, s, t) {
4209 return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t)
4210}
4211
4212function md5_gg (a, b, c, d, x, s, t) {
4213 return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t)
4214}
4215
4216function md5_hh (a, b, c, d, x, s, t) {
4217 return md5_cmn(b ^ c ^ d, a, b, x, s, t)
4218}
4219
4220function md5_ii (a, b, c, d, x, s, t) {
4221 return md5_cmn(c ^ (b | (~d)), a, b, x, s, t)
4222}
4223
4224/*
4225 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
4226 * to work around bugs in some JS interpreters.
4227 */
4228function safe_add (x, y) {
4229 var lsw = (x & 0xFFFF) + (y & 0xFFFF)
4230 var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
4231 return (msw << 16) | (lsw & 0xFFFF)
4232}
4233
4234/*
4235 * Bitwise rotate a 32-bit number to the left.
4236 */
4237function bit_rol (num, cnt) {
4238 return (num << cnt) | (num >>> (32 - cnt))
4239}
4240
4241module.exports = function md5 (buf) {
4242 return makeHash(buf, core_md5)
4243}
4244
4245},{"./make-hash":16}],18:[function(require,module,exports){
4246// Copyright Joyent, Inc. and other Node contributors.
4247//
4248// Permission is hereby granted, free of charge, to any person obtaining a
4249// copy of this software and associated documentation files (the
4250// "Software"), to deal in the Software without restriction, including
4251// without limitation the rights to use, copy, modify, merge, publish,
4252// distribute, sublicense, and/or sell copies of the Software, and to permit
4253// persons to whom the Software is furnished to do so, subject to the
4254// following conditions:
4255//
4256// The above copyright notice and this permission notice shall be included
4257// in all copies or substantial portions of the Software.
4258//
4259// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
4260// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4261// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
4262// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
4263// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
4264// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
4265// USE OR OTHER DEALINGS IN THE SOFTWARE.
4266
4267function EventEmitter() {
4268 this._events = this._events || {};
4269 this._maxListeners = this._maxListeners || undefined;
4270}
4271module.exports = EventEmitter;
4272
4273// Backwards-compat with node 0.10.x
4274EventEmitter.EventEmitter = EventEmitter;
4275
4276EventEmitter.prototype._events = undefined;
4277EventEmitter.prototype._maxListeners = undefined;
4278
4279// By default EventEmitters will print a warning if more than 10 listeners are
4280// added to it. This is a useful default which helps finding memory leaks.
4281EventEmitter.defaultMaxListeners = 10;
4282
4283// Obviously not all Emitters should be limited to 10. This function allows
4284// that to be increased. Set to zero for unlimited.
4285EventEmitter.prototype.setMaxListeners = function(n) {
4286 if (!isNumber(n) || n < 0 || isNaN(n))
4287 throw TypeError('n must be a positive number');
4288 this._maxListeners = n;
4289 return this;
4290};
4291
4292EventEmitter.prototype.emit = function(type) {
4293 var er, handler, len, args, i, listeners;
4294
4295 if (!this._events)
4296 this._events = {};
4297
4298 // If there is no 'error' event listener then throw.
4299 if (type === 'error') {
4300 if (!this._events.error ||
4301 (isObject(this._events.error) && !this._events.error.length)) {
4302 er = arguments[1];
4303 if (er instanceof Error) {
4304 throw er; // Unhandled 'error' event
4305 } else {
4306 // At least give some kind of context to the user
4307 var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
4308 err.context = er;
4309 throw err;
4310 }
4311 }
4312 }
4313
4314 handler = this._events[type];
4315
4316 if (isUndefined(handler))
4317 return false;
4318
4319 if (isFunction(handler)) {
4320 switch (arguments.length) {
4321 // fast cases
4322 case 1:
4323 handler.call(this);
4324 break;
4325 case 2:
4326 handler.call(this, arguments[1]);
4327 break;
4328 case 3:
4329 handler.call(this, arguments[1], arguments[2]);
4330 break;
4331 // slower
4332 default:
4333 args = Array.prototype.slice.call(arguments, 1);
4334 handler.apply(this, args);
4335 }
4336 } else if (isObject(handler)) {
4337 args = Array.prototype.slice.call(arguments, 1);
4338 listeners = handler.slice();
4339 len = listeners.length;
4340 for (i = 0; i < len; i++)
4341 listeners[i].apply(this, args);
4342 }
4343
4344 return true;
4345};
4346
4347EventEmitter.prototype.addListener = function(type, listener) {
4348 var m;
4349
4350 if (!isFunction(listener))
4351 throw TypeError('listener must be a function');
4352
4353 if (!this._events)
4354 this._events = {};
4355
4356 // To avoid recursion in the case that type === "newListener"! Before
4357 // adding it to the listeners, first emit "newListener".
4358 if (this._events.newListener)
4359 this.emit('newListener', type,
4360 isFunction(listener.listener) ?
4361 listener.listener : listener);
4362
4363 if (!this._events[type])
4364 // Optimize the case of one listener. Don't need the extra array object.
4365 this._events[type] = listener;
4366 else if (isObject(this._events[type]))
4367 // If we've already got an array, just append.
4368 this._events[type].push(listener);
4369 else
4370 // Adding the second element, need to change to array.
4371 this._events[type] = [this._events[type], listener];
4372
4373 // Check for listener leak
4374 if (isObject(this._events[type]) && !this._events[type].warned) {
4375 if (!isUndefined(this._maxListeners)) {
4376 m = this._maxListeners;
4377 } else {
4378 m = EventEmitter.defaultMaxListeners;
4379 }
4380
4381 if (m && m > 0 && this._events[type].length > m) {
4382 this._events[type].warned = true;
4383 console.error('(node) warning: possible EventEmitter memory ' +
4384 'leak detected. %d listeners added. ' +
4385 'Use emitter.setMaxListeners() to increase limit.',
4386 this._events[type].length);
4387 if (typeof console.trace === 'function') {
4388 // not supported in IE 10
4389 console.trace();
4390 }
4391 }
4392 }
4393
4394 return this;
4395};
4396
4397EventEmitter.prototype.on = EventEmitter.prototype.addListener;
4398
4399EventEmitter.prototype.once = function(type, listener) {
4400 if (!isFunction(listener))
4401 throw TypeError('listener must be a function');
4402
4403 var fired = false;
4404
4405 function g() {
4406 this.removeListener(type, g);
4407
4408 if (!fired) {
4409 fired = true;
4410 listener.apply(this, arguments);
4411 }
4412 }
4413
4414 g.listener = listener;
4415 this.on(type, g);
4416
4417 return this;
4418};
4419
4420// emits a 'removeListener' event iff the listener was removed
4421EventEmitter.prototype.removeListener = function(type, listener) {
4422 var list, position, length, i;
4423
4424 if (!isFunction(listener))
4425 throw TypeError('listener must be a function');
4426
4427 if (!this._events || !this._events[type])
4428 return this;
4429
4430 list = this._events[type];
4431 length = list.length;
4432 position = -1;
4433
4434 if (list === listener ||
4435 (isFunction(list.listener) && list.listener === listener)) {
4436 delete this._events[type];
4437 if (this._events.removeListener)
4438 this.emit('removeListener', type, listener);
4439
4440 } else if (isObject(list)) {
4441 for (i = length; i-- > 0;) {
4442 if (list[i] === listener ||
4443 (list[i].listener && list[i].listener === listener)) {
4444 position = i;
4445 break;
4446 }
4447 }
4448
4449 if (position < 0)
4450 return this;
4451
4452 if (list.length === 1) {
4453 list.length = 0;
4454 delete this._events[type];
4455 } else {
4456 list.splice(position, 1);
4457 }
4458
4459 if (this._events.removeListener)
4460 this.emit('removeListener', type, listener);
4461 }
4462
4463 return this;
4464};
4465
4466EventEmitter.prototype.removeAllListeners = function(type) {
4467 var key, listeners;
4468
4469 if (!this._events)
4470 return this;
4471
4472 // not listening for removeListener, no need to emit
4473 if (!this._events.removeListener) {
4474 if (arguments.length === 0)
4475 this._events = {};
4476 else if (this._events[type])
4477 delete this._events[type];
4478 return this;
4479 }
4480
4481 // emit removeListener for all listeners on all events
4482 if (arguments.length === 0) {
4483 for (key in this._events) {
4484 if (key === 'removeListener') continue;
4485 this.removeAllListeners(key);
4486 }
4487 this.removeAllListeners('removeListener');
4488 this._events = {};
4489 return this;
4490 }
4491
4492 listeners = this._events[type];
4493
4494 if (isFunction(listeners)) {
4495 this.removeListener(type, listeners);
4496 } else if (listeners) {
4497 // LIFO order
4498 while (listeners.length)
4499 this.removeListener(type, listeners[listeners.length - 1]);
4500 }
4501 delete this._events[type];
4502
4503 return this;
4504};
4505
4506EventEmitter.prototype.listeners = function(type) {
4507 var ret;
4508 if (!this._events || !this._events[type])
4509 ret = [];
4510 else if (isFunction(this._events[type]))
4511 ret = [this._events[type]];
4512 else
4513 ret = this._events[type].slice();
4514 return ret;
4515};
4516
4517EventEmitter.prototype.listenerCount = function(type) {
4518 if (this._events) {
4519 var evlistener = this._events[type];
4520
4521 if (isFunction(evlistener))
4522 return 1;
4523 else if (evlistener)
4524 return evlistener.length;
4525 }
4526 return 0;
4527};
4528
4529EventEmitter.listenerCount = function(emitter, type) {
4530 return emitter.listenerCount(type);
4531};
4532
4533function isFunction(arg) {
4534 return typeof arg === 'function';
4535}
4536
4537function isNumber(arg) {
4538 return typeof arg === 'number';
4539}
4540
4541function isObject(arg) {
4542 return typeof arg === 'object' && arg !== null;
4543}
4544
4545function isUndefined(arg) {
4546 return arg === void 0;
4547}
4548
4549},{}],19:[function(require,module,exports){
4550(function (Buffer){
4551'use strict'
4552var Transform = require('stream').Transform
4553var inherits = require('inherits')
4554
4555function HashBase (blockSize) {
4556 Transform.call(this)
4557
4558 this._block = new Buffer(blockSize)
4559 this._blockSize = blockSize
4560 this._blockOffset = 0
4561 this._length = [0, 0, 0, 0]
4562
4563 this._finalized = false
4564}
4565
4566inherits(HashBase, Transform)
4567
4568HashBase.prototype._transform = function (chunk, encoding, callback) {
4569 var error = null
4570 try {
4571 if (encoding !== 'buffer') chunk = new Buffer(chunk, encoding)
4572 this.update(chunk)
4573 } catch (err) {
4574 error = err
4575 }
4576
4577 callback(error)
4578}
4579
4580HashBase.prototype._flush = function (callback) {
4581 var error = null
4582 try {
4583 this.push(this._digest())
4584 } catch (err) {
4585 error = err
4586 }
4587
4588 callback(error)
4589}
4590
4591HashBase.prototype.update = function (data, encoding) {
4592 if (!Buffer.isBuffer(data) && typeof data !== 'string') throw new TypeError('Data must be a string or a buffer')
4593 if (this._finalized) throw new Error('Digest already called')
4594 if (!Buffer.isBuffer(data)) data = new Buffer(data, encoding || 'binary')
4595
4596 // consume data
4597 var block = this._block
4598 var offset = 0
4599 while (this._blockOffset + data.length - offset >= this._blockSize) {
4600 for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]
4601 this._update()
4602 this._blockOffset = 0
4603 }
4604 while (offset < data.length) block[this._blockOffset++] = data[offset++]
4605
4606 // update length
4607 for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
4608 this._length[j] += carry
4609 carry = (this._length[j] / 0x0100000000) | 0
4610 if (carry > 0) this._length[j] -= 0x0100000000 * carry
4611 }
4612
4613 return this
4614}
4615
4616HashBase.prototype._update = function (data) {
4617 throw new Error('_update is not implemented')
4618}
4619
4620HashBase.prototype.digest = function (encoding) {
4621 if (this._finalized) throw new Error('Digest already called')
4622 this._finalized = true
4623
4624 var digest = this._digest()
4625 if (encoding !== undefined) digest = digest.toString(encoding)
4626 return digest
4627}
4628
4629HashBase.prototype._digest = function () {
4630 throw new Error('_digest is not implemented')
4631}
4632
4633module.exports = HashBase
4634
4635}).call(this,require("buffer").Buffer)
4636},{"buffer":8,"inherits":21,"stream":49}],20:[function(require,module,exports){
4637exports.read = function (buffer, offset, isLE, mLen, nBytes) {
4638 var e, m
4639 var eLen = nBytes * 8 - mLen - 1
4640 var eMax = (1 << eLen) - 1
4641 var eBias = eMax >> 1
4642 var nBits = -7
4643 var i = isLE ? (nBytes - 1) : 0
4644 var d = isLE ? -1 : 1
4645 var s = buffer[offset + i]
4646
4647 i += d
4648
4649 e = s & ((1 << (-nBits)) - 1)
4650 s >>= (-nBits)
4651 nBits += eLen
4652 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
4653
4654 m = e & ((1 << (-nBits)) - 1)
4655 e >>= (-nBits)
4656 nBits += mLen
4657 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
4658
4659 if (e === 0) {
4660 e = 1 - eBias
4661 } else if (e === eMax) {
4662 return m ? NaN : ((s ? -1 : 1) * Infinity)
4663 } else {
4664 m = m + Math.pow(2, mLen)
4665 e = e - eBias
4666 }
4667 return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
4668}
4669
4670exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
4671 var e, m, c
4672 var eLen = nBytes * 8 - mLen - 1
4673 var eMax = (1 << eLen) - 1
4674 var eBias = eMax >> 1
4675 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
4676 var i = isLE ? 0 : (nBytes - 1)
4677 var d = isLE ? 1 : -1
4678 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
4679
4680 value = Math.abs(value)
4681
4682 if (isNaN(value) || value === Infinity) {
4683 m = isNaN(value) ? 1 : 0
4684 e = eMax
4685 } else {
4686 e = Math.floor(Math.log(value) / Math.LN2)
4687 if (value * (c = Math.pow(2, -e)) < 1) {
4688 e--
4689 c *= 2
4690 }
4691 if (e + eBias >= 1) {
4692 value += rt / c
4693 } else {
4694 value += rt * Math.pow(2, 1 - eBias)
4695 }
4696 if (value * c >= 2) {
4697 e++
4698 c /= 2
4699 }
4700
4701 if (e + eBias >= eMax) {
4702 m = 0
4703 e = eMax
4704 } else if (e + eBias >= 1) {
4705 m = (value * c - 1) * Math.pow(2, mLen)
4706 e = e + eBias
4707 } else {
4708 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
4709 e = 0
4710 }
4711 }
4712
4713 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
4714
4715 e = (e << mLen) | m
4716 eLen += mLen
4717 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
4718
4719 buffer[offset + i - d] |= s * 128
4720}
4721
4722},{}],21:[function(require,module,exports){
4723if (typeof Object.create === 'function') {
4724 // implementation from standard node.js 'util' module
4725 module.exports = function inherits(ctor, superCtor) {
4726 ctor.super_ = superCtor
4727 ctor.prototype = Object.create(superCtor.prototype, {
4728 constructor: {
4729 value: ctor,
4730 enumerable: false,
4731 writable: true,
4732 configurable: true
4733 }
4734 });
4735 };
4736} else {
4737 // old school shim for old browsers
4738 module.exports = function inherits(ctor, superCtor) {
4739 ctor.super_ = superCtor
4740 var TempCtor = function () {}
4741 TempCtor.prototype = superCtor.prototype
4742 ctor.prototype = new TempCtor()
4743 ctor.prototype.constructor = ctor
4744 }
4745}
4746
4747},{}],22:[function(require,module,exports){
4748/*!
4749 * Determine if an object is a Buffer
4750 *
4751 * @author Feross Aboukhadijeh <https://feross.org>
4752 * @license MIT
4753 */
4754
4755// The _isBuffer check is for Safari 5-7 support, because it's missing
4756// Object.prototype.constructor. Remove this eventually
4757module.exports = function (obj) {
4758 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
4759}
4760
4761function isBuffer (obj) {
4762 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
4763}
4764
4765// For Node v0.10 support. Remove this eventually.
4766function isSlowBuffer (obj) {
4767 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
4768}
4769
4770},{}],23:[function(require,module,exports){
4771var toString = {}.toString;
4772
4773module.exports = Array.isArray || function (arr) {
4774 return toString.call(arr) == '[object Array]';
4775};
4776
4777},{}],24:[function(require,module,exports){
4778(function (process){
4779'use strict';
4780
4781if (!process.version ||
4782 process.version.indexOf('v0.') === 0 ||
4783 process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
4784 module.exports = nextTick;
4785} else {
4786 module.exports = process.nextTick;
4787}
4788
4789function nextTick(fn, arg1, arg2, arg3) {
4790 if (typeof fn !== 'function') {
4791 throw new TypeError('"callback" argument must be a function');
4792 }
4793 var len = arguments.length;
4794 var args, i;
4795 switch (len) {
4796 case 0:
4797 case 1:
4798 return process.nextTick(fn);
4799 case 2:
4800 return process.nextTick(function afterTickOne() {
4801 fn.call(null, arg1);
4802 });
4803 case 3:
4804 return process.nextTick(function afterTickTwo() {
4805 fn.call(null, arg1, arg2);
4806 });
4807 case 4:
4808 return process.nextTick(function afterTickThree() {
4809 fn.call(null, arg1, arg2, arg3);
4810 });
4811 default:
4812 args = new Array(len - 1);
4813 i = 0;
4814 while (i < args.length) {
4815 args[i++] = arguments[i];
4816 }
4817 return process.nextTick(function afterTick() {
4818 fn.apply(null, args);
4819 });
4820 }
4821}
4822
4823}).call(this,require('_process'))
4824},{"_process":25}],25:[function(require,module,exports){
4825// shim for using process in browser
4826var process = module.exports = {};
4827
4828// cached from whatever global is present so that test runners that stub it
4829// don't break things. But we need to wrap it in a try catch in case it is
4830// wrapped in strict mode code which doesn't define any globals. It's inside a
4831// function because try/catches deoptimize in certain engines.
4832
4833var cachedSetTimeout;
4834var cachedClearTimeout;
4835
4836function defaultSetTimout() {
4837 throw new Error('setTimeout has not been defined');
4838}
4839function defaultClearTimeout () {
4840 throw new Error('clearTimeout has not been defined');
4841}
4842(function () {
4843 try {
4844 if (typeof setTimeout === 'function') {
4845 cachedSetTimeout = setTimeout;
4846 } else {
4847 cachedSetTimeout = defaultSetTimout;
4848 }
4849 } catch (e) {
4850 cachedSetTimeout = defaultSetTimout;
4851 }
4852 try {
4853 if (typeof clearTimeout === 'function') {
4854 cachedClearTimeout = clearTimeout;
4855 } else {
4856 cachedClearTimeout = defaultClearTimeout;
4857 }
4858 } catch (e) {
4859 cachedClearTimeout = defaultClearTimeout;
4860 }
4861} ())
4862function runTimeout(fun) {
4863 if (cachedSetTimeout === setTimeout) {
4864 //normal enviroments in sane situations
4865 return setTimeout(fun, 0);
4866 }
4867 // if setTimeout wasn't available but was latter defined
4868 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
4869 cachedSetTimeout = setTimeout;
4870 return setTimeout(fun, 0);
4871 }
4872 try {
4873 // when when somebody has screwed with setTimeout but no I.E. maddness
4874 return cachedSetTimeout(fun, 0);
4875 } catch(e){
4876 try {
4877 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
4878 return cachedSetTimeout.call(null, fun, 0);
4879 } catch(e){
4880 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
4881 return cachedSetTimeout.call(this, fun, 0);
4882 }
4883 }
4884
4885
4886}
4887function runClearTimeout(marker) {
4888 if (cachedClearTimeout === clearTimeout) {
4889 //normal enviroments in sane situations
4890 return clearTimeout(marker);
4891 }
4892 // if clearTimeout wasn't available but was latter defined
4893 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
4894 cachedClearTimeout = clearTimeout;
4895 return clearTimeout(marker);
4896 }
4897 try {
4898 // when when somebody has screwed with setTimeout but no I.E. maddness
4899 return cachedClearTimeout(marker);
4900 } catch (e){
4901 try {
4902 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
4903 return cachedClearTimeout.call(null, marker);
4904 } catch (e){
4905 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
4906 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
4907 return cachedClearTimeout.call(this, marker);
4908 }
4909 }
4910
4911
4912
4913}
4914var queue = [];
4915var draining = false;
4916var currentQueue;
4917var queueIndex = -1;
4918
4919function cleanUpNextTick() {
4920 if (!draining || !currentQueue) {
4921 return;
4922 }
4923 draining = false;
4924 if (currentQueue.length) {
4925 queue = currentQueue.concat(queue);
4926 } else {
4927 queueIndex = -1;
4928 }
4929 if (queue.length) {
4930 drainQueue();
4931 }
4932}
4933
4934function drainQueue() {
4935 if (draining) {
4936 return;
4937 }
4938 var timeout = runTimeout(cleanUpNextTick);
4939 draining = true;
4940
4941 var len = queue.length;
4942 while(len) {
4943 currentQueue = queue;
4944 queue = [];
4945 while (++queueIndex < len) {
4946 if (currentQueue) {
4947 currentQueue[queueIndex].run();
4948 }
4949 }
4950 queueIndex = -1;
4951 len = queue.length;
4952 }
4953 currentQueue = null;
4954 draining = false;
4955 runClearTimeout(timeout);
4956}
4957
4958process.nextTick = function (fun) {
4959 var args = new Array(arguments.length - 1);
4960 if (arguments.length > 1) {
4961 for (var i = 1; i < arguments.length; i++) {
4962 args[i - 1] = arguments[i];
4963 }
4964 }
4965 queue.push(new Item(fun, args));
4966 if (queue.length === 1 && !draining) {
4967 runTimeout(drainQueue);
4968 }
4969};
4970
4971// v8 likes predictible objects
4972function Item(fun, array) {
4973 this.fun = fun;
4974 this.array = array;
4975}
4976Item.prototype.run = function () {
4977 this.fun.apply(null, this.array);
4978};
4979process.title = 'browser';
4980process.browser = true;
4981process.env = {};
4982process.argv = [];
4983process.version = ''; // empty string to avoid regexp issues
4984process.versions = {};
4985
4986function noop() {}
4987
4988process.on = noop;
4989process.addListener = noop;
4990process.once = noop;
4991process.off = noop;
4992process.removeListener = noop;
4993process.removeAllListeners = noop;
4994process.emit = noop;
4995process.prependListener = noop;
4996process.prependOnceListener = noop;
4997
4998process.listeners = function (name) { return [] }
4999
5000process.binding = function (name) {
5001 throw new Error('process.binding is not supported');
5002};
5003
5004process.cwd = function () { return '/' };
5005process.chdir = function (dir) {
5006 throw new Error('process.chdir is not supported');
5007};
5008process.umask = function() { return 0; };
5009
5010},{}],26:[function(require,module,exports){
5011module.exports = require('./lib/_stream_duplex.js');
5012
5013},{"./lib/_stream_duplex.js":27}],27:[function(require,module,exports){
5014// Copyright Joyent, Inc. and other Node contributors.
5015//
5016// Permission is hereby granted, free of charge, to any person obtaining a
5017// copy of this software and associated documentation files (the
5018// "Software"), to deal in the Software without restriction, including
5019// without limitation the rights to use, copy, modify, merge, publish,
5020// distribute, sublicense, and/or sell copies of the Software, and to permit
5021// persons to whom the Software is furnished to do so, subject to the
5022// following conditions:
5023//
5024// The above copyright notice and this permission notice shall be included
5025// in all copies or substantial portions of the Software.
5026//
5027// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5028// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5029// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5030// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5031// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5032// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5033// USE OR OTHER DEALINGS IN THE SOFTWARE.
5034
5035// a duplex stream is just a stream that is both readable and writable.
5036// Since JS doesn't have multiple prototypal inheritance, this class
5037// prototypally inherits from Readable, and then parasitically from
5038// Writable.
5039
5040'use strict';
5041
5042/*<replacement>*/
5043
5044var processNextTick = require('process-nextick-args');
5045/*</replacement>*/
5046
5047/*<replacement>*/
5048var objectKeys = Object.keys || function (obj) {
5049 var keys = [];
5050 for (var key in obj) {
5051 keys.push(key);
5052 }return keys;
5053};
5054/*</replacement>*/
5055
5056module.exports = Duplex;
5057
5058/*<replacement>*/
5059var util = require('core-util-is');
5060util.inherits = require('inherits');
5061/*</replacement>*/
5062
5063var Readable = require('./_stream_readable');
5064var Writable = require('./_stream_writable');
5065
5066util.inherits(Duplex, Readable);
5067
5068var keys = objectKeys(Writable.prototype);
5069for (var v = 0; v < keys.length; v++) {
5070 var method = keys[v];
5071 if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
5072}
5073
5074function Duplex(options) {
5075 if (!(this instanceof Duplex)) return new Duplex(options);
5076
5077 Readable.call(this, options);
5078 Writable.call(this, options);
5079
5080 if (options && options.readable === false) this.readable = false;
5081
5082 if (options && options.writable === false) this.writable = false;
5083
5084 this.allowHalfOpen = true;
5085 if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
5086
5087 this.once('end', onend);
5088}
5089
5090// the no-half-open enforcer
5091function onend() {
5092 // if we allow half-open state, or if the writable side ended,
5093 // then we're ok.
5094 if (this.allowHalfOpen || this._writableState.ended) return;
5095
5096 // no more data can be written.
5097 // But allow more writes to happen in this tick.
5098 processNextTick(onEndNT, this);
5099}
5100
5101function onEndNT(self) {
5102 self.end();
5103}
5104
5105Object.defineProperty(Duplex.prototype, 'destroyed', {
5106 get: function () {
5107 if (this._readableState === undefined || this._writableState === undefined) {
5108 return false;
5109 }
5110 return this._readableState.destroyed && this._writableState.destroyed;
5111 },
5112 set: function (value) {
5113 // we ignore the value if the stream
5114 // has not been initialized yet
5115 if (this._readableState === undefined || this._writableState === undefined) {
5116 return;
5117 }
5118
5119 // backward compatibility, the user is explicitly
5120 // managing destroyed
5121 this._readableState.destroyed = value;
5122 this._writableState.destroyed = value;
5123 }
5124});
5125
5126Duplex.prototype._destroy = function (err, cb) {
5127 this.push(null);
5128 this.end();
5129
5130 processNextTick(cb, err);
5131};
5132
5133function forEach(xs, f) {
5134 for (var i = 0, l = xs.length; i < l; i++) {
5135 f(xs[i], i);
5136 }
5137}
5138},{"./_stream_readable":29,"./_stream_writable":31,"core-util-is":14,"inherits":21,"process-nextick-args":24}],28:[function(require,module,exports){
5139// Copyright Joyent, Inc. and other Node contributors.
5140//
5141// Permission is hereby granted, free of charge, to any person obtaining a
5142// copy of this software and associated documentation files (the
5143// "Software"), to deal in the Software without restriction, including
5144// without limitation the rights to use, copy, modify, merge, publish,
5145// distribute, sublicense, and/or sell copies of the Software, and to permit
5146// persons to whom the Software is furnished to do so, subject to the
5147// following conditions:
5148//
5149// The above copyright notice and this permission notice shall be included
5150// in all copies or substantial portions of the Software.
5151//
5152// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5153// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5154// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5155// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5156// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5157// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5158// USE OR OTHER DEALINGS IN THE SOFTWARE.
5159
5160// a passthrough stream.
5161// basically just the most minimal sort of Transform stream.
5162// Every written chunk gets output as-is.
5163
5164'use strict';
5165
5166module.exports = PassThrough;
5167
5168var Transform = require('./_stream_transform');
5169
5170/*<replacement>*/
5171var util = require('core-util-is');
5172util.inherits = require('inherits');
5173/*</replacement>*/
5174
5175util.inherits(PassThrough, Transform);
5176
5177function PassThrough(options) {
5178 if (!(this instanceof PassThrough)) return new PassThrough(options);
5179
5180 Transform.call(this, options);
5181}
5182
5183PassThrough.prototype._transform = function (chunk, encoding, cb) {
5184 cb(null, chunk);
5185};
5186},{"./_stream_transform":30,"core-util-is":14,"inherits":21}],29:[function(require,module,exports){
5187(function (process,global){
5188// Copyright Joyent, Inc. and other Node contributors.
5189//
5190// Permission is hereby granted, free of charge, to any person obtaining a
5191// copy of this software and associated documentation files (the
5192// "Software"), to deal in the Software without restriction, including
5193// without limitation the rights to use, copy, modify, merge, publish,
5194// distribute, sublicense, and/or sell copies of the Software, and to permit
5195// persons to whom the Software is furnished to do so, subject to the
5196// following conditions:
5197//
5198// The above copyright notice and this permission notice shall be included
5199// in all copies or substantial portions of the Software.
5200//
5201// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5202// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5203// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5204// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5205// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5206// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5207// USE OR OTHER DEALINGS IN THE SOFTWARE.
5208
5209'use strict';
5210
5211/*<replacement>*/
5212
5213var processNextTick = require('process-nextick-args');
5214/*</replacement>*/
5215
5216module.exports = Readable;
5217
5218/*<replacement>*/
5219var isArray = require('isarray');
5220/*</replacement>*/
5221
5222/*<replacement>*/
5223var Duplex;
5224/*</replacement>*/
5225
5226Readable.ReadableState = ReadableState;
5227
5228/*<replacement>*/
5229var EE = require('events').EventEmitter;
5230
5231var EElistenerCount = function (emitter, type) {
5232 return emitter.listeners(type).length;
5233};
5234/*</replacement>*/
5235
5236/*<replacement>*/
5237var Stream = require('./internal/streams/stream');
5238/*</replacement>*/
5239
5240// TODO(bmeurer): Change this back to const once hole checks are
5241// properly optimized away early in Ignition+TurboFan.
5242/*<replacement>*/
5243var Buffer = require('safe-buffer').Buffer;
5244var OurUint8Array = global.Uint8Array || function () {};
5245function _uint8ArrayToBuffer(chunk) {
5246 return Buffer.from(chunk);
5247}
5248function _isUint8Array(obj) {
5249 return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
5250}
5251/*</replacement>*/
5252
5253/*<replacement>*/
5254var util = require('core-util-is');
5255util.inherits = require('inherits');
5256/*</replacement>*/
5257
5258/*<replacement>*/
5259var debugUtil = require('util');
5260var debug = void 0;
5261if (debugUtil && debugUtil.debuglog) {
5262 debug = debugUtil.debuglog('stream');
5263} else {
5264 debug = function () {};
5265}
5266/*</replacement>*/
5267
5268var BufferList = require('./internal/streams/BufferList');
5269var destroyImpl = require('./internal/streams/destroy');
5270var StringDecoder;
5271
5272util.inherits(Readable, Stream);
5273
5274var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
5275
5276function prependListener(emitter, event, fn) {
5277 // Sadly this is not cacheable as some libraries bundle their own
5278 // event emitter implementation with them.
5279 if (typeof emitter.prependListener === 'function') {
5280 return emitter.prependListener(event, fn);
5281 } else {
5282 // This is a hack to make sure that our error handler is attached before any
5283 // userland ones. NEVER DO THIS. This is here only because this code needs
5284 // to continue to work with older versions of Node.js that do not include
5285 // the prependListener() method. The goal is to eventually remove this hack.
5286 if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
5287 }
5288}
5289
5290function ReadableState(options, stream) {
5291 Duplex = Duplex || require('./_stream_duplex');
5292
5293 options = options || {};
5294
5295 // object stream flag. Used to make read(n) ignore n and to
5296 // make all the buffer merging and length checks go away
5297 this.objectMode = !!options.objectMode;
5298
5299 if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
5300
5301 // the point at which it stops calling _read() to fill the buffer
5302 // Note: 0 is a valid value, means "don't call _read preemptively ever"
5303 var hwm = options.highWaterMark;
5304 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
5305 this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
5306
5307 // cast to ints.
5308 this.highWaterMark = Math.floor(this.highWaterMark);
5309
5310 // A linked list is used to store data chunks instead of an array because the
5311 // linked list can remove elements from the beginning faster than
5312 // array.shift()
5313 this.buffer = new BufferList();
5314 this.length = 0;
5315 this.pipes = null;
5316 this.pipesCount = 0;
5317 this.flowing = null;
5318 this.ended = false;
5319 this.endEmitted = false;
5320 this.reading = false;
5321
5322 // a flag to be able to tell if the event 'readable'/'data' is emitted
5323 // immediately, or on a later tick. We set this to true at first, because
5324 // any actions that shouldn't happen until "later" should generally also
5325 // not happen before the first read call.
5326 this.sync = true;
5327
5328 // whenever we return null, then we set a flag to say
5329 // that we're awaiting a 'readable' event emission.
5330 this.needReadable = false;
5331 this.emittedReadable = false;
5332 this.readableListening = false;
5333 this.resumeScheduled = false;
5334
5335 // has it been destroyed
5336 this.destroyed = false;
5337
5338 // Crypto is kind of old and crusty. Historically, its default string
5339 // encoding is 'binary' so we have to make this configurable.
5340 // Everything else in the universe uses 'utf8', though.
5341 this.defaultEncoding = options.defaultEncoding || 'utf8';
5342
5343 // the number of writers that are awaiting a drain event in .pipe()s
5344 this.awaitDrain = 0;
5345
5346 // if true, a maybeReadMore has been scheduled
5347 this.readingMore = false;
5348
5349 this.decoder = null;
5350 this.encoding = null;
5351 if (options.encoding) {
5352 if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
5353 this.decoder = new StringDecoder(options.encoding);
5354 this.encoding = options.encoding;
5355 }
5356}
5357
5358function Readable(options) {
5359 Duplex = Duplex || require('./_stream_duplex');
5360
5361 if (!(this instanceof Readable)) return new Readable(options);
5362
5363 this._readableState = new ReadableState(options, this);
5364
5365 // legacy
5366 this.readable = true;
5367
5368 if (options) {
5369 if (typeof options.read === 'function') this._read = options.read;
5370
5371 if (typeof options.destroy === 'function') this._destroy = options.destroy;
5372 }
5373
5374 Stream.call(this);
5375}
5376
5377Object.defineProperty(Readable.prototype, 'destroyed', {
5378 get: function () {
5379 if (this._readableState === undefined) {
5380 return false;
5381 }
5382 return this._readableState.destroyed;
5383 },
5384 set: function (value) {
5385 // we ignore the value if the stream
5386 // has not been initialized yet
5387 if (!this._readableState) {
5388 return;
5389 }
5390
5391 // backward compatibility, the user is explicitly
5392 // managing destroyed
5393 this._readableState.destroyed = value;
5394 }
5395});
5396
5397Readable.prototype.destroy = destroyImpl.destroy;
5398Readable.prototype._undestroy = destroyImpl.undestroy;
5399Readable.prototype._destroy = function (err, cb) {
5400 this.push(null);
5401 cb(err);
5402};
5403
5404// Manually shove something into the read() buffer.
5405// This returns true if the highWaterMark has not been hit yet,
5406// similar to how Writable.write() returns true if you should
5407// write() some more.
5408Readable.prototype.push = function (chunk, encoding) {
5409 var state = this._readableState;
5410 var skipChunkCheck;
5411
5412 if (!state.objectMode) {
5413 if (typeof chunk === 'string') {
5414 encoding = encoding || state.defaultEncoding;
5415 if (encoding !== state.encoding) {
5416 chunk = Buffer.from(chunk, encoding);
5417 encoding = '';
5418 }
5419 skipChunkCheck = true;
5420 }
5421 } else {
5422 skipChunkCheck = true;
5423 }
5424
5425 return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
5426};
5427
5428// Unshift should *always* be something directly out of read()
5429Readable.prototype.unshift = function (chunk) {
5430 return readableAddChunk(this, chunk, null, true, false);
5431};
5432
5433function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
5434 var state = stream._readableState;
5435 if (chunk === null) {
5436 state.reading = false;
5437 onEofChunk(stream, state);
5438 } else {
5439 var er;
5440 if (!skipChunkCheck) er = chunkInvalid(state, chunk);
5441 if (er) {
5442 stream.emit('error', er);
5443 } else if (state.objectMode || chunk && chunk.length > 0) {
5444 if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
5445 chunk = _uint8ArrayToBuffer(chunk);
5446 }
5447
5448 if (addToFront) {
5449 if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
5450 } else if (state.ended) {
5451 stream.emit('error', new Error('stream.push() after EOF'));
5452 } else {
5453 state.reading = false;
5454 if (state.decoder && !encoding) {
5455 chunk = state.decoder.write(chunk);
5456 if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
5457 } else {
5458 addChunk(stream, state, chunk, false);
5459 }
5460 }
5461 } else if (!addToFront) {
5462 state.reading = false;
5463 }
5464 }
5465
5466 return needMoreData(state);
5467}
5468
5469function addChunk(stream, state, chunk, addToFront) {
5470 if (state.flowing && state.length === 0 && !state.sync) {
5471 stream.emit('data', chunk);
5472 stream.read(0);
5473 } else {
5474 // update the buffer info.
5475 state.length += state.objectMode ? 1 : chunk.length;
5476 if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
5477
5478 if (state.needReadable) emitReadable(stream);
5479 }
5480 maybeReadMore(stream, state);
5481}
5482
5483function chunkInvalid(state, chunk) {
5484 var er;
5485 if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
5486 er = new TypeError('Invalid non-string/buffer chunk');
5487 }
5488 return er;
5489}
5490
5491// if it's past the high water mark, we can push in some more.
5492// Also, if we have no data yet, we can stand some
5493// more bytes. This is to work around cases where hwm=0,
5494// such as the repl. Also, if the push() triggered a
5495// readable event, and the user called read(largeNumber) such that
5496// needReadable was set, then we ought to push more, so that another
5497// 'readable' event will be triggered.
5498function needMoreData(state) {
5499 return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
5500}
5501
5502Readable.prototype.isPaused = function () {
5503 return this._readableState.flowing === false;
5504};
5505
5506// backwards compatibility.
5507Readable.prototype.setEncoding = function (enc) {
5508 if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
5509 this._readableState.decoder = new StringDecoder(enc);
5510 this._readableState.encoding = enc;
5511 return this;
5512};
5513
5514// Don't raise the hwm > 8MB
5515var MAX_HWM = 0x800000;
5516function computeNewHighWaterMark(n) {
5517 if (n >= MAX_HWM) {
5518 n = MAX_HWM;
5519 } else {
5520 // Get the next highest power of 2 to prevent increasing hwm excessively in
5521 // tiny amounts
5522 n--;
5523 n |= n >>> 1;
5524 n |= n >>> 2;
5525 n |= n >>> 4;
5526 n |= n >>> 8;
5527 n |= n >>> 16;
5528 n++;
5529 }
5530 return n;
5531}
5532
5533// This function is designed to be inlinable, so please take care when making
5534// changes to the function body.
5535function howMuchToRead(n, state) {
5536 if (n <= 0 || state.length === 0 && state.ended) return 0;
5537 if (state.objectMode) return 1;
5538 if (n !== n) {
5539 // Only flow one buffer at a time
5540 if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
5541 }
5542 // If we're asking for more than the current hwm, then raise the hwm.
5543 if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
5544 if (n <= state.length) return n;
5545 // Don't have enough
5546 if (!state.ended) {
5547 state.needReadable = true;
5548 return 0;
5549 }
5550 return state.length;
5551}
5552
5553// you can override either this method, or the async _read(n) below.
5554Readable.prototype.read = function (n) {
5555 debug('read', n);
5556 n = parseInt(n, 10);
5557 var state = this._readableState;
5558 var nOrig = n;
5559
5560 if (n !== 0) state.emittedReadable = false;
5561
5562 // if we're doing read(0) to trigger a readable event, but we
5563 // already have a bunch of data in the buffer, then just trigger
5564 // the 'readable' event and move on.
5565 if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
5566 debug('read: emitReadable', state.length, state.ended);
5567 if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
5568 return null;
5569 }
5570
5571 n = howMuchToRead(n, state);
5572
5573 // if we've ended, and we're now clear, then finish it up.
5574 if (n === 0 && state.ended) {
5575 if (state.length === 0) endReadable(this);
5576 return null;
5577 }
5578
5579 // All the actual chunk generation logic needs to be
5580 // *below* the call to _read. The reason is that in certain
5581 // synthetic stream cases, such as passthrough streams, _read
5582 // may be a completely synchronous operation which may change
5583 // the state of the read buffer, providing enough data when
5584 // before there was *not* enough.
5585 //
5586 // So, the steps are:
5587 // 1. Figure out what the state of things will be after we do
5588 // a read from the buffer.
5589 //
5590 // 2. If that resulting state will trigger a _read, then call _read.
5591 // Note that this may be asynchronous, or synchronous. Yes, it is
5592 // deeply ugly to write APIs this way, but that still doesn't mean
5593 // that the Readable class should behave improperly, as streams are
5594 // designed to be sync/async agnostic.
5595 // Take note if the _read call is sync or async (ie, if the read call
5596 // has returned yet), so that we know whether or not it's safe to emit
5597 // 'readable' etc.
5598 //
5599 // 3. Actually pull the requested chunks out of the buffer and return.
5600
5601 // if we need a readable event, then we need to do some reading.
5602 var doRead = state.needReadable;
5603 debug('need readable', doRead);
5604
5605 // if we currently have less than the highWaterMark, then also read some
5606 if (state.length === 0 || state.length - n < state.highWaterMark) {
5607 doRead = true;
5608 debug('length less than watermark', doRead);
5609 }
5610
5611 // however, if we've ended, then there's no point, and if we're already
5612 // reading, then it's unnecessary.
5613 if (state.ended || state.reading) {
5614 doRead = false;
5615 debug('reading or ended', doRead);
5616 } else if (doRead) {
5617 debug('do read');
5618 state.reading = true;
5619 state.sync = true;
5620 // if the length is currently zero, then we *need* a readable event.
5621 if (state.length === 0) state.needReadable = true;
5622 // call internal read method
5623 this._read(state.highWaterMark);
5624 state.sync = false;
5625 // If _read pushed data synchronously, then `reading` will be false,
5626 // and we need to re-evaluate how much data we can return to the user.
5627 if (!state.reading) n = howMuchToRead(nOrig, state);
5628 }
5629
5630 var ret;
5631 if (n > 0) ret = fromList(n, state);else ret = null;
5632
5633 if (ret === null) {
5634 state.needReadable = true;
5635 n = 0;
5636 } else {
5637 state.length -= n;
5638 }
5639
5640 if (state.length === 0) {
5641 // If we have nothing in the buffer, then we want to know
5642 // as soon as we *do* get something into the buffer.
5643 if (!state.ended) state.needReadable = true;
5644
5645 // If we tried to read() past the EOF, then emit end on the next tick.
5646 if (nOrig !== n && state.ended) endReadable(this);
5647 }
5648
5649 if (ret !== null) this.emit('data', ret);
5650
5651 return ret;
5652};
5653
5654function onEofChunk(stream, state) {
5655 if (state.ended) return;
5656 if (state.decoder) {
5657 var chunk = state.decoder.end();
5658 if (chunk && chunk.length) {
5659 state.buffer.push(chunk);
5660 state.length += state.objectMode ? 1 : chunk.length;
5661 }
5662 }
5663 state.ended = true;
5664
5665 // emit 'readable' now to make sure it gets picked up.
5666 emitReadable(stream);
5667}
5668
5669// Don't emit readable right away in sync mode, because this can trigger
5670// another read() call => stack overflow. This way, it might trigger
5671// a nextTick recursion warning, but that's not so bad.
5672function emitReadable(stream) {
5673 var state = stream._readableState;
5674 state.needReadable = false;
5675 if (!state.emittedReadable) {
5676 debug('emitReadable', state.flowing);
5677 state.emittedReadable = true;
5678 if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
5679 }
5680}
5681
5682function emitReadable_(stream) {
5683 debug('emit readable');
5684 stream.emit('readable');
5685 flow(stream);
5686}
5687
5688// at this point, the user has presumably seen the 'readable' event,
5689// and called read() to consume some data. that may have triggered
5690// in turn another _read(n) call, in which case reading = true if
5691// it's in progress.
5692// However, if we're not ended, or reading, and the length < hwm,
5693// then go ahead and try to read some more preemptively.
5694function maybeReadMore(stream, state) {
5695 if (!state.readingMore) {
5696 state.readingMore = true;
5697 processNextTick(maybeReadMore_, stream, state);
5698 }
5699}
5700
5701function maybeReadMore_(stream, state) {
5702 var len = state.length;
5703 while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
5704 debug('maybeReadMore read 0');
5705 stream.read(0);
5706 if (len === state.length)
5707 // didn't get any data, stop spinning.
5708 break;else len = state.length;
5709 }
5710 state.readingMore = false;
5711}
5712
5713// abstract method. to be overridden in specific implementation classes.
5714// call cb(er, data) where data is <= n in length.
5715// for virtual (non-string, non-buffer) streams, "length" is somewhat
5716// arbitrary, and perhaps not very meaningful.
5717Readable.prototype._read = function (n) {
5718 this.emit('error', new Error('_read() is not implemented'));
5719};
5720
5721Readable.prototype.pipe = function (dest, pipeOpts) {
5722 var src = this;
5723 var state = this._readableState;
5724
5725 switch (state.pipesCount) {
5726 case 0:
5727 state.pipes = dest;
5728 break;
5729 case 1:
5730 state.pipes = [state.pipes, dest];
5731 break;
5732 default:
5733 state.pipes.push(dest);
5734 break;
5735 }
5736 state.pipesCount += 1;
5737 debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
5738
5739 var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
5740
5741 var endFn = doEnd ? onend : unpipe;
5742 if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
5743
5744 dest.on('unpipe', onunpipe);
5745 function onunpipe(readable, unpipeInfo) {
5746 debug('onunpipe');
5747 if (readable === src) {
5748 if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
5749 unpipeInfo.hasUnpiped = true;
5750 cleanup();
5751 }
5752 }
5753 }
5754
5755 function onend() {
5756 debug('onend');
5757 dest.end();
5758 }
5759
5760 // when the dest drains, it reduces the awaitDrain counter
5761 // on the source. This would be more elegant with a .once()
5762 // handler in flow(), but adding and removing repeatedly is
5763 // too slow.
5764 var ondrain = pipeOnDrain(src);
5765 dest.on('drain', ondrain);
5766
5767 var cleanedUp = false;
5768 function cleanup() {
5769 debug('cleanup');
5770 // cleanup event handlers once the pipe is broken
5771 dest.removeListener('close', onclose);
5772 dest.removeListener('finish', onfinish);
5773 dest.removeListener('drain', ondrain);
5774 dest.removeListener('error', onerror);
5775 dest.removeListener('unpipe', onunpipe);
5776 src.removeListener('end', onend);
5777 src.removeListener('end', unpipe);
5778 src.removeListener('data', ondata);
5779
5780 cleanedUp = true;
5781
5782 // if the reader is waiting for a drain event from this
5783 // specific writer, then it would cause it to never start
5784 // flowing again.
5785 // So, if this is awaiting a drain, then we just call it now.
5786 // If we don't know, then assume that we are waiting for one.
5787 if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
5788 }
5789
5790 // If the user pushes more data while we're writing to dest then we'll end up
5791 // in ondata again. However, we only want to increase awaitDrain once because
5792 // dest will only emit one 'drain' event for the multiple writes.
5793 // => Introduce a guard on increasing awaitDrain.
5794 var increasedAwaitDrain = false;
5795 src.on('data', ondata);
5796 function ondata(chunk) {
5797 debug('ondata');
5798 increasedAwaitDrain = false;
5799 var ret = dest.write(chunk);
5800 if (false === ret && !increasedAwaitDrain) {
5801 // If the user unpiped during `dest.write()`, it is possible
5802 // to get stuck in a permanently paused state if that write
5803 // also returned false.
5804 // => Check whether `dest` is still a piping destination.
5805 if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
5806 debug('false write response, pause', src._readableState.awaitDrain);
5807 src._readableState.awaitDrain++;
5808 increasedAwaitDrain = true;
5809 }
5810 src.pause();
5811 }
5812 }
5813
5814 // if the dest has an error, then stop piping into it.
5815 // however, don't suppress the throwing behavior for this.
5816 function onerror(er) {
5817 debug('onerror', er);
5818 unpipe();
5819 dest.removeListener('error', onerror);
5820 if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
5821 }
5822
5823 // Make sure our error handler is attached before userland ones.
5824 prependListener(dest, 'error', onerror);
5825
5826 // Both close and finish should trigger unpipe, but only once.
5827 function onclose() {
5828 dest.removeListener('finish', onfinish);
5829 unpipe();
5830 }
5831 dest.once('close', onclose);
5832 function onfinish() {
5833 debug('onfinish');
5834 dest.removeListener('close', onclose);
5835 unpipe();
5836 }
5837 dest.once('finish', onfinish);
5838
5839 function unpipe() {
5840 debug('unpipe');
5841 src.unpipe(dest);
5842 }
5843
5844 // tell the dest that it's being piped to
5845 dest.emit('pipe', src);
5846
5847 // start the flow if it hasn't been started already.
5848 if (!state.flowing) {
5849 debug('pipe resume');
5850 src.resume();
5851 }
5852
5853 return dest;
5854};
5855
5856function pipeOnDrain(src) {
5857 return function () {
5858 var state = src._readableState;
5859 debug('pipeOnDrain', state.awaitDrain);
5860 if (state.awaitDrain) state.awaitDrain--;
5861 if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
5862 state.flowing = true;
5863 flow(src);
5864 }
5865 };
5866}
5867
5868Readable.prototype.unpipe = function (dest) {
5869 var state = this._readableState;
5870 var unpipeInfo = { hasUnpiped: false };
5871
5872 // if we're not piping anywhere, then do nothing.
5873 if (state.pipesCount === 0) return this;
5874
5875 // just one destination. most common case.
5876 if (state.pipesCount === 1) {
5877 // passed in one, but it's not the right one.
5878 if (dest && dest !== state.pipes) return this;
5879
5880 if (!dest) dest = state.pipes;
5881
5882 // got a match.
5883 state.pipes = null;
5884 state.pipesCount = 0;
5885 state.flowing = false;
5886 if (dest) dest.emit('unpipe', this, unpipeInfo);
5887 return this;
5888 }
5889
5890 // slow case. multiple pipe destinations.
5891
5892 if (!dest) {
5893 // remove all.
5894 var dests = state.pipes;
5895 var len = state.pipesCount;
5896 state.pipes = null;
5897 state.pipesCount = 0;
5898 state.flowing = false;
5899
5900 for (var i = 0; i < len; i++) {
5901 dests[i].emit('unpipe', this, unpipeInfo);
5902 }return this;
5903 }
5904
5905 // try to find the right one.
5906 var index = indexOf(state.pipes, dest);
5907 if (index === -1) return this;
5908
5909 state.pipes.splice(index, 1);
5910 state.pipesCount -= 1;
5911 if (state.pipesCount === 1) state.pipes = state.pipes[0];
5912
5913 dest.emit('unpipe', this, unpipeInfo);
5914
5915 return this;
5916};
5917
5918// set up data events if they are asked for
5919// Ensure readable listeners eventually get something
5920Readable.prototype.on = function (ev, fn) {
5921 var res = Stream.prototype.on.call(this, ev, fn);
5922
5923 if (ev === 'data') {
5924 // Start flowing on next tick if stream isn't explicitly paused
5925 if (this._readableState.flowing !== false) this.resume();
5926 } else if (ev === 'readable') {
5927 var state = this._readableState;
5928 if (!state.endEmitted && !state.readableListening) {
5929 state.readableListening = state.needReadable = true;
5930 state.emittedReadable = false;
5931 if (!state.reading) {
5932 processNextTick(nReadingNextTick, this);
5933 } else if (state.length) {
5934 emitReadable(this);
5935 }
5936 }
5937 }
5938
5939 return res;
5940};
5941Readable.prototype.addListener = Readable.prototype.on;
5942
5943function nReadingNextTick(self) {
5944 debug('readable nexttick read 0');
5945 self.read(0);
5946}
5947
5948// pause() and resume() are remnants of the legacy readable stream API
5949// If the user uses them, then switch into old mode.
5950Readable.prototype.resume = function () {
5951 var state = this._readableState;
5952 if (!state.flowing) {
5953 debug('resume');
5954 state.flowing = true;
5955 resume(this, state);
5956 }
5957 return this;
5958};
5959
5960function resume(stream, state) {
5961 if (!state.resumeScheduled) {
5962 state.resumeScheduled = true;
5963 processNextTick(resume_, stream, state);
5964 }
5965}
5966
5967function resume_(stream, state) {
5968 if (!state.reading) {
5969 debug('resume read 0');
5970 stream.read(0);
5971 }
5972
5973 state.resumeScheduled = false;
5974 state.awaitDrain = 0;
5975 stream.emit('resume');
5976 flow(stream);
5977 if (state.flowing && !state.reading) stream.read(0);
5978}
5979
5980Readable.prototype.pause = function () {
5981 debug('call pause flowing=%j', this._readableState.flowing);
5982 if (false !== this._readableState.flowing) {
5983 debug('pause');
5984 this._readableState.flowing = false;
5985 this.emit('pause');
5986 }
5987 return this;
5988};
5989
5990function flow(stream) {
5991 var state = stream._readableState;
5992 debug('flow', state.flowing);
5993 while (state.flowing && stream.read() !== null) {}
5994}
5995
5996// wrap an old-style stream as the async data source.
5997// This is *not* part of the readable stream interface.
5998// It is an ugly unfortunate mess of history.
5999Readable.prototype.wrap = function (stream) {
6000 var state = this._readableState;
6001 var paused = false;
6002
6003 var self = this;
6004 stream.on('end', function () {
6005 debug('wrapped end');
6006 if (state.decoder && !state.ended) {
6007 var chunk = state.decoder.end();
6008 if (chunk && chunk.length) self.push(chunk);
6009 }
6010
6011 self.push(null);
6012 });
6013
6014 stream.on('data', function (chunk) {
6015 debug('wrapped data');
6016 if (state.decoder) chunk = state.decoder.write(chunk);
6017
6018 // don't skip over falsy values in objectMode
6019 if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
6020
6021 var ret = self.push(chunk);
6022 if (!ret) {
6023 paused = true;
6024 stream.pause();
6025 }
6026 });
6027
6028 // proxy all the other methods.
6029 // important when wrapping filters and duplexes.
6030 for (var i in stream) {
6031 if (this[i] === undefined && typeof stream[i] === 'function') {
6032 this[i] = function (method) {
6033 return function () {
6034 return stream[method].apply(stream, arguments);
6035 };
6036 }(i);
6037 }
6038 }
6039
6040 // proxy certain important events.
6041 for (var n = 0; n < kProxyEvents.length; n++) {
6042 stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n]));
6043 }
6044
6045 // when we try to consume some more bytes, simply unpause the
6046 // underlying stream.
6047 self._read = function (n) {
6048 debug('wrapped _read', n);
6049 if (paused) {
6050 paused = false;
6051 stream.resume();
6052 }
6053 };
6054
6055 return self;
6056};
6057
6058// exposed for testing purposes only.
6059Readable._fromList = fromList;
6060
6061// Pluck off n bytes from an array of buffers.
6062// Length is the combined lengths of all the buffers in the list.
6063// This function is designed to be inlinable, so please take care when making
6064// changes to the function body.
6065function fromList(n, state) {
6066 // nothing buffered
6067 if (state.length === 0) return null;
6068
6069 var ret;
6070 if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
6071 // read it all, truncate the list
6072 if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
6073 state.buffer.clear();
6074 } else {
6075 // read part of list
6076 ret = fromListPartial(n, state.buffer, state.decoder);
6077 }
6078
6079 return ret;
6080}
6081
6082// Extracts only enough buffered data to satisfy the amount requested.
6083// This function is designed to be inlinable, so please take care when making
6084// changes to the function body.
6085function fromListPartial(n, list, hasStrings) {
6086 var ret;
6087 if (n < list.head.data.length) {
6088 // slice is the same for buffers and strings
6089 ret = list.head.data.slice(0, n);
6090 list.head.data = list.head.data.slice(n);
6091 } else if (n === list.head.data.length) {
6092 // first chunk is a perfect match
6093 ret = list.shift();
6094 } else {
6095 // result spans more than one buffer
6096 ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
6097 }
6098 return ret;
6099}
6100
6101// Copies a specified amount of characters from the list of buffered data
6102// chunks.
6103// This function is designed to be inlinable, so please take care when making
6104// changes to the function body.
6105function copyFromBufferString(n, list) {
6106 var p = list.head;
6107 var c = 1;
6108 var ret = p.data;
6109 n -= ret.length;
6110 while (p = p.next) {
6111 var str = p.data;
6112 var nb = n > str.length ? str.length : n;
6113 if (nb === str.length) ret += str;else ret += str.slice(0, n);
6114 n -= nb;
6115 if (n === 0) {
6116 if (nb === str.length) {
6117 ++c;
6118 if (p.next) list.head = p.next;else list.head = list.tail = null;
6119 } else {
6120 list.head = p;
6121 p.data = str.slice(nb);
6122 }
6123 break;
6124 }
6125 ++c;
6126 }
6127 list.length -= c;
6128 return ret;
6129}
6130
6131// Copies a specified amount of bytes from the list of buffered data chunks.
6132// This function is designed to be inlinable, so please take care when making
6133// changes to the function body.
6134function copyFromBuffer(n, list) {
6135 var ret = Buffer.allocUnsafe(n);
6136 var p = list.head;
6137 var c = 1;
6138 p.data.copy(ret);
6139 n -= p.data.length;
6140 while (p = p.next) {
6141 var buf = p.data;
6142 var nb = n > buf.length ? buf.length : n;
6143 buf.copy(ret, ret.length - n, 0, nb);
6144 n -= nb;
6145 if (n === 0) {
6146 if (nb === buf.length) {
6147 ++c;
6148 if (p.next) list.head = p.next;else list.head = list.tail = null;
6149 } else {
6150 list.head = p;
6151 p.data = buf.slice(nb);
6152 }
6153 break;
6154 }
6155 ++c;
6156 }
6157 list.length -= c;
6158 return ret;
6159}
6160
6161function endReadable(stream) {
6162 var state = stream._readableState;
6163
6164 // If we get here before consuming all the bytes, then that is a
6165 // bug in node. Should never happen.
6166 if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
6167
6168 if (!state.endEmitted) {
6169 state.ended = true;
6170 processNextTick(endReadableNT, state, stream);
6171 }
6172}
6173
6174function endReadableNT(state, stream) {
6175 // Check that we didn't get one last unshift.
6176 if (!state.endEmitted && state.length === 0) {
6177 state.endEmitted = true;
6178 stream.readable = false;
6179 stream.emit('end');
6180 }
6181}
6182
6183function forEach(xs, f) {
6184 for (var i = 0, l = xs.length; i < l; i++) {
6185 f(xs[i], i);
6186 }
6187}
6188
6189function indexOf(xs, x) {
6190 for (var i = 0, l = xs.length; i < l; i++) {
6191 if (xs[i] === x) return i;
6192 }
6193 return -1;
6194}
6195}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
6196},{"./_stream_duplex":27,"./internal/streams/BufferList":32,"./internal/streams/destroy":33,"./internal/streams/stream":34,"_process":25,"core-util-is":14,"events":18,"inherits":21,"isarray":23,"process-nextick-args":24,"safe-buffer":40,"string_decoder/":50,"util":4}],30:[function(require,module,exports){
6197// Copyright Joyent, Inc. and other Node contributors.
6198//
6199// Permission is hereby granted, free of charge, to any person obtaining a
6200// copy of this software and associated documentation files (the
6201// "Software"), to deal in the Software without restriction, including
6202// without limitation the rights to use, copy, modify, merge, publish,
6203// distribute, sublicense, and/or sell copies of the Software, and to permit
6204// persons to whom the Software is furnished to do so, subject to the
6205// following conditions:
6206//
6207// The above copyright notice and this permission notice shall be included
6208// in all copies or substantial portions of the Software.
6209//
6210// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6211// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6212// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
6213// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
6214// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
6215// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
6216// USE OR OTHER DEALINGS IN THE SOFTWARE.
6217
6218// a transform stream is a readable/writable stream where you do
6219// something with the data. Sometimes it's called a "filter",
6220// but that's not a great name for it, since that implies a thing where
6221// some bits pass through, and others are simply ignored. (That would
6222// be a valid example of a transform, of course.)
6223//
6224// While the output is causally related to the input, it's not a
6225// necessarily symmetric or synchronous transformation. For example,
6226// a zlib stream might take multiple plain-text writes(), and then
6227// emit a single compressed chunk some time in the future.
6228//
6229// Here's how this works:
6230//
6231// The Transform stream has all the aspects of the readable and writable
6232// stream classes. When you write(chunk), that calls _write(chunk,cb)
6233// internally, and returns false if there's a lot of pending writes
6234// buffered up. When you call read(), that calls _read(n) until
6235// there's enough pending readable data buffered up.
6236//
6237// In a transform stream, the written data is placed in a buffer. When
6238// _read(n) is called, it transforms the queued up data, calling the
6239// buffered _write cb's as it consumes chunks. If consuming a single
6240// written chunk would result in multiple output chunks, then the first
6241// outputted bit calls the readcb, and subsequent chunks just go into
6242// the read buffer, and will cause it to emit 'readable' if necessary.
6243//
6244// This way, back-pressure is actually determined by the reading side,
6245// since _read has to be called to start processing a new chunk. However,
6246// a pathological inflate type of transform can cause excessive buffering
6247// here. For example, imagine a stream where every byte of input is
6248// interpreted as an integer from 0-255, and then results in that many
6249// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
6250// 1kb of data being output. In this case, you could write a very small
6251// amount of input, and end up with a very large amount of output. In
6252// such a pathological inflating mechanism, there'd be no way to tell
6253// the system to stop doing the transform. A single 4MB write could
6254// cause the system to run out of memory.
6255//
6256// However, even in such a pathological case, only a single written chunk
6257// would be consumed, and then the rest would wait (un-transformed) until
6258// the results of the previous transformed chunk were consumed.
6259
6260'use strict';
6261
6262module.exports = Transform;
6263
6264var Duplex = require('./_stream_duplex');
6265
6266/*<replacement>*/
6267var util = require('core-util-is');
6268util.inherits = require('inherits');
6269/*</replacement>*/
6270
6271util.inherits(Transform, Duplex);
6272
6273function TransformState(stream) {
6274 this.afterTransform = function (er, data) {
6275 return afterTransform(stream, er, data);
6276 };
6277
6278 this.needTransform = false;
6279 this.transforming = false;
6280 this.writecb = null;
6281 this.writechunk = null;
6282 this.writeencoding = null;
6283}
6284
6285function afterTransform(stream, er, data) {
6286 var ts = stream._transformState;
6287 ts.transforming = false;
6288
6289 var cb = ts.writecb;
6290
6291 if (!cb) {
6292 return stream.emit('error', new Error('write callback called multiple times'));
6293 }
6294
6295 ts.writechunk = null;
6296 ts.writecb = null;
6297
6298 if (data !== null && data !== undefined) stream.push(data);
6299
6300 cb(er);
6301
6302 var rs = stream._readableState;
6303 rs.reading = false;
6304 if (rs.needReadable || rs.length < rs.highWaterMark) {
6305 stream._read(rs.highWaterMark);
6306 }
6307}
6308
6309function Transform(options) {
6310 if (!(this instanceof Transform)) return new Transform(options);
6311
6312 Duplex.call(this, options);
6313
6314 this._transformState = new TransformState(this);
6315
6316 var stream = this;
6317
6318 // start out asking for a readable event once data is transformed.
6319 this._readableState.needReadable = true;
6320
6321 // we have implemented the _read method, and done the other things
6322 // that Readable wants before the first _read call, so unset the
6323 // sync guard flag.
6324 this._readableState.sync = false;
6325
6326 if (options) {
6327 if (typeof options.transform === 'function') this._transform = options.transform;
6328
6329 if (typeof options.flush === 'function') this._flush = options.flush;
6330 }
6331
6332 // When the writable side finishes, then flush out anything remaining.
6333 this.once('prefinish', function () {
6334 if (typeof this._flush === 'function') this._flush(function (er, data) {
6335 done(stream, er, data);
6336 });else done(stream);
6337 });
6338}
6339
6340Transform.prototype.push = function (chunk, encoding) {
6341 this._transformState.needTransform = false;
6342 return Duplex.prototype.push.call(this, chunk, encoding);
6343};
6344
6345// This is the part where you do stuff!
6346// override this function in implementation classes.
6347// 'chunk' is an input chunk.
6348//
6349// Call `push(newChunk)` to pass along transformed output
6350// to the readable side. You may call 'push' zero or more times.
6351//
6352// Call `cb(err)` when you are done with this chunk. If you pass
6353// an error, then that'll put the hurt on the whole operation. If you
6354// never call cb(), then you'll never get another chunk.
6355Transform.prototype._transform = function (chunk, encoding, cb) {
6356 throw new Error('_transform() is not implemented');
6357};
6358
6359Transform.prototype._write = function (chunk, encoding, cb) {
6360 var ts = this._transformState;
6361 ts.writecb = cb;
6362 ts.writechunk = chunk;
6363 ts.writeencoding = encoding;
6364 if (!ts.transforming) {
6365 var rs = this._readableState;
6366 if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
6367 }
6368};
6369
6370// Doesn't matter what the args are here.
6371// _transform does all the work.
6372// That we got here means that the readable side wants more data.
6373Transform.prototype._read = function (n) {
6374 var ts = this._transformState;
6375
6376 if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
6377 ts.transforming = true;
6378 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
6379 } else {
6380 // mark that we need a transform, so that any data that comes in
6381 // will get processed, now that we've asked for it.
6382 ts.needTransform = true;
6383 }
6384};
6385
6386Transform.prototype._destroy = function (err, cb) {
6387 var _this = this;
6388
6389 Duplex.prototype._destroy.call(this, err, function (err2) {
6390 cb(err2);
6391 _this.emit('close');
6392 });
6393};
6394
6395function done(stream, er, data) {
6396 if (er) return stream.emit('error', er);
6397
6398 if (data !== null && data !== undefined) stream.push(data);
6399
6400 // if there's nothing in the write buffer, then that means
6401 // that nothing more will ever be provided
6402 var ws = stream._writableState;
6403 var ts = stream._transformState;
6404
6405 if (ws.length) throw new Error('Calling transform done when ws.length != 0');
6406
6407 if (ts.transforming) throw new Error('Calling transform done when still transforming');
6408
6409 return stream.push(null);
6410}
6411},{"./_stream_duplex":27,"core-util-is":14,"inherits":21}],31:[function(require,module,exports){
6412(function (process,global){
6413// Copyright Joyent, Inc. and other Node contributors.
6414//
6415// Permission is hereby granted, free of charge, to any person obtaining a
6416// copy of this software and associated documentation files (the
6417// "Software"), to deal in the Software without restriction, including
6418// without limitation the rights to use, copy, modify, merge, publish,
6419// distribute, sublicense, and/or sell copies of the Software, and to permit
6420// persons to whom the Software is furnished to do so, subject to the
6421// following conditions:
6422//
6423// The above copyright notice and this permission notice shall be included
6424// in all copies or substantial portions of the Software.
6425//
6426// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6427// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6428// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
6429// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
6430// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
6431// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
6432// USE OR OTHER DEALINGS IN THE SOFTWARE.
6433
6434// A bit simpler than readable streams.
6435// Implement an async ._write(chunk, encoding, cb), and it'll handle all
6436// the drain event emission and buffering.
6437
6438'use strict';
6439
6440/*<replacement>*/
6441
6442var processNextTick = require('process-nextick-args');
6443/*</replacement>*/
6444
6445module.exports = Writable;
6446
6447/* <replacement> */
6448function WriteReq(chunk, encoding, cb) {
6449 this.chunk = chunk;
6450 this.encoding = encoding;
6451 this.callback = cb;
6452 this.next = null;
6453}
6454
6455// It seems a linked list but it is not
6456// there will be only 2 of these for each stream
6457function CorkedRequest(state) {
6458 var _this = this;
6459
6460 this.next = null;
6461 this.entry = null;
6462 this.finish = function () {
6463 onCorkedFinish(_this, state);
6464 };
6465}
6466/* </replacement> */
6467
6468/*<replacement>*/
6469var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
6470/*</replacement>*/
6471
6472/*<replacement>*/
6473var Duplex;
6474/*</replacement>*/
6475
6476Writable.WritableState = WritableState;
6477
6478/*<replacement>*/
6479var util = require('core-util-is');
6480util.inherits = require('inherits');
6481/*</replacement>*/
6482
6483/*<replacement>*/
6484var internalUtil = {
6485 deprecate: require('util-deprecate')
6486};
6487/*</replacement>*/
6488
6489/*<replacement>*/
6490var Stream = require('./internal/streams/stream');
6491/*</replacement>*/
6492
6493/*<replacement>*/
6494var Buffer = require('safe-buffer').Buffer;
6495var OurUint8Array = global.Uint8Array || function () {};
6496function _uint8ArrayToBuffer(chunk) {
6497 return Buffer.from(chunk);
6498}
6499function _isUint8Array(obj) {
6500 return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
6501}
6502/*</replacement>*/
6503
6504var destroyImpl = require('./internal/streams/destroy');
6505
6506util.inherits(Writable, Stream);
6507
6508function nop() {}
6509
6510function WritableState(options, stream) {
6511 Duplex = Duplex || require('./_stream_duplex');
6512
6513 options = options || {};
6514
6515 // object stream flag to indicate whether or not this stream
6516 // contains buffers or objects.
6517 this.objectMode = !!options.objectMode;
6518
6519 if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
6520
6521 // the point at which write() starts returning false
6522 // Note: 0 is a valid value, means that we always return false if
6523 // the entire buffer is not flushed immediately on write()
6524 var hwm = options.highWaterMark;
6525 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
6526 this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
6527
6528 // cast to ints.
6529 this.highWaterMark = Math.floor(this.highWaterMark);
6530
6531 // if _final has been called
6532 this.finalCalled = false;
6533
6534 // drain event flag.
6535 this.needDrain = false;
6536 // at the start of calling end()
6537 this.ending = false;
6538 // when end() has been called, and returned
6539 this.ended = false;
6540 // when 'finish' is emitted
6541 this.finished = false;
6542
6543 // has it been destroyed
6544 this.destroyed = false;
6545
6546 // should we decode strings into buffers before passing to _write?
6547 // this is here so that some node-core streams can optimize string
6548 // handling at a lower level.
6549 var noDecode = options.decodeStrings === false;
6550 this.decodeStrings = !noDecode;
6551
6552 // Crypto is kind of old and crusty. Historically, its default string
6553 // encoding is 'binary' so we have to make this configurable.
6554 // Everything else in the universe uses 'utf8', though.
6555 this.defaultEncoding = options.defaultEncoding || 'utf8';
6556
6557 // not an actual buffer we keep track of, but a measurement
6558 // of how much we're waiting to get pushed to some underlying
6559 // socket or file.
6560 this.length = 0;
6561
6562 // a flag to see when we're in the middle of a write.
6563 this.writing = false;
6564
6565 // when true all writes will be buffered until .uncork() call
6566 this.corked = 0;
6567
6568 // a flag to be able to tell if the onwrite cb is called immediately,
6569 // or on a later tick. We set this to true at first, because any
6570 // actions that shouldn't happen until "later" should generally also
6571 // not happen before the first write call.
6572 this.sync = true;
6573
6574 // a flag to know if we're processing previously buffered items, which
6575 // may call the _write() callback in the same tick, so that we don't
6576 // end up in an overlapped onwrite situation.
6577 this.bufferProcessing = false;
6578
6579 // the callback that's passed to _write(chunk,cb)
6580 this.onwrite = function (er) {
6581 onwrite(stream, er);
6582 };
6583
6584 // the callback that the user supplies to write(chunk,encoding,cb)
6585 this.writecb = null;
6586
6587 // the amount that is being written when _write is called.
6588 this.writelen = 0;
6589
6590 this.bufferedRequest = null;
6591 this.lastBufferedRequest = null;
6592
6593 // number of pending user-supplied write callbacks
6594 // this must be 0 before 'finish' can be emitted
6595 this.pendingcb = 0;
6596
6597 // emit prefinish if the only thing we're waiting for is _write cbs
6598 // This is relevant for synchronous Transform streams
6599 this.prefinished = false;
6600
6601 // True if the error was already emitted and should not be thrown again
6602 this.errorEmitted = false;
6603
6604 // count buffered requests
6605 this.bufferedRequestCount = 0;
6606
6607 // allocate the first CorkedRequest, there is always
6608 // one allocated and free to use, and we maintain at most two
6609 this.corkedRequestsFree = new CorkedRequest(this);
6610}
6611
6612WritableState.prototype.getBuffer = function getBuffer() {
6613 var current = this.bufferedRequest;
6614 var out = [];
6615 while (current) {
6616 out.push(current);
6617 current = current.next;
6618 }
6619 return out;
6620};
6621
6622(function () {
6623 try {
6624 Object.defineProperty(WritableState.prototype, 'buffer', {
6625 get: internalUtil.deprecate(function () {
6626 return this.getBuffer();
6627 }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
6628 });
6629 } catch (_) {}
6630})();
6631
6632// Test _writableState for inheritance to account for Duplex streams,
6633// whose prototype chain only points to Readable.
6634var realHasInstance;
6635if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
6636 realHasInstance = Function.prototype[Symbol.hasInstance];
6637 Object.defineProperty(Writable, Symbol.hasInstance, {
6638 value: function (object) {
6639 if (realHasInstance.call(this, object)) return true;
6640
6641 return object && object._writableState instanceof WritableState;
6642 }
6643 });
6644} else {
6645 realHasInstance = function (object) {
6646 return object instanceof this;
6647 };
6648}
6649
6650function Writable(options) {
6651 Duplex = Duplex || require('./_stream_duplex');
6652
6653 // Writable ctor is applied to Duplexes, too.
6654 // `realHasInstance` is necessary because using plain `instanceof`
6655 // would return false, as no `_writableState` property is attached.
6656
6657 // Trying to use the custom `instanceof` for Writable here will also break the
6658 // Node.js LazyTransform implementation, which has a non-trivial getter for
6659 // `_writableState` that would lead to infinite recursion.
6660 if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
6661 return new Writable(options);
6662 }
6663
6664 this._writableState = new WritableState(options, this);
6665
6666 // legacy.
6667 this.writable = true;
6668
6669 if (options) {
6670 if (typeof options.write === 'function') this._write = options.write;
6671
6672 if (typeof options.writev === 'function') this._writev = options.writev;
6673
6674 if (typeof options.destroy === 'function') this._destroy = options.destroy;
6675
6676 if (typeof options.final === 'function') this._final = options.final;
6677 }
6678
6679 Stream.call(this);
6680}
6681
6682// Otherwise people can pipe Writable streams, which is just wrong.
6683Writable.prototype.pipe = function () {
6684 this.emit('error', new Error('Cannot pipe, not readable'));
6685};
6686
6687function writeAfterEnd(stream, cb) {
6688 var er = new Error('write after end');
6689 // TODO: defer error events consistently everywhere, not just the cb
6690 stream.emit('error', er);
6691 processNextTick(cb, er);
6692}
6693
6694// Checks that a user-supplied chunk is valid, especially for the particular
6695// mode the stream is in. Currently this means that `null` is never accepted
6696// and undefined/non-string values are only allowed in object mode.
6697function validChunk(stream, state, chunk, cb) {
6698 var valid = true;
6699 var er = false;
6700
6701 if (chunk === null) {
6702 er = new TypeError('May not write null values to stream');
6703 } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
6704 er = new TypeError('Invalid non-string/buffer chunk');
6705 }
6706 if (er) {
6707 stream.emit('error', er);
6708 processNextTick(cb, er);
6709 valid = false;
6710 }
6711 return valid;
6712}
6713
6714Writable.prototype.write = function (chunk, encoding, cb) {
6715 var state = this._writableState;
6716 var ret = false;
6717 var isBuf = _isUint8Array(chunk) && !state.objectMode;
6718
6719 if (isBuf && !Buffer.isBuffer(chunk)) {
6720 chunk = _uint8ArrayToBuffer(chunk);
6721 }
6722
6723 if (typeof encoding === 'function') {
6724 cb = encoding;
6725 encoding = null;
6726 }
6727
6728 if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
6729
6730 if (typeof cb !== 'function') cb = nop;
6731
6732 if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
6733 state.pendingcb++;
6734 ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
6735 }
6736
6737 return ret;
6738};
6739
6740Writable.prototype.cork = function () {
6741 var state = this._writableState;
6742
6743 state.corked++;
6744};
6745
6746Writable.prototype.uncork = function () {
6747 var state = this._writableState;
6748
6749 if (state.corked) {
6750 state.corked--;
6751
6752 if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
6753 }
6754};
6755
6756Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
6757 // node::ParseEncoding() requires lower case.
6758 if (typeof encoding === 'string') encoding = encoding.toLowerCase();
6759 if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
6760 this._writableState.defaultEncoding = encoding;
6761 return this;
6762};
6763
6764function decodeChunk(state, chunk, encoding) {
6765 if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
6766 chunk = Buffer.from(chunk, encoding);
6767 }
6768 return chunk;
6769}
6770
6771// if we're already writing something, then just put this
6772// in the queue, and wait our turn. Otherwise, call _write
6773// If we return false, then we need a drain event, so set that flag.
6774function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
6775 if (!isBuf) {
6776 var newChunk = decodeChunk(state, chunk, encoding);
6777 if (chunk !== newChunk) {
6778 isBuf = true;
6779 encoding = 'buffer';
6780 chunk = newChunk;
6781 }
6782 }
6783 var len = state.objectMode ? 1 : chunk.length;
6784
6785 state.length += len;
6786
6787 var ret = state.length < state.highWaterMark;
6788 // we must ensure that previous needDrain will not be reset to false.
6789 if (!ret) state.needDrain = true;
6790
6791 if (state.writing || state.corked) {
6792 var last = state.lastBufferedRequest;
6793 state.lastBufferedRequest = {
6794 chunk: chunk,
6795 encoding: encoding,
6796 isBuf: isBuf,
6797 callback: cb,
6798 next: null
6799 };
6800 if (last) {
6801 last.next = state.lastBufferedRequest;
6802 } else {
6803 state.bufferedRequest = state.lastBufferedRequest;
6804 }
6805 state.bufferedRequestCount += 1;
6806 } else {
6807 doWrite(stream, state, false, len, chunk, encoding, cb);
6808 }
6809
6810 return ret;
6811}
6812
6813function doWrite(stream, state, writev, len, chunk, encoding, cb) {
6814 state.writelen = len;
6815 state.writecb = cb;
6816 state.writing = true;
6817 state.sync = true;
6818 if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
6819 state.sync = false;
6820}
6821
6822function onwriteError(stream, state, sync, er, cb) {
6823 --state.pendingcb;
6824
6825 if (sync) {
6826 // defer the callback if we are being called synchronously
6827 // to avoid piling up things on the stack
6828 processNextTick(cb, er);
6829 // this can emit finish, and it will always happen
6830 // after error
6831 processNextTick(finishMaybe, stream, state);
6832 stream._writableState.errorEmitted = true;
6833 stream.emit('error', er);
6834 } else {
6835 // the caller expect this to happen before if
6836 // it is async
6837 cb(er);
6838 stream._writableState.errorEmitted = true;
6839 stream.emit('error', er);
6840 // this can emit finish, but finish must
6841 // always follow error
6842 finishMaybe(stream, state);
6843 }
6844}
6845
6846function onwriteStateUpdate(state) {
6847 state.writing = false;
6848 state.writecb = null;
6849 state.length -= state.writelen;
6850 state.writelen = 0;
6851}
6852
6853function onwrite(stream, er) {
6854 var state = stream._writableState;
6855 var sync = state.sync;
6856 var cb = state.writecb;
6857
6858 onwriteStateUpdate(state);
6859
6860 if (er) onwriteError(stream, state, sync, er, cb);else {
6861 // Check if we're actually ready to finish, but don't emit yet
6862 var finished = needFinish(state);
6863
6864 if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
6865 clearBuffer(stream, state);
6866 }
6867
6868 if (sync) {
6869 /*<replacement>*/
6870 asyncWrite(afterWrite, stream, state, finished, cb);
6871 /*</replacement>*/
6872 } else {
6873 afterWrite(stream, state, finished, cb);
6874 }
6875 }
6876}
6877
6878function afterWrite(stream, state, finished, cb) {
6879 if (!finished) onwriteDrain(stream, state);
6880 state.pendingcb--;
6881 cb();
6882 finishMaybe(stream, state);
6883}
6884
6885// Must force callback to be called on nextTick, so that we don't
6886// emit 'drain' before the write() consumer gets the 'false' return
6887// value, and has a chance to attach a 'drain' listener.
6888function onwriteDrain(stream, state) {
6889 if (state.length === 0 && state.needDrain) {
6890 state.needDrain = false;
6891 stream.emit('drain');
6892 }
6893}
6894
6895// if there's something in the buffer waiting, then process it
6896function clearBuffer(stream, state) {
6897 state.bufferProcessing = true;
6898 var entry = state.bufferedRequest;
6899
6900 if (stream._writev && entry && entry.next) {
6901 // Fast case, write everything using _writev()
6902 var l = state.bufferedRequestCount;
6903 var buffer = new Array(l);
6904 var holder = state.corkedRequestsFree;
6905 holder.entry = entry;
6906
6907 var count = 0;
6908 var allBuffers = true;
6909 while (entry) {
6910 buffer[count] = entry;
6911 if (!entry.isBuf) allBuffers = false;
6912 entry = entry.next;
6913 count += 1;
6914 }
6915 buffer.allBuffers = allBuffers;
6916
6917 doWrite(stream, state, true, state.length, buffer, '', holder.finish);
6918
6919 // doWrite is almost always async, defer these to save a bit of time
6920 // as the hot path ends with doWrite
6921 state.pendingcb++;
6922 state.lastBufferedRequest = null;
6923 if (holder.next) {
6924 state.corkedRequestsFree = holder.next;
6925 holder.next = null;
6926 } else {
6927 state.corkedRequestsFree = new CorkedRequest(state);
6928 }
6929 } else {
6930 // Slow case, write chunks one-by-one
6931 while (entry) {
6932 var chunk = entry.chunk;
6933 var encoding = entry.encoding;
6934 var cb = entry.callback;
6935 var len = state.objectMode ? 1 : chunk.length;
6936
6937 doWrite(stream, state, false, len, chunk, encoding, cb);
6938 entry = entry.next;
6939 // if we didn't call the onwrite immediately, then
6940 // it means that we need to wait until it does.
6941 // also, that means that the chunk and cb are currently
6942 // being processed, so move the buffer counter past them.
6943 if (state.writing) {
6944 break;
6945 }
6946 }
6947
6948 if (entry === null) state.lastBufferedRequest = null;
6949 }
6950
6951 state.bufferedRequestCount = 0;
6952 state.bufferedRequest = entry;
6953 state.bufferProcessing = false;
6954}
6955
6956Writable.prototype._write = function (chunk, encoding, cb) {
6957 cb(new Error('_write() is not implemented'));
6958};
6959
6960Writable.prototype._writev = null;
6961
6962Writable.prototype.end = function (chunk, encoding, cb) {
6963 var state = this._writableState;
6964
6965 if (typeof chunk === 'function') {
6966 cb = chunk;
6967 chunk = null;
6968 encoding = null;
6969 } else if (typeof encoding === 'function') {
6970 cb = encoding;
6971 encoding = null;
6972 }
6973
6974 if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
6975
6976 // .end() fully uncorks
6977 if (state.corked) {
6978 state.corked = 1;
6979 this.uncork();
6980 }
6981
6982 // ignore unnecessary end() calls.
6983 if (!state.ending && !state.finished) endWritable(this, state, cb);
6984};
6985
6986function needFinish(state) {
6987 return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
6988}
6989function callFinal(stream, state) {
6990 stream._final(function (err) {
6991 state.pendingcb--;
6992 if (err) {
6993 stream.emit('error', err);
6994 }
6995 state.prefinished = true;
6996 stream.emit('prefinish');
6997 finishMaybe(stream, state);
6998 });
6999}
7000function prefinish(stream, state) {
7001 if (!state.prefinished && !state.finalCalled) {
7002 if (typeof stream._final === 'function') {
7003 state.pendingcb++;
7004 state.finalCalled = true;
7005 processNextTick(callFinal, stream, state);
7006 } else {
7007 state.prefinished = true;
7008 stream.emit('prefinish');
7009 }
7010 }
7011}
7012
7013function finishMaybe(stream, state) {
7014 var need = needFinish(state);
7015 if (need) {
7016 prefinish(stream, state);
7017 if (state.pendingcb === 0) {
7018 state.finished = true;
7019 stream.emit('finish');
7020 }
7021 }
7022 return need;
7023}
7024
7025function endWritable(stream, state, cb) {
7026 state.ending = true;
7027 finishMaybe(stream, state);
7028 if (cb) {
7029 if (state.finished) processNextTick(cb);else stream.once('finish', cb);
7030 }
7031 state.ended = true;
7032 stream.writable = false;
7033}
7034
7035function onCorkedFinish(corkReq, state, err) {
7036 var entry = corkReq.entry;
7037 corkReq.entry = null;
7038 while (entry) {
7039 var cb = entry.callback;
7040 state.pendingcb--;
7041 cb(err);
7042 entry = entry.next;
7043 }
7044 if (state.corkedRequestsFree) {
7045 state.corkedRequestsFree.next = corkReq;
7046 } else {
7047 state.corkedRequestsFree = corkReq;
7048 }
7049}
7050
7051Object.defineProperty(Writable.prototype, 'destroyed', {
7052 get: function () {
7053 if (this._writableState === undefined) {
7054 return false;
7055 }
7056 return this._writableState.destroyed;
7057 },
7058 set: function (value) {
7059 // we ignore the value if the stream
7060 // has not been initialized yet
7061 if (!this._writableState) {
7062 return;
7063 }
7064
7065 // backward compatibility, the user is explicitly
7066 // managing destroyed
7067 this._writableState.destroyed = value;
7068 }
7069});
7070
7071Writable.prototype.destroy = destroyImpl.destroy;
7072Writable.prototype._undestroy = destroyImpl.undestroy;
7073Writable.prototype._destroy = function (err, cb) {
7074 this.end();
7075 cb(err);
7076};
7077}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
7078},{"./_stream_duplex":27,"./internal/streams/destroy":33,"./internal/streams/stream":34,"_process":25,"core-util-is":14,"inherits":21,"process-nextick-args":24,"safe-buffer":40,"util-deprecate":51}],32:[function(require,module,exports){
7079'use strict';
7080
7081/*<replacement>*/
7082
7083function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7084
7085var Buffer = require('safe-buffer').Buffer;
7086/*</replacement>*/
7087
7088function copyBuffer(src, target, offset) {
7089 src.copy(target, offset);
7090}
7091
7092module.exports = function () {
7093 function BufferList() {
7094 _classCallCheck(this, BufferList);
7095
7096 this.head = null;
7097 this.tail = null;
7098 this.length = 0;
7099 }
7100
7101 BufferList.prototype.push = function push(v) {
7102 var entry = { data: v, next: null };
7103 if (this.length > 0) this.tail.next = entry;else this.head = entry;
7104 this.tail = entry;
7105 ++this.length;
7106 };
7107
7108 BufferList.prototype.unshift = function unshift(v) {
7109 var entry = { data: v, next: this.head };
7110 if (this.length === 0) this.tail = entry;
7111 this.head = entry;
7112 ++this.length;
7113 };
7114
7115 BufferList.prototype.shift = function shift() {
7116 if (this.length === 0) return;
7117 var ret = this.head.data;
7118 if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
7119 --this.length;
7120 return ret;
7121 };
7122
7123 BufferList.prototype.clear = function clear() {
7124 this.head = this.tail = null;
7125 this.length = 0;
7126 };
7127
7128 BufferList.prototype.join = function join(s) {
7129 if (this.length === 0) return '';
7130 var p = this.head;
7131 var ret = '' + p.data;
7132 while (p = p.next) {
7133 ret += s + p.data;
7134 }return ret;
7135 };
7136
7137 BufferList.prototype.concat = function concat(n) {
7138 if (this.length === 0) return Buffer.alloc(0);
7139 if (this.length === 1) return this.head.data;
7140 var ret = Buffer.allocUnsafe(n >>> 0);
7141 var p = this.head;
7142 var i = 0;
7143 while (p) {
7144 copyBuffer(p.data, ret, i);
7145 i += p.data.length;
7146 p = p.next;
7147 }
7148 return ret;
7149 };
7150
7151 return BufferList;
7152}();
7153},{"safe-buffer":40}],33:[function(require,module,exports){
7154'use strict';
7155
7156/*<replacement>*/
7157
7158var processNextTick = require('process-nextick-args');
7159/*</replacement>*/
7160
7161// undocumented cb() API, needed for core, not for public API
7162function destroy(err, cb) {
7163 var _this = this;
7164
7165 var readableDestroyed = this._readableState && this._readableState.destroyed;
7166 var writableDestroyed = this._writableState && this._writableState.destroyed;
7167
7168 if (readableDestroyed || writableDestroyed) {
7169 if (cb) {
7170 cb(err);
7171 } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
7172 processNextTick(emitErrorNT, this, err);
7173 }
7174 return;
7175 }
7176
7177 // we set destroyed to true before firing error callbacks in order
7178 // to make it re-entrance safe in case destroy() is called within callbacks
7179
7180 if (this._readableState) {
7181 this._readableState.destroyed = true;
7182 }
7183
7184 // if this is a duplex stream mark the writable part as destroyed as well
7185 if (this._writableState) {
7186 this._writableState.destroyed = true;
7187 }
7188
7189 this._destroy(err || null, function (err) {
7190 if (!cb && err) {
7191 processNextTick(emitErrorNT, _this, err);
7192 if (_this._writableState) {
7193 _this._writableState.errorEmitted = true;
7194 }
7195 } else if (cb) {
7196 cb(err);
7197 }
7198 });
7199}
7200
7201function undestroy() {
7202 if (this._readableState) {
7203 this._readableState.destroyed = false;
7204 this._readableState.reading = false;
7205 this._readableState.ended = false;
7206 this._readableState.endEmitted = false;
7207 }
7208
7209 if (this._writableState) {
7210 this._writableState.destroyed = false;
7211 this._writableState.ended = false;
7212 this._writableState.ending = false;
7213 this._writableState.finished = false;
7214 this._writableState.errorEmitted = false;
7215 }
7216}
7217
7218function emitErrorNT(self, err) {
7219 self.emit('error', err);
7220}
7221
7222module.exports = {
7223 destroy: destroy,
7224 undestroy: undestroy
7225};
7226},{"process-nextick-args":24}],34:[function(require,module,exports){
7227module.exports = require('events').EventEmitter;
7228
7229},{"events":18}],35:[function(require,module,exports){
7230module.exports = require('./readable').PassThrough
7231
7232},{"./readable":36}],36:[function(require,module,exports){
7233exports = module.exports = require('./lib/_stream_readable.js');
7234exports.Stream = exports;
7235exports.Readable = exports;
7236exports.Writable = require('./lib/_stream_writable.js');
7237exports.Duplex = require('./lib/_stream_duplex.js');
7238exports.Transform = require('./lib/_stream_transform.js');
7239exports.PassThrough = require('./lib/_stream_passthrough.js');
7240
7241},{"./lib/_stream_duplex.js":27,"./lib/_stream_passthrough.js":28,"./lib/_stream_readable.js":29,"./lib/_stream_transform.js":30,"./lib/_stream_writable.js":31}],37:[function(require,module,exports){
7242module.exports = require('./readable').Transform
7243
7244},{"./readable":36}],38:[function(require,module,exports){
7245module.exports = require('./lib/_stream_writable.js');
7246
7247},{"./lib/_stream_writable.js":31}],39:[function(require,module,exports){
7248(function (Buffer){
7249'use strict'
7250var inherits = require('inherits')
7251var HashBase = require('hash-base')
7252
7253function RIPEMD160 () {
7254 HashBase.call(this, 64)
7255
7256 // state
7257 this._a = 0x67452301
7258 this._b = 0xefcdab89
7259 this._c = 0x98badcfe
7260 this._d = 0x10325476
7261 this._e = 0xc3d2e1f0
7262}
7263
7264inherits(RIPEMD160, HashBase)
7265
7266RIPEMD160.prototype._update = function () {
7267 var m = new Array(16)
7268 for (var i = 0; i < 16; ++i) m[i] = this._block.readInt32LE(i * 4)
7269
7270 var al = this._a
7271 var bl = this._b
7272 var cl = this._c
7273 var dl = this._d
7274 var el = this._e
7275
7276 // Mj = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
7277 // K = 0x00000000
7278 // Sj = 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8
7279 al = fn1(al, bl, cl, dl, el, m[0], 0x00000000, 11); cl = rotl(cl, 10)
7280 el = fn1(el, al, bl, cl, dl, m[1], 0x00000000, 14); bl = rotl(bl, 10)
7281 dl = fn1(dl, el, al, bl, cl, m[2], 0x00000000, 15); al = rotl(al, 10)
7282 cl = fn1(cl, dl, el, al, bl, m[3], 0x00000000, 12); el = rotl(el, 10)
7283 bl = fn1(bl, cl, dl, el, al, m[4], 0x00000000, 5); dl = rotl(dl, 10)
7284 al = fn1(al, bl, cl, dl, el, m[5], 0x00000000, 8); cl = rotl(cl, 10)
7285 el = fn1(el, al, bl, cl, dl, m[6], 0x00000000, 7); bl = rotl(bl, 10)
7286 dl = fn1(dl, el, al, bl, cl, m[7], 0x00000000, 9); al = rotl(al, 10)
7287 cl = fn1(cl, dl, el, al, bl, m[8], 0x00000000, 11); el = rotl(el, 10)
7288 bl = fn1(bl, cl, dl, el, al, m[9], 0x00000000, 13); dl = rotl(dl, 10)
7289 al = fn1(al, bl, cl, dl, el, m[10], 0x00000000, 14); cl = rotl(cl, 10)
7290 el = fn1(el, al, bl, cl, dl, m[11], 0x00000000, 15); bl = rotl(bl, 10)
7291 dl = fn1(dl, el, al, bl, cl, m[12], 0x00000000, 6); al = rotl(al, 10)
7292 cl = fn1(cl, dl, el, al, bl, m[13], 0x00000000, 7); el = rotl(el, 10)
7293 bl = fn1(bl, cl, dl, el, al, m[14], 0x00000000, 9); dl = rotl(dl, 10)
7294 al = fn1(al, bl, cl, dl, el, m[15], 0x00000000, 8); cl = rotl(cl, 10)
7295
7296 // Mj = 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8
7297 // K = 0x5a827999
7298 // Sj = 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12
7299 el = fn2(el, al, bl, cl, dl, m[7], 0x5a827999, 7); bl = rotl(bl, 10)
7300 dl = fn2(dl, el, al, bl, cl, m[4], 0x5a827999, 6); al = rotl(al, 10)
7301 cl = fn2(cl, dl, el, al, bl, m[13], 0x5a827999, 8); el = rotl(el, 10)
7302 bl = fn2(bl, cl, dl, el, al, m[1], 0x5a827999, 13); dl = rotl(dl, 10)
7303 al = fn2(al, bl, cl, dl, el, m[10], 0x5a827999, 11); cl = rotl(cl, 10)
7304 el = fn2(el, al, bl, cl, dl, m[6], 0x5a827999, 9); bl = rotl(bl, 10)
7305 dl = fn2(dl, el, al, bl, cl, m[15], 0x5a827999, 7); al = rotl(al, 10)
7306 cl = fn2(cl, dl, el, al, bl, m[3], 0x5a827999, 15); el = rotl(el, 10)
7307 bl = fn2(bl, cl, dl, el, al, m[12], 0x5a827999, 7); dl = rotl(dl, 10)
7308 al = fn2(al, bl, cl, dl, el, m[0], 0x5a827999, 12); cl = rotl(cl, 10)
7309 el = fn2(el, al, bl, cl, dl, m[9], 0x5a827999, 15); bl = rotl(bl, 10)
7310 dl = fn2(dl, el, al, bl, cl, m[5], 0x5a827999, 9); al = rotl(al, 10)
7311 cl = fn2(cl, dl, el, al, bl, m[2], 0x5a827999, 11); el = rotl(el, 10)
7312 bl = fn2(bl, cl, dl, el, al, m[14], 0x5a827999, 7); dl = rotl(dl, 10)
7313 al = fn2(al, bl, cl, dl, el, m[11], 0x5a827999, 13); cl = rotl(cl, 10)
7314 el = fn2(el, al, bl, cl, dl, m[8], 0x5a827999, 12); bl = rotl(bl, 10)
7315
7316 // Mj = 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12
7317 // K = 0x6ed9eba1
7318 // Sj = 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5
7319 dl = fn3(dl, el, al, bl, cl, m[3], 0x6ed9eba1, 11); al = rotl(al, 10)
7320 cl = fn3(cl, dl, el, al, bl, m[10], 0x6ed9eba1, 13); el = rotl(el, 10)
7321 bl = fn3(bl, cl, dl, el, al, m[14], 0x6ed9eba1, 6); dl = rotl(dl, 10)
7322 al = fn3(al, bl, cl, dl, el, m[4], 0x6ed9eba1, 7); cl = rotl(cl, 10)
7323 el = fn3(el, al, bl, cl, dl, m[9], 0x6ed9eba1, 14); bl = rotl(bl, 10)
7324 dl = fn3(dl, el, al, bl, cl, m[15], 0x6ed9eba1, 9); al = rotl(al, 10)
7325 cl = fn3(cl, dl, el, al, bl, m[8], 0x6ed9eba1, 13); el = rotl(el, 10)
7326 bl = fn3(bl, cl, dl, el, al, m[1], 0x6ed9eba1, 15); dl = rotl(dl, 10)
7327 al = fn3(al, bl, cl, dl, el, m[2], 0x6ed9eba1, 14); cl = rotl(cl, 10)
7328 el = fn3(el, al, bl, cl, dl, m[7], 0x6ed9eba1, 8); bl = rotl(bl, 10)
7329 dl = fn3(dl, el, al, bl, cl, m[0], 0x6ed9eba1, 13); al = rotl(al, 10)
7330 cl = fn3(cl, dl, el, al, bl, m[6], 0x6ed9eba1, 6); el = rotl(el, 10)
7331 bl = fn3(bl, cl, dl, el, al, m[13], 0x6ed9eba1, 5); dl = rotl(dl, 10)
7332 al = fn3(al, bl, cl, dl, el, m[11], 0x6ed9eba1, 12); cl = rotl(cl, 10)
7333 el = fn3(el, al, bl, cl, dl, m[5], 0x6ed9eba1, 7); bl = rotl(bl, 10)
7334 dl = fn3(dl, el, al, bl, cl, m[12], 0x6ed9eba1, 5); al = rotl(al, 10)
7335
7336 // Mj = 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2
7337 // K = 0x8f1bbcdc
7338 // Sj = 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12
7339 cl = fn4(cl, dl, el, al, bl, m[1], 0x8f1bbcdc, 11); el = rotl(el, 10)
7340 bl = fn4(bl, cl, dl, el, al, m[9], 0x8f1bbcdc, 12); dl = rotl(dl, 10)
7341 al = fn4(al, bl, cl, dl, el, m[11], 0x8f1bbcdc, 14); cl = rotl(cl, 10)
7342 el = fn4(el, al, bl, cl, dl, m[10], 0x8f1bbcdc, 15); bl = rotl(bl, 10)
7343 dl = fn4(dl, el, al, bl, cl, m[0], 0x8f1bbcdc, 14); al = rotl(al, 10)
7344 cl = fn4(cl, dl, el, al, bl, m[8], 0x8f1bbcdc, 15); el = rotl(el, 10)
7345 bl = fn4(bl, cl, dl, el, al, m[12], 0x8f1bbcdc, 9); dl = rotl(dl, 10)
7346 al = fn4(al, bl, cl, dl, el, m[4], 0x8f1bbcdc, 8); cl = rotl(cl, 10)
7347 el = fn4(el, al, bl, cl, dl, m[13], 0x8f1bbcdc, 9); bl = rotl(bl, 10)
7348 dl = fn4(dl, el, al, bl, cl, m[3], 0x8f1bbcdc, 14); al = rotl(al, 10)
7349 cl = fn4(cl, dl, el, al, bl, m[7], 0x8f1bbcdc, 5); el = rotl(el, 10)
7350 bl = fn4(bl, cl, dl, el, al, m[15], 0x8f1bbcdc, 6); dl = rotl(dl, 10)
7351 al = fn4(al, bl, cl, dl, el, m[14], 0x8f1bbcdc, 8); cl = rotl(cl, 10)
7352 el = fn4(el, al, bl, cl, dl, m[5], 0x8f1bbcdc, 6); bl = rotl(bl, 10)
7353 dl = fn4(dl, el, al, bl, cl, m[6], 0x8f1bbcdc, 5); al = rotl(al, 10)
7354 cl = fn4(cl, dl, el, al, bl, m[2], 0x8f1bbcdc, 12); el = rotl(el, 10)
7355
7356 // Mj = 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
7357 // K = 0xa953fd4e
7358 // Sj = 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
7359 bl = fn5(bl, cl, dl, el, al, m[4], 0xa953fd4e, 9); dl = rotl(dl, 10)
7360 al = fn5(al, bl, cl, dl, el, m[0], 0xa953fd4e, 15); cl = rotl(cl, 10)
7361 el = fn5(el, al, bl, cl, dl, m[5], 0xa953fd4e, 5); bl = rotl(bl, 10)
7362 dl = fn5(dl, el, al, bl, cl, m[9], 0xa953fd4e, 11); al = rotl(al, 10)
7363 cl = fn5(cl, dl, el, al, bl, m[7], 0xa953fd4e, 6); el = rotl(el, 10)
7364 bl = fn5(bl, cl, dl, el, al, m[12], 0xa953fd4e, 8); dl = rotl(dl, 10)
7365 al = fn5(al, bl, cl, dl, el, m[2], 0xa953fd4e, 13); cl = rotl(cl, 10)
7366 el = fn5(el, al, bl, cl, dl, m[10], 0xa953fd4e, 12); bl = rotl(bl, 10)
7367 dl = fn5(dl, el, al, bl, cl, m[14], 0xa953fd4e, 5); al = rotl(al, 10)
7368 cl = fn5(cl, dl, el, al, bl, m[1], 0xa953fd4e, 12); el = rotl(el, 10)
7369 bl = fn5(bl, cl, dl, el, al, m[3], 0xa953fd4e, 13); dl = rotl(dl, 10)
7370 al = fn5(al, bl, cl, dl, el, m[8], 0xa953fd4e, 14); cl = rotl(cl, 10)
7371 el = fn5(el, al, bl, cl, dl, m[11], 0xa953fd4e, 11); bl = rotl(bl, 10)
7372 dl = fn5(dl, el, al, bl, cl, m[6], 0xa953fd4e, 8); al = rotl(al, 10)
7373 cl = fn5(cl, dl, el, al, bl, m[15], 0xa953fd4e, 5); el = rotl(el, 10)
7374 bl = fn5(bl, cl, dl, el, al, m[13], 0xa953fd4e, 6); dl = rotl(dl, 10)
7375
7376 var ar = this._a
7377 var br = this._b
7378 var cr = this._c
7379 var dr = this._d
7380 var er = this._e
7381
7382 // M'j = 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12
7383 // K' = 0x50a28be6
7384 // S'j = 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6
7385 ar = fn5(ar, br, cr, dr, er, m[5], 0x50a28be6, 8); cr = rotl(cr, 10)
7386 er = fn5(er, ar, br, cr, dr, m[14], 0x50a28be6, 9); br = rotl(br, 10)
7387 dr = fn5(dr, er, ar, br, cr, m[7], 0x50a28be6, 9); ar = rotl(ar, 10)
7388 cr = fn5(cr, dr, er, ar, br, m[0], 0x50a28be6, 11); er = rotl(er, 10)
7389 br = fn5(br, cr, dr, er, ar, m[9], 0x50a28be6, 13); dr = rotl(dr, 10)
7390 ar = fn5(ar, br, cr, dr, er, m[2], 0x50a28be6, 15); cr = rotl(cr, 10)
7391 er = fn5(er, ar, br, cr, dr, m[11], 0x50a28be6, 15); br = rotl(br, 10)
7392 dr = fn5(dr, er, ar, br, cr, m[4], 0x50a28be6, 5); ar = rotl(ar, 10)
7393 cr = fn5(cr, dr, er, ar, br, m[13], 0x50a28be6, 7); er = rotl(er, 10)
7394 br = fn5(br, cr, dr, er, ar, m[6], 0x50a28be6, 7); dr = rotl(dr, 10)
7395 ar = fn5(ar, br, cr, dr, er, m[15], 0x50a28be6, 8); cr = rotl(cr, 10)
7396 er = fn5(er, ar, br, cr, dr, m[8], 0x50a28be6, 11); br = rotl(br, 10)
7397 dr = fn5(dr, er, ar, br, cr, m[1], 0x50a28be6, 14); ar = rotl(ar, 10)
7398 cr = fn5(cr, dr, er, ar, br, m[10], 0x50a28be6, 14); er = rotl(er, 10)
7399 br = fn5(br, cr, dr, er, ar, m[3], 0x50a28be6, 12); dr = rotl(dr, 10)
7400 ar = fn5(ar, br, cr, dr, er, m[12], 0x50a28be6, 6); cr = rotl(cr, 10)
7401
7402 // M'j = 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2
7403 // K' = 0x5c4dd124
7404 // S'j = 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11
7405 er = fn4(er, ar, br, cr, dr, m[6], 0x5c4dd124, 9); br = rotl(br, 10)
7406 dr = fn4(dr, er, ar, br, cr, m[11], 0x5c4dd124, 13); ar = rotl(ar, 10)
7407 cr = fn4(cr, dr, er, ar, br, m[3], 0x5c4dd124, 15); er = rotl(er, 10)
7408 br = fn4(br, cr, dr, er, ar, m[7], 0x5c4dd124, 7); dr = rotl(dr, 10)
7409 ar = fn4(ar, br, cr, dr, er, m[0], 0x5c4dd124, 12); cr = rotl(cr, 10)
7410 er = fn4(er, ar, br, cr, dr, m[13], 0x5c4dd124, 8); br = rotl(br, 10)
7411 dr = fn4(dr, er, ar, br, cr, m[5], 0x5c4dd124, 9); ar = rotl(ar, 10)
7412 cr = fn4(cr, dr, er, ar, br, m[10], 0x5c4dd124, 11); er = rotl(er, 10)
7413 br = fn4(br, cr, dr, er, ar, m[14], 0x5c4dd124, 7); dr = rotl(dr, 10)
7414 ar = fn4(ar, br, cr, dr, er, m[15], 0x5c4dd124, 7); cr = rotl(cr, 10)
7415 er = fn4(er, ar, br, cr, dr, m[8], 0x5c4dd124, 12); br = rotl(br, 10)
7416 dr = fn4(dr, er, ar, br, cr, m[12], 0x5c4dd124, 7); ar = rotl(ar, 10)
7417 cr = fn4(cr, dr, er, ar, br, m[4], 0x5c4dd124, 6); er = rotl(er, 10)
7418 br = fn4(br, cr, dr, er, ar, m[9], 0x5c4dd124, 15); dr = rotl(dr, 10)
7419 ar = fn4(ar, br, cr, dr, er, m[1], 0x5c4dd124, 13); cr = rotl(cr, 10)
7420 er = fn4(er, ar, br, cr, dr, m[2], 0x5c4dd124, 11); br = rotl(br, 10)
7421
7422 // M'j = 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13
7423 // K' = 0x6d703ef3
7424 // S'j = 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5
7425 dr = fn3(dr, er, ar, br, cr, m[15], 0x6d703ef3, 9); ar = rotl(ar, 10)
7426 cr = fn3(cr, dr, er, ar, br, m[5], 0x6d703ef3, 7); er = rotl(er, 10)
7427 br = fn3(br, cr, dr, er, ar, m[1], 0x6d703ef3, 15); dr = rotl(dr, 10)
7428 ar = fn3(ar, br, cr, dr, er, m[3], 0x6d703ef3, 11); cr = rotl(cr, 10)
7429 er = fn3(er, ar, br, cr, dr, m[7], 0x6d703ef3, 8); br = rotl(br, 10)
7430 dr = fn3(dr, er, ar, br, cr, m[14], 0x6d703ef3, 6); ar = rotl(ar, 10)
7431 cr = fn3(cr, dr, er, ar, br, m[6], 0x6d703ef3, 6); er = rotl(er, 10)
7432 br = fn3(br, cr, dr, er, ar, m[9], 0x6d703ef3, 14); dr = rotl(dr, 10)
7433 ar = fn3(ar, br, cr, dr, er, m[11], 0x6d703ef3, 12); cr = rotl(cr, 10)
7434 er = fn3(er, ar, br, cr, dr, m[8], 0x6d703ef3, 13); br = rotl(br, 10)
7435 dr = fn3(dr, er, ar, br, cr, m[12], 0x6d703ef3, 5); ar = rotl(ar, 10)
7436 cr = fn3(cr, dr, er, ar, br, m[2], 0x6d703ef3, 14); er = rotl(er, 10)
7437 br = fn3(br, cr, dr, er, ar, m[10], 0x6d703ef3, 13); dr = rotl(dr, 10)
7438 ar = fn3(ar, br, cr, dr, er, m[0], 0x6d703ef3, 13); cr = rotl(cr, 10)
7439 er = fn3(er, ar, br, cr, dr, m[4], 0x6d703ef3, 7); br = rotl(br, 10)
7440 dr = fn3(dr, er, ar, br, cr, m[13], 0x6d703ef3, 5); ar = rotl(ar, 10)
7441
7442 // M'j = 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14
7443 // K' = 0x7a6d76e9
7444 // S'j = 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8
7445 cr = fn2(cr, dr, er, ar, br, m[8], 0x7a6d76e9, 15); er = rotl(er, 10)
7446 br = fn2(br, cr, dr, er, ar, m[6], 0x7a6d76e9, 5); dr = rotl(dr, 10)
7447 ar = fn2(ar, br, cr, dr, er, m[4], 0x7a6d76e9, 8); cr = rotl(cr, 10)
7448 er = fn2(er, ar, br, cr, dr, m[1], 0x7a6d76e9, 11); br = rotl(br, 10)
7449 dr = fn2(dr, er, ar, br, cr, m[3], 0x7a6d76e9, 14); ar = rotl(ar, 10)
7450 cr = fn2(cr, dr, er, ar, br, m[11], 0x7a6d76e9, 14); er = rotl(er, 10)
7451 br = fn2(br, cr, dr, er, ar, m[15], 0x7a6d76e9, 6); dr = rotl(dr, 10)
7452 ar = fn2(ar, br, cr, dr, er, m[0], 0x7a6d76e9, 14); cr = rotl(cr, 10)
7453 er = fn2(er, ar, br, cr, dr, m[5], 0x7a6d76e9, 6); br = rotl(br, 10)
7454 dr = fn2(dr, er, ar, br, cr, m[12], 0x7a6d76e9, 9); ar = rotl(ar, 10)
7455 cr = fn2(cr, dr, er, ar, br, m[2], 0x7a6d76e9, 12); er = rotl(er, 10)
7456 br = fn2(br, cr, dr, er, ar, m[13], 0x7a6d76e9, 9); dr = rotl(dr, 10)
7457 ar = fn2(ar, br, cr, dr, er, m[9], 0x7a6d76e9, 12); cr = rotl(cr, 10)
7458 er = fn2(er, ar, br, cr, dr, m[7], 0x7a6d76e9, 5); br = rotl(br, 10)
7459 dr = fn2(dr, er, ar, br, cr, m[10], 0x7a6d76e9, 15); ar = rotl(ar, 10)
7460 cr = fn2(cr, dr, er, ar, br, m[14], 0x7a6d76e9, 8); er = rotl(er, 10)
7461
7462 // M'j = 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
7463 // K' = 0x00000000
7464 // S'j = 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
7465 br = fn1(br, cr, dr, er, ar, m[12], 0x00000000, 8); dr = rotl(dr, 10)
7466 ar = fn1(ar, br, cr, dr, er, m[15], 0x00000000, 5); cr = rotl(cr, 10)
7467 er = fn1(er, ar, br, cr, dr, m[10], 0x00000000, 12); br = rotl(br, 10)
7468 dr = fn1(dr, er, ar, br, cr, m[4], 0x00000000, 9); ar = rotl(ar, 10)
7469 cr = fn1(cr, dr, er, ar, br, m[1], 0x00000000, 12); er = rotl(er, 10)
7470 br = fn1(br, cr, dr, er, ar, m[5], 0x00000000, 5); dr = rotl(dr, 10)
7471 ar = fn1(ar, br, cr, dr, er, m[8], 0x00000000, 14); cr = rotl(cr, 10)
7472 er = fn1(er, ar, br, cr, dr, m[7], 0x00000000, 6); br = rotl(br, 10)
7473 dr = fn1(dr, er, ar, br, cr, m[6], 0x00000000, 8); ar = rotl(ar, 10)
7474 cr = fn1(cr, dr, er, ar, br, m[2], 0x00000000, 13); er = rotl(er, 10)
7475 br = fn1(br, cr, dr, er, ar, m[13], 0x00000000, 6); dr = rotl(dr, 10)
7476 ar = fn1(ar, br, cr, dr, er, m[14], 0x00000000, 5); cr = rotl(cr, 10)
7477 er = fn1(er, ar, br, cr, dr, m[0], 0x00000000, 15); br = rotl(br, 10)
7478 dr = fn1(dr, er, ar, br, cr, m[3], 0x00000000, 13); ar = rotl(ar, 10)
7479 cr = fn1(cr, dr, er, ar, br, m[9], 0x00000000, 11); er = rotl(er, 10)
7480 br = fn1(br, cr, dr, er, ar, m[11], 0x00000000, 11); dr = rotl(dr, 10)
7481
7482 // change state
7483 var t = (this._b + cl + dr) | 0
7484 this._b = (this._c + dl + er) | 0
7485 this._c = (this._d + el + ar) | 0
7486 this._d = (this._e + al + br) | 0
7487 this._e = (this._a + bl + cr) | 0
7488 this._a = t
7489}
7490
7491RIPEMD160.prototype._digest = function () {
7492 // create padding and handle blocks
7493 this._block[this._blockOffset++] = 0x80
7494 if (this._blockOffset > 56) {
7495 this._block.fill(0, this._blockOffset, 64)
7496 this._update()
7497 this._blockOffset = 0
7498 }
7499
7500 this._block.fill(0, this._blockOffset, 56)
7501 this._block.writeUInt32LE(this._length[0], 56)
7502 this._block.writeUInt32LE(this._length[1], 60)
7503 this._update()
7504
7505 // produce result
7506 var buffer = new Buffer(20)
7507 buffer.writeInt32LE(this._a, 0)
7508 buffer.writeInt32LE(this._b, 4)
7509 buffer.writeInt32LE(this._c, 8)
7510 buffer.writeInt32LE(this._d, 12)
7511 buffer.writeInt32LE(this._e, 16)
7512 return buffer
7513}
7514
7515function rotl (x, n) {
7516 return (x << n) | (x >>> (32 - n))
7517}
7518
7519function fn1 (a, b, c, d, e, m, k, s) {
7520 return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0
7521}
7522
7523function fn2 (a, b, c, d, e, m, k, s) {
7524 return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0
7525}
7526
7527function fn3 (a, b, c, d, e, m, k, s) {
7528 return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0
7529}
7530
7531function fn4 (a, b, c, d, e, m, k, s) {
7532 return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0
7533}
7534
7535function fn5 (a, b, c, d, e, m, k, s) {
7536 return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0
7537}
7538
7539module.exports = RIPEMD160
7540
7541}).call(this,require("buffer").Buffer)
7542},{"buffer":8,"hash-base":19,"inherits":21}],40:[function(require,module,exports){
7543/* eslint-disable node/no-deprecated-api */
7544var buffer = require('buffer')
7545var Buffer = buffer.Buffer
7546
7547// alternative to using Object.keys for old browsers
7548function copyProps (src, dst) {
7549 for (var key in src) {
7550 dst[key] = src[key]
7551 }
7552}
7553if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
7554 module.exports = buffer
7555} else {
7556 // Copy properties from require('buffer')
7557 copyProps(buffer, exports)
7558 exports.Buffer = SafeBuffer
7559}
7560
7561function SafeBuffer (arg, encodingOrOffset, length) {
7562 return Buffer(arg, encodingOrOffset, length)
7563}
7564
7565// Copy static methods from Buffer
7566copyProps(Buffer, SafeBuffer)
7567
7568SafeBuffer.from = function (arg, encodingOrOffset, length) {
7569 if (typeof arg === 'number') {
7570 throw new TypeError('Argument must not be a number')
7571 }
7572 return Buffer(arg, encodingOrOffset, length)
7573}
7574
7575SafeBuffer.alloc = function (size, fill, encoding) {
7576 if (typeof size !== 'number') {
7577 throw new TypeError('Argument must be a number')
7578 }
7579 var buf = Buffer(size)
7580 if (fill !== undefined) {
7581 if (typeof encoding === 'string') {
7582 buf.fill(fill, encoding)
7583 } else {
7584 buf.fill(fill)
7585 }
7586 } else {
7587 buf.fill(0)
7588 }
7589 return buf
7590}
7591
7592SafeBuffer.allocUnsafe = function (size) {
7593 if (typeof size !== 'number') {
7594 throw new TypeError('Argument must be a number')
7595 }
7596 return Buffer(size)
7597}
7598
7599SafeBuffer.allocUnsafeSlow = function (size) {
7600 if (typeof size !== 'number') {
7601 throw new TypeError('Argument must be a number')
7602 }
7603 return buffer.SlowBuffer(size)
7604}
7605
7606},{"buffer":8}],41:[function(require,module,exports){
7607var Buffer = require('safe-buffer').Buffer
7608
7609// prototype class for hash functions
7610function Hash (blockSize, finalSize) {
7611 this._block = Buffer.alloc(blockSize)
7612 this._finalSize = finalSize
7613 this._blockSize = blockSize
7614 this._len = 0
7615}
7616
7617Hash.prototype.update = function (data, enc) {
7618 if (typeof data === 'string') {
7619 enc = enc || 'utf8'
7620 data = Buffer.from(data, enc)
7621 }
7622
7623 var block = this._block
7624 var blockSize = this._blockSize
7625 var length = data.length
7626 var accum = this._len
7627
7628 for (var offset = 0; offset < length;) {
7629 var assigned = accum % blockSize
7630 var remainder = Math.min(length - offset, blockSize - assigned)
7631
7632 for (var i = 0; i < remainder; i++) {
7633 block[assigned + i] = data[offset + i]
7634 }
7635
7636 accum += remainder
7637 offset += remainder
7638
7639 if ((accum % blockSize) === 0) {
7640 this._update(block)
7641 }
7642 }
7643
7644 this._len += length
7645 return this
7646}
7647
7648Hash.prototype.digest = function (enc) {
7649 var rem = this._len % this._blockSize
7650
7651 this._block[rem] = 0x80
7652
7653 // zero (rem + 1) trailing bits, where (rem + 1) is the smallest
7654 // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize
7655 this._block.fill(0, rem + 1)
7656
7657 if (rem >= this._finalSize) {
7658 this._update(this._block)
7659 this._block.fill(0)
7660 }
7661
7662 var bits = this._len * 8
7663
7664 // uint32
7665 if (bits <= 0xffffffff) {
7666 this._block.writeUInt32BE(bits, this._blockSize - 4)
7667
7668 // uint64
7669 } else {
7670 var lowBits = bits & 0xffffffff
7671 var highBits = (bits - lowBits) / 0x100000000
7672
7673 this._block.writeUInt32BE(highBits, this._blockSize - 8)
7674 this._block.writeUInt32BE(lowBits, this._blockSize - 4)
7675 }
7676
7677 this._update(this._block)
7678 var hash = this._hash()
7679
7680 return enc ? hash.toString(enc) : hash
7681}
7682
7683Hash.prototype._update = function () {
7684 throw new Error('_update must be implemented by subclass')
7685}
7686
7687module.exports = Hash
7688
7689},{"safe-buffer":40}],42:[function(require,module,exports){
7690var exports = module.exports = function SHA (algorithm) {
7691 algorithm = algorithm.toLowerCase()
7692
7693 var Algorithm = exports[algorithm]
7694 if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
7695
7696 return new Algorithm()
7697}
7698
7699exports.sha = require('./sha')
7700exports.sha1 = require('./sha1')
7701exports.sha224 = require('./sha224')
7702exports.sha256 = require('./sha256')
7703exports.sha384 = require('./sha384')
7704exports.sha512 = require('./sha512')
7705
7706},{"./sha":43,"./sha1":44,"./sha224":45,"./sha256":46,"./sha384":47,"./sha512":48}],43:[function(require,module,exports){
7707/*
7708 * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
7709 * in FIPS PUB 180-1
7710 * This source code is derived from sha1.js of the same repository.
7711 * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
7712 * operation was added.
7713 */
7714
7715var inherits = require('inherits')
7716var Hash = require('./hash')
7717var Buffer = require('safe-buffer').Buffer
7718
7719var K = [
7720 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
7721]
7722
7723var W = new Array(80)
7724
7725function Sha () {
7726 this.init()
7727 this._w = W
7728
7729 Hash.call(this, 64, 56)
7730}
7731
7732inherits(Sha, Hash)
7733
7734Sha.prototype.init = function () {
7735 this._a = 0x67452301
7736 this._b = 0xefcdab89
7737 this._c = 0x98badcfe
7738 this._d = 0x10325476
7739 this._e = 0xc3d2e1f0
7740
7741 return this
7742}
7743
7744function rotl5 (num) {
7745 return (num << 5) | (num >>> 27)
7746}
7747
7748function rotl30 (num) {
7749 return (num << 30) | (num >>> 2)
7750}
7751
7752function ft (s, b, c, d) {
7753 if (s === 0) return (b & c) | ((~b) & d)
7754 if (s === 2) return (b & c) | (b & d) | (c & d)
7755 return b ^ c ^ d
7756}
7757
7758Sha.prototype._update = function (M) {
7759 var W = this._w
7760
7761 var a = this._a | 0
7762 var b = this._b | 0
7763 var c = this._c | 0
7764 var d = this._d | 0
7765 var e = this._e | 0
7766
7767 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
7768 for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]
7769
7770 for (var j = 0; j < 80; ++j) {
7771 var s = ~~(j / 20)
7772 var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
7773
7774 e = d
7775 d = c
7776 c = rotl30(b)
7777 b = a
7778 a = t
7779 }
7780
7781 this._a = (a + this._a) | 0
7782 this._b = (b + this._b) | 0
7783 this._c = (c + this._c) | 0
7784 this._d = (d + this._d) | 0
7785 this._e = (e + this._e) | 0
7786}
7787
7788Sha.prototype._hash = function () {
7789 var H = Buffer.allocUnsafe(20)
7790
7791 H.writeInt32BE(this._a | 0, 0)
7792 H.writeInt32BE(this._b | 0, 4)
7793 H.writeInt32BE(this._c | 0, 8)
7794 H.writeInt32BE(this._d | 0, 12)
7795 H.writeInt32BE(this._e | 0, 16)
7796
7797 return H
7798}
7799
7800module.exports = Sha
7801
7802},{"./hash":41,"inherits":21,"safe-buffer":40}],44:[function(require,module,exports){
7803/*
7804 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
7805 * in FIPS PUB 180-1
7806 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
7807 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
7808 * Distributed under the BSD License
7809 * See http://pajhome.org.uk/crypt/md5 for details.
7810 */
7811
7812var inherits = require('inherits')
7813var Hash = require('./hash')
7814var Buffer = require('safe-buffer').Buffer
7815
7816var K = [
7817 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
7818]
7819
7820var W = new Array(80)
7821
7822function Sha1 () {
7823 this.init()
7824 this._w = W
7825
7826 Hash.call(this, 64, 56)
7827}
7828
7829inherits(Sha1, Hash)
7830
7831Sha1.prototype.init = function () {
7832 this._a = 0x67452301
7833 this._b = 0xefcdab89
7834 this._c = 0x98badcfe
7835 this._d = 0x10325476
7836 this._e = 0xc3d2e1f0
7837
7838 return this
7839}
7840
7841function rotl1 (num) {
7842 return (num << 1) | (num >>> 31)
7843}
7844
7845function rotl5 (num) {
7846 return (num << 5) | (num >>> 27)
7847}
7848
7849function rotl30 (num) {
7850 return (num << 30) | (num >>> 2)
7851}
7852
7853function ft (s, b, c, d) {
7854 if (s === 0) return (b & c) | ((~b) & d)
7855 if (s === 2) return (b & c) | (b & d) | (c & d)
7856 return b ^ c ^ d
7857}
7858
7859Sha1.prototype._update = function (M) {
7860 var W = this._w
7861
7862 var a = this._a | 0
7863 var b = this._b | 0
7864 var c = this._c | 0
7865 var d = this._d | 0
7866 var e = this._e | 0
7867
7868 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
7869 for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
7870
7871 for (var j = 0; j < 80; ++j) {
7872 var s = ~~(j / 20)
7873 var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
7874
7875 e = d
7876 d = c
7877 c = rotl30(b)
7878 b = a
7879 a = t
7880 }
7881
7882 this._a = (a + this._a) | 0
7883 this._b = (b + this._b) | 0
7884 this._c = (c + this._c) | 0
7885 this._d = (d + this._d) | 0
7886 this._e = (e + this._e) | 0
7887}
7888
7889Sha1.prototype._hash = function () {
7890 var H = Buffer.allocUnsafe(20)
7891
7892 H.writeInt32BE(this._a | 0, 0)
7893 H.writeInt32BE(this._b | 0, 4)
7894 H.writeInt32BE(this._c | 0, 8)
7895 H.writeInt32BE(this._d | 0, 12)
7896 H.writeInt32BE(this._e | 0, 16)
7897
7898 return H
7899}
7900
7901module.exports = Sha1
7902
7903},{"./hash":41,"inherits":21,"safe-buffer":40}],45:[function(require,module,exports){
7904/**
7905 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
7906 * in FIPS 180-2
7907 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
7908 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
7909 *
7910 */
7911
7912var inherits = require('inherits')
7913var Sha256 = require('./sha256')
7914var Hash = require('./hash')
7915var Buffer = require('safe-buffer').Buffer
7916
7917var W = new Array(64)
7918
7919function Sha224 () {
7920 this.init()
7921
7922 this._w = W // new Array(64)
7923
7924 Hash.call(this, 64, 56)
7925}
7926
7927inherits(Sha224, Sha256)
7928
7929Sha224.prototype.init = function () {
7930 this._a = 0xc1059ed8
7931 this._b = 0x367cd507
7932 this._c = 0x3070dd17
7933 this._d = 0xf70e5939
7934 this._e = 0xffc00b31
7935 this._f = 0x68581511
7936 this._g = 0x64f98fa7
7937 this._h = 0xbefa4fa4
7938
7939 return this
7940}
7941
7942Sha224.prototype._hash = function () {
7943 var H = Buffer.allocUnsafe(28)
7944
7945 H.writeInt32BE(this._a, 0)
7946 H.writeInt32BE(this._b, 4)
7947 H.writeInt32BE(this._c, 8)
7948 H.writeInt32BE(this._d, 12)
7949 H.writeInt32BE(this._e, 16)
7950 H.writeInt32BE(this._f, 20)
7951 H.writeInt32BE(this._g, 24)
7952
7953 return H
7954}
7955
7956module.exports = Sha224
7957
7958},{"./hash":41,"./sha256":46,"inherits":21,"safe-buffer":40}],46:[function(require,module,exports){
7959/**
7960 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
7961 * in FIPS 180-2
7962 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
7963 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
7964 *
7965 */
7966
7967var inherits = require('inherits')
7968var Hash = require('./hash')
7969var Buffer = require('safe-buffer').Buffer
7970
7971var K = [
7972 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
7973 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
7974 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
7975 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
7976 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
7977 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
7978 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
7979 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
7980 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
7981 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
7982 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
7983 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
7984 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
7985 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
7986 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
7987 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
7988]
7989
7990var W = new Array(64)
7991
7992function Sha256 () {
7993 this.init()
7994
7995 this._w = W // new Array(64)
7996
7997 Hash.call(this, 64, 56)
7998}
7999
8000inherits(Sha256, Hash)
8001
8002Sha256.prototype.init = function () {
8003 this._a = 0x6a09e667
8004 this._b = 0xbb67ae85
8005 this._c = 0x3c6ef372
8006 this._d = 0xa54ff53a
8007 this._e = 0x510e527f
8008 this._f = 0x9b05688c
8009 this._g = 0x1f83d9ab
8010 this._h = 0x5be0cd19
8011
8012 return this
8013}
8014
8015function ch (x, y, z) {
8016 return z ^ (x & (y ^ z))
8017}
8018
8019function maj (x, y, z) {
8020 return (x & y) | (z & (x | y))
8021}
8022
8023function sigma0 (x) {
8024 return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
8025}
8026
8027function sigma1 (x) {
8028 return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
8029}
8030
8031function gamma0 (x) {
8032 return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
8033}
8034
8035function gamma1 (x) {
8036 return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
8037}
8038
8039Sha256.prototype._update = function (M) {
8040 var W = this._w
8041
8042 var a = this._a | 0
8043 var b = this._b | 0
8044 var c = this._c | 0
8045 var d = this._d | 0
8046 var e = this._e | 0
8047 var f = this._f | 0
8048 var g = this._g | 0
8049 var h = this._h | 0
8050
8051 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
8052 for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
8053
8054 for (var j = 0; j < 64; ++j) {
8055 var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
8056 var T2 = (sigma0(a) + maj(a, b, c)) | 0
8057
8058 h = g
8059 g = f
8060 f = e
8061 e = (d + T1) | 0
8062 d = c
8063 c = b
8064 b = a
8065 a = (T1 + T2) | 0
8066 }
8067
8068 this._a = (a + this._a) | 0
8069 this._b = (b + this._b) | 0
8070 this._c = (c + this._c) | 0
8071 this._d = (d + this._d) | 0
8072 this._e = (e + this._e) | 0
8073 this._f = (f + this._f) | 0
8074 this._g = (g + this._g) | 0
8075 this._h = (h + this._h) | 0
8076}
8077
8078Sha256.prototype._hash = function () {
8079 var H = Buffer.allocUnsafe(32)
8080
8081 H.writeInt32BE(this._a, 0)
8082 H.writeInt32BE(this._b, 4)
8083 H.writeInt32BE(this._c, 8)
8084 H.writeInt32BE(this._d, 12)
8085 H.writeInt32BE(this._e, 16)
8086 H.writeInt32BE(this._f, 20)
8087 H.writeInt32BE(this._g, 24)
8088 H.writeInt32BE(this._h, 28)
8089
8090 return H
8091}
8092
8093module.exports = Sha256
8094
8095},{"./hash":41,"inherits":21,"safe-buffer":40}],47:[function(require,module,exports){
8096var inherits = require('inherits')
8097var SHA512 = require('./sha512')
8098var Hash = require('./hash')
8099var Buffer = require('safe-buffer').Buffer
8100
8101var W = new Array(160)
8102
8103function Sha384 () {
8104 this.init()
8105 this._w = W
8106
8107 Hash.call(this, 128, 112)
8108}
8109
8110inherits(Sha384, SHA512)
8111
8112Sha384.prototype.init = function () {
8113 this._ah = 0xcbbb9d5d
8114 this._bh = 0x629a292a
8115 this._ch = 0x9159015a
8116 this._dh = 0x152fecd8
8117 this._eh = 0x67332667
8118 this._fh = 0x8eb44a87
8119 this._gh = 0xdb0c2e0d
8120 this._hh = 0x47b5481d
8121
8122 this._al = 0xc1059ed8
8123 this._bl = 0x367cd507
8124 this._cl = 0x3070dd17
8125 this._dl = 0xf70e5939
8126 this._el = 0xffc00b31
8127 this._fl = 0x68581511
8128 this._gl = 0x64f98fa7
8129 this._hl = 0xbefa4fa4
8130
8131 return this
8132}
8133
8134Sha384.prototype._hash = function () {
8135 var H = Buffer.allocUnsafe(48)
8136
8137 function writeInt64BE (h, l, offset) {
8138 H.writeInt32BE(h, offset)
8139 H.writeInt32BE(l, offset + 4)
8140 }
8141
8142 writeInt64BE(this._ah, this._al, 0)
8143 writeInt64BE(this._bh, this._bl, 8)
8144 writeInt64BE(this._ch, this._cl, 16)
8145 writeInt64BE(this._dh, this._dl, 24)
8146 writeInt64BE(this._eh, this._el, 32)
8147 writeInt64BE(this._fh, this._fl, 40)
8148
8149 return H
8150}
8151
8152module.exports = Sha384
8153
8154},{"./hash":41,"./sha512":48,"inherits":21,"safe-buffer":40}],48:[function(require,module,exports){
8155var inherits = require('inherits')
8156var Hash = require('./hash')
8157var Buffer = require('safe-buffer').Buffer
8158
8159var K = [
8160 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
8161 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
8162 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
8163 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
8164 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
8165 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
8166 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
8167 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
8168 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
8169 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
8170 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
8171 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
8172 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
8173 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
8174 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
8175 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
8176 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
8177 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
8178 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
8179 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
8180 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
8181 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
8182 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
8183 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
8184 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
8185 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
8186 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
8187 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
8188 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
8189 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
8190 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
8191 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
8192 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
8193 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
8194 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
8195 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
8196 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
8197 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
8198 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
8199 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
8200]
8201
8202var W = new Array(160)
8203
8204function Sha512 () {
8205 this.init()
8206 this._w = W
8207
8208 Hash.call(this, 128, 112)
8209}
8210
8211inherits(Sha512, Hash)
8212
8213Sha512.prototype.init = function () {
8214 this._ah = 0x6a09e667
8215 this._bh = 0xbb67ae85
8216 this._ch = 0x3c6ef372
8217 this._dh = 0xa54ff53a
8218 this._eh = 0x510e527f
8219 this._fh = 0x9b05688c
8220 this._gh = 0x1f83d9ab
8221 this._hh = 0x5be0cd19
8222
8223 this._al = 0xf3bcc908
8224 this._bl = 0x84caa73b
8225 this._cl = 0xfe94f82b
8226 this._dl = 0x5f1d36f1
8227 this._el = 0xade682d1
8228 this._fl = 0x2b3e6c1f
8229 this._gl = 0xfb41bd6b
8230 this._hl = 0x137e2179
8231
8232 return this
8233}
8234
8235function Ch (x, y, z) {
8236 return z ^ (x & (y ^ z))
8237}
8238
8239function maj (x, y, z) {
8240 return (x & y) | (z & (x | y))
8241}
8242
8243function sigma0 (x, xl) {
8244 return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
8245}
8246
8247function sigma1 (x, xl) {
8248 return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
8249}
8250
8251function Gamma0 (x, xl) {
8252 return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
8253}
8254
8255function Gamma0l (x, xl) {
8256 return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
8257}
8258
8259function Gamma1 (x, xl) {
8260 return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
8261}
8262
8263function Gamma1l (x, xl) {
8264 return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
8265}
8266
8267function getCarry (a, b) {
8268 return (a >>> 0) < (b >>> 0) ? 1 : 0
8269}
8270
8271Sha512.prototype._update = function (M) {
8272 var W = this._w
8273
8274 var ah = this._ah | 0
8275 var bh = this._bh | 0
8276 var ch = this._ch | 0
8277 var dh = this._dh | 0
8278 var eh = this._eh | 0
8279 var fh = this._fh | 0
8280 var gh = this._gh | 0
8281 var hh = this._hh | 0
8282
8283 var al = this._al | 0
8284 var bl = this._bl | 0
8285 var cl = this._cl | 0
8286 var dl = this._dl | 0
8287 var el = this._el | 0
8288 var fl = this._fl | 0
8289 var gl = this._gl | 0
8290 var hl = this._hl | 0
8291
8292 for (var i = 0; i < 32; i += 2) {
8293 W[i] = M.readInt32BE(i * 4)
8294 W[i + 1] = M.readInt32BE(i * 4 + 4)
8295 }
8296 for (; i < 160; i += 2) {
8297 var xh = W[i - 15 * 2]
8298 var xl = W[i - 15 * 2 + 1]
8299 var gamma0 = Gamma0(xh, xl)
8300 var gamma0l = Gamma0l(xl, xh)
8301
8302 xh = W[i - 2 * 2]
8303 xl = W[i - 2 * 2 + 1]
8304 var gamma1 = Gamma1(xh, xl)
8305 var gamma1l = Gamma1l(xl, xh)
8306
8307 // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
8308 var Wi7h = W[i - 7 * 2]
8309 var Wi7l = W[i - 7 * 2 + 1]
8310
8311 var Wi16h = W[i - 16 * 2]
8312 var Wi16l = W[i - 16 * 2 + 1]
8313
8314 var Wil = (gamma0l + Wi7l) | 0
8315 var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
8316 Wil = (Wil + gamma1l) | 0
8317 Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
8318 Wil = (Wil + Wi16l) | 0
8319 Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
8320
8321 W[i] = Wih
8322 W[i + 1] = Wil
8323 }
8324
8325 for (var j = 0; j < 160; j += 2) {
8326 Wih = W[j]
8327 Wil = W[j + 1]
8328
8329 var majh = maj(ah, bh, ch)
8330 var majl = maj(al, bl, cl)
8331
8332 var sigma0h = sigma0(ah, al)
8333 var sigma0l = sigma0(al, ah)
8334 var sigma1h = sigma1(eh, el)
8335 var sigma1l = sigma1(el, eh)
8336
8337 // t1 = h + sigma1 + ch + K[j] + W[j]
8338 var Kih = K[j]
8339 var Kil = K[j + 1]
8340
8341 var chh = Ch(eh, fh, gh)
8342 var chl = Ch(el, fl, gl)
8343
8344 var t1l = (hl + sigma1l) | 0
8345 var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
8346 t1l = (t1l + chl) | 0
8347 t1h = (t1h + chh + getCarry(t1l, chl)) | 0
8348 t1l = (t1l + Kil) | 0
8349 t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
8350 t1l = (t1l + Wil) | 0
8351 t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
8352
8353 // t2 = sigma0 + maj
8354 var t2l = (sigma0l + majl) | 0
8355 var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
8356
8357 hh = gh
8358 hl = gl
8359 gh = fh
8360 gl = fl
8361 fh = eh
8362 fl = el
8363 el = (dl + t1l) | 0
8364 eh = (dh + t1h + getCarry(el, dl)) | 0
8365 dh = ch
8366 dl = cl
8367 ch = bh
8368 cl = bl
8369 bh = ah
8370 bl = al
8371 al = (t1l + t2l) | 0
8372 ah = (t1h + t2h + getCarry(al, t1l)) | 0
8373 }
8374
8375 this._al = (this._al + al) | 0
8376 this._bl = (this._bl + bl) | 0
8377 this._cl = (this._cl + cl) | 0
8378 this._dl = (this._dl + dl) | 0
8379 this._el = (this._el + el) | 0
8380 this._fl = (this._fl + fl) | 0
8381 this._gl = (this._gl + gl) | 0
8382 this._hl = (this._hl + hl) | 0
8383
8384 this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
8385 this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
8386 this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
8387 this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
8388 this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
8389 this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
8390 this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
8391 this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
8392}
8393
8394Sha512.prototype._hash = function () {
8395 var H = Buffer.allocUnsafe(64)
8396
8397 function writeInt64BE (h, l, offset) {
8398 H.writeInt32BE(h, offset)
8399 H.writeInt32BE(l, offset + 4)
8400 }
8401
8402 writeInt64BE(this._ah, this._al, 0)
8403 writeInt64BE(this._bh, this._bl, 8)
8404 writeInt64BE(this._ch, this._cl, 16)
8405 writeInt64BE(this._dh, this._dl, 24)
8406 writeInt64BE(this._eh, this._el, 32)
8407 writeInt64BE(this._fh, this._fl, 40)
8408 writeInt64BE(this._gh, this._gl, 48)
8409 writeInt64BE(this._hh, this._hl, 56)
8410
8411 return H
8412}
8413
8414module.exports = Sha512
8415
8416},{"./hash":41,"inherits":21,"safe-buffer":40}],49:[function(require,module,exports){
8417// Copyright Joyent, Inc. and other Node contributors.
8418//
8419// Permission is hereby granted, free of charge, to any person obtaining a
8420// copy of this software and associated documentation files (the
8421// "Software"), to deal in the Software without restriction, including
8422// without limitation the rights to use, copy, modify, merge, publish,
8423// distribute, sublicense, and/or sell copies of the Software, and to permit
8424// persons to whom the Software is furnished to do so, subject to the
8425// following conditions:
8426//
8427// The above copyright notice and this permission notice shall be included
8428// in all copies or substantial portions of the Software.
8429//
8430// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8431// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
8432// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
8433// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
8434// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
8435// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
8436// USE OR OTHER DEALINGS IN THE SOFTWARE.
8437
8438module.exports = Stream;
8439
8440var EE = require('events').EventEmitter;
8441var inherits = require('inherits');
8442
8443inherits(Stream, EE);
8444Stream.Readable = require('readable-stream/readable.js');
8445Stream.Writable = require('readable-stream/writable.js');
8446Stream.Duplex = require('readable-stream/duplex.js');
8447Stream.Transform = require('readable-stream/transform.js');
8448Stream.PassThrough = require('readable-stream/passthrough.js');
8449
8450// Backwards-compat with node 0.4.x
8451Stream.Stream = Stream;
8452
8453
8454
8455// old-style streams. Note that the pipe method (the only relevant
8456// part of this class) is overridden in the Readable class.
8457
8458function Stream() {
8459 EE.call(this);
8460}
8461
8462Stream.prototype.pipe = function(dest, options) {
8463 var source = this;
8464
8465 function ondata(chunk) {
8466 if (dest.writable) {
8467 if (false === dest.write(chunk) && source.pause) {
8468 source.pause();
8469 }
8470 }
8471 }
8472
8473 source.on('data', ondata);
8474
8475 function ondrain() {
8476 if (source.readable && source.resume) {
8477 source.resume();
8478 }
8479 }
8480
8481 dest.on('drain', ondrain);
8482
8483 // If the 'end' option is not supplied, dest.end() will be called when
8484 // source gets the 'end' or 'close' events. Only dest.end() once.
8485 if (!dest._isStdio && (!options || options.end !== false)) {
8486 source.on('end', onend);
8487 source.on('close', onclose);
8488 }
8489
8490 var didOnEnd = false;
8491 function onend() {
8492 if (didOnEnd) return;
8493 didOnEnd = true;
8494
8495 dest.end();
8496 }
8497
8498
8499 function onclose() {
8500 if (didOnEnd) return;
8501 didOnEnd = true;
8502
8503 if (typeof dest.destroy === 'function') dest.destroy();
8504 }
8505
8506 // don't leave dangling pipes when there are errors.
8507 function onerror(er) {
8508 cleanup();
8509 if (EE.listenerCount(this, 'error') === 0) {
8510 throw er; // Unhandled stream error in pipe.
8511 }
8512 }
8513
8514 source.on('error', onerror);
8515 dest.on('error', onerror);
8516
8517 // remove all the event listeners that were added.
8518 function cleanup() {
8519 source.removeListener('data', ondata);
8520 dest.removeListener('drain', ondrain);
8521
8522 source.removeListener('end', onend);
8523 source.removeListener('close', onclose);
8524
8525 source.removeListener('error', onerror);
8526 dest.removeListener('error', onerror);
8527
8528 source.removeListener('end', cleanup);
8529 source.removeListener('close', cleanup);
8530
8531 dest.removeListener('close', cleanup);
8532 }
8533
8534 source.on('end', cleanup);
8535 source.on('close', cleanup);
8536
8537 dest.on('close', cleanup);
8538
8539 dest.emit('pipe', source);
8540
8541 // Allow for unix-like usage: A.pipe(B).pipe(C)
8542 return dest;
8543};
8544
8545},{"events":18,"inherits":21,"readable-stream/duplex.js":26,"readable-stream/passthrough.js":35,"readable-stream/readable.js":36,"readable-stream/transform.js":37,"readable-stream/writable.js":38}],50:[function(require,module,exports){
8546'use strict';
8547
8548var Buffer = require('safe-buffer').Buffer;
8549
8550var isEncoding = Buffer.isEncoding || function (encoding) {
8551 encoding = '' + encoding;
8552 switch (encoding && encoding.toLowerCase()) {
8553 case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
8554 return true;
8555 default:
8556 return false;
8557 }
8558};
8559
8560function _normalizeEncoding(enc) {
8561 if (!enc) return 'utf8';
8562 var retried;
8563 while (true) {
8564 switch (enc) {
8565 case 'utf8':
8566 case 'utf-8':
8567 return 'utf8';
8568 case 'ucs2':
8569 case 'ucs-2':
8570 case 'utf16le':
8571 case 'utf-16le':
8572 return 'utf16le';
8573 case 'latin1':
8574 case 'binary':
8575 return 'latin1';
8576 case 'base64':
8577 case 'ascii':
8578 case 'hex':
8579 return enc;
8580 default:
8581 if (retried) return; // undefined
8582 enc = ('' + enc).toLowerCase();
8583 retried = true;
8584 }
8585 }
8586};
8587
8588// Do not cache `Buffer.isEncoding` when checking encoding names as some
8589// modules monkey-patch it to support additional encodings
8590function normalizeEncoding(enc) {
8591 var nenc = _normalizeEncoding(enc);
8592 if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
8593 return nenc || enc;
8594}
8595
8596// StringDecoder provides an interface for efficiently splitting a series of
8597// buffers into a series of JS strings without breaking apart multi-byte
8598// characters.
8599exports.StringDecoder = StringDecoder;
8600function StringDecoder(encoding) {
8601 this.encoding = normalizeEncoding(encoding);
8602 var nb;
8603 switch (this.encoding) {
8604 case 'utf16le':
8605 this.text = utf16Text;
8606 this.end = utf16End;
8607 nb = 4;
8608 break;
8609 case 'utf8':
8610 this.fillLast = utf8FillLast;
8611 nb = 4;
8612 break;
8613 case 'base64':
8614 this.text = base64Text;
8615 this.end = base64End;
8616 nb = 3;
8617 break;
8618 default:
8619 this.write = simpleWrite;
8620 this.end = simpleEnd;
8621 return;
8622 }
8623 this.lastNeed = 0;
8624 this.lastTotal = 0;
8625 this.lastChar = Buffer.allocUnsafe(nb);
8626}
8627
8628StringDecoder.prototype.write = function (buf) {
8629 if (buf.length === 0) return '';
8630 var r;
8631 var i;
8632 if (this.lastNeed) {
8633 r = this.fillLast(buf);
8634 if (r === undefined) return '';
8635 i = this.lastNeed;
8636 this.lastNeed = 0;
8637 } else {
8638 i = 0;
8639 }
8640 if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
8641 return r || '';
8642};
8643
8644StringDecoder.prototype.end = utf8End;
8645
8646// Returns only complete characters in a Buffer
8647StringDecoder.prototype.text = utf8Text;
8648
8649// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
8650StringDecoder.prototype.fillLast = function (buf) {
8651 if (this.lastNeed <= buf.length) {
8652 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
8653 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
8654 }
8655 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
8656 this.lastNeed -= buf.length;
8657};
8658
8659// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
8660// continuation byte.
8661function utf8CheckByte(byte) {
8662 if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
8663 return -1;
8664}
8665
8666// Checks at most 3 bytes at the end of a Buffer in order to detect an
8667// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
8668// needed to complete the UTF-8 character (if applicable) are returned.
8669function utf8CheckIncomplete(self, buf, i) {
8670 var j = buf.length - 1;
8671 if (j < i) return 0;
8672 var nb = utf8CheckByte(buf[j]);
8673 if (nb >= 0) {
8674 if (nb > 0) self.lastNeed = nb - 1;
8675 return nb;
8676 }
8677 if (--j < i) return 0;
8678 nb = utf8CheckByte(buf[j]);
8679 if (nb >= 0) {
8680 if (nb > 0) self.lastNeed = nb - 2;
8681 return nb;
8682 }
8683 if (--j < i) return 0;
8684 nb = utf8CheckByte(buf[j]);
8685 if (nb >= 0) {
8686 if (nb > 0) {
8687 if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
8688 }
8689 return nb;
8690 }
8691 return 0;
8692}
8693
8694// Validates as many continuation bytes for a multi-byte UTF-8 character as
8695// needed or are available. If we see a non-continuation byte where we expect
8696// one, we "replace" the validated continuation bytes we've seen so far with
8697// UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding
8698// behavior. The continuation byte check is included three times in the case
8699// where all of the continuation bytes for a character exist in the same buffer.
8700// It is also done this way as a slight performance increase instead of using a
8701// loop.
8702function utf8CheckExtraBytes(self, buf, p) {
8703 if ((buf[0] & 0xC0) !== 0x80) {
8704 self.lastNeed = 0;
8705 return '\ufffd'.repeat(p);
8706 }
8707 if (self.lastNeed > 1 && buf.length > 1) {
8708 if ((buf[1] & 0xC0) !== 0x80) {
8709 self.lastNeed = 1;
8710 return '\ufffd'.repeat(p + 1);
8711 }
8712 if (self.lastNeed > 2 && buf.length > 2) {
8713 if ((buf[2] & 0xC0) !== 0x80) {
8714 self.lastNeed = 2;
8715 return '\ufffd'.repeat(p + 2);
8716 }
8717 }
8718 }
8719}
8720
8721// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
8722function utf8FillLast(buf) {
8723 var p = this.lastTotal - this.lastNeed;
8724 var r = utf8CheckExtraBytes(this, buf, p);
8725 if (r !== undefined) return r;
8726 if (this.lastNeed <= buf.length) {
8727 buf.copy(this.lastChar, p, 0, this.lastNeed);
8728 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
8729 }
8730 buf.copy(this.lastChar, p, 0, buf.length);
8731 this.lastNeed -= buf.length;
8732}
8733
8734// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
8735// partial character, the character's bytes are buffered until the required
8736// number of bytes are available.
8737function utf8Text(buf, i) {
8738 var total = utf8CheckIncomplete(this, buf, i);
8739 if (!this.lastNeed) return buf.toString('utf8', i);
8740 this.lastTotal = total;
8741 var end = buf.length - (total - this.lastNeed);
8742 buf.copy(this.lastChar, 0, end);
8743 return buf.toString('utf8', i, end);
8744}
8745
8746// For UTF-8, a replacement character for each buffered byte of a (partial)
8747// character needs to be added to the output.
8748function utf8End(buf) {
8749 var r = buf && buf.length ? this.write(buf) : '';
8750 if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed);
8751 return r;
8752}
8753
8754// UTF-16LE typically needs two bytes per character, but even if we have an even
8755// number of bytes available, we need to check if we end on a leading/high
8756// surrogate. In that case, we need to wait for the next two bytes in order to
8757// decode the last character properly.
8758function utf16Text(buf, i) {
8759 if ((buf.length - i) % 2 === 0) {
8760 var r = buf.toString('utf16le', i);
8761 if (r) {
8762 var c = r.charCodeAt(r.length - 1);
8763 if (c >= 0xD800 && c <= 0xDBFF) {
8764 this.lastNeed = 2;
8765 this.lastTotal = 4;
8766 this.lastChar[0] = buf[buf.length - 2];
8767 this.lastChar[1] = buf[buf.length - 1];
8768 return r.slice(0, -1);
8769 }
8770 }
8771 return r;
8772 }
8773 this.lastNeed = 1;
8774 this.lastTotal = 2;
8775 this.lastChar[0] = buf[buf.length - 1];
8776 return buf.toString('utf16le', i, buf.length - 1);
8777}
8778
8779// For UTF-16LE we do not explicitly append special replacement characters if we
8780// end on a partial character, we simply let v8 handle that.
8781function utf16End(buf) {
8782 var r = buf && buf.length ? this.write(buf) : '';
8783 if (this.lastNeed) {
8784 var end = this.lastTotal - this.lastNeed;
8785 return r + this.lastChar.toString('utf16le', 0, end);
8786 }
8787 return r;
8788}
8789
8790function base64Text(buf, i) {
8791 var n = (buf.length - i) % 3;
8792 if (n === 0) return buf.toString('base64', i);
8793 this.lastNeed = 3 - n;
8794 this.lastTotal = 3;
8795 if (n === 1) {
8796 this.lastChar[0] = buf[buf.length - 1];
8797 } else {
8798 this.lastChar[0] = buf[buf.length - 2];
8799 this.lastChar[1] = buf[buf.length - 1];
8800 }
8801 return buf.toString('base64', i, buf.length - n);
8802}
8803
8804function base64End(buf) {
8805 var r = buf && buf.length ? this.write(buf) : '';
8806 if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
8807 return r;
8808}
8809
8810// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
8811function simpleWrite(buf) {
8812 return buf.toString(this.encoding);
8813}
8814
8815function simpleEnd(buf) {
8816 return buf && buf.length ? this.write(buf) : '';
8817}
8818},{"safe-buffer":40}],51:[function(require,module,exports){
8819(function (global){
8820
8821/**
8822 * Module exports.
8823 */
8824
8825module.exports = deprecate;
8826
8827/**
8828 * Mark that a method should not be used.
8829 * Returns a modified function which warns once by default.
8830 *
8831 * If `localStorage.noDeprecation = true` is set, then it is a no-op.
8832 *
8833 * If `localStorage.throwDeprecation = true` is set, then deprecated functions
8834 * will throw an Error when invoked.
8835 *
8836 * If `localStorage.traceDeprecation = true` is set, then deprecated functions
8837 * will invoke `console.trace()` instead of `console.error()`.
8838 *
8839 * @param {Function} fn - the function to deprecate
8840 * @param {String} msg - the string to print to the console when `fn` is invoked
8841 * @returns {Function} a new "deprecated" version of `fn`
8842 * @api public
8843 */
8844
8845function deprecate (fn, msg) {
8846 if (config('noDeprecation')) {
8847 return fn;
8848 }
8849
8850 var warned = false;
8851 function deprecated() {
8852 if (!warned) {
8853 if (config('throwDeprecation')) {
8854 throw new Error(msg);
8855 } else if (config('traceDeprecation')) {
8856 console.trace(msg);
8857 } else {
8858 console.warn(msg);
8859 }
8860 warned = true;
8861 }
8862 return fn.apply(this, arguments);
8863 }
8864
8865 return deprecated;
8866}
8867
8868/**
8869 * Checks `localStorage` for boolean values for the given `name`.
8870 *
8871 * @param {String} name
8872 * @returns {Boolean}
8873 * @api private
8874 */
8875
8876function config (name) {
8877 // accessing global.localStorage can trigger a DOMException in sandboxed iframes
8878 try {
8879 if (!global.localStorage) return false;
8880 } catch (_) {
8881 return false;
8882 }
8883 var val = global.localStorage[name];
8884 if (null == val) return false;
8885 return String(val).toLowerCase() === 'true';
8886}
8887
8888}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
8889},{}],52:[function(require,module,exports){
8890(function (Buffer){
8891/***
8892 * @license
8893 * https://github.com/bitcoincashjs/bchaddr
8894 * Copyright (c) 2018 Emilio Almansi
8895 * Distributed under the MIT software license, see the accompanying
8896 * file LICENSE or http://www.opensource.org/licenses/mit-license.php.
8897 */
8898
8899var bs58check = require('bs58check')
8900var cashaddr = require('cashaddrjs')
8901
8902/**
8903 * General purpose Bitcoin Cash address detection and translation.<br />
8904 * Supports all major Bitcoin Cash address formats.<br />
8905 * Currently:
8906 * <ul>
8907 * <li> Legacy format </li>
8908 * <li> Bitpay format </li>
8909 * <li> Cashaddr format </li>
8910 * </ul>
8911 * @module bchaddr
8912 */
8913
8914/**
8915 * @static
8916 * Supported Bitcoin Cash address formats.
8917 */
8918var Format = {}
8919Format.Legacy = 'legacy'
8920Format.Bitpay = 'bitpay'
8921Format.Cashaddr = 'cashaddr'
8922
8923/**
8924 * @static
8925 * Supported networks.
8926 */
8927var Network = {}
8928Network.Mainnet = 'mainnet'
8929Network.Testnet = 'testnet'
8930
8931/**
8932 * @static
8933 * Supported address types.
8934 */
8935var Type = {}
8936Type.P2PKH = 'p2pkh'
8937Type.P2SH = 'p2sh'
8938
8939/**
8940 * Detects what is the given address' format.
8941 * @static
8942 * @param {string} address - A valid Bitcoin Cash address in any format.
8943 * @return {string}
8944 * @throws {InvalidAddressError}
8945 */
8946function detectAddressFormat (address) {
8947 return decodeAddress(address).format
8948}
8949
8950/**
8951 * Detects what is the given address' network.
8952 * @static
8953 * @param {string} address - A valid Bitcoin Cash address in any format.
8954 * @return {string}
8955 * @throws {InvalidAddressError}
8956 */
8957function detectAddressNetwork (address) {
8958 return decodeAddress(address).network
8959}
8960
8961/**
8962 * Detects what is the given address' type.
8963 * @static
8964 * @param {string} address - A valid Bitcoin Cash address in any format.
8965 * @return {string}
8966 * @throws {InvalidAddressError}
8967 */
8968function detectAddressType (address) {
8969 return decodeAddress(address).type
8970}
8971
8972/**
8973 * Translates the given address into legacy format.
8974 * @static
8975 * @param {string} address - A valid Bitcoin Cash address in any format.
8976 * @return {string}
8977 * @throws {InvalidAddressError}
8978 */
8979function toLegacyAddress (address) {
8980 var decoded = decodeAddress(address)
8981 if (decoded.format === Format.Legacy) {
8982 return address
8983 }
8984 return encodeAsLegacy(decoded)
8985}
8986
8987/**
8988 * Translates the given address into bitpay format.
8989 * @static
8990 * @param {string} address - A valid Bitcoin Cash address in any format.
8991 * @return {string}
8992 * @throws {InvalidAddressError}
8993 */
8994function toBitpayAddress (address) {
8995 var decoded = decodeAddress(address)
8996 if (decoded.format === Format.Bitpay) {
8997 return address
8998 }
8999 return encodeAsBitpay(decoded)
9000}
9001
9002/**
9003 * Translates the given address into cashaddr format.
9004 * @static
9005 * @param {string} address - A valid Bitcoin Cash address in any format.
9006 * @return {string}
9007 * @throws {InvalidAddressError}
9008 */
9009function toCashAddress (address) {
9010 var decoded = decodeAddress(address)
9011 return encodeAsCashaddr(decoded)
9012}
9013
9014/**
9015 * Version byte table for base58 formats.
9016 * @private
9017 */
9018var VERSION_BYTE = {}
9019VERSION_BYTE[Format.Legacy] = {}
9020VERSION_BYTE[Format.Legacy][Network.Mainnet] = {}
9021VERSION_BYTE[Format.Legacy][Network.Mainnet][Type.P2PKH] = 0
9022VERSION_BYTE[Format.Legacy][Network.Mainnet][Type.P2SH] = 5
9023VERSION_BYTE[Format.Legacy][Network.Testnet] = {}
9024VERSION_BYTE[Format.Legacy][Network.Testnet][Type.P2PKH] = 111
9025VERSION_BYTE[Format.Legacy][Network.Testnet][Type.P2SH] = 196
9026VERSION_BYTE[Format.Bitpay] = {}
9027VERSION_BYTE[Format.Bitpay][Network.Mainnet] = {}
9028VERSION_BYTE[Format.Bitpay][Network.Mainnet][Type.P2PKH] = 28
9029VERSION_BYTE[Format.Bitpay][Network.Mainnet][Type.P2SH] = 40
9030VERSION_BYTE[Format.Bitpay][Network.Testnet] = {}
9031VERSION_BYTE[Format.Bitpay][Network.Testnet][Type.P2PKH] = 111
9032VERSION_BYTE[Format.Bitpay][Network.Testnet][Type.P2SH] = 196
9033
9034/**
9035 * Decodes the given address into its constituting hash, format, network and type.
9036 * @private
9037 * @param {string} address - A valid Bitcoin Cash address in any format.
9038 * @return {object}
9039 * @throws {InvalidAddressError}
9040 */
9041function decodeAddress (address) {
9042 try {
9043 return decodeBase58Address(address)
9044 } catch (error) {
9045 }
9046 try {
9047 return decodeCashAddress(address)
9048 } catch (error) {
9049 }
9050 throw new InvalidAddressError()
9051}
9052
9053/**
9054 * Attempts to decode the given address assuming it is a base58 address.
9055 * @private
9056 * @param {string} address - A valid Bitcoin Cash address in any format.
9057 * @return {object}
9058 * @throws {InvalidAddressError}
9059 */
9060function decodeBase58Address (address) {
9061 try {
9062 var payload = bs58check.decode(address)
9063 var versionByte = payload[0]
9064 var hash = Array.prototype.slice.call(payload, 1)
9065 switch (versionByte) {
9066 case VERSION_BYTE[Format.Legacy][Network.Mainnet][Type.P2PKH]:
9067 return {
9068 hash: hash,
9069 format: Format.Legacy,
9070 network: Network.Mainnet,
9071 type: Type.P2PKH
9072 }
9073 case VERSION_BYTE[Format.Legacy][Network.Mainnet][Type.P2SH]:
9074 return {
9075 hash: hash,
9076 format: Format.Legacy,
9077 network: Network.Mainnet,
9078 type: Type.P2SH
9079 }
9080 case VERSION_BYTE[Format.Legacy][Network.Testnet][Type.P2PKH]:
9081 return {
9082 hash: hash,
9083 format: Format.Legacy,
9084 network: Network.Testnet,
9085 type: Type.P2PKH
9086 }
9087 case VERSION_BYTE[Format.Legacy][Network.Testnet][Type.P2SH]:
9088 return {
9089 hash: hash,
9090 format: Format.Legacy,
9091 network: Network.Testnet,
9092 type: Type.P2SH
9093 }
9094 case VERSION_BYTE[Format.Bitpay][Network.Mainnet][Type.P2PKH]:
9095 return {
9096 hash: hash,
9097 format: Format.Bitpay,
9098 network: Network.Mainnet,
9099 type: Type.P2PKH
9100 }
9101 case VERSION_BYTE[Format.Bitpay][Network.Mainnet][Type.P2SH]:
9102 return {
9103 hash: hash,
9104 format: Format.Bitpay,
9105 network: Network.Mainnet,
9106 type: Type.P2SH
9107 }
9108 }
9109 } catch (error) {
9110 }
9111 throw new InvalidAddressError()
9112}
9113
9114/**
9115 * Attempts to decode the given address assuming it is a cashaddr address.
9116 * @private
9117 * @param {string} address - A valid Bitcoin Cash address in any format.
9118 * @return {object}
9119 * @throws {InvalidAddressError}
9120 */
9121function decodeCashAddress (address) {
9122 if (address.indexOf(':') !== -1) {
9123 try {
9124 return decodeCashAddressWithPrefix(address)
9125 } catch (error) {
9126 }
9127 } else {
9128 var prefixes = ['bitcoincash', 'bchtest', 'regtest']
9129 for (var i = 0; i < prefixes.length; ++i) {
9130 try {
9131 var prefix = prefixes[i]
9132 return decodeCashAddressWithPrefix(prefix + ':' + address)
9133 } catch (error) {
9134 }
9135 }
9136 }
9137 throw new InvalidAddressError()
9138}
9139
9140/**
9141 * Attempts to decode the given address assuming it is a cashaddr address with explicit prefix.
9142 * @private
9143 * @param {string} address - A valid Bitcoin Cash address in any format.
9144 * @return {object}
9145 * @throws {InvalidAddressError}
9146 */
9147function decodeCashAddressWithPrefix (address) {
9148 try {
9149 var decoded = cashaddr.decode(address)
9150 var hash = Array.prototype.slice.call(decoded.hash, 0)
9151 var type = decoded.type === 'P2PKH' ? Type.P2PKH : Type.P2SH
9152 switch (decoded.prefix) {
9153 case 'bitcoincash':
9154 return {
9155 hash: hash,
9156 format: Format.Cashaddr,
9157 network: Network.Mainnet,
9158 type: type
9159 }
9160 case 'bchtest':
9161 case 'regtest':
9162 return {
9163 hash: hash,
9164 format: Format.Cashaddr,
9165 network: Network.Testnet,
9166 type: type
9167 }
9168 }
9169 } catch (error) {
9170 }
9171 throw new InvalidAddressError()
9172}
9173
9174/**
9175 * Encodes the given decoded address into legacy format.
9176 * @private
9177 * @param {object} decoded
9178 * @returns {string}
9179 */
9180function encodeAsLegacy (decoded) {
9181 var versionByte = VERSION_BYTE[Format.Legacy][decoded.network][decoded.type]
9182 var buffer = Buffer.alloc(1 + decoded.hash.length)
9183 buffer[0] = versionByte
9184 buffer.set(decoded.hash, 1)
9185 return bs58check.encode(buffer)
9186}
9187
9188/**
9189 * Encodes the given decoded address into bitpay format.
9190 * @private
9191 * @param {object} decoded
9192 * @returns {string}
9193 */
9194function encodeAsBitpay (decoded) {
9195 var versionByte = VERSION_BYTE[Format.Bitpay][decoded.network][decoded.type]
9196 var buffer = Buffer.alloc(1 + decoded.hash.length)
9197 buffer[0] = versionByte
9198 buffer.set(decoded.hash, 1)
9199 return bs58check.encode(buffer)
9200}
9201
9202/**
9203 * Encodes the given decoded address into cashaddr format.
9204 * @private
9205 * @param {object} decoded
9206 * @returns {string}
9207 */
9208function encodeAsCashaddr (decoded) {
9209 var prefix = decoded.network === Network.Mainnet ? 'bitcoincash' : 'bchtest'
9210 var type = decoded.type === Type.P2PKH ? 'P2PKH' : 'P2SH'
9211 var hash = Uint8Array.from(decoded.hash)
9212 return cashaddr.encode(prefix, type, hash)
9213}
9214
9215/**
9216 * Returns a boolean indicating whether the address is in legacy format.
9217 * @static
9218 * @param {string} address - A valid Bitcoin Cash address in any format.
9219 * @returns {boolean}
9220 * @throws {InvalidAddressError}
9221 */
9222function isLegacyAddress (address) {
9223 return detectAddressFormat(address) === Format.Legacy
9224}
9225
9226/**
9227 * Returns a boolean indicating whether the address is in bitpay format.
9228 * @static
9229 * @param {string} address - A valid Bitcoin Cash address in any format.
9230 * @returns {boolean}
9231 * @throws {InvalidAddressError}
9232 */
9233function isBitpayAddress (address) {
9234 return detectAddressFormat(address) === Format.Bitpay
9235}
9236
9237/**
9238 * Returns a boolean indicating whether the address is in cashaddr format.
9239 * @static
9240 * @param {string} address - A valid Bitcoin Cash address in any format.
9241 * @returns {boolean}
9242 * @throws {InvalidAddressError}
9243 */
9244function isCashAddress (address) {
9245 return detectAddressFormat(address) === Format.Cashaddr
9246}
9247
9248/**
9249 * Returns a boolean indicating whether the address is a mainnet address.
9250 * @static
9251 * @param {string} address - A valid Bitcoin Cash address in any format.
9252 * @returns {boolean}
9253 * @throws {InvalidAddressError}
9254 */
9255function isMainnetAddress (address) {
9256 return detectAddressNetwork(address) === Network.Mainnet
9257}
9258
9259/**
9260 * Returns a boolean indicating whether the address is a testnet address.
9261 * @static
9262 * @param {string} address - A valid Bitcoin Cash address in any format.
9263 * @returns {boolean}
9264 * @throws {InvalidAddressError}
9265 */
9266function isTestnetAddress (address) {
9267 return detectAddressNetwork(address) === Network.Testnet
9268}
9269
9270/**
9271 * Returns a boolean indicating whether the address is a p2pkh address.
9272 * @static
9273 * @param {string} address - A valid Bitcoin Cash address in any format.
9274 * @returns {boolean}
9275 * @throws {InvalidAddressError}
9276 */
9277function isP2PKHAddress (address) {
9278 return detectAddressType(address) === Type.P2PKH
9279}
9280
9281/**
9282 * Returns a boolean indicating whether the address is a p2sh address.
9283 * @static
9284 * @param {string} address - A valid Bitcoin Cash address in any format.
9285 * @returns {boolean}
9286 * @throws {InvalidAddressError}
9287 */
9288function isP2SHAddress (address) {
9289 return detectAddressType(address) === Type.P2SH
9290}
9291
9292/**
9293 * Error thrown when the address given as input is not a valid Bitcoin Cash address.
9294 * @constructor
9295 * InvalidAddressError
9296 */
9297function InvalidAddressError () {
9298 var error = new Error()
9299 this.name = error.name = 'InvalidAddressError'
9300 this.message = error.message = 'Received an invalid Bitcoin Cash address as input.'
9301 this.stack = error.stack
9302}
9303
9304InvalidAddressError.prototype = Object.create(Error.prototype)
9305
9306module.exports = {
9307 Format: Format,
9308 Network: Network,
9309 Type: Type,
9310 detectAddressFormat: detectAddressFormat,
9311 detectAddressNetwork: detectAddressNetwork,
9312 detectAddressType: detectAddressType,
9313 toLegacyAddress: toLegacyAddress,
9314 toBitpayAddress: toBitpayAddress,
9315 toCashAddress: toCashAddress,
9316 isLegacyAddress: isLegacyAddress,
9317 isBitpayAddress: isBitpayAddress,
9318 isCashAddress: isCashAddress,
9319 isMainnetAddress: isMainnetAddress,
9320 isTestnetAddress: isTestnetAddress,
9321 isP2PKHAddress: isP2PKHAddress,
9322 isP2SHAddress: isP2SHAddress,
9323 InvalidAddressError: InvalidAddressError
9324}
9325
9326}).call(this,require("buffer").Buffer)
9327},{"bs58check":7,"buffer":8,"cashaddrjs":10}]},{},[52])(52)
9328}); \ No newline at end of file
diff --git a/src/js/bitcoinjs-3.3.2.js b/src/js/bitcoinjs-3.3.2.js
new file mode 100644
index 0000000..2390168
--- /dev/null
+++ b/src/js/bitcoinjs-3.3.2.js
@@ -0,0 +1,15168 @@
1(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.bitcoinjs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2(function (global){
3'use strict';
4
5// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
6// original notice:
7
8/*!
9 * The buffer module from node.js, for the browser.
10 *
11 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
12 * @license MIT
13 */
14function compare(a, b) {
15 if (a === b) {
16 return 0;
17 }
18
19 var x = a.length;
20 var y = b.length;
21
22 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
23 if (a[i] !== b[i]) {
24 x = a[i];
25 y = b[i];
26 break;
27 }
28 }
29
30 if (x < y) {
31 return -1;
32 }
33 if (y < x) {
34 return 1;
35 }
36 return 0;
37}
38function isBuffer(b) {
39 if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {
40 return global.Buffer.isBuffer(b);
41 }
42 return !!(b != null && b._isBuffer);
43}
44
45// based on node assert, original notice:
46
47// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
48//
49// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
50//
51// Originally from narwhal.js (http://narwhaljs.org)
52// Copyright (c) 2009 Thomas Robinson <280north.com>
53//
54// Permission is hereby granted, free of charge, to any person obtaining a copy
55// of this software and associated documentation files (the 'Software'), to
56// deal in the Software without restriction, including without limitation the
57// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
58// sell copies of the Software, and to permit persons to whom the Software is
59// furnished to do so, subject to the following conditions:
60//
61// The above copyright notice and this permission notice shall be included in
62// all copies or substantial portions of the Software.
63//
64// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
66// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
67// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
68// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
69// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
70
71var util = require('util/');
72var hasOwn = Object.prototype.hasOwnProperty;
73var pSlice = Array.prototype.slice;
74var functionsHaveNames = (function () {
75 return function foo() {}.name === 'foo';
76}());
77function pToString (obj) {
78 return Object.prototype.toString.call(obj);
79}
80function isView(arrbuf) {
81 if (isBuffer(arrbuf)) {
82 return false;
83 }
84 if (typeof global.ArrayBuffer !== 'function') {
85 return false;
86 }
87 if (typeof ArrayBuffer.isView === 'function') {
88 return ArrayBuffer.isView(arrbuf);
89 }
90 if (!arrbuf) {
91 return false;
92 }
93 if (arrbuf instanceof DataView) {
94 return true;
95 }
96 if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
97 return true;
98 }
99 return false;
100}
101// 1. The assert module provides functions that throw
102// AssertionError's when particular conditions are not met. The
103// assert module must conform to the following interface.
104
105var assert = module.exports = ok;
106
107// 2. The AssertionError is defined in assert.
108// new assert.AssertionError({ message: message,
109// actual: actual,
110// expected: expected })
111
112var regex = /\s*function\s+([^\(\s]*)\s*/;
113// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js
114function getName(func) {
115 if (!util.isFunction(func)) {
116 return;
117 }
118 if (functionsHaveNames) {
119 return func.name;
120 }
121 var str = func.toString();
122 var match = str.match(regex);
123 return match && match[1];
124}
125assert.AssertionError = function AssertionError(options) {
126 this.name = 'AssertionError';
127 this.actual = options.actual;
128 this.expected = options.expected;
129 this.operator = options.operator;
130 if (options.message) {
131 this.message = options.message;
132 this.generatedMessage = false;
133 } else {
134 this.message = getMessage(this);
135 this.generatedMessage = true;
136 }
137 var stackStartFunction = options.stackStartFunction || fail;
138 if (Error.captureStackTrace) {
139 Error.captureStackTrace(this, stackStartFunction);
140 } else {
141 // non v8 browsers so we can have a stacktrace
142 var err = new Error();
143 if (err.stack) {
144 var out = err.stack;
145
146 // try to strip useless frames
147 var fn_name = getName(stackStartFunction);
148 var idx = out.indexOf('\n' + fn_name);
149 if (idx >= 0) {
150 // once we have located the function frame
151 // we need to strip out everything before it (and its line)
152 var next_line = out.indexOf('\n', idx + 1);
153 out = out.substring(next_line + 1);
154 }
155
156 this.stack = out;
157 }
158 }
159};
160
161// assert.AssertionError instanceof Error
162util.inherits(assert.AssertionError, Error);
163
164function truncate(s, n) {
165 if (typeof s === 'string') {
166 return s.length < n ? s : s.slice(0, n);
167 } else {
168 return s;
169 }
170}
171function inspect(something) {
172 if (functionsHaveNames || !util.isFunction(something)) {
173 return util.inspect(something);
174 }
175 var rawname = getName(something);
176 var name = rawname ? ': ' + rawname : '';
177 return '[Function' + name + ']';
178}
179function getMessage(self) {
180 return truncate(inspect(self.actual), 128) + ' ' +
181 self.operator + ' ' +
182 truncate(inspect(self.expected), 128);
183}
184
185// At present only the three keys mentioned above are used and
186// understood by the spec. Implementations or sub modules can pass
187// other keys to the AssertionError's constructor - they will be
188// ignored.
189
190// 3. All of the following functions must throw an AssertionError
191// when a corresponding condition is not met, with a message that
192// may be undefined if not provided. All assertion methods provide
193// both the actual and expected values to the assertion error for
194// display purposes.
195
196function fail(actual, expected, message, operator, stackStartFunction) {
197 throw new assert.AssertionError({
198 message: message,
199 actual: actual,
200 expected: expected,
201 operator: operator,
202 stackStartFunction: stackStartFunction
203 });
204}
205
206// EXTENSION! allows for well behaved errors defined elsewhere.
207assert.fail = fail;
208
209// 4. Pure assertion tests whether a value is truthy, as determined
210// by !!guard.
211// assert.ok(guard, message_opt);
212// This statement is equivalent to assert.equal(true, !!guard,
213// message_opt);. To test strictly for the value true, use
214// assert.strictEqual(true, guard, message_opt);.
215
216function ok(value, message) {
217 if (!value) fail(value, true, message, '==', assert.ok);
218}
219assert.ok = ok;
220
221// 5. The equality assertion tests shallow, coercive equality with
222// ==.
223// assert.equal(actual, expected, message_opt);
224
225assert.equal = function equal(actual, expected, message) {
226 if (actual != expected) fail(actual, expected, message, '==', assert.equal);
227};
228
229// 6. The non-equality assertion tests for whether two objects are not equal
230// with != assert.notEqual(actual, expected, message_opt);
231
232assert.notEqual = function notEqual(actual, expected, message) {
233 if (actual == expected) {
234 fail(actual, expected, message, '!=', assert.notEqual);
235 }
236};
237
238// 7. The equivalence assertion tests a deep equality relation.
239// assert.deepEqual(actual, expected, message_opt);
240
241assert.deepEqual = function deepEqual(actual, expected, message) {
242 if (!_deepEqual(actual, expected, false)) {
243 fail(actual, expected, message, 'deepEqual', assert.deepEqual);
244 }
245};
246
247assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
248 if (!_deepEqual(actual, expected, true)) {
249 fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
250 }
251};
252
253function _deepEqual(actual, expected, strict, memos) {
254 // 7.1. All identical values are equivalent, as determined by ===.
255 if (actual === expected) {
256 return true;
257 } else if (isBuffer(actual) && isBuffer(expected)) {
258 return compare(actual, expected) === 0;
259
260 // 7.2. If the expected value is a Date object, the actual value is
261 // equivalent if it is also a Date object that refers to the same time.
262 } else if (util.isDate(actual) && util.isDate(expected)) {
263 return actual.getTime() === expected.getTime();
264
265 // 7.3 If the expected value is a RegExp object, the actual value is
266 // equivalent if it is also a RegExp object with the same source and
267 // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
268 } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
269 return actual.source === expected.source &&
270 actual.global === expected.global &&
271 actual.multiline === expected.multiline &&
272 actual.lastIndex === expected.lastIndex &&
273 actual.ignoreCase === expected.ignoreCase;
274
275 // 7.4. Other pairs that do not both pass typeof value == 'object',
276 // equivalence is determined by ==.
277 } else if ((actual === null || typeof actual !== 'object') &&
278 (expected === null || typeof expected !== 'object')) {
279 return strict ? actual === expected : actual == expected;
280
281 // If both values are instances of typed arrays, wrap their underlying
282 // ArrayBuffers in a Buffer each to increase performance
283 // This optimization requires the arrays to have the same type as checked by
284 // Object.prototype.toString (aka pToString). Never perform binary
285 // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
286 // bit patterns are not identical.
287 } else if (isView(actual) && isView(expected) &&
288 pToString(actual) === pToString(expected) &&
289 !(actual instanceof Float32Array ||
290 actual instanceof Float64Array)) {
291 return compare(new Uint8Array(actual.buffer),
292 new Uint8Array(expected.buffer)) === 0;
293
294 // 7.5 For all other Object pairs, including Array objects, equivalence is
295 // determined by having the same number of owned properties (as verified
296 // with Object.prototype.hasOwnProperty.call), the same set of keys
297 // (although not necessarily the same order), equivalent values for every
298 // corresponding key, and an identical 'prototype' property. Note: this
299 // accounts for both named and indexed properties on Arrays.
300 } else if (isBuffer(actual) !== isBuffer(expected)) {
301 return false;
302 } else {
303 memos = memos || {actual: [], expected: []};
304
305 var actualIndex = memos.actual.indexOf(actual);
306 if (actualIndex !== -1) {
307 if (actualIndex === memos.expected.indexOf(expected)) {
308 return true;
309 }
310 }
311
312 memos.actual.push(actual);
313 memos.expected.push(expected);
314
315 return objEquiv(actual, expected, strict, memos);
316 }
317}
318
319function isArguments(object) {
320 return Object.prototype.toString.call(object) == '[object Arguments]';
321}
322
323function objEquiv(a, b, strict, actualVisitedObjects) {
324 if (a === null || a === undefined || b === null || b === undefined)
325 return false;
326 // if one is a primitive, the other must be same
327 if (util.isPrimitive(a) || util.isPrimitive(b))
328 return a === b;
329 if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
330 return false;
331 var aIsArgs = isArguments(a);
332 var bIsArgs = isArguments(b);
333 if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
334 return false;
335 if (aIsArgs) {
336 a = pSlice.call(a);
337 b = pSlice.call(b);
338 return _deepEqual(a, b, strict);
339 }
340 var ka = objectKeys(a);
341 var kb = objectKeys(b);
342 var key, i;
343 // having the same number of owned properties (keys incorporates
344 // hasOwnProperty)
345 if (ka.length !== kb.length)
346 return false;
347 //the same set of keys (although not necessarily the same order),
348 ka.sort();
349 kb.sort();
350 //~~~cheap key test
351 for (i = ka.length - 1; i >= 0; i--) {
352 if (ka[i] !== kb[i])
353 return false;
354 }
355 //equivalent values for every corresponding key, and
356 //~~~possibly expensive deep test
357 for (i = ka.length - 1; i >= 0; i--) {
358 key = ka[i];
359 if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))
360 return false;
361 }
362 return true;
363}
364
365// 8. The non-equivalence assertion tests for any deep inequality.
366// assert.notDeepEqual(actual, expected, message_opt);
367
368assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
369 if (_deepEqual(actual, expected, false)) {
370 fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
371 }
372};
373
374assert.notDeepStrictEqual = notDeepStrictEqual;
375function notDeepStrictEqual(actual, expected, message) {
376 if (_deepEqual(actual, expected, true)) {
377 fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
378 }
379}
380
381
382// 9. The strict equality assertion tests strict equality, as determined by ===.
383// assert.strictEqual(actual, expected, message_opt);
384
385assert.strictEqual = function strictEqual(actual, expected, message) {
386 if (actual !== expected) {
387 fail(actual, expected, message, '===', assert.strictEqual);
388 }
389};
390
391// 10. The strict non-equality assertion tests for strict inequality, as
392// determined by !==. assert.notStrictEqual(actual, expected, message_opt);
393
394assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
395 if (actual === expected) {
396 fail(actual, expected, message, '!==', assert.notStrictEqual);
397 }
398};
399
400function expectedException(actual, expected) {
401 if (!actual || !expected) {
402 return false;
403 }
404
405 if (Object.prototype.toString.call(expected) == '[object RegExp]') {
406 return expected.test(actual);
407 }
408
409 try {
410 if (actual instanceof expected) {
411 return true;
412 }
413 } catch (e) {
414 // Ignore. The instanceof check doesn't work for arrow functions.
415 }
416
417 if (Error.isPrototypeOf(expected)) {
418 return false;
419 }
420
421 return expected.call({}, actual) === true;
422}
423
424function _tryBlock(block) {
425 var error;
426 try {
427 block();
428 } catch (e) {
429 error = e;
430 }
431 return error;
432}
433
434function _throws(shouldThrow, block, expected, message) {
435 var actual;
436
437 if (typeof block !== 'function') {
438 throw new TypeError('"block" argument must be a function');
439 }
440
441 if (typeof expected === 'string') {
442 message = expected;
443 expected = null;
444 }
445
446 actual = _tryBlock(block);
447
448 message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
449 (message ? ' ' + message : '.');
450
451 if (shouldThrow && !actual) {
452 fail(actual, expected, 'Missing expected exception' + message);
453 }
454
455 var userProvidedMessage = typeof message === 'string';
456 var isUnwantedException = !shouldThrow && util.isError(actual);
457 var isUnexpectedException = !shouldThrow && actual && !expected;
458
459 if ((isUnwantedException &&
460 userProvidedMessage &&
461 expectedException(actual, expected)) ||
462 isUnexpectedException) {
463 fail(actual, expected, 'Got unwanted exception' + message);
464 }
465
466 if ((shouldThrow && actual && expected &&
467 !expectedException(actual, expected)) || (!shouldThrow && actual)) {
468 throw actual;
469 }
470}
471
472// 11. Expected to throw an error:
473// assert.throws(block, Error_opt, message_opt);
474
475assert.throws = function(block, /*optional*/error, /*optional*/message) {
476 _throws(true, block, error, message);
477};
478
479// EXTENSION! This is annoying to write outside this module.
480assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
481 _throws(false, block, error, message);
482};
483
484assert.ifError = function(err) { if (err) throw err; };
485
486var objectKeys = Object.keys || function (obj) {
487 var keys = [];
488 for (var key in obj) {
489 if (hasOwn.call(obj, key)) keys.push(key);
490 }
491 return keys;
492};
493
494}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
495},{"util/":33}],2:[function(require,module,exports){
496'use strict'
497
498exports.byteLength = byteLength
499exports.toByteArray = toByteArray
500exports.fromByteArray = fromByteArray
501
502var lookup = []
503var revLookup = []
504var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
505
506var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
507for (var i = 0, len = code.length; i < len; ++i) {
508 lookup[i] = code[i]
509 revLookup[code.charCodeAt(i)] = i
510}
511
512revLookup['-'.charCodeAt(0)] = 62
513revLookup['_'.charCodeAt(0)] = 63
514
515function placeHoldersCount (b64) {
516 var len = b64.length
517 if (len % 4 > 0) {
518 throw new Error('Invalid string. Length must be a multiple of 4')
519 }
520
521 // the number of equal signs (place holders)
522 // if there are two placeholders, than the two characters before it
523 // represent one byte
524 // if there is only one, then the three characters before it represent 2 bytes
525 // this is just a cheap hack to not do indexOf twice
526 return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
527}
528
529function byteLength (b64) {
530 // base64 is 4/3 + up to two characters of the original data
531 return b64.length * 3 / 4 - placeHoldersCount(b64)
532}
533
534function toByteArray (b64) {
535 var i, j, l, tmp, placeHolders, arr
536 var len = b64.length
537 placeHolders = placeHoldersCount(b64)
538
539 arr = new Arr(len * 3 / 4 - placeHolders)
540
541 // if there are placeholders, only get up to the last complete 4 chars
542 l = placeHolders > 0 ? len - 4 : len
543
544 var L = 0
545
546 for (i = 0, j = 0; i < l; i += 4, j += 3) {
547 tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
548 arr[L++] = (tmp >> 16) & 0xFF
549 arr[L++] = (tmp >> 8) & 0xFF
550 arr[L++] = tmp & 0xFF
551 }
552
553 if (placeHolders === 2) {
554 tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
555 arr[L++] = tmp & 0xFF
556 } else if (placeHolders === 1) {
557 tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
558 arr[L++] = (tmp >> 8) & 0xFF
559 arr[L++] = tmp & 0xFF
560 }
561
562 return arr
563}
564
565function tripletToBase64 (num) {
566 return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
567}
568
569function encodeChunk (uint8, start, end) {
570 var tmp
571 var output = []
572 for (var i = start; i < end; i += 3) {
573 tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
574 output.push(tripletToBase64(tmp))
575 }
576 return output.join('')
577}
578
579function fromByteArray (uint8) {
580 var tmp
581 var len = uint8.length
582 var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
583 var output = ''
584 var parts = []
585 var maxChunkLength = 16383 // must be multiple of 3
586
587 // go through the array every three bytes, we'll deal with trailing stuff later
588 for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
589 parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
590 }
591
592 // pad the end with zeros, but make sure to not forget the extra bytes
593 if (extraBytes === 1) {
594 tmp = uint8[len - 1]
595 output += lookup[tmp >> 2]
596 output += lookup[(tmp << 4) & 0x3F]
597 output += '=='
598 } else if (extraBytes === 2) {
599 tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
600 output += lookup[tmp >> 10]
601 output += lookup[(tmp >> 4) & 0x3F]
602 output += lookup[(tmp << 2) & 0x3F]
603 output += '='
604 }
605
606 parts.push(output)
607
608 return parts.join('')
609}
610
611},{}],3:[function(require,module,exports){
612
613},{}],4:[function(require,module,exports){
614(function (global){
615'use strict';
616
617var buffer = require('buffer');
618var Buffer = buffer.Buffer;
619var SlowBuffer = buffer.SlowBuffer;
620var MAX_LEN = buffer.kMaxLength || 2147483647;
621exports.alloc = function alloc(size, fill, encoding) {
622 if (typeof Buffer.alloc === 'function') {
623 return Buffer.alloc(size, fill, encoding);
624 }
625 if (typeof encoding === 'number') {
626 throw new TypeError('encoding must not be number');
627 }
628 if (typeof size !== 'number') {
629 throw new TypeError('size must be a number');
630 }
631 if (size > MAX_LEN) {
632 throw new RangeError('size is too large');
633 }
634 var enc = encoding;
635 var _fill = fill;
636 if (_fill === undefined) {
637 enc = undefined;
638 _fill = 0;
639 }
640 var buf = new Buffer(size);
641 if (typeof _fill === 'string') {
642 var fillBuf = new Buffer(_fill, enc);
643 var flen = fillBuf.length;
644 var i = -1;
645 while (++i < size) {
646 buf[i] = fillBuf[i % flen];
647 }
648 } else {
649 buf.fill(_fill);
650 }
651 return buf;
652}
653exports.allocUnsafe = function allocUnsafe(size) {
654 if (typeof Buffer.allocUnsafe === 'function') {
655 return Buffer.allocUnsafe(size);
656 }
657 if (typeof size !== 'number') {
658 throw new TypeError('size must be a number');
659 }
660 if (size > MAX_LEN) {
661 throw new RangeError('size is too large');
662 }
663 return new Buffer(size);
664}
665exports.from = function from(value, encodingOrOffset, length) {
666 if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {
667 return Buffer.from(value, encodingOrOffset, length);
668 }
669 if (typeof value === 'number') {
670 throw new TypeError('"value" argument must not be a number');
671 }
672 if (typeof value === 'string') {
673 return new Buffer(value, encodingOrOffset);
674 }
675 if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
676 var offset = encodingOrOffset;
677 if (arguments.length === 1) {
678 return new Buffer(value);
679 }
680 if (typeof offset === 'undefined') {
681 offset = 0;
682 }
683 var len = length;
684 if (typeof len === 'undefined') {
685 len = value.byteLength - offset;
686 }
687 if (offset >= value.byteLength) {
688 throw new RangeError('\'offset\' is out of bounds');
689 }
690 if (len > value.byteLength - offset) {
691 throw new RangeError('\'length\' is out of bounds');
692 }
693 return new Buffer(value.slice(offset, offset + len));
694 }
695 if (Buffer.isBuffer(value)) {
696 var out = new Buffer(value.length);
697 value.copy(out, 0, 0, value.length);
698 return out;
699 }
700 if (value) {
701 if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) {
702 return new Buffer(value);
703 }
704 if (value.type === 'Buffer' && Array.isArray(value.data)) {
705 return new Buffer(value.data);
706 }
707 }
708
709 throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');
710}
711exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
712 if (typeof Buffer.allocUnsafeSlow === 'function') {
713 return Buffer.allocUnsafeSlow(size);
714 }
715 if (typeof size !== 'number') {
716 throw new TypeError('size must be a number');
717 }
718 if (size >= MAX_LEN) {
719 throw new RangeError('size is too large');
720 }
721 return new SlowBuffer(size);
722}
723
724}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
725},{"buffer":5}],5:[function(require,module,exports){
726/*!
727 * The buffer module from node.js, for the browser.
728 *
729 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
730 * @license MIT
731 */
732/* eslint-disable no-proto */
733
734'use strict'
735
736var base64 = require('base64-js')
737var ieee754 = require('ieee754')
738
739exports.Buffer = Buffer
740exports.SlowBuffer = SlowBuffer
741exports.INSPECT_MAX_BYTES = 50
742
743var K_MAX_LENGTH = 0x7fffffff
744exports.kMaxLength = K_MAX_LENGTH
745
746/**
747 * If `Buffer.TYPED_ARRAY_SUPPORT`:
748 * === true Use Uint8Array implementation (fastest)
749 * === false Print warning and recommend using `buffer` v4.x which has an Object
750 * implementation (most compatible, even IE6)
751 *
752 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
753 * Opera 11.6+, iOS 4.2+.
754 *
755 * We report that the browser does not support typed arrays if the are not subclassable
756 * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
757 * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
758 * for __proto__ and has a buggy typed array implementation.
759 */
760Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
761
762if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
763 typeof console.error === 'function') {
764 console.error(
765 'This browser lacks typed array (Uint8Array) support which is required by ' +
766 '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
767 )
768}
769
770function typedArraySupport () {
771 // Can typed array instances can be augmented?
772 try {
773 var arr = new Uint8Array(1)
774 arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
775 return arr.foo() === 42
776 } catch (e) {
777 return false
778 }
779}
780
781function createBuffer (length) {
782 if (length > K_MAX_LENGTH) {
783 throw new RangeError('Invalid typed array length')
784 }
785 // Return an augmented `Uint8Array` instance
786 var buf = new Uint8Array(length)
787 buf.__proto__ = Buffer.prototype
788 return buf
789}
790
791/**
792 * The Buffer constructor returns instances of `Uint8Array` that have their
793 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
794 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
795 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
796 * returns a single octet.
797 *
798 * The `Uint8Array` prototype remains unmodified.
799 */
800
801function Buffer (arg, encodingOrOffset, length) {
802 // Common case.
803 if (typeof arg === 'number') {
804 if (typeof encodingOrOffset === 'string') {
805 throw new Error(
806 'If encoding is specified then the first argument must be a string'
807 )
808 }
809 return allocUnsafe(arg)
810 }
811 return from(arg, encodingOrOffset, length)
812}
813
814// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
815if (typeof Symbol !== 'undefined' && Symbol.species &&
816 Buffer[Symbol.species] === Buffer) {
817 Object.defineProperty(Buffer, Symbol.species, {
818 value: null,
819 configurable: true,
820 enumerable: false,
821 writable: false
822 })
823}
824
825Buffer.poolSize = 8192 // not used by this implementation
826
827function from (value, encodingOrOffset, length) {
828 if (typeof value === 'number') {
829 throw new TypeError('"value" argument must not be a number')
830 }
831
832 if (value instanceof ArrayBuffer) {
833 return fromArrayBuffer(value, encodingOrOffset, length)
834 }
835
836 if (typeof value === 'string') {
837 return fromString(value, encodingOrOffset)
838 }
839
840 return fromObject(value)
841}
842
843/**
844 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
845 * if value is a number.
846 * Buffer.from(str[, encoding])
847 * Buffer.from(array)
848 * Buffer.from(buffer)
849 * Buffer.from(arrayBuffer[, byteOffset[, length]])
850 **/
851Buffer.from = function (value, encodingOrOffset, length) {
852 return from(value, encodingOrOffset, length)
853}
854
855// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
856// https://github.com/feross/buffer/pull/148
857Buffer.prototype.__proto__ = Uint8Array.prototype
858Buffer.__proto__ = Uint8Array
859
860function assertSize (size) {
861 if (typeof size !== 'number') {
862 throw new TypeError('"size" argument must be a number')
863 } else if (size < 0) {
864 throw new RangeError('"size" argument must not be negative')
865 }
866}
867
868function alloc (size, fill, encoding) {
869 assertSize(size)
870 if (size <= 0) {
871 return createBuffer(size)
872 }
873 if (fill !== undefined) {
874 // Only pay attention to encoding if it's a string. This
875 // prevents accidentally sending in a number that would
876 // be interpretted as a start offset.
877 return typeof encoding === 'string'
878 ? createBuffer(size).fill(fill, encoding)
879 : createBuffer(size).fill(fill)
880 }
881 return createBuffer(size)
882}
883
884/**
885 * Creates a new filled Buffer instance.
886 * alloc(size[, fill[, encoding]])
887 **/
888Buffer.alloc = function (size, fill, encoding) {
889 return alloc(size, fill, encoding)
890}
891
892function allocUnsafe (size) {
893 assertSize(size)
894 return createBuffer(size < 0 ? 0 : checked(size) | 0)
895}
896
897/**
898 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
899 * */
900Buffer.allocUnsafe = function (size) {
901 return allocUnsafe(size)
902}
903/**
904 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
905 */
906Buffer.allocUnsafeSlow = function (size) {
907 return allocUnsafe(size)
908}
909
910function fromString (string, encoding) {
911 if (typeof encoding !== 'string' || encoding === '') {
912 encoding = 'utf8'
913 }
914
915 if (!Buffer.isEncoding(encoding)) {
916 throw new TypeError('"encoding" must be a valid string encoding')
917 }
918
919 var length = byteLength(string, encoding) | 0
920 var buf = createBuffer(length)
921
922 var actual = buf.write(string, encoding)
923
924 if (actual !== length) {
925 // Writing a hex string, for example, that contains invalid characters will
926 // cause everything after the first invalid character to be ignored. (e.g.
927 // 'abxxcd' will be treated as 'ab')
928 buf = buf.slice(0, actual)
929 }
930
931 return buf
932}
933
934function fromArrayLike (array) {
935 var length = array.length < 0 ? 0 : checked(array.length) | 0
936 var buf = createBuffer(length)
937 for (var i = 0; i < length; i += 1) {
938 buf[i] = array[i] & 255
939 }
940 return buf
941}
942
943function fromArrayBuffer (array, byteOffset, length) {
944 if (byteOffset < 0 || array.byteLength < byteOffset) {
945 throw new RangeError('\'offset\' is out of bounds')
946 }
947
948 if (array.byteLength < byteOffset + (length || 0)) {
949 throw new RangeError('\'length\' is out of bounds')
950 }
951
952 var buf
953 if (byteOffset === undefined && length === undefined) {
954 buf = new Uint8Array(array)
955 } else if (length === undefined) {
956 buf = new Uint8Array(array, byteOffset)
957 } else {
958 buf = new Uint8Array(array, byteOffset, length)
959 }
960
961 // Return an augmented `Uint8Array` instance
962 buf.__proto__ = Buffer.prototype
963 return buf
964}
965
966function fromObject (obj) {
967 if (Buffer.isBuffer(obj)) {
968 var len = checked(obj.length) | 0
969 var buf = createBuffer(len)
970
971 if (buf.length === 0) {
972 return buf
973 }
974
975 obj.copy(buf, 0, 0, len)
976 return buf
977 }
978
979 if (obj) {
980 if (isArrayBufferView(obj) || 'length' in obj) {
981 if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
982 return createBuffer(0)
983 }
984 return fromArrayLike(obj)
985 }
986
987 if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
988 return fromArrayLike(obj.data)
989 }
990 }
991
992 throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
993}
994
995function checked (length) {
996 // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
997 // length is NaN (which is otherwise coerced to zero.)
998 if (length >= K_MAX_LENGTH) {
999 throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
1000 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
1001 }
1002 return length | 0
1003}
1004
1005function SlowBuffer (length) {
1006 if (+length != length) { // eslint-disable-line eqeqeq
1007 length = 0
1008 }
1009 return Buffer.alloc(+length)
1010}
1011
1012Buffer.isBuffer = function isBuffer (b) {
1013 return b != null && b._isBuffer === true
1014}
1015
1016Buffer.compare = function compare (a, b) {
1017 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
1018 throw new TypeError('Arguments must be Buffers')
1019 }
1020
1021 if (a === b) return 0
1022
1023 var x = a.length
1024 var y = b.length
1025
1026 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
1027 if (a[i] !== b[i]) {
1028 x = a[i]
1029 y = b[i]
1030 break
1031 }
1032 }
1033
1034 if (x < y) return -1
1035 if (y < x) return 1
1036 return 0
1037}
1038
1039Buffer.isEncoding = function isEncoding (encoding) {
1040 switch (String(encoding).toLowerCase()) {
1041 case 'hex':
1042 case 'utf8':
1043 case 'utf-8':
1044 case 'ascii':
1045 case 'latin1':
1046 case 'binary':
1047 case 'base64':
1048 case 'ucs2':
1049 case 'ucs-2':
1050 case 'utf16le':
1051 case 'utf-16le':
1052 return true
1053 default:
1054 return false
1055 }
1056}
1057
1058Buffer.concat = function concat (list, length) {
1059 if (!Array.isArray(list)) {
1060 throw new TypeError('"list" argument must be an Array of Buffers')
1061 }
1062
1063 if (list.length === 0) {
1064 return Buffer.alloc(0)
1065 }
1066
1067 var i
1068 if (length === undefined) {
1069 length = 0
1070 for (i = 0; i < list.length; ++i) {
1071 length += list[i].length
1072 }
1073 }
1074
1075 var buffer = Buffer.allocUnsafe(length)
1076 var pos = 0
1077 for (i = 0; i < list.length; ++i) {
1078 var buf = list[i]
1079 if (!Buffer.isBuffer(buf)) {
1080 throw new TypeError('"list" argument must be an Array of Buffers')
1081 }
1082 buf.copy(buffer, pos)
1083 pos += buf.length
1084 }
1085 return buffer
1086}
1087
1088function byteLength (string, encoding) {
1089 if (Buffer.isBuffer(string)) {
1090 return string.length
1091 }
1092 if (isArrayBufferView(string) || string instanceof ArrayBuffer) {
1093 return string.byteLength
1094 }
1095 if (typeof string !== 'string') {
1096 string = '' + string
1097 }
1098
1099 var len = string.length
1100 if (len === 0) return 0
1101
1102 // Use a for loop to avoid recursion
1103 var loweredCase = false
1104 for (;;) {
1105 switch (encoding) {
1106 case 'ascii':
1107 case 'latin1':
1108 case 'binary':
1109 return len
1110 case 'utf8':
1111 case 'utf-8':
1112 case undefined:
1113 return utf8ToBytes(string).length
1114 case 'ucs2':
1115 case 'ucs-2':
1116 case 'utf16le':
1117 case 'utf-16le':
1118 return len * 2
1119 case 'hex':
1120 return len >>> 1
1121 case 'base64':
1122 return base64ToBytes(string).length
1123 default:
1124 if (loweredCase) return utf8ToBytes(string).length // assume utf8
1125 encoding = ('' + encoding).toLowerCase()
1126 loweredCase = true
1127 }
1128 }
1129}
1130Buffer.byteLength = byteLength
1131
1132function slowToString (encoding, start, end) {
1133 var loweredCase = false
1134
1135 // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
1136 // property of a typed array.
1137
1138 // This behaves neither like String nor Uint8Array in that we set start/end
1139 // to their upper/lower bounds if the value passed is out of range.
1140 // undefined is handled specially as per ECMA-262 6th Edition,
1141 // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
1142 if (start === undefined || start < 0) {
1143 start = 0
1144 }
1145 // Return early if start > this.length. Done here to prevent potential uint32
1146 // coercion fail below.
1147 if (start > this.length) {
1148 return ''
1149 }
1150
1151 if (end === undefined || end > this.length) {
1152 end = this.length
1153 }
1154
1155 if (end <= 0) {
1156 return ''
1157 }
1158
1159 // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
1160 end >>>= 0
1161 start >>>= 0
1162
1163 if (end <= start) {
1164 return ''
1165 }
1166
1167 if (!encoding) encoding = 'utf8'
1168
1169 while (true) {
1170 switch (encoding) {
1171 case 'hex':
1172 return hexSlice(this, start, end)
1173
1174 case 'utf8':
1175 case 'utf-8':
1176 return utf8Slice(this, start, end)
1177
1178 case 'ascii':
1179 return asciiSlice(this, start, end)
1180
1181 case 'latin1':
1182 case 'binary':
1183 return latin1Slice(this, start, end)
1184
1185 case 'base64':
1186 return base64Slice(this, start, end)
1187
1188 case 'ucs2':
1189 case 'ucs-2':
1190 case 'utf16le':
1191 case 'utf-16le':
1192 return utf16leSlice(this, start, end)
1193
1194 default:
1195 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
1196 encoding = (encoding + '').toLowerCase()
1197 loweredCase = true
1198 }
1199 }
1200}
1201
1202// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
1203// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
1204// reliably in a browserify context because there could be multiple different
1205// copies of the 'buffer' package in use. This method works even for Buffer
1206// instances that were created from another copy of the `buffer` package.
1207// See: https://github.com/feross/buffer/issues/154
1208Buffer.prototype._isBuffer = true
1209
1210function swap (b, n, m) {
1211 var i = b[n]
1212 b[n] = b[m]
1213 b[m] = i
1214}
1215
1216Buffer.prototype.swap16 = function swap16 () {
1217 var len = this.length
1218 if (len % 2 !== 0) {
1219 throw new RangeError('Buffer size must be a multiple of 16-bits')
1220 }
1221 for (var i = 0; i < len; i += 2) {
1222 swap(this, i, i + 1)
1223 }
1224 return this
1225}
1226
1227Buffer.prototype.swap32 = function swap32 () {
1228 var len = this.length
1229 if (len % 4 !== 0) {
1230 throw new RangeError('Buffer size must be a multiple of 32-bits')
1231 }
1232 for (var i = 0; i < len; i += 4) {
1233 swap(this, i, i + 3)
1234 swap(this, i + 1, i + 2)
1235 }
1236 return this
1237}
1238
1239Buffer.prototype.swap64 = function swap64 () {
1240 var len = this.length
1241 if (len % 8 !== 0) {
1242 throw new RangeError('Buffer size must be a multiple of 64-bits')
1243 }
1244 for (var i = 0; i < len; i += 8) {
1245 swap(this, i, i + 7)
1246 swap(this, i + 1, i + 6)
1247 swap(this, i + 2, i + 5)
1248 swap(this, i + 3, i + 4)
1249 }
1250 return this
1251}
1252
1253Buffer.prototype.toString = function toString () {
1254 var length = this.length
1255 if (length === 0) return ''
1256 if (arguments.length === 0) return utf8Slice(this, 0, length)
1257 return slowToString.apply(this, arguments)
1258}
1259
1260Buffer.prototype.equals = function equals (b) {
1261 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
1262 if (this === b) return true
1263 return Buffer.compare(this, b) === 0
1264}
1265
1266Buffer.prototype.inspect = function inspect () {
1267 var str = ''
1268 var max = exports.INSPECT_MAX_BYTES
1269 if (this.length > 0) {
1270 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
1271 if (this.length > max) str += ' ... '
1272 }
1273 return '<Buffer ' + str + '>'
1274}
1275
1276Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
1277 if (!Buffer.isBuffer(target)) {
1278 throw new TypeError('Argument must be a Buffer')
1279 }
1280
1281 if (start === undefined) {
1282 start = 0
1283 }
1284 if (end === undefined) {
1285 end = target ? target.length : 0
1286 }
1287 if (thisStart === undefined) {
1288 thisStart = 0
1289 }
1290 if (thisEnd === undefined) {
1291 thisEnd = this.length
1292 }
1293
1294 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
1295 throw new RangeError('out of range index')
1296 }
1297
1298 if (thisStart >= thisEnd && start >= end) {
1299 return 0
1300 }
1301 if (thisStart >= thisEnd) {
1302 return -1
1303 }
1304 if (start >= end) {
1305 return 1
1306 }
1307
1308 start >>>= 0
1309 end >>>= 0
1310 thisStart >>>= 0
1311 thisEnd >>>= 0
1312
1313 if (this === target) return 0
1314
1315 var x = thisEnd - thisStart
1316 var y = end - start
1317 var len = Math.min(x, y)
1318
1319 var thisCopy = this.slice(thisStart, thisEnd)
1320 var targetCopy = target.slice(start, end)
1321
1322 for (var i = 0; i < len; ++i) {
1323 if (thisCopy[i] !== targetCopy[i]) {
1324 x = thisCopy[i]
1325 y = targetCopy[i]
1326 break
1327 }
1328 }
1329
1330 if (x < y) return -1
1331 if (y < x) return 1
1332 return 0
1333}
1334
1335// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
1336// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
1337//
1338// Arguments:
1339// - buffer - a Buffer to search
1340// - val - a string, Buffer, or number
1341// - byteOffset - an index into `buffer`; will be clamped to an int32
1342// - encoding - an optional encoding, relevant is val is a string
1343// - dir - true for indexOf, false for lastIndexOf
1344function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
1345 // Empty buffer means no match
1346 if (buffer.length === 0) return -1
1347
1348 // Normalize byteOffset
1349 if (typeof byteOffset === 'string') {
1350 encoding = byteOffset
1351 byteOffset = 0
1352 } else if (byteOffset > 0x7fffffff) {
1353 byteOffset = 0x7fffffff
1354 } else if (byteOffset < -0x80000000) {
1355 byteOffset = -0x80000000
1356 }
1357 byteOffset = +byteOffset // Coerce to Number.
1358 if (numberIsNaN(byteOffset)) {
1359 // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
1360 byteOffset = dir ? 0 : (buffer.length - 1)
1361 }
1362
1363 // Normalize byteOffset: negative offsets start from the end of the buffer
1364 if (byteOffset < 0) byteOffset = buffer.length + byteOffset
1365 if (byteOffset >= buffer.length) {
1366 if (dir) return -1
1367 else byteOffset = buffer.length - 1
1368 } else if (byteOffset < 0) {
1369 if (dir) byteOffset = 0
1370 else return -1
1371 }
1372
1373 // Normalize val
1374 if (typeof val === 'string') {
1375 val = Buffer.from(val, encoding)
1376 }
1377
1378 // Finally, search either indexOf (if dir is true) or lastIndexOf
1379 if (Buffer.isBuffer(val)) {
1380 // Special case: looking for empty string/buffer always fails
1381 if (val.length === 0) {
1382 return -1
1383 }
1384 return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
1385 } else if (typeof val === 'number') {
1386 val = val & 0xFF // Search for a byte value [0-255]
1387 if (typeof Uint8Array.prototype.indexOf === 'function') {
1388 if (dir) {
1389 return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
1390 } else {
1391 return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
1392 }
1393 }
1394 return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
1395 }
1396
1397 throw new TypeError('val must be string, number or Buffer')
1398}
1399
1400function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
1401 var indexSize = 1
1402 var arrLength = arr.length
1403 var valLength = val.length
1404
1405 if (encoding !== undefined) {
1406 encoding = String(encoding).toLowerCase()
1407 if (encoding === 'ucs2' || encoding === 'ucs-2' ||
1408 encoding === 'utf16le' || encoding === 'utf-16le') {
1409 if (arr.length < 2 || val.length < 2) {
1410 return -1
1411 }
1412 indexSize = 2
1413 arrLength /= 2
1414 valLength /= 2
1415 byteOffset /= 2
1416 }
1417 }
1418
1419 function read (buf, i) {
1420 if (indexSize === 1) {
1421 return buf[i]
1422 } else {
1423 return buf.readUInt16BE(i * indexSize)
1424 }
1425 }
1426
1427 var i
1428 if (dir) {
1429 var foundIndex = -1
1430 for (i = byteOffset; i < arrLength; i++) {
1431 if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
1432 if (foundIndex === -1) foundIndex = i
1433 if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
1434 } else {
1435 if (foundIndex !== -1) i -= i - foundIndex
1436 foundIndex = -1
1437 }
1438 }
1439 } else {
1440 if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
1441 for (i = byteOffset; i >= 0; i--) {
1442 var found = true
1443 for (var j = 0; j < valLength; j++) {
1444 if (read(arr, i + j) !== read(val, j)) {
1445 found = false
1446 break
1447 }
1448 }
1449 if (found) return i
1450 }
1451 }
1452
1453 return -1
1454}
1455
1456Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
1457 return this.indexOf(val, byteOffset, encoding) !== -1
1458}
1459
1460Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
1461 return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
1462}
1463
1464Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
1465 return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
1466}
1467
1468function hexWrite (buf, string, offset, length) {
1469 offset = Number(offset) || 0
1470 var remaining = buf.length - offset
1471 if (!length) {
1472 length = remaining
1473 } else {
1474 length = Number(length)
1475 if (length > remaining) {
1476 length = remaining
1477 }
1478 }
1479
1480 // must be an even number of digits
1481 var strLen = string.length
1482 if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
1483
1484 if (length > strLen / 2) {
1485 length = strLen / 2
1486 }
1487 for (var i = 0; i < length; ++i) {
1488 var parsed = parseInt(string.substr(i * 2, 2), 16)
1489 if (numberIsNaN(parsed)) return i
1490 buf[offset + i] = parsed
1491 }
1492 return i
1493}
1494
1495function utf8Write (buf, string, offset, length) {
1496 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
1497}
1498
1499function asciiWrite (buf, string, offset, length) {
1500 return blitBuffer(asciiToBytes(string), buf, offset, length)
1501}
1502
1503function latin1Write (buf, string, offset, length) {
1504 return asciiWrite(buf, string, offset, length)
1505}
1506
1507function base64Write (buf, string, offset, length) {
1508 return blitBuffer(base64ToBytes(string), buf, offset, length)
1509}
1510
1511function ucs2Write (buf, string, offset, length) {
1512 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
1513}
1514
1515Buffer.prototype.write = function write (string, offset, length, encoding) {
1516 // Buffer#write(string)
1517 if (offset === undefined) {
1518 encoding = 'utf8'
1519 length = this.length
1520 offset = 0
1521 // Buffer#write(string, encoding)
1522 } else if (length === undefined && typeof offset === 'string') {
1523 encoding = offset
1524 length = this.length
1525 offset = 0
1526 // Buffer#write(string, offset[, length][, encoding])
1527 } else if (isFinite(offset)) {
1528 offset = offset >>> 0
1529 if (isFinite(length)) {
1530 length = length >>> 0
1531 if (encoding === undefined) encoding = 'utf8'
1532 } else {
1533 encoding = length
1534 length = undefined
1535 }
1536 } else {
1537 throw new Error(
1538 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
1539 )
1540 }
1541
1542 var remaining = this.length - offset
1543 if (length === undefined || length > remaining) length = remaining
1544
1545 if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
1546 throw new RangeError('Attempt to write outside buffer bounds')
1547 }
1548
1549 if (!encoding) encoding = 'utf8'
1550
1551 var loweredCase = false
1552 for (;;) {
1553 switch (encoding) {
1554 case 'hex':
1555 return hexWrite(this, string, offset, length)
1556
1557 case 'utf8':
1558 case 'utf-8':
1559 return utf8Write(this, string, offset, length)
1560
1561 case 'ascii':
1562 return asciiWrite(this, string, offset, length)
1563
1564 case 'latin1':
1565 case 'binary':
1566 return latin1Write(this, string, offset, length)
1567
1568 case 'base64':
1569 // Warning: maxLength not taken into account in base64Write
1570 return base64Write(this, string, offset, length)
1571
1572 case 'ucs2':
1573 case 'ucs-2':
1574 case 'utf16le':
1575 case 'utf-16le':
1576 return ucs2Write(this, string, offset, length)
1577
1578 default:
1579 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
1580 encoding = ('' + encoding).toLowerCase()
1581 loweredCase = true
1582 }
1583 }
1584}
1585
1586Buffer.prototype.toJSON = function toJSON () {
1587 return {
1588 type: 'Buffer',
1589 data: Array.prototype.slice.call(this._arr || this, 0)
1590 }
1591}
1592
1593function base64Slice (buf, start, end) {
1594 if (start === 0 && end === buf.length) {
1595 return base64.fromByteArray(buf)
1596 } else {
1597 return base64.fromByteArray(buf.slice(start, end))
1598 }
1599}
1600
1601function utf8Slice (buf, start, end) {
1602 end = Math.min(buf.length, end)
1603 var res = []
1604
1605 var i = start
1606 while (i < end) {
1607 var firstByte = buf[i]
1608 var codePoint = null
1609 var bytesPerSequence = (firstByte > 0xEF) ? 4
1610 : (firstByte > 0xDF) ? 3
1611 : (firstByte > 0xBF) ? 2
1612 : 1
1613
1614 if (i + bytesPerSequence <= end) {
1615 var secondByte, thirdByte, fourthByte, tempCodePoint
1616
1617 switch (bytesPerSequence) {
1618 case 1:
1619 if (firstByte < 0x80) {
1620 codePoint = firstByte
1621 }
1622 break
1623 case 2:
1624 secondByte = buf[i + 1]
1625 if ((secondByte & 0xC0) === 0x80) {
1626 tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
1627 if (tempCodePoint > 0x7F) {
1628 codePoint = tempCodePoint
1629 }
1630 }
1631 break
1632 case 3:
1633 secondByte = buf[i + 1]
1634 thirdByte = buf[i + 2]
1635 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
1636 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
1637 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
1638 codePoint = tempCodePoint
1639 }
1640 }
1641 break
1642 case 4:
1643 secondByte = buf[i + 1]
1644 thirdByte = buf[i + 2]
1645 fourthByte = buf[i + 3]
1646 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
1647 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
1648 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
1649 codePoint = tempCodePoint
1650 }
1651 }
1652 }
1653 }
1654
1655 if (codePoint === null) {
1656 // we did not generate a valid codePoint so insert a
1657 // replacement char (U+FFFD) and advance only 1 byte
1658 codePoint = 0xFFFD
1659 bytesPerSequence = 1
1660 } else if (codePoint > 0xFFFF) {
1661 // encode to utf16 (surrogate pair dance)
1662 codePoint -= 0x10000
1663 res.push(codePoint >>> 10 & 0x3FF | 0xD800)
1664 codePoint = 0xDC00 | codePoint & 0x3FF
1665 }
1666
1667 res.push(codePoint)
1668 i += bytesPerSequence
1669 }
1670
1671 return decodeCodePointsArray(res)
1672}
1673
1674// Based on http://stackoverflow.com/a/22747272/680742, the browser with
1675// the lowest limit is Chrome, with 0x10000 args.
1676// We go 1 magnitude less, for safety
1677var MAX_ARGUMENTS_LENGTH = 0x1000
1678
1679function decodeCodePointsArray (codePoints) {
1680 var len = codePoints.length
1681 if (len <= MAX_ARGUMENTS_LENGTH) {
1682 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
1683 }
1684
1685 // Decode in chunks to avoid "call stack size exceeded".
1686 var res = ''
1687 var i = 0
1688 while (i < len) {
1689 res += String.fromCharCode.apply(
1690 String,
1691 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
1692 )
1693 }
1694 return res
1695}
1696
1697function asciiSlice (buf, start, end) {
1698 var ret = ''
1699 end = Math.min(buf.length, end)
1700
1701 for (var i = start; i < end; ++i) {
1702 ret += String.fromCharCode(buf[i] & 0x7F)
1703 }
1704 return ret
1705}
1706
1707function latin1Slice (buf, start, end) {
1708 var ret = ''
1709 end = Math.min(buf.length, end)
1710
1711 for (var i = start; i < end; ++i) {
1712 ret += String.fromCharCode(buf[i])
1713 }
1714 return ret
1715}
1716
1717function hexSlice (buf, start, end) {
1718 var len = buf.length
1719
1720 if (!start || start < 0) start = 0
1721 if (!end || end < 0 || end > len) end = len
1722
1723 var out = ''
1724 for (var i = start; i < end; ++i) {
1725 out += toHex(buf[i])
1726 }
1727 return out
1728}
1729
1730function utf16leSlice (buf, start, end) {
1731 var bytes = buf.slice(start, end)
1732 var res = ''
1733 for (var i = 0; i < bytes.length; i += 2) {
1734 res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
1735 }
1736 return res
1737}
1738
1739Buffer.prototype.slice = function slice (start, end) {
1740 var len = this.length
1741 start = ~~start
1742 end = end === undefined ? len : ~~end
1743
1744 if (start < 0) {
1745 start += len
1746 if (start < 0) start = 0
1747 } else if (start > len) {
1748 start = len
1749 }
1750
1751 if (end < 0) {
1752 end += len
1753 if (end < 0) end = 0
1754 } else if (end > len) {
1755 end = len
1756 }
1757
1758 if (end < start) end = start
1759
1760 var newBuf = this.subarray(start, end)
1761 // Return an augmented `Uint8Array` instance
1762 newBuf.__proto__ = Buffer.prototype
1763 return newBuf
1764}
1765
1766/*
1767 * Need to make sure that buffer isn't trying to write out of bounds.
1768 */
1769function checkOffset (offset, ext, length) {
1770 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
1771 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
1772}
1773
1774Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
1775 offset = offset >>> 0
1776 byteLength = byteLength >>> 0
1777 if (!noAssert) checkOffset(offset, byteLength, this.length)
1778
1779 var val = this[offset]
1780 var mul = 1
1781 var i = 0
1782 while (++i < byteLength && (mul *= 0x100)) {
1783 val += this[offset + i] * mul
1784 }
1785
1786 return val
1787}
1788
1789Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
1790 offset = offset >>> 0
1791 byteLength = byteLength >>> 0
1792 if (!noAssert) {
1793 checkOffset(offset, byteLength, this.length)
1794 }
1795
1796 var val = this[offset + --byteLength]
1797 var mul = 1
1798 while (byteLength > 0 && (mul *= 0x100)) {
1799 val += this[offset + --byteLength] * mul
1800 }
1801
1802 return val
1803}
1804
1805Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
1806 offset = offset >>> 0
1807 if (!noAssert) checkOffset(offset, 1, this.length)
1808 return this[offset]
1809}
1810
1811Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
1812 offset = offset >>> 0
1813 if (!noAssert) checkOffset(offset, 2, this.length)
1814 return this[offset] | (this[offset + 1] << 8)
1815}
1816
1817Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
1818 offset = offset >>> 0
1819 if (!noAssert) checkOffset(offset, 2, this.length)
1820 return (this[offset] << 8) | this[offset + 1]
1821}
1822
1823Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
1824 offset = offset >>> 0
1825 if (!noAssert) checkOffset(offset, 4, this.length)
1826
1827 return ((this[offset]) |
1828 (this[offset + 1] << 8) |
1829 (this[offset + 2] << 16)) +
1830 (this[offset + 3] * 0x1000000)
1831}
1832
1833Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
1834 offset = offset >>> 0
1835 if (!noAssert) checkOffset(offset, 4, this.length)
1836
1837 return (this[offset] * 0x1000000) +
1838 ((this[offset + 1] << 16) |
1839 (this[offset + 2] << 8) |
1840 this[offset + 3])
1841}
1842
1843Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
1844 offset = offset >>> 0
1845 byteLength = byteLength >>> 0
1846 if (!noAssert) checkOffset(offset, byteLength, this.length)
1847
1848 var val = this[offset]
1849 var mul = 1
1850 var i = 0
1851 while (++i < byteLength && (mul *= 0x100)) {
1852 val += this[offset + i] * mul
1853 }
1854 mul *= 0x80
1855
1856 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
1857
1858 return val
1859}
1860
1861Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
1862 offset = offset >>> 0
1863 byteLength = byteLength >>> 0
1864 if (!noAssert) checkOffset(offset, byteLength, this.length)
1865
1866 var i = byteLength
1867 var mul = 1
1868 var val = this[offset + --i]
1869 while (i > 0 && (mul *= 0x100)) {
1870 val += this[offset + --i] * mul
1871 }
1872 mul *= 0x80
1873
1874 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
1875
1876 return val
1877}
1878
1879Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
1880 offset = offset >>> 0
1881 if (!noAssert) checkOffset(offset, 1, this.length)
1882 if (!(this[offset] & 0x80)) return (this[offset])
1883 return ((0xff - this[offset] + 1) * -1)
1884}
1885
1886Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
1887 offset = offset >>> 0
1888 if (!noAssert) checkOffset(offset, 2, this.length)
1889 var val = this[offset] | (this[offset + 1] << 8)
1890 return (val & 0x8000) ? val | 0xFFFF0000 : val
1891}
1892
1893Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
1894 offset = offset >>> 0
1895 if (!noAssert) checkOffset(offset, 2, this.length)
1896 var val = this[offset + 1] | (this[offset] << 8)
1897 return (val & 0x8000) ? val | 0xFFFF0000 : val
1898}
1899
1900Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
1901 offset = offset >>> 0
1902 if (!noAssert) checkOffset(offset, 4, this.length)
1903
1904 return (this[offset]) |
1905 (this[offset + 1] << 8) |
1906 (this[offset + 2] << 16) |
1907 (this[offset + 3] << 24)
1908}
1909
1910Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
1911 offset = offset >>> 0
1912 if (!noAssert) checkOffset(offset, 4, this.length)
1913
1914 return (this[offset] << 24) |
1915 (this[offset + 1] << 16) |
1916 (this[offset + 2] << 8) |
1917 (this[offset + 3])
1918}
1919
1920Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
1921 offset = offset >>> 0
1922 if (!noAssert) checkOffset(offset, 4, this.length)
1923 return ieee754.read(this, offset, true, 23, 4)
1924}
1925
1926Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
1927 offset = offset >>> 0
1928 if (!noAssert) checkOffset(offset, 4, this.length)
1929 return ieee754.read(this, offset, false, 23, 4)
1930}
1931
1932Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
1933 offset = offset >>> 0
1934 if (!noAssert) checkOffset(offset, 8, this.length)
1935 return ieee754.read(this, offset, true, 52, 8)
1936}
1937
1938Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
1939 offset = offset >>> 0
1940 if (!noAssert) checkOffset(offset, 8, this.length)
1941 return ieee754.read(this, offset, false, 52, 8)
1942}
1943
1944function checkInt (buf, value, offset, ext, max, min) {
1945 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
1946 if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
1947 if (offset + ext > buf.length) throw new RangeError('Index out of range')
1948}
1949
1950Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
1951 value = +value
1952 offset = offset >>> 0
1953 byteLength = byteLength >>> 0
1954 if (!noAssert) {
1955 var maxBytes = Math.pow(2, 8 * byteLength) - 1
1956 checkInt(this, value, offset, byteLength, maxBytes, 0)
1957 }
1958
1959 var mul = 1
1960 var i = 0
1961 this[offset] = value & 0xFF
1962 while (++i < byteLength && (mul *= 0x100)) {
1963 this[offset + i] = (value / mul) & 0xFF
1964 }
1965
1966 return offset + byteLength
1967}
1968
1969Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
1970 value = +value
1971 offset = offset >>> 0
1972 byteLength = byteLength >>> 0
1973 if (!noAssert) {
1974 var maxBytes = Math.pow(2, 8 * byteLength) - 1
1975 checkInt(this, value, offset, byteLength, maxBytes, 0)
1976 }
1977
1978 var i = byteLength - 1
1979 var mul = 1
1980 this[offset + i] = value & 0xFF
1981 while (--i >= 0 && (mul *= 0x100)) {
1982 this[offset + i] = (value / mul) & 0xFF
1983 }
1984
1985 return offset + byteLength
1986}
1987
1988Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
1989 value = +value
1990 offset = offset >>> 0
1991 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
1992 this[offset] = (value & 0xff)
1993 return offset + 1
1994}
1995
1996Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
1997 value = +value
1998 offset = offset >>> 0
1999 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
2000 this[offset] = (value & 0xff)
2001 this[offset + 1] = (value >>> 8)
2002 return offset + 2
2003}
2004
2005Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
2006 value = +value
2007 offset = offset >>> 0
2008 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
2009 this[offset] = (value >>> 8)
2010 this[offset + 1] = (value & 0xff)
2011 return offset + 2
2012}
2013
2014Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
2015 value = +value
2016 offset = offset >>> 0
2017 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
2018 this[offset + 3] = (value >>> 24)
2019 this[offset + 2] = (value >>> 16)
2020 this[offset + 1] = (value >>> 8)
2021 this[offset] = (value & 0xff)
2022 return offset + 4
2023}
2024
2025Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
2026 value = +value
2027 offset = offset >>> 0
2028 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
2029 this[offset] = (value >>> 24)
2030 this[offset + 1] = (value >>> 16)
2031 this[offset + 2] = (value >>> 8)
2032 this[offset + 3] = (value & 0xff)
2033 return offset + 4
2034}
2035
2036Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
2037 value = +value
2038 offset = offset >>> 0
2039 if (!noAssert) {
2040 var limit = Math.pow(2, (8 * byteLength) - 1)
2041
2042 checkInt(this, value, offset, byteLength, limit - 1, -limit)
2043 }
2044
2045 var i = 0
2046 var mul = 1
2047 var sub = 0
2048 this[offset] = value & 0xFF
2049 while (++i < byteLength && (mul *= 0x100)) {
2050 if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
2051 sub = 1
2052 }
2053 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
2054 }
2055
2056 return offset + byteLength
2057}
2058
2059Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
2060 value = +value
2061 offset = offset >>> 0
2062 if (!noAssert) {
2063 var limit = Math.pow(2, (8 * byteLength) - 1)
2064
2065 checkInt(this, value, offset, byteLength, limit - 1, -limit)
2066 }
2067
2068 var i = byteLength - 1
2069 var mul = 1
2070 var sub = 0
2071 this[offset + i] = value & 0xFF
2072 while (--i >= 0 && (mul *= 0x100)) {
2073 if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
2074 sub = 1
2075 }
2076 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
2077 }
2078
2079 return offset + byteLength
2080}
2081
2082Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
2083 value = +value
2084 offset = offset >>> 0
2085 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
2086 if (value < 0) value = 0xff + value + 1
2087 this[offset] = (value & 0xff)
2088 return offset + 1
2089}
2090
2091Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
2092 value = +value
2093 offset = offset >>> 0
2094 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
2095 this[offset] = (value & 0xff)
2096 this[offset + 1] = (value >>> 8)
2097 return offset + 2
2098}
2099
2100Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
2101 value = +value
2102 offset = offset >>> 0
2103 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
2104 this[offset] = (value >>> 8)
2105 this[offset + 1] = (value & 0xff)
2106 return offset + 2
2107}
2108
2109Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
2110 value = +value
2111 offset = offset >>> 0
2112 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
2113 this[offset] = (value & 0xff)
2114 this[offset + 1] = (value >>> 8)
2115 this[offset + 2] = (value >>> 16)
2116 this[offset + 3] = (value >>> 24)
2117 return offset + 4
2118}
2119
2120Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
2121 value = +value
2122 offset = offset >>> 0
2123 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
2124 if (value < 0) value = 0xffffffff + value + 1
2125 this[offset] = (value >>> 24)
2126 this[offset + 1] = (value >>> 16)
2127 this[offset + 2] = (value >>> 8)
2128 this[offset + 3] = (value & 0xff)
2129 return offset + 4
2130}
2131
2132function checkIEEE754 (buf, value, offset, ext, max, min) {
2133 if (offset + ext > buf.length) throw new RangeError('Index out of range')
2134 if (offset < 0) throw new RangeError('Index out of range')
2135}
2136
2137function writeFloat (buf, value, offset, littleEndian, noAssert) {
2138 value = +value
2139 offset = offset >>> 0
2140 if (!noAssert) {
2141 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
2142 }
2143 ieee754.write(buf, value, offset, littleEndian, 23, 4)
2144 return offset + 4
2145}
2146
2147Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
2148 return writeFloat(this, value, offset, true, noAssert)
2149}
2150
2151Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
2152 return writeFloat(this, value, offset, false, noAssert)
2153}
2154
2155function writeDouble (buf, value, offset, littleEndian, noAssert) {
2156 value = +value
2157 offset = offset >>> 0
2158 if (!noAssert) {
2159 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
2160 }
2161 ieee754.write(buf, value, offset, littleEndian, 52, 8)
2162 return offset + 8
2163}
2164
2165Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
2166 return writeDouble(this, value, offset, true, noAssert)
2167}
2168
2169Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
2170 return writeDouble(this, value, offset, false, noAssert)
2171}
2172
2173// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
2174Buffer.prototype.copy = function copy (target, targetStart, start, end) {
2175 if (!start) start = 0
2176 if (!end && end !== 0) end = this.length
2177 if (targetStart >= target.length) targetStart = target.length
2178 if (!targetStart) targetStart = 0
2179 if (end > 0 && end < start) end = start
2180
2181 // Copy 0 bytes; we're done
2182 if (end === start) return 0
2183 if (target.length === 0 || this.length === 0) return 0
2184
2185 // Fatal error conditions
2186 if (targetStart < 0) {
2187 throw new RangeError('targetStart out of bounds')
2188 }
2189 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
2190 if (end < 0) throw new RangeError('sourceEnd out of bounds')
2191
2192 // Are we oob?
2193 if (end > this.length) end = this.length
2194 if (target.length - targetStart < end - start) {
2195 end = target.length - targetStart + start
2196 }
2197
2198 var len = end - start
2199 var i
2200
2201 if (this === target && start < targetStart && targetStart < end) {
2202 // descending copy from end
2203 for (i = len - 1; i >= 0; --i) {
2204 target[i + targetStart] = this[i + start]
2205 }
2206 } else if (len < 1000) {
2207 // ascending copy from start
2208 for (i = 0; i < len; ++i) {
2209 target[i + targetStart] = this[i + start]
2210 }
2211 } else {
2212 Uint8Array.prototype.set.call(
2213 target,
2214 this.subarray(start, start + len),
2215 targetStart
2216 )
2217 }
2218
2219 return len
2220}
2221
2222// Usage:
2223// buffer.fill(number[, offset[, end]])
2224// buffer.fill(buffer[, offset[, end]])
2225// buffer.fill(string[, offset[, end]][, encoding])
2226Buffer.prototype.fill = function fill (val, start, end, encoding) {
2227 // Handle string cases:
2228 if (typeof val === 'string') {
2229 if (typeof start === 'string') {
2230 encoding = start
2231 start = 0
2232 end = this.length
2233 } else if (typeof end === 'string') {
2234 encoding = end
2235 end = this.length
2236 }
2237 if (val.length === 1) {
2238 var code = val.charCodeAt(0)
2239 if (code < 256) {
2240 val = code
2241 }
2242 }
2243 if (encoding !== undefined && typeof encoding !== 'string') {
2244 throw new TypeError('encoding must be a string')
2245 }
2246 if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
2247 throw new TypeError('Unknown encoding: ' + encoding)
2248 }
2249 } else if (typeof val === 'number') {
2250 val = val & 255
2251 }
2252
2253 // Invalid ranges are not set to a default, so can range check early.
2254 if (start < 0 || this.length < start || this.length < end) {
2255 throw new RangeError('Out of range index')
2256 }
2257
2258 if (end <= start) {
2259 return this
2260 }
2261
2262 start = start >>> 0
2263 end = end === undefined ? this.length : end >>> 0
2264
2265 if (!val) val = 0
2266
2267 var i
2268 if (typeof val === 'number') {
2269 for (i = start; i < end; ++i) {
2270 this[i] = val
2271 }
2272 } else {
2273 var bytes = Buffer.isBuffer(val)
2274 ? val
2275 : new Buffer(val, encoding)
2276 var len = bytes.length
2277 for (i = 0; i < end - start; ++i) {
2278 this[i + start] = bytes[i % len]
2279 }
2280 }
2281
2282 return this
2283}
2284
2285// HELPER FUNCTIONS
2286// ================
2287
2288var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
2289
2290function base64clean (str) {
2291 // Node strips out invalid characters like \n and \t from the string, base64-js does not
2292 str = str.trim().replace(INVALID_BASE64_RE, '')
2293 // Node converts strings with length < 2 to ''
2294 if (str.length < 2) return ''
2295 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
2296 while (str.length % 4 !== 0) {
2297 str = str + '='
2298 }
2299 return str
2300}
2301
2302function toHex (n) {
2303 if (n < 16) return '0' + n.toString(16)
2304 return n.toString(16)
2305}
2306
2307function utf8ToBytes (string, units) {
2308 units = units || Infinity
2309 var codePoint
2310 var length = string.length
2311 var leadSurrogate = null
2312 var bytes = []
2313
2314 for (var i = 0; i < length; ++i) {
2315 codePoint = string.charCodeAt(i)
2316
2317 // is surrogate component
2318 if (codePoint > 0xD7FF && codePoint < 0xE000) {
2319 // last char was a lead
2320 if (!leadSurrogate) {
2321 // no lead yet
2322 if (codePoint > 0xDBFF) {
2323 // unexpected trail
2324 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
2325 continue
2326 } else if (i + 1 === length) {
2327 // unpaired lead
2328 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
2329 continue
2330 }
2331
2332 // valid lead
2333 leadSurrogate = codePoint
2334
2335 continue
2336 }
2337
2338 // 2 leads in a row
2339 if (codePoint < 0xDC00) {
2340 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
2341 leadSurrogate = codePoint
2342 continue
2343 }
2344
2345 // valid surrogate pair
2346 codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
2347 } else if (leadSurrogate) {
2348 // valid bmp char, but last char was a lead
2349 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
2350 }
2351
2352 leadSurrogate = null
2353
2354 // encode utf8
2355 if (codePoint < 0x80) {
2356 if ((units -= 1) < 0) break
2357 bytes.push(codePoint)
2358 } else if (codePoint < 0x800) {
2359 if ((units -= 2) < 0) break
2360 bytes.push(
2361 codePoint >> 0x6 | 0xC0,
2362 codePoint & 0x3F | 0x80
2363 )
2364 } else if (codePoint < 0x10000) {
2365 if ((units -= 3) < 0) break
2366 bytes.push(
2367 codePoint >> 0xC | 0xE0,
2368 codePoint >> 0x6 & 0x3F | 0x80,
2369 codePoint & 0x3F | 0x80
2370 )
2371 } else if (codePoint < 0x110000) {
2372 if ((units -= 4) < 0) break
2373 bytes.push(
2374 codePoint >> 0x12 | 0xF0,
2375 codePoint >> 0xC & 0x3F | 0x80,
2376 codePoint >> 0x6 & 0x3F | 0x80,
2377 codePoint & 0x3F | 0x80
2378 )
2379 } else {
2380 throw new Error('Invalid code point')
2381 }
2382 }
2383
2384 return bytes
2385}
2386
2387function asciiToBytes (str) {
2388 var byteArray = []
2389 for (var i = 0; i < str.length; ++i) {
2390 // Node's code seems to be doing this and not & 0x7F..
2391 byteArray.push(str.charCodeAt(i) & 0xFF)
2392 }
2393 return byteArray
2394}
2395
2396function utf16leToBytes (str, units) {
2397 var c, hi, lo
2398 var byteArray = []
2399 for (var i = 0; i < str.length; ++i) {
2400 if ((units -= 2) < 0) break
2401
2402 c = str.charCodeAt(i)
2403 hi = c >> 8
2404 lo = c % 256
2405 byteArray.push(lo)
2406 byteArray.push(hi)
2407 }
2408
2409 return byteArray
2410}
2411
2412function base64ToBytes (str) {
2413 return base64.toByteArray(base64clean(str))
2414}
2415
2416function blitBuffer (src, dst, offset, length) {
2417 for (var i = 0; i < length; ++i) {
2418 if ((i + offset >= dst.length) || (i >= src.length)) break
2419 dst[i + offset] = src[i]
2420 }
2421 return i
2422}
2423
2424// Node 0.10 supports `ArrayBuffer` but lacks `ArrayBuffer.isView`
2425function isArrayBufferView (obj) {
2426 return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)
2427}
2428
2429function numberIsNaN (obj) {
2430 return obj !== obj // eslint-disable-line no-self-compare
2431}
2432
2433},{"base64-js":2,"ieee754":8}],6:[function(require,module,exports){
2434(function (Buffer){
2435// Copyright Joyent, Inc. and other Node contributors.
2436//
2437// Permission is hereby granted, free of charge, to any person obtaining a
2438// copy of this software and associated documentation files (the
2439// "Software"), to deal in the Software without restriction, including
2440// without limitation the rights to use, copy, modify, merge, publish,
2441// distribute, sublicense, and/or sell copies of the Software, and to permit
2442// persons to whom the Software is furnished to do so, subject to the
2443// following conditions:
2444//
2445// The above copyright notice and this permission notice shall be included
2446// in all copies or substantial portions of the Software.
2447//
2448// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2449// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2450// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2451// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2452// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2453// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2454// USE OR OTHER DEALINGS IN THE SOFTWARE.
2455
2456// NOTE: These type checking functions intentionally don't use `instanceof`
2457// because it is fragile and can be easily faked with `Object.create()`.
2458
2459function isArray(arg) {
2460 if (Array.isArray) {
2461 return Array.isArray(arg);
2462 }
2463 return objectToString(arg) === '[object Array]';
2464}
2465exports.isArray = isArray;
2466
2467function isBoolean(arg) {
2468 return typeof arg === 'boolean';
2469}
2470exports.isBoolean = isBoolean;
2471
2472function isNull(arg) {
2473 return arg === null;
2474}
2475exports.isNull = isNull;
2476
2477function isNullOrUndefined(arg) {
2478 return arg == null;
2479}
2480exports.isNullOrUndefined = isNullOrUndefined;
2481
2482function isNumber(arg) {
2483 return typeof arg === 'number';
2484}
2485exports.isNumber = isNumber;
2486
2487function isString(arg) {
2488 return typeof arg === 'string';
2489}
2490exports.isString = isString;
2491
2492function isSymbol(arg) {
2493 return typeof arg === 'symbol';
2494}
2495exports.isSymbol = isSymbol;
2496
2497function isUndefined(arg) {
2498 return arg === void 0;
2499}
2500exports.isUndefined = isUndefined;
2501
2502function isRegExp(re) {
2503 return objectToString(re) === '[object RegExp]';
2504}
2505exports.isRegExp = isRegExp;
2506
2507function isObject(arg) {
2508 return typeof arg === 'object' && arg !== null;
2509}
2510exports.isObject = isObject;
2511
2512function isDate(d) {
2513 return objectToString(d) === '[object Date]';
2514}
2515exports.isDate = isDate;
2516
2517function isError(e) {
2518 return (objectToString(e) === '[object Error]' || e instanceof Error);
2519}
2520exports.isError = isError;
2521
2522function isFunction(arg) {
2523 return typeof arg === 'function';
2524}
2525exports.isFunction = isFunction;
2526
2527function isPrimitive(arg) {
2528 return arg === null ||
2529 typeof arg === 'boolean' ||
2530 typeof arg === 'number' ||
2531 typeof arg === 'string' ||
2532 typeof arg === 'symbol' || // ES6 symbol
2533 typeof arg === 'undefined';
2534}
2535exports.isPrimitive = isPrimitive;
2536
2537exports.isBuffer = Buffer.isBuffer;
2538
2539function objectToString(o) {
2540 return Object.prototype.toString.call(o);
2541}
2542
2543}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
2544},{"../../is-buffer/index.js":10}],7:[function(require,module,exports){
2545// Copyright Joyent, Inc. and other Node contributors.
2546//
2547// Permission is hereby granted, free of charge, to any person obtaining a
2548// copy of this software and associated documentation files (the
2549// "Software"), to deal in the Software without restriction, including
2550// without limitation the rights to use, copy, modify, merge, publish,
2551// distribute, sublicense, and/or sell copies of the Software, and to permit
2552// persons to whom the Software is furnished to do so, subject to the
2553// following conditions:
2554//
2555// The above copyright notice and this permission notice shall be included
2556// in all copies or substantial portions of the Software.
2557//
2558// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2559// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2560// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2561// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2562// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2563// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2564// USE OR OTHER DEALINGS IN THE SOFTWARE.
2565
2566function EventEmitter() {
2567 this._events = this._events || {};
2568 this._maxListeners = this._maxListeners || undefined;
2569}
2570module.exports = EventEmitter;
2571
2572// Backwards-compat with node 0.10.x
2573EventEmitter.EventEmitter = EventEmitter;
2574
2575EventEmitter.prototype._events = undefined;
2576EventEmitter.prototype._maxListeners = undefined;
2577
2578// By default EventEmitters will print a warning if more than 10 listeners are
2579// added to it. This is a useful default which helps finding memory leaks.
2580EventEmitter.defaultMaxListeners = 10;
2581
2582// Obviously not all Emitters should be limited to 10. This function allows
2583// that to be increased. Set to zero for unlimited.
2584EventEmitter.prototype.setMaxListeners = function(n) {
2585 if (!isNumber(n) || n < 0 || isNaN(n))
2586 throw TypeError('n must be a positive number');
2587 this._maxListeners = n;
2588 return this;
2589};
2590
2591EventEmitter.prototype.emit = function(type) {
2592 var er, handler, len, args, i, listeners;
2593
2594 if (!this._events)
2595 this._events = {};
2596
2597 // If there is no 'error' event listener then throw.
2598 if (type === 'error') {
2599 if (!this._events.error ||
2600 (isObject(this._events.error) && !this._events.error.length)) {
2601 er = arguments[1];
2602 if (er instanceof Error) {
2603 throw er; // Unhandled 'error' event
2604 } else {
2605 // At least give some kind of context to the user
2606 var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
2607 err.context = er;
2608 throw err;
2609 }
2610 }
2611 }
2612
2613 handler = this._events[type];
2614
2615 if (isUndefined(handler))
2616 return false;
2617
2618 if (isFunction(handler)) {
2619 switch (arguments.length) {
2620 // fast cases
2621 case 1:
2622 handler.call(this);
2623 break;
2624 case 2:
2625 handler.call(this, arguments[1]);
2626 break;
2627 case 3:
2628 handler.call(this, arguments[1], arguments[2]);
2629 break;
2630 // slower
2631 default:
2632 args = Array.prototype.slice.call(arguments, 1);
2633 handler.apply(this, args);
2634 }
2635 } else if (isObject(handler)) {
2636 args = Array.prototype.slice.call(arguments, 1);
2637 listeners = handler.slice();
2638 len = listeners.length;
2639 for (i = 0; i < len; i++)
2640 listeners[i].apply(this, args);
2641 }
2642
2643 return true;
2644};
2645
2646EventEmitter.prototype.addListener = function(type, listener) {
2647 var m;
2648
2649 if (!isFunction(listener))
2650 throw TypeError('listener must be a function');
2651
2652 if (!this._events)
2653 this._events = {};
2654
2655 // To avoid recursion in the case that type === "newListener"! Before
2656 // adding it to the listeners, first emit "newListener".
2657 if (this._events.newListener)
2658 this.emit('newListener', type,
2659 isFunction(listener.listener) ?
2660 listener.listener : listener);
2661
2662 if (!this._events[type])
2663 // Optimize the case of one listener. Don't need the extra array object.
2664 this._events[type] = listener;
2665 else if (isObject(this._events[type]))
2666 // If we've already got an array, just append.
2667 this._events[type].push(listener);
2668 else
2669 // Adding the second element, need to change to array.
2670 this._events[type] = [this._events[type], listener];
2671
2672 // Check for listener leak
2673 if (isObject(this._events[type]) && !this._events[type].warned) {
2674 if (!isUndefined(this._maxListeners)) {
2675 m = this._maxListeners;
2676 } else {
2677 m = EventEmitter.defaultMaxListeners;
2678 }
2679
2680 if (m && m > 0 && this._events[type].length > m) {
2681 this._events[type].warned = true;
2682 console.error('(node) warning: possible EventEmitter memory ' +
2683 'leak detected. %d listeners added. ' +
2684 'Use emitter.setMaxListeners() to increase limit.',
2685 this._events[type].length);
2686 if (typeof console.trace === 'function') {
2687 // not supported in IE 10
2688 console.trace();
2689 }
2690 }
2691 }
2692
2693 return this;
2694};
2695
2696EventEmitter.prototype.on = EventEmitter.prototype.addListener;
2697
2698EventEmitter.prototype.once = function(type, listener) {
2699 if (!isFunction(listener))
2700 throw TypeError('listener must be a function');
2701
2702 var fired = false;
2703
2704 function g() {
2705 this.removeListener(type, g);
2706
2707 if (!fired) {
2708 fired = true;
2709 listener.apply(this, arguments);
2710 }
2711 }
2712
2713 g.listener = listener;
2714 this.on(type, g);
2715
2716 return this;
2717};
2718
2719// emits a 'removeListener' event iff the listener was removed
2720EventEmitter.prototype.removeListener = function(type, listener) {
2721 var list, position, length, i;
2722
2723 if (!isFunction(listener))
2724 throw TypeError('listener must be a function');
2725
2726 if (!this._events || !this._events[type])
2727 return this;
2728
2729 list = this._events[type];
2730 length = list.length;
2731 position = -1;
2732
2733 if (list === listener ||
2734 (isFunction(list.listener) && list.listener === listener)) {
2735 delete this._events[type];
2736 if (this._events.removeListener)
2737 this.emit('removeListener', type, listener);
2738
2739 } else if (isObject(list)) {
2740 for (i = length; i-- > 0;) {
2741 if (list[i] === listener ||
2742 (list[i].listener && list[i].listener === listener)) {
2743 position = i;
2744 break;
2745 }
2746 }
2747
2748 if (position < 0)
2749 return this;
2750
2751 if (list.length === 1) {
2752 list.length = 0;
2753 delete this._events[type];
2754 } else {
2755 list.splice(position, 1);
2756 }
2757
2758 if (this._events.removeListener)
2759 this.emit('removeListener', type, listener);
2760 }
2761
2762 return this;
2763};
2764
2765EventEmitter.prototype.removeAllListeners = function(type) {
2766 var key, listeners;
2767
2768 if (!this._events)
2769 return this;
2770
2771 // not listening for removeListener, no need to emit
2772 if (!this._events.removeListener) {
2773 if (arguments.length === 0)
2774 this._events = {};
2775 else if (this._events[type])
2776 delete this._events[type];
2777 return this;
2778 }
2779
2780 // emit removeListener for all listeners on all events
2781 if (arguments.length === 0) {
2782 for (key in this._events) {
2783 if (key === 'removeListener') continue;
2784 this.removeAllListeners(key);
2785 }
2786 this.removeAllListeners('removeListener');
2787 this._events = {};
2788 return this;
2789 }
2790
2791 listeners = this._events[type];
2792
2793 if (isFunction(listeners)) {
2794 this.removeListener(type, listeners);
2795 } else if (listeners) {
2796 // LIFO order
2797 while (listeners.length)
2798 this.removeListener(type, listeners[listeners.length - 1]);
2799 }
2800 delete this._events[type];
2801
2802 return this;
2803};
2804
2805EventEmitter.prototype.listeners = function(type) {
2806 var ret;
2807 if (!this._events || !this._events[type])
2808 ret = [];
2809 else if (isFunction(this._events[type]))
2810 ret = [this._events[type]];
2811 else
2812 ret = this._events[type].slice();
2813 return ret;
2814};
2815
2816EventEmitter.prototype.listenerCount = function(type) {
2817 if (this._events) {
2818 var evlistener = this._events[type];
2819
2820 if (isFunction(evlistener))
2821 return 1;
2822 else if (evlistener)
2823 return evlistener.length;
2824 }
2825 return 0;
2826};
2827
2828EventEmitter.listenerCount = function(emitter, type) {
2829 return emitter.listenerCount(type);
2830};
2831
2832function isFunction(arg) {
2833 return typeof arg === 'function';
2834}
2835
2836function isNumber(arg) {
2837 return typeof arg === 'number';
2838}
2839
2840function isObject(arg) {
2841 return typeof arg === 'object' && arg !== null;
2842}
2843
2844function isUndefined(arg) {
2845 return arg === void 0;
2846}
2847
2848},{}],8:[function(require,module,exports){
2849exports.read = function (buffer, offset, isLE, mLen, nBytes) {
2850 var e, m
2851 var eLen = nBytes * 8 - mLen - 1
2852 var eMax = (1 << eLen) - 1
2853 var eBias = eMax >> 1
2854 var nBits = -7
2855 var i = isLE ? (nBytes - 1) : 0
2856 var d = isLE ? -1 : 1
2857 var s = buffer[offset + i]
2858
2859 i += d
2860
2861 e = s & ((1 << (-nBits)) - 1)
2862 s >>= (-nBits)
2863 nBits += eLen
2864 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
2865
2866 m = e & ((1 << (-nBits)) - 1)
2867 e >>= (-nBits)
2868 nBits += mLen
2869 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
2870
2871 if (e === 0) {
2872 e = 1 - eBias
2873 } else if (e === eMax) {
2874 return m ? NaN : ((s ? -1 : 1) * Infinity)
2875 } else {
2876 m = m + Math.pow(2, mLen)
2877 e = e - eBias
2878 }
2879 return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
2880}
2881
2882exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
2883 var e, m, c
2884 var eLen = nBytes * 8 - mLen - 1
2885 var eMax = (1 << eLen) - 1
2886 var eBias = eMax >> 1
2887 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
2888 var i = isLE ? 0 : (nBytes - 1)
2889 var d = isLE ? 1 : -1
2890 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
2891
2892 value = Math.abs(value)
2893
2894 if (isNaN(value) || value === Infinity) {
2895 m = isNaN(value) ? 1 : 0
2896 e = eMax
2897 } else {
2898 e = Math.floor(Math.log(value) / Math.LN2)
2899 if (value * (c = Math.pow(2, -e)) < 1) {
2900 e--
2901 c *= 2
2902 }
2903 if (e + eBias >= 1) {
2904 value += rt / c
2905 } else {
2906 value += rt * Math.pow(2, 1 - eBias)
2907 }
2908 if (value * c >= 2) {
2909 e++
2910 c /= 2
2911 }
2912
2913 if (e + eBias >= eMax) {
2914 m = 0
2915 e = eMax
2916 } else if (e + eBias >= 1) {
2917 m = (value * c - 1) * Math.pow(2, mLen)
2918 e = e + eBias
2919 } else {
2920 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
2921 e = 0
2922 }
2923 }
2924
2925 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
2926
2927 e = (e << mLen) | m
2928 eLen += mLen
2929 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
2930
2931 buffer[offset + i - d] |= s * 128
2932}
2933
2934},{}],9:[function(require,module,exports){
2935if (typeof Object.create === 'function') {
2936 // implementation from standard node.js 'util' module
2937 module.exports = function inherits(ctor, superCtor) {
2938 ctor.super_ = superCtor
2939 ctor.prototype = Object.create(superCtor.prototype, {
2940 constructor: {
2941 value: ctor,
2942 enumerable: false,
2943 writable: true,
2944 configurable: true
2945 }
2946 });
2947 };
2948} else {
2949 // old school shim for old browsers
2950 module.exports = function inherits(ctor, superCtor) {
2951 ctor.super_ = superCtor
2952 var TempCtor = function () {}
2953 TempCtor.prototype = superCtor.prototype
2954 ctor.prototype = new TempCtor()
2955 ctor.prototype.constructor = ctor
2956 }
2957}
2958
2959},{}],10:[function(require,module,exports){
2960/*!
2961 * Determine if an object is a Buffer
2962 *
2963 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
2964 * @license MIT
2965 */
2966
2967// The _isBuffer check is for Safari 5-7 support, because it's missing
2968// Object.prototype.constructor. Remove this eventually
2969module.exports = function (obj) {
2970 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
2971}
2972
2973function isBuffer (obj) {
2974 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
2975}
2976
2977// For Node v0.10 support. Remove this eventually.
2978function isSlowBuffer (obj) {
2979 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
2980}
2981
2982},{}],11:[function(require,module,exports){
2983var toString = {}.toString;
2984
2985module.exports = Array.isArray || function (arr) {
2986 return toString.call(arr) == '[object Array]';
2987};
2988
2989},{}],12:[function(require,module,exports){
2990(function (process){
2991'use strict';
2992
2993if (!process.version ||
2994 process.version.indexOf('v0.') === 0 ||
2995 process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
2996 module.exports = nextTick;
2997} else {
2998 module.exports = process.nextTick;
2999}
3000
3001function nextTick(fn, arg1, arg2, arg3) {
3002 if (typeof fn !== 'function') {
3003 throw new TypeError('"callback" argument must be a function');
3004 }
3005 var len = arguments.length;
3006 var args, i;
3007 switch (len) {
3008 case 0:
3009 case 1:
3010 return process.nextTick(fn);
3011 case 2:
3012 return process.nextTick(function afterTickOne() {
3013 fn.call(null, arg1);
3014 });
3015 case 3:
3016 return process.nextTick(function afterTickTwo() {
3017 fn.call(null, arg1, arg2);
3018 });
3019 case 4:
3020 return process.nextTick(function afterTickThree() {
3021 fn.call(null, arg1, arg2, arg3);
3022 });
3023 default:
3024 args = new Array(len - 1);
3025 i = 0;
3026 while (i < args.length) {
3027 args[i++] = arguments[i];
3028 }
3029 return process.nextTick(function afterTick() {
3030 fn.apply(null, args);
3031 });
3032 }
3033}
3034
3035}).call(this,require('_process'))
3036},{"_process":13}],13:[function(require,module,exports){
3037// shim for using process in browser
3038var process = module.exports = {};
3039
3040// cached from whatever global is present so that test runners that stub it
3041// don't break things. But we need to wrap it in a try catch in case it is
3042// wrapped in strict mode code which doesn't define any globals. It's inside a
3043// function because try/catches deoptimize in certain engines.
3044
3045var cachedSetTimeout;
3046var cachedClearTimeout;
3047
3048function defaultSetTimout() {
3049 throw new Error('setTimeout has not been defined');
3050}
3051function defaultClearTimeout () {
3052 throw new Error('clearTimeout has not been defined');
3053}
3054(function () {
3055 try {
3056 if (typeof setTimeout === 'function') {
3057 cachedSetTimeout = setTimeout;
3058 } else {
3059 cachedSetTimeout = defaultSetTimout;
3060 }
3061 } catch (e) {
3062 cachedSetTimeout = defaultSetTimout;
3063 }
3064 try {
3065 if (typeof clearTimeout === 'function') {
3066 cachedClearTimeout = clearTimeout;
3067 } else {
3068 cachedClearTimeout = defaultClearTimeout;
3069 }
3070 } catch (e) {
3071 cachedClearTimeout = defaultClearTimeout;
3072 }
3073} ())
3074function runTimeout(fun) {
3075 if (cachedSetTimeout === setTimeout) {
3076 //normal enviroments in sane situations
3077 return setTimeout(fun, 0);
3078 }
3079 // if setTimeout wasn't available but was latter defined
3080 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
3081 cachedSetTimeout = setTimeout;
3082 return setTimeout(fun, 0);
3083 }
3084 try {
3085 // when when somebody has screwed with setTimeout but no I.E. maddness
3086 return cachedSetTimeout(fun, 0);
3087 } catch(e){
3088 try {
3089 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
3090 return cachedSetTimeout.call(null, fun, 0);
3091 } catch(e){
3092 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
3093 return cachedSetTimeout.call(this, fun, 0);
3094 }
3095 }
3096
3097
3098}
3099function runClearTimeout(marker) {
3100 if (cachedClearTimeout === clearTimeout) {
3101 //normal enviroments in sane situations
3102 return clearTimeout(marker);
3103 }
3104 // if clearTimeout wasn't available but was latter defined
3105 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
3106 cachedClearTimeout = clearTimeout;
3107 return clearTimeout(marker);
3108 }
3109 try {
3110 // when when somebody has screwed with setTimeout but no I.E. maddness
3111 return cachedClearTimeout(marker);
3112 } catch (e){
3113 try {
3114 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
3115 return cachedClearTimeout.call(null, marker);
3116 } catch (e){
3117 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
3118 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
3119 return cachedClearTimeout.call(this, marker);
3120 }
3121 }
3122
3123
3124
3125}
3126var queue = [];
3127var draining = false;
3128var currentQueue;
3129var queueIndex = -1;
3130
3131function cleanUpNextTick() {
3132 if (!draining || !currentQueue) {
3133 return;
3134 }
3135 draining = false;
3136 if (currentQueue.length) {
3137 queue = currentQueue.concat(queue);
3138 } else {
3139 queueIndex = -1;
3140 }
3141 if (queue.length) {
3142 drainQueue();
3143 }
3144}
3145
3146function drainQueue() {
3147 if (draining) {
3148 return;
3149 }
3150 var timeout = runTimeout(cleanUpNextTick);
3151 draining = true;
3152
3153 var len = queue.length;
3154 while(len) {
3155 currentQueue = queue;
3156 queue = [];
3157 while (++queueIndex < len) {
3158 if (currentQueue) {
3159 currentQueue[queueIndex].run();
3160 }
3161 }
3162 queueIndex = -1;
3163 len = queue.length;
3164 }
3165 currentQueue = null;
3166 draining = false;
3167 runClearTimeout(timeout);
3168}
3169
3170process.nextTick = function (fun) {
3171 var args = new Array(arguments.length - 1);
3172 if (arguments.length > 1) {
3173 for (var i = 1; i < arguments.length; i++) {
3174 args[i - 1] = arguments[i];
3175 }
3176 }
3177 queue.push(new Item(fun, args));
3178 if (queue.length === 1 && !draining) {
3179 runTimeout(drainQueue);
3180 }
3181};
3182
3183// v8 likes predictible objects
3184function Item(fun, array) {
3185 this.fun = fun;
3186 this.array = array;
3187}
3188Item.prototype.run = function () {
3189 this.fun.apply(null, this.array);
3190};
3191process.title = 'browser';
3192process.browser = true;
3193process.env = {};
3194process.argv = [];
3195process.version = ''; // empty string to avoid regexp issues
3196process.versions = {};
3197
3198function noop() {}
3199
3200process.on = noop;
3201process.addListener = noop;
3202process.once = noop;
3203process.off = noop;
3204process.removeListener = noop;
3205process.removeAllListeners = noop;
3206process.emit = noop;
3207process.prependListener = noop;
3208process.prependOnceListener = noop;
3209
3210process.listeners = function (name) { return [] }
3211
3212process.binding = function (name) {
3213 throw new Error('process.binding is not supported');
3214};
3215
3216process.cwd = function () { return '/' };
3217process.chdir = function (dir) {
3218 throw new Error('process.chdir is not supported');
3219};
3220process.umask = function() { return 0; };
3221
3222},{}],14:[function(require,module,exports){
3223module.exports = require('./lib/_stream_duplex.js');
3224
3225},{"./lib/_stream_duplex.js":15}],15:[function(require,module,exports){
3226// a duplex stream is just a stream that is both readable and writable.
3227// Since JS doesn't have multiple prototypal inheritance, this class
3228// prototypally inherits from Readable, and then parasitically from
3229// Writable.
3230
3231'use strict';
3232
3233/*<replacement>*/
3234
3235var objectKeys = Object.keys || function (obj) {
3236 var keys = [];
3237 for (var key in obj) {
3238 keys.push(key);
3239 }return keys;
3240};
3241/*</replacement>*/
3242
3243module.exports = Duplex;
3244
3245/*<replacement>*/
3246var processNextTick = require('process-nextick-args');
3247/*</replacement>*/
3248
3249/*<replacement>*/
3250var util = require('core-util-is');
3251util.inherits = require('inherits');
3252/*</replacement>*/
3253
3254var Readable = require('./_stream_readable');
3255var Writable = require('./_stream_writable');
3256
3257util.inherits(Duplex, Readable);
3258
3259var keys = objectKeys(Writable.prototype);
3260for (var v = 0; v < keys.length; v++) {
3261 var method = keys[v];
3262 if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
3263}
3264
3265function Duplex(options) {
3266 if (!(this instanceof Duplex)) return new Duplex(options);
3267
3268 Readable.call(this, options);
3269 Writable.call(this, options);
3270
3271 if (options && options.readable === false) this.readable = false;
3272
3273 if (options && options.writable === false) this.writable = false;
3274
3275 this.allowHalfOpen = true;
3276 if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
3277
3278 this.once('end', onend);
3279}
3280
3281// the no-half-open enforcer
3282function onend() {
3283 // if we allow half-open state, or if the writable side ended,
3284 // then we're ok.
3285 if (this.allowHalfOpen || this._writableState.ended) return;
3286
3287 // no more data can be written.
3288 // But allow more writes to happen in this tick.
3289 processNextTick(onEndNT, this);
3290}
3291
3292function onEndNT(self) {
3293 self.end();
3294}
3295
3296function forEach(xs, f) {
3297 for (var i = 0, l = xs.length; i < l; i++) {
3298 f(xs[i], i);
3299 }
3300}
3301},{"./_stream_readable":17,"./_stream_writable":19,"core-util-is":6,"inherits":9,"process-nextick-args":12}],16:[function(require,module,exports){
3302// a passthrough stream.
3303// basically just the most minimal sort of Transform stream.
3304// Every written chunk gets output as-is.
3305
3306'use strict';
3307
3308module.exports = PassThrough;
3309
3310var Transform = require('./_stream_transform');
3311
3312/*<replacement>*/
3313var util = require('core-util-is');
3314util.inherits = require('inherits');
3315/*</replacement>*/
3316
3317util.inherits(PassThrough, Transform);
3318
3319function PassThrough(options) {
3320 if (!(this instanceof PassThrough)) return new PassThrough(options);
3321
3322 Transform.call(this, options);
3323}
3324
3325PassThrough.prototype._transform = function (chunk, encoding, cb) {
3326 cb(null, chunk);
3327};
3328},{"./_stream_transform":18,"core-util-is":6,"inherits":9}],17:[function(require,module,exports){
3329(function (process){
3330'use strict';
3331
3332module.exports = Readable;
3333
3334/*<replacement>*/
3335var processNextTick = require('process-nextick-args');
3336/*</replacement>*/
3337
3338/*<replacement>*/
3339var isArray = require('isarray');
3340/*</replacement>*/
3341
3342/*<replacement>*/
3343var Duplex;
3344/*</replacement>*/
3345
3346Readable.ReadableState = ReadableState;
3347
3348/*<replacement>*/
3349var EE = require('events').EventEmitter;
3350
3351var EElistenerCount = function (emitter, type) {
3352 return emitter.listeners(type).length;
3353};
3354/*</replacement>*/
3355
3356/*<replacement>*/
3357var Stream = require('./internal/streams/stream');
3358/*</replacement>*/
3359
3360var Buffer = require('buffer').Buffer;
3361/*<replacement>*/
3362var bufferShim = require('buffer-shims');
3363/*</replacement>*/
3364
3365/*<replacement>*/
3366var util = require('core-util-is');
3367util.inherits = require('inherits');
3368/*</replacement>*/
3369
3370/*<replacement>*/
3371var debugUtil = require('util');
3372var debug = void 0;
3373if (debugUtil && debugUtil.debuglog) {
3374 debug = debugUtil.debuglog('stream');
3375} else {
3376 debug = function () {};
3377}
3378/*</replacement>*/
3379
3380var BufferList = require('./internal/streams/BufferList');
3381var StringDecoder;
3382
3383util.inherits(Readable, Stream);
3384
3385var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
3386
3387function prependListener(emitter, event, fn) {
3388 // Sadly this is not cacheable as some libraries bundle their own
3389 // event emitter implementation with them.
3390 if (typeof emitter.prependListener === 'function') {
3391 return emitter.prependListener(event, fn);
3392 } else {
3393 // This is a hack to make sure that our error handler is attached before any
3394 // userland ones. NEVER DO THIS. This is here only because this code needs
3395 // to continue to work with older versions of Node.js that do not include
3396 // the prependListener() method. The goal is to eventually remove this hack.
3397 if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
3398 }
3399}
3400
3401function ReadableState(options, stream) {
3402 Duplex = Duplex || require('./_stream_duplex');
3403
3404 options = options || {};
3405
3406 // object stream flag. Used to make read(n) ignore n and to
3407 // make all the buffer merging and length checks go away
3408 this.objectMode = !!options.objectMode;
3409
3410 if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
3411
3412 // the point at which it stops calling _read() to fill the buffer
3413 // Note: 0 is a valid value, means "don't call _read preemptively ever"
3414 var hwm = options.highWaterMark;
3415 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
3416 this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
3417
3418 // cast to ints.
3419 this.highWaterMark = ~~this.highWaterMark;
3420
3421 // A linked list is used to store data chunks instead of an array because the
3422 // linked list can remove elements from the beginning faster than
3423 // array.shift()
3424 this.buffer = new BufferList();
3425 this.length = 0;
3426 this.pipes = null;
3427 this.pipesCount = 0;
3428 this.flowing = null;
3429 this.ended = false;
3430 this.endEmitted = false;
3431 this.reading = false;
3432
3433 // a flag to be able to tell if the onwrite cb is called immediately,
3434 // or on a later tick. We set this to true at first, because any
3435 // actions that shouldn't happen until "later" should generally also
3436 // not happen before the first write call.
3437 this.sync = true;
3438
3439 // whenever we return null, then we set a flag to say
3440 // that we're awaiting a 'readable' event emission.
3441 this.needReadable = false;
3442 this.emittedReadable = false;
3443 this.readableListening = false;
3444 this.resumeScheduled = false;
3445
3446 // Crypto is kind of old and crusty. Historically, its default string
3447 // encoding is 'binary' so we have to make this configurable.
3448 // Everything else in the universe uses 'utf8', though.
3449 this.defaultEncoding = options.defaultEncoding || 'utf8';
3450
3451 // when piping, we only care about 'readable' events that happen
3452 // after read()ing all the bytes and not getting any pushback.
3453 this.ranOut = false;
3454
3455 // the number of writers that are awaiting a drain event in .pipe()s
3456 this.awaitDrain = 0;
3457
3458 // if true, a maybeReadMore has been scheduled
3459 this.readingMore = false;
3460
3461 this.decoder = null;
3462 this.encoding = null;
3463 if (options.encoding) {
3464 if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
3465 this.decoder = new StringDecoder(options.encoding);
3466 this.encoding = options.encoding;
3467 }
3468}
3469
3470function Readable(options) {
3471 Duplex = Duplex || require('./_stream_duplex');
3472
3473 if (!(this instanceof Readable)) return new Readable(options);
3474
3475 this._readableState = new ReadableState(options, this);
3476
3477 // legacy
3478 this.readable = true;
3479
3480 if (options && typeof options.read === 'function') this._read = options.read;
3481
3482 Stream.call(this);
3483}
3484
3485// Manually shove something into the read() buffer.
3486// This returns true if the highWaterMark has not been hit yet,
3487// similar to how Writable.write() returns true if you should
3488// write() some more.
3489Readable.prototype.push = function (chunk, encoding) {
3490 var state = this._readableState;
3491
3492 if (!state.objectMode && typeof chunk === 'string') {
3493 encoding = encoding || state.defaultEncoding;
3494 if (encoding !== state.encoding) {
3495 chunk = bufferShim.from(chunk, encoding);
3496 encoding = '';
3497 }
3498 }
3499
3500 return readableAddChunk(this, state, chunk, encoding, false);
3501};
3502
3503// Unshift should *always* be something directly out of read()
3504Readable.prototype.unshift = function (chunk) {
3505 var state = this._readableState;
3506 return readableAddChunk(this, state, chunk, '', true);
3507};
3508
3509Readable.prototype.isPaused = function () {
3510 return this._readableState.flowing === false;
3511};
3512
3513function readableAddChunk(stream, state, chunk, encoding, addToFront) {
3514 var er = chunkInvalid(state, chunk);
3515 if (er) {
3516 stream.emit('error', er);
3517 } else if (chunk === null) {
3518 state.reading = false;
3519 onEofChunk(stream, state);
3520 } else if (state.objectMode || chunk && chunk.length > 0) {
3521 if (state.ended && !addToFront) {
3522 var e = new Error('stream.push() after EOF');
3523 stream.emit('error', e);
3524 } else if (state.endEmitted && addToFront) {
3525 var _e = new Error('stream.unshift() after end event');
3526 stream.emit('error', _e);
3527 } else {
3528 var skipAdd;
3529 if (state.decoder && !addToFront && !encoding) {
3530 chunk = state.decoder.write(chunk);
3531 skipAdd = !state.objectMode && chunk.length === 0;
3532 }
3533
3534 if (!addToFront) state.reading = false;
3535
3536 // Don't add to the buffer if we've decoded to an empty string chunk and
3537 // we're not in object mode
3538 if (!skipAdd) {
3539 // if we want the data now, just emit it.
3540 if (state.flowing && state.length === 0 && !state.sync) {
3541 stream.emit('data', chunk);
3542 stream.read(0);
3543 } else {
3544 // update the buffer info.
3545 state.length += state.objectMode ? 1 : chunk.length;
3546 if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
3547
3548 if (state.needReadable) emitReadable(stream);
3549 }
3550 }
3551
3552 maybeReadMore(stream, state);
3553 }
3554 } else if (!addToFront) {
3555 state.reading = false;
3556 }
3557
3558 return needMoreData(state);
3559}
3560
3561// if it's past the high water mark, we can push in some more.
3562// Also, if we have no data yet, we can stand some
3563// more bytes. This is to work around cases where hwm=0,
3564// such as the repl. Also, if the push() triggered a
3565// readable event, and the user called read(largeNumber) such that
3566// needReadable was set, then we ought to push more, so that another
3567// 'readable' event will be triggered.
3568function needMoreData(state) {
3569 return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
3570}
3571
3572// backwards compatibility.
3573Readable.prototype.setEncoding = function (enc) {
3574 if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
3575 this._readableState.decoder = new StringDecoder(enc);
3576 this._readableState.encoding = enc;
3577 return this;
3578};
3579
3580// Don't raise the hwm > 8MB
3581var MAX_HWM = 0x800000;
3582function computeNewHighWaterMark(n) {
3583 if (n >= MAX_HWM) {
3584 n = MAX_HWM;
3585 } else {
3586 // Get the next highest power of 2 to prevent increasing hwm excessively in
3587 // tiny amounts
3588 n--;
3589 n |= n >>> 1;
3590 n |= n >>> 2;
3591 n |= n >>> 4;
3592 n |= n >>> 8;
3593 n |= n >>> 16;
3594 n++;
3595 }
3596 return n;
3597}
3598
3599// This function is designed to be inlinable, so please take care when making
3600// changes to the function body.
3601function howMuchToRead(n, state) {
3602 if (n <= 0 || state.length === 0 && state.ended) return 0;
3603 if (state.objectMode) return 1;
3604 if (n !== n) {
3605 // Only flow one buffer at a time
3606 if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
3607 }
3608 // If we're asking for more than the current hwm, then raise the hwm.
3609 if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
3610 if (n <= state.length) return n;
3611 // Don't have enough
3612 if (!state.ended) {
3613 state.needReadable = true;
3614 return 0;
3615 }
3616 return state.length;
3617}
3618
3619// you can override either this method, or the async _read(n) below.
3620Readable.prototype.read = function (n) {
3621 debug('read', n);
3622 n = parseInt(n, 10);
3623 var state = this._readableState;
3624 var nOrig = n;
3625
3626 if (n !== 0) state.emittedReadable = false;
3627
3628 // if we're doing read(0) to trigger a readable event, but we
3629 // already have a bunch of data in the buffer, then just trigger
3630 // the 'readable' event and move on.
3631 if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
3632 debug('read: emitReadable', state.length, state.ended);
3633 if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
3634 return null;
3635 }
3636
3637 n = howMuchToRead(n, state);
3638
3639 // if we've ended, and we're now clear, then finish it up.
3640 if (n === 0 && state.ended) {
3641 if (state.length === 0) endReadable(this);
3642 return null;
3643 }
3644
3645 // All the actual chunk generation logic needs to be
3646 // *below* the call to _read. The reason is that in certain
3647 // synthetic stream cases, such as passthrough streams, _read
3648 // may be a completely synchronous operation which may change
3649 // the state of the read buffer, providing enough data when
3650 // before there was *not* enough.
3651 //
3652 // So, the steps are:
3653 // 1. Figure out what the state of things will be after we do
3654 // a read from the buffer.
3655 //
3656 // 2. If that resulting state will trigger a _read, then call _read.
3657 // Note that this may be asynchronous, or synchronous. Yes, it is
3658 // deeply ugly to write APIs this way, but that still doesn't mean
3659 // that the Readable class should behave improperly, as streams are
3660 // designed to be sync/async agnostic.
3661 // Take note if the _read call is sync or async (ie, if the read call
3662 // has returned yet), so that we know whether or not it's safe to emit
3663 // 'readable' etc.
3664 //
3665 // 3. Actually pull the requested chunks out of the buffer and return.
3666
3667 // if we need a readable event, then we need to do some reading.
3668 var doRead = state.needReadable;
3669 debug('need readable', doRead);
3670
3671 // if we currently have less than the highWaterMark, then also read some
3672 if (state.length === 0 || state.length - n < state.highWaterMark) {
3673 doRead = true;
3674 debug('length less than watermark', doRead);
3675 }
3676
3677 // however, if we've ended, then there's no point, and if we're already
3678 // reading, then it's unnecessary.
3679 if (state.ended || state.reading) {
3680 doRead = false;
3681 debug('reading or ended', doRead);
3682 } else if (doRead) {
3683 debug('do read');
3684 state.reading = true;
3685 state.sync = true;
3686 // if the length is currently zero, then we *need* a readable event.
3687 if (state.length === 0) state.needReadable = true;
3688 // call internal read method
3689 this._read(state.highWaterMark);
3690 state.sync = false;
3691 // If _read pushed data synchronously, then `reading` will be false,
3692 // and we need to re-evaluate how much data we can return to the user.
3693 if (!state.reading) n = howMuchToRead(nOrig, state);
3694 }
3695
3696 var ret;
3697 if (n > 0) ret = fromList(n, state);else ret = null;
3698
3699 if (ret === null) {
3700 state.needReadable = true;
3701 n = 0;
3702 } else {
3703 state.length -= n;
3704 }
3705
3706 if (state.length === 0) {
3707 // If we have nothing in the buffer, then we want to know
3708 // as soon as we *do* get something into the buffer.
3709 if (!state.ended) state.needReadable = true;
3710
3711 // If we tried to read() past the EOF, then emit end on the next tick.
3712 if (nOrig !== n && state.ended) endReadable(this);
3713 }
3714
3715 if (ret !== null) this.emit('data', ret);
3716
3717 return ret;
3718};
3719
3720function chunkInvalid(state, chunk) {
3721 var er = null;
3722 if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
3723 er = new TypeError('Invalid non-string/buffer chunk');
3724 }
3725 return er;
3726}
3727
3728function onEofChunk(stream, state) {
3729 if (state.ended) return;
3730 if (state.decoder) {
3731 var chunk = state.decoder.end();
3732 if (chunk && chunk.length) {
3733 state.buffer.push(chunk);
3734 state.length += state.objectMode ? 1 : chunk.length;
3735 }
3736 }
3737 state.ended = true;
3738
3739 // emit 'readable' now to make sure it gets picked up.
3740 emitReadable(stream);
3741}
3742
3743// Don't emit readable right away in sync mode, because this can trigger
3744// another read() call => stack overflow. This way, it might trigger
3745// a nextTick recursion warning, but that's not so bad.
3746function emitReadable(stream) {
3747 var state = stream._readableState;
3748 state.needReadable = false;
3749 if (!state.emittedReadable) {
3750 debug('emitReadable', state.flowing);
3751 state.emittedReadable = true;
3752 if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
3753 }
3754}
3755
3756function emitReadable_(stream) {
3757 debug('emit readable');
3758 stream.emit('readable');
3759 flow(stream);
3760}
3761
3762// at this point, the user has presumably seen the 'readable' event,
3763// and called read() to consume some data. that may have triggered
3764// in turn another _read(n) call, in which case reading = true if
3765// it's in progress.
3766// However, if we're not ended, or reading, and the length < hwm,
3767// then go ahead and try to read some more preemptively.
3768function maybeReadMore(stream, state) {
3769 if (!state.readingMore) {
3770 state.readingMore = true;
3771 processNextTick(maybeReadMore_, stream, state);
3772 }
3773}
3774
3775function maybeReadMore_(stream, state) {
3776 var len = state.length;
3777 while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
3778 debug('maybeReadMore read 0');
3779 stream.read(0);
3780 if (len === state.length)
3781 // didn't get any data, stop spinning.
3782 break;else len = state.length;
3783 }
3784 state.readingMore = false;
3785}
3786
3787// abstract method. to be overridden in specific implementation classes.
3788// call cb(er, data) where data is <= n in length.
3789// for virtual (non-string, non-buffer) streams, "length" is somewhat
3790// arbitrary, and perhaps not very meaningful.
3791Readable.prototype._read = function (n) {
3792 this.emit('error', new Error('_read() is not implemented'));
3793};
3794
3795Readable.prototype.pipe = function (dest, pipeOpts) {
3796 var src = this;
3797 var state = this._readableState;
3798
3799 switch (state.pipesCount) {
3800 case 0:
3801 state.pipes = dest;
3802 break;
3803 case 1:
3804 state.pipes = [state.pipes, dest];
3805 break;
3806 default:
3807 state.pipes.push(dest);
3808 break;
3809 }
3810 state.pipesCount += 1;
3811 debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
3812
3813 var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
3814
3815 var endFn = doEnd ? onend : cleanup;
3816 if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
3817
3818 dest.on('unpipe', onunpipe);
3819 function onunpipe(readable) {
3820 debug('onunpipe');
3821 if (readable === src) {
3822 cleanup();
3823 }
3824 }
3825
3826 function onend() {
3827 debug('onend');
3828 dest.end();
3829 }
3830
3831 // when the dest drains, it reduces the awaitDrain counter
3832 // on the source. This would be more elegant with a .once()
3833 // handler in flow(), but adding and removing repeatedly is
3834 // too slow.
3835 var ondrain = pipeOnDrain(src);
3836 dest.on('drain', ondrain);
3837
3838 var cleanedUp = false;
3839 function cleanup() {
3840 debug('cleanup');
3841 // cleanup event handlers once the pipe is broken
3842 dest.removeListener('close', onclose);
3843 dest.removeListener('finish', onfinish);
3844 dest.removeListener('drain', ondrain);
3845 dest.removeListener('error', onerror);
3846 dest.removeListener('unpipe', onunpipe);
3847 src.removeListener('end', onend);
3848 src.removeListener('end', cleanup);
3849 src.removeListener('data', ondata);
3850
3851 cleanedUp = true;
3852
3853 // if the reader is waiting for a drain event from this
3854 // specific writer, then it would cause it to never start
3855 // flowing again.
3856 // So, if this is awaiting a drain, then we just call it now.
3857 // If we don't know, then assume that we are waiting for one.
3858 if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
3859 }
3860
3861 // If the user pushes more data while we're writing to dest then we'll end up
3862 // in ondata again. However, we only want to increase awaitDrain once because
3863 // dest will only emit one 'drain' event for the multiple writes.
3864 // => Introduce a guard on increasing awaitDrain.
3865 var increasedAwaitDrain = false;
3866 src.on('data', ondata);
3867 function ondata(chunk) {
3868 debug('ondata');
3869 increasedAwaitDrain = false;
3870 var ret = dest.write(chunk);
3871 if (false === ret && !increasedAwaitDrain) {
3872 // If the user unpiped during `dest.write()`, it is possible
3873 // to get stuck in a permanently paused state if that write
3874 // also returned false.
3875 // => Check whether `dest` is still a piping destination.
3876 if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
3877 debug('false write response, pause', src._readableState.awaitDrain);
3878 src._readableState.awaitDrain++;
3879 increasedAwaitDrain = true;
3880 }
3881 src.pause();
3882 }
3883 }
3884
3885 // if the dest has an error, then stop piping into it.
3886 // however, don't suppress the throwing behavior for this.
3887 function onerror(er) {
3888 debug('onerror', er);
3889 unpipe();
3890 dest.removeListener('error', onerror);
3891 if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
3892 }
3893
3894 // Make sure our error handler is attached before userland ones.
3895 prependListener(dest, 'error', onerror);
3896
3897 // Both close and finish should trigger unpipe, but only once.
3898 function onclose() {
3899 dest.removeListener('finish', onfinish);
3900 unpipe();
3901 }
3902 dest.once('close', onclose);
3903 function onfinish() {
3904 debug('onfinish');
3905 dest.removeListener('close', onclose);
3906 unpipe();
3907 }
3908 dest.once('finish', onfinish);
3909
3910 function unpipe() {
3911 debug('unpipe');
3912 src.unpipe(dest);
3913 }
3914
3915 // tell the dest that it's being piped to
3916 dest.emit('pipe', src);
3917
3918 // start the flow if it hasn't been started already.
3919 if (!state.flowing) {
3920 debug('pipe resume');
3921 src.resume();
3922 }
3923
3924 return dest;
3925};
3926
3927function pipeOnDrain(src) {
3928 return function () {
3929 var state = src._readableState;
3930 debug('pipeOnDrain', state.awaitDrain);
3931 if (state.awaitDrain) state.awaitDrain--;
3932 if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
3933 state.flowing = true;
3934 flow(src);
3935 }
3936 };
3937}
3938
3939Readable.prototype.unpipe = function (dest) {
3940 var state = this._readableState;
3941
3942 // if we're not piping anywhere, then do nothing.
3943 if (state.pipesCount === 0) return this;
3944
3945 // just one destination. most common case.
3946 if (state.pipesCount === 1) {
3947 // passed in one, but it's not the right one.
3948 if (dest && dest !== state.pipes) return this;
3949
3950 if (!dest) dest = state.pipes;
3951
3952 // got a match.
3953 state.pipes = null;
3954 state.pipesCount = 0;
3955 state.flowing = false;
3956 if (dest) dest.emit('unpipe', this);
3957 return this;
3958 }
3959
3960 // slow case. multiple pipe destinations.
3961
3962 if (!dest) {
3963 // remove all.
3964 var dests = state.pipes;
3965 var len = state.pipesCount;
3966 state.pipes = null;
3967 state.pipesCount = 0;
3968 state.flowing = false;
3969
3970 for (var i = 0; i < len; i++) {
3971 dests[i].emit('unpipe', this);
3972 }return this;
3973 }
3974
3975 // try to find the right one.
3976 var index = indexOf(state.pipes, dest);
3977 if (index === -1) return this;
3978
3979 state.pipes.splice(index, 1);
3980 state.pipesCount -= 1;
3981 if (state.pipesCount === 1) state.pipes = state.pipes[0];
3982
3983 dest.emit('unpipe', this);
3984
3985 return this;
3986};
3987
3988// set up data events if they are asked for
3989// Ensure readable listeners eventually get something
3990Readable.prototype.on = function (ev, fn) {
3991 var res = Stream.prototype.on.call(this, ev, fn);
3992
3993 if (ev === 'data') {
3994 // Start flowing on next tick if stream isn't explicitly paused
3995 if (this._readableState.flowing !== false) this.resume();
3996 } else if (ev === 'readable') {
3997 var state = this._readableState;
3998 if (!state.endEmitted && !state.readableListening) {
3999 state.readableListening = state.needReadable = true;
4000 state.emittedReadable = false;
4001 if (!state.reading) {
4002 processNextTick(nReadingNextTick, this);
4003 } else if (state.length) {
4004 emitReadable(this, state);
4005 }
4006 }
4007 }
4008
4009 return res;
4010};
4011Readable.prototype.addListener = Readable.prototype.on;
4012
4013function nReadingNextTick(self) {
4014 debug('readable nexttick read 0');
4015 self.read(0);
4016}
4017
4018// pause() and resume() are remnants of the legacy readable stream API
4019// If the user uses them, then switch into old mode.
4020Readable.prototype.resume = function () {
4021 var state = this._readableState;
4022 if (!state.flowing) {
4023 debug('resume');
4024 state.flowing = true;
4025 resume(this, state);
4026 }
4027 return this;
4028};
4029
4030function resume(stream, state) {
4031 if (!state.resumeScheduled) {
4032 state.resumeScheduled = true;
4033 processNextTick(resume_, stream, state);
4034 }
4035}
4036
4037function resume_(stream, state) {
4038 if (!state.reading) {
4039 debug('resume read 0');
4040 stream.read(0);
4041 }
4042
4043 state.resumeScheduled = false;
4044 state.awaitDrain = 0;
4045 stream.emit('resume');
4046 flow(stream);
4047 if (state.flowing && !state.reading) stream.read(0);
4048}
4049
4050Readable.prototype.pause = function () {
4051 debug('call pause flowing=%j', this._readableState.flowing);
4052 if (false !== this._readableState.flowing) {
4053 debug('pause');
4054 this._readableState.flowing = false;
4055 this.emit('pause');
4056 }
4057 return this;
4058};
4059
4060function flow(stream) {
4061 var state = stream._readableState;
4062 debug('flow', state.flowing);
4063 while (state.flowing && stream.read() !== null) {}
4064}
4065
4066// wrap an old-style stream as the async data source.
4067// This is *not* part of the readable stream interface.
4068// It is an ugly unfortunate mess of history.
4069Readable.prototype.wrap = function (stream) {
4070 var state = this._readableState;
4071 var paused = false;
4072
4073 var self = this;
4074 stream.on('end', function () {
4075 debug('wrapped end');
4076 if (state.decoder && !state.ended) {
4077 var chunk = state.decoder.end();
4078 if (chunk && chunk.length) self.push(chunk);
4079 }
4080
4081 self.push(null);
4082 });
4083
4084 stream.on('data', function (chunk) {
4085 debug('wrapped data');
4086 if (state.decoder) chunk = state.decoder.write(chunk);
4087
4088 // don't skip over falsy values in objectMode
4089 if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
4090
4091 var ret = self.push(chunk);
4092 if (!ret) {
4093 paused = true;
4094 stream.pause();
4095 }
4096 });
4097
4098 // proxy all the other methods.
4099 // important when wrapping filters and duplexes.
4100 for (var i in stream) {
4101 if (this[i] === undefined && typeof stream[i] === 'function') {
4102 this[i] = function (method) {
4103 return function () {
4104 return stream[method].apply(stream, arguments);
4105 };
4106 }(i);
4107 }
4108 }
4109
4110 // proxy certain important events.
4111 for (var n = 0; n < kProxyEvents.length; n++) {
4112 stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n]));
4113 }
4114
4115 // when we try to consume some more bytes, simply unpause the
4116 // underlying stream.
4117 self._read = function (n) {
4118 debug('wrapped _read', n);
4119 if (paused) {
4120 paused = false;
4121 stream.resume();
4122 }
4123 };
4124
4125 return self;
4126};
4127
4128// exposed for testing purposes only.
4129Readable._fromList = fromList;
4130
4131// Pluck off n bytes from an array of buffers.
4132// Length is the combined lengths of all the buffers in the list.
4133// This function is designed to be inlinable, so please take care when making
4134// changes to the function body.
4135function fromList(n, state) {
4136 // nothing buffered
4137 if (state.length === 0) return null;
4138
4139 var ret;
4140 if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
4141 // read it all, truncate the list
4142 if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
4143 state.buffer.clear();
4144 } else {
4145 // read part of list
4146 ret = fromListPartial(n, state.buffer, state.decoder);
4147 }
4148
4149 return ret;
4150}
4151
4152// Extracts only enough buffered data to satisfy the amount requested.
4153// This function is designed to be inlinable, so please take care when making
4154// changes to the function body.
4155function fromListPartial(n, list, hasStrings) {
4156 var ret;
4157 if (n < list.head.data.length) {
4158 // slice is the same for buffers and strings
4159 ret = list.head.data.slice(0, n);
4160 list.head.data = list.head.data.slice(n);
4161 } else if (n === list.head.data.length) {
4162 // first chunk is a perfect match
4163 ret = list.shift();
4164 } else {
4165 // result spans more than one buffer
4166 ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
4167 }
4168 return ret;
4169}
4170
4171// Copies a specified amount of characters from the list of buffered data
4172// chunks.
4173// This function is designed to be inlinable, so please take care when making
4174// changes to the function body.
4175function copyFromBufferString(n, list) {
4176 var p = list.head;
4177 var c = 1;
4178 var ret = p.data;
4179 n -= ret.length;
4180 while (p = p.next) {
4181 var str = p.data;
4182 var nb = n > str.length ? str.length : n;
4183 if (nb === str.length) ret += str;else ret += str.slice(0, n);
4184 n -= nb;
4185 if (n === 0) {
4186 if (nb === str.length) {
4187 ++c;
4188 if (p.next) list.head = p.next;else list.head = list.tail = null;
4189 } else {
4190 list.head = p;
4191 p.data = str.slice(nb);
4192 }
4193 break;
4194 }
4195 ++c;
4196 }
4197 list.length -= c;
4198 return ret;
4199}
4200
4201// Copies a specified amount of bytes from the list of buffered data chunks.
4202// This function is designed to be inlinable, so please take care when making
4203// changes to the function body.
4204function copyFromBuffer(n, list) {
4205 var ret = bufferShim.allocUnsafe(n);
4206 var p = list.head;
4207 var c = 1;
4208 p.data.copy(ret);
4209 n -= p.data.length;
4210 while (p = p.next) {
4211 var buf = p.data;
4212 var nb = n > buf.length ? buf.length : n;
4213 buf.copy(ret, ret.length - n, 0, nb);
4214 n -= nb;
4215 if (n === 0) {
4216 if (nb === buf.length) {
4217 ++c;
4218 if (p.next) list.head = p.next;else list.head = list.tail = null;
4219 } else {
4220 list.head = p;
4221 p.data = buf.slice(nb);
4222 }
4223 break;
4224 }
4225 ++c;
4226 }
4227 list.length -= c;
4228 return ret;
4229}
4230
4231function endReadable(stream) {
4232 var state = stream._readableState;
4233
4234 // If we get here before consuming all the bytes, then that is a
4235 // bug in node. Should never happen.
4236 if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
4237
4238 if (!state.endEmitted) {
4239 state.ended = true;
4240 processNextTick(endReadableNT, state, stream);
4241 }
4242}
4243
4244function endReadableNT(state, stream) {
4245 // Check that we didn't get one last unshift.
4246 if (!state.endEmitted && state.length === 0) {
4247 state.endEmitted = true;
4248 stream.readable = false;
4249 stream.emit('end');
4250 }
4251}
4252
4253function forEach(xs, f) {
4254 for (var i = 0, l = xs.length; i < l; i++) {
4255 f(xs[i], i);
4256 }
4257}
4258
4259function indexOf(xs, x) {
4260 for (var i = 0, l = xs.length; i < l; i++) {
4261 if (xs[i] === x) return i;
4262 }
4263 return -1;
4264}
4265}).call(this,require('_process'))
4266},{"./_stream_duplex":15,"./internal/streams/BufferList":20,"./internal/streams/stream":21,"_process":13,"buffer":5,"buffer-shims":4,"core-util-is":6,"events":7,"inherits":9,"isarray":11,"process-nextick-args":12,"string_decoder/":22,"util":3}],18:[function(require,module,exports){
4267// a transform stream is a readable/writable stream where you do
4268// something with the data. Sometimes it's called a "filter",
4269// but that's not a great name for it, since that implies a thing where
4270// some bits pass through, and others are simply ignored. (That would
4271// be a valid example of a transform, of course.)
4272//
4273// While the output is causally related to the input, it's not a
4274// necessarily symmetric or synchronous transformation. For example,
4275// a zlib stream might take multiple plain-text writes(), and then
4276// emit a single compressed chunk some time in the future.
4277//
4278// Here's how this works:
4279//
4280// The Transform stream has all the aspects of the readable and writable
4281// stream classes. When you write(chunk), that calls _write(chunk,cb)
4282// internally, and returns false if there's a lot of pending writes
4283// buffered up. When you call read(), that calls _read(n) until
4284// there's enough pending readable data buffered up.
4285//
4286// In a transform stream, the written data is placed in a buffer. When
4287// _read(n) is called, it transforms the queued up data, calling the
4288// buffered _write cb's as it consumes chunks. If consuming a single
4289// written chunk would result in multiple output chunks, then the first
4290// outputted bit calls the readcb, and subsequent chunks just go into
4291// the read buffer, and will cause it to emit 'readable' if necessary.
4292//
4293// This way, back-pressure is actually determined by the reading side,
4294// since _read has to be called to start processing a new chunk. However,
4295// a pathological inflate type of transform can cause excessive buffering
4296// here. For example, imagine a stream where every byte of input is
4297// interpreted as an integer from 0-255, and then results in that many
4298// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
4299// 1kb of data being output. In this case, you could write a very small
4300// amount of input, and end up with a very large amount of output. In
4301// such a pathological inflating mechanism, there'd be no way to tell
4302// the system to stop doing the transform. A single 4MB write could
4303// cause the system to run out of memory.
4304//
4305// However, even in such a pathological case, only a single written chunk
4306// would be consumed, and then the rest would wait (un-transformed) until
4307// the results of the previous transformed chunk were consumed.
4308
4309'use strict';
4310
4311module.exports = Transform;
4312
4313var Duplex = require('./_stream_duplex');
4314
4315/*<replacement>*/
4316var util = require('core-util-is');
4317util.inherits = require('inherits');
4318/*</replacement>*/
4319
4320util.inherits(Transform, Duplex);
4321
4322function TransformState(stream) {
4323 this.afterTransform = function (er, data) {
4324 return afterTransform(stream, er, data);
4325 };
4326
4327 this.needTransform = false;
4328 this.transforming = false;
4329 this.writecb = null;
4330 this.writechunk = null;
4331 this.writeencoding = null;
4332}
4333
4334function afterTransform(stream, er, data) {
4335 var ts = stream._transformState;
4336 ts.transforming = false;
4337
4338 var cb = ts.writecb;
4339
4340 if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));
4341
4342 ts.writechunk = null;
4343 ts.writecb = null;
4344
4345 if (data !== null && data !== undefined) stream.push(data);
4346
4347 cb(er);
4348
4349 var rs = stream._readableState;
4350 rs.reading = false;
4351 if (rs.needReadable || rs.length < rs.highWaterMark) {
4352 stream._read(rs.highWaterMark);
4353 }
4354}
4355
4356function Transform(options) {
4357 if (!(this instanceof Transform)) return new Transform(options);
4358
4359 Duplex.call(this, options);
4360
4361 this._transformState = new TransformState(this);
4362
4363 var stream = this;
4364
4365 // start out asking for a readable event once data is transformed.
4366 this._readableState.needReadable = true;
4367
4368 // we have implemented the _read method, and done the other things
4369 // that Readable wants before the first _read call, so unset the
4370 // sync guard flag.
4371 this._readableState.sync = false;
4372
4373 if (options) {
4374 if (typeof options.transform === 'function') this._transform = options.transform;
4375
4376 if (typeof options.flush === 'function') this._flush = options.flush;
4377 }
4378
4379 // When the writable side finishes, then flush out anything remaining.
4380 this.once('prefinish', function () {
4381 if (typeof this._flush === 'function') this._flush(function (er, data) {
4382 done(stream, er, data);
4383 });else done(stream);
4384 });
4385}
4386
4387Transform.prototype.push = function (chunk, encoding) {
4388 this._transformState.needTransform = false;
4389 return Duplex.prototype.push.call(this, chunk, encoding);
4390};
4391
4392// This is the part where you do stuff!
4393// override this function in implementation classes.
4394// 'chunk' is an input chunk.
4395//
4396// Call `push(newChunk)` to pass along transformed output
4397// to the readable side. You may call 'push' zero or more times.
4398//
4399// Call `cb(err)` when you are done with this chunk. If you pass
4400// an error, then that'll put the hurt on the whole operation. If you
4401// never call cb(), then you'll never get another chunk.
4402Transform.prototype._transform = function (chunk, encoding, cb) {
4403 throw new Error('_transform() is not implemented');
4404};
4405
4406Transform.prototype._write = function (chunk, encoding, cb) {
4407 var ts = this._transformState;
4408 ts.writecb = cb;
4409 ts.writechunk = chunk;
4410 ts.writeencoding = encoding;
4411 if (!ts.transforming) {
4412 var rs = this._readableState;
4413 if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
4414 }
4415};
4416
4417// Doesn't matter what the args are here.
4418// _transform does all the work.
4419// That we got here means that the readable side wants more data.
4420Transform.prototype._read = function (n) {
4421 var ts = this._transformState;
4422
4423 if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
4424 ts.transforming = true;
4425 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
4426 } else {
4427 // mark that we need a transform, so that any data that comes in
4428 // will get processed, now that we've asked for it.
4429 ts.needTransform = true;
4430 }
4431};
4432
4433function done(stream, er, data) {
4434 if (er) return stream.emit('error', er);
4435
4436 if (data !== null && data !== undefined) stream.push(data);
4437
4438 // if there's nothing in the write buffer, then that means
4439 // that nothing more will ever be provided
4440 var ws = stream._writableState;
4441 var ts = stream._transformState;
4442
4443 if (ws.length) throw new Error('Calling transform done when ws.length != 0');
4444
4445 if (ts.transforming) throw new Error('Calling transform done when still transforming');
4446
4447 return stream.push(null);
4448}
4449},{"./_stream_duplex":15,"core-util-is":6,"inherits":9}],19:[function(require,module,exports){
4450(function (process){
4451// A bit simpler than readable streams.
4452// Implement an async ._write(chunk, encoding, cb), and it'll handle all
4453// the drain event emission and buffering.
4454
4455'use strict';
4456
4457module.exports = Writable;
4458
4459/*<replacement>*/
4460var processNextTick = require('process-nextick-args');
4461/*</replacement>*/
4462
4463/*<replacement>*/
4464var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
4465/*</replacement>*/
4466
4467/*<replacement>*/
4468var Duplex;
4469/*</replacement>*/
4470
4471Writable.WritableState = WritableState;
4472
4473/*<replacement>*/
4474var util = require('core-util-is');
4475util.inherits = require('inherits');
4476/*</replacement>*/
4477
4478/*<replacement>*/
4479var internalUtil = {
4480 deprecate: require('util-deprecate')
4481};
4482/*</replacement>*/
4483
4484/*<replacement>*/
4485var Stream = require('./internal/streams/stream');
4486/*</replacement>*/
4487
4488var Buffer = require('buffer').Buffer;
4489/*<replacement>*/
4490var bufferShim = require('buffer-shims');
4491/*</replacement>*/
4492
4493util.inherits(Writable, Stream);
4494
4495function nop() {}
4496
4497function WriteReq(chunk, encoding, cb) {
4498 this.chunk = chunk;
4499 this.encoding = encoding;
4500 this.callback = cb;
4501 this.next = null;
4502}
4503
4504function WritableState(options, stream) {
4505 Duplex = Duplex || require('./_stream_duplex');
4506
4507 options = options || {};
4508
4509 // object stream flag to indicate whether or not this stream
4510 // contains buffers or objects.
4511 this.objectMode = !!options.objectMode;
4512
4513 if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
4514
4515 // the point at which write() starts returning false
4516 // Note: 0 is a valid value, means that we always return false if
4517 // the entire buffer is not flushed immediately on write()
4518 var hwm = options.highWaterMark;
4519 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
4520 this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
4521
4522 // cast to ints.
4523 this.highWaterMark = ~~this.highWaterMark;
4524
4525 // drain event flag.
4526 this.needDrain = false;
4527 // at the start of calling end()
4528 this.ending = false;
4529 // when end() has been called, and returned
4530 this.ended = false;
4531 // when 'finish' is emitted
4532 this.finished = false;
4533
4534 // should we decode strings into buffers before passing to _write?
4535 // this is here so that some node-core streams can optimize string
4536 // handling at a lower level.
4537 var noDecode = options.decodeStrings === false;
4538 this.decodeStrings = !noDecode;
4539
4540 // Crypto is kind of old and crusty. Historically, its default string
4541 // encoding is 'binary' so we have to make this configurable.
4542 // Everything else in the universe uses 'utf8', though.
4543 this.defaultEncoding = options.defaultEncoding || 'utf8';
4544
4545 // not an actual buffer we keep track of, but a measurement
4546 // of how much we're waiting to get pushed to some underlying
4547 // socket or file.
4548 this.length = 0;
4549
4550 // a flag to see when we're in the middle of a write.
4551 this.writing = false;
4552
4553 // when true all writes will be buffered until .uncork() call
4554 this.corked = 0;
4555
4556 // a flag to be able to tell if the onwrite cb is called immediately,
4557 // or on a later tick. We set this to true at first, because any
4558 // actions that shouldn't happen until "later" should generally also
4559 // not happen before the first write call.
4560 this.sync = true;
4561
4562 // a flag to know if we're processing previously buffered items, which
4563 // may call the _write() callback in the same tick, so that we don't
4564 // end up in an overlapped onwrite situation.
4565 this.bufferProcessing = false;
4566
4567 // the callback that's passed to _write(chunk,cb)
4568 this.onwrite = function (er) {
4569 onwrite(stream, er);
4570 };
4571
4572 // the callback that the user supplies to write(chunk,encoding,cb)
4573 this.writecb = null;
4574
4575 // the amount that is being written when _write is called.
4576 this.writelen = 0;
4577
4578 this.bufferedRequest = null;
4579 this.lastBufferedRequest = null;
4580
4581 // number of pending user-supplied write callbacks
4582 // this must be 0 before 'finish' can be emitted
4583 this.pendingcb = 0;
4584
4585 // emit prefinish if the only thing we're waiting for is _write cbs
4586 // This is relevant for synchronous Transform streams
4587 this.prefinished = false;
4588
4589 // True if the error was already emitted and should not be thrown again
4590 this.errorEmitted = false;
4591
4592 // count buffered requests
4593 this.bufferedRequestCount = 0;
4594
4595 // allocate the first CorkedRequest, there is always
4596 // one allocated and free to use, and we maintain at most two
4597 this.corkedRequestsFree = new CorkedRequest(this);
4598}
4599
4600WritableState.prototype.getBuffer = function getBuffer() {
4601 var current = this.bufferedRequest;
4602 var out = [];
4603 while (current) {
4604 out.push(current);
4605 current = current.next;
4606 }
4607 return out;
4608};
4609
4610(function () {
4611 try {
4612 Object.defineProperty(WritableState.prototype, 'buffer', {
4613 get: internalUtil.deprecate(function () {
4614 return this.getBuffer();
4615 }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
4616 });
4617 } catch (_) {}
4618})();
4619
4620// Test _writableState for inheritance to account for Duplex streams,
4621// whose prototype chain only points to Readable.
4622var realHasInstance;
4623if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
4624 realHasInstance = Function.prototype[Symbol.hasInstance];
4625 Object.defineProperty(Writable, Symbol.hasInstance, {
4626 value: function (object) {
4627 if (realHasInstance.call(this, object)) return true;
4628
4629 return object && object._writableState instanceof WritableState;
4630 }
4631 });
4632} else {
4633 realHasInstance = function (object) {
4634 return object instanceof this;
4635 };
4636}
4637
4638function Writable(options) {
4639 Duplex = Duplex || require('./_stream_duplex');
4640
4641 // Writable ctor is applied to Duplexes, too.
4642 // `realHasInstance` is necessary because using plain `instanceof`
4643 // would return false, as no `_writableState` property is attached.
4644
4645 // Trying to use the custom `instanceof` for Writable here will also break the
4646 // Node.js LazyTransform implementation, which has a non-trivial getter for
4647 // `_writableState` that would lead to infinite recursion.
4648 if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
4649 return new Writable(options);
4650 }
4651
4652 this._writableState = new WritableState(options, this);
4653
4654 // legacy.
4655 this.writable = true;
4656
4657 if (options) {
4658 if (typeof options.write === 'function') this._write = options.write;
4659
4660 if (typeof options.writev === 'function') this._writev = options.writev;
4661 }
4662
4663 Stream.call(this);
4664}
4665
4666// Otherwise people can pipe Writable streams, which is just wrong.
4667Writable.prototype.pipe = function () {
4668 this.emit('error', new Error('Cannot pipe, not readable'));
4669};
4670
4671function writeAfterEnd(stream, cb) {
4672 var er = new Error('write after end');
4673 // TODO: defer error events consistently everywhere, not just the cb
4674 stream.emit('error', er);
4675 processNextTick(cb, er);
4676}
4677
4678// Checks that a user-supplied chunk is valid, especially for the particular
4679// mode the stream is in. Currently this means that `null` is never accepted
4680// and undefined/non-string values are only allowed in object mode.
4681function validChunk(stream, state, chunk, cb) {
4682 var valid = true;
4683 var er = false;
4684
4685 if (chunk === null) {
4686 er = new TypeError('May not write null values to stream');
4687 } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
4688 er = new TypeError('Invalid non-string/buffer chunk');
4689 }
4690 if (er) {
4691 stream.emit('error', er);
4692 processNextTick(cb, er);
4693 valid = false;
4694 }
4695 return valid;
4696}
4697
4698Writable.prototype.write = function (chunk, encoding, cb) {
4699 var state = this._writableState;
4700 var ret = false;
4701 var isBuf = Buffer.isBuffer(chunk);
4702
4703 if (typeof encoding === 'function') {
4704 cb = encoding;
4705 encoding = null;
4706 }
4707
4708 if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
4709
4710 if (typeof cb !== 'function') cb = nop;
4711
4712 if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
4713 state.pendingcb++;
4714 ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
4715 }
4716
4717 return ret;
4718};
4719
4720Writable.prototype.cork = function () {
4721 var state = this._writableState;
4722
4723 state.corked++;
4724};
4725
4726Writable.prototype.uncork = function () {
4727 var state = this._writableState;
4728
4729 if (state.corked) {
4730 state.corked--;
4731
4732 if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
4733 }
4734};
4735
4736Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
4737 // node::ParseEncoding() requires lower case.
4738 if (typeof encoding === 'string') encoding = encoding.toLowerCase();
4739 if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
4740 this._writableState.defaultEncoding = encoding;
4741 return this;
4742};
4743
4744function decodeChunk(state, chunk, encoding) {
4745 if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
4746 chunk = bufferShim.from(chunk, encoding);
4747 }
4748 return chunk;
4749}
4750
4751// if we're already writing something, then just put this
4752// in the queue, and wait our turn. Otherwise, call _write
4753// If we return false, then we need a drain event, so set that flag.
4754function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
4755 if (!isBuf) {
4756 chunk = decodeChunk(state, chunk, encoding);
4757 if (Buffer.isBuffer(chunk)) encoding = 'buffer';
4758 }
4759 var len = state.objectMode ? 1 : chunk.length;
4760
4761 state.length += len;
4762
4763 var ret = state.length < state.highWaterMark;
4764 // we must ensure that previous needDrain will not be reset to false.
4765 if (!ret) state.needDrain = true;
4766
4767 if (state.writing || state.corked) {
4768 var last = state.lastBufferedRequest;
4769 state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
4770 if (last) {
4771 last.next = state.lastBufferedRequest;
4772 } else {
4773 state.bufferedRequest = state.lastBufferedRequest;
4774 }
4775 state.bufferedRequestCount += 1;
4776 } else {
4777 doWrite(stream, state, false, len, chunk, encoding, cb);
4778 }
4779
4780 return ret;
4781}
4782
4783function doWrite(stream, state, writev, len, chunk, encoding, cb) {
4784 state.writelen = len;
4785 state.writecb = cb;
4786 state.writing = true;
4787 state.sync = true;
4788 if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
4789 state.sync = false;
4790}
4791
4792function onwriteError(stream, state, sync, er, cb) {
4793 --state.pendingcb;
4794 if (sync) processNextTick(cb, er);else cb(er);
4795
4796 stream._writableState.errorEmitted = true;
4797 stream.emit('error', er);
4798}
4799
4800function onwriteStateUpdate(state) {
4801 state.writing = false;
4802 state.writecb = null;
4803 state.length -= state.writelen;
4804 state.writelen = 0;
4805}
4806
4807function onwrite(stream, er) {
4808 var state = stream._writableState;
4809 var sync = state.sync;
4810 var cb = state.writecb;
4811
4812 onwriteStateUpdate(state);
4813
4814 if (er) onwriteError(stream, state, sync, er, cb);else {
4815 // Check if we're actually ready to finish, but don't emit yet
4816 var finished = needFinish(state);
4817
4818 if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
4819 clearBuffer(stream, state);
4820 }
4821
4822 if (sync) {
4823 /*<replacement>*/
4824 asyncWrite(afterWrite, stream, state, finished, cb);
4825 /*</replacement>*/
4826 } else {
4827 afterWrite(stream, state, finished, cb);
4828 }
4829 }
4830}
4831
4832function afterWrite(stream, state, finished, cb) {
4833 if (!finished) onwriteDrain(stream, state);
4834 state.pendingcb--;
4835 cb();
4836 finishMaybe(stream, state);
4837}
4838
4839// Must force callback to be called on nextTick, so that we don't
4840// emit 'drain' before the write() consumer gets the 'false' return
4841// value, and has a chance to attach a 'drain' listener.
4842function onwriteDrain(stream, state) {
4843 if (state.length === 0 && state.needDrain) {
4844 state.needDrain = false;
4845 stream.emit('drain');
4846 }
4847}
4848
4849// if there's something in the buffer waiting, then process it
4850function clearBuffer(stream, state) {
4851 state.bufferProcessing = true;
4852 var entry = state.bufferedRequest;
4853
4854 if (stream._writev && entry && entry.next) {
4855 // Fast case, write everything using _writev()
4856 var l = state.bufferedRequestCount;
4857 var buffer = new Array(l);
4858 var holder = state.corkedRequestsFree;
4859 holder.entry = entry;
4860
4861 var count = 0;
4862 while (entry) {
4863 buffer[count] = entry;
4864 entry = entry.next;
4865 count += 1;
4866 }
4867
4868 doWrite(stream, state, true, state.length, buffer, '', holder.finish);
4869
4870 // doWrite is almost always async, defer these to save a bit of time
4871 // as the hot path ends with doWrite
4872 state.pendingcb++;
4873 state.lastBufferedRequest = null;
4874 if (holder.next) {
4875 state.corkedRequestsFree = holder.next;
4876 holder.next = null;
4877 } else {
4878 state.corkedRequestsFree = new CorkedRequest(state);
4879 }
4880 } else {
4881 // Slow case, write chunks one-by-one
4882 while (entry) {
4883 var chunk = entry.chunk;
4884 var encoding = entry.encoding;
4885 var cb = entry.callback;
4886 var len = state.objectMode ? 1 : chunk.length;
4887
4888 doWrite(stream, state, false, len, chunk, encoding, cb);
4889 entry = entry.next;
4890 // if we didn't call the onwrite immediately, then
4891 // it means that we need to wait until it does.
4892 // also, that means that the chunk and cb are currently
4893 // being processed, so move the buffer counter past them.
4894 if (state.writing) {
4895 break;
4896 }
4897 }
4898
4899 if (entry === null) state.lastBufferedRequest = null;
4900 }
4901
4902 state.bufferedRequestCount = 0;
4903 state.bufferedRequest = entry;
4904 state.bufferProcessing = false;
4905}
4906
4907Writable.prototype._write = function (chunk, encoding, cb) {
4908 cb(new Error('_write() is not implemented'));
4909};
4910
4911Writable.prototype._writev = null;
4912
4913Writable.prototype.end = function (chunk, encoding, cb) {
4914 var state = this._writableState;
4915
4916 if (typeof chunk === 'function') {
4917 cb = chunk;
4918 chunk = null;
4919 encoding = null;
4920 } else if (typeof encoding === 'function') {
4921 cb = encoding;
4922 encoding = null;
4923 }
4924
4925 if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
4926
4927 // .end() fully uncorks
4928 if (state.corked) {
4929 state.corked = 1;
4930 this.uncork();
4931 }
4932
4933 // ignore unnecessary end() calls.
4934 if (!state.ending && !state.finished) endWritable(this, state, cb);
4935};
4936
4937function needFinish(state) {
4938 return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
4939}
4940
4941function prefinish(stream, state) {
4942 if (!state.prefinished) {
4943 state.prefinished = true;
4944 stream.emit('prefinish');
4945 }
4946}
4947
4948function finishMaybe(stream, state) {
4949 var need = needFinish(state);
4950 if (need) {
4951 if (state.pendingcb === 0) {
4952 prefinish(stream, state);
4953 state.finished = true;
4954 stream.emit('finish');
4955 } else {
4956 prefinish(stream, state);
4957 }
4958 }
4959 return need;
4960}
4961
4962function endWritable(stream, state, cb) {
4963 state.ending = true;
4964 finishMaybe(stream, state);
4965 if (cb) {
4966 if (state.finished) processNextTick(cb);else stream.once('finish', cb);
4967 }
4968 state.ended = true;
4969 stream.writable = false;
4970}
4971
4972// It seems a linked list but it is not
4973// there will be only 2 of these for each stream
4974function CorkedRequest(state) {
4975 var _this = this;
4976
4977 this.next = null;
4978 this.entry = null;
4979 this.finish = function (err) {
4980 var entry = _this.entry;
4981 _this.entry = null;
4982 while (entry) {
4983 var cb = entry.callback;
4984 state.pendingcb--;
4985 cb(err);
4986 entry = entry.next;
4987 }
4988 if (state.corkedRequestsFree) {
4989 state.corkedRequestsFree.next = _this;
4990 } else {
4991 state.corkedRequestsFree = _this;
4992 }
4993 };
4994}
4995}).call(this,require('_process'))
4996},{"./_stream_duplex":15,"./internal/streams/stream":21,"_process":13,"buffer":5,"buffer-shims":4,"core-util-is":6,"inherits":9,"process-nextick-args":12,"util-deprecate":30}],20:[function(require,module,exports){
4997'use strict';
4998
4999var Buffer = require('buffer').Buffer;
5000/*<replacement>*/
5001var bufferShim = require('buffer-shims');
5002/*</replacement>*/
5003
5004module.exports = BufferList;
5005
5006function BufferList() {
5007 this.head = null;
5008 this.tail = null;
5009 this.length = 0;
5010}
5011
5012BufferList.prototype.push = function (v) {
5013 var entry = { data: v, next: null };
5014 if (this.length > 0) this.tail.next = entry;else this.head = entry;
5015 this.tail = entry;
5016 ++this.length;
5017};
5018
5019BufferList.prototype.unshift = function (v) {
5020 var entry = { data: v, next: this.head };
5021 if (this.length === 0) this.tail = entry;
5022 this.head = entry;
5023 ++this.length;
5024};
5025
5026BufferList.prototype.shift = function () {
5027 if (this.length === 0) return;
5028 var ret = this.head.data;
5029 if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
5030 --this.length;
5031 return ret;
5032};
5033
5034BufferList.prototype.clear = function () {
5035 this.head = this.tail = null;
5036 this.length = 0;
5037};
5038
5039BufferList.prototype.join = function (s) {
5040 if (this.length === 0) return '';
5041 var p = this.head;
5042 var ret = '' + p.data;
5043 while (p = p.next) {
5044 ret += s + p.data;
5045 }return ret;
5046};
5047
5048BufferList.prototype.concat = function (n) {
5049 if (this.length === 0) return bufferShim.alloc(0);
5050 if (this.length === 1) return this.head.data;
5051 var ret = bufferShim.allocUnsafe(n >>> 0);
5052 var p = this.head;
5053 var i = 0;
5054 while (p) {
5055 p.data.copy(ret, i);
5056 i += p.data.length;
5057 p = p.next;
5058 }
5059 return ret;
5060};
5061},{"buffer":5,"buffer-shims":4}],21:[function(require,module,exports){
5062module.exports = require('events').EventEmitter;
5063
5064},{"events":7}],22:[function(require,module,exports){
5065'use strict';
5066
5067var Buffer = require('safe-buffer').Buffer;
5068
5069var isEncoding = Buffer.isEncoding || function (encoding) {
5070 encoding = '' + encoding;
5071 switch (encoding && encoding.toLowerCase()) {
5072 case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
5073 return true;
5074 default:
5075 return false;
5076 }
5077};
5078
5079function _normalizeEncoding(enc) {
5080 if (!enc) return 'utf8';
5081 var retried;
5082 while (true) {
5083 switch (enc) {
5084 case 'utf8':
5085 case 'utf-8':
5086 return 'utf8';
5087 case 'ucs2':
5088 case 'ucs-2':
5089 case 'utf16le':
5090 case 'utf-16le':
5091 return 'utf16le';
5092 case 'latin1':
5093 case 'binary':
5094 return 'latin1';
5095 case 'base64':
5096 case 'ascii':
5097 case 'hex':
5098 return enc;
5099 default:
5100 if (retried) return; // undefined
5101 enc = ('' + enc).toLowerCase();
5102 retried = true;
5103 }
5104 }
5105};
5106
5107// Do not cache `Buffer.isEncoding` when checking encoding names as some
5108// modules monkey-patch it to support additional encodings
5109function normalizeEncoding(enc) {
5110 var nenc = _normalizeEncoding(enc);
5111 if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
5112 return nenc || enc;
5113}
5114
5115// StringDecoder provides an interface for efficiently splitting a series of
5116// buffers into a series of JS strings without breaking apart multi-byte
5117// characters.
5118exports.StringDecoder = StringDecoder;
5119function StringDecoder(encoding) {
5120 this.encoding = normalizeEncoding(encoding);
5121 var nb;
5122 switch (this.encoding) {
5123 case 'utf16le':
5124 this.text = utf16Text;
5125 this.end = utf16End;
5126 nb = 4;
5127 break;
5128 case 'utf8':
5129 this.fillLast = utf8FillLast;
5130 nb = 4;
5131 break;
5132 case 'base64':
5133 this.text = base64Text;
5134 this.end = base64End;
5135 nb = 3;
5136 break;
5137 default:
5138 this.write = simpleWrite;
5139 this.end = simpleEnd;
5140 return;
5141 }
5142 this.lastNeed = 0;
5143 this.lastTotal = 0;
5144 this.lastChar = Buffer.allocUnsafe(nb);
5145}
5146
5147StringDecoder.prototype.write = function (buf) {
5148 if (buf.length === 0) return '';
5149 var r;
5150 var i;
5151 if (this.lastNeed) {
5152 r = this.fillLast(buf);
5153 if (r === undefined) return '';
5154 i = this.lastNeed;
5155 this.lastNeed = 0;
5156 } else {
5157 i = 0;
5158 }
5159 if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
5160 return r || '';
5161};
5162
5163StringDecoder.prototype.end = utf8End;
5164
5165// Returns only complete characters in a Buffer
5166StringDecoder.prototype.text = utf8Text;
5167
5168// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
5169StringDecoder.prototype.fillLast = function (buf) {
5170 if (this.lastNeed <= buf.length) {
5171 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
5172 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
5173 }
5174 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
5175 this.lastNeed -= buf.length;
5176};
5177
5178// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
5179// continuation byte.
5180function utf8CheckByte(byte) {
5181 if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
5182 return -1;
5183}
5184
5185// Checks at most 3 bytes at the end of a Buffer in order to detect an
5186// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
5187// needed to complete the UTF-8 character (if applicable) are returned.
5188function utf8CheckIncomplete(self, buf, i) {
5189 var j = buf.length - 1;
5190 if (j < i) return 0;
5191 var nb = utf8CheckByte(buf[j]);
5192 if (nb >= 0) {
5193 if (nb > 0) self.lastNeed = nb - 1;
5194 return nb;
5195 }
5196 if (--j < i) return 0;
5197 nb = utf8CheckByte(buf[j]);
5198 if (nb >= 0) {
5199 if (nb > 0) self.lastNeed = nb - 2;
5200 return nb;
5201 }
5202 if (--j < i) return 0;
5203 nb = utf8CheckByte(buf[j]);
5204 if (nb >= 0) {
5205 if (nb > 0) {
5206 if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
5207 }
5208 return nb;
5209 }
5210 return 0;
5211}
5212
5213// Validates as many continuation bytes for a multi-byte UTF-8 character as
5214// needed or are available. If we see a non-continuation byte where we expect
5215// one, we "replace" the validated continuation bytes we've seen so far with
5216// UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding
5217// behavior. The continuation byte check is included three times in the case
5218// where all of the continuation bytes for a character exist in the same buffer.
5219// It is also done this way as a slight performance increase instead of using a
5220// loop.
5221function utf8CheckExtraBytes(self, buf, p) {
5222 if ((buf[0] & 0xC0) !== 0x80) {
5223 self.lastNeed = 0;
5224 return '\ufffd'.repeat(p);
5225 }
5226 if (self.lastNeed > 1 && buf.length > 1) {
5227 if ((buf[1] & 0xC0) !== 0x80) {
5228 self.lastNeed = 1;
5229 return '\ufffd'.repeat(p + 1);
5230 }
5231 if (self.lastNeed > 2 && buf.length > 2) {
5232 if ((buf[2] & 0xC0) !== 0x80) {
5233 self.lastNeed = 2;
5234 return '\ufffd'.repeat(p + 2);
5235 }
5236 }
5237 }
5238}
5239
5240// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
5241function utf8FillLast(buf) {
5242 var p = this.lastTotal - this.lastNeed;
5243 var r = utf8CheckExtraBytes(this, buf, p);
5244 if (r !== undefined) return r;
5245 if (this.lastNeed <= buf.length) {
5246 buf.copy(this.lastChar, p, 0, this.lastNeed);
5247 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
5248 }
5249 buf.copy(this.lastChar, p, 0, buf.length);
5250 this.lastNeed -= buf.length;
5251}
5252
5253// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
5254// partial character, the character's bytes are buffered until the required
5255// number of bytes are available.
5256function utf8Text(buf, i) {
5257 var total = utf8CheckIncomplete(this, buf, i);
5258 if (!this.lastNeed) return buf.toString('utf8', i);
5259 this.lastTotal = total;
5260 var end = buf.length - (total - this.lastNeed);
5261 buf.copy(this.lastChar, 0, end);
5262 return buf.toString('utf8', i, end);
5263}
5264
5265// For UTF-8, a replacement character for each buffered byte of a (partial)
5266// character needs to be added to the output.
5267function utf8End(buf) {
5268 var r = buf && buf.length ? this.write(buf) : '';
5269 if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed);
5270 return r;
5271}
5272
5273// UTF-16LE typically needs two bytes per character, but even if we have an even
5274// number of bytes available, we need to check if we end on a leading/high
5275// surrogate. In that case, we need to wait for the next two bytes in order to
5276// decode the last character properly.
5277function utf16Text(buf, i) {
5278 if ((buf.length - i) % 2 === 0) {
5279 var r = buf.toString('utf16le', i);
5280 if (r) {
5281 var c = r.charCodeAt(r.length - 1);
5282 if (c >= 0xD800 && c <= 0xDBFF) {
5283 this.lastNeed = 2;
5284 this.lastTotal = 4;
5285 this.lastChar[0] = buf[buf.length - 2];
5286 this.lastChar[1] = buf[buf.length - 1];
5287 return r.slice(0, -1);
5288 }
5289 }
5290 return r;
5291 }
5292 this.lastNeed = 1;
5293 this.lastTotal = 2;
5294 this.lastChar[0] = buf[buf.length - 1];
5295 return buf.toString('utf16le', i, buf.length - 1);
5296}
5297
5298// For UTF-16LE we do not explicitly append special replacement characters if we
5299// end on a partial character, we simply let v8 handle that.
5300function utf16End(buf) {
5301 var r = buf && buf.length ? this.write(buf) : '';
5302 if (this.lastNeed) {
5303 var end = this.lastTotal - this.lastNeed;
5304 return r + this.lastChar.toString('utf16le', 0, end);
5305 }
5306 return r;
5307}
5308
5309function base64Text(buf, i) {
5310 var n = (buf.length - i) % 3;
5311 if (n === 0) return buf.toString('base64', i);
5312 this.lastNeed = 3 - n;
5313 this.lastTotal = 3;
5314 if (n === 1) {
5315 this.lastChar[0] = buf[buf.length - 1];
5316 } else {
5317 this.lastChar[0] = buf[buf.length - 2];
5318 this.lastChar[1] = buf[buf.length - 1];
5319 }
5320 return buf.toString('base64', i, buf.length - n);
5321}
5322
5323function base64End(buf) {
5324 var r = buf && buf.length ? this.write(buf) : '';
5325 if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
5326 return r;
5327}
5328
5329// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
5330function simpleWrite(buf) {
5331 return buf.toString(this.encoding);
5332}
5333
5334function simpleEnd(buf) {
5335 return buf && buf.length ? this.write(buf) : '';
5336}
5337},{"safe-buffer":27}],23:[function(require,module,exports){
5338module.exports = require('./readable').PassThrough
5339
5340},{"./readable":24}],24:[function(require,module,exports){
5341exports = module.exports = require('./lib/_stream_readable.js');
5342exports.Stream = exports;
5343exports.Readable = exports;
5344exports.Writable = require('./lib/_stream_writable.js');
5345exports.Duplex = require('./lib/_stream_duplex.js');
5346exports.Transform = require('./lib/_stream_transform.js');
5347exports.PassThrough = require('./lib/_stream_passthrough.js');
5348
5349},{"./lib/_stream_duplex.js":15,"./lib/_stream_passthrough.js":16,"./lib/_stream_readable.js":17,"./lib/_stream_transform.js":18,"./lib/_stream_writable.js":19}],25:[function(require,module,exports){
5350module.exports = require('./readable').Transform
5351
5352},{"./readable":24}],26:[function(require,module,exports){
5353module.exports = require('./lib/_stream_writable.js');
5354
5355},{"./lib/_stream_writable.js":19}],27:[function(require,module,exports){
5356module.exports = require('buffer')
5357
5358},{"buffer":5}],28:[function(require,module,exports){
5359// Copyright Joyent, Inc. and other Node contributors.
5360//
5361// Permission is hereby granted, free of charge, to any person obtaining a
5362// copy of this software and associated documentation files (the
5363// "Software"), to deal in the Software without restriction, including
5364// without limitation the rights to use, copy, modify, merge, publish,
5365// distribute, sublicense, and/or sell copies of the Software, and to permit
5366// persons to whom the Software is furnished to do so, subject to the
5367// following conditions:
5368//
5369// The above copyright notice and this permission notice shall be included
5370// in all copies or substantial portions of the Software.
5371//
5372// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5373// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5374// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5375// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5376// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5377// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5378// USE OR OTHER DEALINGS IN THE SOFTWARE.
5379
5380module.exports = Stream;
5381
5382var EE = require('events').EventEmitter;
5383var inherits = require('inherits');
5384
5385inherits(Stream, EE);
5386Stream.Readable = require('readable-stream/readable.js');
5387Stream.Writable = require('readable-stream/writable.js');
5388Stream.Duplex = require('readable-stream/duplex.js');
5389Stream.Transform = require('readable-stream/transform.js');
5390Stream.PassThrough = require('readable-stream/passthrough.js');
5391
5392// Backwards-compat with node 0.4.x
5393Stream.Stream = Stream;
5394
5395
5396
5397// old-style streams. Note that the pipe method (the only relevant
5398// part of this class) is overridden in the Readable class.
5399
5400function Stream() {
5401 EE.call(this);
5402}
5403
5404Stream.prototype.pipe = function(dest, options) {
5405 var source = this;
5406
5407 function ondata(chunk) {
5408 if (dest.writable) {
5409 if (false === dest.write(chunk) && source.pause) {
5410 source.pause();
5411 }
5412 }
5413 }
5414
5415 source.on('data', ondata);
5416
5417 function ondrain() {
5418 if (source.readable && source.resume) {
5419 source.resume();
5420 }
5421 }
5422
5423 dest.on('drain', ondrain);
5424
5425 // If the 'end' option is not supplied, dest.end() will be called when
5426 // source gets the 'end' or 'close' events. Only dest.end() once.
5427 if (!dest._isStdio && (!options || options.end !== false)) {
5428 source.on('end', onend);
5429 source.on('close', onclose);
5430 }
5431
5432 var didOnEnd = false;
5433 function onend() {
5434 if (didOnEnd) return;
5435 didOnEnd = true;
5436
5437 dest.end();
5438 }
5439
5440
5441 function onclose() {
5442 if (didOnEnd) return;
5443 didOnEnd = true;
5444
5445 if (typeof dest.destroy === 'function') dest.destroy();
5446 }
5447
5448 // don't leave dangling pipes when there are errors.
5449 function onerror(er) {
5450 cleanup();
5451 if (EE.listenerCount(this, 'error') === 0) {
5452 throw er; // Unhandled stream error in pipe.
5453 }
5454 }
5455
5456 source.on('error', onerror);
5457 dest.on('error', onerror);
5458
5459 // remove all the event listeners that were added.
5460 function cleanup() {
5461 source.removeListener('data', ondata);
5462 dest.removeListener('drain', ondrain);
5463
5464 source.removeListener('end', onend);
5465 source.removeListener('close', onclose);
5466
5467 source.removeListener('error', onerror);
5468 dest.removeListener('error', onerror);
5469
5470 source.removeListener('end', cleanup);
5471 source.removeListener('close', cleanup);
5472
5473 dest.removeListener('close', cleanup);
5474 }
5475
5476 source.on('end', cleanup);
5477 source.on('close', cleanup);
5478
5479 dest.on('close', cleanup);
5480
5481 dest.emit('pipe', source);
5482
5483 // Allow for unix-like usage: A.pipe(B).pipe(C)
5484 return dest;
5485};
5486
5487},{"events":7,"inherits":9,"readable-stream/duplex.js":14,"readable-stream/passthrough.js":23,"readable-stream/readable.js":24,"readable-stream/transform.js":25,"readable-stream/writable.js":26}],29:[function(require,module,exports){
5488// Copyright Joyent, Inc. and other Node contributors.
5489//
5490// Permission is hereby granted, free of charge, to any person obtaining a
5491// copy of this software and associated documentation files (the
5492// "Software"), to deal in the Software without restriction, including
5493// without limitation the rights to use, copy, modify, merge, publish,
5494// distribute, sublicense, and/or sell copies of the Software, and to permit
5495// persons to whom the Software is furnished to do so, subject to the
5496// following conditions:
5497//
5498// The above copyright notice and this permission notice shall be included
5499// in all copies or substantial portions of the Software.
5500//
5501// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5502// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5503// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5504// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5505// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5506// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5507// USE OR OTHER DEALINGS IN THE SOFTWARE.
5508
5509var Buffer = require('buffer').Buffer;
5510
5511var isBufferEncoding = Buffer.isEncoding
5512 || function(encoding) {
5513 switch (encoding && encoding.toLowerCase()) {
5514 case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
5515 default: return false;
5516 }
5517 }
5518
5519
5520function assertEncoding(encoding) {
5521 if (encoding && !isBufferEncoding(encoding)) {
5522 throw new Error('Unknown encoding: ' + encoding);
5523 }
5524}
5525
5526// StringDecoder provides an interface for efficiently splitting a series of
5527// buffers into a series of JS strings without breaking apart multi-byte
5528// characters. CESU-8 is handled as part of the UTF-8 encoding.
5529//
5530// @TODO Handling all encodings inside a single object makes it very difficult
5531// to reason about this code, so it should be split up in the future.
5532// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
5533// points as used by CESU-8.
5534var StringDecoder = exports.StringDecoder = function(encoding) {
5535 this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
5536 assertEncoding(encoding);
5537 switch (this.encoding) {
5538 case 'utf8':
5539 // CESU-8 represents each of Surrogate Pair by 3-bytes
5540 this.surrogateSize = 3;
5541 break;
5542 case 'ucs2':
5543 case 'utf16le':
5544 // UTF-16 represents each of Surrogate Pair by 2-bytes
5545 this.surrogateSize = 2;
5546 this.detectIncompleteChar = utf16DetectIncompleteChar;
5547 break;
5548 case 'base64':
5549 // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
5550 this.surrogateSize = 3;
5551 this.detectIncompleteChar = base64DetectIncompleteChar;
5552 break;
5553 default:
5554 this.write = passThroughWrite;
5555 return;
5556 }
5557
5558 // Enough space to store all bytes of a single character. UTF-8 needs 4
5559 // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
5560 this.charBuffer = new Buffer(6);
5561 // Number of bytes received for the current incomplete multi-byte character.
5562 this.charReceived = 0;
5563 // Number of bytes expected for the current incomplete multi-byte character.
5564 this.charLength = 0;
5565};
5566
5567
5568// write decodes the given buffer and returns it as JS string that is
5569// guaranteed to not contain any partial multi-byte characters. Any partial
5570// character found at the end of the buffer is buffered up, and will be
5571// returned when calling write again with the remaining bytes.
5572//
5573// Note: Converting a Buffer containing an orphan surrogate to a String
5574// currently works, but converting a String to a Buffer (via `new Buffer`, or
5575// Buffer#write) will replace incomplete surrogates with the unicode
5576// replacement character. See https://codereview.chromium.org/121173009/ .
5577StringDecoder.prototype.write = function(buffer) {
5578 var charStr = '';
5579 // if our last write ended with an incomplete multibyte character
5580 while (this.charLength) {
5581 // determine how many remaining bytes this buffer has to offer for this char
5582 var available = (buffer.length >= this.charLength - this.charReceived) ?
5583 this.charLength - this.charReceived :
5584 buffer.length;
5585
5586 // add the new bytes to the char buffer
5587 buffer.copy(this.charBuffer, this.charReceived, 0, available);
5588 this.charReceived += available;
5589
5590 if (this.charReceived < this.charLength) {
5591 // still not enough chars in this buffer? wait for more ...
5592 return '';
5593 }
5594
5595 // remove bytes belonging to the current character from the buffer
5596 buffer = buffer.slice(available, buffer.length);
5597
5598 // get the character that was split
5599 charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
5600
5601 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
5602 var charCode = charStr.charCodeAt(charStr.length - 1);
5603 if (charCode >= 0xD800 && charCode <= 0xDBFF) {
5604 this.charLength += this.surrogateSize;
5605 charStr = '';
5606 continue;
5607 }
5608 this.charReceived = this.charLength = 0;
5609
5610 // if there are no more bytes in this buffer, just emit our char
5611 if (buffer.length === 0) {
5612 return charStr;
5613 }
5614 break;
5615 }
5616
5617 // determine and set charLength / charReceived
5618 this.detectIncompleteChar(buffer);
5619
5620 var end = buffer.length;
5621 if (this.charLength) {
5622 // buffer the incomplete character bytes we got
5623 buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
5624 end -= this.charReceived;
5625 }
5626
5627 charStr += buffer.toString(this.encoding, 0, end);
5628
5629 var end = charStr.length - 1;
5630 var charCode = charStr.charCodeAt(end);
5631 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
5632 if (charCode >= 0xD800 && charCode <= 0xDBFF) {
5633 var size = this.surrogateSize;
5634 this.charLength += size;
5635 this.charReceived += size;
5636 this.charBuffer.copy(this.charBuffer, size, 0, size);
5637 buffer.copy(this.charBuffer, 0, 0, size);
5638 return charStr.substring(0, end);
5639 }
5640
5641 // or just emit the charStr
5642 return charStr;
5643};
5644
5645// detectIncompleteChar determines if there is an incomplete UTF-8 character at
5646// the end of the given buffer. If so, it sets this.charLength to the byte
5647// length that character, and sets this.charReceived to the number of bytes
5648// that are available for this character.
5649StringDecoder.prototype.detectIncompleteChar = function(buffer) {
5650 // determine how many bytes we have to check at the end of this buffer
5651 var i = (buffer.length >= 3) ? 3 : buffer.length;
5652
5653 // Figure out if one of the last i bytes of our buffer announces an
5654 // incomplete char.
5655 for (; i > 0; i--) {
5656 var c = buffer[buffer.length - i];
5657
5658 // See http://en.wikipedia.org/wiki/UTF-8#Description
5659
5660 // 110XXXXX
5661 if (i == 1 && c >> 5 == 0x06) {
5662 this.charLength = 2;
5663 break;
5664 }
5665
5666 // 1110XXXX
5667 if (i <= 2 && c >> 4 == 0x0E) {
5668 this.charLength = 3;
5669 break;
5670 }
5671
5672 // 11110XXX
5673 if (i <= 3 && c >> 3 == 0x1E) {
5674 this.charLength = 4;
5675 break;
5676 }
5677 }
5678 this.charReceived = i;
5679};
5680
5681StringDecoder.prototype.end = function(buffer) {
5682 var res = '';
5683 if (buffer && buffer.length)
5684 res = this.write(buffer);
5685
5686 if (this.charReceived) {
5687 var cr = this.charReceived;
5688 var buf = this.charBuffer;
5689 var enc = this.encoding;
5690 res += buf.slice(0, cr).toString(enc);
5691 }
5692
5693 return res;
5694};
5695
5696function passThroughWrite(buffer) {
5697 return buffer.toString(this.encoding);
5698}
5699
5700function utf16DetectIncompleteChar(buffer) {
5701 this.charReceived = buffer.length % 2;
5702 this.charLength = this.charReceived ? 2 : 0;
5703}
5704
5705function base64DetectIncompleteChar(buffer) {
5706 this.charReceived = buffer.length % 3;
5707 this.charLength = this.charReceived ? 3 : 0;
5708}
5709
5710},{"buffer":5}],30:[function(require,module,exports){
5711(function (global){
5712
5713/**
5714 * Module exports.
5715 */
5716
5717module.exports = deprecate;
5718
5719/**
5720 * Mark that a method should not be used.
5721 * Returns a modified function which warns once by default.
5722 *
5723 * If `localStorage.noDeprecation = true` is set, then it is a no-op.
5724 *
5725 * If `localStorage.throwDeprecation = true` is set, then deprecated functions
5726 * will throw an Error when invoked.
5727 *
5728 * If `localStorage.traceDeprecation = true` is set, then deprecated functions
5729 * will invoke `console.trace()` instead of `console.error()`.
5730 *
5731 * @param {Function} fn - the function to deprecate
5732 * @param {String} msg - the string to print to the console when `fn` is invoked
5733 * @returns {Function} a new "deprecated" version of `fn`
5734 * @api public
5735 */
5736
5737function deprecate (fn, msg) {
5738 if (config('noDeprecation')) {
5739 return fn;
5740 }
5741
5742 var warned = false;
5743 function deprecated() {
5744 if (!warned) {
5745 if (config('throwDeprecation')) {
5746 throw new Error(msg);
5747 } else if (config('traceDeprecation')) {
5748 console.trace(msg);
5749 } else {
5750 console.warn(msg);
5751 }
5752 warned = true;
5753 }
5754 return fn.apply(this, arguments);
5755 }
5756
5757 return deprecated;
5758}
5759
5760/**
5761 * Checks `localStorage` for boolean values for the given `name`.
5762 *
5763 * @param {String} name
5764 * @returns {Boolean}
5765 * @api private
5766 */
5767
5768function config (name) {
5769 // accessing global.localStorage can trigger a DOMException in sandboxed iframes
5770 try {
5771 if (!global.localStorage) return false;
5772 } catch (_) {
5773 return false;
5774 }
5775 var val = global.localStorage[name];
5776 if (null == val) return false;
5777 return String(val).toLowerCase() === 'true';
5778}
5779
5780}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
5781},{}],31:[function(require,module,exports){
5782arguments[4][9][0].apply(exports,arguments)
5783},{"dup":9}],32:[function(require,module,exports){
5784module.exports = function isBuffer(arg) {
5785 return arg && typeof arg === 'object'
5786 && typeof arg.copy === 'function'
5787 && typeof arg.fill === 'function'
5788 && typeof arg.readUInt8 === 'function';
5789}
5790},{}],33:[function(require,module,exports){
5791(function (process,global){
5792// Copyright Joyent, Inc. and other Node contributors.
5793//
5794// Permission is hereby granted, free of charge, to any person obtaining a
5795// copy of this software and associated documentation files (the
5796// "Software"), to deal in the Software without restriction, including
5797// without limitation the rights to use, copy, modify, merge, publish,
5798// distribute, sublicense, and/or sell copies of the Software, and to permit
5799// persons to whom the Software is furnished to do so, subject to the
5800// following conditions:
5801//
5802// The above copyright notice and this permission notice shall be included
5803// in all copies or substantial portions of the Software.
5804//
5805// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5806// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5807// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5808// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5809// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5810// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5811// USE OR OTHER DEALINGS IN THE SOFTWARE.
5812
5813var formatRegExp = /%[sdj%]/g;
5814exports.format = function(f) {
5815 if (!isString(f)) {
5816 var objects = [];
5817 for (var i = 0; i < arguments.length; i++) {
5818 objects.push(inspect(arguments[i]));
5819 }
5820 return objects.join(' ');
5821 }
5822
5823 var i = 1;
5824 var args = arguments;
5825 var len = args.length;
5826 var str = String(f).replace(formatRegExp, function(x) {
5827 if (x === '%%') return '%';
5828 if (i >= len) return x;
5829 switch (x) {
5830 case '%s': return String(args[i++]);
5831 case '%d': return Number(args[i++]);
5832 case '%j':
5833 try {
5834 return JSON.stringify(args[i++]);
5835 } catch (_) {
5836 return '[Circular]';
5837 }
5838 default:
5839 return x;
5840 }
5841 });
5842 for (var x = args[i]; i < len; x = args[++i]) {
5843 if (isNull(x) || !isObject(x)) {
5844 str += ' ' + x;
5845 } else {
5846 str += ' ' + inspect(x);
5847 }
5848 }
5849 return str;
5850};
5851
5852
5853// Mark that a method should not be used.
5854// Returns a modified function which warns once by default.
5855// If --no-deprecation is set, then it is a no-op.
5856exports.deprecate = function(fn, msg) {
5857 // Allow for deprecating things in the process of starting up.
5858 if (isUndefined(global.process)) {
5859 return function() {
5860 return exports.deprecate(fn, msg).apply(this, arguments);
5861 };
5862 }
5863
5864 if (process.noDeprecation === true) {
5865 return fn;
5866 }
5867
5868 var warned = false;
5869 function deprecated() {
5870 if (!warned) {
5871 if (process.throwDeprecation) {
5872 throw new Error(msg);
5873 } else if (process.traceDeprecation) {
5874 console.trace(msg);
5875 } else {
5876 console.error(msg);
5877 }
5878 warned = true;
5879 }
5880 return fn.apply(this, arguments);
5881 }
5882
5883 return deprecated;
5884};
5885
5886
5887var debugs = {};
5888var debugEnviron;
5889exports.debuglog = function(set) {
5890 if (isUndefined(debugEnviron))
5891 debugEnviron = process.env.NODE_DEBUG || '';
5892 set = set.toUpperCase();
5893 if (!debugs[set]) {
5894 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
5895 var pid = process.pid;
5896 debugs[set] = function() {
5897 var msg = exports.format.apply(exports, arguments);
5898 console.error('%s %d: %s', set, pid, msg);
5899 };
5900 } else {
5901 debugs[set] = function() {};
5902 }
5903 }
5904 return debugs[set];
5905};
5906
5907
5908/**
5909 * Echos the value of a value. Trys to print the value out
5910 * in the best way possible given the different types.
5911 *
5912 * @param {Object} obj The object to print out.
5913 * @param {Object} opts Optional options object that alters the output.
5914 */
5915/* legacy: obj, showHidden, depth, colors*/
5916function inspect(obj, opts) {
5917 // default options
5918 var ctx = {
5919 seen: [],
5920 stylize: stylizeNoColor
5921 };
5922 // legacy...
5923 if (arguments.length >= 3) ctx.depth = arguments[2];
5924 if (arguments.length >= 4) ctx.colors = arguments[3];
5925 if (isBoolean(opts)) {
5926 // legacy...
5927 ctx.showHidden = opts;
5928 } else if (opts) {
5929 // got an "options" object
5930 exports._extend(ctx, opts);
5931 }
5932 // set default options
5933 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
5934 if (isUndefined(ctx.depth)) ctx.depth = 2;
5935 if (isUndefined(ctx.colors)) ctx.colors = false;
5936 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
5937 if (ctx.colors) ctx.stylize = stylizeWithColor;
5938 return formatValue(ctx, obj, ctx.depth);
5939}
5940exports.inspect = inspect;
5941
5942
5943// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
5944inspect.colors = {
5945 'bold' : [1, 22],
5946 'italic' : [3, 23],
5947 'underline' : [4, 24],
5948 'inverse' : [7, 27],
5949 'white' : [37, 39],
5950 'grey' : [90, 39],
5951 'black' : [30, 39],
5952 'blue' : [34, 39],
5953 'cyan' : [36, 39],
5954 'green' : [32, 39],
5955 'magenta' : [35, 39],
5956 'red' : [31, 39],
5957 'yellow' : [33, 39]
5958};
5959
5960// Don't use 'blue' not visible on cmd.exe
5961inspect.styles = {
5962 'special': 'cyan',
5963 'number': 'yellow',
5964 'boolean': 'yellow',
5965 'undefined': 'grey',
5966 'null': 'bold',
5967 'string': 'green',
5968 'date': 'magenta',
5969 // "name": intentionally not styling
5970 'regexp': 'red'
5971};
5972
5973
5974function stylizeWithColor(str, styleType) {
5975 var style = inspect.styles[styleType];
5976
5977 if (style) {
5978 return '\u001b[' + inspect.colors[style][0] + 'm' + str +
5979 '\u001b[' + inspect.colors[style][1] + 'm';
5980 } else {
5981 return str;
5982 }
5983}
5984
5985
5986function stylizeNoColor(str, styleType) {
5987 return str;
5988}
5989
5990
5991function arrayToHash(array) {
5992 var hash = {};
5993
5994 array.forEach(function(val, idx) {
5995 hash[val] = true;
5996 });
5997
5998 return hash;
5999}
6000
6001
6002function formatValue(ctx, value, recurseTimes) {
6003 // Provide a hook for user-specified inspect functions.
6004 // Check that value is an object with an inspect function on it
6005 if (ctx.customInspect &&
6006 value &&
6007 isFunction(value.inspect) &&
6008 // Filter out the util module, it's inspect function is special
6009 value.inspect !== exports.inspect &&
6010 // Also filter out any prototype objects using the circular check.
6011 !(value.constructor && value.constructor.prototype === value)) {
6012 var ret = value.inspect(recurseTimes, ctx);
6013 if (!isString(ret)) {
6014 ret = formatValue(ctx, ret, recurseTimes);
6015 }
6016 return ret;
6017 }
6018
6019 // Primitive types cannot have properties
6020 var primitive = formatPrimitive(ctx, value);
6021 if (primitive) {
6022 return primitive;
6023 }
6024
6025 // Look up the keys of the object.
6026 var keys = Object.keys(value);
6027 var visibleKeys = arrayToHash(keys);
6028
6029 if (ctx.showHidden) {
6030 keys = Object.getOwnPropertyNames(value);
6031 }
6032
6033 // IE doesn't make error fields non-enumerable
6034 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
6035 if (isError(value)
6036 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
6037 return formatError(value);
6038 }
6039
6040 // Some type of object without properties can be shortcutted.
6041 if (keys.length === 0) {
6042 if (isFunction(value)) {
6043 var name = value.name ? ': ' + value.name : '';
6044 return ctx.stylize('[Function' + name + ']', 'special');
6045 }
6046 if (isRegExp(value)) {
6047 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
6048 }
6049 if (isDate(value)) {
6050 return ctx.stylize(Date.prototype.toString.call(value), 'date');
6051 }
6052 if (isError(value)) {
6053 return formatError(value);
6054 }
6055 }
6056
6057 var base = '', array = false, braces = ['{', '}'];
6058
6059 // Make Array say that they are Array
6060 if (isArray(value)) {
6061 array = true;
6062 braces = ['[', ']'];
6063 }
6064
6065 // Make functions say that they are functions
6066 if (isFunction(value)) {
6067 var n = value.name ? ': ' + value.name : '';
6068 base = ' [Function' + n + ']';
6069 }
6070
6071 // Make RegExps say that they are RegExps
6072 if (isRegExp(value)) {
6073 base = ' ' + RegExp.prototype.toString.call(value);
6074 }
6075
6076 // Make dates with properties first say the date
6077 if (isDate(value)) {
6078 base = ' ' + Date.prototype.toUTCString.call(value);
6079 }
6080
6081 // Make error with message first say the error
6082 if (isError(value)) {
6083 base = ' ' + formatError(value);
6084 }
6085
6086 if (keys.length === 0 && (!array || value.length == 0)) {
6087 return braces[0] + base + braces[1];
6088 }
6089
6090 if (recurseTimes < 0) {
6091 if (isRegExp(value)) {
6092 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
6093 } else {
6094 return ctx.stylize('[Object]', 'special');
6095 }
6096 }
6097
6098 ctx.seen.push(value);
6099
6100 var output;
6101 if (array) {
6102 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
6103 } else {
6104 output = keys.map(function(key) {
6105 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
6106 });
6107 }
6108
6109 ctx.seen.pop();
6110
6111 return reduceToSingleString(output, base, braces);
6112}
6113
6114
6115function formatPrimitive(ctx, value) {
6116 if (isUndefined(value))
6117 return ctx.stylize('undefined', 'undefined');
6118 if (isString(value)) {
6119 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
6120 .replace(/'/g, "\\'")
6121 .replace(/\\"/g, '"') + '\'';
6122 return ctx.stylize(simple, 'string');
6123 }
6124 if (isNumber(value))
6125 return ctx.stylize('' + value, 'number');
6126 if (isBoolean(value))
6127 return ctx.stylize('' + value, 'boolean');
6128 // For some reason typeof null is "object", so special case here.
6129 if (isNull(value))
6130 return ctx.stylize('null', 'null');
6131}
6132
6133
6134function formatError(value) {
6135 return '[' + Error.prototype.toString.call(value) + ']';
6136}
6137
6138
6139function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
6140 var output = [];
6141 for (var i = 0, l = value.length; i < l; ++i) {
6142 if (hasOwnProperty(value, String(i))) {
6143 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
6144 String(i), true));
6145 } else {
6146 output.push('');
6147 }
6148 }
6149 keys.forEach(function(key) {
6150 if (!key.match(/^\d+$/)) {
6151 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
6152 key, true));
6153 }
6154 });
6155 return output;
6156}
6157
6158
6159function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
6160 var name, str, desc;
6161 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
6162 if (desc.get) {
6163 if (desc.set) {
6164 str = ctx.stylize('[Getter/Setter]', 'special');
6165 } else {
6166 str = ctx.stylize('[Getter]', 'special');
6167 }
6168 } else {
6169 if (desc.set) {
6170 str = ctx.stylize('[Setter]', 'special');
6171 }
6172 }
6173 if (!hasOwnProperty(visibleKeys, key)) {
6174 name = '[' + key + ']';
6175 }
6176 if (!str) {
6177 if (ctx.seen.indexOf(desc.value) < 0) {
6178 if (isNull(recurseTimes)) {
6179 str = formatValue(ctx, desc.value, null);
6180 } else {
6181 str = formatValue(ctx, desc.value, recurseTimes - 1);
6182 }
6183 if (str.indexOf('\n') > -1) {
6184 if (array) {
6185 str = str.split('\n').map(function(line) {
6186 return ' ' + line;
6187 }).join('\n').substr(2);
6188 } else {
6189 str = '\n' + str.split('\n').map(function(line) {
6190 return ' ' + line;
6191 }).join('\n');
6192 }
6193 }
6194 } else {
6195 str = ctx.stylize('[Circular]', 'special');
6196 }
6197 }
6198 if (isUndefined(name)) {
6199 if (array && key.match(/^\d+$/)) {
6200 return str;
6201 }
6202 name = JSON.stringify('' + key);
6203 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
6204 name = name.substr(1, name.length - 2);
6205 name = ctx.stylize(name, 'name');
6206 } else {
6207 name = name.replace(/'/g, "\\'")
6208 .replace(/\\"/g, '"')
6209 .replace(/(^"|"$)/g, "'");
6210 name = ctx.stylize(name, 'string');
6211 }
6212 }
6213
6214 return name + ': ' + str;
6215}
6216
6217
6218function reduceToSingleString(output, base, braces) {
6219 var numLinesEst = 0;
6220 var length = output.reduce(function(prev, cur) {
6221 numLinesEst++;
6222 if (cur.indexOf('\n') >= 0) numLinesEst++;
6223 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
6224 }, 0);
6225
6226 if (length > 60) {
6227 return braces[0] +
6228 (base === '' ? '' : base + '\n ') +
6229 ' ' +
6230 output.join(',\n ') +
6231 ' ' +
6232 braces[1];
6233 }
6234
6235 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
6236}
6237
6238
6239// NOTE: These type checking functions intentionally don't use `instanceof`
6240// because it is fragile and can be easily faked with `Object.create()`.
6241function isArray(ar) {
6242 return Array.isArray(ar);
6243}
6244exports.isArray = isArray;
6245
6246function isBoolean(arg) {
6247 return typeof arg === 'boolean';
6248}
6249exports.isBoolean = isBoolean;
6250
6251function isNull(arg) {
6252 return arg === null;
6253}
6254exports.isNull = isNull;
6255
6256function isNullOrUndefined(arg) {
6257 return arg == null;
6258}
6259exports.isNullOrUndefined = isNullOrUndefined;
6260
6261function isNumber(arg) {
6262 return typeof arg === 'number';
6263}
6264exports.isNumber = isNumber;
6265
6266function isString(arg) {
6267 return typeof arg === 'string';
6268}
6269exports.isString = isString;
6270
6271function isSymbol(arg) {
6272 return typeof arg === 'symbol';
6273}
6274exports.isSymbol = isSymbol;
6275
6276function isUndefined(arg) {
6277 return arg === void 0;
6278}
6279exports.isUndefined = isUndefined;
6280
6281function isRegExp(re) {
6282 return isObject(re) && objectToString(re) === '[object RegExp]';
6283}
6284exports.isRegExp = isRegExp;
6285
6286function isObject(arg) {
6287 return typeof arg === 'object' && arg !== null;
6288}
6289exports.isObject = isObject;
6290
6291function isDate(d) {
6292 return isObject(d) && objectToString(d) === '[object Date]';
6293}
6294exports.isDate = isDate;
6295
6296function isError(e) {
6297 return isObject(e) &&
6298 (objectToString(e) === '[object Error]' || e instanceof Error);
6299}
6300exports.isError = isError;
6301
6302function isFunction(arg) {
6303 return typeof arg === 'function';
6304}
6305exports.isFunction = isFunction;
6306
6307function isPrimitive(arg) {
6308 return arg === null ||
6309 typeof arg === 'boolean' ||
6310 typeof arg === 'number' ||
6311 typeof arg === 'string' ||
6312 typeof arg === 'symbol' || // ES6 symbol
6313 typeof arg === 'undefined';
6314}
6315exports.isPrimitive = isPrimitive;
6316
6317exports.isBuffer = require('./support/isBuffer');
6318
6319function objectToString(o) {
6320 return Object.prototype.toString.call(o);
6321}
6322
6323
6324function pad(n) {
6325 return n < 10 ? '0' + n.toString(10) : n.toString(10);
6326}
6327
6328
6329var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
6330 'Oct', 'Nov', 'Dec'];
6331
6332// 26 Feb 16:19:34
6333function timestamp() {
6334 var d = new Date();
6335 var time = [pad(d.getHours()),
6336 pad(d.getMinutes()),
6337 pad(d.getSeconds())].join(':');
6338 return [d.getDate(), months[d.getMonth()], time].join(' ');
6339}
6340
6341
6342// log is just a thin wrapper to console.log that prepends a timestamp
6343exports.log = function() {
6344 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
6345};
6346
6347
6348/**
6349 * Inherit the prototype methods from one constructor into another.
6350 *
6351 * The Function.prototype.inherits from lang.js rewritten as a standalone
6352 * function (not on Function.prototype). NOTE: If this file is to be loaded
6353 * during bootstrapping this function needs to be rewritten using some native
6354 * functions as prototype setup using normal JavaScript does not work as
6355 * expected during bootstrapping (see mirror.js in r114903).
6356 *
6357 * @param {function} ctor Constructor function which needs to inherit the
6358 * prototype.
6359 * @param {function} superCtor Constructor function to inherit prototype from.
6360 */
6361exports.inherits = require('inherits');
6362
6363exports._extend = function(origin, add) {
6364 // Don't do anything if add isn't an object
6365 if (!add || !isObject(add)) return origin;
6366
6367 var keys = Object.keys(add);
6368 var i = keys.length;
6369 while (i--) {
6370 origin[keys[i]] = add[keys[i]];
6371 }
6372 return origin;
6373};
6374
6375function hasOwnProperty(obj, prop) {
6376 return Object.prototype.hasOwnProperty.call(obj, prop);
6377}
6378
6379}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
6380},{"./support/isBuffer":32,"_process":13,"inherits":31}],34:[function(require,module,exports){
6381let bitcoin = require('bitcoinjs-lib');
6382
6383module.exports = {
6384 bitcoin
6385}
6386
6387},{"bitcoinjs-lib":52}],35:[function(require,module,exports){
6388// base-x encoding
6389// Forked from https://github.com/cryptocoinjs/bs58
6390// Originally written by Mike Hearn for BitcoinJ
6391// Copyright (c) 2011 Google Inc
6392// Ported to JavaScript by Stefan Thomas
6393// Merged Buffer refactorings from base58-native by Stephen Pair
6394// Copyright (c) 2013 BitPay Inc
6395
6396var Buffer = require('safe-buffer').Buffer
6397
6398module.exports = function base (ALPHABET) {
6399 var ALPHABET_MAP = {}
6400 var BASE = ALPHABET.length
6401 var LEADER = ALPHABET.charAt(0)
6402
6403 // pre-compute lookup table
6404 for (var z = 0; z < ALPHABET.length; z++) {
6405 var x = ALPHABET.charAt(z)
6406
6407 if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')
6408 ALPHABET_MAP[x] = z
6409 }
6410
6411 function encode (source) {
6412 if (source.length === 0) return ''
6413
6414 var digits = [0]
6415 for (var i = 0; i < source.length; ++i) {
6416 for (var j = 0, carry = source[i]; j < digits.length; ++j) {
6417 carry += digits[j] << 8
6418 digits[j] = carry % BASE
6419 carry = (carry / BASE) | 0
6420 }
6421
6422 while (carry > 0) {
6423 digits.push(carry % BASE)
6424 carry = (carry / BASE) | 0
6425 }
6426 }
6427
6428 var string = ''
6429
6430 // deal with leading zeros
6431 for (var k = 0; source[k] === 0 && k < source.length - 1; ++k) string += LEADER
6432 // convert digits to a string
6433 for (var q = digits.length - 1; q >= 0; --q) string += ALPHABET[digits[q]]
6434
6435 return string
6436 }
6437
6438 function decodeUnsafe (string) {
6439 if (typeof string !== 'string') throw new TypeError('Expected String')
6440 if (string.length === 0) return Buffer.allocUnsafe(0)
6441
6442 var bytes = [0]
6443 for (var i = 0; i < string.length; i++) {
6444 var value = ALPHABET_MAP[string[i]]
6445 if (value === undefined) return
6446
6447 for (var j = 0, carry = value; j < bytes.length; ++j) {
6448 carry += bytes[j] * BASE
6449 bytes[j] = carry & 0xff
6450 carry >>= 8
6451 }
6452
6453 while (carry > 0) {
6454 bytes.push(carry & 0xff)
6455 carry >>= 8
6456 }
6457 }
6458
6459 // deal with leading zeros
6460 for (var k = 0; string[k] === LEADER && k < string.length - 1; ++k) {
6461 bytes.push(0)
6462 }
6463
6464 return Buffer.from(bytes.reverse())
6465 }
6466
6467 function decode (string) {
6468 var buffer = decodeUnsafe(string)
6469 if (buffer) return buffer
6470
6471 throw new Error('Non-base' + BASE + ' character')
6472 }
6473
6474 return {
6475 encode: encode,
6476 decodeUnsafe: decodeUnsafe,
6477 decode: decode
6478 }
6479}
6480
6481},{"safe-buffer":101}],36:[function(require,module,exports){
6482'use strict'
6483var ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l'
6484
6485// pre-compute lookup table
6486var ALPHABET_MAP = {}
6487for (var z = 0; z < ALPHABET.length; z++) {
6488 var x = ALPHABET.charAt(z)
6489
6490 if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')
6491 ALPHABET_MAP[x] = z
6492}
6493
6494function polymodStep (pre) {
6495 var b = pre >> 25
6496 return ((pre & 0x1FFFFFF) << 5) ^
6497 (-((b >> 0) & 1) & 0x3b6a57b2) ^
6498 (-((b >> 1) & 1) & 0x26508e6d) ^
6499 (-((b >> 2) & 1) & 0x1ea119fa) ^
6500 (-((b >> 3) & 1) & 0x3d4233dd) ^
6501 (-((b >> 4) & 1) & 0x2a1462b3)
6502}
6503
6504function prefixChk (prefix) {
6505 var chk = 1
6506 for (var i = 0; i < prefix.length; ++i) {
6507 var c = prefix.charCodeAt(i)
6508 if (c < 33 || c > 126) throw new Error('Invalid prefix (' + prefix + ')')
6509
6510 chk = polymodStep(chk) ^ (c >> 5)
6511 }
6512 chk = polymodStep(chk)
6513
6514 for (i = 0; i < prefix.length; ++i) {
6515 var v = prefix.charCodeAt(i)
6516 chk = polymodStep(chk) ^ (v & 0x1f)
6517 }
6518 return chk
6519}
6520
6521function encode (prefix, words, LIMIT) {
6522 LIMIT = LIMIT || 90
6523 if ((prefix.length + 7 + words.length) > LIMIT) throw new TypeError('Exceeds length limit')
6524
6525 prefix = prefix.toLowerCase()
6526
6527 // determine chk mod
6528 var chk = prefixChk(prefix)
6529 var result = prefix + '1'
6530 for (var i = 0; i < words.length; ++i) {
6531 var x = words[i]
6532 if ((x >> 5) !== 0) throw new Error('Non 5-bit word')
6533
6534 chk = polymodStep(chk) ^ x
6535 result += ALPHABET.charAt(x)
6536 }
6537
6538 for (i = 0; i < 6; ++i) {
6539 chk = polymodStep(chk)
6540 }
6541 chk ^= 1
6542
6543 for (i = 0; i < 6; ++i) {
6544 var v = (chk >> ((5 - i) * 5)) & 0x1f
6545 result += ALPHABET.charAt(v)
6546 }
6547
6548 return result
6549}
6550
6551function decode (str, LIMIT) {
6552 LIMIT = LIMIT || 90
6553 if (str.length < 8) throw new TypeError(str + ' too short')
6554 if (str.length > LIMIT) throw new TypeError('Exceeds length limit')
6555
6556 // don't allow mixed case
6557 var lowered = str.toLowerCase()
6558 var uppered = str.toUpperCase()
6559 if (str !== lowered && str !== uppered) throw new Error('Mixed-case string ' + str)
6560 str = lowered
6561
6562 var split = str.lastIndexOf('1')
6563 if (split === -1) throw new Error('No separator character for ' + str)
6564 if (split === 0) throw new Error('Missing prefix for ' + str)
6565
6566 var prefix = str.slice(0, split)
6567 var wordChars = str.slice(split + 1)
6568 if (wordChars.length < 6) throw new Error('Data too short')
6569
6570 var chk = prefixChk(prefix)
6571 var words = []
6572 for (var i = 0; i < wordChars.length; ++i) {
6573 var c = wordChars.charAt(i)
6574 var v = ALPHABET_MAP[c]
6575 if (v === undefined) throw new Error('Unknown character ' + c)
6576 chk = polymodStep(chk) ^ v
6577
6578 // not in the checksum?
6579 if (i + 6 >= wordChars.length) continue
6580 words.push(v)
6581 }
6582
6583 if (chk !== 1) throw new Error('Invalid checksum for ' + str)
6584 return { prefix: prefix, words: words }
6585}
6586
6587function convert (data, inBits, outBits, pad) {
6588 var value = 0
6589 var bits = 0
6590 var maxV = (1 << outBits) - 1
6591
6592 var result = []
6593 for (var i = 0; i < data.length; ++i) {
6594 value = (value << inBits) | data[i]
6595 bits += inBits
6596
6597 while (bits >= outBits) {
6598 bits -= outBits
6599 result.push((value >> bits) & maxV)
6600 }
6601 }
6602
6603 if (pad) {
6604 if (bits > 0) {
6605 result.push((value << (outBits - bits)) & maxV)
6606 }
6607 } else {
6608 if (bits >= inBits) throw new Error('Excess padding')
6609 if ((value << (outBits - bits)) & maxV) throw new Error('Non-zero padding')
6610 }
6611
6612 return result
6613}
6614
6615function toWords (bytes) {
6616 return convert(bytes, 8, 5, true)
6617}
6618
6619function fromWords (words) {
6620 return convert(words, 5, 8, false)
6621}
6622
6623module.exports = {
6624 decode: decode,
6625 encode: encode,
6626 toWords: toWords,
6627 fromWords: fromWords
6628}
6629
6630},{}],37:[function(require,module,exports){
6631// (public) Constructor
6632function BigInteger(a, b, c) {
6633 if (!(this instanceof BigInteger))
6634 return new BigInteger(a, b, c)
6635
6636 if (a != null) {
6637 if ("number" == typeof a) this.fromNumber(a, b, c)
6638 else if (b == null && "string" != typeof a) this.fromString(a, 256)
6639 else this.fromString(a, b)
6640 }
6641}
6642
6643var proto = BigInteger.prototype
6644
6645// duck-typed isBigInteger
6646proto.__bigi = require('../package.json').version
6647BigInteger.isBigInteger = function (obj, check_ver) {
6648 return obj && obj.__bigi && (!check_ver || obj.__bigi === proto.__bigi)
6649}
6650
6651// Bits per digit
6652var dbits
6653
6654// am: Compute w_j += (x*this_i), propagate carries,
6655// c is initial carry, returns final carry.
6656// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
6657// We need to select the fastest one that works in this environment.
6658
6659// am1: use a single mult and divide to get the high bits,
6660// max digit bits should be 26 because
6661// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
6662function am1(i, x, w, j, c, n) {
6663 while (--n >= 0) {
6664 var v = x * this[i++] + w[j] + c
6665 c = Math.floor(v / 0x4000000)
6666 w[j++] = v & 0x3ffffff
6667 }
6668 return c
6669}
6670// am2 avoids a big mult-and-extract completely.
6671// Max digit bits should be <= 30 because we do bitwise ops
6672// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
6673function am2(i, x, w, j, c, n) {
6674 var xl = x & 0x7fff,
6675 xh = x >> 15
6676 while (--n >= 0) {
6677 var l = this[i] & 0x7fff
6678 var h = this[i++] >> 15
6679 var m = xh * l + h * xl
6680 l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)
6681 c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)
6682 w[j++] = l & 0x3fffffff
6683 }
6684 return c
6685}
6686// Alternately, set max digit bits to 28 since some
6687// browsers slow down when dealing with 32-bit numbers.
6688function am3(i, x, w, j, c, n) {
6689 var xl = x & 0x3fff,
6690 xh = x >> 14
6691 while (--n >= 0) {
6692 var l = this[i] & 0x3fff
6693 var h = this[i++] >> 14
6694 var m = xh * l + h * xl
6695 l = xl * l + ((m & 0x3fff) << 14) + w[j] + c
6696 c = (l >> 28) + (m >> 14) + xh * h
6697 w[j++] = l & 0xfffffff
6698 }
6699 return c
6700}
6701
6702// wtf?
6703BigInteger.prototype.am = am1
6704dbits = 26
6705
6706BigInteger.prototype.DB = dbits
6707BigInteger.prototype.DM = ((1 << dbits) - 1)
6708var DV = BigInteger.prototype.DV = (1 << dbits)
6709
6710var BI_FP = 52
6711BigInteger.prototype.FV = Math.pow(2, BI_FP)
6712BigInteger.prototype.F1 = BI_FP - dbits
6713BigInteger.prototype.F2 = 2 * dbits - BI_FP
6714
6715// Digit conversions
6716var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"
6717var BI_RC = new Array()
6718var rr, vv
6719rr = "0".charCodeAt(0)
6720for (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv
6721rr = "a".charCodeAt(0)
6722for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv
6723rr = "A".charCodeAt(0)
6724for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv
6725
6726function int2char(n) {
6727 return BI_RM.charAt(n)
6728}
6729
6730function intAt(s, i) {
6731 var c = BI_RC[s.charCodeAt(i)]
6732 return (c == null) ? -1 : c
6733}
6734
6735// (protected) copy this to r
6736function bnpCopyTo(r) {
6737 for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]
6738 r.t = this.t
6739 r.s = this.s
6740}
6741
6742// (protected) set from integer value x, -DV <= x < DV
6743function bnpFromInt(x) {
6744 this.t = 1
6745 this.s = (x < 0) ? -1 : 0
6746 if (x > 0) this[0] = x
6747 else if (x < -1) this[0] = x + DV
6748 else this.t = 0
6749}
6750
6751// return bigint initialized to value
6752function nbv(i) {
6753 var r = new BigInteger()
6754 r.fromInt(i)
6755 return r
6756}
6757
6758// (protected) set from string and radix
6759function bnpFromString(s, b) {
6760 var self = this
6761
6762 var k
6763 if (b == 16) k = 4
6764 else if (b == 8) k = 3
6765 else if (b == 256) k = 8; // byte array
6766 else if (b == 2) k = 1
6767 else if (b == 32) k = 5
6768 else if (b == 4) k = 2
6769 else {
6770 self.fromRadix(s, b)
6771 return
6772 }
6773 self.t = 0
6774 self.s = 0
6775 var i = s.length,
6776 mi = false,
6777 sh = 0
6778 while (--i >= 0) {
6779 var x = (k == 8) ? s[i] & 0xff : intAt(s, i)
6780 if (x < 0) {
6781 if (s.charAt(i) == "-") mi = true
6782 continue
6783 }
6784 mi = false
6785 if (sh == 0)
6786 self[self.t++] = x
6787 else if (sh + k > self.DB) {
6788 self[self.t - 1] |= (x & ((1 << (self.DB - sh)) - 1)) << sh
6789 self[self.t++] = (x >> (self.DB - sh))
6790 } else
6791 self[self.t - 1] |= x << sh
6792 sh += k
6793 if (sh >= self.DB) sh -= self.DB
6794 }
6795 if (k == 8 && (s[0] & 0x80) != 0) {
6796 self.s = -1
6797 if (sh > 0) self[self.t - 1] |= ((1 << (self.DB - sh)) - 1) << sh
6798 }
6799 self.clamp()
6800 if (mi) BigInteger.ZERO.subTo(self, self)
6801}
6802
6803// (protected) clamp off excess high words
6804function bnpClamp() {
6805 var c = this.s & this.DM
6806 while (this.t > 0 && this[this.t - 1] == c)--this.t
6807}
6808
6809// (public) return string representation in given radix
6810function bnToString(b) {
6811 var self = this
6812 if (self.s < 0) return "-" + self.negate()
6813 .toString(b)
6814 var k
6815 if (b == 16) k = 4
6816 else if (b == 8) k = 3
6817 else if (b == 2) k = 1
6818 else if (b == 32) k = 5
6819 else if (b == 4) k = 2
6820 else return self.toRadix(b)
6821 var km = (1 << k) - 1,
6822 d, m = false,
6823 r = "",
6824 i = self.t
6825 var p = self.DB - (i * self.DB) % k
6826 if (i-- > 0) {
6827 if (p < self.DB && (d = self[i] >> p) > 0) {
6828 m = true
6829 r = int2char(d)
6830 }
6831 while (i >= 0) {
6832 if (p < k) {
6833 d = (self[i] & ((1 << p) - 1)) << (k - p)
6834 d |= self[--i] >> (p += self.DB - k)
6835 } else {
6836 d = (self[i] >> (p -= k)) & km
6837 if (p <= 0) {
6838 p += self.DB
6839 --i
6840 }
6841 }
6842 if (d > 0) m = true
6843 if (m) r += int2char(d)
6844 }
6845 }
6846 return m ? r : "0"
6847}
6848
6849// (public) -this
6850function bnNegate() {
6851 var r = new BigInteger()
6852 BigInteger.ZERO.subTo(this, r)
6853 return r
6854}
6855
6856// (public) |this|
6857function bnAbs() {
6858 return (this.s < 0) ? this.negate() : this
6859}
6860
6861// (public) return + if this > a, - if this < a, 0 if equal
6862function bnCompareTo(a) {
6863 var r = this.s - a.s
6864 if (r != 0) return r
6865 var i = this.t
6866 r = i - a.t
6867 if (r != 0) return (this.s < 0) ? -r : r
6868 while (--i >= 0)
6869 if ((r = this[i] - a[i]) != 0) return r
6870 return 0
6871}
6872
6873// returns bit length of the integer x
6874function nbits(x) {
6875 var r = 1,
6876 t
6877 if ((t = x >>> 16) != 0) {
6878 x = t
6879 r += 16
6880 }
6881 if ((t = x >> 8) != 0) {
6882 x = t
6883 r += 8
6884 }
6885 if ((t = x >> 4) != 0) {
6886 x = t
6887 r += 4
6888 }
6889 if ((t = x >> 2) != 0) {
6890 x = t
6891 r += 2
6892 }
6893 if ((t = x >> 1) != 0) {
6894 x = t
6895 r += 1
6896 }
6897 return r
6898}
6899
6900// (public) return the number of bits in "this"
6901function bnBitLength() {
6902 if (this.t <= 0) return 0
6903 return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))
6904}
6905
6906// (public) return the number of bytes in "this"
6907function bnByteLength() {
6908 return this.bitLength() >> 3
6909}
6910
6911// (protected) r = this << n*DB
6912function bnpDLShiftTo(n, r) {
6913 var i
6914 for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i]
6915 for (i = n - 1; i >= 0; --i) r[i] = 0
6916 r.t = this.t + n
6917 r.s = this.s
6918}
6919
6920// (protected) r = this >> n*DB
6921function bnpDRShiftTo(n, r) {
6922 for (var i = n; i < this.t; ++i) r[i - n] = this[i]
6923 r.t = Math.max(this.t - n, 0)
6924 r.s = this.s
6925}
6926
6927// (protected) r = this << n
6928function bnpLShiftTo(n, r) {
6929 var self = this
6930 var bs = n % self.DB
6931 var cbs = self.DB - bs
6932 var bm = (1 << cbs) - 1
6933 var ds = Math.floor(n / self.DB),
6934 c = (self.s << bs) & self.DM,
6935 i
6936 for (i = self.t - 1; i >= 0; --i) {
6937 r[i + ds + 1] = (self[i] >> cbs) | c
6938 c = (self[i] & bm) << bs
6939 }
6940 for (i = ds - 1; i >= 0; --i) r[i] = 0
6941 r[ds] = c
6942 r.t = self.t + ds + 1
6943 r.s = self.s
6944 r.clamp()
6945}
6946
6947// (protected) r = this >> n
6948function bnpRShiftTo(n, r) {
6949 var self = this
6950 r.s = self.s
6951 var ds = Math.floor(n / self.DB)
6952 if (ds >= self.t) {
6953 r.t = 0
6954 return
6955 }
6956 var bs = n % self.DB
6957 var cbs = self.DB - bs
6958 var bm = (1 << bs) - 1
6959 r[0] = self[ds] >> bs
6960 for (var i = ds + 1; i < self.t; ++i) {
6961 r[i - ds - 1] |= (self[i] & bm) << cbs
6962 r[i - ds] = self[i] >> bs
6963 }
6964 if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs
6965 r.t = self.t - ds
6966 r.clamp()
6967}
6968
6969// (protected) r = this - a
6970function bnpSubTo(a, r) {
6971 var self = this
6972 var i = 0,
6973 c = 0,
6974 m = Math.min(a.t, self.t)
6975 while (i < m) {
6976 c += self[i] - a[i]
6977 r[i++] = c & self.DM
6978 c >>= self.DB
6979 }
6980 if (a.t < self.t) {
6981 c -= a.s
6982 while (i < self.t) {
6983 c += self[i]
6984 r[i++] = c & self.DM
6985 c >>= self.DB
6986 }
6987 c += self.s
6988 } else {
6989 c += self.s
6990 while (i < a.t) {
6991 c -= a[i]
6992 r[i++] = c & self.DM
6993 c >>= self.DB
6994 }
6995 c -= a.s
6996 }
6997 r.s = (c < 0) ? -1 : 0
6998 if (c < -1) r[i++] = self.DV + c
6999 else if (c > 0) r[i++] = c
7000 r.t = i
7001 r.clamp()
7002}
7003
7004// (protected) r = this * a, r != this,a (HAC 14.12)
7005// "this" should be the larger one if appropriate.
7006function bnpMultiplyTo(a, r) {
7007 var x = this.abs(),
7008 y = a.abs()
7009 var i = x.t
7010 r.t = i + y.t
7011 while (--i >= 0) r[i] = 0
7012 for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t)
7013 r.s = 0
7014 r.clamp()
7015 if (this.s != a.s) BigInteger.ZERO.subTo(r, r)
7016}
7017
7018// (protected) r = this^2, r != this (HAC 14.16)
7019function bnpSquareTo(r) {
7020 var x = this.abs()
7021 var i = r.t = 2 * x.t
7022 while (--i >= 0) r[i] = 0
7023 for (i = 0; i < x.t - 1; ++i) {
7024 var c = x.am(i, x[i], r, 2 * i, 0, 1)
7025 if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {
7026 r[i + x.t] -= x.DV
7027 r[i + x.t + 1] = 1
7028 }
7029 }
7030 if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1)
7031 r.s = 0
7032 r.clamp()
7033}
7034
7035// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
7036// r != q, this != m. q or r may be null.
7037function bnpDivRemTo(m, q, r) {
7038 var self = this
7039 var pm = m.abs()
7040 if (pm.t <= 0) return
7041 var pt = self.abs()
7042 if (pt.t < pm.t) {
7043 if (q != null) q.fromInt(0)
7044 if (r != null) self.copyTo(r)
7045 return
7046 }
7047 if (r == null) r = new BigInteger()
7048 var y = new BigInteger(),
7049 ts = self.s,
7050 ms = m.s
7051 var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus
7052 if (nsh > 0) {
7053 pm.lShiftTo(nsh, y)
7054 pt.lShiftTo(nsh, r)
7055 } else {
7056 pm.copyTo(y)
7057 pt.copyTo(r)
7058 }
7059 var ys = y.t
7060 var y0 = y[ys - 1]
7061 if (y0 == 0) return
7062 var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)
7063 var d1 = self.FV / yt,
7064 d2 = (1 << self.F1) / yt,
7065 e = 1 << self.F2
7066 var i = r.t,
7067 j = i - ys,
7068 t = (q == null) ? new BigInteger() : q
7069 y.dlShiftTo(j, t)
7070 if (r.compareTo(t) >= 0) {
7071 r[r.t++] = 1
7072 r.subTo(t, r)
7073 }
7074 BigInteger.ONE.dlShiftTo(ys, t)
7075 t.subTo(y, y); // "negative" y so we can replace sub with am later
7076 while (y.t < ys) y[y.t++] = 0
7077 while (--j >= 0) {
7078 // Estimate quotient digit
7079 var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)
7080 if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out
7081 y.dlShiftTo(j, t)
7082 r.subTo(t, r)
7083 while (r[i] < --qd) r.subTo(t, r)
7084 }
7085 }
7086 if (q != null) {
7087 r.drShiftTo(ys, q)
7088 if (ts != ms) BigInteger.ZERO.subTo(q, q)
7089 }
7090 r.t = ys
7091 r.clamp()
7092 if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder
7093 if (ts < 0) BigInteger.ZERO.subTo(r, r)
7094}
7095
7096// (public) this mod a
7097function bnMod(a) {
7098 var r = new BigInteger()
7099 this.abs()
7100 .divRemTo(a, null, r)
7101 if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)
7102 return r
7103}
7104
7105// Modular reduction using "classic" algorithm
7106function Classic(m) {
7107 this.m = m
7108}
7109
7110function cConvert(x) {
7111 if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m)
7112 else return x
7113}
7114
7115function cRevert(x) {
7116 return x
7117}
7118
7119function cReduce(x) {
7120 x.divRemTo(this.m, null, x)
7121}
7122
7123function cMulTo(x, y, r) {
7124 x.multiplyTo(y, r)
7125 this.reduce(r)
7126}
7127
7128function cSqrTo(x, r) {
7129 x.squareTo(r)
7130 this.reduce(r)
7131}
7132
7133Classic.prototype.convert = cConvert
7134Classic.prototype.revert = cRevert
7135Classic.prototype.reduce = cReduce
7136Classic.prototype.mulTo = cMulTo
7137Classic.prototype.sqrTo = cSqrTo
7138
7139// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
7140// justification:
7141// xy == 1 (mod m)
7142// xy = 1+km
7143// xy(2-xy) = (1+km)(1-km)
7144// x[y(2-xy)] = 1-k^2m^2
7145// x[y(2-xy)] == 1 (mod m^2)
7146// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
7147// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
7148// JS multiply "overflows" differently from C/C++, so care is needed here.
7149function bnpInvDigit() {
7150 if (this.t < 1) return 0
7151 var x = this[0]
7152 if ((x & 1) == 0) return 0
7153 var y = x & 3; // y == 1/x mod 2^2
7154 y = (y * (2 - (x & 0xf) * y)) & 0xf; // y == 1/x mod 2^4
7155 y = (y * (2 - (x & 0xff) * y)) & 0xff; // y == 1/x mod 2^8
7156 y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff; // y == 1/x mod 2^16
7157 // last step - calculate inverse mod DV directly
7158 // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
7159 y = (y * (2 - x * y % this.DV)) % this.DV; // y == 1/x mod 2^dbits
7160 // we really want the negative inverse, and -DV < y < DV
7161 return (y > 0) ? this.DV - y : -y
7162}
7163
7164// Montgomery reduction
7165function Montgomery(m) {
7166 this.m = m
7167 this.mp = m.invDigit()
7168 this.mpl = this.mp & 0x7fff
7169 this.mph = this.mp >> 15
7170 this.um = (1 << (m.DB - 15)) - 1
7171 this.mt2 = 2 * m.t
7172}
7173
7174// xR mod m
7175function montConvert(x) {
7176 var r = new BigInteger()
7177 x.abs()
7178 .dlShiftTo(this.m.t, r)
7179 r.divRemTo(this.m, null, r)
7180 if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r)
7181 return r
7182}
7183
7184// x/R mod m
7185function montRevert(x) {
7186 var r = new BigInteger()
7187 x.copyTo(r)
7188 this.reduce(r)
7189 return r
7190}
7191
7192// x = x/R mod m (HAC 14.32)
7193function montReduce(x) {
7194 while (x.t <= this.mt2) // pad x so am has enough room later
7195 x[x.t++] = 0
7196 for (var i = 0; i < this.m.t; ++i) {
7197 // faster way of calculating u0 = x[i]*mp mod DV
7198 var j = x[i] & 0x7fff
7199 var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM
7200 // use am to combine the multiply-shift-add into one call
7201 j = i + this.m.t
7202 x[j] += this.m.am(0, u0, x, i, 0, this.m.t)
7203 // propagate carry
7204 while (x[j] >= x.DV) {
7205 x[j] -= x.DV
7206 x[++j]++
7207 }
7208 }
7209 x.clamp()
7210 x.drShiftTo(this.m.t, x)
7211 if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)
7212}
7213
7214// r = "x^2/R mod m"; x != r
7215function montSqrTo(x, r) {
7216 x.squareTo(r)
7217 this.reduce(r)
7218}
7219
7220// r = "xy/R mod m"; x,y != r
7221function montMulTo(x, y, r) {
7222 x.multiplyTo(y, r)
7223 this.reduce(r)
7224}
7225
7226Montgomery.prototype.convert = montConvert
7227Montgomery.prototype.revert = montRevert
7228Montgomery.prototype.reduce = montReduce
7229Montgomery.prototype.mulTo = montMulTo
7230Montgomery.prototype.sqrTo = montSqrTo
7231
7232// (protected) true iff this is even
7233function bnpIsEven() {
7234 return ((this.t > 0) ? (this[0] & 1) : this.s) == 0
7235}
7236
7237// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
7238function bnpExp(e, z) {
7239 if (e > 0xffffffff || e < 1) return BigInteger.ONE
7240 var r = new BigInteger(),
7241 r2 = new BigInteger(),
7242 g = z.convert(this),
7243 i = nbits(e) - 1
7244 g.copyTo(r)
7245 while (--i >= 0) {
7246 z.sqrTo(r, r2)
7247 if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)
7248 else {
7249 var t = r
7250 r = r2
7251 r2 = t
7252 }
7253 }
7254 return z.revert(r)
7255}
7256
7257// (public) this^e % m, 0 <= e < 2^32
7258function bnModPowInt(e, m) {
7259 var z
7260 if (e < 256 || m.isEven()) z = new Classic(m)
7261 else z = new Montgomery(m)
7262 return this.exp(e, z)
7263}
7264
7265// protected
7266proto.copyTo = bnpCopyTo
7267proto.fromInt = bnpFromInt
7268proto.fromString = bnpFromString
7269proto.clamp = bnpClamp
7270proto.dlShiftTo = bnpDLShiftTo
7271proto.drShiftTo = bnpDRShiftTo
7272proto.lShiftTo = bnpLShiftTo
7273proto.rShiftTo = bnpRShiftTo
7274proto.subTo = bnpSubTo
7275proto.multiplyTo = bnpMultiplyTo
7276proto.squareTo = bnpSquareTo
7277proto.divRemTo = bnpDivRemTo
7278proto.invDigit = bnpInvDigit
7279proto.isEven = bnpIsEven
7280proto.exp = bnpExp
7281
7282// public
7283proto.toString = bnToString
7284proto.negate = bnNegate
7285proto.abs = bnAbs
7286proto.compareTo = bnCompareTo
7287proto.bitLength = bnBitLength
7288proto.byteLength = bnByteLength
7289proto.mod = bnMod
7290proto.modPowInt = bnModPowInt
7291
7292// (public)
7293function bnClone() {
7294 var r = new BigInteger()
7295 this.copyTo(r)
7296 return r
7297}
7298
7299// (public) return value as integer
7300function bnIntValue() {
7301 if (this.s < 0) {
7302 if (this.t == 1) return this[0] - this.DV
7303 else if (this.t == 0) return -1
7304 } else if (this.t == 1) return this[0]
7305 else if (this.t == 0) return 0
7306 // assumes 16 < DB < 32
7307 return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]
7308}
7309
7310// (public) return value as byte
7311function bnByteValue() {
7312 return (this.t == 0) ? this.s : (this[0] << 24) >> 24
7313}
7314
7315// (public) return value as short (assumes DB>=16)
7316function bnShortValue() {
7317 return (this.t == 0) ? this.s : (this[0] << 16) >> 16
7318}
7319
7320// (protected) return x s.t. r^x < DV
7321function bnpChunkSize(r) {
7322 return Math.floor(Math.LN2 * this.DB / Math.log(r))
7323}
7324
7325// (public) 0 if this == 0, 1 if this > 0
7326function bnSigNum() {
7327 if (this.s < 0) return -1
7328 else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0
7329 else return 1
7330}
7331
7332// (protected) convert to radix string
7333function bnpToRadix(b) {
7334 if (b == null) b = 10
7335 if (this.signum() == 0 || b < 2 || b > 36) return "0"
7336 var cs = this.chunkSize(b)
7337 var a = Math.pow(b, cs)
7338 var d = nbv(a),
7339 y = new BigInteger(),
7340 z = new BigInteger(),
7341 r = ""
7342 this.divRemTo(d, y, z)
7343 while (y.signum() > 0) {
7344 r = (a + z.intValue())
7345 .toString(b)
7346 .substr(1) + r
7347 y.divRemTo(d, y, z)
7348 }
7349 return z.intValue()
7350 .toString(b) + r
7351}
7352
7353// (protected) convert from radix string
7354function bnpFromRadix(s, b) {
7355 var self = this
7356 self.fromInt(0)
7357 if (b == null) b = 10
7358 var cs = self.chunkSize(b)
7359 var d = Math.pow(b, cs),
7360 mi = false,
7361 j = 0,
7362 w = 0
7363 for (var i = 0; i < s.length; ++i) {
7364 var x = intAt(s, i)
7365 if (x < 0) {
7366 if (s.charAt(i) == "-" && self.signum() == 0) mi = true
7367 continue
7368 }
7369 w = b * w + x
7370 if (++j >= cs) {
7371 self.dMultiply(d)
7372 self.dAddOffset(w, 0)
7373 j = 0
7374 w = 0
7375 }
7376 }
7377 if (j > 0) {
7378 self.dMultiply(Math.pow(b, j))
7379 self.dAddOffset(w, 0)
7380 }
7381 if (mi) BigInteger.ZERO.subTo(self, self)
7382}
7383
7384// (protected) alternate constructor
7385function bnpFromNumber(a, b, c) {
7386 var self = this
7387 if ("number" == typeof b) {
7388 // new BigInteger(int,int,RNG)
7389 if (a < 2) self.fromInt(1)
7390 else {
7391 self.fromNumber(a, c)
7392 if (!self.testBit(a - 1)) // force MSB set
7393 self.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, self)
7394 if (self.isEven()) self.dAddOffset(1, 0); // force odd
7395 while (!self.isProbablePrime(b)) {
7396 self.dAddOffset(2, 0)
7397 if (self.bitLength() > a) self.subTo(BigInteger.ONE.shiftLeft(a - 1), self)
7398 }
7399 }
7400 } else {
7401 // new BigInteger(int,RNG)
7402 var x = new Array(),
7403 t = a & 7
7404 x.length = (a >> 3) + 1
7405 b.nextBytes(x)
7406 if (t > 0) x[0] &= ((1 << t) - 1)
7407 else x[0] = 0
7408 self.fromString(x, 256)
7409 }
7410}
7411
7412// (public) convert to bigendian byte array
7413function bnToByteArray() {
7414 var self = this
7415 var i = self.t,
7416 r = new Array()
7417 r[0] = self.s
7418 var p = self.DB - (i * self.DB) % 8,
7419 d, k = 0
7420 if (i-- > 0) {
7421 if (p < self.DB && (d = self[i] >> p) != (self.s & self.DM) >> p)
7422 r[k++] = d | (self.s << (self.DB - p))
7423 while (i >= 0) {
7424 if (p < 8) {
7425 d = (self[i] & ((1 << p) - 1)) << (8 - p)
7426 d |= self[--i] >> (p += self.DB - 8)
7427 } else {
7428 d = (self[i] >> (p -= 8)) & 0xff
7429 if (p <= 0) {
7430 p += self.DB
7431 --i
7432 }
7433 }
7434 if ((d & 0x80) != 0) d |= -256
7435 if (k === 0 && (self.s & 0x80) != (d & 0x80))++k
7436 if (k > 0 || d != self.s) r[k++] = d
7437 }
7438 }
7439 return r
7440}
7441
7442function bnEquals(a) {
7443 return (this.compareTo(a) == 0)
7444}
7445
7446function bnMin(a) {
7447 return (this.compareTo(a) < 0) ? this : a
7448}
7449
7450function bnMax(a) {
7451 return (this.compareTo(a) > 0) ? this : a
7452}
7453
7454// (protected) r = this op a (bitwise)
7455function bnpBitwiseTo(a, op, r) {
7456 var self = this
7457 var i, f, m = Math.min(a.t, self.t)
7458 for (i = 0; i < m; ++i) r[i] = op(self[i], a[i])
7459 if (a.t < self.t) {
7460 f = a.s & self.DM
7461 for (i = m; i < self.t; ++i) r[i] = op(self[i], f)
7462 r.t = self.t
7463 } else {
7464 f = self.s & self.DM
7465 for (i = m; i < a.t; ++i) r[i] = op(f, a[i])
7466 r.t = a.t
7467 }
7468 r.s = op(self.s, a.s)
7469 r.clamp()
7470}
7471
7472// (public) this & a
7473function op_and(x, y) {
7474 return x & y
7475}
7476
7477function bnAnd(a) {
7478 var r = new BigInteger()
7479 this.bitwiseTo(a, op_and, r)
7480 return r
7481}
7482
7483// (public) this | a
7484function op_or(x, y) {
7485 return x | y
7486}
7487
7488function bnOr(a) {
7489 var r = new BigInteger()
7490 this.bitwiseTo(a, op_or, r)
7491 return r
7492}
7493
7494// (public) this ^ a
7495function op_xor(x, y) {
7496 return x ^ y
7497}
7498
7499function bnXor(a) {
7500 var r = new BigInteger()
7501 this.bitwiseTo(a, op_xor, r)
7502 return r
7503}
7504
7505// (public) this & ~a
7506function op_andnot(x, y) {
7507 return x & ~y
7508}
7509
7510function bnAndNot(a) {
7511 var r = new BigInteger()
7512 this.bitwiseTo(a, op_andnot, r)
7513 return r
7514}
7515
7516// (public) ~this
7517function bnNot() {
7518 var r = new BigInteger()
7519 for (var i = 0; i < this.t; ++i) r[i] = this.DM & ~this[i]
7520 r.t = this.t
7521 r.s = ~this.s
7522 return r
7523}
7524
7525// (public) this << n
7526function bnShiftLeft(n) {
7527 var r = new BigInteger()
7528 if (n < 0) this.rShiftTo(-n, r)
7529 else this.lShiftTo(n, r)
7530 return r
7531}
7532
7533// (public) this >> n
7534function bnShiftRight(n) {
7535 var r = new BigInteger()
7536 if (n < 0) this.lShiftTo(-n, r)
7537 else this.rShiftTo(n, r)
7538 return r
7539}
7540
7541// return index of lowest 1-bit in x, x < 2^31
7542function lbit(x) {
7543 if (x == 0) return -1
7544 var r = 0
7545 if ((x & 0xffff) == 0) {
7546 x >>= 16
7547 r += 16
7548 }
7549 if ((x & 0xff) == 0) {
7550 x >>= 8
7551 r += 8
7552 }
7553 if ((x & 0xf) == 0) {
7554 x >>= 4
7555 r += 4
7556 }
7557 if ((x & 3) == 0) {
7558 x >>= 2
7559 r += 2
7560 }
7561 if ((x & 1) == 0)++r
7562 return r
7563}
7564
7565// (public) returns index of lowest 1-bit (or -1 if none)
7566function bnGetLowestSetBit() {
7567 for (var i = 0; i < this.t; ++i)
7568 if (this[i] != 0) return i * this.DB + lbit(this[i])
7569 if (this.s < 0) return this.t * this.DB
7570 return -1
7571}
7572
7573// return number of 1 bits in x
7574function cbit(x) {
7575 var r = 0
7576 while (x != 0) {
7577 x &= x - 1
7578 ++r
7579 }
7580 return r
7581}
7582
7583// (public) return number of set bits
7584function bnBitCount() {
7585 var r = 0,
7586 x = this.s & this.DM
7587 for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)
7588 return r
7589}
7590
7591// (public) true iff nth bit is set
7592function bnTestBit(n) {
7593 var j = Math.floor(n / this.DB)
7594 if (j >= this.t) return (this.s != 0)
7595 return ((this[j] & (1 << (n % this.DB))) != 0)
7596}
7597
7598// (protected) this op (1<<n)
7599function bnpChangeBit(n, op) {
7600 var r = BigInteger.ONE.shiftLeft(n)
7601 this.bitwiseTo(r, op, r)
7602 return r
7603}
7604
7605// (public) this | (1<<n)
7606function bnSetBit(n) {
7607 return this.changeBit(n, op_or)
7608}
7609
7610// (public) this & ~(1<<n)
7611function bnClearBit(n) {
7612 return this.changeBit(n, op_andnot)
7613}
7614
7615// (public) this ^ (1<<n)
7616function bnFlipBit(n) {
7617 return this.changeBit(n, op_xor)
7618}
7619
7620// (protected) r = this + a
7621function bnpAddTo(a, r) {
7622 var self = this
7623
7624 var i = 0,
7625 c = 0,
7626 m = Math.min(a.t, self.t)
7627 while (i < m) {
7628 c += self[i] + a[i]
7629 r[i++] = c & self.DM
7630 c >>= self.DB
7631 }
7632 if (a.t < self.t) {
7633 c += a.s
7634 while (i < self.t) {
7635 c += self[i]
7636 r[i++] = c & self.DM
7637 c >>= self.DB
7638 }
7639 c += self.s
7640 } else {
7641 c += self.s
7642 while (i < a.t) {
7643 c += a[i]
7644 r[i++] = c & self.DM
7645 c >>= self.DB
7646 }
7647 c += a.s
7648 }
7649 r.s = (c < 0) ? -1 : 0
7650 if (c > 0) r[i++] = c
7651 else if (c < -1) r[i++] = self.DV + c
7652 r.t = i
7653 r.clamp()
7654}
7655
7656// (public) this + a
7657function bnAdd(a) {
7658 var r = new BigInteger()
7659 this.addTo(a, r)
7660 return r
7661}
7662
7663// (public) this - a
7664function bnSubtract(a) {
7665 var r = new BigInteger()
7666 this.subTo(a, r)
7667 return r
7668}
7669
7670// (public) this * a
7671function bnMultiply(a) {
7672 var r = new BigInteger()
7673 this.multiplyTo(a, r)
7674 return r
7675}
7676
7677// (public) this^2
7678function bnSquare() {
7679 var r = new BigInteger()
7680 this.squareTo(r)
7681 return r
7682}
7683
7684// (public) this / a
7685function bnDivide(a) {
7686 var r = new BigInteger()
7687 this.divRemTo(a, r, null)
7688 return r
7689}
7690
7691// (public) this % a
7692function bnRemainder(a) {
7693 var r = new BigInteger()
7694 this.divRemTo(a, null, r)
7695 return r
7696}
7697
7698// (public) [this/a,this%a]
7699function bnDivideAndRemainder(a) {
7700 var q = new BigInteger(),
7701 r = new BigInteger()
7702 this.divRemTo(a, q, r)
7703 return new Array(q, r)
7704}
7705
7706// (protected) this *= n, this >= 0, 1 < n < DV
7707function bnpDMultiply(n) {
7708 this[this.t] = this.am(0, n - 1, this, 0, 0, this.t)
7709 ++this.t
7710 this.clamp()
7711}
7712
7713// (protected) this += n << w words, this >= 0
7714function bnpDAddOffset(n, w) {
7715 if (n == 0) return
7716 while (this.t <= w) this[this.t++] = 0
7717 this[w] += n
7718 while (this[w] >= this.DV) {
7719 this[w] -= this.DV
7720 if (++w >= this.t) this[this.t++] = 0
7721 ++this[w]
7722 }
7723}
7724
7725// A "null" reducer
7726function NullExp() {}
7727
7728function nNop(x) {
7729 return x
7730}
7731
7732function nMulTo(x, y, r) {
7733 x.multiplyTo(y, r)
7734}
7735
7736function nSqrTo(x, r) {
7737 x.squareTo(r)
7738}
7739
7740NullExp.prototype.convert = nNop
7741NullExp.prototype.revert = nNop
7742NullExp.prototype.mulTo = nMulTo
7743NullExp.prototype.sqrTo = nSqrTo
7744
7745// (public) this^e
7746function bnPow(e) {
7747 return this.exp(e, new NullExp())
7748}
7749
7750// (protected) r = lower n words of "this * a", a.t <= n
7751// "this" should be the larger one if appropriate.
7752function bnpMultiplyLowerTo(a, n, r) {
7753 var i = Math.min(this.t + a.t, n)
7754 r.s = 0; // assumes a,this >= 0
7755 r.t = i
7756 while (i > 0) r[--i] = 0
7757 var j
7758 for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.am(0, a[i], r, i, 0, this.t)
7759 for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a[i], r, i, 0, n - i)
7760 r.clamp()
7761}
7762
7763// (protected) r = "this * a" without lower n words, n > 0
7764// "this" should be the larger one if appropriate.
7765function bnpMultiplyUpperTo(a, n, r) {
7766 --n
7767 var i = r.t = this.t + a.t - n
7768 r.s = 0; // assumes a,this >= 0
7769 while (--i >= 0) r[i] = 0
7770 for (i = Math.max(n - this.t, 0); i < a.t; ++i)
7771 r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n)
7772 r.clamp()
7773 r.drShiftTo(1, r)
7774}
7775
7776// Barrett modular reduction
7777function Barrett(m) {
7778 // setup Barrett
7779 this.r2 = new BigInteger()
7780 this.q3 = new BigInteger()
7781 BigInteger.ONE.dlShiftTo(2 * m.t, this.r2)
7782 this.mu = this.r2.divide(m)
7783 this.m = m
7784}
7785
7786function barrettConvert(x) {
7787 if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m)
7788 else if (x.compareTo(this.m) < 0) return x
7789 else {
7790 var r = new BigInteger()
7791 x.copyTo(r)
7792 this.reduce(r)
7793 return r
7794 }
7795}
7796
7797function barrettRevert(x) {
7798 return x
7799}
7800
7801// x = x mod m (HAC 14.42)
7802function barrettReduce(x) {
7803 var self = this
7804 x.drShiftTo(self.m.t - 1, self.r2)
7805 if (x.t > self.m.t + 1) {
7806 x.t = self.m.t + 1
7807 x.clamp()
7808 }
7809 self.mu.multiplyUpperTo(self.r2, self.m.t + 1, self.q3)
7810 self.m.multiplyLowerTo(self.q3, self.m.t + 1, self.r2)
7811 while (x.compareTo(self.r2) < 0) x.dAddOffset(1, self.m.t + 1)
7812 x.subTo(self.r2, x)
7813 while (x.compareTo(self.m) >= 0) x.subTo(self.m, x)
7814}
7815
7816// r = x^2 mod m; x != r
7817function barrettSqrTo(x, r) {
7818 x.squareTo(r)
7819 this.reduce(r)
7820}
7821
7822// r = x*y mod m; x,y != r
7823function barrettMulTo(x, y, r) {
7824 x.multiplyTo(y, r)
7825 this.reduce(r)
7826}
7827
7828Barrett.prototype.convert = barrettConvert
7829Barrett.prototype.revert = barrettRevert
7830Barrett.prototype.reduce = barrettReduce
7831Barrett.prototype.mulTo = barrettMulTo
7832Barrett.prototype.sqrTo = barrettSqrTo
7833
7834// (public) this^e % m (HAC 14.85)
7835function bnModPow(e, m) {
7836 var i = e.bitLength(),
7837 k, r = nbv(1),
7838 z
7839 if (i <= 0) return r
7840 else if (i < 18) k = 1
7841 else if (i < 48) k = 3
7842 else if (i < 144) k = 4
7843 else if (i < 768) k = 5
7844 else k = 6
7845 if (i < 8)
7846 z = new Classic(m)
7847 else if (m.isEven())
7848 z = new Barrett(m)
7849 else
7850 z = new Montgomery(m)
7851
7852 // precomputation
7853 var g = new Array(),
7854 n = 3,
7855 k1 = k - 1,
7856 km = (1 << k) - 1
7857 g[1] = z.convert(this)
7858 if (k > 1) {
7859 var g2 = new BigInteger()
7860 z.sqrTo(g[1], g2)
7861 while (n <= km) {
7862 g[n] = new BigInteger()
7863 z.mulTo(g2, g[n - 2], g[n])
7864 n += 2
7865 }
7866 }
7867
7868 var j = e.t - 1,
7869 w, is1 = true,
7870 r2 = new BigInteger(),
7871 t
7872 i = nbits(e[j]) - 1
7873 while (j >= 0) {
7874 if (i >= k1) w = (e[j] >> (i - k1)) & km
7875 else {
7876 w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)
7877 if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)
7878 }
7879
7880 n = k
7881 while ((w & 1) == 0) {
7882 w >>= 1
7883 --n
7884 }
7885 if ((i -= n) < 0) {
7886 i += this.DB
7887 --j
7888 }
7889 if (is1) { // ret == 1, don't bother squaring or multiplying it
7890 g[w].copyTo(r)
7891 is1 = false
7892 } else {
7893 while (n > 1) {
7894 z.sqrTo(r, r2)
7895 z.sqrTo(r2, r)
7896 n -= 2
7897 }
7898 if (n > 0) z.sqrTo(r, r2)
7899 else {
7900 t = r
7901 r = r2
7902 r2 = t
7903 }
7904 z.mulTo(r2, g[w], r)
7905 }
7906
7907 while (j >= 0 && (e[j] & (1 << i)) == 0) {
7908 z.sqrTo(r, r2)
7909 t = r
7910 r = r2
7911 r2 = t
7912 if (--i < 0) {
7913 i = this.DB - 1
7914 --j
7915 }
7916 }
7917 }
7918 return z.revert(r)
7919}
7920
7921// (public) gcd(this,a) (HAC 14.54)
7922function bnGCD(a) {
7923 var x = (this.s < 0) ? this.negate() : this.clone()
7924 var y = (a.s < 0) ? a.negate() : a.clone()
7925 if (x.compareTo(y) < 0) {
7926 var t = x
7927 x = y
7928 y = t
7929 }
7930 var i = x.getLowestSetBit(),
7931 g = y.getLowestSetBit()
7932 if (g < 0) return x
7933 if (i < g) g = i
7934 if (g > 0) {
7935 x.rShiftTo(g, x)
7936 y.rShiftTo(g, y)
7937 }
7938 while (x.signum() > 0) {
7939 if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)
7940 if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)
7941 if (x.compareTo(y) >= 0) {
7942 x.subTo(y, x)
7943 x.rShiftTo(1, x)
7944 } else {
7945 y.subTo(x, y)
7946 y.rShiftTo(1, y)
7947 }
7948 }
7949 if (g > 0) y.lShiftTo(g, y)
7950 return y
7951}
7952
7953// (protected) this % n, n < 2^26
7954function bnpModInt(n) {
7955 if (n <= 0) return 0
7956 var d = this.DV % n,
7957 r = (this.s < 0) ? n - 1 : 0
7958 if (this.t > 0)
7959 if (d == 0) r = this[0] % n
7960 else
7961 for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n
7962 return r
7963}
7964
7965// (public) 1/this % m (HAC 14.61)
7966function bnModInverse(m) {
7967 var ac = m.isEven()
7968 if (this.signum() === 0) throw new Error('division by zero')
7969 if ((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO
7970 var u = m.clone(),
7971 v = this.clone()
7972 var a = nbv(1),
7973 b = nbv(0),
7974 c = nbv(0),
7975 d = nbv(1)
7976 while (u.signum() != 0) {
7977 while (u.isEven()) {
7978 u.rShiftTo(1, u)
7979 if (ac) {
7980 if (!a.isEven() || !b.isEven()) {
7981 a.addTo(this, a)
7982 b.subTo(m, b)
7983 }
7984 a.rShiftTo(1, a)
7985 } else if (!b.isEven()) b.subTo(m, b)
7986 b.rShiftTo(1, b)
7987 }
7988 while (v.isEven()) {
7989 v.rShiftTo(1, v)
7990 if (ac) {
7991 if (!c.isEven() || !d.isEven()) {
7992 c.addTo(this, c)
7993 d.subTo(m, d)
7994 }
7995 c.rShiftTo(1, c)
7996 } else if (!d.isEven()) d.subTo(m, d)
7997 d.rShiftTo(1, d)
7998 }
7999 if (u.compareTo(v) >= 0) {
8000 u.subTo(v, u)
8001 if (ac) a.subTo(c, a)
8002 b.subTo(d, b)
8003 } else {
8004 v.subTo(u, v)
8005 if (ac) c.subTo(a, c)
8006 d.subTo(b, d)
8007 }
8008 }
8009 if (v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO
8010 while (d.compareTo(m) >= 0) d.subTo(m, d)
8011 while (d.signum() < 0) d.addTo(m, d)
8012 return d
8013}
8014
8015var lowprimes = [
8016 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
8017 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
8018 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233,
8019 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317,
8020 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419,
8021 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503,
8022 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607,
8023 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701,
8024 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811,
8025 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911,
8026 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997
8027]
8028
8029var lplim = (1 << 26) / lowprimes[lowprimes.length - 1]
8030
8031// (public) test primality with certainty >= 1-.5^t
8032function bnIsProbablePrime(t) {
8033 var i, x = this.abs()
8034 if (x.t == 1 && x[0] <= lowprimes[lowprimes.length - 1]) {
8035 for (i = 0; i < lowprimes.length; ++i)
8036 if (x[0] == lowprimes[i]) return true
8037 return false
8038 }
8039 if (x.isEven()) return false
8040 i = 1
8041 while (i < lowprimes.length) {
8042 var m = lowprimes[i],
8043 j = i + 1
8044 while (j < lowprimes.length && m < lplim) m *= lowprimes[j++]
8045 m = x.modInt(m)
8046 while (i < j) if (m % lowprimes[i++] == 0) return false
8047 }
8048 return x.millerRabin(t)
8049}
8050
8051// (protected) true if probably prime (HAC 4.24, Miller-Rabin)
8052function bnpMillerRabin(t) {
8053 var n1 = this.subtract(BigInteger.ONE)
8054 var k = n1.getLowestSetBit()
8055 if (k <= 0) return false
8056 var r = n1.shiftRight(k)
8057 t = (t + 1) >> 1
8058 if (t > lowprimes.length) t = lowprimes.length
8059 var a = new BigInteger(null)
8060 var j, bases = []
8061 for (var i = 0; i < t; ++i) {
8062 for (;;) {
8063 j = lowprimes[Math.floor(Math.random() * lowprimes.length)]
8064 if (bases.indexOf(j) == -1) break
8065 }
8066 bases.push(j)
8067 a.fromInt(j)
8068 var y = a.modPow(r, this)
8069 if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
8070 var j = 1
8071 while (j++ < k && y.compareTo(n1) != 0) {
8072 y = y.modPowInt(2, this)
8073 if (y.compareTo(BigInteger.ONE) == 0) return false
8074 }
8075 if (y.compareTo(n1) != 0) return false
8076 }
8077 }
8078 return true
8079}
8080
8081// protected
8082proto.chunkSize = bnpChunkSize
8083proto.toRadix = bnpToRadix
8084proto.fromRadix = bnpFromRadix
8085proto.fromNumber = bnpFromNumber
8086proto.bitwiseTo = bnpBitwiseTo
8087proto.changeBit = bnpChangeBit
8088proto.addTo = bnpAddTo
8089proto.dMultiply = bnpDMultiply
8090proto.dAddOffset = bnpDAddOffset
8091proto.multiplyLowerTo = bnpMultiplyLowerTo
8092proto.multiplyUpperTo = bnpMultiplyUpperTo
8093proto.modInt = bnpModInt
8094proto.millerRabin = bnpMillerRabin
8095
8096// public
8097proto.clone = bnClone
8098proto.intValue = bnIntValue
8099proto.byteValue = bnByteValue
8100proto.shortValue = bnShortValue
8101proto.signum = bnSigNum
8102proto.toByteArray = bnToByteArray
8103proto.equals = bnEquals
8104proto.min = bnMin
8105proto.max = bnMax
8106proto.and = bnAnd
8107proto.or = bnOr
8108proto.xor = bnXor
8109proto.andNot = bnAndNot
8110proto.not = bnNot
8111proto.shiftLeft = bnShiftLeft
8112proto.shiftRight = bnShiftRight
8113proto.getLowestSetBit = bnGetLowestSetBit
8114proto.bitCount = bnBitCount
8115proto.testBit = bnTestBit
8116proto.setBit = bnSetBit
8117proto.clearBit = bnClearBit
8118proto.flipBit = bnFlipBit
8119proto.add = bnAdd
8120proto.subtract = bnSubtract
8121proto.multiply = bnMultiply
8122proto.divide = bnDivide
8123proto.remainder = bnRemainder
8124proto.divideAndRemainder = bnDivideAndRemainder
8125proto.modPow = bnModPow
8126proto.modInverse = bnModInverse
8127proto.pow = bnPow
8128proto.gcd = bnGCD
8129proto.isProbablePrime = bnIsProbablePrime
8130
8131// JSBN-specific extension
8132proto.square = bnSquare
8133
8134// constants
8135BigInteger.ZERO = nbv(0)
8136BigInteger.ONE = nbv(1)
8137BigInteger.valueOf = nbv
8138
8139module.exports = BigInteger
8140
8141},{"../package.json":40}],38:[function(require,module,exports){
8142(function (Buffer){
8143// FIXME: Kind of a weird way to throw exceptions, consider removing
8144var assert = require('assert')
8145var BigInteger = require('./bigi')
8146
8147/**
8148 * Turns a byte array into a big integer.
8149 *
8150 * This function will interpret a byte array as a big integer in big
8151 * endian notation.
8152 */
8153BigInteger.fromByteArrayUnsigned = function(byteArray) {
8154 // BigInteger expects a DER integer conformant byte array
8155 if (byteArray[0] & 0x80) {
8156 return new BigInteger([0].concat(byteArray))
8157 }
8158
8159 return new BigInteger(byteArray)
8160}
8161
8162/**
8163 * Returns a byte array representation of the big integer.
8164 *
8165 * This returns the absolute of the contained value in big endian
8166 * form. A value of zero results in an empty array.
8167 */
8168BigInteger.prototype.toByteArrayUnsigned = function() {
8169 var byteArray = this.toByteArray()
8170 return byteArray[0] === 0 ? byteArray.slice(1) : byteArray
8171}
8172
8173BigInteger.fromDERInteger = function(byteArray) {
8174 return new BigInteger(byteArray)
8175}
8176
8177/*
8178 * Converts BigInteger to a DER integer representation.
8179 *
8180 * The format for this value uses the most significant bit as a sign
8181 * bit. If the most significant bit is already set and the integer is
8182 * positive, a 0x00 is prepended.
8183 *
8184 * Examples:
8185 *
8186 * 0 => 0x00
8187 * 1 => 0x01
8188 * -1 => 0xff
8189 * 127 => 0x7f
8190 * -127 => 0x81
8191 * 128 => 0x0080
8192 * -128 => 0x80
8193 * 255 => 0x00ff
8194 * -255 => 0xff01
8195 * 16300 => 0x3fac
8196 * -16300 => 0xc054
8197 * 62300 => 0x00f35c
8198 * -62300 => 0xff0ca4
8199*/
8200BigInteger.prototype.toDERInteger = BigInteger.prototype.toByteArray
8201
8202BigInteger.fromBuffer = function(buffer) {
8203 // BigInteger expects a DER integer conformant byte array
8204 if (buffer[0] & 0x80) {
8205 var byteArray = Array.prototype.slice.call(buffer)
8206
8207 return new BigInteger([0].concat(byteArray))
8208 }
8209
8210 return new BigInteger(buffer)
8211}
8212
8213BigInteger.fromHex = function(hex) {
8214 if (hex === '') return BigInteger.ZERO
8215
8216 assert.equal(hex, hex.match(/^[A-Fa-f0-9]+/), 'Invalid hex string')
8217 assert.equal(hex.length % 2, 0, 'Incomplete hex')
8218 return new BigInteger(hex, 16)
8219}
8220
8221BigInteger.prototype.toBuffer = function(size) {
8222 var byteArray = this.toByteArrayUnsigned()
8223 var zeros = []
8224
8225 var padding = size - byteArray.length
8226 while (zeros.length < padding) zeros.push(0)
8227
8228 return new Buffer(zeros.concat(byteArray))
8229}
8230
8231BigInteger.prototype.toHex = function(size) {
8232 return this.toBuffer(size).toString('hex')
8233}
8234
8235}).call(this,require("buffer").Buffer)
8236},{"./bigi":37,"assert":1,"buffer":5}],39:[function(require,module,exports){
8237var BigInteger = require('./bigi')
8238
8239//addons
8240require('./convert')
8241
8242module.exports = BigInteger
8243},{"./bigi":37,"./convert":38}],40:[function(require,module,exports){
8244module.exports={
8245 "_args": [
8246 [
8247 "bigi@^1.4.0",
8248 "/home/ian/git/bitcoin/bitcoinjs-lib-browser/node_modules/bitcoinjs-lib"
8249 ]
8250 ],
8251 "_from": "bigi@>=1.4.0 <2.0.0",
8252 "_id": "bigi@1.4.2",
8253 "_inCache": true,
8254 "_installable": true,
8255 "_location": "/bigi",
8256 "_nodeVersion": "6.1.0",
8257 "_npmOperationalInternal": {
8258 "host": "packages-12-west.internal.npmjs.com",
8259 "tmp": "tmp/bigi-1.4.2.tgz_1469584192413_0.6801238611806184"
8260 },
8261 "_npmUser": {
8262 "email": "jprichardson@gmail.com",
8263 "name": "jprichardson"
8264 },
8265 "_npmVersion": "3.8.6",
8266 "_phantomChildren": {},
8267 "_requested": {
8268 "name": "bigi",
8269 "raw": "bigi@^1.4.0",
8270 "rawSpec": "^1.4.0",
8271 "scope": null,
8272 "spec": ">=1.4.0 <2.0.0",
8273 "type": "range"
8274 },
8275 "_requiredBy": [
8276 "/bitcoinjs-lib",
8277 "/ecurve"
8278 ],
8279 "_resolved": "https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz",
8280 "_shasum": "9c665a95f88b8b08fc05cfd731f561859d725825",
8281 "_shrinkwrap": null,
8282 "_spec": "bigi@^1.4.0",
8283 "_where": "/home/ian/git/bitcoin/bitcoinjs-lib-browser/node_modules/bitcoinjs-lib",
8284 "bugs": {
8285 "url": "https://github.com/cryptocoinjs/bigi/issues"
8286 },
8287 "dependencies": {},
8288 "description": "Big integers.",
8289 "devDependencies": {
8290 "coveralls": "^2.11.2",
8291 "istanbul": "^0.3.5",
8292 "jshint": "^2.5.1",
8293 "mocha": "^2.1.0",
8294 "mochify": "^2.1.0"
8295 },
8296 "directories": {},
8297 "dist": {
8298 "shasum": "9c665a95f88b8b08fc05cfd731f561859d725825",
8299 "tarball": "https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz"
8300 },
8301 "gitHead": "c25308081c896ff84702303722bf5ecd8b3f78e3",
8302 "homepage": "https://github.com/cryptocoinjs/bigi#readme",
8303 "keywords": [
8304 "cryptography",
8305 "math",
8306 "bitcoin",
8307 "arbitrary",
8308 "precision",
8309 "arithmetic",
8310 "big",
8311 "integer",
8312 "int",
8313 "number",
8314 "biginteger",
8315 "bigint",
8316 "bignumber",
8317 "decimal",
8318 "float"
8319 ],
8320 "main": "./lib/index.js",
8321 "maintainers": [
8322 {
8323 "email": "boydb@midnightdesign.ws",
8324 "name": "midnightlightning"
8325 },
8326 {
8327 "email": "sidazhang89@gmail.com",
8328 "name": "sidazhang"
8329 },
8330 {
8331 "email": "npm@shesek.info",
8332 "name": "nadav"
8333 },
8334 {
8335 "email": "jprichardson@gmail.com",
8336 "name": "jprichardson"
8337 }
8338 ],
8339 "name": "bigi",
8340 "optionalDependencies": {},
8341 "readme": "ERROR: No README data found!",
8342 "repository": {
8343 "type": "git",
8344 "url": "git+https://github.com/cryptocoinjs/bigi.git"
8345 },
8346 "scripts": {
8347 "browser-test": "mochify --wd -R spec",
8348 "coverage": "istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js",
8349 "coveralls": "npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info",
8350 "jshint": "jshint --config jshint.json lib/*.js ; true",
8351 "test": "_mocha -- test/*.js",
8352 "unit": "mocha"
8353 },
8354 "testling": {
8355 "browsers": [
8356 "ie/9..latest",
8357 "firefox/latest",
8358 "chrome/latest",
8359 "safari/6.0..latest",
8360 "iphone/6.0..latest",
8361 "android-browser/4.2..latest"
8362 ],
8363 "files": "test/*.js",
8364 "harness": "mocha"
8365 },
8366 "version": "1.4.2"
8367}
8368
8369},{}],41:[function(require,module,exports){
8370// Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki
8371// Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]
8372// NOTE: SIGHASH byte ignored AND restricted, truncate before use
8373
8374var Buffer = require('safe-buffer').Buffer
8375
8376function check (buffer) {
8377 if (buffer.length < 8) return false
8378 if (buffer.length > 72) return false
8379 if (buffer[0] !== 0x30) return false
8380 if (buffer[1] !== buffer.length - 2) return false
8381 if (buffer[2] !== 0x02) return false
8382
8383 var lenR = buffer[3]
8384 if (lenR === 0) return false
8385 if (5 + lenR >= buffer.length) return false
8386 if (buffer[4 + lenR] !== 0x02) return false
8387
8388 var lenS = buffer[5 + lenR]
8389 if (lenS === 0) return false
8390 if ((6 + lenR + lenS) !== buffer.length) return false
8391
8392 if (buffer[4] & 0x80) return false
8393 if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false
8394
8395 if (buffer[lenR + 6] & 0x80) return false
8396 if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false
8397 return true
8398}
8399
8400function decode (buffer) {
8401 if (buffer.length < 8) throw new Error('DER sequence length is too short')
8402 if (buffer.length > 72) throw new Error('DER sequence length is too long')
8403 if (buffer[0] !== 0x30) throw new Error('Expected DER sequence')
8404 if (buffer[1] !== buffer.length - 2) throw new Error('DER sequence length is invalid')
8405 if (buffer[2] !== 0x02) throw new Error('Expected DER integer')
8406
8407 var lenR = buffer[3]
8408 if (lenR === 0) throw new Error('R length is zero')
8409 if (5 + lenR >= buffer.length) throw new Error('R length is too long')
8410 if (buffer[4 + lenR] !== 0x02) throw new Error('Expected DER integer (2)')
8411
8412 var lenS = buffer[5 + lenR]
8413 if (lenS === 0) throw new Error('S length is zero')
8414 if ((6 + lenR + lenS) !== buffer.length) throw new Error('S length is invalid')
8415
8416 if (buffer[4] & 0x80) throw new Error('R value is negative')
8417 if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) throw new Error('R value excessively padded')
8418
8419 if (buffer[lenR + 6] & 0x80) throw new Error('S value is negative')
8420 if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) throw new Error('S value excessively padded')
8421
8422 // non-BIP66 - extract R, S values
8423 return {
8424 r: buffer.slice(4, 4 + lenR),
8425 s: buffer.slice(6 + lenR)
8426 }
8427}
8428
8429/*
8430 * Expects r and s to be positive DER integers.
8431 *
8432 * The DER format uses the most significant bit as a sign bit (& 0x80).
8433 * If the significant bit is set AND the integer is positive, a 0x00 is prepended.
8434 *
8435 * Examples:
8436 *
8437 * 0 => 0x00
8438 * 1 => 0x01
8439 * -1 => 0xff
8440 * 127 => 0x7f
8441 * -127 => 0x81
8442 * 128 => 0x0080
8443 * -128 => 0x80
8444 * 255 => 0x00ff
8445 * -255 => 0xff01
8446 * 16300 => 0x3fac
8447 * -16300 => 0xc054
8448 * 62300 => 0x00f35c
8449 * -62300 => 0xff0ca4
8450*/
8451function encode (r, s) {
8452 var lenR = r.length
8453 var lenS = s.length
8454 if (lenR === 0) throw new Error('R length is zero')
8455 if (lenS === 0) throw new Error('S length is zero')
8456 if (lenR > 33) throw new Error('R length is too long')
8457 if (lenS > 33) throw new Error('S length is too long')
8458 if (r[0] & 0x80) throw new Error('R value is negative')
8459 if (s[0] & 0x80) throw new Error('S value is negative')
8460 if (lenR > 1 && (r[0] === 0x00) && !(r[1] & 0x80)) throw new Error('R value excessively padded')
8461 if (lenS > 1 && (s[0] === 0x00) && !(s[1] & 0x80)) throw new Error('S value excessively padded')
8462
8463 var signature = Buffer.allocUnsafe(6 + lenR + lenS)
8464
8465 // 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]
8466 signature[0] = 0x30
8467 signature[1] = signature.length - 2
8468 signature[2] = 0x02
8469 signature[3] = r.length
8470 r.copy(signature, 4)
8471 signature[4 + lenR] = 0x02
8472 signature[5 + lenR] = s.length
8473 s.copy(signature, 6 + lenR)
8474
8475 return signature
8476}
8477
8478module.exports = {
8479 check: check,
8480 decode: decode,
8481 encode: encode
8482}
8483
8484},{"safe-buffer":101}],42:[function(require,module,exports){
8485module.exports={
8486 "OP_FALSE": 0,
8487 "OP_0": 0,
8488 "OP_PUSHDATA1": 76,
8489 "OP_PUSHDATA2": 77,
8490 "OP_PUSHDATA4": 78,
8491 "OP_1NEGATE": 79,
8492 "OP_RESERVED": 80,
8493 "OP_TRUE": 81,
8494 "OP_1": 81,
8495 "OP_2": 82,
8496 "OP_3": 83,
8497 "OP_4": 84,
8498 "OP_5": 85,
8499 "OP_6": 86,
8500 "OP_7": 87,
8501 "OP_8": 88,
8502 "OP_9": 89,
8503 "OP_10": 90,
8504 "OP_11": 91,
8505 "OP_12": 92,
8506 "OP_13": 93,
8507 "OP_14": 94,
8508 "OP_15": 95,
8509 "OP_16": 96,
8510
8511 "OP_NOP": 97,
8512 "OP_VER": 98,
8513 "OP_IF": 99,
8514 "OP_NOTIF": 100,
8515 "OP_VERIF": 101,
8516 "OP_VERNOTIF": 102,
8517 "OP_ELSE": 103,
8518 "OP_ENDIF": 104,
8519 "OP_VERIFY": 105,
8520 "OP_RETURN": 106,
8521
8522 "OP_TOALTSTACK": 107,
8523 "OP_FROMALTSTACK": 108,
8524 "OP_2DROP": 109,
8525 "OP_2DUP": 110,
8526 "OP_3DUP": 111,
8527 "OP_2OVER": 112,
8528 "OP_2ROT": 113,
8529 "OP_2SWAP": 114,
8530 "OP_IFDUP": 115,
8531 "OP_DEPTH": 116,
8532 "OP_DROP": 117,
8533 "OP_DUP": 118,
8534 "OP_NIP": 119,
8535 "OP_OVER": 120,
8536 "OP_PICK": 121,
8537 "OP_ROLL": 122,
8538 "OP_ROT": 123,
8539 "OP_SWAP": 124,
8540 "OP_TUCK": 125,
8541
8542 "OP_CAT": 126,
8543 "OP_SUBSTR": 127,
8544 "OP_LEFT": 128,
8545 "OP_RIGHT": 129,
8546 "OP_SIZE": 130,
8547
8548 "OP_INVERT": 131,
8549 "OP_AND": 132,
8550 "OP_OR": 133,
8551 "OP_XOR": 134,
8552 "OP_EQUAL": 135,
8553 "OP_EQUALVERIFY": 136,
8554 "OP_RESERVED1": 137,
8555 "OP_RESERVED2": 138,
8556
8557 "OP_1ADD": 139,
8558 "OP_1SUB": 140,
8559 "OP_2MUL": 141,
8560 "OP_2DIV": 142,
8561 "OP_NEGATE": 143,
8562 "OP_ABS": 144,
8563 "OP_NOT": 145,
8564 "OP_0NOTEQUAL": 146,
8565 "OP_ADD": 147,
8566 "OP_SUB": 148,
8567 "OP_MUL": 149,
8568 "OP_DIV": 150,
8569 "OP_MOD": 151,
8570 "OP_LSHIFT": 152,
8571 "OP_RSHIFT": 153,
8572
8573 "OP_BOOLAND": 154,
8574 "OP_BOOLOR": 155,
8575 "OP_NUMEQUAL": 156,
8576 "OP_NUMEQUALVERIFY": 157,
8577 "OP_NUMNOTEQUAL": 158,
8578 "OP_LESSTHAN": 159,
8579 "OP_GREATERTHAN": 160,
8580 "OP_LESSTHANOREQUAL": 161,
8581 "OP_GREATERTHANOREQUAL": 162,
8582 "OP_MIN": 163,
8583 "OP_MAX": 164,
8584
8585 "OP_WITHIN": 165,
8586
8587 "OP_RIPEMD160": 166,
8588 "OP_SHA1": 167,
8589 "OP_SHA256": 168,
8590 "OP_HASH160": 169,
8591 "OP_HASH256": 170,
8592 "OP_CODESEPARATOR": 171,
8593 "OP_CHECKSIG": 172,
8594 "OP_CHECKSIGVERIFY": 173,
8595 "OP_CHECKMULTISIG": 174,
8596 "OP_CHECKMULTISIGVERIFY": 175,
8597
8598 "OP_NOP1": 176,
8599
8600 "OP_NOP2": 177,
8601 "OP_CHECKLOCKTIMEVERIFY": 177,
8602
8603 "OP_NOP3": 178,
8604 "OP_CHECKSEQUENCEVERIFY": 178,
8605
8606 "OP_NOP4": 179,
8607 "OP_NOP5": 180,
8608 "OP_NOP6": 181,
8609 "OP_NOP7": 182,
8610 "OP_NOP8": 183,
8611 "OP_NOP9": 184,
8612 "OP_NOP10": 185,
8613
8614 "OP_PUBKEYHASH": 253,
8615 "OP_PUBKEY": 254,
8616 "OP_INVALIDOPCODE": 255
8617}
8618
8619},{}],43:[function(require,module,exports){
8620var OPS = require('./index.json')
8621
8622var map = {}
8623for (var op in OPS) {
8624 var code = OPS[op]
8625 map[code] = op
8626}
8627
8628module.exports = map
8629
8630},{"./index.json":42}],44:[function(require,module,exports){
8631var Buffer = require('safe-buffer').Buffer
8632var bech32 = require('bech32')
8633var bs58check = require('bs58check')
8634var bscript = require('./script')
8635var btemplates = require('./templates')
8636var networks = require('./networks')
8637var typeforce = require('typeforce')
8638var types = require('./types')
8639
8640function fromBase58Check (address) {
8641 var payload = bs58check.decode(address)
8642
8643 // TODO: 4.0.0, move to "toOutputScript"
8644 if (payload.length < 21) throw new TypeError(address + ' is too short')
8645 if (payload.length > 21) throw new TypeError(address + ' is too long')
8646
8647 var version = payload.readUInt8(0)
8648 var hash = payload.slice(1)
8649
8650 return { version: version, hash: hash }
8651}
8652
8653function fromBech32 (address) {
8654 var result = bech32.decode(address)
8655 var data = bech32.fromWords(result.words.slice(1))
8656
8657 return {
8658 version: result.words[0],
8659 prefix: result.prefix,
8660 data: Buffer.from(data)
8661 }
8662}
8663
8664function toBase58Check (hash, version) {
8665 if (version < 256){
8666 typeforce(types.tuple(types.Hash160bit, types.UInt8), arguments)
8667
8668 var payload = Buffer.allocUnsafe(21)
8669 payload.writeUInt8(version, 0)
8670 hash.copy(payload, 1)
8671
8672 return bs58check.encode(payload)
8673 }
8674 else{
8675 typeforce(types.tuple(types.Hash160bit, types.UInt16), arguments)
8676
8677 var payload = Buffer.allocUnsafe(22)
8678 payload.writeUInt16BE(version, 0)
8679 hash.copy(payload, 2)
8680
8681 return bs58check.encode(payload)
8682 }
8683}
8684
8685function toBech32 (data, version, prefix) {
8686 var words = bech32.toWords(data)
8687 words.unshift(version)
8688
8689 return bech32.encode(prefix, words)
8690}
8691
8692function fromOutputScript (outputScript, network) {
8693 network = network || networks.bitcoin
8694
8695 if (btemplates.pubKeyHash.output.check(outputScript)) return toBase58Check(bscript.compile(outputScript).slice(3, 23), network.pubKeyHash)
8696 if (btemplates.scriptHash.output.check(outputScript)) return toBase58Check(bscript.compile(outputScript).slice(2, 22), network.scriptHash)
8697 if (btemplates.witnessPubKeyHash.output.check(outputScript)) return toBech32(bscript.compile(outputScript).slice(2, 22), 0, network.bech32)
8698 if (btemplates.witnessScriptHash.output.check(outputScript)) return toBech32(bscript.compile(outputScript).slice(2, 34), 0, network.bech32)
8699
8700 throw new Error(bscript.toASM(outputScript) + ' has no matching Address')
8701}
8702
8703function toOutputScript (address, network) {
8704 network = network || networks.bitcoin
8705
8706 var decode
8707 try {
8708 decode = fromBase58Check(address)
8709 } catch (e) {}
8710
8711 if (decode) {
8712 if (decode.version === network.pubKeyHash) return btemplates.pubKeyHash.output.encode(decode.hash)
8713 if (decode.version === network.scriptHash) return btemplates.scriptHash.output.encode(decode.hash)
8714 } else {
8715 try {
8716 decode = fromBech32(address)
8717 } catch (e) {}
8718
8719 if (decode) {
8720 if (decode.prefix !== network.bech32) throw new Error(address + ' has an invalid prefix')
8721 if (decode.version === 0) {
8722 if (decode.data.length === 20) return btemplates.witnessPubKeyHash.output.encode(decode.data)
8723 if (decode.data.length === 32) return btemplates.witnessScriptHash.output.encode(decode.data)
8724 }
8725 }
8726 }
8727
8728 throw new Error(address + ' has no matching Script')
8729}
8730
8731module.exports = {
8732 fromBase58Check: fromBase58Check,
8733 fromBech32: fromBech32,
8734 fromOutputScript: fromOutputScript,
8735 toBase58Check: toBase58Check,
8736 toBech32: toBech32,
8737 toOutputScript: toOutputScript
8738}
8739
8740},{"./networks":53,"./script":54,"./templates":56,"./types":80,"bech32":36,"bs58check":83,"safe-buffer":101,"typeforce":112}],45:[function(require,module,exports){
8741var Buffer = require('safe-buffer').Buffer
8742var bcrypto = require('./crypto')
8743var fastMerkleRoot = require('merkle-lib/fastRoot')
8744var typeforce = require('typeforce')
8745var types = require('./types')
8746var varuint = require('varuint-bitcoin')
8747
8748var Transaction = require('./transaction')
8749
8750function Block () {
8751 this.version = 1
8752 this.prevHash = null
8753 this.merkleRoot = null
8754 this.timestamp = 0
8755 this.bits = 0
8756 this.nonce = 0
8757}
8758
8759Block.fromBuffer = function (buffer) {
8760 if (buffer.length < 80) throw new Error('Buffer too small (< 80 bytes)')
8761
8762 var offset = 0
8763 function readSlice (n) {
8764 offset += n
8765 return buffer.slice(offset - n, offset)
8766 }
8767
8768 function readUInt32 () {
8769 var i = buffer.readUInt32LE(offset)
8770 offset += 4
8771 return i
8772 }
8773
8774 function readInt32 () {
8775 var i = buffer.readInt32LE(offset)
8776 offset += 4
8777 return i
8778 }
8779
8780 var block = new Block()
8781 block.version = readInt32()
8782 block.prevHash = readSlice(32)
8783 block.merkleRoot = readSlice(32)
8784 block.timestamp = readUInt32()
8785 block.bits = readUInt32()
8786 block.nonce = readUInt32()
8787
8788 if (buffer.length === 80) return block
8789
8790 function readVarInt () {
8791 var vi = varuint.decode(buffer, offset)
8792 offset += varuint.decode.bytes
8793 return vi
8794 }
8795
8796 function readTransaction () {
8797 var tx = Transaction.fromBuffer(buffer.slice(offset), true)
8798 offset += tx.byteLength()
8799 return tx
8800 }
8801
8802 var nTransactions = readVarInt()
8803 block.transactions = []
8804
8805 for (var i = 0; i < nTransactions; ++i) {
8806 var tx = readTransaction()
8807 block.transactions.push(tx)
8808 }
8809
8810 return block
8811}
8812
8813Block.prototype.byteLength = function (headersOnly) {
8814 if (headersOnly || !this.transactions) return 80
8815
8816 return 80 + varuint.encodingLength(this.transactions.length) + this.transactions.reduce(function (a, x) {
8817 return a + x.byteLength()
8818 }, 0)
8819}
8820
8821Block.fromHex = function (hex) {
8822 return Block.fromBuffer(Buffer.from(hex, 'hex'))
8823}
8824
8825Block.prototype.getHash = function () {
8826 return bcrypto.hash256(this.toBuffer(true))
8827}
8828
8829Block.prototype.getId = function () {
8830 return this.getHash().reverse().toString('hex')
8831}
8832
8833Block.prototype.getUTCDate = function () {
8834 var date = new Date(0) // epoch
8835 date.setUTCSeconds(this.timestamp)
8836
8837 return date
8838}
8839
8840// TODO: buffer, offset compatibility
8841Block.prototype.toBuffer = function (headersOnly) {
8842 var buffer = Buffer.allocUnsafe(this.byteLength(headersOnly))
8843
8844 var offset = 0
8845 function writeSlice (slice) {
8846 slice.copy(buffer, offset)
8847 offset += slice.length
8848 }
8849
8850 function writeInt32 (i) {
8851 buffer.writeInt32LE(i, offset)
8852 offset += 4
8853 }
8854 function writeUInt32 (i) {
8855 buffer.writeUInt32LE(i, offset)
8856 offset += 4
8857 }
8858
8859 writeInt32(this.version)
8860 writeSlice(this.prevHash)
8861 writeSlice(this.merkleRoot)
8862 writeUInt32(this.timestamp)
8863 writeUInt32(this.bits)
8864 writeUInt32(this.nonce)
8865
8866 if (headersOnly || !this.transactions) return buffer
8867
8868 varuint.encode(this.transactions.length, buffer, offset)
8869 offset += varuint.encode.bytes
8870
8871 this.transactions.forEach(function (tx) {
8872 var txSize = tx.byteLength() // TODO: extract from toBuffer?
8873 tx.toBuffer(buffer, offset)
8874 offset += txSize
8875 })
8876
8877 return buffer
8878}
8879
8880Block.prototype.toHex = function (headersOnly) {
8881 return this.toBuffer(headersOnly).toString('hex')
8882}
8883
8884Block.calculateTarget = function (bits) {
8885 var exponent = ((bits & 0xff000000) >> 24) - 3
8886 var mantissa = bits & 0x007fffff
8887 var target = Buffer.alloc(32, 0)
8888 target.writeUInt32BE(mantissa, 28 - exponent)
8889 return target
8890}
8891
8892Block.calculateMerkleRoot = function (transactions) {
8893 typeforce([{ getHash: types.Function }], transactions)
8894 if (transactions.length === 0) throw TypeError('Cannot compute merkle root for zero transactions')
8895
8896 var hashes = transactions.map(function (transaction) {
8897 return transaction.getHash()
8898 })
8899
8900 return fastMerkleRoot(hashes, bcrypto.hash256)
8901}
8902
8903Block.prototype.checkMerkleRoot = function () {
8904 if (!this.transactions) return false
8905
8906 var actualMerkleRoot = Block.calculateMerkleRoot(this.transactions)
8907 return this.merkleRoot.compare(actualMerkleRoot) === 0
8908}
8909
8910Block.prototype.checkProofOfWork = function () {
8911 var hash = this.getHash().reverse()
8912 var target = Block.calculateTarget(this.bits)
8913
8914 return hash.compare(target) <= 0
8915}
8916
8917module.exports = Block
8918
8919},{"./crypto":47,"./transaction":78,"./types":80,"merkle-lib/fastRoot":97,"safe-buffer":101,"typeforce":112,"varuint-bitcoin":114}],46:[function(require,module,exports){
8920var pushdata = require('pushdata-bitcoin')
8921var varuint = require('varuint-bitcoin')
8922
8923// https://github.com/feross/buffer/blob/master/index.js#L1127
8924function verifuint (value, max) {
8925 if (typeof value !== 'number') throw new Error('cannot write a non-number as a number')
8926 if (value < 0) throw new Error('specified a negative value for writing an unsigned value')
8927 if (value > max) throw new Error('RangeError: value out of range')
8928 if (Math.floor(value) !== value) throw new Error('value has a fractional component')
8929}
8930
8931function readUInt64LE (buffer, offset) {
8932 var a = buffer.readUInt32LE(offset)
8933 var b = buffer.readUInt32LE(offset + 4)
8934 b *= 0x100000000
8935
8936 verifuint(b + a, 0x001fffffffffffff)
8937
8938 return b + a
8939}
8940
8941function writeUInt64LE (buffer, value, offset) {
8942 verifuint(value, 0x001fffffffffffff)
8943
8944 buffer.writeInt32LE(value & -1, offset)
8945 buffer.writeUInt32LE(Math.floor(value / 0x100000000), offset + 4)
8946 return offset + 8
8947}
8948
8949// TODO: remove in 4.0.0?
8950function readVarInt (buffer, offset) {
8951 var result = varuint.decode(buffer, offset)
8952
8953 return {
8954 number: result,
8955 size: varuint.decode.bytes
8956 }
8957}
8958
8959// TODO: remove in 4.0.0?
8960function writeVarInt (buffer, number, offset) {
8961 varuint.encode(number, buffer, offset)
8962 return varuint.encode.bytes
8963}
8964
8965module.exports = {
8966 pushDataSize: pushdata.encodingLength,
8967 readPushDataInt: pushdata.decode,
8968 readUInt64LE: readUInt64LE,
8969 readVarInt: readVarInt,
8970 varIntBuffer: varuint.encode,
8971 varIntSize: varuint.encodingLength,
8972 writePushDataInt: pushdata.encode,
8973 writeUInt64LE: writeUInt64LE,
8974 writeVarInt: writeVarInt
8975}
8976
8977},{"pushdata-bitcoin":98,"varuint-bitcoin":114}],47:[function(require,module,exports){
8978var createHash = require('create-hash')
8979
8980function ripemd160 (buffer) {
8981 return createHash('rmd160').update(buffer).digest()
8982}
8983
8984function sha1 (buffer) {
8985 return createHash('sha1').update(buffer).digest()
8986}
8987
8988function sha256 (buffer) {
8989 return createHash('sha256').update(buffer).digest()
8990}
8991
8992function hash160 (buffer) {
8993 return ripemd160(sha256(buffer))
8994}
8995
8996function hash256 (buffer) {
8997 return sha256(sha256(buffer))
8998}
8999
9000module.exports = {
9001 hash160: hash160,
9002 hash256: hash256,
9003 ripemd160: ripemd160,
9004 sha1: sha1,
9005 sha256: sha256
9006}
9007
9008},{"create-hash":85}],48:[function(require,module,exports){
9009var Buffer = require('safe-buffer').Buffer
9010var createHmac = require('create-hmac')
9011var typeforce = require('typeforce')
9012var types = require('./types')
9013
9014var BigInteger = require('bigi')
9015var ECSignature = require('./ecsignature')
9016
9017var ZERO = Buffer.alloc(1, 0)
9018var ONE = Buffer.alloc(1, 1)
9019
9020var ecurve = require('ecurve')
9021var secp256k1 = ecurve.getCurveByName('secp256k1')
9022
9023// https://tools.ietf.org/html/rfc6979#section-3.2
9024function deterministicGenerateK (hash, x, checkSig) {
9025 typeforce(types.tuple(
9026 types.Hash256bit,
9027 types.Buffer256bit,
9028 types.Function
9029 ), arguments)
9030
9031 // Step A, ignored as hash already provided
9032 // Step B
9033 // Step C
9034 var k = Buffer.alloc(32, 0)
9035 var v = Buffer.alloc(32, 1)
9036
9037 // Step D
9038 k = createHmac('sha256', k)
9039 .update(v)
9040 .update(ZERO)
9041 .update(x)
9042 .update(hash)
9043 .digest()
9044
9045 // Step E
9046 v = createHmac('sha256', k).update(v).digest()
9047
9048 // Step F
9049 k = createHmac('sha256', k)
9050 .update(v)
9051 .update(ONE)
9052 .update(x)
9053 .update(hash)
9054 .digest()
9055
9056 // Step G
9057 v = createHmac('sha256', k).update(v).digest()
9058
9059 // Step H1/H2a, ignored as tlen === qlen (256 bit)
9060 // Step H2b
9061 v = createHmac('sha256', k).update(v).digest()
9062
9063 var T = BigInteger.fromBuffer(v)
9064
9065 // Step H3, repeat until T is within the interval [1, n - 1] and is suitable for ECDSA
9066 while (T.signum() <= 0 || T.compareTo(secp256k1.n) >= 0 || !checkSig(T)) {
9067 k = createHmac('sha256', k)
9068 .update(v)
9069 .update(ZERO)
9070 .digest()
9071
9072 v = createHmac('sha256', k).update(v).digest()
9073
9074 // Step H1/H2a, again, ignored as tlen === qlen (256 bit)
9075 // Step H2b again
9076 v = createHmac('sha256', k).update(v).digest()
9077 T = BigInteger.fromBuffer(v)
9078 }
9079
9080 return T
9081}
9082
9083var N_OVER_TWO = secp256k1.n.shiftRight(1)
9084
9085function sign (hash, d) {
9086 typeforce(types.tuple(types.Hash256bit, types.BigInt), arguments)
9087
9088 var x = d.toBuffer(32)
9089 var e = BigInteger.fromBuffer(hash)
9090 var n = secp256k1.n
9091 var G = secp256k1.G
9092
9093 var r, s
9094 deterministicGenerateK(hash, x, function (k) {
9095 var Q = G.multiply(k)
9096
9097 if (secp256k1.isInfinity(Q)) return false
9098
9099 r = Q.affineX.mod(n)
9100 if (r.signum() === 0) return false
9101
9102 s = k.modInverse(n).multiply(e.add(d.multiply(r))).mod(n)
9103 if (s.signum() === 0) return false
9104
9105 return true
9106 })
9107
9108 // enforce low S values, see bip62: 'low s values in signatures'
9109 if (s.compareTo(N_OVER_TWO) > 0) {
9110 s = n.subtract(s)
9111 }
9112
9113 return new ECSignature(r, s)
9114}
9115
9116function verify (hash, signature, Q) {
9117 typeforce(types.tuple(
9118 types.Hash256bit,
9119 types.ECSignature,
9120 types.ECPoint
9121 ), arguments)
9122
9123 var n = secp256k1.n
9124 var G = secp256k1.G
9125
9126 var r = signature.r
9127 var s = signature.s
9128
9129 // 1.4.1 Enforce r and s are both integers in the interval [1, n − 1]
9130 if (r.signum() <= 0 || r.compareTo(n) >= 0) return false
9131 if (s.signum() <= 0 || s.compareTo(n) >= 0) return false
9132
9133 // 1.4.2 H = Hash(M), already done by the user
9134 // 1.4.3 e = H
9135 var e = BigInteger.fromBuffer(hash)
9136
9137 // Compute s^-1
9138 var sInv = s.modInverse(n)
9139
9140 // 1.4.4 Compute u1 = es^−1 mod n
9141 // u2 = rs^−1 mod n
9142 var u1 = e.multiply(sInv).mod(n)
9143 var u2 = r.multiply(sInv).mod(n)
9144
9145 // 1.4.5 Compute R = (xR, yR)
9146 // R = u1G + u2Q
9147 var R = G.multiplyTwo(u1, Q, u2)
9148
9149 // 1.4.5 (cont.) Enforce R is not at infinity
9150 if (secp256k1.isInfinity(R)) return false
9151
9152 // 1.4.6 Convert the field element R.x to an integer
9153 var xR = R.affineX
9154
9155 // 1.4.7 Set v = xR mod n
9156 var v = xR.mod(n)
9157
9158 // 1.4.8 If v = r, output "valid", and if v != r, output "invalid"
9159 return v.equals(r)
9160}
9161
9162module.exports = {
9163 deterministicGenerateK: deterministicGenerateK,
9164 sign: sign,
9165 verify: verify,
9166
9167 // TODO: remove
9168 __curve: secp256k1
9169}
9170
9171},{"./ecsignature":50,"./types":80,"bigi":39,"create-hmac":88,"ecurve":92,"safe-buffer":101,"typeforce":112}],49:[function(require,module,exports){
9172var baddress = require('./address')
9173var bcrypto = require('./crypto')
9174var ecdsa = require('./ecdsa')
9175var randomBytes = require('randombytes')
9176var typeforce = require('typeforce')
9177var types = require('./types')
9178var wif = require('wif')
9179
9180var NETWORKS = require('./networks')
9181var BigInteger = require('bigi')
9182
9183var ecurve = require('ecurve')
9184var secp256k1 = ecdsa.__curve
9185
9186function ECPair (d, Q, options) {
9187 if (options) {
9188 typeforce({
9189 compressed: types.maybe(types.Boolean),
9190 network: types.maybe(types.Network)
9191 }, options)
9192 }
9193
9194 options = options || {}
9195
9196 if (d) {
9197 if (d.signum() <= 0) throw new Error('Private key must be greater than 0')
9198 if (d.compareTo(secp256k1.n) >= 0) throw new Error('Private key must be less than the curve order')
9199 if (Q) throw new TypeError('Unexpected publicKey parameter')
9200
9201 this.d = d
9202 } else {
9203 typeforce(types.ECPoint, Q)
9204
9205 this.__Q = Q
9206 }
9207
9208 this.compressed = options.compressed === undefined ? true : options.compressed
9209 this.network = options.network || NETWORKS.bitcoin
9210}
9211
9212Object.defineProperty(ECPair.prototype, 'Q', {
9213 get: function () {
9214 if (!this.__Q && this.d) {
9215 this.__Q = secp256k1.G.multiply(this.d)
9216 }
9217
9218 return this.__Q
9219 }
9220})
9221
9222ECPair.fromPublicKeyBuffer = function (buffer, network) {
9223 var Q = ecurve.Point.decodeFrom(secp256k1, buffer)
9224
9225 return new ECPair(null, Q, {
9226 compressed: Q.compressed,
9227 network: network
9228 })
9229}
9230
9231ECPair.fromWIF = function (string, network) {
9232 var decoded = wif.decode(string)
9233 var version = decoded.version
9234
9235 // list of networks?
9236 if (types.Array(network)) {
9237 network = network.filter(function (x) {
9238 return version === x.wif
9239 }).pop()
9240
9241 if (!network) throw new Error('Unknown network version')
9242
9243 // otherwise, assume a network object (or default to bitcoin)
9244 } else {
9245 network = network || NETWORKS.bitcoin
9246
9247 if (version !== network.wif) throw new Error('Invalid network version')
9248 }
9249
9250 var d = BigInteger.fromBuffer(decoded.privateKey)
9251
9252 return new ECPair(d, null, {
9253 compressed: decoded.compressed,
9254 network: network
9255 })
9256}
9257
9258ECPair.makeRandom = function (options) {
9259 options = options || {}
9260
9261 var rng = options.rng || randomBytes
9262
9263 var d
9264 do {
9265 var buffer = rng(32)
9266 typeforce(types.Buffer256bit, buffer)
9267
9268 d = BigInteger.fromBuffer(buffer)
9269 } while (d.signum() <= 0 || d.compareTo(secp256k1.n) >= 0)
9270
9271 return new ECPair(d, null, options)
9272}
9273
9274ECPair.prototype.getAddress = function () {
9275 return baddress.toBase58Check(bcrypto.hash160(this.getPublicKeyBuffer()), this.getNetwork().pubKeyHash)
9276}
9277
9278ECPair.prototype.getNetwork = function () {
9279 return this.network
9280}
9281
9282ECPair.prototype.getPublicKeyBuffer = function () {
9283 return this.Q.getEncoded(this.compressed)
9284}
9285
9286ECPair.prototype.sign = function (hash) {
9287 if (!this.d) throw new Error('Missing private key')
9288
9289 return ecdsa.sign(hash, this.d)
9290}
9291
9292ECPair.prototype.toWIF = function () {
9293 if (!this.d) throw new Error('Missing private key')
9294
9295 return wif.encode(this.network.wif, this.d.toBuffer(32), this.compressed)
9296}
9297
9298ECPair.prototype.verify = function (hash, signature) {
9299 return ecdsa.verify(hash, signature, this.Q)
9300}
9301
9302module.exports = ECPair
9303
9304},{"./address":44,"./crypto":47,"./ecdsa":48,"./networks":53,"./types":80,"bigi":39,"ecurve":92,"randombytes":99,"typeforce":112,"wif":115}],50:[function(require,module,exports){
9305(function (Buffer){
9306var bip66 = require('bip66')
9307var typeforce = require('typeforce')
9308var types = require('./types')
9309
9310var BigInteger = require('bigi')
9311
9312function ECSignature (r, s) {
9313 typeforce(types.tuple(types.BigInt, types.BigInt), arguments)
9314
9315 this.r = r
9316 this.s = s
9317}
9318
9319ECSignature.parseCompact = function (buffer) {
9320 typeforce(types.BufferN(65), buffer)
9321
9322 var flagByte = buffer.readUInt8(0) - 27
9323 if (flagByte !== (flagByte & 7)) throw new Error('Invalid signature parameter')
9324
9325 var compressed = !!(flagByte & 4)
9326 var recoveryParam = flagByte & 3
9327 var signature = ECSignature.fromRSBuffer(buffer.slice(1))
9328
9329 return {
9330 compressed: compressed,
9331 i: recoveryParam,
9332 signature: signature
9333 }
9334}
9335
9336ECSignature.fromRSBuffer = function (buffer) {
9337 typeforce(types.BufferN(64), buffer)
9338
9339 var r = BigInteger.fromBuffer(buffer.slice(0, 32))
9340 var s = BigInteger.fromBuffer(buffer.slice(32, 64))
9341 return new ECSignature(r, s)
9342}
9343
9344ECSignature.fromDER = function (buffer) {
9345 var decode = bip66.decode(buffer)
9346 var r = BigInteger.fromDERInteger(decode.r)
9347 var s = BigInteger.fromDERInteger(decode.s)
9348
9349 return new ECSignature(r, s)
9350}
9351
9352// BIP62: 1 byte hashType flag (only 0x01, 0x02, 0x03, 0x81, 0x82 and 0x83 are allowed)
9353ECSignature.parseScriptSignature = function (buffer) {
9354 var hashType = buffer.readUInt8(buffer.length - 1)
9355 var hashTypeMod = hashType & ~0x80
9356
9357 if (hashTypeMod <= 0x00 || hashTypeMod >= 0x04) throw new Error('Invalid hashType ' + hashType)
9358
9359 return {
9360 signature: ECSignature.fromDER(buffer.slice(0, -1)),
9361 hashType: hashType
9362 }
9363}
9364
9365ECSignature.prototype.toCompact = function (i, compressed) {
9366 if (compressed) {
9367 i += 4
9368 }
9369
9370 i += 27
9371
9372 var buffer = Buffer.alloc(65)
9373 buffer.writeUInt8(i, 0)
9374 this.toRSBuffer(buffer, 1)
9375 return buffer
9376}
9377
9378ECSignature.prototype.toDER = function () {
9379 var r = Buffer.from(this.r.toDERInteger())
9380 var s = Buffer.from(this.s.toDERInteger())
9381
9382 return bip66.encode(r, s)
9383}
9384
9385ECSignature.prototype.toRSBuffer = function (buffer, offset) {
9386 buffer = buffer || Buffer.alloc(64)
9387 this.r.toBuffer(32).copy(buffer, offset)
9388 this.s.toBuffer(32).copy(buffer, offset + 32)
9389 return buffer
9390}
9391
9392ECSignature.prototype.toScriptSignature = function (hashType) {
9393 var hashTypeMod = hashType & ~0x80
9394 if (hashTypeMod <= 0 || hashTypeMod >= 4) throw new Error('Invalid hashType ' + hashType)
9395
9396 var hashTypeBuffer = Buffer.alloc(1)
9397 hashTypeBuffer.writeUInt8(hashType, 0)
9398
9399 return Buffer.concat([this.toDER(), hashTypeBuffer])
9400}
9401
9402module.exports = ECSignature
9403
9404}).call(this,require("buffer").Buffer)
9405},{"./types":80,"bigi":39,"bip66":41,"buffer":5,"typeforce":112}],51:[function(require,module,exports){
9406var Buffer = require('safe-buffer').Buffer
9407var base58check = require('bs58check')
9408var bcrypto = require('./crypto')
9409var createHmac = require('create-hmac')
9410var typeforce = require('typeforce')
9411var types = require('./types')
9412var NETWORKS = require('./networks')
9413
9414var BigInteger = require('bigi')
9415var ECPair = require('./ecpair')
9416
9417var ecurve = require('ecurve')
9418var curve = ecurve.getCurveByName('secp256k1')
9419
9420function HDNode (keyPair, chainCode) {
9421 typeforce(types.tuple('ECPair', types.Buffer256bit), arguments)
9422
9423 if (!keyPair.compressed) throw new TypeError('BIP32 only allows compressed keyPairs')
9424
9425 this.keyPair = keyPair
9426 this.chainCode = chainCode
9427 this.depth = 0
9428 this.index = 0
9429 this.parentFingerprint = 0x00000000
9430}
9431
9432HDNode.HIGHEST_BIT = 0x80000000
9433HDNode.LENGTH = 78
9434HDNode.MASTER_SECRET = Buffer.from('Bitcoin seed', 'utf8')
9435
9436HDNode.fromSeedBuffer = function (seed, network) {
9437 typeforce(types.tuple(types.Buffer, types.maybe(types.Network)), arguments)
9438
9439 if (seed.length < 16) throw new TypeError('Seed should be at least 128 bits')
9440 if (seed.length > 64) throw new TypeError('Seed should be at most 512 bits')
9441
9442 var I = createHmac('sha512', HDNode.MASTER_SECRET).update(seed).digest()
9443 var IL = I.slice(0, 32)
9444 var IR = I.slice(32)
9445
9446 // In case IL is 0 or >= n, the master key is invalid
9447 // This is handled by the ECPair constructor
9448 var pIL = BigInteger.fromBuffer(IL)
9449 var keyPair = new ECPair(pIL, null, {
9450 network: network
9451 })
9452
9453 return new HDNode(keyPair, IR)
9454}
9455
9456HDNode.fromSeedHex = function (hex, network) {
9457 return HDNode.fromSeedBuffer(Buffer.from(hex, 'hex'), network)
9458}
9459
9460HDNode.fromBase58 = function (string, networks) {
9461 var buffer = base58check.decode(string)
9462 if (buffer.length !== 78) throw new Error('Invalid buffer length')
9463
9464 // 4 bytes: version bytes
9465 var version = buffer.readUInt32BE(0)
9466 var network
9467
9468 // list of networks?
9469 if (Array.isArray(networks)) {
9470 network = networks.filter(function (x) {
9471 return version === x.bip32.private ||
9472 version === x.bip32.public
9473 }).pop()
9474
9475 if (!network) throw new Error('Unknown network version')
9476
9477 // otherwise, assume a network object (or default to bitcoin)
9478 } else {
9479 network = networks || NETWORKS.bitcoin
9480 }
9481
9482 if (version !== network.bip32.private &&
9483 version !== network.bip32.public) throw new Error('Invalid network version')
9484
9485 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ...
9486 var depth = buffer[4]
9487
9488 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
9489 var parentFingerprint = buffer.readUInt32BE(5)
9490 if (depth === 0) {
9491 if (parentFingerprint !== 0x00000000) throw new Error('Invalid parent fingerprint')
9492 }
9493
9494 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
9495 // This is encoded in MSB order. (0x00000000 if master key)
9496 var index = buffer.readUInt32BE(9)
9497 if (depth === 0 && index !== 0) throw new Error('Invalid index')
9498
9499 // 32 bytes: the chain code
9500 var chainCode = buffer.slice(13, 45)
9501 var keyPair
9502
9503 // 33 bytes: private key data (0x00 + k)
9504 if (version === network.bip32.private) {
9505 if (buffer.readUInt8(45) !== 0x00) throw new Error('Invalid private key')
9506
9507 var d = BigInteger.fromBuffer(buffer.slice(46, 78))
9508 keyPair = new ECPair(d, null, { network: network })
9509
9510 // 33 bytes: public key data (0x02 + X or 0x03 + X)
9511 } else {
9512 var Q = ecurve.Point.decodeFrom(curve, buffer.slice(45, 78))
9513 // Q.compressed is assumed, if somehow this assumption is broken, `new HDNode` will throw
9514
9515 // Verify that the X coordinate in the public point corresponds to a point on the curve.
9516 // If not, the extended public key is invalid.
9517 curve.validate(Q)
9518
9519 keyPair = new ECPair(null, Q, { network: network })
9520 }
9521
9522 var hd = new HDNode(keyPair, chainCode)
9523 hd.depth = depth
9524 hd.index = index
9525 hd.parentFingerprint = parentFingerprint
9526
9527 return hd
9528}
9529
9530HDNode.prototype.getAddress = function () {
9531 return this.keyPair.getAddress()
9532}
9533
9534HDNode.prototype.getIdentifier = function () {
9535 return bcrypto.hash160(this.keyPair.getPublicKeyBuffer())
9536}
9537
9538HDNode.prototype.getFingerprint = function () {
9539 return this.getIdentifier().slice(0, 4)
9540}
9541
9542HDNode.prototype.getNetwork = function () {
9543 return this.keyPair.getNetwork()
9544}
9545
9546HDNode.prototype.getPublicKeyBuffer = function () {
9547 return this.keyPair.getPublicKeyBuffer()
9548}
9549
9550HDNode.prototype.neutered = function () {
9551 var neuteredKeyPair = new ECPair(null, this.keyPair.Q, {
9552 network: this.keyPair.network
9553 })
9554
9555 var neutered = new HDNode(neuteredKeyPair, this.chainCode)
9556 neutered.depth = this.depth
9557 neutered.index = this.index
9558 neutered.parentFingerprint = this.parentFingerprint
9559
9560 return neutered
9561}
9562
9563HDNode.prototype.sign = function (hash) {
9564 return this.keyPair.sign(hash)
9565}
9566
9567HDNode.prototype.verify = function (hash, signature) {
9568 return this.keyPair.verify(hash, signature)
9569}
9570
9571HDNode.prototype.toBase58 = function (__isPrivate) {
9572 if (__isPrivate !== undefined) throw new TypeError('Unsupported argument in 2.0.0')
9573
9574 // Version
9575 var network = this.keyPair.network
9576 var version = (!this.isNeutered()) ? network.bip32.private : network.bip32.public
9577 var buffer = Buffer.allocUnsafe(78)
9578
9579 // 4 bytes: version bytes
9580 buffer.writeUInt32BE(version, 0)
9581
9582 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ....
9583 buffer.writeUInt8(this.depth, 4)
9584
9585 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
9586 buffer.writeUInt32BE(this.parentFingerprint, 5)
9587
9588 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
9589 // This is encoded in big endian. (0x00000000 if master key)
9590 buffer.writeUInt32BE(this.index, 9)
9591
9592 // 32 bytes: the chain code
9593 this.chainCode.copy(buffer, 13)
9594
9595 // 33 bytes: the public key or private key data
9596 if (!this.isNeutered()) {
9597 // 0x00 + k for private keys
9598 buffer.writeUInt8(0, 45)
9599 this.keyPair.d.toBuffer(32).copy(buffer, 46)
9600
9601 // 33 bytes: the public key
9602 } else {
9603 // X9.62 encoding for public keys
9604 this.keyPair.getPublicKeyBuffer().copy(buffer, 45)
9605 }
9606
9607 return base58check.encode(buffer)
9608}
9609
9610// https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#child-key-derivation-ckd-functions
9611HDNode.prototype.derive = function (index) {
9612 typeforce(types.UInt32, index)
9613
9614 var isHardened = index >= HDNode.HIGHEST_BIT
9615 var data = Buffer.allocUnsafe(37)
9616
9617 // Hardened child
9618 if (isHardened) {
9619 if (this.isNeutered()) throw new TypeError('Could not derive hardened child key')
9620
9621 // data = 0x00 || ser256(kpar) || ser32(index)
9622 data[0] = 0x00
9623 this.keyPair.d.toBuffer(32).copy(data, 1)
9624 data.writeUInt32BE(index, 33)
9625
9626 // Normal child
9627 } else {
9628 // data = serP(point(kpar)) || ser32(index)
9629 // = serP(Kpar) || ser32(index)
9630 this.keyPair.getPublicKeyBuffer().copy(data, 0)
9631 data.writeUInt32BE(index, 33)
9632 }
9633
9634 var I = createHmac('sha512', this.chainCode).update(data).digest()
9635 var IL = I.slice(0, 32)
9636 var IR = I.slice(32)
9637
9638 var pIL = BigInteger.fromBuffer(IL)
9639
9640 // In case parse256(IL) >= n, proceed with the next value for i
9641 if (pIL.compareTo(curve.n) >= 0) {
9642 return this.derive(index + 1)
9643 }
9644
9645 // Private parent key -> private child key
9646 var derivedKeyPair
9647 if (!this.isNeutered()) {
9648 // ki = parse256(IL) + kpar (mod n)
9649 var ki = pIL.add(this.keyPair.d).mod(curve.n)
9650
9651 // In case ki == 0, proceed with the next value for i
9652 if (ki.signum() === 0) {
9653 return this.derive(index + 1)
9654 }
9655
9656 derivedKeyPair = new ECPair(ki, null, {
9657 network: this.keyPair.network
9658 })
9659
9660 // Public parent key -> public child key
9661 } else {
9662 // Ki = point(parse256(IL)) + Kpar
9663 // = G*IL + Kpar
9664 var Ki = curve.G.multiply(pIL).add(this.keyPair.Q)
9665
9666 // In case Ki is the point at infinity, proceed with the next value for i
9667 if (curve.isInfinity(Ki)) {
9668 return this.derive(index + 1)
9669 }
9670
9671 derivedKeyPair = new ECPair(null, Ki, {
9672 network: this.keyPair.network
9673 })
9674 }
9675
9676 var hd = new HDNode(derivedKeyPair, IR)
9677 hd.depth = this.depth + 1
9678 hd.index = index
9679 hd.parentFingerprint = this.getFingerprint().readUInt32BE(0)
9680
9681 return hd
9682}
9683
9684HDNode.prototype.deriveHardened = function (index) {
9685 typeforce(types.UInt31, index)
9686
9687 // Only derives hardened private keys by default
9688 return this.derive(index + HDNode.HIGHEST_BIT)
9689}
9690
9691// Private === not neutered
9692// Public === neutered
9693HDNode.prototype.isNeutered = function () {
9694 return !(this.keyPair.d)
9695}
9696
9697HDNode.prototype.derivePath = function (path) {
9698 typeforce(types.BIP32Path, path)
9699
9700 var splitPath = path.split('/')
9701 if (splitPath[0] === 'm') {
9702 if (this.parentFingerprint) {
9703 throw new Error('Not a master node')
9704 }
9705
9706 splitPath = splitPath.slice(1)
9707 }
9708
9709 return splitPath.reduce(function (prevHd, indexStr) {
9710 var index
9711 if (indexStr.slice(-1) === "'") {
9712 index = parseInt(indexStr.slice(0, -1), 10)
9713 return prevHd.deriveHardened(index)
9714 } else {
9715 index = parseInt(indexStr, 10)
9716 return prevHd.derive(index)
9717 }
9718 }, this)
9719}
9720
9721module.exports = HDNode
9722
9723},{"./crypto":47,"./ecpair":49,"./networks":53,"./types":80,"bigi":39,"bs58check":83,"create-hmac":88,"ecurve":92,"safe-buffer":101,"typeforce":112}],52:[function(require,module,exports){
9724var script = require('./script')
9725
9726var templates = require('./templates')
9727for (var key in templates) {
9728 script[key] = templates[key]
9729}
9730
9731module.exports = {
9732 bufferutils: require('./bufferutils'), // TODO: remove in 4.0.0
9733
9734 Block: require('./block'),
9735 ECPair: require('./ecpair'),
9736 ECSignature: require('./ecsignature'),
9737 HDNode: require('./hdnode'),
9738 Transaction: require('./transaction'),
9739 TransactionBuilder: require('./transaction_builder'),
9740
9741 address: require('./address'),
9742 crypto: require('./crypto'),
9743 networks: require('./networks'),
9744 opcodes: require('bitcoin-ops'),
9745 script: script
9746}
9747
9748},{"./address":44,"./block":45,"./bufferutils":46,"./crypto":47,"./ecpair":49,"./ecsignature":50,"./hdnode":51,"./networks":53,"./script":54,"./templates":56,"./transaction":78,"./transaction_builder":79,"bitcoin-ops":42}],53:[function(require,module,exports){
9749// https://en.bitcoin.it/wiki/List_of_address_prefixes
9750// Dogecoin BIP32 is a proposed standard: https://bitcointalk.org/index.php?topic=409731
9751
9752module.exports = {
9753 bitcoin: {
9754 messagePrefix: '\x18Bitcoin Signed Message:\n',
9755 bech32: 'bc',
9756 bip32: {
9757 public: 0x0488b21e,
9758 private: 0x0488ade4
9759 },
9760 pubKeyHash: 0x00,
9761 scriptHash: 0x05,
9762 wif: 0x80
9763 },
9764 testnet: {
9765 messagePrefix: '\x18Bitcoin Signed Message:\n',
9766 bech32: 'tb',
9767 bip32: {
9768 public: 0x043587cf,
9769 private: 0x04358394
9770 },
9771 pubKeyHash: 0x6f,
9772 scriptHash: 0xc4,
9773 wif: 0xef
9774 },
9775 litecoin: {
9776 messagePrefix: '\x19Litecoin Signed Message:\n',
9777 bip32: {
9778 public: 0x019da462,
9779 private: 0x019d9cfe
9780 },
9781 pubKeyHash: 0x30,
9782 scriptHash: 0x32,
9783 wif: 0xb0
9784 }
9785}
9786
9787},{}],54:[function(require,module,exports){
9788var Buffer = require('safe-buffer').Buffer
9789var bip66 = require('bip66')
9790var pushdata = require('pushdata-bitcoin')
9791var typeforce = require('typeforce')
9792var types = require('./types')
9793var scriptNumber = require('./script_number')
9794
9795var OPS = require('bitcoin-ops')
9796var REVERSE_OPS = require('bitcoin-ops/map')
9797var OP_INT_BASE = OPS.OP_RESERVED // OP_1 - 1
9798
9799function isOPInt (value) {
9800 return types.Number(value) &&
9801 ((value === OPS.OP_0) ||
9802 (value >= OPS.OP_1 && value <= OPS.OP_16) ||
9803 (value === OPS.OP_1NEGATE))
9804}
9805
9806function isPushOnlyChunk (value) {
9807 return types.Buffer(value) || isOPInt(value)
9808}
9809
9810function isPushOnly (value) {
9811 return types.Array(value) && value.every(isPushOnlyChunk)
9812}
9813
9814function asMinimalOP (buffer) {
9815 if (buffer.length === 0) return OPS.OP_0
9816 if (buffer.length !== 1) return
9817 if (buffer[0] >= 1 && buffer[0] <= 16) return OP_INT_BASE + buffer[0]
9818 if (buffer[0] === 0x81) return OPS.OP_1NEGATE
9819}
9820
9821function compile (chunks) {
9822 // TODO: remove me
9823 if (Buffer.isBuffer(chunks)) return chunks
9824
9825 typeforce(types.Array, chunks)
9826
9827 var bufferSize = chunks.reduce(function (accum, chunk) {
9828 // data chunk
9829 if (Buffer.isBuffer(chunk)) {
9830 // adhere to BIP62.3, minimal push policy
9831 if (chunk.length === 1 && asMinimalOP(chunk) !== undefined) {
9832 return accum + 1
9833 }
9834
9835 return accum + pushdata.encodingLength(chunk.length) + chunk.length
9836 }
9837
9838 // opcode
9839 return accum + 1
9840 }, 0.0)
9841
9842 var buffer = Buffer.allocUnsafe(bufferSize)
9843 var offset = 0
9844
9845 chunks.forEach(function (chunk) {
9846 // data chunk
9847 if (Buffer.isBuffer(chunk)) {
9848 // adhere to BIP62.3, minimal push policy
9849 var opcode = asMinimalOP(chunk)
9850 if (opcode !== undefined) {
9851 buffer.writeUInt8(opcode, offset)
9852 offset += 1
9853 return
9854 }
9855
9856 offset += pushdata.encode(buffer, chunk.length, offset)
9857 chunk.copy(buffer, offset)
9858 offset += chunk.length
9859
9860 // opcode
9861 } else {
9862 buffer.writeUInt8(chunk, offset)
9863 offset += 1
9864 }
9865 })
9866
9867 if (offset !== buffer.length) throw new Error('Could not decode chunks')
9868 return buffer
9869}
9870
9871function decompile (buffer) {
9872 // TODO: remove me
9873 if (types.Array(buffer)) return buffer
9874
9875 typeforce(types.Buffer, buffer)
9876
9877 var chunks = []
9878 var i = 0
9879
9880 while (i < buffer.length) {
9881 var opcode = buffer[i]
9882
9883 // data chunk
9884 if ((opcode > OPS.OP_0) && (opcode <= OPS.OP_PUSHDATA4)) {
9885 var d = pushdata.decode(buffer, i)
9886
9887 // did reading a pushDataInt fail? empty script
9888 if (d === null) return []
9889 i += d.size
9890
9891 // attempt to read too much data? empty script
9892 if (i + d.number > buffer.length) return []
9893
9894 var data = buffer.slice(i, i + d.number)
9895 i += d.number
9896
9897 // decompile minimally
9898 var op = asMinimalOP(data)
9899 if (op !== undefined) {
9900 chunks.push(op)
9901 } else {
9902 chunks.push(data)
9903 }
9904
9905 // opcode
9906 } else {
9907 chunks.push(opcode)
9908
9909 i += 1
9910 }
9911 }
9912
9913 return chunks
9914}
9915
9916function toASM (chunks) {
9917 if (Buffer.isBuffer(chunks)) {
9918 chunks = decompile(chunks)
9919 }
9920
9921 return chunks.map(function (chunk) {
9922 // data?
9923 if (Buffer.isBuffer(chunk)) {
9924 var op = asMinimalOP(chunk)
9925 if (op === undefined) return chunk.toString('hex')
9926 chunk = op
9927 }
9928
9929 // opcode!
9930 return REVERSE_OPS[chunk]
9931 }).join(' ')
9932}
9933
9934function fromASM (asm) {
9935 typeforce(types.String, asm)
9936
9937 return compile(asm.split(' ').map(function (chunkStr) {
9938 // opcode?
9939 if (OPS[chunkStr] !== undefined) return OPS[chunkStr]
9940 typeforce(types.Hex, chunkStr)
9941
9942 // data!
9943 return Buffer.from(chunkStr, 'hex')
9944 }))
9945}
9946
9947function toStack (chunks) {
9948 chunks = decompile(chunks)
9949 typeforce(isPushOnly, chunks)
9950
9951 return chunks.map(function (op) {
9952 if (Buffer.isBuffer(op)) return op
9953 if (op === OPS.OP_0) return Buffer.allocUnsafe(0)
9954
9955 return scriptNumber.encode(op - OP_INT_BASE)
9956 })
9957}
9958
9959function isCanonicalPubKey (buffer) {
9960 if (!Buffer.isBuffer(buffer)) return false
9961 if (buffer.length < 33) return false
9962
9963 switch (buffer[0]) {
9964 case 0x02:
9965 case 0x03:
9966 return buffer.length === 33
9967 case 0x04:
9968 return buffer.length === 65
9969 }
9970
9971 return false
9972}
9973
9974function isDefinedHashType (hashType) {
9975 var hashTypeMod = hashType & ~0x80
9976
9977// return hashTypeMod > SIGHASH_ALL && hashTypeMod < SIGHASH_SINGLE
9978 return hashTypeMod > 0x00 && hashTypeMod < 0x04
9979}
9980
9981function isCanonicalSignature (buffer) {
9982 if (!Buffer.isBuffer(buffer)) return false
9983 if (!isDefinedHashType(buffer[buffer.length - 1])) return false
9984
9985 return bip66.check(buffer.slice(0, -1))
9986}
9987
9988module.exports = {
9989 compile: compile,
9990 decompile: decompile,
9991 fromASM: fromASM,
9992 toASM: toASM,
9993 toStack: toStack,
9994
9995 number: require('./script_number'),
9996
9997 isCanonicalPubKey: isCanonicalPubKey,
9998 isCanonicalSignature: isCanonicalSignature,
9999 isPushOnly: isPushOnly,
10000 isDefinedHashType: isDefinedHashType
10001}
10002
10003},{"./script_number":55,"./types":80,"bip66":41,"bitcoin-ops":42,"bitcoin-ops/map":43,"pushdata-bitcoin":98,"safe-buffer":101,"typeforce":112}],55:[function(require,module,exports){
10004var Buffer = require('safe-buffer').Buffer
10005
10006function decode (buffer, maxLength, minimal) {
10007 maxLength = maxLength || 4
10008 minimal = minimal === undefined ? true : minimal
10009
10010 var length = buffer.length
10011 if (length === 0) return 0
10012 if (length > maxLength) throw new TypeError('Script number overflow')
10013 if (minimal) {
10014 if ((buffer[length - 1] & 0x7f) === 0) {
10015 if (length <= 1 || (buffer[length - 2] & 0x80) === 0) throw new Error('Non-minimally encoded script number')
10016 }
10017 }
10018
10019 // 40-bit
10020 if (length === 5) {
10021 var a = buffer.readUInt32LE(0)
10022 var b = buffer.readUInt8(4)
10023
10024 if (b & 0x80) return -(((b & ~0x80) * 0x100000000) + a)
10025 return (b * 0x100000000) + a
10026 }
10027
10028 var result = 0
10029
10030 // 32-bit / 24-bit / 16-bit / 8-bit
10031 for (var i = 0; i < length; ++i) {
10032 result |= buffer[i] << (8 * i)
10033 }
10034
10035 if (buffer[length - 1] & 0x80) return -(result & ~(0x80 << (8 * (length - 1))))
10036 return result
10037}
10038
10039function scriptNumSize (i) {
10040 return i > 0x7fffffff ? 5
10041 : i > 0x7fffff ? 4
10042 : i > 0x7fff ? 3
10043 : i > 0x7f ? 2
10044 : i > 0x00 ? 1
10045 : 0
10046}
10047
10048function encode (number) {
10049 var value = Math.abs(number)
10050 var size = scriptNumSize(value)
10051 var buffer = Buffer.allocUnsafe(size)
10052 var negative = number < 0
10053
10054 for (var i = 0; i < size; ++i) {
10055 buffer.writeUInt8(value & 0xff, i)
10056 value >>= 8
10057 }
10058
10059 if (buffer[size - 1] & 0x80) {
10060 buffer.writeUInt8(negative ? 0x80 : 0x00, size - 1)
10061 } else if (negative) {
10062 buffer[size - 1] |= 0x80
10063 }
10064
10065 return buffer
10066}
10067
10068module.exports = {
10069 decode: decode,
10070 encode: encode
10071}
10072
10073},{"safe-buffer":101}],56:[function(require,module,exports){
10074var decompile = require('../script').decompile
10075var multisig = require('./multisig')
10076var nullData = require('./nulldata')
10077var pubKey = require('./pubkey')
10078var pubKeyHash = require('./pubkeyhash')
10079var scriptHash = require('./scripthash')
10080var witnessPubKeyHash = require('./witnesspubkeyhash')
10081var witnessScriptHash = require('./witnessscripthash')
10082var witnessCommitment = require('./witnesscommitment')
10083
10084var types = {
10085 MULTISIG: 'multisig',
10086 NONSTANDARD: 'nonstandard',
10087 NULLDATA: 'nulldata',
10088 P2PK: 'pubkey',
10089 P2PKH: 'pubkeyhash',
10090 P2SH: 'scripthash',
10091 P2WPKH: 'witnesspubkeyhash',
10092 P2WSH: 'witnessscripthash',
10093 WITNESS_COMMITMENT: 'witnesscommitment'
10094}
10095
10096function classifyOutput (script) {
10097 if (witnessPubKeyHash.output.check(script)) return types.P2WPKH
10098 if (witnessScriptHash.output.check(script)) return types.P2WSH
10099 if (pubKeyHash.output.check(script)) return types.P2PKH
10100 if (scriptHash.output.check(script)) return types.P2SH
10101
10102 // XXX: optimization, below functions .decompile before use
10103 var chunks = decompile(script)
10104 if (multisig.output.check(chunks)) return types.MULTISIG
10105 if (pubKey.output.check(chunks)) return types.P2PK
10106 if (witnessCommitment.output.check(chunks)) return types.WITNESS_COMMITMENT
10107 if (nullData.output.check(chunks)) return types.NULLDATA
10108
10109 return types.NONSTANDARD
10110}
10111
10112function classifyInput (script, allowIncomplete) {
10113 // XXX: optimization, below functions .decompile before use
10114 var chunks = decompile(script)
10115
10116 if (pubKeyHash.input.check(chunks)) return types.P2PKH
10117 if (scriptHash.input.check(chunks, allowIncomplete)) return types.P2SH
10118 if (multisig.input.check(chunks, allowIncomplete)) return types.MULTISIG
10119 if (pubKey.input.check(chunks)) return types.P2PK
10120
10121 return types.NONSTANDARD
10122}
10123
10124function classifyWitness (script, allowIncomplete) {
10125 // XXX: optimization, below functions .decompile before use
10126 var chunks = decompile(script)
10127
10128 if (witnessPubKeyHash.input.check(chunks)) return types.P2WPKH
10129 if (witnessScriptHash.input.check(chunks, allowIncomplete)) return types.P2WSH
10130
10131 return types.NONSTANDARD
10132}
10133
10134module.exports = {
10135 classifyInput: classifyInput,
10136 classifyOutput: classifyOutput,
10137 classifyWitness: classifyWitness,
10138 multisig: multisig,
10139 nullData: nullData,
10140 pubKey: pubKey,
10141 pubKeyHash: pubKeyHash,
10142 scriptHash: scriptHash,
10143 witnessPubKeyHash: witnessPubKeyHash,
10144 witnessScriptHash: witnessScriptHash,
10145 witnessCommitment: witnessCommitment,
10146 types: types
10147}
10148
10149},{"../script":54,"./multisig":57,"./nulldata":60,"./pubkey":61,"./pubkeyhash":64,"./scripthash":67,"./witnesscommitment":70,"./witnesspubkeyhash":72,"./witnessscripthash":75}],57:[function(require,module,exports){
10150module.exports = {
10151 input: require('./input'),
10152 output: require('./output')
10153}
10154
10155},{"./input":58,"./output":59}],58:[function(require,module,exports){
10156// OP_0 [signatures ...]
10157
10158var Buffer = require('safe-buffer').Buffer
10159var bscript = require('../../script')
10160var p2mso = require('./output')
10161var typeforce = require('typeforce')
10162var OPS = require('bitcoin-ops')
10163
10164function partialSignature (value) {
10165 return value === OPS.OP_0 || bscript.isCanonicalSignature(value)
10166}
10167
10168function check (script, allowIncomplete) {
10169 var chunks = bscript.decompile(script)
10170 if (chunks.length < 2) return false
10171 if (chunks[0] !== OPS.OP_0) return false
10172
10173 if (allowIncomplete) {
10174 return chunks.slice(1).every(partialSignature)
10175 }
10176
10177 return chunks.slice(1).every(bscript.isCanonicalSignature)
10178}
10179check.toJSON = function () { return 'multisig input' }
10180
10181var EMPTY_BUFFER = Buffer.allocUnsafe(0)
10182
10183function encodeStack (signatures, scriptPubKey) {
10184 typeforce([partialSignature], signatures)
10185
10186 if (scriptPubKey) {
10187 var scriptData = p2mso.decode(scriptPubKey)
10188
10189 if (signatures.length < scriptData.m) {
10190 throw new TypeError('Not enough signatures provided')
10191 }
10192
10193 if (signatures.length > scriptData.pubKeys.length) {
10194 throw new TypeError('Too many signatures provided')
10195 }
10196 }
10197
10198 return [].concat(EMPTY_BUFFER, signatures.map(function (sig) {
10199 if (sig === OPS.OP_0) {
10200 return EMPTY_BUFFER
10201 }
10202 return sig
10203 }))
10204}
10205
10206function encode (signatures, scriptPubKey) {
10207 return bscript.compile(encodeStack(signatures, scriptPubKey))
10208}
10209
10210function decodeStack (stack, allowIncomplete) {
10211 typeforce(typeforce.Array, stack)
10212 typeforce(check, stack, allowIncomplete)
10213 return stack.slice(1)
10214}
10215
10216function decode (buffer, allowIncomplete) {
10217 var stack = bscript.decompile(buffer)
10218 return decodeStack(stack, allowIncomplete)
10219}
10220
10221module.exports = {
10222 check: check,
10223 decode: decode,
10224 decodeStack: decodeStack,
10225 encode: encode,
10226 encodeStack: encodeStack
10227}
10228
10229},{"../../script":54,"./output":59,"bitcoin-ops":42,"safe-buffer":101,"typeforce":112}],59:[function(require,module,exports){
10230// m [pubKeys ...] n OP_CHECKMULTISIG
10231
10232var bscript = require('../../script')
10233var types = require('../../types')
10234var typeforce = require('typeforce')
10235var OPS = require('bitcoin-ops')
10236var OP_INT_BASE = OPS.OP_RESERVED // OP_1 - 1
10237
10238function check (script, allowIncomplete) {
10239 var chunks = bscript.decompile(script)
10240
10241 if (chunks.length < 4) return false
10242 if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG) return false
10243 if (!types.Number(chunks[0])) return false
10244 if (!types.Number(chunks[chunks.length - 2])) return false
10245 var m = chunks[0] - OP_INT_BASE
10246 var n = chunks[chunks.length - 2] - OP_INT_BASE
10247
10248 if (m <= 0) return false
10249 if (n > 16) return false
10250 if (m > n) return false
10251 if (n !== chunks.length - 3) return false
10252 if (allowIncomplete) return true
10253
10254 var keys = chunks.slice(1, -2)
10255 return keys.every(bscript.isCanonicalPubKey)
10256}
10257check.toJSON = function () { return 'multi-sig output' }
10258
10259function encode (m, pubKeys) {
10260 typeforce({
10261 m: types.Number,
10262 pubKeys: [bscript.isCanonicalPubKey]
10263 }, {
10264 m: m,
10265 pubKeys: pubKeys
10266 })
10267
10268 var n = pubKeys.length
10269 if (n < m) throw new TypeError('Not enough pubKeys provided')
10270
10271 return bscript.compile([].concat(
10272 OP_INT_BASE + m,
10273 pubKeys,
10274 OP_INT_BASE + n,
10275 OPS.OP_CHECKMULTISIG
10276 ))
10277}
10278
10279function decode (buffer, allowIncomplete) {
10280 var chunks = bscript.decompile(buffer)
10281 typeforce(check, chunks, allowIncomplete)
10282
10283 return {
10284 m: chunks[0] - OP_INT_BASE,
10285 pubKeys: chunks.slice(1, -2)
10286 }
10287}
10288
10289module.exports = {
10290 check: check,
10291 decode: decode,
10292 encode: encode
10293}
10294
10295},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":112}],60:[function(require,module,exports){
10296// OP_RETURN {data}
10297
10298var bscript = require('../script')
10299var types = require('../types')
10300var typeforce = require('typeforce')
10301var OPS = require('bitcoin-ops')
10302
10303function check (script) {
10304 var buffer = bscript.compile(script)
10305
10306 return buffer.length > 1 &&
10307 buffer[0] === OPS.OP_RETURN
10308}
10309check.toJSON = function () { return 'null data output' }
10310
10311function encode (data) {
10312 typeforce(types.Buffer, data)
10313
10314 return bscript.compile([OPS.OP_RETURN, data])
10315}
10316
10317function decode (buffer) {
10318 typeforce(check, buffer)
10319
10320 return buffer.slice(2)
10321}
10322
10323module.exports = {
10324 output: {
10325 check: check,
10326 decode: decode,
10327 encode: encode
10328 }
10329}
10330
10331},{"../script":54,"../types":80,"bitcoin-ops":42,"typeforce":112}],61:[function(require,module,exports){
10332arguments[4][57][0].apply(exports,arguments)
10333},{"./input":62,"./output":63,"dup":57}],62:[function(require,module,exports){
10334// {signature}
10335
10336var bscript = require('../../script')
10337var typeforce = require('typeforce')
10338
10339function check (script) {
10340 var chunks = bscript.decompile(script)
10341
10342 return chunks.length === 1 &&
10343 bscript.isCanonicalSignature(chunks[0])
10344}
10345check.toJSON = function () { return 'pubKey input' }
10346
10347function encodeStack (signature) {
10348 typeforce(bscript.isCanonicalSignature, signature)
10349 return [signature]
10350}
10351
10352function encode (signature) {
10353 return bscript.compile(encodeStack(signature))
10354}
10355
10356function decodeStack (stack) {
10357 typeforce(typeforce.Array, stack)
10358 typeforce(check, stack)
10359 return stack[0]
10360}
10361
10362function decode (buffer) {
10363 var stack = bscript.decompile(buffer)
10364 return decodeStack(stack)
10365}
10366
10367module.exports = {
10368 check: check,
10369 decode: decode,
10370 decodeStack: decodeStack,
10371 encode: encode,
10372 encodeStack: encodeStack
10373}
10374
10375},{"../../script":54,"typeforce":112}],63:[function(require,module,exports){
10376// {pubKey} OP_CHECKSIG
10377
10378var bscript = require('../../script')
10379var typeforce = require('typeforce')
10380var OPS = require('bitcoin-ops')
10381
10382function check (script) {
10383 var chunks = bscript.decompile(script)
10384
10385 return chunks.length === 2 &&
10386 bscript.isCanonicalPubKey(chunks[0]) &&
10387 chunks[1] === OPS.OP_CHECKSIG
10388}
10389check.toJSON = function () { return 'pubKey output' }
10390
10391function encode (pubKey) {
10392 typeforce(bscript.isCanonicalPubKey, pubKey)
10393
10394 return bscript.compile([pubKey, OPS.OP_CHECKSIG])
10395}
10396
10397function decode (buffer) {
10398 var chunks = bscript.decompile(buffer)
10399 typeforce(check, chunks)
10400
10401 return chunks[0]
10402}
10403
10404module.exports = {
10405 check: check,
10406 decode: decode,
10407 encode: encode
10408}
10409
10410},{"../../script":54,"bitcoin-ops":42,"typeforce":112}],64:[function(require,module,exports){
10411arguments[4][57][0].apply(exports,arguments)
10412},{"./input":65,"./output":66,"dup":57}],65:[function(require,module,exports){
10413// {signature} {pubKey}
10414
10415var bscript = require('../../script')
10416var typeforce = require('typeforce')
10417
10418function check (script) {
10419 var chunks = bscript.decompile(script)
10420
10421 return chunks.length === 2 &&
10422 bscript.isCanonicalSignature(chunks[0]) &&
10423 bscript.isCanonicalPubKey(chunks[1])
10424}
10425check.toJSON = function () { return 'pubKeyHash input' }
10426
10427function encodeStack (signature, pubKey) {
10428 typeforce({
10429 signature: bscript.isCanonicalSignature,
10430 pubKey: bscript.isCanonicalPubKey
10431 }, {
10432 signature: signature,
10433 pubKey: pubKey
10434 })
10435
10436 return [signature, pubKey]
10437}
10438
10439function encode (signature, pubKey) {
10440 return bscript.compile(encodeStack(signature, pubKey))
10441}
10442
10443function decodeStack (stack) {
10444 typeforce(typeforce.Array, stack)
10445 typeforce(check, stack)
10446
10447 return {
10448 signature: stack[0],
10449 pubKey: stack[1]
10450 }
10451}
10452
10453function decode (buffer) {
10454 var stack = bscript.decompile(buffer)
10455 return decodeStack(stack)
10456}
10457
10458module.exports = {
10459 check: check,
10460 decode: decode,
10461 decodeStack: decodeStack,
10462 encode: encode,
10463 encodeStack: encodeStack
10464}
10465
10466},{"../../script":54,"typeforce":112}],66:[function(require,module,exports){
10467// OP_DUP OP_HASH160 {pubKeyHash} OP_EQUALVERIFY OP_CHECKSIG
10468
10469var bscript = require('../../script')
10470var types = require('../../types')
10471var typeforce = require('typeforce')
10472var OPS = require('bitcoin-ops')
10473
10474function check (script) {
10475 var buffer = bscript.compile(script)
10476
10477 return buffer.length === 25 &&
10478 buffer[0] === OPS.OP_DUP &&
10479 buffer[1] === OPS.OP_HASH160 &&
10480 buffer[2] === 0x14 &&
10481 buffer[23] === OPS.OP_EQUALVERIFY &&
10482 buffer[24] === OPS.OP_CHECKSIG
10483}
10484check.toJSON = function () { return 'pubKeyHash output' }
10485
10486function encode (pubKeyHash) {
10487 typeforce(types.Hash160bit, pubKeyHash)
10488
10489 return bscript.compile([
10490 OPS.OP_DUP,
10491 OPS.OP_HASH160,
10492 pubKeyHash,
10493 OPS.OP_EQUALVERIFY,
10494 OPS.OP_CHECKSIG
10495 ])
10496}
10497
10498function decode (buffer) {
10499 typeforce(check, buffer)
10500
10501 return buffer.slice(3, 23)
10502}
10503
10504module.exports = {
10505 check: check,
10506 decode: decode,
10507 encode: encode
10508}
10509
10510},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":112}],67:[function(require,module,exports){
10511arguments[4][57][0].apply(exports,arguments)
10512},{"./input":68,"./output":69,"dup":57}],68:[function(require,module,exports){
10513// <scriptSig> {serialized scriptPubKey script}
10514
10515var Buffer = require('safe-buffer').Buffer
10516var bscript = require('../../script')
10517var typeforce = require('typeforce')
10518
10519var p2ms = require('../multisig/')
10520var p2pk = require('../pubkey/')
10521var p2pkh = require('../pubkeyhash/')
10522var p2wpkho = require('../witnesspubkeyhash/output')
10523var p2wsho = require('../witnessscripthash/output')
10524
10525function check (script, allowIncomplete) {
10526 var chunks = bscript.decompile(script)
10527 if (chunks.length < 1) return false
10528
10529 var lastChunk = chunks[chunks.length - 1]
10530 if (!Buffer.isBuffer(lastChunk)) return false
10531
10532 var scriptSigChunks = bscript.decompile(bscript.compile(chunks.slice(0, -1)))
10533 var redeemScriptChunks = bscript.decompile(lastChunk)
10534
10535 // is redeemScript a valid script?
10536 if (redeemScriptChunks.length === 0) return false
10537
10538 // is redeemScriptSig push only?
10539 if (!bscript.isPushOnly(scriptSigChunks)) return false
10540
10541 // is witness?
10542 if (chunks.length === 1) {
10543 return p2wsho.check(redeemScriptChunks) ||
10544 p2wpkho.check(redeemScriptChunks)
10545 }
10546
10547 // match types
10548 if (p2pkh.input.check(scriptSigChunks) &&
10549 p2pkh.output.check(redeemScriptChunks)) return true
10550
10551 if (p2ms.input.check(scriptSigChunks, allowIncomplete) &&
10552 p2ms.output.check(redeemScriptChunks)) return true
10553
10554 if (p2pk.input.check(scriptSigChunks) &&
10555 p2pk.output.check(redeemScriptChunks)) return true
10556
10557 return false
10558}
10559check.toJSON = function () { return 'scriptHash input' }
10560
10561function encodeStack (redeemScriptStack, redeemScript) {
10562 var serializedScriptPubKey = bscript.compile(redeemScript)
10563
10564 return [].concat(redeemScriptStack, serializedScriptPubKey)
10565}
10566
10567function encode (redeemScriptSig, redeemScript) {
10568 var redeemScriptStack = bscript.decompile(redeemScriptSig)
10569
10570 return bscript.compile(encodeStack(redeemScriptStack, redeemScript))
10571}
10572
10573function decodeStack (stack) {
10574 typeforce(typeforce.Array, stack)
10575 typeforce(check, stack)
10576
10577 return {
10578 redeemScriptStack: stack.slice(0, -1),
10579 redeemScript: stack[stack.length - 1]
10580 }
10581}
10582
10583function decode (buffer) {
10584 var stack = bscript.decompile(buffer)
10585 var result = decodeStack(stack)
10586 result.redeemScriptSig = bscript.compile(result.redeemScriptStack)
10587 delete result.redeemScriptStack
10588 return result
10589}
10590
10591module.exports = {
10592 check: check,
10593 decode: decode,
10594 decodeStack: decodeStack,
10595 encode: encode,
10596 encodeStack: encodeStack
10597}
10598
10599},{"../../script":54,"../multisig/":57,"../pubkey/":61,"../pubkeyhash/":64,"../witnesspubkeyhash/output":74,"../witnessscripthash/output":77,"safe-buffer":101,"typeforce":112}],69:[function(require,module,exports){
10600// OP_HASH160 {scriptHash} OP_EQUAL
10601
10602var bscript = require('../../script')
10603var types = require('../../types')
10604var typeforce = require('typeforce')
10605var OPS = require('bitcoin-ops')
10606
10607function check (script) {
10608 var buffer = bscript.compile(script)
10609
10610 return buffer.length === 23 &&
10611 buffer[0] === OPS.OP_HASH160 &&
10612 buffer[1] === 0x14 &&
10613 buffer[22] === OPS.OP_EQUAL
10614}
10615check.toJSON = function () { return 'scriptHash output' }
10616
10617function encode (scriptHash) {
10618 typeforce(types.Hash160bit, scriptHash)
10619
10620 return bscript.compile([OPS.OP_HASH160, scriptHash, OPS.OP_EQUAL])
10621}
10622
10623function decode (buffer) {
10624 typeforce(check, buffer)
10625
10626 return buffer.slice(2, 22)
10627}
10628
10629module.exports = {
10630 check: check,
10631 decode: decode,
10632 encode: encode
10633}
10634
10635},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":112}],70:[function(require,module,exports){
10636module.exports = {
10637 output: require('./output')
10638}
10639
10640},{"./output":71}],71:[function(require,module,exports){
10641// OP_RETURN {aa21a9ed} {commitment}
10642
10643var Buffer = require('safe-buffer').Buffer
10644var bscript = require('../../script')
10645var types = require('../../types')
10646var typeforce = require('typeforce')
10647var OPS = require('bitcoin-ops')
10648
10649var HEADER = Buffer.from('aa21a9ed', 'hex')
10650
10651function check (script) {
10652 var buffer = bscript.compile(script)
10653
10654 return buffer.length > 37 &&
10655 buffer[0] === OPS.OP_RETURN &&
10656 buffer[1] === 0x24 &&
10657 buffer.slice(2, 6).equals(HEADER)
10658}
10659
10660check.toJSON = function () { return 'Witness commitment output' }
10661
10662function encode (commitment) {
10663 typeforce(types.Hash256bit, commitment)
10664
10665 var buffer = Buffer.allocUnsafe(36)
10666 HEADER.copy(buffer, 0)
10667 commitment.copy(buffer, 4)
10668
10669 return bscript.compile([OPS.OP_RETURN, buffer])
10670}
10671
10672function decode (buffer) {
10673 typeforce(check, buffer)
10674
10675 return bscript.decompile(buffer)[1].slice(4, 36)
10676}
10677
10678module.exports = {
10679 check: check,
10680 decode: decode,
10681 encode: encode
10682}
10683
10684},{"../../script":54,"../../types":80,"bitcoin-ops":42,"safe-buffer":101,"typeforce":112}],72:[function(require,module,exports){
10685arguments[4][57][0].apply(exports,arguments)
10686},{"./input":73,"./output":74,"dup":57}],73:[function(require,module,exports){
10687// {signature} {pubKey}
10688
10689var bscript = require('../../script')
10690var typeforce = require('typeforce')
10691
10692function isCompressedCanonicalPubKey (pubKey) {
10693 return bscript.isCanonicalPubKey(pubKey) && pubKey.length === 33
10694}
10695
10696function check (script) {
10697 var chunks = bscript.decompile(script)
10698
10699 return chunks.length === 2 &&
10700 bscript.isCanonicalSignature(chunks[0]) &&
10701 isCompressedCanonicalPubKey(chunks[1])
10702}
10703check.toJSON = function () { return 'witnessPubKeyHash input' }
10704
10705function encodeStack (signature, pubKey) {
10706 typeforce({
10707 signature: bscript.isCanonicalSignature,
10708 pubKey: isCompressedCanonicalPubKey
10709 }, {
10710 signature: signature,
10711 pubKey: pubKey
10712 })
10713
10714 return [signature, pubKey]
10715}
10716
10717function decodeStack (stack) {
10718 typeforce(typeforce.Array, stack)
10719 typeforce(check, stack)
10720
10721 return {
10722 signature: stack[0],
10723 pubKey: stack[1]
10724 }
10725}
10726
10727module.exports = {
10728 check: check,
10729 decodeStack: decodeStack,
10730 encodeStack: encodeStack
10731}
10732
10733},{"../../script":54,"typeforce":112}],74:[function(require,module,exports){
10734// OP_0 {pubKeyHash}
10735
10736var bscript = require('../../script')
10737var types = require('../../types')
10738var typeforce = require('typeforce')
10739var OPS = require('bitcoin-ops')
10740
10741function check (script) {
10742 var buffer = bscript.compile(script)
10743
10744 return buffer.length === 22 &&
10745 buffer[0] === OPS.OP_0 &&
10746 buffer[1] === 0x14
10747}
10748check.toJSON = function () { return 'Witness pubKeyHash output' }
10749
10750function encode (pubKeyHash) {
10751 typeforce(types.Hash160bit, pubKeyHash)
10752
10753 return bscript.compile([OPS.OP_0, pubKeyHash])
10754}
10755
10756function decode (buffer) {
10757 typeforce(check, buffer)
10758
10759 return buffer.slice(2)
10760}
10761
10762module.exports = {
10763 check: check,
10764 decode: decode,
10765 encode: encode
10766}
10767
10768},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":112}],75:[function(require,module,exports){
10769arguments[4][57][0].apply(exports,arguments)
10770},{"./input":76,"./output":77,"dup":57}],76:[function(require,module,exports){
10771(function (Buffer){
10772// <scriptSig> {serialized scriptPubKey script}
10773
10774var bscript = require('../../script')
10775var types = require('../../types')
10776var typeforce = require('typeforce')
10777
10778var p2ms = require('../multisig/')
10779var p2pk = require('../pubkey/')
10780var p2pkh = require('../pubkeyhash/')
10781
10782function check (chunks, allowIncomplete) {
10783 typeforce(types.Array, chunks)
10784 if (chunks.length < 1) return false
10785
10786 var witnessScript = chunks[chunks.length - 1]
10787 if (!Buffer.isBuffer(witnessScript)) return false
10788
10789 var witnessScriptChunks = bscript.decompile(witnessScript)
10790
10791 // is witnessScript a valid script?
10792 if (witnessScriptChunks.length === 0) return false
10793
10794 var witnessRawScriptSig = bscript.compile(chunks.slice(0, -1))
10795
10796 // match types
10797 if (p2pkh.input.check(witnessRawScriptSig) &&
10798 p2pkh.output.check(witnessScriptChunks)) return true
10799
10800 if (p2ms.input.check(witnessRawScriptSig, allowIncomplete) &&
10801 p2ms.output.check(witnessScriptChunks)) return true
10802
10803 if (p2pk.input.check(witnessRawScriptSig) &&
10804 p2pk.output.check(witnessScriptChunks)) return true
10805
10806 return false
10807}
10808check.toJSON = function () { return 'witnessScriptHash input' }
10809
10810function encodeStack (witnessData, witnessScript) {
10811 typeforce({
10812 witnessData: [types.Buffer],
10813 witnessScript: types.Buffer
10814 }, {
10815 witnessData: witnessData,
10816 witnessScript: witnessScript
10817 })
10818
10819 return [].concat(witnessData, witnessScript)
10820}
10821
10822function decodeStack (stack) {
10823 typeforce(typeforce.Array, stack)
10824 typeforce(check, stack)
10825 return {
10826 witnessData: stack.slice(0, -1),
10827 witnessScript: stack[stack.length - 1]
10828 }
10829}
10830
10831module.exports = {
10832 check: check,
10833 decodeStack: decodeStack,
10834 encodeStack: encodeStack
10835}
10836
10837}).call(this,{"isBuffer":require("../../../../../../../../.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")})
10838},{"../../../../../../../../.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":10,"../../script":54,"../../types":80,"../multisig/":57,"../pubkey/":61,"../pubkeyhash/":64,"typeforce":112}],77:[function(require,module,exports){
10839// OP_0 {scriptHash}
10840
10841var bscript = require('../../script')
10842var types = require('../../types')
10843var typeforce = require('typeforce')
10844var OPS = require('bitcoin-ops')
10845
10846function check (script) {
10847 var buffer = bscript.compile(script)
10848
10849 return buffer.length === 34 &&
10850 buffer[0] === OPS.OP_0 &&
10851 buffer[1] === 0x20
10852}
10853check.toJSON = function () { return 'Witness scriptHash output' }
10854
10855function encode (scriptHash) {
10856 typeforce(types.Hash256bit, scriptHash)
10857
10858 return bscript.compile([OPS.OP_0, scriptHash])
10859}
10860
10861function decode (buffer) {
10862 typeforce(check, buffer)
10863
10864 return buffer.slice(2)
10865}
10866
10867module.exports = {
10868 check: check,
10869 decode: decode,
10870 encode: encode
10871}
10872
10873},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":112}],78:[function(require,module,exports){
10874var Buffer = require('safe-buffer').Buffer
10875var bcrypto = require('./crypto')
10876var bscript = require('./script')
10877var bufferutils = require('./bufferutils')
10878var opcodes = require('bitcoin-ops')
10879var typeforce = require('typeforce')
10880var types = require('./types')
10881var varuint = require('varuint-bitcoin')
10882
10883function varSliceSize (someScript) {
10884 var length = someScript.length
10885
10886 return varuint.encodingLength(length) + length
10887}
10888
10889function vectorSize (someVector) {
10890 var length = someVector.length
10891
10892 return varuint.encodingLength(length) + someVector.reduce(function (sum, witness) {
10893 return sum + varSliceSize(witness)
10894 }, 0)
10895}
10896
10897function Transaction () {
10898 this.version = 1
10899 this.locktime = 0
10900 this.ins = []
10901 this.outs = []
10902}
10903
10904Transaction.DEFAULT_SEQUENCE = 0xffffffff
10905Transaction.SIGHASH_ALL = 0x01
10906Transaction.SIGHASH_NONE = 0x02
10907Transaction.SIGHASH_SINGLE = 0x03
10908Transaction.SIGHASH_ANYONECANPAY = 0x80
10909Transaction.ADVANCED_TRANSACTION_MARKER = 0x00
10910Transaction.ADVANCED_TRANSACTION_FLAG = 0x01
10911
10912var EMPTY_SCRIPT = Buffer.allocUnsafe(0)
10913var EMPTY_WITNESS = []
10914var ZERO = Buffer.from('0000000000000000000000000000000000000000000000000000000000000000', 'hex')
10915var ONE = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex')
10916var VALUE_UINT64_MAX = Buffer.from('ffffffffffffffff', 'hex')
10917var BLANK_OUTPUT = {
10918 script: EMPTY_SCRIPT,
10919 valueBuffer: VALUE_UINT64_MAX
10920}
10921
10922Transaction.fromBuffer = function (buffer, __noStrict) {
10923 var offset = 0
10924 function readSlice (n) {
10925 offset += n
10926 return buffer.slice(offset - n, offset)
10927 }
10928
10929 function readUInt32 () {
10930 var i = buffer.readUInt32LE(offset)
10931 offset += 4
10932 return i
10933 }
10934
10935 function readInt32 () {
10936 var i = buffer.readInt32LE(offset)
10937 offset += 4
10938 return i
10939 }
10940
10941 function readUInt64 () {
10942 var i = bufferutils.readUInt64LE(buffer, offset)
10943 offset += 8
10944 return i
10945 }
10946
10947 function readVarInt () {
10948 var vi = varuint.decode(buffer, offset)
10949 offset += varuint.decode.bytes
10950 return vi
10951 }
10952
10953 function readVarSlice () {
10954 return readSlice(readVarInt())
10955 }
10956
10957 function readVector () {
10958 var count = readVarInt()
10959 var vector = []
10960 for (var i = 0; i < count; i++) vector.push(readVarSlice())
10961 return vector
10962 }
10963
10964 var tx = new Transaction()
10965 tx.version = readInt32()
10966
10967 var marker = buffer.readUInt8(offset)
10968 var flag = buffer.readUInt8(offset + 1)
10969
10970 var hasWitnesses = false
10971 if (marker === Transaction.ADVANCED_TRANSACTION_MARKER &&
10972 flag === Transaction.ADVANCED_TRANSACTION_FLAG) {
10973 offset += 2
10974 hasWitnesses = true
10975 }
10976
10977 var vinLen = readVarInt()
10978 for (var i = 0; i < vinLen; ++i) {
10979 tx.ins.push({
10980 hash: readSlice(32),
10981 index: readUInt32(),
10982 script: readVarSlice(),
10983 sequence: readUInt32(),
10984 witness: EMPTY_WITNESS
10985 })
10986 }
10987
10988 var voutLen = readVarInt()
10989 for (i = 0; i < voutLen; ++i) {
10990 tx.outs.push({
10991 value: readUInt64(),
10992 script: readVarSlice()
10993 })
10994 }
10995
10996 if (hasWitnesses) {
10997 for (i = 0; i < vinLen; ++i) {
10998 tx.ins[i].witness = readVector()
10999 }
11000
11001 // was this pointless?
11002 if (!tx.hasWitnesses()) throw new Error('Transaction has superfluous witness data')
11003 }
11004
11005 tx.locktime = readUInt32()
11006
11007 if (__noStrict) return tx
11008 if (offset !== buffer.length) throw new Error('Transaction has unexpected data')
11009
11010 return tx
11011}
11012
11013Transaction.fromHex = function (hex) {
11014 return Transaction.fromBuffer(Buffer.from(hex, 'hex'))
11015}
11016
11017Transaction.isCoinbaseHash = function (buffer) {
11018 typeforce(types.Hash256bit, buffer)
11019 for (var i = 0; i < 32; ++i) {
11020 if (buffer[i] !== 0) return false
11021 }
11022 return true
11023}
11024
11025Transaction.prototype.isCoinbase = function () {
11026 return this.ins.length === 1 && Transaction.isCoinbaseHash(this.ins[0].hash)
11027}
11028
11029Transaction.prototype.addInput = function (hash, index, sequence, scriptSig) {
11030 typeforce(types.tuple(
11031 types.Hash256bit,
11032 types.UInt32,
11033 types.maybe(types.UInt32),
11034 types.maybe(types.Buffer)
11035 ), arguments)
11036
11037 if (types.Null(sequence)) {
11038 sequence = Transaction.DEFAULT_SEQUENCE
11039 }
11040
11041 // Add the input and return the input's index
11042 return (this.ins.push({
11043 hash: hash,
11044 index: index,
11045 script: scriptSig || EMPTY_SCRIPT,
11046 sequence: sequence,
11047 witness: EMPTY_WITNESS
11048 }) - 1)
11049}
11050
11051Transaction.prototype.addOutput = function (scriptPubKey, value) {
11052 typeforce(types.tuple(types.Buffer, types.Satoshi), arguments)
11053
11054 // Add the output and return the output's index
11055 return (this.outs.push({
11056 script: scriptPubKey,
11057 value: value
11058 }) - 1)
11059}
11060
11061Transaction.prototype.hasWitnesses = function () {
11062 return this.ins.some(function (x) {
11063 return x.witness.length !== 0
11064 })
11065}
11066
11067Transaction.prototype.weight = function () {
11068 var base = this.__byteLength(false)
11069 var total = this.__byteLength(true)
11070 return base * 3 + total
11071}
11072
11073Transaction.prototype.virtualSize = function () {
11074 return Math.ceil(this.weight() / 4)
11075}
11076
11077Transaction.prototype.byteLength = function () {
11078 return this.__byteLength(true)
11079}
11080
11081Transaction.prototype.__byteLength = function (__allowWitness) {
11082 var hasWitnesses = __allowWitness && this.hasWitnesses()
11083
11084 return (
11085 (hasWitnesses ? 10 : 8) +
11086 varuint.encodingLength(this.ins.length) +
11087 varuint.encodingLength(this.outs.length) +
11088 this.ins.reduce(function (sum, input) { return sum + 40 + varSliceSize(input.script) }, 0) +
11089 this.outs.reduce(function (sum, output) { return sum + 8 + varSliceSize(output.script) }, 0) +
11090 (hasWitnesses ? this.ins.reduce(function (sum, input) { return sum + vectorSize(input.witness) }, 0) : 0)
11091 )
11092}
11093
11094Transaction.prototype.clone = function () {
11095 var newTx = new Transaction()
11096 newTx.version = this.version
11097 newTx.locktime = this.locktime
11098
11099 newTx.ins = this.ins.map(function (txIn) {
11100 return {
11101 hash: txIn.hash,
11102 index: txIn.index,
11103 script: txIn.script,
11104 sequence: txIn.sequence,
11105 witness: txIn.witness
11106 }
11107 })
11108
11109 newTx.outs = this.outs.map(function (txOut) {
11110 return {
11111 script: txOut.script,
11112 value: txOut.value
11113 }
11114 })
11115
11116 return newTx
11117}
11118
11119/**
11120 * Hash transaction for signing a specific input.
11121 *
11122 * Bitcoin uses a different hash for each signed transaction input.
11123 * This method copies the transaction, makes the necessary changes based on the
11124 * hashType, and then hashes the result.
11125 * This hash can then be used to sign the provided transaction input.
11126 */
11127Transaction.prototype.hashForSignature = function (inIndex, prevOutScript, hashType) {
11128 typeforce(types.tuple(types.UInt32, types.Buffer, /* types.UInt8 */ types.Number), arguments)
11129
11130 // https://github.com/bitcoin/bitcoin/blob/master/src/test/sighash_tests.cpp#L29
11131 if (inIndex >= this.ins.length) return ONE
11132
11133 // ignore OP_CODESEPARATOR
11134 var ourScript = bscript.compile(bscript.decompile(prevOutScript).filter(function (x) {
11135 return x !== opcodes.OP_CODESEPARATOR
11136 }))
11137
11138 var txTmp = this.clone()
11139
11140 // SIGHASH_NONE: ignore all outputs? (wildcard payee)
11141 if ((hashType & 0x1f) === Transaction.SIGHASH_NONE) {
11142 txTmp.outs = []
11143
11144 // ignore sequence numbers (except at inIndex)
11145 txTmp.ins.forEach(function (input, i) {
11146 if (i === inIndex) return
11147
11148 input.sequence = 0
11149 })
11150
11151 // SIGHASH_SINGLE: ignore all outputs, except at the same index?
11152 } else if ((hashType & 0x1f) === Transaction.SIGHASH_SINGLE) {
11153 // https://github.com/bitcoin/bitcoin/blob/master/src/test/sighash_tests.cpp#L60
11154 if (inIndex >= this.outs.length) return ONE
11155
11156 // truncate outputs after
11157 txTmp.outs.length = inIndex + 1
11158
11159 // "blank" outputs before
11160 for (var i = 0; i < inIndex; i++) {
11161 txTmp.outs[i] = BLANK_OUTPUT
11162 }
11163
11164 // ignore sequence numbers (except at inIndex)
11165 txTmp.ins.forEach(function (input, y) {
11166 if (y === inIndex) return
11167
11168 input.sequence = 0
11169 })
11170 }
11171
11172 // SIGHASH_ANYONECANPAY: ignore inputs entirely?
11173 if (hashType & Transaction.SIGHASH_ANYONECANPAY) {
11174 txTmp.ins = [txTmp.ins[inIndex]]
11175 txTmp.ins[0].script = ourScript
11176
11177 // SIGHASH_ALL: only ignore input scripts
11178 } else {
11179 // "blank" others input scripts
11180 txTmp.ins.forEach(function (input) { input.script = EMPTY_SCRIPT })
11181 txTmp.ins[inIndex].script = ourScript
11182 }
11183
11184 // serialize and hash
11185 var buffer = Buffer.allocUnsafe(txTmp.__byteLength(false) + 4)
11186 buffer.writeInt32LE(hashType, buffer.length - 4)
11187 txTmp.__toBuffer(buffer, 0, false)
11188
11189 return bcrypto.hash256(buffer)
11190}
11191
11192Transaction.prototype.hashForWitnessV0 = function (inIndex, prevOutScript, value, hashType) {
11193 typeforce(types.tuple(types.UInt32, types.Buffer, types.Satoshi, types.UInt32), arguments)
11194
11195 var tbuffer, toffset
11196 function writeSlice (slice) { toffset += slice.copy(tbuffer, toffset) }
11197 function writeUInt32 (i) { toffset = tbuffer.writeUInt32LE(i, toffset) }
11198 function writeUInt64 (i) { toffset = bufferutils.writeUInt64LE(tbuffer, i, toffset) }
11199 function writeVarInt (i) {
11200 varuint.encode(i, tbuffer, toffset)
11201 toffset += varuint.encode.bytes
11202 }
11203 function writeVarSlice (slice) { writeVarInt(slice.length); writeSlice(slice) }
11204
11205 var hashOutputs = ZERO
11206 var hashPrevouts = ZERO
11207 var hashSequence = ZERO
11208
11209 if (!(hashType & Transaction.SIGHASH_ANYONECANPAY)) {
11210 tbuffer = Buffer.allocUnsafe(36 * this.ins.length)
11211 toffset = 0
11212
11213 this.ins.forEach(function (txIn) {
11214 writeSlice(txIn.hash)
11215 writeUInt32(txIn.index)
11216 })
11217
11218 hashPrevouts = bcrypto.hash256(tbuffer)
11219 }
11220
11221 if (!(hashType & Transaction.SIGHASH_ANYONECANPAY) &&
11222 (hashType & 0x1f) !== Transaction.SIGHASH_SINGLE &&
11223 (hashType & 0x1f) !== Transaction.SIGHASH_NONE) {
11224 tbuffer = Buffer.allocUnsafe(4 * this.ins.length)
11225 toffset = 0
11226
11227 this.ins.forEach(function (txIn) {
11228 writeUInt32(txIn.sequence)
11229 })
11230
11231 hashSequence = bcrypto.hash256(tbuffer)
11232 }
11233
11234 if ((hashType & 0x1f) !== Transaction.SIGHASH_SINGLE &&
11235 (hashType & 0x1f) !== Transaction.SIGHASH_NONE) {
11236 var txOutsSize = this.outs.reduce(function (sum, output) {
11237 return sum + 8 + varSliceSize(output.script)
11238 }, 0)
11239
11240 tbuffer = Buffer.allocUnsafe(txOutsSize)
11241 toffset = 0
11242
11243 this.outs.forEach(function (out) {
11244 writeUInt64(out.value)
11245 writeVarSlice(out.script)
11246 })
11247
11248 hashOutputs = bcrypto.hash256(tbuffer)
11249 } else if ((hashType & 0x1f) === Transaction.SIGHASH_SINGLE && inIndex < this.outs.length) {
11250 var output = this.outs[inIndex]
11251
11252 tbuffer = Buffer.allocUnsafe(8 + varSliceSize(output.script))
11253 toffset = 0
11254 writeUInt64(output.value)
11255 writeVarSlice(output.script)
11256
11257 hashOutputs = bcrypto.hash256(tbuffer)
11258 }
11259
11260 tbuffer = Buffer.allocUnsafe(156 + varSliceSize(prevOutScript))
11261 toffset = 0
11262
11263 var input = this.ins[inIndex]
11264 writeUInt32(this.version)
11265 writeSlice(hashPrevouts)
11266 writeSlice(hashSequence)
11267 writeSlice(input.hash)
11268 writeUInt32(input.index)
11269 writeVarSlice(prevOutScript)
11270 writeUInt64(value)
11271 writeUInt32(input.sequence)
11272 writeSlice(hashOutputs)
11273 writeUInt32(this.locktime)
11274 writeUInt32(hashType)
11275 return bcrypto.hash256(tbuffer)
11276}
11277
11278Transaction.prototype.getHash = function () {
11279 return bcrypto.hash256(this.__toBuffer(undefined, undefined, false))
11280}
11281
11282Transaction.prototype.getId = function () {
11283 // transaction hash's are displayed in reverse order
11284 return this.getHash().reverse().toString('hex')
11285}
11286
11287Transaction.prototype.toBuffer = function (buffer, initialOffset) {
11288 return this.__toBuffer(buffer, initialOffset, true)
11289}
11290
11291Transaction.prototype.__toBuffer = function (buffer, initialOffset, __allowWitness) {
11292 if (!buffer) buffer = Buffer.allocUnsafe(this.__byteLength(__allowWitness))
11293
11294 var offset = initialOffset || 0
11295 function writeSlice (slice) { offset += slice.copy(buffer, offset) }
11296 function writeUInt8 (i) { offset = buffer.writeUInt8(i, offset) }
11297 function writeUInt32 (i) { offset = buffer.writeUInt32LE(i, offset) }
11298 function writeInt32 (i) { offset = buffer.writeInt32LE(i, offset) }
11299 function writeUInt64 (i) { offset = bufferutils.writeUInt64LE(buffer, i, offset) }
11300 function writeVarInt (i) {
11301 varuint.encode(i, buffer, offset)
11302 offset += varuint.encode.bytes
11303 }
11304 function writeVarSlice (slice) { writeVarInt(slice.length); writeSlice(slice) }
11305 function writeVector (vector) { writeVarInt(vector.length); vector.forEach(writeVarSlice) }
11306
11307 writeInt32(this.version)
11308
11309 var hasWitnesses = __allowWitness && this.hasWitnesses()
11310
11311 if (hasWitnesses) {
11312 writeUInt8(Transaction.ADVANCED_TRANSACTION_MARKER)
11313 writeUInt8(Transaction.ADVANCED_TRANSACTION_FLAG)
11314 }
11315
11316 writeVarInt(this.ins.length)
11317
11318 this.ins.forEach(function (txIn) {
11319 writeSlice(txIn.hash)
11320 writeUInt32(txIn.index)
11321 writeVarSlice(txIn.script)
11322 writeUInt32(txIn.sequence)
11323 })
11324
11325 writeVarInt(this.outs.length)
11326 this.outs.forEach(function (txOut) {
11327 if (!txOut.valueBuffer) {
11328 writeUInt64(txOut.value)
11329 } else {
11330 writeSlice(txOut.valueBuffer)
11331 }
11332
11333 writeVarSlice(txOut.script)
11334 })
11335
11336 if (hasWitnesses) {
11337 this.ins.forEach(function (input) {
11338 writeVector(input.witness)
11339 })
11340 }
11341
11342 writeUInt32(this.locktime)
11343
11344 // avoid slicing unless necessary
11345 if (initialOffset !== undefined) return buffer.slice(initialOffset, offset)
11346 return buffer
11347}
11348
11349Transaction.prototype.toHex = function () {
11350 return this.toBuffer().toString('hex')
11351}
11352
11353Transaction.prototype.setInputScript = function (index, scriptSig) {
11354 typeforce(types.tuple(types.Number, types.Buffer), arguments)
11355
11356 this.ins[index].script = scriptSig
11357}
11358
11359Transaction.prototype.setWitness = function (index, witness) {
11360 typeforce(types.tuple(types.Number, [types.Buffer]), arguments)
11361
11362 this.ins[index].witness = witness
11363}
11364
11365module.exports = Transaction
11366
11367},{"./bufferutils":46,"./crypto":47,"./script":54,"./types":80,"bitcoin-ops":42,"safe-buffer":101,"typeforce":112,"varuint-bitcoin":114}],79:[function(require,module,exports){
11368var Buffer = require('safe-buffer').Buffer
11369var baddress = require('./address')
11370var bcrypto = require('./crypto')
11371var bscript = require('./script')
11372var btemplates = require('./templates')
11373var networks = require('./networks')
11374var ops = require('bitcoin-ops')
11375var typeforce = require('typeforce')
11376var types = require('./types')
11377var scriptTypes = btemplates.types
11378var SIGNABLE = [btemplates.types.P2PKH, btemplates.types.P2PK, btemplates.types.MULTISIG]
11379var P2SH = SIGNABLE.concat([btemplates.types.P2WPKH, btemplates.types.P2WSH])
11380
11381var ECPair = require('./ecpair')
11382var ECSignature = require('./ecsignature')
11383var Transaction = require('./transaction')
11384
11385function supportedType (type) {
11386 return SIGNABLE.indexOf(type) !== -1
11387}
11388
11389function supportedP2SHType (type) {
11390 return P2SH.indexOf(type) !== -1
11391}
11392
11393function extractChunks (type, chunks, script) {
11394 var pubKeys = []
11395 var signatures = []
11396 switch (type) {
11397 case scriptTypes.P2PKH:
11398 // if (redeemScript) throw new Error('Nonstandard... P2SH(P2PKH)')
11399 pubKeys = chunks.slice(1)
11400 signatures = chunks.slice(0, 1)
11401 break
11402
11403 case scriptTypes.P2PK:
11404 pubKeys[0] = script ? btemplates.pubKey.output.decode(script) : undefined
11405 signatures = chunks.slice(0, 1)
11406 break
11407
11408 case scriptTypes.MULTISIG:
11409 if (script) {
11410 var multisig = btemplates.multisig.output.decode(script)
11411 pubKeys = multisig.pubKeys
11412 }
11413
11414 signatures = chunks.slice(1).map(function (chunk) {
11415 return chunk.length === 0 ? undefined : chunk
11416 })
11417 break
11418 }
11419
11420 return {
11421 pubKeys: pubKeys,
11422 signatures: signatures
11423 }
11424}
11425function expandInput (scriptSig, witnessStack) {
11426 if (scriptSig.length === 0 && witnessStack.length === 0) return {}
11427
11428 var prevOutScript
11429 var prevOutType
11430 var scriptType
11431 var script
11432 var redeemScript
11433 var witnessScript
11434 var witnessScriptType
11435 var redeemScriptType
11436 var witness = false
11437 var p2wsh = false
11438 var p2sh = false
11439 var witnessProgram
11440 var chunks
11441
11442 var scriptSigChunks = bscript.decompile(scriptSig)
11443 var sigType = btemplates.classifyInput(scriptSigChunks, true)
11444 if (sigType === scriptTypes.P2SH) {
11445 p2sh = true
11446 redeemScript = scriptSigChunks[scriptSigChunks.length - 1]
11447 redeemScriptType = btemplates.classifyOutput(redeemScript)
11448 prevOutScript = btemplates.scriptHash.output.encode(bcrypto.hash160(redeemScript))
11449 prevOutType = scriptTypes.P2SH
11450 script = redeemScript
11451 }
11452
11453 var classifyWitness = btemplates.classifyWitness(witnessStack, true)
11454 if (classifyWitness === scriptTypes.P2WSH) {
11455 witnessScript = witnessStack[witnessStack.length - 1]
11456 witnessScriptType = btemplates.classifyOutput(witnessScript)
11457 p2wsh = true
11458 witness = true
11459 if (scriptSig.length === 0) {
11460 prevOutScript = btemplates.witnessScriptHash.output.encode(bcrypto.sha256(witnessScript))
11461 prevOutType = scriptTypes.P2WSH
11462 if (redeemScript !== undefined) {
11463 throw new Error('Redeem script given when unnecessary')
11464 }
11465 // bare witness
11466 } else {
11467 if (!redeemScript) {
11468 throw new Error('No redeemScript provided for P2WSH, but scriptSig non-empty')
11469 }
11470 witnessProgram = btemplates.witnessScriptHash.output.encode(bcrypto.sha256(witnessScript))
11471 if (!redeemScript.equals(witnessProgram)) {
11472 throw new Error('Redeem script didn\'t match witnessScript')
11473 }
11474 }
11475
11476 if (!supportedType(btemplates.classifyOutput(witnessScript))) {
11477 throw new Error('unsupported witness script')
11478 }
11479
11480 script = witnessScript
11481 scriptType = witnessScriptType
11482 chunks = witnessStack.slice(0, -1)
11483 } else if (classifyWitness === scriptTypes.P2WPKH) {
11484 witness = true
11485 var key = witnessStack[witnessStack.length - 1]
11486 var keyHash = bcrypto.hash160(key)
11487 if (scriptSig.length === 0) {
11488 prevOutScript = btemplates.witnessPubKeyHash.output.encode(keyHash)
11489 prevOutType = scriptTypes.P2WPKH
11490 if (typeof redeemScript !== 'undefined') {
11491 throw new Error('Redeem script given when unnecessary')
11492 }
11493 } else {
11494 if (!redeemScript) {
11495 throw new Error('No redeemScript provided for P2WPKH, but scriptSig wasn\'t empty')
11496 }
11497 witnessProgram = btemplates.witnessPubKeyHash.output.encode(keyHash)
11498 if (!redeemScript.equals(witnessProgram)) {
11499 throw new Error('Redeem script did not have the right witness program')
11500 }
11501 }
11502
11503 scriptType = scriptTypes.P2PKH
11504 chunks = witnessStack
11505 } else if (redeemScript) {
11506 if (!supportedP2SHType(redeemScriptType)) {
11507 throw new Error('Bad redeemscript!')
11508 }
11509
11510 script = redeemScript
11511 scriptType = redeemScriptType
11512 chunks = scriptSigChunks.slice(0, -1)
11513 } else {
11514 prevOutType = scriptType = btemplates.classifyInput(scriptSig)
11515 chunks = scriptSigChunks
11516 }
11517
11518 var expanded = extractChunks(scriptType, chunks, script)
11519
11520 var result = {
11521 pubKeys: expanded.pubKeys,
11522 signatures: expanded.signatures,
11523 prevOutScript: prevOutScript,
11524 prevOutType: prevOutType,
11525 signType: scriptType,
11526 signScript: script,
11527 witness: Boolean(witness)
11528 }
11529
11530 if (p2sh) {
11531 result.redeemScript = redeemScript
11532 result.redeemScriptType = redeemScriptType
11533 }
11534
11535 if (p2wsh) {
11536 result.witnessScript = witnessScript
11537 result.witnessScriptType = witnessScriptType
11538 }
11539
11540 return result
11541}
11542
11543// could be done in expandInput, but requires the original Transaction for hashForSignature
11544function fixMultisigOrder (input, transaction, vin) {
11545 if (input.redeemScriptType !== scriptTypes.MULTISIG || !input.redeemScript) return
11546 if (input.pubKeys.length === input.signatures.length) return
11547
11548 var unmatched = input.signatures.concat()
11549
11550 input.signatures = input.pubKeys.map(function (pubKey) {
11551 var keyPair = ECPair.fromPublicKeyBuffer(pubKey)
11552 var match
11553
11554 // check for a signature
11555 unmatched.some(function (signature, i) {
11556 // skip if undefined || OP_0
11557 if (!signature) return false
11558
11559 // TODO: avoid O(n) hashForSignature
11560 var parsed = ECSignature.parseScriptSignature(signature)
11561 var hash = transaction.hashForSignature(vin, input.redeemScript, parsed.hashType)
11562
11563 // skip if signature does not match pubKey
11564 if (!keyPair.verify(hash, parsed.signature)) return false
11565
11566 // remove matched signature from unmatched
11567 unmatched[i] = undefined
11568 match = signature
11569
11570 return true
11571 })
11572
11573 return match
11574 })
11575}
11576
11577function expandOutput (script, scriptType, ourPubKey) {
11578 typeforce(types.Buffer, script)
11579
11580 var scriptChunks = bscript.decompile(script)
11581 if (!scriptType) {
11582 scriptType = btemplates.classifyOutput(script)
11583 }
11584
11585 var pubKeys = []
11586
11587 switch (scriptType) {
11588 // does our hash160(pubKey) match the output scripts?
11589 case scriptTypes.P2PKH:
11590 if (!ourPubKey) break
11591
11592 var pkh1 = scriptChunks[2]
11593 var pkh2 = bcrypto.hash160(ourPubKey)
11594 if (pkh1.equals(pkh2)) pubKeys = [ourPubKey]
11595 break
11596
11597 // does our hash160(pubKey) match the output scripts?
11598 case scriptTypes.P2WPKH:
11599 if (!ourPubKey) break
11600
11601 var wpkh1 = scriptChunks[1]
11602 var wpkh2 = bcrypto.hash160(ourPubKey)
11603 if (wpkh1.equals(wpkh2)) pubKeys = [ourPubKey]
11604 break
11605
11606 case scriptTypes.P2PK:
11607 pubKeys = scriptChunks.slice(0, 1)
11608 break
11609
11610 case scriptTypes.MULTISIG:
11611 pubKeys = scriptChunks.slice(1, -2)
11612 break
11613
11614 default: return { scriptType: scriptType }
11615 }
11616
11617 return {
11618 pubKeys: pubKeys,
11619 scriptType: scriptType,
11620 signatures: pubKeys.map(function () { return undefined })
11621 }
11622}
11623
11624function checkP2SHInput (input, redeemScriptHash) {
11625 if (input.prevOutType) {
11626 if (input.prevOutType !== scriptTypes.P2SH) throw new Error('PrevOutScript must be P2SH')
11627
11628 var prevOutScriptScriptHash = bscript.decompile(input.prevOutScript)[1]
11629 if (!prevOutScriptScriptHash.equals(redeemScriptHash)) throw new Error('Inconsistent hash160(RedeemScript)')
11630 }
11631}
11632
11633function checkP2WSHInput (input, witnessScriptHash) {
11634 if (input.prevOutType) {
11635 if (input.prevOutType !== scriptTypes.P2WSH) throw new Error('PrevOutScript must be P2WSH')
11636
11637 var scriptHash = bscript.decompile(input.prevOutScript)[1]
11638 if (!scriptHash.equals(witnessScriptHash)) throw new Error('Inconsistent sha25(WitnessScript)')
11639 }
11640}
11641
11642function prepareInput (input, kpPubKey, redeemScript, witnessValue, witnessScript) {
11643 var expanded
11644 var prevOutType
11645 var prevOutScript
11646
11647 var p2sh = false
11648 var p2shType
11649 var redeemScriptHash
11650
11651 var witness = false
11652 var p2wsh = false
11653 var witnessType
11654 var witnessScriptHash
11655
11656 var signType
11657 var signScript
11658
11659 if (redeemScript && witnessScript) {
11660 redeemScriptHash = bcrypto.hash160(redeemScript)
11661 witnessScriptHash = bcrypto.sha256(witnessScript)
11662 checkP2SHInput(input, redeemScriptHash)
11663
11664 if (!redeemScript.equals(btemplates.witnessScriptHash.output.encode(witnessScriptHash))) throw new Error('Witness script inconsistent with redeem script')
11665
11666 expanded = expandOutput(witnessScript, undefined, kpPubKey)
11667 if (!expanded.pubKeys) throw new Error('WitnessScript not supported "' + bscript.toASM(redeemScript) + '"')
11668
11669 prevOutType = btemplates.types.P2SH
11670 prevOutScript = btemplates.scriptHash.output.encode(redeemScriptHash)
11671 p2sh = witness = p2wsh = true
11672 p2shType = btemplates.types.P2WSH
11673 signType = witnessType = expanded.scriptType
11674 signScript = witnessScript
11675 } else if (redeemScript) {
11676 redeemScriptHash = bcrypto.hash160(redeemScript)
11677 checkP2SHInput(input, redeemScriptHash)
11678
11679 expanded = expandOutput(redeemScript, undefined, kpPubKey)
11680 if (!expanded.pubKeys) throw new Error('RedeemScript not supported "' + bscript.toASM(redeemScript) + '"')
11681
11682 prevOutType = btemplates.types.P2SH
11683 prevOutScript = btemplates.scriptHash.output.encode(redeemScriptHash)
11684 p2sh = true
11685 signType = p2shType = expanded.scriptType
11686 signScript = redeemScript
11687 witness = signType === btemplates.types.P2WPKH
11688 } else if (witnessScript) {
11689 witnessScriptHash = bcrypto.sha256(witnessScript)
11690 checkP2WSHInput(input, witnessScriptHash)
11691
11692 expanded = expandOutput(witnessScript, undefined, kpPubKey)
11693 if (!expanded.pubKeys) throw new Error('WitnessScript not supported "' + bscript.toASM(redeemScript) + '"')
11694
11695 prevOutType = btemplates.types.P2WSH
11696 prevOutScript = btemplates.witnessScriptHash.output.encode(witnessScriptHash)
11697 witness = p2wsh = true
11698 signType = witnessType = expanded.scriptType
11699 signScript = witnessScript
11700 } else if (input.prevOutType) {
11701 // embedded scripts are not possible without a redeemScript
11702 if (input.prevOutType === scriptTypes.P2SH ||
11703 input.prevOutType === scriptTypes.P2WSH) {
11704 throw new Error('PrevOutScript is ' + input.prevOutType + ', requires redeemScript')
11705 }
11706
11707 prevOutType = input.prevOutType
11708 prevOutScript = input.prevOutScript
11709 expanded = expandOutput(input.prevOutScript, input.prevOutType, kpPubKey)
11710 if (!expanded.pubKeys) return
11711
11712 witness = (input.prevOutType === scriptTypes.P2WPKH)
11713 signType = prevOutType
11714 signScript = prevOutScript
11715 } else {
11716 prevOutScript = btemplates.pubKeyHash.output.encode(bcrypto.hash160(kpPubKey))
11717 expanded = expandOutput(prevOutScript, scriptTypes.P2PKH, kpPubKey)
11718
11719 prevOutType = scriptTypes.P2PKH
11720 witness = false
11721 signType = prevOutType
11722 signScript = prevOutScript
11723 }
11724
11725 if (signType === scriptTypes.P2WPKH) {
11726 signScript = btemplates.pubKeyHash.output.encode(btemplates.witnessPubKeyHash.output.decode(signScript))
11727 }
11728
11729 if (p2sh) {
11730 input.redeemScript = redeemScript
11731 input.redeemScriptType = p2shType
11732 }
11733
11734 if (p2wsh) {
11735 input.witnessScript = witnessScript
11736 input.witnessScriptType = witnessType
11737 }
11738
11739 input.pubKeys = expanded.pubKeys
11740 input.signatures = expanded.signatures
11741 input.signScript = signScript
11742 input.signType = signType
11743 input.prevOutScript = prevOutScript
11744 input.prevOutType = prevOutType
11745 input.witness = witness
11746}
11747
11748function buildStack (type, signatures, pubKeys, allowIncomplete) {
11749 if (type === scriptTypes.P2PKH) {
11750 if (signatures.length === 1 && Buffer.isBuffer(signatures[0]) && pubKeys.length === 1) return btemplates.pubKeyHash.input.encodeStack(signatures[0], pubKeys[0])
11751 } else if (type === scriptTypes.P2PK) {
11752 if (signatures.length === 1 && Buffer.isBuffer(signatures[0])) return btemplates.pubKey.input.encodeStack(signatures[0])
11753 } else if (type === scriptTypes.MULTISIG) {
11754 if (signatures.length > 0) {
11755 signatures = signatures.map(function (signature) {
11756 return signature || ops.OP_0
11757 })
11758 if (!allowIncomplete) {
11759 // remove blank signatures
11760 signatures = signatures.filter(function (x) { return x !== ops.OP_0 })
11761 }
11762
11763 return btemplates.multisig.input.encodeStack(signatures)
11764 }
11765 } else {
11766 throw new Error('Not yet supported')
11767 }
11768
11769 if (!allowIncomplete) throw new Error('Not enough signatures provided')
11770 return []
11771}
11772
11773function buildInput (input, allowIncomplete) {
11774 var scriptType = input.prevOutType
11775 var sig = []
11776 var witness = []
11777
11778 if (supportedType(scriptType)) {
11779 sig = buildStack(scriptType, input.signatures, input.pubKeys, allowIncomplete)
11780 }
11781
11782 var p2sh = false
11783 if (scriptType === btemplates.types.P2SH) {
11784 // We can remove this error later when we have a guarantee prepareInput
11785 // rejects unsignable scripts - it MUST be signable at this point.
11786 if (!allowIncomplete && !supportedP2SHType(input.redeemScriptType)) {
11787 throw new Error('Impossible to sign this type')
11788 }
11789
11790 if (supportedType(input.redeemScriptType)) {
11791 sig = buildStack(input.redeemScriptType, input.signatures, input.pubKeys, allowIncomplete)
11792 }
11793
11794 // If it wasn't SIGNABLE, it's witness, defer to that
11795 if (input.redeemScriptType) {
11796 p2sh = true
11797 scriptType = input.redeemScriptType
11798 }
11799 }
11800
11801 switch (scriptType) {
11802 // P2WPKH is a special case of P2PKH
11803 case btemplates.types.P2WPKH:
11804 witness = buildStack(btemplates.types.P2PKH, input.signatures, input.pubKeys, allowIncomplete)
11805 break
11806
11807 case btemplates.types.P2WSH:
11808 // We can remove this check later
11809 if (!allowIncomplete && !supportedType(input.witnessScriptType)) {
11810 throw new Error('Impossible to sign this type')
11811 }
11812
11813 if (supportedType(input.witnessScriptType)) {
11814 witness = buildStack(input.witnessScriptType, input.signatures, input.pubKeys, allowIncomplete)
11815 witness.push(input.witnessScript)
11816 scriptType = input.witnessScriptType
11817 }
11818
11819 break
11820 }
11821
11822 // append redeemScript if necessary
11823 if (p2sh) {
11824 sig.push(input.redeemScript)
11825 }
11826
11827 return {
11828 type: scriptType,
11829 script: bscript.compile(sig),
11830 witness: witness
11831 }
11832}
11833
11834function TransactionBuilder (network, maximumFeeRate) {
11835 this.prevTxMap = {}
11836 this.network = network || networks.bitcoin
11837
11838 // WARNING: This is __NOT__ to be relied on, its just another potential safety mechanism (safety in-depth)
11839 this.maximumFeeRate = maximumFeeRate || 2500
11840
11841 this.inputs = []
11842 this.tx = new Transaction()
11843}
11844
11845TransactionBuilder.prototype.setLockTime = function (locktime) {
11846 typeforce(types.UInt32, locktime)
11847
11848 // if any signatures exist, throw
11849 if (this.inputs.some(function (input) {
11850 if (!input.signatures) return false
11851
11852 return input.signatures.some(function (s) { return s })
11853 })) {
11854 throw new Error('No, this would invalidate signatures')
11855 }
11856
11857 this.tx.locktime = locktime
11858}
11859
11860TransactionBuilder.prototype.setVersion = function (version) {
11861 typeforce(types.UInt32, version)
11862
11863 // XXX: this might eventually become more complex depending on what the versions represent
11864 this.tx.version = version
11865}
11866
11867TransactionBuilder.fromTransaction = function (transaction, network) {
11868 var txb = new TransactionBuilder(network)
11869
11870 // Copy transaction fields
11871 txb.setVersion(transaction.version)
11872 txb.setLockTime(transaction.locktime)
11873
11874 // Copy outputs (done first to avoid signature invalidation)
11875 transaction.outs.forEach(function (txOut) {
11876 txb.addOutput(txOut.script, txOut.value)
11877 })
11878
11879 // Copy inputs
11880 transaction.ins.forEach(function (txIn) {
11881 txb.__addInputUnsafe(txIn.hash, txIn.index, {
11882 sequence: txIn.sequence,
11883 script: txIn.script,
11884 witness: txIn.witness
11885 })
11886 })
11887
11888 // fix some things not possible through the public API
11889 txb.inputs.forEach(function (input, i) {
11890 fixMultisigOrder(input, transaction, i)
11891 })
11892
11893 return txb
11894}
11895
11896TransactionBuilder.prototype.addInput = function (txHash, vout, sequence, prevOutScript) {
11897 if (!this.__canModifyInputs()) {
11898 throw new Error('No, this would invalidate signatures')
11899 }
11900
11901 var value
11902
11903 // is it a hex string?
11904 if (typeof txHash === 'string') {
11905 // transaction hashs's are displayed in reverse order, un-reverse it
11906 txHash = Buffer.from(txHash, 'hex').reverse()
11907
11908 // is it a Transaction object?
11909 } else if (txHash instanceof Transaction) {
11910 var txOut = txHash.outs[vout]
11911 prevOutScript = txOut.script
11912 value = txOut.value
11913
11914 txHash = txHash.getHash()
11915 }
11916
11917 return this.__addInputUnsafe(txHash, vout, {
11918 sequence: sequence,
11919 prevOutScript: prevOutScript,
11920 value: value
11921 })
11922}
11923
11924TransactionBuilder.prototype.__addInputUnsafe = function (txHash, vout, options) {
11925 if (Transaction.isCoinbaseHash(txHash)) {
11926 throw new Error('coinbase inputs not supported')
11927 }
11928
11929 var prevTxOut = txHash.toString('hex') + ':' + vout
11930 if (this.prevTxMap[prevTxOut] !== undefined) throw new Error('Duplicate TxOut: ' + prevTxOut)
11931
11932 var input = {}
11933
11934 // derive what we can from the scriptSig
11935 if (options.script !== undefined) {
11936 input = expandInput(options.script, options.witness || [])
11937 }
11938
11939 // if an input value was given, retain it
11940 if (options.value !== undefined) {
11941 input.value = options.value
11942 }
11943
11944 // derive what we can from the previous transactions output script
11945 if (!input.prevOutScript && options.prevOutScript) {
11946 var prevOutType
11947
11948 if (!input.pubKeys && !input.signatures) {
11949 var expanded = expandOutput(options.prevOutScript)
11950
11951 if (expanded.pubKeys) {
11952 input.pubKeys = expanded.pubKeys
11953 input.signatures = expanded.signatures
11954 }
11955
11956 prevOutType = expanded.scriptType
11957 }
11958
11959 input.prevOutScript = options.prevOutScript
11960 input.prevOutType = prevOutType || btemplates.classifyOutput(options.prevOutScript)
11961 }
11962
11963 var vin = this.tx.addInput(txHash, vout, options.sequence, options.scriptSig)
11964 this.inputs[vin] = input
11965 this.prevTxMap[prevTxOut] = vin
11966 return vin
11967}
11968
11969TransactionBuilder.prototype.addOutput = function (scriptPubKey, value) {
11970 if (!this.__canModifyOutputs()) {
11971 throw new Error('No, this would invalidate signatures')
11972 }
11973
11974 // Attempt to get a script if it's a base58 address string
11975 if (typeof scriptPubKey === 'string') {
11976 scriptPubKey = baddress.toOutputScript(scriptPubKey, this.network)
11977 }
11978
11979 return this.tx.addOutput(scriptPubKey, value)
11980}
11981
11982TransactionBuilder.prototype.build = function () {
11983 return this.__build(false)
11984}
11985TransactionBuilder.prototype.buildIncomplete = function () {
11986 return this.__build(true)
11987}
11988
11989TransactionBuilder.prototype.__build = function (allowIncomplete) {
11990 if (!allowIncomplete) {
11991 if (!this.tx.ins.length) throw new Error('Transaction has no inputs')
11992 if (!this.tx.outs.length) throw new Error('Transaction has no outputs')
11993 }
11994
11995 var tx = this.tx.clone()
11996 // Create script signatures from inputs
11997 this.inputs.forEach(function (input, i) {
11998 var scriptType = input.witnessScriptType || input.redeemScriptType || input.prevOutType
11999 if (!scriptType && !allowIncomplete) throw new Error('Transaction is not complete')
12000 var result = buildInput(input, allowIncomplete)
12001
12002 // skip if no result
12003 if (!allowIncomplete) {
12004 if (!supportedType(result.type) && result.type !== btemplates.types.P2WPKH) {
12005 throw new Error(result.type + ' not supported')
12006 }
12007 }
12008
12009 tx.setInputScript(i, result.script)
12010 tx.setWitness(i, result.witness)
12011 })
12012
12013 if (!allowIncomplete) {
12014 // do not rely on this, its merely a last resort
12015 if (this.__overMaximumFees(tx.virtualSize())) {
12016 throw new Error('Transaction has absurd fees')
12017 }
12018 }
12019
12020 return tx
12021}
12022
12023function canSign (input) {
12024 return input.prevOutScript !== undefined &&
12025 input.signScript !== undefined &&
12026 input.pubKeys !== undefined &&
12027 input.signatures !== undefined &&
12028 input.signatures.length === input.pubKeys.length &&
12029 input.pubKeys.length > 0 &&
12030 (
12031 input.witness === false ||
12032 (input.witness === true && input.value !== undefined)
12033 )
12034}
12035
12036TransactionBuilder.prototype.sign = function (vin, keyPair, redeemScript, hashType, witnessValue, witnessScript) {
12037 // TODO: remove keyPair.network matching in 4.0.0
12038 if (keyPair.network && keyPair.network !== this.network) throw new TypeError('Inconsistent network')
12039 if (!this.inputs[vin]) throw new Error('No input at index: ' + vin)
12040 hashType = hashType || Transaction.SIGHASH_ALL
12041
12042 var input = this.inputs[vin]
12043
12044 // if redeemScript was previously provided, enforce consistency
12045 if (input.redeemScript !== undefined &&
12046 redeemScript &&
12047 !input.redeemScript.equals(redeemScript)) {
12048 throw new Error('Inconsistent redeemScript')
12049 }
12050
12051 var kpPubKey = keyPair.publicKey || keyPair.getPublicKeyBuffer()
12052 if (!canSign(input)) {
12053 if (witnessValue !== undefined) {
12054 if (input.value !== undefined && input.value !== witnessValue) throw new Error('Input didn\'t match witnessValue')
12055 typeforce(types.Satoshi, witnessValue)
12056 input.value = witnessValue
12057 }
12058
12059 if (!canSign(input)) prepareInput(input, kpPubKey, redeemScript, witnessValue, witnessScript)
12060 if (!canSign(input)) throw Error(input.prevOutType + ' not supported')
12061 }
12062
12063 // ready to sign
12064 var signatureHash
12065 if (input.witness) {
12066 signatureHash = this.tx.hashForWitnessV0(vin, input.signScript, input.value, hashType)
12067 } else {
12068 signatureHash = this.tx.hashForSignature(vin, input.signScript, hashType)
12069 }
12070
12071 // enforce in order signing of public keys
12072 var signed = input.pubKeys.some(function (pubKey, i) {
12073 if (!kpPubKey.equals(pubKey)) return false
12074 if (input.signatures[i]) throw new Error('Signature already exists')
12075 if (kpPubKey.length !== 33 &&
12076 input.signType === scriptTypes.P2WPKH) throw new Error('BIP143 rejects uncompressed public keys in P2WPKH or P2WSH')
12077
12078 var signature = keyPair.sign(signatureHash)
12079 if (Buffer.isBuffer(signature)) signature = ECSignature.fromRSBuffer(signature)
12080
12081 input.signatures[i] = signature.toScriptSignature(hashType)
12082 return true
12083 })
12084
12085 if (!signed) throw new Error('Key pair cannot sign for this input')
12086}
12087
12088function signatureHashType (buffer) {
12089 return buffer.readUInt8(buffer.length - 1)
12090}
12091
12092TransactionBuilder.prototype.__canModifyInputs = function () {
12093 return this.inputs.every(function (input) {
12094 // any signatures?
12095 if (input.signatures === undefined) return true
12096
12097 return input.signatures.every(function (signature) {
12098 if (!signature) return true
12099 var hashType = signatureHashType(signature)
12100
12101 // if SIGHASH_ANYONECANPAY is set, signatures would not
12102 // be invalidated by more inputs
12103 return hashType & Transaction.SIGHASH_ANYONECANPAY
12104 })
12105 })
12106}
12107
12108TransactionBuilder.prototype.__canModifyOutputs = function () {
12109 var nInputs = this.tx.ins.length
12110 var nOutputs = this.tx.outs.length
12111
12112 return this.inputs.every(function (input) {
12113 if (input.signatures === undefined) return true
12114
12115 return input.signatures.every(function (signature) {
12116 if (!signature) return true
12117 var hashType = signatureHashType(signature)
12118
12119 var hashTypeMod = hashType & 0x1f
12120 if (hashTypeMod === Transaction.SIGHASH_NONE) return true
12121 if (hashTypeMod === Transaction.SIGHASH_SINGLE) {
12122 // if SIGHASH_SINGLE is set, and nInputs > nOutputs
12123 // some signatures would be invalidated by the addition
12124 // of more outputs
12125 return nInputs <= nOutputs
12126 }
12127 })
12128 })
12129}
12130
12131TransactionBuilder.prototype.__overMaximumFees = function (bytes) {
12132 // not all inputs will have .value defined
12133 var incoming = this.inputs.reduce(function (a, x) { return a + (x.value >>> 0) }, 0)
12134
12135 // but all outputs do, and if we have any input value
12136 // we can immediately determine if the outputs are too small
12137 var outgoing = this.tx.outs.reduce(function (a, x) { return a + x.value }, 0)
12138 var fee = incoming - outgoing
12139 var feeRate = fee / bytes
12140
12141 return feeRate > this.maximumFeeRate
12142}
12143
12144module.exports = TransactionBuilder
12145
12146},{"./address":44,"./crypto":47,"./ecpair":49,"./ecsignature":50,"./networks":53,"./script":54,"./templates":56,"./transaction":78,"./types":80,"bitcoin-ops":42,"safe-buffer":101,"typeforce":112}],80:[function(require,module,exports){
12147var typeforce = require('typeforce')
12148
12149var UINT31_MAX = Math.pow(2, 31) - 1
12150function UInt31 (value) {
12151 return typeforce.UInt32(value) && value <= UINT31_MAX
12152}
12153
12154function BIP32Path (value) {
12155 return typeforce.String(value) && value.match(/^(m\/)?(\d+'?\/)*\d+'?$/)
12156}
12157BIP32Path.toJSON = function () { return 'BIP32 derivation path' }
12158
12159var SATOSHI_MAX = 21 * 1e14
12160function Satoshi (value) {
12161 return typeforce.UInt53(value) && value <= SATOSHI_MAX
12162}
12163
12164// external dependent types
12165var BigInt = typeforce.quacksLike('BigInteger')
12166var ECPoint = typeforce.quacksLike('Point')
12167
12168// exposed, external API
12169var ECSignature = typeforce.compile({ r: BigInt, s: BigInt })
12170var Network = typeforce.compile({
12171 messagePrefix: typeforce.oneOf(typeforce.Buffer, typeforce.String),
12172 bip32: {
12173 public: typeforce.UInt32,
12174 private: typeforce.UInt32
12175 },
12176 pubKeyHash: typeforce.oneOf(typeforce.UInt8, typeforce.UInt16),
12177 scriptHash: typeforce.oneOf(typeforce.UInt8, typeforce.UInt16),
12178 wif: typeforce.UInt8
12179})
12180
12181// extend typeforce types with ours
12182var types = {
12183 BigInt: BigInt,
12184 BIP32Path: BIP32Path,
12185 Buffer256bit: typeforce.BufferN(32),
12186 ECPoint: ECPoint,
12187 ECSignature: ECSignature,
12188 Hash160bit: typeforce.BufferN(20),
12189 Hash256bit: typeforce.BufferN(32),
12190 Network: Network,
12191 Satoshi: Satoshi,
12192 UInt31: UInt31
12193}
12194
12195for (var typeName in typeforce) {
12196 types[typeName] = typeforce[typeName]
12197}
12198
12199module.exports = types
12200
12201},{"typeforce":112}],81:[function(require,module,exports){
12202var basex = require('base-x')
12203var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
12204
12205module.exports = basex(ALPHABET)
12206
12207},{"base-x":35}],82:[function(require,module,exports){
12208'use strict'
12209
12210var base58 = require('bs58')
12211var Buffer = require('safe-buffer').Buffer
12212
12213module.exports = function (checksumFn) {
12214 // Encode a buffer as a base58-check encoded string
12215 function encode (payload) {
12216 var checksum = checksumFn(payload)
12217
12218 return base58.encode(Buffer.concat([
12219 payload,
12220 checksum
12221 ], payload.length + 4))
12222 }
12223
12224 function decodeRaw (buffer) {
12225 var payload = buffer.slice(0, -4)
12226 var checksum = buffer.slice(-4)
12227 var newChecksum = checksumFn(payload)
12228
12229 if (checksum[0] ^ newChecksum[0] |
12230 checksum[1] ^ newChecksum[1] |
12231 checksum[2] ^ newChecksum[2] |
12232 checksum[3] ^ newChecksum[3]) return
12233
12234 return payload
12235 }
12236
12237 // Decode a base58-check encoded string to a buffer, no result if checksum is wrong
12238 function decodeUnsafe (string) {
12239 var buffer = base58.decodeUnsafe(string)
12240 if (!buffer) return
12241
12242 return decodeRaw(buffer)
12243 }
12244
12245 function decode (string) {
12246 var buffer = base58.decode(string)
12247 var payload = decodeRaw(buffer, checksumFn)
12248 if (!payload) throw new Error('Invalid checksum')
12249 return payload
12250 }
12251
12252 return {
12253 encode: encode,
12254 decode: decode,
12255 decodeUnsafe: decodeUnsafe
12256 }
12257}
12258
12259},{"bs58":81,"safe-buffer":101}],83:[function(require,module,exports){
12260'use strict'
12261
12262var createHash = require('create-hash')
12263var bs58checkBase = require('./base')
12264
12265// SHA256(SHA256(buffer))
12266function sha256x2 (buffer) {
12267 var tmp = createHash('sha256').update(buffer).digest()
12268 return createHash('sha256').update(tmp).digest()
12269}
12270
12271module.exports = bs58checkBase(sha256x2)
12272
12273},{"./base":82,"create-hash":85}],84:[function(require,module,exports){
12274var Buffer = require('safe-buffer').Buffer
12275var Transform = require('stream').Transform
12276var StringDecoder = require('string_decoder').StringDecoder
12277var inherits = require('inherits')
12278
12279function CipherBase (hashMode) {
12280 Transform.call(this)
12281 this.hashMode = typeof hashMode === 'string'
12282 if (this.hashMode) {
12283 this[hashMode] = this._finalOrDigest
12284 } else {
12285 this.final = this._finalOrDigest
12286 }
12287 if (this._final) {
12288 this.__final = this._final
12289 this._final = null
12290 }
12291 this._decoder = null
12292 this._encoding = null
12293}
12294inherits(CipherBase, Transform)
12295
12296CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
12297 if (typeof data === 'string') {
12298 data = Buffer.from(data, inputEnc)
12299 }
12300
12301 var outData = this._update(data)
12302 if (this.hashMode) return this
12303
12304 if (outputEnc) {
12305 outData = this._toString(outData, outputEnc)
12306 }
12307
12308 return outData
12309}
12310
12311CipherBase.prototype.setAutoPadding = function () {}
12312CipherBase.prototype.getAuthTag = function () {
12313 throw new Error('trying to get auth tag in unsupported state')
12314}
12315
12316CipherBase.prototype.setAuthTag = function () {
12317 throw new Error('trying to set auth tag in unsupported state')
12318}
12319
12320CipherBase.prototype.setAAD = function () {
12321 throw new Error('trying to set aad in unsupported state')
12322}
12323
12324CipherBase.prototype._transform = function (data, _, next) {
12325 var err
12326 try {
12327 if (this.hashMode) {
12328 this._update(data)
12329 } else {
12330 this.push(this._update(data))
12331 }
12332 } catch (e) {
12333 err = e
12334 } finally {
12335 next(err)
12336 }
12337}
12338CipherBase.prototype._flush = function (done) {
12339 var err
12340 try {
12341 this.push(this.__final())
12342 } catch (e) {
12343 err = e
12344 }
12345
12346 done(err)
12347}
12348CipherBase.prototype._finalOrDigest = function (outputEnc) {
12349 var outData = this.__final() || Buffer.alloc(0)
12350 if (outputEnc) {
12351 outData = this._toString(outData, outputEnc, true)
12352 }
12353 return outData
12354}
12355
12356CipherBase.prototype._toString = function (value, enc, fin) {
12357 if (!this._decoder) {
12358 this._decoder = new StringDecoder(enc)
12359 this._encoding = enc
12360 }
12361
12362 if (this._encoding !== enc) throw new Error('can\'t switch encodings')
12363
12364 var out = this._decoder.write(value)
12365 if (fin) {
12366 out += this._decoder.end()
12367 }
12368
12369 return out
12370}
12371
12372module.exports = CipherBase
12373
12374},{"inherits":96,"safe-buffer":101,"stream":28,"string_decoder":29}],85:[function(require,module,exports){
12375(function (Buffer){
12376'use strict'
12377var inherits = require('inherits')
12378var md5 = require('./md5')
12379var RIPEMD160 = require('ripemd160')
12380var sha = require('sha.js')
12381
12382var Base = require('cipher-base')
12383
12384function HashNoConstructor (hash) {
12385 Base.call(this, 'digest')
12386
12387 this._hash = hash
12388 this.buffers = []
12389}
12390
12391inherits(HashNoConstructor, Base)
12392
12393HashNoConstructor.prototype._update = function (data) {
12394 this.buffers.push(data)
12395}
12396
12397HashNoConstructor.prototype._final = function () {
12398 var buf = Buffer.concat(this.buffers)
12399 var r = this._hash(buf)
12400 this.buffers = null
12401
12402 return r
12403}
12404
12405function Hash (hash) {
12406 Base.call(this, 'digest')
12407
12408 this._hash = hash
12409}
12410
12411inherits(Hash, Base)
12412
12413Hash.prototype._update = function (data) {
12414 this._hash.update(data)
12415}
12416
12417Hash.prototype._final = function () {
12418 return this._hash.digest()
12419}
12420
12421module.exports = function createHash (alg) {
12422 alg = alg.toLowerCase()
12423 if (alg === 'md5') return new HashNoConstructor(md5)
12424 if (alg === 'rmd160' || alg === 'ripemd160') return new Hash(new RIPEMD160())
12425
12426 return new Hash(sha(alg))
12427}
12428
12429}).call(this,require("buffer").Buffer)
12430},{"./md5":87,"buffer":5,"cipher-base":84,"inherits":96,"ripemd160":100,"sha.js":103}],86:[function(require,module,exports){
12431(function (Buffer){
12432'use strict'
12433var intSize = 4
12434var zeroBuffer = new Buffer(intSize)
12435zeroBuffer.fill(0)
12436
12437var charSize = 8
12438var hashSize = 16
12439
12440function toArray (buf) {
12441 if ((buf.length % intSize) !== 0) {
12442 var len = buf.length + (intSize - (buf.length % intSize))
12443 buf = Buffer.concat([buf, zeroBuffer], len)
12444 }
12445
12446 var arr = new Array(buf.length >>> 2)
12447 for (var i = 0, j = 0; i < buf.length; i += intSize, j++) {
12448 arr[j] = buf.readInt32LE(i)
12449 }
12450
12451 return arr
12452}
12453
12454module.exports = function hash (buf, fn) {
12455 var arr = fn(toArray(buf), buf.length * charSize)
12456 buf = new Buffer(hashSize)
12457 for (var i = 0; i < arr.length; i++) {
12458 buf.writeInt32LE(arr[i], i << 2, true)
12459 }
12460 return buf
12461}
12462
12463}).call(this,require("buffer").Buffer)
12464},{"buffer":5}],87:[function(require,module,exports){
12465'use strict'
12466/*
12467 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
12468 * Digest Algorithm, as defined in RFC 1321.
12469 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
12470 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
12471 * Distributed under the BSD License
12472 * See http://pajhome.org.uk/crypt/md5 for more info.
12473 */
12474
12475var makeHash = require('./make-hash')
12476
12477/*
12478 * Calculate the MD5 of an array of little-endian words, and a bit length
12479 */
12480function core_md5 (x, len) {
12481 /* append padding */
12482 x[len >> 5] |= 0x80 << ((len) % 32)
12483 x[(((len + 64) >>> 9) << 4) + 14] = len
12484
12485 var a = 1732584193
12486 var b = -271733879
12487 var c = -1732584194
12488 var d = 271733878
12489
12490 for (var i = 0; i < x.length; i += 16) {
12491 var olda = a
12492 var oldb = b
12493 var oldc = c
12494 var oldd = d
12495
12496 a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936)
12497 d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586)
12498 c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819)
12499 b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330)
12500 a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897)
12501 d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426)
12502 c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341)
12503 b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983)
12504 a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416)
12505 d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417)
12506 c = md5_ff(c, d, a, b, x[i + 10], 17, -42063)
12507 b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162)
12508 a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682)
12509 d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101)
12510 c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290)
12511 b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329)
12512
12513 a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510)
12514 d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632)
12515 c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713)
12516 b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302)
12517 a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691)
12518 d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083)
12519 c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335)
12520 b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848)
12521 a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438)
12522 d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690)
12523 c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961)
12524 b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501)
12525 a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467)
12526 d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784)
12527 c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473)
12528 b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734)
12529
12530 a = md5_hh(a, b, c, d, x[i + 5], 4, -378558)
12531 d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463)
12532 c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562)
12533 b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556)
12534 a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060)
12535 d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353)
12536 c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632)
12537 b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640)
12538 a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174)
12539 d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222)
12540 c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979)
12541 b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189)
12542 a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487)
12543 d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835)
12544 c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520)
12545 b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651)
12546
12547 a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844)
12548 d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415)
12549 c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905)
12550 b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055)
12551 a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571)
12552 d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606)
12553 c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523)
12554 b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799)
12555 a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359)
12556 d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744)
12557 c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380)
12558 b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649)
12559 a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070)
12560 d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379)
12561 c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259)
12562 b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551)
12563
12564 a = safe_add(a, olda)
12565 b = safe_add(b, oldb)
12566 c = safe_add(c, oldc)
12567 d = safe_add(d, oldd)
12568 }
12569
12570 return [a, b, c, d]
12571}
12572
12573/*
12574 * These functions implement the four basic operations the algorithm uses.
12575 */
12576function md5_cmn (q, a, b, x, s, t) {
12577 return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
12578}
12579
12580function md5_ff (a, b, c, d, x, s, t) {
12581 return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t)
12582}
12583
12584function md5_gg (a, b, c, d, x, s, t) {
12585 return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t)
12586}
12587
12588function md5_hh (a, b, c, d, x, s, t) {
12589 return md5_cmn(b ^ c ^ d, a, b, x, s, t)
12590}
12591
12592function md5_ii (a, b, c, d, x, s, t) {
12593 return md5_cmn(c ^ (b | (~d)), a, b, x, s, t)
12594}
12595
12596/*
12597 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
12598 * to work around bugs in some JS interpreters.
12599 */
12600function safe_add (x, y) {
12601 var lsw = (x & 0xFFFF) + (y & 0xFFFF)
12602 var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
12603 return (msw << 16) | (lsw & 0xFFFF)
12604}
12605
12606/*
12607 * Bitwise rotate a 32-bit number to the left.
12608 */
12609function bit_rol (num, cnt) {
12610 return (num << cnt) | (num >>> (32 - cnt))
12611}
12612
12613module.exports = function md5 (buf) {
12614 return makeHash(buf, core_md5)
12615}
12616
12617},{"./make-hash":86}],88:[function(require,module,exports){
12618'use strict'
12619var inherits = require('inherits')
12620var Legacy = require('./legacy')
12621var Base = require('cipher-base')
12622var Buffer = require('safe-buffer').Buffer
12623var md5 = require('create-hash/md5')
12624var RIPEMD160 = require('ripemd160')
12625
12626var sha = require('sha.js')
12627
12628var ZEROS = Buffer.alloc(128)
12629
12630function Hmac (alg, key) {
12631 Base.call(this, 'digest')
12632 if (typeof key === 'string') {
12633 key = Buffer.from(key)
12634 }
12635
12636 var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
12637
12638 this._alg = alg
12639 this._key = key
12640 if (key.length > blocksize) {
12641 var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
12642 key = hash.update(key).digest()
12643 } else if (key.length < blocksize) {
12644 key = Buffer.concat([key, ZEROS], blocksize)
12645 }
12646
12647 var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
12648 var opad = this._opad = Buffer.allocUnsafe(blocksize)
12649
12650 for (var i = 0; i < blocksize; i++) {
12651 ipad[i] = key[i] ^ 0x36
12652 opad[i] = key[i] ^ 0x5C
12653 }
12654 this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
12655 this._hash.update(ipad)
12656}
12657
12658inherits(Hmac, Base)
12659
12660Hmac.prototype._update = function (data) {
12661 this._hash.update(data)
12662}
12663
12664Hmac.prototype._final = function () {
12665 var h = this._hash.digest()
12666 var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)
12667 return hash.update(this._opad).update(h).digest()
12668}
12669
12670module.exports = function createHmac (alg, key) {
12671 alg = alg.toLowerCase()
12672 if (alg === 'rmd160' || alg === 'ripemd160') {
12673 return new Hmac('rmd160', key)
12674 }
12675 if (alg === 'md5') {
12676 return new Legacy(md5, key)
12677 }
12678 return new Hmac(alg, key)
12679}
12680
12681},{"./legacy":89,"cipher-base":84,"create-hash/md5":87,"inherits":96,"ripemd160":100,"safe-buffer":101,"sha.js":103}],89:[function(require,module,exports){
12682'use strict'
12683var inherits = require('inherits')
12684var Buffer = require('safe-buffer').Buffer
12685
12686var Base = require('cipher-base')
12687
12688var ZEROS = Buffer.alloc(128)
12689var blocksize = 64
12690
12691function Hmac (alg, key) {
12692 Base.call(this, 'digest')
12693 if (typeof key === 'string') {
12694 key = Buffer.from(key)
12695 }
12696
12697 this._alg = alg
12698 this._key = key
12699
12700 if (key.length > blocksize) {
12701 key = alg(key)
12702 } else if (key.length < blocksize) {
12703 key = Buffer.concat([key, ZEROS], blocksize)
12704 }
12705
12706 var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
12707 var opad = this._opad = Buffer.allocUnsafe(blocksize)
12708
12709 for (var i = 0; i < blocksize; i++) {
12710 ipad[i] = key[i] ^ 0x36
12711 opad[i] = key[i] ^ 0x5C
12712 }
12713
12714 this._hash = [ipad]
12715}
12716
12717inherits(Hmac, Base)
12718
12719Hmac.prototype._update = function (data) {
12720 this._hash.push(data)
12721}
12722
12723Hmac.prototype._final = function () {
12724 var h = this._alg(Buffer.concat(this._hash))
12725 return this._alg(Buffer.concat([this._opad, h]))
12726}
12727module.exports = Hmac
12728
12729},{"cipher-base":84,"inherits":96,"safe-buffer":101}],90:[function(require,module,exports){
12730var assert = require('assert')
12731var BigInteger = require('bigi')
12732
12733var Point = require('./point')
12734
12735function Curve (p, a, b, Gx, Gy, n, h) {
12736 this.p = p
12737 this.a = a
12738 this.b = b
12739 this.G = Point.fromAffine(this, Gx, Gy)
12740 this.n = n
12741 this.h = h
12742
12743 this.infinity = new Point(this, null, null, BigInteger.ZERO)
12744
12745 // result caching
12746 this.pOverFour = p.add(BigInteger.ONE).shiftRight(2)
12747
12748 // determine size of p in bytes
12749 this.pLength = Math.floor((this.p.bitLength() + 7) / 8)
12750}
12751
12752Curve.prototype.pointFromX = function (isOdd, x) {
12753 var alpha = x.pow(3).add(this.a.multiply(x)).add(this.b).mod(this.p)
12754 var beta = alpha.modPow(this.pOverFour, this.p) // XXX: not compatible with all curves
12755
12756 var y = beta
12757 if (beta.isEven() ^ !isOdd) {
12758 y = this.p.subtract(y) // -y % p
12759 }
12760
12761 return Point.fromAffine(this, x, y)
12762}
12763
12764Curve.prototype.isInfinity = function (Q) {
12765 if (Q === this.infinity) return true
12766
12767 return Q.z.signum() === 0 && Q.y.signum() !== 0
12768}
12769
12770Curve.prototype.isOnCurve = function (Q) {
12771 if (this.isInfinity(Q)) return true
12772
12773 var x = Q.affineX
12774 var y = Q.affineY
12775 var a = this.a
12776 var b = this.b
12777 var p = this.p
12778
12779 // Check that xQ and yQ are integers in the interval [0, p - 1]
12780 if (x.signum() < 0 || x.compareTo(p) >= 0) return false
12781 if (y.signum() < 0 || y.compareTo(p) >= 0) return false
12782
12783 // and check that y^2 = x^3 + ax + b (mod p)
12784 var lhs = y.square().mod(p)
12785 var rhs = x.pow(3).add(a.multiply(x)).add(b).mod(p)
12786 return lhs.equals(rhs)
12787}
12788
12789/**
12790 * Validate an elliptic curve point.
12791 *
12792 * See SEC 1, section 3.2.2.1: Elliptic Curve Public Key Validation Primitive
12793 */
12794Curve.prototype.validate = function (Q) {
12795 // Check Q != O
12796 assert(!this.isInfinity(Q), 'Point is at infinity')
12797 assert(this.isOnCurve(Q), 'Point is not on the curve')
12798
12799 // Check nQ = O (where Q is a scalar multiple of G)
12800 var nQ = Q.multiply(this.n)
12801 assert(this.isInfinity(nQ), 'Point is not a scalar multiple of G')
12802
12803 return true
12804}
12805
12806module.exports = Curve
12807
12808},{"./point":94,"assert":1,"bigi":39}],91:[function(require,module,exports){
12809module.exports={
12810 "secp128r1": {
12811 "p": "fffffffdffffffffffffffffffffffff",
12812 "a": "fffffffdfffffffffffffffffffffffc",
12813 "b": "e87579c11079f43dd824993c2cee5ed3",
12814 "n": "fffffffe0000000075a30d1b9038a115",
12815 "h": "01",
12816 "Gx": "161ff7528b899b2d0c28607ca52c5b86",
12817 "Gy": "cf5ac8395bafeb13c02da292dded7a83"
12818 },
12819 "secp160k1": {
12820 "p": "fffffffffffffffffffffffffffffffeffffac73",
12821 "a": "00",
12822 "b": "07",
12823 "n": "0100000000000000000001b8fa16dfab9aca16b6b3",
12824 "h": "01",
12825 "Gx": "3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",
12826 "Gy": "938cf935318fdced6bc28286531733c3f03c4fee"
12827 },
12828 "secp160r1": {
12829 "p": "ffffffffffffffffffffffffffffffff7fffffff",
12830 "a": "ffffffffffffffffffffffffffffffff7ffffffc",
12831 "b": "1c97befc54bd7a8b65acf89f81d4d4adc565fa45",
12832 "n": "0100000000000000000001f4c8f927aed3ca752257",
12833 "h": "01",
12834 "Gx": "4a96b5688ef573284664698968c38bb913cbfc82",
12835 "Gy": "23a628553168947d59dcc912042351377ac5fb32"
12836 },
12837 "secp192k1": {
12838 "p": "fffffffffffffffffffffffffffffffffffffffeffffee37",
12839 "a": "00",
12840 "b": "03",
12841 "n": "fffffffffffffffffffffffe26f2fc170f69466a74defd8d",
12842 "h": "01",
12843 "Gx": "db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",
12844 "Gy": "9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"
12845 },
12846 "secp192r1": {
12847 "p": "fffffffffffffffffffffffffffffffeffffffffffffffff",
12848 "a": "fffffffffffffffffffffffffffffffefffffffffffffffc",
12849 "b": "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",
12850 "n": "ffffffffffffffffffffffff99def836146bc9b1b4d22831",
12851 "h": "01",
12852 "Gx": "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",
12853 "Gy": "07192b95ffc8da78631011ed6b24cdd573f977a11e794811"
12854 },
12855 "secp256k1": {
12856 "p": "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",
12857 "a": "00",
12858 "b": "07",
12859 "n": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",
12860 "h": "01",
12861 "Gx": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
12862 "Gy": "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
12863 },
12864 "secp256r1": {
12865 "p": "ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",
12866 "a": "ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",
12867 "b": "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",
12868 "n": "ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",
12869 "h": "01",
12870 "Gx": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",
12871 "Gy": "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"
12872 }
12873}
12874
12875},{}],92:[function(require,module,exports){
12876var Point = require('./point')
12877var Curve = require('./curve')
12878
12879var getCurveByName = require('./names')
12880
12881module.exports = {
12882 Curve: Curve,
12883 Point: Point,
12884 getCurveByName: getCurveByName
12885}
12886
12887},{"./curve":90,"./names":93,"./point":94}],93:[function(require,module,exports){
12888var BigInteger = require('bigi')
12889
12890var curves = require('./curves.json')
12891var Curve = require('./curve')
12892
12893function getCurveByName (name) {
12894 var curve = curves[name]
12895 if (!curve) return null
12896
12897 var p = new BigInteger(curve.p, 16)
12898 var a = new BigInteger(curve.a, 16)
12899 var b = new BigInteger(curve.b, 16)
12900 var n = new BigInteger(curve.n, 16)
12901 var h = new BigInteger(curve.h, 16)
12902 var Gx = new BigInteger(curve.Gx, 16)
12903 var Gy = new BigInteger(curve.Gy, 16)
12904
12905 return new Curve(p, a, b, Gx, Gy, n, h)
12906}
12907
12908module.exports = getCurveByName
12909
12910},{"./curve":90,"./curves.json":91,"bigi":39}],94:[function(require,module,exports){
12911var assert = require('assert')
12912var Buffer = require('safe-buffer').Buffer
12913var BigInteger = require('bigi')
12914
12915var THREE = BigInteger.valueOf(3)
12916
12917function Point (curve, x, y, z) {
12918 assert.notStrictEqual(z, undefined, 'Missing Z coordinate')
12919
12920 this.curve = curve
12921 this.x = x
12922 this.y = y
12923 this.z = z
12924 this._zInv = null
12925
12926 this.compressed = true
12927}
12928
12929Object.defineProperty(Point.prototype, 'zInv', {
12930 get: function () {
12931 if (this._zInv === null) {
12932 this._zInv = this.z.modInverse(this.curve.p)
12933 }
12934
12935 return this._zInv
12936 }
12937})
12938
12939Object.defineProperty(Point.prototype, 'affineX', {
12940 get: function () {
12941 return this.x.multiply(this.zInv).mod(this.curve.p)
12942 }
12943})
12944
12945Object.defineProperty(Point.prototype, 'affineY', {
12946 get: function () {
12947 return this.y.multiply(this.zInv).mod(this.curve.p)
12948 }
12949})
12950
12951Point.fromAffine = function (curve, x, y) {
12952 return new Point(curve, x, y, BigInteger.ONE)
12953}
12954
12955Point.prototype.equals = function (other) {
12956 if (other === this) return true
12957 if (this.curve.isInfinity(this)) return this.curve.isInfinity(other)
12958 if (this.curve.isInfinity(other)) return this.curve.isInfinity(this)
12959
12960 // u = Y2 * Z1 - Y1 * Z2
12961 var u = other.y.multiply(this.z).subtract(this.y.multiply(other.z)).mod(this.curve.p)
12962
12963 if (u.signum() !== 0) return false
12964
12965 // v = X2 * Z1 - X1 * Z2
12966 var v = other.x.multiply(this.z).subtract(this.x.multiply(other.z)).mod(this.curve.p)
12967
12968 return v.signum() === 0
12969}
12970
12971Point.prototype.negate = function () {
12972 var y = this.curve.p.subtract(this.y)
12973
12974 return new Point(this.curve, this.x, y, this.z)
12975}
12976
12977Point.prototype.add = function (b) {
12978 if (this.curve.isInfinity(this)) return b
12979 if (this.curve.isInfinity(b)) return this
12980
12981 var x1 = this.x
12982 var y1 = this.y
12983 var x2 = b.x
12984 var y2 = b.y
12985
12986 // u = Y2 * Z1 - Y1 * Z2
12987 var u = y2.multiply(this.z).subtract(y1.multiply(b.z)).mod(this.curve.p)
12988 // v = X2 * Z1 - X1 * Z2
12989 var v = x2.multiply(this.z).subtract(x1.multiply(b.z)).mod(this.curve.p)
12990
12991 if (v.signum() === 0) {
12992 if (u.signum() === 0) {
12993 return this.twice() // this == b, so double
12994 }
12995
12996 return this.curve.infinity // this = -b, so infinity
12997 }
12998
12999 var v2 = v.square()
13000 var v3 = v2.multiply(v)
13001 var x1v2 = x1.multiply(v2)
13002 var zu2 = u.square().multiply(this.z)
13003
13004 // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)
13005 var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.p)
13006 // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3
13007 var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.p)
13008 // z3 = v^3 * z1 * z2
13009 var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.p)
13010
13011 return new Point(this.curve, x3, y3, z3)
13012}
13013
13014Point.prototype.twice = function () {
13015 if (this.curve.isInfinity(this)) return this
13016 if (this.y.signum() === 0) return this.curve.infinity
13017
13018 var x1 = this.x
13019 var y1 = this.y
13020
13021 var y1z1 = y1.multiply(this.z).mod(this.curve.p)
13022 var y1sqz1 = y1z1.multiply(y1).mod(this.curve.p)
13023 var a = this.curve.a
13024
13025 // w = 3 * x1^2 + a * z1^2
13026 var w = x1.square().multiply(THREE)
13027
13028 if (a.signum() !== 0) {
13029 w = w.add(this.z.square().multiply(a))
13030 }
13031
13032 w = w.mod(this.curve.p)
13033 // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)
13034 var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.p)
13035 // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3
13036 var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.pow(3)).mod(this.curve.p)
13037 // z3 = 8 * (y1 * z1)^3
13038 var z3 = y1z1.pow(3).shiftLeft(3).mod(this.curve.p)
13039
13040 return new Point(this.curve, x3, y3, z3)
13041}
13042
13043// Simple NAF (Non-Adjacent Form) multiplication algorithm
13044// TODO: modularize the multiplication algorithm
13045Point.prototype.multiply = function (k) {
13046 if (this.curve.isInfinity(this)) return this
13047 if (k.signum() === 0) return this.curve.infinity
13048
13049 var e = k
13050 var h = e.multiply(THREE)
13051
13052 var neg = this.negate()
13053 var R = this
13054
13055 for (var i = h.bitLength() - 2; i > 0; --i) {
13056 var hBit = h.testBit(i)
13057 var eBit = e.testBit(i)
13058
13059 R = R.twice()
13060
13061 if (hBit !== eBit) {
13062 R = R.add(hBit ? this : neg)
13063 }
13064 }
13065
13066 return R
13067}
13068
13069// Compute this*j + x*k (simultaneous multiplication)
13070Point.prototype.multiplyTwo = function (j, x, k) {
13071 var i = Math.max(j.bitLength(), k.bitLength()) - 1
13072 var R = this.curve.infinity
13073 var both = this.add(x)
13074
13075 while (i >= 0) {
13076 var jBit = j.testBit(i)
13077 var kBit = k.testBit(i)
13078
13079 R = R.twice()
13080
13081 if (jBit) {
13082 if (kBit) {
13083 R = R.add(both)
13084 } else {
13085 R = R.add(this)
13086 }
13087 } else if (kBit) {
13088 R = R.add(x)
13089 }
13090 --i
13091 }
13092
13093 return R
13094}
13095
13096Point.prototype.getEncoded = function (compressed) {
13097 if (compressed == null) compressed = this.compressed
13098 if (this.curve.isInfinity(this)) return Buffer.alloc(1, 0) // Infinity point encoded is simply '00'
13099
13100 var x = this.affineX
13101 var y = this.affineY
13102 var byteLength = this.curve.pLength
13103 var buffer
13104
13105 // 0x02/0x03 | X
13106 if (compressed) {
13107 buffer = Buffer.allocUnsafe(1 + byteLength)
13108 buffer.writeUInt8(y.isEven() ? 0x02 : 0x03, 0)
13109
13110 // 0x04 | X | Y
13111 } else {
13112 buffer = Buffer.allocUnsafe(1 + byteLength + byteLength)
13113 buffer.writeUInt8(0x04, 0)
13114
13115 y.toBuffer(byteLength).copy(buffer, 1 + byteLength)
13116 }
13117
13118 x.toBuffer(byteLength).copy(buffer, 1)
13119
13120 return buffer
13121}
13122
13123Point.decodeFrom = function (curve, buffer) {
13124 var type = buffer.readUInt8(0)
13125 var compressed = (type !== 4)
13126
13127 var byteLength = Math.floor((curve.p.bitLength() + 7) / 8)
13128 var x = BigInteger.fromBuffer(buffer.slice(1, 1 + byteLength))
13129
13130 var Q
13131 if (compressed) {
13132 assert.equal(buffer.length, byteLength + 1, 'Invalid sequence length')
13133 assert(type === 0x02 || type === 0x03, 'Invalid sequence tag')
13134
13135 var isOdd = (type === 0x03)
13136 Q = curve.pointFromX(isOdd, x)
13137 } else {
13138 assert.equal(buffer.length, 1 + byteLength + byteLength, 'Invalid sequence length')
13139
13140 var y = BigInteger.fromBuffer(buffer.slice(1 + byteLength))
13141 Q = Point.fromAffine(curve, x, y)
13142 }
13143
13144 Q.compressed = compressed
13145 return Q
13146}
13147
13148Point.prototype.toString = function () {
13149 if (this.curve.isInfinity(this)) return '(INFINITY)'
13150
13151 return '(' + this.affineX.toString() + ',' + this.affineY.toString() + ')'
13152}
13153
13154module.exports = Point
13155
13156},{"assert":1,"bigi":39,"safe-buffer":101}],95:[function(require,module,exports){
13157(function (Buffer){
13158'use strict'
13159var Transform = require('stream').Transform
13160var inherits = require('inherits')
13161
13162function HashBase (blockSize) {
13163 Transform.call(this)
13164
13165 this._block = new Buffer(blockSize)
13166 this._blockSize = blockSize
13167 this._blockOffset = 0
13168 this._length = [0, 0, 0, 0]
13169
13170 this._finalized = false
13171}
13172
13173inherits(HashBase, Transform)
13174
13175HashBase.prototype._transform = function (chunk, encoding, callback) {
13176 var error = null
13177 try {
13178 if (encoding !== 'buffer') chunk = new Buffer(chunk, encoding)
13179 this.update(chunk)
13180 } catch (err) {
13181 error = err
13182 }
13183
13184 callback(error)
13185}
13186
13187HashBase.prototype._flush = function (callback) {
13188 var error = null
13189 try {
13190 this.push(this._digest())
13191 } catch (err) {
13192 error = err
13193 }
13194
13195 callback(error)
13196}
13197
13198HashBase.prototype.update = function (data, encoding) {
13199 if (!Buffer.isBuffer(data) && typeof data !== 'string') throw new TypeError('Data must be a string or a buffer')
13200 if (this._finalized) throw new Error('Digest already called')
13201 if (!Buffer.isBuffer(data)) data = new Buffer(data, encoding || 'binary')
13202
13203 // consume data
13204 var block = this._block
13205 var offset = 0
13206 while (this._blockOffset + data.length - offset >= this._blockSize) {
13207 for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]
13208 this._update()
13209 this._blockOffset = 0
13210 }
13211 while (offset < data.length) block[this._blockOffset++] = data[offset++]
13212
13213 // update length
13214 for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
13215 this._length[j] += carry
13216 carry = (this._length[j] / 0x0100000000) | 0
13217 if (carry > 0) this._length[j] -= 0x0100000000 * carry
13218 }
13219
13220 return this
13221}
13222
13223HashBase.prototype._update = function (data) {
13224 throw new Error('_update is not implemented')
13225}
13226
13227HashBase.prototype.digest = function (encoding) {
13228 if (this._finalized) throw new Error('Digest already called')
13229 this._finalized = true
13230
13231 var digest = this._digest()
13232 if (encoding !== undefined) digest = digest.toString(encoding)
13233 return digest
13234}
13235
13236HashBase.prototype._digest = function () {
13237 throw new Error('_digest is not implemented')
13238}
13239
13240module.exports = HashBase
13241
13242}).call(this,require("buffer").Buffer)
13243},{"buffer":5,"inherits":96,"stream":28}],96:[function(require,module,exports){
13244arguments[4][9][0].apply(exports,arguments)
13245},{"dup":9}],97:[function(require,module,exports){
13246(function (Buffer){
13247// constant-space merkle root calculation algorithm
13248module.exports = function fastRoot (values, digestFn) {
13249 if (!Array.isArray(values)) throw TypeError('Expected values Array')
13250 if (typeof digestFn !== 'function') throw TypeError('Expected digest Function')
13251
13252 var length = values.length
13253 var results = values.concat()
13254
13255 while (length > 1) {
13256 var j = 0
13257
13258 for (var i = 0; i < length; i += 2, ++j) {
13259 var left = results[i]
13260 var right = i + 1 === length ? left : results[i + 1]
13261 var data = Buffer.concat([left, right])
13262
13263 results[j] = digestFn(data)
13264 }
13265
13266 length = j
13267 }
13268
13269 return results[0]
13270}
13271
13272}).call(this,require("buffer").Buffer)
13273},{"buffer":5}],98:[function(require,module,exports){
13274var OPS = require('bitcoin-ops')
13275
13276function encodingLength (i) {
13277 return i < OPS.OP_PUSHDATA1 ? 1
13278 : i <= 0xff ? 2
13279 : i <= 0xffff ? 3
13280 : 5
13281}
13282
13283function encode (buffer, number, offset) {
13284 var size = encodingLength(number)
13285
13286 // ~6 bit
13287 if (size === 1) {
13288 buffer.writeUInt8(number, offset)
13289
13290 // 8 bit
13291 } else if (size === 2) {
13292 buffer.writeUInt8(OPS.OP_PUSHDATA1, offset)
13293 buffer.writeUInt8(number, offset + 1)
13294
13295 // 16 bit
13296 } else if (size === 3) {
13297 buffer.writeUInt8(OPS.OP_PUSHDATA2, offset)
13298 buffer.writeUInt16LE(number, offset + 1)
13299
13300 // 32 bit
13301 } else {
13302 buffer.writeUInt8(OPS.OP_PUSHDATA4, offset)
13303 buffer.writeUInt32LE(number, offset + 1)
13304 }
13305
13306 return size
13307}
13308
13309function decode (buffer, offset) {
13310 var opcode = buffer.readUInt8(offset)
13311 var number, size
13312
13313 // ~6 bit
13314 if (opcode < OPS.OP_PUSHDATA1) {
13315 number = opcode
13316 size = 1
13317
13318 // 8 bit
13319 } else if (opcode === OPS.OP_PUSHDATA1) {
13320 if (offset + 2 > buffer.length) return null
13321 number = buffer.readUInt8(offset + 1)
13322 size = 2
13323
13324 // 16 bit
13325 } else if (opcode === OPS.OP_PUSHDATA2) {
13326 if (offset + 3 > buffer.length) return null
13327 number = buffer.readUInt16LE(offset + 1)
13328 size = 3
13329
13330 // 32 bit
13331 } else {
13332 if (offset + 5 > buffer.length) return null
13333 if (opcode !== OPS.OP_PUSHDATA4) throw new Error('Unexpected opcode')
13334
13335 number = buffer.readUInt32LE(offset + 1)
13336 size = 5
13337 }
13338
13339 return {
13340 opcode: opcode,
13341 number: number,
13342 size: size
13343 }
13344}
13345
13346module.exports = {
13347 encodingLength: encodingLength,
13348 encode: encode,
13349 decode: decode
13350}
13351
13352},{"bitcoin-ops":42}],99:[function(require,module,exports){
13353(function (process,global){
13354'use strict'
13355
13356function oldBrowser () {
13357 throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11')
13358}
13359
13360var Buffer = require('safe-buffer').Buffer
13361var crypto = global.crypto || global.msCrypto
13362
13363if (crypto && crypto.getRandomValues) {
13364 module.exports = randomBytes
13365} else {
13366 module.exports = oldBrowser
13367}
13368
13369function randomBytes (size, cb) {
13370 // phantomjs needs to throw
13371 if (size > 65536) throw new Error('requested too many random bytes')
13372 // in case browserify isn't using the Uint8Array version
13373 var rawBytes = new global.Uint8Array(size)
13374
13375 // This will not work in older browsers.
13376 // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues
13377 if (size > 0) { // getRandomValues fails on IE if size == 0
13378 crypto.getRandomValues(rawBytes)
13379 }
13380
13381 // XXX: phantomjs doesn't like a buffer being passed here
13382 var bytes = Buffer.from(rawBytes.buffer)
13383
13384 if (typeof cb === 'function') {
13385 return process.nextTick(function () {
13386 cb(null, bytes)
13387 })
13388 }
13389
13390 return bytes
13391}
13392
13393}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
13394},{"_process":13,"safe-buffer":101}],100:[function(require,module,exports){
13395(function (Buffer){
13396'use strict'
13397var inherits = require('inherits')
13398var HashBase = require('hash-base')
13399
13400function RIPEMD160 () {
13401 HashBase.call(this, 64)
13402
13403 // state
13404 this._a = 0x67452301
13405 this._b = 0xefcdab89
13406 this._c = 0x98badcfe
13407 this._d = 0x10325476
13408 this._e = 0xc3d2e1f0
13409}
13410
13411inherits(RIPEMD160, HashBase)
13412
13413RIPEMD160.prototype._update = function () {
13414 var m = new Array(16)
13415 for (var i = 0; i < 16; ++i) m[i] = this._block.readInt32LE(i * 4)
13416
13417 var al = this._a
13418 var bl = this._b
13419 var cl = this._c
13420 var dl = this._d
13421 var el = this._e
13422
13423 // Mj = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
13424 // K = 0x00000000
13425 // Sj = 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8
13426 al = fn1(al, bl, cl, dl, el, m[0], 0x00000000, 11); cl = rotl(cl, 10)
13427 el = fn1(el, al, bl, cl, dl, m[1], 0x00000000, 14); bl = rotl(bl, 10)
13428 dl = fn1(dl, el, al, bl, cl, m[2], 0x00000000, 15); al = rotl(al, 10)
13429 cl = fn1(cl, dl, el, al, bl, m[3], 0x00000000, 12); el = rotl(el, 10)
13430 bl = fn1(bl, cl, dl, el, al, m[4], 0x00000000, 5); dl = rotl(dl, 10)
13431 al = fn1(al, bl, cl, dl, el, m[5], 0x00000000, 8); cl = rotl(cl, 10)
13432 el = fn1(el, al, bl, cl, dl, m[6], 0x00000000, 7); bl = rotl(bl, 10)
13433 dl = fn1(dl, el, al, bl, cl, m[7], 0x00000000, 9); al = rotl(al, 10)
13434 cl = fn1(cl, dl, el, al, bl, m[8], 0x00000000, 11); el = rotl(el, 10)
13435 bl = fn1(bl, cl, dl, el, al, m[9], 0x00000000, 13); dl = rotl(dl, 10)
13436 al = fn1(al, bl, cl, dl, el, m[10], 0x00000000, 14); cl = rotl(cl, 10)
13437 el = fn1(el, al, bl, cl, dl, m[11], 0x00000000, 15); bl = rotl(bl, 10)
13438 dl = fn1(dl, el, al, bl, cl, m[12], 0x00000000, 6); al = rotl(al, 10)
13439 cl = fn1(cl, dl, el, al, bl, m[13], 0x00000000, 7); el = rotl(el, 10)
13440 bl = fn1(bl, cl, dl, el, al, m[14], 0x00000000, 9); dl = rotl(dl, 10)
13441 al = fn1(al, bl, cl, dl, el, m[15], 0x00000000, 8); cl = rotl(cl, 10)
13442
13443 // Mj = 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8
13444 // K = 0x5a827999
13445 // Sj = 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12
13446 el = fn2(el, al, bl, cl, dl, m[7], 0x5a827999, 7); bl = rotl(bl, 10)
13447 dl = fn2(dl, el, al, bl, cl, m[4], 0x5a827999, 6); al = rotl(al, 10)
13448 cl = fn2(cl, dl, el, al, bl, m[13], 0x5a827999, 8); el = rotl(el, 10)
13449 bl = fn2(bl, cl, dl, el, al, m[1], 0x5a827999, 13); dl = rotl(dl, 10)
13450 al = fn2(al, bl, cl, dl, el, m[10], 0x5a827999, 11); cl = rotl(cl, 10)
13451 el = fn2(el, al, bl, cl, dl, m[6], 0x5a827999, 9); bl = rotl(bl, 10)
13452 dl = fn2(dl, el, al, bl, cl, m[15], 0x5a827999, 7); al = rotl(al, 10)
13453 cl = fn2(cl, dl, el, al, bl, m[3], 0x5a827999, 15); el = rotl(el, 10)
13454 bl = fn2(bl, cl, dl, el, al, m[12], 0x5a827999, 7); dl = rotl(dl, 10)
13455 al = fn2(al, bl, cl, dl, el, m[0], 0x5a827999, 12); cl = rotl(cl, 10)
13456 el = fn2(el, al, bl, cl, dl, m[9], 0x5a827999, 15); bl = rotl(bl, 10)
13457 dl = fn2(dl, el, al, bl, cl, m[5], 0x5a827999, 9); al = rotl(al, 10)
13458 cl = fn2(cl, dl, el, al, bl, m[2], 0x5a827999, 11); el = rotl(el, 10)
13459 bl = fn2(bl, cl, dl, el, al, m[14], 0x5a827999, 7); dl = rotl(dl, 10)
13460 al = fn2(al, bl, cl, dl, el, m[11], 0x5a827999, 13); cl = rotl(cl, 10)
13461 el = fn2(el, al, bl, cl, dl, m[8], 0x5a827999, 12); bl = rotl(bl, 10)
13462
13463 // Mj = 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12
13464 // K = 0x6ed9eba1
13465 // Sj = 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5
13466 dl = fn3(dl, el, al, bl, cl, m[3], 0x6ed9eba1, 11); al = rotl(al, 10)
13467 cl = fn3(cl, dl, el, al, bl, m[10], 0x6ed9eba1, 13); el = rotl(el, 10)
13468 bl = fn3(bl, cl, dl, el, al, m[14], 0x6ed9eba1, 6); dl = rotl(dl, 10)
13469 al = fn3(al, bl, cl, dl, el, m[4], 0x6ed9eba1, 7); cl = rotl(cl, 10)
13470 el = fn3(el, al, bl, cl, dl, m[9], 0x6ed9eba1, 14); bl = rotl(bl, 10)
13471 dl = fn3(dl, el, al, bl, cl, m[15], 0x6ed9eba1, 9); al = rotl(al, 10)
13472 cl = fn3(cl, dl, el, al, bl, m[8], 0x6ed9eba1, 13); el = rotl(el, 10)
13473 bl = fn3(bl, cl, dl, el, al, m[1], 0x6ed9eba1, 15); dl = rotl(dl, 10)
13474 al = fn3(al, bl, cl, dl, el, m[2], 0x6ed9eba1, 14); cl = rotl(cl, 10)
13475 el = fn3(el, al, bl, cl, dl, m[7], 0x6ed9eba1, 8); bl = rotl(bl, 10)
13476 dl = fn3(dl, el, al, bl, cl, m[0], 0x6ed9eba1, 13); al = rotl(al, 10)
13477 cl = fn3(cl, dl, el, al, bl, m[6], 0x6ed9eba1, 6); el = rotl(el, 10)
13478 bl = fn3(bl, cl, dl, el, al, m[13], 0x6ed9eba1, 5); dl = rotl(dl, 10)
13479 al = fn3(al, bl, cl, dl, el, m[11], 0x6ed9eba1, 12); cl = rotl(cl, 10)
13480 el = fn3(el, al, bl, cl, dl, m[5], 0x6ed9eba1, 7); bl = rotl(bl, 10)
13481 dl = fn3(dl, el, al, bl, cl, m[12], 0x6ed9eba1, 5); al = rotl(al, 10)
13482
13483 // Mj = 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2
13484 // K = 0x8f1bbcdc
13485 // Sj = 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12
13486 cl = fn4(cl, dl, el, al, bl, m[1], 0x8f1bbcdc, 11); el = rotl(el, 10)
13487 bl = fn4(bl, cl, dl, el, al, m[9], 0x8f1bbcdc, 12); dl = rotl(dl, 10)
13488 al = fn4(al, bl, cl, dl, el, m[11], 0x8f1bbcdc, 14); cl = rotl(cl, 10)
13489 el = fn4(el, al, bl, cl, dl, m[10], 0x8f1bbcdc, 15); bl = rotl(bl, 10)
13490 dl = fn4(dl, el, al, bl, cl, m[0], 0x8f1bbcdc, 14); al = rotl(al, 10)
13491 cl = fn4(cl, dl, el, al, bl, m[8], 0x8f1bbcdc, 15); el = rotl(el, 10)
13492 bl = fn4(bl, cl, dl, el, al, m[12], 0x8f1bbcdc, 9); dl = rotl(dl, 10)
13493 al = fn4(al, bl, cl, dl, el, m[4], 0x8f1bbcdc, 8); cl = rotl(cl, 10)
13494 el = fn4(el, al, bl, cl, dl, m[13], 0x8f1bbcdc, 9); bl = rotl(bl, 10)
13495 dl = fn4(dl, el, al, bl, cl, m[3], 0x8f1bbcdc, 14); al = rotl(al, 10)
13496 cl = fn4(cl, dl, el, al, bl, m[7], 0x8f1bbcdc, 5); el = rotl(el, 10)
13497 bl = fn4(bl, cl, dl, el, al, m[15], 0x8f1bbcdc, 6); dl = rotl(dl, 10)
13498 al = fn4(al, bl, cl, dl, el, m[14], 0x8f1bbcdc, 8); cl = rotl(cl, 10)
13499 el = fn4(el, al, bl, cl, dl, m[5], 0x8f1bbcdc, 6); bl = rotl(bl, 10)
13500 dl = fn4(dl, el, al, bl, cl, m[6], 0x8f1bbcdc, 5); al = rotl(al, 10)
13501 cl = fn4(cl, dl, el, al, bl, m[2], 0x8f1bbcdc, 12); el = rotl(el, 10)
13502
13503 // Mj = 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
13504 // K = 0xa953fd4e
13505 // Sj = 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
13506 bl = fn5(bl, cl, dl, el, al, m[4], 0xa953fd4e, 9); dl = rotl(dl, 10)
13507 al = fn5(al, bl, cl, dl, el, m[0], 0xa953fd4e, 15); cl = rotl(cl, 10)
13508 el = fn5(el, al, bl, cl, dl, m[5], 0xa953fd4e, 5); bl = rotl(bl, 10)
13509 dl = fn5(dl, el, al, bl, cl, m[9], 0xa953fd4e, 11); al = rotl(al, 10)
13510 cl = fn5(cl, dl, el, al, bl, m[7], 0xa953fd4e, 6); el = rotl(el, 10)
13511 bl = fn5(bl, cl, dl, el, al, m[12], 0xa953fd4e, 8); dl = rotl(dl, 10)
13512 al = fn5(al, bl, cl, dl, el, m[2], 0xa953fd4e, 13); cl = rotl(cl, 10)
13513 el = fn5(el, al, bl, cl, dl, m[10], 0xa953fd4e, 12); bl = rotl(bl, 10)
13514 dl = fn5(dl, el, al, bl, cl, m[14], 0xa953fd4e, 5); al = rotl(al, 10)
13515 cl = fn5(cl, dl, el, al, bl, m[1], 0xa953fd4e, 12); el = rotl(el, 10)
13516 bl = fn5(bl, cl, dl, el, al, m[3], 0xa953fd4e, 13); dl = rotl(dl, 10)
13517 al = fn5(al, bl, cl, dl, el, m[8], 0xa953fd4e, 14); cl = rotl(cl, 10)
13518 el = fn5(el, al, bl, cl, dl, m[11], 0xa953fd4e, 11); bl = rotl(bl, 10)
13519 dl = fn5(dl, el, al, bl, cl, m[6], 0xa953fd4e, 8); al = rotl(al, 10)
13520 cl = fn5(cl, dl, el, al, bl, m[15], 0xa953fd4e, 5); el = rotl(el, 10)
13521 bl = fn5(bl, cl, dl, el, al, m[13], 0xa953fd4e, 6); dl = rotl(dl, 10)
13522
13523 var ar = this._a
13524 var br = this._b
13525 var cr = this._c
13526 var dr = this._d
13527 var er = this._e
13528
13529 // M'j = 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12
13530 // K' = 0x50a28be6
13531 // S'j = 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6
13532 ar = fn5(ar, br, cr, dr, er, m[5], 0x50a28be6, 8); cr = rotl(cr, 10)
13533 er = fn5(er, ar, br, cr, dr, m[14], 0x50a28be6, 9); br = rotl(br, 10)
13534 dr = fn5(dr, er, ar, br, cr, m[7], 0x50a28be6, 9); ar = rotl(ar, 10)
13535 cr = fn5(cr, dr, er, ar, br, m[0], 0x50a28be6, 11); er = rotl(er, 10)
13536 br = fn5(br, cr, dr, er, ar, m[9], 0x50a28be6, 13); dr = rotl(dr, 10)
13537 ar = fn5(ar, br, cr, dr, er, m[2], 0x50a28be6, 15); cr = rotl(cr, 10)
13538 er = fn5(er, ar, br, cr, dr, m[11], 0x50a28be6, 15); br = rotl(br, 10)
13539 dr = fn5(dr, er, ar, br, cr, m[4], 0x50a28be6, 5); ar = rotl(ar, 10)
13540 cr = fn5(cr, dr, er, ar, br, m[13], 0x50a28be6, 7); er = rotl(er, 10)
13541 br = fn5(br, cr, dr, er, ar, m[6], 0x50a28be6, 7); dr = rotl(dr, 10)
13542 ar = fn5(ar, br, cr, dr, er, m[15], 0x50a28be6, 8); cr = rotl(cr, 10)
13543 er = fn5(er, ar, br, cr, dr, m[8], 0x50a28be6, 11); br = rotl(br, 10)
13544 dr = fn5(dr, er, ar, br, cr, m[1], 0x50a28be6, 14); ar = rotl(ar, 10)
13545 cr = fn5(cr, dr, er, ar, br, m[10], 0x50a28be6, 14); er = rotl(er, 10)
13546 br = fn5(br, cr, dr, er, ar, m[3], 0x50a28be6, 12); dr = rotl(dr, 10)
13547 ar = fn5(ar, br, cr, dr, er, m[12], 0x50a28be6, 6); cr = rotl(cr, 10)
13548
13549 // M'j = 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2
13550 // K' = 0x5c4dd124
13551 // S'j = 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11
13552 er = fn4(er, ar, br, cr, dr, m[6], 0x5c4dd124, 9); br = rotl(br, 10)
13553 dr = fn4(dr, er, ar, br, cr, m[11], 0x5c4dd124, 13); ar = rotl(ar, 10)
13554 cr = fn4(cr, dr, er, ar, br, m[3], 0x5c4dd124, 15); er = rotl(er, 10)
13555 br = fn4(br, cr, dr, er, ar, m[7], 0x5c4dd124, 7); dr = rotl(dr, 10)
13556 ar = fn4(ar, br, cr, dr, er, m[0], 0x5c4dd124, 12); cr = rotl(cr, 10)
13557 er = fn4(er, ar, br, cr, dr, m[13], 0x5c4dd124, 8); br = rotl(br, 10)
13558 dr = fn4(dr, er, ar, br, cr, m[5], 0x5c4dd124, 9); ar = rotl(ar, 10)
13559 cr = fn4(cr, dr, er, ar, br, m[10], 0x5c4dd124, 11); er = rotl(er, 10)
13560 br = fn4(br, cr, dr, er, ar, m[14], 0x5c4dd124, 7); dr = rotl(dr, 10)
13561 ar = fn4(ar, br, cr, dr, er, m[15], 0x5c4dd124, 7); cr = rotl(cr, 10)
13562 er = fn4(er, ar, br, cr, dr, m[8], 0x5c4dd124, 12); br = rotl(br, 10)
13563 dr = fn4(dr, er, ar, br, cr, m[12], 0x5c4dd124, 7); ar = rotl(ar, 10)
13564 cr = fn4(cr, dr, er, ar, br, m[4], 0x5c4dd124, 6); er = rotl(er, 10)
13565 br = fn4(br, cr, dr, er, ar, m[9], 0x5c4dd124, 15); dr = rotl(dr, 10)
13566 ar = fn4(ar, br, cr, dr, er, m[1], 0x5c4dd124, 13); cr = rotl(cr, 10)
13567 er = fn4(er, ar, br, cr, dr, m[2], 0x5c4dd124, 11); br = rotl(br, 10)
13568
13569 // M'j = 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13
13570 // K' = 0x6d703ef3
13571 // S'j = 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5
13572 dr = fn3(dr, er, ar, br, cr, m[15], 0x6d703ef3, 9); ar = rotl(ar, 10)
13573 cr = fn3(cr, dr, er, ar, br, m[5], 0x6d703ef3, 7); er = rotl(er, 10)
13574 br = fn3(br, cr, dr, er, ar, m[1], 0x6d703ef3, 15); dr = rotl(dr, 10)
13575 ar = fn3(ar, br, cr, dr, er, m[3], 0x6d703ef3, 11); cr = rotl(cr, 10)
13576 er = fn3(er, ar, br, cr, dr, m[7], 0x6d703ef3, 8); br = rotl(br, 10)
13577 dr = fn3(dr, er, ar, br, cr, m[14], 0x6d703ef3, 6); ar = rotl(ar, 10)
13578 cr = fn3(cr, dr, er, ar, br, m[6], 0x6d703ef3, 6); er = rotl(er, 10)
13579 br = fn3(br, cr, dr, er, ar, m[9], 0x6d703ef3, 14); dr = rotl(dr, 10)
13580 ar = fn3(ar, br, cr, dr, er, m[11], 0x6d703ef3, 12); cr = rotl(cr, 10)
13581 er = fn3(er, ar, br, cr, dr, m[8], 0x6d703ef3, 13); br = rotl(br, 10)
13582 dr = fn3(dr, er, ar, br, cr, m[12], 0x6d703ef3, 5); ar = rotl(ar, 10)
13583 cr = fn3(cr, dr, er, ar, br, m[2], 0x6d703ef3, 14); er = rotl(er, 10)
13584 br = fn3(br, cr, dr, er, ar, m[10], 0x6d703ef3, 13); dr = rotl(dr, 10)
13585 ar = fn3(ar, br, cr, dr, er, m[0], 0x6d703ef3, 13); cr = rotl(cr, 10)
13586 er = fn3(er, ar, br, cr, dr, m[4], 0x6d703ef3, 7); br = rotl(br, 10)
13587 dr = fn3(dr, er, ar, br, cr, m[13], 0x6d703ef3, 5); ar = rotl(ar, 10)
13588
13589 // M'j = 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14
13590 // K' = 0x7a6d76e9
13591 // S'j = 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8
13592 cr = fn2(cr, dr, er, ar, br, m[8], 0x7a6d76e9, 15); er = rotl(er, 10)
13593 br = fn2(br, cr, dr, er, ar, m[6], 0x7a6d76e9, 5); dr = rotl(dr, 10)
13594 ar = fn2(ar, br, cr, dr, er, m[4], 0x7a6d76e9, 8); cr = rotl(cr, 10)
13595 er = fn2(er, ar, br, cr, dr, m[1], 0x7a6d76e9, 11); br = rotl(br, 10)
13596 dr = fn2(dr, er, ar, br, cr, m[3], 0x7a6d76e9, 14); ar = rotl(ar, 10)
13597 cr = fn2(cr, dr, er, ar, br, m[11], 0x7a6d76e9, 14); er = rotl(er, 10)
13598 br = fn2(br, cr, dr, er, ar, m[15], 0x7a6d76e9, 6); dr = rotl(dr, 10)
13599 ar = fn2(ar, br, cr, dr, er, m[0], 0x7a6d76e9, 14); cr = rotl(cr, 10)
13600 er = fn2(er, ar, br, cr, dr, m[5], 0x7a6d76e9, 6); br = rotl(br, 10)
13601 dr = fn2(dr, er, ar, br, cr, m[12], 0x7a6d76e9, 9); ar = rotl(ar, 10)
13602 cr = fn2(cr, dr, er, ar, br, m[2], 0x7a6d76e9, 12); er = rotl(er, 10)
13603 br = fn2(br, cr, dr, er, ar, m[13], 0x7a6d76e9, 9); dr = rotl(dr, 10)
13604 ar = fn2(ar, br, cr, dr, er, m[9], 0x7a6d76e9, 12); cr = rotl(cr, 10)
13605 er = fn2(er, ar, br, cr, dr, m[7], 0x7a6d76e9, 5); br = rotl(br, 10)
13606 dr = fn2(dr, er, ar, br, cr, m[10], 0x7a6d76e9, 15); ar = rotl(ar, 10)
13607 cr = fn2(cr, dr, er, ar, br, m[14], 0x7a6d76e9, 8); er = rotl(er, 10)
13608
13609 // M'j = 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
13610 // K' = 0x00000000
13611 // S'j = 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
13612 br = fn1(br, cr, dr, er, ar, m[12], 0x00000000, 8); dr = rotl(dr, 10)
13613 ar = fn1(ar, br, cr, dr, er, m[15], 0x00000000, 5); cr = rotl(cr, 10)
13614 er = fn1(er, ar, br, cr, dr, m[10], 0x00000000, 12); br = rotl(br, 10)
13615 dr = fn1(dr, er, ar, br, cr, m[4], 0x00000000, 9); ar = rotl(ar, 10)
13616 cr = fn1(cr, dr, er, ar, br, m[1], 0x00000000, 12); er = rotl(er, 10)
13617 br = fn1(br, cr, dr, er, ar, m[5], 0x00000000, 5); dr = rotl(dr, 10)
13618 ar = fn1(ar, br, cr, dr, er, m[8], 0x00000000, 14); cr = rotl(cr, 10)
13619 er = fn1(er, ar, br, cr, dr, m[7], 0x00000000, 6); br = rotl(br, 10)
13620 dr = fn1(dr, er, ar, br, cr, m[6], 0x00000000, 8); ar = rotl(ar, 10)
13621 cr = fn1(cr, dr, er, ar, br, m[2], 0x00000000, 13); er = rotl(er, 10)
13622 br = fn1(br, cr, dr, er, ar, m[13], 0x00000000, 6); dr = rotl(dr, 10)
13623 ar = fn1(ar, br, cr, dr, er, m[14], 0x00000000, 5); cr = rotl(cr, 10)
13624 er = fn1(er, ar, br, cr, dr, m[0], 0x00000000, 15); br = rotl(br, 10)
13625 dr = fn1(dr, er, ar, br, cr, m[3], 0x00000000, 13); ar = rotl(ar, 10)
13626 cr = fn1(cr, dr, er, ar, br, m[9], 0x00000000, 11); er = rotl(er, 10)
13627 br = fn1(br, cr, dr, er, ar, m[11], 0x00000000, 11); dr = rotl(dr, 10)
13628
13629 // change state
13630 var t = (this._b + cl + dr) | 0
13631 this._b = (this._c + dl + er) | 0
13632 this._c = (this._d + el + ar) | 0
13633 this._d = (this._e + al + br) | 0
13634 this._e = (this._a + bl + cr) | 0
13635 this._a = t
13636}
13637
13638RIPEMD160.prototype._digest = function () {
13639 // create padding and handle blocks
13640 this._block[this._blockOffset++] = 0x80
13641 if (this._blockOffset > 56) {
13642 this._block.fill(0, this._blockOffset, 64)
13643 this._update()
13644 this._blockOffset = 0
13645 }
13646
13647 this._block.fill(0, this._blockOffset, 56)
13648 this._block.writeUInt32LE(this._length[0], 56)
13649 this._block.writeUInt32LE(this._length[1], 60)
13650 this._update()
13651
13652 // produce result
13653 var buffer = new Buffer(20)
13654 buffer.writeInt32LE(this._a, 0)
13655 buffer.writeInt32LE(this._b, 4)
13656 buffer.writeInt32LE(this._c, 8)
13657 buffer.writeInt32LE(this._d, 12)
13658 buffer.writeInt32LE(this._e, 16)
13659 return buffer
13660}
13661
13662function rotl (x, n) {
13663 return (x << n) | (x >>> (32 - n))
13664}
13665
13666function fn1 (a, b, c, d, e, m, k, s) {
13667 return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0
13668}
13669
13670function fn2 (a, b, c, d, e, m, k, s) {
13671 return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0
13672}
13673
13674function fn3 (a, b, c, d, e, m, k, s) {
13675 return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0
13676}
13677
13678function fn4 (a, b, c, d, e, m, k, s) {
13679 return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0
13680}
13681
13682function fn5 (a, b, c, d, e, m, k, s) {
13683 return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0
13684}
13685
13686module.exports = RIPEMD160
13687
13688}).call(this,require("buffer").Buffer)
13689},{"buffer":5,"hash-base":95,"inherits":96}],101:[function(require,module,exports){
13690/* eslint-disable node/no-deprecated-api */
13691var buffer = require('buffer')
13692var Buffer = buffer.Buffer
13693
13694// alternative to using Object.keys for old browsers
13695function copyProps (src, dst) {
13696 for (var key in src) {
13697 dst[key] = src[key]
13698 }
13699}
13700if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
13701 module.exports = buffer
13702} else {
13703 // Copy properties from require('buffer')
13704 copyProps(buffer, exports)
13705 exports.Buffer = SafeBuffer
13706}
13707
13708function SafeBuffer (arg, encodingOrOffset, length) {
13709 return Buffer(arg, encodingOrOffset, length)
13710}
13711
13712// Copy static methods from Buffer
13713copyProps(Buffer, SafeBuffer)
13714
13715SafeBuffer.from = function (arg, encodingOrOffset, length) {
13716 if (typeof arg === 'number') {
13717 throw new TypeError('Argument must not be a number')
13718 }
13719 return Buffer(arg, encodingOrOffset, length)
13720}
13721
13722SafeBuffer.alloc = function (size, fill, encoding) {
13723 if (typeof size !== 'number') {
13724 throw new TypeError('Argument must be a number')
13725 }
13726 var buf = Buffer(size)
13727 if (fill !== undefined) {
13728 if (typeof encoding === 'string') {
13729 buf.fill(fill, encoding)
13730 } else {
13731 buf.fill(fill)
13732 }
13733 } else {
13734 buf.fill(0)
13735 }
13736 return buf
13737}
13738
13739SafeBuffer.allocUnsafe = function (size) {
13740 if (typeof size !== 'number') {
13741 throw new TypeError('Argument must be a number')
13742 }
13743 return Buffer(size)
13744}
13745
13746SafeBuffer.allocUnsafeSlow = function (size) {
13747 if (typeof size !== 'number') {
13748 throw new TypeError('Argument must be a number')
13749 }
13750 return buffer.SlowBuffer(size)
13751}
13752
13753},{"buffer":5}],102:[function(require,module,exports){
13754var Buffer = require('safe-buffer').Buffer
13755
13756// prototype class for hash functions
13757function Hash (blockSize, finalSize) {
13758 this._block = Buffer.alloc(blockSize)
13759 this._finalSize = finalSize
13760 this._blockSize = blockSize
13761 this._len = 0
13762}
13763
13764Hash.prototype.update = function (data, enc) {
13765 if (typeof data === 'string') {
13766 enc = enc || 'utf8'
13767 data = Buffer.from(data, enc)
13768 }
13769
13770 var block = this._block
13771 var blockSize = this._blockSize
13772 var length = data.length
13773 var accum = this._len
13774
13775 for (var offset = 0; offset < length;) {
13776 var assigned = accum % blockSize
13777 var remainder = Math.min(length - offset, blockSize - assigned)
13778
13779 for (var i = 0; i < remainder; i++) {
13780 block[assigned + i] = data[offset + i]
13781 }
13782
13783 accum += remainder
13784 offset += remainder
13785
13786 if ((accum % blockSize) === 0) {
13787 this._update(block)
13788 }
13789 }
13790
13791 this._len += length
13792 return this
13793}
13794
13795Hash.prototype.digest = function (enc) {
13796 var rem = this._len % this._blockSize
13797
13798 this._block[rem] = 0x80
13799
13800 // zero (rem + 1) trailing bits, where (rem + 1) is the smallest
13801 // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize
13802 this._block.fill(0, rem + 1)
13803
13804 if (rem >= this._finalSize) {
13805 this._update(this._block)
13806 this._block.fill(0)
13807 }
13808
13809 var bits = this._len * 8
13810
13811 // uint32
13812 if (bits <= 0xffffffff) {
13813 this._block.writeUInt32BE(bits, this._blockSize - 4)
13814
13815 // uint64
13816 } else {
13817 var lowBits = (bits & 0xffffffff) >>> 0
13818 var highBits = (bits - lowBits) / 0x100000000
13819
13820 this._block.writeUInt32BE(highBits, this._blockSize - 8)
13821 this._block.writeUInt32BE(lowBits, this._blockSize - 4)
13822 }
13823
13824 this._update(this._block)
13825 var hash = this._hash()
13826
13827 return enc ? hash.toString(enc) : hash
13828}
13829
13830Hash.prototype._update = function () {
13831 throw new Error('_update must be implemented by subclass')
13832}
13833
13834module.exports = Hash
13835
13836},{"safe-buffer":101}],103:[function(require,module,exports){
13837var exports = module.exports = function SHA (algorithm) {
13838 algorithm = algorithm.toLowerCase()
13839
13840 var Algorithm = exports[algorithm]
13841 if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
13842
13843 return new Algorithm()
13844}
13845
13846exports.sha = require('./sha')
13847exports.sha1 = require('./sha1')
13848exports.sha224 = require('./sha224')
13849exports.sha256 = require('./sha256')
13850exports.sha384 = require('./sha384')
13851exports.sha512 = require('./sha512')
13852
13853},{"./sha":104,"./sha1":105,"./sha224":106,"./sha256":107,"./sha384":108,"./sha512":109}],104:[function(require,module,exports){
13854/*
13855 * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
13856 * in FIPS PUB 180-1
13857 * This source code is derived from sha1.js of the same repository.
13858 * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
13859 * operation was added.
13860 */
13861
13862var inherits = require('inherits')
13863var Hash = require('./hash')
13864var Buffer = require('safe-buffer').Buffer
13865
13866var K = [
13867 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
13868]
13869
13870var W = new Array(80)
13871
13872function Sha () {
13873 this.init()
13874 this._w = W
13875
13876 Hash.call(this, 64, 56)
13877}
13878
13879inherits(Sha, Hash)
13880
13881Sha.prototype.init = function () {
13882 this._a = 0x67452301
13883 this._b = 0xefcdab89
13884 this._c = 0x98badcfe
13885 this._d = 0x10325476
13886 this._e = 0xc3d2e1f0
13887
13888 return this
13889}
13890
13891function rotl5 (num) {
13892 return (num << 5) | (num >>> 27)
13893}
13894
13895function rotl30 (num) {
13896 return (num << 30) | (num >>> 2)
13897}
13898
13899function ft (s, b, c, d) {
13900 if (s === 0) return (b & c) | ((~b) & d)
13901 if (s === 2) return (b & c) | (b & d) | (c & d)
13902 return b ^ c ^ d
13903}
13904
13905Sha.prototype._update = function (M) {
13906 var W = this._w
13907
13908 var a = this._a | 0
13909 var b = this._b | 0
13910 var c = this._c | 0
13911 var d = this._d | 0
13912 var e = this._e | 0
13913
13914 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
13915 for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]
13916
13917 for (var j = 0; j < 80; ++j) {
13918 var s = ~~(j / 20)
13919 var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
13920
13921 e = d
13922 d = c
13923 c = rotl30(b)
13924 b = a
13925 a = t
13926 }
13927
13928 this._a = (a + this._a) | 0
13929 this._b = (b + this._b) | 0
13930 this._c = (c + this._c) | 0
13931 this._d = (d + this._d) | 0
13932 this._e = (e + this._e) | 0
13933}
13934
13935Sha.prototype._hash = function () {
13936 var H = Buffer.allocUnsafe(20)
13937
13938 H.writeInt32BE(this._a | 0, 0)
13939 H.writeInt32BE(this._b | 0, 4)
13940 H.writeInt32BE(this._c | 0, 8)
13941 H.writeInt32BE(this._d | 0, 12)
13942 H.writeInt32BE(this._e | 0, 16)
13943
13944 return H
13945}
13946
13947module.exports = Sha
13948
13949},{"./hash":102,"inherits":96,"safe-buffer":101}],105:[function(require,module,exports){
13950/*
13951 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
13952 * in FIPS PUB 180-1
13953 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
13954 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
13955 * Distributed under the BSD License
13956 * See http://pajhome.org.uk/crypt/md5 for details.
13957 */
13958
13959var inherits = require('inherits')
13960var Hash = require('./hash')
13961var Buffer = require('safe-buffer').Buffer
13962
13963var K = [
13964 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
13965]
13966
13967var W = new Array(80)
13968
13969function Sha1 () {
13970 this.init()
13971 this._w = W
13972
13973 Hash.call(this, 64, 56)
13974}
13975
13976inherits(Sha1, Hash)
13977
13978Sha1.prototype.init = function () {
13979 this._a = 0x67452301
13980 this._b = 0xefcdab89
13981 this._c = 0x98badcfe
13982 this._d = 0x10325476
13983 this._e = 0xc3d2e1f0
13984
13985 return this
13986}
13987
13988function rotl1 (num) {
13989 return (num << 1) | (num >>> 31)
13990}
13991
13992function rotl5 (num) {
13993 return (num << 5) | (num >>> 27)
13994}
13995
13996function rotl30 (num) {
13997 return (num << 30) | (num >>> 2)
13998}
13999
14000function ft (s, b, c, d) {
14001 if (s === 0) return (b & c) | ((~b) & d)
14002 if (s === 2) return (b & c) | (b & d) | (c & d)
14003 return b ^ c ^ d
14004}
14005
14006Sha1.prototype._update = function (M) {
14007 var W = this._w
14008
14009 var a = this._a | 0
14010 var b = this._b | 0
14011 var c = this._c | 0
14012 var d = this._d | 0
14013 var e = this._e | 0
14014
14015 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
14016 for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
14017
14018 for (var j = 0; j < 80; ++j) {
14019 var s = ~~(j / 20)
14020 var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
14021
14022 e = d
14023 d = c
14024 c = rotl30(b)
14025 b = a
14026 a = t
14027 }
14028
14029 this._a = (a + this._a) | 0
14030 this._b = (b + this._b) | 0
14031 this._c = (c + this._c) | 0
14032 this._d = (d + this._d) | 0
14033 this._e = (e + this._e) | 0
14034}
14035
14036Sha1.prototype._hash = function () {
14037 var H = Buffer.allocUnsafe(20)
14038
14039 H.writeInt32BE(this._a | 0, 0)
14040 H.writeInt32BE(this._b | 0, 4)
14041 H.writeInt32BE(this._c | 0, 8)
14042 H.writeInt32BE(this._d | 0, 12)
14043 H.writeInt32BE(this._e | 0, 16)
14044
14045 return H
14046}
14047
14048module.exports = Sha1
14049
14050},{"./hash":102,"inherits":96,"safe-buffer":101}],106:[function(require,module,exports){
14051/**
14052 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
14053 * in FIPS 180-2
14054 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
14055 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
14056 *
14057 */
14058
14059var inherits = require('inherits')
14060var Sha256 = require('./sha256')
14061var Hash = require('./hash')
14062var Buffer = require('safe-buffer').Buffer
14063
14064var W = new Array(64)
14065
14066function Sha224 () {
14067 this.init()
14068
14069 this._w = W // new Array(64)
14070
14071 Hash.call(this, 64, 56)
14072}
14073
14074inherits(Sha224, Sha256)
14075
14076Sha224.prototype.init = function () {
14077 this._a = 0xc1059ed8
14078 this._b = 0x367cd507
14079 this._c = 0x3070dd17
14080 this._d = 0xf70e5939
14081 this._e = 0xffc00b31
14082 this._f = 0x68581511
14083 this._g = 0x64f98fa7
14084 this._h = 0xbefa4fa4
14085
14086 return this
14087}
14088
14089Sha224.prototype._hash = function () {
14090 var H = Buffer.allocUnsafe(28)
14091
14092 H.writeInt32BE(this._a, 0)
14093 H.writeInt32BE(this._b, 4)
14094 H.writeInt32BE(this._c, 8)
14095 H.writeInt32BE(this._d, 12)
14096 H.writeInt32BE(this._e, 16)
14097 H.writeInt32BE(this._f, 20)
14098 H.writeInt32BE(this._g, 24)
14099
14100 return H
14101}
14102
14103module.exports = Sha224
14104
14105},{"./hash":102,"./sha256":107,"inherits":96,"safe-buffer":101}],107:[function(require,module,exports){
14106/**
14107 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
14108 * in FIPS 180-2
14109 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
14110 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
14111 *
14112 */
14113
14114var inherits = require('inherits')
14115var Hash = require('./hash')
14116var Buffer = require('safe-buffer').Buffer
14117
14118var K = [
14119 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
14120 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
14121 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
14122 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
14123 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
14124 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
14125 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
14126 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
14127 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
14128 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
14129 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
14130 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
14131 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
14132 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
14133 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
14134 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
14135]
14136
14137var W = new Array(64)
14138
14139function Sha256 () {
14140 this.init()
14141
14142 this._w = W // new Array(64)
14143
14144 Hash.call(this, 64, 56)
14145}
14146
14147inherits(Sha256, Hash)
14148
14149Sha256.prototype.init = function () {
14150 this._a = 0x6a09e667
14151 this._b = 0xbb67ae85
14152 this._c = 0x3c6ef372
14153 this._d = 0xa54ff53a
14154 this._e = 0x510e527f
14155 this._f = 0x9b05688c
14156 this._g = 0x1f83d9ab
14157 this._h = 0x5be0cd19
14158
14159 return this
14160}
14161
14162function ch (x, y, z) {
14163 return z ^ (x & (y ^ z))
14164}
14165
14166function maj (x, y, z) {
14167 return (x & y) | (z & (x | y))
14168}
14169
14170function sigma0 (x) {
14171 return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
14172}
14173
14174function sigma1 (x) {
14175 return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
14176}
14177
14178function gamma0 (x) {
14179 return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
14180}
14181
14182function gamma1 (x) {
14183 return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
14184}
14185
14186Sha256.prototype._update = function (M) {
14187 var W = this._w
14188
14189 var a = this._a | 0
14190 var b = this._b | 0
14191 var c = this._c | 0
14192 var d = this._d | 0
14193 var e = this._e | 0
14194 var f = this._f | 0
14195 var g = this._g | 0
14196 var h = this._h | 0
14197
14198 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
14199 for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
14200
14201 for (var j = 0; j < 64; ++j) {
14202 var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
14203 var T2 = (sigma0(a) + maj(a, b, c)) | 0
14204
14205 h = g
14206 g = f
14207 f = e
14208 e = (d + T1) | 0
14209 d = c
14210 c = b
14211 b = a
14212 a = (T1 + T2) | 0
14213 }
14214
14215 this._a = (a + this._a) | 0
14216 this._b = (b + this._b) | 0
14217 this._c = (c + this._c) | 0
14218 this._d = (d + this._d) | 0
14219 this._e = (e + this._e) | 0
14220 this._f = (f + this._f) | 0
14221 this._g = (g + this._g) | 0
14222 this._h = (h + this._h) | 0
14223}
14224
14225Sha256.prototype._hash = function () {
14226 var H = Buffer.allocUnsafe(32)
14227
14228 H.writeInt32BE(this._a, 0)
14229 H.writeInt32BE(this._b, 4)
14230 H.writeInt32BE(this._c, 8)
14231 H.writeInt32BE(this._d, 12)
14232 H.writeInt32BE(this._e, 16)
14233 H.writeInt32BE(this._f, 20)
14234 H.writeInt32BE(this._g, 24)
14235 H.writeInt32BE(this._h, 28)
14236
14237 return H
14238}
14239
14240module.exports = Sha256
14241
14242},{"./hash":102,"inherits":96,"safe-buffer":101}],108:[function(require,module,exports){
14243var inherits = require('inherits')
14244var SHA512 = require('./sha512')
14245var Hash = require('./hash')
14246var Buffer = require('safe-buffer').Buffer
14247
14248var W = new Array(160)
14249
14250function Sha384 () {
14251 this.init()
14252 this._w = W
14253
14254 Hash.call(this, 128, 112)
14255}
14256
14257inherits(Sha384, SHA512)
14258
14259Sha384.prototype.init = function () {
14260 this._ah = 0xcbbb9d5d
14261 this._bh = 0x629a292a
14262 this._ch = 0x9159015a
14263 this._dh = 0x152fecd8
14264 this._eh = 0x67332667
14265 this._fh = 0x8eb44a87
14266 this._gh = 0xdb0c2e0d
14267 this._hh = 0x47b5481d
14268
14269 this._al = 0xc1059ed8
14270 this._bl = 0x367cd507
14271 this._cl = 0x3070dd17
14272 this._dl = 0xf70e5939
14273 this._el = 0xffc00b31
14274 this._fl = 0x68581511
14275 this._gl = 0x64f98fa7
14276 this._hl = 0xbefa4fa4
14277
14278 return this
14279}
14280
14281Sha384.prototype._hash = function () {
14282 var H = Buffer.allocUnsafe(48)
14283
14284 function writeInt64BE (h, l, offset) {
14285 H.writeInt32BE(h, offset)
14286 H.writeInt32BE(l, offset + 4)
14287 }
14288
14289 writeInt64BE(this._ah, this._al, 0)
14290 writeInt64BE(this._bh, this._bl, 8)
14291 writeInt64BE(this._ch, this._cl, 16)
14292 writeInt64BE(this._dh, this._dl, 24)
14293 writeInt64BE(this._eh, this._el, 32)
14294 writeInt64BE(this._fh, this._fl, 40)
14295
14296 return H
14297}
14298
14299module.exports = Sha384
14300
14301},{"./hash":102,"./sha512":109,"inherits":96,"safe-buffer":101}],109:[function(require,module,exports){
14302var inherits = require('inherits')
14303var Hash = require('./hash')
14304var Buffer = require('safe-buffer').Buffer
14305
14306var K = [
14307 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
14308 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
14309 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
14310 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
14311 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
14312 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
14313 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
14314 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
14315 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
14316 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
14317 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
14318 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
14319 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
14320 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
14321 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
14322 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
14323 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
14324 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
14325 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
14326 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
14327 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
14328 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
14329 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
14330 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
14331 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
14332 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
14333 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
14334 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
14335 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
14336 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
14337 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
14338 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
14339 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
14340 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
14341 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
14342 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
14343 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
14344 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
14345 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
14346 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
14347]
14348
14349var W = new Array(160)
14350
14351function Sha512 () {
14352 this.init()
14353 this._w = W
14354
14355 Hash.call(this, 128, 112)
14356}
14357
14358inherits(Sha512, Hash)
14359
14360Sha512.prototype.init = function () {
14361 this._ah = 0x6a09e667
14362 this._bh = 0xbb67ae85
14363 this._ch = 0x3c6ef372
14364 this._dh = 0xa54ff53a
14365 this._eh = 0x510e527f
14366 this._fh = 0x9b05688c
14367 this._gh = 0x1f83d9ab
14368 this._hh = 0x5be0cd19
14369
14370 this._al = 0xf3bcc908
14371 this._bl = 0x84caa73b
14372 this._cl = 0xfe94f82b
14373 this._dl = 0x5f1d36f1
14374 this._el = 0xade682d1
14375 this._fl = 0x2b3e6c1f
14376 this._gl = 0xfb41bd6b
14377 this._hl = 0x137e2179
14378
14379 return this
14380}
14381
14382function Ch (x, y, z) {
14383 return z ^ (x & (y ^ z))
14384}
14385
14386function maj (x, y, z) {
14387 return (x & y) | (z & (x | y))
14388}
14389
14390function sigma0 (x, xl) {
14391 return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
14392}
14393
14394function sigma1 (x, xl) {
14395 return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
14396}
14397
14398function Gamma0 (x, xl) {
14399 return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
14400}
14401
14402function Gamma0l (x, xl) {
14403 return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
14404}
14405
14406function Gamma1 (x, xl) {
14407 return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
14408}
14409
14410function Gamma1l (x, xl) {
14411 return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
14412}
14413
14414function getCarry (a, b) {
14415 return (a >>> 0) < (b >>> 0) ? 1 : 0
14416}
14417
14418Sha512.prototype._update = function (M) {
14419 var W = this._w
14420
14421 var ah = this._ah | 0
14422 var bh = this._bh | 0
14423 var ch = this._ch | 0
14424 var dh = this._dh | 0
14425 var eh = this._eh | 0
14426 var fh = this._fh | 0
14427 var gh = this._gh | 0
14428 var hh = this._hh | 0
14429
14430 var al = this._al | 0
14431 var bl = this._bl | 0
14432 var cl = this._cl | 0
14433 var dl = this._dl | 0
14434 var el = this._el | 0
14435 var fl = this._fl | 0
14436 var gl = this._gl | 0
14437 var hl = this._hl | 0
14438
14439 for (var i = 0; i < 32; i += 2) {
14440 W[i] = M.readInt32BE(i * 4)
14441 W[i + 1] = M.readInt32BE(i * 4 + 4)
14442 }
14443 for (; i < 160; i += 2) {
14444 var xh = W[i - 15 * 2]
14445 var xl = W[i - 15 * 2 + 1]
14446 var gamma0 = Gamma0(xh, xl)
14447 var gamma0l = Gamma0l(xl, xh)
14448
14449 xh = W[i - 2 * 2]
14450 xl = W[i - 2 * 2 + 1]
14451 var gamma1 = Gamma1(xh, xl)
14452 var gamma1l = Gamma1l(xl, xh)
14453
14454 // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
14455 var Wi7h = W[i - 7 * 2]
14456 var Wi7l = W[i - 7 * 2 + 1]
14457
14458 var Wi16h = W[i - 16 * 2]
14459 var Wi16l = W[i - 16 * 2 + 1]
14460
14461 var Wil = (gamma0l + Wi7l) | 0
14462 var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
14463 Wil = (Wil + gamma1l) | 0
14464 Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
14465 Wil = (Wil + Wi16l) | 0
14466 Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
14467
14468 W[i] = Wih
14469 W[i + 1] = Wil
14470 }
14471
14472 for (var j = 0; j < 160; j += 2) {
14473 Wih = W[j]
14474 Wil = W[j + 1]
14475
14476 var majh = maj(ah, bh, ch)
14477 var majl = maj(al, bl, cl)
14478
14479 var sigma0h = sigma0(ah, al)
14480 var sigma0l = sigma0(al, ah)
14481 var sigma1h = sigma1(eh, el)
14482 var sigma1l = sigma1(el, eh)
14483
14484 // t1 = h + sigma1 + ch + K[j] + W[j]
14485 var Kih = K[j]
14486 var Kil = K[j + 1]
14487
14488 var chh = Ch(eh, fh, gh)
14489 var chl = Ch(el, fl, gl)
14490
14491 var t1l = (hl + sigma1l) | 0
14492 var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
14493 t1l = (t1l + chl) | 0
14494 t1h = (t1h + chh + getCarry(t1l, chl)) | 0
14495 t1l = (t1l + Kil) | 0
14496 t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
14497 t1l = (t1l + Wil) | 0
14498 t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
14499
14500 // t2 = sigma0 + maj
14501 var t2l = (sigma0l + majl) | 0
14502 var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
14503
14504 hh = gh
14505 hl = gl
14506 gh = fh
14507 gl = fl
14508 fh = eh
14509 fl = el
14510 el = (dl + t1l) | 0
14511 eh = (dh + t1h + getCarry(el, dl)) | 0
14512 dh = ch
14513 dl = cl
14514 ch = bh
14515 cl = bl
14516 bh = ah
14517 bl = al
14518 al = (t1l + t2l) | 0
14519 ah = (t1h + t2h + getCarry(al, t1l)) | 0
14520 }
14521
14522 this._al = (this._al + al) | 0
14523 this._bl = (this._bl + bl) | 0
14524 this._cl = (this._cl + cl) | 0
14525 this._dl = (this._dl + dl) | 0
14526 this._el = (this._el + el) | 0
14527 this._fl = (this._fl + fl) | 0
14528 this._gl = (this._gl + gl) | 0
14529 this._hl = (this._hl + hl) | 0
14530
14531 this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
14532 this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
14533 this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
14534 this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
14535 this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
14536 this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
14537 this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
14538 this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
14539}
14540
14541Sha512.prototype._hash = function () {
14542 var H = Buffer.allocUnsafe(64)
14543
14544 function writeInt64BE (h, l, offset) {
14545 H.writeInt32BE(h, offset)
14546 H.writeInt32BE(l, offset + 4)
14547 }
14548
14549 writeInt64BE(this._ah, this._al, 0)
14550 writeInt64BE(this._bh, this._bl, 8)
14551 writeInt64BE(this._ch, this._cl, 16)
14552 writeInt64BE(this._dh, this._dl, 24)
14553 writeInt64BE(this._eh, this._el, 32)
14554 writeInt64BE(this._fh, this._fl, 40)
14555 writeInt64BE(this._gh, this._gl, 48)
14556 writeInt64BE(this._hh, this._hl, 56)
14557
14558 return H
14559}
14560
14561module.exports = Sha512
14562
14563},{"./hash":102,"inherits":96,"safe-buffer":101}],110:[function(require,module,exports){
14564var native = require('./native')
14565
14566function getTypeName (fn) {
14567 return fn.name || fn.toString().match(/function (.*?)\s*\(/)[1]
14568}
14569
14570function getValueTypeName (value) {
14571 return native.Nil(value) ? '' : getTypeName(value.constructor)
14572}
14573
14574function getValue (value) {
14575 if (native.Function(value)) return ''
14576 if (native.String(value)) return JSON.stringify(value)
14577 if (value && native.Object(value)) return ''
14578 return value
14579}
14580
14581function tfJSON (type) {
14582 if (native.Function(type)) return type.toJSON ? type.toJSON() : getTypeName(type)
14583 if (native.Array(type)) return 'Array'
14584 if (type && native.Object(type)) return 'Object'
14585
14586 return type !== undefined ? type : ''
14587}
14588
14589function tfErrorString (type, value, valueTypeName) {
14590 var valueJson = getValue(value)
14591
14592 return 'Expected ' + tfJSON(type) + ', got' +
14593 (valueTypeName !== '' ? ' ' + valueTypeName : '') +
14594 (valueJson !== '' ? ' ' + valueJson : '')
14595}
14596
14597function TfTypeError (type, value, valueTypeName) {
14598 valueTypeName = valueTypeName || getValueTypeName(value)
14599 this.message = tfErrorString(type, value, valueTypeName)
14600
14601 Error.captureStackTrace(this, TfTypeError)
14602 this.__type = type
14603 this.__value = value
14604 this.__valueTypeName = valueTypeName
14605}
14606
14607TfTypeError.prototype = Object.create(Error.prototype)
14608TfTypeError.prototype.constructor = TfTypeError
14609
14610function tfPropertyErrorString (type, label, name, value, valueTypeName) {
14611 var description = '" of type '
14612 if (label === 'key') description = '" with key type '
14613
14614 return tfErrorString('property "' + tfJSON(name) + description + tfJSON(type), value, valueTypeName)
14615}
14616
14617function TfPropertyTypeError (type, property, label, value, valueTypeName) {
14618 if (type) {
14619 valueTypeName = valueTypeName || getValueTypeName(value)
14620 this.message = tfPropertyErrorString(type, label, property, value, valueTypeName)
14621 } else {
14622 this.message = 'Unexpected property "' + property + '"'
14623 }
14624
14625 Error.captureStackTrace(this, TfTypeError)
14626 this.__label = label
14627 this.__property = property
14628 this.__type = type
14629 this.__value = value
14630 this.__valueTypeName = valueTypeName
14631}
14632
14633TfPropertyTypeError.prototype = Object.create(Error.prototype)
14634TfPropertyTypeError.prototype.constructor = TfTypeError
14635
14636function tfCustomError (expected, actual) {
14637 return new TfTypeError(expected, {}, actual)
14638}
14639
14640function tfSubError (e, property, label) {
14641 // sub child?
14642 if (e instanceof TfPropertyTypeError) {
14643 property = property + '.' + e.__property
14644
14645 e = new TfPropertyTypeError(
14646 e.__type, property, e.__label, e.__value, e.__valueTypeName
14647 )
14648
14649 // child?
14650 } else if (e instanceof TfTypeError) {
14651 e = new TfPropertyTypeError(
14652 e.__type, property, label, e.__value, e.__valueTypeName
14653 )
14654 }
14655
14656 Error.captureStackTrace(e)
14657 return e
14658}
14659
14660module.exports = {
14661 TfTypeError: TfTypeError,
14662 TfPropertyTypeError: TfPropertyTypeError,
14663 tfCustomError: tfCustomError,
14664 tfSubError: tfSubError,
14665 tfJSON: tfJSON,
14666 getValueTypeName: getValueTypeName
14667}
14668
14669},{"./native":113}],111:[function(require,module,exports){
14670(function (Buffer){
14671var NATIVE = require('./native')
14672var ERRORS = require('./errors')
14673
14674function _Buffer (value) {
14675 return Buffer.isBuffer(value)
14676}
14677
14678function Hex (value) {
14679 return typeof value === 'string' && /^([0-9a-f]{2})+$/i.test(value)
14680}
14681
14682function _LengthN (type, length) {
14683 var name = type.toJSON()
14684
14685 function Length (value) {
14686 if (!type(value)) return false
14687 if (value.length === length) return true
14688
14689 throw ERRORS.tfCustomError(name + '(Length: ' + length + ')', name + '(Length: ' + value.length + ')')
14690 }
14691 Length.toJSON = function () { return name }
14692
14693 return Length
14694}
14695
14696var _ArrayN = _LengthN.bind(null, NATIVE.Array)
14697var _BufferN = _LengthN.bind(null, _Buffer)
14698var _HexN = _LengthN.bind(null, Hex)
14699var _StringN = _LengthN.bind(null, NATIVE.String)
14700
14701var UINT53_MAX = Math.pow(2, 53) - 1
14702
14703function Finite (value) {
14704 return typeof value === 'number' && isFinite(value)
14705}
14706function Int8 (value) { return ((value << 24) >> 24) === value }
14707function Int16 (value) { return ((value << 16) >> 16) === value }
14708function Int32 (value) { return (value | 0) === value }
14709function UInt8 (value) { return (value & 0xff) === value }
14710function UInt16 (value) { return (value & 0xffff) === value }
14711function UInt32 (value) { return (value >>> 0) === value }
14712function UInt53 (value) {
14713 return typeof value === 'number' &&
14714 value >= 0 &&
14715 value <= UINT53_MAX &&
14716 Math.floor(value) === value
14717}
14718
14719var types = {
14720 ArrayN: _ArrayN,
14721 Buffer: _Buffer,
14722 BufferN: _BufferN,
14723 Finite: Finite,
14724 Hex: Hex,
14725 HexN: _HexN,
14726 Int8: Int8,
14727 Int16: Int16,
14728 Int32: Int32,
14729 StringN: _StringN,
14730 UInt8: UInt8,
14731 UInt16: UInt16,
14732 UInt32: UInt32,
14733 UInt53: UInt53
14734}
14735
14736for (var typeName in types) {
14737 types[typeName].toJSON = function (t) {
14738 return t
14739 }.bind(null, typeName)
14740}
14741
14742module.exports = types
14743
14744}).call(this,{"isBuffer":require("../../../../../.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")})
14745},{"../../../../../.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":10,"./errors":110,"./native":113}],112:[function(require,module,exports){
14746var ERRORS = require('./errors')
14747var NATIVE = require('./native')
14748
14749// short-hand
14750var tfJSON = ERRORS.tfJSON
14751var TfTypeError = ERRORS.TfTypeError
14752var TfPropertyTypeError = ERRORS.TfPropertyTypeError
14753var tfSubError = ERRORS.tfSubError
14754var getValueTypeName = ERRORS.getValueTypeName
14755
14756var TYPES = {
14757 arrayOf: function arrayOf (type) {
14758 type = compile(type)
14759
14760 function _arrayOf (array, strict) {
14761 if (!NATIVE.Array(array)) return false
14762 if (NATIVE.Nil(array)) return false
14763
14764 return array.every(function (value, i) {
14765 try {
14766 return typeforce(type, value, strict)
14767 } catch (e) {
14768 throw tfSubError(e, i)
14769 }
14770 })
14771 }
14772 _arrayOf.toJSON = function () { return '[' + tfJSON(type) + ']' }
14773
14774 return _arrayOf
14775 },
14776
14777 maybe: function maybe (type) {
14778 type = compile(type)
14779
14780 function _maybe (value, strict) {
14781 return NATIVE.Nil(value) || type(value, strict, maybe)
14782 }
14783 _maybe.toJSON = function () { return '?' + tfJSON(type) }
14784
14785 return _maybe
14786 },
14787
14788 map: function map (propertyType, propertyKeyType) {
14789 propertyType = compile(propertyType)
14790 if (propertyKeyType) propertyKeyType = compile(propertyKeyType)
14791
14792 function _map (value, strict) {
14793 if (!NATIVE.Object(value)) return false
14794 if (NATIVE.Nil(value)) return false
14795
14796 for (var propertyName in value) {
14797 try {
14798 if (propertyKeyType) {
14799 typeforce(propertyKeyType, propertyName, strict)
14800 }
14801 } catch (e) {
14802 throw tfSubError(e, propertyName, 'key')
14803 }
14804
14805 try {
14806 var propertyValue = value[propertyName]
14807 typeforce(propertyType, propertyValue, strict)
14808 } catch (e) {
14809 throw tfSubError(e, propertyName)
14810 }
14811 }
14812
14813 return true
14814 }
14815
14816 if (propertyKeyType) {
14817 _map.toJSON = function () {
14818 return '{' + tfJSON(propertyKeyType) + ': ' + tfJSON(propertyType) + '}'
14819 }
14820 } else {
14821 _map.toJSON = function () { return '{' + tfJSON(propertyType) + '}' }
14822 }
14823
14824 return _map
14825 },
14826
14827 object: function object (uncompiled) {
14828 var type = {}
14829
14830 for (var typePropertyName in uncompiled) {
14831 type[typePropertyName] = compile(uncompiled[typePropertyName])
14832 }
14833
14834 function _object (value, strict) {
14835 if (!NATIVE.Object(value)) return false
14836 if (NATIVE.Nil(value)) return false
14837
14838 var propertyName
14839
14840 try {
14841 for (propertyName in type) {
14842 var propertyType = type[propertyName]
14843 var propertyValue = value[propertyName]
14844
14845 typeforce(propertyType, propertyValue, strict)
14846 }
14847 } catch (e) {
14848 throw tfSubError(e, propertyName)
14849 }
14850
14851 if (strict) {
14852 for (propertyName in value) {
14853 if (type[propertyName]) continue
14854
14855 throw new TfPropertyTypeError(undefined, propertyName)
14856 }
14857 }
14858
14859 return true
14860 }
14861 _object.toJSON = function () { return tfJSON(type) }
14862
14863 return _object
14864 },
14865
14866 oneOf: function oneOf () {
14867 var types = [].slice.call(arguments).map(compile)
14868
14869 function _oneOf (value, strict) {
14870 return types.some(function (type) {
14871 try {
14872 return typeforce(type, value, strict)
14873 } catch (e) {
14874 return false
14875 }
14876 })
14877 }
14878 _oneOf.toJSON = function () { return types.map(tfJSON).join('|') }
14879
14880 return _oneOf
14881 },
14882
14883 quacksLike: function quacksLike (type) {
14884 function _quacksLike (value) {
14885 return type === getValueTypeName(value)
14886 }
14887 _quacksLike.toJSON = function () { return type }
14888
14889 return _quacksLike
14890 },
14891
14892 tuple: function tuple () {
14893 var types = [].slice.call(arguments).map(compile)
14894
14895 function _tuple (values, strict) {
14896 if (NATIVE.Nil(values)) return false
14897 if (NATIVE.Nil(values.length)) return false
14898 if (strict && (values.length !== types.length)) return false
14899
14900 return types.every(function (type, i) {
14901 try {
14902 return typeforce(type, values[i], strict)
14903 } catch (e) {
14904 throw tfSubError(e, i)
14905 }
14906 })
14907 }
14908 _tuple.toJSON = function () { return '(' + types.map(tfJSON).join(', ') + ')' }
14909
14910 return _tuple
14911 },
14912
14913 value: function value (expected) {
14914 function _value (actual) {
14915 return actual === expected
14916 }
14917 _value.toJSON = function () { return expected }
14918
14919 return _value
14920 }
14921}
14922
14923function compile (type) {
14924 if (NATIVE.String(type)) {
14925 if (type[0] === '?') return TYPES.maybe(type.slice(1))
14926
14927 return NATIVE[type] || TYPES.quacksLike(type)
14928 } else if (type && NATIVE.Object(type)) {
14929 if (NATIVE.Array(type)) return TYPES.arrayOf(type[0])
14930
14931 return TYPES.object(type)
14932 } else if (NATIVE.Function(type)) {
14933 return type
14934 }
14935
14936 return TYPES.value(type)
14937}
14938
14939function typeforce (type, value, strict, surrogate) {
14940 if (NATIVE.Function(type)) {
14941 if (type(value, strict)) return true
14942
14943 throw new TfTypeError(surrogate || type, value)
14944 }
14945
14946 // JIT
14947 return typeforce(compile(type), value, strict)
14948}
14949
14950// assign types to typeforce function
14951for (var typeName in NATIVE) {
14952 typeforce[typeName] = NATIVE[typeName]
14953}
14954
14955for (typeName in TYPES) {
14956 typeforce[typeName] = TYPES[typeName]
14957}
14958
14959var EXTRA = require('./extra')
14960for (typeName in EXTRA) {
14961 typeforce[typeName] = EXTRA[typeName]
14962}
14963
14964// async wrapper
14965function __async (type, value, strict, callback) {
14966 // default to falsy strict if using shorthand overload
14967 if (typeof strict === 'function') return __async(type, value, false, strict)
14968
14969 try {
14970 typeforce(type, value, strict)
14971 } catch (e) {
14972 return callback(e)
14973 }
14974
14975 callback()
14976}
14977
14978typeforce.async = __async
14979typeforce.compile = compile
14980typeforce.TfTypeError = TfTypeError
14981typeforce.TfPropertyTypeError = TfPropertyTypeError
14982
14983module.exports = typeforce
14984
14985},{"./errors":110,"./extra":111,"./native":113}],113:[function(require,module,exports){
14986var types = {
14987 Array: function (value) { return value !== null && value !== undefined && value.constructor === Array },
14988 Boolean: function (value) { return typeof value === 'boolean' },
14989 Function: function (value) { return typeof value === 'function' },
14990 Nil: function (value) { return value === undefined || value === null },
14991 Number: function (value) { return typeof value === 'number' },
14992 Object: function (value) { return typeof value === 'object' },
14993 String: function (value) { return typeof value === 'string' },
14994 '': function () { return true }
14995}
14996
14997// TODO: deprecate
14998types.Null = types.Nil
14999
15000for (var typeName in types) {
15001 types[typeName].toJSON = function (t) {
15002 return t
15003 }.bind(null, typeName)
15004}
15005
15006module.exports = types
15007
15008},{}],114:[function(require,module,exports){
15009'use strict'
15010var Buffer = require('safe-buffer').Buffer
15011
15012// Number.MAX_SAFE_INTEGER
15013var MAX_SAFE_INTEGER = 9007199254740991
15014
15015function checkUInt53 (n) {
15016 if (n < 0 || n > MAX_SAFE_INTEGER || n % 1 !== 0) throw new RangeError('value out of range')
15017}
15018
15019function encode (number, buffer, offset) {
15020 checkUInt53(number)
15021
15022 if (!buffer) buffer = Buffer.allocUnsafe(encodingLength(number))
15023 if (!Buffer.isBuffer(buffer)) throw new TypeError('buffer must be a Buffer instance')
15024 if (!offset) offset = 0
15025
15026 // 8 bit
15027 if (number < 0xfd) {
15028 buffer.writeUInt8(number, offset)
15029 encode.bytes = 1
15030
15031 // 16 bit
15032 } else if (number <= 0xffff) {
15033 buffer.writeUInt8(0xfd, offset)
15034 buffer.writeUInt16LE(number, offset + 1)
15035 encode.bytes = 3
15036
15037 // 32 bit
15038 } else if (number <= 0xffffffff) {
15039 buffer.writeUInt8(0xfe, offset)
15040 buffer.writeUInt32LE(number, offset + 1)
15041 encode.bytes = 5
15042
15043 // 64 bit
15044 } else {
15045 buffer.writeUInt8(0xff, offset)
15046 buffer.writeUInt32LE(number >>> 0, offset + 1)
15047 buffer.writeUInt32LE((number / 0x100000000) | 0, offset + 5)
15048 encode.bytes = 9
15049 }
15050
15051 return buffer
15052}
15053
15054function decode (buffer, offset) {
15055 if (!Buffer.isBuffer(buffer)) throw new TypeError('buffer must be a Buffer instance')
15056 if (!offset) offset = 0
15057
15058 var first = buffer.readUInt8(offset)
15059
15060 // 8 bit
15061 if (first < 0xfd) {
15062 decode.bytes = 1
15063 return first
15064
15065 // 16 bit
15066 } else if (first === 0xfd) {
15067 decode.bytes = 3
15068 return buffer.readUInt16LE(offset + 1)
15069
15070 // 32 bit
15071 } else if (first === 0xfe) {
15072 decode.bytes = 5
15073 return buffer.readUInt32LE(offset + 1)
15074
15075 // 64 bit
15076 } else {
15077 decode.bytes = 9
15078 var lo = buffer.readUInt32LE(offset + 1)
15079 var hi = buffer.readUInt32LE(offset + 5)
15080 var number = hi * 0x0100000000 + lo
15081 checkUInt53(number)
15082
15083 return number
15084 }
15085}
15086
15087function encodingLength (number) {
15088 checkUInt53(number)
15089
15090 return (
15091 number < 0xfd ? 1
15092 : number <= 0xffff ? 3
15093 : number <= 0xffffffff ? 5
15094 : 9
15095 )
15096}
15097
15098module.exports = { encode: encode, decode: decode, encodingLength: encodingLength }
15099
15100},{"safe-buffer":101}],115:[function(require,module,exports){
15101(function (Buffer){
15102var bs58check = require('bs58check')
15103
15104function decodeRaw (buffer, version) {
15105 // check version only if defined
15106 if (version !== undefined && buffer[0] !== version) throw new Error('Invalid network version')
15107
15108 // uncompressed
15109 if (buffer.length === 33) {
15110 return {
15111 version: buffer[0],
15112 privateKey: buffer.slice(1, 33),
15113 compressed: false
15114 }
15115 }
15116
15117 // invalid length
15118 if (buffer.length !== 34) throw new Error('Invalid WIF length')
15119
15120 // invalid compression flag
15121 if (buffer[33] !== 0x01) throw new Error('Invalid compression flag')
15122
15123 return {
15124 version: buffer[0],
15125 privateKey: buffer.slice(1, 33),
15126 compressed: true
15127 }
15128}
15129
15130function encodeRaw (version, privateKey, compressed) {
15131 var result = new Buffer(compressed ? 34 : 33)
15132
15133 result.writeUInt8(version, 0)
15134 privateKey.copy(result, 1)
15135
15136 if (compressed) {
15137 result[33] = 0x01
15138 }
15139
15140 return result
15141}
15142
15143function decode (string, version) {
15144 return decodeRaw(bs58check.decode(string), version)
15145}
15146
15147function encode (version, privateKey, compressed) {
15148 if (typeof version === 'number') return bs58check.encode(encodeRaw(version, privateKey, compressed))
15149
15150 return bs58check.encode(
15151 encodeRaw(
15152 version.version,
15153 version.privateKey,
15154 version.compressed
15155 )
15156 )
15157}
15158
15159module.exports = {
15160 decode: decode,
15161 decodeRaw: decodeRaw,
15162 encode: encode,
15163 encodeRaw: encodeRaw
15164}
15165
15166}).call(this,require("buffer").Buffer)
15167},{"bs58check":83,"buffer":5}]},{},[34])(34)
15168}); \ No newline at end of file
diff --git a/src/js/bitcoinjs-3.3.0.js b/src/js/bitcoinjs-bip38-2.0.2.js
index 3c20653..ea38715 100644
--- a/src/js/bitcoinjs-3.3.0.js
+++ b/src/js/bitcoinjs-bip38-2.0.2.js
@@ -1,4 +1,1737 @@
1(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.bitcoinjs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ 1(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.bitcoinjsBip38 = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2var asn1 = exports;
3
4asn1.bignum = require('bn.js');
5
6asn1.define = require('./asn1/api').define;
7asn1.base = require('./asn1/base');
8asn1.constants = require('./asn1/constants');
9asn1.decoders = require('./asn1/decoders');
10asn1.encoders = require('./asn1/encoders');
11
12},{"./asn1/api":2,"./asn1/base":4,"./asn1/constants":8,"./asn1/decoders":10,"./asn1/encoders":13,"bn.js":17}],2:[function(require,module,exports){
13var asn1 = require('../asn1');
14var inherits = require('inherits');
15
16var api = exports;
17
18api.define = function define(name, body) {
19 return new Entity(name, body);
20};
21
22function Entity(name, body) {
23 this.name = name;
24 this.body = body;
25
26 this.decoders = {};
27 this.encoders = {};
28};
29
30Entity.prototype._createNamed = function createNamed(base) {
31 var named;
32 try {
33 named = require('vm').runInThisContext(
34 '(function ' + this.name + '(entity) {\n' +
35 ' this._initNamed(entity);\n' +
36 '})'
37 );
38 } catch (e) {
39 named = function (entity) {
40 this._initNamed(entity);
41 };
42 }
43 inherits(named, base);
44 named.prototype._initNamed = function initnamed(entity) {
45 base.call(this, entity);
46 };
47
48 return new named(this);
49};
50
51Entity.prototype._getDecoder = function _getDecoder(enc) {
52 enc = enc || 'der';
53 // Lazily create decoder
54 if (!this.decoders.hasOwnProperty(enc))
55 this.decoders[enc] = this._createNamed(asn1.decoders[enc]);
56 return this.decoders[enc];
57};
58
59Entity.prototype.decode = function decode(data, enc, options) {
60 return this._getDecoder(enc).decode(data, options);
61};
62
63Entity.prototype._getEncoder = function _getEncoder(enc) {
64 enc = enc || 'der';
65 // Lazily create encoder
66 if (!this.encoders.hasOwnProperty(enc))
67 this.encoders[enc] = this._createNamed(asn1.encoders[enc]);
68 return this.encoders[enc];
69};
70
71Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) {
72 return this._getEncoder(enc).encode(data, reporter);
73};
74
75},{"../asn1":1,"inherits":95,"vm":149}],3:[function(require,module,exports){
76var inherits = require('inherits');
77var Reporter = require('../base').Reporter;
78var Buffer = require('buffer').Buffer;
79
80function DecoderBuffer(base, options) {
81 Reporter.call(this, options);
82 if (!Buffer.isBuffer(base)) {
83 this.error('Input not Buffer');
84 return;
85 }
86
87 this.base = base;
88 this.offset = 0;
89 this.length = base.length;
90}
91inherits(DecoderBuffer, Reporter);
92exports.DecoderBuffer = DecoderBuffer;
93
94DecoderBuffer.prototype.save = function save() {
95 return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };
96};
97
98DecoderBuffer.prototype.restore = function restore(save) {
99 // Return skipped data
100 var res = new DecoderBuffer(this.base);
101 res.offset = save.offset;
102 res.length = this.offset;
103
104 this.offset = save.offset;
105 Reporter.prototype.restore.call(this, save.reporter);
106
107 return res;
108};
109
110DecoderBuffer.prototype.isEmpty = function isEmpty() {
111 return this.offset === this.length;
112};
113
114DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {
115 if (this.offset + 1 <= this.length)
116 return this.base.readUInt8(this.offset++, true);
117 else
118 return this.error(fail || 'DecoderBuffer overrun');
119}
120
121DecoderBuffer.prototype.skip = function skip(bytes, fail) {
122 if (!(this.offset + bytes <= this.length))
123 return this.error(fail || 'DecoderBuffer overrun');
124
125 var res = new DecoderBuffer(this.base);
126
127 // Share reporter state
128 res._reporterState = this._reporterState;
129
130 res.offset = this.offset;
131 res.length = this.offset + bytes;
132 this.offset += bytes;
133 return res;
134}
135
136DecoderBuffer.prototype.raw = function raw(save) {
137 return this.base.slice(save ? save.offset : this.offset, this.length);
138}
139
140function EncoderBuffer(value, reporter) {
141 if (Array.isArray(value)) {
142 this.length = 0;
143 this.value = value.map(function(item) {
144 if (!(item instanceof EncoderBuffer))
145 item = new EncoderBuffer(item, reporter);
146 this.length += item.length;
147 return item;
148 }, this);
149 } else if (typeof value === 'number') {
150 if (!(0 <= value && value <= 0xff))
151 return reporter.error('non-byte EncoderBuffer value');
152 this.value = value;
153 this.length = 1;
154 } else if (typeof value === 'string') {
155 this.value = value;
156 this.length = Buffer.byteLength(value);
157 } else if (Buffer.isBuffer(value)) {
158 this.value = value;
159 this.length = value.length;
160 } else {
161 return reporter.error('Unsupported type: ' + typeof value);
162 }
163}
164exports.EncoderBuffer = EncoderBuffer;
165
166EncoderBuffer.prototype.join = function join(out, offset) {
167 if (!out)
168 out = new Buffer(this.length);
169 if (!offset)
170 offset = 0;
171
172 if (this.length === 0)
173 return out;
174
175 if (Array.isArray(this.value)) {
176 this.value.forEach(function(item) {
177 item.join(out, offset);
178 offset += item.length;
179 });
180 } else {
181 if (typeof this.value === 'number')
182 out[offset] = this.value;
183 else if (typeof this.value === 'string')
184 out.write(this.value, offset);
185 else if (Buffer.isBuffer(this.value))
186 this.value.copy(out, offset);
187 offset += this.length;
188 }
189
190 return out;
191};
192
193},{"../base":4,"buffer":47,"inherits":95}],4:[function(require,module,exports){
194var base = exports;
195
196base.Reporter = require('./reporter').Reporter;
197base.DecoderBuffer = require('./buffer').DecoderBuffer;
198base.EncoderBuffer = require('./buffer').EncoderBuffer;
199base.Node = require('./node');
200
201},{"./buffer":3,"./node":5,"./reporter":6}],5:[function(require,module,exports){
202var Reporter = require('../base').Reporter;
203var EncoderBuffer = require('../base').EncoderBuffer;
204var DecoderBuffer = require('../base').DecoderBuffer;
205var assert = require('minimalistic-assert');
206
207// Supported tags
208var tags = [
209 'seq', 'seqof', 'set', 'setof', 'objid', 'bool',
210 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',
211 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',
212 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'
213];
214
215// Public methods list
216var methods = [
217 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',
218 'any', 'contains'
219].concat(tags);
220
221// Overrided methods list
222var overrided = [
223 '_peekTag', '_decodeTag', '_use',
224 '_decodeStr', '_decodeObjid', '_decodeTime',
225 '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',
226
227 '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',
228 '_encodeNull', '_encodeInt', '_encodeBool'
229];
230
231function Node(enc, parent) {
232 var state = {};
233 this._baseState = state;
234
235 state.enc = enc;
236
237 state.parent = parent || null;
238 state.children = null;
239
240 // State
241 state.tag = null;
242 state.args = null;
243 state.reverseArgs = null;
244 state.choice = null;
245 state.optional = false;
246 state.any = false;
247 state.obj = false;
248 state.use = null;
249 state.useDecoder = null;
250 state.key = null;
251 state['default'] = null;
252 state.explicit = null;
253 state.implicit = null;
254 state.contains = null;
255
256 // Should create new instance on each method
257 if (!state.parent) {
258 state.children = [];
259 this._wrap();
260 }
261}
262module.exports = Node;
263
264var stateProps = [
265 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',
266 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',
267 'implicit', 'contains'
268];
269
270Node.prototype.clone = function clone() {
271 var state = this._baseState;
272 var cstate = {};
273 stateProps.forEach(function(prop) {
274 cstate[prop] = state[prop];
275 });
276 var res = new this.constructor(cstate.parent);
277 res._baseState = cstate;
278 return res;
279};
280
281Node.prototype._wrap = function wrap() {
282 var state = this._baseState;
283 methods.forEach(function(method) {
284 this[method] = function _wrappedMethod() {
285 var clone = new this.constructor(this);
286 state.children.push(clone);
287 return clone[method].apply(clone, arguments);
288 };
289 }, this);
290};
291
292Node.prototype._init = function init(body) {
293 var state = this._baseState;
294
295 assert(state.parent === null);
296 body.call(this);
297
298 // Filter children
299 state.children = state.children.filter(function(child) {
300 return child._baseState.parent === this;
301 }, this);
302 assert.equal(state.children.length, 1, 'Root node can have only one child');
303};
304
305Node.prototype._useArgs = function useArgs(args) {
306 var state = this._baseState;
307
308 // Filter children and args
309 var children = args.filter(function(arg) {
310 return arg instanceof this.constructor;
311 }, this);
312 args = args.filter(function(arg) {
313 return !(arg instanceof this.constructor);
314 }, this);
315
316 if (children.length !== 0) {
317 assert(state.children === null);
318 state.children = children;
319
320 // Replace parent to maintain backward link
321 children.forEach(function(child) {
322 child._baseState.parent = this;
323 }, this);
324 }
325 if (args.length !== 0) {
326 assert(state.args === null);
327 state.args = args;
328 state.reverseArgs = args.map(function(arg) {
329 if (typeof arg !== 'object' || arg.constructor !== Object)
330 return arg;
331
332 var res = {};
333 Object.keys(arg).forEach(function(key) {
334 if (key == (key | 0))
335 key |= 0;
336 var value = arg[key];
337 res[value] = key;
338 });
339 return res;
340 });
341 }
342};
343
344//
345// Overrided methods
346//
347
348overrided.forEach(function(method) {
349 Node.prototype[method] = function _overrided() {
350 var state = this._baseState;
351 throw new Error(method + ' not implemented for encoding: ' + state.enc);
352 };
353});
354
355//
356// Public methods
357//
358
359tags.forEach(function(tag) {
360 Node.prototype[tag] = function _tagMethod() {
361 var state = this._baseState;
362 var args = Array.prototype.slice.call(arguments);
363
364 assert(state.tag === null);
365 state.tag = tag;
366
367 this._useArgs(args);
368
369 return this;
370 };
371});
372
373Node.prototype.use = function use(item) {
374 assert(item);
375 var state = this._baseState;
376
377 assert(state.use === null);
378 state.use = item;
379
380 return this;
381};
382
383Node.prototype.optional = function optional() {
384 var state = this._baseState;
385
386 state.optional = true;
387
388 return this;
389};
390
391Node.prototype.def = function def(val) {
392 var state = this._baseState;
393
394 assert(state['default'] === null);
395 state['default'] = val;
396 state.optional = true;
397
398 return this;
399};
400
401Node.prototype.explicit = function explicit(num) {
402 var state = this._baseState;
403
404 assert(state.explicit === null && state.implicit === null);
405 state.explicit = num;
406
407 return this;
408};
409
410Node.prototype.implicit = function implicit(num) {
411 var state = this._baseState;
412
413 assert(state.explicit === null && state.implicit === null);
414 state.implicit = num;
415
416 return this;
417};
418
419Node.prototype.obj = function obj() {
420 var state = this._baseState;
421 var args = Array.prototype.slice.call(arguments);
422
423 state.obj = true;
424
425 if (args.length !== 0)
426 this._useArgs(args);
427
428 return this;
429};
430
431Node.prototype.key = function key(newKey) {
432 var state = this._baseState;
433
434 assert(state.key === null);
435 state.key = newKey;
436
437 return this;
438};
439
440Node.prototype.any = function any() {
441 var state = this._baseState;
442
443 state.any = true;
444
445 return this;
446};
447
448Node.prototype.choice = function choice(obj) {
449 var state = this._baseState;
450
451 assert(state.choice === null);
452 state.choice = obj;
453 this._useArgs(Object.keys(obj).map(function(key) {
454 return obj[key];
455 }));
456
457 return this;
458};
459
460Node.prototype.contains = function contains(item) {
461 var state = this._baseState;
462
463 assert(state.use === null);
464 state.contains = item;
465
466 return this;
467};
468
469//
470// Decoding
471//
472
473Node.prototype._decode = function decode(input, options) {
474 var state = this._baseState;
475
476 // Decode root node
477 if (state.parent === null)
478 return input.wrapResult(state.children[0]._decode(input, options));
479
480 var result = state['default'];
481 var present = true;
482
483 var prevKey = null;
484 if (state.key !== null)
485 prevKey = input.enterKey(state.key);
486
487 // Check if tag is there
488 if (state.optional) {
489 var tag = null;
490 if (state.explicit !== null)
491 tag = state.explicit;
492 else if (state.implicit !== null)
493 tag = state.implicit;
494 else if (state.tag !== null)
495 tag = state.tag;
496
497 if (tag === null && !state.any) {
498 // Trial and Error
499 var save = input.save();
500 try {
501 if (state.choice === null)
502 this._decodeGeneric(state.tag, input, options);
503 else
504 this._decodeChoice(input, options);
505 present = true;
506 } catch (e) {
507 present = false;
508 }
509 input.restore(save);
510 } else {
511 present = this._peekTag(input, tag, state.any);
512
513 if (input.isError(present))
514 return present;
515 }
516 }
517
518 // Push object on stack
519 var prevObj;
520 if (state.obj && present)
521 prevObj = input.enterObject();
522
523 if (present) {
524 // Unwrap explicit values
525 if (state.explicit !== null) {
526 var explicit = this._decodeTag(input, state.explicit);
527 if (input.isError(explicit))
528 return explicit;
529 input = explicit;
530 }
531
532 var start = input.offset;
533
534 // Unwrap implicit and normal values
535 if (state.use === null && state.choice === null) {
536 if (state.any)
537 var save = input.save();
538 var body = this._decodeTag(
539 input,
540 state.implicit !== null ? state.implicit : state.tag,
541 state.any
542 );
543 if (input.isError(body))
544 return body;
545
546 if (state.any)
547 result = input.raw(save);
548 else
549 input = body;
550 }
551
552 if (options && options.track && state.tag !== null)
553 options.track(input.path(), start, input.length, 'tagged');
554
555 if (options && options.track && state.tag !== null)
556 options.track(input.path(), input.offset, input.length, 'content');
557
558 // Select proper method for tag
559 if (state.any)
560 result = result;
561 else if (state.choice === null)
562 result = this._decodeGeneric(state.tag, input, options);
563 else
564 result = this._decodeChoice(input, options);
565
566 if (input.isError(result))
567 return result;
568
569 // Decode children
570 if (!state.any && state.choice === null && state.children !== null) {
571 state.children.forEach(function decodeChildren(child) {
572 // NOTE: We are ignoring errors here, to let parser continue with other
573 // parts of encoded data
574 child._decode(input, options);
575 });
576 }
577
578 // Decode contained/encoded by schema, only in bit or octet strings
579 if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {
580 var data = new DecoderBuffer(result);
581 result = this._getUse(state.contains, input._reporterState.obj)
582 ._decode(data, options);
583 }
584 }
585
586 // Pop object
587 if (state.obj && present)
588 result = input.leaveObject(prevObj);
589
590 // Set key
591 if (state.key !== null && (result !== null || present === true))
592 input.leaveKey(prevKey, state.key, result);
593 else if (prevKey !== null)
594 input.exitKey(prevKey);
595
596 return result;
597};
598
599Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {
600 var state = this._baseState;
601
602 if (tag === 'seq' || tag === 'set')
603 return null;
604 if (tag === 'seqof' || tag === 'setof')
605 return this._decodeList(input, tag, state.args[0], options);
606 else if (/str$/.test(tag))
607 return this._decodeStr(input, tag, options);
608 else if (tag === 'objid' && state.args)
609 return this._decodeObjid(input, state.args[0], state.args[1], options);
610 else if (tag === 'objid')
611 return this._decodeObjid(input, null, null, options);
612 else if (tag === 'gentime' || tag === 'utctime')
613 return this._decodeTime(input, tag, options);
614 else if (tag === 'null_')
615 return this._decodeNull(input, options);
616 else if (tag === 'bool')
617 return this._decodeBool(input, options);
618 else if (tag === 'objDesc')
619 return this._decodeStr(input, tag, options);
620 else if (tag === 'int' || tag === 'enum')
621 return this._decodeInt(input, state.args && state.args[0], options);
622
623 if (state.use !== null) {
624 return this._getUse(state.use, input._reporterState.obj)
625 ._decode(input, options);
626 } else {
627 return input.error('unknown tag: ' + tag);
628 }
629};
630
631Node.prototype._getUse = function _getUse(entity, obj) {
632
633 var state = this._baseState;
634 // Create altered use decoder if implicit is set
635 state.useDecoder = this._use(entity, obj);
636 assert(state.useDecoder._baseState.parent === null);
637 state.useDecoder = state.useDecoder._baseState.children[0];
638 if (state.implicit !== state.useDecoder._baseState.implicit) {
639 state.useDecoder = state.useDecoder.clone();
640 state.useDecoder._baseState.implicit = state.implicit;
641 }
642 return state.useDecoder;
643};
644
645Node.prototype._decodeChoice = function decodeChoice(input, options) {
646 var state = this._baseState;
647 var result = null;
648 var match = false;
649
650 Object.keys(state.choice).some(function(key) {
651 var save = input.save();
652 var node = state.choice[key];
653 try {
654 var value = node._decode(input, options);
655 if (input.isError(value))
656 return false;
657
658 result = { type: key, value: value };
659 match = true;
660 } catch (e) {
661 input.restore(save);
662 return false;
663 }
664 return true;
665 }, this);
666
667 if (!match)
668 return input.error('Choice not matched');
669
670 return result;
671};
672
673//
674// Encoding
675//
676
677Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) {
678 return new EncoderBuffer(data, this.reporter);
679};
680
681Node.prototype._encode = function encode(data, reporter, parent) {
682 var state = this._baseState;
683 if (state['default'] !== null && state['default'] === data)
684 return;
685
686 var result = this._encodeValue(data, reporter, parent);
687 if (result === undefined)
688 return;
689
690 if (this._skipDefault(result, reporter, parent))
691 return;
692
693 return result;
694};
695
696Node.prototype._encodeValue = function encode(data, reporter, parent) {
697 var state = this._baseState;
698
699 // Decode root node
700 if (state.parent === null)
701 return state.children[0]._encode(data, reporter || new Reporter());
702
703 var result = null;
704
705 // Set reporter to share it with a child class
706 this.reporter = reporter;
707
708 // Check if data is there
709 if (state.optional && data === undefined) {
710 if (state['default'] !== null)
711 data = state['default']
712 else
713 return;
714 }
715
716 // Encode children first
717 var content = null;
718 var primitive = false;
719 if (state.any) {
720 // Anything that was given is translated to buffer
721 result = this._createEncoderBuffer(data);
722 } else if (state.choice) {
723 result = this._encodeChoice(data, reporter);
724 } else if (state.contains) {
725 content = this._getUse(state.contains, parent)._encode(data, reporter);
726 primitive = true;
727 } else if (state.children) {
728 content = state.children.map(function(child) {
729 if (child._baseState.tag === 'null_')
730 return child._encode(null, reporter, data);
731
732 if (child._baseState.key === null)
733 return reporter.error('Child should have a key');
734 var prevKey = reporter.enterKey(child._baseState.key);
735
736 if (typeof data !== 'object')
737 return reporter.error('Child expected, but input is not object');
738
739 var res = child._encode(data[child._baseState.key], reporter, data);
740 reporter.leaveKey(prevKey);
741
742 return res;
743 }, this).filter(function(child) {
744 return child;
745 });
746 content = this._createEncoderBuffer(content);
747 } else {
748 if (state.tag === 'seqof' || state.tag === 'setof') {
749 // TODO(indutny): this should be thrown on DSL level
750 if (!(state.args && state.args.length === 1))
751 return reporter.error('Too many args for : ' + state.tag);
752
753 if (!Array.isArray(data))
754 return reporter.error('seqof/setof, but data is not Array');
755
756 var child = this.clone();
757 child._baseState.implicit = null;
758 content = this._createEncoderBuffer(data.map(function(item) {
759 var state = this._baseState;
760
761 return this._getUse(state.args[0], data)._encode(item, reporter);
762 }, child));
763 } else if (state.use !== null) {
764 result = this._getUse(state.use, parent)._encode(data, reporter);
765 } else {
766 content = this._encodePrimitive(state.tag, data);
767 primitive = true;
768 }
769 }
770
771 // Encode data itself
772 var result;
773 if (!state.any && state.choice === null) {
774 var tag = state.implicit !== null ? state.implicit : state.tag;
775 var cls = state.implicit === null ? 'universal' : 'context';
776
777 if (tag === null) {
778 if (state.use === null)
779 reporter.error('Tag could be ommited only for .use()');
780 } else {
781 if (state.use === null)
782 result = this._encodeComposite(tag, primitive, cls, content);
783 }
784 }
785
786 // Wrap in explicit
787 if (state.explicit !== null)
788 result = this._encodeComposite(state.explicit, false, 'context', result);
789
790 return result;
791};
792
793Node.prototype._encodeChoice = function encodeChoice(data, reporter) {
794 var state = this._baseState;
795
796 var node = state.choice[data.type];
797 if (!node) {
798 assert(
799 false,
800 data.type + ' not found in ' +
801 JSON.stringify(Object.keys(state.choice)));
802 }
803 return node._encode(data.value, reporter);
804};
805
806Node.prototype._encodePrimitive = function encodePrimitive(tag, data) {
807 var state = this._baseState;
808
809 if (/str$/.test(tag))
810 return this._encodeStr(data, tag);
811 else if (tag === 'objid' && state.args)
812 return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);
813 else if (tag === 'objid')
814 return this._encodeObjid(data, null, null);
815 else if (tag === 'gentime' || tag === 'utctime')
816 return this._encodeTime(data, tag);
817 else if (tag === 'null_')
818 return this._encodeNull();
819 else if (tag === 'int' || tag === 'enum')
820 return this._encodeInt(data, state.args && state.reverseArgs[0]);
821 else if (tag === 'bool')
822 return this._encodeBool(data);
823 else if (tag === 'objDesc')
824 return this._encodeStr(data, tag);
825 else
826 throw new Error('Unsupported tag: ' + tag);
827};
828
829Node.prototype._isNumstr = function isNumstr(str) {
830 return /^[0-9 ]*$/.test(str);
831};
832
833Node.prototype._isPrintstr = function isPrintstr(str) {
834 return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str);
835};
836
837},{"../base":4,"minimalistic-assert":99}],6:[function(require,module,exports){
838var inherits = require('inherits');
839
840function Reporter(options) {
841 this._reporterState = {
842 obj: null,
843 path: [],
844 options: options || {},
845 errors: []
846 };
847}
848exports.Reporter = Reporter;
849
850Reporter.prototype.isError = function isError(obj) {
851 return obj instanceof ReporterError;
852};
853
854Reporter.prototype.save = function save() {
855 var state = this._reporterState;
856
857 return { obj: state.obj, pathLen: state.path.length };
858};
859
860Reporter.prototype.restore = function restore(data) {
861 var state = this._reporterState;
862
863 state.obj = data.obj;
864 state.path = state.path.slice(0, data.pathLen);
865};
866
867Reporter.prototype.enterKey = function enterKey(key) {
868 return this._reporterState.path.push(key);
869};
870
871Reporter.prototype.exitKey = function exitKey(index) {
872 var state = this._reporterState;
873
874 state.path = state.path.slice(0, index - 1);
875};
876
877Reporter.prototype.leaveKey = function leaveKey(index, key, value) {
878 var state = this._reporterState;
879
880 this.exitKey(index);
881 if (state.obj !== null)
882 state.obj[key] = value;
883};
884
885Reporter.prototype.path = function path() {
886 return this._reporterState.path.join('/');
887};
888
889Reporter.prototype.enterObject = function enterObject() {
890 var state = this._reporterState;
891
892 var prev = state.obj;
893 state.obj = {};
894 return prev;
895};
896
897Reporter.prototype.leaveObject = function leaveObject(prev) {
898 var state = this._reporterState;
899
900 var now = state.obj;
901 state.obj = prev;
902 return now;
903};
904
905Reporter.prototype.error = function error(msg) {
906 var err;
907 var state = this._reporterState;
908
909 var inherited = msg instanceof ReporterError;
910 if (inherited) {
911 err = msg;
912 } else {
913 err = new ReporterError(state.path.map(function(elem) {
914 return '[' + JSON.stringify(elem) + ']';
915 }).join(''), msg.message || msg, msg.stack);
916 }
917
918 if (!state.options.partial)
919 throw err;
920
921 if (!inherited)
922 state.errors.push(err);
923
924 return err;
925};
926
927Reporter.prototype.wrapResult = function wrapResult(result) {
928 var state = this._reporterState;
929 if (!state.options.partial)
930 return result;
931
932 return {
933 result: this.isError(result) ? null : result,
934 errors: state.errors
935 };
936};
937
938function ReporterError(path, msg) {
939 this.path = path;
940 this.rethrow(msg);
941};
942inherits(ReporterError, Error);
943
944ReporterError.prototype.rethrow = function rethrow(msg) {
945 this.message = msg + ' at: ' + (this.path || '(shallow)');
946 if (Error.captureStackTrace)
947 Error.captureStackTrace(this, ReporterError);
948
949 if (!this.stack) {
950 try {
951 // IE only adds stack when thrown
952 throw new Error(this.message);
953 } catch (e) {
954 this.stack = e.stack;
955 }
956 }
957 return this;
958};
959
960},{"inherits":95}],7:[function(require,module,exports){
961var constants = require('../constants');
962
963exports.tagClass = {
964 0: 'universal',
965 1: 'application',
966 2: 'context',
967 3: 'private'
968};
969exports.tagClassByName = constants._reverse(exports.tagClass);
970
971exports.tag = {
972 0x00: 'end',
973 0x01: 'bool',
974 0x02: 'int',
975 0x03: 'bitstr',
976 0x04: 'octstr',
977 0x05: 'null_',
978 0x06: 'objid',
979 0x07: 'objDesc',
980 0x08: 'external',
981 0x09: 'real',
982 0x0a: 'enum',
983 0x0b: 'embed',
984 0x0c: 'utf8str',
985 0x0d: 'relativeOid',
986 0x10: 'seq',
987 0x11: 'set',
988 0x12: 'numstr',
989 0x13: 'printstr',
990 0x14: 't61str',
991 0x15: 'videostr',
992 0x16: 'ia5str',
993 0x17: 'utctime',
994 0x18: 'gentime',
995 0x19: 'graphstr',
996 0x1a: 'iso646str',
997 0x1b: 'genstr',
998 0x1c: 'unistr',
999 0x1d: 'charstr',
1000 0x1e: 'bmpstr'
1001};
1002exports.tagByName = constants._reverse(exports.tag);
1003
1004},{"../constants":8}],8:[function(require,module,exports){
1005var constants = exports;
1006
1007// Helper
1008constants._reverse = function reverse(map) {
1009 var res = {};
1010
1011 Object.keys(map).forEach(function(key) {
1012 // Convert key to integer if it is stringified
1013 if ((key | 0) == key)
1014 key = key | 0;
1015
1016 var value = map[key];
1017 res[value] = key;
1018 });
1019
1020 return res;
1021};
1022
1023constants.der = require('./der');
1024
1025},{"./der":7}],9:[function(require,module,exports){
1026var inherits = require('inherits');
1027
1028var asn1 = require('../../asn1');
1029var base = asn1.base;
1030var bignum = asn1.bignum;
1031
1032// Import DER constants
1033var der = asn1.constants.der;
1034
1035function DERDecoder(entity) {
1036 this.enc = 'der';
1037 this.name = entity.name;
1038 this.entity = entity;
1039
1040 // Construct base tree
1041 this.tree = new DERNode();
1042 this.tree._init(entity.body);
1043};
1044module.exports = DERDecoder;
1045
1046DERDecoder.prototype.decode = function decode(data, options) {
1047 if (!(data instanceof base.DecoderBuffer))
1048 data = new base.DecoderBuffer(data, options);
1049
1050 return this.tree._decode(data, options);
1051};
1052
1053// Tree methods
1054
1055function DERNode(parent) {
1056 base.Node.call(this, 'der', parent);
1057}
1058inherits(DERNode, base.Node);
1059
1060DERNode.prototype._peekTag = function peekTag(buffer, tag, any) {
1061 if (buffer.isEmpty())
1062 return false;
1063
1064 var state = buffer.save();
1065 var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"');
1066 if (buffer.isError(decodedTag))
1067 return decodedTag;
1068
1069 buffer.restore(state);
1070
1071 return decodedTag.tag === tag || decodedTag.tagStr === tag ||
1072 (decodedTag.tagStr + 'of') === tag || any;
1073};
1074
1075DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {
1076 var decodedTag = derDecodeTag(buffer,
1077 'Failed to decode tag of "' + tag + '"');
1078 if (buffer.isError(decodedTag))
1079 return decodedTag;
1080
1081 var len = derDecodeLen(buffer,
1082 decodedTag.primitive,
1083 'Failed to get length of "' + tag + '"');
1084
1085 // Failure
1086 if (buffer.isError(len))
1087 return len;
1088
1089 if (!any &&
1090 decodedTag.tag !== tag &&
1091 decodedTag.tagStr !== tag &&
1092 decodedTag.tagStr + 'of' !== tag) {
1093 return buffer.error('Failed to match tag: "' + tag + '"');
1094 }
1095
1096 if (decodedTag.primitive || len !== null)
1097 return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
1098
1099 // Indefinite length... find END tag
1100 var state = buffer.save();
1101 var res = this._skipUntilEnd(
1102 buffer,
1103 'Failed to skip indefinite length body: "' + this.tag + '"');
1104 if (buffer.isError(res))
1105 return res;
1106
1107 len = buffer.offset - state.offset;
1108 buffer.restore(state);
1109 return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
1110};
1111
1112DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {
1113 while (true) {
1114 var tag = derDecodeTag(buffer, fail);
1115 if (buffer.isError(tag))
1116 return tag;
1117 var len = derDecodeLen(buffer, tag.primitive, fail);
1118 if (buffer.isError(len))
1119 return len;
1120
1121 var res;
1122 if (tag.primitive || len !== null)
1123 res = buffer.skip(len)
1124 else
1125 res = this._skipUntilEnd(buffer, fail);
1126
1127 // Failure
1128 if (buffer.isError(res))
1129 return res;
1130
1131 if (tag.tagStr === 'end')
1132 break;
1133 }
1134};
1135
1136DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,
1137 options) {
1138 var result = [];
1139 while (!buffer.isEmpty()) {
1140 var possibleEnd = this._peekTag(buffer, 'end');
1141 if (buffer.isError(possibleEnd))
1142 return possibleEnd;
1143
1144 var res = decoder.decode(buffer, 'der', options);
1145 if (buffer.isError(res) && possibleEnd)
1146 break;
1147 result.push(res);
1148 }
1149 return result;
1150};
1151
1152DERNode.prototype._decodeStr = function decodeStr(buffer, tag) {
1153 if (tag === 'bitstr') {
1154 var unused = buffer.readUInt8();
1155 if (buffer.isError(unused))
1156 return unused;
1157 return { unused: unused, data: buffer.raw() };
1158 } else if (tag === 'bmpstr') {
1159 var raw = buffer.raw();
1160 if (raw.length % 2 === 1)
1161 return buffer.error('Decoding of string type: bmpstr length mismatch');
1162
1163 var str = '';
1164 for (var i = 0; i < raw.length / 2; i++) {
1165 str += String.fromCharCode(raw.readUInt16BE(i * 2));
1166 }
1167 return str;
1168 } else if (tag === 'numstr') {
1169 var numstr = buffer.raw().toString('ascii');
1170 if (!this._isNumstr(numstr)) {
1171 return buffer.error('Decoding of string type: ' +
1172 'numstr unsupported characters');
1173 }
1174 return numstr;
1175 } else if (tag === 'octstr') {
1176 return buffer.raw();
1177 } else if (tag === 'objDesc') {
1178 return buffer.raw();
1179 } else if (tag === 'printstr') {
1180 var printstr = buffer.raw().toString('ascii');
1181 if (!this._isPrintstr(printstr)) {
1182 return buffer.error('Decoding of string type: ' +
1183 'printstr unsupported characters');
1184 }
1185 return printstr;
1186 } else if (/str$/.test(tag)) {
1187 return buffer.raw().toString();
1188 } else {
1189 return buffer.error('Decoding of string type: ' + tag + ' unsupported');
1190 }
1191};
1192
1193DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {
1194 var result;
1195 var identifiers = [];
1196 var ident = 0;
1197 while (!buffer.isEmpty()) {
1198 var subident = buffer.readUInt8();
1199 ident <<= 7;
1200 ident |= subident & 0x7f;
1201 if ((subident & 0x80) === 0) {
1202 identifiers.push(ident);
1203 ident = 0;
1204 }
1205 }
1206 if (subident & 0x80)
1207 identifiers.push(ident);
1208
1209 var first = (identifiers[0] / 40) | 0;
1210 var second = identifiers[0] % 40;
1211
1212 if (relative)
1213 result = identifiers;
1214 else
1215 result = [first, second].concat(identifiers.slice(1));
1216
1217 if (values) {
1218 var tmp = values[result.join(' ')];
1219 if (tmp === undefined)
1220 tmp = values[result.join('.')];
1221 if (tmp !== undefined)
1222 result = tmp;
1223 }
1224
1225 return result;
1226};
1227
1228DERNode.prototype._decodeTime = function decodeTime(buffer, tag) {
1229 var str = buffer.raw().toString();
1230 if (tag === 'gentime') {
1231 var year = str.slice(0, 4) | 0;
1232 var mon = str.slice(4, 6) | 0;
1233 var day = str.slice(6, 8) | 0;
1234 var hour = str.slice(8, 10) | 0;
1235 var min = str.slice(10, 12) | 0;
1236 var sec = str.slice(12, 14) | 0;
1237 } else if (tag === 'utctime') {
1238 var year = str.slice(0, 2) | 0;
1239 var mon = str.slice(2, 4) | 0;
1240 var day = str.slice(4, 6) | 0;
1241 var hour = str.slice(6, 8) | 0;
1242 var min = str.slice(8, 10) | 0;
1243 var sec = str.slice(10, 12) | 0;
1244 if (year < 70)
1245 year = 2000 + year;
1246 else
1247 year = 1900 + year;
1248 } else {
1249 return buffer.error('Decoding ' + tag + ' time is not supported yet');
1250 }
1251
1252 return Date.UTC(year, mon - 1, day, hour, min, sec, 0);
1253};
1254
1255DERNode.prototype._decodeNull = function decodeNull(buffer) {
1256 return null;
1257};
1258
1259DERNode.prototype._decodeBool = function decodeBool(buffer) {
1260 var res = buffer.readUInt8();
1261 if (buffer.isError(res))
1262 return res;
1263 else
1264 return res !== 0;
1265};
1266
1267DERNode.prototype._decodeInt = function decodeInt(buffer, values) {
1268 // Bigint, return as it is (assume big endian)
1269 var raw = buffer.raw();
1270 var res = new bignum(raw);
1271
1272 if (values)
1273 res = values[res.toString(10)] || res;
1274
1275 return res;
1276};
1277
1278DERNode.prototype._use = function use(entity, obj) {
1279 if (typeof entity === 'function')
1280 entity = entity(obj);
1281 return entity._getDecoder('der').tree;
1282};
1283
1284// Utility methods
1285
1286function derDecodeTag(buf, fail) {
1287 var tag = buf.readUInt8(fail);
1288 if (buf.isError(tag))
1289 return tag;
1290
1291 var cls = der.tagClass[tag >> 6];
1292 var primitive = (tag & 0x20) === 0;
1293
1294 // Multi-octet tag - load
1295 if ((tag & 0x1f) === 0x1f) {
1296 var oct = tag;
1297 tag = 0;
1298 while ((oct & 0x80) === 0x80) {
1299 oct = buf.readUInt8(fail);
1300 if (buf.isError(oct))
1301 return oct;
1302
1303 tag <<= 7;
1304 tag |= oct & 0x7f;
1305 }
1306 } else {
1307 tag &= 0x1f;
1308 }
1309 var tagStr = der.tag[tag];
1310
1311 return {
1312 cls: cls,
1313 primitive: primitive,
1314 tag: tag,
1315 tagStr: tagStr
1316 };
1317}
1318
1319function derDecodeLen(buf, primitive, fail) {
1320 var len = buf.readUInt8(fail);
1321 if (buf.isError(len))
1322 return len;
1323
1324 // Indefinite form
1325 if (!primitive && len === 0x80)
1326 return null;
1327
1328 // Definite form
1329 if ((len & 0x80) === 0) {
1330 // Short form
1331 return len;
1332 }
1333
1334 // Long form
1335 var num = len & 0x7f;
1336 if (num > 4)
1337 return buf.error('length octect is too long');
1338
1339 len = 0;
1340 for (var i = 0; i < num; i++) {
1341 len <<= 8;
1342 var j = buf.readUInt8(fail);
1343 if (buf.isError(j))
1344 return j;
1345 len |= j;
1346 }
1347
1348 return len;
1349}
1350
1351},{"../../asn1":1,"inherits":95}],10:[function(require,module,exports){
1352var decoders = exports;
1353
1354decoders.der = require('./der');
1355decoders.pem = require('./pem');
1356
1357},{"./der":9,"./pem":11}],11:[function(require,module,exports){
1358var inherits = require('inherits');
1359var Buffer = require('buffer').Buffer;
1360
1361var DERDecoder = require('./der');
1362
1363function PEMDecoder(entity) {
1364 DERDecoder.call(this, entity);
1365 this.enc = 'pem';
1366};
1367inherits(PEMDecoder, DERDecoder);
1368module.exports = PEMDecoder;
1369
1370PEMDecoder.prototype.decode = function decode(data, options) {
1371 var lines = data.toString().split(/[\r\n]+/g);
1372
1373 var label = options.label.toUpperCase();
1374
1375 var re = /^-----(BEGIN|END) ([^-]+)-----$/;
1376 var start = -1;
1377 var end = -1;
1378 for (var i = 0; i < lines.length; i++) {
1379 var match = lines[i].match(re);
1380 if (match === null)
1381 continue;
1382
1383 if (match[2] !== label)
1384 continue;
1385
1386 if (start === -1) {
1387 if (match[1] !== 'BEGIN')
1388 break;
1389 start = i;
1390 } else {
1391 if (match[1] !== 'END')
1392 break;
1393 end = i;
1394 break;
1395 }
1396 }
1397 if (start === -1 || end === -1)
1398 throw new Error('PEM section not found for: ' + label);
1399
1400 var base64 = lines.slice(start + 1, end).join('');
1401 // Remove excessive symbols
1402 base64.replace(/[^a-z0-9\+\/=]+/gi, '');
1403
1404 var input = new Buffer(base64, 'base64');
1405 return DERDecoder.prototype.decode.call(this, input, options);
1406};
1407
1408},{"./der":9,"buffer":47,"inherits":95}],12:[function(require,module,exports){
1409var inherits = require('inherits');
1410var Buffer = require('buffer').Buffer;
1411
1412var asn1 = require('../../asn1');
1413var base = asn1.base;
1414
1415// Import DER constants
1416var der = asn1.constants.der;
1417
1418function DEREncoder(entity) {
1419 this.enc = 'der';
1420 this.name = entity.name;
1421 this.entity = entity;
1422
1423 // Construct base tree
1424 this.tree = new DERNode();
1425 this.tree._init(entity.body);
1426};
1427module.exports = DEREncoder;
1428
1429DEREncoder.prototype.encode = function encode(data, reporter) {
1430 return this.tree._encode(data, reporter).join();
1431};
1432
1433// Tree methods
1434
1435function DERNode(parent) {
1436 base.Node.call(this, 'der', parent);
1437}
1438inherits(DERNode, base.Node);
1439
1440DERNode.prototype._encodeComposite = function encodeComposite(tag,
1441 primitive,
1442 cls,
1443 content) {
1444 var encodedTag = encodeTag(tag, primitive, cls, this.reporter);
1445
1446 // Short form
1447 if (content.length < 0x80) {
1448 var header = new Buffer(2);
1449 header[0] = encodedTag;
1450 header[1] = content.length;
1451 return this._createEncoderBuffer([ header, content ]);
1452 }
1453
1454 // Long form
1455 // Count octets required to store length
1456 var lenOctets = 1;
1457 for (var i = content.length; i >= 0x100; i >>= 8)
1458 lenOctets++;
1459
1460 var header = new Buffer(1 + 1 + lenOctets);
1461 header[0] = encodedTag;
1462 header[1] = 0x80 | lenOctets;
1463
1464 for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)
1465 header[i] = j & 0xff;
1466
1467 return this._createEncoderBuffer([ header, content ]);
1468};
1469
1470DERNode.prototype._encodeStr = function encodeStr(str, tag) {
1471 if (tag === 'bitstr') {
1472 return this._createEncoderBuffer([ str.unused | 0, str.data ]);
1473 } else if (tag === 'bmpstr') {
1474 var buf = new Buffer(str.length * 2);
1475 for (var i = 0; i < str.length; i++) {
1476 buf.writeUInt16BE(str.charCodeAt(i), i * 2);
1477 }
1478 return this._createEncoderBuffer(buf);
1479 } else if (tag === 'numstr') {
1480 if (!this._isNumstr(str)) {
1481 return this.reporter.error('Encoding of string type: numstr supports ' +
1482 'only digits and space');
1483 }
1484 return this._createEncoderBuffer(str);
1485 } else if (tag === 'printstr') {
1486 if (!this._isPrintstr(str)) {
1487 return this.reporter.error('Encoding of string type: printstr supports ' +
1488 'only latin upper and lower case letters, ' +
1489 'digits, space, apostrophe, left and rigth ' +
1490 'parenthesis, plus sign, comma, hyphen, ' +
1491 'dot, slash, colon, equal sign, ' +
1492 'question mark');
1493 }
1494 return this._createEncoderBuffer(str);
1495 } else if (/str$/.test(tag)) {
1496 return this._createEncoderBuffer(str);
1497 } else if (tag === 'objDesc') {
1498 return this._createEncoderBuffer(str);
1499 } else {
1500 return this.reporter.error('Encoding of string type: ' + tag +
1501 ' unsupported');
1502 }
1503};
1504
1505DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {
1506 if (typeof id === 'string') {
1507 if (!values)
1508 return this.reporter.error('string objid given, but no values map found');
1509 if (!values.hasOwnProperty(id))
1510 return this.reporter.error('objid not found in values map');
1511 id = values[id].split(/[\s\.]+/g);
1512 for (var i = 0; i < id.length; i++)
1513 id[i] |= 0;
1514 } else if (Array.isArray(id)) {
1515 id = id.slice();
1516 for (var i = 0; i < id.length; i++)
1517 id[i] |= 0;
1518 }
1519
1520 if (!Array.isArray(id)) {
1521 return this.reporter.error('objid() should be either array or string, ' +
1522 'got: ' + JSON.stringify(id));
1523 }
1524
1525 if (!relative) {
1526 if (id[1] >= 40)
1527 return this.reporter.error('Second objid identifier OOB');
1528 id.splice(0, 2, id[0] * 40 + id[1]);
1529 }
1530
1531 // Count number of octets
1532 var size = 0;
1533 for (var i = 0; i < id.length; i++) {
1534 var ident = id[i];
1535 for (size++; ident >= 0x80; ident >>= 7)
1536 size++;
1537 }
1538
1539 var objid = new Buffer(size);
1540 var offset = objid.length - 1;
1541 for (var i = id.length - 1; i >= 0; i--) {
1542 var ident = id[i];
1543 objid[offset--] = ident & 0x7f;
1544 while ((ident >>= 7) > 0)
1545 objid[offset--] = 0x80 | (ident & 0x7f);
1546 }
1547
1548 return this._createEncoderBuffer(objid);
1549};
1550
1551function two(num) {
1552 if (num < 10)
1553 return '0' + num;
1554 else
1555 return num;
1556}
1557
1558DERNode.prototype._encodeTime = function encodeTime(time, tag) {
1559 var str;
1560 var date = new Date(time);
1561
1562 if (tag === 'gentime') {
1563 str = [
1564 two(date.getFullYear()),
1565 two(date.getUTCMonth() + 1),
1566 two(date.getUTCDate()),
1567 two(date.getUTCHours()),
1568 two(date.getUTCMinutes()),
1569 two(date.getUTCSeconds()),
1570 'Z'
1571 ].join('');
1572 } else if (tag === 'utctime') {
1573 str = [
1574 two(date.getFullYear() % 100),
1575 two(date.getUTCMonth() + 1),
1576 two(date.getUTCDate()),
1577 two(date.getUTCHours()),
1578 two(date.getUTCMinutes()),
1579 two(date.getUTCSeconds()),
1580 'Z'
1581 ].join('');
1582 } else {
1583 this.reporter.error('Encoding ' + tag + ' time is not supported yet');
1584 }
1585
1586 return this._encodeStr(str, 'octstr');
1587};
1588
1589DERNode.prototype._encodeNull = function encodeNull() {
1590 return this._createEncoderBuffer('');
1591};
1592
1593DERNode.prototype._encodeInt = function encodeInt(num, values) {
1594 if (typeof num === 'string') {
1595 if (!values)
1596 return this.reporter.error('String int or enum given, but no values map');
1597 if (!values.hasOwnProperty(num)) {
1598 return this.reporter.error('Values map doesn\'t contain: ' +
1599 JSON.stringify(num));
1600 }
1601 num = values[num];
1602 }
1603
1604 // Bignum, assume big endian
1605 if (typeof num !== 'number' && !Buffer.isBuffer(num)) {
1606 var numArray = num.toArray();
1607 if (!num.sign && numArray[0] & 0x80) {
1608 numArray.unshift(0);
1609 }
1610 num = new Buffer(numArray);
1611 }
1612
1613 if (Buffer.isBuffer(num)) {
1614 var size = num.length;
1615 if (num.length === 0)
1616 size++;
1617
1618 var out = new Buffer(size);
1619 num.copy(out);
1620 if (num.length === 0)
1621 out[0] = 0
1622 return this._createEncoderBuffer(out);
1623 }
1624
1625 if (num < 0x80)
1626 return this._createEncoderBuffer(num);
1627
1628 if (num < 0x100)
1629 return this._createEncoderBuffer([0, num]);
1630
1631 var size = 1;
1632 for (var i = num; i >= 0x100; i >>= 8)
1633 size++;
1634
1635 var out = new Array(size);
1636 for (var i = out.length - 1; i >= 0; i--) {
1637 out[i] = num & 0xff;
1638 num >>= 8;
1639 }
1640 if(out[0] & 0x80) {
1641 out.unshift(0);
1642 }
1643
1644 return this._createEncoderBuffer(new Buffer(out));
1645};
1646
1647DERNode.prototype._encodeBool = function encodeBool(value) {
1648 return this._createEncoderBuffer(value ? 0xff : 0);
1649};
1650
1651DERNode.prototype._use = function use(entity, obj) {
1652 if (typeof entity === 'function')
1653 entity = entity(obj);
1654 return entity._getEncoder('der').tree;
1655};
1656
1657DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {
1658 var state = this._baseState;
1659 var i;
1660 if (state['default'] === null)
1661 return false;
1662
1663 var data = dataBuffer.join();
1664 if (state.defaultBuffer === undefined)
1665 state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();
1666
1667 if (data.length !== state.defaultBuffer.length)
1668 return false;
1669
1670 for (i=0; i < data.length; i++)
1671 if (data[i] !== state.defaultBuffer[i])
1672 return false;
1673
1674 return true;
1675};
1676
1677// Utility methods
1678
1679function encodeTag(tag, primitive, cls, reporter) {
1680 var res;
1681
1682 if (tag === 'seqof')
1683 tag = 'seq';
1684 else if (tag === 'setof')
1685 tag = 'set';
1686
1687 if (der.tagByName.hasOwnProperty(tag))
1688 res = der.tagByName[tag];
1689 else if (typeof tag === 'number' && (tag | 0) === tag)
1690 res = tag;
1691 else
1692 return reporter.error('Unknown tag: ' + tag);
1693
1694 if (res >= 0x1f)
1695 return reporter.error('Multi-octet tag encoding unsupported');
1696
1697 if (!primitive)
1698 res |= 0x20;
1699
1700 res |= (der.tagClassByName[cls || 'universal'] << 6);
1701
1702 return res;
1703}
1704
1705},{"../../asn1":1,"buffer":47,"inherits":95}],13:[function(require,module,exports){
1706var encoders = exports;
1707
1708encoders.der = require('./der');
1709encoders.pem = require('./pem');
1710
1711},{"./der":12,"./pem":14}],14:[function(require,module,exports){
1712var inherits = require('inherits');
1713
1714var DEREncoder = require('./der');
1715
1716function PEMEncoder(entity) {
1717 DEREncoder.call(this, entity);
1718 this.enc = 'pem';
1719};
1720inherits(PEMEncoder, DEREncoder);
1721module.exports = PEMEncoder;
1722
1723PEMEncoder.prototype.encode = function encode(data, options) {
1724 var buf = DEREncoder.prototype.encode.call(this, data);
1725
1726 var p = buf.toString('base64');
1727 var out = [ '-----BEGIN ' + options.label + '-----' ];
1728 for (var i = 0; i < p.length; i += 64)
1729 out.push(p.slice(i, i + 64));
1730 out.push('-----END ' + options.label + '-----');
1731 return out.join('\n');
1732};
1733
1734},{"./der":12,"inherits":95}],15:[function(require,module,exports){
2(function (global){ 1735(function (global){
3'use strict'; 1736'use strict';
4 1737
@@ -492,7 +2225,7 @@ var objectKeys = Object.keys || function (obj) {
492}; 2225};
493 2226
494}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 2227}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
495},{"util/":33}],2:[function(require,module,exports){ 2228},{"util/":148}],16:[function(require,module,exports){
496'use strict' 2229'use strict'
497 2230
498exports.byteLength = byteLength 2231exports.byteLength = byteLength
@@ -608,11575 +2341,7 @@ function fromByteArray (uint8) {
608 return parts.join('') 2341 return parts.join('')
609} 2342}
610 2343
611},{}],3:[function(require,module,exports){ 2344},{}],17:[function(require,module,exports){
612
613},{}],4:[function(require,module,exports){
614(function (global){
615'use strict';
616
617var buffer = require('buffer');
618var Buffer = buffer.Buffer;
619var SlowBuffer = buffer.SlowBuffer;
620var MAX_LEN = buffer.kMaxLength || 2147483647;
621exports.alloc = function alloc(size, fill, encoding) {
622 if (typeof Buffer.alloc === 'function') {
623 return Buffer.alloc(size, fill, encoding);
624 }
625 if (typeof encoding === 'number') {
626 throw new TypeError('encoding must not be number');
627 }
628 if (typeof size !== 'number') {
629 throw new TypeError('size must be a number');
630 }
631 if (size > MAX_LEN) {
632 throw new RangeError('size is too large');
633 }
634 var enc = encoding;
635 var _fill = fill;
636 if (_fill === undefined) {
637 enc = undefined;
638 _fill = 0;
639 }
640 var buf = new Buffer(size);
641 if (typeof _fill === 'string') {
642 var fillBuf = new Buffer(_fill, enc);
643 var flen = fillBuf.length;
644 var i = -1;
645 while (++i < size) {
646 buf[i] = fillBuf[i % flen];
647 }
648 } else {
649 buf.fill(_fill);
650 }
651 return buf;
652}
653exports.allocUnsafe = function allocUnsafe(size) {
654 if (typeof Buffer.allocUnsafe === 'function') {
655 return Buffer.allocUnsafe(size);
656 }
657 if (typeof size !== 'number') {
658 throw new TypeError('size must be a number');
659 }
660 if (size > MAX_LEN) {
661 throw new RangeError('size is too large');
662 }
663 return new Buffer(size);
664}
665exports.from = function from(value, encodingOrOffset, length) {
666 if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {
667 return Buffer.from(value, encodingOrOffset, length);
668 }
669 if (typeof value === 'number') {
670 throw new TypeError('"value" argument must not be a number');
671 }
672 if (typeof value === 'string') {
673 return new Buffer(value, encodingOrOffset);
674 }
675 if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
676 var offset = encodingOrOffset;
677 if (arguments.length === 1) {
678 return new Buffer(value);
679 }
680 if (typeof offset === 'undefined') {
681 offset = 0;
682 }
683 var len = length;
684 if (typeof len === 'undefined') {
685 len = value.byteLength - offset;
686 }
687 if (offset >= value.byteLength) {
688 throw new RangeError('\'offset\' is out of bounds');
689 }
690 if (len > value.byteLength - offset) {
691 throw new RangeError('\'length\' is out of bounds');
692 }
693 return new Buffer(value.slice(offset, offset + len));
694 }
695 if (Buffer.isBuffer(value)) {
696 var out = new Buffer(value.length);
697 value.copy(out, 0, 0, value.length);
698 return out;
699 }
700 if (value) {
701 if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) {
702 return new Buffer(value);
703 }
704 if (value.type === 'Buffer' && Array.isArray(value.data)) {
705 return new Buffer(value.data);
706 }
707 }
708
709 throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');
710}
711exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
712 if (typeof Buffer.allocUnsafeSlow === 'function') {
713 return Buffer.allocUnsafeSlow(size);
714 }
715 if (typeof size !== 'number') {
716 throw new TypeError('size must be a number');
717 }
718 if (size >= MAX_LEN) {
719 throw new RangeError('size is too large');
720 }
721 return new SlowBuffer(size);
722}
723
724}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
725},{"buffer":5}],5:[function(require,module,exports){
726/*!
727 * The buffer module from node.js, for the browser.
728 *
729 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
730 * @license MIT
731 */
732/* eslint-disable no-proto */
733
734'use strict'
735
736var base64 = require('base64-js')
737var ieee754 = require('ieee754')
738
739exports.Buffer = Buffer
740exports.SlowBuffer = SlowBuffer
741exports.INSPECT_MAX_BYTES = 50
742
743var K_MAX_LENGTH = 0x7fffffff
744exports.kMaxLength = K_MAX_LENGTH
745
746/**
747 * If `Buffer.TYPED_ARRAY_SUPPORT`:
748 * === true Use Uint8Array implementation (fastest)
749 * === false Print warning and recommend using `buffer` v4.x which has an Object
750 * implementation (most compatible, even IE6)
751 *
752 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
753 * Opera 11.6+, iOS 4.2+.
754 *
755 * We report that the browser does not support typed arrays if the are not subclassable
756 * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
757 * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
758 * for __proto__ and has a buggy typed array implementation.
759 */
760Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
761
762if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
763 typeof console.error === 'function') {
764 console.error(
765 'This browser lacks typed array (Uint8Array) support which is required by ' +
766 '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
767 )
768}
769
770function typedArraySupport () {
771 // Can typed array instances can be augmented?
772 try {
773 var arr = new Uint8Array(1)
774 arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
775 return arr.foo() === 42
776 } catch (e) {
777 return false
778 }
779}
780
781function createBuffer (length) {
782 if (length > K_MAX_LENGTH) {
783 throw new RangeError('Invalid typed array length')
784 }
785 // Return an augmented `Uint8Array` instance
786 var buf = new Uint8Array(length)
787 buf.__proto__ = Buffer.prototype
788 return buf
789}
790
791/**
792 * The Buffer constructor returns instances of `Uint8Array` that have their
793 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
794 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
795 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
796 * returns a single octet.
797 *
798 * The `Uint8Array` prototype remains unmodified.
799 */
800
801function Buffer (arg, encodingOrOffset, length) {
802 // Common case.
803 if (typeof arg === 'number') {
804 if (typeof encodingOrOffset === 'string') {
805 throw new Error(
806 'If encoding is specified then the first argument must be a string'
807 )
808 }
809 return allocUnsafe(arg)
810 }
811 return from(arg, encodingOrOffset, length)
812}
813
814// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
815if (typeof Symbol !== 'undefined' && Symbol.species &&
816 Buffer[Symbol.species] === Buffer) {
817 Object.defineProperty(Buffer, Symbol.species, {
818 value: null,
819 configurable: true,
820 enumerable: false,
821 writable: false
822 })
823}
824
825Buffer.poolSize = 8192 // not used by this implementation
826
827function from (value, encodingOrOffset, length) {
828 if (typeof value === 'number') {
829 throw new TypeError('"value" argument must not be a number')
830 }
831
832 if (value instanceof ArrayBuffer) {
833 return fromArrayBuffer(value, encodingOrOffset, length)
834 }
835
836 if (typeof value === 'string') {
837 return fromString(value, encodingOrOffset)
838 }
839
840 return fromObject(value)
841}
842
843/**
844 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
845 * if value is a number.
846 * Buffer.from(str[, encoding])
847 * Buffer.from(array)
848 * Buffer.from(buffer)
849 * Buffer.from(arrayBuffer[, byteOffset[, length]])
850 **/
851Buffer.from = function (value, encodingOrOffset, length) {
852 return from(value, encodingOrOffset, length)
853}
854
855// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
856// https://github.com/feross/buffer/pull/148
857Buffer.prototype.__proto__ = Uint8Array.prototype
858Buffer.__proto__ = Uint8Array
859
860function assertSize (size) {
861 if (typeof size !== 'number') {
862 throw new TypeError('"size" argument must be a number')
863 } else if (size < 0) {
864 throw new RangeError('"size" argument must not be negative')
865 }
866}
867
868function alloc (size, fill, encoding) {
869 assertSize(size)
870 if (size <= 0) {
871 return createBuffer(size)
872 }
873 if (fill !== undefined) {
874 // Only pay attention to encoding if it's a string. This
875 // prevents accidentally sending in a number that would
876 // be interpretted as a start offset.
877 return typeof encoding === 'string'
878 ? createBuffer(size).fill(fill, encoding)
879 : createBuffer(size).fill(fill)
880 }
881 return createBuffer(size)
882}
883
884/**
885 * Creates a new filled Buffer instance.
886 * alloc(size[, fill[, encoding]])
887 **/
888Buffer.alloc = function (size, fill, encoding) {
889 return alloc(size, fill, encoding)
890}
891
892function allocUnsafe (size) {
893 assertSize(size)
894 return createBuffer(size < 0 ? 0 : checked(size) | 0)
895}
896
897/**
898 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
899 * */
900Buffer.allocUnsafe = function (size) {
901 return allocUnsafe(size)
902}
903/**
904 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
905 */
906Buffer.allocUnsafeSlow = function (size) {
907 return allocUnsafe(size)
908}
909
910function fromString (string, encoding) {
911 if (typeof encoding !== 'string' || encoding === '') {
912 encoding = 'utf8'
913 }
914
915 if (!Buffer.isEncoding(encoding)) {
916 throw new TypeError('"encoding" must be a valid string encoding')
917 }
918
919 var length = byteLength(string, encoding) | 0
920 var buf = createBuffer(length)
921
922 var actual = buf.write(string, encoding)
923
924 if (actual !== length) {
925 // Writing a hex string, for example, that contains invalid characters will
926 // cause everything after the first invalid character to be ignored. (e.g.
927 // 'abxxcd' will be treated as 'ab')
928 buf = buf.slice(0, actual)
929 }
930
931 return buf
932}
933
934function fromArrayLike (array) {
935 var length = array.length < 0 ? 0 : checked(array.length) | 0
936 var buf = createBuffer(length)
937 for (var i = 0; i < length; i += 1) {
938 buf[i] = array[i] & 255
939 }
940 return buf
941}
942
943function fromArrayBuffer (array, byteOffset, length) {
944 if (byteOffset < 0 || array.byteLength < byteOffset) {
945 throw new RangeError('\'offset\' is out of bounds')
946 }
947
948 if (array.byteLength < byteOffset + (length || 0)) {
949 throw new RangeError('\'length\' is out of bounds')
950 }
951
952 var buf
953 if (byteOffset === undefined && length === undefined) {
954 buf = new Uint8Array(array)
955 } else if (length === undefined) {
956 buf = new Uint8Array(array, byteOffset)
957 } else {
958 buf = new Uint8Array(array, byteOffset, length)
959 }
960
961 // Return an augmented `Uint8Array` instance
962 buf.__proto__ = Buffer.prototype
963 return buf
964}
965
966function fromObject (obj) {
967 if (Buffer.isBuffer(obj)) {
968 var len = checked(obj.length) | 0
969 var buf = createBuffer(len)
970
971 if (buf.length === 0) {
972 return buf
973 }
974
975 obj.copy(buf, 0, 0, len)
976 return buf
977 }
978
979 if (obj) {
980 if (isArrayBufferView(obj) || 'length' in obj) {
981 if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
982 return createBuffer(0)
983 }
984 return fromArrayLike(obj)
985 }
986
987 if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
988 return fromArrayLike(obj.data)
989 }
990 }
991
992 throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
993}
994
995function checked (length) {
996 // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
997 // length is NaN (which is otherwise coerced to zero.)
998 if (length >= K_MAX_LENGTH) {
999 throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
1000 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
1001 }
1002 return length | 0
1003}
1004
1005function SlowBuffer (length) {
1006 if (+length != length) { // eslint-disable-line eqeqeq
1007 length = 0
1008 }
1009 return Buffer.alloc(+length)
1010}
1011
1012Buffer.isBuffer = function isBuffer (b) {
1013 return b != null && b._isBuffer === true
1014}
1015
1016Buffer.compare = function compare (a, b) {
1017 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
1018 throw new TypeError('Arguments must be Buffers')
1019 }
1020
1021 if (a === b) return 0
1022
1023 var x = a.length
1024 var y = b.length
1025
1026 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
1027 if (a[i] !== b[i]) {
1028 x = a[i]
1029 y = b[i]
1030 break
1031 }
1032 }
1033
1034 if (x < y) return -1
1035 if (y < x) return 1
1036 return 0
1037}
1038
1039Buffer.isEncoding = function isEncoding (encoding) {
1040 switch (String(encoding).toLowerCase()) {
1041 case 'hex':
1042 case 'utf8':
1043 case 'utf-8':
1044 case 'ascii':
1045 case 'latin1':
1046 case 'binary':
1047 case 'base64':
1048 case 'ucs2':
1049 case 'ucs-2':
1050 case 'utf16le':
1051 case 'utf-16le':
1052 return true
1053 default:
1054 return false
1055 }
1056}
1057
1058Buffer.concat = function concat (list, length) {
1059 if (!Array.isArray(list)) {
1060 throw new TypeError('"list" argument must be an Array of Buffers')
1061 }
1062
1063 if (list.length === 0) {
1064 return Buffer.alloc(0)
1065 }
1066
1067 var i
1068 if (length === undefined) {
1069 length = 0
1070 for (i = 0; i < list.length; ++i) {
1071 length += list[i].length
1072 }
1073 }
1074
1075 var buffer = Buffer.allocUnsafe(length)
1076 var pos = 0
1077 for (i = 0; i < list.length; ++i) {
1078 var buf = list[i]
1079 if (!Buffer.isBuffer(buf)) {
1080 throw new TypeError('"list" argument must be an Array of Buffers')
1081 }
1082 buf.copy(buffer, pos)
1083 pos += buf.length
1084 }
1085 return buffer
1086}
1087
1088function byteLength (string, encoding) {
1089 if (Buffer.isBuffer(string)) {
1090 return string.length
1091 }
1092 if (isArrayBufferView(string) || string instanceof ArrayBuffer) {
1093 return string.byteLength
1094 }
1095 if (typeof string !== 'string') {
1096 string = '' + string
1097 }
1098
1099 var len = string.length
1100 if (len === 0) return 0
1101
1102 // Use a for loop to avoid recursion
1103 var loweredCase = false
1104 for (;;) {
1105 switch (encoding) {
1106 case 'ascii':
1107 case 'latin1':
1108 case 'binary':
1109 return len
1110 case 'utf8':
1111 case 'utf-8':
1112 case undefined:
1113 return utf8ToBytes(string).length
1114 case 'ucs2':
1115 case 'ucs-2':
1116 case 'utf16le':
1117 case 'utf-16le':
1118 return len * 2
1119 case 'hex':
1120 return len >>> 1
1121 case 'base64':
1122 return base64ToBytes(string).length
1123 default:
1124 if (loweredCase) return utf8ToBytes(string).length // assume utf8
1125 encoding = ('' + encoding).toLowerCase()
1126 loweredCase = true
1127 }
1128 }
1129}
1130Buffer.byteLength = byteLength
1131
1132function slowToString (encoding, start, end) {
1133 var loweredCase = false
1134
1135 // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
1136 // property of a typed array.
1137
1138 // This behaves neither like String nor Uint8Array in that we set start/end
1139 // to their upper/lower bounds if the value passed is out of range.
1140 // undefined is handled specially as per ECMA-262 6th Edition,
1141 // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
1142 if (start === undefined || start < 0) {
1143 start = 0
1144 }
1145 // Return early if start > this.length. Done here to prevent potential uint32
1146 // coercion fail below.
1147 if (start > this.length) {
1148 return ''
1149 }
1150
1151 if (end === undefined || end > this.length) {
1152 end = this.length
1153 }
1154
1155 if (end <= 0) {
1156 return ''
1157 }
1158
1159 // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
1160 end >>>= 0
1161 start >>>= 0
1162
1163 if (end <= start) {
1164 return ''
1165 }
1166
1167 if (!encoding) encoding = 'utf8'
1168
1169 while (true) {
1170 switch (encoding) {
1171 case 'hex':
1172 return hexSlice(this, start, end)
1173
1174 case 'utf8':
1175 case 'utf-8':
1176 return utf8Slice(this, start, end)
1177
1178 case 'ascii':
1179 return asciiSlice(this, start, end)
1180
1181 case 'latin1':
1182 case 'binary':
1183 return latin1Slice(this, start, end)
1184
1185 case 'base64':
1186 return base64Slice(this, start, end)
1187
1188 case 'ucs2':
1189 case 'ucs-2':
1190 case 'utf16le':
1191 case 'utf-16le':
1192 return utf16leSlice(this, start, end)
1193
1194 default:
1195 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
1196 encoding = (encoding + '').toLowerCase()
1197 loweredCase = true
1198 }
1199 }
1200}
1201
1202// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
1203// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
1204// reliably in a browserify context because there could be multiple different
1205// copies of the 'buffer' package in use. This method works even for Buffer
1206// instances that were created from another copy of the `buffer` package.
1207// See: https://github.com/feross/buffer/issues/154
1208Buffer.prototype._isBuffer = true
1209
1210function swap (b, n, m) {
1211 var i = b[n]
1212 b[n] = b[m]
1213 b[m] = i
1214}
1215
1216Buffer.prototype.swap16 = function swap16 () {
1217 var len = this.length
1218 if (len % 2 !== 0) {
1219 throw new RangeError('Buffer size must be a multiple of 16-bits')
1220 }
1221 for (var i = 0; i < len; i += 2) {
1222 swap(this, i, i + 1)
1223 }
1224 return this
1225}
1226
1227Buffer.prototype.swap32 = function swap32 () {
1228 var len = this.length
1229 if (len % 4 !== 0) {
1230 throw new RangeError('Buffer size must be a multiple of 32-bits')
1231 }
1232 for (var i = 0; i < len; i += 4) {
1233 swap(this, i, i + 3)
1234 swap(this, i + 1, i + 2)
1235 }
1236 return this
1237}
1238
1239Buffer.prototype.swap64 = function swap64 () {
1240 var len = this.length
1241 if (len % 8 !== 0) {
1242 throw new RangeError('Buffer size must be a multiple of 64-bits')
1243 }
1244 for (var i = 0; i < len; i += 8) {
1245 swap(this, i, i + 7)
1246 swap(this, i + 1, i + 6)
1247 swap(this, i + 2, i + 5)
1248 swap(this, i + 3, i + 4)
1249 }
1250 return this
1251}
1252
1253Buffer.prototype.toString = function toString () {
1254 var length = this.length
1255 if (length === 0) return ''
1256 if (arguments.length === 0) return utf8Slice(this, 0, length)
1257 return slowToString.apply(this, arguments)
1258}
1259
1260Buffer.prototype.equals = function equals (b) {
1261 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
1262 if (this === b) return true
1263 return Buffer.compare(this, b) === 0
1264}
1265
1266Buffer.prototype.inspect = function inspect () {
1267 var str = ''
1268 var max = exports.INSPECT_MAX_BYTES
1269 if (this.length > 0) {
1270 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
1271 if (this.length > max) str += ' ... '
1272 }
1273 return '<Buffer ' + str + '>'
1274}
1275
1276Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
1277 if (!Buffer.isBuffer(target)) {
1278 throw new TypeError('Argument must be a Buffer')
1279 }
1280
1281 if (start === undefined) {
1282 start = 0
1283 }
1284 if (end === undefined) {
1285 end = target ? target.length : 0
1286 }
1287 if (thisStart === undefined) {
1288 thisStart = 0
1289 }
1290 if (thisEnd === undefined) {
1291 thisEnd = this.length
1292 }
1293
1294 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
1295 throw new RangeError('out of range index')
1296 }
1297
1298 if (thisStart >= thisEnd && start >= end) {
1299 return 0
1300 }
1301 if (thisStart >= thisEnd) {
1302 return -1
1303 }
1304 if (start >= end) {
1305 return 1
1306 }
1307
1308 start >>>= 0
1309 end >>>= 0
1310 thisStart >>>= 0
1311 thisEnd >>>= 0
1312
1313 if (this === target) return 0
1314
1315 var x = thisEnd - thisStart
1316 var y = end - start
1317 var len = Math.min(x, y)
1318
1319 var thisCopy = this.slice(thisStart, thisEnd)
1320 var targetCopy = target.slice(start, end)
1321
1322 for (var i = 0; i < len; ++i) {
1323 if (thisCopy[i] !== targetCopy[i]) {
1324 x = thisCopy[i]
1325 y = targetCopy[i]
1326 break
1327 }
1328 }
1329
1330 if (x < y) return -1
1331 if (y < x) return 1
1332 return 0
1333}
1334
1335// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
1336// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
1337//
1338// Arguments:
1339// - buffer - a Buffer to search
1340// - val - a string, Buffer, or number
1341// - byteOffset - an index into `buffer`; will be clamped to an int32
1342// - encoding - an optional encoding, relevant is val is a string
1343// - dir - true for indexOf, false for lastIndexOf
1344function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
1345 // Empty buffer means no match
1346 if (buffer.length === 0) return -1
1347
1348 // Normalize byteOffset
1349 if (typeof byteOffset === 'string') {
1350 encoding = byteOffset
1351 byteOffset = 0
1352 } else if (byteOffset > 0x7fffffff) {
1353 byteOffset = 0x7fffffff
1354 } else if (byteOffset < -0x80000000) {
1355 byteOffset = -0x80000000
1356 }
1357 byteOffset = +byteOffset // Coerce to Number.
1358 if (numberIsNaN(byteOffset)) {
1359 // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
1360 byteOffset = dir ? 0 : (buffer.length - 1)
1361 }
1362
1363 // Normalize byteOffset: negative offsets start from the end of the buffer
1364 if (byteOffset < 0) byteOffset = buffer.length + byteOffset
1365 if (byteOffset >= buffer.length) {
1366 if (dir) return -1
1367 else byteOffset = buffer.length - 1
1368 } else if (byteOffset < 0) {
1369 if (dir) byteOffset = 0
1370 else return -1
1371 }
1372
1373 // Normalize val
1374 if (typeof val === 'string') {
1375 val = Buffer.from(val, encoding)
1376 }
1377
1378 // Finally, search either indexOf (if dir is true) or lastIndexOf
1379 if (Buffer.isBuffer(val)) {
1380 // Special case: looking for empty string/buffer always fails
1381 if (val.length === 0) {
1382 return -1
1383 }
1384 return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
1385 } else if (typeof val === 'number') {
1386 val = val & 0xFF // Search for a byte value [0-255]
1387 if (typeof Uint8Array.prototype.indexOf === 'function') {
1388 if (dir) {
1389 return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
1390 } else {
1391 return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
1392 }
1393 }
1394 return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
1395 }
1396
1397 throw new TypeError('val must be string, number or Buffer')
1398}
1399
1400function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
1401 var indexSize = 1
1402 var arrLength = arr.length
1403 var valLength = val.length
1404
1405 if (encoding !== undefined) {
1406 encoding = String(encoding).toLowerCase()
1407 if (encoding === 'ucs2' || encoding === 'ucs-2' ||
1408 encoding === 'utf16le' || encoding === 'utf-16le') {
1409 if (arr.length < 2 || val.length < 2) {
1410 return -1
1411 }
1412 indexSize = 2
1413 arrLength /= 2
1414 valLength /= 2
1415 byteOffset /= 2
1416 }
1417 }
1418
1419 function read (buf, i) {
1420 if (indexSize === 1) {
1421 return buf[i]
1422 } else {
1423 return buf.readUInt16BE(i * indexSize)
1424 }
1425 }
1426
1427 var i
1428 if (dir) {
1429 var foundIndex = -1
1430 for (i = byteOffset; i < arrLength; i++) {
1431 if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
1432 if (foundIndex === -1) foundIndex = i
1433 if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
1434 } else {
1435 if (foundIndex !== -1) i -= i - foundIndex
1436 foundIndex = -1
1437 }
1438 }
1439 } else {
1440 if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
1441 for (i = byteOffset; i >= 0; i--) {
1442 var found = true
1443 for (var j = 0; j < valLength; j++) {
1444 if (read(arr, i + j) !== read(val, j)) {
1445 found = false
1446 break
1447 }
1448 }
1449 if (found) return i
1450 }
1451 }
1452
1453 return -1
1454}
1455
1456Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
1457 return this.indexOf(val, byteOffset, encoding) !== -1
1458}
1459
1460Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
1461 return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
1462}
1463
1464Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
1465 return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
1466}
1467
1468function hexWrite (buf, string, offset, length) {
1469 offset = Number(offset) || 0
1470 var remaining = buf.length - offset
1471 if (!length) {
1472 length = remaining
1473 } else {
1474 length = Number(length)
1475 if (length > remaining) {
1476 length = remaining
1477 }
1478 }
1479
1480 // must be an even number of digits
1481 var strLen = string.length
1482 if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
1483
1484 if (length > strLen / 2) {
1485 length = strLen / 2
1486 }
1487 for (var i = 0; i < length; ++i) {
1488 var parsed = parseInt(string.substr(i * 2, 2), 16)
1489 if (numberIsNaN(parsed)) return i
1490 buf[offset + i] = parsed
1491 }
1492 return i
1493}
1494
1495function utf8Write (buf, string, offset, length) {
1496 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
1497}
1498
1499function asciiWrite (buf, string, offset, length) {
1500 return blitBuffer(asciiToBytes(string), buf, offset, length)
1501}
1502
1503function latin1Write (buf, string, offset, length) {
1504 return asciiWrite(buf, string, offset, length)
1505}
1506
1507function base64Write (buf, string, offset, length) {
1508 return blitBuffer(base64ToBytes(string), buf, offset, length)
1509}
1510
1511function ucs2Write (buf, string, offset, length) {
1512 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
1513}
1514
1515Buffer.prototype.write = function write (string, offset, length, encoding) {
1516 // Buffer#write(string)
1517 if (offset === undefined) {
1518 encoding = 'utf8'
1519 length = this.length
1520 offset = 0
1521 // Buffer#write(string, encoding)
1522 } else if (length === undefined && typeof offset === 'string') {
1523 encoding = offset
1524 length = this.length
1525 offset = 0
1526 // Buffer#write(string, offset[, length][, encoding])
1527 } else if (isFinite(offset)) {
1528 offset = offset >>> 0
1529 if (isFinite(length)) {
1530 length = length >>> 0
1531 if (encoding === undefined) encoding = 'utf8'
1532 } else {
1533 encoding = length
1534 length = undefined
1535 }
1536 } else {
1537 throw new Error(
1538 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
1539 )
1540 }
1541
1542 var remaining = this.length - offset
1543 if (length === undefined || length > remaining) length = remaining
1544
1545 if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
1546 throw new RangeError('Attempt to write outside buffer bounds')
1547 }
1548
1549 if (!encoding) encoding = 'utf8'
1550
1551 var loweredCase = false
1552 for (;;) {
1553 switch (encoding) {
1554 case 'hex':
1555 return hexWrite(this, string, offset, length)
1556
1557 case 'utf8':
1558 case 'utf-8':
1559 return utf8Write(this, string, offset, length)
1560
1561 case 'ascii':
1562 return asciiWrite(this, string, offset, length)
1563
1564 case 'latin1':
1565 case 'binary':
1566 return latin1Write(this, string, offset, length)
1567
1568 case 'base64':
1569 // Warning: maxLength not taken into account in base64Write
1570 return base64Write(this, string, offset, length)
1571
1572 case 'ucs2':
1573 case 'ucs-2':
1574 case 'utf16le':
1575 case 'utf-16le':
1576 return ucs2Write(this, string, offset, length)
1577
1578 default:
1579 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
1580 encoding = ('' + encoding).toLowerCase()
1581 loweredCase = true
1582 }
1583 }
1584}
1585
1586Buffer.prototype.toJSON = function toJSON () {
1587 return {
1588 type: 'Buffer',
1589 data: Array.prototype.slice.call(this._arr || this, 0)
1590 }
1591}
1592
1593function base64Slice (buf, start, end) {
1594 if (start === 0 && end === buf.length) {
1595 return base64.fromByteArray(buf)
1596 } else {
1597 return base64.fromByteArray(buf.slice(start, end))
1598 }
1599}
1600
1601function utf8Slice (buf, start, end) {
1602 end = Math.min(buf.length, end)
1603 var res = []
1604
1605 var i = start
1606 while (i < end) {
1607 var firstByte = buf[i]
1608 var codePoint = null
1609 var bytesPerSequence = (firstByte > 0xEF) ? 4
1610 : (firstByte > 0xDF) ? 3
1611 : (firstByte > 0xBF) ? 2
1612 : 1
1613
1614 if (i + bytesPerSequence <= end) {
1615 var secondByte, thirdByte, fourthByte, tempCodePoint
1616
1617 switch (bytesPerSequence) {
1618 case 1:
1619 if (firstByte < 0x80) {
1620 codePoint = firstByte
1621 }
1622 break
1623 case 2:
1624 secondByte = buf[i + 1]
1625 if ((secondByte & 0xC0) === 0x80) {
1626 tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
1627 if (tempCodePoint > 0x7F) {
1628 codePoint = tempCodePoint
1629 }
1630 }
1631 break
1632 case 3:
1633 secondByte = buf[i + 1]
1634 thirdByte = buf[i + 2]
1635 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
1636 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
1637 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
1638 codePoint = tempCodePoint
1639 }
1640 }
1641 break
1642 case 4:
1643 secondByte = buf[i + 1]
1644 thirdByte = buf[i + 2]
1645 fourthByte = buf[i + 3]
1646 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
1647 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
1648 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
1649 codePoint = tempCodePoint
1650 }
1651 }
1652 }
1653 }
1654
1655 if (codePoint === null) {
1656 // we did not generate a valid codePoint so insert a
1657 // replacement char (U+FFFD) and advance only 1 byte
1658 codePoint = 0xFFFD
1659 bytesPerSequence = 1
1660 } else if (codePoint > 0xFFFF) {
1661 // encode to utf16 (surrogate pair dance)
1662 codePoint -= 0x10000
1663 res.push(codePoint >>> 10 & 0x3FF | 0xD800)
1664 codePoint = 0xDC00 | codePoint & 0x3FF
1665 }
1666
1667 res.push(codePoint)
1668 i += bytesPerSequence
1669 }
1670
1671 return decodeCodePointsArray(res)
1672}
1673
1674// Based on http://stackoverflow.com/a/22747272/680742, the browser with
1675// the lowest limit is Chrome, with 0x10000 args.
1676// We go 1 magnitude less, for safety
1677var MAX_ARGUMENTS_LENGTH = 0x1000
1678
1679function decodeCodePointsArray (codePoints) {
1680 var len = codePoints.length
1681 if (len <= MAX_ARGUMENTS_LENGTH) {
1682 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
1683 }
1684
1685 // Decode in chunks to avoid "call stack size exceeded".
1686 var res = ''
1687 var i = 0
1688 while (i < len) {
1689 res += String.fromCharCode.apply(
1690 String,
1691 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
1692 )
1693 }
1694 return res
1695}
1696
1697function asciiSlice (buf, start, end) {
1698 var ret = ''
1699 end = Math.min(buf.length, end)
1700
1701 for (var i = start; i < end; ++i) {
1702 ret += String.fromCharCode(buf[i] & 0x7F)
1703 }
1704 return ret
1705}
1706
1707function latin1Slice (buf, start, end) {
1708 var ret = ''
1709 end = Math.min(buf.length, end)
1710
1711 for (var i = start; i < end; ++i) {
1712 ret += String.fromCharCode(buf[i])
1713 }
1714 return ret
1715}
1716
1717function hexSlice (buf, start, end) {
1718 var len = buf.length
1719
1720 if (!start || start < 0) start = 0
1721 if (!end || end < 0 || end > len) end = len
1722
1723 var out = ''
1724 for (var i = start; i < end; ++i) {
1725 out += toHex(buf[i])
1726 }
1727 return out
1728}
1729
1730function utf16leSlice (buf, start, end) {
1731 var bytes = buf.slice(start, end)
1732 var res = ''
1733 for (var i = 0; i < bytes.length; i += 2) {
1734 res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
1735 }
1736 return res
1737}
1738
1739Buffer.prototype.slice = function slice (start, end) {
1740 var len = this.length
1741 start = ~~start
1742 end = end === undefined ? len : ~~end
1743
1744 if (start < 0) {
1745 start += len
1746 if (start < 0) start = 0
1747 } else if (start > len) {
1748 start = len
1749 }
1750
1751 if (end < 0) {
1752 end += len
1753 if (end < 0) end = 0
1754 } else if (end > len) {
1755 end = len
1756 }
1757
1758 if (end < start) end = start
1759
1760 var newBuf = this.subarray(start, end)
1761 // Return an augmented `Uint8Array` instance
1762 newBuf.__proto__ = Buffer.prototype
1763 return newBuf
1764}
1765
1766/*
1767 * Need to make sure that buffer isn't trying to write out of bounds.
1768 */
1769function checkOffset (offset, ext, length) {
1770 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
1771 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
1772}
1773
1774Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
1775 offset = offset >>> 0
1776 byteLength = byteLength >>> 0
1777 if (!noAssert) checkOffset(offset, byteLength, this.length)
1778
1779 var val = this[offset]
1780 var mul = 1
1781 var i = 0
1782 while (++i < byteLength && (mul *= 0x100)) {
1783 val += this[offset + i] * mul
1784 }
1785
1786 return val
1787}
1788
1789Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
1790 offset = offset >>> 0
1791 byteLength = byteLength >>> 0
1792 if (!noAssert) {
1793 checkOffset(offset, byteLength, this.length)
1794 }
1795
1796 var val = this[offset + --byteLength]
1797 var mul = 1
1798 while (byteLength > 0 && (mul *= 0x100)) {
1799 val += this[offset + --byteLength] * mul
1800 }
1801
1802 return val
1803}
1804
1805Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
1806 offset = offset >>> 0
1807 if (!noAssert) checkOffset(offset, 1, this.length)
1808 return this[offset]
1809}
1810
1811Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
1812 offset = offset >>> 0
1813 if (!noAssert) checkOffset(offset, 2, this.length)
1814 return this[offset] | (this[offset + 1] << 8)
1815}
1816
1817Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
1818 offset = offset >>> 0
1819 if (!noAssert) checkOffset(offset, 2, this.length)
1820 return (this[offset] << 8) | this[offset + 1]
1821}
1822
1823Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
1824 offset = offset >>> 0
1825 if (!noAssert) checkOffset(offset, 4, this.length)
1826
1827 return ((this[offset]) |
1828 (this[offset + 1] << 8) |
1829 (this[offset + 2] << 16)) +
1830 (this[offset + 3] * 0x1000000)
1831}
1832
1833Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
1834 offset = offset >>> 0
1835 if (!noAssert) checkOffset(offset, 4, this.length)
1836
1837 return (this[offset] * 0x1000000) +
1838 ((this[offset + 1] << 16) |
1839 (this[offset + 2] << 8) |
1840 this[offset + 3])
1841}
1842
1843Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
1844 offset = offset >>> 0
1845 byteLength = byteLength >>> 0
1846 if (!noAssert) checkOffset(offset, byteLength, this.length)
1847
1848 var val = this[offset]
1849 var mul = 1
1850 var i = 0
1851 while (++i < byteLength && (mul *= 0x100)) {
1852 val += this[offset + i] * mul
1853 }
1854 mul *= 0x80
1855
1856 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
1857
1858 return val
1859}
1860
1861Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
1862 offset = offset >>> 0
1863 byteLength = byteLength >>> 0
1864 if (!noAssert) checkOffset(offset, byteLength, this.length)
1865
1866 var i = byteLength
1867 var mul = 1
1868 var val = this[offset + --i]
1869 while (i > 0 && (mul *= 0x100)) {
1870 val += this[offset + --i] * mul
1871 }
1872 mul *= 0x80
1873
1874 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
1875
1876 return val
1877}
1878
1879Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
1880 offset = offset >>> 0
1881 if (!noAssert) checkOffset(offset, 1, this.length)
1882 if (!(this[offset] & 0x80)) return (this[offset])
1883 return ((0xff - this[offset] + 1) * -1)
1884}
1885
1886Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
1887 offset = offset >>> 0
1888 if (!noAssert) checkOffset(offset, 2, this.length)
1889 var val = this[offset] | (this[offset + 1] << 8)
1890 return (val & 0x8000) ? val | 0xFFFF0000 : val
1891}
1892
1893Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
1894 offset = offset >>> 0
1895 if (!noAssert) checkOffset(offset, 2, this.length)
1896 var val = this[offset + 1] | (this[offset] << 8)
1897 return (val & 0x8000) ? val | 0xFFFF0000 : val
1898}
1899
1900Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
1901 offset = offset >>> 0
1902 if (!noAssert) checkOffset(offset, 4, this.length)
1903
1904 return (this[offset]) |
1905 (this[offset + 1] << 8) |
1906 (this[offset + 2] << 16) |
1907 (this[offset + 3] << 24)
1908}
1909
1910Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
1911 offset = offset >>> 0
1912 if (!noAssert) checkOffset(offset, 4, this.length)
1913
1914 return (this[offset] << 24) |
1915 (this[offset + 1] << 16) |
1916 (this[offset + 2] << 8) |
1917 (this[offset + 3])
1918}
1919
1920Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
1921 offset = offset >>> 0
1922 if (!noAssert) checkOffset(offset, 4, this.length)
1923 return ieee754.read(this, offset, true, 23, 4)
1924}
1925
1926Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
1927 offset = offset >>> 0
1928 if (!noAssert) checkOffset(offset, 4, this.length)
1929 return ieee754.read(this, offset, false, 23, 4)
1930}
1931
1932Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
1933 offset = offset >>> 0
1934 if (!noAssert) checkOffset(offset, 8, this.length)
1935 return ieee754.read(this, offset, true, 52, 8)
1936}
1937
1938Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
1939 offset = offset >>> 0
1940 if (!noAssert) checkOffset(offset, 8, this.length)
1941 return ieee754.read(this, offset, false, 52, 8)
1942}
1943
1944function checkInt (buf, value, offset, ext, max, min) {
1945 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
1946 if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
1947 if (offset + ext > buf.length) throw new RangeError('Index out of range')
1948}
1949
1950Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
1951 value = +value
1952 offset = offset >>> 0
1953 byteLength = byteLength >>> 0
1954 if (!noAssert) {
1955 var maxBytes = Math.pow(2, 8 * byteLength) - 1
1956 checkInt(this, value, offset, byteLength, maxBytes, 0)
1957 }
1958
1959 var mul = 1
1960 var i = 0
1961 this[offset] = value & 0xFF
1962 while (++i < byteLength && (mul *= 0x100)) {
1963 this[offset + i] = (value / mul) & 0xFF
1964 }
1965
1966 return offset + byteLength
1967}
1968
1969Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
1970 value = +value
1971 offset = offset >>> 0
1972 byteLength = byteLength >>> 0
1973 if (!noAssert) {
1974 var maxBytes = Math.pow(2, 8 * byteLength) - 1
1975 checkInt(this, value, offset, byteLength, maxBytes, 0)
1976 }
1977
1978 var i = byteLength - 1
1979 var mul = 1
1980 this[offset + i] = value & 0xFF
1981 while (--i >= 0 && (mul *= 0x100)) {
1982 this[offset + i] = (value / mul) & 0xFF
1983 }
1984
1985 return offset + byteLength
1986}
1987
1988Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
1989 value = +value
1990 offset = offset >>> 0
1991 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
1992 this[offset] = (value & 0xff)
1993 return offset + 1
1994}
1995
1996Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
1997 value = +value
1998 offset = offset >>> 0
1999 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
2000 this[offset] = (value & 0xff)
2001 this[offset + 1] = (value >>> 8)
2002 return offset + 2
2003}
2004
2005Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
2006 value = +value
2007 offset = offset >>> 0
2008 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
2009 this[offset] = (value >>> 8)
2010 this[offset + 1] = (value & 0xff)
2011 return offset + 2
2012}
2013
2014Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
2015 value = +value
2016 offset = offset >>> 0
2017 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
2018 this[offset + 3] = (value >>> 24)
2019 this[offset + 2] = (value >>> 16)
2020 this[offset + 1] = (value >>> 8)
2021 this[offset] = (value & 0xff)
2022 return offset + 4
2023}
2024
2025Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
2026 value = +value
2027 offset = offset >>> 0
2028 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
2029 this[offset] = (value >>> 24)
2030 this[offset + 1] = (value >>> 16)
2031 this[offset + 2] = (value >>> 8)
2032 this[offset + 3] = (value & 0xff)
2033 return offset + 4
2034}
2035
2036Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
2037 value = +value
2038 offset = offset >>> 0
2039 if (!noAssert) {
2040 var limit = Math.pow(2, (8 * byteLength) - 1)
2041
2042 checkInt(this, value, offset, byteLength, limit - 1, -limit)
2043 }
2044
2045 var i = 0
2046 var mul = 1
2047 var sub = 0
2048 this[offset] = value & 0xFF
2049 while (++i < byteLength && (mul *= 0x100)) {
2050 if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
2051 sub = 1
2052 }
2053 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
2054 }
2055
2056 return offset + byteLength
2057}
2058
2059Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
2060 value = +value
2061 offset = offset >>> 0
2062 if (!noAssert) {
2063 var limit = Math.pow(2, (8 * byteLength) - 1)
2064
2065 checkInt(this, value, offset, byteLength, limit - 1, -limit)
2066 }
2067
2068 var i = byteLength - 1
2069 var mul = 1
2070 var sub = 0
2071 this[offset + i] = value & 0xFF
2072 while (--i >= 0 && (mul *= 0x100)) {
2073 if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
2074 sub = 1
2075 }
2076 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
2077 }
2078
2079 return offset + byteLength
2080}
2081
2082Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
2083 value = +value
2084 offset = offset >>> 0
2085 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
2086 if (value < 0) value = 0xff + value + 1
2087 this[offset] = (value & 0xff)
2088 return offset + 1
2089}
2090
2091Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
2092 value = +value
2093 offset = offset >>> 0
2094 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
2095 this[offset] = (value & 0xff)
2096 this[offset + 1] = (value >>> 8)
2097 return offset + 2
2098}
2099
2100Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
2101 value = +value
2102 offset = offset >>> 0
2103 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
2104 this[offset] = (value >>> 8)
2105 this[offset + 1] = (value & 0xff)
2106 return offset + 2
2107}
2108
2109Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
2110 value = +value
2111 offset = offset >>> 0
2112 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
2113 this[offset] = (value & 0xff)
2114 this[offset + 1] = (value >>> 8)
2115 this[offset + 2] = (value >>> 16)
2116 this[offset + 3] = (value >>> 24)
2117 return offset + 4
2118}
2119
2120Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
2121 value = +value
2122 offset = offset >>> 0
2123 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
2124 if (value < 0) value = 0xffffffff + value + 1
2125 this[offset] = (value >>> 24)
2126 this[offset + 1] = (value >>> 16)
2127 this[offset + 2] = (value >>> 8)
2128 this[offset + 3] = (value & 0xff)
2129 return offset + 4
2130}
2131
2132function checkIEEE754 (buf, value, offset, ext, max, min) {
2133 if (offset + ext > buf.length) throw new RangeError('Index out of range')
2134 if (offset < 0) throw new RangeError('Index out of range')
2135}
2136
2137function writeFloat (buf, value, offset, littleEndian, noAssert) {
2138 value = +value
2139 offset = offset >>> 0
2140 if (!noAssert) {
2141 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
2142 }
2143 ieee754.write(buf, value, offset, littleEndian, 23, 4)
2144 return offset + 4
2145}
2146
2147Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
2148 return writeFloat(this, value, offset, true, noAssert)
2149}
2150
2151Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
2152 return writeFloat(this, value, offset, false, noAssert)
2153}
2154
2155function writeDouble (buf, value, offset, littleEndian, noAssert) {
2156 value = +value
2157 offset = offset >>> 0
2158 if (!noAssert) {
2159 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
2160 }
2161 ieee754.write(buf, value, offset, littleEndian, 52, 8)
2162 return offset + 8
2163}
2164
2165Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
2166 return writeDouble(this, value, offset, true, noAssert)
2167}
2168
2169Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
2170 return writeDouble(this, value, offset, false, noAssert)
2171}
2172
2173// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
2174Buffer.prototype.copy = function copy (target, targetStart, start, end) {
2175 if (!start) start = 0
2176 if (!end && end !== 0) end = this.length
2177 if (targetStart >= target.length) targetStart = target.length
2178 if (!targetStart) targetStart = 0
2179 if (end > 0 && end < start) end = start
2180
2181 // Copy 0 bytes; we're done
2182 if (end === start) return 0
2183 if (target.length === 0 || this.length === 0) return 0
2184
2185 // Fatal error conditions
2186 if (targetStart < 0) {
2187 throw new RangeError('targetStart out of bounds')
2188 }
2189 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
2190 if (end < 0) throw new RangeError('sourceEnd out of bounds')
2191
2192 // Are we oob?
2193 if (end > this.length) end = this.length
2194 if (target.length - targetStart < end - start) {
2195 end = target.length - targetStart + start
2196 }
2197
2198 var len = end - start
2199 var i
2200
2201 if (this === target && start < targetStart && targetStart < end) {
2202 // descending copy from end
2203 for (i = len - 1; i >= 0; --i) {
2204 target[i + targetStart] = this[i + start]
2205 }
2206 } else if (len < 1000) {
2207 // ascending copy from start
2208 for (i = 0; i < len; ++i) {
2209 target[i + targetStart] = this[i + start]
2210 }
2211 } else {
2212 Uint8Array.prototype.set.call(
2213 target,
2214 this.subarray(start, start + len),
2215 targetStart
2216 )
2217 }
2218
2219 return len
2220}
2221
2222// Usage:
2223// buffer.fill(number[, offset[, end]])
2224// buffer.fill(buffer[, offset[, end]])
2225// buffer.fill(string[, offset[, end]][, encoding])
2226Buffer.prototype.fill = function fill (val, start, end, encoding) {
2227 // Handle string cases:
2228 if (typeof val === 'string') {
2229 if (typeof start === 'string') {
2230 encoding = start
2231 start = 0
2232 end = this.length
2233 } else if (typeof end === 'string') {
2234 encoding = end
2235 end = this.length
2236 }
2237 if (val.length === 1) {
2238 var code = val.charCodeAt(0)
2239 if (code < 256) {
2240 val = code
2241 }
2242 }
2243 if (encoding !== undefined && typeof encoding !== 'string') {
2244 throw new TypeError('encoding must be a string')
2245 }
2246 if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
2247 throw new TypeError('Unknown encoding: ' + encoding)
2248 }
2249 } else if (typeof val === 'number') {
2250 val = val & 255
2251 }
2252
2253 // Invalid ranges are not set to a default, so can range check early.
2254 if (start < 0 || this.length < start || this.length < end) {
2255 throw new RangeError('Out of range index')
2256 }
2257
2258 if (end <= start) {
2259 return this
2260 }
2261
2262 start = start >>> 0
2263 end = end === undefined ? this.length : end >>> 0
2264
2265 if (!val) val = 0
2266
2267 var i
2268 if (typeof val === 'number') {
2269 for (i = start; i < end; ++i) {
2270 this[i] = val
2271 }
2272 } else {
2273 var bytes = Buffer.isBuffer(val)
2274 ? val
2275 : new Buffer(val, encoding)
2276 var len = bytes.length
2277 for (i = 0; i < end - start; ++i) {
2278 this[i + start] = bytes[i % len]
2279 }
2280 }
2281
2282 return this
2283}
2284
2285// HELPER FUNCTIONS
2286// ================
2287
2288var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
2289
2290function base64clean (str) {
2291 // Node strips out invalid characters like \n and \t from the string, base64-js does not
2292 str = str.trim().replace(INVALID_BASE64_RE, '')
2293 // Node converts strings with length < 2 to ''
2294 if (str.length < 2) return ''
2295 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
2296 while (str.length % 4 !== 0) {
2297 str = str + '='
2298 }
2299 return str
2300}
2301
2302function toHex (n) {
2303 if (n < 16) return '0' + n.toString(16)
2304 return n.toString(16)
2305}
2306
2307function utf8ToBytes (string, units) {
2308 units = units || Infinity
2309 var codePoint
2310 var length = string.length
2311 var leadSurrogate = null
2312 var bytes = []
2313
2314 for (var i = 0; i < length; ++i) {
2315 codePoint = string.charCodeAt(i)
2316
2317 // is surrogate component
2318 if (codePoint > 0xD7FF && codePoint < 0xE000) {
2319 // last char was a lead
2320 if (!leadSurrogate) {
2321 // no lead yet
2322 if (codePoint > 0xDBFF) {
2323 // unexpected trail
2324 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
2325 continue
2326 } else if (i + 1 === length) {
2327 // unpaired lead
2328 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
2329 continue
2330 }
2331
2332 // valid lead
2333 leadSurrogate = codePoint
2334
2335 continue
2336 }
2337
2338 // 2 leads in a row
2339 if (codePoint < 0xDC00) {
2340 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
2341 leadSurrogate = codePoint
2342 continue
2343 }
2344
2345 // valid surrogate pair
2346 codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
2347 } else if (leadSurrogate) {
2348 // valid bmp char, but last char was a lead
2349 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
2350 }
2351
2352 leadSurrogate = null
2353
2354 // encode utf8
2355 if (codePoint < 0x80) {
2356 if ((units -= 1) < 0) break
2357 bytes.push(codePoint)
2358 } else if (codePoint < 0x800) {
2359 if ((units -= 2) < 0) break
2360 bytes.push(
2361 codePoint >> 0x6 | 0xC0,
2362 codePoint & 0x3F | 0x80
2363 )
2364 } else if (codePoint < 0x10000) {
2365 if ((units -= 3) < 0) break
2366 bytes.push(
2367 codePoint >> 0xC | 0xE0,
2368 codePoint >> 0x6 & 0x3F | 0x80,
2369 codePoint & 0x3F | 0x80
2370 )
2371 } else if (codePoint < 0x110000) {
2372 if ((units -= 4) < 0) break
2373 bytes.push(
2374 codePoint >> 0x12 | 0xF0,
2375 codePoint >> 0xC & 0x3F | 0x80,
2376 codePoint >> 0x6 & 0x3F | 0x80,
2377 codePoint & 0x3F | 0x80
2378 )
2379 } else {
2380 throw new Error('Invalid code point')
2381 }
2382 }
2383
2384 return bytes
2385}
2386
2387function asciiToBytes (str) {
2388 var byteArray = []
2389 for (var i = 0; i < str.length; ++i) {
2390 // Node's code seems to be doing this and not & 0x7F..
2391 byteArray.push(str.charCodeAt(i) & 0xFF)
2392 }
2393 return byteArray
2394}
2395
2396function utf16leToBytes (str, units) {
2397 var c, hi, lo
2398 var byteArray = []
2399 for (var i = 0; i < str.length; ++i) {
2400 if ((units -= 2) < 0) break
2401
2402 c = str.charCodeAt(i)
2403 hi = c >> 8
2404 lo = c % 256
2405 byteArray.push(lo)
2406 byteArray.push(hi)
2407 }
2408
2409 return byteArray
2410}
2411
2412function base64ToBytes (str) {
2413 return base64.toByteArray(base64clean(str))
2414}
2415
2416function blitBuffer (src, dst, offset, length) {
2417 for (var i = 0; i < length; ++i) {
2418 if ((i + offset >= dst.length) || (i >= src.length)) break
2419 dst[i + offset] = src[i]
2420 }
2421 return i
2422}
2423
2424// Node 0.10 supports `ArrayBuffer` but lacks `ArrayBuffer.isView`
2425function isArrayBufferView (obj) {
2426 return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)
2427}
2428
2429function numberIsNaN (obj) {
2430 return obj !== obj // eslint-disable-line no-self-compare
2431}
2432
2433},{"base64-js":2,"ieee754":8}],6:[function(require,module,exports){
2434(function (Buffer){
2435// Copyright Joyent, Inc. and other Node contributors.
2436//
2437// Permission is hereby granted, free of charge, to any person obtaining a
2438// copy of this software and associated documentation files (the
2439// "Software"), to deal in the Software without restriction, including
2440// without limitation the rights to use, copy, modify, merge, publish,
2441// distribute, sublicense, and/or sell copies of the Software, and to permit
2442// persons to whom the Software is furnished to do so, subject to the
2443// following conditions:
2444//
2445// The above copyright notice and this permission notice shall be included
2446// in all copies or substantial portions of the Software.
2447//
2448// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2449// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2450// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2451// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2452// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2453// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2454// USE OR OTHER DEALINGS IN THE SOFTWARE.
2455
2456// NOTE: These type checking functions intentionally don't use `instanceof`
2457// because it is fragile and can be easily faked with `Object.create()`.
2458
2459function isArray(arg) {
2460 if (Array.isArray) {
2461 return Array.isArray(arg);
2462 }
2463 return objectToString(arg) === '[object Array]';
2464}
2465exports.isArray = isArray;
2466
2467function isBoolean(arg) {
2468 return typeof arg === 'boolean';
2469}
2470exports.isBoolean = isBoolean;
2471
2472function isNull(arg) {
2473 return arg === null;
2474}
2475exports.isNull = isNull;
2476
2477function isNullOrUndefined(arg) {
2478 return arg == null;
2479}
2480exports.isNullOrUndefined = isNullOrUndefined;
2481
2482function isNumber(arg) {
2483 return typeof arg === 'number';
2484}
2485exports.isNumber = isNumber;
2486
2487function isString(arg) {
2488 return typeof arg === 'string';
2489}
2490exports.isString = isString;
2491
2492function isSymbol(arg) {
2493 return typeof arg === 'symbol';
2494}
2495exports.isSymbol = isSymbol;
2496
2497function isUndefined(arg) {
2498 return arg === void 0;
2499}
2500exports.isUndefined = isUndefined;
2501
2502function isRegExp(re) {
2503 return objectToString(re) === '[object RegExp]';
2504}
2505exports.isRegExp = isRegExp;
2506
2507function isObject(arg) {
2508 return typeof arg === 'object' && arg !== null;
2509}
2510exports.isObject = isObject;
2511
2512function isDate(d) {
2513 return objectToString(d) === '[object Date]';
2514}
2515exports.isDate = isDate;
2516
2517function isError(e) {
2518 return (objectToString(e) === '[object Error]' || e instanceof Error);
2519}
2520exports.isError = isError;
2521
2522function isFunction(arg) {
2523 return typeof arg === 'function';
2524}
2525exports.isFunction = isFunction;
2526
2527function isPrimitive(arg) {
2528 return arg === null ||
2529 typeof arg === 'boolean' ||
2530 typeof arg === 'number' ||
2531 typeof arg === 'string' ||
2532 typeof arg === 'symbol' || // ES6 symbol
2533 typeof arg === 'undefined';
2534}
2535exports.isPrimitive = isPrimitive;
2536
2537exports.isBuffer = Buffer.isBuffer;
2538
2539function objectToString(o) {
2540 return Object.prototype.toString.call(o);
2541}
2542
2543}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
2544},{"../../is-buffer/index.js":10}],7:[function(require,module,exports){
2545// Copyright Joyent, Inc. and other Node contributors.
2546//
2547// Permission is hereby granted, free of charge, to any person obtaining a
2548// copy of this software and associated documentation files (the
2549// "Software"), to deal in the Software without restriction, including
2550// without limitation the rights to use, copy, modify, merge, publish,
2551// distribute, sublicense, and/or sell copies of the Software, and to permit
2552// persons to whom the Software is furnished to do so, subject to the
2553// following conditions:
2554//
2555// The above copyright notice and this permission notice shall be included
2556// in all copies or substantial portions of the Software.
2557//
2558// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2559// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2560// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2561// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2562// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2563// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2564// USE OR OTHER DEALINGS IN THE SOFTWARE.
2565
2566function EventEmitter() {
2567 this._events = this._events || {};
2568 this._maxListeners = this._maxListeners || undefined;
2569}
2570module.exports = EventEmitter;
2571
2572// Backwards-compat with node 0.10.x
2573EventEmitter.EventEmitter = EventEmitter;
2574
2575EventEmitter.prototype._events = undefined;
2576EventEmitter.prototype._maxListeners = undefined;
2577
2578// By default EventEmitters will print a warning if more than 10 listeners are
2579// added to it. This is a useful default which helps finding memory leaks.
2580EventEmitter.defaultMaxListeners = 10;
2581
2582// Obviously not all Emitters should be limited to 10. This function allows
2583// that to be increased. Set to zero for unlimited.
2584EventEmitter.prototype.setMaxListeners = function(n) {
2585 if (!isNumber(n) || n < 0 || isNaN(n))
2586 throw TypeError('n must be a positive number');
2587 this._maxListeners = n;
2588 return this;
2589};
2590
2591EventEmitter.prototype.emit = function(type) {
2592 var er, handler, len, args, i, listeners;
2593
2594 if (!this._events)
2595 this._events = {};
2596
2597 // If there is no 'error' event listener then throw.
2598 if (type === 'error') {
2599 if (!this._events.error ||
2600 (isObject(this._events.error) && !this._events.error.length)) {
2601 er = arguments[1];
2602 if (er instanceof Error) {
2603 throw er; // Unhandled 'error' event
2604 } else {
2605 // At least give some kind of context to the user
2606 var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
2607 err.context = er;
2608 throw err;
2609 }
2610 }
2611 }
2612
2613 handler = this._events[type];
2614
2615 if (isUndefined(handler))
2616 return false;
2617
2618 if (isFunction(handler)) {
2619 switch (arguments.length) {
2620 // fast cases
2621 case 1:
2622 handler.call(this);
2623 break;
2624 case 2:
2625 handler.call(this, arguments[1]);
2626 break;
2627 case 3:
2628 handler.call(this, arguments[1], arguments[2]);
2629 break;
2630 // slower
2631 default:
2632 args = Array.prototype.slice.call(arguments, 1);
2633 handler.apply(this, args);
2634 }
2635 } else if (isObject(handler)) {
2636 args = Array.prototype.slice.call(arguments, 1);
2637 listeners = handler.slice();
2638 len = listeners.length;
2639 for (i = 0; i < len; i++)
2640 listeners[i].apply(this, args);
2641 }
2642
2643 return true;
2644};
2645
2646EventEmitter.prototype.addListener = function(type, listener) {
2647 var m;
2648
2649 if (!isFunction(listener))
2650 throw TypeError('listener must be a function');
2651
2652 if (!this._events)
2653 this._events = {};
2654
2655 // To avoid recursion in the case that type === "newListener"! Before
2656 // adding it to the listeners, first emit "newListener".
2657 if (this._events.newListener)
2658 this.emit('newListener', type,
2659 isFunction(listener.listener) ?
2660 listener.listener : listener);
2661
2662 if (!this._events[type])
2663 // Optimize the case of one listener. Don't need the extra array object.
2664 this._events[type] = listener;
2665 else if (isObject(this._events[type]))
2666 // If we've already got an array, just append.
2667 this._events[type].push(listener);
2668 else
2669 // Adding the second element, need to change to array.
2670 this._events[type] = [this._events[type], listener];
2671
2672 // Check for listener leak
2673 if (isObject(this._events[type]) && !this._events[type].warned) {
2674 if (!isUndefined(this._maxListeners)) {
2675 m = this._maxListeners;
2676 } else {
2677 m = EventEmitter.defaultMaxListeners;
2678 }
2679
2680 if (m && m > 0 && this._events[type].length > m) {
2681 this._events[type].warned = true;
2682 console.error('(node) warning: possible EventEmitter memory ' +
2683 'leak detected. %d listeners added. ' +
2684 'Use emitter.setMaxListeners() to increase limit.',
2685 this._events[type].length);
2686 if (typeof console.trace === 'function') {
2687 // not supported in IE 10
2688 console.trace();
2689 }
2690 }
2691 }
2692
2693 return this;
2694};
2695
2696EventEmitter.prototype.on = EventEmitter.prototype.addListener;
2697
2698EventEmitter.prototype.once = function(type, listener) {
2699 if (!isFunction(listener))
2700 throw TypeError('listener must be a function');
2701
2702 var fired = false;
2703
2704 function g() {
2705 this.removeListener(type, g);
2706
2707 if (!fired) {
2708 fired = true;
2709 listener.apply(this, arguments);
2710 }
2711 }
2712
2713 g.listener = listener;
2714 this.on(type, g);
2715
2716 return this;
2717};
2718
2719// emits a 'removeListener' event iff the listener was removed
2720EventEmitter.prototype.removeListener = function(type, listener) {
2721 var list, position, length, i;
2722
2723 if (!isFunction(listener))
2724 throw TypeError('listener must be a function');
2725
2726 if (!this._events || !this._events[type])
2727 return this;
2728
2729 list = this._events[type];
2730 length = list.length;
2731 position = -1;
2732
2733 if (list === listener ||
2734 (isFunction(list.listener) && list.listener === listener)) {
2735 delete this._events[type];
2736 if (this._events.removeListener)
2737 this.emit('removeListener', type, listener);
2738
2739 } else if (isObject(list)) {
2740 for (i = length; i-- > 0;) {
2741 if (list[i] === listener ||
2742 (list[i].listener && list[i].listener === listener)) {
2743 position = i;
2744 break;
2745 }
2746 }
2747
2748 if (position < 0)
2749 return this;
2750
2751 if (list.length === 1) {
2752 list.length = 0;
2753 delete this._events[type];
2754 } else {
2755 list.splice(position, 1);
2756 }
2757
2758 if (this._events.removeListener)
2759 this.emit('removeListener', type, listener);
2760 }
2761
2762 return this;
2763};
2764
2765EventEmitter.prototype.removeAllListeners = function(type) {
2766 var key, listeners;
2767
2768 if (!this._events)
2769 return this;
2770
2771 // not listening for removeListener, no need to emit
2772 if (!this._events.removeListener) {
2773 if (arguments.length === 0)
2774 this._events = {};
2775 else if (this._events[type])
2776 delete this._events[type];
2777 return this;
2778 }
2779
2780 // emit removeListener for all listeners on all events
2781 if (arguments.length === 0) {
2782 for (key in this._events) {
2783 if (key === 'removeListener') continue;
2784 this.removeAllListeners(key);
2785 }
2786 this.removeAllListeners('removeListener');
2787 this._events = {};
2788 return this;
2789 }
2790
2791 listeners = this._events[type];
2792
2793 if (isFunction(listeners)) {
2794 this.removeListener(type, listeners);
2795 } else if (listeners) {
2796 // LIFO order
2797 while (listeners.length)
2798 this.removeListener(type, listeners[listeners.length - 1]);
2799 }
2800 delete this._events[type];
2801
2802 return this;
2803};
2804
2805EventEmitter.prototype.listeners = function(type) {
2806 var ret;
2807 if (!this._events || !this._events[type])
2808 ret = [];
2809 else if (isFunction(this._events[type]))
2810 ret = [this._events[type]];
2811 else
2812 ret = this._events[type].slice();
2813 return ret;
2814};
2815
2816EventEmitter.prototype.listenerCount = function(type) {
2817 if (this._events) {
2818 var evlistener = this._events[type];
2819
2820 if (isFunction(evlistener))
2821 return 1;
2822 else if (evlistener)
2823 return evlistener.length;
2824 }
2825 return 0;
2826};
2827
2828EventEmitter.listenerCount = function(emitter, type) {
2829 return emitter.listenerCount(type);
2830};
2831
2832function isFunction(arg) {
2833 return typeof arg === 'function';
2834}
2835
2836function isNumber(arg) {
2837 return typeof arg === 'number';
2838}
2839
2840function isObject(arg) {
2841 return typeof arg === 'object' && arg !== null;
2842}
2843
2844function isUndefined(arg) {
2845 return arg === void 0;
2846}
2847
2848},{}],8:[function(require,module,exports){
2849exports.read = function (buffer, offset, isLE, mLen, nBytes) {
2850 var e, m
2851 var eLen = nBytes * 8 - mLen - 1
2852 var eMax = (1 << eLen) - 1
2853 var eBias = eMax >> 1
2854 var nBits = -7
2855 var i = isLE ? (nBytes - 1) : 0
2856 var d = isLE ? -1 : 1
2857 var s = buffer[offset + i]
2858
2859 i += d
2860
2861 e = s & ((1 << (-nBits)) - 1)
2862 s >>= (-nBits)
2863 nBits += eLen
2864 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
2865
2866 m = e & ((1 << (-nBits)) - 1)
2867 e >>= (-nBits)
2868 nBits += mLen
2869 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
2870
2871 if (e === 0) {
2872 e = 1 - eBias
2873 } else if (e === eMax) {
2874 return m ? NaN : ((s ? -1 : 1) * Infinity)
2875 } else {
2876 m = m + Math.pow(2, mLen)
2877 e = e - eBias
2878 }
2879 return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
2880}
2881
2882exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
2883 var e, m, c
2884 var eLen = nBytes * 8 - mLen - 1
2885 var eMax = (1 << eLen) - 1
2886 var eBias = eMax >> 1
2887 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
2888 var i = isLE ? 0 : (nBytes - 1)
2889 var d = isLE ? 1 : -1
2890 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
2891
2892 value = Math.abs(value)
2893
2894 if (isNaN(value) || value === Infinity) {
2895 m = isNaN(value) ? 1 : 0
2896 e = eMax
2897 } else {
2898 e = Math.floor(Math.log(value) / Math.LN2)
2899 if (value * (c = Math.pow(2, -e)) < 1) {
2900 e--
2901 c *= 2
2902 }
2903 if (e + eBias >= 1) {
2904 value += rt / c
2905 } else {
2906 value += rt * Math.pow(2, 1 - eBias)
2907 }
2908 if (value * c >= 2) {
2909 e++
2910 c /= 2
2911 }
2912
2913 if (e + eBias >= eMax) {
2914 m = 0
2915 e = eMax
2916 } else if (e + eBias >= 1) {
2917 m = (value * c - 1) * Math.pow(2, mLen)
2918 e = e + eBias
2919 } else {
2920 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
2921 e = 0
2922 }
2923 }
2924
2925 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
2926
2927 e = (e << mLen) | m
2928 eLen += mLen
2929 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
2930
2931 buffer[offset + i - d] |= s * 128
2932}
2933
2934},{}],9:[function(require,module,exports){
2935if (typeof Object.create === 'function') {
2936 // implementation from standard node.js 'util' module
2937 module.exports = function inherits(ctor, superCtor) {
2938 ctor.super_ = superCtor
2939 ctor.prototype = Object.create(superCtor.prototype, {
2940 constructor: {
2941 value: ctor,
2942 enumerable: false,
2943 writable: true,
2944 configurable: true
2945 }
2946 });
2947 };
2948} else {
2949 // old school shim for old browsers
2950 module.exports = function inherits(ctor, superCtor) {
2951 ctor.super_ = superCtor
2952 var TempCtor = function () {}
2953 TempCtor.prototype = superCtor.prototype
2954 ctor.prototype = new TempCtor()
2955 ctor.prototype.constructor = ctor
2956 }
2957}
2958
2959},{}],10:[function(require,module,exports){
2960/*!
2961 * Determine if an object is a Buffer
2962 *
2963 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
2964 * @license MIT
2965 */
2966
2967// The _isBuffer check is for Safari 5-7 support, because it's missing
2968// Object.prototype.constructor. Remove this eventually
2969module.exports = function (obj) {
2970 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
2971}
2972
2973function isBuffer (obj) {
2974 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
2975}
2976
2977// For Node v0.10 support. Remove this eventually.
2978function isSlowBuffer (obj) {
2979 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
2980}
2981
2982},{}],11:[function(require,module,exports){
2983var toString = {}.toString;
2984
2985module.exports = Array.isArray || function (arr) {
2986 return toString.call(arr) == '[object Array]';
2987};
2988
2989},{}],12:[function(require,module,exports){
2990(function (process){
2991'use strict';
2992
2993if (!process.version ||
2994 process.version.indexOf('v0.') === 0 ||
2995 process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
2996 module.exports = nextTick;
2997} else {
2998 module.exports = process.nextTick;
2999}
3000
3001function nextTick(fn, arg1, arg2, arg3) {
3002 if (typeof fn !== 'function') {
3003 throw new TypeError('"callback" argument must be a function');
3004 }
3005 var len = arguments.length;
3006 var args, i;
3007 switch (len) {
3008 case 0:
3009 case 1:
3010 return process.nextTick(fn);
3011 case 2:
3012 return process.nextTick(function afterTickOne() {
3013 fn.call(null, arg1);
3014 });
3015 case 3:
3016 return process.nextTick(function afterTickTwo() {
3017 fn.call(null, arg1, arg2);
3018 });
3019 case 4:
3020 return process.nextTick(function afterTickThree() {
3021 fn.call(null, arg1, arg2, arg3);
3022 });
3023 default:
3024 args = new Array(len - 1);
3025 i = 0;
3026 while (i < args.length) {
3027 args[i++] = arguments[i];
3028 }
3029 return process.nextTick(function afterTick() {
3030 fn.apply(null, args);
3031 });
3032 }
3033}
3034
3035}).call(this,require('_process'))
3036},{"_process":13}],13:[function(require,module,exports){
3037// shim for using process in browser
3038var process = module.exports = {};
3039
3040// cached from whatever global is present so that test runners that stub it
3041// don't break things. But we need to wrap it in a try catch in case it is
3042// wrapped in strict mode code which doesn't define any globals. It's inside a
3043// function because try/catches deoptimize in certain engines.
3044
3045var cachedSetTimeout;
3046var cachedClearTimeout;
3047
3048function defaultSetTimout() {
3049 throw new Error('setTimeout has not been defined');
3050}
3051function defaultClearTimeout () {
3052 throw new Error('clearTimeout has not been defined');
3053}
3054(function () {
3055 try {
3056 if (typeof setTimeout === 'function') {
3057 cachedSetTimeout = setTimeout;
3058 } else {
3059 cachedSetTimeout = defaultSetTimout;
3060 }
3061 } catch (e) {
3062 cachedSetTimeout = defaultSetTimout;
3063 }
3064 try {
3065 if (typeof clearTimeout === 'function') {
3066 cachedClearTimeout = clearTimeout;
3067 } else {
3068 cachedClearTimeout = defaultClearTimeout;
3069 }
3070 } catch (e) {
3071 cachedClearTimeout = defaultClearTimeout;
3072 }
3073} ())
3074function runTimeout(fun) {
3075 if (cachedSetTimeout === setTimeout) {
3076 //normal enviroments in sane situations
3077 return setTimeout(fun, 0);
3078 }
3079 // if setTimeout wasn't available but was latter defined
3080 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
3081 cachedSetTimeout = setTimeout;
3082 return setTimeout(fun, 0);
3083 }
3084 try {
3085 // when when somebody has screwed with setTimeout but no I.E. maddness
3086 return cachedSetTimeout(fun, 0);
3087 } catch(e){
3088 try {
3089 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
3090 return cachedSetTimeout.call(null, fun, 0);
3091 } catch(e){
3092 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
3093 return cachedSetTimeout.call(this, fun, 0);
3094 }
3095 }
3096
3097
3098}
3099function runClearTimeout(marker) {
3100 if (cachedClearTimeout === clearTimeout) {
3101 //normal enviroments in sane situations
3102 return clearTimeout(marker);
3103 }
3104 // if clearTimeout wasn't available but was latter defined
3105 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
3106 cachedClearTimeout = clearTimeout;
3107 return clearTimeout(marker);
3108 }
3109 try {
3110 // when when somebody has screwed with setTimeout but no I.E. maddness
3111 return cachedClearTimeout(marker);
3112 } catch (e){
3113 try {
3114 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
3115 return cachedClearTimeout.call(null, marker);
3116 } catch (e){
3117 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
3118 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
3119 return cachedClearTimeout.call(this, marker);
3120 }
3121 }
3122
3123
3124
3125}
3126var queue = [];
3127var draining = false;
3128var currentQueue;
3129var queueIndex = -1;
3130
3131function cleanUpNextTick() {
3132 if (!draining || !currentQueue) {
3133 return;
3134 }
3135 draining = false;
3136 if (currentQueue.length) {
3137 queue = currentQueue.concat(queue);
3138 } else {
3139 queueIndex = -1;
3140 }
3141 if (queue.length) {
3142 drainQueue();
3143 }
3144}
3145
3146function drainQueue() {
3147 if (draining) {
3148 return;
3149 }
3150 var timeout = runTimeout(cleanUpNextTick);
3151 draining = true;
3152
3153 var len = queue.length;
3154 while(len) {
3155 currentQueue = queue;
3156 queue = [];
3157 while (++queueIndex < len) {
3158 if (currentQueue) {
3159 currentQueue[queueIndex].run();
3160 }
3161 }
3162 queueIndex = -1;
3163 len = queue.length;
3164 }
3165 currentQueue = null;
3166 draining = false;
3167 runClearTimeout(timeout);
3168}
3169
3170process.nextTick = function (fun) {
3171 var args = new Array(arguments.length - 1);
3172 if (arguments.length > 1) {
3173 for (var i = 1; i < arguments.length; i++) {
3174 args[i - 1] = arguments[i];
3175 }
3176 }
3177 queue.push(new Item(fun, args));
3178 if (queue.length === 1 && !draining) {
3179 runTimeout(drainQueue);
3180 }
3181};
3182
3183// v8 likes predictible objects
3184function Item(fun, array) {
3185 this.fun = fun;
3186 this.array = array;
3187}
3188Item.prototype.run = function () {
3189 this.fun.apply(null, this.array);
3190};
3191process.title = 'browser';
3192process.browser = true;
3193process.env = {};
3194process.argv = [];
3195process.version = ''; // empty string to avoid regexp issues
3196process.versions = {};
3197
3198function noop() {}
3199
3200process.on = noop;
3201process.addListener = noop;
3202process.once = noop;
3203process.off = noop;
3204process.removeListener = noop;
3205process.removeAllListeners = noop;
3206process.emit = noop;
3207process.prependListener = noop;
3208process.prependOnceListener = noop;
3209
3210process.listeners = function (name) { return [] }
3211
3212process.binding = function (name) {
3213 throw new Error('process.binding is not supported');
3214};
3215
3216process.cwd = function () { return '/' };
3217process.chdir = function (dir) {
3218 throw new Error('process.chdir is not supported');
3219};
3220process.umask = function() { return 0; };
3221
3222},{}],14:[function(require,module,exports){
3223module.exports = require('./lib/_stream_duplex.js');
3224
3225},{"./lib/_stream_duplex.js":15}],15:[function(require,module,exports){
3226// a duplex stream is just a stream that is both readable and writable.
3227// Since JS doesn't have multiple prototypal inheritance, this class
3228// prototypally inherits from Readable, and then parasitically from
3229// Writable.
3230
3231'use strict';
3232
3233/*<replacement>*/
3234
3235var objectKeys = Object.keys || function (obj) {
3236 var keys = [];
3237 for (var key in obj) {
3238 keys.push(key);
3239 }return keys;
3240};
3241/*</replacement>*/
3242
3243module.exports = Duplex;
3244
3245/*<replacement>*/
3246var processNextTick = require('process-nextick-args');
3247/*</replacement>*/
3248
3249/*<replacement>*/
3250var util = require('core-util-is');
3251util.inherits = require('inherits');
3252/*</replacement>*/
3253
3254var Readable = require('./_stream_readable');
3255var Writable = require('./_stream_writable');
3256
3257util.inherits(Duplex, Readable);
3258
3259var keys = objectKeys(Writable.prototype);
3260for (var v = 0; v < keys.length; v++) {
3261 var method = keys[v];
3262 if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
3263}
3264
3265function Duplex(options) {
3266 if (!(this instanceof Duplex)) return new Duplex(options);
3267
3268 Readable.call(this, options);
3269 Writable.call(this, options);
3270
3271 if (options && options.readable === false) this.readable = false;
3272
3273 if (options && options.writable === false) this.writable = false;
3274
3275 this.allowHalfOpen = true;
3276 if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
3277
3278 this.once('end', onend);
3279}
3280
3281// the no-half-open enforcer
3282function onend() {
3283 // if we allow half-open state, or if the writable side ended,
3284 // then we're ok.
3285 if (this.allowHalfOpen || this._writableState.ended) return;
3286
3287 // no more data can be written.
3288 // But allow more writes to happen in this tick.
3289 processNextTick(onEndNT, this);
3290}
3291
3292function onEndNT(self) {
3293 self.end();
3294}
3295
3296function forEach(xs, f) {
3297 for (var i = 0, l = xs.length; i < l; i++) {
3298 f(xs[i], i);
3299 }
3300}
3301},{"./_stream_readable":17,"./_stream_writable":19,"core-util-is":6,"inherits":9,"process-nextick-args":12}],16:[function(require,module,exports){
3302// a passthrough stream.
3303// basically just the most minimal sort of Transform stream.
3304// Every written chunk gets output as-is.
3305
3306'use strict';
3307
3308module.exports = PassThrough;
3309
3310var Transform = require('./_stream_transform');
3311
3312/*<replacement>*/
3313var util = require('core-util-is');
3314util.inherits = require('inherits');
3315/*</replacement>*/
3316
3317util.inherits(PassThrough, Transform);
3318
3319function PassThrough(options) {
3320 if (!(this instanceof PassThrough)) return new PassThrough(options);
3321
3322 Transform.call(this, options);
3323}
3324
3325PassThrough.prototype._transform = function (chunk, encoding, cb) {
3326 cb(null, chunk);
3327};
3328},{"./_stream_transform":18,"core-util-is":6,"inherits":9}],17:[function(require,module,exports){
3329(function (process){
3330'use strict';
3331
3332module.exports = Readable;
3333
3334/*<replacement>*/
3335var processNextTick = require('process-nextick-args');
3336/*</replacement>*/
3337
3338/*<replacement>*/
3339var isArray = require('isarray');
3340/*</replacement>*/
3341
3342/*<replacement>*/
3343var Duplex;
3344/*</replacement>*/
3345
3346Readable.ReadableState = ReadableState;
3347
3348/*<replacement>*/
3349var EE = require('events').EventEmitter;
3350
3351var EElistenerCount = function (emitter, type) {
3352 return emitter.listeners(type).length;
3353};
3354/*</replacement>*/
3355
3356/*<replacement>*/
3357var Stream = require('./internal/streams/stream');
3358/*</replacement>*/
3359
3360var Buffer = require('buffer').Buffer;
3361/*<replacement>*/
3362var bufferShim = require('buffer-shims');
3363/*</replacement>*/
3364
3365/*<replacement>*/
3366var util = require('core-util-is');
3367util.inherits = require('inherits');
3368/*</replacement>*/
3369
3370/*<replacement>*/
3371var debugUtil = require('util');
3372var debug = void 0;
3373if (debugUtil && debugUtil.debuglog) {
3374 debug = debugUtil.debuglog('stream');
3375} else {
3376 debug = function () {};
3377}
3378/*</replacement>*/
3379
3380var BufferList = require('./internal/streams/BufferList');
3381var StringDecoder;
3382
3383util.inherits(Readable, Stream);
3384
3385var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
3386
3387function prependListener(emitter, event, fn) {
3388 // Sadly this is not cacheable as some libraries bundle their own
3389 // event emitter implementation with them.
3390 if (typeof emitter.prependListener === 'function') {
3391 return emitter.prependListener(event, fn);
3392 } else {
3393 // This is a hack to make sure that our error handler is attached before any
3394 // userland ones. NEVER DO THIS. This is here only because this code needs
3395 // to continue to work with older versions of Node.js that do not include
3396 // the prependListener() method. The goal is to eventually remove this hack.
3397 if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
3398 }
3399}
3400
3401function ReadableState(options, stream) {
3402 Duplex = Duplex || require('./_stream_duplex');
3403
3404 options = options || {};
3405
3406 // object stream flag. Used to make read(n) ignore n and to
3407 // make all the buffer merging and length checks go away
3408 this.objectMode = !!options.objectMode;
3409
3410 if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
3411
3412 // the point at which it stops calling _read() to fill the buffer
3413 // Note: 0 is a valid value, means "don't call _read preemptively ever"
3414 var hwm = options.highWaterMark;
3415 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
3416 this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
3417
3418 // cast to ints.
3419 this.highWaterMark = ~~this.highWaterMark;
3420
3421 // A linked list is used to store data chunks instead of an array because the
3422 // linked list can remove elements from the beginning faster than
3423 // array.shift()
3424 this.buffer = new BufferList();
3425 this.length = 0;
3426 this.pipes = null;
3427 this.pipesCount = 0;
3428 this.flowing = null;
3429 this.ended = false;
3430 this.endEmitted = false;
3431 this.reading = false;
3432
3433 // a flag to be able to tell if the onwrite cb is called immediately,
3434 // or on a later tick. We set this to true at first, because any
3435 // actions that shouldn't happen until "later" should generally also
3436 // not happen before the first write call.
3437 this.sync = true;
3438
3439 // whenever we return null, then we set a flag to say
3440 // that we're awaiting a 'readable' event emission.
3441 this.needReadable = false;
3442 this.emittedReadable = false;
3443 this.readableListening = false;
3444 this.resumeScheduled = false;
3445
3446 // Crypto is kind of old and crusty. Historically, its default string
3447 // encoding is 'binary' so we have to make this configurable.
3448 // Everything else in the universe uses 'utf8', though.
3449 this.defaultEncoding = options.defaultEncoding || 'utf8';
3450
3451 // when piping, we only care about 'readable' events that happen
3452 // after read()ing all the bytes and not getting any pushback.
3453 this.ranOut = false;
3454
3455 // the number of writers that are awaiting a drain event in .pipe()s
3456 this.awaitDrain = 0;
3457
3458 // if true, a maybeReadMore has been scheduled
3459 this.readingMore = false;
3460
3461 this.decoder = null;
3462 this.encoding = null;
3463 if (options.encoding) {
3464 if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
3465 this.decoder = new StringDecoder(options.encoding);
3466 this.encoding = options.encoding;
3467 }
3468}
3469
3470function Readable(options) {
3471 Duplex = Duplex || require('./_stream_duplex');
3472
3473 if (!(this instanceof Readable)) return new Readable(options);
3474
3475 this._readableState = new ReadableState(options, this);
3476
3477 // legacy
3478 this.readable = true;
3479
3480 if (options && typeof options.read === 'function') this._read = options.read;
3481
3482 Stream.call(this);
3483}
3484
3485// Manually shove something into the read() buffer.
3486// This returns true if the highWaterMark has not been hit yet,
3487// similar to how Writable.write() returns true if you should
3488// write() some more.
3489Readable.prototype.push = function (chunk, encoding) {
3490 var state = this._readableState;
3491
3492 if (!state.objectMode && typeof chunk === 'string') {
3493 encoding = encoding || state.defaultEncoding;
3494 if (encoding !== state.encoding) {
3495 chunk = bufferShim.from(chunk, encoding);
3496 encoding = '';
3497 }
3498 }
3499
3500 return readableAddChunk(this, state, chunk, encoding, false);
3501};
3502
3503// Unshift should *always* be something directly out of read()
3504Readable.prototype.unshift = function (chunk) {
3505 var state = this._readableState;
3506 return readableAddChunk(this, state, chunk, '', true);
3507};
3508
3509Readable.prototype.isPaused = function () {
3510 return this._readableState.flowing === false;
3511};
3512
3513function readableAddChunk(stream, state, chunk, encoding, addToFront) {
3514 var er = chunkInvalid(state, chunk);
3515 if (er) {
3516 stream.emit('error', er);
3517 } else if (chunk === null) {
3518 state.reading = false;
3519 onEofChunk(stream, state);
3520 } else if (state.objectMode || chunk && chunk.length > 0) {
3521 if (state.ended && !addToFront) {
3522 var e = new Error('stream.push() after EOF');
3523 stream.emit('error', e);
3524 } else if (state.endEmitted && addToFront) {
3525 var _e = new Error('stream.unshift() after end event');
3526 stream.emit('error', _e);
3527 } else {
3528 var skipAdd;
3529 if (state.decoder && !addToFront && !encoding) {
3530 chunk = state.decoder.write(chunk);
3531 skipAdd = !state.objectMode && chunk.length === 0;
3532 }
3533
3534 if (!addToFront) state.reading = false;
3535
3536 // Don't add to the buffer if we've decoded to an empty string chunk and
3537 // we're not in object mode
3538 if (!skipAdd) {
3539 // if we want the data now, just emit it.
3540 if (state.flowing && state.length === 0 && !state.sync) {
3541 stream.emit('data', chunk);
3542 stream.read(0);
3543 } else {
3544 // update the buffer info.
3545 state.length += state.objectMode ? 1 : chunk.length;
3546 if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
3547
3548 if (state.needReadable) emitReadable(stream);
3549 }
3550 }
3551
3552 maybeReadMore(stream, state);
3553 }
3554 } else if (!addToFront) {
3555 state.reading = false;
3556 }
3557
3558 return needMoreData(state);
3559}
3560
3561// if it's past the high water mark, we can push in some more.
3562// Also, if we have no data yet, we can stand some
3563// more bytes. This is to work around cases where hwm=0,
3564// such as the repl. Also, if the push() triggered a
3565// readable event, and the user called read(largeNumber) such that
3566// needReadable was set, then we ought to push more, so that another
3567// 'readable' event will be triggered.
3568function needMoreData(state) {
3569 return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
3570}
3571
3572// backwards compatibility.
3573Readable.prototype.setEncoding = function (enc) {
3574 if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
3575 this._readableState.decoder = new StringDecoder(enc);
3576 this._readableState.encoding = enc;
3577 return this;
3578};
3579
3580// Don't raise the hwm > 8MB
3581var MAX_HWM = 0x800000;
3582function computeNewHighWaterMark(n) {
3583 if (n >= MAX_HWM) {
3584 n = MAX_HWM;
3585 } else {
3586 // Get the next highest power of 2 to prevent increasing hwm excessively in
3587 // tiny amounts
3588 n--;
3589 n |= n >>> 1;
3590 n |= n >>> 2;
3591 n |= n >>> 4;
3592 n |= n >>> 8;
3593 n |= n >>> 16;
3594 n++;
3595 }
3596 return n;
3597}
3598
3599// This function is designed to be inlinable, so please take care when making
3600// changes to the function body.
3601function howMuchToRead(n, state) {
3602 if (n <= 0 || state.length === 0 && state.ended) return 0;
3603 if (state.objectMode) return 1;
3604 if (n !== n) {
3605 // Only flow one buffer at a time
3606 if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
3607 }
3608 // If we're asking for more than the current hwm, then raise the hwm.
3609 if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
3610 if (n <= state.length) return n;
3611 // Don't have enough
3612 if (!state.ended) {
3613 state.needReadable = true;
3614 return 0;
3615 }
3616 return state.length;
3617}
3618
3619// you can override either this method, or the async _read(n) below.
3620Readable.prototype.read = function (n) {
3621 debug('read', n);
3622 n = parseInt(n, 10);
3623 var state = this._readableState;
3624 var nOrig = n;
3625
3626 if (n !== 0) state.emittedReadable = false;
3627
3628 // if we're doing read(0) to trigger a readable event, but we
3629 // already have a bunch of data in the buffer, then just trigger
3630 // the 'readable' event and move on.
3631 if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
3632 debug('read: emitReadable', state.length, state.ended);
3633 if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
3634 return null;
3635 }
3636
3637 n = howMuchToRead(n, state);
3638
3639 // if we've ended, and we're now clear, then finish it up.
3640 if (n === 0 && state.ended) {
3641 if (state.length === 0) endReadable(this);
3642 return null;
3643 }
3644
3645 // All the actual chunk generation logic needs to be
3646 // *below* the call to _read. The reason is that in certain
3647 // synthetic stream cases, such as passthrough streams, _read
3648 // may be a completely synchronous operation which may change
3649 // the state of the read buffer, providing enough data when
3650 // before there was *not* enough.
3651 //
3652 // So, the steps are:
3653 // 1. Figure out what the state of things will be after we do
3654 // a read from the buffer.
3655 //
3656 // 2. If that resulting state will trigger a _read, then call _read.
3657 // Note that this may be asynchronous, or synchronous. Yes, it is
3658 // deeply ugly to write APIs this way, but that still doesn't mean
3659 // that the Readable class should behave improperly, as streams are
3660 // designed to be sync/async agnostic.
3661 // Take note if the _read call is sync or async (ie, if the read call
3662 // has returned yet), so that we know whether or not it's safe to emit
3663 // 'readable' etc.
3664 //
3665 // 3. Actually pull the requested chunks out of the buffer and return.
3666
3667 // if we need a readable event, then we need to do some reading.
3668 var doRead = state.needReadable;
3669 debug('need readable', doRead);
3670
3671 // if we currently have less than the highWaterMark, then also read some
3672 if (state.length === 0 || state.length - n < state.highWaterMark) {
3673 doRead = true;
3674 debug('length less than watermark', doRead);
3675 }
3676
3677 // however, if we've ended, then there's no point, and if we're already
3678 // reading, then it's unnecessary.
3679 if (state.ended || state.reading) {
3680 doRead = false;
3681 debug('reading or ended', doRead);
3682 } else if (doRead) {
3683 debug('do read');
3684 state.reading = true;
3685 state.sync = true;
3686 // if the length is currently zero, then we *need* a readable event.
3687 if (state.length === 0) state.needReadable = true;
3688 // call internal read method
3689 this._read(state.highWaterMark);
3690 state.sync = false;
3691 // If _read pushed data synchronously, then `reading` will be false,
3692 // and we need to re-evaluate how much data we can return to the user.
3693 if (!state.reading) n = howMuchToRead(nOrig, state);
3694 }
3695
3696 var ret;
3697 if (n > 0) ret = fromList(n, state);else ret = null;
3698
3699 if (ret === null) {
3700 state.needReadable = true;
3701 n = 0;
3702 } else {
3703 state.length -= n;
3704 }
3705
3706 if (state.length === 0) {
3707 // If we have nothing in the buffer, then we want to know
3708 // as soon as we *do* get something into the buffer.
3709 if (!state.ended) state.needReadable = true;
3710
3711 // If we tried to read() past the EOF, then emit end on the next tick.
3712 if (nOrig !== n && state.ended) endReadable(this);
3713 }
3714
3715 if (ret !== null) this.emit('data', ret);
3716
3717 return ret;
3718};
3719
3720function chunkInvalid(state, chunk) {
3721 var er = null;
3722 if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
3723 er = new TypeError('Invalid non-string/buffer chunk');
3724 }
3725 return er;
3726}
3727
3728function onEofChunk(stream, state) {
3729 if (state.ended) return;
3730 if (state.decoder) {
3731 var chunk = state.decoder.end();
3732 if (chunk && chunk.length) {
3733 state.buffer.push(chunk);
3734 state.length += state.objectMode ? 1 : chunk.length;
3735 }
3736 }
3737 state.ended = true;
3738
3739 // emit 'readable' now to make sure it gets picked up.
3740 emitReadable(stream);
3741}
3742
3743// Don't emit readable right away in sync mode, because this can trigger
3744// another read() call => stack overflow. This way, it might trigger
3745// a nextTick recursion warning, but that's not so bad.
3746function emitReadable(stream) {
3747 var state = stream._readableState;
3748 state.needReadable = false;
3749 if (!state.emittedReadable) {
3750 debug('emitReadable', state.flowing);
3751 state.emittedReadable = true;
3752 if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
3753 }
3754}
3755
3756function emitReadable_(stream) {
3757 debug('emit readable');
3758 stream.emit('readable');
3759 flow(stream);
3760}
3761
3762// at this point, the user has presumably seen the 'readable' event,
3763// and called read() to consume some data. that may have triggered
3764// in turn another _read(n) call, in which case reading = true if
3765// it's in progress.
3766// However, if we're not ended, or reading, and the length < hwm,
3767// then go ahead and try to read some more preemptively.
3768function maybeReadMore(stream, state) {
3769 if (!state.readingMore) {
3770 state.readingMore = true;
3771 processNextTick(maybeReadMore_, stream, state);
3772 }
3773}
3774
3775function maybeReadMore_(stream, state) {
3776 var len = state.length;
3777 while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
3778 debug('maybeReadMore read 0');
3779 stream.read(0);
3780 if (len === state.length)
3781 // didn't get any data, stop spinning.
3782 break;else len = state.length;
3783 }
3784 state.readingMore = false;
3785}
3786
3787// abstract method. to be overridden in specific implementation classes.
3788// call cb(er, data) where data is <= n in length.
3789// for virtual (non-string, non-buffer) streams, "length" is somewhat
3790// arbitrary, and perhaps not very meaningful.
3791Readable.prototype._read = function (n) {
3792 this.emit('error', new Error('_read() is not implemented'));
3793};
3794
3795Readable.prototype.pipe = function (dest, pipeOpts) {
3796 var src = this;
3797 var state = this._readableState;
3798
3799 switch (state.pipesCount) {
3800 case 0:
3801 state.pipes = dest;
3802 break;
3803 case 1:
3804 state.pipes = [state.pipes, dest];
3805 break;
3806 default:
3807 state.pipes.push(dest);
3808 break;
3809 }
3810 state.pipesCount += 1;
3811 debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
3812
3813 var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
3814
3815 var endFn = doEnd ? onend : cleanup;
3816 if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
3817
3818 dest.on('unpipe', onunpipe);
3819 function onunpipe(readable) {
3820 debug('onunpipe');
3821 if (readable === src) {
3822 cleanup();
3823 }
3824 }
3825
3826 function onend() {
3827 debug('onend');
3828 dest.end();
3829 }
3830
3831 // when the dest drains, it reduces the awaitDrain counter
3832 // on the source. This would be more elegant with a .once()
3833 // handler in flow(), but adding and removing repeatedly is
3834 // too slow.
3835 var ondrain = pipeOnDrain(src);
3836 dest.on('drain', ondrain);
3837
3838 var cleanedUp = false;
3839 function cleanup() {
3840 debug('cleanup');
3841 // cleanup event handlers once the pipe is broken
3842 dest.removeListener('close', onclose);
3843 dest.removeListener('finish', onfinish);
3844 dest.removeListener('drain', ondrain);
3845 dest.removeListener('error', onerror);
3846 dest.removeListener('unpipe', onunpipe);
3847 src.removeListener('end', onend);
3848 src.removeListener('end', cleanup);
3849 src.removeListener('data', ondata);
3850
3851 cleanedUp = true;
3852
3853 // if the reader is waiting for a drain event from this
3854 // specific writer, then it would cause it to never start
3855 // flowing again.
3856 // So, if this is awaiting a drain, then we just call it now.
3857 // If we don't know, then assume that we are waiting for one.
3858 if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
3859 }
3860
3861 // If the user pushes more data while we're writing to dest then we'll end up
3862 // in ondata again. However, we only want to increase awaitDrain once because
3863 // dest will only emit one 'drain' event for the multiple writes.
3864 // => Introduce a guard on increasing awaitDrain.
3865 var increasedAwaitDrain = false;
3866 src.on('data', ondata);
3867 function ondata(chunk) {
3868 debug('ondata');
3869 increasedAwaitDrain = false;
3870 var ret = dest.write(chunk);
3871 if (false === ret && !increasedAwaitDrain) {
3872 // If the user unpiped during `dest.write()`, it is possible
3873 // to get stuck in a permanently paused state if that write
3874 // also returned false.
3875 // => Check whether `dest` is still a piping destination.
3876 if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
3877 debug('false write response, pause', src._readableState.awaitDrain);
3878 src._readableState.awaitDrain++;
3879 increasedAwaitDrain = true;
3880 }
3881 src.pause();
3882 }
3883 }
3884
3885 // if the dest has an error, then stop piping into it.
3886 // however, don't suppress the throwing behavior for this.
3887 function onerror(er) {
3888 debug('onerror', er);
3889 unpipe();
3890 dest.removeListener('error', onerror);
3891 if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
3892 }
3893
3894 // Make sure our error handler is attached before userland ones.
3895 prependListener(dest, 'error', onerror);
3896
3897 // Both close and finish should trigger unpipe, but only once.
3898 function onclose() {
3899 dest.removeListener('finish', onfinish);
3900 unpipe();
3901 }
3902 dest.once('close', onclose);
3903 function onfinish() {
3904 debug('onfinish');
3905 dest.removeListener('close', onclose);
3906 unpipe();
3907 }
3908 dest.once('finish', onfinish);
3909
3910 function unpipe() {
3911 debug('unpipe');
3912 src.unpipe(dest);
3913 }
3914
3915 // tell the dest that it's being piped to
3916 dest.emit('pipe', src);
3917
3918 // start the flow if it hasn't been started already.
3919 if (!state.flowing) {
3920 debug('pipe resume');
3921 src.resume();
3922 }
3923
3924 return dest;
3925};
3926
3927function pipeOnDrain(src) {
3928 return function () {
3929 var state = src._readableState;
3930 debug('pipeOnDrain', state.awaitDrain);
3931 if (state.awaitDrain) state.awaitDrain--;
3932 if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
3933 state.flowing = true;
3934 flow(src);
3935 }
3936 };
3937}
3938
3939Readable.prototype.unpipe = function (dest) {
3940 var state = this._readableState;
3941
3942 // if we're not piping anywhere, then do nothing.
3943 if (state.pipesCount === 0) return this;
3944
3945 // just one destination. most common case.
3946 if (state.pipesCount === 1) {
3947 // passed in one, but it's not the right one.
3948 if (dest && dest !== state.pipes) return this;
3949
3950 if (!dest) dest = state.pipes;
3951
3952 // got a match.
3953 state.pipes = null;
3954 state.pipesCount = 0;
3955 state.flowing = false;
3956 if (dest) dest.emit('unpipe', this);
3957 return this;
3958 }
3959
3960 // slow case. multiple pipe destinations.
3961
3962 if (!dest) {
3963 // remove all.
3964 var dests = state.pipes;
3965 var len = state.pipesCount;
3966 state.pipes = null;
3967 state.pipesCount = 0;
3968 state.flowing = false;
3969
3970 for (var i = 0; i < len; i++) {
3971 dests[i].emit('unpipe', this);
3972 }return this;
3973 }
3974
3975 // try to find the right one.
3976 var index = indexOf(state.pipes, dest);
3977 if (index === -1) return this;
3978
3979 state.pipes.splice(index, 1);
3980 state.pipesCount -= 1;
3981 if (state.pipesCount === 1) state.pipes = state.pipes[0];
3982
3983 dest.emit('unpipe', this);
3984
3985 return this;
3986};
3987
3988// set up data events if they are asked for
3989// Ensure readable listeners eventually get something
3990Readable.prototype.on = function (ev, fn) {
3991 var res = Stream.prototype.on.call(this, ev, fn);
3992
3993 if (ev === 'data') {
3994 // Start flowing on next tick if stream isn't explicitly paused
3995 if (this._readableState.flowing !== false) this.resume();
3996 } else if (ev === 'readable') {
3997 var state = this._readableState;
3998 if (!state.endEmitted && !state.readableListening) {
3999 state.readableListening = state.needReadable = true;
4000 state.emittedReadable = false;
4001 if (!state.reading) {
4002 processNextTick(nReadingNextTick, this);
4003 } else if (state.length) {
4004 emitReadable(this, state);
4005 }
4006 }
4007 }
4008
4009 return res;
4010};
4011Readable.prototype.addListener = Readable.prototype.on;
4012
4013function nReadingNextTick(self) {
4014 debug('readable nexttick read 0');
4015 self.read(0);
4016}
4017
4018// pause() and resume() are remnants of the legacy readable stream API
4019// If the user uses them, then switch into old mode.
4020Readable.prototype.resume = function () {
4021 var state = this._readableState;
4022 if (!state.flowing) {
4023 debug('resume');
4024 state.flowing = true;
4025 resume(this, state);
4026 }
4027 return this;
4028};
4029
4030function resume(stream, state) {
4031 if (!state.resumeScheduled) {
4032 state.resumeScheduled = true;
4033 processNextTick(resume_, stream, state);
4034 }
4035}
4036
4037function resume_(stream, state) {
4038 if (!state.reading) {
4039 debug('resume read 0');
4040 stream.read(0);
4041 }
4042
4043 state.resumeScheduled = false;
4044 state.awaitDrain = 0;
4045 stream.emit('resume');
4046 flow(stream);
4047 if (state.flowing && !state.reading) stream.read(0);
4048}
4049
4050Readable.prototype.pause = function () {
4051 debug('call pause flowing=%j', this._readableState.flowing);
4052 if (false !== this._readableState.flowing) {
4053 debug('pause');
4054 this._readableState.flowing = false;
4055 this.emit('pause');
4056 }
4057 return this;
4058};
4059
4060function flow(stream) {
4061 var state = stream._readableState;
4062 debug('flow', state.flowing);
4063 while (state.flowing && stream.read() !== null) {}
4064}
4065
4066// wrap an old-style stream as the async data source.
4067// This is *not* part of the readable stream interface.
4068// It is an ugly unfortunate mess of history.
4069Readable.prototype.wrap = function (stream) {
4070 var state = this._readableState;
4071 var paused = false;
4072
4073 var self = this;
4074 stream.on('end', function () {
4075 debug('wrapped end');
4076 if (state.decoder && !state.ended) {
4077 var chunk = state.decoder.end();
4078 if (chunk && chunk.length) self.push(chunk);
4079 }
4080
4081 self.push(null);
4082 });
4083
4084 stream.on('data', function (chunk) {
4085 debug('wrapped data');
4086 if (state.decoder) chunk = state.decoder.write(chunk);
4087
4088 // don't skip over falsy values in objectMode
4089 if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
4090
4091 var ret = self.push(chunk);
4092 if (!ret) {
4093 paused = true;
4094 stream.pause();
4095 }
4096 });
4097
4098 // proxy all the other methods.
4099 // important when wrapping filters and duplexes.
4100 for (var i in stream) {
4101 if (this[i] === undefined && typeof stream[i] === 'function') {
4102 this[i] = function (method) {
4103 return function () {
4104 return stream[method].apply(stream, arguments);
4105 };
4106 }(i);
4107 }
4108 }
4109
4110 // proxy certain important events.
4111 for (var n = 0; n < kProxyEvents.length; n++) {
4112 stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n]));
4113 }
4114
4115 // when we try to consume some more bytes, simply unpause the
4116 // underlying stream.
4117 self._read = function (n) {
4118 debug('wrapped _read', n);
4119 if (paused) {
4120 paused = false;
4121 stream.resume();
4122 }
4123 };
4124
4125 return self;
4126};
4127
4128// exposed for testing purposes only.
4129Readable._fromList = fromList;
4130
4131// Pluck off n bytes from an array of buffers.
4132// Length is the combined lengths of all the buffers in the list.
4133// This function is designed to be inlinable, so please take care when making
4134// changes to the function body.
4135function fromList(n, state) {
4136 // nothing buffered
4137 if (state.length === 0) return null;
4138
4139 var ret;
4140 if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
4141 // read it all, truncate the list
4142 if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
4143 state.buffer.clear();
4144 } else {
4145 // read part of list
4146 ret = fromListPartial(n, state.buffer, state.decoder);
4147 }
4148
4149 return ret;
4150}
4151
4152// Extracts only enough buffered data to satisfy the amount requested.
4153// This function is designed to be inlinable, so please take care when making
4154// changes to the function body.
4155function fromListPartial(n, list, hasStrings) {
4156 var ret;
4157 if (n < list.head.data.length) {
4158 // slice is the same for buffers and strings
4159 ret = list.head.data.slice(0, n);
4160 list.head.data = list.head.data.slice(n);
4161 } else if (n === list.head.data.length) {
4162 // first chunk is a perfect match
4163 ret = list.shift();
4164 } else {
4165 // result spans more than one buffer
4166 ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
4167 }
4168 return ret;
4169}
4170
4171// Copies a specified amount of characters from the list of buffered data
4172// chunks.
4173// This function is designed to be inlinable, so please take care when making
4174// changes to the function body.
4175function copyFromBufferString(n, list) {
4176 var p = list.head;
4177 var c = 1;
4178 var ret = p.data;
4179 n -= ret.length;
4180 while (p = p.next) {
4181 var str = p.data;
4182 var nb = n > str.length ? str.length : n;
4183 if (nb === str.length) ret += str;else ret += str.slice(0, n);
4184 n -= nb;
4185 if (n === 0) {
4186 if (nb === str.length) {
4187 ++c;
4188 if (p.next) list.head = p.next;else list.head = list.tail = null;
4189 } else {
4190 list.head = p;
4191 p.data = str.slice(nb);
4192 }
4193 break;
4194 }
4195 ++c;
4196 }
4197 list.length -= c;
4198 return ret;
4199}
4200
4201// Copies a specified amount of bytes from the list of buffered data chunks.
4202// This function is designed to be inlinable, so please take care when making
4203// changes to the function body.
4204function copyFromBuffer(n, list) {
4205 var ret = bufferShim.allocUnsafe(n);
4206 var p = list.head;
4207 var c = 1;
4208 p.data.copy(ret);
4209 n -= p.data.length;
4210 while (p = p.next) {
4211 var buf = p.data;
4212 var nb = n > buf.length ? buf.length : n;
4213 buf.copy(ret, ret.length - n, 0, nb);
4214 n -= nb;
4215 if (n === 0) {
4216 if (nb === buf.length) {
4217 ++c;
4218 if (p.next) list.head = p.next;else list.head = list.tail = null;
4219 } else {
4220 list.head = p;
4221 p.data = buf.slice(nb);
4222 }
4223 break;
4224 }
4225 ++c;
4226 }
4227 list.length -= c;
4228 return ret;
4229}
4230
4231function endReadable(stream) {
4232 var state = stream._readableState;
4233
4234 // If we get here before consuming all the bytes, then that is a
4235 // bug in node. Should never happen.
4236 if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
4237
4238 if (!state.endEmitted) {
4239 state.ended = true;
4240 processNextTick(endReadableNT, state, stream);
4241 }
4242}
4243
4244function endReadableNT(state, stream) {
4245 // Check that we didn't get one last unshift.
4246 if (!state.endEmitted && state.length === 0) {
4247 state.endEmitted = true;
4248 stream.readable = false;
4249 stream.emit('end');
4250 }
4251}
4252
4253function forEach(xs, f) {
4254 for (var i = 0, l = xs.length; i < l; i++) {
4255 f(xs[i], i);
4256 }
4257}
4258
4259function indexOf(xs, x) {
4260 for (var i = 0, l = xs.length; i < l; i++) {
4261 if (xs[i] === x) return i;
4262 }
4263 return -1;
4264}
4265}).call(this,require('_process'))
4266},{"./_stream_duplex":15,"./internal/streams/BufferList":20,"./internal/streams/stream":21,"_process":13,"buffer":5,"buffer-shims":4,"core-util-is":6,"events":7,"inherits":9,"isarray":11,"process-nextick-args":12,"string_decoder/":22,"util":3}],18:[function(require,module,exports){
4267// a transform stream is a readable/writable stream where you do
4268// something with the data. Sometimes it's called a "filter",
4269// but that's not a great name for it, since that implies a thing where
4270// some bits pass through, and others are simply ignored. (That would
4271// be a valid example of a transform, of course.)
4272//
4273// While the output is causally related to the input, it's not a
4274// necessarily symmetric or synchronous transformation. For example,
4275// a zlib stream might take multiple plain-text writes(), and then
4276// emit a single compressed chunk some time in the future.
4277//
4278// Here's how this works:
4279//
4280// The Transform stream has all the aspects of the readable and writable
4281// stream classes. When you write(chunk), that calls _write(chunk,cb)
4282// internally, and returns false if there's a lot of pending writes
4283// buffered up. When you call read(), that calls _read(n) until
4284// there's enough pending readable data buffered up.
4285//
4286// In a transform stream, the written data is placed in a buffer. When
4287// _read(n) is called, it transforms the queued up data, calling the
4288// buffered _write cb's as it consumes chunks. If consuming a single
4289// written chunk would result in multiple output chunks, then the first
4290// outputted bit calls the readcb, and subsequent chunks just go into
4291// the read buffer, and will cause it to emit 'readable' if necessary.
4292//
4293// This way, back-pressure is actually determined by the reading side,
4294// since _read has to be called to start processing a new chunk. However,
4295// a pathological inflate type of transform can cause excessive buffering
4296// here. For example, imagine a stream where every byte of input is
4297// interpreted as an integer from 0-255, and then results in that many
4298// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
4299// 1kb of data being output. In this case, you could write a very small
4300// amount of input, and end up with a very large amount of output. In
4301// such a pathological inflating mechanism, there'd be no way to tell
4302// the system to stop doing the transform. A single 4MB write could
4303// cause the system to run out of memory.
4304//
4305// However, even in such a pathological case, only a single written chunk
4306// would be consumed, and then the rest would wait (un-transformed) until
4307// the results of the previous transformed chunk were consumed.
4308
4309'use strict';
4310
4311module.exports = Transform;
4312
4313var Duplex = require('./_stream_duplex');
4314
4315/*<replacement>*/
4316var util = require('core-util-is');
4317util.inherits = require('inherits');
4318/*</replacement>*/
4319
4320util.inherits(Transform, Duplex);
4321
4322function TransformState(stream) {
4323 this.afterTransform = function (er, data) {
4324 return afterTransform(stream, er, data);
4325 };
4326
4327 this.needTransform = false;
4328 this.transforming = false;
4329 this.writecb = null;
4330 this.writechunk = null;
4331 this.writeencoding = null;
4332}
4333
4334function afterTransform(stream, er, data) {
4335 var ts = stream._transformState;
4336 ts.transforming = false;
4337
4338 var cb = ts.writecb;
4339
4340 if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));
4341
4342 ts.writechunk = null;
4343 ts.writecb = null;
4344
4345 if (data !== null && data !== undefined) stream.push(data);
4346
4347 cb(er);
4348
4349 var rs = stream._readableState;
4350 rs.reading = false;
4351 if (rs.needReadable || rs.length < rs.highWaterMark) {
4352 stream._read(rs.highWaterMark);
4353 }
4354}
4355
4356function Transform(options) {
4357 if (!(this instanceof Transform)) return new Transform(options);
4358
4359 Duplex.call(this, options);
4360
4361 this._transformState = new TransformState(this);
4362
4363 var stream = this;
4364
4365 // start out asking for a readable event once data is transformed.
4366 this._readableState.needReadable = true;
4367
4368 // we have implemented the _read method, and done the other things
4369 // that Readable wants before the first _read call, so unset the
4370 // sync guard flag.
4371 this._readableState.sync = false;
4372
4373 if (options) {
4374 if (typeof options.transform === 'function') this._transform = options.transform;
4375
4376 if (typeof options.flush === 'function') this._flush = options.flush;
4377 }
4378
4379 // When the writable side finishes, then flush out anything remaining.
4380 this.once('prefinish', function () {
4381 if (typeof this._flush === 'function') this._flush(function (er, data) {
4382 done(stream, er, data);
4383 });else done(stream);
4384 });
4385}
4386
4387Transform.prototype.push = function (chunk, encoding) {
4388 this._transformState.needTransform = false;
4389 return Duplex.prototype.push.call(this, chunk, encoding);
4390};
4391
4392// This is the part where you do stuff!
4393// override this function in implementation classes.
4394// 'chunk' is an input chunk.
4395//
4396// Call `push(newChunk)` to pass along transformed output
4397// to the readable side. You may call 'push' zero or more times.
4398//
4399// Call `cb(err)` when you are done with this chunk. If you pass
4400// an error, then that'll put the hurt on the whole operation. If you
4401// never call cb(), then you'll never get another chunk.
4402Transform.prototype._transform = function (chunk, encoding, cb) {
4403 throw new Error('_transform() is not implemented');
4404};
4405
4406Transform.prototype._write = function (chunk, encoding, cb) {
4407 var ts = this._transformState;
4408 ts.writecb = cb;
4409 ts.writechunk = chunk;
4410 ts.writeencoding = encoding;
4411 if (!ts.transforming) {
4412 var rs = this._readableState;
4413 if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
4414 }
4415};
4416
4417// Doesn't matter what the args are here.
4418// _transform does all the work.
4419// That we got here means that the readable side wants more data.
4420Transform.prototype._read = function (n) {
4421 var ts = this._transformState;
4422
4423 if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
4424 ts.transforming = true;
4425 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
4426 } else {
4427 // mark that we need a transform, so that any data that comes in
4428 // will get processed, now that we've asked for it.
4429 ts.needTransform = true;
4430 }
4431};
4432
4433function done(stream, er, data) {
4434 if (er) return stream.emit('error', er);
4435
4436 if (data !== null && data !== undefined) stream.push(data);
4437
4438 // if there's nothing in the write buffer, then that means
4439 // that nothing more will ever be provided
4440 var ws = stream._writableState;
4441 var ts = stream._transformState;
4442
4443 if (ws.length) throw new Error('Calling transform done when ws.length != 0');
4444
4445 if (ts.transforming) throw new Error('Calling transform done when still transforming');
4446
4447 return stream.push(null);
4448}
4449},{"./_stream_duplex":15,"core-util-is":6,"inherits":9}],19:[function(require,module,exports){
4450(function (process){
4451// A bit simpler than readable streams.
4452// Implement an async ._write(chunk, encoding, cb), and it'll handle all
4453// the drain event emission and buffering.
4454
4455'use strict';
4456
4457module.exports = Writable;
4458
4459/*<replacement>*/
4460var processNextTick = require('process-nextick-args');
4461/*</replacement>*/
4462
4463/*<replacement>*/
4464var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
4465/*</replacement>*/
4466
4467/*<replacement>*/
4468var Duplex;
4469/*</replacement>*/
4470
4471Writable.WritableState = WritableState;
4472
4473/*<replacement>*/
4474var util = require('core-util-is');
4475util.inherits = require('inherits');
4476/*</replacement>*/
4477
4478/*<replacement>*/
4479var internalUtil = {
4480 deprecate: require('util-deprecate')
4481};
4482/*</replacement>*/
4483
4484/*<replacement>*/
4485var Stream = require('./internal/streams/stream');
4486/*</replacement>*/
4487
4488var Buffer = require('buffer').Buffer;
4489/*<replacement>*/
4490var bufferShim = require('buffer-shims');
4491/*</replacement>*/
4492
4493util.inherits(Writable, Stream);
4494
4495function nop() {}
4496
4497function WriteReq(chunk, encoding, cb) {
4498 this.chunk = chunk;
4499 this.encoding = encoding;
4500 this.callback = cb;
4501 this.next = null;
4502}
4503
4504function WritableState(options, stream) {
4505 Duplex = Duplex || require('./_stream_duplex');
4506
4507 options = options || {};
4508
4509 // object stream flag to indicate whether or not this stream
4510 // contains buffers or objects.
4511 this.objectMode = !!options.objectMode;
4512
4513 if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
4514
4515 // the point at which write() starts returning false
4516 // Note: 0 is a valid value, means that we always return false if
4517 // the entire buffer is not flushed immediately on write()
4518 var hwm = options.highWaterMark;
4519 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
4520 this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
4521
4522 // cast to ints.
4523 this.highWaterMark = ~~this.highWaterMark;
4524
4525 // drain event flag.
4526 this.needDrain = false;
4527 // at the start of calling end()
4528 this.ending = false;
4529 // when end() has been called, and returned
4530 this.ended = false;
4531 // when 'finish' is emitted
4532 this.finished = false;
4533
4534 // should we decode strings into buffers before passing to _write?
4535 // this is here so that some node-core streams can optimize string
4536 // handling at a lower level.
4537 var noDecode = options.decodeStrings === false;
4538 this.decodeStrings = !noDecode;
4539
4540 // Crypto is kind of old and crusty. Historically, its default string
4541 // encoding is 'binary' so we have to make this configurable.
4542 // Everything else in the universe uses 'utf8', though.
4543 this.defaultEncoding = options.defaultEncoding || 'utf8';
4544
4545 // not an actual buffer we keep track of, but a measurement
4546 // of how much we're waiting to get pushed to some underlying
4547 // socket or file.
4548 this.length = 0;
4549
4550 // a flag to see when we're in the middle of a write.
4551 this.writing = false;
4552
4553 // when true all writes will be buffered until .uncork() call
4554 this.corked = 0;
4555
4556 // a flag to be able to tell if the onwrite cb is called immediately,
4557 // or on a later tick. We set this to true at first, because any
4558 // actions that shouldn't happen until "later" should generally also
4559 // not happen before the first write call.
4560 this.sync = true;
4561
4562 // a flag to know if we're processing previously buffered items, which
4563 // may call the _write() callback in the same tick, so that we don't
4564 // end up in an overlapped onwrite situation.
4565 this.bufferProcessing = false;
4566
4567 // the callback that's passed to _write(chunk,cb)
4568 this.onwrite = function (er) {
4569 onwrite(stream, er);
4570 };
4571
4572 // the callback that the user supplies to write(chunk,encoding,cb)
4573 this.writecb = null;
4574
4575 // the amount that is being written when _write is called.
4576 this.writelen = 0;
4577
4578 this.bufferedRequest = null;
4579 this.lastBufferedRequest = null;
4580
4581 // number of pending user-supplied write callbacks
4582 // this must be 0 before 'finish' can be emitted
4583 this.pendingcb = 0;
4584
4585 // emit prefinish if the only thing we're waiting for is _write cbs
4586 // This is relevant for synchronous Transform streams
4587 this.prefinished = false;
4588
4589 // True if the error was already emitted and should not be thrown again
4590 this.errorEmitted = false;
4591
4592 // count buffered requests
4593 this.bufferedRequestCount = 0;
4594
4595 // allocate the first CorkedRequest, there is always
4596 // one allocated and free to use, and we maintain at most two
4597 this.corkedRequestsFree = new CorkedRequest(this);
4598}
4599
4600WritableState.prototype.getBuffer = function getBuffer() {
4601 var current = this.bufferedRequest;
4602 var out = [];
4603 while (current) {
4604 out.push(current);
4605 current = current.next;
4606 }
4607 return out;
4608};
4609
4610(function () {
4611 try {
4612 Object.defineProperty(WritableState.prototype, 'buffer', {
4613 get: internalUtil.deprecate(function () {
4614 return this.getBuffer();
4615 }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
4616 });
4617 } catch (_) {}
4618})();
4619
4620// Test _writableState for inheritance to account for Duplex streams,
4621// whose prototype chain only points to Readable.
4622var realHasInstance;
4623if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
4624 realHasInstance = Function.prototype[Symbol.hasInstance];
4625 Object.defineProperty(Writable, Symbol.hasInstance, {
4626 value: function (object) {
4627 if (realHasInstance.call(this, object)) return true;
4628
4629 return object && object._writableState instanceof WritableState;
4630 }
4631 });
4632} else {
4633 realHasInstance = function (object) {
4634 return object instanceof this;
4635 };
4636}
4637
4638function Writable(options) {
4639 Duplex = Duplex || require('./_stream_duplex');
4640
4641 // Writable ctor is applied to Duplexes, too.
4642 // `realHasInstance` is necessary because using plain `instanceof`
4643 // would return false, as no `_writableState` property is attached.
4644
4645 // Trying to use the custom `instanceof` for Writable here will also break the
4646 // Node.js LazyTransform implementation, which has a non-trivial getter for
4647 // `_writableState` that would lead to infinite recursion.
4648 if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
4649 return new Writable(options);
4650 }
4651
4652 this._writableState = new WritableState(options, this);
4653
4654 // legacy.
4655 this.writable = true;
4656
4657 if (options) {
4658 if (typeof options.write === 'function') this._write = options.write;
4659
4660 if (typeof options.writev === 'function') this._writev = options.writev;
4661 }
4662
4663 Stream.call(this);
4664}
4665
4666// Otherwise people can pipe Writable streams, which is just wrong.
4667Writable.prototype.pipe = function () {
4668 this.emit('error', new Error('Cannot pipe, not readable'));
4669};
4670
4671function writeAfterEnd(stream, cb) {
4672 var er = new Error('write after end');
4673 // TODO: defer error events consistently everywhere, not just the cb
4674 stream.emit('error', er);
4675 processNextTick(cb, er);
4676}
4677
4678// Checks that a user-supplied chunk is valid, especially for the particular
4679// mode the stream is in. Currently this means that `null` is never accepted
4680// and undefined/non-string values are only allowed in object mode.
4681function validChunk(stream, state, chunk, cb) {
4682 var valid = true;
4683 var er = false;
4684
4685 if (chunk === null) {
4686 er = new TypeError('May not write null values to stream');
4687 } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
4688 er = new TypeError('Invalid non-string/buffer chunk');
4689 }
4690 if (er) {
4691 stream.emit('error', er);
4692 processNextTick(cb, er);
4693 valid = false;
4694 }
4695 return valid;
4696}
4697
4698Writable.prototype.write = function (chunk, encoding, cb) {
4699 var state = this._writableState;
4700 var ret = false;
4701 var isBuf = Buffer.isBuffer(chunk);
4702
4703 if (typeof encoding === 'function') {
4704 cb = encoding;
4705 encoding = null;
4706 }
4707
4708 if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
4709
4710 if (typeof cb !== 'function') cb = nop;
4711
4712 if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
4713 state.pendingcb++;
4714 ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
4715 }
4716
4717 return ret;
4718};
4719
4720Writable.prototype.cork = function () {
4721 var state = this._writableState;
4722
4723 state.corked++;
4724};
4725
4726Writable.prototype.uncork = function () {
4727 var state = this._writableState;
4728
4729 if (state.corked) {
4730 state.corked--;
4731
4732 if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
4733 }
4734};
4735
4736Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
4737 // node::ParseEncoding() requires lower case.
4738 if (typeof encoding === 'string') encoding = encoding.toLowerCase();
4739 if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
4740 this._writableState.defaultEncoding = encoding;
4741 return this;
4742};
4743
4744function decodeChunk(state, chunk, encoding) {
4745 if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
4746 chunk = bufferShim.from(chunk, encoding);
4747 }
4748 return chunk;
4749}
4750
4751// if we're already writing something, then just put this
4752// in the queue, and wait our turn. Otherwise, call _write
4753// If we return false, then we need a drain event, so set that flag.
4754function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
4755 if (!isBuf) {
4756 chunk = decodeChunk(state, chunk, encoding);
4757 if (Buffer.isBuffer(chunk)) encoding = 'buffer';
4758 }
4759 var len = state.objectMode ? 1 : chunk.length;
4760
4761 state.length += len;
4762
4763 var ret = state.length < state.highWaterMark;
4764 // we must ensure that previous needDrain will not be reset to false.
4765 if (!ret) state.needDrain = true;
4766
4767 if (state.writing || state.corked) {
4768 var last = state.lastBufferedRequest;
4769 state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
4770 if (last) {
4771 last.next = state.lastBufferedRequest;
4772 } else {
4773 state.bufferedRequest = state.lastBufferedRequest;
4774 }
4775 state.bufferedRequestCount += 1;
4776 } else {
4777 doWrite(stream, state, false, len, chunk, encoding, cb);
4778 }
4779
4780 return ret;
4781}
4782
4783function doWrite(stream, state, writev, len, chunk, encoding, cb) {
4784 state.writelen = len;
4785 state.writecb = cb;
4786 state.writing = true;
4787 state.sync = true;
4788 if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
4789 state.sync = false;
4790}
4791
4792function onwriteError(stream, state, sync, er, cb) {
4793 --state.pendingcb;
4794 if (sync) processNextTick(cb, er);else cb(er);
4795
4796 stream._writableState.errorEmitted = true;
4797 stream.emit('error', er);
4798}
4799
4800function onwriteStateUpdate(state) {
4801 state.writing = false;
4802 state.writecb = null;
4803 state.length -= state.writelen;
4804 state.writelen = 0;
4805}
4806
4807function onwrite(stream, er) {
4808 var state = stream._writableState;
4809 var sync = state.sync;
4810 var cb = state.writecb;
4811
4812 onwriteStateUpdate(state);
4813
4814 if (er) onwriteError(stream, state, sync, er, cb);else {
4815 // Check if we're actually ready to finish, but don't emit yet
4816 var finished = needFinish(state);
4817
4818 if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
4819 clearBuffer(stream, state);
4820 }
4821
4822 if (sync) {
4823 /*<replacement>*/
4824 asyncWrite(afterWrite, stream, state, finished, cb);
4825 /*</replacement>*/
4826 } else {
4827 afterWrite(stream, state, finished, cb);
4828 }
4829 }
4830}
4831
4832function afterWrite(stream, state, finished, cb) {
4833 if (!finished) onwriteDrain(stream, state);
4834 state.pendingcb--;
4835 cb();
4836 finishMaybe(stream, state);
4837}
4838
4839// Must force callback to be called on nextTick, so that we don't
4840// emit 'drain' before the write() consumer gets the 'false' return
4841// value, and has a chance to attach a 'drain' listener.
4842function onwriteDrain(stream, state) {
4843 if (state.length === 0 && state.needDrain) {
4844 state.needDrain = false;
4845 stream.emit('drain');
4846 }
4847}
4848
4849// if there's something in the buffer waiting, then process it
4850function clearBuffer(stream, state) {
4851 state.bufferProcessing = true;
4852 var entry = state.bufferedRequest;
4853
4854 if (stream._writev && entry && entry.next) {
4855 // Fast case, write everything using _writev()
4856 var l = state.bufferedRequestCount;
4857 var buffer = new Array(l);
4858 var holder = state.corkedRequestsFree;
4859 holder.entry = entry;
4860
4861 var count = 0;
4862 while (entry) {
4863 buffer[count] = entry;
4864 entry = entry.next;
4865 count += 1;
4866 }
4867
4868 doWrite(stream, state, true, state.length, buffer, '', holder.finish);
4869
4870 // doWrite is almost always async, defer these to save a bit of time
4871 // as the hot path ends with doWrite
4872 state.pendingcb++;
4873 state.lastBufferedRequest = null;
4874 if (holder.next) {
4875 state.corkedRequestsFree = holder.next;
4876 holder.next = null;
4877 } else {
4878 state.corkedRequestsFree = new CorkedRequest(state);
4879 }
4880 } else {
4881 // Slow case, write chunks one-by-one
4882 while (entry) {
4883 var chunk = entry.chunk;
4884 var encoding = entry.encoding;
4885 var cb = entry.callback;
4886 var len = state.objectMode ? 1 : chunk.length;
4887
4888 doWrite(stream, state, false, len, chunk, encoding, cb);
4889 entry = entry.next;
4890 // if we didn't call the onwrite immediately, then
4891 // it means that we need to wait until it does.
4892 // also, that means that the chunk and cb are currently
4893 // being processed, so move the buffer counter past them.
4894 if (state.writing) {
4895 break;
4896 }
4897 }
4898
4899 if (entry === null) state.lastBufferedRequest = null;
4900 }
4901
4902 state.bufferedRequestCount = 0;
4903 state.bufferedRequest = entry;
4904 state.bufferProcessing = false;
4905}
4906
4907Writable.prototype._write = function (chunk, encoding, cb) {
4908 cb(new Error('_write() is not implemented'));
4909};
4910
4911Writable.prototype._writev = null;
4912
4913Writable.prototype.end = function (chunk, encoding, cb) {
4914 var state = this._writableState;
4915
4916 if (typeof chunk === 'function') {
4917 cb = chunk;
4918 chunk = null;
4919 encoding = null;
4920 } else if (typeof encoding === 'function') {
4921 cb = encoding;
4922 encoding = null;
4923 }
4924
4925 if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
4926
4927 // .end() fully uncorks
4928 if (state.corked) {
4929 state.corked = 1;
4930 this.uncork();
4931 }
4932
4933 // ignore unnecessary end() calls.
4934 if (!state.ending && !state.finished) endWritable(this, state, cb);
4935};
4936
4937function needFinish(state) {
4938 return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
4939}
4940
4941function prefinish(stream, state) {
4942 if (!state.prefinished) {
4943 state.prefinished = true;
4944 stream.emit('prefinish');
4945 }
4946}
4947
4948function finishMaybe(stream, state) {
4949 var need = needFinish(state);
4950 if (need) {
4951 if (state.pendingcb === 0) {
4952 prefinish(stream, state);
4953 state.finished = true;
4954 stream.emit('finish');
4955 } else {
4956 prefinish(stream, state);
4957 }
4958 }
4959 return need;
4960}
4961
4962function endWritable(stream, state, cb) {
4963 state.ending = true;
4964 finishMaybe(stream, state);
4965 if (cb) {
4966 if (state.finished) processNextTick(cb);else stream.once('finish', cb);
4967 }
4968 state.ended = true;
4969 stream.writable = false;
4970}
4971
4972// It seems a linked list but it is not
4973// there will be only 2 of these for each stream
4974function CorkedRequest(state) {
4975 var _this = this;
4976
4977 this.next = null;
4978 this.entry = null;
4979 this.finish = function (err) {
4980 var entry = _this.entry;
4981 _this.entry = null;
4982 while (entry) {
4983 var cb = entry.callback;
4984 state.pendingcb--;
4985 cb(err);
4986 entry = entry.next;
4987 }
4988 if (state.corkedRequestsFree) {
4989 state.corkedRequestsFree.next = _this;
4990 } else {
4991 state.corkedRequestsFree = _this;
4992 }
4993 };
4994}
4995}).call(this,require('_process'))
4996},{"./_stream_duplex":15,"./internal/streams/stream":21,"_process":13,"buffer":5,"buffer-shims":4,"core-util-is":6,"inherits":9,"process-nextick-args":12,"util-deprecate":30}],20:[function(require,module,exports){
4997'use strict';
4998
4999var Buffer = require('buffer').Buffer;
5000/*<replacement>*/
5001var bufferShim = require('buffer-shims');
5002/*</replacement>*/
5003
5004module.exports = BufferList;
5005
5006function BufferList() {
5007 this.head = null;
5008 this.tail = null;
5009 this.length = 0;
5010}
5011
5012BufferList.prototype.push = function (v) {
5013 var entry = { data: v, next: null };
5014 if (this.length > 0) this.tail.next = entry;else this.head = entry;
5015 this.tail = entry;
5016 ++this.length;
5017};
5018
5019BufferList.prototype.unshift = function (v) {
5020 var entry = { data: v, next: this.head };
5021 if (this.length === 0) this.tail = entry;
5022 this.head = entry;
5023 ++this.length;
5024};
5025
5026BufferList.prototype.shift = function () {
5027 if (this.length === 0) return;
5028 var ret = this.head.data;
5029 if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
5030 --this.length;
5031 return ret;
5032};
5033
5034BufferList.prototype.clear = function () {
5035 this.head = this.tail = null;
5036 this.length = 0;
5037};
5038
5039BufferList.prototype.join = function (s) {
5040 if (this.length === 0) return '';
5041 var p = this.head;
5042 var ret = '' + p.data;
5043 while (p = p.next) {
5044 ret += s + p.data;
5045 }return ret;
5046};
5047
5048BufferList.prototype.concat = function (n) {
5049 if (this.length === 0) return bufferShim.alloc(0);
5050 if (this.length === 1) return this.head.data;
5051 var ret = bufferShim.allocUnsafe(n >>> 0);
5052 var p = this.head;
5053 var i = 0;
5054 while (p) {
5055 p.data.copy(ret, i);
5056 i += p.data.length;
5057 p = p.next;
5058 }
5059 return ret;
5060};
5061},{"buffer":5,"buffer-shims":4}],21:[function(require,module,exports){
5062module.exports = require('events').EventEmitter;
5063
5064},{"events":7}],22:[function(require,module,exports){
5065'use strict';
5066
5067var Buffer = require('safe-buffer').Buffer;
5068
5069var isEncoding = Buffer.isEncoding || function (encoding) {
5070 encoding = '' + encoding;
5071 switch (encoding && encoding.toLowerCase()) {
5072 case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
5073 return true;
5074 default:
5075 return false;
5076 }
5077};
5078
5079function _normalizeEncoding(enc) {
5080 if (!enc) return 'utf8';
5081 var retried;
5082 while (true) {
5083 switch (enc) {
5084 case 'utf8':
5085 case 'utf-8':
5086 return 'utf8';
5087 case 'ucs2':
5088 case 'ucs-2':
5089 case 'utf16le':
5090 case 'utf-16le':
5091 return 'utf16le';
5092 case 'latin1':
5093 case 'binary':
5094 return 'latin1';
5095 case 'base64':
5096 case 'ascii':
5097 case 'hex':
5098 return enc;
5099 default:
5100 if (retried) return; // undefined
5101 enc = ('' + enc).toLowerCase();
5102 retried = true;
5103 }
5104 }
5105};
5106
5107// Do not cache `Buffer.isEncoding` when checking encoding names as some
5108// modules monkey-patch it to support additional encodings
5109function normalizeEncoding(enc) {
5110 var nenc = _normalizeEncoding(enc);
5111 if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
5112 return nenc || enc;
5113}
5114
5115// StringDecoder provides an interface for efficiently splitting a series of
5116// buffers into a series of JS strings without breaking apart multi-byte
5117// characters.
5118exports.StringDecoder = StringDecoder;
5119function StringDecoder(encoding) {
5120 this.encoding = normalizeEncoding(encoding);
5121 var nb;
5122 switch (this.encoding) {
5123 case 'utf16le':
5124 this.text = utf16Text;
5125 this.end = utf16End;
5126 nb = 4;
5127 break;
5128 case 'utf8':
5129 this.fillLast = utf8FillLast;
5130 nb = 4;
5131 break;
5132 case 'base64':
5133 this.text = base64Text;
5134 this.end = base64End;
5135 nb = 3;
5136 break;
5137 default:
5138 this.write = simpleWrite;
5139 this.end = simpleEnd;
5140 return;
5141 }
5142 this.lastNeed = 0;
5143 this.lastTotal = 0;
5144 this.lastChar = Buffer.allocUnsafe(nb);
5145}
5146
5147StringDecoder.prototype.write = function (buf) {
5148 if (buf.length === 0) return '';
5149 var r;
5150 var i;
5151 if (this.lastNeed) {
5152 r = this.fillLast(buf);
5153 if (r === undefined) return '';
5154 i = this.lastNeed;
5155 this.lastNeed = 0;
5156 } else {
5157 i = 0;
5158 }
5159 if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
5160 return r || '';
5161};
5162
5163StringDecoder.prototype.end = utf8End;
5164
5165// Returns only complete characters in a Buffer
5166StringDecoder.prototype.text = utf8Text;
5167
5168// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
5169StringDecoder.prototype.fillLast = function (buf) {
5170 if (this.lastNeed <= buf.length) {
5171 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
5172 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
5173 }
5174 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
5175 this.lastNeed -= buf.length;
5176};
5177
5178// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
5179// continuation byte.
5180function utf8CheckByte(byte) {
5181 if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
5182 return -1;
5183}
5184
5185// Checks at most 3 bytes at the end of a Buffer in order to detect an
5186// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
5187// needed to complete the UTF-8 character (if applicable) are returned.
5188function utf8CheckIncomplete(self, buf, i) {
5189 var j = buf.length - 1;
5190 if (j < i) return 0;
5191 var nb = utf8CheckByte(buf[j]);
5192 if (nb >= 0) {
5193 if (nb > 0) self.lastNeed = nb - 1;
5194 return nb;
5195 }
5196 if (--j < i) return 0;
5197 nb = utf8CheckByte(buf[j]);
5198 if (nb >= 0) {
5199 if (nb > 0) self.lastNeed = nb - 2;
5200 return nb;
5201 }
5202 if (--j < i) return 0;
5203 nb = utf8CheckByte(buf[j]);
5204 if (nb >= 0) {
5205 if (nb > 0) {
5206 if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
5207 }
5208 return nb;
5209 }
5210 return 0;
5211}
5212
5213// Validates as many continuation bytes for a multi-byte UTF-8 character as
5214// needed or are available. If we see a non-continuation byte where we expect
5215// one, we "replace" the validated continuation bytes we've seen so far with
5216// UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding
5217// behavior. The continuation byte check is included three times in the case
5218// where all of the continuation bytes for a character exist in the same buffer.
5219// It is also done this way as a slight performance increase instead of using a
5220// loop.
5221function utf8CheckExtraBytes(self, buf, p) {
5222 if ((buf[0] & 0xC0) !== 0x80) {
5223 self.lastNeed = 0;
5224 return '\ufffd'.repeat(p);
5225 }
5226 if (self.lastNeed > 1 && buf.length > 1) {
5227 if ((buf[1] & 0xC0) !== 0x80) {
5228 self.lastNeed = 1;
5229 return '\ufffd'.repeat(p + 1);
5230 }
5231 if (self.lastNeed > 2 && buf.length > 2) {
5232 if ((buf[2] & 0xC0) !== 0x80) {
5233 self.lastNeed = 2;
5234 return '\ufffd'.repeat(p + 2);
5235 }
5236 }
5237 }
5238}
5239
5240// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
5241function utf8FillLast(buf) {
5242 var p = this.lastTotal - this.lastNeed;
5243 var r = utf8CheckExtraBytes(this, buf, p);
5244 if (r !== undefined) return r;
5245 if (this.lastNeed <= buf.length) {
5246 buf.copy(this.lastChar, p, 0, this.lastNeed);
5247 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
5248 }
5249 buf.copy(this.lastChar, p, 0, buf.length);
5250 this.lastNeed -= buf.length;
5251}
5252
5253// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
5254// partial character, the character's bytes are buffered until the required
5255// number of bytes are available.
5256function utf8Text(buf, i) {
5257 var total = utf8CheckIncomplete(this, buf, i);
5258 if (!this.lastNeed) return buf.toString('utf8', i);
5259 this.lastTotal = total;
5260 var end = buf.length - (total - this.lastNeed);
5261 buf.copy(this.lastChar, 0, end);
5262 return buf.toString('utf8', i, end);
5263}
5264
5265// For UTF-8, a replacement character for each buffered byte of a (partial)
5266// character needs to be added to the output.
5267function utf8End(buf) {
5268 var r = buf && buf.length ? this.write(buf) : '';
5269 if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed);
5270 return r;
5271}
5272
5273// UTF-16LE typically needs two bytes per character, but even if we have an even
5274// number of bytes available, we need to check if we end on a leading/high
5275// surrogate. In that case, we need to wait for the next two bytes in order to
5276// decode the last character properly.
5277function utf16Text(buf, i) {
5278 if ((buf.length - i) % 2 === 0) {
5279 var r = buf.toString('utf16le', i);
5280 if (r) {
5281 var c = r.charCodeAt(r.length - 1);
5282 if (c >= 0xD800 && c <= 0xDBFF) {
5283 this.lastNeed = 2;
5284 this.lastTotal = 4;
5285 this.lastChar[0] = buf[buf.length - 2];
5286 this.lastChar[1] = buf[buf.length - 1];
5287 return r.slice(0, -1);
5288 }
5289 }
5290 return r;
5291 }
5292 this.lastNeed = 1;
5293 this.lastTotal = 2;
5294 this.lastChar[0] = buf[buf.length - 1];
5295 return buf.toString('utf16le', i, buf.length - 1);
5296}
5297
5298// For UTF-16LE we do not explicitly append special replacement characters if we
5299// end on a partial character, we simply let v8 handle that.
5300function utf16End(buf) {
5301 var r = buf && buf.length ? this.write(buf) : '';
5302 if (this.lastNeed) {
5303 var end = this.lastTotal - this.lastNeed;
5304 return r + this.lastChar.toString('utf16le', 0, end);
5305 }
5306 return r;
5307}
5308
5309function base64Text(buf, i) {
5310 var n = (buf.length - i) % 3;
5311 if (n === 0) return buf.toString('base64', i);
5312 this.lastNeed = 3 - n;
5313 this.lastTotal = 3;
5314 if (n === 1) {
5315 this.lastChar[0] = buf[buf.length - 1];
5316 } else {
5317 this.lastChar[0] = buf[buf.length - 2];
5318 this.lastChar[1] = buf[buf.length - 1];
5319 }
5320 return buf.toString('base64', i, buf.length - n);
5321}
5322
5323function base64End(buf) {
5324 var r = buf && buf.length ? this.write(buf) : '';
5325 if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
5326 return r;
5327}
5328
5329// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
5330function simpleWrite(buf) {
5331 return buf.toString(this.encoding);
5332}
5333
5334function simpleEnd(buf) {
5335 return buf && buf.length ? this.write(buf) : '';
5336}
5337},{"safe-buffer":27}],23:[function(require,module,exports){
5338module.exports = require('./readable').PassThrough
5339
5340},{"./readable":24}],24:[function(require,module,exports){
5341exports = module.exports = require('./lib/_stream_readable.js');
5342exports.Stream = exports;
5343exports.Readable = exports;
5344exports.Writable = require('./lib/_stream_writable.js');
5345exports.Duplex = require('./lib/_stream_duplex.js');
5346exports.Transform = require('./lib/_stream_transform.js');
5347exports.PassThrough = require('./lib/_stream_passthrough.js');
5348
5349},{"./lib/_stream_duplex.js":15,"./lib/_stream_passthrough.js":16,"./lib/_stream_readable.js":17,"./lib/_stream_transform.js":18,"./lib/_stream_writable.js":19}],25:[function(require,module,exports){
5350module.exports = require('./readable').Transform
5351
5352},{"./readable":24}],26:[function(require,module,exports){
5353module.exports = require('./lib/_stream_writable.js');
5354
5355},{"./lib/_stream_writable.js":19}],27:[function(require,module,exports){
5356module.exports = require('buffer')
5357
5358},{"buffer":5}],28:[function(require,module,exports){
5359// Copyright Joyent, Inc. and other Node contributors.
5360//
5361// Permission is hereby granted, free of charge, to any person obtaining a
5362// copy of this software and associated documentation files (the
5363// "Software"), to deal in the Software without restriction, including
5364// without limitation the rights to use, copy, modify, merge, publish,
5365// distribute, sublicense, and/or sell copies of the Software, and to permit
5366// persons to whom the Software is furnished to do so, subject to the
5367// following conditions:
5368//
5369// The above copyright notice and this permission notice shall be included
5370// in all copies or substantial portions of the Software.
5371//
5372// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5373// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5374// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5375// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5376// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5377// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5378// USE OR OTHER DEALINGS IN THE SOFTWARE.
5379
5380module.exports = Stream;
5381
5382var EE = require('events').EventEmitter;
5383var inherits = require('inherits');
5384
5385inherits(Stream, EE);
5386Stream.Readable = require('readable-stream/readable.js');
5387Stream.Writable = require('readable-stream/writable.js');
5388Stream.Duplex = require('readable-stream/duplex.js');
5389Stream.Transform = require('readable-stream/transform.js');
5390Stream.PassThrough = require('readable-stream/passthrough.js');
5391
5392// Backwards-compat with node 0.4.x
5393Stream.Stream = Stream;
5394
5395
5396
5397// old-style streams. Note that the pipe method (the only relevant
5398// part of this class) is overridden in the Readable class.
5399
5400function Stream() {
5401 EE.call(this);
5402}
5403
5404Stream.prototype.pipe = function(dest, options) {
5405 var source = this;
5406
5407 function ondata(chunk) {
5408 if (dest.writable) {
5409 if (false === dest.write(chunk) && source.pause) {
5410 source.pause();
5411 }
5412 }
5413 }
5414
5415 source.on('data', ondata);
5416
5417 function ondrain() {
5418 if (source.readable && source.resume) {
5419 source.resume();
5420 }
5421 }
5422
5423 dest.on('drain', ondrain);
5424
5425 // If the 'end' option is not supplied, dest.end() will be called when
5426 // source gets the 'end' or 'close' events. Only dest.end() once.
5427 if (!dest._isStdio && (!options || options.end !== false)) {
5428 source.on('end', onend);
5429 source.on('close', onclose);
5430 }
5431
5432 var didOnEnd = false;
5433 function onend() {
5434 if (didOnEnd) return;
5435 didOnEnd = true;
5436
5437 dest.end();
5438 }
5439
5440
5441 function onclose() {
5442 if (didOnEnd) return;
5443 didOnEnd = true;
5444
5445 if (typeof dest.destroy === 'function') dest.destroy();
5446 }
5447
5448 // don't leave dangling pipes when there are errors.
5449 function onerror(er) {
5450 cleanup();
5451 if (EE.listenerCount(this, 'error') === 0) {
5452 throw er; // Unhandled stream error in pipe.
5453 }
5454 }
5455
5456 source.on('error', onerror);
5457 dest.on('error', onerror);
5458
5459 // remove all the event listeners that were added.
5460 function cleanup() {
5461 source.removeListener('data', ondata);
5462 dest.removeListener('drain', ondrain);
5463
5464 source.removeListener('end', onend);
5465 source.removeListener('close', onclose);
5466
5467 source.removeListener('error', onerror);
5468 dest.removeListener('error', onerror);
5469
5470 source.removeListener('end', cleanup);
5471 source.removeListener('close', cleanup);
5472
5473 dest.removeListener('close', cleanup);
5474 }
5475
5476 source.on('end', cleanup);
5477 source.on('close', cleanup);
5478
5479 dest.on('close', cleanup);
5480
5481 dest.emit('pipe', source);
5482
5483 // Allow for unix-like usage: A.pipe(B).pipe(C)
5484 return dest;
5485};
5486
5487},{"events":7,"inherits":9,"readable-stream/duplex.js":14,"readable-stream/passthrough.js":23,"readable-stream/readable.js":24,"readable-stream/transform.js":25,"readable-stream/writable.js":26}],29:[function(require,module,exports){
5488// Copyright Joyent, Inc. and other Node contributors.
5489//
5490// Permission is hereby granted, free of charge, to any person obtaining a
5491// copy of this software and associated documentation files (the
5492// "Software"), to deal in the Software without restriction, including
5493// without limitation the rights to use, copy, modify, merge, publish,
5494// distribute, sublicense, and/or sell copies of the Software, and to permit
5495// persons to whom the Software is furnished to do so, subject to the
5496// following conditions:
5497//
5498// The above copyright notice and this permission notice shall be included
5499// in all copies or substantial portions of the Software.
5500//
5501// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5502// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5503// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5504// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5505// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5506// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5507// USE OR OTHER DEALINGS IN THE SOFTWARE.
5508
5509var Buffer = require('buffer').Buffer;
5510
5511var isBufferEncoding = Buffer.isEncoding
5512 || function(encoding) {
5513 switch (encoding && encoding.toLowerCase()) {
5514 case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
5515 default: return false;
5516 }
5517 }
5518
5519
5520function assertEncoding(encoding) {
5521 if (encoding && !isBufferEncoding(encoding)) {
5522 throw new Error('Unknown encoding: ' + encoding);
5523 }
5524}
5525
5526// StringDecoder provides an interface for efficiently splitting a series of
5527// buffers into a series of JS strings without breaking apart multi-byte
5528// characters. CESU-8 is handled as part of the UTF-8 encoding.
5529//
5530// @TODO Handling all encodings inside a single object makes it very difficult
5531// to reason about this code, so it should be split up in the future.
5532// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
5533// points as used by CESU-8.
5534var StringDecoder = exports.StringDecoder = function(encoding) {
5535 this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
5536 assertEncoding(encoding);
5537 switch (this.encoding) {
5538 case 'utf8':
5539 // CESU-8 represents each of Surrogate Pair by 3-bytes
5540 this.surrogateSize = 3;
5541 break;
5542 case 'ucs2':
5543 case 'utf16le':
5544 // UTF-16 represents each of Surrogate Pair by 2-bytes
5545 this.surrogateSize = 2;
5546 this.detectIncompleteChar = utf16DetectIncompleteChar;
5547 break;
5548 case 'base64':
5549 // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
5550 this.surrogateSize = 3;
5551 this.detectIncompleteChar = base64DetectIncompleteChar;
5552 break;
5553 default:
5554 this.write = passThroughWrite;
5555 return;
5556 }
5557
5558 // Enough space to store all bytes of a single character. UTF-8 needs 4
5559 // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
5560 this.charBuffer = new Buffer(6);
5561 // Number of bytes received for the current incomplete multi-byte character.
5562 this.charReceived = 0;
5563 // Number of bytes expected for the current incomplete multi-byte character.
5564 this.charLength = 0;
5565};
5566
5567
5568// write decodes the given buffer and returns it as JS string that is
5569// guaranteed to not contain any partial multi-byte characters. Any partial
5570// character found at the end of the buffer is buffered up, and will be
5571// returned when calling write again with the remaining bytes.
5572//
5573// Note: Converting a Buffer containing an orphan surrogate to a String
5574// currently works, but converting a String to a Buffer (via `new Buffer`, or
5575// Buffer#write) will replace incomplete surrogates with the unicode
5576// replacement character. See https://codereview.chromium.org/121173009/ .
5577StringDecoder.prototype.write = function(buffer) {
5578 var charStr = '';
5579 // if our last write ended with an incomplete multibyte character
5580 while (this.charLength) {
5581 // determine how many remaining bytes this buffer has to offer for this char
5582 var available = (buffer.length >= this.charLength - this.charReceived) ?
5583 this.charLength - this.charReceived :
5584 buffer.length;
5585
5586 // add the new bytes to the char buffer
5587 buffer.copy(this.charBuffer, this.charReceived, 0, available);
5588 this.charReceived += available;
5589
5590 if (this.charReceived < this.charLength) {
5591 // still not enough chars in this buffer? wait for more ...
5592 return '';
5593 }
5594
5595 // remove bytes belonging to the current character from the buffer
5596 buffer = buffer.slice(available, buffer.length);
5597
5598 // get the character that was split
5599 charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
5600
5601 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
5602 var charCode = charStr.charCodeAt(charStr.length - 1);
5603 if (charCode >= 0xD800 && charCode <= 0xDBFF) {
5604 this.charLength += this.surrogateSize;
5605 charStr = '';
5606 continue;
5607 }
5608 this.charReceived = this.charLength = 0;
5609
5610 // if there are no more bytes in this buffer, just emit our char
5611 if (buffer.length === 0) {
5612 return charStr;
5613 }
5614 break;
5615 }
5616
5617 // determine and set charLength / charReceived
5618 this.detectIncompleteChar(buffer);
5619
5620 var end = buffer.length;
5621 if (this.charLength) {
5622 // buffer the incomplete character bytes we got
5623 buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
5624 end -= this.charReceived;
5625 }
5626
5627 charStr += buffer.toString(this.encoding, 0, end);
5628
5629 var end = charStr.length - 1;
5630 var charCode = charStr.charCodeAt(end);
5631 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
5632 if (charCode >= 0xD800 && charCode <= 0xDBFF) {
5633 var size = this.surrogateSize;
5634 this.charLength += size;
5635 this.charReceived += size;
5636 this.charBuffer.copy(this.charBuffer, size, 0, size);
5637 buffer.copy(this.charBuffer, 0, 0, size);
5638 return charStr.substring(0, end);
5639 }
5640
5641 // or just emit the charStr
5642 return charStr;
5643};
5644
5645// detectIncompleteChar determines if there is an incomplete UTF-8 character at
5646// the end of the given buffer. If so, it sets this.charLength to the byte
5647// length that character, and sets this.charReceived to the number of bytes
5648// that are available for this character.
5649StringDecoder.prototype.detectIncompleteChar = function(buffer) {
5650 // determine how many bytes we have to check at the end of this buffer
5651 var i = (buffer.length >= 3) ? 3 : buffer.length;
5652
5653 // Figure out if one of the last i bytes of our buffer announces an
5654 // incomplete char.
5655 for (; i > 0; i--) {
5656 var c = buffer[buffer.length - i];
5657
5658 // See http://en.wikipedia.org/wiki/UTF-8#Description
5659
5660 // 110XXXXX
5661 if (i == 1 && c >> 5 == 0x06) {
5662 this.charLength = 2;
5663 break;
5664 }
5665
5666 // 1110XXXX
5667 if (i <= 2 && c >> 4 == 0x0E) {
5668 this.charLength = 3;
5669 break;
5670 }
5671
5672 // 11110XXX
5673 if (i <= 3 && c >> 3 == 0x1E) {
5674 this.charLength = 4;
5675 break;
5676 }
5677 }
5678 this.charReceived = i;
5679};
5680
5681StringDecoder.prototype.end = function(buffer) {
5682 var res = '';
5683 if (buffer && buffer.length)
5684 res = this.write(buffer);
5685
5686 if (this.charReceived) {
5687 var cr = this.charReceived;
5688 var buf = this.charBuffer;
5689 var enc = this.encoding;
5690 res += buf.slice(0, cr).toString(enc);
5691 }
5692
5693 return res;
5694};
5695
5696function passThroughWrite(buffer) {
5697 return buffer.toString(this.encoding);
5698}
5699
5700function utf16DetectIncompleteChar(buffer) {
5701 this.charReceived = buffer.length % 2;
5702 this.charLength = this.charReceived ? 2 : 0;
5703}
5704
5705function base64DetectIncompleteChar(buffer) {
5706 this.charReceived = buffer.length % 3;
5707 this.charLength = this.charReceived ? 3 : 0;
5708}
5709
5710},{"buffer":5}],30:[function(require,module,exports){
5711(function (global){
5712
5713/**
5714 * Module exports.
5715 */
5716
5717module.exports = deprecate;
5718
5719/**
5720 * Mark that a method should not be used.
5721 * Returns a modified function which warns once by default.
5722 *
5723 * If `localStorage.noDeprecation = true` is set, then it is a no-op.
5724 *
5725 * If `localStorage.throwDeprecation = true` is set, then deprecated functions
5726 * will throw an Error when invoked.
5727 *
5728 * If `localStorage.traceDeprecation = true` is set, then deprecated functions
5729 * will invoke `console.trace()` instead of `console.error()`.
5730 *
5731 * @param {Function} fn - the function to deprecate
5732 * @param {String} msg - the string to print to the console when `fn` is invoked
5733 * @returns {Function} a new "deprecated" version of `fn`
5734 * @api public
5735 */
5736
5737function deprecate (fn, msg) {
5738 if (config('noDeprecation')) {
5739 return fn;
5740 }
5741
5742 var warned = false;
5743 function deprecated() {
5744 if (!warned) {
5745 if (config('throwDeprecation')) {
5746 throw new Error(msg);
5747 } else if (config('traceDeprecation')) {
5748 console.trace(msg);
5749 } else {
5750 console.warn(msg);
5751 }
5752 warned = true;
5753 }
5754 return fn.apply(this, arguments);
5755 }
5756
5757 return deprecated;
5758}
5759
5760/**
5761 * Checks `localStorage` for boolean values for the given `name`.
5762 *
5763 * @param {String} name
5764 * @returns {Boolean}
5765 * @api private
5766 */
5767
5768function config (name) {
5769 // accessing global.localStorage can trigger a DOMException in sandboxed iframes
5770 try {
5771 if (!global.localStorage) return false;
5772 } catch (_) {
5773 return false;
5774 }
5775 var val = global.localStorage[name];
5776 if (null == val) return false;
5777 return String(val).toLowerCase() === 'true';
5778}
5779
5780}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
5781},{}],31:[function(require,module,exports){
5782arguments[4][9][0].apply(exports,arguments)
5783},{"dup":9}],32:[function(require,module,exports){
5784module.exports = function isBuffer(arg) {
5785 return arg && typeof arg === 'object'
5786 && typeof arg.copy === 'function'
5787 && typeof arg.fill === 'function'
5788 && typeof arg.readUInt8 === 'function';
5789}
5790},{}],33:[function(require,module,exports){
5791(function (process,global){
5792// Copyright Joyent, Inc. and other Node contributors.
5793//
5794// Permission is hereby granted, free of charge, to any person obtaining a
5795// copy of this software and associated documentation files (the
5796// "Software"), to deal in the Software without restriction, including
5797// without limitation the rights to use, copy, modify, merge, publish,
5798// distribute, sublicense, and/or sell copies of the Software, and to permit
5799// persons to whom the Software is furnished to do so, subject to the
5800// following conditions:
5801//
5802// The above copyright notice and this permission notice shall be included
5803// in all copies or substantial portions of the Software.
5804//
5805// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5806// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5807// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5808// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5809// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5810// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5811// USE OR OTHER DEALINGS IN THE SOFTWARE.
5812
5813var formatRegExp = /%[sdj%]/g;
5814exports.format = function(f) {
5815 if (!isString(f)) {
5816 var objects = [];
5817 for (var i = 0; i < arguments.length; i++) {
5818 objects.push(inspect(arguments[i]));
5819 }
5820 return objects.join(' ');
5821 }
5822
5823 var i = 1;
5824 var args = arguments;
5825 var len = args.length;
5826 var str = String(f).replace(formatRegExp, function(x) {
5827 if (x === '%%') return '%';
5828 if (i >= len) return x;
5829 switch (x) {
5830 case '%s': return String(args[i++]);
5831 case '%d': return Number(args[i++]);
5832 case '%j':
5833 try {
5834 return JSON.stringify(args[i++]);
5835 } catch (_) {
5836 return '[Circular]';
5837 }
5838 default:
5839 return x;
5840 }
5841 });
5842 for (var x = args[i]; i < len; x = args[++i]) {
5843 if (isNull(x) || !isObject(x)) {
5844 str += ' ' + x;
5845 } else {
5846 str += ' ' + inspect(x);
5847 }
5848 }
5849 return str;
5850};
5851
5852
5853// Mark that a method should not be used.
5854// Returns a modified function which warns once by default.
5855// If --no-deprecation is set, then it is a no-op.
5856exports.deprecate = function(fn, msg) {
5857 // Allow for deprecating things in the process of starting up.
5858 if (isUndefined(global.process)) {
5859 return function() {
5860 return exports.deprecate(fn, msg).apply(this, arguments);
5861 };
5862 }
5863
5864 if (process.noDeprecation === true) {
5865 return fn;
5866 }
5867
5868 var warned = false;
5869 function deprecated() {
5870 if (!warned) {
5871 if (process.throwDeprecation) {
5872 throw new Error(msg);
5873 } else if (process.traceDeprecation) {
5874 console.trace(msg);
5875 } else {
5876 console.error(msg);
5877 }
5878 warned = true;
5879 }
5880 return fn.apply(this, arguments);
5881 }
5882
5883 return deprecated;
5884};
5885
5886
5887var debugs = {};
5888var debugEnviron;
5889exports.debuglog = function(set) {
5890 if (isUndefined(debugEnviron))
5891 debugEnviron = process.env.NODE_DEBUG || '';
5892 set = set.toUpperCase();
5893 if (!debugs[set]) {
5894 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
5895 var pid = process.pid;
5896 debugs[set] = function() {
5897 var msg = exports.format.apply(exports, arguments);
5898 console.error('%s %d: %s', set, pid, msg);
5899 };
5900 } else {
5901 debugs[set] = function() {};
5902 }
5903 }
5904 return debugs[set];
5905};
5906
5907
5908/**
5909 * Echos the value of a value. Trys to print the value out
5910 * in the best way possible given the different types.
5911 *
5912 * @param {Object} obj The object to print out.
5913 * @param {Object} opts Optional options object that alters the output.
5914 */
5915/* legacy: obj, showHidden, depth, colors*/
5916function inspect(obj, opts) {
5917 // default options
5918 var ctx = {
5919 seen: [],
5920 stylize: stylizeNoColor
5921 };
5922 // legacy...
5923 if (arguments.length >= 3) ctx.depth = arguments[2];
5924 if (arguments.length >= 4) ctx.colors = arguments[3];
5925 if (isBoolean(opts)) {
5926 // legacy...
5927 ctx.showHidden = opts;
5928 } else if (opts) {
5929 // got an "options" object
5930 exports._extend(ctx, opts);
5931 }
5932 // set default options
5933 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
5934 if (isUndefined(ctx.depth)) ctx.depth = 2;
5935 if (isUndefined(ctx.colors)) ctx.colors = false;
5936 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
5937 if (ctx.colors) ctx.stylize = stylizeWithColor;
5938 return formatValue(ctx, obj, ctx.depth);
5939}
5940exports.inspect = inspect;
5941
5942
5943// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
5944inspect.colors = {
5945 'bold' : [1, 22],
5946 'italic' : [3, 23],
5947 'underline' : [4, 24],
5948 'inverse' : [7, 27],
5949 'white' : [37, 39],
5950 'grey' : [90, 39],
5951 'black' : [30, 39],
5952 'blue' : [34, 39],
5953 'cyan' : [36, 39],
5954 'green' : [32, 39],
5955 'magenta' : [35, 39],
5956 'red' : [31, 39],
5957 'yellow' : [33, 39]
5958};
5959
5960// Don't use 'blue' not visible on cmd.exe
5961inspect.styles = {
5962 'special': 'cyan',
5963 'number': 'yellow',
5964 'boolean': 'yellow',
5965 'undefined': 'grey',
5966 'null': 'bold',
5967 'string': 'green',
5968 'date': 'magenta',
5969 // "name": intentionally not styling
5970 'regexp': 'red'
5971};
5972
5973
5974function stylizeWithColor(str, styleType) {
5975 var style = inspect.styles[styleType];
5976
5977 if (style) {
5978 return '\u001b[' + inspect.colors[style][0] + 'm' + str +
5979 '\u001b[' + inspect.colors[style][1] + 'm';
5980 } else {
5981 return str;
5982 }
5983}
5984
5985
5986function stylizeNoColor(str, styleType) {
5987 return str;
5988}
5989
5990
5991function arrayToHash(array) {
5992 var hash = {};
5993
5994 array.forEach(function(val, idx) {
5995 hash[val] = true;
5996 });
5997
5998 return hash;
5999}
6000
6001
6002function formatValue(ctx, value, recurseTimes) {
6003 // Provide a hook for user-specified inspect functions.
6004 // Check that value is an object with an inspect function on it
6005 if (ctx.customInspect &&
6006 value &&
6007 isFunction(value.inspect) &&
6008 // Filter out the util module, it's inspect function is special
6009 value.inspect !== exports.inspect &&
6010 // Also filter out any prototype objects using the circular check.
6011 !(value.constructor && value.constructor.prototype === value)) {
6012 var ret = value.inspect(recurseTimes, ctx);
6013 if (!isString(ret)) {
6014 ret = formatValue(ctx, ret, recurseTimes);
6015 }
6016 return ret;
6017 }
6018
6019 // Primitive types cannot have properties
6020 var primitive = formatPrimitive(ctx, value);
6021 if (primitive) {
6022 return primitive;
6023 }
6024
6025 // Look up the keys of the object.
6026 var keys = Object.keys(value);
6027 var visibleKeys = arrayToHash(keys);
6028
6029 if (ctx.showHidden) {
6030 keys = Object.getOwnPropertyNames(value);
6031 }
6032
6033 // IE doesn't make error fields non-enumerable
6034 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
6035 if (isError(value)
6036 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
6037 return formatError(value);
6038 }
6039
6040 // Some type of object without properties can be shortcutted.
6041 if (keys.length === 0) {
6042 if (isFunction(value)) {
6043 var name = value.name ? ': ' + value.name : '';
6044 return ctx.stylize('[Function' + name + ']', 'special');
6045 }
6046 if (isRegExp(value)) {
6047 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
6048 }
6049 if (isDate(value)) {
6050 return ctx.stylize(Date.prototype.toString.call(value), 'date');
6051 }
6052 if (isError(value)) {
6053 return formatError(value);
6054 }
6055 }
6056
6057 var base = '', array = false, braces = ['{', '}'];
6058
6059 // Make Array say that they are Array
6060 if (isArray(value)) {
6061 array = true;
6062 braces = ['[', ']'];
6063 }
6064
6065 // Make functions say that they are functions
6066 if (isFunction(value)) {
6067 var n = value.name ? ': ' + value.name : '';
6068 base = ' [Function' + n + ']';
6069 }
6070
6071 // Make RegExps say that they are RegExps
6072 if (isRegExp(value)) {
6073 base = ' ' + RegExp.prototype.toString.call(value);
6074 }
6075
6076 // Make dates with properties first say the date
6077 if (isDate(value)) {
6078 base = ' ' + Date.prototype.toUTCString.call(value);
6079 }
6080
6081 // Make error with message first say the error
6082 if (isError(value)) {
6083 base = ' ' + formatError(value);
6084 }
6085
6086 if (keys.length === 0 && (!array || value.length == 0)) {
6087 return braces[0] + base + braces[1];
6088 }
6089
6090 if (recurseTimes < 0) {
6091 if (isRegExp(value)) {
6092 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
6093 } else {
6094 return ctx.stylize('[Object]', 'special');
6095 }
6096 }
6097
6098 ctx.seen.push(value);
6099
6100 var output;
6101 if (array) {
6102 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
6103 } else {
6104 output = keys.map(function(key) {
6105 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
6106 });
6107 }
6108
6109 ctx.seen.pop();
6110
6111 return reduceToSingleString(output, base, braces);
6112}
6113
6114
6115function formatPrimitive(ctx, value) {
6116 if (isUndefined(value))
6117 return ctx.stylize('undefined', 'undefined');
6118 if (isString(value)) {
6119 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
6120 .replace(/'/g, "\\'")
6121 .replace(/\\"/g, '"') + '\'';
6122 return ctx.stylize(simple, 'string');
6123 }
6124 if (isNumber(value))
6125 return ctx.stylize('' + value, 'number');
6126 if (isBoolean(value))
6127 return ctx.stylize('' + value, 'boolean');
6128 // For some reason typeof null is "object", so special case here.
6129 if (isNull(value))
6130 return ctx.stylize('null', 'null');
6131}
6132
6133
6134function formatError(value) {
6135 return '[' + Error.prototype.toString.call(value) + ']';
6136}
6137
6138
6139function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
6140 var output = [];
6141 for (var i = 0, l = value.length; i < l; ++i) {
6142 if (hasOwnProperty(value, String(i))) {
6143 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
6144 String(i), true));
6145 } else {
6146 output.push('');
6147 }
6148 }
6149 keys.forEach(function(key) {
6150 if (!key.match(/^\d+$/)) {
6151 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
6152 key, true));
6153 }
6154 });
6155 return output;
6156}
6157
6158
6159function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
6160 var name, str, desc;
6161 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
6162 if (desc.get) {
6163 if (desc.set) {
6164 str = ctx.stylize('[Getter/Setter]', 'special');
6165 } else {
6166 str = ctx.stylize('[Getter]', 'special');
6167 }
6168 } else {
6169 if (desc.set) {
6170 str = ctx.stylize('[Setter]', 'special');
6171 }
6172 }
6173 if (!hasOwnProperty(visibleKeys, key)) {
6174 name = '[' + key + ']';
6175 }
6176 if (!str) {
6177 if (ctx.seen.indexOf(desc.value) < 0) {
6178 if (isNull(recurseTimes)) {
6179 str = formatValue(ctx, desc.value, null);
6180 } else {
6181 str = formatValue(ctx, desc.value, recurseTimes - 1);
6182 }
6183 if (str.indexOf('\n') > -1) {
6184 if (array) {
6185 str = str.split('\n').map(function(line) {
6186 return ' ' + line;
6187 }).join('\n').substr(2);
6188 } else {
6189 str = '\n' + str.split('\n').map(function(line) {
6190 return ' ' + line;
6191 }).join('\n');
6192 }
6193 }
6194 } else {
6195 str = ctx.stylize('[Circular]', 'special');
6196 }
6197 }
6198 if (isUndefined(name)) {
6199 if (array && key.match(/^\d+$/)) {
6200 return str;
6201 }
6202 name = JSON.stringify('' + key);
6203 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
6204 name = name.substr(1, name.length - 2);
6205 name = ctx.stylize(name, 'name');
6206 } else {
6207 name = name.replace(/'/g, "\\'")
6208 .replace(/\\"/g, '"')
6209 .replace(/(^"|"$)/g, "'");
6210 name = ctx.stylize(name, 'string');
6211 }
6212 }
6213
6214 return name + ': ' + str;
6215}
6216
6217
6218function reduceToSingleString(output, base, braces) {
6219 var numLinesEst = 0;
6220 var length = output.reduce(function(prev, cur) {
6221 numLinesEst++;
6222 if (cur.indexOf('\n') >= 0) numLinesEst++;
6223 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
6224 }, 0);
6225
6226 if (length > 60) {
6227 return braces[0] +
6228 (base === '' ? '' : base + '\n ') +
6229 ' ' +
6230 output.join(',\n ') +
6231 ' ' +
6232 braces[1];
6233 }
6234
6235 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
6236}
6237
6238
6239// NOTE: These type checking functions intentionally don't use `instanceof`
6240// because it is fragile and can be easily faked with `Object.create()`.
6241function isArray(ar) {
6242 return Array.isArray(ar);
6243}
6244exports.isArray = isArray;
6245
6246function isBoolean(arg) {
6247 return typeof arg === 'boolean';
6248}
6249exports.isBoolean = isBoolean;
6250
6251function isNull(arg) {
6252 return arg === null;
6253}
6254exports.isNull = isNull;
6255
6256function isNullOrUndefined(arg) {
6257 return arg == null;
6258}
6259exports.isNullOrUndefined = isNullOrUndefined;
6260
6261function isNumber(arg) {
6262 return typeof arg === 'number';
6263}
6264exports.isNumber = isNumber;
6265
6266function isString(arg) {
6267 return typeof arg === 'string';
6268}
6269exports.isString = isString;
6270
6271function isSymbol(arg) {
6272 return typeof arg === 'symbol';
6273}
6274exports.isSymbol = isSymbol;
6275
6276function isUndefined(arg) {
6277 return arg === void 0;
6278}
6279exports.isUndefined = isUndefined;
6280
6281function isRegExp(re) {
6282 return isObject(re) && objectToString(re) === '[object RegExp]';
6283}
6284exports.isRegExp = isRegExp;
6285
6286function isObject(arg) {
6287 return typeof arg === 'object' && arg !== null;
6288}
6289exports.isObject = isObject;
6290
6291function isDate(d) {
6292 return isObject(d) && objectToString(d) === '[object Date]';
6293}
6294exports.isDate = isDate;
6295
6296function isError(e) {
6297 return isObject(e) &&
6298 (objectToString(e) === '[object Error]' || e instanceof Error);
6299}
6300exports.isError = isError;
6301
6302function isFunction(arg) {
6303 return typeof arg === 'function';
6304}
6305exports.isFunction = isFunction;
6306
6307function isPrimitive(arg) {
6308 return arg === null ||
6309 typeof arg === 'boolean' ||
6310 typeof arg === 'number' ||
6311 typeof arg === 'string' ||
6312 typeof arg === 'symbol' || // ES6 symbol
6313 typeof arg === 'undefined';
6314}
6315exports.isPrimitive = isPrimitive;
6316
6317exports.isBuffer = require('./support/isBuffer');
6318
6319function objectToString(o) {
6320 return Object.prototype.toString.call(o);
6321}
6322
6323
6324function pad(n) {
6325 return n < 10 ? '0' + n.toString(10) : n.toString(10);
6326}
6327
6328
6329var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
6330 'Oct', 'Nov', 'Dec'];
6331
6332// 26 Feb 16:19:34
6333function timestamp() {
6334 var d = new Date();
6335 var time = [pad(d.getHours()),
6336 pad(d.getMinutes()),
6337 pad(d.getSeconds())].join(':');
6338 return [d.getDate(), months[d.getMonth()], time].join(' ');
6339}
6340
6341
6342// log is just a thin wrapper to console.log that prepends a timestamp
6343exports.log = function() {
6344 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
6345};
6346
6347
6348/**
6349 * Inherit the prototype methods from one constructor into another.
6350 *
6351 * The Function.prototype.inherits from lang.js rewritten as a standalone
6352 * function (not on Function.prototype). NOTE: If this file is to be loaded
6353 * during bootstrapping this function needs to be rewritten using some native
6354 * functions as prototype setup using normal JavaScript does not work as
6355 * expected during bootstrapping (see mirror.js in r114903).
6356 *
6357 * @param {function} ctor Constructor function which needs to inherit the
6358 * prototype.
6359 * @param {function} superCtor Constructor function to inherit prototype from.
6360 */
6361exports.inherits = require('inherits');
6362
6363exports._extend = function(origin, add) {
6364 // Don't do anything if add isn't an object
6365 if (!add || !isObject(add)) return origin;
6366
6367 var keys = Object.keys(add);
6368 var i = keys.length;
6369 while (i--) {
6370 origin[keys[i]] = add[keys[i]];
6371 }
6372 return origin;
6373};
6374
6375function hasOwnProperty(obj, prop) {
6376 return Object.prototype.hasOwnProperty.call(obj, prop);
6377}
6378
6379}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
6380},{"./support/isBuffer":32,"_process":13,"inherits":31}],34:[function(require,module,exports){
6381bitcoin = {
6382 base58: require('bs58'),
6383 bitcoin: require('bitcoinjs-lib'),
6384 ecurve: require('ecurve'),
6385 BigInteger: require('bigi'),
6386 Buffer: require('buffer'),
6387 elliptic: require('elliptic'),
6388 bs58check: require('bs58check'),
6389}
6390
6391module.exports = bitcoin;
6392
6393},{"bigi":39,"bitcoinjs-lib":52,"bs58":83,"bs58check":85,"buffer":5,"ecurve":94,"elliptic":97}],35:[function(require,module,exports){
6394// base-x encoding
6395// Forked from https://github.com/cryptocoinjs/bs58
6396// Originally written by Mike Hearn for BitcoinJ
6397// Copyright (c) 2011 Google Inc
6398// Ported to JavaScript by Stefan Thomas
6399// Merged Buffer refactorings from base58-native by Stephen Pair
6400// Copyright (c) 2013 BitPay Inc
6401
6402var Buffer = require('safe-buffer').Buffer
6403
6404module.exports = function base (ALPHABET) {
6405 var ALPHABET_MAP = {}
6406 var BASE = ALPHABET.length
6407 var LEADER = ALPHABET.charAt(0)
6408
6409 // pre-compute lookup table
6410 for (var z = 0; z < ALPHABET.length; z++) {
6411 var x = ALPHABET.charAt(z)
6412
6413 if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')
6414 ALPHABET_MAP[x] = z
6415 }
6416
6417 function encode (source) {
6418 if (source.length === 0) return ''
6419
6420 var digits = [0]
6421 for (var i = 0; i < source.length; ++i) {
6422 for (var j = 0, carry = source[i]; j < digits.length; ++j) {
6423 carry += digits[j] << 8
6424 digits[j] = carry % BASE
6425 carry = (carry / BASE) | 0
6426 }
6427
6428 while (carry > 0) {
6429 digits.push(carry % BASE)
6430 carry = (carry / BASE) | 0
6431 }
6432 }
6433
6434 var string = ''
6435
6436 // deal with leading zeros
6437 for (var k = 0; source[k] === 0 && k < source.length - 1; ++k) string += ALPHABET[0]
6438 // convert digits to a string
6439 for (var q = digits.length - 1; q >= 0; --q) string += ALPHABET[digits[q]]
6440
6441 return string
6442 }
6443
6444 function decodeUnsafe (string) {
6445 if (string.length === 0) return Buffer.allocUnsafe(0)
6446
6447 var bytes = [0]
6448 for (var i = 0; i < string.length; i++) {
6449 var value = ALPHABET_MAP[string[i]]
6450 if (value === undefined) return
6451
6452 for (var j = 0, carry = value; j < bytes.length; ++j) {
6453 carry += bytes[j] * BASE
6454 bytes[j] = carry & 0xff
6455 carry >>= 8
6456 }
6457
6458 while (carry > 0) {
6459 bytes.push(carry & 0xff)
6460 carry >>= 8
6461 }
6462 }
6463
6464 // deal with leading zeros
6465 for (var k = 0; string[k] === LEADER && k < string.length - 1; ++k) {
6466 bytes.push(0)
6467 }
6468
6469 return Buffer.from(bytes.reverse())
6470 }
6471
6472 function decode (string) {
6473 var buffer = decodeUnsafe(string)
6474 if (buffer) return buffer
6475
6476 throw new Error('Non-base' + BASE + ' character')
6477 }
6478
6479 return {
6480 encode: encode,
6481 decodeUnsafe: decodeUnsafe,
6482 decode: decode
6483 }
6484}
6485
6486},{"safe-buffer":128}],36:[function(require,module,exports){
6487'use strict'
6488let ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l'
6489
6490// pre-compute lookup table
6491let ALPHABET_MAP = {}
6492for (let z = 0; z < ALPHABET.length; z++) {
6493 let x = ALPHABET.charAt(z)
6494
6495 if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')
6496 ALPHABET_MAP[x] = z
6497}
6498
6499function polymodStep (pre) {
6500 let b = pre >> 25
6501 return ((pre & 0x1FFFFFF) << 5) ^
6502 (-((b >> 0) & 1) & 0x3b6a57b2) ^
6503 (-((b >> 1) & 1) & 0x26508e6d) ^
6504 (-((b >> 2) & 1) & 0x1ea119fa) ^
6505 (-((b >> 3) & 1) & 0x3d4233dd) ^
6506 (-((b >> 4) & 1) & 0x2a1462b3)
6507}
6508
6509function prefixChk (prefix) {
6510 let chk = 1
6511 for (let i = 0; i < prefix.length; ++i) {
6512 let c = prefix.charCodeAt(i)
6513 if (c < 33 || c > 126) throw new Error('Invalid prefix (' + prefix + ')')
6514
6515 chk = polymodStep(chk) ^ (c >> 5)
6516 }
6517 chk = polymodStep(chk)
6518
6519 for (let i = 0; i < prefix.length; ++i) {
6520 let v = prefix.charCodeAt(i)
6521 chk = polymodStep(chk) ^ (v & 0x1f)
6522 }
6523 return chk
6524}
6525
6526function encode (prefix, words) {
6527 // too long?
6528 if ((prefix.length + 7 + words.length) > 90) throw new TypeError('Exceeds Bech32 maximum length')
6529 prefix = prefix.toLowerCase()
6530
6531 // determine chk mod
6532 let chk = prefixChk(prefix)
6533 let result = prefix + '1'
6534 for (let i = 0; i < words.length; ++i) {
6535 let x = words[i]
6536 if ((x >> 5) !== 0) throw new Error('Non 5-bit word')
6537
6538 chk = polymodStep(chk) ^ x
6539 result += ALPHABET.charAt(x)
6540 }
6541
6542 for (let i = 0; i < 6; ++i) {
6543 chk = polymodStep(chk)
6544 }
6545 chk ^= 1
6546
6547 for (let i = 0; i < 6; ++i) {
6548 let v = (chk >> ((5 - i) * 5)) & 0x1f
6549 result += ALPHABET.charAt(v)
6550 }
6551
6552 return result
6553}
6554
6555function decode (str) {
6556 if (str.length < 8) throw new TypeError(str + ' too short')
6557 if (str.length > 90) throw new TypeError(str + ' too long')
6558
6559 // don't allow mixed case
6560 let lowered = str.toLowerCase()
6561 let uppered = str.toUpperCase()
6562 if (str !== lowered && str !== uppered) throw new Error('Mixed-case string ' + str)
6563 str = lowered
6564
6565 let split = str.lastIndexOf('1')
6566 if (split === 0) throw new Error('Missing prefix for ' + str)
6567
6568 let prefix = str.slice(0, split)
6569 let wordChars = str.slice(split + 1)
6570 if (wordChars.length < 6) throw new Error('Data too short')
6571
6572 let chk = prefixChk(prefix)
6573 let words = []
6574 for (let i = 0; i < wordChars.length; ++i) {
6575 let c = wordChars.charAt(i)
6576 let v = ALPHABET_MAP[c]
6577 if (v === undefined) throw new Error('Unknown character ' + c)
6578 chk = polymodStep(chk) ^ v
6579
6580 // not in the checksum?
6581 if (i + 6 >= wordChars.length) continue
6582 words.push(v)
6583 }
6584
6585 if (chk !== 1) throw new Error('Invalid checksum for ' + str)
6586 return { prefix, words }
6587}
6588
6589function convert (data, inBits, outBits, pad) {
6590 let value = 0
6591 let bits = 0
6592 let maxV = (1 << outBits) - 1
6593
6594 let result = []
6595 for (let i = 0; i < data.length; ++i) {
6596 value = (value << inBits) | data[i]
6597 bits += inBits
6598
6599 while (bits >= outBits) {
6600 bits -= outBits
6601 result.push((value >> bits) & maxV)
6602 }
6603 }
6604
6605 if (pad) {
6606 if (bits > 0) {
6607 result.push((value << (outBits - bits)) & maxV)
6608 }
6609 } else {
6610 if (bits >= inBits) throw new Error('Excess padding')
6611 if ((value << (outBits - bits)) & maxV) throw new Error('Non-zero padding')
6612 }
6613
6614 return result
6615}
6616
6617function toWords (bytes) {
6618 return convert(bytes, 8, 5, true)
6619}
6620
6621function fromWords (words) {
6622 return convert(words, 5, 8, false)
6623}
6624
6625module.exports = { decode, encode, toWords, fromWords }
6626
6627},{}],37:[function(require,module,exports){
6628// (public) Constructor
6629function BigInteger(a, b, c) {
6630 if (!(this instanceof BigInteger))
6631 return new BigInteger(a, b, c)
6632
6633 if (a != null) {
6634 if ("number" == typeof a) this.fromNumber(a, b, c)
6635 else if (b == null && "string" != typeof a) this.fromString(a, 256)
6636 else this.fromString(a, b)
6637 }
6638}
6639
6640var proto = BigInteger.prototype
6641
6642// duck-typed isBigInteger
6643proto.__bigi = require('../package.json').version
6644BigInteger.isBigInteger = function (obj, check_ver) {
6645 return obj && obj.__bigi && (!check_ver || obj.__bigi === proto.__bigi)
6646}
6647
6648// Bits per digit
6649var dbits
6650
6651// am: Compute w_j += (x*this_i), propagate carries,
6652// c is initial carry, returns final carry.
6653// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
6654// We need to select the fastest one that works in this environment.
6655
6656// am1: use a single mult and divide to get the high bits,
6657// max digit bits should be 26 because
6658// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
6659function am1(i, x, w, j, c, n) {
6660 while (--n >= 0) {
6661 var v = x * this[i++] + w[j] + c
6662 c = Math.floor(v / 0x4000000)
6663 w[j++] = v & 0x3ffffff
6664 }
6665 return c
6666}
6667// am2 avoids a big mult-and-extract completely.
6668// Max digit bits should be <= 30 because we do bitwise ops
6669// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
6670function am2(i, x, w, j, c, n) {
6671 var xl = x & 0x7fff,
6672 xh = x >> 15
6673 while (--n >= 0) {
6674 var l = this[i] & 0x7fff
6675 var h = this[i++] >> 15
6676 var m = xh * l + h * xl
6677 l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)
6678 c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)
6679 w[j++] = l & 0x3fffffff
6680 }
6681 return c
6682}
6683// Alternately, set max digit bits to 28 since some
6684// browsers slow down when dealing with 32-bit numbers.
6685function am3(i, x, w, j, c, n) {
6686 var xl = x & 0x3fff,
6687 xh = x >> 14
6688 while (--n >= 0) {
6689 var l = this[i] & 0x3fff
6690 var h = this[i++] >> 14
6691 var m = xh * l + h * xl
6692 l = xl * l + ((m & 0x3fff) << 14) + w[j] + c
6693 c = (l >> 28) + (m >> 14) + xh * h
6694 w[j++] = l & 0xfffffff
6695 }
6696 return c
6697}
6698
6699// wtf?
6700BigInteger.prototype.am = am1
6701dbits = 26
6702
6703BigInteger.prototype.DB = dbits
6704BigInteger.prototype.DM = ((1 << dbits) - 1)
6705var DV = BigInteger.prototype.DV = (1 << dbits)
6706
6707var BI_FP = 52
6708BigInteger.prototype.FV = Math.pow(2, BI_FP)
6709BigInteger.prototype.F1 = BI_FP - dbits
6710BigInteger.prototype.F2 = 2 * dbits - BI_FP
6711
6712// Digit conversions
6713var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"
6714var BI_RC = new Array()
6715var rr, vv
6716rr = "0".charCodeAt(0)
6717for (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv
6718rr = "a".charCodeAt(0)
6719for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv
6720rr = "A".charCodeAt(0)
6721for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv
6722
6723function int2char(n) {
6724 return BI_RM.charAt(n)
6725}
6726
6727function intAt(s, i) {
6728 var c = BI_RC[s.charCodeAt(i)]
6729 return (c == null) ? -1 : c
6730}
6731
6732// (protected) copy this to r
6733function bnpCopyTo(r) {
6734 for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]
6735 r.t = this.t
6736 r.s = this.s
6737}
6738
6739// (protected) set from integer value x, -DV <= x < DV
6740function bnpFromInt(x) {
6741 this.t = 1
6742 this.s = (x < 0) ? -1 : 0
6743 if (x > 0) this[0] = x
6744 else if (x < -1) this[0] = x + DV
6745 else this.t = 0
6746}
6747
6748// return bigint initialized to value
6749function nbv(i) {
6750 var r = new BigInteger()
6751 r.fromInt(i)
6752 return r
6753}
6754
6755// (protected) set from string and radix
6756function bnpFromString(s, b) {
6757 var self = this
6758
6759 var k
6760 if (b == 16) k = 4
6761 else if (b == 8) k = 3
6762 else if (b == 256) k = 8; // byte array
6763 else if (b == 2) k = 1
6764 else if (b == 32) k = 5
6765 else if (b == 4) k = 2
6766 else {
6767 self.fromRadix(s, b)
6768 return
6769 }
6770 self.t = 0
6771 self.s = 0
6772 var i = s.length,
6773 mi = false,
6774 sh = 0
6775 while (--i >= 0) {
6776 var x = (k == 8) ? s[i] & 0xff : intAt(s, i)
6777 if (x < 0) {
6778 if (s.charAt(i) == "-") mi = true
6779 continue
6780 }
6781 mi = false
6782 if (sh == 0)
6783 self[self.t++] = x
6784 else if (sh + k > self.DB) {
6785 self[self.t - 1] |= (x & ((1 << (self.DB - sh)) - 1)) << sh
6786 self[self.t++] = (x >> (self.DB - sh))
6787 } else
6788 self[self.t - 1] |= x << sh
6789 sh += k
6790 if (sh >= self.DB) sh -= self.DB
6791 }
6792 if (k == 8 && (s[0] & 0x80) != 0) {
6793 self.s = -1
6794 if (sh > 0) self[self.t - 1] |= ((1 << (self.DB - sh)) - 1) << sh
6795 }
6796 self.clamp()
6797 if (mi) BigInteger.ZERO.subTo(self, self)
6798}
6799
6800// (protected) clamp off excess high words
6801function bnpClamp() {
6802 var c = this.s & this.DM
6803 while (this.t > 0 && this[this.t - 1] == c)--this.t
6804}
6805
6806// (public) return string representation in given radix
6807function bnToString(b) {
6808 var self = this
6809 if (self.s < 0) return "-" + self.negate()
6810 .toString(b)
6811 var k
6812 if (b == 16) k = 4
6813 else if (b == 8) k = 3
6814 else if (b == 2) k = 1
6815 else if (b == 32) k = 5
6816 else if (b == 4) k = 2
6817 else return self.toRadix(b)
6818 var km = (1 << k) - 1,
6819 d, m = false,
6820 r = "",
6821 i = self.t
6822 var p = self.DB - (i * self.DB) % k
6823 if (i-- > 0) {
6824 if (p < self.DB && (d = self[i] >> p) > 0) {
6825 m = true
6826 r = int2char(d)
6827 }
6828 while (i >= 0) {
6829 if (p < k) {
6830 d = (self[i] & ((1 << p) - 1)) << (k - p)
6831 d |= self[--i] >> (p += self.DB - k)
6832 } else {
6833 d = (self[i] >> (p -= k)) & km
6834 if (p <= 0) {
6835 p += self.DB
6836 --i
6837 }
6838 }
6839 if (d > 0) m = true
6840 if (m) r += int2char(d)
6841 }
6842 }
6843 return m ? r : "0"
6844}
6845
6846// (public) -this
6847function bnNegate() {
6848 var r = new BigInteger()
6849 BigInteger.ZERO.subTo(this, r)
6850 return r
6851}
6852
6853// (public) |this|
6854function bnAbs() {
6855 return (this.s < 0) ? this.negate() : this
6856}
6857
6858// (public) return + if this > a, - if this < a, 0 if equal
6859function bnCompareTo(a) {
6860 var r = this.s - a.s
6861 if (r != 0) return r
6862 var i = this.t
6863 r = i - a.t
6864 if (r != 0) return (this.s < 0) ? -r : r
6865 while (--i >= 0)
6866 if ((r = this[i] - a[i]) != 0) return r
6867 return 0
6868}
6869
6870// returns bit length of the integer x
6871function nbits(x) {
6872 var r = 1,
6873 t
6874 if ((t = x >>> 16) != 0) {
6875 x = t
6876 r += 16
6877 }
6878 if ((t = x >> 8) != 0) {
6879 x = t
6880 r += 8
6881 }
6882 if ((t = x >> 4) != 0) {
6883 x = t
6884 r += 4
6885 }
6886 if ((t = x >> 2) != 0) {
6887 x = t
6888 r += 2
6889 }
6890 if ((t = x >> 1) != 0) {
6891 x = t
6892 r += 1
6893 }
6894 return r
6895}
6896
6897// (public) return the number of bits in "this"
6898function bnBitLength() {
6899 if (this.t <= 0) return 0
6900 return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))
6901}
6902
6903// (public) return the number of bytes in "this"
6904function bnByteLength() {
6905 return this.bitLength() >> 3
6906}
6907
6908// (protected) r = this << n*DB
6909function bnpDLShiftTo(n, r) {
6910 var i
6911 for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i]
6912 for (i = n - 1; i >= 0; --i) r[i] = 0
6913 r.t = this.t + n
6914 r.s = this.s
6915}
6916
6917// (protected) r = this >> n*DB
6918function bnpDRShiftTo(n, r) {
6919 for (var i = n; i < this.t; ++i) r[i - n] = this[i]
6920 r.t = Math.max(this.t - n, 0)
6921 r.s = this.s
6922}
6923
6924// (protected) r = this << n
6925function bnpLShiftTo(n, r) {
6926 var self = this
6927 var bs = n % self.DB
6928 var cbs = self.DB - bs
6929 var bm = (1 << cbs) - 1
6930 var ds = Math.floor(n / self.DB),
6931 c = (self.s << bs) & self.DM,
6932 i
6933 for (i = self.t - 1; i >= 0; --i) {
6934 r[i + ds + 1] = (self[i] >> cbs) | c
6935 c = (self[i] & bm) << bs
6936 }
6937 for (i = ds - 1; i >= 0; --i) r[i] = 0
6938 r[ds] = c
6939 r.t = self.t + ds + 1
6940 r.s = self.s
6941 r.clamp()
6942}
6943
6944// (protected) r = this >> n
6945function bnpRShiftTo(n, r) {
6946 var self = this
6947 r.s = self.s
6948 var ds = Math.floor(n / self.DB)
6949 if (ds >= self.t) {
6950 r.t = 0
6951 return
6952 }
6953 var bs = n % self.DB
6954 var cbs = self.DB - bs
6955 var bm = (1 << bs) - 1
6956 r[0] = self[ds] >> bs
6957 for (var i = ds + 1; i < self.t; ++i) {
6958 r[i - ds - 1] |= (self[i] & bm) << cbs
6959 r[i - ds] = self[i] >> bs
6960 }
6961 if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs
6962 r.t = self.t - ds
6963 r.clamp()
6964}
6965
6966// (protected) r = this - a
6967function bnpSubTo(a, r) {
6968 var self = this
6969 var i = 0,
6970 c = 0,
6971 m = Math.min(a.t, self.t)
6972 while (i < m) {
6973 c += self[i] - a[i]
6974 r[i++] = c & self.DM
6975 c >>= self.DB
6976 }
6977 if (a.t < self.t) {
6978 c -= a.s
6979 while (i < self.t) {
6980 c += self[i]
6981 r[i++] = c & self.DM
6982 c >>= self.DB
6983 }
6984 c += self.s
6985 } else {
6986 c += self.s
6987 while (i < a.t) {
6988 c -= a[i]
6989 r[i++] = c & self.DM
6990 c >>= self.DB
6991 }
6992 c -= a.s
6993 }
6994 r.s = (c < 0) ? -1 : 0
6995 if (c < -1) r[i++] = self.DV + c
6996 else if (c > 0) r[i++] = c
6997 r.t = i
6998 r.clamp()
6999}
7000
7001// (protected) r = this * a, r != this,a (HAC 14.12)
7002// "this" should be the larger one if appropriate.
7003function bnpMultiplyTo(a, r) {
7004 var x = this.abs(),
7005 y = a.abs()
7006 var i = x.t
7007 r.t = i + y.t
7008 while (--i >= 0) r[i] = 0
7009 for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t)
7010 r.s = 0
7011 r.clamp()
7012 if (this.s != a.s) BigInteger.ZERO.subTo(r, r)
7013}
7014
7015// (protected) r = this^2, r != this (HAC 14.16)
7016function bnpSquareTo(r) {
7017 var x = this.abs()
7018 var i = r.t = 2 * x.t
7019 while (--i >= 0) r[i] = 0
7020 for (i = 0; i < x.t - 1; ++i) {
7021 var c = x.am(i, x[i], r, 2 * i, 0, 1)
7022 if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {
7023 r[i + x.t] -= x.DV
7024 r[i + x.t + 1] = 1
7025 }
7026 }
7027 if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1)
7028 r.s = 0
7029 r.clamp()
7030}
7031
7032// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
7033// r != q, this != m. q or r may be null.
7034function bnpDivRemTo(m, q, r) {
7035 var self = this
7036 var pm = m.abs()
7037 if (pm.t <= 0) return
7038 var pt = self.abs()
7039 if (pt.t < pm.t) {
7040 if (q != null) q.fromInt(0)
7041 if (r != null) self.copyTo(r)
7042 return
7043 }
7044 if (r == null) r = new BigInteger()
7045 var y = new BigInteger(),
7046 ts = self.s,
7047 ms = m.s
7048 var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus
7049 if (nsh > 0) {
7050 pm.lShiftTo(nsh, y)
7051 pt.lShiftTo(nsh, r)
7052 } else {
7053 pm.copyTo(y)
7054 pt.copyTo(r)
7055 }
7056 var ys = y.t
7057 var y0 = y[ys - 1]
7058 if (y0 == 0) return
7059 var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)
7060 var d1 = self.FV / yt,
7061 d2 = (1 << self.F1) / yt,
7062 e = 1 << self.F2
7063 var i = r.t,
7064 j = i - ys,
7065 t = (q == null) ? new BigInteger() : q
7066 y.dlShiftTo(j, t)
7067 if (r.compareTo(t) >= 0) {
7068 r[r.t++] = 1
7069 r.subTo(t, r)
7070 }
7071 BigInteger.ONE.dlShiftTo(ys, t)
7072 t.subTo(y, y); // "negative" y so we can replace sub with am later
7073 while (y.t < ys) y[y.t++] = 0
7074 while (--j >= 0) {
7075 // Estimate quotient digit
7076 var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)
7077 if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out
7078 y.dlShiftTo(j, t)
7079 r.subTo(t, r)
7080 while (r[i] < --qd) r.subTo(t, r)
7081 }
7082 }
7083 if (q != null) {
7084 r.drShiftTo(ys, q)
7085 if (ts != ms) BigInteger.ZERO.subTo(q, q)
7086 }
7087 r.t = ys
7088 r.clamp()
7089 if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder
7090 if (ts < 0) BigInteger.ZERO.subTo(r, r)
7091}
7092
7093// (public) this mod a
7094function bnMod(a) {
7095 var r = new BigInteger()
7096 this.abs()
7097 .divRemTo(a, null, r)
7098 if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)
7099 return r
7100}
7101
7102// Modular reduction using "classic" algorithm
7103function Classic(m) {
7104 this.m = m
7105}
7106
7107function cConvert(x) {
7108 if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m)
7109 else return x
7110}
7111
7112function cRevert(x) {
7113 return x
7114}
7115
7116function cReduce(x) {
7117 x.divRemTo(this.m, null, x)
7118}
7119
7120function cMulTo(x, y, r) {
7121 x.multiplyTo(y, r)
7122 this.reduce(r)
7123}
7124
7125function cSqrTo(x, r) {
7126 x.squareTo(r)
7127 this.reduce(r)
7128}
7129
7130Classic.prototype.convert = cConvert
7131Classic.prototype.revert = cRevert
7132Classic.prototype.reduce = cReduce
7133Classic.prototype.mulTo = cMulTo
7134Classic.prototype.sqrTo = cSqrTo
7135
7136// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
7137// justification:
7138// xy == 1 (mod m)
7139// xy = 1+km
7140// xy(2-xy) = (1+km)(1-km)
7141// x[y(2-xy)] = 1-k^2m^2
7142// x[y(2-xy)] == 1 (mod m^2)
7143// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
7144// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
7145// JS multiply "overflows" differently from C/C++, so care is needed here.
7146function bnpInvDigit() {
7147 if (this.t < 1) return 0
7148 var x = this[0]
7149 if ((x & 1) == 0) return 0
7150 var y = x & 3; // y == 1/x mod 2^2
7151 y = (y * (2 - (x & 0xf) * y)) & 0xf; // y == 1/x mod 2^4
7152 y = (y * (2 - (x & 0xff) * y)) & 0xff; // y == 1/x mod 2^8
7153 y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff; // y == 1/x mod 2^16
7154 // last step - calculate inverse mod DV directly
7155 // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
7156 y = (y * (2 - x * y % this.DV)) % this.DV; // y == 1/x mod 2^dbits
7157 // we really want the negative inverse, and -DV < y < DV
7158 return (y > 0) ? this.DV - y : -y
7159}
7160
7161// Montgomery reduction
7162function Montgomery(m) {
7163 this.m = m
7164 this.mp = m.invDigit()
7165 this.mpl = this.mp & 0x7fff
7166 this.mph = this.mp >> 15
7167 this.um = (1 << (m.DB - 15)) - 1
7168 this.mt2 = 2 * m.t
7169}
7170
7171// xR mod m
7172function montConvert(x) {
7173 var r = new BigInteger()
7174 x.abs()
7175 .dlShiftTo(this.m.t, r)
7176 r.divRemTo(this.m, null, r)
7177 if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r)
7178 return r
7179}
7180
7181// x/R mod m
7182function montRevert(x) {
7183 var r = new BigInteger()
7184 x.copyTo(r)
7185 this.reduce(r)
7186 return r
7187}
7188
7189// x = x/R mod m (HAC 14.32)
7190function montReduce(x) {
7191 while (x.t <= this.mt2) // pad x so am has enough room later
7192 x[x.t++] = 0
7193 for (var i = 0; i < this.m.t; ++i) {
7194 // faster way of calculating u0 = x[i]*mp mod DV
7195 var j = x[i] & 0x7fff
7196 var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM
7197 // use am to combine the multiply-shift-add into one call
7198 j = i + this.m.t
7199 x[j] += this.m.am(0, u0, x, i, 0, this.m.t)
7200 // propagate carry
7201 while (x[j] >= x.DV) {
7202 x[j] -= x.DV
7203 x[++j]++
7204 }
7205 }
7206 x.clamp()
7207 x.drShiftTo(this.m.t, x)
7208 if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)
7209}
7210
7211// r = "x^2/R mod m"; x != r
7212function montSqrTo(x, r) {
7213 x.squareTo(r)
7214 this.reduce(r)
7215}
7216
7217// r = "xy/R mod m"; x,y != r
7218function montMulTo(x, y, r) {
7219 x.multiplyTo(y, r)
7220 this.reduce(r)
7221}
7222
7223Montgomery.prototype.convert = montConvert
7224Montgomery.prototype.revert = montRevert
7225Montgomery.prototype.reduce = montReduce
7226Montgomery.prototype.mulTo = montMulTo
7227Montgomery.prototype.sqrTo = montSqrTo
7228
7229// (protected) true iff this is even
7230function bnpIsEven() {
7231 return ((this.t > 0) ? (this[0] & 1) : this.s) == 0
7232}
7233
7234// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
7235function bnpExp(e, z) {
7236 if (e > 0xffffffff || e < 1) return BigInteger.ONE
7237 var r = new BigInteger(),
7238 r2 = new BigInteger(),
7239 g = z.convert(this),
7240 i = nbits(e) - 1
7241 g.copyTo(r)
7242 while (--i >= 0) {
7243 z.sqrTo(r, r2)
7244 if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)
7245 else {
7246 var t = r
7247 r = r2
7248 r2 = t
7249 }
7250 }
7251 return z.revert(r)
7252}
7253
7254// (public) this^e % m, 0 <= e < 2^32
7255function bnModPowInt(e, m) {
7256 var z
7257 if (e < 256 || m.isEven()) z = new Classic(m)
7258 else z = new Montgomery(m)
7259 return this.exp(e, z)
7260}
7261
7262// protected
7263proto.copyTo = bnpCopyTo
7264proto.fromInt = bnpFromInt
7265proto.fromString = bnpFromString
7266proto.clamp = bnpClamp
7267proto.dlShiftTo = bnpDLShiftTo
7268proto.drShiftTo = bnpDRShiftTo
7269proto.lShiftTo = bnpLShiftTo
7270proto.rShiftTo = bnpRShiftTo
7271proto.subTo = bnpSubTo
7272proto.multiplyTo = bnpMultiplyTo
7273proto.squareTo = bnpSquareTo
7274proto.divRemTo = bnpDivRemTo
7275proto.invDigit = bnpInvDigit
7276proto.isEven = bnpIsEven
7277proto.exp = bnpExp
7278
7279// public
7280proto.toString = bnToString
7281proto.negate = bnNegate
7282proto.abs = bnAbs
7283proto.compareTo = bnCompareTo
7284proto.bitLength = bnBitLength
7285proto.byteLength = bnByteLength
7286proto.mod = bnMod
7287proto.modPowInt = bnModPowInt
7288
7289// (public)
7290function bnClone() {
7291 var r = new BigInteger()
7292 this.copyTo(r)
7293 return r
7294}
7295
7296// (public) return value as integer
7297function bnIntValue() {
7298 if (this.s < 0) {
7299 if (this.t == 1) return this[0] - this.DV
7300 else if (this.t == 0) return -1
7301 } else if (this.t == 1) return this[0]
7302 else if (this.t == 0) return 0
7303 // assumes 16 < DB < 32
7304 return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]
7305}
7306
7307// (public) return value as byte
7308function bnByteValue() {
7309 return (this.t == 0) ? this.s : (this[0] << 24) >> 24
7310}
7311
7312// (public) return value as short (assumes DB>=16)
7313function bnShortValue() {
7314 return (this.t == 0) ? this.s : (this[0] << 16) >> 16
7315}
7316
7317// (protected) return x s.t. r^x < DV
7318function bnpChunkSize(r) {
7319 return Math.floor(Math.LN2 * this.DB / Math.log(r))
7320}
7321
7322// (public) 0 if this == 0, 1 if this > 0
7323function bnSigNum() {
7324 if (this.s < 0) return -1
7325 else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0
7326 else return 1
7327}
7328
7329// (protected) convert to radix string
7330function bnpToRadix(b) {
7331 if (b == null) b = 10
7332 if (this.signum() == 0 || b < 2 || b > 36) return "0"
7333 var cs = this.chunkSize(b)
7334 var a = Math.pow(b, cs)
7335 var d = nbv(a),
7336 y = new BigInteger(),
7337 z = new BigInteger(),
7338 r = ""
7339 this.divRemTo(d, y, z)
7340 while (y.signum() > 0) {
7341 r = (a + z.intValue())
7342 .toString(b)
7343 .substr(1) + r
7344 y.divRemTo(d, y, z)
7345 }
7346 return z.intValue()
7347 .toString(b) + r
7348}
7349
7350// (protected) convert from radix string
7351function bnpFromRadix(s, b) {
7352 var self = this
7353 self.fromInt(0)
7354 if (b == null) b = 10
7355 var cs = self.chunkSize(b)
7356 var d = Math.pow(b, cs),
7357 mi = false,
7358 j = 0,
7359 w = 0
7360 for (var i = 0; i < s.length; ++i) {
7361 var x = intAt(s, i)
7362 if (x < 0) {
7363 if (s.charAt(i) == "-" && self.signum() == 0) mi = true
7364 continue
7365 }
7366 w = b * w + x
7367 if (++j >= cs) {
7368 self.dMultiply(d)
7369 self.dAddOffset(w, 0)
7370 j = 0
7371 w = 0
7372 }
7373 }
7374 if (j > 0) {
7375 self.dMultiply(Math.pow(b, j))
7376 self.dAddOffset(w, 0)
7377 }
7378 if (mi) BigInteger.ZERO.subTo(self, self)
7379}
7380
7381// (protected) alternate constructor
7382function bnpFromNumber(a, b, c) {
7383 var self = this
7384 if ("number" == typeof b) {
7385 // new BigInteger(int,int,RNG)
7386 if (a < 2) self.fromInt(1)
7387 else {
7388 self.fromNumber(a, c)
7389 if (!self.testBit(a - 1)) // force MSB set
7390 self.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, self)
7391 if (self.isEven()) self.dAddOffset(1, 0); // force odd
7392 while (!self.isProbablePrime(b)) {
7393 self.dAddOffset(2, 0)
7394 if (self.bitLength() > a) self.subTo(BigInteger.ONE.shiftLeft(a - 1), self)
7395 }
7396 }
7397 } else {
7398 // new BigInteger(int,RNG)
7399 var x = new Array(),
7400 t = a & 7
7401 x.length = (a >> 3) + 1
7402 b.nextBytes(x)
7403 if (t > 0) x[0] &= ((1 << t) - 1)
7404 else x[0] = 0
7405 self.fromString(x, 256)
7406 }
7407}
7408
7409// (public) convert to bigendian byte array
7410function bnToByteArray() {
7411 var self = this
7412 var i = self.t,
7413 r = new Array()
7414 r[0] = self.s
7415 var p = self.DB - (i * self.DB) % 8,
7416 d, k = 0
7417 if (i-- > 0) {
7418 if (p < self.DB && (d = self[i] >> p) != (self.s & self.DM) >> p)
7419 r[k++] = d | (self.s << (self.DB - p))
7420 while (i >= 0) {
7421 if (p < 8) {
7422 d = (self[i] & ((1 << p) - 1)) << (8 - p)
7423 d |= self[--i] >> (p += self.DB - 8)
7424 } else {
7425 d = (self[i] >> (p -= 8)) & 0xff
7426 if (p <= 0) {
7427 p += self.DB
7428 --i
7429 }
7430 }
7431 if ((d & 0x80) != 0) d |= -256
7432 if (k === 0 && (self.s & 0x80) != (d & 0x80))++k
7433 if (k > 0 || d != self.s) r[k++] = d
7434 }
7435 }
7436 return r
7437}
7438
7439function bnEquals(a) {
7440 return (this.compareTo(a) == 0)
7441}
7442
7443function bnMin(a) {
7444 return (this.compareTo(a) < 0) ? this : a
7445}
7446
7447function bnMax(a) {
7448 return (this.compareTo(a) > 0) ? this : a
7449}
7450
7451// (protected) r = this op a (bitwise)
7452function bnpBitwiseTo(a, op, r) {
7453 var self = this
7454 var i, f, m = Math.min(a.t, self.t)
7455 for (i = 0; i < m; ++i) r[i] = op(self[i], a[i])
7456 if (a.t < self.t) {
7457 f = a.s & self.DM
7458 for (i = m; i < self.t; ++i) r[i] = op(self[i], f)
7459 r.t = self.t
7460 } else {
7461 f = self.s & self.DM
7462 for (i = m; i < a.t; ++i) r[i] = op(f, a[i])
7463 r.t = a.t
7464 }
7465 r.s = op(self.s, a.s)
7466 r.clamp()
7467}
7468
7469// (public) this & a
7470function op_and(x, y) {
7471 return x & y
7472}
7473
7474function bnAnd(a) {
7475 var r = new BigInteger()
7476 this.bitwiseTo(a, op_and, r)
7477 return r
7478}
7479
7480// (public) this | a
7481function op_or(x, y) {
7482 return x | y
7483}
7484
7485function bnOr(a) {
7486 var r = new BigInteger()
7487 this.bitwiseTo(a, op_or, r)
7488 return r
7489}
7490
7491// (public) this ^ a
7492function op_xor(x, y) {
7493 return x ^ y
7494}
7495
7496function bnXor(a) {
7497 var r = new BigInteger()
7498 this.bitwiseTo(a, op_xor, r)
7499 return r
7500}
7501
7502// (public) this & ~a
7503function op_andnot(x, y) {
7504 return x & ~y
7505}
7506
7507function bnAndNot(a) {
7508 var r = new BigInteger()
7509 this.bitwiseTo(a, op_andnot, r)
7510 return r
7511}
7512
7513// (public) ~this
7514function bnNot() {
7515 var r = new BigInteger()
7516 for (var i = 0; i < this.t; ++i) r[i] = this.DM & ~this[i]
7517 r.t = this.t
7518 r.s = ~this.s
7519 return r
7520}
7521
7522// (public) this << n
7523function bnShiftLeft(n) {
7524 var r = new BigInteger()
7525 if (n < 0) this.rShiftTo(-n, r)
7526 else this.lShiftTo(n, r)
7527 return r
7528}
7529
7530// (public) this >> n
7531function bnShiftRight(n) {
7532 var r = new BigInteger()
7533 if (n < 0) this.lShiftTo(-n, r)
7534 else this.rShiftTo(n, r)
7535 return r
7536}
7537
7538// return index of lowest 1-bit in x, x < 2^31
7539function lbit(x) {
7540 if (x == 0) return -1
7541 var r = 0
7542 if ((x & 0xffff) == 0) {
7543 x >>= 16
7544 r += 16
7545 }
7546 if ((x & 0xff) == 0) {
7547 x >>= 8
7548 r += 8
7549 }
7550 if ((x & 0xf) == 0) {
7551 x >>= 4
7552 r += 4
7553 }
7554 if ((x & 3) == 0) {
7555 x >>= 2
7556 r += 2
7557 }
7558 if ((x & 1) == 0)++r
7559 return r
7560}
7561
7562// (public) returns index of lowest 1-bit (or -1 if none)
7563function bnGetLowestSetBit() {
7564 for (var i = 0; i < this.t; ++i)
7565 if (this[i] != 0) return i * this.DB + lbit(this[i])
7566 if (this.s < 0) return this.t * this.DB
7567 return -1
7568}
7569
7570// return number of 1 bits in x
7571function cbit(x) {
7572 var r = 0
7573 while (x != 0) {
7574 x &= x - 1
7575 ++r
7576 }
7577 return r
7578}
7579
7580// (public) return number of set bits
7581function bnBitCount() {
7582 var r = 0,
7583 x = this.s & this.DM
7584 for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)
7585 return r
7586}
7587
7588// (public) true iff nth bit is set
7589function bnTestBit(n) {
7590 var j = Math.floor(n / this.DB)
7591 if (j >= this.t) return (this.s != 0)
7592 return ((this[j] & (1 << (n % this.DB))) != 0)
7593}
7594
7595// (protected) this op (1<<n)
7596function bnpChangeBit(n, op) {
7597 var r = BigInteger.ONE.shiftLeft(n)
7598 this.bitwiseTo(r, op, r)
7599 return r
7600}
7601
7602// (public) this | (1<<n)
7603function bnSetBit(n) {
7604 return this.changeBit(n, op_or)
7605}
7606
7607// (public) this & ~(1<<n)
7608function bnClearBit(n) {
7609 return this.changeBit(n, op_andnot)
7610}
7611
7612// (public) this ^ (1<<n)
7613function bnFlipBit(n) {
7614 return this.changeBit(n, op_xor)
7615}
7616
7617// (protected) r = this + a
7618function bnpAddTo(a, r) {
7619 var self = this
7620
7621 var i = 0,
7622 c = 0,
7623 m = Math.min(a.t, self.t)
7624 while (i < m) {
7625 c += self[i] + a[i]
7626 r[i++] = c & self.DM
7627 c >>= self.DB
7628 }
7629 if (a.t < self.t) {
7630 c += a.s
7631 while (i < self.t) {
7632 c += self[i]
7633 r[i++] = c & self.DM
7634 c >>= self.DB
7635 }
7636 c += self.s
7637 } else {
7638 c += self.s
7639 while (i < a.t) {
7640 c += a[i]
7641 r[i++] = c & self.DM
7642 c >>= self.DB
7643 }
7644 c += a.s
7645 }
7646 r.s = (c < 0) ? -1 : 0
7647 if (c > 0) r[i++] = c
7648 else if (c < -1) r[i++] = self.DV + c
7649 r.t = i
7650 r.clamp()
7651}
7652
7653// (public) this + a
7654function bnAdd(a) {
7655 var r = new BigInteger()
7656 this.addTo(a, r)
7657 return r
7658}
7659
7660// (public) this - a
7661function bnSubtract(a) {
7662 var r = new BigInteger()
7663 this.subTo(a, r)
7664 return r
7665}
7666
7667// (public) this * a
7668function bnMultiply(a) {
7669 var r = new BigInteger()
7670 this.multiplyTo(a, r)
7671 return r
7672}
7673
7674// (public) this^2
7675function bnSquare() {
7676 var r = new BigInteger()
7677 this.squareTo(r)
7678 return r
7679}
7680
7681// (public) this / a
7682function bnDivide(a) {
7683 var r = new BigInteger()
7684 this.divRemTo(a, r, null)
7685 return r
7686}
7687
7688// (public) this % a
7689function bnRemainder(a) {
7690 var r = new BigInteger()
7691 this.divRemTo(a, null, r)
7692 return r
7693}
7694
7695// (public) [this/a,this%a]
7696function bnDivideAndRemainder(a) {
7697 var q = new BigInteger(),
7698 r = new BigInteger()
7699 this.divRemTo(a, q, r)
7700 return new Array(q, r)
7701}
7702
7703// (protected) this *= n, this >= 0, 1 < n < DV
7704function bnpDMultiply(n) {
7705 this[this.t] = this.am(0, n - 1, this, 0, 0, this.t)
7706 ++this.t
7707 this.clamp()
7708}
7709
7710// (protected) this += n << w words, this >= 0
7711function bnpDAddOffset(n, w) {
7712 if (n == 0) return
7713 while (this.t <= w) this[this.t++] = 0
7714 this[w] += n
7715 while (this[w] >= this.DV) {
7716 this[w] -= this.DV
7717 if (++w >= this.t) this[this.t++] = 0
7718 ++this[w]
7719 }
7720}
7721
7722// A "null" reducer
7723function NullExp() {}
7724
7725function nNop(x) {
7726 return x
7727}
7728
7729function nMulTo(x, y, r) {
7730 x.multiplyTo(y, r)
7731}
7732
7733function nSqrTo(x, r) {
7734 x.squareTo(r)
7735}
7736
7737NullExp.prototype.convert = nNop
7738NullExp.prototype.revert = nNop
7739NullExp.prototype.mulTo = nMulTo
7740NullExp.prototype.sqrTo = nSqrTo
7741
7742// (public) this^e
7743function bnPow(e) {
7744 return this.exp(e, new NullExp())
7745}
7746
7747// (protected) r = lower n words of "this * a", a.t <= n
7748// "this" should be the larger one if appropriate.
7749function bnpMultiplyLowerTo(a, n, r) {
7750 var i = Math.min(this.t + a.t, n)
7751 r.s = 0; // assumes a,this >= 0
7752 r.t = i
7753 while (i > 0) r[--i] = 0
7754 var j
7755 for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.am(0, a[i], r, i, 0, this.t)
7756 for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a[i], r, i, 0, n - i)
7757 r.clamp()
7758}
7759
7760// (protected) r = "this * a" without lower n words, n > 0
7761// "this" should be the larger one if appropriate.
7762function bnpMultiplyUpperTo(a, n, r) {
7763 --n
7764 var i = r.t = this.t + a.t - n
7765 r.s = 0; // assumes a,this >= 0
7766 while (--i >= 0) r[i] = 0
7767 for (i = Math.max(n - this.t, 0); i < a.t; ++i)
7768 r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n)
7769 r.clamp()
7770 r.drShiftTo(1, r)
7771}
7772
7773// Barrett modular reduction
7774function Barrett(m) {
7775 // setup Barrett
7776 this.r2 = new BigInteger()
7777 this.q3 = new BigInteger()
7778 BigInteger.ONE.dlShiftTo(2 * m.t, this.r2)
7779 this.mu = this.r2.divide(m)
7780 this.m = m
7781}
7782
7783function barrettConvert(x) {
7784 if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m)
7785 else if (x.compareTo(this.m) < 0) return x
7786 else {
7787 var r = new BigInteger()
7788 x.copyTo(r)
7789 this.reduce(r)
7790 return r
7791 }
7792}
7793
7794function barrettRevert(x) {
7795 return x
7796}
7797
7798// x = x mod m (HAC 14.42)
7799function barrettReduce(x) {
7800 var self = this
7801 x.drShiftTo(self.m.t - 1, self.r2)
7802 if (x.t > self.m.t + 1) {
7803 x.t = self.m.t + 1
7804 x.clamp()
7805 }
7806 self.mu.multiplyUpperTo(self.r2, self.m.t + 1, self.q3)
7807 self.m.multiplyLowerTo(self.q3, self.m.t + 1, self.r2)
7808 while (x.compareTo(self.r2) < 0) x.dAddOffset(1, self.m.t + 1)
7809 x.subTo(self.r2, x)
7810 while (x.compareTo(self.m) >= 0) x.subTo(self.m, x)
7811}
7812
7813// r = x^2 mod m; x != r
7814function barrettSqrTo(x, r) {
7815 x.squareTo(r)
7816 this.reduce(r)
7817}
7818
7819// r = x*y mod m; x,y != r
7820function barrettMulTo(x, y, r) {
7821 x.multiplyTo(y, r)
7822 this.reduce(r)
7823}
7824
7825Barrett.prototype.convert = barrettConvert
7826Barrett.prototype.revert = barrettRevert
7827Barrett.prototype.reduce = barrettReduce
7828Barrett.prototype.mulTo = barrettMulTo
7829Barrett.prototype.sqrTo = barrettSqrTo
7830
7831// (public) this^e % m (HAC 14.85)
7832function bnModPow(e, m) {
7833 var i = e.bitLength(),
7834 k, r = nbv(1),
7835 z
7836 if (i <= 0) return r
7837 else if (i < 18) k = 1
7838 else if (i < 48) k = 3
7839 else if (i < 144) k = 4
7840 else if (i < 768) k = 5
7841 else k = 6
7842 if (i < 8)
7843 z = new Classic(m)
7844 else if (m.isEven())
7845 z = new Barrett(m)
7846 else
7847 z = new Montgomery(m)
7848
7849 // precomputation
7850 var g = new Array(),
7851 n = 3,
7852 k1 = k - 1,
7853 km = (1 << k) - 1
7854 g[1] = z.convert(this)
7855 if (k > 1) {
7856 var g2 = new BigInteger()
7857 z.sqrTo(g[1], g2)
7858 while (n <= km) {
7859 g[n] = new BigInteger()
7860 z.mulTo(g2, g[n - 2], g[n])
7861 n += 2
7862 }
7863 }
7864
7865 var j = e.t - 1,
7866 w, is1 = true,
7867 r2 = new BigInteger(),
7868 t
7869 i = nbits(e[j]) - 1
7870 while (j >= 0) {
7871 if (i >= k1) w = (e[j] >> (i - k1)) & km
7872 else {
7873 w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)
7874 if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)
7875 }
7876
7877 n = k
7878 while ((w & 1) == 0) {
7879 w >>= 1
7880 --n
7881 }
7882 if ((i -= n) < 0) {
7883 i += this.DB
7884 --j
7885 }
7886 if (is1) { // ret == 1, don't bother squaring or multiplying it
7887 g[w].copyTo(r)
7888 is1 = false
7889 } else {
7890 while (n > 1) {
7891 z.sqrTo(r, r2)
7892 z.sqrTo(r2, r)
7893 n -= 2
7894 }
7895 if (n > 0) z.sqrTo(r, r2)
7896 else {
7897 t = r
7898 r = r2
7899 r2 = t
7900 }
7901 z.mulTo(r2, g[w], r)
7902 }
7903
7904 while (j >= 0 && (e[j] & (1 << i)) == 0) {
7905 z.sqrTo(r, r2)
7906 t = r
7907 r = r2
7908 r2 = t
7909 if (--i < 0) {
7910 i = this.DB - 1
7911 --j
7912 }
7913 }
7914 }
7915 return z.revert(r)
7916}
7917
7918// (public) gcd(this,a) (HAC 14.54)
7919function bnGCD(a) {
7920 var x = (this.s < 0) ? this.negate() : this.clone()
7921 var y = (a.s < 0) ? a.negate() : a.clone()
7922 if (x.compareTo(y) < 0) {
7923 var t = x
7924 x = y
7925 y = t
7926 }
7927 var i = x.getLowestSetBit(),
7928 g = y.getLowestSetBit()
7929 if (g < 0) return x
7930 if (i < g) g = i
7931 if (g > 0) {
7932 x.rShiftTo(g, x)
7933 y.rShiftTo(g, y)
7934 }
7935 while (x.signum() > 0) {
7936 if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)
7937 if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)
7938 if (x.compareTo(y) >= 0) {
7939 x.subTo(y, x)
7940 x.rShiftTo(1, x)
7941 } else {
7942 y.subTo(x, y)
7943 y.rShiftTo(1, y)
7944 }
7945 }
7946 if (g > 0) y.lShiftTo(g, y)
7947 return y
7948}
7949
7950// (protected) this % n, n < 2^26
7951function bnpModInt(n) {
7952 if (n <= 0) return 0
7953 var d = this.DV % n,
7954 r = (this.s < 0) ? n - 1 : 0
7955 if (this.t > 0)
7956 if (d == 0) r = this[0] % n
7957 else
7958 for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n
7959 return r
7960}
7961
7962// (public) 1/this % m (HAC 14.61)
7963function bnModInverse(m) {
7964 var ac = m.isEven()
7965 if (this.signum() === 0) throw new Error('division by zero')
7966 if ((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO
7967 var u = m.clone(),
7968 v = this.clone()
7969 var a = nbv(1),
7970 b = nbv(0),
7971 c = nbv(0),
7972 d = nbv(1)
7973 while (u.signum() != 0) {
7974 while (u.isEven()) {
7975 u.rShiftTo(1, u)
7976 if (ac) {
7977 if (!a.isEven() || !b.isEven()) {
7978 a.addTo(this, a)
7979 b.subTo(m, b)
7980 }
7981 a.rShiftTo(1, a)
7982 } else if (!b.isEven()) b.subTo(m, b)
7983 b.rShiftTo(1, b)
7984 }
7985 while (v.isEven()) {
7986 v.rShiftTo(1, v)
7987 if (ac) {
7988 if (!c.isEven() || !d.isEven()) {
7989 c.addTo(this, c)
7990 d.subTo(m, d)
7991 }
7992 c.rShiftTo(1, c)
7993 } else if (!d.isEven()) d.subTo(m, d)
7994 d.rShiftTo(1, d)
7995 }
7996 if (u.compareTo(v) >= 0) {
7997 u.subTo(v, u)
7998 if (ac) a.subTo(c, a)
7999 b.subTo(d, b)
8000 } else {
8001 v.subTo(u, v)
8002 if (ac) c.subTo(a, c)
8003 d.subTo(b, d)
8004 }
8005 }
8006 if (v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO
8007 while (d.compareTo(m) >= 0) d.subTo(m, d)
8008 while (d.signum() < 0) d.addTo(m, d)
8009 return d
8010}
8011
8012var lowprimes = [
8013 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
8014 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
8015 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233,
8016 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317,
8017 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419,
8018 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503,
8019 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607,
8020 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701,
8021 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811,
8022 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911,
8023 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997
8024]
8025
8026var lplim = (1 << 26) / lowprimes[lowprimes.length - 1]
8027
8028// (public) test primality with certainty >= 1-.5^t
8029function bnIsProbablePrime(t) {
8030 var i, x = this.abs()
8031 if (x.t == 1 && x[0] <= lowprimes[lowprimes.length - 1]) {
8032 for (i = 0; i < lowprimes.length; ++i)
8033 if (x[0] == lowprimes[i]) return true
8034 return false
8035 }
8036 if (x.isEven()) return false
8037 i = 1
8038 while (i < lowprimes.length) {
8039 var m = lowprimes[i],
8040 j = i + 1
8041 while (j < lowprimes.length && m < lplim) m *= lowprimes[j++]
8042 m = x.modInt(m)
8043 while (i < j) if (m % lowprimes[i++] == 0) return false
8044 }
8045 return x.millerRabin(t)
8046}
8047
8048// (protected) true if probably prime (HAC 4.24, Miller-Rabin)
8049function bnpMillerRabin(t) {
8050 var n1 = this.subtract(BigInteger.ONE)
8051 var k = n1.getLowestSetBit()
8052 if (k <= 0) return false
8053 var r = n1.shiftRight(k)
8054 t = (t + 1) >> 1
8055 if (t > lowprimes.length) t = lowprimes.length
8056 var a = new BigInteger(null)
8057 var j, bases = []
8058 for (var i = 0; i < t; ++i) {
8059 for (;;) {
8060 j = lowprimes[Math.floor(Math.random() * lowprimes.length)]
8061 if (bases.indexOf(j) == -1) break
8062 }
8063 bases.push(j)
8064 a.fromInt(j)
8065 var y = a.modPow(r, this)
8066 if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
8067 var j = 1
8068 while (j++ < k && y.compareTo(n1) != 0) {
8069 y = y.modPowInt(2, this)
8070 if (y.compareTo(BigInteger.ONE) == 0) return false
8071 }
8072 if (y.compareTo(n1) != 0) return false
8073 }
8074 }
8075 return true
8076}
8077
8078// protected
8079proto.chunkSize = bnpChunkSize
8080proto.toRadix = bnpToRadix
8081proto.fromRadix = bnpFromRadix
8082proto.fromNumber = bnpFromNumber
8083proto.bitwiseTo = bnpBitwiseTo
8084proto.changeBit = bnpChangeBit
8085proto.addTo = bnpAddTo
8086proto.dMultiply = bnpDMultiply
8087proto.dAddOffset = bnpDAddOffset
8088proto.multiplyLowerTo = bnpMultiplyLowerTo
8089proto.multiplyUpperTo = bnpMultiplyUpperTo
8090proto.modInt = bnpModInt
8091proto.millerRabin = bnpMillerRabin
8092
8093// public
8094proto.clone = bnClone
8095proto.intValue = bnIntValue
8096proto.byteValue = bnByteValue
8097proto.shortValue = bnShortValue
8098proto.signum = bnSigNum
8099proto.toByteArray = bnToByteArray
8100proto.equals = bnEquals
8101proto.min = bnMin
8102proto.max = bnMax
8103proto.and = bnAnd
8104proto.or = bnOr
8105proto.xor = bnXor
8106proto.andNot = bnAndNot
8107proto.not = bnNot
8108proto.shiftLeft = bnShiftLeft
8109proto.shiftRight = bnShiftRight
8110proto.getLowestSetBit = bnGetLowestSetBit
8111proto.bitCount = bnBitCount
8112proto.testBit = bnTestBit
8113proto.setBit = bnSetBit
8114proto.clearBit = bnClearBit
8115proto.flipBit = bnFlipBit
8116proto.add = bnAdd
8117proto.subtract = bnSubtract
8118proto.multiply = bnMultiply
8119proto.divide = bnDivide
8120proto.remainder = bnRemainder
8121proto.divideAndRemainder = bnDivideAndRemainder
8122proto.modPow = bnModPow
8123proto.modInverse = bnModInverse
8124proto.pow = bnPow
8125proto.gcd = bnGCD
8126proto.isProbablePrime = bnIsProbablePrime
8127
8128// JSBN-specific extension
8129proto.square = bnSquare
8130
8131// constants
8132BigInteger.ZERO = nbv(0)
8133BigInteger.ONE = nbv(1)
8134BigInteger.valueOf = nbv
8135
8136module.exports = BigInteger
8137
8138},{"../package.json":40}],38:[function(require,module,exports){
8139(function (Buffer){
8140// FIXME: Kind of a weird way to throw exceptions, consider removing
8141var assert = require('assert')
8142var BigInteger = require('./bigi')
8143
8144/**
8145 * Turns a byte array into a big integer.
8146 *
8147 * This function will interpret a byte array as a big integer in big
8148 * endian notation.
8149 */
8150BigInteger.fromByteArrayUnsigned = function(byteArray) {
8151 // BigInteger expects a DER integer conformant byte array
8152 if (byteArray[0] & 0x80) {
8153 return new BigInteger([0].concat(byteArray))
8154 }
8155
8156 return new BigInteger(byteArray)
8157}
8158
8159/**
8160 * Returns a byte array representation of the big integer.
8161 *
8162 * This returns the absolute of the contained value in big endian
8163 * form. A value of zero results in an empty array.
8164 */
8165BigInteger.prototype.toByteArrayUnsigned = function() {
8166 var byteArray = this.toByteArray()
8167 return byteArray[0] === 0 ? byteArray.slice(1) : byteArray
8168}
8169
8170BigInteger.fromDERInteger = function(byteArray) {
8171 return new BigInteger(byteArray)
8172}
8173
8174/*
8175 * Converts BigInteger to a DER integer representation.
8176 *
8177 * The format for this value uses the most significant bit as a sign
8178 * bit. If the most significant bit is already set and the integer is
8179 * positive, a 0x00 is prepended.
8180 *
8181 * Examples:
8182 *
8183 * 0 => 0x00
8184 * 1 => 0x01
8185 * -1 => 0xff
8186 * 127 => 0x7f
8187 * -127 => 0x81
8188 * 128 => 0x0080
8189 * -128 => 0x80
8190 * 255 => 0x00ff
8191 * -255 => 0xff01
8192 * 16300 => 0x3fac
8193 * -16300 => 0xc054
8194 * 62300 => 0x00f35c
8195 * -62300 => 0xff0ca4
8196*/
8197BigInteger.prototype.toDERInteger = BigInteger.prototype.toByteArray
8198
8199BigInteger.fromBuffer = function(buffer) {
8200 // BigInteger expects a DER integer conformant byte array
8201 if (buffer[0] & 0x80) {
8202 var byteArray = Array.prototype.slice.call(buffer)
8203
8204 return new BigInteger([0].concat(byteArray))
8205 }
8206
8207 return new BigInteger(buffer)
8208}
8209
8210BigInteger.fromHex = function(hex) {
8211 if (hex === '') return BigInteger.ZERO
8212
8213 assert.equal(hex, hex.match(/^[A-Fa-f0-9]+/), 'Invalid hex string')
8214 assert.equal(hex.length % 2, 0, 'Incomplete hex')
8215 return new BigInteger(hex, 16)
8216}
8217
8218BigInteger.prototype.toBuffer = function(size) {
8219 var byteArray = this.toByteArrayUnsigned()
8220 var zeros = []
8221
8222 var padding = size - byteArray.length
8223 while (zeros.length < padding) zeros.push(0)
8224
8225 return new Buffer(zeros.concat(byteArray))
8226}
8227
8228BigInteger.prototype.toHex = function(size) {
8229 return this.toBuffer(size).toString('hex')
8230}
8231
8232}).call(this,require("buffer").Buffer)
8233},{"./bigi":37,"assert":1,"buffer":5}],39:[function(require,module,exports){
8234var BigInteger = require('./bigi')
8235
8236//addons
8237require('./convert')
8238
8239module.exports = BigInteger
8240},{"./bigi":37,"./convert":38}],40:[function(require,module,exports){
8241module.exports={
8242 "_args": [
8243 [
8244 "bigi",
8245 "/home/ian/git/bitcoin/bitcoinjs-lib-browser"
8246 ]
8247 ],
8248 "_from": "bigi@latest",
8249 "_id": "bigi@1.4.2",
8250 "_inCache": true,
8251 "_installable": true,
8252 "_location": "/bigi",
8253 "_nodeVersion": "6.1.0",
8254 "_npmOperationalInternal": {
8255 "host": "packages-12-west.internal.npmjs.com",
8256 "tmp": "tmp/bigi-1.4.2.tgz_1469584192413_0.6801238611806184"
8257 },
8258 "_npmUser": {
8259 "email": "jprichardson@gmail.com",
8260 "name": "jprichardson"
8261 },
8262 "_npmVersion": "3.8.6",
8263 "_phantomChildren": {},
8264 "_requested": {
8265 "name": "bigi",
8266 "raw": "bigi",
8267 "rawSpec": "",
8268 "scope": null,
8269 "spec": "latest",
8270 "type": "tag"
8271 },
8272 "_requiredBy": [
8273 "#USER",
8274 "/bitcoinjs-lib",
8275 "/ecurve"
8276 ],
8277 "_resolved": "https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz",
8278 "_shasum": "9c665a95f88b8b08fc05cfd731f561859d725825",
8279 "_shrinkwrap": null,
8280 "_spec": "bigi",
8281 "_where": "/home/ian/git/bitcoin/bitcoinjs-lib-browser",
8282 "bugs": {
8283 "url": "https://github.com/cryptocoinjs/bigi/issues"
8284 },
8285 "dependencies": {},
8286 "description": "Big integers.",
8287 "devDependencies": {
8288 "coveralls": "^2.11.2",
8289 "istanbul": "^0.3.5",
8290 "jshint": "^2.5.1",
8291 "mocha": "^2.1.0",
8292 "mochify": "^2.1.0"
8293 },
8294 "directories": {},
8295 "dist": {
8296 "shasum": "9c665a95f88b8b08fc05cfd731f561859d725825",
8297 "tarball": "https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz"
8298 },
8299 "gitHead": "c25308081c896ff84702303722bf5ecd8b3f78e3",
8300 "homepage": "https://github.com/cryptocoinjs/bigi#readme",
8301 "keywords": [
8302 "cryptography",
8303 "math",
8304 "bitcoin",
8305 "arbitrary",
8306 "precision",
8307 "arithmetic",
8308 "big",
8309 "integer",
8310 "int",
8311 "number",
8312 "biginteger",
8313 "bigint",
8314 "bignumber",
8315 "decimal",
8316 "float"
8317 ],
8318 "main": "./lib/index.js",
8319 "maintainers": [
8320 {
8321 "email": "boydb@midnightdesign.ws",
8322 "name": "midnightlightning"
8323 },
8324 {
8325 "email": "sidazhang89@gmail.com",
8326 "name": "sidazhang"
8327 },
8328 {
8329 "email": "npm@shesek.info",
8330 "name": "nadav"
8331 },
8332 {
8333 "email": "jprichardson@gmail.com",
8334 "name": "jprichardson"
8335 }
8336 ],
8337 "name": "bigi",
8338 "optionalDependencies": {},
8339 "readme": "ERROR: No README data found!",
8340 "repository": {
8341 "type": "git",
8342 "url": "git+https://github.com/cryptocoinjs/bigi.git"
8343 },
8344 "scripts": {
8345 "browser-test": "mochify --wd -R spec",
8346 "coverage": "istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js",
8347 "coveralls": "npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info",
8348 "jshint": "jshint --config jshint.json lib/*.js ; true",
8349 "test": "_mocha -- test/*.js",
8350 "unit": "mocha"
8351 },
8352 "testling": {
8353 "browsers": [
8354 "ie/9..latest",
8355 "firefox/latest",
8356 "chrome/latest",
8357 "safari/6.0..latest",
8358 "iphone/6.0..latest",
8359 "android-browser/4.2..latest"
8360 ],
8361 "files": "test/*.js",
8362 "harness": "mocha"
8363 },
8364 "version": "1.4.2"
8365}
8366
8367},{}],41:[function(require,module,exports){
8368// Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki
8369// Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]
8370// NOTE: SIGHASH byte ignored AND restricted, truncate before use
8371
8372var Buffer = require('safe-buffer').Buffer
8373
8374function check (buffer) {
8375 if (buffer.length < 8) return false
8376 if (buffer.length > 72) return false
8377 if (buffer[0] !== 0x30) return false
8378 if (buffer[1] !== buffer.length - 2) return false
8379 if (buffer[2] !== 0x02) return false
8380
8381 var lenR = buffer[3]
8382 if (lenR === 0) return false
8383 if (5 + lenR >= buffer.length) return false
8384 if (buffer[4 + lenR] !== 0x02) return false
8385
8386 var lenS = buffer[5 + lenR]
8387 if (lenS === 0) return false
8388 if ((6 + lenR + lenS) !== buffer.length) return false
8389
8390 if (buffer[4] & 0x80) return false
8391 if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false
8392
8393 if (buffer[lenR + 6] & 0x80) return false
8394 if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false
8395 return true
8396}
8397
8398function decode (buffer) {
8399 if (buffer.length < 8) throw new Error('DER sequence length is too short')
8400 if (buffer.length > 72) throw new Error('DER sequence length is too long')
8401 if (buffer[0] !== 0x30) throw new Error('Expected DER sequence')
8402 if (buffer[1] !== buffer.length - 2) throw new Error('DER sequence length is invalid')
8403 if (buffer[2] !== 0x02) throw new Error('Expected DER integer')
8404
8405 var lenR = buffer[3]
8406 if (lenR === 0) throw new Error('R length is zero')
8407 if (5 + lenR >= buffer.length) throw new Error('R length is too long')
8408 if (buffer[4 + lenR] !== 0x02) throw new Error('Expected DER integer (2)')
8409
8410 var lenS = buffer[5 + lenR]
8411 if (lenS === 0) throw new Error('S length is zero')
8412 if ((6 + lenR + lenS) !== buffer.length) throw new Error('S length is invalid')
8413
8414 if (buffer[4] & 0x80) throw new Error('R value is negative')
8415 if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) throw new Error('R value excessively padded')
8416
8417 if (buffer[lenR + 6] & 0x80) throw new Error('S value is negative')
8418 if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) throw new Error('S value excessively padded')
8419
8420 // non-BIP66 - extract R, S values
8421 return {
8422 r: buffer.slice(4, 4 + lenR),
8423 s: buffer.slice(6 + lenR)
8424 }
8425}
8426
8427/*
8428 * Expects r and s to be positive DER integers.
8429 *
8430 * The DER format uses the most significant bit as a sign bit (& 0x80).
8431 * If the significant bit is set AND the integer is positive, a 0x00 is prepended.
8432 *
8433 * Examples:
8434 *
8435 * 0 => 0x00
8436 * 1 => 0x01
8437 * -1 => 0xff
8438 * 127 => 0x7f
8439 * -127 => 0x81
8440 * 128 => 0x0080
8441 * -128 => 0x80
8442 * 255 => 0x00ff
8443 * -255 => 0xff01
8444 * 16300 => 0x3fac
8445 * -16300 => 0xc054
8446 * 62300 => 0x00f35c
8447 * -62300 => 0xff0ca4
8448*/
8449function encode (r, s) {
8450 var lenR = r.length
8451 var lenS = s.length
8452 if (lenR === 0) throw new Error('R length is zero')
8453 if (lenS === 0) throw new Error('S length is zero')
8454 if (lenR > 33) throw new Error('R length is too long')
8455 if (lenS > 33) throw new Error('S length is too long')
8456 if (r[0] & 0x80) throw new Error('R value is negative')
8457 if (s[0] & 0x80) throw new Error('S value is negative')
8458 if (lenR > 1 && (r[0] === 0x00) && !(r[1] & 0x80)) throw new Error('R value excessively padded')
8459 if (lenS > 1 && (s[0] === 0x00) && !(s[1] & 0x80)) throw new Error('S value excessively padded')
8460
8461 var signature = Buffer.allocUnsafe(6 + lenR + lenS)
8462
8463 // 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]
8464 signature[0] = 0x30
8465 signature[1] = signature.length - 2
8466 signature[2] = 0x02
8467 signature[3] = r.length
8468 r.copy(signature, 4)
8469 signature[4 + lenR] = 0x02
8470 signature[5 + lenR] = s.length
8471 s.copy(signature, 6 + lenR)
8472
8473 return signature
8474}
8475
8476module.exports = {
8477 check: check,
8478 decode: decode,
8479 encode: encode
8480}
8481
8482},{"safe-buffer":128}],42:[function(require,module,exports){
8483module.exports={
8484 "OP_FALSE": 0,
8485 "OP_0": 0,
8486 "OP_PUSHDATA1": 76,
8487 "OP_PUSHDATA2": 77,
8488 "OP_PUSHDATA4": 78,
8489 "OP_1NEGATE": 79,
8490 "OP_RESERVED": 80,
8491 "OP_1": 81,
8492 "OP_TRUE": 81,
8493 "OP_2": 82,
8494 "OP_3": 83,
8495 "OP_4": 84,
8496 "OP_5": 85,
8497 "OP_6": 86,
8498 "OP_7": 87,
8499 "OP_8": 88,
8500 "OP_9": 89,
8501 "OP_10": 90,
8502 "OP_11": 91,
8503 "OP_12": 92,
8504 "OP_13": 93,
8505 "OP_14": 94,
8506 "OP_15": 95,
8507 "OP_16": 96,
8508
8509 "OP_NOP": 97,
8510 "OP_VER": 98,
8511 "OP_IF": 99,
8512 "OP_NOTIF": 100,
8513 "OP_VERIF": 101,
8514 "OP_VERNOTIF": 102,
8515 "OP_ELSE": 103,
8516 "OP_ENDIF": 104,
8517 "OP_VERIFY": 105,
8518 "OP_RETURN": 106,
8519
8520 "OP_TOALTSTACK": 107,
8521 "OP_FROMALTSTACK": 108,
8522 "OP_2DROP": 109,
8523 "OP_2DUP": 110,
8524 "OP_3DUP": 111,
8525 "OP_2OVER": 112,
8526 "OP_2ROT": 113,
8527 "OP_2SWAP": 114,
8528 "OP_IFDUP": 115,
8529 "OP_DEPTH": 116,
8530 "OP_DROP": 117,
8531 "OP_DUP": 118,
8532 "OP_NIP": 119,
8533 "OP_OVER": 120,
8534 "OP_PICK": 121,
8535 "OP_ROLL": 122,
8536 "OP_ROT": 123,
8537 "OP_SWAP": 124,
8538 "OP_TUCK": 125,
8539
8540 "OP_CAT": 126,
8541 "OP_SUBSTR": 127,
8542 "OP_LEFT": 128,
8543 "OP_RIGHT": 129,
8544 "OP_SIZE": 130,
8545
8546 "OP_INVERT": 131,
8547 "OP_AND": 132,
8548 "OP_OR": 133,
8549 "OP_XOR": 134,
8550 "OP_EQUAL": 135,
8551 "OP_EQUALVERIFY": 136,
8552 "OP_RESERVED1": 137,
8553 "OP_RESERVED2": 138,
8554
8555 "OP_1ADD": 139,
8556 "OP_1SUB": 140,
8557 "OP_2MUL": 141,
8558 "OP_2DIV": 142,
8559 "OP_NEGATE": 143,
8560 "OP_ABS": 144,
8561 "OP_NOT": 145,
8562 "OP_0NOTEQUAL": 146,
8563 "OP_ADD": 147,
8564 "OP_SUB": 148,
8565 "OP_MUL": 149,
8566 "OP_DIV": 150,
8567 "OP_MOD": 151,
8568 "OP_LSHIFT": 152,
8569 "OP_RSHIFT": 153,
8570
8571 "OP_BOOLAND": 154,
8572 "OP_BOOLOR": 155,
8573 "OP_NUMEQUAL": 156,
8574 "OP_NUMEQUALVERIFY": 157,
8575 "OP_NUMNOTEQUAL": 158,
8576 "OP_LESSTHAN": 159,
8577 "OP_GREATERTHAN": 160,
8578 "OP_LESSTHANOREQUAL": 161,
8579 "OP_GREATERTHANOREQUAL": 162,
8580 "OP_MIN": 163,
8581 "OP_MAX": 164,
8582
8583 "OP_WITHIN": 165,
8584
8585 "OP_RIPEMD160": 166,
8586 "OP_SHA1": 167,
8587 "OP_SHA256": 168,
8588 "OP_HASH160": 169,
8589 "OP_HASH256": 170,
8590 "OP_CODESEPARATOR": 171,
8591 "OP_CHECKSIG": 172,
8592 "OP_CHECKSIGVERIFY": 173,
8593 "OP_CHECKMULTISIG": 174,
8594 "OP_CHECKMULTISIGVERIFY": 175,
8595
8596 "OP_NOP1": 176,
8597 "OP_NOP2": 177,
8598 "OP_CHECKLOCKTIMEVERIFY": 177,
8599
8600 "OP_NOP3": 178,
8601 "OP_NOP4": 179,
8602 "OP_NOP5": 180,
8603 "OP_NOP6": 181,
8604 "OP_NOP7": 182,
8605 "OP_NOP8": 183,
8606 "OP_NOP9": 184,
8607 "OP_NOP10": 185,
8608
8609 "OP_PUBKEYHASH": 253,
8610 "OP_PUBKEY": 254,
8611 "OP_INVALIDOPCODE": 255
8612}
8613
8614},{}],43:[function(require,module,exports){
8615var OPS = require('./index.json')
8616
8617var map = {}
8618for (var op in OPS) {
8619 var code = OPS[op]
8620 map[code] = op
8621}
8622
8623module.exports = map
8624
8625},{"./index.json":42}],44:[function(require,module,exports){
8626var Buffer = require('safe-buffer').Buffer
8627var bech32 = require('bech32')
8628var bs58check = require('bs58check')
8629var bscript = require('./script')
8630var btemplates = require('./templates')
8631var networks = require('./networks')
8632var typeforce = require('typeforce')
8633var types = require('./types')
8634
8635function fromBase58Check (address) {
8636 var payload = bs58check.decode(address)
8637
8638 // TODO: 4.0.0, move to "toOutputScript"
8639 if (payload.length < 21) throw new TypeError(address + ' is too short')
8640 if (payload.length > 21) throw new TypeError(address + ' is too long')
8641
8642 var version = payload.readUInt8(0)
8643 var hash = payload.slice(1)
8644
8645 return { version: version, hash: hash }
8646}
8647
8648function fromBech32 (address) {
8649 var result = bech32.decode(address)
8650 var data = bech32.fromWords(result.words.slice(1))
8651
8652 return {
8653 version: result.words[0],
8654 prefix: result.prefix,
8655 data: Buffer.from(data)
8656 }
8657}
8658
8659function toBase58Check (hash, version) {
8660 typeforce(types.tuple(types.Hash160bit, types.UInt8), arguments)
8661
8662 var payload = Buffer.allocUnsafe(21)
8663 payload.writeUInt8(version, 0)
8664 hash.copy(payload, 1)
8665
8666 return bs58check.encode(payload)
8667}
8668
8669function toBech32 (data, version, prefix) {
8670 var words = bech32.toWords(data)
8671 words.unshift(version)
8672
8673 return bech32.encode(prefix, words)
8674}
8675
8676function fromOutputScript (outputScript, network) {
8677 network = network || networks.bitcoin
8678
8679 if (btemplates.pubKeyHash.output.check(outputScript)) return toBase58Check(bscript.compile(outputScript).slice(3, 23), network.pubKeyHash)
8680 if (btemplates.scriptHash.output.check(outputScript)) return toBase58Check(bscript.compile(outputScript).slice(2, 22), network.scriptHash)
8681 if (btemplates.witnessPubKeyHash.output.check(outputScript)) return toBech32(bscript.compile(outputScript).slice(2, 22), 0, network.bech32)
8682 if (btemplates.witnessScriptHash.output.check(outputScript)) return toBech32(bscript.compile(outputScript).slice(2, 34), 0, network.bech32)
8683
8684 throw new Error(bscript.toASM(outputScript) + ' has no matching Address')
8685}
8686
8687function toOutputScript (address, network) {
8688 network = network || networks.bitcoin
8689
8690 var decode
8691 try {
8692 decode = fromBase58Check(address)
8693 } catch (e) {}
8694
8695 if (decode) {
8696 if (decode.version === network.pubKeyHash) return btemplates.pubKeyHash.output.encode(decode.hash)
8697 if (decode.version === network.scriptHash) return btemplates.scriptHash.output.encode(decode.hash)
8698 } else {
8699 try {
8700 decode = fromBech32(address)
8701 } catch (e) {}
8702
8703 if (decode) {
8704 if (decode.prefix !== network.bech32) throw new Error(address + ' has an invalid prefix')
8705 if (decode.version === 0) {
8706 if (decode.data.length === 20) return btemplates.witnessPubKeyHash.output.encode(decode.data)
8707 if (decode.data.length === 32) return btemplates.witnessScriptHash.output.encode(decode.data)
8708 }
8709 }
8710 }
8711
8712 throw new Error(address + ' has no matching Script')
8713}
8714
8715module.exports = {
8716 fromBase58Check: fromBase58Check,
8717 fromBech32: fromBech32,
8718 fromOutputScript: fromOutputScript,
8719 toBase58Check: toBase58Check,
8720 toBech32: toBech32,
8721 toOutputScript: toOutputScript
8722}
8723
8724},{"./networks":53,"./script":54,"./templates":56,"./types":80,"bech32":36,"bs58check":85,"safe-buffer":128,"typeforce":139}],45:[function(require,module,exports){
8725var Buffer = require('safe-buffer').Buffer
8726var bcrypto = require('./crypto')
8727var fastMerkleRoot = require('merkle-lib/fastRoot')
8728var typeforce = require('typeforce')
8729var types = require('./types')
8730var varuint = require('varuint-bitcoin')
8731
8732var Transaction = require('./transaction')
8733
8734function Block () {
8735 this.version = 1
8736 this.prevHash = null
8737 this.merkleRoot = null
8738 this.timestamp = 0
8739 this.bits = 0
8740 this.nonce = 0
8741}
8742
8743Block.fromBuffer = function (buffer) {
8744 if (buffer.length < 80) throw new Error('Buffer too small (< 80 bytes)')
8745
8746 var offset = 0
8747 function readSlice (n) {
8748 offset += n
8749 return buffer.slice(offset - n, offset)
8750 }
8751
8752 function readUInt32 () {
8753 var i = buffer.readUInt32LE(offset)
8754 offset += 4
8755 return i
8756 }
8757
8758 function readInt32 () {
8759 var i = buffer.readInt32LE(offset)
8760 offset += 4
8761 return i
8762 }
8763
8764 var block = new Block()
8765 block.version = readInt32()
8766 block.prevHash = readSlice(32)
8767 block.merkleRoot = readSlice(32)
8768 block.timestamp = readUInt32()
8769 block.bits = readUInt32()
8770 block.nonce = readUInt32()
8771
8772 if (buffer.length === 80) return block
8773
8774 function readVarInt () {
8775 var vi = varuint.decode(buffer, offset)
8776 offset += varuint.decode.bytes
8777 return vi
8778 }
8779
8780 function readTransaction () {
8781 var tx = Transaction.fromBuffer(buffer.slice(offset), true)
8782 offset += tx.byteLength()
8783 return tx
8784 }
8785
8786 var nTransactions = readVarInt()
8787 block.transactions = []
8788
8789 for (var i = 0; i < nTransactions; ++i) {
8790 var tx = readTransaction()
8791 block.transactions.push(tx)
8792 }
8793
8794 return block
8795}
8796
8797Block.prototype.byteLength = function (headersOnly) {
8798 if (headersOnly || !this.transactions) return 80
8799
8800 return 80 + varuint.encodingLength(this.transactions.length) + this.transactions.reduce(function (a, x) {
8801 return a + x.byteLength()
8802 }, 0)
8803}
8804
8805Block.fromHex = function (hex) {
8806 return Block.fromBuffer(Buffer.from(hex, 'hex'))
8807}
8808
8809Block.prototype.getHash = function () {
8810 return bcrypto.hash256(this.toBuffer(true))
8811}
8812
8813Block.prototype.getId = function () {
8814 return this.getHash().reverse().toString('hex')
8815}
8816
8817Block.prototype.getUTCDate = function () {
8818 var date = new Date(0) // epoch
8819 date.setUTCSeconds(this.timestamp)
8820
8821 return date
8822}
8823
8824// TODO: buffer, offset compatibility
8825Block.prototype.toBuffer = function (headersOnly) {
8826 var buffer = Buffer.allocUnsafe(this.byteLength(headersOnly))
8827
8828 var offset = 0
8829 function writeSlice (slice) {
8830 slice.copy(buffer, offset)
8831 offset += slice.length
8832 }
8833
8834 function writeInt32 (i) {
8835 buffer.writeInt32LE(i, offset)
8836 offset += 4
8837 }
8838 function writeUInt32 (i) {
8839 buffer.writeUInt32LE(i, offset)
8840 offset += 4
8841 }
8842
8843 writeInt32(this.version)
8844 writeSlice(this.prevHash)
8845 writeSlice(this.merkleRoot)
8846 writeUInt32(this.timestamp)
8847 writeUInt32(this.bits)
8848 writeUInt32(this.nonce)
8849
8850 if (headersOnly || !this.transactions) return buffer
8851
8852 varuint.encode(this.transactions.length, buffer, offset)
8853 offset += varuint.encode.bytes
8854
8855 this.transactions.forEach(function (tx) {
8856 var txSize = tx.byteLength() // TODO: extract from toBuffer?
8857 tx.toBuffer(buffer, offset)
8858 offset += txSize
8859 })
8860
8861 return buffer
8862}
8863
8864Block.prototype.toHex = function (headersOnly) {
8865 return this.toBuffer(headersOnly).toString('hex')
8866}
8867
8868Block.calculateTarget = function (bits) {
8869 var exponent = ((bits & 0xff000000) >> 24) - 3
8870 var mantissa = bits & 0x007fffff
8871 var target = Buffer.alloc(32, 0)
8872 target.writeUInt32BE(mantissa, 28 - exponent)
8873 return target
8874}
8875
8876Block.calculateMerkleRoot = function (transactions) {
8877 typeforce([{ getHash: types.Function }], transactions)
8878 if (transactions.length === 0) throw TypeError('Cannot compute merkle root for zero transactions')
8879
8880 var hashes = transactions.map(function (transaction) {
8881 return transaction.getHash()
8882 })
8883
8884 return fastMerkleRoot(hashes, bcrypto.hash256)
8885}
8886
8887Block.prototype.checkMerkleRoot = function () {
8888 if (!this.transactions) return false
8889
8890 var actualMerkleRoot = Block.calculateMerkleRoot(this.transactions)
8891 return this.merkleRoot.compare(actualMerkleRoot) === 0
8892}
8893
8894Block.prototype.checkProofOfWork = function () {
8895 var hash = this.getHash().reverse()
8896 var target = Block.calculateTarget(this.bits)
8897
8898 return hash.compare(target) <= 0
8899}
8900
8901module.exports = Block
8902
8903},{"./crypto":47,"./transaction":78,"./types":80,"merkle-lib/fastRoot":122,"safe-buffer":128,"typeforce":139,"varuint-bitcoin":141}],46:[function(require,module,exports){
8904var pushdata = require('pushdata-bitcoin')
8905var varuint = require('varuint-bitcoin')
8906
8907// https://github.com/feross/buffer/blob/master/index.js#L1127
8908function verifuint (value, max) {
8909 if (typeof value !== 'number') throw new Error('cannot write a non-number as a number')
8910 if (value < 0) throw new Error('specified a negative value for writing an unsigned value')
8911 if (value > max) throw new Error('RangeError: value out of range')
8912 if (Math.floor(value) !== value) throw new Error('value has a fractional component')
8913}
8914
8915function readUInt64LE (buffer, offset) {
8916 var a = buffer.readUInt32LE(offset)
8917 var b = buffer.readUInt32LE(offset + 4)
8918 b *= 0x100000000
8919
8920 verifuint(b + a, 0x001fffffffffffff)
8921
8922 return b + a
8923}
8924
8925function writeUInt64LE (buffer, value, offset) {
8926 verifuint(value, 0x001fffffffffffff)
8927
8928 buffer.writeInt32LE(value & -1, offset)
8929 buffer.writeUInt32LE(Math.floor(value / 0x100000000), offset + 4)
8930 return offset + 8
8931}
8932
8933// TODO: remove in 4.0.0?
8934function readVarInt (buffer, offset) {
8935 var result = varuint.decode(buffer, offset)
8936
8937 return {
8938 number: result,
8939 size: varuint.decode.bytes
8940 }
8941}
8942
8943// TODO: remove in 4.0.0?
8944function writeVarInt (buffer, number, offset) {
8945 varuint.encode(number, buffer, offset)
8946 return varuint.encode.bytes
8947}
8948
8949module.exports = {
8950 pushDataSize: pushdata.encodingLength,
8951 readPushDataInt: pushdata.decode,
8952 readUInt64LE: readUInt64LE,
8953 readVarInt: readVarInt,
8954 varIntBuffer: varuint.encode,
8955 varIntSize: varuint.encodingLength,
8956 writePushDataInt: pushdata.encode,
8957 writeUInt64LE: writeUInt64LE,
8958 writeVarInt: writeVarInt
8959}
8960
8961},{"pushdata-bitcoin":125,"varuint-bitcoin":141}],47:[function(require,module,exports){
8962var createHash = require('create-hash')
8963
8964function ripemd160 (buffer) {
8965 return createHash('rmd160').update(buffer).digest()
8966}
8967
8968function sha1 (buffer) {
8969 return createHash('sha1').update(buffer).digest()
8970}
8971
8972function sha256 (buffer) {
8973 return createHash('sha256').update(buffer).digest()
8974}
8975
8976function hash160 (buffer) {
8977 return ripemd160(sha256(buffer))
8978}
8979
8980function hash256 (buffer) {
8981 return sha256(sha256(buffer))
8982}
8983
8984module.exports = {
8985 hash160: hash160,
8986 hash256: hash256,
8987 ripemd160: ripemd160,
8988 sha1: sha1,
8989 sha256: sha256
8990}
8991
8992},{"create-hash":87}],48:[function(require,module,exports){
8993var Buffer = require('safe-buffer').Buffer
8994var createHmac = require('create-hmac')
8995var typeforce = require('typeforce')
8996var types = require('./types')
8997
8998var BigInteger = require('bigi')
8999var ECSignature = require('./ecsignature')
9000
9001var ZERO = Buffer.alloc(1, 0)
9002var ONE = Buffer.alloc(1, 1)
9003
9004var ecurve = require('ecurve')
9005var secp256k1 = ecurve.getCurveByName('secp256k1')
9006
9007// https://tools.ietf.org/html/rfc6979#section-3.2
9008function deterministicGenerateK (hash, x, checkSig) {
9009 typeforce(types.tuple(
9010 types.Hash256bit,
9011 types.Buffer256bit,
9012 types.Function
9013 ), arguments)
9014
9015 // Step A, ignored as hash already provided
9016 // Step B
9017 // Step C
9018 var k = Buffer.alloc(32, 0)
9019 var v = Buffer.alloc(32, 1)
9020
9021 // Step D
9022 k = createHmac('sha256', k)
9023 .update(v)
9024 .update(ZERO)
9025 .update(x)
9026 .update(hash)
9027 .digest()
9028
9029 // Step E
9030 v = createHmac('sha256', k).update(v).digest()
9031
9032 // Step F
9033 k = createHmac('sha256', k)
9034 .update(v)
9035 .update(ONE)
9036 .update(x)
9037 .update(hash)
9038 .digest()
9039
9040 // Step G
9041 v = createHmac('sha256', k).update(v).digest()
9042
9043 // Step H1/H2a, ignored as tlen === qlen (256 bit)
9044 // Step H2b
9045 v = createHmac('sha256', k).update(v).digest()
9046
9047 var T = BigInteger.fromBuffer(v)
9048
9049 // Step H3, repeat until T is within the interval [1, n - 1] and is suitable for ECDSA
9050 while (T.signum() <= 0 || T.compareTo(secp256k1.n) >= 0 || !checkSig(T)) {
9051 k = createHmac('sha256', k)
9052 .update(v)
9053 .update(ZERO)
9054 .digest()
9055
9056 v = createHmac('sha256', k).update(v).digest()
9057
9058 // Step H1/H2a, again, ignored as tlen === qlen (256 bit)
9059 // Step H2b again
9060 v = createHmac('sha256', k).update(v).digest()
9061 T = BigInteger.fromBuffer(v)
9062 }
9063
9064 return T
9065}
9066
9067var N_OVER_TWO = secp256k1.n.shiftRight(1)
9068
9069function sign (hash, d) {
9070 typeforce(types.tuple(types.Hash256bit, types.BigInt), arguments)
9071
9072 var x = d.toBuffer(32)
9073 var e = BigInteger.fromBuffer(hash)
9074 var n = secp256k1.n
9075 var G = secp256k1.G
9076
9077 var r, s
9078 deterministicGenerateK(hash, x, function (k) {
9079 var Q = G.multiply(k)
9080
9081 if (secp256k1.isInfinity(Q)) return false
9082
9083 r = Q.affineX.mod(n)
9084 if (r.signum() === 0) return false
9085
9086 s = k.modInverse(n).multiply(e.add(d.multiply(r))).mod(n)
9087 if (s.signum() === 0) return false
9088
9089 return true
9090 })
9091
9092 // enforce low S values, see bip62: 'low s values in signatures'
9093 if (s.compareTo(N_OVER_TWO) > 0) {
9094 s = n.subtract(s)
9095 }
9096
9097 return new ECSignature(r, s)
9098}
9099
9100function verify (hash, signature, Q) {
9101 typeforce(types.tuple(
9102 types.Hash256bit,
9103 types.ECSignature,
9104 types.ECPoint
9105 ), arguments)
9106
9107 var n = secp256k1.n
9108 var G = secp256k1.G
9109
9110 var r = signature.r
9111 var s = signature.s
9112
9113 // 1.4.1 Enforce r and s are both integers in the interval [1, n − 1]
9114 if (r.signum() <= 0 || r.compareTo(n) >= 0) return false
9115 if (s.signum() <= 0 || s.compareTo(n) >= 0) return false
9116
9117 // 1.4.2 H = Hash(M), already done by the user
9118 // 1.4.3 e = H
9119 var e = BigInteger.fromBuffer(hash)
9120
9121 // Compute s^-1
9122 var sInv = s.modInverse(n)
9123
9124 // 1.4.4 Compute u1 = es^−1 mod n
9125 // u2 = rs^−1 mod n
9126 var u1 = e.multiply(sInv).mod(n)
9127 var u2 = r.multiply(sInv).mod(n)
9128
9129 // 1.4.5 Compute R = (xR, yR)
9130 // R = u1G + u2Q
9131 var R = G.multiplyTwo(u1, Q, u2)
9132
9133 // 1.4.5 (cont.) Enforce R is not at infinity
9134 if (secp256k1.isInfinity(R)) return false
9135
9136 // 1.4.6 Convert the field element R.x to an integer
9137 var xR = R.affineX
9138
9139 // 1.4.7 Set v = xR mod n
9140 var v = xR.mod(n)
9141
9142 // 1.4.8 If v = r, output "valid", and if v != r, output "invalid"
9143 return v.equals(r)
9144}
9145
9146module.exports = {
9147 deterministicGenerateK: deterministicGenerateK,
9148 sign: sign,
9149 verify: verify,
9150
9151 // TODO: remove
9152 __curve: secp256k1
9153}
9154
9155},{"./ecsignature":50,"./types":80,"bigi":39,"create-hmac":90,"ecurve":94,"safe-buffer":128,"typeforce":139}],49:[function(require,module,exports){
9156var baddress = require('./address')
9157var bcrypto = require('./crypto')
9158var ecdsa = require('./ecdsa')
9159var randomBytes = require('randombytes')
9160var typeforce = require('typeforce')
9161var types = require('./types')
9162var wif = require('wif')
9163
9164var NETWORKS = require('./networks')
9165var BigInteger = require('bigi')
9166
9167var ecurve = require('ecurve')
9168var secp256k1 = ecdsa.__curve
9169
9170function ECPair (d, Q, options) {
9171 if (options) {
9172 typeforce({
9173 compressed: types.maybe(types.Boolean),
9174 network: types.maybe(types.Network)
9175 }, options)
9176 }
9177
9178 options = options || {}
9179
9180 if (d) {
9181 if (d.signum() <= 0) throw new Error('Private key must be greater than 0')
9182 if (d.compareTo(secp256k1.n) >= 0) throw new Error('Private key must be less than the curve order')
9183 if (Q) throw new TypeError('Unexpected publicKey parameter')
9184
9185 this.d = d
9186 } else {
9187 typeforce(types.ECPoint, Q)
9188
9189 this.__Q = Q
9190 }
9191
9192 this.compressed = options.compressed === undefined ? true : options.compressed
9193 this.network = options.network || NETWORKS.bitcoin
9194}
9195
9196Object.defineProperty(ECPair.prototype, 'Q', {
9197 get: function () {
9198 if (!this.__Q && this.d) {
9199 this.__Q = secp256k1.G.multiply(this.d)
9200 }
9201
9202 return this.__Q
9203 }
9204})
9205
9206ECPair.fromPublicKeyBuffer = function (buffer, network) {
9207 var Q = ecurve.Point.decodeFrom(secp256k1, buffer)
9208
9209 return new ECPair(null, Q, {
9210 compressed: Q.compressed,
9211 network: network
9212 })
9213}
9214
9215ECPair.fromWIF = function (string, network) {
9216 var decoded = wif.decode(string)
9217 var version = decoded.version
9218
9219 // list of networks?
9220 if (types.Array(network)) {
9221 network = network.filter(function (x) {
9222 return version === x.wif
9223 }).pop()
9224
9225 if (!network) throw new Error('Unknown network version')
9226
9227 // otherwise, assume a network object (or default to bitcoin)
9228 } else {
9229 network = network || NETWORKS.bitcoin
9230
9231 if (version !== network.wif) throw new Error('Invalid network version')
9232 }
9233
9234 var d = BigInteger.fromBuffer(decoded.privateKey)
9235
9236 return new ECPair(d, null, {
9237 compressed: decoded.compressed,
9238 network: network
9239 })
9240}
9241
9242ECPair.makeRandom = function (options) {
9243 options = options || {}
9244
9245 var rng = options.rng || randomBytes
9246
9247 var d
9248 do {
9249 var buffer = rng(32)
9250 typeforce(types.Buffer256bit, buffer)
9251
9252 d = BigInteger.fromBuffer(buffer)
9253 } while (d.signum() <= 0 || d.compareTo(secp256k1.n) >= 0)
9254
9255 return new ECPair(d, null, options)
9256}
9257
9258ECPair.prototype.getAddress = function () {
9259 return baddress.toBase58Check(bcrypto.hash160(this.getPublicKeyBuffer()), this.getNetwork().pubKeyHash)
9260}
9261
9262ECPair.prototype.getNetwork = function () {
9263 return this.network
9264}
9265
9266ECPair.prototype.getPublicKeyBuffer = function () {
9267 return this.Q.getEncoded(this.compressed)
9268}
9269
9270ECPair.prototype.sign = function (hash) {
9271 if (!this.d) throw new Error('Missing private key')
9272
9273 return ecdsa.sign(hash, this.d)
9274}
9275
9276ECPair.prototype.toWIF = function () {
9277 if (!this.d) throw new Error('Missing private key')
9278
9279 return wif.encode(this.network.wif, this.d.toBuffer(32), this.compressed)
9280}
9281
9282ECPair.prototype.verify = function (hash, signature) {
9283 return ecdsa.verify(hash, signature, this.Q)
9284}
9285
9286module.exports = ECPair
9287
9288},{"./address":44,"./crypto":47,"./ecdsa":48,"./networks":53,"./types":80,"bigi":39,"ecurve":94,"randombytes":126,"typeforce":139,"wif":142}],50:[function(require,module,exports){
9289(function (Buffer){
9290var bip66 = require('bip66')
9291var typeforce = require('typeforce')
9292var types = require('./types')
9293
9294var BigInteger = require('bigi')
9295
9296function ECSignature (r, s) {
9297 typeforce(types.tuple(types.BigInt, types.BigInt), arguments)
9298
9299 this.r = r
9300 this.s = s
9301}
9302
9303ECSignature.parseCompact = function (buffer) {
9304 typeforce(types.BufferN(65), buffer)
9305
9306 var flagByte = buffer.readUInt8(0) - 27
9307 if (flagByte !== (flagByte & 7)) throw new Error('Invalid signature parameter')
9308
9309 var compressed = !!(flagByte & 4)
9310 var recoveryParam = flagByte & 3
9311 var signature = ECSignature.fromRSBuffer(buffer.slice(1))
9312
9313 return {
9314 compressed: compressed,
9315 i: recoveryParam,
9316 signature: signature
9317 }
9318}
9319
9320ECSignature.fromRSBuffer = function (buffer) {
9321 typeforce(types.BufferN(64), buffer)
9322
9323 var r = BigInteger.fromBuffer(buffer.slice(0, 32))
9324 var s = BigInteger.fromBuffer(buffer.slice(32, 64))
9325 return new ECSignature(r, s)
9326}
9327
9328ECSignature.fromDER = function (buffer) {
9329 var decode = bip66.decode(buffer)
9330 var r = BigInteger.fromDERInteger(decode.r)
9331 var s = BigInteger.fromDERInteger(decode.s)
9332
9333 return new ECSignature(r, s)
9334}
9335
9336// BIP62: 1 byte hashType flag (only 0x01, 0x02, 0x03, 0x81, 0x82 and 0x83 are allowed)
9337ECSignature.parseScriptSignature = function (buffer) {
9338 var hashType = buffer.readUInt8(buffer.length - 1)
9339 var hashTypeMod = hashType & ~0x80
9340
9341 if (hashTypeMod <= 0x00 || hashTypeMod >= 0x04) throw new Error('Invalid hashType ' + hashType)
9342
9343 return {
9344 signature: ECSignature.fromDER(buffer.slice(0, -1)),
9345 hashType: hashType
9346 }
9347}
9348
9349ECSignature.prototype.toCompact = function (i, compressed) {
9350 if (compressed) {
9351 i += 4
9352 }
9353
9354 i += 27
9355
9356 var buffer = Buffer.alloc(65)
9357 buffer.writeUInt8(i, 0)
9358 this.toRSBuffer(buffer, 1)
9359 return buffer
9360}
9361
9362ECSignature.prototype.toDER = function () {
9363 var r = Buffer.from(this.r.toDERInteger())
9364 var s = Buffer.from(this.s.toDERInteger())
9365
9366 return bip66.encode(r, s)
9367}
9368
9369ECSignature.prototype.toRSBuffer = function (buffer, offset) {
9370 buffer = buffer || Buffer.alloc(64)
9371 this.r.toBuffer(32).copy(buffer, offset)
9372 this.s.toBuffer(32).copy(buffer, offset + 32)
9373 return buffer
9374}
9375
9376ECSignature.prototype.toScriptSignature = function (hashType) {
9377 var hashTypeMod = hashType & ~0x80
9378 if (hashTypeMod <= 0 || hashTypeMod >= 4) throw new Error('Invalid hashType ' + hashType)
9379
9380 var hashTypeBuffer = Buffer.alloc(1)
9381 hashTypeBuffer.writeUInt8(hashType, 0)
9382
9383 return Buffer.concat([this.toDER(), hashTypeBuffer])
9384}
9385
9386module.exports = ECSignature
9387
9388}).call(this,require("buffer").Buffer)
9389},{"./types":80,"bigi":39,"bip66":41,"buffer":5,"typeforce":139}],51:[function(require,module,exports){
9390var Buffer = require('safe-buffer').Buffer
9391var base58check = require('bs58check')
9392var bcrypto = require('./crypto')
9393var createHmac = require('create-hmac')
9394var typeforce = require('typeforce')
9395var types = require('./types')
9396var NETWORKS = require('./networks')
9397
9398var BigInteger = require('bigi')
9399var ECPair = require('./ecpair')
9400
9401var ecurve = require('ecurve')
9402var curve = ecurve.getCurveByName('secp256k1')
9403
9404function HDNode (keyPair, chainCode) {
9405 typeforce(types.tuple('ECPair', types.Buffer256bit), arguments)
9406
9407 if (!keyPair.compressed) throw new TypeError('BIP32 only allows compressed keyPairs')
9408
9409 this.keyPair = keyPair
9410 this.chainCode = chainCode
9411 this.depth = 0
9412 this.index = 0
9413 this.parentFingerprint = 0x00000000
9414}
9415
9416HDNode.HIGHEST_BIT = 0x80000000
9417HDNode.LENGTH = 78
9418HDNode.MASTER_SECRET = Buffer.from('Bitcoin seed', 'utf8')
9419
9420HDNode.fromSeedBuffer = function (seed, network) {
9421 typeforce(types.tuple(types.Buffer, types.maybe(types.Network)), arguments)
9422
9423 if (seed.length < 16) throw new TypeError('Seed should be at least 128 bits')
9424 if (seed.length > 64) throw new TypeError('Seed should be at most 512 bits')
9425
9426 var I = createHmac('sha512', HDNode.MASTER_SECRET).update(seed).digest()
9427 var IL = I.slice(0, 32)
9428 var IR = I.slice(32)
9429
9430 // In case IL is 0 or >= n, the master key is invalid
9431 // This is handled by the ECPair constructor
9432 var pIL = BigInteger.fromBuffer(IL)
9433 var keyPair = new ECPair(pIL, null, {
9434 network: network
9435 })
9436
9437 return new HDNode(keyPair, IR)
9438}
9439
9440HDNode.fromSeedHex = function (hex, network) {
9441 return HDNode.fromSeedBuffer(Buffer.from(hex, 'hex'), network)
9442}
9443
9444HDNode.fromBase58 = function (string, networks) {
9445 var buffer = base58check.decode(string)
9446 if (buffer.length !== 78) throw new Error('Invalid buffer length')
9447
9448 // 4 bytes: version bytes
9449 var version = buffer.readUInt32BE(0)
9450 var network
9451
9452 // list of networks?
9453 if (Array.isArray(networks)) {
9454 network = networks.filter(function (x) {
9455 return version === x.bip32.private ||
9456 version === x.bip32.public
9457 }).pop()
9458
9459 if (!network) throw new Error('Unknown network version')
9460
9461 // otherwise, assume a network object (or default to bitcoin)
9462 } else {
9463 network = networks || NETWORKS.bitcoin
9464 }
9465
9466 if (version !== network.bip32.private &&
9467 version !== network.bip32.public) throw new Error('Invalid network version')
9468
9469 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ...
9470 var depth = buffer[4]
9471
9472 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
9473 var parentFingerprint = buffer.readUInt32BE(5)
9474 if (depth === 0) {
9475 if (parentFingerprint !== 0x00000000) throw new Error('Invalid parent fingerprint')
9476 }
9477
9478 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
9479 // This is encoded in MSB order. (0x00000000 if master key)
9480 var index = buffer.readUInt32BE(9)
9481 if (depth === 0 && index !== 0) throw new Error('Invalid index')
9482
9483 // 32 bytes: the chain code
9484 var chainCode = buffer.slice(13, 45)
9485 var keyPair
9486
9487 // 33 bytes: private key data (0x00 + k)
9488 if (version === network.bip32.private) {
9489 if (buffer.readUInt8(45) !== 0x00) throw new Error('Invalid private key')
9490
9491 var d = BigInteger.fromBuffer(buffer.slice(46, 78))
9492 keyPair = new ECPair(d, null, { network: network })
9493
9494 // 33 bytes: public key data (0x02 + X or 0x03 + X)
9495 } else {
9496 var Q = ecurve.Point.decodeFrom(curve, buffer.slice(45, 78))
9497 // Q.compressed is assumed, if somehow this assumption is broken, `new HDNode` will throw
9498
9499 // Verify that the X coordinate in the public point corresponds to a point on the curve.
9500 // If not, the extended public key is invalid.
9501 curve.validate(Q)
9502
9503 keyPair = new ECPair(null, Q, { network: network })
9504 }
9505
9506 var hd = new HDNode(keyPair, chainCode)
9507 hd.depth = depth
9508 hd.index = index
9509 hd.parentFingerprint = parentFingerprint
9510
9511 return hd
9512}
9513
9514HDNode.prototype.getAddress = function () {
9515 return this.keyPair.getAddress()
9516}
9517
9518HDNode.prototype.getIdentifier = function () {
9519 return bcrypto.hash160(this.keyPair.getPublicKeyBuffer())
9520}
9521
9522HDNode.prototype.getFingerprint = function () {
9523 return this.getIdentifier().slice(0, 4)
9524}
9525
9526HDNode.prototype.getNetwork = function () {
9527 return this.keyPair.getNetwork()
9528}
9529
9530HDNode.prototype.getPublicKeyBuffer = function () {
9531 return this.keyPair.getPublicKeyBuffer()
9532}
9533
9534HDNode.prototype.neutered = function () {
9535 var neuteredKeyPair = new ECPair(null, this.keyPair.Q, {
9536 network: this.keyPair.network
9537 })
9538
9539 var neutered = new HDNode(neuteredKeyPair, this.chainCode)
9540 neutered.depth = this.depth
9541 neutered.index = this.index
9542 neutered.parentFingerprint = this.parentFingerprint
9543
9544 return neutered
9545}
9546
9547HDNode.prototype.sign = function (hash) {
9548 return this.keyPair.sign(hash)
9549}
9550
9551HDNode.prototype.verify = function (hash, signature) {
9552 return this.keyPair.verify(hash, signature)
9553}
9554
9555HDNode.prototype.toBase58 = function (__isPrivate) {
9556 if (__isPrivate !== undefined) throw new TypeError('Unsupported argument in 2.0.0')
9557
9558 // Version
9559 var network = this.keyPair.network
9560 var version = (!this.isNeutered()) ? network.bip32.private : network.bip32.public
9561 var buffer = Buffer.allocUnsafe(78)
9562
9563 // 4 bytes: version bytes
9564 buffer.writeUInt32BE(version, 0)
9565
9566 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ....
9567 buffer.writeUInt8(this.depth, 4)
9568
9569 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
9570 buffer.writeUInt32BE(this.parentFingerprint, 5)
9571
9572 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
9573 // This is encoded in big endian. (0x00000000 if master key)
9574 buffer.writeUInt32BE(this.index, 9)
9575
9576 // 32 bytes: the chain code
9577 this.chainCode.copy(buffer, 13)
9578
9579 // 33 bytes: the public key or private key data
9580 if (!this.isNeutered()) {
9581 // 0x00 + k for private keys
9582 buffer.writeUInt8(0, 45)
9583 this.keyPair.d.toBuffer(32).copy(buffer, 46)
9584
9585 // 33 bytes: the public key
9586 } else {
9587 // X9.62 encoding for public keys
9588 this.keyPair.getPublicKeyBuffer().copy(buffer, 45)
9589 }
9590
9591 return base58check.encode(buffer)
9592}
9593
9594// https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#child-key-derivation-ckd-functions
9595HDNode.prototype.derive = function (index) {
9596 typeforce(types.UInt32, index)
9597
9598 var isHardened = index >= HDNode.HIGHEST_BIT
9599 var data = Buffer.allocUnsafe(37)
9600
9601 // Hardened child
9602 if (isHardened) {
9603 if (this.isNeutered()) throw new TypeError('Could not derive hardened child key')
9604
9605 // data = 0x00 || ser256(kpar) || ser32(index)
9606 data[0] = 0x00
9607 this.keyPair.d.toBuffer(32).copy(data, 1)
9608 data.writeUInt32BE(index, 33)
9609
9610 // Normal child
9611 } else {
9612 // data = serP(point(kpar)) || ser32(index)
9613 // = serP(Kpar) || ser32(index)
9614 this.keyPair.getPublicKeyBuffer().copy(data, 0)
9615 data.writeUInt32BE(index, 33)
9616 }
9617
9618 var I = createHmac('sha512', this.chainCode).update(data).digest()
9619 var IL = I.slice(0, 32)
9620 var IR = I.slice(32)
9621
9622 var pIL = BigInteger.fromBuffer(IL)
9623
9624 // In case parse256(IL) >= n, proceed with the next value for i
9625 if (pIL.compareTo(curve.n) >= 0) {
9626 return this.derive(index + 1)
9627 }
9628
9629 // Private parent key -> private child key
9630 var derivedKeyPair
9631 if (!this.isNeutered()) {
9632 // ki = parse256(IL) + kpar (mod n)
9633 var ki = pIL.add(this.keyPair.d).mod(curve.n)
9634
9635 // In case ki == 0, proceed with the next value for i
9636 if (ki.signum() === 0) {
9637 return this.derive(index + 1)
9638 }
9639
9640 derivedKeyPair = new ECPair(ki, null, {
9641 network: this.keyPair.network
9642 })
9643
9644 // Public parent key -> public child key
9645 } else {
9646 // Ki = point(parse256(IL)) + Kpar
9647 // = G*IL + Kpar
9648 var Ki = curve.G.multiply(pIL).add(this.keyPair.Q)
9649
9650 // In case Ki is the point at infinity, proceed with the next value for i
9651 if (curve.isInfinity(Ki)) {
9652 return this.derive(index + 1)
9653 }
9654
9655 derivedKeyPair = new ECPair(null, Ki, {
9656 network: this.keyPair.network
9657 })
9658 }
9659
9660 var hd = new HDNode(derivedKeyPair, IR)
9661 hd.depth = this.depth + 1
9662 hd.index = index
9663 hd.parentFingerprint = this.getFingerprint().readUInt32BE(0)
9664
9665 return hd
9666}
9667
9668HDNode.prototype.deriveHardened = function (index) {
9669 typeforce(types.UInt31, index)
9670
9671 // Only derives hardened private keys by default
9672 return this.derive(index + HDNode.HIGHEST_BIT)
9673}
9674
9675// Private === not neutered
9676// Public === neutered
9677HDNode.prototype.isNeutered = function () {
9678 return !(this.keyPair.d)
9679}
9680
9681HDNode.prototype.derivePath = function (path) {
9682 typeforce(types.BIP32Path, path)
9683
9684 var splitPath = path.split('/')
9685 if (splitPath[0] === 'm') {
9686 if (this.parentFingerprint) {
9687 throw new Error('Not a master node')
9688 }
9689
9690 splitPath = splitPath.slice(1)
9691 }
9692
9693 return splitPath.reduce(function (prevHd, indexStr) {
9694 var index
9695 if (indexStr.slice(-1) === "'") {
9696 index = parseInt(indexStr.slice(0, -1), 10)
9697 return prevHd.deriveHardened(index)
9698 } else {
9699 index = parseInt(indexStr, 10)
9700 return prevHd.derive(index)
9701 }
9702 }, this)
9703}
9704
9705module.exports = HDNode
9706
9707},{"./crypto":47,"./ecpair":49,"./networks":53,"./types":80,"bigi":39,"bs58check":85,"create-hmac":90,"ecurve":94,"safe-buffer":128,"typeforce":139}],52:[function(require,module,exports){
9708var script = require('./script')
9709
9710var templates = require('./templates')
9711for (var key in templates) {
9712 script[key] = templates[key]
9713}
9714
9715module.exports = {
9716 bufferutils: require('./bufferutils'), // TODO: remove in 4.0.0
9717
9718 Block: require('./block'),
9719 ECPair: require('./ecpair'),
9720 ECSignature: require('./ecsignature'),
9721 HDNode: require('./hdnode'),
9722 Transaction: require('./transaction'),
9723 TransactionBuilder: require('./transaction_builder'),
9724
9725 address: require('./address'),
9726 crypto: require('./crypto'),
9727 networks: require('./networks'),
9728 opcodes: require('bitcoin-ops'),
9729 script: script
9730}
9731
9732},{"./address":44,"./block":45,"./bufferutils":46,"./crypto":47,"./ecpair":49,"./ecsignature":50,"./hdnode":51,"./networks":53,"./script":54,"./templates":56,"./transaction":78,"./transaction_builder":79,"bitcoin-ops":42}],53:[function(require,module,exports){
9733// https://en.bitcoin.it/wiki/List_of_address_prefixes
9734// Dogecoin BIP32 is a proposed standard: https://bitcointalk.org/index.php?topic=409731
9735
9736module.exports = {
9737 bitcoin: {
9738 messagePrefix: '\x18Bitcoin Signed Message:\n',
9739 bech32: 'bc',
9740 bip32: {
9741 public: 0x0488b21e,
9742 private: 0x0488ade4
9743 },
9744 pubKeyHash: 0x00,
9745 scriptHash: 0x05,
9746 wif: 0x80
9747 },
9748 testnet: {
9749 messagePrefix: '\x18Bitcoin Signed Message:\n',
9750 bech32: 'tb',
9751 bip32: {
9752 public: 0x043587cf,
9753 private: 0x04358394
9754 },
9755 pubKeyHash: 0x6f,
9756 scriptHash: 0xc4,
9757 wif: 0xef
9758 },
9759 litecoin: {
9760 messagePrefix: '\x19Litecoin Signed Message:\n',
9761 bip32: {
9762 public: 0x019da462,
9763 private: 0x019d9cfe
9764 },
9765 pubKeyHash: 0x30,
9766 scriptHash: 0x32,
9767 wif: 0xb0
9768 }
9769}
9770
9771},{}],54:[function(require,module,exports){
9772var Buffer = require('safe-buffer').Buffer
9773var bip66 = require('bip66')
9774var pushdata = require('pushdata-bitcoin')
9775var typeforce = require('typeforce')
9776var types = require('./types')
9777var scriptNumber = require('./script_number')
9778
9779var OPS = require('bitcoin-ops')
9780var REVERSE_OPS = require('bitcoin-ops/map')
9781var OP_INT_BASE = OPS.OP_RESERVED // OP_1 - 1
9782
9783function isOPInt (value) {
9784 return types.Number(value) &&
9785 ((value === OPS.OP_0) ||
9786 (value >= OPS.OP_1 && value <= OPS.OP_16) ||
9787 (value === OPS.OP_1NEGATE))
9788}
9789
9790function isPushOnlyChunk (value) {
9791 return types.Buffer(value) || isOPInt(value)
9792}
9793
9794function isPushOnly (value) {
9795 return types.Array(value) && value.every(isPushOnlyChunk)
9796}
9797
9798function asMinimalOP (buffer) {
9799 if (buffer.length === 0) return OPS.OP_0
9800 if (buffer.length !== 1) return
9801 if (buffer[0] >= 1 && buffer[0] <= 16) return OP_INT_BASE + buffer[0]
9802 if (buffer[0] === 0x81) return OPS.OP_1NEGATE
9803}
9804
9805function compile (chunks) {
9806 // TODO: remove me
9807 if (Buffer.isBuffer(chunks)) return chunks
9808
9809 typeforce(types.Array, chunks)
9810
9811 var bufferSize = chunks.reduce(function (accum, chunk) {
9812 // data chunk
9813 if (Buffer.isBuffer(chunk)) {
9814 // adhere to BIP62.3, minimal push policy
9815 if (chunk.length === 1 && asMinimalOP(chunk) !== undefined) {
9816 return accum + 1
9817 }
9818
9819 return accum + pushdata.encodingLength(chunk.length) + chunk.length
9820 }
9821
9822 // opcode
9823 return accum + 1
9824 }, 0.0)
9825
9826 var buffer = Buffer.allocUnsafe(bufferSize)
9827 var offset = 0
9828
9829 chunks.forEach(function (chunk) {
9830 // data chunk
9831 if (Buffer.isBuffer(chunk)) {
9832 // adhere to BIP62.3, minimal push policy
9833 var opcode = asMinimalOP(chunk)
9834 if (opcode !== undefined) {
9835 buffer.writeUInt8(opcode, offset)
9836 offset += 1
9837 return
9838 }
9839
9840 offset += pushdata.encode(buffer, chunk.length, offset)
9841 chunk.copy(buffer, offset)
9842 offset += chunk.length
9843
9844 // opcode
9845 } else {
9846 buffer.writeUInt8(chunk, offset)
9847 offset += 1
9848 }
9849 })
9850
9851 if (offset !== buffer.length) throw new Error('Could not decode chunks')
9852 return buffer
9853}
9854
9855function decompile (buffer) {
9856 // TODO: remove me
9857 if (types.Array(buffer)) return buffer
9858
9859 typeforce(types.Buffer, buffer)
9860
9861 var chunks = []
9862 var i = 0
9863
9864 while (i < buffer.length) {
9865 var opcode = buffer[i]
9866
9867 // data chunk
9868 if ((opcode > OPS.OP_0) && (opcode <= OPS.OP_PUSHDATA4)) {
9869 var d = pushdata.decode(buffer, i)
9870
9871 // did reading a pushDataInt fail? empty script
9872 if (d === null) return []
9873 i += d.size
9874
9875 // attempt to read too much data? empty script
9876 if (i + d.number > buffer.length) return []
9877
9878 var data = buffer.slice(i, i + d.number)
9879 i += d.number
9880
9881 // decompile minimally
9882 var op = asMinimalOP(data)
9883 if (op !== undefined) {
9884 chunks.push(op)
9885 } else {
9886 chunks.push(data)
9887 }
9888
9889 // opcode
9890 } else {
9891 chunks.push(opcode)
9892
9893 i += 1
9894 }
9895 }
9896
9897 return chunks
9898}
9899
9900function toASM (chunks) {
9901 if (Buffer.isBuffer(chunks)) {
9902 chunks = decompile(chunks)
9903 }
9904
9905 return chunks.map(function (chunk) {
9906 // data?
9907 if (Buffer.isBuffer(chunk)) {
9908 var op = asMinimalOP(chunk)
9909 if (op === undefined) return chunk.toString('hex')
9910 chunk = op
9911 }
9912
9913 // opcode!
9914 return REVERSE_OPS[chunk]
9915 }).join(' ')
9916}
9917
9918function fromASM (asm) {
9919 typeforce(types.String, asm)
9920
9921 return compile(asm.split(' ').map(function (chunkStr) {
9922 // opcode?
9923 if (OPS[chunkStr] !== undefined) return OPS[chunkStr]
9924 typeforce(types.Hex, chunkStr)
9925
9926 // data!
9927 return Buffer.from(chunkStr, 'hex')
9928 }))
9929}
9930
9931function toStack (chunks) {
9932 chunks = decompile(chunks)
9933 typeforce(isPushOnly, chunks)
9934
9935 return chunks.map(function (op) {
9936 if (Buffer.isBuffer(op)) return op
9937 if (op === OPS.OP_0) return Buffer.allocUnsafe(0)
9938
9939 return scriptNumber.encode(op - OP_INT_BASE)
9940 })
9941}
9942
9943function isCanonicalPubKey (buffer) {
9944 if (!Buffer.isBuffer(buffer)) return false
9945 if (buffer.length < 33) return false
9946
9947 switch (buffer[0]) {
9948 case 0x02:
9949 case 0x03:
9950 return buffer.length === 33
9951 case 0x04:
9952 return buffer.length === 65
9953 }
9954
9955 return false
9956}
9957
9958function isDefinedHashType (hashType) {
9959 var hashTypeMod = hashType & ~0x80
9960
9961// return hashTypeMod > SIGHASH_ALL && hashTypeMod < SIGHASH_SINGLE
9962 return hashTypeMod > 0x00 && hashTypeMod < 0x04
9963}
9964
9965function isCanonicalSignature (buffer) {
9966 if (!Buffer.isBuffer(buffer)) return false
9967 if (!isDefinedHashType(buffer[buffer.length - 1])) return false
9968
9969 return bip66.check(buffer.slice(0, -1))
9970}
9971
9972module.exports = {
9973 compile: compile,
9974 decompile: decompile,
9975 fromASM: fromASM,
9976 toASM: toASM,
9977 toStack: toStack,
9978
9979 number: require('./script_number'),
9980
9981 isCanonicalPubKey: isCanonicalPubKey,
9982 isCanonicalSignature: isCanonicalSignature,
9983 isPushOnly: isPushOnly,
9984 isDefinedHashType: isDefinedHashType
9985}
9986
9987},{"./script_number":55,"./types":80,"bip66":41,"bitcoin-ops":42,"bitcoin-ops/map":43,"pushdata-bitcoin":125,"safe-buffer":128,"typeforce":139}],55:[function(require,module,exports){
9988var Buffer = require('safe-buffer').Buffer
9989
9990function decode (buffer, maxLength, minimal) {
9991 maxLength = maxLength || 4
9992 minimal = minimal === undefined ? true : minimal
9993
9994 var length = buffer.length
9995 if (length === 0) return 0
9996 if (length > maxLength) throw new TypeError('Script number overflow')
9997 if (minimal) {
9998 if ((buffer[length - 1] & 0x7f) === 0) {
9999 if (length <= 1 || (buffer[length - 2] & 0x80) === 0) throw new Error('Non-minimally encoded script number')
10000 }
10001 }
10002
10003 // 40-bit
10004 if (length === 5) {
10005 var a = buffer.readUInt32LE(0)
10006 var b = buffer.readUInt8(4)
10007
10008 if (b & 0x80) return -(((b & ~0x80) * 0x100000000) + a)
10009 return (b * 0x100000000) + a
10010 }
10011
10012 var result = 0
10013
10014 // 32-bit / 24-bit / 16-bit / 8-bit
10015 for (var i = 0; i < length; ++i) {
10016 result |= buffer[i] << (8 * i)
10017 }
10018
10019 if (buffer[length - 1] & 0x80) return -(result & ~(0x80 << (8 * (length - 1))))
10020 return result
10021}
10022
10023function scriptNumSize (i) {
10024 return i > 0x7fffffff ? 5
10025 : i > 0x7fffff ? 4
10026 : i > 0x7fff ? 3
10027 : i > 0x7f ? 2
10028 : i > 0x00 ? 1
10029 : 0
10030}
10031
10032function encode (number) {
10033 var value = Math.abs(number)
10034 var size = scriptNumSize(value)
10035 var buffer = Buffer.allocUnsafe(size)
10036 var negative = number < 0
10037
10038 for (var i = 0; i < size; ++i) {
10039 buffer.writeUInt8(value & 0xff, i)
10040 value >>= 8
10041 }
10042
10043 if (buffer[size - 1] & 0x80) {
10044 buffer.writeUInt8(negative ? 0x80 : 0x00, size - 1)
10045 } else if (negative) {
10046 buffer[size - 1] |= 0x80
10047 }
10048
10049 return buffer
10050}
10051
10052module.exports = {
10053 decode: decode,
10054 encode: encode
10055}
10056
10057},{"safe-buffer":128}],56:[function(require,module,exports){
10058var decompile = require('../script').decompile
10059var multisig = require('./multisig')
10060var nullData = require('./nulldata')
10061var pubKey = require('./pubkey')
10062var pubKeyHash = require('./pubkeyhash')
10063var scriptHash = require('./scripthash')
10064var witnessPubKeyHash = require('./witnesspubkeyhash')
10065var witnessScriptHash = require('./witnessscripthash')
10066var witnessCommitment = require('./witnesscommitment')
10067
10068var types = {
10069 MULTISIG: 'multisig',
10070 NONSTANDARD: 'nonstandard',
10071 NULLDATA: 'nulldata',
10072 P2PK: 'pubkey',
10073 P2PKH: 'pubkeyhash',
10074 P2SH: 'scripthash',
10075 P2WPKH: 'witnesspubkeyhash',
10076 P2WSH: 'witnessscripthash',
10077 WITNESS_COMMITMENT: 'witnesscommitment'
10078}
10079
10080function classifyOutput (script) {
10081 if (witnessPubKeyHash.output.check(script)) return types.P2WPKH
10082 if (witnessScriptHash.output.check(script)) return types.P2WSH
10083 if (pubKeyHash.output.check(script)) return types.P2PKH
10084 if (scriptHash.output.check(script)) return types.P2SH
10085
10086 // XXX: optimization, below functions .decompile before use
10087 var chunks = decompile(script)
10088 if (multisig.output.check(chunks)) return types.MULTISIG
10089 if (pubKey.output.check(chunks)) return types.P2PK
10090 if (witnessCommitment.output.check(chunks)) return types.WITNESS_COMMITMENT
10091 if (nullData.output.check(chunks)) return types.NULLDATA
10092
10093 return types.NONSTANDARD
10094}
10095
10096function classifyInput (script, allowIncomplete) {
10097 // XXX: optimization, below functions .decompile before use
10098 var chunks = decompile(script)
10099
10100 if (pubKeyHash.input.check(chunks)) return types.P2PKH
10101 if (scriptHash.input.check(chunks, allowIncomplete)) return types.P2SH
10102 if (multisig.input.check(chunks, allowIncomplete)) return types.MULTISIG
10103 if (pubKey.input.check(chunks)) return types.P2PK
10104
10105 return types.NONSTANDARD
10106}
10107
10108function classifyWitness (script, allowIncomplete) {
10109 // XXX: optimization, below functions .decompile before use
10110 var chunks = decompile(script)
10111
10112 if (witnessPubKeyHash.input.check(chunks)) return types.P2WPKH
10113 if (witnessScriptHash.input.check(chunks, allowIncomplete)) return types.P2WSH
10114
10115 return types.NONSTANDARD
10116}
10117
10118module.exports = {
10119 classifyInput: classifyInput,
10120 classifyOutput: classifyOutput,
10121 classifyWitness: classifyWitness,
10122 multisig: multisig,
10123 nullData: nullData,
10124 pubKey: pubKey,
10125 pubKeyHash: pubKeyHash,
10126 scriptHash: scriptHash,
10127 witnessPubKeyHash: witnessPubKeyHash,
10128 witnessScriptHash: witnessScriptHash,
10129 witnessCommitment: witnessCommitment,
10130 types: types
10131}
10132
10133},{"../script":54,"./multisig":57,"./nulldata":60,"./pubkey":61,"./pubkeyhash":64,"./scripthash":67,"./witnesscommitment":70,"./witnesspubkeyhash":72,"./witnessscripthash":75}],57:[function(require,module,exports){
10134module.exports = {
10135 input: require('./input'),
10136 output: require('./output')
10137}
10138
10139},{"./input":58,"./output":59}],58:[function(require,module,exports){
10140// OP_0 [signatures ...]
10141
10142var Buffer = require('safe-buffer').Buffer
10143var bscript = require('../../script')
10144var p2mso = require('./output')
10145var typeforce = require('typeforce')
10146var OPS = require('bitcoin-ops')
10147
10148function partialSignature (value) {
10149 return value === OPS.OP_0 || bscript.isCanonicalSignature(value)
10150}
10151
10152function check (script, allowIncomplete) {
10153 var chunks = bscript.decompile(script)
10154 if (chunks.length < 2) return false
10155 if (chunks[0] !== OPS.OP_0) return false
10156
10157 if (allowIncomplete) {
10158 return chunks.slice(1).every(partialSignature)
10159 }
10160
10161 return chunks.slice(1).every(bscript.isCanonicalSignature)
10162}
10163check.toJSON = function () { return 'multisig input' }
10164
10165var EMPTY_BUFFER = Buffer.allocUnsafe(0)
10166
10167function encodeStack (signatures, scriptPubKey) {
10168 typeforce([partialSignature], signatures)
10169
10170 if (scriptPubKey) {
10171 var scriptData = p2mso.decode(scriptPubKey)
10172
10173 if (signatures.length < scriptData.m) {
10174 throw new TypeError('Not enough signatures provided')
10175 }
10176
10177 if (signatures.length > scriptData.pubKeys.length) {
10178 throw new TypeError('Too many signatures provided')
10179 }
10180 }
10181
10182 return [].concat(EMPTY_BUFFER, signatures.map(function (sig) {
10183 if (sig === OPS.OP_0) {
10184 return EMPTY_BUFFER
10185 }
10186 return sig
10187 }))
10188}
10189
10190function encode (signatures, scriptPubKey) {
10191 return bscript.compile(encodeStack(signatures, scriptPubKey))
10192}
10193
10194function decodeStack (stack, allowIncomplete) {
10195 typeforce(check, stack, allowIncomplete)
10196 return stack.slice(1)
10197}
10198
10199function decode (buffer, allowIncomplete) {
10200 var stack = bscript.decompile(buffer)
10201 return decodeStack(stack, allowIncomplete)
10202}
10203
10204module.exports = {
10205 check: check,
10206 decode: decode,
10207 decodeStack: decodeStack,
10208 encode: encode,
10209 encodeStack: encodeStack
10210}
10211
10212},{"../../script":54,"./output":59,"bitcoin-ops":42,"safe-buffer":128,"typeforce":139}],59:[function(require,module,exports){
10213// m [pubKeys ...] n OP_CHECKMULTISIG
10214
10215var bscript = require('../../script')
10216var types = require('../../types')
10217var typeforce = require('typeforce')
10218var OPS = require('bitcoin-ops')
10219var OP_INT_BASE = OPS.OP_RESERVED // OP_1 - 1
10220
10221function check (script, allowIncomplete) {
10222 var chunks = bscript.decompile(script)
10223
10224 if (chunks.length < 4) return false
10225 if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG) return false
10226 if (!types.Number(chunks[0])) return false
10227 if (!types.Number(chunks[chunks.length - 2])) return false
10228 var m = chunks[0] - OP_INT_BASE
10229 var n = chunks[chunks.length - 2] - OP_INT_BASE
10230
10231 if (m <= 0) return false
10232 if (n > 16) return false
10233 if (m > n) return false
10234 if (n !== chunks.length - 3) return false
10235 if (allowIncomplete) return true
10236
10237 var keys = chunks.slice(1, -2)
10238 return keys.every(bscript.isCanonicalPubKey)
10239}
10240check.toJSON = function () { return 'multi-sig output' }
10241
10242function encode (m, pubKeys) {
10243 typeforce({
10244 m: types.Number,
10245 pubKeys: [bscript.isCanonicalPubKey]
10246 }, {
10247 m: m,
10248 pubKeys: pubKeys
10249 })
10250
10251 var n = pubKeys.length
10252 if (n < m) throw new TypeError('Not enough pubKeys provided')
10253
10254 return bscript.compile([].concat(
10255 OP_INT_BASE + m,
10256 pubKeys,
10257 OP_INT_BASE + n,
10258 OPS.OP_CHECKMULTISIG
10259 ))
10260}
10261
10262function decode (buffer, allowIncomplete) {
10263 var chunks = bscript.decompile(buffer)
10264 typeforce(check, chunks, allowIncomplete)
10265
10266 return {
10267 m: chunks[0] - OP_INT_BASE,
10268 pubKeys: chunks.slice(1, -2)
10269 }
10270}
10271
10272module.exports = {
10273 check: check,
10274 decode: decode,
10275 encode: encode
10276}
10277
10278},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":139}],60:[function(require,module,exports){
10279// OP_RETURN {data}
10280
10281var bscript = require('../script')
10282var types = require('../types')
10283var typeforce = require('typeforce')
10284var OPS = require('bitcoin-ops')
10285
10286function check (script) {
10287 var buffer = bscript.compile(script)
10288
10289 return buffer.length > 1 &&
10290 buffer[0] === OPS.OP_RETURN
10291}
10292check.toJSON = function () { return 'null data output' }
10293
10294function encode (data) {
10295 typeforce(types.Buffer, data)
10296
10297 return bscript.compile([OPS.OP_RETURN, data])
10298}
10299
10300function decode (buffer) {
10301 typeforce(check, buffer)
10302
10303 return buffer.slice(2)
10304}
10305
10306module.exports = {
10307 output: {
10308 check: check,
10309 decode: decode,
10310 encode: encode
10311 }
10312}
10313
10314},{"../script":54,"../types":80,"bitcoin-ops":42,"typeforce":139}],61:[function(require,module,exports){
10315arguments[4][57][0].apply(exports,arguments)
10316},{"./input":62,"./output":63,"dup":57}],62:[function(require,module,exports){
10317// {signature}
10318
10319var bscript = require('../../script')
10320var typeforce = require('typeforce')
10321
10322function check (script) {
10323 var chunks = bscript.decompile(script)
10324
10325 return chunks.length === 1 &&
10326 bscript.isCanonicalSignature(chunks[0])
10327}
10328check.toJSON = function () { return 'pubKey input' }
10329
10330function encodeStack (signature) {
10331 typeforce(bscript.isCanonicalSignature, signature)
10332 return [signature]
10333}
10334
10335function encode (signature) {
10336 return bscript.compile(encodeStack(signature))
10337}
10338
10339function decodeStack (stack) {
10340 typeforce(check, stack)
10341 return stack[0]
10342}
10343
10344function decode (buffer) {
10345 var stack = bscript.decompile(buffer)
10346 return decodeStack(stack)
10347}
10348
10349module.exports = {
10350 check: check,
10351 decode: decode,
10352 decodeStack: decodeStack,
10353 encode: encode,
10354 encodeStack: encodeStack
10355}
10356
10357},{"../../script":54,"typeforce":139}],63:[function(require,module,exports){
10358// {pubKey} OP_CHECKSIG
10359
10360var bscript = require('../../script')
10361var typeforce = require('typeforce')
10362var OPS = require('bitcoin-ops')
10363
10364function check (script) {
10365 var chunks = bscript.decompile(script)
10366
10367 return chunks.length === 2 &&
10368 bscript.isCanonicalPubKey(chunks[0]) &&
10369 chunks[1] === OPS.OP_CHECKSIG
10370}
10371check.toJSON = function () { return 'pubKey output' }
10372
10373function encode (pubKey) {
10374 typeforce(bscript.isCanonicalPubKey, pubKey)
10375
10376 return bscript.compile([pubKey, OPS.OP_CHECKSIG])
10377}
10378
10379function decode (buffer) {
10380 var chunks = bscript.decompile(buffer)
10381 typeforce(check, chunks)
10382
10383 return chunks[0]
10384}
10385
10386module.exports = {
10387 check: check,
10388 decode: decode,
10389 encode: encode
10390}
10391
10392},{"../../script":54,"bitcoin-ops":42,"typeforce":139}],64:[function(require,module,exports){
10393arguments[4][57][0].apply(exports,arguments)
10394},{"./input":65,"./output":66,"dup":57}],65:[function(require,module,exports){
10395// {signature} {pubKey}
10396
10397var bscript = require('../../script')
10398var typeforce = require('typeforce')
10399
10400function check (script) {
10401 var chunks = bscript.decompile(script)
10402
10403 return chunks.length === 2 &&
10404 bscript.isCanonicalSignature(chunks[0]) &&
10405 bscript.isCanonicalPubKey(chunks[1])
10406}
10407check.toJSON = function () { return 'pubKeyHash input' }
10408
10409function encodeStack (signature, pubKey) {
10410 typeforce({
10411 signature: bscript.isCanonicalSignature,
10412 pubKey: bscript.isCanonicalPubKey
10413 }, {
10414 signature: signature,
10415 pubKey: pubKey
10416 })
10417
10418 return [signature, pubKey]
10419}
10420
10421function encode (signature, pubKey) {
10422 return bscript.compile(encodeStack(signature, pubKey))
10423}
10424
10425function decodeStack (stack) {
10426 typeforce(check, stack)
10427
10428 return {
10429 signature: stack[0],
10430 pubKey: stack[1]
10431 }
10432}
10433
10434function decode (buffer) {
10435 var stack = bscript.decompile(buffer)
10436 return decodeStack(stack)
10437}
10438
10439module.exports = {
10440 check: check,
10441 decode: decode,
10442 decodeStack: decodeStack,
10443 encode: encode,
10444 encodeStack: encodeStack
10445}
10446
10447},{"../../script":54,"typeforce":139}],66:[function(require,module,exports){
10448// OP_DUP OP_HASH160 {pubKeyHash} OP_EQUALVERIFY OP_CHECKSIG
10449
10450var bscript = require('../../script')
10451var types = require('../../types')
10452var typeforce = require('typeforce')
10453var OPS = require('bitcoin-ops')
10454
10455function check (script) {
10456 var buffer = bscript.compile(script)
10457
10458 return buffer.length === 25 &&
10459 buffer[0] === OPS.OP_DUP &&
10460 buffer[1] === OPS.OP_HASH160 &&
10461 buffer[2] === 0x14 &&
10462 buffer[23] === OPS.OP_EQUALVERIFY &&
10463 buffer[24] === OPS.OP_CHECKSIG
10464}
10465check.toJSON = function () { return 'pubKeyHash output' }
10466
10467function encode (pubKeyHash) {
10468 typeforce(types.Hash160bit, pubKeyHash)
10469
10470 return bscript.compile([
10471 OPS.OP_DUP,
10472 OPS.OP_HASH160,
10473 pubKeyHash,
10474 OPS.OP_EQUALVERIFY,
10475 OPS.OP_CHECKSIG
10476 ])
10477}
10478
10479function decode (buffer) {
10480 typeforce(check, buffer)
10481
10482 return buffer.slice(3, 23)
10483}
10484
10485module.exports = {
10486 check: check,
10487 decode: decode,
10488 encode: encode
10489}
10490
10491},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":139}],67:[function(require,module,exports){
10492arguments[4][57][0].apply(exports,arguments)
10493},{"./input":68,"./output":69,"dup":57}],68:[function(require,module,exports){
10494// <scriptSig> {serialized scriptPubKey script}
10495
10496var Buffer = require('safe-buffer').Buffer
10497var bscript = require('../../script')
10498var typeforce = require('typeforce')
10499
10500var p2ms = require('../multisig/')
10501var p2pk = require('../pubkey/')
10502var p2pkh = require('../pubkeyhash/')
10503var p2wpkho = require('../witnesspubkeyhash/output')
10504var p2wsho = require('../witnessscripthash/output')
10505
10506function check (script, allowIncomplete) {
10507 var chunks = bscript.decompile(script)
10508 if (chunks.length < 1) return false
10509
10510 var lastChunk = chunks[chunks.length - 1]
10511 if (!Buffer.isBuffer(lastChunk)) return false
10512
10513 var scriptSigChunks = bscript.decompile(bscript.compile(chunks.slice(0, -1)))
10514 var redeemScriptChunks = bscript.decompile(lastChunk)
10515
10516 // is redeemScript a valid script?
10517 if (redeemScriptChunks.length === 0) return false
10518
10519 // is redeemScriptSig push only?
10520 if (!bscript.isPushOnly(scriptSigChunks)) return false
10521
10522 // is witness?
10523 if (chunks.length === 1) {
10524 return p2wsho.check(redeemScriptChunks) ||
10525 p2wpkho.check(redeemScriptChunks)
10526 }
10527
10528 // match types
10529 if (p2pkh.input.check(scriptSigChunks) &&
10530 p2pkh.output.check(redeemScriptChunks)) return true
10531
10532 if (p2ms.input.check(scriptSigChunks, allowIncomplete) &&
10533 p2ms.output.check(redeemScriptChunks)) return true
10534
10535 if (p2pk.input.check(scriptSigChunks) &&
10536 p2pk.output.check(redeemScriptChunks)) return true
10537
10538 return false
10539}
10540check.toJSON = function () { return 'scriptHash input' }
10541
10542function encodeStack (redeemScriptStack, redeemScript) {
10543 var serializedScriptPubKey = bscript.compile(redeemScript)
10544
10545 return [].concat(redeemScriptStack, serializedScriptPubKey)
10546}
10547
10548function encode (redeemScriptSig, redeemScript) {
10549 var redeemScriptStack = bscript.decompile(redeemScriptSig)
10550
10551 return bscript.compile(encodeStack(redeemScriptStack, redeemScript))
10552}
10553
10554function decodeStack (stack) {
10555 typeforce(check, stack)
10556
10557 return {
10558 redeemScriptStack: stack.slice(0, -1),
10559 redeemScript: stack[stack.length - 1]
10560 }
10561}
10562
10563function decode (buffer) {
10564 var stack = bscript.decompile(buffer)
10565 var result = decodeStack(stack)
10566 result.redeemScriptSig = bscript.compile(result.redeemScriptStack)
10567 delete result.redeemScriptStack
10568 return result
10569}
10570
10571module.exports = {
10572 check: check,
10573 decode: decode,
10574 decodeStack: decodeStack,
10575 encode: encode,
10576 encodeStack: encodeStack
10577}
10578
10579},{"../../script":54,"../multisig/":57,"../pubkey/":61,"../pubkeyhash/":64,"../witnesspubkeyhash/output":74,"../witnessscripthash/output":77,"safe-buffer":128,"typeforce":139}],69:[function(require,module,exports){
10580// OP_HASH160 {scriptHash} OP_EQUAL
10581
10582var bscript = require('../../script')
10583var types = require('../../types')
10584var typeforce = require('typeforce')
10585var OPS = require('bitcoin-ops')
10586
10587function check (script) {
10588 var buffer = bscript.compile(script)
10589
10590 return buffer.length === 23 &&
10591 buffer[0] === OPS.OP_HASH160 &&
10592 buffer[1] === 0x14 &&
10593 buffer[22] === OPS.OP_EQUAL
10594}
10595check.toJSON = function () { return 'scriptHash output' }
10596
10597function encode (scriptHash) {
10598 typeforce(types.Hash160bit, scriptHash)
10599
10600 return bscript.compile([OPS.OP_HASH160, scriptHash, OPS.OP_EQUAL])
10601}
10602
10603function decode (buffer) {
10604 typeforce(check, buffer)
10605
10606 return buffer.slice(2, 22)
10607}
10608
10609module.exports = {
10610 check: check,
10611 decode: decode,
10612 encode: encode
10613}
10614
10615},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":139}],70:[function(require,module,exports){
10616module.exports = {
10617 output: require('./output')
10618}
10619
10620},{"./output":71}],71:[function(require,module,exports){
10621// OP_RETURN {aa21a9ed} {commitment}
10622
10623var Buffer = require('safe-buffer').Buffer
10624var bscript = require('../../script')
10625var types = require('../../types')
10626var typeforce = require('typeforce')
10627var OPS = require('bitcoin-ops')
10628
10629var HEADER = Buffer.from('aa21a9ed', 'hex')
10630
10631function check (script) {
10632 var buffer = bscript.compile(script)
10633
10634 return buffer.length > 37 &&
10635 buffer[0] === OPS.OP_RETURN &&
10636 buffer[1] === 0x24 &&
10637 buffer.slice(2, 6).equals(HEADER)
10638}
10639
10640check.toJSON = function () { return 'Witness commitment output' }
10641
10642function encode (commitment) {
10643 typeforce(types.Hash256bit, commitment)
10644
10645 var buffer = Buffer.allocUnsafe(36)
10646 HEADER.copy(buffer, 0)
10647 commitment.copy(buffer, 4)
10648
10649 return bscript.compile([OPS.OP_RETURN, buffer])
10650}
10651
10652function decode (buffer) {
10653 typeforce(check, buffer)
10654
10655 return bscript.decompile(buffer)[1].slice(4, 36)
10656}
10657
10658module.exports = {
10659 check: check,
10660 decode: decode,
10661 encode: encode
10662}
10663
10664},{"../../script":54,"../../types":80,"bitcoin-ops":42,"safe-buffer":128,"typeforce":139}],72:[function(require,module,exports){
10665arguments[4][57][0].apply(exports,arguments)
10666},{"./input":73,"./output":74,"dup":57}],73:[function(require,module,exports){
10667// {signature} {pubKey}
10668
10669var bscript = require('../../script')
10670var typeforce = require('typeforce')
10671
10672function isCompressedCanonicalPubKey (pubKey) {
10673 return bscript.isCanonicalPubKey(pubKey) && pubKey.length === 33
10674}
10675
10676function check (script) {
10677 var chunks = bscript.decompile(script)
10678
10679 return chunks.length === 2 &&
10680 bscript.isCanonicalSignature(chunks[0]) &&
10681 isCompressedCanonicalPubKey(chunks[1])
10682}
10683check.toJSON = function () { return 'witnessPubKeyHash input' }
10684
10685function encodeStack (signature, pubKey) {
10686 typeforce({
10687 signature: bscript.isCanonicalSignature,
10688 pubKey: isCompressedCanonicalPubKey
10689 }, {
10690 signature: signature,
10691 pubKey: pubKey
10692 })
10693
10694 return [signature, pubKey]
10695}
10696
10697function decodeStack (stack) {
10698 typeforce(check, stack)
10699
10700 return {
10701 signature: stack[0],
10702 pubKey: stack[1]
10703 }
10704}
10705
10706module.exports = {
10707 check: check,
10708 decodeStack: decodeStack,
10709 encodeStack: encodeStack
10710}
10711
10712},{"../../script":54,"typeforce":139}],74:[function(require,module,exports){
10713// OP_0 {pubKeyHash}
10714
10715var bscript = require('../../script')
10716var types = require('../../types')
10717var typeforce = require('typeforce')
10718var OPS = require('bitcoin-ops')
10719
10720function check (script) {
10721 var buffer = bscript.compile(script)
10722
10723 return buffer.length === 22 &&
10724 buffer[0] === OPS.OP_0 &&
10725 buffer[1] === 0x14
10726}
10727check.toJSON = function () { return 'Witness pubKeyHash output' }
10728
10729function encode (pubKeyHash) {
10730 typeforce(types.Hash160bit, pubKeyHash)
10731
10732 return bscript.compile([OPS.OP_0, pubKeyHash])
10733}
10734
10735function decode (buffer) {
10736 typeforce(check, buffer)
10737
10738 return buffer.slice(2)
10739}
10740
10741module.exports = {
10742 check: check,
10743 decode: decode,
10744 encode: encode
10745}
10746
10747},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":139}],75:[function(require,module,exports){
10748arguments[4][57][0].apply(exports,arguments)
10749},{"./input":76,"./output":77,"dup":57}],76:[function(require,module,exports){
10750(function (Buffer){
10751// <scriptSig> {serialized scriptPubKey script}
10752
10753var bscript = require('../../script')
10754var types = require('../../types')
10755var typeforce = require('typeforce')
10756
10757var p2ms = require('../multisig/')
10758var p2pk = require('../pubkey/')
10759var p2pkh = require('../pubkeyhash/')
10760
10761function check (chunks, allowIncomplete) {
10762 typeforce(types.Array, chunks)
10763 if (chunks.length < 1) return false
10764
10765 var witnessScript = chunks[chunks.length - 1]
10766 if (!Buffer.isBuffer(witnessScript)) return false
10767
10768 var witnessScriptChunks = bscript.decompile(witnessScript)
10769
10770 // is witnessScript a valid script?
10771 if (witnessScriptChunks.length === 0) return false
10772
10773 var witnessRawScriptSig = bscript.compile(chunks.slice(0, -1))
10774
10775 // match types
10776 if (p2pkh.input.check(witnessRawScriptSig) &&
10777 p2pkh.output.check(witnessScriptChunks)) return true
10778
10779 if (p2ms.input.check(witnessRawScriptSig, allowIncomplete) &&
10780 p2ms.output.check(witnessScriptChunks)) return true
10781
10782 if (p2pk.input.check(witnessRawScriptSig) &&
10783 p2pk.output.check(witnessScriptChunks)) return true
10784
10785 return false
10786}
10787check.toJSON = function () { return 'witnessScriptHash input' }
10788
10789function encodeStack (witnessData, witnessScript) {
10790 typeforce({
10791 witnessData: [types.Buffer],
10792 witnessScript: types.Buffer
10793 }, {
10794 witnessData: witnessData,
10795 witnessScript: witnessScript
10796 })
10797
10798 return [].concat(witnessData, witnessScript)
10799}
10800
10801function decodeStack (chunks) {
10802 typeforce(check, chunks)
10803 return {
10804 witnessData: chunks.slice(0, -1),
10805 witnessScript: chunks[chunks.length - 1]
10806 }
10807}
10808
10809module.exports = {
10810 check: check,
10811 decodeStack: decodeStack,
10812 encodeStack: encodeStack
10813}
10814
10815}).call(this,{"isBuffer":require("../../../../../../../../.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")})
10816},{"../../../../../../../../.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":10,"../../script":54,"../../types":80,"../multisig/":57,"../pubkey/":61,"../pubkeyhash/":64,"typeforce":139}],77:[function(require,module,exports){
10817// OP_0 {scriptHash}
10818
10819var bscript = require('../../script')
10820var types = require('../../types')
10821var typeforce = require('typeforce')
10822var OPS = require('bitcoin-ops')
10823
10824function check (script) {
10825 var buffer = bscript.compile(script)
10826
10827 return buffer.length === 34 &&
10828 buffer[0] === OPS.OP_0 &&
10829 buffer[1] === 0x20
10830}
10831check.toJSON = function () { return 'Witness scriptHash output' }
10832
10833function encode (scriptHash) {
10834 typeforce(types.Hash256bit, scriptHash)
10835
10836 return bscript.compile([OPS.OP_0, scriptHash])
10837}
10838
10839function decode (buffer) {
10840 typeforce(check, buffer)
10841
10842 return buffer.slice(2)
10843}
10844
10845module.exports = {
10846 check: check,
10847 decode: decode,
10848 encode: encode
10849}
10850
10851},{"../../script":54,"../../types":80,"bitcoin-ops":42,"typeforce":139}],78:[function(require,module,exports){
10852var Buffer = require('safe-buffer').Buffer
10853var bcrypto = require('./crypto')
10854var bscript = require('./script')
10855var bufferutils = require('./bufferutils')
10856var opcodes = require('bitcoin-ops')
10857var typeforce = require('typeforce')
10858var types = require('./types')
10859var varuint = require('varuint-bitcoin')
10860
10861function varSliceSize (someScript) {
10862 var length = someScript.length
10863
10864 return varuint.encodingLength(length) + length
10865}
10866
10867function vectorSize (someVector) {
10868 var length = someVector.length
10869
10870 return varuint.encodingLength(length) + someVector.reduce(function (sum, witness) {
10871 return sum + varSliceSize(witness)
10872 }, 0)
10873}
10874
10875function Transaction () {
10876 this.version = 1
10877 this.locktime = 0
10878 this.ins = []
10879 this.outs = []
10880}
10881
10882Transaction.DEFAULT_SEQUENCE = 0xffffffff
10883Transaction.SIGHASH_ALL = 0x01
10884Transaction.SIGHASH_NONE = 0x02
10885Transaction.SIGHASH_SINGLE = 0x03
10886Transaction.SIGHASH_ANYONECANPAY = 0x80
10887Transaction.ADVANCED_TRANSACTION_MARKER = 0x00
10888Transaction.ADVANCED_TRANSACTION_FLAG = 0x01
10889
10890var EMPTY_SCRIPT = Buffer.allocUnsafe(0)
10891var EMPTY_WITNESS = []
10892var ZERO = Buffer.from('0000000000000000000000000000000000000000000000000000000000000000', 'hex')
10893var ONE = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex')
10894var VALUE_UINT64_MAX = Buffer.from('ffffffffffffffff', 'hex')
10895var BLANK_OUTPUT = {
10896 script: EMPTY_SCRIPT,
10897 valueBuffer: VALUE_UINT64_MAX
10898}
10899
10900Transaction.fromBuffer = function (buffer, __noStrict) {
10901 var offset = 0
10902 function readSlice (n) {
10903 offset += n
10904 return buffer.slice(offset - n, offset)
10905 }
10906
10907 function readUInt32 () {
10908 var i = buffer.readUInt32LE(offset)
10909 offset += 4
10910 return i
10911 }
10912
10913 function readInt32 () {
10914 var i = buffer.readInt32LE(offset)
10915 offset += 4
10916 return i
10917 }
10918
10919 function readUInt64 () {
10920 var i = bufferutils.readUInt64LE(buffer, offset)
10921 offset += 8
10922 return i
10923 }
10924
10925 function readVarInt () {
10926 var vi = varuint.decode(buffer, offset)
10927 offset += varuint.decode.bytes
10928 return vi
10929 }
10930
10931 function readVarSlice () {
10932 return readSlice(readVarInt())
10933 }
10934
10935 function readVector () {
10936 var count = readVarInt()
10937 var vector = []
10938 for (var i = 0; i < count; i++) vector.push(readVarSlice())
10939 return vector
10940 }
10941
10942 var tx = new Transaction()
10943 tx.version = readInt32()
10944
10945 var marker = buffer.readUInt8(offset)
10946 var flag = buffer.readUInt8(offset + 1)
10947
10948 var hasWitnesses = false
10949 if (marker === Transaction.ADVANCED_TRANSACTION_MARKER &&
10950 flag === Transaction.ADVANCED_TRANSACTION_FLAG) {
10951 offset += 2
10952 hasWitnesses = true
10953 }
10954
10955 var vinLen = readVarInt()
10956 for (var i = 0; i < vinLen; ++i) {
10957 tx.ins.push({
10958 hash: readSlice(32),
10959 index: readUInt32(),
10960 script: readVarSlice(),
10961 sequence: readUInt32(),
10962 witness: EMPTY_WITNESS
10963 })
10964 }
10965
10966 var voutLen = readVarInt()
10967 for (i = 0; i < voutLen; ++i) {
10968 tx.outs.push({
10969 value: readUInt64(),
10970 script: readVarSlice()
10971 })
10972 }
10973
10974 if (hasWitnesses) {
10975 for (i = 0; i < vinLen; ++i) {
10976 tx.ins[i].witness = readVector()
10977 }
10978
10979 // was this pointless?
10980 if (!tx.hasWitnesses()) throw new Error('Transaction has superfluous witness data')
10981 }
10982
10983 tx.locktime = readUInt32()
10984
10985 if (__noStrict) return tx
10986 if (offset !== buffer.length) throw new Error('Transaction has unexpected data')
10987
10988 return tx
10989}
10990
10991Transaction.fromHex = function (hex) {
10992 return Transaction.fromBuffer(Buffer.from(hex, 'hex'))
10993}
10994
10995Transaction.isCoinbaseHash = function (buffer) {
10996 typeforce(types.Hash256bit, buffer)
10997 for (var i = 0; i < 32; ++i) {
10998 if (buffer[i] !== 0) return false
10999 }
11000 return true
11001}
11002
11003Transaction.prototype.isCoinbase = function () {
11004 return this.ins.length === 1 && Transaction.isCoinbaseHash(this.ins[0].hash)
11005}
11006
11007Transaction.prototype.addInput = function (hash, index, sequence, scriptSig) {
11008 typeforce(types.tuple(
11009 types.Hash256bit,
11010 types.UInt32,
11011 types.maybe(types.UInt32),
11012 types.maybe(types.Buffer)
11013 ), arguments)
11014
11015 if (types.Null(sequence)) {
11016 sequence = Transaction.DEFAULT_SEQUENCE
11017 }
11018
11019 // Add the input and return the input's index
11020 return (this.ins.push({
11021 hash: hash,
11022 index: index,
11023 script: scriptSig || EMPTY_SCRIPT,
11024 sequence: sequence,
11025 witness: EMPTY_WITNESS
11026 }) - 1)
11027}
11028
11029Transaction.prototype.addOutput = function (scriptPubKey, value) {
11030 typeforce(types.tuple(types.Buffer, types.Satoshi), arguments)
11031
11032 // Add the output and return the output's index
11033 return (this.outs.push({
11034 script: scriptPubKey,
11035 value: value
11036 }) - 1)
11037}
11038
11039Transaction.prototype.hasWitnesses = function () {
11040 return this.ins.some(function (x) {
11041 return x.witness.length !== 0
11042 })
11043}
11044
11045Transaction.prototype.weight = function () {
11046 var base = this.__byteLength(false)
11047 var total = this.__byteLength(true)
11048 return base * 3 + total
11049}
11050
11051Transaction.prototype.virtualSize = function () {
11052 return Math.ceil(this.weight() / 4)
11053}
11054
11055Transaction.prototype.byteLength = function () {
11056 return this.__byteLength(true)
11057}
11058
11059Transaction.prototype.__byteLength = function (__allowWitness) {
11060 var hasWitnesses = __allowWitness && this.hasWitnesses()
11061
11062 return (
11063 (hasWitnesses ? 10 : 8) +
11064 varuint.encodingLength(this.ins.length) +
11065 varuint.encodingLength(this.outs.length) +
11066 this.ins.reduce(function (sum, input) { return sum + 40 + varSliceSize(input.script) }, 0) +
11067 this.outs.reduce(function (sum, output) { return sum + 8 + varSliceSize(output.script) }, 0) +
11068 (hasWitnesses ? this.ins.reduce(function (sum, input) { return sum + vectorSize(input.witness) }, 0) : 0)
11069 )
11070}
11071
11072Transaction.prototype.clone = function () {
11073 var newTx = new Transaction()
11074 newTx.version = this.version
11075 newTx.locktime = this.locktime
11076
11077 newTx.ins = this.ins.map(function (txIn) {
11078 return {
11079 hash: txIn.hash,
11080 index: txIn.index,
11081 script: txIn.script,
11082 sequence: txIn.sequence,
11083 witness: txIn.witness
11084 }
11085 })
11086
11087 newTx.outs = this.outs.map(function (txOut) {
11088 return {
11089 script: txOut.script,
11090 value: txOut.value
11091 }
11092 })
11093
11094 return newTx
11095}
11096
11097/**
11098 * Hash transaction for signing a specific input.
11099 *
11100 * Bitcoin uses a different hash for each signed transaction input.
11101 * This method copies the transaction, makes the necessary changes based on the
11102 * hashType, and then hashes the result.
11103 * This hash can then be used to sign the provided transaction input.
11104 */
11105Transaction.prototype.hashForSignature = function (inIndex, prevOutScript, hashType) {
11106 typeforce(types.tuple(types.UInt32, types.Buffer, /* types.UInt8 */ types.Number), arguments)
11107
11108 // https://github.com/bitcoin/bitcoin/blob/master/src/test/sighash_tests.cpp#L29
11109 if (inIndex >= this.ins.length) return ONE
11110
11111 // ignore OP_CODESEPARATOR
11112 var ourScript = bscript.compile(bscript.decompile(prevOutScript).filter(function (x) {
11113 return x !== opcodes.OP_CODESEPARATOR
11114 }))
11115
11116 var txTmp = this.clone()
11117
11118 // SIGHASH_NONE: ignore all outputs? (wildcard payee)
11119 if ((hashType & 0x1f) === Transaction.SIGHASH_NONE) {
11120 txTmp.outs = []
11121
11122 // ignore sequence numbers (except at inIndex)
11123 txTmp.ins.forEach(function (input, i) {
11124 if (i === inIndex) return
11125
11126 input.sequence = 0
11127 })
11128
11129 // SIGHASH_SINGLE: ignore all outputs, except at the same index?
11130 } else if ((hashType & 0x1f) === Transaction.SIGHASH_SINGLE) {
11131 // https://github.com/bitcoin/bitcoin/blob/master/src/test/sighash_tests.cpp#L60
11132 if (inIndex >= this.outs.length) return ONE
11133
11134 // truncate outputs after
11135 txTmp.outs.length = inIndex + 1
11136
11137 // "blank" outputs before
11138 for (var i = 0; i < inIndex; i++) {
11139 txTmp.outs[i] = BLANK_OUTPUT
11140 }
11141
11142 // ignore sequence numbers (except at inIndex)
11143 txTmp.ins.forEach(function (input, y) {
11144 if (y === inIndex) return
11145
11146 input.sequence = 0
11147 })
11148 }
11149
11150 // SIGHASH_ANYONECANPAY: ignore inputs entirely?
11151 if (hashType & Transaction.SIGHASH_ANYONECANPAY) {
11152 txTmp.ins = [txTmp.ins[inIndex]]
11153 txTmp.ins[0].script = ourScript
11154
11155 // SIGHASH_ALL: only ignore input scripts
11156 } else {
11157 // "blank" others input scripts
11158 txTmp.ins.forEach(function (input) { input.script = EMPTY_SCRIPT })
11159 txTmp.ins[inIndex].script = ourScript
11160 }
11161
11162 // serialize and hash
11163 var buffer = Buffer.allocUnsafe(txTmp.__byteLength(false) + 4)
11164 buffer.writeInt32LE(hashType, buffer.length - 4)
11165 txTmp.__toBuffer(buffer, 0, false)
11166
11167 return bcrypto.hash256(buffer)
11168}
11169
11170Transaction.prototype.hashForWitnessV0 = function (inIndex, prevOutScript, value, hashType) {
11171 typeforce(types.tuple(types.UInt32, types.Buffer, types.Satoshi, types.UInt32), arguments)
11172
11173 var tbuffer, toffset
11174 function writeSlice (slice) { toffset += slice.copy(tbuffer, toffset) }
11175 function writeUInt32 (i) { toffset = tbuffer.writeUInt32LE(i, toffset) }
11176 function writeUInt64 (i) { toffset = bufferutils.writeUInt64LE(tbuffer, i, toffset) }
11177 function writeVarInt (i) {
11178 varuint.encode(i, tbuffer, toffset)
11179 toffset += varuint.encode.bytes
11180 }
11181 function writeVarSlice (slice) { writeVarInt(slice.length); writeSlice(slice) }
11182
11183 var hashOutputs = ZERO
11184 var hashPrevouts = ZERO
11185 var hashSequence = ZERO
11186
11187 if (!(hashType & Transaction.SIGHASH_ANYONECANPAY)) {
11188 tbuffer = Buffer.allocUnsafe(36 * this.ins.length)
11189 toffset = 0
11190
11191 this.ins.forEach(function (txIn) {
11192 writeSlice(txIn.hash)
11193 writeUInt32(txIn.index)
11194 })
11195
11196 hashPrevouts = bcrypto.hash256(tbuffer)
11197 }
11198
11199 if (!(hashType & Transaction.SIGHASH_ANYONECANPAY) &&
11200 (hashType & 0x1f) !== Transaction.SIGHASH_SINGLE &&
11201 (hashType & 0x1f) !== Transaction.SIGHASH_NONE) {
11202 tbuffer = Buffer.allocUnsafe(4 * this.ins.length)
11203 toffset = 0
11204
11205 this.ins.forEach(function (txIn) {
11206 writeUInt32(txIn.sequence)
11207 })
11208
11209 hashSequence = bcrypto.hash256(tbuffer)
11210 }
11211
11212 if ((hashType & 0x1f) !== Transaction.SIGHASH_SINGLE &&
11213 (hashType & 0x1f) !== Transaction.SIGHASH_NONE) {
11214 var txOutsSize = this.outs.reduce(function (sum, output) {
11215 return sum + 8 + varSliceSize(output.script)
11216 }, 0)
11217
11218 tbuffer = Buffer.allocUnsafe(txOutsSize)
11219 toffset = 0
11220
11221 this.outs.forEach(function (out) {
11222 writeUInt64(out.value)
11223 writeVarSlice(out.script)
11224 })
11225
11226 hashOutputs = bcrypto.hash256(tbuffer)
11227 } else if ((hashType & 0x1f) === Transaction.SIGHASH_SINGLE && inIndex < this.outs.length) {
11228 var output = this.outs[inIndex]
11229
11230 tbuffer = Buffer.allocUnsafe(8 + varSliceSize(output.script))
11231 toffset = 0
11232 writeUInt64(output.value)
11233 writeVarSlice(output.script)
11234
11235 hashOutputs = bcrypto.hash256(tbuffer)
11236 }
11237
11238 tbuffer = Buffer.allocUnsafe(156 + varSliceSize(prevOutScript))
11239 toffset = 0
11240
11241 var input = this.ins[inIndex]
11242 writeUInt32(this.version)
11243 writeSlice(hashPrevouts)
11244 writeSlice(hashSequence)
11245 writeSlice(input.hash)
11246 writeUInt32(input.index)
11247 writeVarSlice(prevOutScript)
11248 writeUInt64(value)
11249 writeUInt32(input.sequence)
11250 writeSlice(hashOutputs)
11251 writeUInt32(this.locktime)
11252 writeUInt32(hashType)
11253 return bcrypto.hash256(tbuffer)
11254}
11255
11256Transaction.prototype.getHash = function () {
11257 return bcrypto.hash256(this.__toBuffer(undefined, undefined, false))
11258}
11259
11260Transaction.prototype.getId = function () {
11261 // transaction hash's are displayed in reverse order
11262 return this.getHash().reverse().toString('hex')
11263}
11264
11265Transaction.prototype.toBuffer = function (buffer, initialOffset) {
11266 return this.__toBuffer(buffer, initialOffset, true)
11267}
11268
11269Transaction.prototype.__toBuffer = function (buffer, initialOffset, __allowWitness) {
11270 if (!buffer) buffer = Buffer.allocUnsafe(this.__byteLength(__allowWitness))
11271
11272 var offset = initialOffset || 0
11273 function writeSlice (slice) { offset += slice.copy(buffer, offset) }
11274 function writeUInt8 (i) { offset = buffer.writeUInt8(i, offset) }
11275 function writeUInt32 (i) { offset = buffer.writeUInt32LE(i, offset) }
11276 function writeInt32 (i) { offset = buffer.writeInt32LE(i, offset) }
11277 function writeUInt64 (i) { offset = bufferutils.writeUInt64LE(buffer, i, offset) }
11278 function writeVarInt (i) {
11279 varuint.encode(i, buffer, offset)
11280 offset += varuint.encode.bytes
11281 }
11282 function writeVarSlice (slice) { writeVarInt(slice.length); writeSlice(slice) }
11283 function writeVector (vector) { writeVarInt(vector.length); vector.forEach(writeVarSlice) }
11284
11285 writeInt32(this.version)
11286
11287 var hasWitnesses = __allowWitness && this.hasWitnesses()
11288
11289 if (hasWitnesses) {
11290 writeUInt8(Transaction.ADVANCED_TRANSACTION_MARKER)
11291 writeUInt8(Transaction.ADVANCED_TRANSACTION_FLAG)
11292 }
11293
11294 writeVarInt(this.ins.length)
11295
11296 this.ins.forEach(function (txIn) {
11297 writeSlice(txIn.hash)
11298 writeUInt32(txIn.index)
11299 writeVarSlice(txIn.script)
11300 writeUInt32(txIn.sequence)
11301 })
11302
11303 writeVarInt(this.outs.length)
11304 this.outs.forEach(function (txOut) {
11305 if (!txOut.valueBuffer) {
11306 writeUInt64(txOut.value)
11307 } else {
11308 writeSlice(txOut.valueBuffer)
11309 }
11310
11311 writeVarSlice(txOut.script)
11312 })
11313
11314 if (hasWitnesses) {
11315 this.ins.forEach(function (input) {
11316 writeVector(input.witness)
11317 })
11318 }
11319
11320 writeUInt32(this.locktime)
11321
11322 // avoid slicing unless necessary
11323 if (initialOffset !== undefined) return buffer.slice(initialOffset, offset)
11324 return buffer
11325}
11326
11327Transaction.prototype.toHex = function () {
11328 return this.toBuffer().toString('hex')
11329}
11330
11331Transaction.prototype.setInputScript = function (index, scriptSig) {
11332 typeforce(types.tuple(types.Number, types.Buffer), arguments)
11333
11334 this.ins[index].script = scriptSig
11335}
11336
11337Transaction.prototype.setWitness = function (index, witness) {
11338 typeforce(types.tuple(types.Number, [types.Buffer]), arguments)
11339
11340 this.ins[index].witness = witness
11341}
11342
11343module.exports = Transaction
11344
11345},{"./bufferutils":46,"./crypto":47,"./script":54,"./types":80,"bitcoin-ops":42,"safe-buffer":128,"typeforce":139,"varuint-bitcoin":141}],79:[function(require,module,exports){
11346var Buffer = require('safe-buffer').Buffer
11347var baddress = require('./address')
11348var bcrypto = require('./crypto')
11349var bscript = require('./script')
11350var btemplates = require('./templates')
11351var networks = require('./networks')
11352var ops = require('bitcoin-ops')
11353var typeforce = require('typeforce')
11354var types = require('./types')
11355var scriptTypes = btemplates.types
11356var SIGNABLE = [btemplates.types.P2PKH, btemplates.types.P2PK, btemplates.types.MULTISIG]
11357var P2SH = SIGNABLE.concat([btemplates.types.P2WPKH, btemplates.types.P2WSH])
11358
11359var ECPair = require('./ecpair')
11360var ECSignature = require('./ecsignature')
11361var Transaction = require('./transaction')
11362
11363function supportedType (type) {
11364 return SIGNABLE.indexOf(type) !== -1
11365}
11366
11367function supportedP2SHType (type) {
11368 return P2SH.indexOf(type) !== -1
11369}
11370
11371function extractChunks (type, chunks, script) {
11372 var pubKeys = []
11373 var signatures = []
11374 switch (type) {
11375 case scriptTypes.P2PKH:
11376 // if (redeemScript) throw new Error('Nonstandard... P2SH(P2PKH)')
11377 pubKeys = chunks.slice(1)
11378 signatures = chunks.slice(0, 1)
11379 break
11380
11381 case scriptTypes.P2PK:
11382 pubKeys[0] = script ? btemplates.pubKey.output.decode(script) : undefined
11383 signatures = chunks.slice(0, 1)
11384 break
11385
11386 case scriptTypes.MULTISIG:
11387 if (script) {
11388 var multisig = btemplates.multisig.output.decode(script)
11389 pubKeys = multisig.pubKeys
11390 }
11391
11392 signatures = chunks.slice(1).map(function (chunk) {
11393 return chunk.length === 0 ? undefined : chunk
11394 })
11395 break
11396 }
11397
11398 return {
11399 pubKeys: pubKeys,
11400 signatures: signatures
11401 }
11402}
11403function expandInput (scriptSig, witnessStack) {
11404 if (scriptSig.length === 0 && witnessStack.length === 0) return {}
11405
11406 var prevOutScript
11407 var prevOutType
11408 var scriptType
11409 var script
11410 var redeemScript
11411 var witnessScript
11412 var witnessScriptType
11413 var redeemScriptType
11414 var witness = false
11415 var p2wsh = false
11416 var p2sh = false
11417 var witnessProgram
11418 var chunks
11419
11420 var scriptSigChunks = bscript.decompile(scriptSig)
11421 var sigType = btemplates.classifyInput(scriptSigChunks, true)
11422 if (sigType === scriptTypes.P2SH) {
11423 p2sh = true
11424 redeemScript = scriptSigChunks[scriptSigChunks.length - 1]
11425 redeemScriptType = btemplates.classifyOutput(redeemScript)
11426 prevOutScript = btemplates.scriptHash.output.encode(bcrypto.hash160(redeemScript))
11427 prevOutType = scriptTypes.P2SH
11428 script = redeemScript
11429 }
11430
11431 var classifyWitness = btemplates.classifyWitness(witnessStack, true)
11432 if (classifyWitness === scriptTypes.P2WSH) {
11433 witnessScript = witnessStack[witnessStack.length - 1]
11434 witnessScriptType = btemplates.classifyOutput(witnessScript)
11435 p2wsh = true
11436 witness = true
11437 if (scriptSig.length === 0) {
11438 prevOutScript = btemplates.witnessScriptHash.output.encode(bcrypto.sha256(witnessScript))
11439 prevOutType = scriptTypes.P2WSH
11440 if (redeemScript !== undefined) {
11441 throw new Error('Redeem script given when unnecessary')
11442 }
11443 // bare witness
11444 } else {
11445 if (!redeemScript) {
11446 throw new Error('No redeemScript provided for P2WSH, but scriptSig non-empty')
11447 }
11448 witnessProgram = btemplates.witnessScriptHash.output.encode(bcrypto.sha256(witnessScript))
11449 if (!redeemScript.equals(witnessProgram)) {
11450 throw new Error('Redeem script didn\'t match witnessScript')
11451 }
11452 }
11453
11454 if (!supportedType(btemplates.classifyOutput(witnessScript))) {
11455 throw new Error('unsupported witness script')
11456 }
11457
11458 script = witnessScript
11459 scriptType = witnessScriptType
11460 chunks = witnessStack.slice(0, -1)
11461 } else if (classifyWitness === scriptTypes.P2WPKH) {
11462 witness = true
11463 var key = witnessStack[witnessStack.length - 1]
11464 var keyHash = bcrypto.hash160(key)
11465 if (scriptSig.length === 0) {
11466 prevOutScript = btemplates.witnessPubKeyHash.output.encode(keyHash)
11467 prevOutType = scriptTypes.P2WPKH
11468 if (typeof redeemScript !== 'undefined') {
11469 throw new Error('Redeem script given when unnecessary')
11470 }
11471 } else {
11472 if (!redeemScript) {
11473 throw new Error('No redeemScript provided for P2WPKH, but scriptSig wasn\'t empty')
11474 }
11475 witnessProgram = btemplates.witnessPubKeyHash.output.encode(keyHash)
11476 if (!redeemScript.equals(witnessProgram)) {
11477 throw new Error('Redeem script did not have the right witness program')
11478 }
11479 }
11480
11481 scriptType = scriptTypes.P2PKH
11482 chunks = witnessStack
11483 } else if (redeemScript) {
11484 if (!supportedP2SHType(redeemScriptType)) {
11485 throw new Error('Bad redeemscript!')
11486 }
11487
11488 script = redeemScript
11489 scriptType = redeemScriptType
11490 chunks = scriptSigChunks.slice(0, -1)
11491 } else {
11492 prevOutType = scriptType = btemplates.classifyInput(scriptSig)
11493 chunks = scriptSigChunks
11494 }
11495
11496 var expanded = extractChunks(scriptType, chunks, script)
11497
11498 var result = {
11499 pubKeys: expanded.pubKeys,
11500 signatures: expanded.signatures,
11501 prevOutScript: prevOutScript,
11502 prevOutType: prevOutType,
11503 signType: scriptType,
11504 signScript: script,
11505 witness: Boolean(witness)
11506 }
11507
11508 if (p2sh) {
11509 result.redeemScript = redeemScript
11510 result.redeemScriptType = redeemScriptType
11511 }
11512
11513 if (p2wsh) {
11514 result.witnessScript = witnessScript
11515 result.witnessScriptType = witnessScriptType
11516 }
11517
11518 return result
11519}
11520
11521// could be done in expandInput, but requires the original Transaction for hashForSignature
11522function fixMultisigOrder (input, transaction, vin) {
11523 if (input.redeemScriptType !== scriptTypes.MULTISIG || !input.redeemScript) return
11524 if (input.pubKeys.length === input.signatures.length) return
11525
11526 var unmatched = input.signatures.concat()
11527
11528 input.signatures = input.pubKeys.map(function (pubKey) {
11529 var keyPair = ECPair.fromPublicKeyBuffer(pubKey)
11530 var match
11531
11532 // check for a signature
11533 unmatched.some(function (signature, i) {
11534 // skip if undefined || OP_0
11535 if (!signature) return false
11536
11537 // TODO: avoid O(n) hashForSignature
11538 var parsed = ECSignature.parseScriptSignature(signature)
11539 var hash = transaction.hashForSignature(vin, input.redeemScript, parsed.hashType)
11540
11541 // skip if signature does not match pubKey
11542 if (!keyPair.verify(hash, parsed.signature)) return false
11543
11544 // remove matched signature from unmatched
11545 unmatched[i] = undefined
11546 match = signature
11547
11548 return true
11549 })
11550
11551 return match
11552 })
11553}
11554
11555function expandOutput (script, scriptType, ourPubKey) {
11556 typeforce(types.Buffer, script)
11557
11558 var scriptChunks = bscript.decompile(script)
11559 if (!scriptType) {
11560 scriptType = btemplates.classifyOutput(script)
11561 }
11562
11563 var pubKeys = []
11564
11565 switch (scriptType) {
11566 // does our hash160(pubKey) match the output scripts?
11567 case scriptTypes.P2PKH:
11568 if (!ourPubKey) break
11569
11570 var pkh1 = scriptChunks[2]
11571 var pkh2 = bcrypto.hash160(ourPubKey)
11572 if (pkh1.equals(pkh2)) pubKeys = [ourPubKey]
11573 break
11574
11575 // does our hash160(pubKey) match the output scripts?
11576 case scriptTypes.P2WPKH:
11577 if (!ourPubKey) break
11578
11579 var wpkh1 = scriptChunks[1]
11580 var wpkh2 = bcrypto.hash160(ourPubKey)
11581 if (wpkh1.equals(wpkh2)) pubKeys = [ourPubKey]
11582 break
11583
11584 case scriptTypes.P2PK:
11585 pubKeys = scriptChunks.slice(0, 1)
11586 break
11587
11588 case scriptTypes.MULTISIG:
11589 pubKeys = scriptChunks.slice(1, -2)
11590 break
11591
11592 default: return { scriptType: scriptType }
11593 }
11594
11595 return {
11596 pubKeys: pubKeys,
11597 scriptType: scriptType,
11598 signatures: pubKeys.map(function () { return undefined })
11599 }
11600}
11601
11602function checkP2SHInput (input, redeemScriptHash) {
11603 if (input.prevOutType) {
11604 if (input.prevOutType !== scriptTypes.P2SH) throw new Error('PrevOutScript must be P2SH')
11605
11606 var prevOutScriptScriptHash = bscript.decompile(input.prevOutScript)[1]
11607 if (!prevOutScriptScriptHash.equals(redeemScriptHash)) throw new Error('Inconsistent hash160(RedeemScript)')
11608 }
11609}
11610
11611function checkP2WSHInput (input, witnessScriptHash) {
11612 if (input.prevOutType) {
11613 if (input.prevOutType !== scriptTypes.P2WSH) throw new Error('PrevOutScript must be P2WSH')
11614
11615 var scriptHash = bscript.decompile(input.prevOutScript)[1]
11616 if (!scriptHash.equals(witnessScriptHash)) throw new Error('Inconsistent sha25(WitnessScript)')
11617 }
11618}
11619
11620function prepareInput (input, kpPubKey, redeemScript, witnessValue, witnessScript) {
11621 var expanded
11622 var prevOutType
11623 var prevOutScript
11624
11625 var p2sh = false
11626 var p2shType
11627 var redeemScriptHash
11628
11629 var witness = false
11630 var p2wsh = false
11631 var witnessType
11632 var witnessScriptHash
11633
11634 var signType
11635 var signScript
11636
11637 if (redeemScript && witnessScript) {
11638 redeemScriptHash = bcrypto.hash160(redeemScript)
11639 witnessScriptHash = bcrypto.sha256(witnessScript)
11640 checkP2SHInput(input, redeemScriptHash)
11641
11642 if (!redeemScript.equals(btemplates.witnessScriptHash.output.encode(witnessScriptHash))) throw new Error('Witness script inconsistent with redeem script')
11643
11644 expanded = expandOutput(witnessScript, undefined, kpPubKey)
11645 if (!expanded.pubKeys) throw new Error('WitnessScript not supported "' + bscript.toASM(redeemScript) + '"')
11646
11647 prevOutType = btemplates.types.P2SH
11648 prevOutScript = btemplates.scriptHash.output.encode(redeemScriptHash)
11649 p2sh = witness = p2wsh = true
11650 p2shType = btemplates.types.P2WSH
11651 signType = witnessType = expanded.scriptType
11652 signScript = witnessScript
11653 } else if (redeemScript) {
11654 redeemScriptHash = bcrypto.hash160(redeemScript)
11655 checkP2SHInput(input, redeemScriptHash)
11656
11657 expanded = expandOutput(redeemScript, undefined, kpPubKey)
11658 if (!expanded.pubKeys) throw new Error('RedeemScript not supported "' + bscript.toASM(redeemScript) + '"')
11659
11660 prevOutType = btemplates.types.P2SH
11661 prevOutScript = btemplates.scriptHash.output.encode(redeemScriptHash)
11662 p2sh = true
11663 signType = p2shType = expanded.scriptType
11664 signScript = redeemScript
11665 witness = signType === btemplates.types.P2WPKH
11666 } else if (witnessScript) {
11667 witnessScriptHash = bcrypto.sha256(witnessScript)
11668 checkP2WSHInput(input, witnessScriptHash)
11669
11670 expanded = expandOutput(witnessScript, undefined, kpPubKey)
11671 if (!expanded.pubKeys) throw new Error('WitnessScript not supported "' + bscript.toASM(redeemScript) + '"')
11672
11673 prevOutType = btemplates.types.P2WSH
11674 prevOutScript = btemplates.witnessScriptHash.output.encode(witnessScriptHash)
11675 witness = p2wsh = true
11676 signType = witnessType = expanded.scriptType
11677 signScript = witnessScript
11678 } else if (input.prevOutType) {
11679 // embedded scripts are not possible without a redeemScript
11680 if (input.prevOutType === scriptTypes.P2SH ||
11681 input.prevOutType === scriptTypes.P2WSH) {
11682 throw new Error('PrevOutScript is ' + input.prevOutType + ', requires redeemScript')
11683 }
11684
11685 prevOutType = input.prevOutType
11686 prevOutScript = input.prevOutScript
11687 expanded = expandOutput(input.prevOutScript, input.prevOutType, kpPubKey)
11688 if (!expanded.pubKeys) return
11689
11690 witness = (input.prevOutType === scriptTypes.P2WPKH)
11691 signType = prevOutType
11692 signScript = prevOutScript
11693 } else {
11694 prevOutScript = btemplates.pubKeyHash.output.encode(bcrypto.hash160(kpPubKey))
11695 expanded = expandOutput(prevOutScript, scriptTypes.P2PKH, kpPubKey)
11696
11697 prevOutType = scriptTypes.P2PKH
11698 witness = false
11699 signType = prevOutType
11700 signScript = prevOutScript
11701 }
11702
11703 if (signType === scriptTypes.P2WPKH) {
11704 signScript = btemplates.pubKeyHash.output.encode(btemplates.witnessPubKeyHash.output.decode(signScript))
11705 }
11706
11707 if (p2sh) {
11708 input.redeemScript = redeemScript
11709 input.redeemScriptType = p2shType
11710 }
11711
11712 if (p2wsh) {
11713 input.witnessScript = witnessScript
11714 input.witnessScriptType = witnessType
11715 }
11716
11717 input.pubKeys = expanded.pubKeys
11718 input.signatures = expanded.signatures
11719 input.signScript = signScript
11720 input.signType = signType
11721 input.prevOutScript = prevOutScript
11722 input.prevOutType = prevOutType
11723 input.witness = witness
11724}
11725
11726function buildStack (type, signatures, pubKeys, allowIncomplete) {
11727 if (type === scriptTypes.P2PKH) {
11728 if (signatures.length === 1 && Buffer.isBuffer(signatures[0]) && pubKeys.length === 1) return btemplates.pubKeyHash.input.encodeStack(signatures[0], pubKeys[0])
11729 } else if (type === scriptTypes.P2PK) {
11730 if (signatures.length === 1 && Buffer.isBuffer(signatures[0])) return btemplates.pubKey.input.encodeStack(signatures[0])
11731 } else if (type === scriptTypes.MULTISIG) {
11732 if (signatures.length > 0) {
11733 signatures = signatures.map(function (signature) {
11734 return signature || ops.OP_0
11735 })
11736 if (!allowIncomplete) {
11737 // remove blank signatures
11738 signatures = signatures.filter(function (x) { return x !== ops.OP_0 })
11739 }
11740
11741 return btemplates.multisig.input.encodeStack(signatures)
11742 }
11743 } else {
11744 throw new Error('Not yet supported')
11745 }
11746
11747 if (!allowIncomplete) throw new Error('Not enough signatures provided')
11748 return []
11749}
11750
11751function buildInput (input, allowIncomplete) {
11752 var scriptType = input.prevOutType
11753 var sig = []
11754 var witness = []
11755
11756 if (supportedType(scriptType)) {
11757 sig = buildStack(scriptType, input.signatures, input.pubKeys, allowIncomplete)
11758 }
11759
11760 var p2sh = false
11761 if (scriptType === btemplates.types.P2SH) {
11762 // We can remove this error later when we have a guarantee prepareInput
11763 // rejects unsignable scripts - it MUST be signable at this point.
11764 if (!allowIncomplete && !supportedP2SHType(input.redeemScriptType)) {
11765 throw new Error('Impossible to sign this type')
11766 }
11767
11768 if (supportedType(input.redeemScriptType)) {
11769 sig = buildStack(input.redeemScriptType, input.signatures, input.pubKeys, allowIncomplete)
11770 }
11771
11772 // If it wasn't SIGNABLE, it's witness, defer to that
11773 if (input.redeemScriptType) {
11774 p2sh = true
11775 scriptType = input.redeemScriptType
11776 }
11777 }
11778
11779 switch (scriptType) {
11780 // P2WPKH is a special case of P2PKH
11781 case btemplates.types.P2WPKH:
11782 witness = buildStack(btemplates.types.P2PKH, input.signatures, input.pubKeys, allowIncomplete)
11783 break
11784
11785 case btemplates.types.P2WSH:
11786 // We can remove this check later
11787 if (!allowIncomplete && !supportedType(input.witnessScriptType)) {
11788 throw new Error('Impossible to sign this type')
11789 }
11790
11791 if (supportedType(input.witnessScriptType)) {
11792 witness = buildStack(input.witnessScriptType, input.signatures, input.pubKeys, allowIncomplete)
11793 witness.push(input.witnessScript)
11794 scriptType = input.witnessScriptType
11795 }
11796
11797 break
11798 }
11799
11800 // append redeemScript if necessary
11801 if (p2sh) {
11802 sig.push(input.redeemScript)
11803 }
11804
11805 return {
11806 type: scriptType,
11807 script: bscript.compile(sig),
11808 witness: witness
11809 }
11810}
11811
11812function TransactionBuilder (network, maximumFeeRate) {
11813 this.prevTxMap = {}
11814 this.network = network || networks.bitcoin
11815
11816 // WARNING: This is __NOT__ to be relied on, its just another potential safety mechanism (safety in-depth)
11817 this.maximumFeeRate = maximumFeeRate || 1000
11818
11819 this.inputs = []
11820 this.tx = new Transaction()
11821}
11822
11823TransactionBuilder.prototype.setLockTime = function (locktime) {
11824 typeforce(types.UInt32, locktime)
11825
11826 // if any signatures exist, throw
11827 if (this.inputs.some(function (input) {
11828 if (!input.signatures) return false
11829
11830 return input.signatures.some(function (s) { return s })
11831 })) {
11832 throw new Error('No, this would invalidate signatures')
11833 }
11834
11835 this.tx.locktime = locktime
11836}
11837
11838TransactionBuilder.prototype.setVersion = function (version) {
11839 typeforce(types.UInt32, version)
11840
11841 // XXX: this might eventually become more complex depending on what the versions represent
11842 this.tx.version = version
11843}
11844
11845TransactionBuilder.fromTransaction = function (transaction, network) {
11846 var txb = new TransactionBuilder(network)
11847
11848 // Copy transaction fields
11849 txb.setVersion(transaction.version)
11850 txb.setLockTime(transaction.locktime)
11851
11852 // Copy outputs (done first to avoid signature invalidation)
11853 transaction.outs.forEach(function (txOut) {
11854 txb.addOutput(txOut.script, txOut.value)
11855 })
11856
11857 // Copy inputs
11858 transaction.ins.forEach(function (txIn) {
11859 txb.__addInputUnsafe(txIn.hash, txIn.index, {
11860 sequence: txIn.sequence,
11861 script: txIn.script,
11862 witness: txIn.witness
11863 })
11864 })
11865
11866 // fix some things not possible through the public API
11867 txb.inputs.forEach(function (input, i) {
11868 fixMultisigOrder(input, transaction, i)
11869 })
11870
11871 return txb
11872}
11873
11874TransactionBuilder.prototype.addInput = function (txHash, vout, sequence, prevOutScript) {
11875 if (!this.__canModifyInputs()) {
11876 throw new Error('No, this would invalidate signatures')
11877 }
11878
11879 var value
11880
11881 // is it a hex string?
11882 if (typeof txHash === 'string') {
11883 // transaction hashs's are displayed in reverse order, un-reverse it
11884 txHash = Buffer.from(txHash, 'hex').reverse()
11885
11886 // is it a Transaction object?
11887 } else if (txHash instanceof Transaction) {
11888 var txOut = txHash.outs[vout]
11889 prevOutScript = txOut.script
11890 value = txOut.value
11891
11892 txHash = txHash.getHash()
11893 }
11894
11895 return this.__addInputUnsafe(txHash, vout, {
11896 sequence: sequence,
11897 prevOutScript: prevOutScript,
11898 value: value
11899 })
11900}
11901
11902TransactionBuilder.prototype.__addInputUnsafe = function (txHash, vout, options) {
11903 if (Transaction.isCoinbaseHash(txHash)) {
11904 throw new Error('coinbase inputs not supported')
11905 }
11906
11907 var prevTxOut = txHash.toString('hex') + ':' + vout
11908 if (this.prevTxMap[prevTxOut] !== undefined) throw new Error('Duplicate TxOut: ' + prevTxOut)
11909
11910 var input = {}
11911
11912 // derive what we can from the scriptSig
11913 if (options.script !== undefined) {
11914 input = expandInput(options.script, options.witness || [])
11915 }
11916
11917 // if an input value was given, retain it
11918 if (options.value !== undefined) {
11919 input.value = options.value
11920 }
11921
11922 // derive what we can from the previous transactions output script
11923 if (!input.prevOutScript && options.prevOutScript) {
11924 var prevOutType
11925
11926 if (!input.pubKeys && !input.signatures) {
11927 var expanded = expandOutput(options.prevOutScript)
11928
11929 if (expanded.pubKeys) {
11930 input.pubKeys = expanded.pubKeys
11931 input.signatures = expanded.signatures
11932 }
11933
11934 prevOutType = expanded.scriptType
11935 }
11936
11937 input.prevOutScript = options.prevOutScript
11938 input.prevOutType = prevOutType || btemplates.classifyOutput(options.prevOutScript)
11939 }
11940
11941 var vin = this.tx.addInput(txHash, vout, options.sequence, options.scriptSig)
11942 this.inputs[vin] = input
11943 this.prevTxMap[prevTxOut] = vin
11944 return vin
11945}
11946
11947TransactionBuilder.prototype.addOutput = function (scriptPubKey, value) {
11948 if (!this.__canModifyOutputs()) {
11949 throw new Error('No, this would invalidate signatures')
11950 }
11951
11952 // Attempt to get a script if it's a base58 address string
11953 if (typeof scriptPubKey === 'string') {
11954 scriptPubKey = baddress.toOutputScript(scriptPubKey, this.network)
11955 }
11956
11957 return this.tx.addOutput(scriptPubKey, value)
11958}
11959
11960TransactionBuilder.prototype.build = function () {
11961 return this.__build(false)
11962}
11963TransactionBuilder.prototype.buildIncomplete = function () {
11964 return this.__build(true)
11965}
11966
11967TransactionBuilder.prototype.__build = function (allowIncomplete) {
11968 if (!allowIncomplete) {
11969 if (!this.tx.ins.length) throw new Error('Transaction has no inputs')
11970 if (!this.tx.outs.length) throw new Error('Transaction has no outputs')
11971 }
11972
11973 var tx = this.tx.clone()
11974 // Create script signatures from inputs
11975 this.inputs.forEach(function (input, i) {
11976 var scriptType = input.witnessScriptType || input.redeemScriptType || input.prevOutType
11977 if (!scriptType && !allowIncomplete) throw new Error('Transaction is not complete')
11978 var result = buildInput(input, allowIncomplete)
11979
11980 // skip if no result
11981 if (!allowIncomplete) {
11982 if (!supportedType(result.type) && result.type !== btemplates.types.P2WPKH) {
11983 throw new Error(result.type + ' not supported')
11984 }
11985 }
11986
11987 tx.setInputScript(i, result.script)
11988 tx.setWitness(i, result.witness)
11989 })
11990
11991 if (!allowIncomplete) {
11992 // do not rely on this, its merely a last resort
11993 if (this.__overMaximumFees(tx.virtualSize())) {
11994 throw new Error('Transaction has absurd fees')
11995 }
11996 }
11997
11998 return tx
11999}
12000
12001function canSign (input) {
12002 return input.prevOutScript !== undefined &&
12003 input.signScript !== undefined &&
12004 input.pubKeys !== undefined &&
12005 input.signatures !== undefined &&
12006 input.signatures.length === input.pubKeys.length &&
12007 input.pubKeys.length > 0 &&
12008 (
12009 input.witness === false ||
12010 (input.witness === true && input.value !== undefined)
12011 )
12012}
12013
12014TransactionBuilder.prototype.sign = function (vin, keyPair, redeemScript, hashType, witnessValue, witnessScript) {
12015 // TODO: remove keyPair.network matching in 4.0.0
12016 if (keyPair.network && keyPair.network !== this.network) throw new TypeError('Inconsistent network')
12017 if (!this.inputs[vin]) throw new Error('No input at index: ' + vin)
12018 hashType = hashType || Transaction.SIGHASH_ALL
12019
12020 var input = this.inputs[vin]
12021
12022 // if redeemScript was previously provided, enforce consistency
12023 if (input.redeemScript !== undefined &&
12024 redeemScript &&
12025 !input.redeemScript.equals(redeemScript)) {
12026 throw new Error('Inconsistent redeemScript')
12027 }
12028
12029 var kpPubKey = keyPair.publicKey || keyPair.getPublicKeyBuffer()
12030 if (!canSign(input)) {
12031 if (witnessValue !== undefined) {
12032 if (input.value !== undefined && input.value !== witnessValue) throw new Error('Input didn\'t match witnessValue')
12033 typeforce(types.Satoshi, witnessValue)
12034 input.value = witnessValue
12035 }
12036
12037 if (!canSign(input)) prepareInput(input, kpPubKey, redeemScript, witnessValue, witnessScript)
12038 if (!canSign(input)) throw Error(input.prevOutType + ' not supported')
12039 }
12040
12041 // ready to sign
12042 var signatureHash
12043 if (input.witness) {
12044 signatureHash = this.tx.hashForWitnessV0(vin, input.signScript, input.value, hashType)
12045 } else {
12046 signatureHash = this.tx.hashForSignature(vin, input.signScript, hashType)
12047 }
12048
12049 // enforce in order signing of public keys
12050 var signed = input.pubKeys.some(function (pubKey, i) {
12051 if (!kpPubKey.equals(pubKey)) return false
12052 if (input.signatures[i]) throw new Error('Signature already exists')
12053 if (kpPubKey.length !== 33 &&
12054 input.signType === scriptTypes.P2WPKH) throw new Error('BIP143 rejects uncompressed public keys in P2WPKH or P2WSH')
12055
12056 var signature = keyPair.sign(signatureHash)
12057 if (Buffer.isBuffer(signature)) signature = ECSignature.fromRSBuffer(signature)
12058
12059 input.signatures[i] = signature.toScriptSignature(hashType)
12060 return true
12061 })
12062
12063 if (!signed) throw new Error('Key pair cannot sign for this input')
12064}
12065
12066function signatureHashType (buffer) {
12067 return buffer.readUInt8(buffer.length - 1)
12068}
12069
12070TransactionBuilder.prototype.__canModifyInputs = function () {
12071 return this.inputs.every(function (input) {
12072 // any signatures?
12073 if (input.signatures === undefined) return true
12074
12075 return input.signatures.every(function (signature) {
12076 if (!signature) return true
12077 var hashType = signatureHashType(signature)
12078
12079 // if SIGHASH_ANYONECANPAY is set, signatures would not
12080 // be invalidated by more inputs
12081 return hashType & Transaction.SIGHASH_ANYONECANPAY
12082 })
12083 })
12084}
12085
12086TransactionBuilder.prototype.__canModifyOutputs = function () {
12087 var nInputs = this.tx.ins.length
12088 var nOutputs = this.tx.outs.length
12089
12090 return this.inputs.every(function (input) {
12091 if (input.signatures === undefined) return true
12092
12093 return input.signatures.every(function (signature) {
12094 if (!signature) return true
12095 var hashType = signatureHashType(signature)
12096
12097 var hashTypeMod = hashType & 0x1f
12098 if (hashTypeMod === Transaction.SIGHASH_NONE) return true
12099 if (hashTypeMod === Transaction.SIGHASH_SINGLE) {
12100 // if SIGHASH_SINGLE is set, and nInputs > nOutputs
12101 // some signatures would be invalidated by the addition
12102 // of more outputs
12103 return nInputs <= nOutputs
12104 }
12105 })
12106 })
12107}
12108
12109TransactionBuilder.prototype.__overMaximumFees = function (bytes) {
12110 // not all inputs will have .value defined
12111 var incoming = this.inputs.reduce(function (a, x) { return a + (x.value >>> 0) }, 0)
12112
12113 // but all outputs do, and if we have any input value
12114 // we can immediately determine if the outputs are too small
12115 var outgoing = this.tx.outs.reduce(function (a, x) { return a + x.value }, 0)
12116 var fee = incoming - outgoing
12117 var feeRate = fee / bytes
12118
12119 return feeRate > this.maximumFeeRate
12120}
12121
12122module.exports = TransactionBuilder
12123
12124},{"./address":44,"./crypto":47,"./ecpair":49,"./ecsignature":50,"./networks":53,"./script":54,"./templates":56,"./transaction":78,"./types":80,"bitcoin-ops":42,"safe-buffer":128,"typeforce":139}],80:[function(require,module,exports){
12125var typeforce = require('typeforce')
12126
12127var UINT31_MAX = Math.pow(2, 31) - 1
12128function UInt31 (value) {
12129 return typeforce.UInt32(value) && value <= UINT31_MAX
12130}
12131
12132function BIP32Path (value) {
12133 return typeforce.String(value) && value.match(/^(m\/)?(\d+'?\/)*\d+'?$/)
12134}
12135BIP32Path.toJSON = function () { return 'BIP32 derivation path' }
12136
12137var SATOSHI_MAX = 21 * 1e14
12138function Satoshi (value) {
12139 return typeforce.UInt53(value) && value <= SATOSHI_MAX
12140}
12141
12142// external dependent types
12143var BigInt = typeforce.quacksLike('BigInteger')
12144var ECPoint = typeforce.quacksLike('Point')
12145
12146// exposed, external API
12147var ECSignature = typeforce.compile({ r: BigInt, s: BigInt })
12148var Network = typeforce.compile({
12149 messagePrefix: typeforce.oneOf(typeforce.Buffer, typeforce.String),
12150 bip32: {
12151 public: typeforce.UInt32,
12152 private: typeforce.UInt32
12153 },
12154 pubKeyHash: typeforce.UInt8,
12155 scriptHash: typeforce.UInt8,
12156 wif: typeforce.UInt8
12157})
12158
12159// extend typeforce types with ours
12160var types = {
12161 BigInt: BigInt,
12162 BIP32Path: BIP32Path,
12163 Buffer256bit: typeforce.BufferN(32),
12164 ECPoint: ECPoint,
12165 ECSignature: ECSignature,
12166 Hash160bit: typeforce.BufferN(20),
12167 Hash256bit: typeforce.BufferN(32),
12168 Network: Network,
12169 Satoshi: Satoshi,
12170 UInt31: UInt31
12171}
12172
12173for (var typeName in typeforce) {
12174 types[typeName] = typeforce[typeName]
12175}
12176
12177module.exports = types
12178
12179},{"typeforce":139}],81:[function(require,module,exports){
12180(function (module, exports) { 2345(function (module, exports) {
12181 'use strict'; 2346 'use strict';
12182 2347
@@ -15605,7 +5770,7 @@ module.exports = types
15605 }; 5770 };
15606})(typeof module === 'undefined' || module, this); 5771})(typeof module === 'undefined' || module, this);
15607 5772
15608},{}],82:[function(require,module,exports){ 5773},{}],18:[function(require,module,exports){
15609var r; 5774var r;
15610 5775
15611module.exports = function rand(len) { 5776module.exports = function rand(len) {
@@ -15672,85 +5837,3579 @@ if (typeof self === 'object') {
15672 } 5837 }
15673} 5838}
15674 5839
15675},{"crypto":3}],83:[function(require,module,exports){ 5840},{"crypto":19}],19:[function(require,module,exports){
15676var basex = require('base-x')
15677var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
15678 5841
15679module.exports = basex(ALPHABET) 5842},{}],20:[function(require,module,exports){
5843(function (Buffer){
5844// based on the aes implimentation in triple sec
5845// https://github.com/keybase/triplesec
5846
5847// which is in turn based on the one from crypto-js
5848// https://code.google.com/p/crypto-js/
5849
5850var uint_max = Math.pow(2, 32)
5851function fixup_uint32 (x) {
5852 var ret, x_pos
5853 ret = x > uint_max || x < 0 ? (x_pos = Math.abs(x) % uint_max, x < 0 ? uint_max - x_pos : x_pos) : x
5854 return ret
5855}
5856function scrub_vec (v) {
5857 for (var i = 0; i < v.length; v++) {
5858 v[i] = 0
5859 }
5860 return false
5861}
5862
5863function Global () {
5864 this.SBOX = []
5865 this.INV_SBOX = []
5866 this.SUB_MIX = [[], [], [], []]
5867 this.INV_SUB_MIX = [[], [], [], []]
5868 this.init()
5869 this.RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]
5870}
5871
5872Global.prototype.init = function () {
5873 var d, i, sx, t, x, x2, x4, x8, xi, _i
5874 d = (function () {
5875 var _i, _results
5876 _results = []
5877 for (i = _i = 0; _i < 256; i = ++_i) {
5878 if (i < 128) {
5879 _results.push(i << 1)
5880 } else {
5881 _results.push((i << 1) ^ 0x11b)
5882 }
5883 }
5884 return _results
5885 })()
5886 x = 0
5887 xi = 0
5888 for (i = _i = 0; _i < 256; i = ++_i) {
5889 sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)
5890 sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63
5891 this.SBOX[x] = sx
5892 this.INV_SBOX[sx] = x
5893 x2 = d[x]
5894 x4 = d[x2]
5895 x8 = d[x4]
5896 t = (d[sx] * 0x101) ^ (sx * 0x1010100)
5897 this.SUB_MIX[0][x] = (t << 24) | (t >>> 8)
5898 this.SUB_MIX[1][x] = (t << 16) | (t >>> 16)
5899 this.SUB_MIX[2][x] = (t << 8) | (t >>> 24)
5900 this.SUB_MIX[3][x] = t
5901 t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)
5902 this.INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)
5903 this.INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)
5904 this.INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)
5905 this.INV_SUB_MIX[3][sx] = t
5906 if (x === 0) {
5907 x = xi = 1
5908 } else {
5909 x = x2 ^ d[d[d[x8 ^ x2]]]
5910 xi ^= d[d[xi]]
5911 }
5912 }
5913 return true
5914}
5915
5916var G = new Global()
5917
5918AES.blockSize = 4 * 4
5919
5920AES.prototype.blockSize = AES.blockSize
5921
5922AES.keySize = 256 / 8
5923
5924AES.prototype.keySize = AES.keySize
5925
5926function bufferToArray (buf) {
5927 var len = buf.length / 4
5928 var out = new Array(len)
5929 var i = -1
5930 while (++i < len) {
5931 out[i] = buf.readUInt32BE(i * 4)
5932 }
5933 return out
5934}
5935function AES (key) {
5936 this._key = bufferToArray(key)
5937 this._doReset()
5938}
5939
5940AES.prototype._doReset = function () {
5941 var invKsRow, keySize, keyWords, ksRow, ksRows, t
5942 keyWords = this._key
5943 keySize = keyWords.length
5944 this._nRounds = keySize + 6
5945 ksRows = (this._nRounds + 1) * 4
5946 this._keySchedule = []
5947 for (ksRow = 0; ksRow < ksRows; ksRow++) {
5948 this._keySchedule[ksRow] = ksRow < keySize ? keyWords[ksRow] : (t = this._keySchedule[ksRow - 1], (ksRow % keySize) === 0 ? (t = (t << 8) | (t >>> 24), t = (G.SBOX[t >>> 24] << 24) | (G.SBOX[(t >>> 16) & 0xff] << 16) | (G.SBOX[(t >>> 8) & 0xff] << 8) | G.SBOX[t & 0xff], t ^= G.RCON[(ksRow / keySize) | 0] << 24) : keySize > 6 && ksRow % keySize === 4 ? t = (G.SBOX[t >>> 24] << 24) | (G.SBOX[(t >>> 16) & 0xff] << 16) | (G.SBOX[(t >>> 8) & 0xff] << 8) | G.SBOX[t & 0xff] : void 0, this._keySchedule[ksRow - keySize] ^ t)
5949 }
5950 this._invKeySchedule = []
5951 for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {
5952 ksRow = ksRows - invKsRow
5953 t = this._keySchedule[ksRow - (invKsRow % 4 ? 0 : 4)]
5954 this._invKeySchedule[invKsRow] = invKsRow < 4 || ksRow <= 4 ? t : G.INV_SUB_MIX[0][G.SBOX[t >>> 24]] ^ G.INV_SUB_MIX[1][G.SBOX[(t >>> 16) & 0xff]] ^ G.INV_SUB_MIX[2][G.SBOX[(t >>> 8) & 0xff]] ^ G.INV_SUB_MIX[3][G.SBOX[t & 0xff]]
5955 }
5956 return true
5957}
5958
5959AES.prototype.encryptBlock = function (M) {
5960 M = bufferToArray(new Buffer(M))
5961 var out = this._doCryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX)
5962 var buf = new Buffer(16)
5963 buf.writeUInt32BE(out[0], 0)
5964 buf.writeUInt32BE(out[1], 4)
5965 buf.writeUInt32BE(out[2], 8)
5966 buf.writeUInt32BE(out[3], 12)
5967 return buf
5968}
5969
5970AES.prototype.decryptBlock = function (M) {
5971 M = bufferToArray(new Buffer(M))
5972 var temp = [M[3], M[1]]
5973 M[1] = temp[0]
5974 M[3] = temp[1]
5975 var out = this._doCryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX)
5976 var buf = new Buffer(16)
5977 buf.writeUInt32BE(out[0], 0)
5978 buf.writeUInt32BE(out[3], 4)
5979 buf.writeUInt32BE(out[2], 8)
5980 buf.writeUInt32BE(out[1], 12)
5981 return buf
5982}
5983
5984AES.prototype.scrub = function () {
5985 scrub_vec(this._keySchedule)
5986 scrub_vec(this._invKeySchedule)
5987 scrub_vec(this._key)
5988}
5989
5990AES.prototype._doCryptBlock = function (M, keySchedule, SUB_MIX, SBOX) {
5991 var ksRow, s0, s1, s2, s3, t0, t1, t2, t3
5992
5993 s0 = M[0] ^ keySchedule[0]
5994 s1 = M[1] ^ keySchedule[1]
5995 s2 = M[2] ^ keySchedule[2]
5996 s3 = M[3] ^ keySchedule[3]
5997 ksRow = 4
5998 for (var round = 1; round < this._nRounds; round++) {
5999 t0 = SUB_MIX[0][s0 >>> 24] ^ SUB_MIX[1][(s1 >>> 16) & 0xff] ^ SUB_MIX[2][(s2 >>> 8) & 0xff] ^ SUB_MIX[3][s3 & 0xff] ^ keySchedule[ksRow++]
6000 t1 = SUB_MIX[0][s1 >>> 24] ^ SUB_MIX[1][(s2 >>> 16) & 0xff] ^ SUB_MIX[2][(s3 >>> 8) & 0xff] ^ SUB_MIX[3][s0 & 0xff] ^ keySchedule[ksRow++]
6001 t2 = SUB_MIX[0][s2 >>> 24] ^ SUB_MIX[1][(s3 >>> 16) & 0xff] ^ SUB_MIX[2][(s0 >>> 8) & 0xff] ^ SUB_MIX[3][s1 & 0xff] ^ keySchedule[ksRow++]
6002 t3 = SUB_MIX[0][s3 >>> 24] ^ SUB_MIX[1][(s0 >>> 16) & 0xff] ^ SUB_MIX[2][(s1 >>> 8) & 0xff] ^ SUB_MIX[3][s2 & 0xff] ^ keySchedule[ksRow++]
6003 s0 = t0
6004 s1 = t1
6005 s2 = t2
6006 s3 = t3
6007 }
6008 t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]
6009 t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]
6010 t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]
6011 t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]
6012 return [
6013 fixup_uint32(t0),
6014 fixup_uint32(t1),
6015 fixup_uint32(t2),
6016 fixup_uint32(t3)
6017 ]
6018}
6019
6020exports.AES = AES
15680 6021
15681},{"base-x":35}],84:[function(require,module,exports){ 6022}).call(this,require("buffer").Buffer)
6023},{"buffer":47}],21:[function(require,module,exports){
15682(function (Buffer){ 6024(function (Buffer){
15683'use strict' 6025var aes = require('./aes')
6026var Transform = require('cipher-base')
6027var inherits = require('inherits')
6028var GHASH = require('./ghash')
6029var xor = require('buffer-xor')
6030inherits(StreamCipher, Transform)
6031module.exports = StreamCipher
15684 6032
15685var base58 = require('bs58') 6033function StreamCipher (mode, key, iv, decrypt) {
6034 if (!(this instanceof StreamCipher)) {
6035 return new StreamCipher(mode, key, iv)
6036 }
6037 Transform.call(this)
6038 this._finID = Buffer.concat([iv, new Buffer([0, 0, 0, 1])])
6039 iv = Buffer.concat([iv, new Buffer([0, 0, 0, 2])])
6040 this._cipher = new aes.AES(key)
6041 this._prev = new Buffer(iv.length)
6042 this._cache = new Buffer('')
6043 this._secCache = new Buffer('')
6044 this._decrypt = decrypt
6045 this._alen = 0
6046 this._len = 0
6047 iv.copy(this._prev)
6048 this._mode = mode
6049 var h = new Buffer(4)
6050 h.fill(0)
6051 this._ghash = new GHASH(this._cipher.encryptBlock(h))
6052 this._authTag = null
6053 this._called = false
6054}
6055StreamCipher.prototype._update = function (chunk) {
6056 if (!this._called && this._alen) {
6057 var rump = 16 - (this._alen % 16)
6058 if (rump < 16) {
6059 rump = new Buffer(rump)
6060 rump.fill(0)
6061 this._ghash.update(rump)
6062 }
6063 }
6064 this._called = true
6065 var out = this._mode.encrypt(this, chunk)
6066 if (this._decrypt) {
6067 this._ghash.update(chunk)
6068 } else {
6069 this._ghash.update(out)
6070 }
6071 this._len += chunk.length
6072 return out
6073}
6074StreamCipher.prototype._final = function () {
6075 if (this._decrypt && !this._authTag) {
6076 throw new Error('Unsupported state or unable to authenticate data')
6077 }
6078 var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))
6079 if (this._decrypt) {
6080 if (xorTest(tag, this._authTag)) {
6081 throw new Error('Unsupported state or unable to authenticate data')
6082 }
6083 } else {
6084 this._authTag = tag
6085 }
6086 this._cipher.scrub()
6087}
6088StreamCipher.prototype.getAuthTag = function getAuthTag () {
6089 if (!this._decrypt && Buffer.isBuffer(this._authTag)) {
6090 return this._authTag
6091 } else {
6092 throw new Error('Attempting to get auth tag in unsupported state')
6093 }
6094}
6095StreamCipher.prototype.setAuthTag = function setAuthTag (tag) {
6096 if (this._decrypt) {
6097 this._authTag = tag
6098 } else {
6099 throw new Error('Attempting to set auth tag in unsupported state')
6100 }
6101}
6102StreamCipher.prototype.setAAD = function setAAD (buf) {
6103 if (!this._called) {
6104 this._ghash.update(buf)
6105 this._alen += buf.length
6106 } else {
6107 throw new Error('Attempting to set AAD in unsupported state')
6108 }
6109}
6110function xorTest (a, b) {
6111 var out = 0
6112 if (a.length !== b.length) {
6113 out++
6114 }
6115 var len = Math.min(a.length, b.length)
6116 var i = -1
6117 while (++i < len) {
6118 out += (a[i] ^ b[i])
6119 }
6120 return out
6121}
15686 6122
15687module.exports = function (checksumFn) { 6123}).call(this,require("buffer").Buffer)
15688 // Encode a buffer as a base58-check encoded string 6124},{"./aes":20,"./ghash":25,"buffer":47,"buffer-xor":46,"cipher-base":48,"inherits":95}],22:[function(require,module,exports){
15689 function encode (payload) { 6125var ciphers = require('./encrypter')
15690 var checksum = checksumFn(payload) 6126exports.createCipher = exports.Cipher = ciphers.createCipher
6127exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv
6128var deciphers = require('./decrypter')
6129exports.createDecipher = exports.Decipher = deciphers.createDecipher
6130exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv
6131var modes = require('./modes')
6132function getCiphers () {
6133 return Object.keys(modes)
6134}
6135exports.listCiphers = exports.getCiphers = getCiphers
6136
6137},{"./decrypter":23,"./encrypter":24,"./modes":26}],23:[function(require,module,exports){
6138(function (Buffer){
6139var aes = require('./aes')
6140var Transform = require('cipher-base')
6141var inherits = require('inherits')
6142var modes = require('./modes')
6143var StreamCipher = require('./streamCipher')
6144var AuthCipher = require('./authCipher')
6145var ebtk = require('evp_bytestokey')
15691 6146
15692 return base58.encode(Buffer.concat([ 6147inherits(Decipher, Transform)
15693 payload, 6148function Decipher (mode, key, iv) {
15694 checksum 6149 if (!(this instanceof Decipher)) {
15695 ], payload.length + 4)) 6150 return new Decipher(mode, key, iv)
6151 }
6152 Transform.call(this)
6153 this._cache = new Splitter()
6154 this._last = void 0
6155 this._cipher = new aes.AES(key)
6156 this._prev = new Buffer(iv.length)
6157 iv.copy(this._prev)
6158 this._mode = mode
6159 this._autopadding = true
6160}
6161Decipher.prototype._update = function (data) {
6162 this._cache.add(data)
6163 var chunk
6164 var thing
6165 var out = []
6166 while ((chunk = this._cache.get(this._autopadding))) {
6167 thing = this._mode.decrypt(this, chunk)
6168 out.push(thing)
6169 }
6170 return Buffer.concat(out)
6171}
6172Decipher.prototype._final = function () {
6173 var chunk = this._cache.flush()
6174 if (this._autopadding) {
6175 return unpad(this._mode.decrypt(this, chunk))
6176 } else if (chunk) {
6177 throw new Error('data not multiple of block length')
6178 }
6179}
6180Decipher.prototype.setAutoPadding = function (setTo) {
6181 this._autopadding = !!setTo
6182 return this
6183}
6184function Splitter () {
6185 if (!(this instanceof Splitter)) {
6186 return new Splitter()
15696 } 6187 }
6188 this.cache = new Buffer('')
6189}
6190Splitter.prototype.add = function (data) {
6191 this.cache = Buffer.concat([this.cache, data])
6192}
15697 6193
15698 function decodeRaw (buffer) { 6194Splitter.prototype.get = function (autoPadding) {
15699 var payload = buffer.slice(0, -4) 6195 var out
15700 var checksum = buffer.slice(-4) 6196 if (autoPadding) {
15701 var newChecksum = checksumFn(payload) 6197 if (this.cache.length > 16) {
6198 out = this.cache.slice(0, 16)
6199 this.cache = this.cache.slice(16)
6200 return out
6201 }
6202 } else {
6203 if (this.cache.length >= 16) {
6204 out = this.cache.slice(0, 16)
6205 this.cache = this.cache.slice(16)
6206 return out
6207 }
6208 }
6209 return null
6210}
6211Splitter.prototype.flush = function () {
6212 if (this.cache.length) {
6213 return this.cache
6214 }
6215}
6216function unpad (last) {
6217 var padded = last[15]
6218 var i = -1
6219 while (++i < padded) {
6220 if (last[(i + (16 - padded))] !== padded) {
6221 throw new Error('unable to decrypt data')
6222 }
6223 }
6224 if (padded === 16) {
6225 return
6226 }
6227 return last.slice(0, 16 - padded)
6228}
15702 6229
15703 if (checksum[0] ^ newChecksum[0] | 6230var modelist = {
15704 checksum[1] ^ newChecksum[1] | 6231 ECB: require('./modes/ecb'),
15705 checksum[2] ^ newChecksum[2] | 6232 CBC: require('./modes/cbc'),
15706 checksum[3] ^ newChecksum[3]) return 6233 CFB: require('./modes/cfb'),
6234 CFB8: require('./modes/cfb8'),
6235 CFB1: require('./modes/cfb1'),
6236 OFB: require('./modes/ofb'),
6237 CTR: require('./modes/ctr'),
6238 GCM: require('./modes/ctr')
6239}
15707 6240
15708 return payload 6241function createDecipheriv (suite, password, iv) {
6242 var config = modes[suite.toLowerCase()]
6243 if (!config) {
6244 throw new TypeError('invalid suite type')
15709 } 6245 }
6246 if (typeof iv === 'string') {
6247 iv = new Buffer(iv)
6248 }
6249 if (typeof password === 'string') {
6250 password = new Buffer(password)
6251 }
6252 if (password.length !== config.key / 8) {
6253 throw new TypeError('invalid key length ' + password.length)
6254 }
6255 if (iv.length !== config.iv) {
6256 throw new TypeError('invalid iv length ' + iv.length)
6257 }
6258 if (config.type === 'stream') {
6259 return new StreamCipher(modelist[config.mode], password, iv, true)
6260 } else if (config.type === 'auth') {
6261 return new AuthCipher(modelist[config.mode], password, iv, true)
6262 }
6263 return new Decipher(modelist[config.mode], password, iv)
6264}
15710 6265
15711 // Decode a base58-check encoded string to a buffer, no result if checksum is wrong 6266function createDecipher (suite, password) {
15712 function decodeUnsafe (string) { 6267 var config = modes[suite.toLowerCase()]
15713 var buffer = base58.decodeUnsafe(string) 6268 if (!config) {
15714 if (!buffer) return 6269 throw new TypeError('invalid suite type')
6270 }
6271 var keys = ebtk(password, false, config.key, config.iv)
6272 return createDecipheriv(suite, keys.key, keys.iv)
6273}
6274exports.createDecipher = createDecipher
6275exports.createDecipheriv = createDecipheriv
15715 6276
15716 return decodeRaw(buffer) 6277}).call(this,require("buffer").Buffer)
6278},{"./aes":20,"./authCipher":21,"./modes":26,"./modes/cbc":27,"./modes/cfb":28,"./modes/cfb1":29,"./modes/cfb8":30,"./modes/ctr":31,"./modes/ecb":32,"./modes/ofb":33,"./streamCipher":34,"buffer":47,"cipher-base":48,"evp_bytestokey":84,"inherits":95}],24:[function(require,module,exports){
6279(function (Buffer){
6280var aes = require('./aes')
6281var Transform = require('cipher-base')
6282var inherits = require('inherits')
6283var modes = require('./modes')
6284var ebtk = require('evp_bytestokey')
6285var StreamCipher = require('./streamCipher')
6286var AuthCipher = require('./authCipher')
6287inherits(Cipher, Transform)
6288function Cipher (mode, key, iv) {
6289 if (!(this instanceof Cipher)) {
6290 return new Cipher(mode, key, iv)
15717 } 6291 }
6292 Transform.call(this)
6293 this._cache = new Splitter()
6294 this._cipher = new aes.AES(key)
6295 this._prev = new Buffer(iv.length)
6296 iv.copy(this._prev)
6297 this._mode = mode
6298 this._autopadding = true
6299}
6300Cipher.prototype._update = function (data) {
6301 this._cache.add(data)
6302 var chunk
6303 var thing
6304 var out = []
6305 while ((chunk = this._cache.get())) {
6306 thing = this._mode.encrypt(this, chunk)
6307 out.push(thing)
6308 }
6309 return Buffer.concat(out)
6310}
6311Cipher.prototype._final = function () {
6312 var chunk = this._cache.flush()
6313 if (this._autopadding) {
6314 chunk = this._mode.encrypt(this, chunk)
6315 this._cipher.scrub()
6316 return chunk
6317 } else if (chunk.toString('hex') !== '10101010101010101010101010101010') {
6318 this._cipher.scrub()
6319 throw new Error('data not multiple of block length')
6320 }
6321}
6322Cipher.prototype.setAutoPadding = function (setTo) {
6323 this._autopadding = !!setTo
6324 return this
6325}
15718 6326
15719 function decode (string) { 6327function Splitter () {
15720 var buffer = base58.decode(string) 6328 if (!(this instanceof Splitter)) {
15721 var payload = decodeRaw(buffer, checksumFn) 6329 return new Splitter()
15722 if (!payload) throw new Error('Invalid checksum') 6330 }
15723 return payload 6331 this.cache = new Buffer('')
6332}
6333Splitter.prototype.add = function (data) {
6334 this.cache = Buffer.concat([this.cache, data])
6335}
6336
6337Splitter.prototype.get = function () {
6338 if (this.cache.length > 15) {
6339 var out = this.cache.slice(0, 16)
6340 this.cache = this.cache.slice(16)
6341 return out
6342 }
6343 return null
6344}
6345Splitter.prototype.flush = function () {
6346 var len = 16 - this.cache.length
6347 var padBuff = new Buffer(len)
6348
6349 var i = -1
6350 while (++i < len) {
6351 padBuff.writeUInt8(len, i)
6352 }
6353 var out = Buffer.concat([this.cache, padBuff])
6354 return out
6355}
6356var modelist = {
6357 ECB: require('./modes/ecb'),
6358 CBC: require('./modes/cbc'),
6359 CFB: require('./modes/cfb'),
6360 CFB8: require('./modes/cfb8'),
6361 CFB1: require('./modes/cfb1'),
6362 OFB: require('./modes/ofb'),
6363 CTR: require('./modes/ctr'),
6364 GCM: require('./modes/ctr')
6365}
6366
6367function createCipheriv (suite, password, iv) {
6368 var config = modes[suite.toLowerCase()]
6369 if (!config) {
6370 throw new TypeError('invalid suite type')
6371 }
6372 if (typeof iv === 'string') {
6373 iv = new Buffer(iv)
6374 }
6375 if (typeof password === 'string') {
6376 password = new Buffer(password)
6377 }
6378 if (password.length !== config.key / 8) {
6379 throw new TypeError('invalid key length ' + password.length)
6380 }
6381 if (iv.length !== config.iv) {
6382 throw new TypeError('invalid iv length ' + iv.length)
6383 }
6384 if (config.type === 'stream') {
6385 return new StreamCipher(modelist[config.mode], password, iv)
6386 } else if (config.type === 'auth') {
6387 return new AuthCipher(modelist[config.mode], password, iv)
6388 }
6389 return new Cipher(modelist[config.mode], password, iv)
6390}
6391function createCipher (suite, password) {
6392 var config = modes[suite.toLowerCase()]
6393 if (!config) {
6394 throw new TypeError('invalid suite type')
6395 }
6396 var keys = ebtk(password, false, config.key, config.iv)
6397 return createCipheriv(suite, keys.key, keys.iv)
6398}
6399
6400exports.createCipheriv = createCipheriv
6401exports.createCipher = createCipher
6402
6403}).call(this,require("buffer").Buffer)
6404},{"./aes":20,"./authCipher":21,"./modes":26,"./modes/cbc":27,"./modes/cfb":28,"./modes/cfb1":29,"./modes/cfb8":30,"./modes/ctr":31,"./modes/ecb":32,"./modes/ofb":33,"./streamCipher":34,"buffer":47,"cipher-base":48,"evp_bytestokey":84,"inherits":95}],25:[function(require,module,exports){
6405(function (Buffer){
6406var zeros = new Buffer(16)
6407zeros.fill(0)
6408module.exports = GHASH
6409function GHASH (key) {
6410 this.h = key
6411 this.state = new Buffer(16)
6412 this.state.fill(0)
6413 this.cache = new Buffer('')
6414}
6415// from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html
6416// by Juho Vähä-Herttua
6417GHASH.prototype.ghash = function (block) {
6418 var i = -1
6419 while (++i < block.length) {
6420 this.state[i] ^= block[i]
6421 }
6422 this._multiply()
6423}
6424
6425GHASH.prototype._multiply = function () {
6426 var Vi = toArray(this.h)
6427 var Zi = [0, 0, 0, 0]
6428 var j, xi, lsb_Vi
6429 var i = -1
6430 while (++i < 128) {
6431 xi = (this.state[~~(i / 8)] & (1 << (7 - i % 8))) !== 0
6432 if (xi) {
6433 // Z_i+1 = Z_i ^ V_i
6434 Zi = xor(Zi, Vi)
6435 }
6436
6437 // Store the value of LSB(V_i)
6438 lsb_Vi = (Vi[3] & 1) !== 0
6439
6440 // V_i+1 = V_i >> 1
6441 for (j = 3; j > 0; j--) {
6442 Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)
6443 }
6444 Vi[0] = Vi[0] >>> 1
6445
6446 // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R
6447 if (lsb_Vi) {
6448 Vi[0] = Vi[0] ^ (0xe1 << 24)
6449 }
6450 }
6451 this.state = fromArray(Zi)
6452}
6453GHASH.prototype.update = function (buf) {
6454 this.cache = Buffer.concat([this.cache, buf])
6455 var chunk
6456 while (this.cache.length >= 16) {
6457 chunk = this.cache.slice(0, 16)
6458 this.cache = this.cache.slice(16)
6459 this.ghash(chunk)
6460 }
6461}
6462GHASH.prototype.final = function (abl, bl) {
6463 if (this.cache.length) {
6464 this.ghash(Buffer.concat([this.cache, zeros], 16))
6465 }
6466 this.ghash(fromArray([
6467 0, abl,
6468 0, bl
6469 ]))
6470 return this.state
6471}
6472
6473function toArray (buf) {
6474 return [
6475 buf.readUInt32BE(0),
6476 buf.readUInt32BE(4),
6477 buf.readUInt32BE(8),
6478 buf.readUInt32BE(12)
6479 ]
6480}
6481function fromArray (out) {
6482 out = out.map(fixup_uint32)
6483 var buf = new Buffer(16)
6484 buf.writeUInt32BE(out[0], 0)
6485 buf.writeUInt32BE(out[1], 4)
6486 buf.writeUInt32BE(out[2], 8)
6487 buf.writeUInt32BE(out[3], 12)
6488 return buf
6489}
6490var uint_max = Math.pow(2, 32)
6491function fixup_uint32 (x) {
6492 var ret, x_pos
6493 ret = x > uint_max || x < 0 ? (x_pos = Math.abs(x) % uint_max, x < 0 ? uint_max - x_pos : x_pos) : x
6494 return ret
6495}
6496function xor (a, b) {
6497 return [
6498 a[0] ^ b[0],
6499 a[1] ^ b[1],
6500 a[2] ^ b[2],
6501 a[3] ^ b[3]
6502 ]
6503}
6504
6505}).call(this,require("buffer").Buffer)
6506},{"buffer":47}],26:[function(require,module,exports){
6507exports['aes-128-ecb'] = {
6508 cipher: 'AES',
6509 key: 128,
6510 iv: 0,
6511 mode: 'ECB',
6512 type: 'block'
6513}
6514exports['aes-192-ecb'] = {
6515 cipher: 'AES',
6516 key: 192,
6517 iv: 0,
6518 mode: 'ECB',
6519 type: 'block'
6520}
6521exports['aes-256-ecb'] = {
6522 cipher: 'AES',
6523 key: 256,
6524 iv: 0,
6525 mode: 'ECB',
6526 type: 'block'
6527}
6528exports['aes-128-cbc'] = {
6529 cipher: 'AES',
6530 key: 128,
6531 iv: 16,
6532 mode: 'CBC',
6533 type: 'block'
6534}
6535exports['aes-192-cbc'] = {
6536 cipher: 'AES',
6537 key: 192,
6538 iv: 16,
6539 mode: 'CBC',
6540 type: 'block'
6541}
6542exports['aes-256-cbc'] = {
6543 cipher: 'AES',
6544 key: 256,
6545 iv: 16,
6546 mode: 'CBC',
6547 type: 'block'
6548}
6549exports['aes128'] = exports['aes-128-cbc']
6550exports['aes192'] = exports['aes-192-cbc']
6551exports['aes256'] = exports['aes-256-cbc']
6552exports['aes-128-cfb'] = {
6553 cipher: 'AES',
6554 key: 128,
6555 iv: 16,
6556 mode: 'CFB',
6557 type: 'stream'
6558}
6559exports['aes-192-cfb'] = {
6560 cipher: 'AES',
6561 key: 192,
6562 iv: 16,
6563 mode: 'CFB',
6564 type: 'stream'
6565}
6566exports['aes-256-cfb'] = {
6567 cipher: 'AES',
6568 key: 256,
6569 iv: 16,
6570 mode: 'CFB',
6571 type: 'stream'
6572}
6573exports['aes-128-cfb8'] = {
6574 cipher: 'AES',
6575 key: 128,
6576 iv: 16,
6577 mode: 'CFB8',
6578 type: 'stream'
6579}
6580exports['aes-192-cfb8'] = {
6581 cipher: 'AES',
6582 key: 192,
6583 iv: 16,
6584 mode: 'CFB8',
6585 type: 'stream'
6586}
6587exports['aes-256-cfb8'] = {
6588 cipher: 'AES',
6589 key: 256,
6590 iv: 16,
6591 mode: 'CFB8',
6592 type: 'stream'
6593}
6594exports['aes-128-cfb1'] = {
6595 cipher: 'AES',
6596 key: 128,
6597 iv: 16,
6598 mode: 'CFB1',
6599 type: 'stream'
6600}
6601exports['aes-192-cfb1'] = {
6602 cipher: 'AES',
6603 key: 192,
6604 iv: 16,
6605 mode: 'CFB1',
6606 type: 'stream'
6607}
6608exports['aes-256-cfb1'] = {
6609 cipher: 'AES',
6610 key: 256,
6611 iv: 16,
6612 mode: 'CFB1',
6613 type: 'stream'
6614}
6615exports['aes-128-ofb'] = {
6616 cipher: 'AES',
6617 key: 128,
6618 iv: 16,
6619 mode: 'OFB',
6620 type: 'stream'
6621}
6622exports['aes-192-ofb'] = {
6623 cipher: 'AES',
6624 key: 192,
6625 iv: 16,
6626 mode: 'OFB',
6627 type: 'stream'
6628}
6629exports['aes-256-ofb'] = {
6630 cipher: 'AES',
6631 key: 256,
6632 iv: 16,
6633 mode: 'OFB',
6634 type: 'stream'
6635}
6636exports['aes-128-ctr'] = {
6637 cipher: 'AES',
6638 key: 128,
6639 iv: 16,
6640 mode: 'CTR',
6641 type: 'stream'
6642}
6643exports['aes-192-ctr'] = {
6644 cipher: 'AES',
6645 key: 192,
6646 iv: 16,
6647 mode: 'CTR',
6648 type: 'stream'
6649}
6650exports['aes-256-ctr'] = {
6651 cipher: 'AES',
6652 key: 256,
6653 iv: 16,
6654 mode: 'CTR',
6655 type: 'stream'
6656}
6657exports['aes-128-gcm'] = {
6658 cipher: 'AES',
6659 key: 128,
6660 iv: 12,
6661 mode: 'GCM',
6662 type: 'auth'
6663}
6664exports['aes-192-gcm'] = {
6665 cipher: 'AES',
6666 key: 192,
6667 iv: 12,
6668 mode: 'GCM',
6669 type: 'auth'
6670}
6671exports['aes-256-gcm'] = {
6672 cipher: 'AES',
6673 key: 256,
6674 iv: 12,
6675 mode: 'GCM',
6676 type: 'auth'
6677}
6678
6679},{}],27:[function(require,module,exports){
6680var xor = require('buffer-xor')
6681
6682exports.encrypt = function (self, block) {
6683 var data = xor(block, self._prev)
6684
6685 self._prev = self._cipher.encryptBlock(data)
6686 return self._prev
6687}
6688
6689exports.decrypt = function (self, block) {
6690 var pad = self._prev
6691
6692 self._prev = block
6693 var out = self._cipher.decryptBlock(block)
6694
6695 return xor(out, pad)
6696}
6697
6698},{"buffer-xor":46}],28:[function(require,module,exports){
6699(function (Buffer){
6700var xor = require('buffer-xor')
6701
6702exports.encrypt = function (self, data, decrypt) {
6703 var out = new Buffer('')
6704 var len
6705
6706 while (data.length) {
6707 if (self._cache.length === 0) {
6708 self._cache = self._cipher.encryptBlock(self._prev)
6709 self._prev = new Buffer('')
6710 }
6711
6712 if (self._cache.length <= data.length) {
6713 len = self._cache.length
6714 out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])
6715 data = data.slice(len)
6716 } else {
6717 out = Buffer.concat([out, encryptStart(self, data, decrypt)])
6718 break
6719 }
6720 }
6721
6722 return out
6723}
6724function encryptStart (self, data, decrypt) {
6725 var len = data.length
6726 var out = xor(data, self._cache)
6727 self._cache = self._cache.slice(len)
6728 self._prev = Buffer.concat([self._prev, decrypt ? data : out])
6729 return out
6730}
6731
6732}).call(this,require("buffer").Buffer)
6733},{"buffer":47,"buffer-xor":46}],29:[function(require,module,exports){
6734(function (Buffer){
6735function encryptByte (self, byteParam, decrypt) {
6736 var pad
6737 var i = -1
6738 var len = 8
6739 var out = 0
6740 var bit, value
6741 while (++i < len) {
6742 pad = self._cipher.encryptBlock(self._prev)
6743 bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0
6744 value = pad[0] ^ bit
6745 out += ((value & 0x80) >> (i % 8))
6746 self._prev = shiftIn(self._prev, decrypt ? bit : value)
6747 }
6748 return out
6749}
6750exports.encrypt = function (self, chunk, decrypt) {
6751 var len = chunk.length
6752 var out = new Buffer(len)
6753 var i = -1
6754 while (++i < len) {
6755 out[i] = encryptByte(self, chunk[i], decrypt)
6756 }
6757 return out
6758}
6759function shiftIn (buffer, value) {
6760 var len = buffer.length
6761 var i = -1
6762 var out = new Buffer(buffer.length)
6763 buffer = Buffer.concat([buffer, new Buffer([value])])
6764 while (++i < len) {
6765 out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)
6766 }
6767 return out
6768}
6769
6770}).call(this,require("buffer").Buffer)
6771},{"buffer":47}],30:[function(require,module,exports){
6772(function (Buffer){
6773function encryptByte (self, byteParam, decrypt) {
6774 var pad = self._cipher.encryptBlock(self._prev)
6775 var out = pad[0] ^ byteParam
6776 self._prev = Buffer.concat([self._prev.slice(1), new Buffer([decrypt ? byteParam : out])])
6777 return out
6778}
6779exports.encrypt = function (self, chunk, decrypt) {
6780 var len = chunk.length
6781 var out = new Buffer(len)
6782 var i = -1
6783 while (++i < len) {
6784 out[i] = encryptByte(self, chunk[i], decrypt)
6785 }
6786 return out
6787}
6788
6789}).call(this,require("buffer").Buffer)
6790},{"buffer":47}],31:[function(require,module,exports){
6791(function (Buffer){
6792var xor = require('buffer-xor')
6793
6794function incr32 (iv) {
6795 var len = iv.length
6796 var item
6797 while (len--) {
6798 item = iv.readUInt8(len)
6799 if (item === 255) {
6800 iv.writeUInt8(0, len)
6801 } else {
6802 item++
6803 iv.writeUInt8(item, len)
6804 break
6805 }
6806 }
6807}
6808
6809function getBlock (self) {
6810 var out = self._cipher.encryptBlock(self._prev)
6811 incr32(self._prev)
6812 return out
6813}
6814
6815exports.encrypt = function (self, chunk) {
6816 while (self._cache.length < chunk.length) {
6817 self._cache = Buffer.concat([self._cache, getBlock(self)])
6818 }
6819 var pad = self._cache.slice(0, chunk.length)
6820 self._cache = self._cache.slice(chunk.length)
6821 return xor(chunk, pad)
6822}
6823
6824}).call(this,require("buffer").Buffer)
6825},{"buffer":47,"buffer-xor":46}],32:[function(require,module,exports){
6826exports.encrypt = function (self, block) {
6827 return self._cipher.encryptBlock(block)
6828}
6829exports.decrypt = function (self, block) {
6830 return self._cipher.decryptBlock(block)
6831}
6832
6833},{}],33:[function(require,module,exports){
6834(function (Buffer){
6835var xor = require('buffer-xor')
6836
6837function getBlock (self) {
6838 self._prev = self._cipher.encryptBlock(self._prev)
6839 return self._prev
6840}
6841
6842exports.encrypt = function (self, chunk) {
6843 while (self._cache.length < chunk.length) {
6844 self._cache = Buffer.concat([self._cache, getBlock(self)])
6845 }
6846
6847 var pad = self._cache.slice(0, chunk.length)
6848 self._cache = self._cache.slice(chunk.length)
6849 return xor(chunk, pad)
6850}
6851
6852}).call(this,require("buffer").Buffer)
6853},{"buffer":47,"buffer-xor":46}],34:[function(require,module,exports){
6854(function (Buffer){
6855var aes = require('./aes')
6856var Transform = require('cipher-base')
6857var inherits = require('inherits')
6858
6859inherits(StreamCipher, Transform)
6860module.exports = StreamCipher
6861function StreamCipher (mode, key, iv, decrypt) {
6862 if (!(this instanceof StreamCipher)) {
6863 return new StreamCipher(mode, key, iv)
6864 }
6865 Transform.call(this)
6866 this._cipher = new aes.AES(key)
6867 this._prev = new Buffer(iv.length)
6868 this._cache = new Buffer('')
6869 this._secCache = new Buffer('')
6870 this._decrypt = decrypt
6871 iv.copy(this._prev)
6872 this._mode = mode
6873}
6874StreamCipher.prototype._update = function (chunk) {
6875 return this._mode.encrypt(this, chunk, this._decrypt)
6876}
6877StreamCipher.prototype._final = function () {
6878 this._cipher.scrub()
6879}
6880
6881}).call(this,require("buffer").Buffer)
6882},{"./aes":20,"buffer":47,"cipher-base":48,"inherits":95}],35:[function(require,module,exports){
6883var ebtk = require('evp_bytestokey')
6884var aes = require('browserify-aes/browser')
6885var DES = require('browserify-des')
6886var desModes = require('browserify-des/modes')
6887var aesModes = require('browserify-aes/modes')
6888function createCipher (suite, password) {
6889 var keyLen, ivLen
6890 suite = suite.toLowerCase()
6891 if (aesModes[suite]) {
6892 keyLen = aesModes[suite].key
6893 ivLen = aesModes[suite].iv
6894 } else if (desModes[suite]) {
6895 keyLen = desModes[suite].key * 8
6896 ivLen = desModes[suite].iv
6897 } else {
6898 throw new TypeError('invalid suite type')
6899 }
6900 var keys = ebtk(password, false, keyLen, ivLen)
6901 return createCipheriv(suite, keys.key, keys.iv)
6902}
6903function createDecipher (suite, password) {
6904 var keyLen, ivLen
6905 suite = suite.toLowerCase()
6906 if (aesModes[suite]) {
6907 keyLen = aesModes[suite].key
6908 ivLen = aesModes[suite].iv
6909 } else if (desModes[suite]) {
6910 keyLen = desModes[suite].key * 8
6911 ivLen = desModes[suite].iv
6912 } else {
6913 throw new TypeError('invalid suite type')
6914 }
6915 var keys = ebtk(password, false, keyLen, ivLen)
6916 return createDecipheriv(suite, keys.key, keys.iv)
6917}
6918
6919function createCipheriv (suite, key, iv) {
6920 suite = suite.toLowerCase()
6921 if (aesModes[suite]) {
6922 return aes.createCipheriv(suite, key, iv)
6923 } else if (desModes[suite]) {
6924 return new DES({
6925 key: key,
6926 iv: iv,
6927 mode: suite
6928 })
6929 } else {
6930 throw new TypeError('invalid suite type')
6931 }
6932}
6933function createDecipheriv (suite, key, iv) {
6934 suite = suite.toLowerCase()
6935 if (aesModes[suite]) {
6936 return aes.createDecipheriv(suite, key, iv)
6937 } else if (desModes[suite]) {
6938 return new DES({
6939 key: key,
6940 iv: iv,
6941 mode: suite,
6942 decrypt: true
6943 })
6944 } else {
6945 throw new TypeError('invalid suite type')
6946 }
6947}
6948exports.createCipher = exports.Cipher = createCipher
6949exports.createCipheriv = exports.Cipheriv = createCipheriv
6950exports.createDecipher = exports.Decipher = createDecipher
6951exports.createDecipheriv = exports.Decipheriv = createDecipheriv
6952function getCiphers () {
6953 return Object.keys(desModes).concat(aes.getCiphers())
6954}
6955exports.listCiphers = exports.getCiphers = getCiphers
6956
6957},{"browserify-aes/browser":22,"browserify-aes/modes":26,"browserify-des":36,"browserify-des/modes":37,"evp_bytestokey":84}],36:[function(require,module,exports){
6958(function (Buffer){
6959var CipherBase = require('cipher-base')
6960var des = require('des.js')
6961var inherits = require('inherits')
6962
6963var modes = {
6964 'des-ede3-cbc': des.CBC.instantiate(des.EDE),
6965 'des-ede3': des.EDE,
6966 'des-ede-cbc': des.CBC.instantiate(des.EDE),
6967 'des-ede': des.EDE,
6968 'des-cbc': des.CBC.instantiate(des.DES),
6969 'des-ecb': des.DES
6970}
6971modes.des = modes['des-cbc']
6972modes.des3 = modes['des-ede3-cbc']
6973module.exports = DES
6974inherits(DES, CipherBase)
6975function DES (opts) {
6976 CipherBase.call(this)
6977 var modeName = opts.mode.toLowerCase()
6978 var mode = modes[modeName]
6979 var type
6980 if (opts.decrypt) {
6981 type = 'decrypt'
6982 } else {
6983 type = 'encrypt'
6984 }
6985 var key = opts.key
6986 if (modeName === 'des-ede' || modeName === 'des-ede-cbc') {
6987 key = Buffer.concat([key, key.slice(0, 8)])
15724 } 6988 }
6989 var iv = opts.iv
6990 this._des = mode.create({
6991 key: key,
6992 iv: iv,
6993 type: type
6994 })
6995}
6996DES.prototype._update = function (data) {
6997 return new Buffer(this._des.update(data))
6998}
6999DES.prototype._final = function () {
7000 return new Buffer(this._des.final())
7001}
7002
7003}).call(this,require("buffer").Buffer)
7004},{"buffer":47,"cipher-base":48,"des.js":57,"inherits":95}],37:[function(require,module,exports){
7005exports['des-ecb'] = {
7006 key: 8,
7007 iv: 0
7008}
7009exports['des-cbc'] = exports.des = {
7010 key: 8,
7011 iv: 8
7012}
7013exports['des-ede3-cbc'] = exports.des3 = {
7014 key: 24,
7015 iv: 8
7016}
7017exports['des-ede3'] = {
7018 key: 24,
7019 iv: 0
7020}
7021exports['des-ede-cbc'] = {
7022 key: 16,
7023 iv: 8
7024}
7025exports['des-ede'] = {
7026 key: 16,
7027 iv: 0
7028}
15725 7029
7030},{}],38:[function(require,module,exports){
7031(function (Buffer){
7032var bn = require('bn.js');
7033var randomBytes = require('randombytes');
7034module.exports = crt;
7035function blind(priv) {
7036 var r = getr(priv);
7037 var blinder = r.toRed(bn.mont(priv.modulus))
7038 .redPow(new bn(priv.publicExponent)).fromRed();
15726 return { 7039 return {
15727 encode: encode, 7040 blinder: blinder,
15728 decode: decode, 7041 unblinder:r.invm(priv.modulus)
15729 decodeUnsafe: decodeUnsafe 7042 };
7043}
7044function crt(msg, priv) {
7045 var blinds = blind(priv);
7046 var len = priv.modulus.byteLength();
7047 var mod = bn.mont(priv.modulus);
7048 var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus);
7049 var c1 = blinded.toRed(bn.mont(priv.prime1));
7050 var c2 = blinded.toRed(bn.mont(priv.prime2));
7051 var qinv = priv.coefficient;
7052 var p = priv.prime1;
7053 var q = priv.prime2;
7054 var m1 = c1.redPow(priv.exponent1);
7055 var m2 = c2.redPow(priv.exponent2);
7056 m1 = m1.fromRed();
7057 m2 = m2.fromRed();
7058 var h = m1.isub(m2).imul(qinv).umod(p);
7059 h.imul(q);
7060 m2.iadd(h);
7061 return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len));
7062}
7063crt.getr = getr;
7064function getr(priv) {
7065 var len = priv.modulus.byteLength();
7066 var r = new bn(randomBytes(len));
7067 while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) {
7068 r = new bn(randomBytes(len));
15730 } 7069 }
7070 return r;
15731} 7071}
15732 7072
15733}).call(this,require("buffer").Buffer) 7073}).call(this,require("buffer").Buffer)
15734},{"bs58":83,"buffer":5}],85:[function(require,module,exports){ 7074},{"bn.js":17,"buffer":47,"randombytes":119}],39:[function(require,module,exports){
15735'use strict' 7075module.exports = require('./browser/algorithms.json')
7076
7077},{"./browser/algorithms.json":40}],40:[function(require,module,exports){
7078module.exports={
7079 "sha224WithRSAEncryption": {
7080 "sign": "rsa",
7081 "hash": "sha224",
7082 "id": "302d300d06096086480165030402040500041c"
7083 },
7084 "RSA-SHA224": {
7085 "sign": "ecdsa/rsa",
7086 "hash": "sha224",
7087 "id": "302d300d06096086480165030402040500041c"
7088 },
7089 "sha256WithRSAEncryption": {
7090 "sign": "rsa",
7091 "hash": "sha256",
7092 "id": "3031300d060960864801650304020105000420"
7093 },
7094 "RSA-SHA256": {
7095 "sign": "ecdsa/rsa",
7096 "hash": "sha256",
7097 "id": "3031300d060960864801650304020105000420"
7098 },
7099 "sha384WithRSAEncryption": {
7100 "sign": "rsa",
7101 "hash": "sha384",
7102 "id": "3041300d060960864801650304020205000430"
7103 },
7104 "RSA-SHA384": {
7105 "sign": "ecdsa/rsa",
7106 "hash": "sha384",
7107 "id": "3041300d060960864801650304020205000430"
7108 },
7109 "sha512WithRSAEncryption": {
7110 "sign": "rsa",
7111 "hash": "sha512",
7112 "id": "3051300d060960864801650304020305000440"
7113 },
7114 "RSA-SHA512": {
7115 "sign": "ecdsa/rsa",
7116 "hash": "sha512",
7117 "id": "3051300d060960864801650304020305000440"
7118 },
7119 "RSA-SHA1": {
7120 "sign": "rsa",
7121 "hash": "sha1",
7122 "id": "3021300906052b0e03021a05000414"
7123 },
7124 "ecdsa-with-SHA1": {
7125 "sign": "ecdsa",
7126 "hash": "sha1",
7127 "id": ""
7128 },
7129 "sha256": {
7130 "sign": "ecdsa",
7131 "hash": "sha256",
7132 "id": ""
7133 },
7134 "sha224": {
7135 "sign": "ecdsa",
7136 "hash": "sha224",
7137 "id": ""
7138 },
7139 "sha384": {
7140 "sign": "ecdsa",
7141 "hash": "sha384",
7142 "id": ""
7143 },
7144 "sha512": {
7145 "sign": "ecdsa",
7146 "hash": "sha512",
7147 "id": ""
7148 },
7149 "DSA-SHA": {
7150 "sign": "dsa",
7151 "hash": "sha1",
7152 "id": ""
7153 },
7154 "DSA-SHA1": {
7155 "sign": "dsa",
7156 "hash": "sha1",
7157 "id": ""
7158 },
7159 "DSA": {
7160 "sign": "dsa",
7161 "hash": "sha1",
7162 "id": ""
7163 },
7164 "DSA-WITH-SHA224": {
7165 "sign": "dsa",
7166 "hash": "sha224",
7167 "id": ""
7168 },
7169 "DSA-SHA224": {
7170 "sign": "dsa",
7171 "hash": "sha224",
7172 "id": ""
7173 },
7174 "DSA-WITH-SHA256": {
7175 "sign": "dsa",
7176 "hash": "sha256",
7177 "id": ""
7178 },
7179 "DSA-SHA256": {
7180 "sign": "dsa",
7181 "hash": "sha256",
7182 "id": ""
7183 },
7184 "DSA-WITH-SHA384": {
7185 "sign": "dsa",
7186 "hash": "sha384",
7187 "id": ""
7188 },
7189 "DSA-SHA384": {
7190 "sign": "dsa",
7191 "hash": "sha384",
7192 "id": ""
7193 },
7194 "DSA-WITH-SHA512": {
7195 "sign": "dsa",
7196 "hash": "sha512",
7197 "id": ""
7198 },
7199 "DSA-SHA512": {
7200 "sign": "dsa",
7201 "hash": "sha512",
7202 "id": ""
7203 },
7204 "DSA-RIPEMD160": {
7205 "sign": "dsa",
7206 "hash": "rmd160",
7207 "id": ""
7208 },
7209 "ripemd160WithRSA": {
7210 "sign": "rsa",
7211 "hash": "rmd160",
7212 "id": "3021300906052b2403020105000414"
7213 },
7214 "RSA-RIPEMD160": {
7215 "sign": "rsa",
7216 "hash": "rmd160",
7217 "id": "3021300906052b2403020105000414"
7218 },
7219 "md5WithRSAEncryption": {
7220 "sign": "rsa",
7221 "hash": "md5",
7222 "id": "3020300c06082a864886f70d020505000410"
7223 },
7224 "RSA-MD5": {
7225 "sign": "rsa",
7226 "hash": "md5",
7227 "id": "3020300c06082a864886f70d020505000410"
7228 }
7229}
7230
7231},{}],41:[function(require,module,exports){
7232module.exports={
7233 "1.3.132.0.10": "secp256k1",
7234 "1.3.132.0.33": "p224",
7235 "1.2.840.10045.3.1.1": "p192",
7236 "1.2.840.10045.3.1.7": "p256",
7237 "1.3.132.0.34": "p384",
7238 "1.3.132.0.35": "p521"
7239}
15736 7240
7241},{}],42:[function(require,module,exports){
7242(function (Buffer){
15737var createHash = require('create-hash') 7243var createHash = require('create-hash')
15738var bs58checkBase = require('./base') 7244var stream = require('stream')
7245var inherits = require('inherits')
7246var sign = require('./sign')
7247var verify = require('./verify')
15739 7248
15740// SHA256(SHA256(buffer)) 7249var algorithms = require('./algorithms.json')
15741function sha256x2 (buffer) { 7250Object.keys(algorithms).forEach(function (key) {
15742 var tmp = createHash('sha256').update(buffer).digest() 7251 algorithms[key].id = new Buffer(algorithms[key].id, 'hex')
15743 return createHash('sha256').update(tmp).digest() 7252 algorithms[key.toLowerCase()] = algorithms[key]
7253})
7254
7255function Sign (algorithm) {
7256 stream.Writable.call(this)
7257
7258 var data = algorithms[algorithm]
7259 if (!data) throw new Error('Unknown message digest')
7260
7261 this._hashType = data.hash
7262 this._hash = createHash(data.hash)
7263 this._tag = data.id
7264 this._signType = data.sign
15744} 7265}
7266inherits(Sign, stream.Writable)
15745 7267
15746module.exports = bs58checkBase(sha256x2) 7268Sign.prototype._write = function _write (data, _, done) {
7269 this._hash.update(data)
7270 done()
7271}
15747 7272
15748},{"./base":84,"create-hash":87}],86:[function(require,module,exports){ 7273Sign.prototype.update = function update (data, enc) {
15749var Buffer = require('safe-buffer').Buffer 7274 if (typeof data === 'string') data = new Buffer(data, enc)
7275
7276 this._hash.update(data)
7277 return this
7278}
7279
7280Sign.prototype.sign = function signMethod (key, enc) {
7281 this.end()
7282 var hash = this._hash.digest()
7283 var sig = sign(hash, key, this._hashType, this._signType, this._tag)
7284
7285 return enc ? sig.toString(enc) : sig
7286}
7287
7288function Verify (algorithm) {
7289 stream.Writable.call(this)
7290
7291 var data = algorithms[algorithm]
7292 if (!data) throw new Error('Unknown message digest')
7293
7294 this._hash = createHash(data.hash)
7295 this._tag = data.id
7296 this._signType = data.sign
7297}
7298inherits(Verify, stream.Writable)
7299
7300Verify.prototype._write = function _write (data, _, done) {
7301 this._hash.update(data)
7302 done()
7303}
7304
7305Verify.prototype.update = function update (data, enc) {
7306 if (typeof data === 'string') data = new Buffer(data, enc)
7307
7308 this._hash.update(data)
7309 return this
7310}
7311
7312Verify.prototype.verify = function verifyMethod (key, sig, enc) {
7313 if (typeof sig === 'string') sig = new Buffer(sig, enc)
7314
7315 this.end()
7316 var hash = this._hash.digest()
7317 return verify(sig, hash, key, this._signType, this._tag)
7318}
7319
7320function createSign (algorithm) {
7321 return new Sign(algorithm)
7322}
7323
7324function createVerify (algorithm) {
7325 return new Verify(algorithm)
7326}
7327
7328module.exports = {
7329 Sign: createSign,
7330 Verify: createVerify,
7331 createSign: createSign,
7332 createVerify: createVerify
7333}
7334
7335}).call(this,require("buffer").Buffer)
7336},{"./algorithms.json":40,"./sign":43,"./verify":44,"buffer":47,"create-hash":51,"inherits":95,"stream":143}],43:[function(require,module,exports){
7337(function (Buffer){
7338// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
7339var createHmac = require('create-hmac')
7340var crt = require('browserify-rsa')
7341var EC = require('elliptic').ec
7342var BN = require('bn.js')
7343var parseKeys = require('parse-asn1')
7344var curves = require('./curves.json')
7345
7346function sign (hash, key, hashType, signType, tag) {
7347 var priv = parseKeys(key)
7348 if (priv.curve) {
7349 // rsa keys can be interpreted as ecdsa ones in openssl
7350 if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
7351 return ecSign(hash, priv)
7352 } else if (priv.type === 'dsa') {
7353 if (signType !== 'dsa') throw new Error('wrong private key type')
7354 return dsaSign(hash, priv, hashType)
7355 } else {
7356 if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
7357 }
7358 hash = Buffer.concat([tag, hash])
7359 var len = priv.modulus.byteLength()
7360 var pad = [ 0, 1 ]
7361 while (hash.length + pad.length + 1 < len) pad.push(0xff)
7362 pad.push(0x00)
7363 var i = -1
7364 while (++i < hash.length) pad.push(hash[i])
7365
7366 var out = crt(pad, priv)
7367 return out
7368}
7369
7370function ecSign (hash, priv) {
7371 var curveId = curves[priv.curve.join('.')]
7372 if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.'))
7373
7374 var curve = new EC(curveId)
7375 var key = curve.keyFromPrivate(priv.privateKey)
7376 var out = key.sign(hash)
7377
7378 return new Buffer(out.toDER())
7379}
7380
7381function dsaSign (hash, priv, algo) {
7382 var x = priv.params.priv_key
7383 var p = priv.params.p
7384 var q = priv.params.q
7385 var g = priv.params.g
7386 var r = new BN(0)
7387 var k
7388 var H = bits2int(hash, q).mod(q)
7389 var s = false
7390 var kv = getKey(x, q, hash, algo)
7391 while (s === false) {
7392 k = makeKey(q, kv, algo)
7393 r = makeR(g, k, p, q)
7394 s = k.invm(q).imul(H.add(x.mul(r))).mod(q)
7395 if (s.cmpn(0) === 0) {
7396 s = false
7397 r = new BN(0)
7398 }
7399 }
7400 return toDER(r, s)
7401}
7402
7403function toDER (r, s) {
7404 r = r.toArray()
7405 s = s.toArray()
7406
7407 // Pad values
7408 if (r[0] & 0x80) r = [ 0 ].concat(r)
7409 if (s[0] & 0x80) s = [ 0 ].concat(s)
7410
7411 var total = r.length + s.length + 4
7412 var res = [ 0x30, total, 0x02, r.length ]
7413 res = res.concat(r, [ 0x02, s.length ], s)
7414 return new Buffer(res)
7415}
7416
7417function getKey (x, q, hash, algo) {
7418 x = new Buffer(x.toArray())
7419 if (x.length < q.byteLength()) {
7420 var zeros = new Buffer(q.byteLength() - x.length)
7421 zeros.fill(0)
7422 x = Buffer.concat([ zeros, x ])
7423 }
7424 var hlen = hash.length
7425 var hbits = bits2octets(hash, q)
7426 var v = new Buffer(hlen)
7427 v.fill(1)
7428 var k = new Buffer(hlen)
7429 k.fill(0)
7430 k = createHmac(algo, k).update(v).update(new Buffer([ 0 ])).update(x).update(hbits).digest()
7431 v = createHmac(algo, k).update(v).digest()
7432 k = createHmac(algo, k).update(v).update(new Buffer([ 1 ])).update(x).update(hbits).digest()
7433 v = createHmac(algo, k).update(v).digest()
7434 return { k: k, v: v }
7435}
7436
7437function bits2int (obits, q) {
7438 var bits = new BN(obits)
7439 var shift = (obits.length << 3) - q.bitLength()
7440 if (shift > 0) bits.ishrn(shift)
7441 return bits
7442}
7443
7444function bits2octets (bits, q) {
7445 bits = bits2int(bits, q)
7446 bits = bits.mod(q)
7447 var out = new Buffer(bits.toArray())
7448 if (out.length < q.byteLength()) {
7449 var zeros = new Buffer(q.byteLength() - out.length)
7450 zeros.fill(0)
7451 out = Buffer.concat([ zeros, out ])
7452 }
7453 return out
7454}
7455
7456function makeKey (q, kv, algo) {
7457 var t
7458 var k
7459
7460 do {
7461 t = new Buffer(0)
7462
7463 while (t.length * 8 < q.bitLength()) {
7464 kv.v = createHmac(algo, kv.k).update(kv.v).digest()
7465 t = Buffer.concat([ t, kv.v ])
7466 }
7467
7468 k = bits2int(t, q)
7469 kv.k = createHmac(algo, kv.k).update(kv.v).update(new Buffer([ 0 ])).digest()
7470 kv.v = createHmac(algo, kv.k).update(kv.v).digest()
7471 } while (k.cmp(q) !== -1)
7472
7473 return k
7474}
7475
7476function makeR (g, k, p, q) {
7477 return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q)
7478}
7479
7480module.exports = sign
7481module.exports.getKey = getKey
7482module.exports.makeKey = makeKey
7483
7484}).call(this,require("buffer").Buffer)
7485},{"./curves.json":41,"bn.js":17,"browserify-rsa":38,"buffer":47,"create-hmac":54,"elliptic":67,"parse-asn1":105}],44:[function(require,module,exports){
7486(function (Buffer){
7487// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
7488var BN = require('bn.js')
7489var EC = require('elliptic').ec
7490var parseKeys = require('parse-asn1')
7491var curves = require('./curves.json')
7492
7493function verify (sig, hash, key, signType, tag) {
7494 var pub = parseKeys(key)
7495 if (pub.type === 'ec') {
7496 // rsa keys can be interpreted as ecdsa ones in openssl
7497 if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
7498 return ecVerify(sig, hash, pub)
7499 } else if (pub.type === 'dsa') {
7500 if (signType !== 'dsa') throw new Error('wrong public key type')
7501 return dsaVerify(sig, hash, pub)
7502 } else {
7503 if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
7504 }
7505 hash = Buffer.concat([tag, hash])
7506 var len = pub.modulus.byteLength()
7507 var pad = [ 1 ]
7508 var padNum = 0
7509 while (hash.length + pad.length + 2 < len) {
7510 pad.push(0xff)
7511 padNum++
7512 }
7513 pad.push(0x00)
7514 var i = -1
7515 while (++i < hash.length) {
7516 pad.push(hash[i])
7517 }
7518 pad = new Buffer(pad)
7519 var red = BN.mont(pub.modulus)
7520 sig = new BN(sig).toRed(red)
7521
7522 sig = sig.redPow(new BN(pub.publicExponent))
7523 sig = new Buffer(sig.fromRed().toArray())
7524 var out = padNum < 8 ? 1 : 0
7525 len = Math.min(sig.length, pad.length)
7526 if (sig.length !== pad.length) out = 1
7527
7528 i = -1
7529 while (++i < len) out |= sig[i] ^ pad[i]
7530 return out === 0
7531}
7532
7533function ecVerify (sig, hash, pub) {
7534 var curveId = curves[pub.data.algorithm.curve.join('.')]
7535 if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.'))
7536
7537 var curve = new EC(curveId)
7538 var pubkey = pub.data.subjectPrivateKey.data
7539
7540 return curve.verify(hash, sig, pubkey)
7541}
7542
7543function dsaVerify (sig, hash, pub) {
7544 var p = pub.data.p
7545 var q = pub.data.q
7546 var g = pub.data.g
7547 var y = pub.data.pub_key
7548 var unpacked = parseKeys.signature.decode(sig, 'der')
7549 var s = unpacked.s
7550 var r = unpacked.r
7551 checkValue(s, q)
7552 checkValue(r, q)
7553 var montp = BN.mont(p)
7554 var w = s.invm(q)
7555 var v = g.toRed(montp)
7556 .redPow(new BN(hash).mul(w).mod(q))
7557 .fromRed()
7558 .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed())
7559 .mod(p)
7560 .mod(q)
7561 return v.cmp(r) === 0
7562}
7563
7564function checkValue (b, q) {
7565 if (b.cmpn(0) <= 0) throw new Error('invalid sig')
7566 if (b.cmp(q) >= q) throw new Error('invalid sig')
7567}
7568
7569module.exports = verify
7570
7571}).call(this,require("buffer").Buffer)
7572},{"./curves.json":41,"bn.js":17,"buffer":47,"elliptic":67,"parse-asn1":105}],45:[function(require,module,exports){
7573(function (global){
7574'use strict';
7575
7576var buffer = require('buffer');
7577var Buffer = buffer.Buffer;
7578var SlowBuffer = buffer.SlowBuffer;
7579var MAX_LEN = buffer.kMaxLength || 2147483647;
7580exports.alloc = function alloc(size, fill, encoding) {
7581 if (typeof Buffer.alloc === 'function') {
7582 return Buffer.alloc(size, fill, encoding);
7583 }
7584 if (typeof encoding === 'number') {
7585 throw new TypeError('encoding must not be number');
7586 }
7587 if (typeof size !== 'number') {
7588 throw new TypeError('size must be a number');
7589 }
7590 if (size > MAX_LEN) {
7591 throw new RangeError('size is too large');
7592 }
7593 var enc = encoding;
7594 var _fill = fill;
7595 if (_fill === undefined) {
7596 enc = undefined;
7597 _fill = 0;
7598 }
7599 var buf = new Buffer(size);
7600 if (typeof _fill === 'string') {
7601 var fillBuf = new Buffer(_fill, enc);
7602 var flen = fillBuf.length;
7603 var i = -1;
7604 while (++i < size) {
7605 buf[i] = fillBuf[i % flen];
7606 }
7607 } else {
7608 buf.fill(_fill);
7609 }
7610 return buf;
7611}
7612exports.allocUnsafe = function allocUnsafe(size) {
7613 if (typeof Buffer.allocUnsafe === 'function') {
7614 return Buffer.allocUnsafe(size);
7615 }
7616 if (typeof size !== 'number') {
7617 throw new TypeError('size must be a number');
7618 }
7619 if (size > MAX_LEN) {
7620 throw new RangeError('size is too large');
7621 }
7622 return new Buffer(size);
7623}
7624exports.from = function from(value, encodingOrOffset, length) {
7625 if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {
7626 return Buffer.from(value, encodingOrOffset, length);
7627 }
7628 if (typeof value === 'number') {
7629 throw new TypeError('"value" argument must not be a number');
7630 }
7631 if (typeof value === 'string') {
7632 return new Buffer(value, encodingOrOffset);
7633 }
7634 if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
7635 var offset = encodingOrOffset;
7636 if (arguments.length === 1) {
7637 return new Buffer(value);
7638 }
7639 if (typeof offset === 'undefined') {
7640 offset = 0;
7641 }
7642 var len = length;
7643 if (typeof len === 'undefined') {
7644 len = value.byteLength - offset;
7645 }
7646 if (offset >= value.byteLength) {
7647 throw new RangeError('\'offset\' is out of bounds');
7648 }
7649 if (len > value.byteLength - offset) {
7650 throw new RangeError('\'length\' is out of bounds');
7651 }
7652 return new Buffer(value.slice(offset, offset + len));
7653 }
7654 if (Buffer.isBuffer(value)) {
7655 var out = new Buffer(value.length);
7656 value.copy(out, 0, 0, value.length);
7657 return out;
7658 }
7659 if (value) {
7660 if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) {
7661 return new Buffer(value);
7662 }
7663 if (value.type === 'Buffer' && Array.isArray(value.data)) {
7664 return new Buffer(value.data);
7665 }
7666 }
7667
7668 throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');
7669}
7670exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
7671 if (typeof Buffer.allocUnsafeSlow === 'function') {
7672 return Buffer.allocUnsafeSlow(size);
7673 }
7674 if (typeof size !== 'number') {
7675 throw new TypeError('size must be a number');
7676 }
7677 if (size >= MAX_LEN) {
7678 throw new RangeError('size is too large');
7679 }
7680 return new SlowBuffer(size);
7681}
7682
7683}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
7684},{"buffer":47}],46:[function(require,module,exports){
7685(function (Buffer){
7686module.exports = function xor (a, b) {
7687 var length = Math.min(a.length, b.length)
7688 var buffer = new Buffer(length)
7689
7690 for (var i = 0; i < length; ++i) {
7691 buffer[i] = a[i] ^ b[i]
7692 }
7693
7694 return buffer
7695}
7696
7697}).call(this,require("buffer").Buffer)
7698},{"buffer":47}],47:[function(require,module,exports){
7699/*!
7700 * The buffer module from node.js, for the browser.
7701 *
7702 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
7703 * @license MIT
7704 */
7705/* eslint-disable no-proto */
7706
7707'use strict'
7708
7709var base64 = require('base64-js')
7710var ieee754 = require('ieee754')
7711
7712exports.Buffer = Buffer
7713exports.SlowBuffer = SlowBuffer
7714exports.INSPECT_MAX_BYTES = 50
7715
7716var K_MAX_LENGTH = 0x7fffffff
7717exports.kMaxLength = K_MAX_LENGTH
7718
7719/**
7720 * If `Buffer.TYPED_ARRAY_SUPPORT`:
7721 * === true Use Uint8Array implementation (fastest)
7722 * === false Print warning and recommend using `buffer` v4.x which has an Object
7723 * implementation (most compatible, even IE6)
7724 *
7725 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
7726 * Opera 11.6+, iOS 4.2+.
7727 *
7728 * We report that the browser does not support typed arrays if the are not subclassable
7729 * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
7730 * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
7731 * for __proto__ and has a buggy typed array implementation.
7732 */
7733Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
7734
7735if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
7736 typeof console.error === 'function') {
7737 console.error(
7738 'This browser lacks typed array (Uint8Array) support which is required by ' +
7739 '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
7740 )
7741}
7742
7743function typedArraySupport () {
7744 // Can typed array instances can be augmented?
7745 try {
7746 var arr = new Uint8Array(1)
7747 arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
7748 return arr.foo() === 42
7749 } catch (e) {
7750 return false
7751 }
7752}
7753
7754function createBuffer (length) {
7755 if (length > K_MAX_LENGTH) {
7756 throw new RangeError('Invalid typed array length')
7757 }
7758 // Return an augmented `Uint8Array` instance
7759 var buf = new Uint8Array(length)
7760 buf.__proto__ = Buffer.prototype
7761 return buf
7762}
7763
7764/**
7765 * The Buffer constructor returns instances of `Uint8Array` that have their
7766 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
7767 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
7768 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
7769 * returns a single octet.
7770 *
7771 * The `Uint8Array` prototype remains unmodified.
7772 */
7773
7774function Buffer (arg, encodingOrOffset, length) {
7775 // Common case.
7776 if (typeof arg === 'number') {
7777 if (typeof encodingOrOffset === 'string') {
7778 throw new Error(
7779 'If encoding is specified then the first argument must be a string'
7780 )
7781 }
7782 return allocUnsafe(arg)
7783 }
7784 return from(arg, encodingOrOffset, length)
7785}
7786
7787// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
7788if (typeof Symbol !== 'undefined' && Symbol.species &&
7789 Buffer[Symbol.species] === Buffer) {
7790 Object.defineProperty(Buffer, Symbol.species, {
7791 value: null,
7792 configurable: true,
7793 enumerable: false,
7794 writable: false
7795 })
7796}
7797
7798Buffer.poolSize = 8192 // not used by this implementation
7799
7800function from (value, encodingOrOffset, length) {
7801 if (typeof value === 'number') {
7802 throw new TypeError('"value" argument must not be a number')
7803 }
7804
7805 if (value instanceof ArrayBuffer) {
7806 return fromArrayBuffer(value, encodingOrOffset, length)
7807 }
7808
7809 if (typeof value === 'string') {
7810 return fromString(value, encodingOrOffset)
7811 }
7812
7813 return fromObject(value)
7814}
7815
7816/**
7817 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
7818 * if value is a number.
7819 * Buffer.from(str[, encoding])
7820 * Buffer.from(array)
7821 * Buffer.from(buffer)
7822 * Buffer.from(arrayBuffer[, byteOffset[, length]])
7823 **/
7824Buffer.from = function (value, encodingOrOffset, length) {
7825 return from(value, encodingOrOffset, length)
7826}
7827
7828// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
7829// https://github.com/feross/buffer/pull/148
7830Buffer.prototype.__proto__ = Uint8Array.prototype
7831Buffer.__proto__ = Uint8Array
7832
7833function assertSize (size) {
7834 if (typeof size !== 'number') {
7835 throw new TypeError('"size" argument must be a number')
7836 } else if (size < 0) {
7837 throw new RangeError('"size" argument must not be negative')
7838 }
7839}
7840
7841function alloc (size, fill, encoding) {
7842 assertSize(size)
7843 if (size <= 0) {
7844 return createBuffer(size)
7845 }
7846 if (fill !== undefined) {
7847 // Only pay attention to encoding if it's a string. This
7848 // prevents accidentally sending in a number that would
7849 // be interpretted as a start offset.
7850 return typeof encoding === 'string'
7851 ? createBuffer(size).fill(fill, encoding)
7852 : createBuffer(size).fill(fill)
7853 }
7854 return createBuffer(size)
7855}
7856
7857/**
7858 * Creates a new filled Buffer instance.
7859 * alloc(size[, fill[, encoding]])
7860 **/
7861Buffer.alloc = function (size, fill, encoding) {
7862 return alloc(size, fill, encoding)
7863}
7864
7865function allocUnsafe (size) {
7866 assertSize(size)
7867 return createBuffer(size < 0 ? 0 : checked(size) | 0)
7868}
7869
7870/**
7871 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
7872 * */
7873Buffer.allocUnsafe = function (size) {
7874 return allocUnsafe(size)
7875}
7876/**
7877 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
7878 */
7879Buffer.allocUnsafeSlow = function (size) {
7880 return allocUnsafe(size)
7881}
7882
7883function fromString (string, encoding) {
7884 if (typeof encoding !== 'string' || encoding === '') {
7885 encoding = 'utf8'
7886 }
7887
7888 if (!Buffer.isEncoding(encoding)) {
7889 throw new TypeError('"encoding" must be a valid string encoding')
7890 }
7891
7892 var length = byteLength(string, encoding) | 0
7893 var buf = createBuffer(length)
7894
7895 var actual = buf.write(string, encoding)
7896
7897 if (actual !== length) {
7898 // Writing a hex string, for example, that contains invalid characters will
7899 // cause everything after the first invalid character to be ignored. (e.g.
7900 // 'abxxcd' will be treated as 'ab')
7901 buf = buf.slice(0, actual)
7902 }
7903
7904 return buf
7905}
7906
7907function fromArrayLike (array) {
7908 var length = array.length < 0 ? 0 : checked(array.length) | 0
7909 var buf = createBuffer(length)
7910 for (var i = 0; i < length; i += 1) {
7911 buf[i] = array[i] & 255
7912 }
7913 return buf
7914}
7915
7916function fromArrayBuffer (array, byteOffset, length) {
7917 if (byteOffset < 0 || array.byteLength < byteOffset) {
7918 throw new RangeError('\'offset\' is out of bounds')
7919 }
7920
7921 if (array.byteLength < byteOffset + (length || 0)) {
7922 throw new RangeError('\'length\' is out of bounds')
7923 }
7924
7925 var buf
7926 if (byteOffset === undefined && length === undefined) {
7927 buf = new Uint8Array(array)
7928 } else if (length === undefined) {
7929 buf = new Uint8Array(array, byteOffset)
7930 } else {
7931 buf = new Uint8Array(array, byteOffset, length)
7932 }
7933
7934 // Return an augmented `Uint8Array` instance
7935 buf.__proto__ = Buffer.prototype
7936 return buf
7937}
7938
7939function fromObject (obj) {
7940 if (Buffer.isBuffer(obj)) {
7941 var len = checked(obj.length) | 0
7942 var buf = createBuffer(len)
7943
7944 if (buf.length === 0) {
7945 return buf
7946 }
7947
7948 obj.copy(buf, 0, 0, len)
7949 return buf
7950 }
7951
7952 if (obj) {
7953 if (isArrayBufferView(obj) || 'length' in obj) {
7954 if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
7955 return createBuffer(0)
7956 }
7957 return fromArrayLike(obj)
7958 }
7959
7960 if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
7961 return fromArrayLike(obj.data)
7962 }
7963 }
7964
7965 throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
7966}
7967
7968function checked (length) {
7969 // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
7970 // length is NaN (which is otherwise coerced to zero.)
7971 if (length >= K_MAX_LENGTH) {
7972 throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
7973 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
7974 }
7975 return length | 0
7976}
7977
7978function SlowBuffer (length) {
7979 if (+length != length) { // eslint-disable-line eqeqeq
7980 length = 0
7981 }
7982 return Buffer.alloc(+length)
7983}
7984
7985Buffer.isBuffer = function isBuffer (b) {
7986 return b != null && b._isBuffer === true
7987}
7988
7989Buffer.compare = function compare (a, b) {
7990 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
7991 throw new TypeError('Arguments must be Buffers')
7992 }
7993
7994 if (a === b) return 0
7995
7996 var x = a.length
7997 var y = b.length
7998
7999 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
8000 if (a[i] !== b[i]) {
8001 x = a[i]
8002 y = b[i]
8003 break
8004 }
8005 }
8006
8007 if (x < y) return -1
8008 if (y < x) return 1
8009 return 0
8010}
8011
8012Buffer.isEncoding = function isEncoding (encoding) {
8013 switch (String(encoding).toLowerCase()) {
8014 case 'hex':
8015 case 'utf8':
8016 case 'utf-8':
8017 case 'ascii':
8018 case 'latin1':
8019 case 'binary':
8020 case 'base64':
8021 case 'ucs2':
8022 case 'ucs-2':
8023 case 'utf16le':
8024 case 'utf-16le':
8025 return true
8026 default:
8027 return false
8028 }
8029}
8030
8031Buffer.concat = function concat (list, length) {
8032 if (!Array.isArray(list)) {
8033 throw new TypeError('"list" argument must be an Array of Buffers')
8034 }
8035
8036 if (list.length === 0) {
8037 return Buffer.alloc(0)
8038 }
8039
8040 var i
8041 if (length === undefined) {
8042 length = 0
8043 for (i = 0; i < list.length; ++i) {
8044 length += list[i].length
8045 }
8046 }
8047
8048 var buffer = Buffer.allocUnsafe(length)
8049 var pos = 0
8050 for (i = 0; i < list.length; ++i) {
8051 var buf = list[i]
8052 if (!Buffer.isBuffer(buf)) {
8053 throw new TypeError('"list" argument must be an Array of Buffers')
8054 }
8055 buf.copy(buffer, pos)
8056 pos += buf.length
8057 }
8058 return buffer
8059}
8060
8061function byteLength (string, encoding) {
8062 if (Buffer.isBuffer(string)) {
8063 return string.length
8064 }
8065 if (isArrayBufferView(string) || string instanceof ArrayBuffer) {
8066 return string.byteLength
8067 }
8068 if (typeof string !== 'string') {
8069 string = '' + string
8070 }
8071
8072 var len = string.length
8073 if (len === 0) return 0
8074
8075 // Use a for loop to avoid recursion
8076 var loweredCase = false
8077 for (;;) {
8078 switch (encoding) {
8079 case 'ascii':
8080 case 'latin1':
8081 case 'binary':
8082 return len
8083 case 'utf8':
8084 case 'utf-8':
8085 case undefined:
8086 return utf8ToBytes(string).length
8087 case 'ucs2':
8088 case 'ucs-2':
8089 case 'utf16le':
8090 case 'utf-16le':
8091 return len * 2
8092 case 'hex':
8093 return len >>> 1
8094 case 'base64':
8095 return base64ToBytes(string).length
8096 default:
8097 if (loweredCase) return utf8ToBytes(string).length // assume utf8
8098 encoding = ('' + encoding).toLowerCase()
8099 loweredCase = true
8100 }
8101 }
8102}
8103Buffer.byteLength = byteLength
8104
8105function slowToString (encoding, start, end) {
8106 var loweredCase = false
8107
8108 // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
8109 // property of a typed array.
8110
8111 // This behaves neither like String nor Uint8Array in that we set start/end
8112 // to their upper/lower bounds if the value passed is out of range.
8113 // undefined is handled specially as per ECMA-262 6th Edition,
8114 // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
8115 if (start === undefined || start < 0) {
8116 start = 0
8117 }
8118 // Return early if start > this.length. Done here to prevent potential uint32
8119 // coercion fail below.
8120 if (start > this.length) {
8121 return ''
8122 }
8123
8124 if (end === undefined || end > this.length) {
8125 end = this.length
8126 }
8127
8128 if (end <= 0) {
8129 return ''
8130 }
8131
8132 // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
8133 end >>>= 0
8134 start >>>= 0
8135
8136 if (end <= start) {
8137 return ''
8138 }
8139
8140 if (!encoding) encoding = 'utf8'
8141
8142 while (true) {
8143 switch (encoding) {
8144 case 'hex':
8145 return hexSlice(this, start, end)
8146
8147 case 'utf8':
8148 case 'utf-8':
8149 return utf8Slice(this, start, end)
8150
8151 case 'ascii':
8152 return asciiSlice(this, start, end)
8153
8154 case 'latin1':
8155 case 'binary':
8156 return latin1Slice(this, start, end)
8157
8158 case 'base64':
8159 return base64Slice(this, start, end)
8160
8161 case 'ucs2':
8162 case 'ucs-2':
8163 case 'utf16le':
8164 case 'utf-16le':
8165 return utf16leSlice(this, start, end)
8166
8167 default:
8168 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
8169 encoding = (encoding + '').toLowerCase()
8170 loweredCase = true
8171 }
8172 }
8173}
8174
8175// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
8176// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
8177// reliably in a browserify context because there could be multiple different
8178// copies of the 'buffer' package in use. This method works even for Buffer
8179// instances that were created from another copy of the `buffer` package.
8180// See: https://github.com/feross/buffer/issues/154
8181Buffer.prototype._isBuffer = true
8182
8183function swap (b, n, m) {
8184 var i = b[n]
8185 b[n] = b[m]
8186 b[m] = i
8187}
8188
8189Buffer.prototype.swap16 = function swap16 () {
8190 var len = this.length
8191 if (len % 2 !== 0) {
8192 throw new RangeError('Buffer size must be a multiple of 16-bits')
8193 }
8194 for (var i = 0; i < len; i += 2) {
8195 swap(this, i, i + 1)
8196 }
8197 return this
8198}
8199
8200Buffer.prototype.swap32 = function swap32 () {
8201 var len = this.length
8202 if (len % 4 !== 0) {
8203 throw new RangeError('Buffer size must be a multiple of 32-bits')
8204 }
8205 for (var i = 0; i < len; i += 4) {
8206 swap(this, i, i + 3)
8207 swap(this, i + 1, i + 2)
8208 }
8209 return this
8210}
8211
8212Buffer.prototype.swap64 = function swap64 () {
8213 var len = this.length
8214 if (len % 8 !== 0) {
8215 throw new RangeError('Buffer size must be a multiple of 64-bits')
8216 }
8217 for (var i = 0; i < len; i += 8) {
8218 swap(this, i, i + 7)
8219 swap(this, i + 1, i + 6)
8220 swap(this, i + 2, i + 5)
8221 swap(this, i + 3, i + 4)
8222 }
8223 return this
8224}
8225
8226Buffer.prototype.toString = function toString () {
8227 var length = this.length
8228 if (length === 0) return ''
8229 if (arguments.length === 0) return utf8Slice(this, 0, length)
8230 return slowToString.apply(this, arguments)
8231}
8232
8233Buffer.prototype.equals = function equals (b) {
8234 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
8235 if (this === b) return true
8236 return Buffer.compare(this, b) === 0
8237}
8238
8239Buffer.prototype.inspect = function inspect () {
8240 var str = ''
8241 var max = exports.INSPECT_MAX_BYTES
8242 if (this.length > 0) {
8243 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
8244 if (this.length > max) str += ' ... '
8245 }
8246 return '<Buffer ' + str + '>'
8247}
8248
8249Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
8250 if (!Buffer.isBuffer(target)) {
8251 throw new TypeError('Argument must be a Buffer')
8252 }
8253
8254 if (start === undefined) {
8255 start = 0
8256 }
8257 if (end === undefined) {
8258 end = target ? target.length : 0
8259 }
8260 if (thisStart === undefined) {
8261 thisStart = 0
8262 }
8263 if (thisEnd === undefined) {
8264 thisEnd = this.length
8265 }
8266
8267 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
8268 throw new RangeError('out of range index')
8269 }
8270
8271 if (thisStart >= thisEnd && start >= end) {
8272 return 0
8273 }
8274 if (thisStart >= thisEnd) {
8275 return -1
8276 }
8277 if (start >= end) {
8278 return 1
8279 }
8280
8281 start >>>= 0
8282 end >>>= 0
8283 thisStart >>>= 0
8284 thisEnd >>>= 0
8285
8286 if (this === target) return 0
8287
8288 var x = thisEnd - thisStart
8289 var y = end - start
8290 var len = Math.min(x, y)
8291
8292 var thisCopy = this.slice(thisStart, thisEnd)
8293 var targetCopy = target.slice(start, end)
8294
8295 for (var i = 0; i < len; ++i) {
8296 if (thisCopy[i] !== targetCopy[i]) {
8297 x = thisCopy[i]
8298 y = targetCopy[i]
8299 break
8300 }
8301 }
8302
8303 if (x < y) return -1
8304 if (y < x) return 1
8305 return 0
8306}
8307
8308// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
8309// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
8310//
8311// Arguments:
8312// - buffer - a Buffer to search
8313// - val - a string, Buffer, or number
8314// - byteOffset - an index into `buffer`; will be clamped to an int32
8315// - encoding - an optional encoding, relevant is val is a string
8316// - dir - true for indexOf, false for lastIndexOf
8317function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
8318 // Empty buffer means no match
8319 if (buffer.length === 0) return -1
8320
8321 // Normalize byteOffset
8322 if (typeof byteOffset === 'string') {
8323 encoding = byteOffset
8324 byteOffset = 0
8325 } else if (byteOffset > 0x7fffffff) {
8326 byteOffset = 0x7fffffff
8327 } else if (byteOffset < -0x80000000) {
8328 byteOffset = -0x80000000
8329 }
8330 byteOffset = +byteOffset // Coerce to Number.
8331 if (numberIsNaN(byteOffset)) {
8332 // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
8333 byteOffset = dir ? 0 : (buffer.length - 1)
8334 }
8335
8336 // Normalize byteOffset: negative offsets start from the end of the buffer
8337 if (byteOffset < 0) byteOffset = buffer.length + byteOffset
8338 if (byteOffset >= buffer.length) {
8339 if (dir) return -1
8340 else byteOffset = buffer.length - 1
8341 } else if (byteOffset < 0) {
8342 if (dir) byteOffset = 0
8343 else return -1
8344 }
8345
8346 // Normalize val
8347 if (typeof val === 'string') {
8348 val = Buffer.from(val, encoding)
8349 }
8350
8351 // Finally, search either indexOf (if dir is true) or lastIndexOf
8352 if (Buffer.isBuffer(val)) {
8353 // Special case: looking for empty string/buffer always fails
8354 if (val.length === 0) {
8355 return -1
8356 }
8357 return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
8358 } else if (typeof val === 'number') {
8359 val = val & 0xFF // Search for a byte value [0-255]
8360 if (typeof Uint8Array.prototype.indexOf === 'function') {
8361 if (dir) {
8362 return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
8363 } else {
8364 return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
8365 }
8366 }
8367 return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
8368 }
8369
8370 throw new TypeError('val must be string, number or Buffer')
8371}
8372
8373function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
8374 var indexSize = 1
8375 var arrLength = arr.length
8376 var valLength = val.length
8377
8378 if (encoding !== undefined) {
8379 encoding = String(encoding).toLowerCase()
8380 if (encoding === 'ucs2' || encoding === 'ucs-2' ||
8381 encoding === 'utf16le' || encoding === 'utf-16le') {
8382 if (arr.length < 2 || val.length < 2) {
8383 return -1
8384 }
8385 indexSize = 2
8386 arrLength /= 2
8387 valLength /= 2
8388 byteOffset /= 2
8389 }
8390 }
8391
8392 function read (buf, i) {
8393 if (indexSize === 1) {
8394 return buf[i]
8395 } else {
8396 return buf.readUInt16BE(i * indexSize)
8397 }
8398 }
8399
8400 var i
8401 if (dir) {
8402 var foundIndex = -1
8403 for (i = byteOffset; i < arrLength; i++) {
8404 if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
8405 if (foundIndex === -1) foundIndex = i
8406 if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
8407 } else {
8408 if (foundIndex !== -1) i -= i - foundIndex
8409 foundIndex = -1
8410 }
8411 }
8412 } else {
8413 if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
8414 for (i = byteOffset; i >= 0; i--) {
8415 var found = true
8416 for (var j = 0; j < valLength; j++) {
8417 if (read(arr, i + j) !== read(val, j)) {
8418 found = false
8419 break
8420 }
8421 }
8422 if (found) return i
8423 }
8424 }
8425
8426 return -1
8427}
8428
8429Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
8430 return this.indexOf(val, byteOffset, encoding) !== -1
8431}
8432
8433Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
8434 return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
8435}
8436
8437Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
8438 return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
8439}
8440
8441function hexWrite (buf, string, offset, length) {
8442 offset = Number(offset) || 0
8443 var remaining = buf.length - offset
8444 if (!length) {
8445 length = remaining
8446 } else {
8447 length = Number(length)
8448 if (length > remaining) {
8449 length = remaining
8450 }
8451 }
8452
8453 // must be an even number of digits
8454 var strLen = string.length
8455 if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
8456
8457 if (length > strLen / 2) {
8458 length = strLen / 2
8459 }
8460 for (var i = 0; i < length; ++i) {
8461 var parsed = parseInt(string.substr(i * 2, 2), 16)
8462 if (numberIsNaN(parsed)) return i
8463 buf[offset + i] = parsed
8464 }
8465 return i
8466}
8467
8468function utf8Write (buf, string, offset, length) {
8469 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
8470}
8471
8472function asciiWrite (buf, string, offset, length) {
8473 return blitBuffer(asciiToBytes(string), buf, offset, length)
8474}
8475
8476function latin1Write (buf, string, offset, length) {
8477 return asciiWrite(buf, string, offset, length)
8478}
8479
8480function base64Write (buf, string, offset, length) {
8481 return blitBuffer(base64ToBytes(string), buf, offset, length)
8482}
8483
8484function ucs2Write (buf, string, offset, length) {
8485 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
8486}
8487
8488Buffer.prototype.write = function write (string, offset, length, encoding) {
8489 // Buffer#write(string)
8490 if (offset === undefined) {
8491 encoding = 'utf8'
8492 length = this.length
8493 offset = 0
8494 // Buffer#write(string, encoding)
8495 } else if (length === undefined && typeof offset === 'string') {
8496 encoding = offset
8497 length = this.length
8498 offset = 0
8499 // Buffer#write(string, offset[, length][, encoding])
8500 } else if (isFinite(offset)) {
8501 offset = offset >>> 0
8502 if (isFinite(length)) {
8503 length = length >>> 0
8504 if (encoding === undefined) encoding = 'utf8'
8505 } else {
8506 encoding = length
8507 length = undefined
8508 }
8509 } else {
8510 throw new Error(
8511 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
8512 )
8513 }
8514
8515 var remaining = this.length - offset
8516 if (length === undefined || length > remaining) length = remaining
8517
8518 if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
8519 throw new RangeError('Attempt to write outside buffer bounds')
8520 }
8521
8522 if (!encoding) encoding = 'utf8'
8523
8524 var loweredCase = false
8525 for (;;) {
8526 switch (encoding) {
8527 case 'hex':
8528 return hexWrite(this, string, offset, length)
8529
8530 case 'utf8':
8531 case 'utf-8':
8532 return utf8Write(this, string, offset, length)
8533
8534 case 'ascii':
8535 return asciiWrite(this, string, offset, length)
8536
8537 case 'latin1':
8538 case 'binary':
8539 return latin1Write(this, string, offset, length)
8540
8541 case 'base64':
8542 // Warning: maxLength not taken into account in base64Write
8543 return base64Write(this, string, offset, length)
8544
8545 case 'ucs2':
8546 case 'ucs-2':
8547 case 'utf16le':
8548 case 'utf-16le':
8549 return ucs2Write(this, string, offset, length)
8550
8551 default:
8552 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
8553 encoding = ('' + encoding).toLowerCase()
8554 loweredCase = true
8555 }
8556 }
8557}
8558
8559Buffer.prototype.toJSON = function toJSON () {
8560 return {
8561 type: 'Buffer',
8562 data: Array.prototype.slice.call(this._arr || this, 0)
8563 }
8564}
8565
8566function base64Slice (buf, start, end) {
8567 if (start === 0 && end === buf.length) {
8568 return base64.fromByteArray(buf)
8569 } else {
8570 return base64.fromByteArray(buf.slice(start, end))
8571 }
8572}
8573
8574function utf8Slice (buf, start, end) {
8575 end = Math.min(buf.length, end)
8576 var res = []
8577
8578 var i = start
8579 while (i < end) {
8580 var firstByte = buf[i]
8581 var codePoint = null
8582 var bytesPerSequence = (firstByte > 0xEF) ? 4
8583 : (firstByte > 0xDF) ? 3
8584 : (firstByte > 0xBF) ? 2
8585 : 1
8586
8587 if (i + bytesPerSequence <= end) {
8588 var secondByte, thirdByte, fourthByte, tempCodePoint
8589
8590 switch (bytesPerSequence) {
8591 case 1:
8592 if (firstByte < 0x80) {
8593 codePoint = firstByte
8594 }
8595 break
8596 case 2:
8597 secondByte = buf[i + 1]
8598 if ((secondByte & 0xC0) === 0x80) {
8599 tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
8600 if (tempCodePoint > 0x7F) {
8601 codePoint = tempCodePoint
8602 }
8603 }
8604 break
8605 case 3:
8606 secondByte = buf[i + 1]
8607 thirdByte = buf[i + 2]
8608 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
8609 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
8610 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
8611 codePoint = tempCodePoint
8612 }
8613 }
8614 break
8615 case 4:
8616 secondByte = buf[i + 1]
8617 thirdByte = buf[i + 2]
8618 fourthByte = buf[i + 3]
8619 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
8620 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
8621 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
8622 codePoint = tempCodePoint
8623 }
8624 }
8625 }
8626 }
8627
8628 if (codePoint === null) {
8629 // we did not generate a valid codePoint so insert a
8630 // replacement char (U+FFFD) and advance only 1 byte
8631 codePoint = 0xFFFD
8632 bytesPerSequence = 1
8633 } else if (codePoint > 0xFFFF) {
8634 // encode to utf16 (surrogate pair dance)
8635 codePoint -= 0x10000
8636 res.push(codePoint >>> 10 & 0x3FF | 0xD800)
8637 codePoint = 0xDC00 | codePoint & 0x3FF
8638 }
8639
8640 res.push(codePoint)
8641 i += bytesPerSequence
8642 }
8643
8644 return decodeCodePointsArray(res)
8645}
8646
8647// Based on http://stackoverflow.com/a/22747272/680742, the browser with
8648// the lowest limit is Chrome, with 0x10000 args.
8649// We go 1 magnitude less, for safety
8650var MAX_ARGUMENTS_LENGTH = 0x1000
8651
8652function decodeCodePointsArray (codePoints) {
8653 var len = codePoints.length
8654 if (len <= MAX_ARGUMENTS_LENGTH) {
8655 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
8656 }
8657
8658 // Decode in chunks to avoid "call stack size exceeded".
8659 var res = ''
8660 var i = 0
8661 while (i < len) {
8662 res += String.fromCharCode.apply(
8663 String,
8664 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
8665 )
8666 }
8667 return res
8668}
8669
8670function asciiSlice (buf, start, end) {
8671 var ret = ''
8672 end = Math.min(buf.length, end)
8673
8674 for (var i = start; i < end; ++i) {
8675 ret += String.fromCharCode(buf[i] & 0x7F)
8676 }
8677 return ret
8678}
8679
8680function latin1Slice (buf, start, end) {
8681 var ret = ''
8682 end = Math.min(buf.length, end)
8683
8684 for (var i = start; i < end; ++i) {
8685 ret += String.fromCharCode(buf[i])
8686 }
8687 return ret
8688}
8689
8690function hexSlice (buf, start, end) {
8691 var len = buf.length
8692
8693 if (!start || start < 0) start = 0
8694 if (!end || end < 0 || end > len) end = len
8695
8696 var out = ''
8697 for (var i = start; i < end; ++i) {
8698 out += toHex(buf[i])
8699 }
8700 return out
8701}
8702
8703function utf16leSlice (buf, start, end) {
8704 var bytes = buf.slice(start, end)
8705 var res = ''
8706 for (var i = 0; i < bytes.length; i += 2) {
8707 res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
8708 }
8709 return res
8710}
8711
8712Buffer.prototype.slice = function slice (start, end) {
8713 var len = this.length
8714 start = ~~start
8715 end = end === undefined ? len : ~~end
8716
8717 if (start < 0) {
8718 start += len
8719 if (start < 0) start = 0
8720 } else if (start > len) {
8721 start = len
8722 }
8723
8724 if (end < 0) {
8725 end += len
8726 if (end < 0) end = 0
8727 } else if (end > len) {
8728 end = len
8729 }
8730
8731 if (end < start) end = start
8732
8733 var newBuf = this.subarray(start, end)
8734 // Return an augmented `Uint8Array` instance
8735 newBuf.__proto__ = Buffer.prototype
8736 return newBuf
8737}
8738
8739/*
8740 * Need to make sure that buffer isn't trying to write out of bounds.
8741 */
8742function checkOffset (offset, ext, length) {
8743 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
8744 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
8745}
8746
8747Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
8748 offset = offset >>> 0
8749 byteLength = byteLength >>> 0
8750 if (!noAssert) checkOffset(offset, byteLength, this.length)
8751
8752 var val = this[offset]
8753 var mul = 1
8754 var i = 0
8755 while (++i < byteLength && (mul *= 0x100)) {
8756 val += this[offset + i] * mul
8757 }
8758
8759 return val
8760}
8761
8762Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
8763 offset = offset >>> 0
8764 byteLength = byteLength >>> 0
8765 if (!noAssert) {
8766 checkOffset(offset, byteLength, this.length)
8767 }
8768
8769 var val = this[offset + --byteLength]
8770 var mul = 1
8771 while (byteLength > 0 && (mul *= 0x100)) {
8772 val += this[offset + --byteLength] * mul
8773 }
8774
8775 return val
8776}
8777
8778Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
8779 offset = offset >>> 0
8780 if (!noAssert) checkOffset(offset, 1, this.length)
8781 return this[offset]
8782}
8783
8784Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
8785 offset = offset >>> 0
8786 if (!noAssert) checkOffset(offset, 2, this.length)
8787 return this[offset] | (this[offset + 1] << 8)
8788}
8789
8790Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
8791 offset = offset >>> 0
8792 if (!noAssert) checkOffset(offset, 2, this.length)
8793 return (this[offset] << 8) | this[offset + 1]
8794}
8795
8796Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
8797 offset = offset >>> 0
8798 if (!noAssert) checkOffset(offset, 4, this.length)
8799
8800 return ((this[offset]) |
8801 (this[offset + 1] << 8) |
8802 (this[offset + 2] << 16)) +
8803 (this[offset + 3] * 0x1000000)
8804}
8805
8806Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
8807 offset = offset >>> 0
8808 if (!noAssert) checkOffset(offset, 4, this.length)
8809
8810 return (this[offset] * 0x1000000) +
8811 ((this[offset + 1] << 16) |
8812 (this[offset + 2] << 8) |
8813 this[offset + 3])
8814}
8815
8816Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
8817 offset = offset >>> 0
8818 byteLength = byteLength >>> 0
8819 if (!noAssert) checkOffset(offset, byteLength, this.length)
8820
8821 var val = this[offset]
8822 var mul = 1
8823 var i = 0
8824 while (++i < byteLength && (mul *= 0x100)) {
8825 val += this[offset + i] * mul
8826 }
8827 mul *= 0x80
8828
8829 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
8830
8831 return val
8832}
8833
8834Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
8835 offset = offset >>> 0
8836 byteLength = byteLength >>> 0
8837 if (!noAssert) checkOffset(offset, byteLength, this.length)
8838
8839 var i = byteLength
8840 var mul = 1
8841 var val = this[offset + --i]
8842 while (i > 0 && (mul *= 0x100)) {
8843 val += this[offset + --i] * mul
8844 }
8845 mul *= 0x80
8846
8847 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
8848
8849 return val
8850}
8851
8852Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
8853 offset = offset >>> 0
8854 if (!noAssert) checkOffset(offset, 1, this.length)
8855 if (!(this[offset] & 0x80)) return (this[offset])
8856 return ((0xff - this[offset] + 1) * -1)
8857}
8858
8859Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
8860 offset = offset >>> 0
8861 if (!noAssert) checkOffset(offset, 2, this.length)
8862 var val = this[offset] | (this[offset + 1] << 8)
8863 return (val & 0x8000) ? val | 0xFFFF0000 : val
8864}
8865
8866Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
8867 offset = offset >>> 0
8868 if (!noAssert) checkOffset(offset, 2, this.length)
8869 var val = this[offset + 1] | (this[offset] << 8)
8870 return (val & 0x8000) ? val | 0xFFFF0000 : val
8871}
8872
8873Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
8874 offset = offset >>> 0
8875 if (!noAssert) checkOffset(offset, 4, this.length)
8876
8877 return (this[offset]) |
8878 (this[offset + 1] << 8) |
8879 (this[offset + 2] << 16) |
8880 (this[offset + 3] << 24)
8881}
8882
8883Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
8884 offset = offset >>> 0
8885 if (!noAssert) checkOffset(offset, 4, this.length)
8886
8887 return (this[offset] << 24) |
8888 (this[offset + 1] << 16) |
8889 (this[offset + 2] << 8) |
8890 (this[offset + 3])
8891}
8892
8893Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
8894 offset = offset >>> 0
8895 if (!noAssert) checkOffset(offset, 4, this.length)
8896 return ieee754.read(this, offset, true, 23, 4)
8897}
8898
8899Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
8900 offset = offset >>> 0
8901 if (!noAssert) checkOffset(offset, 4, this.length)
8902 return ieee754.read(this, offset, false, 23, 4)
8903}
8904
8905Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
8906 offset = offset >>> 0
8907 if (!noAssert) checkOffset(offset, 8, this.length)
8908 return ieee754.read(this, offset, true, 52, 8)
8909}
8910
8911Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
8912 offset = offset >>> 0
8913 if (!noAssert) checkOffset(offset, 8, this.length)
8914 return ieee754.read(this, offset, false, 52, 8)
8915}
8916
8917function checkInt (buf, value, offset, ext, max, min) {
8918 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
8919 if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
8920 if (offset + ext > buf.length) throw new RangeError('Index out of range')
8921}
8922
8923Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
8924 value = +value
8925 offset = offset >>> 0
8926 byteLength = byteLength >>> 0
8927 if (!noAssert) {
8928 var maxBytes = Math.pow(2, 8 * byteLength) - 1
8929 checkInt(this, value, offset, byteLength, maxBytes, 0)
8930 }
8931
8932 var mul = 1
8933 var i = 0
8934 this[offset] = value & 0xFF
8935 while (++i < byteLength && (mul *= 0x100)) {
8936 this[offset + i] = (value / mul) & 0xFF
8937 }
8938
8939 return offset + byteLength
8940}
8941
8942Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
8943 value = +value
8944 offset = offset >>> 0
8945 byteLength = byteLength >>> 0
8946 if (!noAssert) {
8947 var maxBytes = Math.pow(2, 8 * byteLength) - 1
8948 checkInt(this, value, offset, byteLength, maxBytes, 0)
8949 }
8950
8951 var i = byteLength - 1
8952 var mul = 1
8953 this[offset + i] = value & 0xFF
8954 while (--i >= 0 && (mul *= 0x100)) {
8955 this[offset + i] = (value / mul) & 0xFF
8956 }
8957
8958 return offset + byteLength
8959}
8960
8961Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
8962 value = +value
8963 offset = offset >>> 0
8964 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
8965 this[offset] = (value & 0xff)
8966 return offset + 1
8967}
8968
8969Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
8970 value = +value
8971 offset = offset >>> 0
8972 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
8973 this[offset] = (value & 0xff)
8974 this[offset + 1] = (value >>> 8)
8975 return offset + 2
8976}
8977
8978Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
8979 value = +value
8980 offset = offset >>> 0
8981 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
8982 this[offset] = (value >>> 8)
8983 this[offset + 1] = (value & 0xff)
8984 return offset + 2
8985}
8986
8987Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
8988 value = +value
8989 offset = offset >>> 0
8990 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
8991 this[offset + 3] = (value >>> 24)
8992 this[offset + 2] = (value >>> 16)
8993 this[offset + 1] = (value >>> 8)
8994 this[offset] = (value & 0xff)
8995 return offset + 4
8996}
8997
8998Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
8999 value = +value
9000 offset = offset >>> 0
9001 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
9002 this[offset] = (value >>> 24)
9003 this[offset + 1] = (value >>> 16)
9004 this[offset + 2] = (value >>> 8)
9005 this[offset + 3] = (value & 0xff)
9006 return offset + 4
9007}
9008
9009Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
9010 value = +value
9011 offset = offset >>> 0
9012 if (!noAssert) {
9013 var limit = Math.pow(2, (8 * byteLength) - 1)
9014
9015 checkInt(this, value, offset, byteLength, limit - 1, -limit)
9016 }
9017
9018 var i = 0
9019 var mul = 1
9020 var sub = 0
9021 this[offset] = value & 0xFF
9022 while (++i < byteLength && (mul *= 0x100)) {
9023 if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
9024 sub = 1
9025 }
9026 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
9027 }
9028
9029 return offset + byteLength
9030}
9031
9032Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
9033 value = +value
9034 offset = offset >>> 0
9035 if (!noAssert) {
9036 var limit = Math.pow(2, (8 * byteLength) - 1)
9037
9038 checkInt(this, value, offset, byteLength, limit - 1, -limit)
9039 }
9040
9041 var i = byteLength - 1
9042 var mul = 1
9043 var sub = 0
9044 this[offset + i] = value & 0xFF
9045 while (--i >= 0 && (mul *= 0x100)) {
9046 if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
9047 sub = 1
9048 }
9049 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
9050 }
9051
9052 return offset + byteLength
9053}
9054
9055Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
9056 value = +value
9057 offset = offset >>> 0
9058 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
9059 if (value < 0) value = 0xff + value + 1
9060 this[offset] = (value & 0xff)
9061 return offset + 1
9062}
9063
9064Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
9065 value = +value
9066 offset = offset >>> 0
9067 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
9068 this[offset] = (value & 0xff)
9069 this[offset + 1] = (value >>> 8)
9070 return offset + 2
9071}
9072
9073Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
9074 value = +value
9075 offset = offset >>> 0
9076 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
9077 this[offset] = (value >>> 8)
9078 this[offset + 1] = (value & 0xff)
9079 return offset + 2
9080}
9081
9082Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
9083 value = +value
9084 offset = offset >>> 0
9085 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
9086 this[offset] = (value & 0xff)
9087 this[offset + 1] = (value >>> 8)
9088 this[offset + 2] = (value >>> 16)
9089 this[offset + 3] = (value >>> 24)
9090 return offset + 4
9091}
9092
9093Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
9094 value = +value
9095 offset = offset >>> 0
9096 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
9097 if (value < 0) value = 0xffffffff + value + 1
9098 this[offset] = (value >>> 24)
9099 this[offset + 1] = (value >>> 16)
9100 this[offset + 2] = (value >>> 8)
9101 this[offset + 3] = (value & 0xff)
9102 return offset + 4
9103}
9104
9105function checkIEEE754 (buf, value, offset, ext, max, min) {
9106 if (offset + ext > buf.length) throw new RangeError('Index out of range')
9107 if (offset < 0) throw new RangeError('Index out of range')
9108}
9109
9110function writeFloat (buf, value, offset, littleEndian, noAssert) {
9111 value = +value
9112 offset = offset >>> 0
9113 if (!noAssert) {
9114 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
9115 }
9116 ieee754.write(buf, value, offset, littleEndian, 23, 4)
9117 return offset + 4
9118}
9119
9120Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
9121 return writeFloat(this, value, offset, true, noAssert)
9122}
9123
9124Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
9125 return writeFloat(this, value, offset, false, noAssert)
9126}
9127
9128function writeDouble (buf, value, offset, littleEndian, noAssert) {
9129 value = +value
9130 offset = offset >>> 0
9131 if (!noAssert) {
9132 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
9133 }
9134 ieee754.write(buf, value, offset, littleEndian, 52, 8)
9135 return offset + 8
9136}
9137
9138Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
9139 return writeDouble(this, value, offset, true, noAssert)
9140}
9141
9142Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
9143 return writeDouble(this, value, offset, false, noAssert)
9144}
9145
9146// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
9147Buffer.prototype.copy = function copy (target, targetStart, start, end) {
9148 if (!start) start = 0
9149 if (!end && end !== 0) end = this.length
9150 if (targetStart >= target.length) targetStart = target.length
9151 if (!targetStart) targetStart = 0
9152 if (end > 0 && end < start) end = start
9153
9154 // Copy 0 bytes; we're done
9155 if (end === start) return 0
9156 if (target.length === 0 || this.length === 0) return 0
9157
9158 // Fatal error conditions
9159 if (targetStart < 0) {
9160 throw new RangeError('targetStart out of bounds')
9161 }
9162 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
9163 if (end < 0) throw new RangeError('sourceEnd out of bounds')
9164
9165 // Are we oob?
9166 if (end > this.length) end = this.length
9167 if (target.length - targetStart < end - start) {
9168 end = target.length - targetStart + start
9169 }
9170
9171 var len = end - start
9172 var i
9173
9174 if (this === target && start < targetStart && targetStart < end) {
9175 // descending copy from end
9176 for (i = len - 1; i >= 0; --i) {
9177 target[i + targetStart] = this[i + start]
9178 }
9179 } else if (len < 1000) {
9180 // ascending copy from start
9181 for (i = 0; i < len; ++i) {
9182 target[i + targetStart] = this[i + start]
9183 }
9184 } else {
9185 Uint8Array.prototype.set.call(
9186 target,
9187 this.subarray(start, start + len),
9188 targetStart
9189 )
9190 }
9191
9192 return len
9193}
9194
9195// Usage:
9196// buffer.fill(number[, offset[, end]])
9197// buffer.fill(buffer[, offset[, end]])
9198// buffer.fill(string[, offset[, end]][, encoding])
9199Buffer.prototype.fill = function fill (val, start, end, encoding) {
9200 // Handle string cases:
9201 if (typeof val === 'string') {
9202 if (typeof start === 'string') {
9203 encoding = start
9204 start = 0
9205 end = this.length
9206 } else if (typeof end === 'string') {
9207 encoding = end
9208 end = this.length
9209 }
9210 if (val.length === 1) {
9211 var code = val.charCodeAt(0)
9212 if (code < 256) {
9213 val = code
9214 }
9215 }
9216 if (encoding !== undefined && typeof encoding !== 'string') {
9217 throw new TypeError('encoding must be a string')
9218 }
9219 if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
9220 throw new TypeError('Unknown encoding: ' + encoding)
9221 }
9222 } else if (typeof val === 'number') {
9223 val = val & 255
9224 }
9225
9226 // Invalid ranges are not set to a default, so can range check early.
9227 if (start < 0 || this.length < start || this.length < end) {
9228 throw new RangeError('Out of range index')
9229 }
9230
9231 if (end <= start) {
9232 return this
9233 }
9234
9235 start = start >>> 0
9236 end = end === undefined ? this.length : end >>> 0
9237
9238 if (!val) val = 0
9239
9240 var i
9241 if (typeof val === 'number') {
9242 for (i = start; i < end; ++i) {
9243 this[i] = val
9244 }
9245 } else {
9246 var bytes = Buffer.isBuffer(val)
9247 ? val
9248 : new Buffer(val, encoding)
9249 var len = bytes.length
9250 for (i = 0; i < end - start; ++i) {
9251 this[i + start] = bytes[i % len]
9252 }
9253 }
9254
9255 return this
9256}
9257
9258// HELPER FUNCTIONS
9259// ================
9260
9261var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
9262
9263function base64clean (str) {
9264 // Node strips out invalid characters like \n and \t from the string, base64-js does not
9265 str = str.trim().replace(INVALID_BASE64_RE, '')
9266 // Node converts strings with length < 2 to ''
9267 if (str.length < 2) return ''
9268 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
9269 while (str.length % 4 !== 0) {
9270 str = str + '='
9271 }
9272 return str
9273}
9274
9275function toHex (n) {
9276 if (n < 16) return '0' + n.toString(16)
9277 return n.toString(16)
9278}
9279
9280function utf8ToBytes (string, units) {
9281 units = units || Infinity
9282 var codePoint
9283 var length = string.length
9284 var leadSurrogate = null
9285 var bytes = []
9286
9287 for (var i = 0; i < length; ++i) {
9288 codePoint = string.charCodeAt(i)
9289
9290 // is surrogate component
9291 if (codePoint > 0xD7FF && codePoint < 0xE000) {
9292 // last char was a lead
9293 if (!leadSurrogate) {
9294 // no lead yet
9295 if (codePoint > 0xDBFF) {
9296 // unexpected trail
9297 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
9298 continue
9299 } else if (i + 1 === length) {
9300 // unpaired lead
9301 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
9302 continue
9303 }
9304
9305 // valid lead
9306 leadSurrogate = codePoint
9307
9308 continue
9309 }
9310
9311 // 2 leads in a row
9312 if (codePoint < 0xDC00) {
9313 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
9314 leadSurrogate = codePoint
9315 continue
9316 }
9317
9318 // valid surrogate pair
9319 codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
9320 } else if (leadSurrogate) {
9321 // valid bmp char, but last char was a lead
9322 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
9323 }
9324
9325 leadSurrogate = null
9326
9327 // encode utf8
9328 if (codePoint < 0x80) {
9329 if ((units -= 1) < 0) break
9330 bytes.push(codePoint)
9331 } else if (codePoint < 0x800) {
9332 if ((units -= 2) < 0) break
9333 bytes.push(
9334 codePoint >> 0x6 | 0xC0,
9335 codePoint & 0x3F | 0x80
9336 )
9337 } else if (codePoint < 0x10000) {
9338 if ((units -= 3) < 0) break
9339 bytes.push(
9340 codePoint >> 0xC | 0xE0,
9341 codePoint >> 0x6 & 0x3F | 0x80,
9342 codePoint & 0x3F | 0x80
9343 )
9344 } else if (codePoint < 0x110000) {
9345 if ((units -= 4) < 0) break
9346 bytes.push(
9347 codePoint >> 0x12 | 0xF0,
9348 codePoint >> 0xC & 0x3F | 0x80,
9349 codePoint >> 0x6 & 0x3F | 0x80,
9350 codePoint & 0x3F | 0x80
9351 )
9352 } else {
9353 throw new Error('Invalid code point')
9354 }
9355 }
9356
9357 return bytes
9358}
9359
9360function asciiToBytes (str) {
9361 var byteArray = []
9362 for (var i = 0; i < str.length; ++i) {
9363 // Node's code seems to be doing this and not & 0x7F..
9364 byteArray.push(str.charCodeAt(i) & 0xFF)
9365 }
9366 return byteArray
9367}
9368
9369function utf16leToBytes (str, units) {
9370 var c, hi, lo
9371 var byteArray = []
9372 for (var i = 0; i < str.length; ++i) {
9373 if ((units -= 2) < 0) break
9374
9375 c = str.charCodeAt(i)
9376 hi = c >> 8
9377 lo = c % 256
9378 byteArray.push(lo)
9379 byteArray.push(hi)
9380 }
9381
9382 return byteArray
9383}
9384
9385function base64ToBytes (str) {
9386 return base64.toByteArray(base64clean(str))
9387}
9388
9389function blitBuffer (src, dst, offset, length) {
9390 for (var i = 0; i < length; ++i) {
9391 if ((i + offset >= dst.length) || (i >= src.length)) break
9392 dst[i + offset] = src[i]
9393 }
9394 return i
9395}
9396
9397// Node 0.10 supports `ArrayBuffer` but lacks `ArrayBuffer.isView`
9398function isArrayBufferView (obj) {
9399 return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)
9400}
9401
9402function numberIsNaN (obj) {
9403 return obj !== obj // eslint-disable-line no-self-compare
9404}
9405
9406},{"base64-js":16,"ieee754":93}],48:[function(require,module,exports){
9407(function (Buffer){
15750var Transform = require('stream').Transform 9408var Transform = require('stream').Transform
15751var StringDecoder = require('string_decoder').StringDecoder
15752var inherits = require('inherits') 9409var inherits = require('inherits')
15753 9410var StringDecoder = require('string_decoder').StringDecoder
9411module.exports = CipherBase
9412inherits(CipherBase, Transform)
15754function CipherBase (hashMode) { 9413function CipherBase (hashMode) {
15755 Transform.call(this) 9414 Transform.call(this)
15756 this.hashMode = typeof hashMode === 'string' 9415 this.hashMode = typeof hashMode === 'string'
@@ -15759,31 +9418,25 @@ function CipherBase (hashMode) {
15759 } else { 9418 } else {
15760 this.final = this._finalOrDigest 9419 this.final = this._finalOrDigest
15761 } 9420 }
15762 if (this._final) {
15763 this.__final = this._final
15764 this._final = null
15765 }
15766 this._decoder = null 9421 this._decoder = null
15767 this._encoding = null 9422 this._encoding = null
15768} 9423}
15769inherits(CipherBase, Transform)
15770
15771CipherBase.prototype.update = function (data, inputEnc, outputEnc) { 9424CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
15772 if (typeof data === 'string') { 9425 if (typeof data === 'string') {
15773 data = Buffer.from(data, inputEnc) 9426 data = new Buffer(data, inputEnc)
15774 } 9427 }
15775
15776 var outData = this._update(data) 9428 var outData = this._update(data)
15777 if (this.hashMode) return this 9429 if (this.hashMode) {
15778 9430 return this
9431 }
15779 if (outputEnc) { 9432 if (outputEnc) {
15780 outData = this._toString(outData, outputEnc) 9433 outData = this._toString(outData, outputEnc)
15781 } 9434 }
15782
15783 return outData 9435 return outData
15784} 9436}
15785 9437
15786CipherBase.prototype.setAutoPadding = function () {} 9438CipherBase.prototype.setAutoPadding = function () {}
9439
15787CipherBase.prototype.getAuthTag = function () { 9440CipherBase.prototype.getAuthTag = function () {
15788 throw new Error('trying to get auth tag in unsupported state') 9441 throw new Error('trying to get auth tag in unsupported state')
15789} 9442}
@@ -15813,15 +9466,15 @@ CipherBase.prototype._transform = function (data, _, next) {
15813CipherBase.prototype._flush = function (done) { 9466CipherBase.prototype._flush = function (done) {
15814 var err 9467 var err
15815 try { 9468 try {
15816 this.push(this.__final()) 9469 this.push(this._final())
15817 } catch (e) { 9470 } catch (e) {
15818 err = e 9471 err = e
9472 } finally {
9473 done(err)
15819 } 9474 }
15820
15821 done(err)
15822} 9475}
15823CipherBase.prototype._finalOrDigest = function (outputEnc) { 9476CipherBase.prototype._finalOrDigest = function (outputEnc) {
15824 var outData = this.__final() || Buffer.alloc(0) 9477 var outData = this._final() || new Buffer('')
15825 if (outputEnc) { 9478 if (outputEnc) {
15826 outData = this._toString(outData, outputEnc, true) 9479 outData = this._toString(outData, outputEnc, true)
15827 } 9480 }
@@ -15833,20 +9486,255 @@ CipherBase.prototype._toString = function (value, enc, fin) {
15833 this._decoder = new StringDecoder(enc) 9486 this._decoder = new StringDecoder(enc)
15834 this._encoding = enc 9487 this._encoding = enc
15835 } 9488 }
15836 9489 if (this._encoding !== enc) {
15837 if (this._encoding !== enc) throw new Error('can\'t switch encodings') 9490 throw new Error('can\'t switch encodings')
15838 9491 }
15839 var out = this._decoder.write(value) 9492 var out = this._decoder.write(value)
15840 if (fin) { 9493 if (fin) {
15841 out += this._decoder.end() 9494 out += this._decoder.end()
15842 } 9495 }
15843
15844 return out 9496 return out
15845} 9497}
15846 9498
15847module.exports = CipherBase 9499}).call(this,require("buffer").Buffer)
9500},{"buffer":47,"inherits":95,"stream":143,"string_decoder":144}],49:[function(require,module,exports){
9501(function (Buffer){
9502// Copyright Joyent, Inc. and other Node contributors.
9503//
9504// Permission is hereby granted, free of charge, to any person obtaining a
9505// copy of this software and associated documentation files (the
9506// "Software"), to deal in the Software without restriction, including
9507// without limitation the rights to use, copy, modify, merge, publish,
9508// distribute, sublicense, and/or sell copies of the Software, and to permit
9509// persons to whom the Software is furnished to do so, subject to the
9510// following conditions:
9511//
9512// The above copyright notice and this permission notice shall be included
9513// in all copies or substantial portions of the Software.
9514//
9515// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9516// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9517// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
9518// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
9519// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
9520// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
9521// USE OR OTHER DEALINGS IN THE SOFTWARE.
9522
9523// NOTE: These type checking functions intentionally don't use `instanceof`
9524// because it is fragile and can be easily faked with `Object.create()`.
9525
9526function isArray(arg) {
9527 if (Array.isArray) {
9528 return Array.isArray(arg);
9529 }
9530 return objectToString(arg) === '[object Array]';
9531}
9532exports.isArray = isArray;
9533
9534function isBoolean(arg) {
9535 return typeof arg === 'boolean';
9536}
9537exports.isBoolean = isBoolean;
9538
9539function isNull(arg) {
9540 return arg === null;
9541}
9542exports.isNull = isNull;
9543
9544function isNullOrUndefined(arg) {
9545 return arg == null;
9546}
9547exports.isNullOrUndefined = isNullOrUndefined;
9548
9549function isNumber(arg) {
9550 return typeof arg === 'number';
9551}
9552exports.isNumber = isNumber;
9553
9554function isString(arg) {
9555 return typeof arg === 'string';
9556}
9557exports.isString = isString;
9558
9559function isSymbol(arg) {
9560 return typeof arg === 'symbol';
9561}
9562exports.isSymbol = isSymbol;
9563
9564function isUndefined(arg) {
9565 return arg === void 0;
9566}
9567exports.isUndefined = isUndefined;
9568
9569function isRegExp(re) {
9570 return objectToString(re) === '[object RegExp]';
9571}
9572exports.isRegExp = isRegExp;
9573
9574function isObject(arg) {
9575 return typeof arg === 'object' && arg !== null;
9576}
9577exports.isObject = isObject;
9578
9579function isDate(d) {
9580 return objectToString(d) === '[object Date]';
9581}
9582exports.isDate = isDate;
9583
9584function isError(e) {
9585 return (objectToString(e) === '[object Error]' || e instanceof Error);
9586}
9587exports.isError = isError;
9588
9589function isFunction(arg) {
9590 return typeof arg === 'function';
9591}
9592exports.isFunction = isFunction;
9593
9594function isPrimitive(arg) {
9595 return arg === null ||
9596 typeof arg === 'boolean' ||
9597 typeof arg === 'number' ||
9598 typeof arg === 'string' ||
9599 typeof arg === 'symbol' || // ES6 symbol
9600 typeof arg === 'undefined';
9601}
9602exports.isPrimitive = isPrimitive;
9603
9604exports.isBuffer = Buffer.isBuffer;
9605
9606function objectToString(o) {
9607 return Object.prototype.toString.call(o);
9608}
9609
9610}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
9611},{"../../is-buffer/index.js":96}],50:[function(require,module,exports){
9612(function (Buffer){
9613var elliptic = require('elliptic');
9614var BN = require('bn.js');
9615
9616module.exports = function createECDH(curve) {
9617 return new ECDH(curve);
9618};
9619
9620var aliases = {
9621 secp256k1: {
9622 name: 'secp256k1',
9623 byteLength: 32
9624 },
9625 secp224r1: {
9626 name: 'p224',
9627 byteLength: 28
9628 },
9629 prime256v1: {
9630 name: 'p256',
9631 byteLength: 32
9632 },
9633 prime192v1: {
9634 name: 'p192',
9635 byteLength: 24
9636 },
9637 ed25519: {
9638 name: 'ed25519',
9639 byteLength: 32
9640 },
9641 secp384r1: {
9642 name: 'p384',
9643 byteLength: 48
9644 },
9645 secp521r1: {
9646 name: 'p521',
9647 byteLength: 66
9648 }
9649};
9650
9651aliases.p224 = aliases.secp224r1;
9652aliases.p256 = aliases.secp256r1 = aliases.prime256v1;
9653aliases.p192 = aliases.secp192r1 = aliases.prime192v1;
9654aliases.p384 = aliases.secp384r1;
9655aliases.p521 = aliases.secp521r1;
9656
9657function ECDH(curve) {
9658 this.curveType = aliases[curve];
9659 if (!this.curveType ) {
9660 this.curveType = {
9661 name: curve
9662 };
9663 }
9664 this.curve = new elliptic.ec(this.curveType.name);
9665 this.keys = void 0;
9666}
9667
9668ECDH.prototype.generateKeys = function (enc, format) {
9669 this.keys = this.curve.genKeyPair();
9670 return this.getPublicKey(enc, format);
9671};
9672
9673ECDH.prototype.computeSecret = function (other, inenc, enc) {
9674 inenc = inenc || 'utf8';
9675 if (!Buffer.isBuffer(other)) {
9676 other = new Buffer(other, inenc);
9677 }
9678 var otherPub = this.curve.keyFromPublic(other).getPublic();
9679 var out = otherPub.mul(this.keys.getPrivate()).getX();
9680 return formatReturnValue(out, enc, this.curveType.byteLength);
9681};
9682
9683ECDH.prototype.getPublicKey = function (enc, format) {
9684 var key = this.keys.getPublic(format === 'compressed', true);
9685 if (format === 'hybrid') {
9686 if (key[key.length - 1] % 2) {
9687 key[0] = 7;
9688 } else {
9689 key [0] = 6;
9690 }
9691 }
9692 return formatReturnValue(key, enc);
9693};
9694
9695ECDH.prototype.getPrivateKey = function (enc) {
9696 return formatReturnValue(this.keys.getPrivate(), enc);
9697};
9698
9699ECDH.prototype.setPublicKey = function (pub, enc) {
9700 enc = enc || 'utf8';
9701 if (!Buffer.isBuffer(pub)) {
9702 pub = new Buffer(pub, enc);
9703 }
9704 this.keys._importPublic(pub);
9705 return this;
9706};
9707
9708ECDH.prototype.setPrivateKey = function (priv, enc) {
9709 enc = enc || 'utf8';
9710 if (!Buffer.isBuffer(priv)) {
9711 priv = new Buffer(priv, enc);
9712 }
9713 var _priv = new BN(priv);
9714 _priv = _priv.toString(16);
9715 this.keys._importPrivate(_priv);
9716 return this;
9717};
9718
9719function formatReturnValue(bn, enc, len) {
9720 if (!Array.isArray(bn)) {
9721 bn = bn.toArray();
9722 }
9723 var buf = new Buffer(bn);
9724 if (len && buf.length < len) {
9725 var zeros = new Buffer(len - buf.length);
9726 zeros.fill(0);
9727 buf = Buffer.concat([zeros, buf]);
9728 }
9729 if (!enc) {
9730 return buf;
9731 } else {
9732 return buf.toString(enc);
9733 }
9734}
15848 9735
15849},{"inherits":121,"safe-buffer":128,"stream":28,"string_decoder":29}],87:[function(require,module,exports){ 9736}).call(this,require("buffer").Buffer)
9737},{"bn.js":17,"buffer":47,"elliptic":67}],51:[function(require,module,exports){
15850(function (Buffer){ 9738(function (Buffer){
15851'use strict' 9739'use strict'
15852var inherits = require('inherits') 9740var inherits = require('inherits')
@@ -15902,7 +9790,7 @@ module.exports = function createHash (alg) {
15902} 9790}
15903 9791
15904}).call(this,require("buffer").Buffer) 9792}).call(this,require("buffer").Buffer)
15905},{"./md5":89,"buffer":5,"cipher-base":86,"inherits":121,"ripemd160":127,"sha.js":130}],88:[function(require,module,exports){ 9793},{"./md5":53,"buffer":47,"cipher-base":48,"inherits":95,"ripemd160":133,"sha.js":136}],52:[function(require,module,exports){
15906(function (Buffer){ 9794(function (Buffer){
15907'use strict' 9795'use strict'
15908var intSize = 4 9796var intSize = 4
@@ -15936,7 +9824,7 @@ module.exports = function hash (buf, fn) {
15936} 9824}
15937 9825
15938}).call(this,require("buffer").Buffer) 9826}).call(this,require("buffer").Buffer)
15939},{"buffer":5}],89:[function(require,module,exports){ 9827},{"buffer":47}],53:[function(require,module,exports){
15940'use strict' 9828'use strict'
15941/* 9829/*
15942 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message 9830 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
@@ -16089,7 +9977,7 @@ module.exports = function md5 (buf) {
16089 return makeHash(buf, core_md5) 9977 return makeHash(buf, core_md5)
16090} 9978}
16091 9979
16092},{"./make-hash":88}],90:[function(require,module,exports){ 9980},{"./make-hash":52}],54:[function(require,module,exports){
16093'use strict' 9981'use strict'
16094var inherits = require('inherits') 9982var inherits = require('inherits')
16095var Legacy = require('./legacy') 9983var Legacy = require('./legacy')
@@ -16153,7 +10041,7 @@ module.exports = function createHmac (alg, key) {
16153 return new Hmac(alg, key) 10041 return new Hmac(alg, key)
16154} 10042}
16155 10043
16156},{"./legacy":91,"cipher-base":86,"create-hash/md5":89,"inherits":121,"ripemd160":127,"safe-buffer":128,"sha.js":130}],91:[function(require,module,exports){ 10044},{"./legacy":55,"cipher-base":48,"create-hash/md5":53,"inherits":95,"ripemd160":133,"safe-buffer":134,"sha.js":136}],55:[function(require,module,exports){
16157'use strict' 10045'use strict'
16158var inherits = require('inherits') 10046var inherits = require('inherits')
16159var Buffer = require('safe-buffer').Buffer 10047var Buffer = require('safe-buffer').Buffer
@@ -16201,435 +10089,1121 @@ Hmac.prototype._final = function () {
16201} 10089}
16202module.exports = Hmac 10090module.exports = Hmac
16203 10091
16204},{"cipher-base":86,"inherits":121,"safe-buffer":128}],92:[function(require,module,exports){ 10092},{"cipher-base":48,"inherits":95,"safe-buffer":134}],56:[function(require,module,exports){
16205var assert = require('assert') 10093'use strict'
16206var BigInteger = require('bigi')
16207 10094
16208var Point = require('./point') 10095exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes')
10096exports.createHash = exports.Hash = require('create-hash')
10097exports.createHmac = exports.Hmac = require('create-hmac')
10098
10099var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(Object.keys(require('browserify-sign/algos')))
10100exports.getHashes = function () {
10101 return hashes
10102}
10103
10104var p = require('pbkdf2')
10105exports.pbkdf2 = p.pbkdf2
10106exports.pbkdf2Sync = p.pbkdf2Sync
10107
10108var aes = require('browserify-cipher')
10109;[
10110 'Cipher',
10111 'createCipher',
10112 'Cipheriv',
10113 'createCipheriv',
10114 'Decipher',
10115 'createDecipher',
10116 'Decipheriv',
10117 'createDecipheriv',
10118 'getCiphers',
10119 'listCiphers'
10120].forEach(function (key) {
10121 exports[key] = aes[key]
10122})
16209 10123
16210function Curve (p, a, b, Gx, Gy, n, h) { 10124var dh = require('diffie-hellman')
16211 this.p = p 10125;[
16212 this.a = a 10126 'DiffieHellmanGroup',
16213 this.b = b 10127 'createDiffieHellmanGroup',
16214 this.G = Point.fromAffine(this, Gx, Gy) 10128 'getDiffieHellman',
16215 this.n = n 10129 'createDiffieHellman',
16216 this.h = h 10130 'DiffieHellman'
10131].forEach(function (key) {
10132 exports[key] = dh[key]
10133})
16217 10134
16218 this.infinity = new Point(this, null, null, BigInteger.ZERO) 10135var sign = require('browserify-sign')
10136;[
10137 'createSign',
10138 'Sign',
10139 'createVerify',
10140 'Verify'
10141].forEach(function (key) {
10142 exports[key] = sign[key]
10143})
16219 10144
16220 // result caching 10145exports.createECDH = require('create-ecdh')
16221 this.pOverFour = p.add(BigInteger.ONE).shiftRight(2)
16222 10146
16223 // determine size of p in bytes 10147var publicEncrypt = require('public-encrypt')
16224 this.pLength = Math.floor((this.p.bitLength() + 7) / 8)
16225}
16226 10148
16227Curve.prototype.pointFromX = function (isOdd, x) { 10149;[
16228 var alpha = x.pow(3).add(this.a.multiply(x)).add(this.b).mod(this.p) 10150 'publicEncrypt',
16229 var beta = alpha.modPow(this.pOverFour, this.p) // XXX: not compatible with all curves 10151 'privateEncrypt',
10152 'publicDecrypt',
10153 'privateDecrypt'
10154].forEach(function (key) {
10155 exports[key] = publicEncrypt[key]
10156})
16230 10157
16231 var y = beta 10158// the least I can do is make error messages for the rest of the node.js/crypto api.
16232 if (beta.isEven() ^ !isOdd) { 10159;[
16233 y = this.p.subtract(y) // -y % p 10160 'createCredentials'
10161].forEach(function (name) {
10162 exports[name] = function () {
10163 throw new Error([
10164 'sorry, ' + name + ' is not implemented yet',
10165 'we accept pull requests',
10166 'https://github.com/crypto-browserify/crypto-browserify'
10167 ].join('\n'))
16234 } 10168 }
10169})
16235 10170
16236 return Point.fromAffine(this, x, y) 10171},{"browserify-cipher":35,"browserify-sign":42,"browserify-sign/algos":39,"create-ecdh":50,"create-hash":51,"create-hmac":54,"diffie-hellman":63,"pbkdf2":106,"public-encrypt":113,"randombytes":119}],57:[function(require,module,exports){
16237} 10172'use strict';
16238 10173
16239Curve.prototype.isInfinity = function (Q) { 10174exports.utils = require('./des/utils');
16240 if (Q === this.infinity) return true 10175exports.Cipher = require('./des/cipher');
10176exports.DES = require('./des/des');
10177exports.CBC = require('./des/cbc');
10178exports.EDE = require('./des/ede');
16241 10179
16242 return Q.z.signum() === 0 && Q.y.signum() !== 0 10180},{"./des/cbc":58,"./des/cipher":59,"./des/des":60,"./des/ede":61,"./des/utils":62}],58:[function(require,module,exports){
16243} 10181'use strict';
16244 10182
16245Curve.prototype.isOnCurve = function (Q) { 10183var assert = require('minimalistic-assert');
16246 if (this.isInfinity(Q)) return true 10184var inherits = require('inherits');
16247 10185
16248 var x = Q.affineX 10186var proto = {};
16249 var y = Q.affineY
16250 var a = this.a
16251 var b = this.b
16252 var p = this.p
16253 10187
16254 // Check that xQ and yQ are integers in the interval [0, p - 1] 10188function CBCState(iv) {
16255 if (x.signum() < 0 || x.compareTo(p) >= 0) return false 10189 assert.equal(iv.length, 8, 'Invalid IV length');
16256 if (y.signum() < 0 || y.compareTo(p) >= 0) return false
16257 10190
16258 // and check that y^2 = x^3 + ax + b (mod p) 10191 this.iv = new Array(8);
16259 var lhs = y.square().mod(p) 10192 for (var i = 0; i < this.iv.length; i++)
16260 var rhs = x.pow(3).add(a.multiply(x)).add(b).mod(p) 10193 this.iv[i] = iv[i];
16261 return lhs.equals(rhs)
16262} 10194}
16263 10195
16264/** 10196function instantiate(Base) {
16265 * Validate an elliptic curve point. 10197 function CBC(options) {
16266 * 10198 Base.call(this, options);
16267 * See SEC 1, section 3.2.2.1: Elliptic Curve Public Key Validation Primitive 10199 this._cbcInit();
16268 */ 10200 }
16269Curve.prototype.validate = function (Q) { 10201 inherits(CBC, Base);
16270 // Check Q != O
16271 assert(!this.isInfinity(Q), 'Point is at infinity')
16272 assert(this.isOnCurve(Q), 'Point is not on the curve')
16273 10202
16274 // Check nQ = O (where Q is a scalar multiple of G) 10203 var keys = Object.keys(proto);
16275 var nQ = Q.multiply(this.n) 10204 for (var i = 0; i < keys.length; i++) {
16276 assert(this.isInfinity(nQ), 'Point is not a scalar multiple of G') 10205 var key = keys[i];
10206 CBC.prototype[key] = proto[key];
10207 }
16277 10208
16278 return true 10209 CBC.create = function create(options) {
10210 return new CBC(options);
10211 };
10212
10213 return CBC;
16279} 10214}
16280 10215
16281module.exports = Curve 10216exports.instantiate = instantiate;
16282 10217
16283},{"./point":96,"assert":1,"bigi":39}],93:[function(require,module,exports){ 10218proto._cbcInit = function _cbcInit() {
16284module.exports={ 10219 var state = new CBCState(this.options.iv);
16285 "secp128r1": { 10220 this._cbcState = state;
16286 "p": "fffffffdffffffffffffffffffffffff", 10221};
16287 "a": "fffffffdfffffffffffffffffffffffc",
16288 "b": "e87579c11079f43dd824993c2cee5ed3",
16289 "n": "fffffffe0000000075a30d1b9038a115",
16290 "h": "01",
16291 "Gx": "161ff7528b899b2d0c28607ca52c5b86",
16292 "Gy": "cf5ac8395bafeb13c02da292dded7a83"
16293 },
16294 "secp160k1": {
16295 "p": "fffffffffffffffffffffffffffffffeffffac73",
16296 "a": "00",
16297 "b": "07",
16298 "n": "0100000000000000000001b8fa16dfab9aca16b6b3",
16299 "h": "01",
16300 "Gx": "3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",
16301 "Gy": "938cf935318fdced6bc28286531733c3f03c4fee"
16302 },
16303 "secp160r1": {
16304 "p": "ffffffffffffffffffffffffffffffff7fffffff",
16305 "a": "ffffffffffffffffffffffffffffffff7ffffffc",
16306 "b": "1c97befc54bd7a8b65acf89f81d4d4adc565fa45",
16307 "n": "0100000000000000000001f4c8f927aed3ca752257",
16308 "h": "01",
16309 "Gx": "4a96b5688ef573284664698968c38bb913cbfc82",
16310 "Gy": "23a628553168947d59dcc912042351377ac5fb32"
16311 },
16312 "secp192k1": {
16313 "p": "fffffffffffffffffffffffffffffffffffffffeffffee37",
16314 "a": "00",
16315 "b": "03",
16316 "n": "fffffffffffffffffffffffe26f2fc170f69466a74defd8d",
16317 "h": "01",
16318 "Gx": "db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",
16319 "Gy": "9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"
16320 },
16321 "secp192r1": {
16322 "p": "fffffffffffffffffffffffffffffffeffffffffffffffff",
16323 "a": "fffffffffffffffffffffffffffffffefffffffffffffffc",
16324 "b": "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",
16325 "n": "ffffffffffffffffffffffff99def836146bc9b1b4d22831",
16326 "h": "01",
16327 "Gx": "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",
16328 "Gy": "07192b95ffc8da78631011ed6b24cdd573f977a11e794811"
16329 },
16330 "secp256k1": {
16331 "p": "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",
16332 "a": "00",
16333 "b": "07",
16334 "n": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",
16335 "h": "01",
16336 "Gx": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
16337 "Gy": "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
16338 },
16339 "secp256r1": {
16340 "p": "ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",
16341 "a": "ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",
16342 "b": "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",
16343 "n": "ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",
16344 "h": "01",
16345 "Gx": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",
16346 "Gy": "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"
16347 }
16348}
16349 10222
16350},{}],94:[function(require,module,exports){ 10223proto._update = function _update(inp, inOff, out, outOff) {
16351var Point = require('./point') 10224 var state = this._cbcState;
16352var Curve = require('./curve') 10225 var superProto = this.constructor.super_.prototype;
16353 10226
16354var getCurveByName = require('./names') 10227 var iv = state.iv;
10228 if (this.type === 'encrypt') {
10229 for (var i = 0; i < this.blockSize; i++)
10230 iv[i] ^= inp[inOff + i];
16355 10231
16356module.exports = { 10232 superProto._update.call(this, iv, 0, out, outOff);
16357 Curve: Curve,
16358 Point: Point,
16359 getCurveByName: getCurveByName
16360}
16361 10233
16362},{"./curve":92,"./names":95,"./point":96}],95:[function(require,module,exports){ 10234 for (var i = 0; i < this.blockSize; i++)
16363var BigInteger = require('bigi') 10235 iv[i] = out[outOff + i];
10236 } else {
10237 superProto._update.call(this, inp, inOff, out, outOff);
16364 10238
16365var curves = require('./curves.json') 10239 for (var i = 0; i < this.blockSize; i++)
16366var Curve = require('./curve') 10240 out[outOff + i] ^= iv[i];
16367 10241
16368function getCurveByName (name) { 10242 for (var i = 0; i < this.blockSize; i++)
16369 var curve = curves[name] 10243 iv[i] = inp[inOff + i];
16370 if (!curve) return null 10244 }
10245};
16371 10246
16372 var p = new BigInteger(curve.p, 16) 10247},{"inherits":95,"minimalistic-assert":99}],59:[function(require,module,exports){
16373 var a = new BigInteger(curve.a, 16) 10248'use strict';
16374 var b = new BigInteger(curve.b, 16)
16375 var n = new BigInteger(curve.n, 16)
16376 var h = new BigInteger(curve.h, 16)
16377 var Gx = new BigInteger(curve.Gx, 16)
16378 var Gy = new BigInteger(curve.Gy, 16)
16379 10249
16380 return new Curve(p, a, b, Gx, Gy, n, h) 10250var assert = require('minimalistic-assert');
10251
10252function Cipher(options) {
10253 this.options = options;
10254
10255 this.type = this.options.type;
10256 this.blockSize = 8;
10257 this._init();
10258
10259 this.buffer = new Array(this.blockSize);
10260 this.bufferOff = 0;
16381} 10261}
10262module.exports = Cipher;
16382 10263
16383module.exports = getCurveByName 10264Cipher.prototype._init = function _init() {
10265 // Might be overrided
10266};
16384 10267
16385},{"./curve":92,"./curves.json":93,"bigi":39}],96:[function(require,module,exports){ 10268Cipher.prototype.update = function update(data) {
16386(function (Buffer){ 10269 if (data.length === 0)
16387var assert = require('assert') 10270 return [];
16388var BigInteger = require('bigi')
16389 10271
16390var THREE = BigInteger.valueOf(3) 10272 if (this.type === 'decrypt')
10273 return this._updateDecrypt(data);
10274 else
10275 return this._updateEncrypt(data);
10276};
16391 10277
16392function Point (curve, x, y, z) { 10278Cipher.prototype._buffer = function _buffer(data, off) {
16393 assert.notStrictEqual(z, undefined, 'Missing Z coordinate') 10279 // Append data to buffer
10280 var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);
10281 for (var i = 0; i < min; i++)
10282 this.buffer[this.bufferOff + i] = data[off + i];
10283 this.bufferOff += min;
16394 10284
16395 this.curve = curve 10285 // Shift next
16396 this.x = x 10286 return min;
16397 this.y = y 10287};
16398 this.z = z
16399 this._zInv = null
16400 10288
16401 this.compressed = true 10289Cipher.prototype._flushBuffer = function _flushBuffer(out, off) {
16402} 10290 this._update(this.buffer, 0, out, off);
10291 this.bufferOff = 0;
10292 return this.blockSize;
10293};
16403 10294
16404Object.defineProperty(Point.prototype, 'zInv', { 10295Cipher.prototype._updateEncrypt = function _updateEncrypt(data) {
16405 get: function () { 10296 var inputOff = 0;
16406 if (this._zInv === null) { 10297 var outputOff = 0;
16407 this._zInv = this.z.modInverse(this.curve.p)
16408 }
16409 10298
16410 return this._zInv 10299 var count = ((this.bufferOff + data.length) / this.blockSize) | 0;
10300 var out = new Array(count * this.blockSize);
10301
10302 if (this.bufferOff !== 0) {
10303 inputOff += this._buffer(data, inputOff);
10304
10305 if (this.bufferOff === this.buffer.length)
10306 outputOff += this._flushBuffer(out, outputOff);
16411 } 10307 }
16412})
16413 10308
16414Object.defineProperty(Point.prototype, 'affineX', { 10309 // Write blocks
16415 get: function () { 10310 var max = data.length - ((data.length - inputOff) % this.blockSize);
16416 return this.x.multiply(this.zInv).mod(this.curve.p) 10311 for (; inputOff < max; inputOff += this.blockSize) {
10312 this._update(data, inputOff, out, outputOff);
10313 outputOff += this.blockSize;
16417 } 10314 }
16418})
16419 10315
16420Object.defineProperty(Point.prototype, 'affineY', { 10316 // Queue rest
16421 get: function () { 10317 for (; inputOff < data.length; inputOff++, this.bufferOff++)
16422 return this.y.multiply(this.zInv).mod(this.curve.p) 10318 this.buffer[this.bufferOff] = data[inputOff];
10319
10320 return out;
10321};
10322
10323Cipher.prototype._updateDecrypt = function _updateDecrypt(data) {
10324 var inputOff = 0;
10325 var outputOff = 0;
10326
10327 var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;
10328 var out = new Array(count * this.blockSize);
10329
10330 // TODO(indutny): optimize it, this is far from optimal
10331 for (; count > 0; count--) {
10332 inputOff += this._buffer(data, inputOff);
10333 outputOff += this._flushBuffer(out, outputOff);
16423 } 10334 }
16424})
16425 10335
16426Point.fromAffine = function (curve, x, y) { 10336 // Buffer rest of the input
16427 return new Point(curve, x, y, BigInteger.ONE) 10337 inputOff += this._buffer(data, inputOff);
16428}
16429 10338
16430Point.prototype.equals = function (other) { 10339 return out;
16431 if (other === this) return true 10340};
16432 if (this.curve.isInfinity(this)) return this.curve.isInfinity(other)
16433 if (this.curve.isInfinity(other)) return this.curve.isInfinity(this)
16434 10341
16435 // u = Y2 * Z1 - Y1 * Z2 10342Cipher.prototype.final = function final(buffer) {
16436 var u = other.y.multiply(this.z).subtract(this.y.multiply(other.z)).mod(this.curve.p) 10343 var first;
10344 if (buffer)
10345 first = this.update(buffer);
16437 10346
16438 if (u.signum() !== 0) return false 10347 var last;
10348 if (this.type === 'encrypt')
10349 last = this._finalEncrypt();
10350 else
10351 last = this._finalDecrypt();
16439 10352
16440 // v = X2 * Z1 - X1 * Z2 10353 if (first)
16441 var v = other.x.multiply(this.z).subtract(this.x.multiply(other.z)).mod(this.curve.p) 10354 return first.concat(last);
10355 else
10356 return last;
10357};
16442 10358
16443 return v.signum() === 0 10359Cipher.prototype._pad = function _pad(buffer, off) {
10360 if (off === 0)
10361 return false;
10362
10363 while (off < buffer.length)
10364 buffer[off++] = 0;
10365
10366 return true;
10367};
10368
10369Cipher.prototype._finalEncrypt = function _finalEncrypt() {
10370 if (!this._pad(this.buffer, this.bufferOff))
10371 return [];
10372
10373 var out = new Array(this.blockSize);
10374 this._update(this.buffer, 0, out, 0);
10375 return out;
10376};
10377
10378Cipher.prototype._unpad = function _unpad(buffer) {
10379 return buffer;
10380};
10381
10382Cipher.prototype._finalDecrypt = function _finalDecrypt() {
10383 assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt');
10384 var out = new Array(this.blockSize);
10385 this._flushBuffer(out, 0);
10386
10387 return this._unpad(out);
10388};
10389
10390},{"minimalistic-assert":99}],60:[function(require,module,exports){
10391'use strict';
10392
10393var assert = require('minimalistic-assert');
10394var inherits = require('inherits');
10395
10396var des = require('../des');
10397var utils = des.utils;
10398var Cipher = des.Cipher;
10399
10400function DESState() {
10401 this.tmp = new Array(2);
10402 this.keys = null;
16444} 10403}
16445 10404
16446Point.prototype.negate = function () { 10405function DES(options) {
16447 var y = this.curve.p.subtract(this.y) 10406 Cipher.call(this, options);
16448 10407
16449 return new Point(this.curve, this.x, y, this.z) 10408 var state = new DESState();
10409 this._desState = state;
10410
10411 this.deriveKeys(state, options.key);
16450} 10412}
10413inherits(DES, Cipher);
10414module.exports = DES;
16451 10415
16452Point.prototype.add = function (b) { 10416DES.create = function create(options) {
16453 if (this.curve.isInfinity(this)) return b 10417 return new DES(options);
16454 if (this.curve.isInfinity(b)) return this 10418};
16455 10419
16456 var x1 = this.x 10420var shiftTable = [
16457 var y1 = this.y 10421 1, 1, 2, 2, 2, 2, 2, 2,
16458 var x2 = b.x 10422 1, 2, 2, 2, 2, 2, 2, 1
16459 var y2 = b.y 10423];
16460 10424
16461 // u = Y2 * Z1 - Y1 * Z2 10425DES.prototype.deriveKeys = function deriveKeys(state, key) {
16462 var u = y2.multiply(this.z).subtract(y1.multiply(b.z)).mod(this.curve.p) 10426 state.keys = new Array(16 * 2);
16463 // v = X2 * Z1 - X1 * Z2
16464 var v = x2.multiply(this.z).subtract(x1.multiply(b.z)).mod(this.curve.p)
16465 10427
16466 if (v.signum() === 0) { 10428 assert.equal(key.length, this.blockSize, 'Invalid key length');
16467 if (u.signum() === 0) {
16468 return this.twice() // this == b, so double
16469 }
16470 10429
16471 return this.curve.infinity // this = -b, so infinity 10430 var kL = utils.readUInt32BE(key, 0);
10431 var kR = utils.readUInt32BE(key, 4);
10432
10433 utils.pc1(kL, kR, state.tmp, 0);
10434 kL = state.tmp[0];
10435 kR = state.tmp[1];
10436 for (var i = 0; i < state.keys.length; i += 2) {
10437 var shift = shiftTable[i >>> 1];
10438 kL = utils.r28shl(kL, shift);
10439 kR = utils.r28shl(kR, shift);
10440 utils.pc2(kL, kR, state.keys, i);
16472 } 10441 }
10442};
16473 10443
16474 var v2 = v.square() 10444DES.prototype._update = function _update(inp, inOff, out, outOff) {
16475 var v3 = v2.multiply(v) 10445 var state = this._desState;
16476 var x1v2 = x1.multiply(v2)
16477 var zu2 = u.square().multiply(this.z)
16478 10446
16479 // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3) 10447 var l = utils.readUInt32BE(inp, inOff);
16480 var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.p) 10448 var r = utils.readUInt32BE(inp, inOff + 4);
16481 // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3
16482 var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.p)
16483 // z3 = v^3 * z1 * z2
16484 var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.p)
16485 10449
16486 return new Point(this.curve, x3, y3, z3) 10450 // Initial Permutation
16487} 10451 utils.ip(l, r, state.tmp, 0);
10452 l = state.tmp[0];
10453 r = state.tmp[1];
16488 10454
16489Point.prototype.twice = function () { 10455 if (this.type === 'encrypt')
16490 if (this.curve.isInfinity(this)) return this 10456 this._encrypt(state, l, r, state.tmp, 0);
16491 if (this.y.signum() === 0) return this.curve.infinity 10457 else
10458 this._decrypt(state, l, r, state.tmp, 0);
16492 10459
16493 var x1 = this.x 10460 l = state.tmp[0];
16494 var y1 = this.y 10461 r = state.tmp[1];
16495 10462
16496 var y1z1 = y1.multiply(this.z).mod(this.curve.p) 10463 utils.writeUInt32BE(out, l, outOff);
16497 var y1sqz1 = y1z1.multiply(y1).mod(this.curve.p) 10464 utils.writeUInt32BE(out, r, outOff + 4);
16498 var a = this.curve.a 10465};
16499 10466
16500 // w = 3 * x1^2 + a * z1^2 10467DES.prototype._pad = function _pad(buffer, off) {
16501 var w = x1.square().multiply(THREE) 10468 var value = buffer.length - off;
10469 for (var i = off; i < buffer.length; i++)
10470 buffer[i] = value;
16502 10471
16503 if (a.signum() !== 0) { 10472 return true;
16504 w = w.add(this.z.square().multiply(a)) 10473};
10474
10475DES.prototype._unpad = function _unpad(buffer) {
10476 var pad = buffer[buffer.length - 1];
10477 for (var i = buffer.length - pad; i < buffer.length; i++)
10478 assert.equal(buffer[i], pad);
10479
10480 return buffer.slice(0, buffer.length - pad);
10481};
10482
10483DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {
10484 var l = lStart;
10485 var r = rStart;
10486
10487 // Apply f() x16 times
10488 for (var i = 0; i < state.keys.length; i += 2) {
10489 var keyL = state.keys[i];
10490 var keyR = state.keys[i + 1];
10491
10492 // f(r, k)
10493 utils.expand(r, state.tmp, 0);
10494
10495 keyL ^= state.tmp[0];
10496 keyR ^= state.tmp[1];
10497 var s = utils.substitute(keyL, keyR);
10498 var f = utils.permute(s);
10499
10500 var t = r;
10501 r = (l ^ f) >>> 0;
10502 l = t;
16505 } 10503 }
16506 10504
16507 w = w.mod(this.curve.p) 10505 // Reverse Initial Permutation
16508 // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1) 10506 utils.rip(r, l, out, off);
16509 var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.p) 10507};
16510 // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3
16511 var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.pow(3)).mod(this.curve.p)
16512 // z3 = 8 * (y1 * z1)^3
16513 var z3 = y1z1.pow(3).shiftLeft(3).mod(this.curve.p)
16514 10508
16515 return new Point(this.curve, x3, y3, z3) 10509DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {
10510 var l = rStart;
10511 var r = lStart;
10512
10513 // Apply f() x16 times
10514 for (var i = state.keys.length - 2; i >= 0; i -= 2) {
10515 var keyL = state.keys[i];
10516 var keyR = state.keys[i + 1];
10517
10518 // f(r, k)
10519 utils.expand(l, state.tmp, 0);
10520
10521 keyL ^= state.tmp[0];
10522 keyR ^= state.tmp[1];
10523 var s = utils.substitute(keyL, keyR);
10524 var f = utils.permute(s);
10525
10526 var t = l;
10527 l = (r ^ f) >>> 0;
10528 r = t;
10529 }
10530
10531 // Reverse Initial Permutation
10532 utils.rip(l, r, out, off);
10533};
10534
10535},{"../des":57,"inherits":95,"minimalistic-assert":99}],61:[function(require,module,exports){
10536'use strict';
10537
10538var assert = require('minimalistic-assert');
10539var inherits = require('inherits');
10540
10541var des = require('../des');
10542var Cipher = des.Cipher;
10543var DES = des.DES;
10544
10545function EDEState(type, key) {
10546 assert.equal(key.length, 24, 'Invalid key length');
10547
10548 var k1 = key.slice(0, 8);
10549 var k2 = key.slice(8, 16);
10550 var k3 = key.slice(16, 24);
10551
10552 if (type === 'encrypt') {
10553 this.ciphers = [
10554 DES.create({ type: 'encrypt', key: k1 }),
10555 DES.create({ type: 'decrypt', key: k2 }),
10556 DES.create({ type: 'encrypt', key: k3 })
10557 ];
10558 } else {
10559 this.ciphers = [
10560 DES.create({ type: 'decrypt', key: k3 }),
10561 DES.create({ type: 'encrypt', key: k2 }),
10562 DES.create({ type: 'decrypt', key: k1 })
10563 ];
10564 }
16516} 10565}
16517 10566
16518// Simple NAF (Non-Adjacent Form) multiplication algorithm 10567function EDE(options) {
16519// TODO: modularize the multiplication algorithm 10568 Cipher.call(this, options);
16520Point.prototype.multiply = function (k) {
16521 if (this.curve.isInfinity(this)) return this
16522 if (k.signum() === 0) return this.curve.infinity
16523 10569
16524 var e = k 10570 var state = new EDEState(this.type, this.options.key);
16525 var h = e.multiply(THREE) 10571 this._edeState = state;
10572}
10573inherits(EDE, Cipher);
16526 10574
16527 var neg = this.negate() 10575module.exports = EDE;
16528 var R = this
16529 10576
16530 for (var i = h.bitLength() - 2; i > 0; --i) { 10577EDE.create = function create(options) {
16531 var hBit = h.testBit(i) 10578 return new EDE(options);
16532 var eBit = e.testBit(i) 10579};
16533 10580
16534 R = R.twice() 10581EDE.prototype._update = function _update(inp, inOff, out, outOff) {
10582 var state = this._edeState;
16535 10583
16536 if (hBit !== eBit) { 10584 state.ciphers[0]._update(inp, inOff, out, outOff);
16537 R = R.add(hBit ? this : neg) 10585 state.ciphers[1]._update(out, outOff, out, outOff);
10586 state.ciphers[2]._update(out, outOff, out, outOff);
10587};
10588
10589EDE.prototype._pad = DES.prototype._pad;
10590EDE.prototype._unpad = DES.prototype._unpad;
10591
10592},{"../des":57,"inherits":95,"minimalistic-assert":99}],62:[function(require,module,exports){
10593'use strict';
10594
10595exports.readUInt32BE = function readUInt32BE(bytes, off) {
10596 var res = (bytes[0 + off] << 24) |
10597 (bytes[1 + off] << 16) |
10598 (bytes[2 + off] << 8) |
10599 bytes[3 + off];
10600 return res >>> 0;
10601};
10602
10603exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {
10604 bytes[0 + off] = value >>> 24;
10605 bytes[1 + off] = (value >>> 16) & 0xff;
10606 bytes[2 + off] = (value >>> 8) & 0xff;
10607 bytes[3 + off] = value & 0xff;
10608};
10609
10610exports.ip = function ip(inL, inR, out, off) {
10611 var outL = 0;
10612 var outR = 0;
10613
10614 for (var i = 6; i >= 0; i -= 2) {
10615 for (var j = 0; j <= 24; j += 8) {
10616 outL <<= 1;
10617 outL |= (inR >>> (j + i)) & 1;
10618 }
10619 for (var j = 0; j <= 24; j += 8) {
10620 outL <<= 1;
10621 outL |= (inL >>> (j + i)) & 1;
16538 } 10622 }
16539 } 10623 }
16540 10624
16541 return R 10625 for (var i = 6; i >= 0; i -= 2) {
16542} 10626 for (var j = 1; j <= 25; j += 8) {
10627 outR <<= 1;
10628 outR |= (inR >>> (j + i)) & 1;
10629 }
10630 for (var j = 1; j <= 25; j += 8) {
10631 outR <<= 1;
10632 outR |= (inL >>> (j + i)) & 1;
10633 }
10634 }
16543 10635
16544// Compute this*j + x*k (simultaneous multiplication) 10636 out[off + 0] = outL >>> 0;
16545Point.prototype.multiplyTwo = function (j, x, k) { 10637 out[off + 1] = outR >>> 0;
16546 var i = Math.max(j.bitLength(), k.bitLength()) - 1 10638};
16547 var R = this.curve.infinity
16548 var both = this.add(x)
16549 10639
16550 while (i >= 0) { 10640exports.rip = function rip(inL, inR, out, off) {
16551 var jBit = j.testBit(i) 10641 var outL = 0;
16552 var kBit = k.testBit(i) 10642 var outR = 0;
16553 10643
16554 R = R.twice() 10644 for (var i = 0; i < 4; i++) {
10645 for (var j = 24; j >= 0; j -= 8) {
10646 outL <<= 1;
10647 outL |= (inR >>> (j + i)) & 1;
10648 outL <<= 1;
10649 outL |= (inL >>> (j + i)) & 1;
10650 }
10651 }
10652 for (var i = 4; i < 8; i++) {
10653 for (var j = 24; j >= 0; j -= 8) {
10654 outR <<= 1;
10655 outR |= (inR >>> (j + i)) & 1;
10656 outR <<= 1;
10657 outR |= (inL >>> (j + i)) & 1;
10658 }
10659 }
16555 10660
16556 if (jBit) { 10661 out[off + 0] = outL >>> 0;
16557 if (kBit) { 10662 out[off + 1] = outR >>> 0;
16558 R = R.add(both) 10663};
16559 } else { 10664
16560 R = R.add(this) 10665exports.pc1 = function pc1(inL, inR, out, off) {
16561 } 10666 var outL = 0;
16562 } else if (kBit) { 10667 var outR = 0;
16563 R = R.add(x) 10668
10669 // 7, 15, 23, 31, 39, 47, 55, 63
10670 // 6, 14, 22, 30, 39, 47, 55, 63
10671 // 5, 13, 21, 29, 39, 47, 55, 63
10672 // 4, 12, 20, 28
10673 for (var i = 7; i >= 5; i--) {
10674 for (var j = 0; j <= 24; j += 8) {
10675 outL <<= 1;
10676 outL |= (inR >> (j + i)) & 1;
16564 } 10677 }
16565 --i 10678 for (var j = 0; j <= 24; j += 8) {
10679 outL <<= 1;
10680 outL |= (inL >> (j + i)) & 1;
10681 }
10682 }
10683 for (var j = 0; j <= 24; j += 8) {
10684 outL <<= 1;
10685 outL |= (inR >> (j + i)) & 1;
16566 } 10686 }
16567 10687
16568 return R 10688 // 1, 9, 17, 25, 33, 41, 49, 57
10689 // 2, 10, 18, 26, 34, 42, 50, 58
10690 // 3, 11, 19, 27, 35, 43, 51, 59
10691 // 36, 44, 52, 60
10692 for (var i = 1; i <= 3; i++) {
10693 for (var j = 0; j <= 24; j += 8) {
10694 outR <<= 1;
10695 outR |= (inR >> (j + i)) & 1;
10696 }
10697 for (var j = 0; j <= 24; j += 8) {
10698 outR <<= 1;
10699 outR |= (inL >> (j + i)) & 1;
10700 }
10701 }
10702 for (var j = 0; j <= 24; j += 8) {
10703 outR <<= 1;
10704 outR |= (inL >> (j + i)) & 1;
10705 }
10706
10707 out[off + 0] = outL >>> 0;
10708 out[off + 1] = outR >>> 0;
10709};
10710
10711exports.r28shl = function r28shl(num, shift) {
10712 return ((num << shift) & 0xfffffff) | (num >>> (28 - shift));
10713};
10714
10715var pc2table = [
10716 // inL => outL
10717 14, 11, 17, 4, 27, 23, 25, 0,
10718 13, 22, 7, 18, 5, 9, 16, 24,
10719 2, 20, 12, 21, 1, 8, 15, 26,
10720
10721 // inR => outR
10722 15, 4, 25, 19, 9, 1, 26, 16,
10723 5, 11, 23, 8, 12, 7, 17, 0,
10724 22, 3, 10, 14, 6, 20, 27, 24
10725];
10726
10727exports.pc2 = function pc2(inL, inR, out, off) {
10728 var outL = 0;
10729 var outR = 0;
10730
10731 var len = pc2table.length >>> 1;
10732 for (var i = 0; i < len; i++) {
10733 outL <<= 1;
10734 outL |= (inL >>> pc2table[i]) & 0x1;
10735 }
10736 for (var i = len; i < pc2table.length; i++) {
10737 outR <<= 1;
10738 outR |= (inR >>> pc2table[i]) & 0x1;
10739 }
10740
10741 out[off + 0] = outL >>> 0;
10742 out[off + 1] = outR >>> 0;
10743};
10744
10745exports.expand = function expand(r, out, off) {
10746 var outL = 0;
10747 var outR = 0;
10748
10749 outL = ((r & 1) << 5) | (r >>> 27);
10750 for (var i = 23; i >= 15; i -= 4) {
10751 outL <<= 6;
10752 outL |= (r >>> i) & 0x3f;
10753 }
10754 for (var i = 11; i >= 3; i -= 4) {
10755 outR |= (r >>> i) & 0x3f;
10756 outR <<= 6;
10757 }
10758 outR |= ((r & 0x1f) << 1) | (r >>> 31);
10759
10760 out[off + 0] = outL >>> 0;
10761 out[off + 1] = outR >>> 0;
10762};
10763
10764var sTable = [
10765 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,
10766 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8,
10767 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7,
10768 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13,
10769
10770 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14,
10771 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5,
10772 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2,
10773 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9,
10774
10775 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10,
10776 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1,
10777 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7,
10778 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12,
10779
10780 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3,
10781 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9,
10782 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8,
10783 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14,
10784
10785 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1,
10786 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6,
10787 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13,
10788 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3,
10789
10790 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5,
10791 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8,
10792 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10,
10793 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13,
10794
10795 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10,
10796 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6,
10797 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7,
10798 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12,
10799
10800 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4,
10801 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2,
10802 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13,
10803 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11
10804];
10805
10806exports.substitute = function substitute(inL, inR) {
10807 var out = 0;
10808 for (var i = 0; i < 4; i++) {
10809 var b = (inL >>> (18 - i * 6)) & 0x3f;
10810 var sb = sTable[i * 0x40 + b];
10811
10812 out <<= 4;
10813 out |= sb;
10814 }
10815 for (var i = 0; i < 4; i++) {
10816 var b = (inR >>> (18 - i * 6)) & 0x3f;
10817 var sb = sTable[4 * 0x40 + i * 0x40 + b];
10818
10819 out <<= 4;
10820 out |= sb;
10821 }
10822 return out >>> 0;
10823};
10824
10825var permuteTable = [
10826 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22,
10827 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7
10828];
10829
10830exports.permute = function permute(num) {
10831 var out = 0;
10832 for (var i = 0; i < permuteTable.length; i++) {
10833 out <<= 1;
10834 out |= (num >>> permuteTable[i]) & 0x1;
10835 }
10836 return out >>> 0;
10837};
10838
10839exports.padSplit = function padSplit(num, size, group) {
10840 var str = num.toString(2);
10841 while (str.length < size)
10842 str = '0' + str;
10843
10844 var out = [];
10845 for (var i = 0; i < size; i += group)
10846 out.push(str.slice(i, i + group));
10847 return out.join(' ');
10848};
10849
10850},{}],63:[function(require,module,exports){
10851(function (Buffer){
10852var generatePrime = require('./lib/generatePrime')
10853var primes = require('./lib/primes.json')
10854
10855var DH = require('./lib/dh')
10856
10857function getDiffieHellman (mod) {
10858 var prime = new Buffer(primes[mod].prime, 'hex')
10859 var gen = new Buffer(primes[mod].gen, 'hex')
10860
10861 return new DH(prime, gen)
16569} 10862}
16570 10863
16571Point.prototype.getEncoded = function (compressed) { 10864var ENCODINGS = {
16572 if (compressed == null) compressed = this.compressed 10865 'binary': true, 'hex': true, 'base64': true
16573 if (this.curve.isInfinity(this)) return new Buffer('00', 'hex') // Infinity point encoded is simply '00' 10866}
16574 10867
16575 var x = this.affineX 10868function createDiffieHellman (prime, enc, generator, genc) {
16576 var y = this.affineY 10869 if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {
16577 var byteLength = this.curve.pLength 10870 return createDiffieHellman(prime, 'binary', enc, generator)
16578 var buffer 10871 }
16579 10872
16580 // 0x02/0x03 | X 10873 enc = enc || 'binary'
16581 if (compressed) { 10874 genc = genc || 'binary'
16582 buffer = new Buffer(1 + byteLength) 10875 generator = generator || new Buffer([2])
16583 buffer.writeUInt8(y.isEven() ? 0x02 : 0x03, 0)
16584 10876
16585 // 0x04 | X | Y 10877 if (!Buffer.isBuffer(generator)) {
16586 } else { 10878 generator = new Buffer(generator, genc)
16587 buffer = new Buffer(1 + byteLength + byteLength) 10879 }
16588 buffer.writeUInt8(0x04, 0)
16589 10880
16590 y.toBuffer(byteLength).copy(buffer, 1 + byteLength) 10881 if (typeof prime === 'number') {
10882 return new DH(generatePrime(prime, generator), generator, true)
16591 } 10883 }
16592 10884
16593 x.toBuffer(byteLength).copy(buffer, 1) 10885 if (!Buffer.isBuffer(prime)) {
10886 prime = new Buffer(prime, enc)
10887 }
16594 10888
16595 return buffer 10889 return new DH(prime, generator, true)
16596} 10890}
16597 10891
16598Point.decodeFrom = function (curve, buffer) { 10892exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman
16599 var type = buffer.readUInt8(0) 10893exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman
16600 var compressed = (type !== 4)
16601 10894
16602 var byteLength = Math.floor((curve.p.bitLength() + 7) / 8) 10895}).call(this,require("buffer").Buffer)
16603 var x = BigInteger.fromBuffer(buffer.slice(1, 1 + byteLength)) 10896},{"./lib/dh":64,"./lib/generatePrime":65,"./lib/primes.json":66,"buffer":47}],64:[function(require,module,exports){
10897(function (Buffer){
10898var BN = require('bn.js');
10899var MillerRabin = require('miller-rabin');
10900var millerRabin = new MillerRabin();
10901var TWENTYFOUR = new BN(24);
10902var ELEVEN = new BN(11);
10903var TEN = new BN(10);
10904var THREE = new BN(3);
10905var SEVEN = new BN(7);
10906var primes = require('./generatePrime');
10907var randomBytes = require('randombytes');
10908module.exports = DH;
10909
10910function setPublicKey(pub, enc) {
10911 enc = enc || 'utf8';
10912 if (!Buffer.isBuffer(pub)) {
10913 pub = new Buffer(pub, enc);
10914 }
10915 this._pub = new BN(pub);
10916 return this;
10917}
16604 10918
16605 var Q 10919function setPrivateKey(priv, enc) {
16606 if (compressed) { 10920 enc = enc || 'utf8';
16607 assert.equal(buffer.length, byteLength + 1, 'Invalid sequence length') 10921 if (!Buffer.isBuffer(priv)) {
16608 assert(type === 0x02 || type === 0x03, 'Invalid sequence tag') 10922 priv = new Buffer(priv, enc);
10923 }
10924 this._priv = new BN(priv);
10925 return this;
10926}
16609 10927
16610 var isOdd = (type === 0x03) 10928var primeCache = {};
16611 Q = curve.pointFromX(isOdd, x) 10929function checkPrime(prime, generator) {
10930 var gen = generator.toString('hex');
10931 var hex = [gen, prime.toString(16)].join('_');
10932 if (hex in primeCache) {
10933 return primeCache[hex];
10934 }
10935 var error = 0;
10936
10937 if (prime.isEven() ||
10938 !primes.simpleSieve ||
10939 !primes.fermatTest(prime) ||
10940 !millerRabin.test(prime)) {
10941 //not a prime so +1
10942 error += 1;
10943
10944 if (gen === '02' || gen === '05') {
10945 // we'd be able to check the generator
10946 // it would fail so +8
10947 error += 8;
10948 } else {
10949 //we wouldn't be able to test the generator
10950 // so +4
10951 error += 4;
10952 }
10953 primeCache[hex] = error;
10954 return error;
10955 }
10956 if (!millerRabin.test(prime.shrn(1))) {
10957 //not a safe prime
10958 error += 2;
10959 }
10960 var rem;
10961 switch (gen) {
10962 case '02':
10963 if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {
10964 // unsuidable generator
10965 error += 8;
10966 }
10967 break;
10968 case '05':
10969 rem = prime.mod(TEN);
10970 if (rem.cmp(THREE) && rem.cmp(SEVEN)) {
10971 // prime mod 10 needs to equal 3 or 7
10972 error += 8;
10973 }
10974 break;
10975 default:
10976 error += 4;
10977 }
10978 primeCache[hex] = error;
10979 return error;
10980}
10981
10982function DH(prime, generator, malleable) {
10983 this.setGenerator(generator);
10984 this.__prime = new BN(prime);
10985 this._prime = BN.mont(this.__prime);
10986 this._primeLen = prime.length;
10987 this._pub = undefined;
10988 this._priv = undefined;
10989 this._primeCode = undefined;
10990 if (malleable) {
10991 this.setPublicKey = setPublicKey;
10992 this.setPrivateKey = setPrivateKey;
16612 } else { 10993 } else {
16613 assert.equal(buffer.length, 1 + byteLength + byteLength, 'Invalid sequence length') 10994 this._primeCode = 8;
10995 }
10996}
10997Object.defineProperty(DH.prototype, 'verifyError', {
10998 enumerable: true,
10999 get: function () {
11000 if (typeof this._primeCode !== 'number') {
11001 this._primeCode = checkPrime(this.__prime, this.__gen);
11002 }
11003 return this._primeCode;
11004 }
11005});
11006DH.prototype.generateKeys = function () {
11007 if (!this._priv) {
11008 this._priv = new BN(randomBytes(this._primeLen));
11009 }
11010 this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();
11011 return this.getPublicKey();
11012};
16614 11013
16615 var y = BigInteger.fromBuffer(buffer.slice(1 + byteLength)) 11014DH.prototype.computeSecret = function (other) {
16616 Q = Point.fromAffine(curve, x, y) 11015 other = new BN(other);
11016 other = other.toRed(this._prime);
11017 var secret = other.redPow(this._priv).fromRed();
11018 var out = new Buffer(secret.toArray());
11019 var prime = this.getPrime();
11020 if (out.length < prime.length) {
11021 var front = new Buffer(prime.length - out.length);
11022 front.fill(0);
11023 out = Buffer.concat([front, out]);
16617 } 11024 }
11025 return out;
11026};
16618 11027
16619 Q.compressed = compressed 11028DH.prototype.getPublicKey = function getPublicKey(enc) {
16620 return Q 11029 return formatReturnValue(this._pub, enc);
11030};
11031
11032DH.prototype.getPrivateKey = function getPrivateKey(enc) {
11033 return formatReturnValue(this._priv, enc);
11034};
11035
11036DH.prototype.getPrime = function (enc) {
11037 return formatReturnValue(this.__prime, enc);
11038};
11039
11040DH.prototype.getGenerator = function (enc) {
11041 return formatReturnValue(this._gen, enc);
11042};
11043
11044DH.prototype.setGenerator = function (gen, enc) {
11045 enc = enc || 'utf8';
11046 if (!Buffer.isBuffer(gen)) {
11047 gen = new Buffer(gen, enc);
11048 }
11049 this.__gen = gen;
11050 this._gen = new BN(gen);
11051 return this;
11052};
11053
11054function formatReturnValue(bn, enc) {
11055 var buf = new Buffer(bn.toArray());
11056 if (!enc) {
11057 return buf;
11058 } else {
11059 return buf.toString(enc);
11060 }
16621} 11061}
16622 11062
16623Point.prototype.toString = function () { 11063}).call(this,require("buffer").Buffer)
16624 if (this.curve.isInfinity(this)) return '(INFINITY)' 11064},{"./generatePrime":65,"bn.js":17,"buffer":47,"miller-rabin":98,"randombytes":119}],65:[function(require,module,exports){
11065var randomBytes = require('randombytes');
11066module.exports = findPrime;
11067findPrime.simpleSieve = simpleSieve;
11068findPrime.fermatTest = fermatTest;
11069var BN = require('bn.js');
11070var TWENTYFOUR = new BN(24);
11071var MillerRabin = require('miller-rabin');
11072var millerRabin = new MillerRabin();
11073var ONE = new BN(1);
11074var TWO = new BN(2);
11075var FIVE = new BN(5);
11076var SIXTEEN = new BN(16);
11077var EIGHT = new BN(8);
11078var TEN = new BN(10);
11079var THREE = new BN(3);
11080var SEVEN = new BN(7);
11081var ELEVEN = new BN(11);
11082var FOUR = new BN(4);
11083var TWELVE = new BN(12);
11084var primes = null;
11085
11086function _getPrimes() {
11087 if (primes !== null)
11088 return primes;
11089
11090 var limit = 0x100000;
11091 var res = [];
11092 res[0] = 2;
11093 for (var i = 1, k = 3; k < limit; k += 2) {
11094 var sqrt = Math.ceil(Math.sqrt(k));
11095 for (var j = 0; j < i && res[j] <= sqrt; j++)
11096 if (k % res[j] === 0)
11097 break;
16625 11098
16626 return '(' + this.affineX.toString() + ',' + this.affineY.toString() + ')' 11099 if (i !== j && res[j] <= sqrt)
11100 continue;
11101
11102 res[i++] = k;
11103 }
11104 primes = res;
11105 return res;
16627} 11106}
16628 11107
16629module.exports = Point 11108function simpleSieve(p) {
11109 var primes = _getPrimes();
16630 11110
16631}).call(this,require("buffer").Buffer) 11111 for (var i = 0; i < primes.length; i++)
16632},{"assert":1,"bigi":39,"buffer":5}],97:[function(require,module,exports){ 11112 if (p.modn(primes[i]) === 0) {
11113 if (p.cmpn(primes[i]) === 0) {
11114 return true;
11115 } else {
11116 return false;
11117 }
11118 }
11119
11120 return true;
11121}
11122
11123function fermatTest(p) {
11124 var red = BN.mont(p);
11125 return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;
11126}
11127
11128function findPrime(bits, gen) {
11129 if (bits < 16) {
11130 // this is what openssl does
11131 if (gen === 2 || gen === 5) {
11132 return new BN([0x8c, 0x7b]);
11133 } else {
11134 return new BN([0x8c, 0x27]);
11135 }
11136 }
11137 gen = new BN(gen);
11138
11139 var num, n2;
11140
11141 while (true) {
11142 num = new BN(randomBytes(Math.ceil(bits / 8)));
11143 while (num.bitLength() > bits) {
11144 num.ishrn(1);
11145 }
11146 if (num.isEven()) {
11147 num.iadd(ONE);
11148 }
11149 if (!num.testn(1)) {
11150 num.iadd(TWO);
11151 }
11152 if (!gen.cmp(TWO)) {
11153 while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {
11154 num.iadd(FOUR);
11155 }
11156 } else if (!gen.cmp(FIVE)) {
11157 while (num.mod(TEN).cmp(THREE)) {
11158 num.iadd(FOUR);
11159 }
11160 }
11161 n2 = num.shrn(1);
11162 if (simpleSieve(n2) && simpleSieve(num) &&
11163 fermatTest(n2) && fermatTest(num) &&
11164 millerRabin.test(n2) && millerRabin.test(num)) {
11165 return num;
11166 }
11167 }
11168
11169}
11170
11171},{"bn.js":17,"miller-rabin":98,"randombytes":119}],66:[function(require,module,exports){
11172module.exports={
11173 "modp1": {
11174 "gen": "02",
11175 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"
11176 },
11177 "modp2": {
11178 "gen": "02",
11179 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"
11180 },
11181 "modp5": {
11182 "gen": "02",
11183 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"
11184 },
11185 "modp14": {
11186 "gen": "02",
11187 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"
11188 },
11189 "modp15": {
11190 "gen": "02",
11191 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"
11192 },
11193 "modp16": {
11194 "gen": "02",
11195 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"
11196 },
11197 "modp17": {
11198 "gen": "02",
11199 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"
11200 },
11201 "modp18": {
11202 "gen": "02",
11203 "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"
11204 }
11205}
11206},{}],67:[function(require,module,exports){
16633'use strict'; 11207'use strict';
16634 11208
16635var elliptic = exports; 11209var elliptic = exports;
@@ -16644,7 +11218,7 @@ elliptic.curves = require('./elliptic/curves');
16644elliptic.ec = require('./elliptic/ec'); 11218elliptic.ec = require('./elliptic/ec');
16645elliptic.eddsa = require('./elliptic/eddsa'); 11219elliptic.eddsa = require('./elliptic/eddsa');
16646 11220
16647},{"../package.json":112,"./elliptic/curve":100,"./elliptic/curves":103,"./elliptic/ec":104,"./elliptic/eddsa":107,"./elliptic/utils":111,"brorand":82}],98:[function(require,module,exports){ 11221},{"../package.json":82,"./elliptic/curve":70,"./elliptic/curves":73,"./elliptic/ec":74,"./elliptic/eddsa":77,"./elliptic/utils":81,"brorand":18}],68:[function(require,module,exports){
16648'use strict'; 11222'use strict';
16649 11223
16650var BN = require('bn.js'); 11224var BN = require('bn.js');
@@ -17021,7 +11595,7 @@ BasePoint.prototype.dblp = function dblp(k) {
17021 return r; 11595 return r;
17022}; 11596};
17023 11597
17024},{"../../elliptic":97,"bn.js":81}],99:[function(require,module,exports){ 11598},{"../../elliptic":67,"bn.js":17}],69:[function(require,module,exports){
17025'use strict'; 11599'use strict';
17026 11600
17027var curve = require('../curve'); 11601var curve = require('../curve');
@@ -17456,7 +12030,7 @@ Point.prototype.eqXToP = function eqXToP(x) {
17456Point.prototype.toP = Point.prototype.normalize; 12030Point.prototype.toP = Point.prototype.normalize;
17457Point.prototype.mixedAdd = Point.prototype.add; 12031Point.prototype.mixedAdd = Point.prototype.add;
17458 12032
17459},{"../../elliptic":97,"../curve":100,"bn.js":81,"inherits":121}],100:[function(require,module,exports){ 12033},{"../../elliptic":67,"../curve":70,"bn.js":17,"inherits":95}],70:[function(require,module,exports){
17460'use strict'; 12034'use strict';
17461 12035
17462var curve = exports; 12036var curve = exports;
@@ -17466,7 +12040,7 @@ curve.short = require('./short');
17466curve.mont = require('./mont'); 12040curve.mont = require('./mont');
17467curve.edwards = require('./edwards'); 12041curve.edwards = require('./edwards');
17468 12042
17469},{"./base":98,"./edwards":99,"./mont":101,"./short":102}],101:[function(require,module,exports){ 12043},{"./base":68,"./edwards":69,"./mont":71,"./short":72}],71:[function(require,module,exports){
17470'use strict'; 12044'use strict';
17471 12045
17472var curve = require('../curve'); 12046var curve = require('../curve');
@@ -17648,7 +12222,7 @@ Point.prototype.getX = function getX() {
17648 return this.x.fromRed(); 12222 return this.x.fromRed();
17649}; 12223};
17650 12224
17651},{"../../elliptic":97,"../curve":100,"bn.js":81,"inherits":121}],102:[function(require,module,exports){ 12225},{"../../elliptic":67,"../curve":70,"bn.js":17,"inherits":95}],72:[function(require,module,exports){
17652'use strict'; 12226'use strict';
17653 12227
17654var curve = require('../curve'); 12228var curve = require('../curve');
@@ -18588,7 +13162,7 @@ JPoint.prototype.isInfinity = function isInfinity() {
18588 return this.z.cmpn(0) === 0; 13162 return this.z.cmpn(0) === 0;
18589}; 13163};
18590 13164
18591},{"../../elliptic":97,"../curve":100,"bn.js":81,"inherits":121}],103:[function(require,module,exports){ 13165},{"../../elliptic":67,"../curve":70,"bn.js":17,"inherits":95}],73:[function(require,module,exports){
18592'use strict'; 13166'use strict';
18593 13167
18594var curves = exports; 13168var curves = exports;
@@ -18795,7 +13369,7 @@ defineCurve('secp256k1', {
18795 ] 13369 ]
18796}); 13370});
18797 13371
18798},{"../elliptic":97,"./precomputed/secp256k1":110,"hash.js":114}],104:[function(require,module,exports){ 13372},{"../elliptic":67,"./precomputed/secp256k1":80,"hash.js":86}],74:[function(require,module,exports){
18799'use strict'; 13373'use strict';
18800 13374
18801var BN = require('bn.js'); 13375var BN = require('bn.js');
@@ -19037,7 +13611,7 @@ EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
19037 throw new Error('Unable to find valid recovery factor'); 13611 throw new Error('Unable to find valid recovery factor');
19038}; 13612};
19039 13613
19040},{"../../elliptic":97,"./key":105,"./signature":106,"bn.js":81,"hmac-drbg":120}],105:[function(require,module,exports){ 13614},{"../../elliptic":67,"./key":75,"./signature":76,"bn.js":17,"hmac-drbg":92}],75:[function(require,module,exports){
19041'use strict'; 13615'use strict';
19042 13616
19043var BN = require('bn.js'); 13617var BN = require('bn.js');
@@ -19158,7 +13732,7 @@ KeyPair.prototype.inspect = function inspect() {
19158 ' pub: ' + (this.pub && this.pub.inspect()) + ' >'; 13732 ' pub: ' + (this.pub && this.pub.inspect()) + ' >';
19159}; 13733};
19160 13734
19161},{"../../elliptic":97,"bn.js":81}],106:[function(require,module,exports){ 13735},{"../../elliptic":67,"bn.js":17}],76:[function(require,module,exports){
19162'use strict'; 13736'use strict';
19163 13737
19164var BN = require('bn.js'); 13738var BN = require('bn.js');
@@ -19295,7 +13869,7 @@ Signature.prototype.toDER = function toDER(enc) {
19295 return utils.encode(res, enc); 13869 return utils.encode(res, enc);
19296}; 13870};
19297 13871
19298},{"../../elliptic":97,"bn.js":81}],107:[function(require,module,exports){ 13872},{"../../elliptic":67,"bn.js":17}],77:[function(require,module,exports){
19299'use strict'; 13873'use strict';
19300 13874
19301var hash = require('hash.js'); 13875var hash = require('hash.js');
@@ -19415,7 +13989,7 @@ EDDSA.prototype.isPoint = function isPoint(val) {
19415 return val instanceof this.pointClass; 13989 return val instanceof this.pointClass;
19416}; 13990};
19417 13991
19418},{"../../elliptic":97,"./key":108,"./signature":109,"hash.js":114}],108:[function(require,module,exports){ 13992},{"../../elliptic":67,"./key":78,"./signature":79,"hash.js":86}],78:[function(require,module,exports){
19419'use strict'; 13993'use strict';
19420 13994
19421var elliptic = require('../../elliptic'); 13995var elliptic = require('../../elliptic');
@@ -19513,7 +14087,7 @@ KeyPair.prototype.getPublic = function getPublic(enc) {
19513 14087
19514module.exports = KeyPair; 14088module.exports = KeyPair;
19515 14089
19516},{"../../elliptic":97}],109:[function(require,module,exports){ 14090},{"../../elliptic":67}],79:[function(require,module,exports){
19517'use strict'; 14091'use strict';
19518 14092
19519var BN = require('bn.js'); 14093var BN = require('bn.js');
@@ -19581,7 +14155,7 @@ Signature.prototype.toHex = function toHex() {
19581 14155
19582module.exports = Signature; 14156module.exports = Signature;
19583 14157
19584},{"../../elliptic":97,"bn.js":81}],110:[function(require,module,exports){ 14158},{"../../elliptic":67,"bn.js":17}],80:[function(require,module,exports){
19585module.exports = { 14159module.exports = {
19586 doubles: { 14160 doubles: {
19587 step: 4, 14161 step: 4,
@@ -20363,7 +14937,7 @@ module.exports = {
20363 } 14937 }
20364}; 14938};
20365 14939
20366},{}],111:[function(require,module,exports){ 14940},{}],81:[function(require,module,exports){
20367'use strict'; 14941'use strict';
20368 14942
20369var utils = exports; 14943var utils = exports;
@@ -20485,19 +15059,19 @@ function intFromLE(bytes) {
20485utils.intFromLE = intFromLE; 15059utils.intFromLE = intFromLE;
20486 15060
20487 15061
20488},{"bn.js":81,"minimalistic-assert":123,"minimalistic-crypto-utils":124}],112:[function(require,module,exports){ 15062},{"bn.js":17,"minimalistic-assert":99,"minimalistic-crypto-utils":100}],82:[function(require,module,exports){
20489module.exports={ 15063module.exports={
20490 "_args": [ 15064 "_args": [
20491 [ 15065 [
20492 "elliptic", 15066 "elliptic@^6.0.0",
20493 "/home/ian/git/bitcoin/bitcoinjs-lib-browser" 15067 "/home/ian/.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/browserify-sign"
20494 ] 15068 ]
20495 ], 15069 ],
20496 "_from": "elliptic@latest", 15070 "_from": "elliptic@>=6.0.0 <7.0.0",
20497 "_id": "elliptic@6.4.0", 15071 "_id": "elliptic@6.4.0",
20498 "_inCache": true, 15072 "_inCache": true,
20499 "_installable": true, 15073 "_installable": true,
20500 "_location": "/elliptic", 15074 "_location": "/browserify/elliptic",
20501 "_nodeVersion": "7.0.0", 15075 "_nodeVersion": "7.0.0",
20502 "_npmOperationalInternal": { 15076 "_npmOperationalInternal": {
20503 "host": "packages-18-east.internal.npmjs.com", 15077 "host": "packages-18-east.internal.npmjs.com",
@@ -20511,20 +15085,21 @@ module.exports={
20511 "_phantomChildren": {}, 15085 "_phantomChildren": {},
20512 "_requested": { 15086 "_requested": {
20513 "name": "elliptic", 15087 "name": "elliptic",
20514 "raw": "elliptic", 15088 "raw": "elliptic@^6.0.0",
20515 "rawSpec": "", 15089 "rawSpec": "^6.0.0",
20516 "scope": null, 15090 "scope": null,
20517 "spec": "latest", 15091 "spec": ">=6.0.0 <7.0.0",
20518 "type": "tag" 15092 "type": "range"
20519 }, 15093 },
20520 "_requiredBy": [ 15094 "_requiredBy": [
20521 "#USER" 15095 "/browserify/browserify-sign",
15096 "/browserify/create-ecdh"
20522 ], 15097 ],
20523 "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", 15098 "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",
20524 "_shasum": "cac9af8762c85836187003c8dfe193e5e2eae5df", 15099 "_shasum": "cac9af8762c85836187003c8dfe193e5e2eae5df",
20525 "_shrinkwrap": null, 15100 "_shrinkwrap": null,
20526 "_spec": "elliptic", 15101 "_spec": "elliptic@^6.0.0",
20527 "_where": "/home/ian/git/bitcoin/bitcoinjs-lib-browser", 15102 "_where": "/home/ian/.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/browserify-sign",
20528 "author": { 15103 "author": {
20529 "email": "fedor@indutny.com", 15104 "email": "fedor@indutny.com",
20530 "name": "Fedor Indutny" 15105 "name": "Fedor Indutny"
@@ -20600,7 +15175,383 @@ module.exports={
20600 "version": "6.4.0" 15175 "version": "6.4.0"
20601} 15176}
20602 15177
20603},{}],113:[function(require,module,exports){ 15178},{}],83:[function(require,module,exports){
15179// Copyright Joyent, Inc. and other Node contributors.
15180//
15181// Permission is hereby granted, free of charge, to any person obtaining a
15182// copy of this software and associated documentation files (the
15183// "Software"), to deal in the Software without restriction, including
15184// without limitation the rights to use, copy, modify, merge, publish,
15185// distribute, sublicense, and/or sell copies of the Software, and to permit
15186// persons to whom the Software is furnished to do so, subject to the
15187// following conditions:
15188//
15189// The above copyright notice and this permission notice shall be included
15190// in all copies or substantial portions of the Software.
15191//
15192// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15193// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15194// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
15195// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15196// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15197// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
15198// USE OR OTHER DEALINGS IN THE SOFTWARE.
15199
15200function EventEmitter() {
15201 this._events = this._events || {};
15202 this._maxListeners = this._maxListeners || undefined;
15203}
15204module.exports = EventEmitter;
15205
15206// Backwards-compat with node 0.10.x
15207EventEmitter.EventEmitter = EventEmitter;
15208
15209EventEmitter.prototype._events = undefined;
15210EventEmitter.prototype._maxListeners = undefined;
15211
15212// By default EventEmitters will print a warning if more than 10 listeners are
15213// added to it. This is a useful default which helps finding memory leaks.
15214EventEmitter.defaultMaxListeners = 10;
15215
15216// Obviously not all Emitters should be limited to 10. This function allows
15217// that to be increased. Set to zero for unlimited.
15218EventEmitter.prototype.setMaxListeners = function(n) {
15219 if (!isNumber(n) || n < 0 || isNaN(n))
15220 throw TypeError('n must be a positive number');
15221 this._maxListeners = n;
15222 return this;
15223};
15224
15225EventEmitter.prototype.emit = function(type) {
15226 var er, handler, len, args, i, listeners;
15227
15228 if (!this._events)
15229 this._events = {};
15230
15231 // If there is no 'error' event listener then throw.
15232 if (type === 'error') {
15233 if (!this._events.error ||
15234 (isObject(this._events.error) && !this._events.error.length)) {
15235 er = arguments[1];
15236 if (er instanceof Error) {
15237 throw er; // Unhandled 'error' event
15238 } else {
15239 // At least give some kind of context to the user
15240 var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
15241 err.context = er;
15242 throw err;
15243 }
15244 }
15245 }
15246
15247 handler = this._events[type];
15248
15249 if (isUndefined(handler))
15250 return false;
15251
15252 if (isFunction(handler)) {
15253 switch (arguments.length) {
15254 // fast cases
15255 case 1:
15256 handler.call(this);
15257 break;
15258 case 2:
15259 handler.call(this, arguments[1]);
15260 break;
15261 case 3:
15262 handler.call(this, arguments[1], arguments[2]);
15263 break;
15264 // slower
15265 default:
15266 args = Array.prototype.slice.call(arguments, 1);
15267 handler.apply(this, args);
15268 }
15269 } else if (isObject(handler)) {
15270 args = Array.prototype.slice.call(arguments, 1);
15271 listeners = handler.slice();
15272 len = listeners.length;
15273 for (i = 0; i < len; i++)
15274 listeners[i].apply(this, args);
15275 }
15276
15277 return true;
15278};
15279
15280EventEmitter.prototype.addListener = function(type, listener) {
15281 var m;
15282
15283 if (!isFunction(listener))
15284 throw TypeError('listener must be a function');
15285
15286 if (!this._events)
15287 this._events = {};
15288
15289 // To avoid recursion in the case that type === "newListener"! Before
15290 // adding it to the listeners, first emit "newListener".
15291 if (this._events.newListener)
15292 this.emit('newListener', type,
15293 isFunction(listener.listener) ?
15294 listener.listener : listener);
15295
15296 if (!this._events[type])
15297 // Optimize the case of one listener. Don't need the extra array object.
15298 this._events[type] = listener;
15299 else if (isObject(this._events[type]))
15300 // If we've already got an array, just append.
15301 this._events[type].push(listener);
15302 else
15303 // Adding the second element, need to change to array.
15304 this._events[type] = [this._events[type], listener];
15305
15306 // Check for listener leak
15307 if (isObject(this._events[type]) && !this._events[type].warned) {
15308 if (!isUndefined(this._maxListeners)) {
15309 m = this._maxListeners;
15310 } else {
15311 m = EventEmitter.defaultMaxListeners;
15312 }
15313
15314 if (m && m > 0 && this._events[type].length > m) {
15315 this._events[type].warned = true;
15316 console.error('(node) warning: possible EventEmitter memory ' +
15317 'leak detected. %d listeners added. ' +
15318 'Use emitter.setMaxListeners() to increase limit.',
15319 this._events[type].length);
15320 if (typeof console.trace === 'function') {
15321 // not supported in IE 10
15322 console.trace();
15323 }
15324 }
15325 }
15326
15327 return this;
15328};
15329
15330EventEmitter.prototype.on = EventEmitter.prototype.addListener;
15331
15332EventEmitter.prototype.once = function(type, listener) {
15333 if (!isFunction(listener))
15334 throw TypeError('listener must be a function');
15335
15336 var fired = false;
15337
15338 function g() {
15339 this.removeListener(type, g);
15340
15341 if (!fired) {
15342 fired = true;
15343 listener.apply(this, arguments);
15344 }
15345 }
15346
15347 g.listener = listener;
15348 this.on(type, g);
15349
15350 return this;
15351};
15352
15353// emits a 'removeListener' event iff the listener was removed
15354EventEmitter.prototype.removeListener = function(type, listener) {
15355 var list, position, length, i;
15356
15357 if (!isFunction(listener))
15358 throw TypeError('listener must be a function');
15359
15360 if (!this._events || !this._events[type])
15361 return this;
15362
15363 list = this._events[type];
15364 length = list.length;
15365 position = -1;
15366
15367 if (list === listener ||
15368 (isFunction(list.listener) && list.listener === listener)) {
15369 delete this._events[type];
15370 if (this._events.removeListener)
15371 this.emit('removeListener', type, listener);
15372
15373 } else if (isObject(list)) {
15374 for (i = length; i-- > 0;) {
15375 if (list[i] === listener ||
15376 (list[i].listener && list[i].listener === listener)) {
15377 position = i;
15378 break;
15379 }
15380 }
15381
15382 if (position < 0)
15383 return this;
15384
15385 if (list.length === 1) {
15386 list.length = 0;
15387 delete this._events[type];
15388 } else {
15389 list.splice(position, 1);
15390 }
15391
15392 if (this._events.removeListener)
15393 this.emit('removeListener', type, listener);
15394 }
15395
15396 return this;
15397};
15398
15399EventEmitter.prototype.removeAllListeners = function(type) {
15400 var key, listeners;
15401
15402 if (!this._events)
15403 return this;
15404
15405 // not listening for removeListener, no need to emit
15406 if (!this._events.removeListener) {
15407 if (arguments.length === 0)
15408 this._events = {};
15409 else if (this._events[type])
15410 delete this._events[type];
15411 return this;
15412 }
15413
15414 // emit removeListener for all listeners on all events
15415 if (arguments.length === 0) {
15416 for (key in this._events) {
15417 if (key === 'removeListener') continue;
15418 this.removeAllListeners(key);
15419 }
15420 this.removeAllListeners('removeListener');
15421 this._events = {};
15422 return this;
15423 }
15424
15425 listeners = this._events[type];
15426
15427 if (isFunction(listeners)) {
15428 this.removeListener(type, listeners);
15429 } else if (listeners) {
15430 // LIFO order
15431 while (listeners.length)
15432 this.removeListener(type, listeners[listeners.length - 1]);
15433 }
15434 delete this._events[type];
15435
15436 return this;
15437};
15438
15439EventEmitter.prototype.listeners = function(type) {
15440 var ret;
15441 if (!this._events || !this._events[type])
15442 ret = [];
15443 else if (isFunction(this._events[type]))
15444 ret = [this._events[type]];
15445 else
15446 ret = this._events[type].slice();
15447 return ret;
15448};
15449
15450EventEmitter.prototype.listenerCount = function(type) {
15451 if (this._events) {
15452 var evlistener = this._events[type];
15453
15454 if (isFunction(evlistener))
15455 return 1;
15456 else if (evlistener)
15457 return evlistener.length;
15458 }
15459 return 0;
15460};
15461
15462EventEmitter.listenerCount = function(emitter, type) {
15463 return emitter.listenerCount(type);
15464};
15465
15466function isFunction(arg) {
15467 return typeof arg === 'function';
15468}
15469
15470function isNumber(arg) {
15471 return typeof arg === 'number';
15472}
15473
15474function isObject(arg) {
15475 return typeof arg === 'object' && arg !== null;
15476}
15477
15478function isUndefined(arg) {
15479 return arg === void 0;
15480}
15481
15482},{}],84:[function(require,module,exports){
15483(function (Buffer){
15484var md5 = require('create-hash/md5')
15485module.exports = EVP_BytesToKey
15486function EVP_BytesToKey (password, salt, keyLen, ivLen) {
15487 if (!Buffer.isBuffer(password)) {
15488 password = new Buffer(password, 'binary')
15489 }
15490 if (salt && !Buffer.isBuffer(salt)) {
15491 salt = new Buffer(salt, 'binary')
15492 }
15493 keyLen = keyLen / 8
15494 ivLen = ivLen || 0
15495 var ki = 0
15496 var ii = 0
15497 var key = new Buffer(keyLen)
15498 var iv = new Buffer(ivLen)
15499 var addmd = 0
15500 var md_buf
15501 var i
15502 var bufs = []
15503 while (true) {
15504 if (addmd++ > 0) {
15505 bufs.push(md_buf)
15506 }
15507 bufs.push(password)
15508 if (salt) {
15509 bufs.push(salt)
15510 }
15511 md_buf = md5(Buffer.concat(bufs))
15512 bufs = []
15513 i = 0
15514 if (keyLen > 0) {
15515 while (true) {
15516 if (keyLen === 0) {
15517 break
15518 }
15519 if (i === md_buf.length) {
15520 break
15521 }
15522 key[ki++] = md_buf[i]
15523 keyLen--
15524 i++
15525 }
15526 }
15527 if (ivLen > 0 && i !== md_buf.length) {
15528 while (true) {
15529 if (ivLen === 0) {
15530 break
15531 }
15532 if (i === md_buf.length) {
15533 break
15534 }
15535 iv[ii++] = md_buf[i]
15536 ivLen--
15537 i++
15538 }
15539 }
15540 if (keyLen === 0 && ivLen === 0) {
15541 break
15542 }
15543 }
15544 for (i = 0; i < md_buf.length; i++) {
15545 md_buf[i] = 0
15546 }
15547 return {
15548 key: key,
15549 iv: iv
15550 }
15551}
15552
15553}).call(this,require("buffer").Buffer)
15554},{"buffer":47,"create-hash/md5":53}],85:[function(require,module,exports){
20604(function (Buffer){ 15555(function (Buffer){
20605'use strict' 15556'use strict'
20606var Transform = require('stream').Transform 15557var Transform = require('stream').Transform
@@ -20687,7 +15638,7 @@ HashBase.prototype._digest = function () {
20687module.exports = HashBase 15638module.exports = HashBase
20688 15639
20689}).call(this,require("buffer").Buffer) 15640}).call(this,require("buffer").Buffer)
20690},{"buffer":5,"inherits":121,"stream":28}],114:[function(require,module,exports){ 15641},{"buffer":47,"inherits":95,"stream":143}],86:[function(require,module,exports){
20691var hash = exports; 15642var hash = exports;
20692 15643
20693hash.utils = require('./hash/utils'); 15644hash.utils = require('./hash/utils');
@@ -20704,7 +15655,7 @@ hash.sha384 = hash.sha.sha384;
20704hash.sha512 = hash.sha.sha512; 15655hash.sha512 = hash.sha.sha512;
20705hash.ripemd160 = hash.ripemd.ripemd160; 15656hash.ripemd160 = hash.ripemd.ripemd160;
20706 15657
20707},{"./hash/common":115,"./hash/hmac":116,"./hash/ripemd":117,"./hash/sha":118,"./hash/utils":119}],115:[function(require,module,exports){ 15658},{"./hash/common":87,"./hash/hmac":88,"./hash/ripemd":89,"./hash/sha":90,"./hash/utils":91}],87:[function(require,module,exports){
20708var hash = require('../hash'); 15659var hash = require('../hash');
20709var utils = hash.utils; 15660var utils = hash.utils;
20710var assert = utils.assert; 15661var assert = utils.assert;
@@ -20797,7 +15748,7 @@ BlockHash.prototype._pad = function pad() {
20797 return res; 15748 return res;
20798}; 15749};
20799 15750
20800},{"../hash":114}],116:[function(require,module,exports){ 15751},{"../hash":86}],88:[function(require,module,exports){
20801var hmac = exports; 15752var hmac = exports;
20802 15753
20803var hash = require('../hash'); 15754var hash = require('../hash');
@@ -20847,7 +15798,7 @@ Hmac.prototype.digest = function digest(enc) {
20847 return this.outer.digest(enc); 15798 return this.outer.digest(enc);
20848}; 15799};
20849 15800
20850},{"../hash":114}],117:[function(require,module,exports){ 15801},{"../hash":86}],89:[function(require,module,exports){
20851var hash = require('../hash'); 15802var hash = require('../hash');
20852var utils = hash.utils; 15803var utils = hash.utils;
20853 15804
@@ -20993,7 +15944,7 @@ var sh = [
20993 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 15944 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
20994]; 15945];
20995 15946
20996},{"../hash":114}],118:[function(require,module,exports){ 15947},{"../hash":86}],90:[function(require,module,exports){
20997var hash = require('../hash'); 15948var hash = require('../hash');
20998var utils = hash.utils; 15949var utils = hash.utils;
20999var assert = utils.assert; 15950var assert = utils.assert;
@@ -21559,7 +16510,7 @@ function g1_512_lo(xh, xl) {
21559 return r; 16510 return r;
21560} 16511}
21561 16512
21562},{"../hash":114}],119:[function(require,module,exports){ 16513},{"../hash":86}],91:[function(require,module,exports){
21563var utils = exports; 16514var utils = exports;
21564var inherits = require('inherits'); 16515var inherits = require('inherits');
21565 16516
@@ -21818,7 +16769,7 @@ function shr64_lo(ah, al, num) {
21818}; 16769};
21819exports.shr64_lo = shr64_lo; 16770exports.shr64_lo = shr64_lo;
21820 16771
21821},{"inherits":121}],120:[function(require,module,exports){ 16772},{"inherits":95}],92:[function(require,module,exports){
21822'use strict'; 16773'use strict';
21823 16774
21824var hash = require('hash.js'); 16775var hash = require('hash.js');
@@ -21933,37 +16884,274 @@ HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
21933 return utils.encode(res, enc); 16884 return utils.encode(res, enc);
21934}; 16885};
21935 16886
21936},{"hash.js":114,"minimalistic-assert":123,"minimalistic-crypto-utils":124}],121:[function(require,module,exports){ 16887},{"hash.js":86,"minimalistic-assert":99,"minimalistic-crypto-utils":100}],93:[function(require,module,exports){
21937arguments[4][9][0].apply(exports,arguments) 16888exports.read = function (buffer, offset, isLE, mLen, nBytes) {
21938},{"dup":9}],122:[function(require,module,exports){ 16889 var e, m
21939(function (Buffer){ 16890 var eLen = nBytes * 8 - mLen - 1
21940// constant-space merkle root calculation algorithm 16891 var eMax = (1 << eLen) - 1
21941module.exports = function fastRoot (values, digestFn) { 16892 var eBias = eMax >> 1
21942 if (!Array.isArray(values)) throw TypeError('Expected values Array') 16893 var nBits = -7
21943 if (typeof digestFn !== 'function') throw TypeError('Expected digest Function') 16894 var i = isLE ? (nBytes - 1) : 0
16895 var d = isLE ? -1 : 1
16896 var s = buffer[offset + i]
21944 16897
21945 var length = values.length 16898 i += d
21946 var results = values.concat()
21947 16899
21948 while (length > 1) { 16900 e = s & ((1 << (-nBits)) - 1)
21949 var j = 0 16901 s >>= (-nBits)
16902 nBits += eLen
16903 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
16904
16905 m = e & ((1 << (-nBits)) - 1)
16906 e >>= (-nBits)
16907 nBits += mLen
16908 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
21950 16909
21951 for (var i = 0; i < length; i += 2, ++j) { 16910 if (e === 0) {
21952 var left = results[i] 16911 e = 1 - eBias
21953 var right = i + 1 === length ? left : results[i + 1] 16912 } else if (e === eMax) {
21954 var data = Buffer.concat([left, right]) 16913 return m ? NaN : ((s ? -1 : 1) * Infinity)
16914 } else {
16915 m = m + Math.pow(2, mLen)
16916 e = e - eBias
16917 }
16918 return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
16919}
16920
16921exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
16922 var e, m, c
16923 var eLen = nBytes * 8 - mLen - 1
16924 var eMax = (1 << eLen) - 1
16925 var eBias = eMax >> 1
16926 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
16927 var i = isLE ? 0 : (nBytes - 1)
16928 var d = isLE ? 1 : -1
16929 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
16930
16931 value = Math.abs(value)
21955 16932
21956 results[j] = digestFn(data) 16933 if (isNaN(value) || value === Infinity) {
16934 m = isNaN(value) ? 1 : 0
16935 e = eMax
16936 } else {
16937 e = Math.floor(Math.log(value) / Math.LN2)
16938 if (value * (c = Math.pow(2, -e)) < 1) {
16939 e--
16940 c *= 2
16941 }
16942 if (e + eBias >= 1) {
16943 value += rt / c
16944 } else {
16945 value += rt * Math.pow(2, 1 - eBias)
16946 }
16947 if (value * c >= 2) {
16948 e++
16949 c /= 2
21957 } 16950 }
21958 16951
21959 length = j 16952 if (e + eBias >= eMax) {
16953 m = 0
16954 e = eMax
16955 } else if (e + eBias >= 1) {
16956 m = (value * c - 1) * Math.pow(2, mLen)
16957 e = e + eBias
16958 } else {
16959 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
16960 e = 0
16961 }
21960 } 16962 }
21961 16963
21962 return results[0] 16964 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
16965
16966 e = (e << mLen) | m
16967 eLen += mLen
16968 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
16969
16970 buffer[offset + i - d] |= s * 128
21963} 16971}
21964 16972
21965}).call(this,require("buffer").Buffer) 16973},{}],94:[function(require,module,exports){
21966},{"buffer":5}],123:[function(require,module,exports){ 16974
16975var indexOf = [].indexOf;
16976
16977module.exports = function(arr, obj){
16978 if (indexOf) return arr.indexOf(obj);
16979 for (var i = 0; i < arr.length; ++i) {
16980 if (arr[i] === obj) return i;
16981 }
16982 return -1;
16983};
16984},{}],95:[function(require,module,exports){
16985if (typeof Object.create === 'function') {
16986 // implementation from standard node.js 'util' module
16987 module.exports = function inherits(ctor, superCtor) {
16988 ctor.super_ = superCtor
16989 ctor.prototype = Object.create(superCtor.prototype, {
16990 constructor: {
16991 value: ctor,
16992 enumerable: false,
16993 writable: true,
16994 configurable: true
16995 }
16996 });
16997 };
16998} else {
16999 // old school shim for old browsers
17000 module.exports = function inherits(ctor, superCtor) {
17001 ctor.super_ = superCtor
17002 var TempCtor = function () {}
17003 TempCtor.prototype = superCtor.prototype
17004 ctor.prototype = new TempCtor()
17005 ctor.prototype.constructor = ctor
17006 }
17007}
17008
17009},{}],96:[function(require,module,exports){
17010/*!
17011 * Determine if an object is a Buffer
17012 *
17013 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
17014 * @license MIT
17015 */
17016
17017// The _isBuffer check is for Safari 5-7 support, because it's missing
17018// Object.prototype.constructor. Remove this eventually
17019module.exports = function (obj) {
17020 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
17021}
17022
17023function isBuffer (obj) {
17024 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
17025}
17026
17027// For Node v0.10 support. Remove this eventually.
17028function isSlowBuffer (obj) {
17029 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
17030}
17031
17032},{}],97:[function(require,module,exports){
17033var toString = {}.toString;
17034
17035module.exports = Array.isArray || function (arr) {
17036 return toString.call(arr) == '[object Array]';
17037};
17038
17039},{}],98:[function(require,module,exports){
17040var bn = require('bn.js');
17041var brorand = require('brorand');
17042
17043function MillerRabin(rand) {
17044 this.rand = rand || new brorand.Rand();
17045}
17046module.exports = MillerRabin;
17047
17048MillerRabin.create = function create(rand) {
17049 return new MillerRabin(rand);
17050};
17051
17052MillerRabin.prototype._rand = function _rand(n) {
17053 var len = n.bitLength();
17054 var buf = this.rand.generate(Math.ceil(len / 8));
17055
17056 // Set low bits
17057 buf[0] |= 3;
17058
17059 // Mask high bits
17060 var mask = len & 0x7;
17061 if (mask !== 0)
17062 buf[buf.length - 1] >>= 7 - mask;
17063
17064 return new bn(buf);
17065}
17066
17067MillerRabin.prototype.test = function test(n, k, cb) {
17068 var len = n.bitLength();
17069 var red = bn.mont(n);
17070 var rone = new bn(1).toRed(red);
17071
17072 if (!k)
17073 k = Math.max(1, (len / 48) | 0);
17074
17075 // Find d and s, (n - 1) = (2 ^ s) * d;
17076 var n1 = n.subn(1);
17077 var n2 = n1.subn(1);
17078 for (var s = 0; !n1.testn(s); s++) {}
17079 var d = n.shrn(s);
17080
17081 var rn1 = n1.toRed(red);
17082
17083 var prime = true;
17084 for (; k > 0; k--) {
17085 var a = this._rand(n2);
17086 if (cb)
17087 cb(a);
17088
17089 var x = a.toRed(red).redPow(d);
17090 if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
17091 continue;
17092
17093 for (var i = 1; i < s; i++) {
17094 x = x.redSqr();
17095
17096 if (x.cmp(rone) === 0)
17097 return false;
17098 if (x.cmp(rn1) === 0)
17099 break;
17100 }
17101
17102 if (i === s)
17103 return false;
17104 }
17105
17106 return prime;
17107};
17108
17109MillerRabin.prototype.getDivisor = function getDivisor(n, k) {
17110 var len = n.bitLength();
17111 var red = bn.mont(n);
17112 var rone = new bn(1).toRed(red);
17113
17114 if (!k)
17115 k = Math.max(1, (len / 48) | 0);
17116
17117 // Find d and s, (n - 1) = (2 ^ s) * d;
17118 var n1 = n.subn(1);
17119 var n2 = n1.subn(1);
17120 for (var s = 0; !n1.testn(s); s++) {}
17121 var d = n.shrn(s);
17122
17123 var rn1 = n1.toRed(red);
17124
17125 for (; k > 0; k--) {
17126 var a = this._rand(n2);
17127
17128 var g = n.gcd(a);
17129 if (g.cmpn(1) !== 0)
17130 return g;
17131
17132 var x = a.toRed(red).redPow(d);
17133 if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
17134 continue;
17135
17136 for (var i = 1; i < s; i++) {
17137 x = x.redSqr();
17138
17139 if (x.cmp(rone) === 0)
17140 return x.fromRed().subn(1).gcd(n);
17141 if (x.cmp(rn1) === 0)
17142 break;
17143 }
17144
17145 if (i === s) {
17146 x = x.redSqr();
17147 return x.fromRed().subn(1).gcd(n);
17148 }
17149 }
17150
17151 return false;
17152};
17153
17154},{"bn.js":17,"brorand":18}],99:[function(require,module,exports){
21967module.exports = assert; 17155module.exports = assert;
21968 17156
21969function assert(val, msg) { 17157function assert(val, msg) {
@@ -21976,7 +17164,7 @@ assert.equal = function assertEqual(l, r, msg) {
21976 throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); 17164 throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
21977}; 17165};
21978 17166
21979},{}],124:[function(require,module,exports){ 17167},{}],100:[function(require,module,exports){
21980'use strict'; 17168'use strict';
21981 17169
21982var utils = exports; 17170var utils = exports;
@@ -22036,94 +17224,1126 @@ utils.encode = function encode(arr, enc) {
22036 return arr; 17224 return arr;
22037}; 17225};
22038 17226
22039},{}],125:[function(require,module,exports){ 17227},{}],101:[function(require,module,exports){
22040var OPS = require('bitcoin-ops') 17228module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb",
17229"2.16.840.1.101.3.4.1.2": "aes-128-cbc",
17230"2.16.840.1.101.3.4.1.3": "aes-128-ofb",
17231"2.16.840.1.101.3.4.1.4": "aes-128-cfb",
17232"2.16.840.1.101.3.4.1.21": "aes-192-ecb",
17233"2.16.840.1.101.3.4.1.22": "aes-192-cbc",
17234"2.16.840.1.101.3.4.1.23": "aes-192-ofb",
17235"2.16.840.1.101.3.4.1.24": "aes-192-cfb",
17236"2.16.840.1.101.3.4.1.41": "aes-256-ecb",
17237"2.16.840.1.101.3.4.1.42": "aes-256-cbc",
17238"2.16.840.1.101.3.4.1.43": "aes-256-ofb",
17239"2.16.840.1.101.3.4.1.44": "aes-256-cfb"
17240}
17241},{}],102:[function(require,module,exports){
17242// from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js
17243// Fedor, you are amazing.
17244'use strict'
22041 17245
22042function encodingLength (i) { 17246var asn1 = require('asn1.js')
22043 return i < OPS.OP_PUSHDATA1 ? 1 17247
22044 : i <= 0xff ? 2 17248exports.certificate = require('./certificate')
22045 : i <= 0xffff ? 3 17249
22046 : 5 17250var RSAPrivateKey = asn1.define('RSAPrivateKey', function () {
22047} 17251 this.seq().obj(
17252 this.key('version').int(),
17253 this.key('modulus').int(),
17254 this.key('publicExponent').int(),
17255 this.key('privateExponent').int(),
17256 this.key('prime1').int(),
17257 this.key('prime2').int(),
17258 this.key('exponent1').int(),
17259 this.key('exponent2').int(),
17260 this.key('coefficient').int()
17261 )
17262})
17263exports.RSAPrivateKey = RSAPrivateKey
17264
17265var RSAPublicKey = asn1.define('RSAPublicKey', function () {
17266 this.seq().obj(
17267 this.key('modulus').int(),
17268 this.key('publicExponent').int()
17269 )
17270})
17271exports.RSAPublicKey = RSAPublicKey
17272
17273var PublicKey = asn1.define('SubjectPublicKeyInfo', function () {
17274 this.seq().obj(
17275 this.key('algorithm').use(AlgorithmIdentifier),
17276 this.key('subjectPublicKey').bitstr()
17277 )
17278})
17279exports.PublicKey = PublicKey
17280
17281var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {
17282 this.seq().obj(
17283 this.key('algorithm').objid(),
17284 this.key('none').null_().optional(),
17285 this.key('curve').objid().optional(),
17286 this.key('params').seq().obj(
17287 this.key('p').int(),
17288 this.key('q').int(),
17289 this.key('g').int()
17290 ).optional()
17291 )
17292})
17293
17294var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {
17295 this.seq().obj(
17296 this.key('version').int(),
17297 this.key('algorithm').use(AlgorithmIdentifier),
17298 this.key('subjectPrivateKey').octstr()
17299 )
17300})
17301exports.PrivateKey = PrivateKeyInfo
17302var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {
17303 this.seq().obj(
17304 this.key('algorithm').seq().obj(
17305 this.key('id').objid(),
17306 this.key('decrypt').seq().obj(
17307 this.key('kde').seq().obj(
17308 this.key('id').objid(),
17309 this.key('kdeparams').seq().obj(
17310 this.key('salt').octstr(),
17311 this.key('iters').int()
17312 )
17313 ),
17314 this.key('cipher').seq().obj(
17315 this.key('algo').objid(),
17316 this.key('iv').octstr()
17317 )
17318 )
17319 ),
17320 this.key('subjectPrivateKey').octstr()
17321 )
17322})
17323
17324exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo
17325
17326var DSAPrivateKey = asn1.define('DSAPrivateKey', function () {
17327 this.seq().obj(
17328 this.key('version').int(),
17329 this.key('p').int(),
17330 this.key('q').int(),
17331 this.key('g').int(),
17332 this.key('pub_key').int(),
17333 this.key('priv_key').int()
17334 )
17335})
17336exports.DSAPrivateKey = DSAPrivateKey
17337
17338exports.DSAparam = asn1.define('DSAparam', function () {
17339 this.int()
17340})
17341
17342var ECPrivateKey = asn1.define('ECPrivateKey', function () {
17343 this.seq().obj(
17344 this.key('version').int(),
17345 this.key('privateKey').octstr(),
17346 this.key('parameters').optional().explicit(0).use(ECParameters),
17347 this.key('publicKey').optional().explicit(1).bitstr()
17348 )
17349})
17350exports.ECPrivateKey = ECPrivateKey
17351
17352var ECParameters = asn1.define('ECParameters', function () {
17353 this.choice({
17354 namedCurve: this.objid()
17355 })
17356})
17357
17358exports.signature = asn1.define('signature', function () {
17359 this.seq().obj(
17360 this.key('r').int(),
17361 this.key('s').int()
17362 )
17363})
17364
17365},{"./certificate":103,"asn1.js":1}],103:[function(require,module,exports){
17366// from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js
17367// thanks to @Rantanen
17368
17369'use strict'
17370
17371var asn = require('asn1.js')
17372
17373var Time = asn.define('Time', function () {
17374 this.choice({
17375 utcTime: this.utctime(),
17376 generalTime: this.gentime()
17377 })
17378})
17379
17380var AttributeTypeValue = asn.define('AttributeTypeValue', function () {
17381 this.seq().obj(
17382 this.key('type').objid(),
17383 this.key('value').any()
17384 )
17385})
22048 17386
22049function encode (buffer, number, offset) { 17387var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {
22050 var size = encodingLength(number) 17388 this.seq().obj(
17389 this.key('algorithm').objid(),
17390 this.key('parameters').optional()
17391 )
17392})
17393
17394var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {
17395 this.seq().obj(
17396 this.key('algorithm').use(AlgorithmIdentifier),
17397 this.key('subjectPublicKey').bitstr()
17398 )
17399})
17400
17401var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {
17402 this.setof(AttributeTypeValue)
17403})
17404
17405var RDNSequence = asn.define('RDNSequence', function () {
17406 this.seqof(RelativeDistinguishedName)
17407})
17408
17409var Name = asn.define('Name', function () {
17410 this.choice({
17411 rdnSequence: this.use(RDNSequence)
17412 })
17413})
17414
17415var Validity = asn.define('Validity', function () {
17416 this.seq().obj(
17417 this.key('notBefore').use(Time),
17418 this.key('notAfter').use(Time)
17419 )
17420})
22051 17421
22052 // ~6 bit 17422var Extension = asn.define('Extension', function () {
22053 if (size === 1) { 17423 this.seq().obj(
22054 buffer.writeUInt8(number, offset) 17424 this.key('extnID').objid(),
17425 this.key('critical').bool().def(false),
17426 this.key('extnValue').octstr()
17427 )
17428})
17429
17430var TBSCertificate = asn.define('TBSCertificate', function () {
17431 this.seq().obj(
17432 this.key('version').explicit(0).int(),
17433 this.key('serialNumber').int(),
17434 this.key('signature').use(AlgorithmIdentifier),
17435 this.key('issuer').use(Name),
17436 this.key('validity').use(Validity),
17437 this.key('subject').use(Name),
17438 this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),
17439 this.key('issuerUniqueID').implicit(1).bitstr().optional(),
17440 this.key('subjectUniqueID').implicit(2).bitstr().optional(),
17441 this.key('extensions').explicit(3).seqof(Extension).optional()
17442 )
17443})
22055 17444
22056 // 8 bit 17445var X509Certificate = asn.define('X509Certificate', function () {
22057 } else if (size === 2) { 17446 this.seq().obj(
22058 buffer.writeUInt8(OPS.OP_PUSHDATA1, offset) 17447 this.key('tbsCertificate').use(TBSCertificate),
22059 buffer.writeUInt8(number, offset + 1) 17448 this.key('signatureAlgorithm').use(AlgorithmIdentifier),
17449 this.key('signatureValue').bitstr()
17450 )
17451})
22060 17452
22061 // 16 bit 17453module.exports = X509Certificate
22062 } else if (size === 3) {
22063 buffer.writeUInt8(OPS.OP_PUSHDATA2, offset)
22064 buffer.writeUInt16LE(number, offset + 1)
22065 17454
22066 // 32 bit 17455},{"asn1.js":1}],104:[function(require,module,exports){
17456(function (Buffer){
17457// adapted from https://github.com/apatil/pemstrip
17458var findProc = /Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m
17459var startRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m
17460var fullRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m
17461var evp = require('evp_bytestokey')
17462var ciphers = require('browserify-aes')
17463module.exports = function (okey, password) {
17464 var key = okey.toString()
17465 var match = key.match(findProc)
17466 var decrypted
17467 if (!match) {
17468 var match2 = key.match(fullRegex)
17469 decrypted = new Buffer(match2[2].replace(/\r?\n/g, ''), 'base64')
22067 } else { 17470 } else {
22068 buffer.writeUInt8(OPS.OP_PUSHDATA4, offset) 17471 var suite = 'aes' + match[1]
22069 buffer.writeUInt32LE(number, offset + 1) 17472 var iv = new Buffer(match[2], 'hex')
17473 var cipherText = new Buffer(match[3].replace(/\r?\n/g, ''), 'base64')
17474 var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key
17475 var out = []
17476 var cipher = ciphers.createDecipheriv(suite, cipherKey, iv)
17477 out.push(cipher.update(cipherText))
17478 out.push(cipher.final())
17479 decrypted = Buffer.concat(out)
17480 }
17481 var tag = key.match(startRegex)[1]
17482 return {
17483 tag: tag,
17484 data: decrypted
17485 }
17486}
17487
17488}).call(this,require("buffer").Buffer)
17489},{"browserify-aes":22,"buffer":47,"evp_bytestokey":84}],105:[function(require,module,exports){
17490(function (Buffer){
17491var asn1 = require('./asn1')
17492var aesid = require('./aesid.json')
17493var fixProc = require('./fixProc')
17494var ciphers = require('browserify-aes')
17495var compat = require('pbkdf2')
17496module.exports = parseKeys
17497
17498function parseKeys (buffer) {
17499 var password
17500 if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) {
17501 password = buffer.passphrase
17502 buffer = buffer.key
22070 } 17503 }
17504 if (typeof buffer === 'string') {
17505 buffer = new Buffer(buffer)
17506 }
17507
17508 var stripped = fixProc(buffer, password)
22071 17509
22072 return size 17510 var type = stripped.tag
17511 var data = stripped.data
17512 var subtype, ndata
17513 switch (type) {
17514 case 'CERTIFICATE':
17515 ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo
17516 // falls through
17517 case 'PUBLIC KEY':
17518 if (!ndata) {
17519 ndata = asn1.PublicKey.decode(data, 'der')
17520 }
17521 subtype = ndata.algorithm.algorithm.join('.')
17522 switch (subtype) {
17523 case '1.2.840.113549.1.1.1':
17524 return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der')
17525 case '1.2.840.10045.2.1':
17526 ndata.subjectPrivateKey = ndata.subjectPublicKey
17527 return {
17528 type: 'ec',
17529 data: ndata
17530 }
17531 case '1.2.840.10040.4.1':
17532 ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der')
17533 return {
17534 type: 'dsa',
17535 data: ndata.algorithm.params
17536 }
17537 default: throw new Error('unknown key id ' + subtype)
17538 }
17539 throw new Error('unknown key type ' + type)
17540 case 'ENCRYPTED PRIVATE KEY':
17541 data = asn1.EncryptedPrivateKey.decode(data, 'der')
17542 data = decrypt(data, password)
17543 // falls through
17544 case 'PRIVATE KEY':
17545 ndata = asn1.PrivateKey.decode(data, 'der')
17546 subtype = ndata.algorithm.algorithm.join('.')
17547 switch (subtype) {
17548 case '1.2.840.113549.1.1.1':
17549 return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der')
17550 case '1.2.840.10045.2.1':
17551 return {
17552 curve: ndata.algorithm.curve,
17553 privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey
17554 }
17555 case '1.2.840.10040.4.1':
17556 ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der')
17557 return {
17558 type: 'dsa',
17559 params: ndata.algorithm.params
17560 }
17561 default: throw new Error('unknown key id ' + subtype)
17562 }
17563 throw new Error('unknown key type ' + type)
17564 case 'RSA PUBLIC KEY':
17565 return asn1.RSAPublicKey.decode(data, 'der')
17566 case 'RSA PRIVATE KEY':
17567 return asn1.RSAPrivateKey.decode(data, 'der')
17568 case 'DSA PRIVATE KEY':
17569 return {
17570 type: 'dsa',
17571 params: asn1.DSAPrivateKey.decode(data, 'der')
17572 }
17573 case 'EC PRIVATE KEY':
17574 data = asn1.ECPrivateKey.decode(data, 'der')
17575 return {
17576 curve: data.parameters.value,
17577 privateKey: data.privateKey
17578 }
17579 default: throw new Error('unknown key type ' + type)
17580 }
17581}
17582parseKeys.signature = asn1.signature
17583function decrypt (data, password) {
17584 var salt = data.algorithm.decrypt.kde.kdeparams.salt
17585 var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10)
17586 var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')]
17587 var iv = data.algorithm.decrypt.cipher.iv
17588 var cipherText = data.subjectPrivateKey
17589 var keylen = parseInt(algo.split('-')[1], 10) / 8
17590 var key = compat.pbkdf2Sync(password, salt, iters, keylen)
17591 var cipher = ciphers.createDecipheriv(algo, key, iv)
17592 var out = []
17593 out.push(cipher.update(cipherText))
17594 out.push(cipher.final())
17595 return Buffer.concat(out)
22073} 17596}
22074 17597
22075function decode (buffer, offset) { 17598}).call(this,require("buffer").Buffer)
22076 var opcode = buffer.readUInt8(offset) 17599},{"./aesid.json":101,"./asn1":102,"./fixProc":104,"browserify-aes":22,"buffer":47,"pbkdf2":106}],106:[function(require,module,exports){
22077 var number, size
22078 17600
22079 // ~6 bit 17601exports.pbkdf2 = require('./lib/async')
22080 if (opcode < OPS.OP_PUSHDATA1) {
22081 number = opcode
22082 size = 1
22083 17602
22084 // 8 bit 17603exports.pbkdf2Sync = require('./lib/sync')
22085 } else if (opcode === OPS.OP_PUSHDATA1) {
22086 if (offset + 2 > buffer.length) return null
22087 number = buffer.readUInt8(offset + 1)
22088 size = 2
22089 17604
22090 // 16 bit 17605},{"./lib/async":107,"./lib/sync":110}],107:[function(require,module,exports){
22091 } else if (opcode === OPS.OP_PUSHDATA2) { 17606(function (process,global){
22092 if (offset + 3 > buffer.length) return null 17607var checkParameters = require('./precondition')
22093 number = buffer.readUInt16LE(offset + 1) 17608var defaultEncoding = require('./default-encoding')
22094 size = 3 17609var sync = require('./sync')
17610var Buffer = require('safe-buffer').Buffer
22095 17611
22096 // 32 bit 17612var ZERO_BUF
22097 } else { 17613var subtle = global.crypto && global.crypto.subtle
22098 if (offset + 5 > buffer.length) return null 17614var toBrowser = {
22099 if (opcode !== OPS.OP_PUSHDATA4) throw new Error('Unexpected opcode') 17615 'sha': 'SHA-1',
17616 'sha-1': 'SHA-1',
17617 'sha1': 'SHA-1',
17618 'sha256': 'SHA-256',
17619 'sha-256': 'SHA-256',
17620 'sha384': 'SHA-384',
17621 'sha-384': 'SHA-384',
17622 'sha-512': 'SHA-512',
17623 'sha512': 'SHA-512'
17624}
17625var checks = []
17626function checkNative (algo) {
17627 if (global.process && !global.process.browser) {
17628 return Promise.resolve(false)
17629 }
17630 if (!subtle || !subtle.importKey || !subtle.deriveBits) {
17631 return Promise.resolve(false)
17632 }
17633 if (checks[algo] !== undefined) {
17634 return checks[algo]
17635 }
17636 ZERO_BUF = ZERO_BUF || Buffer.alloc(8)
17637 var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)
17638 .then(function () {
17639 return true
17640 }).catch(function () {
17641 return false
17642 })
17643 checks[algo] = prom
17644 return prom
17645}
17646function browserPbkdf2 (password, salt, iterations, length, algo) {
17647 return subtle.importKey(
17648 'raw', password, {name: 'PBKDF2'}, false, ['deriveBits']
17649 ).then(function (key) {
17650 return subtle.deriveBits({
17651 name: 'PBKDF2',
17652 salt: salt,
17653 iterations: iterations,
17654 hash: {
17655 name: algo
17656 }
17657 }, key, length << 3)
17658 }).then(function (res) {
17659 return Buffer.from(res)
17660 })
17661}
17662function resolvePromise (promise, callback) {
17663 promise.then(function (out) {
17664 process.nextTick(function () {
17665 callback(null, out)
17666 })
17667 }, function (e) {
17668 process.nextTick(function () {
17669 callback(e)
17670 })
17671 })
17672}
17673module.exports = function (password, salt, iterations, keylen, digest, callback) {
17674 if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding)
17675 if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding)
22100 17676
22101 number = buffer.readUInt32LE(offset + 1) 17677 checkParameters(iterations, keylen)
22102 size = 5 17678 if (typeof digest === 'function') {
17679 callback = digest
17680 digest = undefined
22103 } 17681 }
17682 if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')
22104 17683
22105 return { 17684 digest = digest || 'sha1'
22106 opcode: opcode, 17685 var algo = toBrowser[digest.toLowerCase()]
22107 number: number, 17686 if (!algo || typeof global.Promise !== 'function') {
22108 size: size 17687 return process.nextTick(function () {
17688 var out
17689 try {
17690 out = sync(password, salt, iterations, keylen, digest)
17691 } catch (e) {
17692 return callback(e)
17693 }
17694 callback(null, out)
17695 })
22109 } 17696 }
17697 resolvePromise(checkNative(algo).then(function (resp) {
17698 if (resp) {
17699 return browserPbkdf2(password, salt, iterations, keylen, algo)
17700 } else {
17701 return sync(password, salt, iterations, keylen, digest)
17702 }
17703 }), callback)
22110} 17704}
22111 17705
22112module.exports = { 17706}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
22113 encodingLength: encodingLength, 17707},{"./default-encoding":108,"./precondition":109,"./sync":110,"_process":112,"safe-buffer":134}],108:[function(require,module,exports){
22114 encode: encode, 17708(function (process){
22115 decode: decode 17709var defaultEncoding
17710/* istanbul ignore next */
17711if (process.browser) {
17712 defaultEncoding = 'utf-8'
17713} else {
17714 var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)
17715
17716 defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
22116} 17717}
17718module.exports = defaultEncoding
22117 17719
22118},{"bitcoin-ops":42}],126:[function(require,module,exports){ 17720}).call(this,require('_process'))
22119(function (process,global){ 17721},{"_process":112}],109:[function(require,module,exports){
17722var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs
17723module.exports = function (iterations, keylen) {
17724 if (typeof iterations !== 'number') {
17725 throw new TypeError('Iterations not a number')
17726 }
17727
17728 if (iterations < 0) {
17729 throw new TypeError('Bad iterations')
17730 }
17731
17732 if (typeof keylen !== 'number') {
17733 throw new TypeError('Key length not a number')
17734 }
17735
17736 if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */
17737 throw new TypeError('Bad key length')
17738 }
17739}
17740
17741},{}],110:[function(require,module,exports){
17742var md5 = require('create-hash/md5')
17743var rmd160 = require('ripemd160')
17744var sha = require('sha.js')
17745
17746var checkParameters = require('./precondition')
17747var defaultEncoding = require('./default-encoding')
17748var Buffer = require('safe-buffer').Buffer
17749var ZEROS = Buffer.alloc(128)
17750var sizes = {
17751 md5: 16,
17752 sha1: 20,
17753 sha224: 28,
17754 sha256: 32,
17755 sha384: 48,
17756 sha512: 64,
17757 rmd160: 20,
17758 ripemd160: 20
17759}
17760function Hmac (alg, key, saltLen) {
17761 var hash = getDigest(alg)
17762 var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
17763
17764 if (key.length > blocksize) {
17765 key = hash(key)
17766 } else if (key.length < blocksize) {
17767 key = Buffer.concat([key, ZEROS], blocksize)
17768 }
17769
17770 var ipad = Buffer.allocUnsafe(blocksize + sizes[alg])
17771 var opad = Buffer.allocUnsafe(blocksize + sizes[alg])
17772 for (var i = 0; i < blocksize; i++) {
17773 ipad[i] = key[i] ^ 0x36
17774 opad[i] = key[i] ^ 0x5C
17775 }
17776
17777 var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4)
17778 ipad.copy(ipad1, 0, 0, blocksize)
17779 this.ipad1 = ipad1
17780 this.ipad2 = ipad
17781 this.opad = opad
17782 this.alg = alg
17783 this.blocksize = blocksize
17784 this.hash = hash
17785 this.size = sizes[alg]
17786}
17787
17788Hmac.prototype.run = function (data, ipad) {
17789 data.copy(ipad, this.blocksize)
17790 var h = this.hash(ipad)
17791 h.copy(this.opad, this.blocksize)
17792 return this.hash(this.opad)
17793}
17794
17795function getDigest (alg) {
17796 if (alg === 'rmd160' || alg === 'ripemd160') return rmd160
17797 if (alg === 'md5') return md5
17798 return shaFunc
17799
17800 function shaFunc (data) {
17801 return sha(alg).update(data).digest()
17802 }
17803}
17804
17805module.exports = function (password, salt, iterations, keylen, digest) {
17806 if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding)
17807 if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding)
17808
17809 checkParameters(iterations, keylen)
17810
17811 digest = digest || 'sha1'
17812
17813 var hmac = new Hmac(digest, password, salt.length)
17814
17815 var DK = Buffer.allocUnsafe(keylen)
17816 var block1 = Buffer.allocUnsafe(salt.length + 4)
17817 salt.copy(block1, 0, 0, salt.length)
17818
17819 var U, j, destPos, len
17820
17821 var hLen = hmac.size
17822 var T = Buffer.allocUnsafe(hLen)
17823 var l = Math.ceil(keylen / hLen)
17824 var r = keylen - (l - 1) * hLen
17825
17826 for (var i = 1; i <= l; i++) {
17827 block1.writeUInt32BE(i, salt.length)
17828 U = hmac.run(block1, hmac.ipad1)
17829
17830 U.copy(T, 0, 0, hLen)
17831
17832 for (j = 1; j < iterations; j++) {
17833 U = hmac.run(U, hmac.ipad2)
17834 for (var k = 0; k < hLen; k++) T[k] ^= U[k]
17835 }
17836
17837 destPos = (i - 1) * hLen
17838 len = (i === l ? r : hLen)
17839 T.copy(DK, destPos, 0, len)
17840 }
17841
17842 return DK
17843}
17844
17845},{"./default-encoding":108,"./precondition":109,"create-hash/md5":53,"ripemd160":133,"safe-buffer":134,"sha.js":136}],111:[function(require,module,exports){
17846(function (process){
17847'use strict';
17848
17849if (!process.version ||
17850 process.version.indexOf('v0.') === 0 ||
17851 process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
17852 module.exports = nextTick;
17853} else {
17854 module.exports = process.nextTick;
17855}
17856
17857function nextTick(fn, arg1, arg2, arg3) {
17858 if (typeof fn !== 'function') {
17859 throw new TypeError('"callback" argument must be a function');
17860 }
17861 var len = arguments.length;
17862 var args, i;
17863 switch (len) {
17864 case 0:
17865 case 1:
17866 return process.nextTick(fn);
17867 case 2:
17868 return process.nextTick(function afterTickOne() {
17869 fn.call(null, arg1);
17870 });
17871 case 3:
17872 return process.nextTick(function afterTickTwo() {
17873 fn.call(null, arg1, arg2);
17874 });
17875 case 4:
17876 return process.nextTick(function afterTickThree() {
17877 fn.call(null, arg1, arg2, arg3);
17878 });
17879 default:
17880 args = new Array(len - 1);
17881 i = 0;
17882 while (i < args.length) {
17883 args[i++] = arguments[i];
17884 }
17885 return process.nextTick(function afterTick() {
17886 fn.apply(null, args);
17887 });
17888 }
17889}
17890
17891}).call(this,require('_process'))
17892},{"_process":112}],112:[function(require,module,exports){
17893// shim for using process in browser
17894var process = module.exports = {};
17895
17896// cached from whatever global is present so that test runners that stub it
17897// don't break things. But we need to wrap it in a try catch in case it is
17898// wrapped in strict mode code which doesn't define any globals. It's inside a
17899// function because try/catches deoptimize in certain engines.
17900
17901var cachedSetTimeout;
17902var cachedClearTimeout;
17903
17904function defaultSetTimout() {
17905 throw new Error('setTimeout has not been defined');
17906}
17907function defaultClearTimeout () {
17908 throw new Error('clearTimeout has not been defined');
17909}
17910(function () {
17911 try {
17912 if (typeof setTimeout === 'function') {
17913 cachedSetTimeout = setTimeout;
17914 } else {
17915 cachedSetTimeout = defaultSetTimout;
17916 }
17917 } catch (e) {
17918 cachedSetTimeout = defaultSetTimout;
17919 }
17920 try {
17921 if (typeof clearTimeout === 'function') {
17922 cachedClearTimeout = clearTimeout;
17923 } else {
17924 cachedClearTimeout = defaultClearTimeout;
17925 }
17926 } catch (e) {
17927 cachedClearTimeout = defaultClearTimeout;
17928 }
17929} ())
17930function runTimeout(fun) {
17931 if (cachedSetTimeout === setTimeout) {
17932 //normal enviroments in sane situations
17933 return setTimeout(fun, 0);
17934 }
17935 // if setTimeout wasn't available but was latter defined
17936 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
17937 cachedSetTimeout = setTimeout;
17938 return setTimeout(fun, 0);
17939 }
17940 try {
17941 // when when somebody has screwed with setTimeout but no I.E. maddness
17942 return cachedSetTimeout(fun, 0);
17943 } catch(e){
17944 try {
17945 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
17946 return cachedSetTimeout.call(null, fun, 0);
17947 } catch(e){
17948 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
17949 return cachedSetTimeout.call(this, fun, 0);
17950 }
17951 }
17952
17953
17954}
17955function runClearTimeout(marker) {
17956 if (cachedClearTimeout === clearTimeout) {
17957 //normal enviroments in sane situations
17958 return clearTimeout(marker);
17959 }
17960 // if clearTimeout wasn't available but was latter defined
17961 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
17962 cachedClearTimeout = clearTimeout;
17963 return clearTimeout(marker);
17964 }
17965 try {
17966 // when when somebody has screwed with setTimeout but no I.E. maddness
17967 return cachedClearTimeout(marker);
17968 } catch (e){
17969 try {
17970 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
17971 return cachedClearTimeout.call(null, marker);
17972 } catch (e){
17973 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
17974 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
17975 return cachedClearTimeout.call(this, marker);
17976 }
17977 }
17978
17979
17980
17981}
17982var queue = [];
17983var draining = false;
17984var currentQueue;
17985var queueIndex = -1;
17986
17987function cleanUpNextTick() {
17988 if (!draining || !currentQueue) {
17989 return;
17990 }
17991 draining = false;
17992 if (currentQueue.length) {
17993 queue = currentQueue.concat(queue);
17994 } else {
17995 queueIndex = -1;
17996 }
17997 if (queue.length) {
17998 drainQueue();
17999 }
18000}
18001
18002function drainQueue() {
18003 if (draining) {
18004 return;
18005 }
18006 var timeout = runTimeout(cleanUpNextTick);
18007 draining = true;
18008
18009 var len = queue.length;
18010 while(len) {
18011 currentQueue = queue;
18012 queue = [];
18013 while (++queueIndex < len) {
18014 if (currentQueue) {
18015 currentQueue[queueIndex].run();
18016 }
18017 }
18018 queueIndex = -1;
18019 len = queue.length;
18020 }
18021 currentQueue = null;
18022 draining = false;
18023 runClearTimeout(timeout);
18024}
18025
18026process.nextTick = function (fun) {
18027 var args = new Array(arguments.length - 1);
18028 if (arguments.length > 1) {
18029 for (var i = 1; i < arguments.length; i++) {
18030 args[i - 1] = arguments[i];
18031 }
18032 }
18033 queue.push(new Item(fun, args));
18034 if (queue.length === 1 && !draining) {
18035 runTimeout(drainQueue);
18036 }
18037};
18038
18039// v8 likes predictible objects
18040function Item(fun, array) {
18041 this.fun = fun;
18042 this.array = array;
18043}
18044Item.prototype.run = function () {
18045 this.fun.apply(null, this.array);
18046};
18047process.title = 'browser';
18048process.browser = true;
18049process.env = {};
18050process.argv = [];
18051process.version = ''; // empty string to avoid regexp issues
18052process.versions = {};
18053
18054function noop() {}
18055
18056process.on = noop;
18057process.addListener = noop;
18058process.once = noop;
18059process.off = noop;
18060process.removeListener = noop;
18061process.removeAllListeners = noop;
18062process.emit = noop;
18063process.prependListener = noop;
18064process.prependOnceListener = noop;
18065
18066process.listeners = function (name) { return [] }
18067
18068process.binding = function (name) {
18069 throw new Error('process.binding is not supported');
18070};
18071
18072process.cwd = function () { return '/' };
18073process.chdir = function (dir) {
18074 throw new Error('process.chdir is not supported');
18075};
18076process.umask = function() { return 0; };
18077
18078},{}],113:[function(require,module,exports){
18079exports.publicEncrypt = require('./publicEncrypt');
18080exports.privateDecrypt = require('./privateDecrypt');
18081
18082exports.privateEncrypt = function privateEncrypt(key, buf) {
18083 return exports.publicEncrypt(key, buf, true);
18084};
18085
18086exports.publicDecrypt = function publicDecrypt(key, buf) {
18087 return exports.privateDecrypt(key, buf, true);
18088};
18089},{"./privateDecrypt":115,"./publicEncrypt":116}],114:[function(require,module,exports){
18090(function (Buffer){
18091var createHash = require('create-hash');
18092module.exports = function (seed, len) {
18093 var t = new Buffer('');
18094 var i = 0, c;
18095 while (t.length < len) {
18096 c = i2ops(i++);
18097 t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()]);
18098 }
18099 return t.slice(0, len);
18100};
18101
18102function i2ops(c) {
18103 var out = new Buffer(4);
18104 out.writeUInt32BE(c,0);
18105 return out;
18106}
18107}).call(this,require("buffer").Buffer)
18108},{"buffer":47,"create-hash":51}],115:[function(require,module,exports){
18109(function (Buffer){
18110var parseKeys = require('parse-asn1');
18111var mgf = require('./mgf');
18112var xor = require('./xor');
18113var bn = require('bn.js');
18114var crt = require('browserify-rsa');
18115var createHash = require('create-hash');
18116var withPublic = require('./withPublic');
18117module.exports = function privateDecrypt(private_key, enc, reverse) {
18118 var padding;
18119 if (private_key.padding) {
18120 padding = private_key.padding;
18121 } else if (reverse) {
18122 padding = 1;
18123 } else {
18124 padding = 4;
18125 }
18126
18127 var key = parseKeys(private_key);
18128 var k = key.modulus.byteLength();
18129 if (enc.length > k || new bn(enc).cmp(key.modulus) >= 0) {
18130 throw new Error('decryption error');
18131 }
18132 var msg;
18133 if (reverse) {
18134 msg = withPublic(new bn(enc), key);
18135 } else {
18136 msg = crt(enc, key);
18137 }
18138 var zBuffer = new Buffer(k - msg.length);
18139 zBuffer.fill(0);
18140 msg = Buffer.concat([zBuffer, msg], k);
18141 if (padding === 4) {
18142 return oaep(key, msg);
18143 } else if (padding === 1) {
18144 return pkcs1(key, msg, reverse);
18145 } else if (padding === 3) {
18146 return msg;
18147 } else {
18148 throw new Error('unknown padding');
18149 }
18150};
18151
18152function oaep(key, msg){
18153 var n = key.modulus;
18154 var k = key.modulus.byteLength();
18155 var mLen = msg.length;
18156 var iHash = createHash('sha1').update(new Buffer('')).digest();
18157 var hLen = iHash.length;
18158 var hLen2 = 2 * hLen;
18159 if (msg[0] !== 0) {
18160 throw new Error('decryption error');
18161 }
18162 var maskedSeed = msg.slice(1, hLen + 1);
18163 var maskedDb = msg.slice(hLen + 1);
18164 var seed = xor(maskedSeed, mgf(maskedDb, hLen));
18165 var db = xor(maskedDb, mgf(seed, k - hLen - 1));
18166 if (compare(iHash, db.slice(0, hLen))) {
18167 throw new Error('decryption error');
18168 }
18169 var i = hLen;
18170 while (db[i] === 0) {
18171 i++;
18172 }
18173 if (db[i++] !== 1) {
18174 throw new Error('decryption error');
18175 }
18176 return db.slice(i);
18177}
18178
18179function pkcs1(key, msg, reverse){
18180 var p1 = msg.slice(0, 2);
18181 var i = 2;
18182 var status = 0;
18183 while (msg[i++] !== 0) {
18184 if (i >= msg.length) {
18185 status++;
18186 break;
18187 }
18188 }
18189 var ps = msg.slice(2, i - 1);
18190 var p2 = msg.slice(i - 1, i);
18191
18192 if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)){
18193 status++;
18194 }
18195 if (ps.length < 8) {
18196 status++;
18197 }
18198 if (status) {
18199 throw new Error('decryption error');
18200 }
18201 return msg.slice(i);
18202}
18203function compare(a, b){
18204 a = new Buffer(a);
18205 b = new Buffer(b);
18206 var dif = 0;
18207 var len = a.length;
18208 if (a.length !== b.length) {
18209 dif++;
18210 len = Math.min(a.length, b.length);
18211 }
18212 var i = -1;
18213 while (++i < len) {
18214 dif += (a[i] ^ b[i]);
18215 }
18216 return dif;
18217}
18218}).call(this,require("buffer").Buffer)
18219},{"./mgf":114,"./withPublic":117,"./xor":118,"bn.js":17,"browserify-rsa":38,"buffer":47,"create-hash":51,"parse-asn1":105}],116:[function(require,module,exports){
18220(function (Buffer){
18221var parseKeys = require('parse-asn1');
18222var randomBytes = require('randombytes');
18223var createHash = require('create-hash');
18224var mgf = require('./mgf');
18225var xor = require('./xor');
18226var bn = require('bn.js');
18227var withPublic = require('./withPublic');
18228var crt = require('browserify-rsa');
18229
18230var constants = {
18231 RSA_PKCS1_OAEP_PADDING: 4,
18232 RSA_PKCS1_PADDIN: 1,
18233 RSA_NO_PADDING: 3
18234};
18235
18236module.exports = function publicEncrypt(public_key, msg, reverse) {
18237 var padding;
18238 if (public_key.padding) {
18239 padding = public_key.padding;
18240 } else if (reverse) {
18241 padding = 1;
18242 } else {
18243 padding = 4;
18244 }
18245 var key = parseKeys(public_key);
18246 var paddedMsg;
18247 if (padding === 4) {
18248 paddedMsg = oaep(key, msg);
18249 } else if (padding === 1) {
18250 paddedMsg = pkcs1(key, msg, reverse);
18251 } else if (padding === 3) {
18252 paddedMsg = new bn(msg);
18253 if (paddedMsg.cmp(key.modulus) >= 0) {
18254 throw new Error('data too long for modulus');
18255 }
18256 } else {
18257 throw new Error('unknown padding');
18258 }
18259 if (reverse) {
18260 return crt(paddedMsg, key);
18261 } else {
18262 return withPublic(paddedMsg, key);
18263 }
18264};
18265
18266function oaep(key, msg){
18267 var k = key.modulus.byteLength();
18268 var mLen = msg.length;
18269 var iHash = createHash('sha1').update(new Buffer('')).digest();
18270 var hLen = iHash.length;
18271 var hLen2 = 2 * hLen;
18272 if (mLen > k - hLen2 - 2) {
18273 throw new Error('message too long');
18274 }
18275 var ps = new Buffer(k - mLen - hLen2 - 2);
18276 ps.fill(0);
18277 var dblen = k - hLen - 1;
18278 var seed = randomBytes(hLen);
18279 var maskedDb = xor(Buffer.concat([iHash, ps, new Buffer([1]), msg], dblen), mgf(seed, dblen));
18280 var maskedSeed = xor(seed, mgf(maskedDb, hLen));
18281 return new bn(Buffer.concat([new Buffer([0]), maskedSeed, maskedDb], k));
18282}
18283function pkcs1(key, msg, reverse){
18284 var mLen = msg.length;
18285 var k = key.modulus.byteLength();
18286 if (mLen > k - 11) {
18287 throw new Error('message too long');
18288 }
18289 var ps;
18290 if (reverse) {
18291 ps = new Buffer(k - mLen - 3);
18292 ps.fill(0xff);
18293 } else {
18294 ps = nonZero(k - mLen - 3);
18295 }
18296 return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k));
18297}
18298function nonZero(len, crypto) {
18299 var out = new Buffer(len);
18300 var i = 0;
18301 var cache = randomBytes(len*2);
18302 var cur = 0;
18303 var num;
18304 while (i < len) {
18305 if (cur === cache.length) {
18306 cache = randomBytes(len*2);
18307 cur = 0;
18308 }
18309 num = cache[cur++];
18310 if (num) {
18311 out[i++] = num;
18312 }
18313 }
18314 return out;
18315}
18316}).call(this,require("buffer").Buffer)
18317},{"./mgf":114,"./withPublic":117,"./xor":118,"bn.js":17,"browserify-rsa":38,"buffer":47,"create-hash":51,"parse-asn1":105,"randombytes":119}],117:[function(require,module,exports){
18318(function (Buffer){
18319var bn = require('bn.js');
18320function withPublic(paddedMsg, key) {
18321 return new Buffer(paddedMsg
18322 .toRed(bn.mont(key.modulus))
18323 .redPow(new bn(key.publicExponent))
18324 .fromRed()
18325 .toArray());
18326}
18327
18328module.exports = withPublic;
18329}).call(this,require("buffer").Buffer)
18330},{"bn.js":17,"buffer":47}],118:[function(require,module,exports){
18331module.exports = function xor(a, b) {
18332 var len = a.length;
18333 var i = -1;
18334 while (++i < len) {
18335 a[i] ^= b[i];
18336 }
18337 return a
18338};
18339},{}],119:[function(require,module,exports){
18340(function (process,global,Buffer){
22120'use strict' 18341'use strict'
22121 18342
22122function oldBrowser () { 18343function oldBrowser () {
22123 throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') 18344 throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11')
22124} 18345}
22125 18346
22126var Buffer = require('safe-buffer').Buffer
22127var crypto = global.crypto || global.msCrypto 18347var crypto = global.crypto || global.msCrypto
22128 18348
22129if (crypto && crypto.getRandomValues) { 18349if (crypto && crypto.getRandomValues) {
@@ -22143,9 +18363,8 @@ function randomBytes (size, cb) {
22143 if (size > 0) { // getRandomValues fails on IE if size == 0 18363 if (size > 0) { // getRandomValues fails on IE if size == 0
22144 crypto.getRandomValues(rawBytes) 18364 crypto.getRandomValues(rawBytes)
22145 } 18365 }
22146 18366 // phantomjs doesn't like a buffer being passed here
22147 // XXX: phantomjs doesn't like a buffer being passed here 18367 var bytes = new Buffer(rawBytes.buffer)
22148 var bytes = Buffer.from(rawBytes.buffer)
22149 18368
22150 if (typeof cb === 'function') { 18369 if (typeof cb === 'function') {
22151 return process.nextTick(function () { 18370 return process.nextTick(function () {
@@ -22156,8 +18375,2141 @@ function randomBytes (size, cb) {
22156 return bytes 18375 return bytes
22157} 18376}
22158 18377
22159}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 18378}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
22160},{"_process":13,"safe-buffer":128}],127:[function(require,module,exports){ 18379},{"_process":112,"buffer":47}],120:[function(require,module,exports){
18380module.exports = require('./lib/_stream_duplex.js');
18381
18382},{"./lib/_stream_duplex.js":121}],121:[function(require,module,exports){
18383// a duplex stream is just a stream that is both readable and writable.
18384// Since JS doesn't have multiple prototypal inheritance, this class
18385// prototypally inherits from Readable, and then parasitically from
18386// Writable.
18387
18388'use strict';
18389
18390/*<replacement>*/
18391
18392var objectKeys = Object.keys || function (obj) {
18393 var keys = [];
18394 for (var key in obj) {
18395 keys.push(key);
18396 }return keys;
18397};
18398/*</replacement>*/
18399
18400module.exports = Duplex;
18401
18402/*<replacement>*/
18403var processNextTick = require('process-nextick-args');
18404/*</replacement>*/
18405
18406/*<replacement>*/
18407var util = require('core-util-is');
18408util.inherits = require('inherits');
18409/*</replacement>*/
18410
18411var Readable = require('./_stream_readable');
18412var Writable = require('./_stream_writable');
18413
18414util.inherits(Duplex, Readable);
18415
18416var keys = objectKeys(Writable.prototype);
18417for (var v = 0; v < keys.length; v++) {
18418 var method = keys[v];
18419 if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
18420}
18421
18422function Duplex(options) {
18423 if (!(this instanceof Duplex)) return new Duplex(options);
18424
18425 Readable.call(this, options);
18426 Writable.call(this, options);
18427
18428 if (options && options.readable === false) this.readable = false;
18429
18430 if (options && options.writable === false) this.writable = false;
18431
18432 this.allowHalfOpen = true;
18433 if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
18434
18435 this.once('end', onend);
18436}
18437
18438// the no-half-open enforcer
18439function onend() {
18440 // if we allow half-open state, or if the writable side ended,
18441 // then we're ok.
18442 if (this.allowHalfOpen || this._writableState.ended) return;
18443
18444 // no more data can be written.
18445 // But allow more writes to happen in this tick.
18446 processNextTick(onEndNT, this);
18447}
18448
18449function onEndNT(self) {
18450 self.end();
18451}
18452
18453function forEach(xs, f) {
18454 for (var i = 0, l = xs.length; i < l; i++) {
18455 f(xs[i], i);
18456 }
18457}
18458},{"./_stream_readable":123,"./_stream_writable":125,"core-util-is":49,"inherits":95,"process-nextick-args":111}],122:[function(require,module,exports){
18459// a passthrough stream.
18460// basically just the most minimal sort of Transform stream.
18461// Every written chunk gets output as-is.
18462
18463'use strict';
18464
18465module.exports = PassThrough;
18466
18467var Transform = require('./_stream_transform');
18468
18469/*<replacement>*/
18470var util = require('core-util-is');
18471util.inherits = require('inherits');
18472/*</replacement>*/
18473
18474util.inherits(PassThrough, Transform);
18475
18476function PassThrough(options) {
18477 if (!(this instanceof PassThrough)) return new PassThrough(options);
18478
18479 Transform.call(this, options);
18480}
18481
18482PassThrough.prototype._transform = function (chunk, encoding, cb) {
18483 cb(null, chunk);
18484};
18485},{"./_stream_transform":124,"core-util-is":49,"inherits":95}],123:[function(require,module,exports){
18486(function (process){
18487'use strict';
18488
18489module.exports = Readable;
18490
18491/*<replacement>*/
18492var processNextTick = require('process-nextick-args');
18493/*</replacement>*/
18494
18495/*<replacement>*/
18496var isArray = require('isarray');
18497/*</replacement>*/
18498
18499/*<replacement>*/
18500var Duplex;
18501/*</replacement>*/
18502
18503Readable.ReadableState = ReadableState;
18504
18505/*<replacement>*/
18506var EE = require('events').EventEmitter;
18507
18508var EElistenerCount = function (emitter, type) {
18509 return emitter.listeners(type).length;
18510};
18511/*</replacement>*/
18512
18513/*<replacement>*/
18514var Stream = require('./internal/streams/stream');
18515/*</replacement>*/
18516
18517var Buffer = require('buffer').Buffer;
18518/*<replacement>*/
18519var bufferShim = require('buffer-shims');
18520/*</replacement>*/
18521
18522/*<replacement>*/
18523var util = require('core-util-is');
18524util.inherits = require('inherits');
18525/*</replacement>*/
18526
18527/*<replacement>*/
18528var debugUtil = require('util');
18529var debug = void 0;
18530if (debugUtil && debugUtil.debuglog) {
18531 debug = debugUtil.debuglog('stream');
18532} else {
18533 debug = function () {};
18534}
18535/*</replacement>*/
18536
18537var BufferList = require('./internal/streams/BufferList');
18538var StringDecoder;
18539
18540util.inherits(Readable, Stream);
18541
18542var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
18543
18544function prependListener(emitter, event, fn) {
18545 // Sadly this is not cacheable as some libraries bundle their own
18546 // event emitter implementation with them.
18547 if (typeof emitter.prependListener === 'function') {
18548 return emitter.prependListener(event, fn);
18549 } else {
18550 // This is a hack to make sure that our error handler is attached before any
18551 // userland ones. NEVER DO THIS. This is here only because this code needs
18552 // to continue to work with older versions of Node.js that do not include
18553 // the prependListener() method. The goal is to eventually remove this hack.
18554 if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
18555 }
18556}
18557
18558function ReadableState(options, stream) {
18559 Duplex = Duplex || require('./_stream_duplex');
18560
18561 options = options || {};
18562
18563 // object stream flag. Used to make read(n) ignore n and to
18564 // make all the buffer merging and length checks go away
18565 this.objectMode = !!options.objectMode;
18566
18567 if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
18568
18569 // the point at which it stops calling _read() to fill the buffer
18570 // Note: 0 is a valid value, means "don't call _read preemptively ever"
18571 var hwm = options.highWaterMark;
18572 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
18573 this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
18574
18575 // cast to ints.
18576 this.highWaterMark = ~~this.highWaterMark;
18577
18578 // A linked list is used to store data chunks instead of an array because the
18579 // linked list can remove elements from the beginning faster than
18580 // array.shift()
18581 this.buffer = new BufferList();
18582 this.length = 0;
18583 this.pipes = null;
18584 this.pipesCount = 0;
18585 this.flowing = null;
18586 this.ended = false;
18587 this.endEmitted = false;
18588 this.reading = false;
18589
18590 // a flag to be able to tell if the onwrite cb is called immediately,
18591 // or on a later tick. We set this to true at first, because any
18592 // actions that shouldn't happen until "later" should generally also
18593 // not happen before the first write call.
18594 this.sync = true;
18595
18596 // whenever we return null, then we set a flag to say
18597 // that we're awaiting a 'readable' event emission.
18598 this.needReadable = false;
18599 this.emittedReadable = false;
18600 this.readableListening = false;
18601 this.resumeScheduled = false;
18602
18603 // Crypto is kind of old and crusty. Historically, its default string
18604 // encoding is 'binary' so we have to make this configurable.
18605 // Everything else in the universe uses 'utf8', though.
18606 this.defaultEncoding = options.defaultEncoding || 'utf8';
18607
18608 // when piping, we only care about 'readable' events that happen
18609 // after read()ing all the bytes and not getting any pushback.
18610 this.ranOut = false;
18611
18612 // the number of writers that are awaiting a drain event in .pipe()s
18613 this.awaitDrain = 0;
18614
18615 // if true, a maybeReadMore has been scheduled
18616 this.readingMore = false;
18617
18618 this.decoder = null;
18619 this.encoding = null;
18620 if (options.encoding) {
18621 if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
18622 this.decoder = new StringDecoder(options.encoding);
18623 this.encoding = options.encoding;
18624 }
18625}
18626
18627function Readable(options) {
18628 Duplex = Duplex || require('./_stream_duplex');
18629
18630 if (!(this instanceof Readable)) return new Readable(options);
18631
18632 this._readableState = new ReadableState(options, this);
18633
18634 // legacy
18635 this.readable = true;
18636
18637 if (options && typeof options.read === 'function') this._read = options.read;
18638
18639 Stream.call(this);
18640}
18641
18642// Manually shove something into the read() buffer.
18643// This returns true if the highWaterMark has not been hit yet,
18644// similar to how Writable.write() returns true if you should
18645// write() some more.
18646Readable.prototype.push = function (chunk, encoding) {
18647 var state = this._readableState;
18648
18649 if (!state.objectMode && typeof chunk === 'string') {
18650 encoding = encoding || state.defaultEncoding;
18651 if (encoding !== state.encoding) {
18652 chunk = bufferShim.from(chunk, encoding);
18653 encoding = '';
18654 }
18655 }
18656
18657 return readableAddChunk(this, state, chunk, encoding, false);
18658};
18659
18660// Unshift should *always* be something directly out of read()
18661Readable.prototype.unshift = function (chunk) {
18662 var state = this._readableState;
18663 return readableAddChunk(this, state, chunk, '', true);
18664};
18665
18666Readable.prototype.isPaused = function () {
18667 return this._readableState.flowing === false;
18668};
18669
18670function readableAddChunk(stream, state, chunk, encoding, addToFront) {
18671 var er = chunkInvalid(state, chunk);
18672 if (er) {
18673 stream.emit('error', er);
18674 } else if (chunk === null) {
18675 state.reading = false;
18676 onEofChunk(stream, state);
18677 } else if (state.objectMode || chunk && chunk.length > 0) {
18678 if (state.ended && !addToFront) {
18679 var e = new Error('stream.push() after EOF');
18680 stream.emit('error', e);
18681 } else if (state.endEmitted && addToFront) {
18682 var _e = new Error('stream.unshift() after end event');
18683 stream.emit('error', _e);
18684 } else {
18685 var skipAdd;
18686 if (state.decoder && !addToFront && !encoding) {
18687 chunk = state.decoder.write(chunk);
18688 skipAdd = !state.objectMode && chunk.length === 0;
18689 }
18690
18691 if (!addToFront) state.reading = false;
18692
18693 // Don't add to the buffer if we've decoded to an empty string chunk and
18694 // we're not in object mode
18695 if (!skipAdd) {
18696 // if we want the data now, just emit it.
18697 if (state.flowing && state.length === 0 && !state.sync) {
18698 stream.emit('data', chunk);
18699 stream.read(0);
18700 } else {
18701 // update the buffer info.
18702 state.length += state.objectMode ? 1 : chunk.length;
18703 if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
18704
18705 if (state.needReadable) emitReadable(stream);
18706 }
18707 }
18708
18709 maybeReadMore(stream, state);
18710 }
18711 } else if (!addToFront) {
18712 state.reading = false;
18713 }
18714
18715 return needMoreData(state);
18716}
18717
18718// if it's past the high water mark, we can push in some more.
18719// Also, if we have no data yet, we can stand some
18720// more bytes. This is to work around cases where hwm=0,
18721// such as the repl. Also, if the push() triggered a
18722// readable event, and the user called read(largeNumber) such that
18723// needReadable was set, then we ought to push more, so that another
18724// 'readable' event will be triggered.
18725function needMoreData(state) {
18726 return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
18727}
18728
18729// backwards compatibility.
18730Readable.prototype.setEncoding = function (enc) {
18731 if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
18732 this._readableState.decoder = new StringDecoder(enc);
18733 this._readableState.encoding = enc;
18734 return this;
18735};
18736
18737// Don't raise the hwm > 8MB
18738var MAX_HWM = 0x800000;
18739function computeNewHighWaterMark(n) {
18740 if (n >= MAX_HWM) {
18741 n = MAX_HWM;
18742 } else {
18743 // Get the next highest power of 2 to prevent increasing hwm excessively in
18744 // tiny amounts
18745 n--;
18746 n |= n >>> 1;
18747 n |= n >>> 2;
18748 n |= n >>> 4;
18749 n |= n >>> 8;
18750 n |= n >>> 16;
18751 n++;
18752 }
18753 return n;
18754}
18755
18756// This function is designed to be inlinable, so please take care when making
18757// changes to the function body.
18758function howMuchToRead(n, state) {
18759 if (n <= 0 || state.length === 0 && state.ended) return 0;
18760 if (state.objectMode) return 1;
18761 if (n !== n) {
18762 // Only flow one buffer at a time
18763 if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
18764 }
18765 // If we're asking for more than the current hwm, then raise the hwm.
18766 if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
18767 if (n <= state.length) return n;
18768 // Don't have enough
18769 if (!state.ended) {
18770 state.needReadable = true;
18771 return 0;
18772 }
18773 return state.length;
18774}
18775
18776// you can override either this method, or the async _read(n) below.
18777Readable.prototype.read = function (n) {
18778 debug('read', n);
18779 n = parseInt(n, 10);
18780 var state = this._readableState;
18781 var nOrig = n;
18782
18783 if (n !== 0) state.emittedReadable = false;
18784
18785 // if we're doing read(0) to trigger a readable event, but we
18786 // already have a bunch of data in the buffer, then just trigger
18787 // the 'readable' event and move on.
18788 if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
18789 debug('read: emitReadable', state.length, state.ended);
18790 if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
18791 return null;
18792 }
18793
18794 n = howMuchToRead(n, state);
18795
18796 // if we've ended, and we're now clear, then finish it up.
18797 if (n === 0 && state.ended) {
18798 if (state.length === 0) endReadable(this);
18799 return null;
18800 }
18801
18802 // All the actual chunk generation logic needs to be
18803 // *below* the call to _read. The reason is that in certain
18804 // synthetic stream cases, such as passthrough streams, _read
18805 // may be a completely synchronous operation which may change
18806 // the state of the read buffer, providing enough data when
18807 // before there was *not* enough.
18808 //
18809 // So, the steps are:
18810 // 1. Figure out what the state of things will be after we do
18811 // a read from the buffer.
18812 //
18813 // 2. If that resulting state will trigger a _read, then call _read.
18814 // Note that this may be asynchronous, or synchronous. Yes, it is
18815 // deeply ugly to write APIs this way, but that still doesn't mean
18816 // that the Readable class should behave improperly, as streams are
18817 // designed to be sync/async agnostic.
18818 // Take note if the _read call is sync or async (ie, if the read call
18819 // has returned yet), so that we know whether or not it's safe to emit
18820 // 'readable' etc.
18821 //
18822 // 3. Actually pull the requested chunks out of the buffer and return.
18823
18824 // if we need a readable event, then we need to do some reading.
18825 var doRead = state.needReadable;
18826 debug('need readable', doRead);
18827
18828 // if we currently have less than the highWaterMark, then also read some
18829 if (state.length === 0 || state.length - n < state.highWaterMark) {
18830 doRead = true;
18831 debug('length less than watermark', doRead);
18832 }
18833
18834 // however, if we've ended, then there's no point, and if we're already
18835 // reading, then it's unnecessary.
18836 if (state.ended || state.reading) {
18837 doRead = false;
18838 debug('reading or ended', doRead);
18839 } else if (doRead) {
18840 debug('do read');
18841 state.reading = true;
18842 state.sync = true;
18843 // if the length is currently zero, then we *need* a readable event.
18844 if (state.length === 0) state.needReadable = true;
18845 // call internal read method
18846 this._read(state.highWaterMark);
18847 state.sync = false;
18848 // If _read pushed data synchronously, then `reading` will be false,
18849 // and we need to re-evaluate how much data we can return to the user.
18850 if (!state.reading) n = howMuchToRead(nOrig, state);
18851 }
18852
18853 var ret;
18854 if (n > 0) ret = fromList(n, state);else ret = null;
18855
18856 if (ret === null) {
18857 state.needReadable = true;
18858 n = 0;
18859 } else {
18860 state.length -= n;
18861 }
18862
18863 if (state.length === 0) {
18864 // If we have nothing in the buffer, then we want to know
18865 // as soon as we *do* get something into the buffer.
18866 if (!state.ended) state.needReadable = true;
18867
18868 // If we tried to read() past the EOF, then emit end on the next tick.
18869 if (nOrig !== n && state.ended) endReadable(this);
18870 }
18871
18872 if (ret !== null) this.emit('data', ret);
18873
18874 return ret;
18875};
18876
18877function chunkInvalid(state, chunk) {
18878 var er = null;
18879 if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
18880 er = new TypeError('Invalid non-string/buffer chunk');
18881 }
18882 return er;
18883}
18884
18885function onEofChunk(stream, state) {
18886 if (state.ended) return;
18887 if (state.decoder) {
18888 var chunk = state.decoder.end();
18889 if (chunk && chunk.length) {
18890 state.buffer.push(chunk);
18891 state.length += state.objectMode ? 1 : chunk.length;
18892 }
18893 }
18894 state.ended = true;
18895
18896 // emit 'readable' now to make sure it gets picked up.
18897 emitReadable(stream);
18898}
18899
18900// Don't emit readable right away in sync mode, because this can trigger
18901// another read() call => stack overflow. This way, it might trigger
18902// a nextTick recursion warning, but that's not so bad.
18903function emitReadable(stream) {
18904 var state = stream._readableState;
18905 state.needReadable = false;
18906 if (!state.emittedReadable) {
18907 debug('emitReadable', state.flowing);
18908 state.emittedReadable = true;
18909 if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
18910 }
18911}
18912
18913function emitReadable_(stream) {
18914 debug('emit readable');
18915 stream.emit('readable');
18916 flow(stream);
18917}
18918
18919// at this point, the user has presumably seen the 'readable' event,
18920// and called read() to consume some data. that may have triggered
18921// in turn another _read(n) call, in which case reading = true if
18922// it's in progress.
18923// However, if we're not ended, or reading, and the length < hwm,
18924// then go ahead and try to read some more preemptively.
18925function maybeReadMore(stream, state) {
18926 if (!state.readingMore) {
18927 state.readingMore = true;
18928 processNextTick(maybeReadMore_, stream, state);
18929 }
18930}
18931
18932function maybeReadMore_(stream, state) {
18933 var len = state.length;
18934 while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
18935 debug('maybeReadMore read 0');
18936 stream.read(0);
18937 if (len === state.length)
18938 // didn't get any data, stop spinning.
18939 break;else len = state.length;
18940 }
18941 state.readingMore = false;
18942}
18943
18944// abstract method. to be overridden in specific implementation classes.
18945// call cb(er, data) where data is <= n in length.
18946// for virtual (non-string, non-buffer) streams, "length" is somewhat
18947// arbitrary, and perhaps not very meaningful.
18948Readable.prototype._read = function (n) {
18949 this.emit('error', new Error('_read() is not implemented'));
18950};
18951
18952Readable.prototype.pipe = function (dest, pipeOpts) {
18953 var src = this;
18954 var state = this._readableState;
18955
18956 switch (state.pipesCount) {
18957 case 0:
18958 state.pipes = dest;
18959 break;
18960 case 1:
18961 state.pipes = [state.pipes, dest];
18962 break;
18963 default:
18964 state.pipes.push(dest);
18965 break;
18966 }
18967 state.pipesCount += 1;
18968 debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
18969
18970 var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
18971
18972 var endFn = doEnd ? onend : cleanup;
18973 if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
18974
18975 dest.on('unpipe', onunpipe);
18976 function onunpipe(readable) {
18977 debug('onunpipe');
18978 if (readable === src) {
18979 cleanup();
18980 }
18981 }
18982
18983 function onend() {
18984 debug('onend');
18985 dest.end();
18986 }
18987
18988 // when the dest drains, it reduces the awaitDrain counter
18989 // on the source. This would be more elegant with a .once()
18990 // handler in flow(), but adding and removing repeatedly is
18991 // too slow.
18992 var ondrain = pipeOnDrain(src);
18993 dest.on('drain', ondrain);
18994
18995 var cleanedUp = false;
18996 function cleanup() {
18997 debug('cleanup');
18998 // cleanup event handlers once the pipe is broken
18999 dest.removeListener('close', onclose);
19000 dest.removeListener('finish', onfinish);
19001 dest.removeListener('drain', ondrain);
19002 dest.removeListener('error', onerror);
19003 dest.removeListener('unpipe', onunpipe);
19004 src.removeListener('end', onend);
19005 src.removeListener('end', cleanup);
19006 src.removeListener('data', ondata);
19007
19008 cleanedUp = true;
19009
19010 // if the reader is waiting for a drain event from this
19011 // specific writer, then it would cause it to never start
19012 // flowing again.
19013 // So, if this is awaiting a drain, then we just call it now.
19014 // If we don't know, then assume that we are waiting for one.
19015 if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
19016 }
19017
19018 // If the user pushes more data while we're writing to dest then we'll end up
19019 // in ondata again. However, we only want to increase awaitDrain once because
19020 // dest will only emit one 'drain' event for the multiple writes.
19021 // => Introduce a guard on increasing awaitDrain.
19022 var increasedAwaitDrain = false;
19023 src.on('data', ondata);
19024 function ondata(chunk) {
19025 debug('ondata');
19026 increasedAwaitDrain = false;
19027 var ret = dest.write(chunk);
19028 if (false === ret && !increasedAwaitDrain) {
19029 // If the user unpiped during `dest.write()`, it is possible
19030 // to get stuck in a permanently paused state if that write
19031 // also returned false.
19032 // => Check whether `dest` is still a piping destination.
19033 if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
19034 debug('false write response, pause', src._readableState.awaitDrain);
19035 src._readableState.awaitDrain++;
19036 increasedAwaitDrain = true;
19037 }
19038 src.pause();
19039 }
19040 }
19041
19042 // if the dest has an error, then stop piping into it.
19043 // however, don't suppress the throwing behavior for this.
19044 function onerror(er) {
19045 debug('onerror', er);
19046 unpipe();
19047 dest.removeListener('error', onerror);
19048 if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
19049 }
19050
19051 // Make sure our error handler is attached before userland ones.
19052 prependListener(dest, 'error', onerror);
19053
19054 // Both close and finish should trigger unpipe, but only once.
19055 function onclose() {
19056 dest.removeListener('finish', onfinish);
19057 unpipe();
19058 }
19059 dest.once('close', onclose);
19060 function onfinish() {
19061 debug('onfinish');
19062 dest.removeListener('close', onclose);
19063 unpipe();
19064 }
19065 dest.once('finish', onfinish);
19066
19067 function unpipe() {
19068 debug('unpipe');
19069 src.unpipe(dest);
19070 }
19071
19072 // tell the dest that it's being piped to
19073 dest.emit('pipe', src);
19074
19075 // start the flow if it hasn't been started already.
19076 if (!state.flowing) {
19077 debug('pipe resume');
19078 src.resume();
19079 }
19080
19081 return dest;
19082};
19083
19084function pipeOnDrain(src) {
19085 return function () {
19086 var state = src._readableState;
19087 debug('pipeOnDrain', state.awaitDrain);
19088 if (state.awaitDrain) state.awaitDrain--;
19089 if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
19090 state.flowing = true;
19091 flow(src);
19092 }
19093 };
19094}
19095
19096Readable.prototype.unpipe = function (dest) {
19097 var state = this._readableState;
19098
19099 // if we're not piping anywhere, then do nothing.
19100 if (state.pipesCount === 0) return this;
19101
19102 // just one destination. most common case.
19103 if (state.pipesCount === 1) {
19104 // passed in one, but it's not the right one.
19105 if (dest && dest !== state.pipes) return this;
19106
19107 if (!dest) dest = state.pipes;
19108
19109 // got a match.
19110 state.pipes = null;
19111 state.pipesCount = 0;
19112 state.flowing = false;
19113 if (dest) dest.emit('unpipe', this);
19114 return this;
19115 }
19116
19117 // slow case. multiple pipe destinations.
19118
19119 if (!dest) {
19120 // remove all.
19121 var dests = state.pipes;
19122 var len = state.pipesCount;
19123 state.pipes = null;
19124 state.pipesCount = 0;
19125 state.flowing = false;
19126
19127 for (var i = 0; i < len; i++) {
19128 dests[i].emit('unpipe', this);
19129 }return this;
19130 }
19131
19132 // try to find the right one.
19133 var index = indexOf(state.pipes, dest);
19134 if (index === -1) return this;
19135
19136 state.pipes.splice(index, 1);
19137 state.pipesCount -= 1;
19138 if (state.pipesCount === 1) state.pipes = state.pipes[0];
19139
19140 dest.emit('unpipe', this);
19141
19142 return this;
19143};
19144
19145// set up data events if they are asked for
19146// Ensure readable listeners eventually get something
19147Readable.prototype.on = function (ev, fn) {
19148 var res = Stream.prototype.on.call(this, ev, fn);
19149
19150 if (ev === 'data') {
19151 // Start flowing on next tick if stream isn't explicitly paused
19152 if (this._readableState.flowing !== false) this.resume();
19153 } else if (ev === 'readable') {
19154 var state = this._readableState;
19155 if (!state.endEmitted && !state.readableListening) {
19156 state.readableListening = state.needReadable = true;
19157 state.emittedReadable = false;
19158 if (!state.reading) {
19159 processNextTick(nReadingNextTick, this);
19160 } else if (state.length) {
19161 emitReadable(this, state);
19162 }
19163 }
19164 }
19165
19166 return res;
19167};
19168Readable.prototype.addListener = Readable.prototype.on;
19169
19170function nReadingNextTick(self) {
19171 debug('readable nexttick read 0');
19172 self.read(0);
19173}
19174
19175// pause() and resume() are remnants of the legacy readable stream API
19176// If the user uses them, then switch into old mode.
19177Readable.prototype.resume = function () {
19178 var state = this._readableState;
19179 if (!state.flowing) {
19180 debug('resume');
19181 state.flowing = true;
19182 resume(this, state);
19183 }
19184 return this;
19185};
19186
19187function resume(stream, state) {
19188 if (!state.resumeScheduled) {
19189 state.resumeScheduled = true;
19190 processNextTick(resume_, stream, state);
19191 }
19192}
19193
19194function resume_(stream, state) {
19195 if (!state.reading) {
19196 debug('resume read 0');
19197 stream.read(0);
19198 }
19199
19200 state.resumeScheduled = false;
19201 state.awaitDrain = 0;
19202 stream.emit('resume');
19203 flow(stream);
19204 if (state.flowing && !state.reading) stream.read(0);
19205}
19206
19207Readable.prototype.pause = function () {
19208 debug('call pause flowing=%j', this._readableState.flowing);
19209 if (false !== this._readableState.flowing) {
19210 debug('pause');
19211 this._readableState.flowing = false;
19212 this.emit('pause');
19213 }
19214 return this;
19215};
19216
19217function flow(stream) {
19218 var state = stream._readableState;
19219 debug('flow', state.flowing);
19220 while (state.flowing && stream.read() !== null) {}
19221}
19222
19223// wrap an old-style stream as the async data source.
19224// This is *not* part of the readable stream interface.
19225// It is an ugly unfortunate mess of history.
19226Readable.prototype.wrap = function (stream) {
19227 var state = this._readableState;
19228 var paused = false;
19229
19230 var self = this;
19231 stream.on('end', function () {
19232 debug('wrapped end');
19233 if (state.decoder && !state.ended) {
19234 var chunk = state.decoder.end();
19235 if (chunk && chunk.length) self.push(chunk);
19236 }
19237
19238 self.push(null);
19239 });
19240
19241 stream.on('data', function (chunk) {
19242 debug('wrapped data');
19243 if (state.decoder) chunk = state.decoder.write(chunk);
19244
19245 // don't skip over falsy values in objectMode
19246 if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
19247
19248 var ret = self.push(chunk);
19249 if (!ret) {
19250 paused = true;
19251 stream.pause();
19252 }
19253 });
19254
19255 // proxy all the other methods.
19256 // important when wrapping filters and duplexes.
19257 for (var i in stream) {
19258 if (this[i] === undefined && typeof stream[i] === 'function') {
19259 this[i] = function (method) {
19260 return function () {
19261 return stream[method].apply(stream, arguments);
19262 };
19263 }(i);
19264 }
19265 }
19266
19267 // proxy certain important events.
19268 for (var n = 0; n < kProxyEvents.length; n++) {
19269 stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n]));
19270 }
19271
19272 // when we try to consume some more bytes, simply unpause the
19273 // underlying stream.
19274 self._read = function (n) {
19275 debug('wrapped _read', n);
19276 if (paused) {
19277 paused = false;
19278 stream.resume();
19279 }
19280 };
19281
19282 return self;
19283};
19284
19285// exposed for testing purposes only.
19286Readable._fromList = fromList;
19287
19288// Pluck off n bytes from an array of buffers.
19289// Length is the combined lengths of all the buffers in the list.
19290// This function is designed to be inlinable, so please take care when making
19291// changes to the function body.
19292function fromList(n, state) {
19293 // nothing buffered
19294 if (state.length === 0) return null;
19295
19296 var ret;
19297 if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
19298 // read it all, truncate the list
19299 if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
19300 state.buffer.clear();
19301 } else {
19302 // read part of list
19303 ret = fromListPartial(n, state.buffer, state.decoder);
19304 }
19305
19306 return ret;
19307}
19308
19309// Extracts only enough buffered data to satisfy the amount requested.
19310// This function is designed to be inlinable, so please take care when making
19311// changes to the function body.
19312function fromListPartial(n, list, hasStrings) {
19313 var ret;
19314 if (n < list.head.data.length) {
19315 // slice is the same for buffers and strings
19316 ret = list.head.data.slice(0, n);
19317 list.head.data = list.head.data.slice(n);
19318 } else if (n === list.head.data.length) {
19319 // first chunk is a perfect match
19320 ret = list.shift();
19321 } else {
19322 // result spans more than one buffer
19323 ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
19324 }
19325 return ret;
19326}
19327
19328// Copies a specified amount of characters from the list of buffered data
19329// chunks.
19330// This function is designed to be inlinable, so please take care when making
19331// changes to the function body.
19332function copyFromBufferString(n, list) {
19333 var p = list.head;
19334 var c = 1;
19335 var ret = p.data;
19336 n -= ret.length;
19337 while (p = p.next) {
19338 var str = p.data;
19339 var nb = n > str.length ? str.length : n;
19340 if (nb === str.length) ret += str;else ret += str.slice(0, n);
19341 n -= nb;
19342 if (n === 0) {
19343 if (nb === str.length) {
19344 ++c;
19345 if (p.next) list.head = p.next;else list.head = list.tail = null;
19346 } else {
19347 list.head = p;
19348 p.data = str.slice(nb);
19349 }
19350 break;
19351 }
19352 ++c;
19353 }
19354 list.length -= c;
19355 return ret;
19356}
19357
19358// Copies a specified amount of bytes from the list of buffered data chunks.
19359// This function is designed to be inlinable, so please take care when making
19360// changes to the function body.
19361function copyFromBuffer(n, list) {
19362 var ret = bufferShim.allocUnsafe(n);
19363 var p = list.head;
19364 var c = 1;
19365 p.data.copy(ret);
19366 n -= p.data.length;
19367 while (p = p.next) {
19368 var buf = p.data;
19369 var nb = n > buf.length ? buf.length : n;
19370 buf.copy(ret, ret.length - n, 0, nb);
19371 n -= nb;
19372 if (n === 0) {
19373 if (nb === buf.length) {
19374 ++c;
19375 if (p.next) list.head = p.next;else list.head = list.tail = null;
19376 } else {
19377 list.head = p;
19378 p.data = buf.slice(nb);
19379 }
19380 break;
19381 }
19382 ++c;
19383 }
19384 list.length -= c;
19385 return ret;
19386}
19387
19388function endReadable(stream) {
19389 var state = stream._readableState;
19390
19391 // If we get here before consuming all the bytes, then that is a
19392 // bug in node. Should never happen.
19393 if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
19394
19395 if (!state.endEmitted) {
19396 state.ended = true;
19397 processNextTick(endReadableNT, state, stream);
19398 }
19399}
19400
19401function endReadableNT(state, stream) {
19402 // Check that we didn't get one last unshift.
19403 if (!state.endEmitted && state.length === 0) {
19404 state.endEmitted = true;
19405 stream.readable = false;
19406 stream.emit('end');
19407 }
19408}
19409
19410function forEach(xs, f) {
19411 for (var i = 0, l = xs.length; i < l; i++) {
19412 f(xs[i], i);
19413 }
19414}
19415
19416function indexOf(xs, x) {
19417 for (var i = 0, l = xs.length; i < l; i++) {
19418 if (xs[i] === x) return i;
19419 }
19420 return -1;
19421}
19422}).call(this,require('_process'))
19423},{"./_stream_duplex":121,"./internal/streams/BufferList":126,"./internal/streams/stream":127,"_process":112,"buffer":47,"buffer-shims":45,"core-util-is":49,"events":83,"inherits":95,"isarray":97,"process-nextick-args":111,"string_decoder/":128,"util":19}],124:[function(require,module,exports){
19424// a transform stream is a readable/writable stream where you do
19425// something with the data. Sometimes it's called a "filter",
19426// but that's not a great name for it, since that implies a thing where
19427// some bits pass through, and others are simply ignored. (That would
19428// be a valid example of a transform, of course.)
19429//
19430// While the output is causally related to the input, it's not a
19431// necessarily symmetric or synchronous transformation. For example,
19432// a zlib stream might take multiple plain-text writes(), and then
19433// emit a single compressed chunk some time in the future.
19434//
19435// Here's how this works:
19436//
19437// The Transform stream has all the aspects of the readable and writable
19438// stream classes. When you write(chunk), that calls _write(chunk,cb)
19439// internally, and returns false if there's a lot of pending writes
19440// buffered up. When you call read(), that calls _read(n) until
19441// there's enough pending readable data buffered up.
19442//
19443// In a transform stream, the written data is placed in a buffer. When
19444// _read(n) is called, it transforms the queued up data, calling the
19445// buffered _write cb's as it consumes chunks. If consuming a single
19446// written chunk would result in multiple output chunks, then the first
19447// outputted bit calls the readcb, and subsequent chunks just go into
19448// the read buffer, and will cause it to emit 'readable' if necessary.
19449//
19450// This way, back-pressure is actually determined by the reading side,
19451// since _read has to be called to start processing a new chunk. However,
19452// a pathological inflate type of transform can cause excessive buffering
19453// here. For example, imagine a stream where every byte of input is
19454// interpreted as an integer from 0-255, and then results in that many
19455// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
19456// 1kb of data being output. In this case, you could write a very small
19457// amount of input, and end up with a very large amount of output. In
19458// such a pathological inflating mechanism, there'd be no way to tell
19459// the system to stop doing the transform. A single 4MB write could
19460// cause the system to run out of memory.
19461//
19462// However, even in such a pathological case, only a single written chunk
19463// would be consumed, and then the rest would wait (un-transformed) until
19464// the results of the previous transformed chunk were consumed.
19465
19466'use strict';
19467
19468module.exports = Transform;
19469
19470var Duplex = require('./_stream_duplex');
19471
19472/*<replacement>*/
19473var util = require('core-util-is');
19474util.inherits = require('inherits');
19475/*</replacement>*/
19476
19477util.inherits(Transform, Duplex);
19478
19479function TransformState(stream) {
19480 this.afterTransform = function (er, data) {
19481 return afterTransform(stream, er, data);
19482 };
19483
19484 this.needTransform = false;
19485 this.transforming = false;
19486 this.writecb = null;
19487 this.writechunk = null;
19488 this.writeencoding = null;
19489}
19490
19491function afterTransform(stream, er, data) {
19492 var ts = stream._transformState;
19493 ts.transforming = false;
19494
19495 var cb = ts.writecb;
19496
19497 if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));
19498
19499 ts.writechunk = null;
19500 ts.writecb = null;
19501
19502 if (data !== null && data !== undefined) stream.push(data);
19503
19504 cb(er);
19505
19506 var rs = stream._readableState;
19507 rs.reading = false;
19508 if (rs.needReadable || rs.length < rs.highWaterMark) {
19509 stream._read(rs.highWaterMark);
19510 }
19511}
19512
19513function Transform(options) {
19514 if (!(this instanceof Transform)) return new Transform(options);
19515
19516 Duplex.call(this, options);
19517
19518 this._transformState = new TransformState(this);
19519
19520 var stream = this;
19521
19522 // start out asking for a readable event once data is transformed.
19523 this._readableState.needReadable = true;
19524
19525 // we have implemented the _read method, and done the other things
19526 // that Readable wants before the first _read call, so unset the
19527 // sync guard flag.
19528 this._readableState.sync = false;
19529
19530 if (options) {
19531 if (typeof options.transform === 'function') this._transform = options.transform;
19532
19533 if (typeof options.flush === 'function') this._flush = options.flush;
19534 }
19535
19536 // When the writable side finishes, then flush out anything remaining.
19537 this.once('prefinish', function () {
19538 if (typeof this._flush === 'function') this._flush(function (er, data) {
19539 done(stream, er, data);
19540 });else done(stream);
19541 });
19542}
19543
19544Transform.prototype.push = function (chunk, encoding) {
19545 this._transformState.needTransform = false;
19546 return Duplex.prototype.push.call(this, chunk, encoding);
19547};
19548
19549// This is the part where you do stuff!
19550// override this function in implementation classes.
19551// 'chunk' is an input chunk.
19552//
19553// Call `push(newChunk)` to pass along transformed output
19554// to the readable side. You may call 'push' zero or more times.
19555//
19556// Call `cb(err)` when you are done with this chunk. If you pass
19557// an error, then that'll put the hurt on the whole operation. If you
19558// never call cb(), then you'll never get another chunk.
19559Transform.prototype._transform = function (chunk, encoding, cb) {
19560 throw new Error('_transform() is not implemented');
19561};
19562
19563Transform.prototype._write = function (chunk, encoding, cb) {
19564 var ts = this._transformState;
19565 ts.writecb = cb;
19566 ts.writechunk = chunk;
19567 ts.writeencoding = encoding;
19568 if (!ts.transforming) {
19569 var rs = this._readableState;
19570 if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
19571 }
19572};
19573
19574// Doesn't matter what the args are here.
19575// _transform does all the work.
19576// That we got here means that the readable side wants more data.
19577Transform.prototype._read = function (n) {
19578 var ts = this._transformState;
19579
19580 if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
19581 ts.transforming = true;
19582 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
19583 } else {
19584 // mark that we need a transform, so that any data that comes in
19585 // will get processed, now that we've asked for it.
19586 ts.needTransform = true;
19587 }
19588};
19589
19590function done(stream, er, data) {
19591 if (er) return stream.emit('error', er);
19592
19593 if (data !== null && data !== undefined) stream.push(data);
19594
19595 // if there's nothing in the write buffer, then that means
19596 // that nothing more will ever be provided
19597 var ws = stream._writableState;
19598 var ts = stream._transformState;
19599
19600 if (ws.length) throw new Error('Calling transform done when ws.length != 0');
19601
19602 if (ts.transforming) throw new Error('Calling transform done when still transforming');
19603
19604 return stream.push(null);
19605}
19606},{"./_stream_duplex":121,"core-util-is":49,"inherits":95}],125:[function(require,module,exports){
19607(function (process){
19608// A bit simpler than readable streams.
19609// Implement an async ._write(chunk, encoding, cb), and it'll handle all
19610// the drain event emission and buffering.
19611
19612'use strict';
19613
19614module.exports = Writable;
19615
19616/*<replacement>*/
19617var processNextTick = require('process-nextick-args');
19618/*</replacement>*/
19619
19620/*<replacement>*/
19621var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
19622/*</replacement>*/
19623
19624/*<replacement>*/
19625var Duplex;
19626/*</replacement>*/
19627
19628Writable.WritableState = WritableState;
19629
19630/*<replacement>*/
19631var util = require('core-util-is');
19632util.inherits = require('inherits');
19633/*</replacement>*/
19634
19635/*<replacement>*/
19636var internalUtil = {
19637 deprecate: require('util-deprecate')
19638};
19639/*</replacement>*/
19640
19641/*<replacement>*/
19642var Stream = require('./internal/streams/stream');
19643/*</replacement>*/
19644
19645var Buffer = require('buffer').Buffer;
19646/*<replacement>*/
19647var bufferShim = require('buffer-shims');
19648/*</replacement>*/
19649
19650util.inherits(Writable, Stream);
19651
19652function nop() {}
19653
19654function WriteReq(chunk, encoding, cb) {
19655 this.chunk = chunk;
19656 this.encoding = encoding;
19657 this.callback = cb;
19658 this.next = null;
19659}
19660
19661function WritableState(options, stream) {
19662 Duplex = Duplex || require('./_stream_duplex');
19663
19664 options = options || {};
19665
19666 // object stream flag to indicate whether or not this stream
19667 // contains buffers or objects.
19668 this.objectMode = !!options.objectMode;
19669
19670 if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
19671
19672 // the point at which write() starts returning false
19673 // Note: 0 is a valid value, means that we always return false if
19674 // the entire buffer is not flushed immediately on write()
19675 var hwm = options.highWaterMark;
19676 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
19677 this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
19678
19679 // cast to ints.
19680 this.highWaterMark = ~~this.highWaterMark;
19681
19682 // drain event flag.
19683 this.needDrain = false;
19684 // at the start of calling end()
19685 this.ending = false;
19686 // when end() has been called, and returned
19687 this.ended = false;
19688 // when 'finish' is emitted
19689 this.finished = false;
19690
19691 // should we decode strings into buffers before passing to _write?
19692 // this is here so that some node-core streams can optimize string
19693 // handling at a lower level.
19694 var noDecode = options.decodeStrings === false;
19695 this.decodeStrings = !noDecode;
19696
19697 // Crypto is kind of old and crusty. Historically, its default string
19698 // encoding is 'binary' so we have to make this configurable.
19699 // Everything else in the universe uses 'utf8', though.
19700 this.defaultEncoding = options.defaultEncoding || 'utf8';
19701
19702 // not an actual buffer we keep track of, but a measurement
19703 // of how much we're waiting to get pushed to some underlying
19704 // socket or file.
19705 this.length = 0;
19706
19707 // a flag to see when we're in the middle of a write.
19708 this.writing = false;
19709
19710 // when true all writes will be buffered until .uncork() call
19711 this.corked = 0;
19712
19713 // a flag to be able to tell if the onwrite cb is called immediately,
19714 // or on a later tick. We set this to true at first, because any
19715 // actions that shouldn't happen until "later" should generally also
19716 // not happen before the first write call.
19717 this.sync = true;
19718
19719 // a flag to know if we're processing previously buffered items, which
19720 // may call the _write() callback in the same tick, so that we don't
19721 // end up in an overlapped onwrite situation.
19722 this.bufferProcessing = false;
19723
19724 // the callback that's passed to _write(chunk,cb)
19725 this.onwrite = function (er) {
19726 onwrite(stream, er);
19727 };
19728
19729 // the callback that the user supplies to write(chunk,encoding,cb)
19730 this.writecb = null;
19731
19732 // the amount that is being written when _write is called.
19733 this.writelen = 0;
19734
19735 this.bufferedRequest = null;
19736 this.lastBufferedRequest = null;
19737
19738 // number of pending user-supplied write callbacks
19739 // this must be 0 before 'finish' can be emitted
19740 this.pendingcb = 0;
19741
19742 // emit prefinish if the only thing we're waiting for is _write cbs
19743 // This is relevant for synchronous Transform streams
19744 this.prefinished = false;
19745
19746 // True if the error was already emitted and should not be thrown again
19747 this.errorEmitted = false;
19748
19749 // count buffered requests
19750 this.bufferedRequestCount = 0;
19751
19752 // allocate the first CorkedRequest, there is always
19753 // one allocated and free to use, and we maintain at most two
19754 this.corkedRequestsFree = new CorkedRequest(this);
19755}
19756
19757WritableState.prototype.getBuffer = function getBuffer() {
19758 var current = this.bufferedRequest;
19759 var out = [];
19760 while (current) {
19761 out.push(current);
19762 current = current.next;
19763 }
19764 return out;
19765};
19766
19767(function () {
19768 try {
19769 Object.defineProperty(WritableState.prototype, 'buffer', {
19770 get: internalUtil.deprecate(function () {
19771 return this.getBuffer();
19772 }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
19773 });
19774 } catch (_) {}
19775})();
19776
19777// Test _writableState for inheritance to account for Duplex streams,
19778// whose prototype chain only points to Readable.
19779var realHasInstance;
19780if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
19781 realHasInstance = Function.prototype[Symbol.hasInstance];
19782 Object.defineProperty(Writable, Symbol.hasInstance, {
19783 value: function (object) {
19784 if (realHasInstance.call(this, object)) return true;
19785
19786 return object && object._writableState instanceof WritableState;
19787 }
19788 });
19789} else {
19790 realHasInstance = function (object) {
19791 return object instanceof this;
19792 };
19793}
19794
19795function Writable(options) {
19796 Duplex = Duplex || require('./_stream_duplex');
19797
19798 // Writable ctor is applied to Duplexes, too.
19799 // `realHasInstance` is necessary because using plain `instanceof`
19800 // would return false, as no `_writableState` property is attached.
19801
19802 // Trying to use the custom `instanceof` for Writable here will also break the
19803 // Node.js LazyTransform implementation, which has a non-trivial getter for
19804 // `_writableState` that would lead to infinite recursion.
19805 if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
19806 return new Writable(options);
19807 }
19808
19809 this._writableState = new WritableState(options, this);
19810
19811 // legacy.
19812 this.writable = true;
19813
19814 if (options) {
19815 if (typeof options.write === 'function') this._write = options.write;
19816
19817 if (typeof options.writev === 'function') this._writev = options.writev;
19818 }
19819
19820 Stream.call(this);
19821}
19822
19823// Otherwise people can pipe Writable streams, which is just wrong.
19824Writable.prototype.pipe = function () {
19825 this.emit('error', new Error('Cannot pipe, not readable'));
19826};
19827
19828function writeAfterEnd(stream, cb) {
19829 var er = new Error('write after end');
19830 // TODO: defer error events consistently everywhere, not just the cb
19831 stream.emit('error', er);
19832 processNextTick(cb, er);
19833}
19834
19835// Checks that a user-supplied chunk is valid, especially for the particular
19836// mode the stream is in. Currently this means that `null` is never accepted
19837// and undefined/non-string values are only allowed in object mode.
19838function validChunk(stream, state, chunk, cb) {
19839 var valid = true;
19840 var er = false;
19841
19842 if (chunk === null) {
19843 er = new TypeError('May not write null values to stream');
19844 } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
19845 er = new TypeError('Invalid non-string/buffer chunk');
19846 }
19847 if (er) {
19848 stream.emit('error', er);
19849 processNextTick(cb, er);
19850 valid = false;
19851 }
19852 return valid;
19853}
19854
19855Writable.prototype.write = function (chunk, encoding, cb) {
19856 var state = this._writableState;
19857 var ret = false;
19858 var isBuf = Buffer.isBuffer(chunk);
19859
19860 if (typeof encoding === 'function') {
19861 cb = encoding;
19862 encoding = null;
19863 }
19864
19865 if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
19866
19867 if (typeof cb !== 'function') cb = nop;
19868
19869 if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
19870 state.pendingcb++;
19871 ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
19872 }
19873
19874 return ret;
19875};
19876
19877Writable.prototype.cork = function () {
19878 var state = this._writableState;
19879
19880 state.corked++;
19881};
19882
19883Writable.prototype.uncork = function () {
19884 var state = this._writableState;
19885
19886 if (state.corked) {
19887 state.corked--;
19888
19889 if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
19890 }
19891};
19892
19893Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
19894 // node::ParseEncoding() requires lower case.
19895 if (typeof encoding === 'string') encoding = encoding.toLowerCase();
19896 if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
19897 this._writableState.defaultEncoding = encoding;
19898 return this;
19899};
19900
19901function decodeChunk(state, chunk, encoding) {
19902 if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
19903 chunk = bufferShim.from(chunk, encoding);
19904 }
19905 return chunk;
19906}
19907
19908// if we're already writing something, then just put this
19909// in the queue, and wait our turn. Otherwise, call _write
19910// If we return false, then we need a drain event, so set that flag.
19911function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
19912 if (!isBuf) {
19913 chunk = decodeChunk(state, chunk, encoding);
19914 if (Buffer.isBuffer(chunk)) encoding = 'buffer';
19915 }
19916 var len = state.objectMode ? 1 : chunk.length;
19917
19918 state.length += len;
19919
19920 var ret = state.length < state.highWaterMark;
19921 // we must ensure that previous needDrain will not be reset to false.
19922 if (!ret) state.needDrain = true;
19923
19924 if (state.writing || state.corked) {
19925 var last = state.lastBufferedRequest;
19926 state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
19927 if (last) {
19928 last.next = state.lastBufferedRequest;
19929 } else {
19930 state.bufferedRequest = state.lastBufferedRequest;
19931 }
19932 state.bufferedRequestCount += 1;
19933 } else {
19934 doWrite(stream, state, false, len, chunk, encoding, cb);
19935 }
19936
19937 return ret;
19938}
19939
19940function doWrite(stream, state, writev, len, chunk, encoding, cb) {
19941 state.writelen = len;
19942 state.writecb = cb;
19943 state.writing = true;
19944 state.sync = true;
19945 if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
19946 state.sync = false;
19947}
19948
19949function onwriteError(stream, state, sync, er, cb) {
19950 --state.pendingcb;
19951 if (sync) processNextTick(cb, er);else cb(er);
19952
19953 stream._writableState.errorEmitted = true;
19954 stream.emit('error', er);
19955}
19956
19957function onwriteStateUpdate(state) {
19958 state.writing = false;
19959 state.writecb = null;
19960 state.length -= state.writelen;
19961 state.writelen = 0;
19962}
19963
19964function onwrite(stream, er) {
19965 var state = stream._writableState;
19966 var sync = state.sync;
19967 var cb = state.writecb;
19968
19969 onwriteStateUpdate(state);
19970
19971 if (er) onwriteError(stream, state, sync, er, cb);else {
19972 // Check if we're actually ready to finish, but don't emit yet
19973 var finished = needFinish(state);
19974
19975 if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
19976 clearBuffer(stream, state);
19977 }
19978
19979 if (sync) {
19980 /*<replacement>*/
19981 asyncWrite(afterWrite, stream, state, finished, cb);
19982 /*</replacement>*/
19983 } else {
19984 afterWrite(stream, state, finished, cb);
19985 }
19986 }
19987}
19988
19989function afterWrite(stream, state, finished, cb) {
19990 if (!finished) onwriteDrain(stream, state);
19991 state.pendingcb--;
19992 cb();
19993 finishMaybe(stream, state);
19994}
19995
19996// Must force callback to be called on nextTick, so that we don't
19997// emit 'drain' before the write() consumer gets the 'false' return
19998// value, and has a chance to attach a 'drain' listener.
19999function onwriteDrain(stream, state) {
20000 if (state.length === 0 && state.needDrain) {
20001 state.needDrain = false;
20002 stream.emit('drain');
20003 }
20004}
20005
20006// if there's something in the buffer waiting, then process it
20007function clearBuffer(stream, state) {
20008 state.bufferProcessing = true;
20009 var entry = state.bufferedRequest;
20010
20011 if (stream._writev && entry && entry.next) {
20012 // Fast case, write everything using _writev()
20013 var l = state.bufferedRequestCount;
20014 var buffer = new Array(l);
20015 var holder = state.corkedRequestsFree;
20016 holder.entry = entry;
20017
20018 var count = 0;
20019 while (entry) {
20020 buffer[count] = entry;
20021 entry = entry.next;
20022 count += 1;
20023 }
20024
20025 doWrite(stream, state, true, state.length, buffer, '', holder.finish);
20026
20027 // doWrite is almost always async, defer these to save a bit of time
20028 // as the hot path ends with doWrite
20029 state.pendingcb++;
20030 state.lastBufferedRequest = null;
20031 if (holder.next) {
20032 state.corkedRequestsFree = holder.next;
20033 holder.next = null;
20034 } else {
20035 state.corkedRequestsFree = new CorkedRequest(state);
20036 }
20037 } else {
20038 // Slow case, write chunks one-by-one
20039 while (entry) {
20040 var chunk = entry.chunk;
20041 var encoding = entry.encoding;
20042 var cb = entry.callback;
20043 var len = state.objectMode ? 1 : chunk.length;
20044
20045 doWrite(stream, state, false, len, chunk, encoding, cb);
20046 entry = entry.next;
20047 // if we didn't call the onwrite immediately, then
20048 // it means that we need to wait until it does.
20049 // also, that means that the chunk and cb are currently
20050 // being processed, so move the buffer counter past them.
20051 if (state.writing) {
20052 break;
20053 }
20054 }
20055
20056 if (entry === null) state.lastBufferedRequest = null;
20057 }
20058
20059 state.bufferedRequestCount = 0;
20060 state.bufferedRequest = entry;
20061 state.bufferProcessing = false;
20062}
20063
20064Writable.prototype._write = function (chunk, encoding, cb) {
20065 cb(new Error('_write() is not implemented'));
20066};
20067
20068Writable.prototype._writev = null;
20069
20070Writable.prototype.end = function (chunk, encoding, cb) {
20071 var state = this._writableState;
20072
20073 if (typeof chunk === 'function') {
20074 cb = chunk;
20075 chunk = null;
20076 encoding = null;
20077 } else if (typeof encoding === 'function') {
20078 cb = encoding;
20079 encoding = null;
20080 }
20081
20082 if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
20083
20084 // .end() fully uncorks
20085 if (state.corked) {
20086 state.corked = 1;
20087 this.uncork();
20088 }
20089
20090 // ignore unnecessary end() calls.
20091 if (!state.ending && !state.finished) endWritable(this, state, cb);
20092};
20093
20094function needFinish(state) {
20095 return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
20096}
20097
20098function prefinish(stream, state) {
20099 if (!state.prefinished) {
20100 state.prefinished = true;
20101 stream.emit('prefinish');
20102 }
20103}
20104
20105function finishMaybe(stream, state) {
20106 var need = needFinish(state);
20107 if (need) {
20108 if (state.pendingcb === 0) {
20109 prefinish(stream, state);
20110 state.finished = true;
20111 stream.emit('finish');
20112 } else {
20113 prefinish(stream, state);
20114 }
20115 }
20116 return need;
20117}
20118
20119function endWritable(stream, state, cb) {
20120 state.ending = true;
20121 finishMaybe(stream, state);
20122 if (cb) {
20123 if (state.finished) processNextTick(cb);else stream.once('finish', cb);
20124 }
20125 state.ended = true;
20126 stream.writable = false;
20127}
20128
20129// It seems a linked list but it is not
20130// there will be only 2 of these for each stream
20131function CorkedRequest(state) {
20132 var _this = this;
20133
20134 this.next = null;
20135 this.entry = null;
20136 this.finish = function (err) {
20137 var entry = _this.entry;
20138 _this.entry = null;
20139 while (entry) {
20140 var cb = entry.callback;
20141 state.pendingcb--;
20142 cb(err);
20143 entry = entry.next;
20144 }
20145 if (state.corkedRequestsFree) {
20146 state.corkedRequestsFree.next = _this;
20147 } else {
20148 state.corkedRequestsFree = _this;
20149 }
20150 };
20151}
20152}).call(this,require('_process'))
20153},{"./_stream_duplex":121,"./internal/streams/stream":127,"_process":112,"buffer":47,"buffer-shims":45,"core-util-is":49,"inherits":95,"process-nextick-args":111,"util-deprecate":145}],126:[function(require,module,exports){
20154'use strict';
20155
20156var Buffer = require('buffer').Buffer;
20157/*<replacement>*/
20158var bufferShim = require('buffer-shims');
20159/*</replacement>*/
20160
20161module.exports = BufferList;
20162
20163function BufferList() {
20164 this.head = null;
20165 this.tail = null;
20166 this.length = 0;
20167}
20168
20169BufferList.prototype.push = function (v) {
20170 var entry = { data: v, next: null };
20171 if (this.length > 0) this.tail.next = entry;else this.head = entry;
20172 this.tail = entry;
20173 ++this.length;
20174};
20175
20176BufferList.prototype.unshift = function (v) {
20177 var entry = { data: v, next: this.head };
20178 if (this.length === 0) this.tail = entry;
20179 this.head = entry;
20180 ++this.length;
20181};
20182
20183BufferList.prototype.shift = function () {
20184 if (this.length === 0) return;
20185 var ret = this.head.data;
20186 if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
20187 --this.length;
20188 return ret;
20189};
20190
20191BufferList.prototype.clear = function () {
20192 this.head = this.tail = null;
20193 this.length = 0;
20194};
20195
20196BufferList.prototype.join = function (s) {
20197 if (this.length === 0) return '';
20198 var p = this.head;
20199 var ret = '' + p.data;
20200 while (p = p.next) {
20201 ret += s + p.data;
20202 }return ret;
20203};
20204
20205BufferList.prototype.concat = function (n) {
20206 if (this.length === 0) return bufferShim.alloc(0);
20207 if (this.length === 1) return this.head.data;
20208 var ret = bufferShim.allocUnsafe(n >>> 0);
20209 var p = this.head;
20210 var i = 0;
20211 while (p) {
20212 p.data.copy(ret, i);
20213 i += p.data.length;
20214 p = p.next;
20215 }
20216 return ret;
20217};
20218},{"buffer":47,"buffer-shims":45}],127:[function(require,module,exports){
20219module.exports = require('events').EventEmitter;
20220
20221},{"events":83}],128:[function(require,module,exports){
20222'use strict';
20223
20224var Buffer = require('safe-buffer').Buffer;
20225
20226var isEncoding = Buffer.isEncoding || function (encoding) {
20227 encoding = '' + encoding;
20228 switch (encoding && encoding.toLowerCase()) {
20229 case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
20230 return true;
20231 default:
20232 return false;
20233 }
20234};
20235
20236function _normalizeEncoding(enc) {
20237 if (!enc) return 'utf8';
20238 var retried;
20239 while (true) {
20240 switch (enc) {
20241 case 'utf8':
20242 case 'utf-8':
20243 return 'utf8';
20244 case 'ucs2':
20245 case 'ucs-2':
20246 case 'utf16le':
20247 case 'utf-16le':
20248 return 'utf16le';
20249 case 'latin1':
20250 case 'binary':
20251 return 'latin1';
20252 case 'base64':
20253 case 'ascii':
20254 case 'hex':
20255 return enc;
20256 default:
20257 if (retried) return; // undefined
20258 enc = ('' + enc).toLowerCase();
20259 retried = true;
20260 }
20261 }
20262};
20263
20264// Do not cache `Buffer.isEncoding` when checking encoding names as some
20265// modules monkey-patch it to support additional encodings
20266function normalizeEncoding(enc) {
20267 var nenc = _normalizeEncoding(enc);
20268 if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
20269 return nenc || enc;
20270}
20271
20272// StringDecoder provides an interface for efficiently splitting a series of
20273// buffers into a series of JS strings without breaking apart multi-byte
20274// characters.
20275exports.StringDecoder = StringDecoder;
20276function StringDecoder(encoding) {
20277 this.encoding = normalizeEncoding(encoding);
20278 var nb;
20279 switch (this.encoding) {
20280 case 'utf16le':
20281 this.text = utf16Text;
20282 this.end = utf16End;
20283 nb = 4;
20284 break;
20285 case 'utf8':
20286 this.fillLast = utf8FillLast;
20287 nb = 4;
20288 break;
20289 case 'base64':
20290 this.text = base64Text;
20291 this.end = base64End;
20292 nb = 3;
20293 break;
20294 default:
20295 this.write = simpleWrite;
20296 this.end = simpleEnd;
20297 return;
20298 }
20299 this.lastNeed = 0;
20300 this.lastTotal = 0;
20301 this.lastChar = Buffer.allocUnsafe(nb);
20302}
20303
20304StringDecoder.prototype.write = function (buf) {
20305 if (buf.length === 0) return '';
20306 var r;
20307 var i;
20308 if (this.lastNeed) {
20309 r = this.fillLast(buf);
20310 if (r === undefined) return '';
20311 i = this.lastNeed;
20312 this.lastNeed = 0;
20313 } else {
20314 i = 0;
20315 }
20316 if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
20317 return r || '';
20318};
20319
20320StringDecoder.prototype.end = utf8End;
20321
20322// Returns only complete characters in a Buffer
20323StringDecoder.prototype.text = utf8Text;
20324
20325// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
20326StringDecoder.prototype.fillLast = function (buf) {
20327 if (this.lastNeed <= buf.length) {
20328 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
20329 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
20330 }
20331 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
20332 this.lastNeed -= buf.length;
20333};
20334
20335// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
20336// continuation byte.
20337function utf8CheckByte(byte) {
20338 if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
20339 return -1;
20340}
20341
20342// Checks at most 3 bytes at the end of a Buffer in order to detect an
20343// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
20344// needed to complete the UTF-8 character (if applicable) are returned.
20345function utf8CheckIncomplete(self, buf, i) {
20346 var j = buf.length - 1;
20347 if (j < i) return 0;
20348 var nb = utf8CheckByte(buf[j]);
20349 if (nb >= 0) {
20350 if (nb > 0) self.lastNeed = nb - 1;
20351 return nb;
20352 }
20353 if (--j < i) return 0;
20354 nb = utf8CheckByte(buf[j]);
20355 if (nb >= 0) {
20356 if (nb > 0) self.lastNeed = nb - 2;
20357 return nb;
20358 }
20359 if (--j < i) return 0;
20360 nb = utf8CheckByte(buf[j]);
20361 if (nb >= 0) {
20362 if (nb > 0) {
20363 if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
20364 }
20365 return nb;
20366 }
20367 return 0;
20368}
20369
20370// Validates as many continuation bytes for a multi-byte UTF-8 character as
20371// needed or are available. If we see a non-continuation byte where we expect
20372// one, we "replace" the validated continuation bytes we've seen so far with
20373// UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding
20374// behavior. The continuation byte check is included three times in the case
20375// where all of the continuation bytes for a character exist in the same buffer.
20376// It is also done this way as a slight performance increase instead of using a
20377// loop.
20378function utf8CheckExtraBytes(self, buf, p) {
20379 if ((buf[0] & 0xC0) !== 0x80) {
20380 self.lastNeed = 0;
20381 return '\ufffd'.repeat(p);
20382 }
20383 if (self.lastNeed > 1 && buf.length > 1) {
20384 if ((buf[1] & 0xC0) !== 0x80) {
20385 self.lastNeed = 1;
20386 return '\ufffd'.repeat(p + 1);
20387 }
20388 if (self.lastNeed > 2 && buf.length > 2) {
20389 if ((buf[2] & 0xC0) !== 0x80) {
20390 self.lastNeed = 2;
20391 return '\ufffd'.repeat(p + 2);
20392 }
20393 }
20394 }
20395}
20396
20397// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
20398function utf8FillLast(buf) {
20399 var p = this.lastTotal - this.lastNeed;
20400 var r = utf8CheckExtraBytes(this, buf, p);
20401 if (r !== undefined) return r;
20402 if (this.lastNeed <= buf.length) {
20403 buf.copy(this.lastChar, p, 0, this.lastNeed);
20404 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
20405 }
20406 buf.copy(this.lastChar, p, 0, buf.length);
20407 this.lastNeed -= buf.length;
20408}
20409
20410// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
20411// partial character, the character's bytes are buffered until the required
20412// number of bytes are available.
20413function utf8Text(buf, i) {
20414 var total = utf8CheckIncomplete(this, buf, i);
20415 if (!this.lastNeed) return buf.toString('utf8', i);
20416 this.lastTotal = total;
20417 var end = buf.length - (total - this.lastNeed);
20418 buf.copy(this.lastChar, 0, end);
20419 return buf.toString('utf8', i, end);
20420}
20421
20422// For UTF-8, a replacement character for each buffered byte of a (partial)
20423// character needs to be added to the output.
20424function utf8End(buf) {
20425 var r = buf && buf.length ? this.write(buf) : '';
20426 if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed);
20427 return r;
20428}
20429
20430// UTF-16LE typically needs two bytes per character, but even if we have an even
20431// number of bytes available, we need to check if we end on a leading/high
20432// surrogate. In that case, we need to wait for the next two bytes in order to
20433// decode the last character properly.
20434function utf16Text(buf, i) {
20435 if ((buf.length - i) % 2 === 0) {
20436 var r = buf.toString('utf16le', i);
20437 if (r) {
20438 var c = r.charCodeAt(r.length - 1);
20439 if (c >= 0xD800 && c <= 0xDBFF) {
20440 this.lastNeed = 2;
20441 this.lastTotal = 4;
20442 this.lastChar[0] = buf[buf.length - 2];
20443 this.lastChar[1] = buf[buf.length - 1];
20444 return r.slice(0, -1);
20445 }
20446 }
20447 return r;
20448 }
20449 this.lastNeed = 1;
20450 this.lastTotal = 2;
20451 this.lastChar[0] = buf[buf.length - 1];
20452 return buf.toString('utf16le', i, buf.length - 1);
20453}
20454
20455// For UTF-16LE we do not explicitly append special replacement characters if we
20456// end on a partial character, we simply let v8 handle that.
20457function utf16End(buf) {
20458 var r = buf && buf.length ? this.write(buf) : '';
20459 if (this.lastNeed) {
20460 var end = this.lastTotal - this.lastNeed;
20461 return r + this.lastChar.toString('utf16le', 0, end);
20462 }
20463 return r;
20464}
20465
20466function base64Text(buf, i) {
20467 var n = (buf.length - i) % 3;
20468 if (n === 0) return buf.toString('base64', i);
20469 this.lastNeed = 3 - n;
20470 this.lastTotal = 3;
20471 if (n === 1) {
20472 this.lastChar[0] = buf[buf.length - 1];
20473 } else {
20474 this.lastChar[0] = buf[buf.length - 2];
20475 this.lastChar[1] = buf[buf.length - 1];
20476 }
20477 return buf.toString('base64', i, buf.length - n);
20478}
20479
20480function base64End(buf) {
20481 var r = buf && buf.length ? this.write(buf) : '';
20482 if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
20483 return r;
20484}
20485
20486// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
20487function simpleWrite(buf) {
20488 return buf.toString(this.encoding);
20489}
20490
20491function simpleEnd(buf) {
20492 return buf && buf.length ? this.write(buf) : '';
20493}
20494},{"safe-buffer":134}],129:[function(require,module,exports){
20495module.exports = require('./readable').PassThrough
20496
20497},{"./readable":130}],130:[function(require,module,exports){
20498exports = module.exports = require('./lib/_stream_readable.js');
20499exports.Stream = exports;
20500exports.Readable = exports;
20501exports.Writable = require('./lib/_stream_writable.js');
20502exports.Duplex = require('./lib/_stream_duplex.js');
20503exports.Transform = require('./lib/_stream_transform.js');
20504exports.PassThrough = require('./lib/_stream_passthrough.js');
20505
20506},{"./lib/_stream_duplex.js":121,"./lib/_stream_passthrough.js":122,"./lib/_stream_readable.js":123,"./lib/_stream_transform.js":124,"./lib/_stream_writable.js":125}],131:[function(require,module,exports){
20507module.exports = require('./readable').Transform
20508
20509},{"./readable":130}],132:[function(require,module,exports){
20510module.exports = require('./lib/_stream_writable.js');
20511
20512},{"./lib/_stream_writable.js":125}],133:[function(require,module,exports){
22161(function (Buffer){ 20513(function (Buffer){
22162'use strict' 20514'use strict'
22163var inherits = require('inherits') 20515var inherits = require('inherits')
@@ -22452,143 +20804,71 @@ function fn5 (a, b, c, d, e, m, k, s) {
22452module.exports = RIPEMD160 20804module.exports = RIPEMD160
22453 20805
22454}).call(this,require("buffer").Buffer) 20806}).call(this,require("buffer").Buffer)
22455},{"buffer":5,"hash-base":113,"inherits":121}],128:[function(require,module,exports){ 20807},{"buffer":47,"hash-base":85,"inherits":95}],134:[function(require,module,exports){
22456/* eslint-disable node/no-deprecated-api */ 20808module.exports = require('buffer')
22457var buffer = require('buffer')
22458var Buffer = buffer.Buffer
22459
22460// alternative to using Object.keys for old browsers
22461function copyProps (src, dst) {
22462 for (var key in src) {
22463 dst[key] = src[key]
22464 }
22465}
22466if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
22467 module.exports = buffer
22468} else {
22469 // Copy properties from require('buffer')
22470 copyProps(buffer, exports)
22471 exports.Buffer = SafeBuffer
22472}
22473
22474function SafeBuffer (arg, encodingOrOffset, length) {
22475 return Buffer(arg, encodingOrOffset, length)
22476}
22477
22478// Copy static methods from Buffer
22479copyProps(Buffer, SafeBuffer)
22480
22481SafeBuffer.from = function (arg, encodingOrOffset, length) {
22482 if (typeof arg === 'number') {
22483 throw new TypeError('Argument must not be a number')
22484 }
22485 return Buffer(arg, encodingOrOffset, length)
22486}
22487
22488SafeBuffer.alloc = function (size, fill, encoding) {
22489 if (typeof size !== 'number') {
22490 throw new TypeError('Argument must be a number')
22491 }
22492 var buf = Buffer(size)
22493 if (fill !== undefined) {
22494 if (typeof encoding === 'string') {
22495 buf.fill(fill, encoding)
22496 } else {
22497 buf.fill(fill)
22498 }
22499 } else {
22500 buf.fill(0)
22501 }
22502 return buf
22503}
22504
22505SafeBuffer.allocUnsafe = function (size) {
22506 if (typeof size !== 'number') {
22507 throw new TypeError('Argument must be a number')
22508 }
22509 return Buffer(size)
22510}
22511
22512SafeBuffer.allocUnsafeSlow = function (size) {
22513 if (typeof size !== 'number') {
22514 throw new TypeError('Argument must be a number')
22515 }
22516 return buffer.SlowBuffer(size)
22517}
22518
22519},{"buffer":5}],129:[function(require,module,exports){
22520var Buffer = require('safe-buffer').Buffer
22521 20809
20810},{"buffer":47}],135:[function(require,module,exports){
20811(function (Buffer){
22522// prototype class for hash functions 20812// prototype class for hash functions
22523function Hash (blockSize, finalSize) { 20813function Hash (blockSize, finalSize) {
22524 this._block = Buffer.alloc(blockSize) 20814 this._block = new Buffer(blockSize)
22525 this._finalSize = finalSize 20815 this._finalSize = finalSize
22526 this._blockSize = blockSize 20816 this._blockSize = blockSize
22527 this._len = 0 20817 this._len = 0
20818 this._s = 0
22528} 20819}
22529 20820
22530Hash.prototype.update = function (data, enc) { 20821Hash.prototype.update = function (data, enc) {
22531 if (typeof data === 'string') { 20822 if (typeof data === 'string') {
22532 enc = enc || 'utf8' 20823 enc = enc || 'utf8'
22533 data = Buffer.from(data, enc) 20824 data = new Buffer(data, enc)
22534 } 20825 }
22535 20826
22536 var block = this._block 20827 var l = this._len += data.length
22537 var blockSize = this._blockSize 20828 var s = this._s || 0
22538 var length = data.length 20829 var f = 0
22539 var accum = this._len 20830 var buffer = this._block
22540 20831
22541 for (var offset = 0; offset < length;) { 20832 while (s < l) {
22542 var assigned = accum % blockSize 20833 var t = Math.min(data.length, f + this._blockSize - (s % this._blockSize))
22543 var remainder = Math.min(length - offset, blockSize - assigned) 20834 var ch = (t - f)
22544 20835
22545 for (var i = 0; i < remainder; i++) { 20836 for (var i = 0; i < ch; i++) {
22546 block[assigned + i] = data[offset + i] 20837 buffer[(s % this._blockSize) + i] = data[i + f]
22547 } 20838 }
22548 20839
22549 accum += remainder 20840 s += ch
22550 offset += remainder 20841 f += ch
22551 20842
22552 if ((accum % blockSize) === 0) { 20843 if ((s % this._blockSize) === 0) {
22553 this._update(block) 20844 this._update(buffer)
22554 } 20845 }
22555 } 20846 }
20847 this._s = s
22556 20848
22557 this._len += length
22558 return this 20849 return this
22559} 20850}
22560 20851
22561Hash.prototype.digest = function (enc) { 20852Hash.prototype.digest = function (enc) {
22562 var rem = this._len % this._blockSize 20853 // Suppose the length of the message M, in bits, is l
20854 var l = this._len * 8
22563 20855
22564 this._block[rem] = 0x80 20856 // Append the bit 1 to the end of the message
20857 this._block[this._len % this._blockSize] = 0x80
22565 20858
22566 // zero (rem + 1) trailing bits, where (rem + 1) is the smallest 20859 // and then k zero bits, where k is the smallest non-negative solution to the equation (l + 1 + k) === finalSize mod blockSize
22567 // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize 20860 this._block.fill(0, this._len % this._blockSize + 1)
22568 this._block.fill(0, rem + 1)
22569 20861
22570 if (rem >= this._finalSize) { 20862 if (l % (this._blockSize * 8) >= this._finalSize * 8) {
22571 this._update(this._block) 20863 this._update(this._block)
22572 this._block.fill(0) 20864 this._block.fill(0)
22573 } 20865 }
22574 20866
22575 var bits = this._len * 8 20867 // to this append the block which is equal to the number l written in binary
22576 20868 // TODO: handle case where l is > Math.pow(2, 29)
22577 // uint32 20869 this._block.writeInt32BE(l, this._blockSize - 4)
22578 if (bits <= 0xffffffff) {
22579 this._block.writeUInt32BE(bits, this._blockSize - 4)
22580
22581 // uint64
22582 } else {
22583 var lowBits = bits & 0xffffffff
22584 var highBits = (bits - lowBits) / 0x100000000
22585
22586 this._block.writeUInt32BE(highBits, this._blockSize - 8)
22587 this._block.writeUInt32BE(lowBits, this._blockSize - 4)
22588 }
22589 20870
22590 this._update(this._block) 20871 var hash = this._update(this._block) || this._hash()
22591 var hash = this._hash()
22592 20872
22593 return enc ? hash.toString(enc) : hash 20873 return enc ? hash.toString(enc) : hash
22594} 20874}
@@ -22599,7 +20879,8 @@ Hash.prototype._update = function () {
22599 20879
22600module.exports = Hash 20880module.exports = Hash
22601 20881
22602},{"safe-buffer":128}],130:[function(require,module,exports){ 20882}).call(this,require("buffer").Buffer)
20883},{"buffer":47}],136:[function(require,module,exports){
22603var exports = module.exports = function SHA (algorithm) { 20884var exports = module.exports = function SHA (algorithm) {
22604 algorithm = algorithm.toLowerCase() 20885 algorithm = algorithm.toLowerCase()
22605 20886
@@ -22616,7 +20897,8 @@ exports.sha256 = require('./sha256')
22616exports.sha384 = require('./sha384') 20897exports.sha384 = require('./sha384')
22617exports.sha512 = require('./sha512') 20898exports.sha512 = require('./sha512')
22618 20899
22619},{"./sha":131,"./sha1":132,"./sha224":133,"./sha256":134,"./sha384":135,"./sha512":136}],131:[function(require,module,exports){ 20900},{"./sha":137,"./sha1":138,"./sha224":139,"./sha256":140,"./sha384":141,"./sha512":142}],137:[function(require,module,exports){
20901(function (Buffer){
22620/* 20902/*
22621 * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined 20903 * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
22622 * in FIPS PUB 180-1 20904 * in FIPS PUB 180-1
@@ -22627,7 +20909,6 @@ exports.sha512 = require('./sha512')
22627 20909
22628var inherits = require('inherits') 20910var inherits = require('inherits')
22629var Hash = require('./hash') 20911var Hash = require('./hash')
22630var Buffer = require('safe-buffer').Buffer
22631 20912
22632var K = [ 20913var K = [
22633 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0 20914 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
@@ -22699,7 +20980,7 @@ Sha.prototype._update = function (M) {
22699} 20980}
22700 20981
22701Sha.prototype._hash = function () { 20982Sha.prototype._hash = function () {
22702 var H = Buffer.allocUnsafe(20) 20983 var H = new Buffer(20)
22703 20984
22704 H.writeInt32BE(this._a | 0, 0) 20985 H.writeInt32BE(this._a | 0, 0)
22705 H.writeInt32BE(this._b | 0, 4) 20986 H.writeInt32BE(this._b | 0, 4)
@@ -22712,7 +20993,9 @@ Sha.prototype._hash = function () {
22712 20993
22713module.exports = Sha 20994module.exports = Sha
22714 20995
22715},{"./hash":129,"inherits":121,"safe-buffer":128}],132:[function(require,module,exports){ 20996}).call(this,require("buffer").Buffer)
20997},{"./hash":135,"buffer":47,"inherits":95}],138:[function(require,module,exports){
20998(function (Buffer){
22716/* 20999/*
22717 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined 21000 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
22718 * in FIPS PUB 180-1 21001 * in FIPS PUB 180-1
@@ -22724,7 +21007,6 @@ module.exports = Sha
22724 21007
22725var inherits = require('inherits') 21008var inherits = require('inherits')
22726var Hash = require('./hash') 21009var Hash = require('./hash')
22727var Buffer = require('safe-buffer').Buffer
22728 21010
22729var K = [ 21011var K = [
22730 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0 21012 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
@@ -22800,7 +21082,7 @@ Sha1.prototype._update = function (M) {
22800} 21082}
22801 21083
22802Sha1.prototype._hash = function () { 21084Sha1.prototype._hash = function () {
22803 var H = Buffer.allocUnsafe(20) 21085 var H = new Buffer(20)
22804 21086
22805 H.writeInt32BE(this._a | 0, 0) 21087 H.writeInt32BE(this._a | 0, 0)
22806 H.writeInt32BE(this._b | 0, 4) 21088 H.writeInt32BE(this._b | 0, 4)
@@ -22813,7 +21095,9 @@ Sha1.prototype._hash = function () {
22813 21095
22814module.exports = Sha1 21096module.exports = Sha1
22815 21097
22816},{"./hash":129,"inherits":121,"safe-buffer":128}],133:[function(require,module,exports){ 21098}).call(this,require("buffer").Buffer)
21099},{"./hash":135,"buffer":47,"inherits":95}],139:[function(require,module,exports){
21100(function (Buffer){
22817/** 21101/**
22818 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined 21102 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
22819 * in FIPS 180-2 21103 * in FIPS 180-2
@@ -22825,7 +21109,6 @@ module.exports = Sha1
22825var inherits = require('inherits') 21109var inherits = require('inherits')
22826var Sha256 = require('./sha256') 21110var Sha256 = require('./sha256')
22827var Hash = require('./hash') 21111var Hash = require('./hash')
22828var Buffer = require('safe-buffer').Buffer
22829 21112
22830var W = new Array(64) 21113var W = new Array(64)
22831 21114
@@ -22853,7 +21136,7 @@ Sha224.prototype.init = function () {
22853} 21136}
22854 21137
22855Sha224.prototype._hash = function () { 21138Sha224.prototype._hash = function () {
22856 var H = Buffer.allocUnsafe(28) 21139 var H = new Buffer(28)
22857 21140
22858 H.writeInt32BE(this._a, 0) 21141 H.writeInt32BE(this._a, 0)
22859 H.writeInt32BE(this._b, 4) 21142 H.writeInt32BE(this._b, 4)
@@ -22868,7 +21151,9 @@ Sha224.prototype._hash = function () {
22868 21151
22869module.exports = Sha224 21152module.exports = Sha224
22870 21153
22871},{"./hash":129,"./sha256":134,"inherits":121,"safe-buffer":128}],134:[function(require,module,exports){ 21154}).call(this,require("buffer").Buffer)
21155},{"./hash":135,"./sha256":140,"buffer":47,"inherits":95}],140:[function(require,module,exports){
21156(function (Buffer){
22872/** 21157/**
22873 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined 21158 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
22874 * in FIPS 180-2 21159 * in FIPS 180-2
@@ -22879,7 +21164,6 @@ module.exports = Sha224
22879 21164
22880var inherits = require('inherits') 21165var inherits = require('inherits')
22881var Hash = require('./hash') 21166var Hash = require('./hash')
22882var Buffer = require('safe-buffer').Buffer
22883 21167
22884var K = [ 21168var K = [
22885 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 21169 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
@@ -22989,7 +21273,7 @@ Sha256.prototype._update = function (M) {
22989} 21273}
22990 21274
22991Sha256.prototype._hash = function () { 21275Sha256.prototype._hash = function () {
22992 var H = Buffer.allocUnsafe(32) 21276 var H = new Buffer(32)
22993 21277
22994 H.writeInt32BE(this._a, 0) 21278 H.writeInt32BE(this._a, 0)
22995 H.writeInt32BE(this._b, 4) 21279 H.writeInt32BE(this._b, 4)
@@ -23005,11 +21289,12 @@ Sha256.prototype._hash = function () {
23005 21289
23006module.exports = Sha256 21290module.exports = Sha256
23007 21291
23008},{"./hash":129,"inherits":121,"safe-buffer":128}],135:[function(require,module,exports){ 21292}).call(this,require("buffer").Buffer)
21293},{"./hash":135,"buffer":47,"inherits":95}],141:[function(require,module,exports){
21294(function (Buffer){
23009var inherits = require('inherits') 21295var inherits = require('inherits')
23010var SHA512 = require('./sha512') 21296var SHA512 = require('./sha512')
23011var Hash = require('./hash') 21297var Hash = require('./hash')
23012var Buffer = require('safe-buffer').Buffer
23013 21298
23014var W = new Array(160) 21299var W = new Array(160)
23015 21300
@@ -23045,7 +21330,7 @@ Sha384.prototype.init = function () {
23045} 21330}
23046 21331
23047Sha384.prototype._hash = function () { 21332Sha384.prototype._hash = function () {
23048 var H = Buffer.allocUnsafe(48) 21333 var H = new Buffer(48)
23049 21334
23050 function writeInt64BE (h, l, offset) { 21335 function writeInt64BE (h, l, offset) {
23051 H.writeInt32BE(h, offset) 21336 H.writeInt32BE(h, offset)
@@ -23064,10 +21349,11 @@ Sha384.prototype._hash = function () {
23064 21349
23065module.exports = Sha384 21350module.exports = Sha384
23066 21351
23067},{"./hash":129,"./sha512":136,"inherits":121,"safe-buffer":128}],136:[function(require,module,exports){ 21352}).call(this,require("buffer").Buffer)
21353},{"./hash":135,"./sha512":142,"buffer":47,"inherits":95}],142:[function(require,module,exports){
21354(function (Buffer){
23068var inherits = require('inherits') 21355var inherits = require('inherits')
23069var Hash = require('./hash') 21356var Hash = require('./hash')
23070var Buffer = require('safe-buffer').Buffer
23071 21357
23072var K = [ 21358var K = [
23073 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 21359 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
@@ -23305,7 +21591,7 @@ Sha512.prototype._update = function (M) {
23305} 21591}
23306 21592
23307Sha512.prototype._hash = function () { 21593Sha512.prototype._hash = function () {
23308 var H = Buffer.allocUnsafe(64) 21594 var H = new Buffer(64)
23309 21595
23310 function writeInt64BE (h, l, offset) { 21596 function writeInt64BE (h, l, offset) {
23311 H.writeInt32BE(h, offset) 21597 H.writeInt32BE(h, offset)
@@ -23326,610 +21612,6306 @@ Sha512.prototype._hash = function () {
23326 21612
23327module.exports = Sha512 21613module.exports = Sha512
23328 21614
23329},{"./hash":129,"inherits":121,"safe-buffer":128}],137:[function(require,module,exports){ 21615}).call(this,require("buffer").Buffer)
23330var native = require('./native') 21616},{"./hash":135,"buffer":47,"inherits":95}],143:[function(require,module,exports){
21617// Copyright Joyent, Inc. and other Node contributors.
21618//
21619// Permission is hereby granted, free of charge, to any person obtaining a
21620// copy of this software and associated documentation files (the
21621// "Software"), to deal in the Software without restriction, including
21622// without limitation the rights to use, copy, modify, merge, publish,
21623// distribute, sublicense, and/or sell copies of the Software, and to permit
21624// persons to whom the Software is furnished to do so, subject to the
21625// following conditions:
21626//
21627// The above copyright notice and this permission notice shall be included
21628// in all copies or substantial portions of the Software.
21629//
21630// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21631// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21632// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
21633// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21634// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21635// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21636// USE OR OTHER DEALINGS IN THE SOFTWARE.
21637
21638module.exports = Stream;
21639
21640var EE = require('events').EventEmitter;
21641var inherits = require('inherits');
21642
21643inherits(Stream, EE);
21644Stream.Readable = require('readable-stream/readable.js');
21645Stream.Writable = require('readable-stream/writable.js');
21646Stream.Duplex = require('readable-stream/duplex.js');
21647Stream.Transform = require('readable-stream/transform.js');
21648Stream.PassThrough = require('readable-stream/passthrough.js');
21649
21650// Backwards-compat with node 0.4.x
21651Stream.Stream = Stream;
21652
21653
21654
21655// old-style streams. Note that the pipe method (the only relevant
21656// part of this class) is overridden in the Readable class.
23331 21657
23332function getTypeName (fn) { 21658function Stream() {
23333 return fn.name || fn.toString().match(/function (.*?)\s*\(/)[1] 21659 EE.call(this);
23334} 21660}
23335 21661
23336function getValueTypeName (value) { 21662Stream.prototype.pipe = function(dest, options) {
23337 return native.Nil(value) ? '' : getTypeName(value.constructor) 21663 var source = this;
21664
21665 function ondata(chunk) {
21666 if (dest.writable) {
21667 if (false === dest.write(chunk) && source.pause) {
21668 source.pause();
21669 }
21670 }
21671 }
21672
21673 source.on('data', ondata);
21674
21675 function ondrain() {
21676 if (source.readable && source.resume) {
21677 source.resume();
21678 }
21679 }
21680
21681 dest.on('drain', ondrain);
21682
21683 // If the 'end' option is not supplied, dest.end() will be called when
21684 // source gets the 'end' or 'close' events. Only dest.end() once.
21685 if (!dest._isStdio && (!options || options.end !== false)) {
21686 source.on('end', onend);
21687 source.on('close', onclose);
21688 }
21689
21690 var didOnEnd = false;
21691 function onend() {
21692 if (didOnEnd) return;
21693 didOnEnd = true;
21694
21695 dest.end();
21696 }
21697
21698
21699 function onclose() {
21700 if (didOnEnd) return;
21701 didOnEnd = true;
21702
21703 if (typeof dest.destroy === 'function') dest.destroy();
21704 }
21705
21706 // don't leave dangling pipes when there are errors.
21707 function onerror(er) {
21708 cleanup();
21709 if (EE.listenerCount(this, 'error') === 0) {
21710 throw er; // Unhandled stream error in pipe.
21711 }
21712 }
21713
21714 source.on('error', onerror);
21715 dest.on('error', onerror);
21716
21717 // remove all the event listeners that were added.
21718 function cleanup() {
21719 source.removeListener('data', ondata);
21720 dest.removeListener('drain', ondrain);
21721
21722 source.removeListener('end', onend);
21723 source.removeListener('close', onclose);
21724
21725 source.removeListener('error', onerror);
21726 dest.removeListener('error', onerror);
21727
21728 source.removeListener('end', cleanup);
21729 source.removeListener('close', cleanup);
21730
21731 dest.removeListener('close', cleanup);
21732 }
21733
21734 source.on('end', cleanup);
21735 source.on('close', cleanup);
21736
21737 dest.on('close', cleanup);
21738
21739 dest.emit('pipe', source);
21740
21741 // Allow for unix-like usage: A.pipe(B).pipe(C)
21742 return dest;
21743};
21744
21745},{"events":83,"inherits":95,"readable-stream/duplex.js":120,"readable-stream/passthrough.js":129,"readable-stream/readable.js":130,"readable-stream/transform.js":131,"readable-stream/writable.js":132}],144:[function(require,module,exports){
21746// Copyright Joyent, Inc. and other Node contributors.
21747//
21748// Permission is hereby granted, free of charge, to any person obtaining a
21749// copy of this software and associated documentation files (the
21750// "Software"), to deal in the Software without restriction, including
21751// without limitation the rights to use, copy, modify, merge, publish,
21752// distribute, sublicense, and/or sell copies of the Software, and to permit
21753// persons to whom the Software is furnished to do so, subject to the
21754// following conditions:
21755//
21756// The above copyright notice and this permission notice shall be included
21757// in all copies or substantial portions of the Software.
21758//
21759// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21760// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21761// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
21762// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21763// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21764// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21765// USE OR OTHER DEALINGS IN THE SOFTWARE.
21766
21767var Buffer = require('buffer').Buffer;
21768
21769var isBufferEncoding = Buffer.isEncoding
21770 || function(encoding) {
21771 switch (encoding && encoding.toLowerCase()) {
21772 case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
21773 default: return false;
21774 }
21775 }
21776
21777
21778function assertEncoding(encoding) {
21779 if (encoding && !isBufferEncoding(encoding)) {
21780 throw new Error('Unknown encoding: ' + encoding);
21781 }
23338} 21782}
23339 21783
23340function getValue (value) { 21784// StringDecoder provides an interface for efficiently splitting a series of
23341 if (native.Function(value)) return '' 21785// buffers into a series of JS strings without breaking apart multi-byte
23342 if (native.String(value)) return JSON.stringify(value) 21786// characters. CESU-8 is handled as part of the UTF-8 encoding.
23343 if (value && native.Object(value)) return '' 21787//
23344 return value 21788// @TODO Handling all encodings inside a single object makes it very difficult
21789// to reason about this code, so it should be split up in the future.
21790// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
21791// points as used by CESU-8.
21792var StringDecoder = exports.StringDecoder = function(encoding) {
21793 this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
21794 assertEncoding(encoding);
21795 switch (this.encoding) {
21796 case 'utf8':
21797 // CESU-8 represents each of Surrogate Pair by 3-bytes
21798 this.surrogateSize = 3;
21799 break;
21800 case 'ucs2':
21801 case 'utf16le':
21802 // UTF-16 represents each of Surrogate Pair by 2-bytes
21803 this.surrogateSize = 2;
21804 this.detectIncompleteChar = utf16DetectIncompleteChar;
21805 break;
21806 case 'base64':
21807 // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
21808 this.surrogateSize = 3;
21809 this.detectIncompleteChar = base64DetectIncompleteChar;
21810 break;
21811 default:
21812 this.write = passThroughWrite;
21813 return;
21814 }
21815
21816 // Enough space to store all bytes of a single character. UTF-8 needs 4
21817 // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
21818 this.charBuffer = new Buffer(6);
21819 // Number of bytes received for the current incomplete multi-byte character.
21820 this.charReceived = 0;
21821 // Number of bytes expected for the current incomplete multi-byte character.
21822 this.charLength = 0;
21823};
21824
21825
21826// write decodes the given buffer and returns it as JS string that is
21827// guaranteed to not contain any partial multi-byte characters. Any partial
21828// character found at the end of the buffer is buffered up, and will be
21829// returned when calling write again with the remaining bytes.
21830//
21831// Note: Converting a Buffer containing an orphan surrogate to a String
21832// currently works, but converting a String to a Buffer (via `new Buffer`, or
21833// Buffer#write) will replace incomplete surrogates with the unicode
21834// replacement character. See https://codereview.chromium.org/121173009/ .
21835StringDecoder.prototype.write = function(buffer) {
21836 var charStr = '';
21837 // if our last write ended with an incomplete multibyte character
21838 while (this.charLength) {
21839 // determine how many remaining bytes this buffer has to offer for this char
21840 var available = (buffer.length >= this.charLength - this.charReceived) ?
21841 this.charLength - this.charReceived :
21842 buffer.length;
21843
21844 // add the new bytes to the char buffer
21845 buffer.copy(this.charBuffer, this.charReceived, 0, available);
21846 this.charReceived += available;
21847
21848 if (this.charReceived < this.charLength) {
21849 // still not enough chars in this buffer? wait for more ...
21850 return '';
21851 }
21852
21853 // remove bytes belonging to the current character from the buffer
21854 buffer = buffer.slice(available, buffer.length);
21855
21856 // get the character that was split
21857 charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
21858
21859 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
21860 var charCode = charStr.charCodeAt(charStr.length - 1);
21861 if (charCode >= 0xD800 && charCode <= 0xDBFF) {
21862 this.charLength += this.surrogateSize;
21863 charStr = '';
21864 continue;
21865 }
21866 this.charReceived = this.charLength = 0;
21867
21868 // if there are no more bytes in this buffer, just emit our char
21869 if (buffer.length === 0) {
21870 return charStr;
21871 }
21872 break;
21873 }
21874
21875 // determine and set charLength / charReceived
21876 this.detectIncompleteChar(buffer);
21877
21878 var end = buffer.length;
21879 if (this.charLength) {
21880 // buffer the incomplete character bytes we got
21881 buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
21882 end -= this.charReceived;
21883 }
21884
21885 charStr += buffer.toString(this.encoding, 0, end);
21886
21887 var end = charStr.length - 1;
21888 var charCode = charStr.charCodeAt(end);
21889 // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
21890 if (charCode >= 0xD800 && charCode <= 0xDBFF) {
21891 var size = this.surrogateSize;
21892 this.charLength += size;
21893 this.charReceived += size;
21894 this.charBuffer.copy(this.charBuffer, size, 0, size);
21895 buffer.copy(this.charBuffer, 0, 0, size);
21896 return charStr.substring(0, end);
21897 }
21898
21899 // or just emit the charStr
21900 return charStr;
21901};
21902
21903// detectIncompleteChar determines if there is an incomplete UTF-8 character at
21904// the end of the given buffer. If so, it sets this.charLength to the byte
21905// length that character, and sets this.charReceived to the number of bytes
21906// that are available for this character.
21907StringDecoder.prototype.detectIncompleteChar = function(buffer) {
21908 // determine how many bytes we have to check at the end of this buffer
21909 var i = (buffer.length >= 3) ? 3 : buffer.length;
21910
21911 // Figure out if one of the last i bytes of our buffer announces an
21912 // incomplete char.
21913 for (; i > 0; i--) {
21914 var c = buffer[buffer.length - i];
21915
21916 // See http://en.wikipedia.org/wiki/UTF-8#Description
21917
21918 // 110XXXXX
21919 if (i == 1 && c >> 5 == 0x06) {
21920 this.charLength = 2;
21921 break;
21922 }
21923
21924 // 1110XXXX
21925 if (i <= 2 && c >> 4 == 0x0E) {
21926 this.charLength = 3;
21927 break;
21928 }
21929
21930 // 11110XXX
21931 if (i <= 3 && c >> 3 == 0x1E) {
21932 this.charLength = 4;
21933 break;
21934 }
21935 }
21936 this.charReceived = i;
21937};
21938
21939StringDecoder.prototype.end = function(buffer) {
21940 var res = '';
21941 if (buffer && buffer.length)
21942 res = this.write(buffer);
21943
21944 if (this.charReceived) {
21945 var cr = this.charReceived;
21946 var buf = this.charBuffer;
21947 var enc = this.encoding;
21948 res += buf.slice(0, cr).toString(enc);
21949 }
21950
21951 return res;
21952};
21953
21954function passThroughWrite(buffer) {
21955 return buffer.toString(this.encoding);
23345} 21956}
23346 21957
23347function tfJSON (type) { 21958function utf16DetectIncompleteChar(buffer) {
23348 if (native.Function(type)) return type.toJSON ? type.toJSON() : getTypeName(type) 21959 this.charReceived = buffer.length % 2;
23349 if (native.Array(type)) return 'Array' 21960 this.charLength = this.charReceived ? 2 : 0;
23350 if (type && native.Object(type)) return 'Object' 21961}
23351 21962
23352 return type !== undefined ? type : '' 21963function base64DetectIncompleteChar(buffer) {
21964 this.charReceived = buffer.length % 3;
21965 this.charLength = this.charReceived ? 3 : 0;
23353} 21966}
23354 21967
23355function tfErrorString (type, value, valueTypeName) { 21968},{"buffer":47}],145:[function(require,module,exports){
23356 var valueJson = getValue(value) 21969(function (global){
21970
21971/**
21972 * Module exports.
21973 */
21974
21975module.exports = deprecate;
21976
21977/**
21978 * Mark that a method should not be used.
21979 * Returns a modified function which warns once by default.
21980 *
21981 * If `localStorage.noDeprecation = true` is set, then it is a no-op.
21982 *
21983 * If `localStorage.throwDeprecation = true` is set, then deprecated functions
21984 * will throw an Error when invoked.
21985 *
21986 * If `localStorage.traceDeprecation = true` is set, then deprecated functions
21987 * will invoke `console.trace()` instead of `console.error()`.
21988 *
21989 * @param {Function} fn - the function to deprecate
21990 * @param {String} msg - the string to print to the console when `fn` is invoked
21991 * @returns {Function} a new "deprecated" version of `fn`
21992 * @api public
21993 */
21994
21995function deprecate (fn, msg) {
21996 if (config('noDeprecation')) {
21997 return fn;
21998 }
21999
22000 var warned = false;
22001 function deprecated() {
22002 if (!warned) {
22003 if (config('throwDeprecation')) {
22004 throw new Error(msg);
22005 } else if (config('traceDeprecation')) {
22006 console.trace(msg);
22007 } else {
22008 console.warn(msg);
22009 }
22010 warned = true;
22011 }
22012 return fn.apply(this, arguments);
22013 }
23357 22014
23358 return 'Expected ' + tfJSON(type) + ', got' + 22015 return deprecated;
23359 (valueTypeName !== '' ? ' ' + valueTypeName : '') +
23360 (valueJson !== '' ? ' ' + valueJson : '')
23361} 22016}
23362 22017
23363function TfTypeError (type, value, valueTypeName) { 22018/**
23364 valueTypeName = valueTypeName || getValueTypeName(value) 22019 * Checks `localStorage` for boolean values for the given `name`.
23365 this.message = tfErrorString(type, value, valueTypeName) 22020 *
22021 * @param {String} name
22022 * @returns {Boolean}
22023 * @api private
22024 */
22025
22026function config (name) {
22027 // accessing global.localStorage can trigger a DOMException in sandboxed iframes
22028 try {
22029 if (!global.localStorage) return false;
22030 } catch (_) {
22031 return false;
22032 }
22033 var val = global.localStorage[name];
22034 if (null == val) return false;
22035 return String(val).toLowerCase() === 'true';
22036}
23366 22037
23367 Error.captureStackTrace(this, TfTypeError) 22038}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
23368 this.__type = type 22039},{}],146:[function(require,module,exports){
23369 this.__value = value 22040arguments[4][95][0].apply(exports,arguments)
23370 this.__valueTypeName = valueTypeName 22041},{"dup":95}],147:[function(require,module,exports){
22042module.exports = function isBuffer(arg) {
22043 return arg && typeof arg === 'object'
22044 && typeof arg.copy === 'function'
22045 && typeof arg.fill === 'function'
22046 && typeof arg.readUInt8 === 'function';
23371} 22047}
22048},{}],148:[function(require,module,exports){
22049(function (process,global){
22050// Copyright Joyent, Inc. and other Node contributors.
22051//
22052// Permission is hereby granted, free of charge, to any person obtaining a
22053// copy of this software and associated documentation files (the
22054// "Software"), to deal in the Software without restriction, including
22055// without limitation the rights to use, copy, modify, merge, publish,
22056// distribute, sublicense, and/or sell copies of the Software, and to permit
22057// persons to whom the Software is furnished to do so, subject to the
22058// following conditions:
22059//
22060// The above copyright notice and this permission notice shall be included
22061// in all copies or substantial portions of the Software.
22062//
22063// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22064// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22065// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
22066// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
22067// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22068// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22069// USE OR OTHER DEALINGS IN THE SOFTWARE.
22070
22071var formatRegExp = /%[sdj%]/g;
22072exports.format = function(f) {
22073 if (!isString(f)) {
22074 var objects = [];
22075 for (var i = 0; i < arguments.length; i++) {
22076 objects.push(inspect(arguments[i]));
22077 }
22078 return objects.join(' ');
22079 }
22080
22081 var i = 1;
22082 var args = arguments;
22083 var len = args.length;
22084 var str = String(f).replace(formatRegExp, function(x) {
22085 if (x === '%%') return '%';
22086 if (i >= len) return x;
22087 switch (x) {
22088 case '%s': return String(args[i++]);
22089 case '%d': return Number(args[i++]);
22090 case '%j':
22091 try {
22092 return JSON.stringify(args[i++]);
22093 } catch (_) {
22094 return '[Circular]';
22095 }
22096 default:
22097 return x;
22098 }
22099 });
22100 for (var x = args[i]; i < len; x = args[++i]) {
22101 if (isNull(x) || !isObject(x)) {
22102 str += ' ' + x;
22103 } else {
22104 str += ' ' + inspect(x);
22105 }
22106 }
22107 return str;
22108};
22109
22110
22111// Mark that a method should not be used.
22112// Returns a modified function which warns once by default.
22113// If --no-deprecation is set, then it is a no-op.
22114exports.deprecate = function(fn, msg) {
22115 // Allow for deprecating things in the process of starting up.
22116 if (isUndefined(global.process)) {
22117 return function() {
22118 return exports.deprecate(fn, msg).apply(this, arguments);
22119 };
22120 }
22121
22122 if (process.noDeprecation === true) {
22123 return fn;
22124 }
22125
22126 var warned = false;
22127 function deprecated() {
22128 if (!warned) {
22129 if (process.throwDeprecation) {
22130 throw new Error(msg);
22131 } else if (process.traceDeprecation) {
22132 console.trace(msg);
22133 } else {
22134 console.error(msg);
22135 }
22136 warned = true;
22137 }
22138 return fn.apply(this, arguments);
22139 }
22140
22141 return deprecated;
22142};
22143
23372 22144
23373TfTypeError.prototype = Object.create(Error.prototype) 22145var debugs = {};
23374TfTypeError.prototype.constructor = TfTypeError 22146var debugEnviron;
22147exports.debuglog = function(set) {
22148 if (isUndefined(debugEnviron))
22149 debugEnviron = process.env.NODE_DEBUG || '';
22150 set = set.toUpperCase();
22151 if (!debugs[set]) {
22152 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
22153 var pid = process.pid;
22154 debugs[set] = function() {
22155 var msg = exports.format.apply(exports, arguments);
22156 console.error('%s %d: %s', set, pid, msg);
22157 };
22158 } else {
22159 debugs[set] = function() {};
22160 }
22161 }
22162 return debugs[set];
22163};
23375 22164
23376function tfPropertyErrorString (type, label, name, value, valueTypeName) {
23377 var description = '" of type '
23378 if (label === 'key') description = '" with key type '
23379 22165
23380 return tfErrorString('property "' + tfJSON(name) + description + tfJSON(type), value, valueTypeName) 22166/**
22167 * Echos the value of a value. Trys to print the value out
22168 * in the best way possible given the different types.
22169 *
22170 * @param {Object} obj The object to print out.
22171 * @param {Object} opts Optional options object that alters the output.
22172 */
22173/* legacy: obj, showHidden, depth, colors*/
22174function inspect(obj, opts) {
22175 // default options
22176 var ctx = {
22177 seen: [],
22178 stylize: stylizeNoColor
22179 };
22180 // legacy...
22181 if (arguments.length >= 3) ctx.depth = arguments[2];
22182 if (arguments.length >= 4) ctx.colors = arguments[3];
22183 if (isBoolean(opts)) {
22184 // legacy...
22185 ctx.showHidden = opts;
22186 } else if (opts) {
22187 // got an "options" object
22188 exports._extend(ctx, opts);
22189 }
22190 // set default options
22191 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
22192 if (isUndefined(ctx.depth)) ctx.depth = 2;
22193 if (isUndefined(ctx.colors)) ctx.colors = false;
22194 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
22195 if (ctx.colors) ctx.stylize = stylizeWithColor;
22196 return formatValue(ctx, obj, ctx.depth);
23381} 22197}
22198exports.inspect = inspect;
22199
22200
22201// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
22202inspect.colors = {
22203 'bold' : [1, 22],
22204 'italic' : [3, 23],
22205 'underline' : [4, 24],
22206 'inverse' : [7, 27],
22207 'white' : [37, 39],
22208 'grey' : [90, 39],
22209 'black' : [30, 39],
22210 'blue' : [34, 39],
22211 'cyan' : [36, 39],
22212 'green' : [32, 39],
22213 'magenta' : [35, 39],
22214 'red' : [31, 39],
22215 'yellow' : [33, 39]
22216};
22217
22218// Don't use 'blue' not visible on cmd.exe
22219inspect.styles = {
22220 'special': 'cyan',
22221 'number': 'yellow',
22222 'boolean': 'yellow',
22223 'undefined': 'grey',
22224 'null': 'bold',
22225 'string': 'green',
22226 'date': 'magenta',
22227 // "name": intentionally not styling
22228 'regexp': 'red'
22229};
23382 22230
23383function TfPropertyTypeError (type, property, label, value, valueTypeName) { 22231
23384 if (type) { 22232function stylizeWithColor(str, styleType) {
23385 valueTypeName = valueTypeName || getValueTypeName(value) 22233 var style = inspect.styles[styleType];
23386 this.message = tfPropertyErrorString(type, label, property, value, valueTypeName) 22234
22235 if (style) {
22236 return '\u001b[' + inspect.colors[style][0] + 'm' + str +
22237 '\u001b[' + inspect.colors[style][1] + 'm';
23387 } else { 22238 } else {
23388 this.message = 'Unexpected property "' + property + '"' 22239 return str;
23389 } 22240 }
22241}
22242
23390 22243
23391 Error.captureStackTrace(this, TfTypeError) 22244function stylizeNoColor(str, styleType) {
23392 this.__label = label 22245 return str;
23393 this.__property = property
23394 this.__type = type
23395 this.__value = value
23396 this.__valueTypeName = valueTypeName
23397} 22246}
23398 22247
23399TfPropertyTypeError.prototype = Object.create(Error.prototype)
23400TfPropertyTypeError.prototype.constructor = TfTypeError
23401 22248
23402function tfCustomError (expected, actual) { 22249function arrayToHash(array) {
23403 return new TfTypeError(expected, {}, actual) 22250 var hash = {};
22251
22252 array.forEach(function(val, idx) {
22253 hash[val] = true;
22254 });
22255
22256 return hash;
23404} 22257}
23405 22258
23406function tfSubError (e, property, label) {
23407 // sub child?
23408 if (e instanceof TfPropertyTypeError) {
23409 property = property + '.' + e.__property
23410 22259
23411 e = new TfPropertyTypeError( 22260function formatValue(ctx, value, recurseTimes) {
23412 e.__type, property, e.__label, e.__value, e.__valueTypeName 22261 // Provide a hook for user-specified inspect functions.
23413 ) 22262 // Check that value is an object with an inspect function on it
22263 if (ctx.customInspect &&
22264 value &&
22265 isFunction(value.inspect) &&
22266 // Filter out the util module, it's inspect function is special
22267 value.inspect !== exports.inspect &&
22268 // Also filter out any prototype objects using the circular check.
22269 !(value.constructor && value.constructor.prototype === value)) {
22270 var ret = value.inspect(recurseTimes, ctx);
22271 if (!isString(ret)) {
22272 ret = formatValue(ctx, ret, recurseTimes);
22273 }
22274 return ret;
22275 }
23414 22276
23415 // child? 22277 // Primitive types cannot have properties
23416 } else if (e instanceof TfTypeError) { 22278 var primitive = formatPrimitive(ctx, value);
23417 e = new TfPropertyTypeError( 22279 if (primitive) {
23418 e.__type, property, label, e.__value, e.__valueTypeName 22280 return primitive;
23419 ) 22281 }
22282
22283 // Look up the keys of the object.
22284 var keys = Object.keys(value);
22285 var visibleKeys = arrayToHash(keys);
22286
22287 if (ctx.showHidden) {
22288 keys = Object.getOwnPropertyNames(value);
22289 }
22290
22291 // IE doesn't make error fields non-enumerable
22292 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
22293 if (isError(value)
22294 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
22295 return formatError(value);
22296 }
22297
22298 // Some type of object without properties can be shortcutted.
22299 if (keys.length === 0) {
22300 if (isFunction(value)) {
22301 var name = value.name ? ': ' + value.name : '';
22302 return ctx.stylize('[Function' + name + ']', 'special');
22303 }
22304 if (isRegExp(value)) {
22305 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
22306 }
22307 if (isDate(value)) {
22308 return ctx.stylize(Date.prototype.toString.call(value), 'date');
22309 }
22310 if (isError(value)) {
22311 return formatError(value);
22312 }
22313 }
22314
22315 var base = '', array = false, braces = ['{', '}'];
22316
22317 // Make Array say that they are Array
22318 if (isArray(value)) {
22319 array = true;
22320 braces = ['[', ']'];
22321 }
22322
22323 // Make functions say that they are functions
22324 if (isFunction(value)) {
22325 var n = value.name ? ': ' + value.name : '';
22326 base = ' [Function' + n + ']';
22327 }
22328
22329 // Make RegExps say that they are RegExps
22330 if (isRegExp(value)) {
22331 base = ' ' + RegExp.prototype.toString.call(value);
22332 }
22333
22334 // Make dates with properties first say the date
22335 if (isDate(value)) {
22336 base = ' ' + Date.prototype.toUTCString.call(value);
22337 }
22338
22339 // Make error with message first say the error
22340 if (isError(value)) {
22341 base = ' ' + formatError(value);
22342 }
22343
22344 if (keys.length === 0 && (!array || value.length == 0)) {
22345 return braces[0] + base + braces[1];
22346 }
22347
22348 if (recurseTimes < 0) {
22349 if (isRegExp(value)) {
22350 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
22351 } else {
22352 return ctx.stylize('[Object]', 'special');
22353 }
22354 }
22355
22356 ctx.seen.push(value);
22357
22358 var output;
22359 if (array) {
22360 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
22361 } else {
22362 output = keys.map(function(key) {
22363 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
22364 });
23420 } 22365 }
23421 22366
23422 Error.captureStackTrace(e) 22367 ctx.seen.pop();
23423 return e 22368
22369 return reduceToSingleString(output, base, braces);
23424} 22370}
23425 22371
23426module.exports = { 22372
23427 TfTypeError: TfTypeError, 22373function formatPrimitive(ctx, value) {
23428 TfPropertyTypeError: TfPropertyTypeError, 22374 if (isUndefined(value))
23429 tfCustomError: tfCustomError, 22375 return ctx.stylize('undefined', 'undefined');
23430 tfSubError: tfSubError, 22376 if (isString(value)) {
23431 tfJSON: tfJSON, 22377 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
23432 getValueTypeName: getValueTypeName 22378 .replace(/'/g, "\\'")
22379 .replace(/\\"/g, '"') + '\'';
22380 return ctx.stylize(simple, 'string');
22381 }
22382 if (isNumber(value))
22383 return ctx.stylize('' + value, 'number');
22384 if (isBoolean(value))
22385 return ctx.stylize('' + value, 'boolean');
22386 // For some reason typeof null is "object", so special case here.
22387 if (isNull(value))
22388 return ctx.stylize('null', 'null');
22389}
22390
22391
22392function formatError(value) {
22393 return '[' + Error.prototype.toString.call(value) + ']';
23433} 22394}
23434 22395
23435},{"./native":140}],138:[function(require,module,exports){
23436(function (Buffer){
23437var NATIVE = require('./native')
23438var ERRORS = require('./errors')
23439 22396
23440function _Buffer (value) { 22397function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
23441 return Buffer.isBuffer(value) 22398 var output = [];
22399 for (var i = 0, l = value.length; i < l; ++i) {
22400 if (hasOwnProperty(value, String(i))) {
22401 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
22402 String(i), true));
22403 } else {
22404 output.push('');
22405 }
22406 }
22407 keys.forEach(function(key) {
22408 if (!key.match(/^\d+$/)) {
22409 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
22410 key, true));
22411 }
22412 });
22413 return output;
23442} 22414}
23443 22415
23444function Hex (value) { 22416
23445 return typeof value === 'string' && /^([0-9a-f]{2})+$/i.test(value) 22417function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
22418 var name, str, desc;
22419 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
22420 if (desc.get) {
22421 if (desc.set) {
22422 str = ctx.stylize('[Getter/Setter]', 'special');
22423 } else {
22424 str = ctx.stylize('[Getter]', 'special');
22425 }
22426 } else {
22427 if (desc.set) {
22428 str = ctx.stylize('[Setter]', 'special');
22429 }
22430 }
22431 if (!hasOwnProperty(visibleKeys, key)) {
22432 name = '[' + key + ']';
22433 }
22434 if (!str) {
22435 if (ctx.seen.indexOf(desc.value) < 0) {
22436 if (isNull(recurseTimes)) {
22437 str = formatValue(ctx, desc.value, null);
22438 } else {
22439 str = formatValue(ctx, desc.value, recurseTimes - 1);
22440 }
22441 if (str.indexOf('\n') > -1) {
22442 if (array) {
22443 str = str.split('\n').map(function(line) {
22444 return ' ' + line;
22445 }).join('\n').substr(2);
22446 } else {
22447 str = '\n' + str.split('\n').map(function(line) {
22448 return ' ' + line;
22449 }).join('\n');
22450 }
22451 }
22452 } else {
22453 str = ctx.stylize('[Circular]', 'special');
22454 }
22455 }
22456 if (isUndefined(name)) {
22457 if (array && key.match(/^\d+$/)) {
22458 return str;
22459 }
22460 name = JSON.stringify('' + key);
22461 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
22462 name = name.substr(1, name.length - 2);
22463 name = ctx.stylize(name, 'name');
22464 } else {
22465 name = name.replace(/'/g, "\\'")
22466 .replace(/\\"/g, '"')
22467 .replace(/(^"|"$)/g, "'");
22468 name = ctx.stylize(name, 'string');
22469 }
22470 }
22471
22472 return name + ': ' + str;
23446} 22473}
23447 22474
23448function _LengthN (type, length) {
23449 var name = type.toJSON()
23450 22475
23451 function Length (value) { 22476function reduceToSingleString(output, base, braces) {
23452 if (!type(value)) return false 22477 var numLinesEst = 0;
23453 if (value.length === length) return true 22478 var length = output.reduce(function(prev, cur) {
22479 numLinesEst++;
22480 if (cur.indexOf('\n') >= 0) numLinesEst++;
22481 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
22482 }, 0);
23454 22483
23455 throw ERRORS.tfCustomError(name + '(Length: ' + length + ')', name + '(Length: ' + value.length + ')') 22484 if (length > 60) {
22485 return braces[0] +
22486 (base === '' ? '' : base + '\n ') +
22487 ' ' +
22488 output.join(',\n ') +
22489 ' ' +
22490 braces[1];
23456 } 22491 }
23457 Length.toJSON = function () { return name }
23458 22492
23459 return Length 22493 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
22494}
22495
22496
22497// NOTE: These type checking functions intentionally don't use `instanceof`
22498// because it is fragile and can be easily faked with `Object.create()`.
22499function isArray(ar) {
22500 return Array.isArray(ar);
22501}
22502exports.isArray = isArray;
22503
22504function isBoolean(arg) {
22505 return typeof arg === 'boolean';
22506}
22507exports.isBoolean = isBoolean;
22508
22509function isNull(arg) {
22510 return arg === null;
22511}
22512exports.isNull = isNull;
22513
22514function isNullOrUndefined(arg) {
22515 return arg == null;
22516}
22517exports.isNullOrUndefined = isNullOrUndefined;
22518
22519function isNumber(arg) {
22520 return typeof arg === 'number';
22521}
22522exports.isNumber = isNumber;
22523
22524function isString(arg) {
22525 return typeof arg === 'string';
22526}
22527exports.isString = isString;
22528
22529function isSymbol(arg) {
22530 return typeof arg === 'symbol';
22531}
22532exports.isSymbol = isSymbol;
22533
22534function isUndefined(arg) {
22535 return arg === void 0;
23460} 22536}
22537exports.isUndefined = isUndefined;
23461 22538
23462var _ArrayN = _LengthN.bind(null, NATIVE.Array) 22539function isRegExp(re) {
23463var _BufferN = _LengthN.bind(null, _Buffer) 22540 return isObject(re) && objectToString(re) === '[object RegExp]';
23464var _HexN = _LengthN.bind(null, Hex) 22541}
23465var _StringN = _LengthN.bind(null, NATIVE.String) 22542exports.isRegExp = isRegExp;
23466 22543
23467var UINT53_MAX = Math.pow(2, 53) - 1 22544function isObject(arg) {
22545 return typeof arg === 'object' && arg !== null;
22546}
22547exports.isObject = isObject;
23468 22548
23469function Finite (value) { 22549function isDate(d) {
23470 return typeof value === 'number' && isFinite(value) 22550 return isObject(d) && objectToString(d) === '[object Date]';
23471} 22551}
23472function Int8 (value) { return ((value << 24) >> 24) === value } 22552exports.isDate = isDate;
23473function Int16 (value) { return ((value << 16) >> 16) === value } 22553
23474function Int32 (value) { return (value | 0) === value } 22554function isError(e) {
23475function UInt8 (value) { return (value & 0xff) === value } 22555 return isObject(e) &&
23476function UInt16 (value) { return (value & 0xffff) === value } 22556 (objectToString(e) === '[object Error]' || e instanceof Error);
23477function UInt32 (value) { return (value >>> 0) === value }
23478function UInt53 (value) {
23479 return typeof value === 'number' &&
23480 value >= 0 &&
23481 value <= UINT53_MAX &&
23482 Math.floor(value) === value
23483} 22557}
22558exports.isError = isError;
23484 22559
23485var types = { 22560function isFunction(arg) {
23486 ArrayN: _ArrayN, 22561 return typeof arg === 'function';
23487 Buffer: _Buffer,
23488 BufferN: _BufferN,
23489 Finite: Finite,
23490 Hex: Hex,
23491 HexN: _HexN,
23492 Int8: Int8,
23493 Int16: Int16,
23494 Int32: Int32,
23495 StringN: _StringN,
23496 UInt8: UInt8,
23497 UInt16: UInt16,
23498 UInt32: UInt32,
23499 UInt53: UInt53
23500} 22562}
22563exports.isFunction = isFunction;
23501 22564
23502for (var typeName in types) { 22565function isPrimitive(arg) {
23503 types[typeName].toJSON = function (t) { 22566 return arg === null ||
23504 return t 22567 typeof arg === 'boolean' ||
23505 }.bind(null, typeName) 22568 typeof arg === 'number' ||
22569 typeof arg === 'string' ||
22570 typeof arg === 'symbol' || // ES6 symbol
22571 typeof arg === 'undefined';
23506} 22572}
22573exports.isPrimitive = isPrimitive;
23507 22574
23508module.exports = types 22575exports.isBuffer = require('./support/isBuffer');
23509 22576
23510}).call(this,{"isBuffer":require("../../../../../.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")}) 22577function objectToString(o) {
23511},{"../../../../../.nvm/versions/node/v6.0.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":10,"./errors":137,"./native":140}],139:[function(require,module,exports){ 22578 return Object.prototype.toString.call(o);
23512var ERRORS = require('./errors') 22579}
23513var NATIVE = require('./native')
23514 22580
23515// short-hand
23516var tfJSON = ERRORS.tfJSON
23517var TfTypeError = ERRORS.TfTypeError
23518var TfPropertyTypeError = ERRORS.TfPropertyTypeError
23519var tfSubError = ERRORS.tfSubError
23520var getValueTypeName = ERRORS.getValueTypeName
23521 22581
23522var TYPES = { 22582function pad(n) {
23523 arrayOf: function arrayOf (type) { 22583 return n < 10 ? '0' + n.toString(10) : n.toString(10);
23524 type = compile(type) 22584}
23525 22585
23526 function _arrayOf (array, strict) {
23527 if (!NATIVE.Array(array)) return false
23528 if (NATIVE.Nil(array)) return false
23529 22586
23530 return array.every(function (value, i) { 22587var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
23531 try { 22588 'Oct', 'Nov', 'Dec'];
23532 return typeforce(type, value, strict) 22589
23533 } catch (e) { 22590// 26 Feb 16:19:34
23534 throw tfSubError(e, i) 22591function timestamp() {
22592 var d = new Date();
22593 var time = [pad(d.getHours()),
22594 pad(d.getMinutes()),
22595 pad(d.getSeconds())].join(':');
22596 return [d.getDate(), months[d.getMonth()], time].join(' ');
22597}
22598
22599
22600// log is just a thin wrapper to console.log that prepends a timestamp
22601exports.log = function() {
22602 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
22603};
22604
22605
22606/**
22607 * Inherit the prototype methods from one constructor into another.
22608 *
22609 * The Function.prototype.inherits from lang.js rewritten as a standalone
22610 * function (not on Function.prototype). NOTE: If this file is to be loaded
22611 * during bootstrapping this function needs to be rewritten using some native
22612 * functions as prototype setup using normal JavaScript does not work as
22613 * expected during bootstrapping (see mirror.js in r114903).
22614 *
22615 * @param {function} ctor Constructor function which needs to inherit the
22616 * prototype.
22617 * @param {function} superCtor Constructor function to inherit prototype from.
22618 */
22619exports.inherits = require('inherits');
22620
22621exports._extend = function(origin, add) {
22622 // Don't do anything if add isn't an object
22623 if (!add || !isObject(add)) return origin;
22624
22625 var keys = Object.keys(add);
22626 var i = keys.length;
22627 while (i--) {
22628 origin[keys[i]] = add[keys[i]];
22629 }
22630 return origin;
22631};
22632
22633function hasOwnProperty(obj, prop) {
22634 return Object.prototype.hasOwnProperty.call(obj, prop);
22635}
22636
22637}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
22638},{"./support/isBuffer":147,"_process":112,"inherits":146}],149:[function(require,module,exports){
22639var indexOf = require('indexof');
22640
22641var Object_keys = function (obj) {
22642 if (Object.keys) return Object.keys(obj)
22643 else {
22644 var res = [];
22645 for (var key in obj) res.push(key)
22646 return res;
22647 }
22648};
22649
22650var forEach = function (xs, fn) {
22651 if (xs.forEach) return xs.forEach(fn)
22652 else for (var i = 0; i < xs.length; i++) {
22653 fn(xs[i], i, xs);
22654 }
22655};
22656
22657var defineProp = (function() {
22658 try {
22659 Object.defineProperty({}, '_', {});
22660 return function(obj, name, value) {
22661 Object.defineProperty(obj, name, {
22662 writable: true,
22663 enumerable: false,
22664 configurable: true,
22665 value: value
22666 })
22667 };
22668 } catch(e) {
22669 return function(obj, name, value) {
22670 obj[name] = value;
22671 };
22672 }
22673}());
22674
22675var globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function',
22676'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError',
22677'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError',
22678'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape',
22679'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape'];
22680
22681function Context() {}
22682Context.prototype = {};
22683
22684var Script = exports.Script = function NodeScript (code) {
22685 if (!(this instanceof Script)) return new Script(code);
22686 this.code = code;
22687};
22688
22689Script.prototype.runInContext = function (context) {
22690 if (!(context instanceof Context)) {
22691 throw new TypeError("needs a 'context' argument.");
22692 }
22693
22694 var iframe = document.createElement('iframe');
22695 if (!iframe.style) iframe.style = {};
22696 iframe.style.display = 'none';
22697
22698 document.body.appendChild(iframe);
22699
22700 var win = iframe.contentWindow;
22701 var wEval = win.eval, wExecScript = win.execScript;
22702
22703 if (!wEval && wExecScript) {
22704 // win.eval() magically appears when this is called in IE:
22705 wExecScript.call(win, 'null');
22706 wEval = win.eval;
22707 }
22708
22709 forEach(Object_keys(context), function (key) {
22710 win[key] = context[key];
22711 });
22712 forEach(globals, function (key) {
22713 if (context[key]) {
22714 win[key] = context[key];
22715 }
22716 });
22717
22718 var winKeys = Object_keys(win);
22719
22720 var res = wEval.call(win, this.code);
22721
22722 forEach(Object_keys(win), function (key) {
22723 // Avoid copying circular objects like `top` and `window` by only
22724 // updating existing context properties or new properties in the `win`
22725 // that was only introduced after the eval.
22726 if (key in context || indexOf(winKeys, key) === -1) {
22727 context[key] = win[key];
22728 }
22729 });
22730
22731 forEach(globals, function (key) {
22732 if (!(key in context)) {
22733 defineProp(context, key, win[key]);
23535 } 22734 }
23536 }) 22735 });
22736
22737 document.body.removeChild(iframe);
22738
22739 return res;
22740};
22741
22742Script.prototype.runInThisContext = function () {
22743 return eval(this.code); // maybe...
22744};
22745
22746Script.prototype.runInNewContext = function (context) {
22747 var ctx = Script.createContext(context);
22748 var res = this.runInContext(ctx);
22749
22750 forEach(Object_keys(ctx), function (key) {
22751 context[key] = ctx[key];
22752 });
22753
22754 return res;
22755};
22756
22757forEach(Object_keys(Script.prototype), function (name) {
22758 exports[name] = Script[name] = function (code) {
22759 var s = Script(code);
22760 return s[name].apply(s, [].slice.call(arguments, 1));
22761 };
22762});
22763
22764exports.createScript = function (code) {
22765 return exports.Script(code);
22766};
22767
22768exports.createContext = Script.createContext = function (context) {
22769 var copy = new Context();
22770 if(typeof context === 'object') {
22771 forEach(Object_keys(context), function (key) {
22772 copy[key] = context[key];
22773 });
23537 } 22774 }
23538 _arrayOf.toJSON = function () { return '[' + tfJSON(type) + ']' } 22775 return copy;
22776};
23539 22777
23540 return _arrayOf 22778},{"indexof":94}],150:[function(require,module,exports){
23541 }, 22779var aes = require('browserify-aes')
22780var assert = require('assert')
22781var Buffer = require('safe-buffer').Buffer
22782var bs58check = require('bs58check')
22783var createHash = require('create-hash')
22784var scrypt = require('scryptsy')
22785var xor = require('buffer-xor/inplace')
22786
22787var ecurve = require('ecurve')
22788var curve = ecurve.getCurveByName('secp256k1')
22789
22790var BigInteger = require('bigi')
22791
22792// constants
22793var SCRYPT_PARAMS = {
22794 N: 16384, // specified by BIP38
22795 r: 8,
22796 p: 8
22797}
22798var NULL = Buffer.alloc(0)
22799
22800function hash160 (buffer) {
22801 return createHash('rmd160').update(
22802 createHash('sha256').update(buffer).digest()
22803 ).digest()
22804}
22805
22806function hash256 (buffer) {
22807 return createHash('sha256').update(
22808 createHash('sha256').update(buffer).digest()
22809 ).digest()
22810}
22811
22812function getAddress (d, compressed) {
22813 var Q = curve.G.multiply(d).getEncoded(compressed)
22814 var hash = hash160(Q)
22815 var payload = Buffer.allocUnsafe(21)
22816 payload.writeUInt8(0x00, 0) // XXX TODO FIXME bitcoin only??? damn you BIP38
22817 hash.copy(payload, 1)
22818
22819 return bs58check.encode(payload)
22820}
22821
22822function encryptRaw (buffer, compressed, passphrase, progressCallback, scryptParams) {
22823 if (buffer.length !== 32) throw new Error('Invalid private key length')
22824 scryptParams = scryptParams || SCRYPT_PARAMS
22825
22826 var d = BigInteger.fromBuffer(buffer)
22827 var address = getAddress(d, compressed)
22828 var secret = Buffer.from(passphrase, 'utf8')
22829 var salt = hash256(address).slice(0, 4)
22830
22831 var N = scryptParams.N
22832 var r = scryptParams.r
22833 var p = scryptParams.p
22834
22835 var scryptBuf = scrypt(secret, salt, N, r, p, 64, progressCallback)
22836 var derivedHalf1 = scryptBuf.slice(0, 32)
22837 var derivedHalf2 = scryptBuf.slice(32, 64)
22838
22839 var xorBuf = xor(derivedHalf1, buffer)
22840 var cipher = aes.createCipheriv('aes-256-ecb', derivedHalf2, NULL)
22841 cipher.setAutoPadding(false)
22842 cipher.end(xorBuf)
22843
22844 var cipherText = cipher.read()
22845
22846 // 0x01 | 0x42 | flagByte | salt (4) | cipherText (32)
22847 var result = Buffer.allocUnsafe(7 + 32)
22848 result.writeUInt8(0x01, 0)
22849 result.writeUInt8(0x42, 1)
22850 result.writeUInt8(compressed ? 0xe0 : 0xc0, 2)
22851 salt.copy(result, 3)
22852 cipherText.copy(result, 7)
22853
22854 return result
22855}
22856
22857function encrypt (buffer, compressed, passphrase, progressCallback, scryptParams) {
22858 return bs58check.encode(encryptRaw(buffer, compressed, passphrase, progressCallback, scryptParams))
22859}
22860
22861// some of the techniques borrowed from: https://github.com/pointbiz/bitaddress.org
22862function decryptRaw (buffer, passphrase, progressCallback, scryptParams) {
22863 // 39 bytes: 2 bytes prefix, 37 bytes payload
22864 if (buffer.length !== 39) throw new Error('Invalid BIP38 data length')
22865 if (buffer.readUInt8(0) !== 0x01) throw new Error('Invalid BIP38 prefix')
22866 scryptParams = scryptParams || SCRYPT_PARAMS
22867
22868 // check if BIP38 EC multiply
22869 var type = buffer.readUInt8(1)
22870 if (type === 0x43) return decryptECMult(buffer, passphrase, progressCallback, scryptParams)
22871 if (type !== 0x42) throw new Error('Invalid BIP38 type')
22872
22873 passphrase = Buffer.from(passphrase, 'utf8')
22874
22875 var flagByte = buffer.readUInt8(2)
22876 var compressed = flagByte === 0xe0
22877 if (!compressed && flagByte !== 0xc0) throw new Error('Invalid BIP38 compression flag')
22878
22879 var N = scryptParams.N
22880 var r = scryptParams.r
22881 var p = scryptParams.p
22882
22883 var salt = buffer.slice(3, 7)
22884 var scryptBuf = scrypt(passphrase, salt, N, r, p, 64, progressCallback)
22885 var derivedHalf1 = scryptBuf.slice(0, 32)
22886 var derivedHalf2 = scryptBuf.slice(32, 64)
22887
22888 var privKeyBuf = buffer.slice(7, 7 + 32)
22889 var decipher = aes.createDecipheriv('aes-256-ecb', derivedHalf2, NULL)
22890 decipher.setAutoPadding(false)
22891 decipher.end(privKeyBuf)
22892
22893 var plainText = decipher.read()
22894 var privateKey = xor(derivedHalf1, plainText)
22895
22896 // verify salt matches address
22897 var d = BigInteger.fromBuffer(privateKey)
22898 var address = getAddress(d, compressed)
22899 var checksum = hash256(address).slice(0, 4)
22900 assert.deepEqual(salt, checksum)
22901
22902 return {
22903 privateKey: privateKey,
22904 compressed: compressed
22905 }
22906}
22907
22908function decrypt (string, passphrase, progressCallback, scryptParams) {
22909 return decryptRaw(bs58check.decode(string), passphrase, progressCallback, scryptParams)
22910}
22911
22912function decryptECMult (buffer, passphrase, progressCallback, scryptParams) {
22913 passphrase = Buffer.from(passphrase, 'utf8')
22914 buffer = buffer.slice(1) // FIXME: we can avoid this
22915 scryptParams = scryptParams || SCRYPT_PARAMS
22916
22917 var flag = buffer.readUInt8(1)
22918 var compressed = (flag & 0x20) !== 0
22919 var hasLotSeq = (flag & 0x04) !== 0
22920
22921 assert.equal((flag & 0x24), flag, 'Invalid private key.')
22922
22923 var addressHash = buffer.slice(2, 6)
22924 var ownerEntropy = buffer.slice(6, 14)
22925 var ownerSalt
22926
22927 // 4 bytes ownerSalt if 4 bytes lot/sequence
22928 if (hasLotSeq) {
22929 ownerSalt = ownerEntropy.slice(0, 4)
22930
22931 // else, 8 bytes ownerSalt
22932 } else {
22933 ownerSalt = ownerEntropy
22934 }
22935
22936 var encryptedPart1 = buffer.slice(14, 22) // First 8 bytes
22937 var encryptedPart2 = buffer.slice(22, 38) // 16 bytes
22938
22939 var N = scryptParams.N
22940 var r = scryptParams.r
22941 var p = scryptParams.p
22942 var preFactor = scrypt(passphrase, ownerSalt, N, r, p, 32, progressCallback)
22943
22944 var passFactor
22945 if (hasLotSeq) {
22946 var hashTarget = Buffer.concat([preFactor, ownerEntropy])
22947 passFactor = hash256(hashTarget)
22948 } else {
22949 passFactor = preFactor
22950 }
22951
22952 var passInt = BigInteger.fromBuffer(passFactor)
22953 var passPoint = curve.G.multiply(passInt).getEncoded(true)
22954
22955 var seedBPass = scrypt(passPoint, Buffer.concat([addressHash, ownerEntropy]), 1024, 1, 1, 64)
22956 var derivedHalf1 = seedBPass.slice(0, 32)
22957 var derivedHalf2 = seedBPass.slice(32, 64)
22958
22959 var decipher = aes.createDecipheriv('aes-256-ecb', derivedHalf2, Buffer.alloc(0))
22960 decipher.setAutoPadding(false)
22961 decipher.end(encryptedPart2)
22962
22963 var decryptedPart2 = decipher.read()
22964 var tmp = xor(decryptedPart2, derivedHalf1.slice(16, 32))
22965 var seedBPart2 = tmp.slice(8, 16)
22966
22967 var decipher2 = aes.createDecipheriv('aes-256-ecb', derivedHalf2, Buffer.alloc(0))
22968 decipher2.setAutoPadding(false)
22969 decipher2.write(encryptedPart1) // first 8 bytes
22970 decipher2.end(tmp.slice(0, 8)) // last 8 bytes
22971
22972 var seedBPart1 = xor(decipher2.read(), derivedHalf1.slice(0, 16))
22973 var seedB = Buffer.concat([seedBPart1, seedBPart2], 24)
22974 var factorB = BigInteger.fromBuffer(hash256(seedB))
22975
22976 // d = passFactor * factorB (mod n)
22977 var d = passInt.multiply(factorB).mod(curve.n)
22978
22979 return {
22980 privateKey: d.toBuffer(32),
22981 compressed: compressed
22982 }
22983}
22984
22985function verify (string) {
22986 var decoded = bs58check.decodeUnsafe(string)
22987 if (!decoded) return false
22988
22989 if (decoded.length !== 39) return false
22990 if (decoded.readUInt8(0) !== 0x01) return false
22991
22992 var type = decoded.readUInt8(1)
22993 var flag = decoded.readUInt8(2)
22994
22995 // encrypted WIF
22996 if (type === 0x42) {
22997 if (flag !== 0xc0 && flag !== 0xe0) return false
22998
22999 // EC mult
23000 } else if (type === 0x43) {
23001 if ((flag & ~0x24)) return false
23002 } else {
23003 return false
23004 }
23005
23006 return true
23007}
23008
23009module.exports = {
23010 decrypt: decrypt,
23011 decryptECMult: decryptECMult,
23012 decryptRaw: decryptRaw,
23013 encrypt: encrypt,
23014 encryptRaw: encryptRaw,
23015 verify: verify
23016}
23017
23018},{"assert":15,"bigi":154,"browserify-aes":158,"bs58check":175,"buffer-xor/inplace":177,"create-hash":179,"ecurve":184,"safe-buffer":193,"scryptsy":194}],151:[function(require,module,exports){
23019// base-x encoding
23020// Forked from https://github.com/cryptocoinjs/bs58
23021// Originally written by Mike Hearn for BitcoinJ
23022// Copyright (c) 2011 Google Inc
23023// Ported to JavaScript by Stefan Thomas
23024// Merged Buffer refactorings from base58-native by Stephen Pair
23025// Copyright (c) 2013 BitPay Inc
23026
23027var Buffer = require('safe-buffer').Buffer
23028
23029module.exports = function base (ALPHABET) {
23030 var ALPHABET_MAP = {}
23031 var BASE = ALPHABET.length
23032 var LEADER = ALPHABET.charAt(0)
23033
23034 // pre-compute lookup table
23035 for (var z = 0; z < ALPHABET.length; z++) {
23036 var x = ALPHABET.charAt(z)
23037
23038 if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')
23039 ALPHABET_MAP[x] = z
23040 }
23041
23042 function encode (source) {
23043 if (source.length === 0) return ''
23542 23044
23543 maybe: function maybe (type) { 23045 var digits = [0]
23544 type = compile(type) 23046 for (var i = 0; i < source.length; ++i) {
23047 for (var j = 0, carry = source[i]; j < digits.length; ++j) {
23048 carry += digits[j] << 8
23049 digits[j] = carry % BASE
23050 carry = (carry / BASE) | 0
23051 }
23545 23052
23546 function _maybe (value, strict) { 23053 while (carry > 0) {
23547 return NATIVE.Nil(value) || type(value, strict, maybe) 23054 digits.push(carry % BASE)
23055 carry = (carry / BASE) | 0
23056 }
23548 } 23057 }
23549 _maybe.toJSON = function () { return '?' + tfJSON(type) }
23550 23058
23551 return _maybe 23059 var string = ''
23552 }, 23060
23061 // deal with leading zeros
23062 for (var k = 0; source[k] === 0 && k < source.length - 1; ++k) string += LEADER
23063 // convert digits to a string
23064 for (var q = digits.length - 1; q >= 0; --q) string += ALPHABET[digits[q]]
23553 23065
23554 map: function map (propertyType, propertyKeyType) { 23066 return string
23555 propertyType = compile(propertyType) 23067 }
23556 if (propertyKeyType) propertyKeyType = compile(propertyKeyType)
23557 23068
23558 function _map (value, strict) { 23069 function decodeUnsafe (string) {
23559 if (!NATIVE.Object(value)) return false 23070 if (typeof string !== 'string') throw new TypeError('Expected String')
23560 if (NATIVE.Nil(value)) return false 23071 if (string.length === 0) return Buffer.allocUnsafe(0)
23561 23072
23562 for (var propertyName in value) { 23073 var bytes = [0]
23563 try { 23074 for (var i = 0; i < string.length; i++) {
23564 if (propertyKeyType) { 23075 var value = ALPHABET_MAP[string[i]]
23565 typeforce(propertyKeyType, propertyName, strict) 23076 if (value === undefined) return
23566 }
23567 } catch (e) {
23568 throw tfSubError(e, propertyName, 'key')
23569 }
23570 23077
23571 try { 23078 for (var j = 0, carry = value; j < bytes.length; ++j) {
23572 var propertyValue = value[propertyName] 23079 carry += bytes[j] * BASE
23573 typeforce(propertyType, propertyValue, strict) 23080 bytes[j] = carry & 0xff
23574 } catch (e) { 23081 carry >>= 8
23575 throw tfSubError(e, propertyName)
23576 }
23577 } 23082 }
23578 23083
23579 return true 23084 while (carry > 0) {
23085 bytes.push(carry & 0xff)
23086 carry >>= 8
23087 }
23088 }
23089
23090 // deal with leading zeros
23091 for (var k = 0; string[k] === LEADER && k < string.length - 1; ++k) {
23092 bytes.push(0)
23093 }
23094
23095 return Buffer.from(bytes.reverse())
23096 }
23097
23098 function decode (string) {
23099 var buffer = decodeUnsafe(string)
23100 if (buffer) return buffer
23101
23102 throw new Error('Non-base' + BASE + ' character')
23103 }
23104
23105 return {
23106 encode: encode,
23107 decodeUnsafe: decodeUnsafe,
23108 decode: decode
23109 }
23110}
23111
23112},{"safe-buffer":193}],152:[function(require,module,exports){
23113// (public) Constructor
23114function BigInteger(a, b, c) {
23115 if (!(this instanceof BigInteger))
23116 return new BigInteger(a, b, c)
23117
23118 if (a != null) {
23119 if ("number" == typeof a) this.fromNumber(a, b, c)
23120 else if (b == null && "string" != typeof a) this.fromString(a, 256)
23121 else this.fromString(a, b)
23122 }
23123}
23124
23125var proto = BigInteger.prototype
23126
23127// duck-typed isBigInteger
23128proto.__bigi = require('../package.json').version
23129BigInteger.isBigInteger = function (obj, check_ver) {
23130 return obj && obj.__bigi && (!check_ver || obj.__bigi === proto.__bigi)
23131}
23132
23133// Bits per digit
23134var dbits
23135
23136// am: Compute w_j += (x*this_i), propagate carries,
23137// c is initial carry, returns final carry.
23138// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
23139// We need to select the fastest one that works in this environment.
23140
23141// am1: use a single mult and divide to get the high bits,
23142// max digit bits should be 26 because
23143// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
23144function am1(i, x, w, j, c, n) {
23145 while (--n >= 0) {
23146 var v = x * this[i++] + w[j] + c
23147 c = Math.floor(v / 0x4000000)
23148 w[j++] = v & 0x3ffffff
23149 }
23150 return c
23151}
23152// am2 avoids a big mult-and-extract completely.
23153// Max digit bits should be <= 30 because we do bitwise ops
23154// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
23155function am2(i, x, w, j, c, n) {
23156 var xl = x & 0x7fff,
23157 xh = x >> 15
23158 while (--n >= 0) {
23159 var l = this[i] & 0x7fff
23160 var h = this[i++] >> 15
23161 var m = xh * l + h * xl
23162 l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)
23163 c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)
23164 w[j++] = l & 0x3fffffff
23165 }
23166 return c
23167}
23168// Alternately, set max digit bits to 28 since some
23169// browsers slow down when dealing with 32-bit numbers.
23170function am3(i, x, w, j, c, n) {
23171 var xl = x & 0x3fff,
23172 xh = x >> 14
23173 while (--n >= 0) {
23174 var l = this[i] & 0x3fff
23175 var h = this[i++] >> 14
23176 var m = xh * l + h * xl
23177 l = xl * l + ((m & 0x3fff) << 14) + w[j] + c
23178 c = (l >> 28) + (m >> 14) + xh * h
23179 w[j++] = l & 0xfffffff
23180 }
23181 return c
23182}
23183
23184// wtf?
23185BigInteger.prototype.am = am1
23186dbits = 26
23187
23188BigInteger.prototype.DB = dbits
23189BigInteger.prototype.DM = ((1 << dbits) - 1)
23190var DV = BigInteger.prototype.DV = (1 << dbits)
23191
23192var BI_FP = 52
23193BigInteger.prototype.FV = Math.pow(2, BI_FP)
23194BigInteger.prototype.F1 = BI_FP - dbits
23195BigInteger.prototype.F2 = 2 * dbits - BI_FP
23196
23197// Digit conversions
23198var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"
23199var BI_RC = new Array()
23200var rr, vv
23201rr = "0".charCodeAt(0)
23202for (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv
23203rr = "a".charCodeAt(0)
23204for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv
23205rr = "A".charCodeAt(0)
23206for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv
23207
23208function int2char(n) {
23209 return BI_RM.charAt(n)
23210}
23211
23212function intAt(s, i) {
23213 var c = BI_RC[s.charCodeAt(i)]
23214 return (c == null) ? -1 : c
23215}
23216
23217// (protected) copy this to r
23218function bnpCopyTo(r) {
23219 for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]
23220 r.t = this.t
23221 r.s = this.s
23222}
23223
23224// (protected) set from integer value x, -DV <= x < DV
23225function bnpFromInt(x) {
23226 this.t = 1
23227 this.s = (x < 0) ? -1 : 0
23228 if (x > 0) this[0] = x
23229 else if (x < -1) this[0] = x + DV
23230 else this.t = 0
23231}
23232
23233// return bigint initialized to value
23234function nbv(i) {
23235 var r = new BigInteger()
23236 r.fromInt(i)
23237 return r
23238}
23239
23240// (protected) set from string and radix
23241function bnpFromString(s, b) {
23242 var self = this
23243
23244 var k
23245 if (b == 16) k = 4
23246 else if (b == 8) k = 3
23247 else if (b == 256) k = 8; // byte array
23248 else if (b == 2) k = 1
23249 else if (b == 32) k = 5
23250 else if (b == 4) k = 2
23251 else {
23252 self.fromRadix(s, b)
23253 return
23254 }
23255 self.t = 0
23256 self.s = 0
23257 var i = s.length,
23258 mi = false,
23259 sh = 0
23260 while (--i >= 0) {
23261 var x = (k == 8) ? s[i] & 0xff : intAt(s, i)
23262 if (x < 0) {
23263 if (s.charAt(i) == "-") mi = true
23264 continue
23580 } 23265 }
23266 mi = false
23267 if (sh == 0)
23268 self[self.t++] = x
23269 else if (sh + k > self.DB) {
23270 self[self.t - 1] |= (x & ((1 << (self.DB - sh)) - 1)) << sh
23271 self[self.t++] = (x >> (self.DB - sh))
23272 } else
23273 self[self.t - 1] |= x << sh
23274 sh += k
23275 if (sh >= self.DB) sh -= self.DB
23276 }
23277 if (k == 8 && (s[0] & 0x80) != 0) {
23278 self.s = -1
23279 if (sh > 0) self[self.t - 1] |= ((1 << (self.DB - sh)) - 1) << sh
23280 }
23281 self.clamp()
23282 if (mi) BigInteger.ZERO.subTo(self, self)
23283}
23284
23285// (protected) clamp off excess high words
23286function bnpClamp() {
23287 var c = this.s & this.DM
23288 while (this.t > 0 && this[this.t - 1] == c)--this.t
23289}
23581 23290
23582 if (propertyKeyType) { 23291// (public) return string representation in given radix
23583 _map.toJSON = function () { 23292function bnToString(b) {
23584 return '{' + tfJSON(propertyKeyType) + ': ' + tfJSON(propertyType) + '}' 23293 var self = this
23294 if (self.s < 0) return "-" + self.negate()
23295 .toString(b)
23296 var k
23297 if (b == 16) k = 4
23298 else if (b == 8) k = 3
23299 else if (b == 2) k = 1
23300 else if (b == 32) k = 5
23301 else if (b == 4) k = 2
23302 else return self.toRadix(b)
23303 var km = (1 << k) - 1,
23304 d, m = false,
23305 r = "",
23306 i = self.t
23307 var p = self.DB - (i * self.DB) % k
23308 if (i-- > 0) {
23309 if (p < self.DB && (d = self[i] >> p) > 0) {
23310 m = true
23311 r = int2char(d)
23312 }
23313 while (i >= 0) {
23314 if (p < k) {
23315 d = (self[i] & ((1 << p) - 1)) << (k - p)
23316 d |= self[--i] >> (p += self.DB - k)
23317 } else {
23318 d = (self[i] >> (p -= k)) & km
23319 if (p <= 0) {
23320 p += self.DB
23321 --i
23322 }
23585 } 23323 }
23586 } else { 23324 if (d > 0) m = true
23587 _map.toJSON = function () { return '{' + tfJSON(propertyType) + '}' } 23325 if (m) r += int2char(d)
23588 } 23326 }
23327 }
23328 return m ? r : "0"
23329}
23589 23330
23590 return _map 23331// (public) -this
23591 }, 23332function bnNegate() {
23333 var r = new BigInteger()
23334 BigInteger.ZERO.subTo(this, r)
23335 return r
23336}
23337
23338// (public) |this|
23339function bnAbs() {
23340 return (this.s < 0) ? this.negate() : this
23341}
23342
23343// (public) return + if this > a, - if this < a, 0 if equal
23344function bnCompareTo(a) {
23345 var r = this.s - a.s
23346 if (r != 0) return r
23347 var i = this.t
23348 r = i - a.t
23349 if (r != 0) return (this.s < 0) ? -r : r
23350 while (--i >= 0)
23351 if ((r = this[i] - a[i]) != 0) return r
23352 return 0
23353}
23354
23355// returns bit length of the integer x
23356function nbits(x) {
23357 var r = 1,
23358 t
23359 if ((t = x >>> 16) != 0) {
23360 x = t
23361 r += 16
23362 }
23363 if ((t = x >> 8) != 0) {
23364 x = t
23365 r += 8
23366 }
23367 if ((t = x >> 4) != 0) {
23368 x = t
23369 r += 4
23370 }
23371 if ((t = x >> 2) != 0) {
23372 x = t
23373 r += 2
23374 }
23375 if ((t = x >> 1) != 0) {
23376 x = t
23377 r += 1
23378 }
23379 return r
23380}
23381
23382// (public) return the number of bits in "this"
23383function bnBitLength() {
23384 if (this.t <= 0) return 0
23385 return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))
23386}
23387
23388// (public) return the number of bytes in "this"
23389function bnByteLength() {
23390 return this.bitLength() >> 3
23391}
23392
23393// (protected) r = this << n*DB
23394function bnpDLShiftTo(n, r) {
23395 var i
23396 for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i]
23397 for (i = n - 1; i >= 0; --i) r[i] = 0
23398 r.t = this.t + n
23399 r.s = this.s
23400}
23401
23402// (protected) r = this >> n*DB
23403function bnpDRShiftTo(n, r) {
23404 for (var i = n; i < this.t; ++i) r[i - n] = this[i]
23405 r.t = Math.max(this.t - n, 0)
23406 r.s = this.s
23407}
23592 23408
23593 object: function object (uncompiled) { 23409// (protected) r = this << n
23594 var type = {} 23410function bnpLShiftTo(n, r) {
23411 var self = this
23412 var bs = n % self.DB
23413 var cbs = self.DB - bs
23414 var bm = (1 << cbs) - 1
23415 var ds = Math.floor(n / self.DB),
23416 c = (self.s << bs) & self.DM,
23417 i
23418 for (i = self.t - 1; i >= 0; --i) {
23419 r[i + ds + 1] = (self[i] >> cbs) | c
23420 c = (self[i] & bm) << bs
23421 }
23422 for (i = ds - 1; i >= 0; --i) r[i] = 0
23423 r[ds] = c
23424 r.t = self.t + ds + 1
23425 r.s = self.s
23426 r.clamp()
23427}
23428
23429// (protected) r = this >> n
23430function bnpRShiftTo(n, r) {
23431 var self = this
23432 r.s = self.s
23433 var ds = Math.floor(n / self.DB)
23434 if (ds >= self.t) {
23435 r.t = 0
23436 return
23437 }
23438 var bs = n % self.DB
23439 var cbs = self.DB - bs
23440 var bm = (1 << bs) - 1
23441 r[0] = self[ds] >> bs
23442 for (var i = ds + 1; i < self.t; ++i) {
23443 r[i - ds - 1] |= (self[i] & bm) << cbs
23444 r[i - ds] = self[i] >> bs
23445 }
23446 if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs
23447 r.t = self.t - ds
23448 r.clamp()
23449}
23595 23450
23596 for (var typePropertyName in uncompiled) { 23451// (protected) r = this - a
23597 type[typePropertyName] = compile(uncompiled[typePropertyName]) 23452function bnpSubTo(a, r) {
23453 var self = this
23454 var i = 0,
23455 c = 0,
23456 m = Math.min(a.t, self.t)
23457 while (i < m) {
23458 c += self[i] - a[i]
23459 r[i++] = c & self.DM
23460 c >>= self.DB
23461 }
23462 if (a.t < self.t) {
23463 c -= a.s
23464 while (i < self.t) {
23465 c += self[i]
23466 r[i++] = c & self.DM
23467 c >>= self.DB
23468 }
23469 c += self.s
23470 } else {
23471 c += self.s
23472 while (i < a.t) {
23473 c -= a[i]
23474 r[i++] = c & self.DM
23475 c >>= self.DB
23598 } 23476 }
23477 c -= a.s
23478 }
23479 r.s = (c < 0) ? -1 : 0
23480 if (c < -1) r[i++] = self.DV + c
23481 else if (c > 0) r[i++] = c
23482 r.t = i
23483 r.clamp()
23484}
23599 23485
23600 function _object (value, strict) { 23486// (protected) r = this * a, r != this,a (HAC 14.12)
23601 if (!NATIVE.Object(value)) return false 23487// "this" should be the larger one if appropriate.
23602 if (NATIVE.Nil(value)) return false 23488function bnpMultiplyTo(a, r) {
23489 var x = this.abs(),
23490 y = a.abs()
23491 var i = x.t
23492 r.t = i + y.t
23493 while (--i >= 0) r[i] = 0
23494 for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t)
23495 r.s = 0
23496 r.clamp()
23497 if (this.s != a.s) BigInteger.ZERO.subTo(r, r)
23498}
23603 23499
23604 var propertyName 23500// (protected) r = this^2, r != this (HAC 14.16)
23501function bnpSquareTo(r) {
23502 var x = this.abs()
23503 var i = r.t = 2 * x.t
23504 while (--i >= 0) r[i] = 0
23505 for (i = 0; i < x.t - 1; ++i) {
23506 var c = x.am(i, x[i], r, 2 * i, 0, 1)
23507 if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {
23508 r[i + x.t] -= x.DV
23509 r[i + x.t + 1] = 1
23510 }
23511 }
23512 if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1)
23513 r.s = 0
23514 r.clamp()
23515}
23605 23516
23606 try { 23517// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
23607 for (propertyName in type) { 23518// r != q, this != m. q or r may be null.
23608 var propertyType = type[propertyName] 23519function bnpDivRemTo(m, q, r) {
23609 var propertyValue = value[propertyName] 23520 var self = this
23521 var pm = m.abs()
23522 if (pm.t <= 0) return
23523 var pt = self.abs()
23524 if (pt.t < pm.t) {
23525 if (q != null) q.fromInt(0)
23526 if (r != null) self.copyTo(r)
23527 return
23528 }
23529 if (r == null) r = new BigInteger()
23530 var y = new BigInteger(),
23531 ts = self.s,
23532 ms = m.s
23533 var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus
23534 if (nsh > 0) {
23535 pm.lShiftTo(nsh, y)
23536 pt.lShiftTo(nsh, r)
23537 } else {
23538 pm.copyTo(y)
23539 pt.copyTo(r)
23540 }
23541 var ys = y.t
23542 var y0 = y[ys - 1]
23543 if (y0 == 0) return
23544 var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)
23545 var d1 = self.FV / yt,
23546 d2 = (1 << self.F1) / yt,
23547 e = 1 << self.F2
23548 var i = r.t,
23549 j = i - ys,
23550 t = (q == null) ? new BigInteger() : q
23551 y.dlShiftTo(j, t)
23552 if (r.compareTo(t) >= 0) {
23553 r[r.t++] = 1
23554 r.subTo(t, r)
23555 }
23556 BigInteger.ONE.dlShiftTo(ys, t)
23557 t.subTo(y, y); // "negative" y so we can replace sub with am later
23558 while (y.t < ys) y[y.t++] = 0
23559 while (--j >= 0) {
23560 // Estimate quotient digit
23561 var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)
23562 if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out
23563 y.dlShiftTo(j, t)
23564 r.subTo(t, r)
23565 while (r[i] < --qd) r.subTo(t, r)
23566 }
23567 }
23568 if (q != null) {
23569 r.drShiftTo(ys, q)
23570 if (ts != ms) BigInteger.ZERO.subTo(q, q)
23571 }
23572 r.t = ys
23573 r.clamp()
23574 if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder
23575 if (ts < 0) BigInteger.ZERO.subTo(r, r)
23576}
23577
23578// (public) this mod a
23579function bnMod(a) {
23580 var r = new BigInteger()
23581 this.abs()
23582 .divRemTo(a, null, r)
23583 if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)
23584 return r
23585}
23586
23587// Modular reduction using "classic" algorithm
23588function Classic(m) {
23589 this.m = m
23590}
23591
23592function cConvert(x) {
23593 if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m)
23594 else return x
23595}
23596
23597function cRevert(x) {
23598 return x
23599}
23600
23601function cReduce(x) {
23602 x.divRemTo(this.m, null, x)
23603}
23604
23605function cMulTo(x, y, r) {
23606 x.multiplyTo(y, r)
23607 this.reduce(r)
23608}
23609
23610function cSqrTo(x, r) {
23611 x.squareTo(r)
23612 this.reduce(r)
23613}
23614
23615Classic.prototype.convert = cConvert
23616Classic.prototype.revert = cRevert
23617Classic.prototype.reduce = cReduce
23618Classic.prototype.mulTo = cMulTo
23619Classic.prototype.sqrTo = cSqrTo
23620
23621// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
23622// justification:
23623// xy == 1 (mod m)
23624// xy = 1+km
23625// xy(2-xy) = (1+km)(1-km)
23626// x[y(2-xy)] = 1-k^2m^2
23627// x[y(2-xy)] == 1 (mod m^2)
23628// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
23629// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
23630// JS multiply "overflows" differently from C/C++, so care is needed here.
23631function bnpInvDigit() {
23632 if (this.t < 1) return 0
23633 var x = this[0]
23634 if ((x & 1) == 0) return 0
23635 var y = x & 3; // y == 1/x mod 2^2
23636 y = (y * (2 - (x & 0xf) * y)) & 0xf; // y == 1/x mod 2^4
23637 y = (y * (2 - (x & 0xff) * y)) & 0xff; // y == 1/x mod 2^8
23638 y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff; // y == 1/x mod 2^16
23639 // last step - calculate inverse mod DV directly
23640 // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
23641 y = (y * (2 - x * y % this.DV)) % this.DV; // y == 1/x mod 2^dbits
23642 // we really want the negative inverse, and -DV < y < DV
23643 return (y > 0) ? this.DV - y : -y
23644}
23645
23646// Montgomery reduction
23647function Montgomery(m) {
23648 this.m = m
23649 this.mp = m.invDigit()
23650 this.mpl = this.mp & 0x7fff
23651 this.mph = this.mp >> 15
23652 this.um = (1 << (m.DB - 15)) - 1
23653 this.mt2 = 2 * m.t
23654}
23655
23656// xR mod m
23657function montConvert(x) {
23658 var r = new BigInteger()
23659 x.abs()
23660 .dlShiftTo(this.m.t, r)
23661 r.divRemTo(this.m, null, r)
23662 if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r)
23663 return r
23664}
23665
23666// x/R mod m
23667function montRevert(x) {
23668 var r = new BigInteger()
23669 x.copyTo(r)
23670 this.reduce(r)
23671 return r
23672}
23673
23674// x = x/R mod m (HAC 14.32)
23675function montReduce(x) {
23676 while (x.t <= this.mt2) // pad x so am has enough room later
23677 x[x.t++] = 0
23678 for (var i = 0; i < this.m.t; ++i) {
23679 // faster way of calculating u0 = x[i]*mp mod DV
23680 var j = x[i] & 0x7fff
23681 var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM
23682 // use am to combine the multiply-shift-add into one call
23683 j = i + this.m.t
23684 x[j] += this.m.am(0, u0, x, i, 0, this.m.t)
23685 // propagate carry
23686 while (x[j] >= x.DV) {
23687 x[j] -= x.DV
23688 x[++j]++
23689 }
23690 }
23691 x.clamp()
23692 x.drShiftTo(this.m.t, x)
23693 if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)
23694}
23695
23696// r = "x^2/R mod m"; x != r
23697function montSqrTo(x, r) {
23698 x.squareTo(r)
23699 this.reduce(r)
23700}
23701
23702// r = "xy/R mod m"; x,y != r
23703function montMulTo(x, y, r) {
23704 x.multiplyTo(y, r)
23705 this.reduce(r)
23706}
23707
23708Montgomery.prototype.convert = montConvert
23709Montgomery.prototype.revert = montRevert
23710Montgomery.prototype.reduce = montReduce
23711Montgomery.prototype.mulTo = montMulTo
23712Montgomery.prototype.sqrTo = montSqrTo
23713
23714// (protected) true iff this is even
23715function bnpIsEven() {
23716 return ((this.t > 0) ? (this[0] & 1) : this.s) == 0
23717}
23718
23719// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
23720function bnpExp(e, z) {
23721 if (e > 0xffffffff || e < 1) return BigInteger.ONE
23722 var r = new BigInteger(),
23723 r2 = new BigInteger(),
23724 g = z.convert(this),
23725 i = nbits(e) - 1
23726 g.copyTo(r)
23727 while (--i >= 0) {
23728 z.sqrTo(r, r2)
23729 if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)
23730 else {
23731 var t = r
23732 r = r2
23733 r2 = t
23734 }
23735 }
23736 return z.revert(r)
23737}
23738
23739// (public) this^e % m, 0 <= e < 2^32
23740function bnModPowInt(e, m) {
23741 var z
23742 if (e < 256 || m.isEven()) z = new Classic(m)
23743 else z = new Montgomery(m)
23744 return this.exp(e, z)
23745}
23746
23747// protected
23748proto.copyTo = bnpCopyTo
23749proto.fromInt = bnpFromInt
23750proto.fromString = bnpFromString
23751proto.clamp = bnpClamp
23752proto.dlShiftTo = bnpDLShiftTo
23753proto.drShiftTo = bnpDRShiftTo
23754proto.lShiftTo = bnpLShiftTo
23755proto.rShiftTo = bnpRShiftTo
23756proto.subTo = bnpSubTo
23757proto.multiplyTo = bnpMultiplyTo
23758proto.squareTo = bnpSquareTo
23759proto.divRemTo = bnpDivRemTo
23760proto.invDigit = bnpInvDigit
23761proto.isEven = bnpIsEven
23762proto.exp = bnpExp
23763
23764// public
23765proto.toString = bnToString
23766proto.negate = bnNegate
23767proto.abs = bnAbs
23768proto.compareTo = bnCompareTo
23769proto.bitLength = bnBitLength
23770proto.byteLength = bnByteLength
23771proto.mod = bnMod
23772proto.modPowInt = bnModPowInt
23773
23774// (public)
23775function bnClone() {
23776 var r = new BigInteger()
23777 this.copyTo(r)
23778 return r
23779}
23780
23781// (public) return value as integer
23782function bnIntValue() {
23783 if (this.s < 0) {
23784 if (this.t == 1) return this[0] - this.DV
23785 else if (this.t == 0) return -1
23786 } else if (this.t == 1) return this[0]
23787 else if (this.t == 0) return 0
23788 // assumes 16 < DB < 32
23789 return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]
23790}
23791
23792// (public) return value as byte
23793function bnByteValue() {
23794 return (this.t == 0) ? this.s : (this[0] << 24) >> 24
23795}
23796
23797// (public) return value as short (assumes DB>=16)
23798function bnShortValue() {
23799 return (this.t == 0) ? this.s : (this[0] << 16) >> 16
23800}
23801
23802// (protected) return x s.t. r^x < DV
23803function bnpChunkSize(r) {
23804 return Math.floor(Math.LN2 * this.DB / Math.log(r))
23805}
23806
23807// (public) 0 if this == 0, 1 if this > 0
23808function bnSigNum() {
23809 if (this.s < 0) return -1
23810 else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0
23811 else return 1
23812}
23813
23814// (protected) convert to radix string
23815function bnpToRadix(b) {
23816 if (b == null) b = 10
23817 if (this.signum() == 0 || b < 2 || b > 36) return "0"
23818 var cs = this.chunkSize(b)
23819 var a = Math.pow(b, cs)
23820 var d = nbv(a),
23821 y = new BigInteger(),
23822 z = new BigInteger(),
23823 r = ""
23824 this.divRemTo(d, y, z)
23825 while (y.signum() > 0) {
23826 r = (a + z.intValue())
23827 .toString(b)
23828 .substr(1) + r
23829 y.divRemTo(d, y, z)
23830 }
23831 return z.intValue()
23832 .toString(b) + r
23833}
23834
23835// (protected) convert from radix string
23836function bnpFromRadix(s, b) {
23837 var self = this
23838 self.fromInt(0)
23839 if (b == null) b = 10
23840 var cs = self.chunkSize(b)
23841 var d = Math.pow(b, cs),
23842 mi = false,
23843 j = 0,
23844 w = 0
23845 for (var i = 0; i < s.length; ++i) {
23846 var x = intAt(s, i)
23847 if (x < 0) {
23848 if (s.charAt(i) == "-" && self.signum() == 0) mi = true
23849 continue
23850 }
23851 w = b * w + x
23852 if (++j >= cs) {
23853 self.dMultiply(d)
23854 self.dAddOffset(w, 0)
23855 j = 0
23856 w = 0
23857 }
23858 }
23859 if (j > 0) {
23860 self.dMultiply(Math.pow(b, j))
23861 self.dAddOffset(w, 0)
23862 }
23863 if (mi) BigInteger.ZERO.subTo(self, self)
23864}
23865
23866// (protected) alternate constructor
23867function bnpFromNumber(a, b, c) {
23868 var self = this
23869 if ("number" == typeof b) {
23870 // new BigInteger(int,int,RNG)
23871 if (a < 2) self.fromInt(1)
23872 else {
23873 self.fromNumber(a, c)
23874 if (!self.testBit(a - 1)) // force MSB set
23875 self.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, self)
23876 if (self.isEven()) self.dAddOffset(1, 0); // force odd
23877 while (!self.isProbablePrime(b)) {
23878 self.dAddOffset(2, 0)
23879 if (self.bitLength() > a) self.subTo(BigInteger.ONE.shiftLeft(a - 1), self)
23880 }
23881 }
23882 } else {
23883 // new BigInteger(int,RNG)
23884 var x = new Array(),
23885 t = a & 7
23886 x.length = (a >> 3) + 1
23887 b.nextBytes(x)
23888 if (t > 0) x[0] &= ((1 << t) - 1)
23889 else x[0] = 0
23890 self.fromString(x, 256)
23891 }
23892}
23610 23893
23611 typeforce(propertyType, propertyValue, strict) 23894// (public) convert to bigendian byte array
23895function bnToByteArray() {
23896 var self = this
23897 var i = self.t,
23898 r = new Array()
23899 r[0] = self.s
23900 var p = self.DB - (i * self.DB) % 8,
23901 d, k = 0
23902 if (i-- > 0) {
23903 if (p < self.DB && (d = self[i] >> p) != (self.s & self.DM) >> p)
23904 r[k++] = d | (self.s << (self.DB - p))
23905 while (i >= 0) {
23906 if (p < 8) {
23907 d = (self[i] & ((1 << p) - 1)) << (8 - p)
23908 d |= self[--i] >> (p += self.DB - 8)
23909 } else {
23910 d = (self[i] >> (p -= 8)) & 0xff
23911 if (p <= 0) {
23912 p += self.DB
23913 --i
23612 } 23914 }
23613 } catch (e) {
23614 throw tfSubError(e, propertyName)
23615 } 23915 }
23916 if ((d & 0x80) != 0) d |= -256
23917 if (k === 0 && (self.s & 0x80) != (d & 0x80))++k
23918 if (k > 0 || d != self.s) r[k++] = d
23919 }
23920 }
23921 return r
23922}
23923
23924function bnEquals(a) {
23925 return (this.compareTo(a) == 0)
23926}
23927
23928function bnMin(a) {
23929 return (this.compareTo(a) < 0) ? this : a
23930}
23616 23931
23617 if (strict) { 23932function bnMax(a) {
23618 for (propertyName in value) { 23933 return (this.compareTo(a) > 0) ? this : a
23619 if (type[propertyName]) continue 23934}
23620 23935
23621 throw new TfPropertyTypeError(undefined, propertyName) 23936// (protected) r = this op a (bitwise)
23622 } 23937function bnpBitwiseTo(a, op, r) {
23938 var self = this
23939 var i, f, m = Math.min(a.t, self.t)
23940 for (i = 0; i < m; ++i) r[i] = op(self[i], a[i])
23941 if (a.t < self.t) {
23942 f = a.s & self.DM
23943 for (i = m; i < self.t; ++i) r[i] = op(self[i], f)
23944 r.t = self.t
23945 } else {
23946 f = self.s & self.DM
23947 for (i = m; i < a.t; ++i) r[i] = op(f, a[i])
23948 r.t = a.t
23949 }
23950 r.s = op(self.s, a.s)
23951 r.clamp()
23952}
23953
23954// (public) this & a
23955function op_and(x, y) {
23956 return x & y
23957}
23958
23959function bnAnd(a) {
23960 var r = new BigInteger()
23961 this.bitwiseTo(a, op_and, r)
23962 return r
23963}
23964
23965// (public) this | a
23966function op_or(x, y) {
23967 return x | y
23968}
23969
23970function bnOr(a) {
23971 var r = new BigInteger()
23972 this.bitwiseTo(a, op_or, r)
23973 return r
23974}
23975
23976// (public) this ^ a
23977function op_xor(x, y) {
23978 return x ^ y
23979}
23980
23981function bnXor(a) {
23982 var r = new BigInteger()
23983 this.bitwiseTo(a, op_xor, r)
23984 return r
23985}
23986
23987// (public) this & ~a
23988function op_andnot(x, y) {
23989 return x & ~y
23990}
23991
23992function bnAndNot(a) {
23993 var r = new BigInteger()
23994 this.bitwiseTo(a, op_andnot, r)
23995 return r
23996}
23997
23998// (public) ~this
23999function bnNot() {
24000 var r = new BigInteger()
24001 for (var i = 0; i < this.t; ++i) r[i] = this.DM & ~this[i]
24002 r.t = this.t
24003 r.s = ~this.s
24004 return r
24005}
24006
24007// (public) this << n
24008function bnShiftLeft(n) {
24009 var r = new BigInteger()
24010 if (n < 0) this.rShiftTo(-n, r)
24011 else this.lShiftTo(n, r)
24012 return r
24013}
24014
24015// (public) this >> n
24016function bnShiftRight(n) {
24017 var r = new BigInteger()
24018 if (n < 0) this.lShiftTo(-n, r)
24019 else this.rShiftTo(n, r)
24020 return r
24021}
24022
24023// return index of lowest 1-bit in x, x < 2^31
24024function lbit(x) {
24025 if (x == 0) return -1
24026 var r = 0
24027 if ((x & 0xffff) == 0) {
24028 x >>= 16
24029 r += 16
24030 }
24031 if ((x & 0xff) == 0) {
24032 x >>= 8
24033 r += 8
24034 }
24035 if ((x & 0xf) == 0) {
24036 x >>= 4
24037 r += 4
24038 }
24039 if ((x & 3) == 0) {
24040 x >>= 2
24041 r += 2
24042 }
24043 if ((x & 1) == 0)++r
24044 return r
24045}
24046
24047// (public) returns index of lowest 1-bit (or -1 if none)
24048function bnGetLowestSetBit() {
24049 for (var i = 0; i < this.t; ++i)
24050 if (this[i] != 0) return i * this.DB + lbit(this[i])
24051 if (this.s < 0) return this.t * this.DB
24052 return -1
24053}
24054
24055// return number of 1 bits in x
24056function cbit(x) {
24057 var r = 0
24058 while (x != 0) {
24059 x &= x - 1
24060 ++r
24061 }
24062 return r
24063}
24064
24065// (public) return number of set bits
24066function bnBitCount() {
24067 var r = 0,
24068 x = this.s & this.DM
24069 for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)
24070 return r
24071}
24072
24073// (public) true iff nth bit is set
24074function bnTestBit(n) {
24075 var j = Math.floor(n / this.DB)
24076 if (j >= this.t) return (this.s != 0)
24077 return ((this[j] & (1 << (n % this.DB))) != 0)
24078}
24079
24080// (protected) this op (1<<n)
24081function bnpChangeBit(n, op) {
24082 var r = BigInteger.ONE.shiftLeft(n)
24083 this.bitwiseTo(r, op, r)
24084 return r
24085}
24086
24087// (public) this | (1<<n)
24088function bnSetBit(n) {
24089 return this.changeBit(n, op_or)
24090}
24091
24092// (public) this & ~(1<<n)
24093function bnClearBit(n) {
24094 return this.changeBit(n, op_andnot)
24095}
24096
24097// (public) this ^ (1<<n)
24098function bnFlipBit(n) {
24099 return this.changeBit(n, op_xor)
24100}
24101
24102// (protected) r = this + a
24103function bnpAddTo(a, r) {
24104 var self = this
24105
24106 var i = 0,
24107 c = 0,
24108 m = Math.min(a.t, self.t)
24109 while (i < m) {
24110 c += self[i] + a[i]
24111 r[i++] = c & self.DM
24112 c >>= self.DB
24113 }
24114 if (a.t < self.t) {
24115 c += a.s
24116 while (i < self.t) {
24117 c += self[i]
24118 r[i++] = c & self.DM
24119 c >>= self.DB
24120 }
24121 c += self.s
24122 } else {
24123 c += self.s
24124 while (i < a.t) {
24125 c += a[i]
24126 r[i++] = c & self.DM
24127 c >>= self.DB
24128 }
24129 c += a.s
24130 }
24131 r.s = (c < 0) ? -1 : 0
24132 if (c > 0) r[i++] = c
24133 else if (c < -1) r[i++] = self.DV + c
24134 r.t = i
24135 r.clamp()
24136}
24137
24138// (public) this + a
24139function bnAdd(a) {
24140 var r = new BigInteger()
24141 this.addTo(a, r)
24142 return r
24143}
24144
24145// (public) this - a
24146function bnSubtract(a) {
24147 var r = new BigInteger()
24148 this.subTo(a, r)
24149 return r
24150}
24151
24152// (public) this * a
24153function bnMultiply(a) {
24154 var r = new BigInteger()
24155 this.multiplyTo(a, r)
24156 return r
24157}
24158
24159// (public) this^2
24160function bnSquare() {
24161 var r = new BigInteger()
24162 this.squareTo(r)
24163 return r
24164}
24165
24166// (public) this / a
24167function bnDivide(a) {
24168 var r = new BigInteger()
24169 this.divRemTo(a, r, null)
24170 return r
24171}
24172
24173// (public) this % a
24174function bnRemainder(a) {
24175 var r = new BigInteger()
24176 this.divRemTo(a, null, r)
24177 return r
24178}
24179
24180// (public) [this/a,this%a]
24181function bnDivideAndRemainder(a) {
24182 var q = new BigInteger(),
24183 r = new BigInteger()
24184 this.divRemTo(a, q, r)
24185 return new Array(q, r)
24186}
24187
24188// (protected) this *= n, this >= 0, 1 < n < DV
24189function bnpDMultiply(n) {
24190 this[this.t] = this.am(0, n - 1, this, 0, 0, this.t)
24191 ++this.t
24192 this.clamp()
24193}
24194
24195// (protected) this += n << w words, this >= 0
24196function bnpDAddOffset(n, w) {
24197 if (n == 0) return
24198 while (this.t <= w) this[this.t++] = 0
24199 this[w] += n
24200 while (this[w] >= this.DV) {
24201 this[w] -= this.DV
24202 if (++w >= this.t) this[this.t++] = 0
24203 ++this[w]
24204 }
24205}
24206
24207// A "null" reducer
24208function NullExp() {}
24209
24210function nNop(x) {
24211 return x
24212}
24213
24214function nMulTo(x, y, r) {
24215 x.multiplyTo(y, r)
24216}
24217
24218function nSqrTo(x, r) {
24219 x.squareTo(r)
24220}
24221
24222NullExp.prototype.convert = nNop
24223NullExp.prototype.revert = nNop
24224NullExp.prototype.mulTo = nMulTo
24225NullExp.prototype.sqrTo = nSqrTo
24226
24227// (public) this^e
24228function bnPow(e) {
24229 return this.exp(e, new NullExp())
24230}
24231
24232// (protected) r = lower n words of "this * a", a.t <= n
24233// "this" should be the larger one if appropriate.
24234function bnpMultiplyLowerTo(a, n, r) {
24235 var i = Math.min(this.t + a.t, n)
24236 r.s = 0; // assumes a,this >= 0
24237 r.t = i
24238 while (i > 0) r[--i] = 0
24239 var j
24240 for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.am(0, a[i], r, i, 0, this.t)
24241 for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a[i], r, i, 0, n - i)
24242 r.clamp()
24243}
24244
24245// (protected) r = "this * a" without lower n words, n > 0
24246// "this" should be the larger one if appropriate.
24247function bnpMultiplyUpperTo(a, n, r) {
24248 --n
24249 var i = r.t = this.t + a.t - n
24250 r.s = 0; // assumes a,this >= 0
24251 while (--i >= 0) r[i] = 0
24252 for (i = Math.max(n - this.t, 0); i < a.t; ++i)
24253 r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n)
24254 r.clamp()
24255 r.drShiftTo(1, r)
24256}
24257
24258// Barrett modular reduction
24259function Barrett(m) {
24260 // setup Barrett
24261 this.r2 = new BigInteger()
24262 this.q3 = new BigInteger()
24263 BigInteger.ONE.dlShiftTo(2 * m.t, this.r2)
24264 this.mu = this.r2.divide(m)
24265 this.m = m
24266}
24267
24268function barrettConvert(x) {
24269 if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m)
24270 else if (x.compareTo(this.m) < 0) return x
24271 else {
24272 var r = new BigInteger()
24273 x.copyTo(r)
24274 this.reduce(r)
24275 return r
24276 }
24277}
24278
24279function barrettRevert(x) {
24280 return x
24281}
24282
24283// x = x mod m (HAC 14.42)
24284function barrettReduce(x) {
24285 var self = this
24286 x.drShiftTo(self.m.t - 1, self.r2)
24287 if (x.t > self.m.t + 1) {
24288 x.t = self.m.t + 1
24289 x.clamp()
24290 }
24291 self.mu.multiplyUpperTo(self.r2, self.m.t + 1, self.q3)
24292 self.m.multiplyLowerTo(self.q3, self.m.t + 1, self.r2)
24293 while (x.compareTo(self.r2) < 0) x.dAddOffset(1, self.m.t + 1)
24294 x.subTo(self.r2, x)
24295 while (x.compareTo(self.m) >= 0) x.subTo(self.m, x)
24296}
24297
24298// r = x^2 mod m; x != r
24299function barrettSqrTo(x, r) {
24300 x.squareTo(r)
24301 this.reduce(r)
24302}
24303
24304// r = x*y mod m; x,y != r
24305function barrettMulTo(x, y, r) {
24306 x.multiplyTo(y, r)
24307 this.reduce(r)
24308}
24309
24310Barrett.prototype.convert = barrettConvert
24311Barrett.prototype.revert = barrettRevert
24312Barrett.prototype.reduce = barrettReduce
24313Barrett.prototype.mulTo = barrettMulTo
24314Barrett.prototype.sqrTo = barrettSqrTo
24315
24316// (public) this^e % m (HAC 14.85)
24317function bnModPow(e, m) {
24318 var i = e.bitLength(),
24319 k, r = nbv(1),
24320 z
24321 if (i <= 0) return r
24322 else if (i < 18) k = 1
24323 else if (i < 48) k = 3
24324 else if (i < 144) k = 4
24325 else if (i < 768) k = 5
24326 else k = 6
24327 if (i < 8)
24328 z = new Classic(m)
24329 else if (m.isEven())
24330 z = new Barrett(m)
24331 else
24332 z = new Montgomery(m)
24333
24334 // precomputation
24335 var g = new Array(),
24336 n = 3,
24337 k1 = k - 1,
24338 km = (1 << k) - 1
24339 g[1] = z.convert(this)
24340 if (k > 1) {
24341 var g2 = new BigInteger()
24342 z.sqrTo(g[1], g2)
24343 while (n <= km) {
24344 g[n] = new BigInteger()
24345 z.mulTo(g2, g[n - 2], g[n])
24346 n += 2
24347 }
24348 }
24349
24350 var j = e.t - 1,
24351 w, is1 = true,
24352 r2 = new BigInteger(),
24353 t
24354 i = nbits(e[j]) - 1
24355 while (j >= 0) {
24356 if (i >= k1) w = (e[j] >> (i - k1)) & km
24357 else {
24358 w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)
24359 if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)
24360 }
24361
24362 n = k
24363 while ((w & 1) == 0) {
24364 w >>= 1
24365 --n
24366 }
24367 if ((i -= n) < 0) {
24368 i += this.DB
24369 --j
24370 }
24371 if (is1) { // ret == 1, don't bother squaring or multiplying it
24372 g[w].copyTo(r)
24373 is1 = false
24374 } else {
24375 while (n > 1) {
24376 z.sqrTo(r, r2)
24377 z.sqrTo(r2, r)
24378 n -= 2
24379 }
24380 if (n > 0) z.sqrTo(r, r2)
24381 else {
24382 t = r
24383 r = r2
24384 r2 = t
23623 } 24385 }
24386 z.mulTo(r2, g[w], r)
24387 }
23624 24388
23625 return true 24389 while (j >= 0 && (e[j] & (1 << i)) == 0) {
24390 z.sqrTo(r, r2)
24391 t = r
24392 r = r2
24393 r2 = t
24394 if (--i < 0) {
24395 i = this.DB - 1
24396 --j
24397 }
23626 } 24398 }
23627 _object.toJSON = function () { return tfJSON(type) } 24399 }
24400 return z.revert(r)
24401}
23628 24402
23629 return _object 24403// (public) gcd(this,a) (HAC 14.54)
23630 }, 24404function bnGCD(a) {
24405 var x = (this.s < 0) ? this.negate() : this.clone()
24406 var y = (a.s < 0) ? a.negate() : a.clone()
24407 if (x.compareTo(y) < 0) {
24408 var t = x
24409 x = y
24410 y = t
24411 }
24412 var i = x.getLowestSetBit(),
24413 g = y.getLowestSetBit()
24414 if (g < 0) return x
24415 if (i < g) g = i
24416 if (g > 0) {
24417 x.rShiftTo(g, x)
24418 y.rShiftTo(g, y)
24419 }
24420 while (x.signum() > 0) {
24421 if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)
24422 if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)
24423 if (x.compareTo(y) >= 0) {
24424 x.subTo(y, x)
24425 x.rShiftTo(1, x)
24426 } else {
24427 y.subTo(x, y)
24428 y.rShiftTo(1, y)
24429 }
24430 }
24431 if (g > 0) y.lShiftTo(g, y)
24432 return y
24433}
23631 24434
23632 oneOf: function oneOf () { 24435// (protected) this % n, n < 2^26
23633 var types = [].slice.call(arguments).map(compile) 24436function bnpModInt(n) {
24437 if (n <= 0) return 0
24438 var d = this.DV % n,
24439 r = (this.s < 0) ? n - 1 : 0
24440 if (this.t > 0)
24441 if (d == 0) r = this[0] % n
24442 else
24443 for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n
24444 return r
24445}
23634 24446
23635 function _oneOf (value, strict) { 24447// (public) 1/this % m (HAC 14.61)
23636 return types.some(function (type) { 24448function bnModInverse(m) {
23637 try { 24449 var ac = m.isEven()
23638 return typeforce(type, value, strict) 24450 if (this.signum() === 0) throw new Error('division by zero')
23639 } catch (e) { 24451 if ((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO
23640 return false 24452 var u = m.clone(),
24453 v = this.clone()
24454 var a = nbv(1),
24455 b = nbv(0),
24456 c = nbv(0),
24457 d = nbv(1)
24458 while (u.signum() != 0) {
24459 while (u.isEven()) {
24460 u.rShiftTo(1, u)
24461 if (ac) {
24462 if (!a.isEven() || !b.isEven()) {
24463 a.addTo(this, a)
24464 b.subTo(m, b)
24465 }
24466 a.rShiftTo(1, a)
24467 } else if (!b.isEven()) b.subTo(m, b)
24468 b.rShiftTo(1, b)
24469 }
24470 while (v.isEven()) {
24471 v.rShiftTo(1, v)
24472 if (ac) {
24473 if (!c.isEven() || !d.isEven()) {
24474 c.addTo(this, c)
24475 d.subTo(m, d)
23641 } 24476 }
23642 }) 24477 c.rShiftTo(1, c)
24478 } else if (!d.isEven()) d.subTo(m, d)
24479 d.rShiftTo(1, d)
24480 }
24481 if (u.compareTo(v) >= 0) {
24482 u.subTo(v, u)
24483 if (ac) a.subTo(c, a)
24484 b.subTo(d, b)
24485 } else {
24486 v.subTo(u, v)
24487 if (ac) c.subTo(a, c)
24488 d.subTo(b, d)
23643 } 24489 }
23644 _oneOf.toJSON = function () { return types.map(tfJSON).join('|') } 24490 }
24491 if (v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO
24492 while (d.compareTo(m) >= 0) d.subTo(m, d)
24493 while (d.signum() < 0) d.addTo(m, d)
24494 return d
24495}
23645 24496
23646 return _oneOf 24497var lowprimes = [
23647 }, 24498 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
24499 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
24500 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233,
24501 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317,
24502 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419,
24503 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503,
24504 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607,
24505 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701,
24506 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811,
24507 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911,
24508 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997
24509]
24510
24511var lplim = (1 << 26) / lowprimes[lowprimes.length - 1]
24512
24513// (public) test primality with certainty >= 1-.5^t
24514function bnIsProbablePrime(t) {
24515 var i, x = this.abs()
24516 if (x.t == 1 && x[0] <= lowprimes[lowprimes.length - 1]) {
24517 for (i = 0; i < lowprimes.length; ++i)
24518 if (x[0] == lowprimes[i]) return true
24519 return false
24520 }
24521 if (x.isEven()) return false
24522 i = 1
24523 while (i < lowprimes.length) {
24524 var m = lowprimes[i],
24525 j = i + 1
24526 while (j < lowprimes.length && m < lplim) m *= lowprimes[j++]
24527 m = x.modInt(m)
24528 while (i < j) if (m % lowprimes[i++] == 0) return false
24529 }
24530 return x.millerRabin(t)
24531}
23648 24532
23649 quacksLike: function quacksLike (type) { 24533// (protected) true if probably prime (HAC 4.24, Miller-Rabin)
23650 function _quacksLike (value) { 24534function bnpMillerRabin(t) {
23651 return type === getValueTypeName(value) 24535 var n1 = this.subtract(BigInteger.ONE)
24536 var k = n1.getLowestSetBit()
24537 if (k <= 0) return false
24538 var r = n1.shiftRight(k)
24539 t = (t + 1) >> 1
24540 if (t > lowprimes.length) t = lowprimes.length
24541 var a = new BigInteger(null)
24542 var j, bases = []
24543 for (var i = 0; i < t; ++i) {
24544 for (;;) {
24545 j = lowprimes[Math.floor(Math.random() * lowprimes.length)]
24546 if (bases.indexOf(j) == -1) break
24547 }
24548 bases.push(j)
24549 a.fromInt(j)
24550 var y = a.modPow(r, this)
24551 if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
24552 var j = 1
24553 while (j++ < k && y.compareTo(n1) != 0) {
24554 y = y.modPowInt(2, this)
24555 if (y.compareTo(BigInteger.ONE) == 0) return false
24556 }
24557 if (y.compareTo(n1) != 0) return false
23652 } 24558 }
23653 _quacksLike.toJSON = function () { return type } 24559 }
24560 return true
24561}
24562
24563// protected
24564proto.chunkSize = bnpChunkSize
24565proto.toRadix = bnpToRadix
24566proto.fromRadix = bnpFromRadix
24567proto.fromNumber = bnpFromNumber
24568proto.bitwiseTo = bnpBitwiseTo
24569proto.changeBit = bnpChangeBit
24570proto.addTo = bnpAddTo
24571proto.dMultiply = bnpDMultiply
24572proto.dAddOffset = bnpDAddOffset
24573proto.multiplyLowerTo = bnpMultiplyLowerTo
24574proto.multiplyUpperTo = bnpMultiplyUpperTo
24575proto.modInt = bnpModInt
24576proto.millerRabin = bnpMillerRabin
24577
24578// public
24579proto.clone = bnClone
24580proto.intValue = bnIntValue
24581proto.byteValue = bnByteValue
24582proto.shortValue = bnShortValue
24583proto.signum = bnSigNum
24584proto.toByteArray = bnToByteArray
24585proto.equals = bnEquals
24586proto.min = bnMin
24587proto.max = bnMax
24588proto.and = bnAnd
24589proto.or = bnOr
24590proto.xor = bnXor
24591proto.andNot = bnAndNot
24592proto.not = bnNot
24593proto.shiftLeft = bnShiftLeft
24594proto.shiftRight = bnShiftRight
24595proto.getLowestSetBit = bnGetLowestSetBit
24596proto.bitCount = bnBitCount
24597proto.testBit = bnTestBit
24598proto.setBit = bnSetBit
24599proto.clearBit = bnClearBit
24600proto.flipBit = bnFlipBit
24601proto.add = bnAdd
24602proto.subtract = bnSubtract
24603proto.multiply = bnMultiply
24604proto.divide = bnDivide
24605proto.remainder = bnRemainder
24606proto.divideAndRemainder = bnDivideAndRemainder
24607proto.modPow = bnModPow
24608proto.modInverse = bnModInverse
24609proto.pow = bnPow
24610proto.gcd = bnGCD
24611proto.isProbablePrime = bnIsProbablePrime
24612
24613// JSBN-specific extension
24614proto.square = bnSquare
24615
24616// constants
24617BigInteger.ZERO = nbv(0)
24618BigInteger.ONE = nbv(1)
24619BigInteger.valueOf = nbv
24620
24621module.exports = BigInteger
24622
24623},{"../package.json":155}],153:[function(require,module,exports){
24624(function (Buffer){
24625// FIXME: Kind of a weird way to throw exceptions, consider removing
24626var assert = require('assert')
24627var BigInteger = require('./bigi')
24628
24629/**
24630 * Turns a byte array into a big integer.
24631 *
24632 * This function will interpret a byte array as a big integer in big
24633 * endian notation.
24634 */
24635BigInteger.fromByteArrayUnsigned = function(byteArray) {
24636 // BigInteger expects a DER integer conformant byte array
24637 if (byteArray[0] & 0x80) {
24638 return new BigInteger([0].concat(byteArray))
24639 }
24640
24641 return new BigInteger(byteArray)
24642}
24643
24644/**
24645 * Returns a byte array representation of the big integer.
24646 *
24647 * This returns the absolute of the contained value in big endian
24648 * form. A value of zero results in an empty array.
24649 */
24650BigInteger.prototype.toByteArrayUnsigned = function() {
24651 var byteArray = this.toByteArray()
24652 return byteArray[0] === 0 ? byteArray.slice(1) : byteArray
24653}
24654
24655BigInteger.fromDERInteger = function(byteArray) {
24656 return new BigInteger(byteArray)
24657}
24658
24659/*
24660 * Converts BigInteger to a DER integer representation.
24661 *
24662 * The format for this value uses the most significant bit as a sign
24663 * bit. If the most significant bit is already set and the integer is
24664 * positive, a 0x00 is prepended.
24665 *
24666 * Examples:
24667 *
24668 * 0 => 0x00
24669 * 1 => 0x01
24670 * -1 => 0xff
24671 * 127 => 0x7f
24672 * -127 => 0x81
24673 * 128 => 0x0080
24674 * -128 => 0x80
24675 * 255 => 0x00ff
24676 * -255 => 0xff01
24677 * 16300 => 0x3fac
24678 * -16300 => 0xc054
24679 * 62300 => 0x00f35c
24680 * -62300 => 0xff0ca4
24681*/
24682BigInteger.prototype.toDERInteger = BigInteger.prototype.toByteArray
24683
24684BigInteger.fromBuffer = function(buffer) {
24685 // BigInteger expects a DER integer conformant byte array
24686 if (buffer[0] & 0x80) {
24687 var byteArray = Array.prototype.slice.call(buffer)
24688
24689 return new BigInteger([0].concat(byteArray))
24690 }
24691
24692 return new BigInteger(buffer)
24693}
24694
24695BigInteger.fromHex = function(hex) {
24696 if (hex === '') return BigInteger.ZERO
24697
24698 assert.equal(hex, hex.match(/^[A-Fa-f0-9]+/), 'Invalid hex string')
24699 assert.equal(hex.length % 2, 0, 'Incomplete hex')
24700 return new BigInteger(hex, 16)
24701}
24702
24703BigInteger.prototype.toBuffer = function(size) {
24704 var byteArray = this.toByteArrayUnsigned()
24705 var zeros = []
24706
24707 var padding = size - byteArray.length
24708 while (zeros.length < padding) zeros.push(0)
24709
24710 return new Buffer(zeros.concat(byteArray))
24711}
24712
24713BigInteger.prototype.toHex = function(size) {
24714 return this.toBuffer(size).toString('hex')
24715}
24716
24717}).call(this,require("buffer").Buffer)
24718},{"./bigi":152,"assert":15,"buffer":47}],154:[function(require,module,exports){
24719var BigInteger = require('./bigi')
24720
24721//addons
24722require('./convert')
23654 24723
23655 return _quacksLike 24724module.exports = BigInteger
24725},{"./bigi":152,"./convert":153}],155:[function(require,module,exports){
24726module.exports={
24727 "_args": [
24728 [
24729 "bigi@^1.2.0",
24730 "/home/ian/git/bitcoin/bitcoinjs-bip38"
24731 ]
24732 ],
24733 "_from": "bigi@>=1.2.0 <2.0.0",
24734 "_id": "bigi@1.4.2",
24735 "_inCache": true,
24736 "_installable": true,
24737 "_location": "/bigi",
24738 "_nodeVersion": "6.1.0",
24739 "_npmOperationalInternal": {
24740 "host": "packages-12-west.internal.npmjs.com",
24741 "tmp": "tmp/bigi-1.4.2.tgz_1469584192413_0.6801238611806184"
24742 },
24743 "_npmUser": {
24744 "email": "jprichardson@gmail.com",
24745 "name": "jprichardson"
24746 },
24747 "_npmVersion": "3.8.6",
24748 "_phantomChildren": {},
24749 "_requested": {
24750 "name": "bigi",
24751 "raw": "bigi@^1.2.0",
24752 "rawSpec": "^1.2.0",
24753 "scope": null,
24754 "spec": ">=1.2.0 <2.0.0",
24755 "type": "range"
24756 },
24757 "_requiredBy": [
24758 "/",
24759 "/ecurve"
24760 ],
24761 "_resolved": "https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz",
24762 "_shasum": "9c665a95f88b8b08fc05cfd731f561859d725825",
24763 "_shrinkwrap": null,
24764 "_spec": "bigi@^1.2.0",
24765 "_where": "/home/ian/git/bitcoin/bitcoinjs-bip38",
24766 "bugs": {
24767 "url": "https://github.com/cryptocoinjs/bigi/issues"
24768 },
24769 "dependencies": {},
24770 "description": "Big integers.",
24771 "devDependencies": {
24772 "coveralls": "^2.11.2",
24773 "istanbul": "^0.3.5",
24774 "jshint": "^2.5.1",
24775 "mocha": "^2.1.0",
24776 "mochify": "^2.1.0"
24777 },
24778 "directories": {},
24779 "dist": {
24780 "shasum": "9c665a95f88b8b08fc05cfd731f561859d725825",
24781 "tarball": "https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz"
24782 },
24783 "gitHead": "c25308081c896ff84702303722bf5ecd8b3f78e3",
24784 "homepage": "https://github.com/cryptocoinjs/bigi#readme",
24785 "keywords": [
24786 "cryptography",
24787 "math",
24788 "bitcoin",
24789 "arbitrary",
24790 "precision",
24791 "arithmetic",
24792 "big",
24793 "integer",
24794 "int",
24795 "number",
24796 "biginteger",
24797 "bigint",
24798 "bignumber",
24799 "decimal",
24800 "float"
24801 ],
24802 "main": "./lib/index.js",
24803 "maintainers": [
24804 {
24805 "email": "boydb@midnightdesign.ws",
24806 "name": "midnightlightning"
24807 },
24808 {
24809 "email": "sidazhang89@gmail.com",
24810 "name": "sidazhang"
24811 },
24812 {
24813 "email": "npm@shesek.info",
24814 "name": "nadav"
24815 },
24816 {
24817 "email": "jprichardson@gmail.com",
24818 "name": "jprichardson"
24819 }
24820 ],
24821 "name": "bigi",
24822 "optionalDependencies": {},
24823 "readme": "ERROR: No README data found!",
24824 "repository": {
24825 "type": "git",
24826 "url": "git+https://github.com/cryptocoinjs/bigi.git"
24827 },
24828 "scripts": {
24829 "browser-test": "mochify --wd -R spec",
24830 "coverage": "istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js",
24831 "coveralls": "npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info",
24832 "jshint": "jshint --config jshint.json lib/*.js ; true",
24833 "test": "_mocha -- test/*.js",
24834 "unit": "mocha"
23656 }, 24835 },
24836 "testling": {
24837 "browsers": [
24838 "ie/9..latest",
24839 "firefox/latest",
24840 "chrome/latest",
24841 "safari/6.0..latest",
24842 "iphone/6.0..latest",
24843 "android-browser/4.2..latest"
24844 ],
24845 "files": "test/*.js",
24846 "harness": "mocha"
24847 },
24848 "version": "1.4.2"
24849}
23657 24850
23658 tuple: function tuple () { 24851},{}],156:[function(require,module,exports){
23659 var types = [].slice.call(arguments).map(compile) 24852// based on the aes implimentation in triple sec
24853// https://github.com/keybase/triplesec
24854// which is in turn based on the one from crypto-js
24855// https://code.google.com/p/crypto-js/
23660 24856
23661 function _tuple (values, strict) { 24857var Buffer = require('safe-buffer').Buffer
23662 if (NATIVE.Nil(values)) return false
23663 if (NATIVE.Nil(values.length)) return false
23664 if (strict && (values.length !== types.length)) return false
23665 24858
23666 return types.every(function (type, i) { 24859function asUInt32Array (buf) {
23667 try { 24860 if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)
23668 return typeforce(type, values[i], strict) 24861
23669 } catch (e) { 24862 var len = (buf.length / 4) | 0
23670 throw tfSubError(e, i) 24863 var out = new Array(len)
23671 } 24864
23672 }) 24865 for (var i = 0; i < len; i++) {
24866 out[i] = buf.readUInt32BE(i * 4)
24867 }
24868
24869 return out
24870}
24871
24872function scrubVec (v) {
24873 for (var i = 0; i < v.length; v++) {
24874 v[i] = 0
24875 }
24876}
24877
24878function cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) {
24879 var SUB_MIX0 = SUB_MIX[0]
24880 var SUB_MIX1 = SUB_MIX[1]
24881 var SUB_MIX2 = SUB_MIX[2]
24882 var SUB_MIX3 = SUB_MIX[3]
24883
24884 var s0 = M[0] ^ keySchedule[0]
24885 var s1 = M[1] ^ keySchedule[1]
24886 var s2 = M[2] ^ keySchedule[2]
24887 var s3 = M[3] ^ keySchedule[3]
24888 var t0, t1, t2, t3
24889 var ksRow = 4
24890
24891 for (var round = 1; round < nRounds; round++) {
24892 t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++]
24893 t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++]
24894 t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++]
24895 t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++]
24896 s0 = t0
24897 s1 = t1
24898 s2 = t2
24899 s3 = t3
24900 }
24901
24902 t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]
24903 t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]
24904 t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]
24905 t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]
24906 t0 = t0 >>> 0
24907 t1 = t1 >>> 0
24908 t2 = t2 >>> 0
24909 t3 = t3 >>> 0
24910
24911 return [t0, t1, t2, t3]
24912}
24913
24914// AES constants
24915var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]
24916var G = (function () {
24917 // Compute double table
24918 var d = new Array(256)
24919 for (var j = 0; j < 256; j++) {
24920 if (j < 128) {
24921 d[j] = j << 1
24922 } else {
24923 d[j] = (j << 1) ^ 0x11b
24924 }
24925 }
24926
24927 var SBOX = []
24928 var INV_SBOX = []
24929 var SUB_MIX = [[], [], [], []]
24930 var INV_SUB_MIX = [[], [], [], []]
24931
24932 // Walk GF(2^8)
24933 var x = 0
24934 var xi = 0
24935 for (var i = 0; i < 256; ++i) {
24936 // Compute sbox
24937 var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)
24938 sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63
24939 SBOX[x] = sx
24940 INV_SBOX[sx] = x
24941
24942 // Compute multiplication
24943 var x2 = d[x]
24944 var x4 = d[x2]
24945 var x8 = d[x4]
24946
24947 // Compute sub bytes, mix columns tables
24948 var t = (d[sx] * 0x101) ^ (sx * 0x1010100)
24949 SUB_MIX[0][x] = (t << 24) | (t >>> 8)
24950 SUB_MIX[1][x] = (t << 16) | (t >>> 16)
24951 SUB_MIX[2][x] = (t << 8) | (t >>> 24)
24952 SUB_MIX[3][x] = t
24953
24954 // Compute inv sub bytes, inv mix columns tables
24955 t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)
24956 INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)
24957 INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)
24958 INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)
24959 INV_SUB_MIX[3][sx] = t
24960
24961 if (x === 0) {
24962 x = xi = 1
24963 } else {
24964 x = x2 ^ d[d[d[x8 ^ x2]]]
24965 xi ^= d[d[xi]]
23673 } 24966 }
23674 _tuple.toJSON = function () { return '(' + types.map(tfJSON).join(', ') + ')' } 24967 }
23675 24968
23676 return _tuple 24969 return {
23677 }, 24970 SBOX: SBOX,
24971 INV_SBOX: INV_SBOX,
24972 SUB_MIX: SUB_MIX,
24973 INV_SUB_MIX: INV_SUB_MIX
24974 }
24975})()
24976
24977function AES (key) {
24978 this._key = asUInt32Array(key)
24979 this._reset()
24980}
24981
24982AES.blockSize = 4 * 4
24983AES.keySize = 256 / 8
24984AES.prototype.blockSize = AES.blockSize
24985AES.prototype.keySize = AES.keySize
24986AES.prototype._reset = function () {
24987 var keyWords = this._key
24988 var keySize = keyWords.length
24989 var nRounds = keySize + 6
24990 var ksRows = (nRounds + 1) * 4
24991
24992 var keySchedule = []
24993 for (var k = 0; k < keySize; k++) {
24994 keySchedule[k] = keyWords[k]
24995 }
24996
24997 for (k = keySize; k < ksRows; k++) {
24998 var t = keySchedule[k - 1]
24999
25000 if (k % keySize === 0) {
25001 t = (t << 8) | (t >>> 24)
25002 t =
25003 (G.SBOX[t >>> 24] << 24) |
25004 (G.SBOX[(t >>> 16) & 0xff] << 16) |
25005 (G.SBOX[(t >>> 8) & 0xff] << 8) |
25006 (G.SBOX[t & 0xff])
25007
25008 t ^= RCON[(k / keySize) | 0] << 24
25009 } else if (keySize > 6 && k % keySize === 4) {
25010 t =
25011 (G.SBOX[t >>> 24] << 24) |
25012 (G.SBOX[(t >>> 16) & 0xff] << 16) |
25013 (G.SBOX[(t >>> 8) & 0xff] << 8) |
25014 (G.SBOX[t & 0xff])
25015 }
25016
25017 keySchedule[k] = keySchedule[k - keySize] ^ t
25018 }
25019
25020 var invKeySchedule = []
25021 for (var ik = 0; ik < ksRows; ik++) {
25022 var ksR = ksRows - ik
25023 var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]
25024
25025 if (ik < 4 || ksR <= 4) {
25026 invKeySchedule[ik] = tt
25027 } else {
25028 invKeySchedule[ik] =
25029 G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^
25030 G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^
25031 G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^
25032 G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]]
25033 }
25034 }
25035
25036 this._nRounds = nRounds
25037 this._keySchedule = keySchedule
25038 this._invKeySchedule = invKeySchedule
25039}
25040
25041AES.prototype.encryptBlockRaw = function (M) {
25042 M = asUInt32Array(M)
25043 return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds)
25044}
25045
25046AES.prototype.encryptBlock = function (M) {
25047 var out = this.encryptBlockRaw(M)
25048 var buf = Buffer.allocUnsafe(16)
25049 buf.writeUInt32BE(out[0], 0)
25050 buf.writeUInt32BE(out[1], 4)
25051 buf.writeUInt32BE(out[2], 8)
25052 buf.writeUInt32BE(out[3], 12)
25053 return buf
25054}
25055
25056AES.prototype.decryptBlock = function (M) {
25057 M = asUInt32Array(M)
25058
25059 // swap
25060 var m1 = M[1]
25061 M[1] = M[3]
25062 M[3] = m1
25063
25064 var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds)
25065 var buf = Buffer.allocUnsafe(16)
25066 buf.writeUInt32BE(out[0], 0)
25067 buf.writeUInt32BE(out[3], 4)
25068 buf.writeUInt32BE(out[2], 8)
25069 buf.writeUInt32BE(out[1], 12)
25070 return buf
25071}
25072
25073AES.prototype.scrub = function () {
25074 scrubVec(this._keySchedule)
25075 scrubVec(this._invKeySchedule)
25076 scrubVec(this._key)
25077}
25078
25079module.exports.AES = AES
25080
25081},{"safe-buffer":193}],157:[function(require,module,exports){
25082var aes = require('./aes')
25083var Buffer = require('safe-buffer').Buffer
25084var Transform = require('cipher-base')
25085var inherits = require('inherits')
25086var GHASH = require('./ghash')
25087var xor = require('buffer-xor')
25088var incr32 = require('./incr32')
25089
25090function xorTest (a, b) {
25091 var out = 0
25092 if (a.length !== b.length) out++
25093
25094 var len = Math.min(a.length, b.length)
25095 for (var i = 0; i < len; ++i) {
25096 out += (a[i] ^ b[i])
25097 }
25098
25099 return out
25100}
25101
25102function calcIv (self, iv, ck) {
25103 if (iv.length === 12) {
25104 self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])])
25105 return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])])
25106 }
25107 var ghash = new GHASH(ck)
25108 var len = iv.length
25109 var toPad = len % 16
25110 ghash.update(iv)
25111 if (toPad) {
25112 toPad = 16 - toPad
25113 ghash.update(Buffer.alloc(toPad, 0))
25114 }
25115 ghash.update(Buffer.alloc(8, 0))
25116 var ivBits = len * 8
25117 var tail = Buffer.alloc(8)
25118 tail.writeUIntBE(ivBits, 0, 8)
25119 ghash.update(tail)
25120 self._finID = ghash.state
25121 var out = Buffer.from(self._finID)
25122 incr32(out)
25123 return out
25124}
25125function StreamCipher (mode, key, iv, decrypt) {
25126 Transform.call(this)
25127
25128 var h = Buffer.alloc(4, 0)
25129
25130 this._cipher = new aes.AES(key)
25131 var ck = this._cipher.encryptBlock(h)
25132 this._ghash = new GHASH(ck)
25133 iv = calcIv(this, iv, ck)
25134
25135 this._prev = Buffer.from(iv)
25136 this._cache = Buffer.allocUnsafe(0)
25137 this._secCache = Buffer.allocUnsafe(0)
25138 this._decrypt = decrypt
25139 this._alen = 0
25140 this._len = 0
25141 this._mode = mode
25142
25143 this._authTag = null
25144 this._called = false
25145}
25146
25147inherits(StreamCipher, Transform)
25148
25149StreamCipher.prototype._update = function (chunk) {
25150 if (!this._called && this._alen) {
25151 var rump = 16 - (this._alen % 16)
25152 if (rump < 16) {
25153 rump = Buffer.alloc(rump, 0)
25154 this._ghash.update(rump)
25155 }
25156 }
25157
25158 this._called = true
25159 var out = this._mode.encrypt(this, chunk)
25160 if (this._decrypt) {
25161 this._ghash.update(chunk)
25162 } else {
25163 this._ghash.update(out)
25164 }
25165 this._len += chunk.length
25166 return out
25167}
25168
25169StreamCipher.prototype._final = function () {
25170 if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data')
25171
25172 var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))
25173 if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data')
25174
25175 this._authTag = tag
25176 this._cipher.scrub()
25177}
25178
25179StreamCipher.prototype.getAuthTag = function getAuthTag () {
25180 if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state')
25181
25182 return this._authTag
25183}
25184
25185StreamCipher.prototype.setAuthTag = function setAuthTag (tag) {
25186 if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state')
25187
25188 this._authTag = tag
25189}
25190
25191StreamCipher.prototype.setAAD = function setAAD (buf) {
25192 if (this._called) throw new Error('Attempting to set AAD in unsupported state')
25193
25194 this._ghash.update(buf)
25195 this._alen += buf.length
25196}
25197
25198module.exports = StreamCipher
25199
25200},{"./aes":156,"./ghash":161,"./incr32":162,"buffer-xor":176,"cipher-base":178,"inherits":189,"safe-buffer":193}],158:[function(require,module,exports){
25201var ciphers = require('./encrypter')
25202var deciphers = require('./decrypter')
25203var modes = require('./modes/list.json')
25204
25205function getCiphers () {
25206 return Object.keys(modes)
25207}
25208
25209exports.createCipher = exports.Cipher = ciphers.createCipher
25210exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv
25211exports.createDecipher = exports.Decipher = deciphers.createDecipher
25212exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv
25213exports.listCiphers = exports.getCiphers = getCiphers
25214
25215},{"./decrypter":159,"./encrypter":160,"./modes/list.json":170}],159:[function(require,module,exports){
25216var AuthCipher = require('./authCipher')
25217var Buffer = require('safe-buffer').Buffer
25218var MODES = require('./modes')
25219var StreamCipher = require('./streamCipher')
25220var Transform = require('cipher-base')
25221var aes = require('./aes')
25222var ebtk = require('evp_bytestokey')
25223var inherits = require('inherits')
25224
25225function Decipher (mode, key, iv) {
25226 Transform.call(this)
25227
25228 this._cache = new Splitter()
25229 this._last = void 0
25230 this._cipher = new aes.AES(key)
25231 this._prev = Buffer.from(iv)
25232 this._mode = mode
25233 this._autopadding = true
25234}
25235
25236inherits(Decipher, Transform)
25237
25238Decipher.prototype._update = function (data) {
25239 this._cache.add(data)
25240 var chunk
25241 var thing
25242 var out = []
25243 while ((chunk = this._cache.get(this._autopadding))) {
25244 thing = this._mode.decrypt(this, chunk)
25245 out.push(thing)
25246 }
25247 return Buffer.concat(out)
25248}
25249
25250Decipher.prototype._final = function () {
25251 var chunk = this._cache.flush()
25252 if (this._autopadding) {
25253 return unpad(this._mode.decrypt(this, chunk))
25254 } else if (chunk) {
25255 throw new Error('data not multiple of block length')
25256 }
25257}
25258
25259Decipher.prototype.setAutoPadding = function (setTo) {
25260 this._autopadding = !!setTo
25261 return this
25262}
25263
25264function Splitter () {
25265 this.cache = Buffer.allocUnsafe(0)
25266}
25267
25268Splitter.prototype.add = function (data) {
25269 this.cache = Buffer.concat([this.cache, data])
25270}
25271
25272Splitter.prototype.get = function (autoPadding) {
25273 var out
25274 if (autoPadding) {
25275 if (this.cache.length > 16) {
25276 out = this.cache.slice(0, 16)
25277 this.cache = this.cache.slice(16)
25278 return out
25279 }
25280 } else {
25281 if (this.cache.length >= 16) {
25282 out = this.cache.slice(0, 16)
25283 this.cache = this.cache.slice(16)
25284 return out
25285 }
25286 }
25287
25288 return null
25289}
25290
25291Splitter.prototype.flush = function () {
25292 if (this.cache.length) return this.cache
25293}
25294
25295function unpad (last) {
25296 var padded = last[15]
25297 var i = -1
25298 while (++i < padded) {
25299 if (last[(i + (16 - padded))] !== padded) {
25300 throw new Error('unable to decrypt data')
25301 }
25302 }
25303 if (padded === 16) return
25304
25305 return last.slice(0, 16 - padded)
25306}
25307
25308function createDecipheriv (suite, password, iv) {
25309 var config = MODES[suite.toLowerCase()]
25310 if (!config) throw new TypeError('invalid suite type')
25311
25312 if (typeof iv === 'string') iv = Buffer.from(iv)
25313 if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
25314
25315 if (typeof password === 'string') password = Buffer.from(password)
25316 if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
25317
25318 if (config.type === 'stream') {
25319 return new StreamCipher(config.module, password, iv, true)
25320 } else if (config.type === 'auth') {
25321 return new AuthCipher(config.module, password, iv, true)
25322 }
25323
25324 return new Decipher(config.module, password, iv)
25325}
25326
25327function createDecipher (suite, password) {
25328 var config = MODES[suite.toLowerCase()]
25329 if (!config) throw new TypeError('invalid suite type')
25330
25331 var keys = ebtk(password, false, config.key, config.iv)
25332 return createDecipheriv(suite, keys.key, keys.iv)
25333}
25334
25335exports.createDecipher = createDecipher
25336exports.createDecipheriv = createDecipheriv
25337
25338},{"./aes":156,"./authCipher":157,"./modes":169,"./streamCipher":172,"cipher-base":178,"evp_bytestokey":187,"inherits":189,"safe-buffer":193}],160:[function(require,module,exports){
25339var MODES = require('./modes')
25340var AuthCipher = require('./authCipher')
25341var Buffer = require('safe-buffer').Buffer
25342var StreamCipher = require('./streamCipher')
25343var Transform = require('cipher-base')
25344var aes = require('./aes')
25345var ebtk = require('evp_bytestokey')
25346var inherits = require('inherits')
25347
25348function Cipher (mode, key, iv) {
25349 Transform.call(this)
25350
25351 this._cache = new Splitter()
25352 this._cipher = new aes.AES(key)
25353 this._prev = Buffer.from(iv)
25354 this._mode = mode
25355 this._autopadding = true
25356}
25357
25358inherits(Cipher, Transform)
23678 25359
23679 value: function value (expected) { 25360Cipher.prototype._update = function (data) {
23680 function _value (actual) { 25361 this._cache.add(data)
23681 return actual === expected 25362 var chunk
25363 var thing
25364 var out = []
25365
25366 while ((chunk = this._cache.get())) {
25367 thing = this._mode.encrypt(this, chunk)
25368 out.push(thing)
25369 }
25370
25371 return Buffer.concat(out)
25372}
25373
25374var PADDING = Buffer.alloc(16, 0x10)
25375
25376Cipher.prototype._final = function () {
25377 var chunk = this._cache.flush()
25378 if (this._autopadding) {
25379 chunk = this._mode.encrypt(this, chunk)
25380 this._cipher.scrub()
25381 return chunk
25382 }
25383
25384 if (!chunk.equals(PADDING)) {
25385 this._cipher.scrub()
25386 throw new Error('data not multiple of block length')
25387 }
25388}
25389
25390Cipher.prototype.setAutoPadding = function (setTo) {
25391 this._autopadding = !!setTo
25392 return this
25393}
25394
25395function Splitter () {
25396 this.cache = Buffer.allocUnsafe(0)
25397}
25398
25399Splitter.prototype.add = function (data) {
25400 this.cache = Buffer.concat([this.cache, data])
25401}
25402
25403Splitter.prototype.get = function () {
25404 if (this.cache.length > 15) {
25405 var out = this.cache.slice(0, 16)
25406 this.cache = this.cache.slice(16)
25407 return out
25408 }
25409 return null
25410}
25411
25412Splitter.prototype.flush = function () {
25413 var len = 16 - this.cache.length
25414 var padBuff = Buffer.allocUnsafe(len)
25415
25416 var i = -1
25417 while (++i < len) {
25418 padBuff.writeUInt8(len, i)
25419 }
25420
25421 return Buffer.concat([this.cache, padBuff])
25422}
25423
25424function createCipheriv (suite, password, iv) {
25425 var config = MODES[suite.toLowerCase()]
25426 if (!config) throw new TypeError('invalid suite type')
25427
25428 if (typeof password === 'string') password = Buffer.from(password)
25429 if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
25430
25431 if (typeof iv === 'string') iv = Buffer.from(iv)
25432 if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
25433
25434 if (config.type === 'stream') {
25435 return new StreamCipher(config.module, password, iv)
25436 } else if (config.type === 'auth') {
25437 return new AuthCipher(config.module, password, iv)
25438 }
25439
25440 return new Cipher(config.module, password, iv)
25441}
25442
25443function createCipher (suite, password) {
25444 var config = MODES[suite.toLowerCase()]
25445 if (!config) throw new TypeError('invalid suite type')
25446
25447 var keys = ebtk(password, false, config.key, config.iv)
25448 return createCipheriv(suite, keys.key, keys.iv)
25449}
25450
25451exports.createCipheriv = createCipheriv
25452exports.createCipher = createCipher
25453
25454},{"./aes":156,"./authCipher":157,"./modes":169,"./streamCipher":172,"cipher-base":178,"evp_bytestokey":187,"inherits":189,"safe-buffer":193}],161:[function(require,module,exports){
25455var Buffer = require('safe-buffer').Buffer
25456var ZEROES = Buffer.alloc(16, 0)
25457
25458function toArray (buf) {
25459 return [
25460 buf.readUInt32BE(0),
25461 buf.readUInt32BE(4),
25462 buf.readUInt32BE(8),
25463 buf.readUInt32BE(12)
25464 ]
25465}
25466
25467function fromArray (out) {
25468 var buf = Buffer.allocUnsafe(16)
25469 buf.writeUInt32BE(out[0] >>> 0, 0)
25470 buf.writeUInt32BE(out[1] >>> 0, 4)
25471 buf.writeUInt32BE(out[2] >>> 0, 8)
25472 buf.writeUInt32BE(out[3] >>> 0, 12)
25473 return buf
25474}
25475
25476function GHASH (key) {
25477 this.h = key
25478 this.state = Buffer.alloc(16, 0)
25479 this.cache = Buffer.allocUnsafe(0)
25480}
25481
25482// from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html
25483// by Juho Vähä-Herttua
25484GHASH.prototype.ghash = function (block) {
25485 var i = -1
25486 while (++i < block.length) {
25487 this.state[i] ^= block[i]
25488 }
25489 this._multiply()
25490}
25491
25492GHASH.prototype._multiply = function () {
25493 var Vi = toArray(this.h)
25494 var Zi = [0, 0, 0, 0]
25495 var j, xi, lsbVi
25496 var i = -1
25497 while (++i < 128) {
25498 xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0
25499 if (xi) {
25500 // Z_i+1 = Z_i ^ V_i
25501 Zi[0] ^= Vi[0]
25502 Zi[1] ^= Vi[1]
25503 Zi[2] ^= Vi[2]
25504 Zi[3] ^= Vi[3]
25505 }
25506
25507 // Store the value of LSB(V_i)
25508 lsbVi = (Vi[3] & 1) !== 0
25509
25510 // V_i+1 = V_i >> 1
25511 for (j = 3; j > 0; j--) {
25512 Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)
25513 }
25514 Vi[0] = Vi[0] >>> 1
25515
25516 // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R
25517 if (lsbVi) {
25518 Vi[0] = Vi[0] ^ (0xe1 << 24)
25519 }
25520 }
25521 this.state = fromArray(Zi)
25522}
25523
25524GHASH.prototype.update = function (buf) {
25525 this.cache = Buffer.concat([this.cache, buf])
25526 var chunk
25527 while (this.cache.length >= 16) {
25528 chunk = this.cache.slice(0, 16)
25529 this.cache = this.cache.slice(16)
25530 this.ghash(chunk)
25531 }
25532}
25533
25534GHASH.prototype.final = function (abl, bl) {
25535 if (this.cache.length) {
25536 this.ghash(Buffer.concat([this.cache, ZEROES], 16))
25537 }
25538
25539 this.ghash(fromArray([0, abl, 0, bl]))
25540 return this.state
25541}
25542
25543module.exports = GHASH
25544
25545},{"safe-buffer":193}],162:[function(require,module,exports){
25546function incr32 (iv) {
25547 var len = iv.length
25548 var item
25549 while (len--) {
25550 item = iv.readUInt8(len)
25551 if (item === 255) {
25552 iv.writeUInt8(0, len)
25553 } else {
25554 item++
25555 iv.writeUInt8(item, len)
25556 break
25557 }
25558 }
25559}
25560module.exports = incr32
25561
25562},{}],163:[function(require,module,exports){
25563arguments[4][27][0].apply(exports,arguments)
25564},{"buffer-xor":176,"dup":27}],164:[function(require,module,exports){
25565var Buffer = require('safe-buffer').Buffer
25566var xor = require('buffer-xor')
25567
25568function encryptStart (self, data, decrypt) {
25569 var len = data.length
25570 var out = xor(data, self._cache)
25571 self._cache = self._cache.slice(len)
25572 self._prev = Buffer.concat([self._prev, decrypt ? data : out])
25573 return out
25574}
25575
25576exports.encrypt = function (self, data, decrypt) {
25577 var out = Buffer.allocUnsafe(0)
25578 var len
25579
25580 while (data.length) {
25581 if (self._cache.length === 0) {
25582 self._cache = self._cipher.encryptBlock(self._prev)
25583 self._prev = Buffer.allocUnsafe(0)
25584 }
25585
25586 if (self._cache.length <= data.length) {
25587 len = self._cache.length
25588 out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])
25589 data = data.slice(len)
25590 } else {
25591 out = Buffer.concat([out, encryptStart(self, data, decrypt)])
25592 break
23682 } 25593 }
23683 _value.toJSON = function () { return expected } 25594 }
25595
25596 return out
25597}
25598
25599},{"buffer-xor":176,"safe-buffer":193}],165:[function(require,module,exports){
25600var Buffer = require('safe-buffer').Buffer
25601
25602function encryptByte (self, byteParam, decrypt) {
25603 var pad
25604 var i = -1
25605 var len = 8
25606 var out = 0
25607 var bit, value
25608 while (++i < len) {
25609 pad = self._cipher.encryptBlock(self._prev)
25610 bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0
25611 value = pad[0] ^ bit
25612 out += ((value & 0x80) >> (i % 8))
25613 self._prev = shiftIn(self._prev, decrypt ? bit : value)
25614 }
25615 return out
25616}
25617
25618function shiftIn (buffer, value) {
25619 var len = buffer.length
25620 var i = -1
25621 var out = Buffer.allocUnsafe(buffer.length)
25622 buffer = Buffer.concat([buffer, Buffer.from([value])])
25623
25624 while (++i < len) {
25625 out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)
25626 }
25627
25628 return out
25629}
25630
25631exports.encrypt = function (self, chunk, decrypt) {
25632 var len = chunk.length
25633 var out = Buffer.allocUnsafe(len)
25634 var i = -1
25635
25636 while (++i < len) {
25637 out[i] = encryptByte(self, chunk[i], decrypt)
25638 }
25639
25640 return out
25641}
25642
25643},{"safe-buffer":193}],166:[function(require,module,exports){
25644var Buffer = require('safe-buffer').Buffer
25645
25646function encryptByte (self, byteParam, decrypt) {
25647 var pad = self._cipher.encryptBlock(self._prev)
25648 var out = pad[0] ^ byteParam
25649
25650 self._prev = Buffer.concat([
25651 self._prev.slice(1),
25652 Buffer.from([decrypt ? byteParam : out])
25653 ])
25654
25655 return out
25656}
25657
25658exports.encrypt = function (self, chunk, decrypt) {
25659 var len = chunk.length
25660 var out = Buffer.allocUnsafe(len)
25661 var i = -1
25662
25663 while (++i < len) {
25664 out[i] = encryptByte(self, chunk[i], decrypt)
25665 }
25666
25667 return out
25668}
25669
25670},{"safe-buffer":193}],167:[function(require,module,exports){
25671var xor = require('buffer-xor')
25672var Buffer = require('safe-buffer').Buffer
25673var incr32 = require('../incr32')
25674
25675function getBlock (self) {
25676 var out = self._cipher.encryptBlockRaw(self._prev)
25677 incr32(self._prev)
25678 return out
25679}
25680
25681var blockSize = 16
25682exports.encrypt = function (self, chunk) {
25683 var chunkNum = Math.ceil(chunk.length / blockSize)
25684 var start = self._cache.length
25685 self._cache = Buffer.concat([
25686 self._cache,
25687 Buffer.allocUnsafe(chunkNum * blockSize)
25688 ])
25689 for (var i = 0; i < chunkNum; i++) {
25690 var out = getBlock(self)
25691 var offset = start + i * blockSize
25692 self._cache.writeUInt32BE(out[0], offset + 0)
25693 self._cache.writeUInt32BE(out[1], offset + 4)
25694 self._cache.writeUInt32BE(out[2], offset + 8)
25695 self._cache.writeUInt32BE(out[3], offset + 12)
25696 }
25697 var pad = self._cache.slice(0, chunk.length)
25698 self._cache = self._cache.slice(chunk.length)
25699 return xor(chunk, pad)
25700}
25701
25702},{"../incr32":162,"buffer-xor":176,"safe-buffer":193}],168:[function(require,module,exports){
25703exports.encrypt = function (self, block) {
25704 return self._cipher.encryptBlock(block)
25705}
25706
25707exports.decrypt = function (self, block) {
25708 return self._cipher.decryptBlock(block)
25709}
25710
25711},{}],169:[function(require,module,exports){
25712var modeModules = {
25713 ECB: require('./ecb'),
25714 CBC: require('./cbc'),
25715 CFB: require('./cfb'),
25716 CFB8: require('./cfb8'),
25717 CFB1: require('./cfb1'),
25718 OFB: require('./ofb'),
25719 CTR: require('./ctr'),
25720 GCM: require('./ctr')
25721}
25722
25723var modes = require('./list.json')
25724
25725for (var key in modes) {
25726 modes[key].module = modeModules[modes[key].mode]
25727}
25728
25729module.exports = modes
23684 25730
23685 return _value 25731},{"./cbc":163,"./cfb":164,"./cfb1":165,"./cfb8":166,"./ctr":167,"./ecb":168,"./list.json":170,"./ofb":171}],170:[function(require,module,exports){
25732module.exports={
25733 "aes-128-ecb": {
25734 "cipher": "AES",
25735 "key": 128,
25736 "iv": 0,
25737 "mode": "ECB",
25738 "type": "block"
25739 },
25740 "aes-192-ecb": {
25741 "cipher": "AES",
25742 "key": 192,
25743 "iv": 0,
25744 "mode": "ECB",
25745 "type": "block"
25746 },
25747 "aes-256-ecb": {
25748 "cipher": "AES",
25749 "key": 256,
25750 "iv": 0,
25751 "mode": "ECB",
25752 "type": "block"
25753 },
25754 "aes-128-cbc": {
25755 "cipher": "AES",
25756 "key": 128,
25757 "iv": 16,
25758 "mode": "CBC",
25759 "type": "block"
25760 },
25761 "aes-192-cbc": {
25762 "cipher": "AES",
25763 "key": 192,
25764 "iv": 16,
25765 "mode": "CBC",
25766 "type": "block"
25767 },
25768 "aes-256-cbc": {
25769 "cipher": "AES",
25770 "key": 256,
25771 "iv": 16,
25772 "mode": "CBC",
25773 "type": "block"
25774 },
25775 "aes128": {
25776 "cipher": "AES",
25777 "key": 128,
25778 "iv": 16,
25779 "mode": "CBC",
25780 "type": "block"
25781 },
25782 "aes192": {
25783 "cipher": "AES",
25784 "key": 192,
25785 "iv": 16,
25786 "mode": "CBC",
25787 "type": "block"
25788 },
25789 "aes256": {
25790 "cipher": "AES",
25791 "key": 256,
25792 "iv": 16,
25793 "mode": "CBC",
25794 "type": "block"
25795 },
25796 "aes-128-cfb": {
25797 "cipher": "AES",
25798 "key": 128,
25799 "iv": 16,
25800 "mode": "CFB",
25801 "type": "stream"
25802 },
25803 "aes-192-cfb": {
25804 "cipher": "AES",
25805 "key": 192,
25806 "iv": 16,
25807 "mode": "CFB",
25808 "type": "stream"
25809 },
25810 "aes-256-cfb": {
25811 "cipher": "AES",
25812 "key": 256,
25813 "iv": 16,
25814 "mode": "CFB",
25815 "type": "stream"
25816 },
25817 "aes-128-cfb8": {
25818 "cipher": "AES",
25819 "key": 128,
25820 "iv": 16,
25821 "mode": "CFB8",
25822 "type": "stream"
25823 },
25824 "aes-192-cfb8": {
25825 "cipher": "AES",
25826 "key": 192,
25827 "iv": 16,
25828 "mode": "CFB8",
25829 "type": "stream"
25830 },
25831 "aes-256-cfb8": {
25832 "cipher": "AES",
25833 "key": 256,
25834 "iv": 16,
25835 "mode": "CFB8",
25836 "type": "stream"
25837 },
25838 "aes-128-cfb1": {
25839 "cipher": "AES",
25840 "key": 128,
25841 "iv": 16,
25842 "mode": "CFB1",
25843 "type": "stream"
25844 },
25845 "aes-192-cfb1": {
25846 "cipher": "AES",
25847 "key": 192,
25848 "iv": 16,
25849 "mode": "CFB1",
25850 "type": "stream"
25851 },
25852 "aes-256-cfb1": {
25853 "cipher": "AES",
25854 "key": 256,
25855 "iv": 16,
25856 "mode": "CFB1",
25857 "type": "stream"
25858 },
25859 "aes-128-ofb": {
25860 "cipher": "AES",
25861 "key": 128,
25862 "iv": 16,
25863 "mode": "OFB",
25864 "type": "stream"
25865 },
25866 "aes-192-ofb": {
25867 "cipher": "AES",
25868 "key": 192,
25869 "iv": 16,
25870 "mode": "OFB",
25871 "type": "stream"
25872 },
25873 "aes-256-ofb": {
25874 "cipher": "AES",
25875 "key": 256,
25876 "iv": 16,
25877 "mode": "OFB",
25878 "type": "stream"
25879 },
25880 "aes-128-ctr": {
25881 "cipher": "AES",
25882 "key": 128,
25883 "iv": 16,
25884 "mode": "CTR",
25885 "type": "stream"
25886 },
25887 "aes-192-ctr": {
25888 "cipher": "AES",
25889 "key": 192,
25890 "iv": 16,
25891 "mode": "CTR",
25892 "type": "stream"
25893 },
25894 "aes-256-ctr": {
25895 "cipher": "AES",
25896 "key": 256,
25897 "iv": 16,
25898 "mode": "CTR",
25899 "type": "stream"
25900 },
25901 "aes-128-gcm": {
25902 "cipher": "AES",
25903 "key": 128,
25904 "iv": 12,
25905 "mode": "GCM",
25906 "type": "auth"
25907 },
25908 "aes-192-gcm": {
25909 "cipher": "AES",
25910 "key": 192,
25911 "iv": 12,
25912 "mode": "GCM",
25913 "type": "auth"
25914 },
25915 "aes-256-gcm": {
25916 "cipher": "AES",
25917 "key": 256,
25918 "iv": 12,
25919 "mode": "GCM",
25920 "type": "auth"
23686 } 25921 }
23687} 25922}
23688 25923
23689function compile (type) { 25924},{}],171:[function(require,module,exports){
23690 if (NATIVE.String(type)) { 25925arguments[4][33][0].apply(exports,arguments)
23691 if (type[0] === '?') return TYPES.maybe(type.slice(1)) 25926},{"buffer":47,"buffer-xor":176,"dup":33}],172:[function(require,module,exports){
25927var aes = require('./aes')
25928var Buffer = require('safe-buffer').Buffer
25929var Transform = require('cipher-base')
25930var inherits = require('inherits')
25931
25932function StreamCipher (mode, key, iv, decrypt) {
25933 Transform.call(this)
25934
25935 this._cipher = new aes.AES(key)
25936 this._prev = Buffer.from(iv)
25937 this._cache = Buffer.allocUnsafe(0)
25938 this._secCache = Buffer.allocUnsafe(0)
25939 this._decrypt = decrypt
25940 this._mode = mode
25941}
25942
25943inherits(StreamCipher, Transform)
25944
25945StreamCipher.prototype._update = function (chunk) {
25946 return this._mode.encrypt(this, chunk, this._decrypt)
25947}
25948
25949StreamCipher.prototype._final = function () {
25950 this._cipher.scrub()
25951}
25952
25953module.exports = StreamCipher
25954
25955},{"./aes":156,"cipher-base":178,"inherits":189,"safe-buffer":193}],173:[function(require,module,exports){
25956var basex = require('base-x')
25957var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
25958
25959module.exports = basex(ALPHABET)
25960
25961},{"base-x":151}],174:[function(require,module,exports){
25962'use strict'
25963
25964var base58 = require('bs58')
25965var Buffer = require('safe-buffer').Buffer
25966
25967module.exports = function (checksumFn) {
25968 // Encode a buffer as a base58-check encoded string
25969 function encode (payload) {
25970 var checksum = checksumFn(payload)
25971
25972 return base58.encode(Buffer.concat([
25973 payload,
25974 checksum
25975 ], payload.length + 4))
25976 }
25977
25978 function decodeRaw (buffer) {
25979 var payload = buffer.slice(0, -4)
25980 var checksum = buffer.slice(-4)
25981 var newChecksum = checksumFn(payload)
25982
25983 if (checksum[0] ^ newChecksum[0] |
25984 checksum[1] ^ newChecksum[1] |
25985 checksum[2] ^ newChecksum[2] |
25986 checksum[3] ^ newChecksum[3]) return
25987
25988 return payload
25989 }
25990
25991 // Decode a base58-check encoded string to a buffer, no result if checksum is wrong
25992 function decodeUnsafe (string) {
25993 var buffer = base58.decodeUnsafe(string)
25994 if (!buffer) return
25995
25996 return decodeRaw(buffer)
25997 }
23692 25998
23693 return NATIVE[type] || TYPES.quacksLike(type) 25999 function decode (string) {
23694 } else if (type && NATIVE.Object(type)) { 26000 var buffer = base58.decode(string)
23695 if (NATIVE.Array(type)) return TYPES.arrayOf(type[0]) 26001 var payload = decodeRaw(buffer, checksumFn)
26002 if (!payload) throw new Error('Invalid checksum')
26003 return payload
26004 }
23696 26005
23697 return TYPES.object(type) 26006 return {
23698 } else if (NATIVE.Function(type)) { 26007 encode: encode,
23699 return type 26008 decode: decode,
26009 decodeUnsafe: decodeUnsafe
23700 } 26010 }
26011}
26012
26013},{"bs58":173,"safe-buffer":193}],175:[function(require,module,exports){
26014'use strict'
26015
26016var createHash = require('create-hash')
26017var bs58checkBase = require('./base')
23701 26018
23702 return TYPES.value(type) 26019// SHA256(SHA256(buffer))
26020function sha256x2 (buffer) {
26021 var tmp = createHash('sha256').update(buffer).digest()
26022 return createHash('sha256').update(tmp).digest()
23703} 26023}
23704 26024
23705function typeforce (type, value, strict, surrogate) { 26025module.exports = bs58checkBase(sha256x2)
23706 if (NATIVE.Function(type)) { 26026
23707 if (type(value, strict)) return true 26027},{"./base":174,"create-hash":179}],176:[function(require,module,exports){
26028arguments[4][46][0].apply(exports,arguments)
26029},{"buffer":47,"dup":46}],177:[function(require,module,exports){
26030module.exports = function xorInplace (a, b) {
26031 var length = Math.min(a.length, b.length)
23708 26032
23709 throw new TfTypeError(surrogate || type, value) 26033 for (var i = 0; i < length; ++i) {
26034 a[i] = a[i] ^ b[i]
23710 } 26035 }
23711 26036
23712 // JIT 26037 return a.slice(0, length)
23713 return typeforce(compile(type), value, strict) 26038}
26039
26040},{}],178:[function(require,module,exports){
26041var Buffer = require('safe-buffer').Buffer
26042var Transform = require('stream').Transform
26043var StringDecoder = require('string_decoder').StringDecoder
26044var inherits = require('inherits')
26045
26046function CipherBase (hashMode) {
26047 Transform.call(this)
26048 this.hashMode = typeof hashMode === 'string'
26049 if (this.hashMode) {
26050 this[hashMode] = this._finalOrDigest
26051 } else {
26052 this.final = this._finalOrDigest
26053 }
26054 if (this._final) {
26055 this.__final = this._final
26056 this._final = null
26057 }
26058 this._decoder = null
26059 this._encoding = null
23714} 26060}
26061inherits(CipherBase, Transform)
26062
26063CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
26064 if (typeof data === 'string') {
26065 data = Buffer.from(data, inputEnc)
26066 }
26067
26068 var outData = this._update(data)
26069 if (this.hashMode) return this
26070
26071 if (outputEnc) {
26072 outData = this._toString(outData, outputEnc)
26073 }
23715 26074
23716// assign types to typeforce function 26075 return outData
23717for (var typeName in NATIVE) {
23718 typeforce[typeName] = NATIVE[typeName]
23719} 26076}
23720 26077
23721for (typeName in TYPES) { 26078CipherBase.prototype.setAutoPadding = function () {}
23722 typeforce[typeName] = TYPES[typeName] 26079CipherBase.prototype.getAuthTag = function () {
26080 throw new Error('trying to get auth tag in unsupported state')
23723} 26081}
23724 26082
23725var EXTRA = require('./extra') 26083CipherBase.prototype.setAuthTag = function () {
23726for (typeName in EXTRA) { 26084 throw new Error('trying to set auth tag in unsupported state')
23727 typeforce[typeName] = EXTRA[typeName]
23728} 26085}
23729 26086
23730// async wrapper 26087CipherBase.prototype.setAAD = function () {
23731function __async (type, value, strict, callback) { 26088 throw new Error('trying to set aad in unsupported state')
23732 // default to falsy strict if using shorthand overload 26089}
23733 if (typeof strict === 'function') return __async(type, value, false, strict)
23734 26090
26091CipherBase.prototype._transform = function (data, _, next) {
26092 var err
26093 try {
26094 if (this.hashMode) {
26095 this._update(data)
26096 } else {
26097 this.push(this._update(data))
26098 }
26099 } catch (e) {
26100 err = e
26101 } finally {
26102 next(err)
26103 }
26104}
26105CipherBase.prototype._flush = function (done) {
26106 var err
23735 try { 26107 try {
23736 typeforce(type, value, strict) 26108 this.push(this.__final())
23737 } catch (e) { 26109 } catch (e) {
23738 return callback(e) 26110 err = e
26111 }
26112
26113 done(err)
26114}
26115CipherBase.prototype._finalOrDigest = function (outputEnc) {
26116 var outData = this.__final() || Buffer.alloc(0)
26117 if (outputEnc) {
26118 outData = this._toString(outData, outputEnc, true)
26119 }
26120 return outData
26121}
26122
26123CipherBase.prototype._toString = function (value, enc, fin) {
26124 if (!this._decoder) {
26125 this._decoder = new StringDecoder(enc)
26126 this._encoding = enc
26127 }
26128
26129 if (this._encoding !== enc) throw new Error('can\'t switch encodings')
26130
26131 var out = this._decoder.write(value)
26132 if (fin) {
26133 out += this._decoder.end()
23739 } 26134 }
23740 26135
23741 callback() 26136 return out
26137}
26138
26139module.exports = CipherBase
26140
26141},{"inherits":189,"safe-buffer":193,"stream":143,"string_decoder":144}],179:[function(require,module,exports){
26142arguments[4][51][0].apply(exports,arguments)
26143},{"./md5":181,"buffer":47,"cipher-base":178,"dup":51,"inherits":189,"ripemd160":192,"sha.js":196}],180:[function(require,module,exports){
26144arguments[4][52][0].apply(exports,arguments)
26145},{"buffer":47,"dup":52}],181:[function(require,module,exports){
26146arguments[4][53][0].apply(exports,arguments)
26147},{"./make-hash":180,"dup":53}],182:[function(require,module,exports){
26148var assert = require('assert')
26149var BigInteger = require('bigi')
26150
26151var Point = require('./point')
26152
26153function Curve (p, a, b, Gx, Gy, n, h) {
26154 this.p = p
26155 this.a = a
26156 this.b = b
26157 this.G = Point.fromAffine(this, Gx, Gy)
26158 this.n = n
26159 this.h = h
26160
26161 this.infinity = new Point(this, null, null, BigInteger.ZERO)
26162
26163 // result caching
26164 this.pOverFour = p.add(BigInteger.ONE).shiftRight(2)
26165
26166 // determine size of p in bytes
26167 this.pLength = Math.floor((this.p.bitLength() + 7) / 8)
23742} 26168}
23743 26169
23744typeforce.async = __async 26170Curve.prototype.pointFromX = function (isOdd, x) {
23745typeforce.compile = compile 26171 var alpha = x.pow(3).add(this.a.multiply(x)).add(this.b).mod(this.p)
23746typeforce.TfTypeError = TfTypeError 26172 var beta = alpha.modPow(this.pOverFour, this.p) // XXX: not compatible with all curves
23747typeforce.TfPropertyTypeError = TfPropertyTypeError 26173
26174 var y = beta
26175 if (beta.isEven() ^ !isOdd) {
26176 y = this.p.subtract(y) // -y % p
26177 }
26178
26179 return Point.fromAffine(this, x, y)
26180}
23748 26181
23749module.exports = typeforce 26182Curve.prototype.isInfinity = function (Q) {
26183 if (Q === this.infinity) return true
23750 26184
23751},{"./errors":137,"./extra":138,"./native":140}],140:[function(require,module,exports){ 26185 return Q.z.signum() === 0 && Q.y.signum() !== 0
23752var types = {
23753 Array: function (value) { return value !== null && value !== undefined && value.constructor === Array },
23754 Boolean: function (value) { return typeof value === 'boolean' },
23755 Function: function (value) { return typeof value === 'function' },
23756 Nil: function (value) { return value === undefined || value === null },
23757 Number: function (value) { return typeof value === 'number' },
23758 Object: function (value) { return typeof value === 'object' },
23759 String: function (value) { return typeof value === 'string' },
23760 '': function () { return true }
23761} 26186}
23762 26187
23763// TODO: deprecate 26188Curve.prototype.isOnCurve = function (Q) {
23764types.Null = types.Nil 26189 if (this.isInfinity(Q)) return true
26190
26191 var x = Q.affineX
26192 var y = Q.affineY
26193 var a = this.a
26194 var b = this.b
26195 var p = this.p
23765 26196
23766for (var typeName in types) { 26197 // Check that xQ and yQ are integers in the interval [0, p - 1]
23767 types[typeName].toJSON = function (t) { 26198 if (x.signum() < 0 || x.compareTo(p) >= 0) return false
23768 return t 26199 if (y.signum() < 0 || y.compareTo(p) >= 0) return false
23769 }.bind(null, typeName) 26200
26201 // and check that y^2 = x^3 + ax + b (mod p)
26202 var lhs = y.square().mod(p)
26203 var rhs = x.pow(3).add(a.multiply(x)).add(b).mod(p)
26204 return lhs.equals(rhs)
23770} 26205}
23771 26206
23772module.exports = types 26207/**
26208 * Validate an elliptic curve point.
26209 *
26210 * See SEC 1, section 3.2.2.1: Elliptic Curve Public Key Validation Primitive
26211 */
26212Curve.prototype.validate = function (Q) {
26213 // Check Q != O
26214 assert(!this.isInfinity(Q), 'Point is at infinity')
26215 assert(this.isOnCurve(Q), 'Point is not on the curve')
26216
26217 // Check nQ = O (where Q is a scalar multiple of G)
26218 var nQ = Q.multiply(this.n)
26219 assert(this.isInfinity(nQ), 'Point is not a scalar multiple of G')
23773 26220
23774},{}],141:[function(require,module,exports){ 26221 return true
23775(function (Buffer){ 26222}
23776'use strict'
23777 26223
23778// Number.MAX_SAFE_INTEGER 26224module.exports = Curve
23779var MAX_SAFE_INTEGER = 9007199254740991
23780 26225
23781function checkUInt53 (n) { 26226},{"./point":186,"assert":15,"bigi":154}],183:[function(require,module,exports){
23782 if (n < 0 || n > MAX_SAFE_INTEGER || n % 1 !== 0) throw new RangeError('value out of range') 26227module.exports={
26228 "secp128r1": {
26229 "p": "fffffffdffffffffffffffffffffffff",
26230 "a": "fffffffdfffffffffffffffffffffffc",
26231 "b": "e87579c11079f43dd824993c2cee5ed3",
26232 "n": "fffffffe0000000075a30d1b9038a115",
26233 "h": "01",
26234 "Gx": "161ff7528b899b2d0c28607ca52c5b86",
26235 "Gy": "cf5ac8395bafeb13c02da292dded7a83"
26236 },
26237 "secp160k1": {
26238 "p": "fffffffffffffffffffffffffffffffeffffac73",
26239 "a": "00",
26240 "b": "07",
26241 "n": "0100000000000000000001b8fa16dfab9aca16b6b3",
26242 "h": "01",
26243 "Gx": "3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",
26244 "Gy": "938cf935318fdced6bc28286531733c3f03c4fee"
26245 },
26246 "secp160r1": {
26247 "p": "ffffffffffffffffffffffffffffffff7fffffff",
26248 "a": "ffffffffffffffffffffffffffffffff7ffffffc",
26249 "b": "1c97befc54bd7a8b65acf89f81d4d4adc565fa45",
26250 "n": "0100000000000000000001f4c8f927aed3ca752257",
26251 "h": "01",
26252 "Gx": "4a96b5688ef573284664698968c38bb913cbfc82",
26253 "Gy": "23a628553168947d59dcc912042351377ac5fb32"
26254 },
26255 "secp192k1": {
26256 "p": "fffffffffffffffffffffffffffffffffffffffeffffee37",
26257 "a": "00",
26258 "b": "03",
26259 "n": "fffffffffffffffffffffffe26f2fc170f69466a74defd8d",
26260 "h": "01",
26261 "Gx": "db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",
26262 "Gy": "9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"
26263 },
26264 "secp192r1": {
26265 "p": "fffffffffffffffffffffffffffffffeffffffffffffffff",
26266 "a": "fffffffffffffffffffffffffffffffefffffffffffffffc",
26267 "b": "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",
26268 "n": "ffffffffffffffffffffffff99def836146bc9b1b4d22831",
26269 "h": "01",
26270 "Gx": "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",
26271 "Gy": "07192b95ffc8da78631011ed6b24cdd573f977a11e794811"
26272 },
26273 "secp256k1": {
26274 "p": "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",
26275 "a": "00",
26276 "b": "07",
26277 "n": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",
26278 "h": "01",
26279 "Gx": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
26280 "Gy": "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
26281 },
26282 "secp256r1": {
26283 "p": "ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",
26284 "a": "ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",
26285 "b": "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",
26286 "n": "ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",
26287 "h": "01",
26288 "Gx": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",
26289 "Gy": "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"
26290 }
23783} 26291}
23784 26292
23785function encode (number, buffer, offset) { 26293},{}],184:[function(require,module,exports){
23786 checkUInt53(number) 26294var Point = require('./point')
26295var Curve = require('./curve')
23787 26296
23788 if (!buffer) buffer = new Buffer(encodingLength(number)) 26297var getCurveByName = require('./names')
23789 if (!Buffer.isBuffer(buffer)) throw new TypeError('buffer must be a Buffer instance') 26298
23790 if (!offset) offset = 0 26299module.exports = {
26300 Curve: Curve,
26301 Point: Point,
26302 getCurveByName: getCurveByName
26303}
23791 26304
23792 // 8 bit 26305},{"./curve":182,"./names":185,"./point":186}],185:[function(require,module,exports){
23793 if (number < 0xfd) { 26306var BigInteger = require('bigi')
23794 buffer.writeUInt8(number, offset)
23795 encode.bytes = 1
23796 26307
23797 // 16 bit 26308var curves = require('./curves.json')
23798 } else if (number <= 0xffff) { 26309var Curve = require('./curve')
23799 buffer.writeUInt8(0xfd, offset)
23800 buffer.writeUInt16LE(number, offset + 1)
23801 encode.bytes = 3
23802 26310
23803 // 32 bit 26311function getCurveByName (name) {
23804 } else if (number <= 0xffffffff) { 26312 var curve = curves[name]
23805 buffer.writeUInt8(0xfe, offset) 26313 if (!curve) return null
23806 buffer.writeUInt32LE(number, offset + 1)
23807 encode.bytes = 5
23808 26314
23809 // 64 bit 26315 var p = new BigInteger(curve.p, 16)
26316 var a = new BigInteger(curve.a, 16)
26317 var b = new BigInteger(curve.b, 16)
26318 var n = new BigInteger(curve.n, 16)
26319 var h = new BigInteger(curve.h, 16)
26320 var Gx = new BigInteger(curve.Gx, 16)
26321 var Gy = new BigInteger(curve.Gy, 16)
26322
26323 return new Curve(p, a, b, Gx, Gy, n, h)
26324}
26325
26326module.exports = getCurveByName
26327
26328},{"./curve":182,"./curves.json":183,"bigi":154}],186:[function(require,module,exports){
26329var assert = require('assert')
26330var Buffer = require('safe-buffer').Buffer
26331var BigInteger = require('bigi')
26332
26333var THREE = BigInteger.valueOf(3)
26334
26335function Point (curve, x, y, z) {
26336 assert.notStrictEqual(z, undefined, 'Missing Z coordinate')
26337
26338 this.curve = curve
26339 this.x = x
26340 this.y = y
26341 this.z = z
26342 this._zInv = null
26343
26344 this.compressed = true
26345}
26346
26347Object.defineProperty(Point.prototype, 'zInv', {
26348 get: function () {
26349 if (this._zInv === null) {
26350 this._zInv = this.z.modInverse(this.curve.p)
26351 }
26352
26353 return this._zInv
26354 }
26355})
26356
26357Object.defineProperty(Point.prototype, 'affineX', {
26358 get: function () {
26359 return this.x.multiply(this.zInv).mod(this.curve.p)
26360 }
26361})
26362
26363Object.defineProperty(Point.prototype, 'affineY', {
26364 get: function () {
26365 return this.y.multiply(this.zInv).mod(this.curve.p)
26366 }
26367})
26368
26369Point.fromAffine = function (curve, x, y) {
26370 return new Point(curve, x, y, BigInteger.ONE)
26371}
26372
26373Point.prototype.equals = function (other) {
26374 if (other === this) return true
26375 if (this.curve.isInfinity(this)) return this.curve.isInfinity(other)
26376 if (this.curve.isInfinity(other)) return this.curve.isInfinity(this)
26377
26378 // u = Y2 * Z1 - Y1 * Z2
26379 var u = other.y.multiply(this.z).subtract(this.y.multiply(other.z)).mod(this.curve.p)
26380
26381 if (u.signum() !== 0) return false
26382
26383 // v = X2 * Z1 - X1 * Z2
26384 var v = other.x.multiply(this.z).subtract(this.x.multiply(other.z)).mod(this.curve.p)
26385
26386 return v.signum() === 0
26387}
26388
26389Point.prototype.negate = function () {
26390 var y = this.curve.p.subtract(this.y)
26391
26392 return new Point(this.curve, this.x, y, this.z)
26393}
26394
26395Point.prototype.add = function (b) {
26396 if (this.curve.isInfinity(this)) return b
26397 if (this.curve.isInfinity(b)) return this
26398
26399 var x1 = this.x
26400 var y1 = this.y
26401 var x2 = b.x
26402 var y2 = b.y
26403
26404 // u = Y2 * Z1 - Y1 * Z2
26405 var u = y2.multiply(this.z).subtract(y1.multiply(b.z)).mod(this.curve.p)
26406 // v = X2 * Z1 - X1 * Z2
26407 var v = x2.multiply(this.z).subtract(x1.multiply(b.z)).mod(this.curve.p)
26408
26409 if (v.signum() === 0) {
26410 if (u.signum() === 0) {
26411 return this.twice() // this == b, so double
26412 }
26413
26414 return this.curve.infinity // this = -b, so infinity
26415 }
26416
26417 var v2 = v.square()
26418 var v3 = v2.multiply(v)
26419 var x1v2 = x1.multiply(v2)
26420 var zu2 = u.square().multiply(this.z)
26421
26422 // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)
26423 var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.p)
26424 // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3
26425 var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.p)
26426 // z3 = v^3 * z1 * z2
26427 var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.p)
26428
26429 return new Point(this.curve, x3, y3, z3)
26430}
26431
26432Point.prototype.twice = function () {
26433 if (this.curve.isInfinity(this)) return this
26434 if (this.y.signum() === 0) return this.curve.infinity
26435
26436 var x1 = this.x
26437 var y1 = this.y
26438
26439 var y1z1 = y1.multiply(this.z).mod(this.curve.p)
26440 var y1sqz1 = y1z1.multiply(y1).mod(this.curve.p)
26441 var a = this.curve.a
26442
26443 // w = 3 * x1^2 + a * z1^2
26444 var w = x1.square().multiply(THREE)
26445
26446 if (a.signum() !== 0) {
26447 w = w.add(this.z.square().multiply(a))
26448 }
26449
26450 w = w.mod(this.curve.p)
26451 // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)
26452 var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.p)
26453 // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3
26454 var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.pow(3)).mod(this.curve.p)
26455 // z3 = 8 * (y1 * z1)^3
26456 var z3 = y1z1.pow(3).shiftLeft(3).mod(this.curve.p)
26457
26458 return new Point(this.curve, x3, y3, z3)
26459}
26460
26461// Simple NAF (Non-Adjacent Form) multiplication algorithm
26462// TODO: modularize the multiplication algorithm
26463Point.prototype.multiply = function (k) {
26464 if (this.curve.isInfinity(this)) return this
26465 if (k.signum() === 0) return this.curve.infinity
26466
26467 var e = k
26468 var h = e.multiply(THREE)
26469
26470 var neg = this.negate()
26471 var R = this
26472
26473 for (var i = h.bitLength() - 2; i > 0; --i) {
26474 var hBit = h.testBit(i)
26475 var eBit = e.testBit(i)
26476
26477 R = R.twice()
26478
26479 if (hBit !== eBit) {
26480 R = R.add(hBit ? this : neg)
26481 }
26482 }
26483
26484 return R
26485}
26486
26487// Compute this*j + x*k (simultaneous multiplication)
26488Point.prototype.multiplyTwo = function (j, x, k) {
26489 var i = Math.max(j.bitLength(), k.bitLength()) - 1
26490 var R = this.curve.infinity
26491 var both = this.add(x)
26492
26493 while (i >= 0) {
26494 var jBit = j.testBit(i)
26495 var kBit = k.testBit(i)
26496
26497 R = R.twice()
26498
26499 if (jBit) {
26500 if (kBit) {
26501 R = R.add(both)
26502 } else {
26503 R = R.add(this)
26504 }
26505 } else if (kBit) {
26506 R = R.add(x)
26507 }
26508 --i
26509 }
26510
26511 return R
26512}
26513
26514Point.prototype.getEncoded = function (compressed) {
26515 if (compressed == null) compressed = this.compressed
26516 if (this.curve.isInfinity(this)) return Buffer.alloc(1, 0) // Infinity point encoded is simply '00'
26517
26518 var x = this.affineX
26519 var y = this.affineY
26520 var byteLength = this.curve.pLength
26521 var buffer
26522
26523 // 0x02/0x03 | X
26524 if (compressed) {
26525 buffer = Buffer.allocUnsafe(1 + byteLength)
26526 buffer.writeUInt8(y.isEven() ? 0x02 : 0x03, 0)
26527
26528 // 0x04 | X | Y
23810 } else { 26529 } else {
23811 buffer.writeUInt8(0xff, offset) 26530 buffer = Buffer.allocUnsafe(1 + byteLength + byteLength)
23812 buffer.writeUInt32LE(number >>> 0, offset + 1) 26531 buffer.writeUInt8(0x04, 0)
23813 buffer.writeUInt32LE((number / 0x100000000) | 0, offset + 5) 26532
23814 encode.bytes = 9 26533 y.toBuffer(byteLength).copy(buffer, 1 + byteLength)
23815 } 26534 }
23816 26535
26536 x.toBuffer(byteLength).copy(buffer, 1)
26537
23817 return buffer 26538 return buffer
23818} 26539}
23819 26540
23820function decode (buffer, offset) { 26541Point.decodeFrom = function (curve, buffer) {
23821 if (!Buffer.isBuffer(buffer)) throw new TypeError('buffer must be a Buffer instance') 26542 var type = buffer.readUInt8(0)
23822 if (!offset) offset = 0 26543 var compressed = (type !== 4)
26544
26545 var byteLength = Math.floor((curve.p.bitLength() + 7) / 8)
26546 var x = BigInteger.fromBuffer(buffer.slice(1, 1 + byteLength))
26547
26548 var Q
26549 if (compressed) {
26550 assert.equal(buffer.length, byteLength + 1, 'Invalid sequence length')
26551 assert(type === 0x02 || type === 0x03, 'Invalid sequence tag')
23823 26552
23824 var first = buffer.readUInt8(offset) 26553 var isOdd = (type === 0x03)
26554 Q = curve.pointFromX(isOdd, x)
26555 } else {
26556 assert.equal(buffer.length, 1 + byteLength + byteLength, 'Invalid sequence length')
23825 26557
23826 // 8 bit 26558 var y = BigInteger.fromBuffer(buffer.slice(1 + byteLength))
23827 if (first < 0xfd) { 26559 Q = Point.fromAffine(curve, x, y)
23828 decode.bytes = 1 26560 }
23829 return first
23830 26561
23831 // 16 bit 26562 Q.compressed = compressed
23832 } else if (first === 0xfd) { 26563 return Q
23833 decode.bytes = 3 26564}
23834 return buffer.readUInt16LE(offset + 1)
23835 26565
23836 // 32 bit 26566Point.prototype.toString = function () {
23837 } else if (first === 0xfe) { 26567 if (this.curve.isInfinity(this)) return '(INFINITY)'
23838 decode.bytes = 5
23839 return buffer.readUInt32LE(offset + 1)
23840 26568
23841 // 64 bit 26569 return '(' + this.affineX.toString() + ',' + this.affineY.toString() + ')'
23842 } else { 26570}
23843 decode.bytes = 9 26571
23844 var lo = buffer.readUInt32LE(offset + 1) 26572module.exports = Point
23845 var hi = buffer.readUInt32LE(offset + 5) 26573
23846 var number = hi * 0x0100000000 + lo 26574},{"assert":15,"bigi":154,"safe-buffer":193}],187:[function(require,module,exports){
23847 checkUInt53(number) 26575var Buffer = require('safe-buffer').Buffer
26576var MD5 = require('md5.js')
26577
26578/* eslint-disable camelcase */
26579function EVP_BytesToKey (password, salt, keyBits, ivLen) {
26580 if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary')
26581 if (salt) {
26582 if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary')
26583 if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length')
26584 }
26585
26586 var keyLen = keyBits / 8
26587 var key = Buffer.alloc(keyLen)
26588 var iv = Buffer.alloc(ivLen || 0)
26589 var tmp = Buffer.alloc(0)
26590
26591 while (keyLen > 0 || ivLen > 0) {
26592 var hash = new MD5()
26593 hash.update(tmp)
26594 hash.update(password)
26595 if (salt) hash.update(salt)
26596 tmp = hash.digest()
23848 26597
23849 return number 26598 var used = 0
26599
26600 if (keyLen > 0) {
26601 var keyStart = key.length - keyLen
26602 used = Math.min(keyLen, tmp.length)
26603 tmp.copy(key, keyStart, 0, used)
26604 keyLen -= used
26605 }
26606
26607 if (used < tmp.length && ivLen > 0) {
26608 var ivStart = iv.length - ivLen
26609 var length = Math.min(ivLen, tmp.length - used)
26610 tmp.copy(iv, ivStart, used, used + length)
26611 ivLen -= length
26612 }
23850 } 26613 }
26614
26615 tmp.fill(0)
26616 return { key: key, iv: iv }
23851} 26617}
23852 26618
23853function encodingLength (number) { 26619module.exports = EVP_BytesToKey
23854 checkUInt53(number)
23855 26620
23856 return ( 26621},{"md5.js":190,"safe-buffer":193}],188:[function(require,module,exports){
23857 number < 0xfd ? 1 26622arguments[4][85][0].apply(exports,arguments)
23858 : number <= 0xffff ? 3 26623},{"buffer":47,"dup":85,"inherits":189,"stream":143}],189:[function(require,module,exports){
23859 : number <= 0xffffffff ? 5 26624arguments[4][95][0].apply(exports,arguments)
23860 : 9 26625},{"dup":95}],190:[function(require,module,exports){
23861 ) 26626(function (Buffer){
26627'use strict'
26628var inherits = require('inherits')
26629var HashBase = require('hash-base')
26630
26631var ARRAY16 = new Array(16)
26632
26633function MD5 () {
26634 HashBase.call(this, 64)
26635
26636 // state
26637 this._a = 0x67452301
26638 this._b = 0xefcdab89
26639 this._c = 0x98badcfe
26640 this._d = 0x10325476
26641}
26642
26643inherits(MD5, HashBase)
26644
26645MD5.prototype._update = function () {
26646 var M = ARRAY16
26647 for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)
26648
26649 var a = this._a
26650 var b = this._b
26651 var c = this._c
26652 var d = this._d
26653
26654 a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)
26655 d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)
26656 c = fnF(c, d, a, b, M[2], 0x242070db, 17)
26657 b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)
26658 a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)
26659 d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)
26660 c = fnF(c, d, a, b, M[6], 0xa8304613, 17)
26661 b = fnF(b, c, d, a, M[7], 0xfd469501, 22)
26662 a = fnF(a, b, c, d, M[8], 0x698098d8, 7)
26663 d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)
26664 c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)
26665 b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)
26666 a = fnF(a, b, c, d, M[12], 0x6b901122, 7)
26667 d = fnF(d, a, b, c, M[13], 0xfd987193, 12)
26668 c = fnF(c, d, a, b, M[14], 0xa679438e, 17)
26669 b = fnF(b, c, d, a, M[15], 0x49b40821, 22)
26670
26671 a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)
26672 d = fnG(d, a, b, c, M[6], 0xc040b340, 9)
26673 c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)
26674 b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)
26675 a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)
26676 d = fnG(d, a, b, c, M[10], 0x02441453, 9)
26677 c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)
26678 b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)
26679 a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)
26680 d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)
26681 c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)
26682 b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)
26683 a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)
26684 d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)
26685 c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)
26686 b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)
26687
26688 a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)
26689 d = fnH(d, a, b, c, M[8], 0x8771f681, 11)
26690 c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)
26691 b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)
26692 a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)
26693 d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)
26694 c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)
26695 b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)
26696 a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)
26697 d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)
26698 c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)
26699 b = fnH(b, c, d, a, M[6], 0x04881d05, 23)
26700 a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)
26701 d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)
26702 c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)
26703 b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)
26704
26705 a = fnI(a, b, c, d, M[0], 0xf4292244, 6)
26706 d = fnI(d, a, b, c, M[7], 0x432aff97, 10)
26707 c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)
26708 b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)
26709 a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)
26710 d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)
26711 c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)
26712 b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)
26713 a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)
26714 d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)
26715 c = fnI(c, d, a, b, M[6], 0xa3014314, 15)
26716 b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)
26717 a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)
26718 d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)
26719 c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)
26720 b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)
26721
26722 this._a = (this._a + a) | 0
26723 this._b = (this._b + b) | 0
26724 this._c = (this._c + c) | 0
26725 this._d = (this._d + d) | 0
26726}
26727
26728MD5.prototype._digest = function () {
26729 // create padding and handle blocks
26730 this._block[this._blockOffset++] = 0x80
26731 if (this._blockOffset > 56) {
26732 this._block.fill(0, this._blockOffset, 64)
26733 this._update()
26734 this._blockOffset = 0
26735 }
26736
26737 this._block.fill(0, this._blockOffset, 56)
26738 this._block.writeUInt32LE(this._length[0], 56)
26739 this._block.writeUInt32LE(this._length[1], 60)
26740 this._update()
26741
26742 // produce result
26743 var buffer = new Buffer(16)
26744 buffer.writeInt32LE(this._a, 0)
26745 buffer.writeInt32LE(this._b, 4)
26746 buffer.writeInt32LE(this._c, 8)
26747 buffer.writeInt32LE(this._d, 12)
26748 return buffer
26749}
26750
26751function rotl (x, n) {
26752 return (x << n) | (x >>> (32 - n))
26753}
26754
26755function fnF (a, b, c, d, m, k, s) {
26756 return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0
26757}
26758
26759function fnG (a, b, c, d, m, k, s) {
26760 return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0
26761}
26762
26763function fnH (a, b, c, d, m, k, s) {
26764 return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0
23862} 26765}
23863 26766
23864module.exports = { encode: encode, decode: decode, encodingLength: encodingLength } 26767function fnI (a, b, c, d, m, k, s) {
26768 return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0
26769}
26770
26771module.exports = MD5
23865 26772
23866}).call(this,require("buffer").Buffer) 26773}).call(this,require("buffer").Buffer)
23867},{"buffer":5}],142:[function(require,module,exports){ 26774},{"buffer":47,"hash-base":191,"inherits":189}],191:[function(require,module,exports){
26775'use strict'
26776var Buffer = require('safe-buffer').Buffer
26777var Transform = require('stream').Transform
26778var inherits = require('inherits')
26779
26780function throwIfNotStringOrBuffer (val, prefix) {
26781 if (!Buffer.isBuffer(val) && typeof val !== 'string') {
26782 throw new TypeError(prefix + ' must be a string or a buffer')
26783 }
26784}
26785
26786function HashBase (blockSize) {
26787 Transform.call(this)
26788
26789 this._block = Buffer.allocUnsafe(blockSize)
26790 this._blockSize = blockSize
26791 this._blockOffset = 0
26792 this._length = [0, 0, 0, 0]
26793
26794 this._finalized = false
26795}
26796
26797inherits(HashBase, Transform)
26798
26799HashBase.prototype._transform = function (chunk, encoding, callback) {
26800 var error = null
26801 try {
26802 this.update(chunk, encoding)
26803 } catch (err) {
26804 error = err
26805 }
26806
26807 callback(error)
26808}
26809
26810HashBase.prototype._flush = function (callback) {
26811 var error = null
26812 try {
26813 this.push(this.digest())
26814 } catch (err) {
26815 error = err
26816 }
26817
26818 callback(error)
26819}
26820
26821HashBase.prototype.update = function (data, encoding) {
26822 throwIfNotStringOrBuffer(data, 'Data')
26823 if (this._finalized) throw new Error('Digest already called')
26824 if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)
26825
26826 // consume data
26827 var block = this._block
26828 var offset = 0
26829 while (this._blockOffset + data.length - offset >= this._blockSize) {
26830 for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]
26831 this._update()
26832 this._blockOffset = 0
26833 }
26834 while (offset < data.length) block[this._blockOffset++] = data[offset++]
26835
26836 // update length
26837 for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
26838 this._length[j] += carry
26839 carry = (this._length[j] / 0x0100000000) | 0
26840 if (carry > 0) this._length[j] -= 0x0100000000 * carry
26841 }
26842
26843 return this
26844}
26845
26846HashBase.prototype._update = function () {
26847 throw new Error('_update is not implemented')
26848}
26849
26850HashBase.prototype.digest = function (encoding) {
26851 if (this._finalized) throw new Error('Digest already called')
26852 this._finalized = true
26853
26854 var digest = this._digest()
26855 if (encoding !== undefined) digest = digest.toString(encoding)
26856
26857 // reset state
26858 this._block.fill(0)
26859 this._blockOffset = 0
26860 for (var i = 0; i < 4; ++i) this._length[i] = 0
26861
26862 return digest
26863}
26864
26865HashBase.prototype._digest = function () {
26866 throw new Error('_digest is not implemented')
26867}
26868
26869module.exports = HashBase
26870
26871},{"inherits":189,"safe-buffer":193,"stream":143}],192:[function(require,module,exports){
26872arguments[4][133][0].apply(exports,arguments)
26873},{"buffer":47,"dup":133,"hash-base":188,"inherits":189}],193:[function(require,module,exports){
26874/* eslint-disable node/no-deprecated-api */
26875var buffer = require('buffer')
26876var Buffer = buffer.Buffer
26877
26878// alternative to using Object.keys for old browsers
26879function copyProps (src, dst) {
26880 for (var key in src) {
26881 dst[key] = src[key]
26882 }
26883}
26884if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
26885 module.exports = buffer
26886} else {
26887 // Copy properties from require('buffer')
26888 copyProps(buffer, exports)
26889 exports.Buffer = SafeBuffer
26890}
26891
26892function SafeBuffer (arg, encodingOrOffset, length) {
26893 return Buffer(arg, encodingOrOffset, length)
26894}
26895
26896// Copy static methods from Buffer
26897copyProps(Buffer, SafeBuffer)
26898
26899SafeBuffer.from = function (arg, encodingOrOffset, length) {
26900 if (typeof arg === 'number') {
26901 throw new TypeError('Argument must not be a number')
26902 }
26903 return Buffer(arg, encodingOrOffset, length)
26904}
26905
26906SafeBuffer.alloc = function (size, fill, encoding) {
26907 if (typeof size !== 'number') {
26908 throw new TypeError('Argument must be a number')
26909 }
26910 var buf = Buffer(size)
26911 if (fill !== undefined) {
26912 if (typeof encoding === 'string') {
26913 buf.fill(fill, encoding)
26914 } else {
26915 buf.fill(fill)
26916 }
26917 } else {
26918 buf.fill(0)
26919 }
26920 return buf
26921}
26922
26923SafeBuffer.allocUnsafe = function (size) {
26924 if (typeof size !== 'number') {
26925 throw new TypeError('Argument must be a number')
26926 }
26927 return Buffer(size)
26928}
26929
26930SafeBuffer.allocUnsafeSlow = function (size) {
26931 if (typeof size !== 'number') {
26932 throw new TypeError('Argument must be a number')
26933 }
26934 return buffer.SlowBuffer(size)
26935}
26936
26937},{"buffer":47}],194:[function(require,module,exports){
23868(function (Buffer){ 26938(function (Buffer){
23869var bs58check = require('bs58check') 26939var crypto = require('crypto')
26940/* eslint-disable camelcase */
23870 26941
23871function decodeRaw (buffer, version) { 26942var MAX_VALUE = 0x7fffffff
23872 // check version only if defined
23873 if (version !== undefined && buffer[0] !== version) throw new Error('Invalid network version')
23874 26943
23875 // uncompressed 26944// N = Cpu cost, r = Memory cost, p = parallelization cost
23876 if (buffer.length === 33) { 26945function scrypt (key, salt, N, r, p, dkLen, progressCallback) {
23877 return { 26946 if (N === 0 || (N & (N - 1)) !== 0) throw Error('N must be > 0 and a power of 2')
23878 version: buffer[0], 26947
23879 privateKey: buffer.slice(1, 33), 26948 if (N > MAX_VALUE / 128 / r) throw Error('Parameter N is too large')
23880 compressed: false 26949 if (r > MAX_VALUE / 128 / p) throw Error('Parameter r is too large')
26950
26951 var XY = new Buffer(256 * r)
26952 var V = new Buffer(128 * r * N)
26953
26954 // pseudo global
26955 var B32 = new Int32Array(16) // salsa20_8
26956 var x = new Int32Array(16) // salsa20_8
26957 var _X = new Buffer(64) // blockmix_salsa8
26958
26959 // pseudo global
26960 var B = crypto.pbkdf2Sync(key, salt, 1, p * 128 * r, 'sha256')
26961
26962 var tickCallback
26963 if (progressCallback) {
26964 var totalOps = p * N * 2
26965 var currentOp = 0
26966
26967 tickCallback = function () {
26968 ++currentOp
26969
26970 // send progress notifications once every 1,000 ops
26971 if (currentOp % 1000 === 0) {
26972 progressCallback({
26973 current: currentOp,
26974 total: totalOps,
26975 percent: (currentOp / totalOps) * 100.0
26976 })
26977 }
26978 }
26979 }
26980
26981 for (var i = 0; i < p; i++) {
26982 smix(B, i * 128 * r, r, N, V, XY)
26983 }
26984
26985 return crypto.pbkdf2Sync(key, B, 1, dkLen, 'sha256')
26986
26987 // all of these functions are actually moved to the top
26988 // due to function hoisting
26989
26990 function smix (B, Bi, r, N, V, XY) {
26991 var Xi = 0
26992 var Yi = 128 * r
26993 var i
26994
26995 B.copy(XY, Xi, Bi, Bi + Yi)
26996
26997 for (i = 0; i < N; i++) {
26998 XY.copy(V, i * Yi, Xi, Xi + Yi)
26999 blockmix_salsa8(XY, Xi, Yi, r)
27000
27001 if (tickCallback) tickCallback()
27002 }
27003
27004 for (i = 0; i < N; i++) {
27005 var offset = Xi + (2 * r - 1) * 64
27006 var j = XY.readUInt32LE(offset) & (N - 1)
27007 blockxor(V, j * Yi, XY, Xi, Yi)
27008 blockmix_salsa8(XY, Xi, Yi, r)
27009
27010 if (tickCallback) tickCallback()
23881 } 27011 }
27012
27013 XY.copy(B, Bi, Xi, Xi + Yi)
23882 } 27014 }
23883 27015
23884 // invalid length 27016 function blockmix_salsa8 (BY, Bi, Yi, r) {
23885 if (buffer.length !== 34) throw new Error('Invalid WIF length') 27017 var i
23886 27018
23887 // invalid compression flag 27019 arraycopy(BY, Bi + (2 * r - 1) * 64, _X, 0, 64)
23888 if (buffer[33] !== 0x01) throw new Error('Invalid compression flag')
23889 27020
23890 return { 27021 for (i = 0; i < 2 * r; i++) {
23891 version: buffer[0], 27022 blockxor(BY, i * 64, _X, 0, 64)
23892 privateKey: buffer.slice(1, 33), 27023 salsa20_8(_X)
23893 compressed: true 27024 arraycopy(_X, 0, BY, Yi + (i * 64), 64)
27025 }
27026
27027 for (i = 0; i < r; i++) {
27028 arraycopy(BY, Yi + (i * 2) * 64, BY, Bi + (i * 64), 64)
27029 }
27030
27031 for (i = 0; i < r; i++) {
27032 arraycopy(BY, Yi + (i * 2 + 1) * 64, BY, Bi + (i + r) * 64, 64)
27033 }
27034 }
27035
27036 function R (a, b) {
27037 return (a << b) | (a >>> (32 - b))
27038 }
27039
27040 function salsa20_8 (B) {
27041 var i
27042
27043 for (i = 0; i < 16; i++) {
27044 B32[i] = (B[i * 4 + 0] & 0xff) << 0
27045 B32[i] |= (B[i * 4 + 1] & 0xff) << 8
27046 B32[i] |= (B[i * 4 + 2] & 0xff) << 16
27047 B32[i] |= (B[i * 4 + 3] & 0xff) << 24
27048 // B32[i] = B.readUInt32LE(i*4) <--- this is signficantly slower even in Node.js
27049 }
27050
27051 arraycopy(B32, 0, x, 0, 16)
27052
27053 for (i = 8; i > 0; i -= 2) {
27054 x[4] ^= R(x[0] + x[12], 7)
27055 x[8] ^= R(x[4] + x[0], 9)
27056 x[12] ^= R(x[8] + x[4], 13)
27057 x[0] ^= R(x[12] + x[8], 18)
27058 x[9] ^= R(x[5] + x[1], 7)
27059 x[13] ^= R(x[9] + x[5], 9)
27060 x[1] ^= R(x[13] + x[9], 13)
27061 x[5] ^= R(x[1] + x[13], 18)
27062 x[14] ^= R(x[10] + x[6], 7)
27063 x[2] ^= R(x[14] + x[10], 9)
27064 x[6] ^= R(x[2] + x[14], 13)
27065 x[10] ^= R(x[6] + x[2], 18)
27066 x[3] ^= R(x[15] + x[11], 7)
27067 x[7] ^= R(x[3] + x[15], 9)
27068 x[11] ^= R(x[7] + x[3], 13)
27069 x[15] ^= R(x[11] + x[7], 18)
27070 x[1] ^= R(x[0] + x[3], 7)
27071 x[2] ^= R(x[1] + x[0], 9)
27072 x[3] ^= R(x[2] + x[1], 13)
27073 x[0] ^= R(x[3] + x[2], 18)
27074 x[6] ^= R(x[5] + x[4], 7)
27075 x[7] ^= R(x[6] + x[5], 9)
27076 x[4] ^= R(x[7] + x[6], 13)
27077 x[5] ^= R(x[4] + x[7], 18)
27078 x[11] ^= R(x[10] + x[9], 7)
27079 x[8] ^= R(x[11] + x[10], 9)
27080 x[9] ^= R(x[8] + x[11], 13)
27081 x[10] ^= R(x[9] + x[8], 18)
27082 x[12] ^= R(x[15] + x[14], 7)
27083 x[13] ^= R(x[12] + x[15], 9)
27084 x[14] ^= R(x[13] + x[12], 13)
27085 x[15] ^= R(x[14] + x[13], 18)
27086 }
27087
27088 for (i = 0; i < 16; ++i) B32[i] = x[i] + B32[i]
27089
27090 for (i = 0; i < 16; i++) {
27091 var bi = i * 4
27092 B[bi + 0] = (B32[i] >> 0 & 0xff)
27093 B[bi + 1] = (B32[i] >> 8 & 0xff)
27094 B[bi + 2] = (B32[i] >> 16 & 0xff)
27095 B[bi + 3] = (B32[i] >> 24 & 0xff)
27096 // B.writeInt32LE(B32[i], i*4) //<--- this is signficantly slower even in Node.js
27097 }
27098 }
27099
27100 // naive approach... going back to loop unrolling may yield additional performance
27101 function blockxor (S, Si, D, Di, len) {
27102 for (var i = 0; i < len; i++) {
27103 D[Di + i] ^= S[Si + i]
27104 }
23894 } 27105 }
23895} 27106}
23896 27107
23897function encodeRaw (version, privateKey, compressed) { 27108function arraycopy (src, srcPos, dest, destPos, length) {
23898 var result = new Buffer(compressed ? 34 : 33) 27109 if (Buffer.isBuffer(src) && Buffer.isBuffer(dest)) {
27110 src.copy(dest, destPos, srcPos, srcPos + length)
27111 } else {
27112 while (length--) {
27113 dest[destPos++] = src[srcPos++]
27114 }
27115 }
27116}
23899 27117
23900 result.writeUInt8(version, 0) 27118module.exports = scrypt
23901 privateKey.copy(result, 1)
23902 27119
23903 if (compressed) { 27120}).call(this,require("buffer").Buffer)
23904 result[33] = 0x01 27121},{"buffer":47,"crypto":56}],195:[function(require,module,exports){
27122var Buffer = require('safe-buffer').Buffer
27123
27124// prototype class for hash functions
27125function Hash (blockSize, finalSize) {
27126 this._block = Buffer.alloc(blockSize)
27127 this._finalSize = finalSize
27128 this._blockSize = blockSize
27129 this._len = 0
27130}
27131
27132Hash.prototype.update = function (data, enc) {
27133 if (typeof data === 'string') {
27134 enc = enc || 'utf8'
27135 data = Buffer.from(data, enc)
23905 } 27136 }
23906 27137
23907 return result 27138 var block = this._block
27139 var blockSize = this._blockSize
27140 var length = data.length
27141 var accum = this._len
27142
27143 for (var offset = 0; offset < length;) {
27144 var assigned = accum % blockSize
27145 var remainder = Math.min(length - offset, blockSize - assigned)
27146
27147 for (var i = 0; i < remainder; i++) {
27148 block[assigned + i] = data[offset + i]
27149 }
27150
27151 accum += remainder
27152 offset += remainder
27153
27154 if ((accum % blockSize) === 0) {
27155 this._update(block)
27156 }
27157 }
27158
27159 this._len += length
27160 return this
27161}
27162
27163Hash.prototype.digest = function (enc) {
27164 var rem = this._len % this._blockSize
27165
27166 this._block[rem] = 0x80
27167
27168 // zero (rem + 1) trailing bits, where (rem + 1) is the smallest
27169 // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize
27170 this._block.fill(0, rem + 1)
27171
27172 if (rem >= this._finalSize) {
27173 this._update(this._block)
27174 this._block.fill(0)
27175 }
27176
27177 var bits = this._len * 8
27178
27179 // uint32
27180 if (bits <= 0xffffffff) {
27181 this._block.writeUInt32BE(bits, this._blockSize - 4)
27182
27183 // uint64
27184 } else {
27185 var lowBits = (bits & 0xffffffff) >>> 0
27186 var highBits = (bits - lowBits) / 0x100000000
27187
27188 this._block.writeUInt32BE(highBits, this._blockSize - 8)
27189 this._block.writeUInt32BE(lowBits, this._blockSize - 4)
27190 }
27191
27192 this._update(this._block)
27193 var hash = this._hash()
27194
27195 return enc ? hash.toString(enc) : hash
23908} 27196}
23909 27197
23910function decode (string, version) { 27198Hash.prototype._update = function () {
23911 return decodeRaw(bs58check.decode(string), version) 27199 throw new Error('_update must be implemented by subclass')
23912} 27200}
23913 27201
23914function encode (version, privateKey, compressed) { 27202module.exports = Hash
23915 if (typeof version === 'number') return bs58check.encode(encodeRaw(version, privateKey, compressed))
23916 27203
23917 return bs58check.encode( 27204},{"safe-buffer":193}],196:[function(require,module,exports){
23918 encodeRaw( 27205arguments[4][136][0].apply(exports,arguments)
23919 version.version, 27206},{"./sha":197,"./sha1":198,"./sha224":199,"./sha256":200,"./sha384":201,"./sha512":202,"dup":136}],197:[function(require,module,exports){
23920 version.privateKey, 27207/*
23921 version.compressed 27208 * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
23922 ) 27209 * in FIPS PUB 180-1
23923 ) 27210 * This source code is derived from sha1.js of the same repository.
27211 * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
27212 * operation was added.
27213 */
27214
27215var inherits = require('inherits')
27216var Hash = require('./hash')
27217var Buffer = require('safe-buffer').Buffer
27218
27219var K = [
27220 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
27221]
27222
27223var W = new Array(80)
27224
27225function Sha () {
27226 this.init()
27227 this._w = W
27228
27229 Hash.call(this, 64, 56)
23924} 27230}
23925 27231
23926module.exports = { 27232inherits(Sha, Hash)
23927 decode: decode, 27233
23928 decodeRaw: decodeRaw, 27234Sha.prototype.init = function () {
23929 encode: encode, 27235 this._a = 0x67452301
23930 encodeRaw: encodeRaw 27236 this._b = 0xefcdab89
27237 this._c = 0x98badcfe
27238 this._d = 0x10325476
27239 this._e = 0xc3d2e1f0
27240
27241 return this
23931} 27242}
23932 27243
23933}).call(this,require("buffer").Buffer) 27244function rotl5 (num) {
23934},{"bs58check":85,"buffer":5}]},{},[34])(34) 27245 return (num << 5) | (num >>> 27)
27246}
27247
27248function rotl30 (num) {
27249 return (num << 30) | (num >>> 2)
27250}
27251
27252function ft (s, b, c, d) {
27253 if (s === 0) return (b & c) | ((~b) & d)
27254 if (s === 2) return (b & c) | (b & d) | (c & d)
27255 return b ^ c ^ d
27256}
27257
27258Sha.prototype._update = function (M) {
27259 var W = this._w
27260
27261 var a = this._a | 0
27262 var b = this._b | 0
27263 var c = this._c | 0
27264 var d = this._d | 0
27265 var e = this._e | 0
27266
27267 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
27268 for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]
27269
27270 for (var j = 0; j < 80; ++j) {
27271 var s = ~~(j / 20)
27272 var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
27273
27274 e = d
27275 d = c
27276 c = rotl30(b)
27277 b = a
27278 a = t
27279 }
27280
27281 this._a = (a + this._a) | 0
27282 this._b = (b + this._b) | 0
27283 this._c = (c + this._c) | 0
27284 this._d = (d + this._d) | 0
27285 this._e = (e + this._e) | 0
27286}
27287
27288Sha.prototype._hash = function () {
27289 var H = Buffer.allocUnsafe(20)
27290
27291 H.writeInt32BE(this._a | 0, 0)
27292 H.writeInt32BE(this._b | 0, 4)
27293 H.writeInt32BE(this._c | 0, 8)
27294 H.writeInt32BE(this._d | 0, 12)
27295 H.writeInt32BE(this._e | 0, 16)
27296
27297 return H
27298}
27299
27300module.exports = Sha
27301
27302},{"./hash":195,"inherits":189,"safe-buffer":193}],198:[function(require,module,exports){
27303/*
27304 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
27305 * in FIPS PUB 180-1
27306 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
27307 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
27308 * Distributed under the BSD License
27309 * See http://pajhome.org.uk/crypt/md5 for details.
27310 */
27311
27312var inherits = require('inherits')
27313var Hash = require('./hash')
27314var Buffer = require('safe-buffer').Buffer
27315
27316var K = [
27317 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
27318]
27319
27320var W = new Array(80)
27321
27322function Sha1 () {
27323 this.init()
27324 this._w = W
27325
27326 Hash.call(this, 64, 56)
27327}
27328
27329inherits(Sha1, Hash)
27330
27331Sha1.prototype.init = function () {
27332 this._a = 0x67452301
27333 this._b = 0xefcdab89
27334 this._c = 0x98badcfe
27335 this._d = 0x10325476
27336 this._e = 0xc3d2e1f0
27337
27338 return this
27339}
27340
27341function rotl1 (num) {
27342 return (num << 1) | (num >>> 31)
27343}
27344
27345function rotl5 (num) {
27346 return (num << 5) | (num >>> 27)
27347}
27348
27349function rotl30 (num) {
27350 return (num << 30) | (num >>> 2)
27351}
27352
27353function ft (s, b, c, d) {
27354 if (s === 0) return (b & c) | ((~b) & d)
27355 if (s === 2) return (b & c) | (b & d) | (c & d)
27356 return b ^ c ^ d
27357}
27358
27359Sha1.prototype._update = function (M) {
27360 var W = this._w
27361
27362 var a = this._a | 0
27363 var b = this._b | 0
27364 var c = this._c | 0
27365 var d = this._d | 0
27366 var e = this._e | 0
27367
27368 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
27369 for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
27370
27371 for (var j = 0; j < 80; ++j) {
27372 var s = ~~(j / 20)
27373 var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
27374
27375 e = d
27376 d = c
27377 c = rotl30(b)
27378 b = a
27379 a = t
27380 }
27381
27382 this._a = (a + this._a) | 0
27383 this._b = (b + this._b) | 0
27384 this._c = (c + this._c) | 0
27385 this._d = (d + this._d) | 0
27386 this._e = (e + this._e) | 0
27387}
27388
27389Sha1.prototype._hash = function () {
27390 var H = Buffer.allocUnsafe(20)
27391
27392 H.writeInt32BE(this._a | 0, 0)
27393 H.writeInt32BE(this._b | 0, 4)
27394 H.writeInt32BE(this._c | 0, 8)
27395 H.writeInt32BE(this._d | 0, 12)
27396 H.writeInt32BE(this._e | 0, 16)
27397
27398 return H
27399}
27400
27401module.exports = Sha1
27402
27403},{"./hash":195,"inherits":189,"safe-buffer":193}],199:[function(require,module,exports){
27404/**
27405 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
27406 * in FIPS 180-2
27407 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
27408 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
27409 *
27410 */
27411
27412var inherits = require('inherits')
27413var Sha256 = require('./sha256')
27414var Hash = require('./hash')
27415var Buffer = require('safe-buffer').Buffer
27416
27417var W = new Array(64)
27418
27419function Sha224 () {
27420 this.init()
27421
27422 this._w = W // new Array(64)
27423
27424 Hash.call(this, 64, 56)
27425}
27426
27427inherits(Sha224, Sha256)
27428
27429Sha224.prototype.init = function () {
27430 this._a = 0xc1059ed8
27431 this._b = 0x367cd507
27432 this._c = 0x3070dd17
27433 this._d = 0xf70e5939
27434 this._e = 0xffc00b31
27435 this._f = 0x68581511
27436 this._g = 0x64f98fa7
27437 this._h = 0xbefa4fa4
27438
27439 return this
27440}
27441
27442Sha224.prototype._hash = function () {
27443 var H = Buffer.allocUnsafe(28)
27444
27445 H.writeInt32BE(this._a, 0)
27446 H.writeInt32BE(this._b, 4)
27447 H.writeInt32BE(this._c, 8)
27448 H.writeInt32BE(this._d, 12)
27449 H.writeInt32BE(this._e, 16)
27450 H.writeInt32BE(this._f, 20)
27451 H.writeInt32BE(this._g, 24)
27452
27453 return H
27454}
27455
27456module.exports = Sha224
27457
27458},{"./hash":195,"./sha256":200,"inherits":189,"safe-buffer":193}],200:[function(require,module,exports){
27459/**
27460 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
27461 * in FIPS 180-2
27462 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
27463 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
27464 *
27465 */
27466
27467var inherits = require('inherits')
27468var Hash = require('./hash')
27469var Buffer = require('safe-buffer').Buffer
27470
27471var K = [
27472 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
27473 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
27474 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
27475 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
27476 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
27477 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
27478 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
27479 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
27480 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
27481 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
27482 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
27483 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
27484 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
27485 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
27486 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
27487 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
27488]
27489
27490var W = new Array(64)
27491
27492function Sha256 () {
27493 this.init()
27494
27495 this._w = W // new Array(64)
27496
27497 Hash.call(this, 64, 56)
27498}
27499
27500inherits(Sha256, Hash)
27501
27502Sha256.prototype.init = function () {
27503 this._a = 0x6a09e667
27504 this._b = 0xbb67ae85
27505 this._c = 0x3c6ef372
27506 this._d = 0xa54ff53a
27507 this._e = 0x510e527f
27508 this._f = 0x9b05688c
27509 this._g = 0x1f83d9ab
27510 this._h = 0x5be0cd19
27511
27512 return this
27513}
27514
27515function ch (x, y, z) {
27516 return z ^ (x & (y ^ z))
27517}
27518
27519function maj (x, y, z) {
27520 return (x & y) | (z & (x | y))
27521}
27522
27523function sigma0 (x) {
27524 return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
27525}
27526
27527function sigma1 (x) {
27528 return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
27529}
27530
27531function gamma0 (x) {
27532 return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
27533}
27534
27535function gamma1 (x) {
27536 return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
27537}
27538
27539Sha256.prototype._update = function (M) {
27540 var W = this._w
27541
27542 var a = this._a | 0
27543 var b = this._b | 0
27544 var c = this._c | 0
27545 var d = this._d | 0
27546 var e = this._e | 0
27547 var f = this._f | 0
27548 var g = this._g | 0
27549 var h = this._h | 0
27550
27551 for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
27552 for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
27553
27554 for (var j = 0; j < 64; ++j) {
27555 var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
27556 var T2 = (sigma0(a) + maj(a, b, c)) | 0
27557
27558 h = g
27559 g = f
27560 f = e
27561 e = (d + T1) | 0
27562 d = c
27563 c = b
27564 b = a
27565 a = (T1 + T2) | 0
27566 }
27567
27568 this._a = (a + this._a) | 0
27569 this._b = (b + this._b) | 0
27570 this._c = (c + this._c) | 0
27571 this._d = (d + this._d) | 0
27572 this._e = (e + this._e) | 0
27573 this._f = (f + this._f) | 0
27574 this._g = (g + this._g) | 0
27575 this._h = (h + this._h) | 0
27576}
27577
27578Sha256.prototype._hash = function () {
27579 var H = Buffer.allocUnsafe(32)
27580
27581 H.writeInt32BE(this._a, 0)
27582 H.writeInt32BE(this._b, 4)
27583 H.writeInt32BE(this._c, 8)
27584 H.writeInt32BE(this._d, 12)
27585 H.writeInt32BE(this._e, 16)
27586 H.writeInt32BE(this._f, 20)
27587 H.writeInt32BE(this._g, 24)
27588 H.writeInt32BE(this._h, 28)
27589
27590 return H
27591}
27592
27593module.exports = Sha256
27594
27595},{"./hash":195,"inherits":189,"safe-buffer":193}],201:[function(require,module,exports){
27596var inherits = require('inherits')
27597var SHA512 = require('./sha512')
27598var Hash = require('./hash')
27599var Buffer = require('safe-buffer').Buffer
27600
27601var W = new Array(160)
27602
27603function Sha384 () {
27604 this.init()
27605 this._w = W
27606
27607 Hash.call(this, 128, 112)
27608}
27609
27610inherits(Sha384, SHA512)
27611
27612Sha384.prototype.init = function () {
27613 this._ah = 0xcbbb9d5d
27614 this._bh = 0x629a292a
27615 this._ch = 0x9159015a
27616 this._dh = 0x152fecd8
27617 this._eh = 0x67332667
27618 this._fh = 0x8eb44a87
27619 this._gh = 0xdb0c2e0d
27620 this._hh = 0x47b5481d
27621
27622 this._al = 0xc1059ed8
27623 this._bl = 0x367cd507
27624 this._cl = 0x3070dd17
27625 this._dl = 0xf70e5939
27626 this._el = 0xffc00b31
27627 this._fl = 0x68581511
27628 this._gl = 0x64f98fa7
27629 this._hl = 0xbefa4fa4
27630
27631 return this
27632}
27633
27634Sha384.prototype._hash = function () {
27635 var H = Buffer.allocUnsafe(48)
27636
27637 function writeInt64BE (h, l, offset) {
27638 H.writeInt32BE(h, offset)
27639 H.writeInt32BE(l, offset + 4)
27640 }
27641
27642 writeInt64BE(this._ah, this._al, 0)
27643 writeInt64BE(this._bh, this._bl, 8)
27644 writeInt64BE(this._ch, this._cl, 16)
27645 writeInt64BE(this._dh, this._dl, 24)
27646 writeInt64BE(this._eh, this._el, 32)
27647 writeInt64BE(this._fh, this._fl, 40)
27648
27649 return H
27650}
27651
27652module.exports = Sha384
27653
27654},{"./hash":195,"./sha512":202,"inherits":189,"safe-buffer":193}],202:[function(require,module,exports){
27655var inherits = require('inherits')
27656var Hash = require('./hash')
27657var Buffer = require('safe-buffer').Buffer
27658
27659var K = [
27660 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
27661 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
27662 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
27663 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
27664 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
27665 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
27666 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
27667 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
27668 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
27669 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
27670 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
27671 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
27672 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
27673 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
27674 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
27675 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
27676 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
27677 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
27678 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
27679 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
27680 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
27681 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
27682 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
27683 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
27684 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
27685 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
27686 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
27687 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
27688 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
27689 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
27690 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
27691 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
27692 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
27693 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
27694 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
27695 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
27696 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
27697 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
27698 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
27699 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
27700]
27701
27702var W = new Array(160)
27703
27704function Sha512 () {
27705 this.init()
27706 this._w = W
27707
27708 Hash.call(this, 128, 112)
27709}
27710
27711inherits(Sha512, Hash)
27712
27713Sha512.prototype.init = function () {
27714 this._ah = 0x6a09e667
27715 this._bh = 0xbb67ae85
27716 this._ch = 0x3c6ef372
27717 this._dh = 0xa54ff53a
27718 this._eh = 0x510e527f
27719 this._fh = 0x9b05688c
27720 this._gh = 0x1f83d9ab
27721 this._hh = 0x5be0cd19
27722
27723 this._al = 0xf3bcc908
27724 this._bl = 0x84caa73b
27725 this._cl = 0xfe94f82b
27726 this._dl = 0x5f1d36f1
27727 this._el = 0xade682d1
27728 this._fl = 0x2b3e6c1f
27729 this._gl = 0xfb41bd6b
27730 this._hl = 0x137e2179
27731
27732 return this
27733}
27734
27735function Ch (x, y, z) {
27736 return z ^ (x & (y ^ z))
27737}
27738
27739function maj (x, y, z) {
27740 return (x & y) | (z & (x | y))
27741}
27742
27743function sigma0 (x, xl) {
27744 return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
27745}
27746
27747function sigma1 (x, xl) {
27748 return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
27749}
27750
27751function Gamma0 (x, xl) {
27752 return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
27753}
27754
27755function Gamma0l (x, xl) {
27756 return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
27757}
27758
27759function Gamma1 (x, xl) {
27760 return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
27761}
27762
27763function Gamma1l (x, xl) {
27764 return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
27765}
27766
27767function getCarry (a, b) {
27768 return (a >>> 0) < (b >>> 0) ? 1 : 0
27769}
27770
27771Sha512.prototype._update = function (M) {
27772 var W = this._w
27773
27774 var ah = this._ah | 0
27775 var bh = this._bh | 0
27776 var ch = this._ch | 0
27777 var dh = this._dh | 0
27778 var eh = this._eh | 0
27779 var fh = this._fh | 0
27780 var gh = this._gh | 0
27781 var hh = this._hh | 0
27782
27783 var al = this._al | 0
27784 var bl = this._bl | 0
27785 var cl = this._cl | 0
27786 var dl = this._dl | 0
27787 var el = this._el | 0
27788 var fl = this._fl | 0
27789 var gl = this._gl | 0
27790 var hl = this._hl | 0
27791
27792 for (var i = 0; i < 32; i += 2) {
27793 W[i] = M.readInt32BE(i * 4)
27794 W[i + 1] = M.readInt32BE(i * 4 + 4)
27795 }
27796 for (; i < 160; i += 2) {
27797 var xh = W[i - 15 * 2]
27798 var xl = W[i - 15 * 2 + 1]
27799 var gamma0 = Gamma0(xh, xl)
27800 var gamma0l = Gamma0l(xl, xh)
27801
27802 xh = W[i - 2 * 2]
27803 xl = W[i - 2 * 2 + 1]
27804 var gamma1 = Gamma1(xh, xl)
27805 var gamma1l = Gamma1l(xl, xh)
27806
27807 // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
27808 var Wi7h = W[i - 7 * 2]
27809 var Wi7l = W[i - 7 * 2 + 1]
27810
27811 var Wi16h = W[i - 16 * 2]
27812 var Wi16l = W[i - 16 * 2 + 1]
27813
27814 var Wil = (gamma0l + Wi7l) | 0
27815 var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
27816 Wil = (Wil + gamma1l) | 0
27817 Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
27818 Wil = (Wil + Wi16l) | 0
27819 Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
27820
27821 W[i] = Wih
27822 W[i + 1] = Wil
27823 }
27824
27825 for (var j = 0; j < 160; j += 2) {
27826 Wih = W[j]
27827 Wil = W[j + 1]
27828
27829 var majh = maj(ah, bh, ch)
27830 var majl = maj(al, bl, cl)
27831
27832 var sigma0h = sigma0(ah, al)
27833 var sigma0l = sigma0(al, ah)
27834 var sigma1h = sigma1(eh, el)
27835 var sigma1l = sigma1(el, eh)
27836
27837 // t1 = h + sigma1 + ch + K[j] + W[j]
27838 var Kih = K[j]
27839 var Kil = K[j + 1]
27840
27841 var chh = Ch(eh, fh, gh)
27842 var chl = Ch(el, fl, gl)
27843
27844 var t1l = (hl + sigma1l) | 0
27845 var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
27846 t1l = (t1l + chl) | 0
27847 t1h = (t1h + chh + getCarry(t1l, chl)) | 0
27848 t1l = (t1l + Kil) | 0
27849 t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
27850 t1l = (t1l + Wil) | 0
27851 t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
27852
27853 // t2 = sigma0 + maj
27854 var t2l = (sigma0l + majl) | 0
27855 var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
27856
27857 hh = gh
27858 hl = gl
27859 gh = fh
27860 gl = fl
27861 fh = eh
27862 fl = el
27863 el = (dl + t1l) | 0
27864 eh = (dh + t1h + getCarry(el, dl)) | 0
27865 dh = ch
27866 dl = cl
27867 ch = bh
27868 cl = bl
27869 bh = ah
27870 bl = al
27871 al = (t1l + t2l) | 0
27872 ah = (t1h + t2h + getCarry(al, t1l)) | 0
27873 }
27874
27875 this._al = (this._al + al) | 0
27876 this._bl = (this._bl + bl) | 0
27877 this._cl = (this._cl + cl) | 0
27878 this._dl = (this._dl + dl) | 0
27879 this._el = (this._el + el) | 0
27880 this._fl = (this._fl + fl) | 0
27881 this._gl = (this._gl + gl) | 0
27882 this._hl = (this._hl + hl) | 0
27883
27884 this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
27885 this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
27886 this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
27887 this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
27888 this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
27889 this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
27890 this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
27891 this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
27892}
27893
27894Sha512.prototype._hash = function () {
27895 var H = Buffer.allocUnsafe(64)
27896
27897 function writeInt64BE (h, l, offset) {
27898 H.writeInt32BE(h, offset)
27899 H.writeInt32BE(l, offset + 4)
27900 }
27901
27902 writeInt64BE(this._ah, this._al, 0)
27903 writeInt64BE(this._bh, this._bl, 8)
27904 writeInt64BE(this._ch, this._cl, 16)
27905 writeInt64BE(this._dh, this._dl, 24)
27906 writeInt64BE(this._eh, this._el, 32)
27907 writeInt64BE(this._fh, this._fl, 40)
27908 writeInt64BE(this._gh, this._gl, 48)
27909 writeInt64BE(this._hh, this._hl, 56)
27910
27911 return H
27912}
27913
27914module.exports = Sha512
27915
27916},{"./hash":195,"inherits":189,"safe-buffer":193}]},{},[150])(150)
23935}); \ No newline at end of file 27917}); \ No newline at end of file
diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js
index 219395d..7ac8ed4 100644
--- a/src/js/bitcoinjs-extensions.js
+++ b/src/js/bitcoinjs-extensions.js
@@ -114,9 +114,9 @@ bitcoinjs.bitcoin.networks.axe = {
114 public: 0x0488b21e, 114 public: 0x0488b21e,
115 private: 0x0488ade4 115 private: 0x0488ade4
116 }, 116 },
117 pubKeyHash: 0x4B, 117 pubKeyHash: 0x37,
118 scriptHash: 0xCB, // TODO set this correctly 118 scriptHash: 0x10, // TODO set this correctly
119 wif: 0xCB 119 wif: 0xcc
120}; 120};
121 121
122bitcoinjs.bitcoin.networks.slimcoin = { 122bitcoinjs.bitcoin.networks.slimcoin = {
@@ -152,6 +152,28 @@ bitcoinjs.bitcoin.networks.dogecoin = {
152 wif: 0x9e 152 wif: 0x9e
153}; 153};
154 154
155bitcoinjs.bitcoin.networks.denarius = {
156 messagePrefix: '\x19Denarius Signed Message:\n',
157 bip32: {
158 public: 0x0488b21e,
159 private: 0x0488ade4
160 },
161 pubKeyHash: 0x1e,
162 scriptHash: 0x5a,
163 wif: 0x9e
164};
165
166bitcoinjs.bitcoin.networks.neblio = {
167 messagePrefix: '\x18Neblio Signed Message:\n',
168 bip32: {
169 public: 0x0488b21e,
170 private: 0x0488ade4
171 },
172 pubKeyHash: 0x35,
173 scriptHash: 0x70,
174 wif: 0xb5
175};
176
155bitcoinjs.bitcoin.networks.viacoin = { 177bitcoinjs.bitcoin.networks.viacoin = {
156 messagePrefix: '\x18Viacoin Signed Message:\n', 178 messagePrefix: '\x18Viacoin Signed Message:\n',
157 bip32: { 179 bip32: {
@@ -275,7 +297,7 @@ bitcoinjs.bitcoin.networks.nubits = {
275}; 297};
276 298
277bitcoinjs.bitcoin.networks.bgold = { 299bitcoinjs.bitcoin.networks.bgold = {
278 messagePrefix: 'unused', 300 messagePrefix: '\x1DBitcoin Gold Signed Message:\n',
279 bip32: { 301 bip32: {
280 public: 0x0488b21e, 302 public: 0x0488b21e,
281 private: 0x0488ade4 303 private: 0x0488ade4
@@ -285,17 +307,6 @@ bitcoinjs.bitcoin.networks.bgold = {
285 wif: 128 307 wif: 128
286}; 308};
287 309
288bitcoinjs.bitcoin.networks.bitcoinCashBitbpay = {
289 messagePrefix: '\x18Bitcoin Signed Message:\n',
290 bip32: {
291 public: 0x0488b21e,
292 private: 0x0488ade4
293 },
294 pubKeyHash: 0x1c,
295 scriptHash: 0x28,
296 wif: 0x80
297};
298
299bitcoinjs.bitcoin.networks.monacoin = { 310bitcoinjs.bitcoin.networks.monacoin = {
300 messagePrefix: '\x18Monacoin Signed Message:\n', 311 messagePrefix: '\x18Monacoin Signed Message:\n',
301 bip32: { 312 bip32: {
@@ -328,3 +339,1138 @@ bitcoinjs.bitcoin.networks.komodo = {
328 scriptHash: 0x55, 339 scriptHash: 0x55,
329 wif: 0xbc 340 wif: 0xbc
330}; 341};
342
343bitcoinjs.bitcoin.networks.blackcoin = {
344 messagePrefix: '\x18BlackCoin Signed Message:\n',
345 bip32: {
346 public: 0x02CFBEDE,
347 private: 0x02CFBF60
348 },
349 pubKeyHash: 0x19,
350 scriptHash: 0x55,
351 wif: 0x99
352};
353
354bitcoinjs.bitcoin.networks.beetlecoin = {
355 messagePrefix: '\x19Beetlecoin Signed Message:\n',
356 bip32: {
357 public: 0x0488b21e,
358 private: 0x0488ade4
359 },
360 pubKeyHash: 0x1A,
361 scriptHash: 0x55,
362 wif: 0x99,
363};
364
365
366bitcoinjs.bitcoin.networks.adcoin = {
367 messagePrefix: '\x18AdCoin Signed Message:\n',
368 bip32: {
369 public: 0x0488B21E,
370 private: 0x0488ADE4,
371 },
372 pubKeyHash: 0x17,
373 scriptHash: 0x05,
374 wif: 0xb0,
375};
376
377bitcoinjs.bitcoin.networks.asiacoin = {
378 messagePrefix: '\x18AsiaCoin Signed Message:\n',
379 bip32: {
380 public: 0x0488b21e,
381 private: 0x0488ade4,
382 },
383 pubKeyHash: 0x17,
384 scriptHash: 0x08,
385 wif: 0x97,
386};
387
388bitcoinjs.bitcoin.networks.auroracoin = {
389 messagePrefix: '\x18AuroraCoin Signed Message:\n',
390 bip32: {
391 public: 0x0488b21e,
392 private: 0x0488ade4,
393 },
394 pubKeyHash: 0x17,
395 scriptHash: 0x05,
396 wif: 0x97,
397};
398
399bitcoinjs.bitcoin.networks.bata = {
400 messagePrefix: '\x18Bata Signed Message:\n',
401 bip32: {
402 public: 0xA40C86FA,
403 private: 0xA40B91BD,
404 },
405 pubKeyHash: 0x19,
406 scriptHash: 0x05,
407 wif: 0xa4,
408};
409
410bitcoinjs.bitcoin.networks.belacoin = {
411 messagePrefix: '\x18BelaCoin Signed Message:\n',
412 bip32: {
413 public: 0x0488b21e,
414 private: 0x0488ade4,
415 },
416 pubKeyHash: 0x19,
417 scriptHash: 0x05,
418 wif: 0x99,
419};
420
421bitcoinjs.bitcoin.networks.atom = {
422 messagePrefix: '\x18Bitcoin Signed Message:\n',
423 bip32: {
424 public: 0x0488B21E,
425 private: 0x0488ADE4,
426 },
427 pubKeyHash: 0x17,
428 scriptHash: 0x0a,
429 wif: 0x80,
430};
431
432bitcoinjs.bitcoin.networks.bitcoinplus = {
433 messagePrefix: '\x18BitcoinPlus Signed Message:\n',
434 bip32: {
435 public: 0x0488b21e,
436 private: 0x0488ade4,
437 },
438 pubKeyHash: 0x19,
439 scriptHash: 0x08,
440 wif: 0x99,
441};
442
443bitcoinjs.bitcoin.networks.bitcloud = {
444 messagePrefix: '\x18BitCloud Signed Message:\n',
445 bip32: {
446 public: 0x0488B21E,
447 private: 0x0488ADE4,
448 },
449 pubKeyHash: 0x19,
450 scriptHash: 0x05,
451 wif: 0x99,
452};
453
454bitcoinjs.bitcoin.networks.bitcore = {
455 messagePrefix: '\x18BitCore Signed Message:\n',
456 bip32: {
457 public: 0x0488B21E,
458 private: 0x0488ADE4,
459 },
460 pubKeyHash: 0x03,
461 scriptHash: 0x7D,
462 wif: 0x80,
463};
464
465bitcoinjs.bitcoin.networks.bitsend = {
466 messagePrefix: '\x18Bitsend Signed Message:\n',
467 bip32: {
468 public: 0x0488B21E,
469 private: 0x0488ADE4,
470 },
471 pubKeyHash: 0x66,
472 scriptHash: 0x05,
473 wif: 0xcc,
474};
475
476bitcoinjs.bitcoin.networks.britcoin = {
477 messagePrefix: '\x18BritCoin Signed Message:\n',
478 bip32: {
479 public: 0x0488b21e,
480 private: 0x0488ade4,
481 },
482 pubKeyHash: 0x19,
483 scriptHash: 0x55,
484 wif: 0x99,
485};
486
487bitcoinjs.bitcoin.networks.canadaecoin = {
488 messagePrefix: '\x18Canada eCoin Signed Message:\n',
489 bip32: {
490 public: 0x0488b21e,
491 private: 0x0488ade4,
492 },
493 pubKeyHash: 0x1c,
494 scriptHash: 0x05,
495 wif: 0x9c,
496};
497
498bitcoinjs.bitcoin.networks.cannacoin = {
499 messagePrefix: '\x18Cannacoin Signed Message:\n',
500 bip32: {
501 public: 0x0488b21e,
502 private: 0x0488ade4,
503 },
504 pubKeyHash: 0x1c,
505 scriptHash: 0x05,
506 wif: 0x9c,
507};
508
509bitcoinjs.bitcoin.networks.cryptoescudo = {
510 messagePrefix: '\x18Cryptoescudo Signed Message:\n',
511 bip32: {
512 public: 0x0488b21e,
513 private: 0x0488ade4,
514 },
515 pubKeyHash: 0x1c,
516 scriptHash: 0x05,
517 wif: 0x9c,
518};
519
520bitcoinjs.bitcoin.networks.clubcoin = {
521 messagePrefix: '\x18ClubCoin Signed Message:\n',
522 bip32: {
523 public: 0x0488B21E,
524 private: 0x0488ADE4,
525 },
526 pubKeyHash: 0x1c,
527 scriptHash: 0x55,
528 wif: 0x99,
529};
530
531bitcoinjs.bitcoin.networks.compcoin = {
532 messagePrefix: '\x18CompCoin Signed Message:\n',
533 bip32: {
534 public: 0x0488b21e,
535 private: 0x0488ade4,
536 },
537 pubKeyHash: 0x1c,
538 scriptHash: 0x55,
539 wif: 0x9c,
540};
541
542bitcoinjs.bitcoin.networks.crave = {
543 messagePrefix: '\x18DarkNet Signed Message:\n',
544 bip32: {
545 public: 0x0488B21E,
546 private: 0x0488ADE4,
547 },
548 pubKeyHash: 0x46,
549 scriptHash: 0x55,
550 wif: 0x99,
551};
552
553bitcoinjs.bitcoin.networks.defcoin = {
554 messagePrefix: '\x18defcoin Signed Message:\n',
555 bip32: {
556 public: 0x0488b21e,
557 private: 0x0488ade4,
558 },
559 pubKeyHash: 0x1e,
560 scriptHash: 0x05,
561 wif: 0x9e,
562};
563
564bitcoinjs.bitcoin.networks.diamond = {
565 messagePrefix: '\x18Diamond Signed Message:\n',
566 bip32: {
567 public: 0x0488B21E,
568 private: 0x0488ADE4,
569 },
570 pubKeyHash: 0x5a,
571 scriptHash: 0x08,
572 wif: 0xda,
573};
574
575bitcoinjs.bitcoin.networks.digibyte = {
576 messagePrefix: '\x18DigiByte Signed Message:\n',
577 bip32: {
578 public: 0x0488B21E,
579 private: 0x0488ADE4,
580 },
581 pubKeyHash: 0x1e,
582 scriptHash: 0x05,
583 wif: 0x80,
584};
585
586bitcoinjs.bitcoin.networks.digitalcoin = {
587 messagePrefix: '\x18Digitalcoin Signed Message:\n',
588 bip32: {
589 public: 0x9e0488B2,
590 private: 0x0488ADE4,
591 },
592 pubKeyHash: 0x1e,
593 scriptHash: 0x05,
594 wif: 0x9e,
595};
596
597bitcoinjs.bitcoin.networks.ecoin = {
598 messagePrefix: '\x18eCoin Signed Message:\n',
599 bip32: {
600 public: 0x0488b21e,
601 private: 0x0488ade4,
602 },
603 pubKeyHash: 0x5c,
604 scriptHash: 0x14,
605 wif: 0xdc,
606};
607
608bitcoinjs.bitcoin.networks.edrcoin = {
609 messagePrefix: '\x18EDRcoin Signed Message:\n',
610 bip32: {
611 public: 0x0488b21e,
612 private: 0x0488ade4,
613 },
614 pubKeyHash: 0x5d,
615 scriptHash: 0x1c,
616 wif: 0xdd,
617};
618
619bitcoinjs.bitcoin.networks.egulden = {
620 messagePrefix: '\x18Egulden Signed Message:\n',
621 bip32: {
622 public: 0x0488B21E,
623 private: 0x0488ADE4,
624 },
625 pubKeyHash: 0x30,
626 scriptHash: 0x05,
627 wif: 0xb0,
628};
629
630bitcoinjs.bitcoin.networks.einsteinium = {
631 messagePrefix: '\x18Einsteinium Signed Message:\n',
632 bip32: {
633 public: 0x0488b21e,
634 private: 0x0488ade4,
635 },
636 pubKeyHash: 0x21,
637 scriptHash: 0x05,
638 wif: 0xa1,
639};
640
641bitcoinjs.bitcoin.networks.europecoin = {
642 messagePrefix: '\x18Bitcoin Signed Message:\n',
643 bip32: {
644 public: 0x0488B21E,
645 private: 0x0488ADE4,
646 },
647 pubKeyHash: 0x21,
648 scriptHash: 0x05,
649 wif: 0xa8,
650};
651
652bitcoinjs.bitcoin.networks.exclusivecoin = {
653 messagePrefix: '\x18ExclusiveCoin Signed Message:\n',
654 bip32: {
655 public: 0x0488B21E,
656 private: 0x0488ADE4,
657 },
658 pubKeyHash: 0x21,
659 scriptHash: 0x89,
660 wif: 0xa1,
661};
662
663bitcoinjs.bitcoin.networks.feathercoin = {
664 messagePrefix: '\x18Feathercoin Signed Message:\n',
665 bip32: {
666 public: 0x0488BC26,
667 private: 0x0488DAEE,
668 },
669 pubKeyHash: 0x0e,
670 scriptHash: 0x05,
671 wif: 0x8e,
672};
673
674bitcoinjs.bitcoin.networks.firstcoin = {
675 messagePrefix: '\x18FirstCoin Signed Message:\n',
676 bip32: {
677 public: 0x0488b21e,
678 private: 0x0488ade4,
679 },
680 pubKeyHash: 0x23,
681 scriptHash: 0x05,
682 wif: 0xa3,
683};
684
685bitcoinjs.bitcoin.networks.flashcoin = {
686 messagePrefix: '\x18Flashcoin Signed Message:\n',
687 bip32: {
688 public: 0x0488b21e,
689 private: 0x0488ade4,
690 },
691 pubKeyHash: 0x44,
692 scriptHash: 0x82,
693 wif: 0xc4,
694};
695
696bitcoinjs.bitcoin.networks.gcr = {
697 messagePrefix: '\x18GCR Signed Message:\n',
698 bip32: {
699 public: 0x0488B21E,
700 private: 0x0488ADE4,
701 },
702 pubKeyHash: 0x26,
703 scriptHash: 0x61,
704 wif: 0x9a,
705};
706
707bitcoinjs.bitcoin.networks.gobyte = {
708 messagePrefix: '\x18DarkCoin Signed Message:\n',
709 bip32: {
710 public: 0x0488B21E,
711 private: 0x0488ADE4,
712 },
713 pubKeyHash: 0x26,
714 scriptHash: 0x0a,
715 wif: 0xc6,
716};
717
718bitcoinjs.bitcoin.networks.gridcoin = {
719 messagePrefix: '\x18Gridcoin Signed Message:\n',
720 bip32: {
721 public: 0x0488b21e,
722 private: 0x0488ade4,
723 },
724 pubKeyHash: 0x3e,
725 scriptHash: 0x55,
726 wif: 0xbe,
727};
728
729bitcoinjs.bitcoin.networks.gulden = {
730 messagePrefix: '\x18Guldencoin Signed Message:\n',
731 bip32: {
732 public: 0x0488B21E,
733 private: 0x0488ADE4,
734 },
735 pubKeyHash: 0x26,
736 scriptHash: 0x62,
737 wif: 0x62,
738};
739
740bitcoinjs.bitcoin.networks.helleniccoin = {
741 messagePrefix: '\x18helleniccoin Signed Message:\n',
742 bip32: {
743 public: 0x0488b21e,
744 private: 0x0488ade4,
745 },
746 pubKeyHash: 0x30,
747 scriptHash: 0x05,
748 wif: 0xb0,
749};
750
751bitcoinjs.bitcoin.networks.hempcoin = {
752 messagePrefix: '\x18Hempcoin Signed Message:\n',
753 bip32: {
754 public: 0x0488b21e,
755 private: 0x0488ade4,
756 },
757 pubKeyHash: 0x28,
758 scriptHash: 0x08,
759 wif: 0xa8,
760};
761
762bitcoinjs.bitcoin.networks.insane = {
763 messagePrefix: '\x18INSaNe Signed Message:\n',
764 bip32: {
765 public: 0x0488B21E,
766 private: 0x0488ADE4,
767 },
768 pubKeyHash: 0x66,
769 scriptHash: 0x39,
770 wif: 0x37,
771};
772
773bitcoinjs.bitcoin.networks.iop = {
774 messagePrefix: '\x18IoP Signed Message:\n',
775 bip32: {
776 public: 0x2780915F,
777 private: 0xAE3416F6,
778 },
779 pubKeyHash: 0x75,
780 scriptHash: 0xae,
781 wif: 0x31,
782};
783
784bitcoinjs.bitcoin.networks.ixcoin = {
785 messagePrefix: '\x18Ixcoin Signed Message:\n',
786 bip32: {
787 public: 0x0488B21E,
788 private: 0x0488ADE4,
789 },
790 pubKeyHash: 0x8a,
791 scriptHash: 0x05,
792 wif: 0x80,
793};
794
795bitcoinjs.bitcoin.networks.kobocoin = {
796 messagePrefix: '\x18Kobocoin Signed Message:\n',
797 bip32: {
798 public: 0x0488B21E,
799 private: 0x0488ADE4,
800 },
801 pubKeyHash: 0x23,
802 scriptHash: 0x1c,
803 wif: 0xa3,
804};
805
806bitcoinjs.bitcoin.networks.landcoin = {
807 messagePrefix: '\x18Landcoin Signed Message:\n',
808 bip32: {
809 public: 0x0488B21E,
810 private: 0x0488ADE4,
811 },
812 pubKeyHash: 0x30,
813 scriptHash: 0x7a,
814 wif: 0xb0,
815};
816
817bitcoinjs.bitcoin.networks.lbry = {
818 messagePrefix: '\x18LBRYcrd Signed Message:\n',
819 bip32: {
820 public: 0x0488B21E,
821 private: 0x0488ADE4,
822 },
823 pubKeyHash: 0x55,
824 scriptHash: 0x7a,
825 wif: 0x1c,
826};
827
828bitcoinjs.bitcoin.networks.linx = {
829 messagePrefix: '\x18LinX Signed Message:\n',
830 bip32: {
831 public: 0x0488b21e,
832 private: 0x0488ade4,
833 },
834 pubKeyHash: 0x4b,
835 scriptHash: 0x05,
836 wif: 0xcb,
837};
838
839bitcoinjs.bitcoin.networks.litecoincash = {
840 messagePrefix: '\x18Litecoin Signed Message:\n',
841 bip32: {
842 public: 0x0488B21E,
843 private: 0x0488ADE4,
844 },
845 pubKeyHash: 0x1c,
846 scriptHash: 0x05,
847 wif: 0xb0,
848};
849
850bitcoinjs.bitcoin.networks.lynx = {
851 messagePrefix: '\x18Lynx Signed Message:\n',
852 bip32: {
853 public: 0x0488B21E,
854 private: 0x0488ADE4,
855 },
856 pubKeyHash: 0x2d,
857 scriptHash: 0x32,
858 wif: 0xad,
859};
860
861bitcoinjs.bitcoin.networks.megacoin = {
862 messagePrefix: '\x18Megacoin Signed Message:\n',
863 bip32: {
864 public: 0x0488B21E,
865 private: 0x0488ADE4,
866 },
867 pubKeyHash: 0x32,
868 scriptHash: 0x05,
869 wif: 0xB2,
870};
871
872bitcoinjs.bitcoin.networks.minexcoin = {
873 messagePrefix: '\x18Bitcoin Signed Message:\n',
874 bip32: {
875 public: 0x0488B21E,
876 private: 0x0488ADE4,
877 },
878 pubKeyHash: 0x4b,
879 scriptHash: 0x05,
880 wif: 0x80,
881};
882
883bitcoinjs.bitcoin.networks.navcoin = {
884 messagePrefix: '\x18Navcoin Signed Message:\n',
885 bip32: {
886 public: 0x0488B21E,
887 private: 0x0488ADE4,
888 },
889 pubKeyHash: 0x35,
890 scriptHash: 0x55,
891 wif: 0x96,
892};
893
894bitcoinjs.bitcoin.networks.neoscoin = {
895 messagePrefix: '\x18NeosCoin Signed Message:\n',
896 bip32: {
897 public: 0x0488B21E,
898 private: 0x0488ADE4,
899 },
900 pubKeyHash: 0x35,
901 scriptHash: 0x05,
902 wif: 0xb1,
903};
904
905bitcoinjs.bitcoin.networks.neurocoin = {
906 messagePrefix: '\x18PPCoin Signed Message:\n',
907 bip32: {
908 public: 0x0488B21E,
909 private: 0x0488ADE4,
910 },
911 pubKeyHash: 0x35,
912 scriptHash: 0x75,
913 wif: 0xb5,
914};
915
916bitcoinjs.bitcoin.networks.newyorkc = {
917 messagePrefix: '\x18newyorkc Signed Message:\n',
918 bip32: {
919 public: 0x0488b21e,
920 private: 0x0488ade4,
921 },
922 pubKeyHash: 0x3c,
923 scriptHash: 0x16,
924 wif: 0xbc,
925};
926
927bitcoinjs.bitcoin.networks.novacoin = {
928 messagePrefix: '\x18NovaCoin Signed Message:\n',
929 bip32: {
930 public: 0x0488b21e,
931 private: 0x0488ade4,
932 },
933 pubKeyHash: 0x08,
934 scriptHash: 0x14,
935 wif: 0x88,
936};
937
938bitcoinjs.bitcoin.networks.nushares = {
939 messagePrefix: '\x18Nu Signed Message:\n',
940 bip32: {
941 public: 0x0488b21e,
942 private: 0x0488ade4,
943 },
944 pubKeyHash: 0x3f,
945 scriptHash: 0x40,
946 wif: 0x95,
947};
948
949bitcoinjs.bitcoin.networks.okcash = {
950 messagePrefix: '\x18OKCash Signed Message:\n',
951 bip32: {
952 public: 0x03CC23D7,
953 private: 0x03CC1C73,
954 },
955 pubKeyHash: 0x37,
956 scriptHash: 0x1c,
957 wif: 0x03,
958};
959
960bitcoinjs.bitcoin.networks.omnicore = {
961 messagePrefix: '\x18Bitcoin Signed Message:\n',
962 bip32: {
963 public: 0x0488B21E,
964 private: 0x0488ADE4,
965 },
966 pubKeyHash: 0x00,
967 scriptHash: 0x05,
968 wif: 0x80,
969};
970
971bitcoinjs.bitcoin.networks.pesobit = {
972 messagePrefix: '\x18Pesobit Signed Message:\n',
973 bip32: {
974 public: 0x0488b21e,
975 private: 0x0488ade4,
976 },
977 pubKeyHash: 0x37,
978 scriptHash: 0x55,
979 wif: 0xb7,
980};
981
982bitcoinjs.bitcoin.networks.pinkcoin = {
983 messagePrefix: '\x18Pinkcoin Signed Message:\n',
984 bip32: {
985 public: 0x0488b21e,
986 private: 0x0488ade4,
987 },
988 pubKeyHash: 0x03,
989 scriptHash: 0x1c,
990 wif: 0x83,
991};
992
993bitcoinjs.bitcoin.networks.poswcoin = {
994 messagePrefix: '\x18Poswcoin Signed Message:\n',
995 bip32: {
996 public: 0x0488b21e,
997 private: 0x0488ade4,
998 },
999 pubKeyHash: 0x37,
1000 scriptHash: 0x55,
1001 wif: 0xb7,
1002};
1003
1004bitcoinjs.bitcoin.networks.potcoin = {
1005 messagePrefix: '\x18Potcoin Signed Message:\n',
1006 bip32: {
1007 public: 0x0488b21e,
1008 private: 0x0488ade4,
1009 },
1010 pubKeyHash: 0x37,
1011 scriptHash: 0x05,
1012 wif: 0xb7,
1013};
1014
1015bitcoinjs.bitcoin.networks.putincoin = {
1016 messagePrefix: '\x18PutinCoin Signed Message:\n',
1017 bip32: {
1018 public: 0x0488b21e,
1019 private: 0x0488ade4,
1020 },
1021 pubKeyHash: 0x37,
1022 scriptHash: 0x14,
1023 wif: 0xb7,
1024};
1025
1026bitcoinjs.bitcoin.networks.ravencoin = {
1027 messagePrefix: '\x16Raven Signed Message:\n',
1028 bip32: {
1029 public: 0x0488B21E,
1030 private: 0x0488ADE4,
1031 },
1032 pubKeyHash: 0x3c,
1033 scriptHash: 0x7a,
1034 wif: 0x80,
1035};
1036
1037bitcoinjs.bitcoin.networks.reddcoin = {
1038 messagePrefix: '\x18Reddcoin Signed Message:\n',
1039 bip32: {
1040 public: 0x0488B21E,
1041 private: 0x0488ADE4,
1042 },
1043 pubKeyHash: 0x3d,
1044 scriptHash: 0x05,
1045 wif: 0xbd,
1046};
1047
1048bitcoinjs.bitcoin.networks.revolutionvr = {
1049 messagePrefix: '\x18Voxels Signed Message:\n',
1050 bip32: {
1051 public: 0x0488B21E,
1052 private: 0x0488ADE4,
1053 },
1054 pubKeyHash: 0x46,
1055 scriptHash: 0x05,
1056 wif: 0xc6,
1057};
1058
1059bitcoinjs.bitcoin.networks.rubycoin = {
1060 messagePrefix: '\x18Rubycoin Signed Message:\n',
1061 bip32: {
1062 public: 0x0488B21E,
1063 private: 0x0488ADE4,
1064 },
1065 pubKeyHash: 0x3c,
1066 scriptHash: 0x55,
1067 wif: 0xbc,
1068};
1069
1070bitcoinjs.bitcoin.networks.safecoin = {
1071 messagePrefix: '\x18Safecoin Signed Message:\n',
1072 bip32: {
1073 public: 0x0488b21e,
1074 private: 0x0488ade4,
1075 },
1076 pubKeyHash: 0x3d,
1077 scriptHash: 0x56,
1078 wif: 0xbd,
1079};
1080
1081bitcoinjs.bitcoin.networks.salus = {
1082messagePrefix: '\x18Salus Signed Message:\n',
1083bip32: {
1084 public: 0x0488B21E,
1085 private: 0x0488ADE4,
1086},
1087pubKeyHash: 0x3f,
1088scriptHash: 0xc4,
1089wif: 0xbf,
1090};
1091
1092bitcoinjs.bitcoin.networks.smileycoin = {
1093 messagePrefix: '\x18Smileycoin Signed Message:\n',
1094 bip32: {
1095 public: 0x1E562D9A,
1096 private: 0x1E5631BC,
1097 },
1098 pubKeyHash: 0x19,
1099 scriptHash: 0x05,
1100 wif: 0x05,
1101};
1102
1103bitcoinjs.bitcoin.networks.solarcoin = {
1104 messagePrefix: '\x18SolarCoin Signed Message:\n',
1105 bip32: {
1106 public: 0x0488b21e,
1107 private: 0x0488ade4,
1108 },
1109 pubKeyHash: 0x12,
1110 scriptHash: 0x05,
1111 wif: 0x92,
1112};
1113
1114bitcoinjs.bitcoin.networks.stash = {
1115 messagePrefix: '\x18Stash Signed Message:\n',
1116 bip32: {
1117 public: 0x0488b21e,
1118 private: 0x0488ade4
1119 },
1120 pubKeyHash: 0x4c,
1121 scriptHash: 0x10,
1122 wif: 0xcc
1123};
1124
1125bitcoinjs.bitcoin.networks.stashtn = {
1126 messagePrefix: '\x18Stash Test Signed Message:\n',
1127 bip32: {
1128 public: 0x043587cf,
1129 private: 0x04358394
1130 },
1131 pubKeyHash: 0x8c,
1132 scriptHash: 0x13,
1133 wif: 0xef
1134};
1135
1136bitcoinjs.bitcoin.networks.stratis = {
1137 messagePrefix: '\x18Stratis Signed Message:\n',
1138 bip32: {
1139 public: 0x0488B21E,
1140 private: 0x0488ADE4,
1141 },
1142 pubKeyHash: 0x3f,
1143 scriptHash: 0x7d,
1144 wif: 0xbf,
1145};
1146
1147bitcoinjs.bitcoin.networks.stratistest = {
1148 messagePrefix: '\x18Stratis Test Signed Message:\n',
1149 bip32: {
1150 public: 0x0488B21E,
1151 private: 0x0488ADE4,
1152 },
1153 pubKeyHash: 0x41,
1154 scriptHash: 0x7d,
1155 wif: 0xbf,
1156};
1157
1158bitcoinjs.bitcoin.networks.syscoin = {
1159 messagePrefix: '\x18Syscoin Signed Message:\n',
1160 bip32: {
1161 public: 0x0488B21E,
1162 private: 0x0488ADE4,
1163 },
1164 pubKeyHash: 0x3f,
1165 scriptHash: 0x05,
1166 wif: 0x80,
1167};
1168
1169
1170bitcoinjs.bitcoin.networks.toa = {
1171 messagePrefix: '\x18TOA Signed Message:\n',
1172 bip32: {
1173 public: 0x0488b21e,
1174 private: 0x0488ade4,
1175 },
1176 pubKeyHash: 0x41,
1177 scriptHash: 0x17,
1178 wif: 0xc1,
1179};
1180
1181bitcoinjs.bitcoin.networks.ultimatesecurecash = {
1182 messagePrefix: '\x18UltimateSecureCash Signed Message:\n',
1183 bip32: {
1184 public: 0xEE80286A,
1185 private: 0xEE8031E8,
1186 },
1187 pubKeyHash: 0x44,
1188 scriptHash: 0x7d,
1189 wif: 0xbf,
1190};
1191
1192bitcoinjs.bitcoin.networks.unobtanium = {
1193 messagePrefix: '\x18Unobtanium Signed Message:\n',
1194 bip32: {
1195 public: 0x0488B21E,
1196 private: 0x0488ADE4,
1197 },
1198 pubKeyHash: 0x82,
1199 scriptHash: 0x1e,
1200 wif: 0xe0,
1201};
1202
1203bitcoinjs.bitcoin.networks.vcash = {
1204 messagePrefix: '\x18Vcash Signed Message:\n',
1205 bip32: {
1206 public: 0x0488b21e,
1207 private: 0x0488ade4,
1208 },
1209 pubKeyHash: 0x47,
1210 scriptHash: 0x08,
1211 wif: 0xc7,
1212};
1213
1214bitcoinjs.bitcoin.networks.verge = {
1215 messagePrefix: '\x18VERGE Signed Message:\n',
1216 bip32: {
1217 public: 0x0488b21e,
1218 private: 0x0488ade4,
1219 },
1220 pubKeyHash: 0x1e,
1221 scriptHash: 0x21,
1222 wif: 0x9e,
1223};
1224
1225bitcoinjs.bitcoin.networks.vertcoin = {
1226 messagePrefix: '\x18Vertcoin Signed Message:\n',
1227 bip32: {
1228 public: 0x0488b21e,
1229 private: 0x0488ade4,
1230 },
1231 pubKeyHash: 0x47,
1232 scriptHash: 0x05,
1233 wif: 0x80,
1234};
1235
1236bitcoinjs.bitcoin.networks.vivo = {
1237 messagePrefix: '\x18DarkCoin Signed Message:\n',
1238 bip32: {
1239 public: 0x0488B21E,
1240 private: 0x0488ADE4,
1241 },
1242 pubKeyHash: 0x46,
1243 scriptHash: 0x0a,
1244 wif: 0xc6,
1245};
1246
1247bitcoinjs.bitcoin.networks.vpncoin = {
1248 messagePrefix: '\x18VpnCoin Signed Message:\n',
1249 bip32: {
1250 public: 0x0488b21e,
1251 private: 0x0488ade4,
1252 },
1253 pubKeyHash: 0x47,
1254 scriptHash: 0x05,
1255 wif: 0xc7,
1256};
1257
1258bitcoinjs.bitcoin.networks.whitecoin = {
1259 messagePrefix: '\x18Whitecoin Signed Message:\n',
1260 bip32: {
1261 public: 0x04887F1E,
1262 private: 0x048894ED,
1263 },
1264 pubKeyHash: 0x49,
1265 scriptHash: 0x57,
1266 wif: 0xc9,
1267};
1268
1269bitcoinjs.bitcoin.networks.wincoin = {
1270 messagePrefix: '\x18WinCoin Signed Message:\n',
1271 bip32: {
1272 public: 0x0488b21e,
1273 private: 0x0488ade4,
1274 },
1275 pubKeyHash: 0x49,
1276 scriptHash: 0x1c,
1277 wif: 0xc9,
1278};
1279
1280bitcoinjs.bitcoin.networks.zcoin = {
1281 messagePrefix: '\x18Zcoin Signed Message:\n',
1282 bip32: {
1283 public: 0x0488B21E,
1284 private: 0x0488ADE4,
1285 },
1286 pubKeyHash: 0x52,
1287 scriptHash: 0x07,
1288 wif: 0xd2,
1289};
1290
1291bitcoinjs.bitcoin.networks.zcash = {
1292 messagePrefix: '\x18Zcash Signed Message:\n',
1293 bip32: {
1294 public: 0x0488B21E,
1295 private: 0x0488ADE4,
1296 },
1297 pubKeyHash: 0x1CB8,
1298 scriptHash: 0x1CBD,
1299 wif: 0x80,
1300};
1301
1302bitcoinjs.bitcoin.networks.xuez = {
1303 messagePrefix: 'unused',
1304 bip32: {
1305 public: 0x022d2533,
1306 private: 0x0221312b
1307 },
1308 pubKeyHash: 0x4b,
1309 scriptHash: 0x12,
1310 wif: 0xd4
1311};
1312
1313bitcoinjs.bitcoin.networks.bitcoinprivate = {
1314 messagePrefix: '\x18BitcoinPrivate Signed Message:\n',
1315 bip32: {
1316 public: 0x0488B21E,
1317 private: 0x0488ADE4,
1318 },
1319 pubKeyHash: 0x1325,
1320 scriptHash: 0x13AF,
1321 wif: 0x80,
1322};
1323
1324bitcoinjs.bitcoin.networks.bitcoinz = {
1325 messagePrefix: '\x18BitcoinZ Signed Message:\n',
1326 bip32: {
1327 public: 0x0488B21E,
1328 private: 0x0488ADE4,
1329 },
1330 pubKeyHash: 0x1CB8,
1331 scriptHash: 0x1CBD,
1332 wif: 0x80,
1333};
1334
1335bitcoinjs.bitcoin.networks.hush = {
1336 messagePrefix: '\x18Hush Signed Message:\n',
1337 bip32: {
1338 public: 0x0488B21E,
1339 private: 0x0488ADE4,
1340 },
1341 pubKeyHash: 0x1CB8,
1342 scriptHash: 0x1CBD,
1343 wif: 0x80,
1344};
1345
1346bitcoinjs.bitcoin.networks.zclassic = {
1347 messagePrefix: '\x18Zcash Signed Message:\n',
1348 bip32: {
1349 public: 0x0488B21E,
1350 private: 0x0488ADE4,
1351 },
1352 pubKeyHash: 0x1CB8,
1353 scriptHash: 0x1CBD,
1354 wif: 0x80,
1355};
1356
1357bitcoinjs.bitcoin.networks.zencash = {
1358 messagePrefix: '\x18Zcash Signed Message:\n',
1359 bip32: {
1360 public: 0x0488B21E,
1361 private: 0x0488ADE4,
1362 },
1363 pubKeyHash: 0x2089,
1364 scriptHash: 0x2096,
1365 wif: 0x80,
1366};
1367
1368bitcoinjs.bitcoin.networks.energi = {
1369 messagePrefix: 'DarkCoin Signed Message:\n',
1370 bip32: {
1371 public: 0x03B8C856,
1372 private: 0xD7DC6E9F,
1373 },
1374 pubKeyHash: 0x21,
1375 scriptHash: 0x35,
1376 wif: 0x6a,
1377};
1378
1379bitcoinjs.bitcoin.networks.exchangecoin = {
1380 messagePrefix: 'ExchangeCoin Signed Message:\n',
1381 bip32: {
1382 public: 0x0488B21E,
1383 private: 0x0488ADE4,
1384 },
1385 pubKeyHash: 0x21B9,
1386 scriptHash: 0x34AF,
1387 wif: 0x80,
1388};
1389
1390bitcoinjs.bitcoin.networks.artax = {
1391 messagePrefix: '\x18Artax Signed Message:\n',
1392 bip32: {
1393 public: 0x0488B21E,
1394 private: 0x0488ADE4,
1395 },
1396 pubKeyHash: 0x17,
1397 scriptHash: 0x1CBD,
1398 wif: 0x97,
1399};
1400
1401bitcoinjs.bitcoin.networks.bitcoingreen = {
1402 messagePrefix: '\x18BitcoinGreen Signed Message:\n',
1403 bip32: {
1404 public: 0x0488B21E,
1405 private: 0x0488ADE4,
1406 },
1407 pubKeyHash: 0x26,
1408 scriptHash: 0x1CBD,
1409 wif: 0x2E,
1410};
1411
1412bitcoinjs.bitcoin.networks.anon = {
1413 messagePrefix: '\x18ANON Signed Message:\n',
1414 bip32: {
1415 public: 0x0488b21e,
1416 private: 0x0488ade4
1417 },
1418 pubKeyHash: 0x0582,
1419 scriptHash: 0x5389,
1420 wif: 0x80
1421};
1422
1423bitcoinjs.bitcoin.networks.projectcoin = {
1424 messagePrefix: '\x18ProjectCoin Signed Message:\n',
1425 bip32: {
1426 public: 0x022D2533,
1427 private: 0x0221312B,
1428 },
1429 pubKeyHash: 0x37,
1430 scriptHash: 0x08,
1431 wif: 0x75,
1432};
1433
1434bitcoinjs.bitcoin.networks.phore = {
1435 messagePrefix: '\x18Phore Signed Message:\n',
1436 bip32: {
1437 public: 0x022D2533,
1438 private: 0x0221312B,
1439 },
1440 pubKeyHash: 0x37,
1441 scriptHash: 0x0D,
1442 wif: 0xD4,
1443};
1444
1445bitcoinjs.bitcoin.networks.blocknode = {
1446 messagePrefix: '\x18Blocknode Signed Message:\n',
1447 bip32: {
1448 public: 0x0488b21e,
1449 private: 0x0488ade4
1450 },
1451 pubKeyHash: 0x19,
1452 scriptHash: 0x3F,
1453 wif: 0x4b,
1454};
1455
1456bitcoinjs.bitcoin.networks.blocknode_testnet = {
1457 messagePrefix: '\x18Blocknode Testnet Signed Message:\n',
1458 bip32: {
1459 public: 0x043587cf,
1460 private: 0x04358394
1461 },
1462 pubKeyHash: 0x55,
1463 scriptHash: 0x7d,
1464 wif: 0x89,
1465};
1466
1467bitcoinjs.bitcoin.networks.litecoinz = {
1468 messagePrefix: '\x18LitecoinZ Signed Message:\n',
1469 bip32: {
1470 public: 0x0488B21E,
1471 private: 0x0488ADE3,
1472 },
1473 pubKeyHash: 0x0AB3,
1474 scriptHash: 0x0AB8,
1475 wif: 0x80,
1476}; \ No newline at end of file
diff --git a/src/js/index.js b/src/js/index.js
index b887a67..690fff7 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -23,6 +23,7 @@
23 var generationProcesses = []; 23 var generationProcesses = [];
24 24
25 var DOM = {}; 25 var DOM = {};
26 DOM.privacyScreenToggle = $(".privacy-screen-toggle");
26 DOM.network = $(".network"); 27 DOM.network = $(".network");
27 DOM.bip32Client = $("#bip32-client"); 28 DOM.bip32Client = $("#bip32-client");
28 DOM.phraseNetwork = $("#network-phrase"); 29 DOM.phraseNetwork = $("#network-phrase");
@@ -38,7 +39,9 @@
38 DOM.entropyWordCount = DOM.entropyContainer.find(".word-count"); 39 DOM.entropyWordCount = DOM.entropyContainer.find(".word-count");
39 DOM.entropyBinary = DOM.entropyContainer.find(".binary"); 40 DOM.entropyBinary = DOM.entropyContainer.find(".binary");
40 DOM.entropyWordIndexes = DOM.entropyContainer.find(".word-indexes"); 41 DOM.entropyWordIndexes = DOM.entropyContainer.find(".word-indexes");
42 DOM.entropyChecksum = DOM.entropyContainer.find(".checksum");
41 DOM.entropyMnemonicLength = DOM.entropyContainer.find(".mnemonic-length"); 43 DOM.entropyMnemonicLength = DOM.entropyContainer.find(".mnemonic-length");
44 DOM.entropyWeakEntropyOverrideWarning = DOM.entropyContainer.find(".weak-entropy-override-warning");
42 DOM.entropyFilterWarning = DOM.entropyContainer.find(".filter-warning"); 45 DOM.entropyFilterWarning = DOM.entropyContainer.find(".filter-warning");
43 DOM.phrase = $(".phrase"); 46 DOM.phrase = $(".phrase");
44 DOM.passphrase = $(".passphrase"); 47 DOM.passphrase = $(".passphrase");
@@ -75,6 +78,8 @@
75 DOM.bip49accountXprv = $("#bip49 .account-xprv"); 78 DOM.bip49accountXprv = $("#bip49 .account-xprv");
76 DOM.bip49accountXpub = $("#bip49 .account-xpub"); 79 DOM.bip49accountXpub = $("#bip49 .account-xpub");
77 DOM.bip49change = $("#bip49 .change"); 80 DOM.bip49change = $("#bip49 .change");
81 DOM.bip84unavailable = $("#bip84 .unavailable");
82 DOM.bip84available = $("#bip84 .available");
78 DOM.bip84path = $("#bip84-path"); 83 DOM.bip84path = $("#bip84-path");
79 DOM.bip84purpose = $("#bip84 .purpose"); 84 DOM.bip84purpose = $("#bip84 .purpose");
80 DOM.bip84coin = $("#bip84 .coin"); 85 DOM.bip84coin = $("#bip84 .coin");
@@ -87,9 +92,12 @@
87 DOM.bip141path = $("#bip141-path"); 92 DOM.bip141path = $("#bip141-path");
88 DOM.bip141semantics = $(".bip141-semantics"); 93 DOM.bip141semantics = $(".bip141-semantics");
89 DOM.generatedStrength = $(".generate-container .strength"); 94 DOM.generatedStrength = $(".generate-container .strength");
95 DOM.generatedStrengthWarning = $(".generate-container .warning");
90 DOM.hardenedAddresses = $(".hardened-addresses"); 96 DOM.hardenedAddresses = $(".hardened-addresses");
91 DOM.useBitpayAddressesContainer = $(".use-bitpay-addresses-container"); 97 DOM.bitcoinCashAddressTypeContainer = $(".bch-addr-type-container");
92 DOM.useBitpayAddresses = $(".use-bitpay-addresses"); 98 DOM.bitcoinCashAddressType = $("[name=bch-addr-type]")
99 DOM.useBip38 = $(".use-bip38");
100 DOM.bip38Password = $(".bip38-password");
93 DOM.addresses = $(".addresses"); 101 DOM.addresses = $(".addresses");
94 DOM.csvTab = $("#csv-tab a"); 102 DOM.csvTab = $("#csv-tab a");
95 DOM.csv = $(".csv"); 103 DOM.csv = $(".csv");
@@ -111,6 +119,8 @@
111 119
112 function init() { 120 function init() {
113 // Events 121 // Events
122 DOM.privacyScreenToggle.on("change", privacyScreenToggled);
123 DOM.generatedStrength.on("change", generatedStrengthChanged);
114 DOM.network.on("change", networkChanged); 124 DOM.network.on("change", networkChanged);
115 DOM.bip32Client.on("change", bip32ClientChanged); 125 DOM.bip32Client.on("change", bip32ClientChanged);
116 DOM.useEntropy.on("change", setEntropyVisibility); 126 DOM.useEntropy.on("change", setEntropyVisibility);
@@ -133,13 +143,15 @@
133 DOM.bip141semantics.on("change", tabChanged); 143 DOM.bip141semantics.on("change", tabChanged);
134 DOM.tab.on("shown.bs.tab", tabChanged); 144 DOM.tab.on("shown.bs.tab", tabChanged);
135 DOM.hardenedAddresses.on("change", calcForDerivationPath); 145 DOM.hardenedAddresses.on("change", calcForDerivationPath);
146 DOM.useBip38.on("change", calcForDerivationPath);
147 DOM.bip38Password.on("change", calcForDerivationPath);
136 DOM.indexToggle.on("click", toggleIndexes); 148 DOM.indexToggle.on("click", toggleIndexes);
137 DOM.addressToggle.on("click", toggleAddresses); 149 DOM.addressToggle.on("click", toggleAddresses);
138 DOM.publicKeyToggle.on("click", togglePublicKeys); 150 DOM.publicKeyToggle.on("click", togglePublicKeys);
139 DOM.privateKeyToggle.on("click", togglePrivateKeys); 151 DOM.privateKeyToggle.on("click", togglePrivateKeys);
140 DOM.csvTab.on("click", updateCsv); 152 DOM.csvTab.on("click", updateCsv);
141 DOM.languages.on("click", languageChanged); 153 DOM.languages.on("click", languageChanged);
142 DOM.useBitpayAddresses.on("change", useBitpayAddressesChange); 154 DOM.bitcoinCashAddressType.on("change", bitcoinCashAddressTypeChange);
143 setQrEvents(DOM.showQrEls); 155 setQrEvents(DOM.showQrEls);
144 disableForms(); 156 disableForms();
145 hidePending(); 157 hidePending();
@@ -150,21 +162,25 @@
150 162
151 // Event handlers 163 // Event handlers
152 164
165 function generatedStrengthChanged() {
166 var strength = parseInt(DOM.generatedStrength.val());
167 if (strength < 12) {
168 DOM.generatedStrengthWarning.removeClass("hidden");
169 }
170 else {
171 DOM.generatedStrengthWarning.addClass("hidden");
172 }
173 }
174
153 function networkChanged(e) { 175 function networkChanged(e) {
154 clearDerivedKeys(); 176 clearDerivedKeys();
155 clearAddressesList(); 177 clearAddressesList();
156 DOM.litecoinLtubContainer.addClass("hidden"); 178 DOM.litecoinLtubContainer.addClass("hidden");
157 DOM.useBitpayAddressesContainer.addClass("hidden"); 179 DOM.bitcoinCashAddressTypeContainer.addClass("hidden");
158 var networkIndex = e.target.value; 180 var networkIndex = e.target.value;
159 var network = networks[networkIndex]; 181 var network = networks[networkIndex];
160 network.onSelect(); 182 network.onSelect();
161 if (network.segwitAvailable) { 183 adjustNetworkForSegwit();
162 adjustNetworkForSegwit();
163 showSegwitAvailable();
164 }
165 else {
166 showSegwitUnavailable();
167 }
168 if (seed != null) { 184 if (seed != null) {
169 phraseChanged(); 185 phraseChanged();
170 } 186 }
@@ -354,8 +370,11 @@
354 showPending(); 370 showPending();
355 // Don't show segwit if it's selected but network doesn't support it 371 // Don't show segwit if it's selected but network doesn't support it
356 if (segwitSelected() && !networkHasSegwit()) { 372 if (segwitSelected() && !networkHasSegwit()) {
373 showSegwitUnavailable();
374 hidePending();
357 return; 375 return;
358 } 376 }
377 showSegwitAvailable();
359 // Get the derivation path 378 // Get the derivation path
360 var derivationPath = getDerivationPath(); 379 var derivationPath = getDerivationPath();
361 var errorText = findDerivationPathErrors(derivationPath); 380 var errorText = findDerivationPathErrors(derivationPath);
@@ -406,8 +425,7 @@
406 }, 50); 425 }, 50);
407 } 426 }
408 427
409 function useBitpayAddressesChange() { 428 function bitcoinCashAddressTypeChange() {
410 setBitcoinCashNetworkValues();
411 phraseChanged(); 429 phraseChanged();
412 } 430 }
413 431
@@ -431,6 +449,17 @@
431 $("td.privkey span").toggleClass("invisible"); 449 $("td.privkey span").toggleClass("invisible");
432 } 450 }
433 451
452 function privacyScreenToggled() {
453 // private-data contains elements added to DOM at runtime
454 // so catch all by adding visual privacy class to the root of the DOM
455 if (DOM.privacyScreenToggle.prop("checked")) {
456 $("body").addClass("visual-privacy");
457 }
458 else {
459 $("body").removeClass("visual-privacy");
460 }
461 }
462
434 // Private methods 463 // Private methods
435 464
436 function generateRandomPhrase() { 465 function generateRandomPhrase() {
@@ -462,6 +491,37 @@
462 } 491 }
463 492
464 function calcBip32RootKeyFromBase58(rootKeyBase58) { 493 function calcBip32RootKeyFromBase58(rootKeyBase58) {
494 // try parsing with various segwit network params since this extended
495 // key may be from any one of them.
496 if (networkHasSegwit()) {
497 var n = network;
498 if ("baseNetwork" in n) {
499 n = bitcoinjs.bitcoin.networks[n.baseNetwork];
500 }
501 // try parsing using base network params
502 try {
503 bip32RootKey = bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, n);
504 return;
505 }
506 catch (e) {}
507 // try parsing using p2wpkh params
508 if ("p2wpkh" in n) {
509 try {
510 bip32RootKey = bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, n.p2wpkh);
511 return;
512 }
513 catch (e) {}
514 }
515 // try parsing using p2wpkh-in-p2sh network params
516 if ("p2wpkhInP2sh" in n) {
517 try {
518 bip32RootKey = bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, n.p2wpkhInP2sh);
519 return;
520 }
521 catch (e) {}
522 }
523 }
524 // try the network params as currently specified
465 bip32RootKey = bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, network); 525 bip32RootKey = bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, network);
466 } 526 }
467 527
@@ -535,6 +595,37 @@
535 } 595 }
536 596
537 function validateRootKey(rootKeyBase58) { 597 function validateRootKey(rootKeyBase58) {
598 // try various segwit network params since this extended key may be from
599 // any one of them.
600 if (networkHasSegwit()) {
601 var n = network;
602 if ("baseNetwork" in n) {
603 n = bitcoinjs.bitcoin.networks[n.baseNetwork];
604 }
605 // try parsing using base network params
606 try {
607 bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, n);
608 return "";
609 }
610 catch (e) {}
611 // try parsing using p2wpkh params
612 if ("p2wpkh" in n) {
613 try {
614 bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, n.p2wpkh);
615 return "";
616 }
617 catch (e) {}
618 }
619 // try parsing using p2wpkh-in-p2sh network params
620 if ("p2wpkhInP2sh" in n) {
621 try {
622 bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, n.p2wpkhInP2sh);
623 return "";
624 }
625 catch (e) {}
626 }
627 }
628 // try the network params as currently specified
538 try { 629 try {
539 bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, network); 630 bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, network);
540 } 631 }
@@ -723,7 +814,8 @@
723 DOM.extendedPubKey.val(extendedPubKey); 814 DOM.extendedPubKey.val(extendedPubKey);
724 // Display the addresses and privkeys 815 // Display the addresses and privkeys
725 clearAddressesList(); 816 clearAddressesList();
726 displayAddresses(0, 20); 817 var initialAddressCount = parseInt(DOM.rowsToAdd.val());
818 displayAddresses(0, initialAddressCount);
727 } 819 }
728 820
729 function displayAddresses(start, total) { 821 function displayAddresses(start, total) {
@@ -766,6 +858,8 @@
766 var self = this; 858 var self = this;
767 this.shouldGenerate = true; 859 this.shouldGenerate = true;
768 var useHardenedAddresses = DOM.hardenedAddresses.prop("checked"); 860 var useHardenedAddresses = DOM.hardenedAddresses.prop("checked");
861 var useBip38 = DOM.useBip38.prop("checked");
862 var bip38password = DOM.bip38Password.val();
769 var isSegwit = segwitSelected(); 863 var isSegwit = segwitSelected();
770 var segwitAvailable = networkHasSegwit(); 864 var segwitAvailable = networkHasSegwit();
771 var isP2wpkh = p2wpkhSelected(); 865 var isP2wpkh = p2wpkhSelected();
@@ -780,6 +874,7 @@
780 if (!self.shouldGenerate) { 874 if (!self.shouldGenerate) {
781 return; 875 return;
782 } 876 }
877 // derive HDkey for this row of the table
783 var key = "NA"; 878 var key = "NA";
784 if (useHardenedAddresses) { 879 if (useHardenedAddresses) {
785 key = bip32ExtendedKey.deriveHardened(index); 880 key = bip32ExtendedKey.deriveHardened(index);
@@ -787,19 +882,43 @@
787 else { 882 else {
788 key = bip32ExtendedKey.derive(index); 883 key = bip32ExtendedKey.derive(index);
789 } 884 }
790 var address = key.getAddress().toString(); 885 // bip38 requires uncompressed keys
886 // see https://github.com/iancoleman/bip39/issues/140#issuecomment-352164035
887 var keyPair = key.keyPair;
888 var useUncompressed = useBip38;
889 if (useUncompressed) {
890 keyPair = new bitcoinjs.bitcoin.ECPair(keyPair.d, null, { network: network, compressed: false });
891 }
892 // get address
893 var address = keyPair.getAddress().toString();
894 // get privkey
895 var hasPrivkey = !key.isNeutered();
791 var privkey = "NA"; 896 var privkey = "NA";
792 if (!key.isNeutered()) { 897 if (hasPrivkey) {
793 privkey = key.keyPair.toWIF(network); 898 privkey = keyPair.toWIF();
899 // BIP38 encode private key if required
900 if (useBip38) {
901 privkey = bitcoinjsBip38.encrypt(keyPair.d.toBuffer(), false, bip38password, function(p) {
902 console.log("Progressed " + p.percent.toFixed(1) + "% for index " + index);
903 });
904 }
794 } 905 }
795 var pubkey = key.getPublicKeyBuffer().toString('hex'); 906 // get pubkey
907 var pubkey = keyPair.getPublicKeyBuffer().toString('hex');
796 var indexText = getDerivationPath() + "/" + index; 908 var indexText = getDerivationPath() + "/" + index;
797 if (useHardenedAddresses) { 909 if (useHardenedAddresses) {
798 indexText = indexText + "'"; 910 indexText = indexText + "'";
799 } 911 }
800 // Ethereum values are different 912 // Ethereum values are different
801 if (networks[DOM.network.val()].name == "ETH - Ethereum") { 913 if ((networks[DOM.network.val()].name == "ETH - Ethereum")
802 var privKeyBuffer = key.keyPair.d.toBuffer(32); 914 || (networks[DOM.network.val()].name == "ETC - Ethereum Classic")
915 || (networks[DOM.network.val()].name == "PIRL - Pirl")
916 || (networks[DOM.network.val()].name == "MIX - MIX")
917 || (networks[DOM.network.val()].name == "MUSIC - Musicoin")
918 || (networks[DOM.network.val()].name == "POA - Poa")
919 || (networks[DOM.network.val()].name == "EXP - Expanse")
920 || (networks[DOM.network.val()].name == "CLO - Callisto")) {
921 var privKeyBuffer = keyPair.d.toBuffer(32);
803 privkey = privKeyBuffer.toString('hex'); 922 privkey = privKeyBuffer.toString('hex');
804 var addressBuffer = ethUtil.privateToAddress(privKeyBuffer); 923 var addressBuffer = ethUtil.privateToAddress(privKeyBuffer);
805 var hexAddress = addressBuffer.toString('hex'); 924 var hexAddress = addressBuffer.toString('hex');
@@ -825,6 +944,16 @@
825 privkey = convertRipplePriv(privkey); 944 privkey = convertRipplePriv(privkey);
826 address = convertRippleAdrr(address); 945 address = convertRippleAdrr(address);
827 } 946 }
947 // Bitcoin Cash address format may vary
948 if (networks[DOM.network.val()].name == "BCH - Bitcoin Cash") {
949 var bchAddrType = DOM.bitcoinCashAddressType.filter(":checked").val();
950 if (bchAddrType == "cashaddr") {
951 address = bchaddr.toCashAddress(address);
952 }
953 else if (bchAddrType == "bitpay") {
954 address = bchaddr.toBitpayAddress(address);
955 }
956 }
828 // Segwit addresses are different 957 // Segwit addresses are different
829 if (isSegwit) { 958 if (isSegwit) {
830 if (!segwitAvailable) { 959 if (!segwitAvailable) {
@@ -1164,6 +1293,17 @@
1164 mnemonicLength = parseInt(mnemonicLength); 1293 mnemonicLength = parseInt(mnemonicLength);
1165 var numberOfBits = 32 * mnemonicLength / 3; 1294 var numberOfBits = 32 * mnemonicLength / 3;
1166 bits = bits.substring(0, numberOfBits); 1295 bits = bits.substring(0, numberOfBits);
1296 // show warning for weak entropy override
1297 if (mnemonicLength / 3 * 32 > entropy.binaryStr.length) {
1298 DOM.entropyWeakEntropyOverrideWarning.removeClass("hidden");
1299 }
1300 else {
1301 DOM.entropyWeakEntropyOverrideWarning.addClass("hidden");
1302 }
1303 }
1304 else {
1305 // hide warning for weak entropy override
1306 DOM.entropyWeakEntropyOverrideWarning.addClass("hidden");
1167 } 1307 }
1168 // Discard trailing entropy 1308 // Discard trailing entropy
1169 var bitsToUse = Math.floor(bits.length / 32) * 32; 1309 var bitsToUse = Math.floor(bits.length / 32) * 32;
@@ -1182,6 +1322,8 @@
1182 DOM.phrase.val(phrase); 1322 DOM.phrase.val(phrase);
1183 // Show the word indexes 1323 // Show the word indexes
1184 showWordIndexes(); 1324 showWordIndexes();
1325 // Show the checksum
1326 showChecksum();
1185 } 1327 }
1186 1328
1187 function clearEntropyFeedback() { 1329 function clearEntropyFeedback() {
@@ -1212,13 +1354,14 @@
1212 var entropyTypeStr = getEntropyTypeStr(entropy); 1354 var entropyTypeStr = getEntropyTypeStr(entropy);
1213 var wordCount = Math.floor(numberOfBits / 32) * 3; 1355 var wordCount = Math.floor(numberOfBits / 32) * 3;
1214 var bitsPerEvent = entropy.bitsPerEvent.toFixed(2); 1356 var bitsPerEvent = entropy.bitsPerEvent.toFixed(2);
1357 var spacedBinaryStr = addSpacesEveryElevenBits(entropy.binaryStr);
1215 DOM.entropyFiltered.html(entropy.cleanHtml); 1358 DOM.entropyFiltered.html(entropy.cleanHtml);
1216 DOM.entropyType.text(entropyTypeStr); 1359 DOM.entropyType.text(entropyTypeStr);
1217 DOM.entropyCrackTime.text(timeToCrack); 1360 DOM.entropyCrackTime.text(timeToCrack);
1218 DOM.entropyEventCount.text(entropy.base.ints.length); 1361 DOM.entropyEventCount.text(entropy.base.ints.length);
1219 DOM.entropyBits.text(numberOfBits); 1362 DOM.entropyBits.text(numberOfBits);
1220 DOM.entropyWordCount.text(wordCount); 1363 DOM.entropyWordCount.text(wordCount);
1221 DOM.entropyBinary.text(entropy.binaryStr); 1364 DOM.entropyBinary.text(spacedBinaryStr);
1222 DOM.entropyBitsPerEvent.text(bitsPerEvent); 1365 DOM.entropyBitsPerEvent.text(bitsPerEvent);
1223 // detect and warn of filtering 1366 // detect and warn of filtering
1224 var rawNoSpaces = DOM.entropy.val().replace(/\s/g, ""); 1367 var rawNoSpaces = DOM.entropy.val().replace(/\s/g, "");
@@ -1341,7 +1484,20 @@
1341 } 1484 }
1342 1485
1343 function networkHasSegwit() { 1486 function networkHasSegwit() {
1344 return networks[DOM.network.val()].segwitAvailable; 1487 var n = network;
1488 if ("baseNetwork" in network) {
1489 n = bitcoinjs.bitcoin.networks[network.baseNetwork];
1490 }
1491 // check if only p2wpkh params are required
1492 if (p2wpkhSelected()) {
1493 return "p2wpkh" in n;
1494 }
1495 // check if only p2wpkh-in-p2sh params are required
1496 else if (p2wpkhInP2shSelected()) {
1497 return "p2wpkhInP2sh" in n;
1498 }
1499 // require both if it's unclear which params are required
1500 return "p2wpkh" in n && "p2wpkhInP2sh" in n;
1345 } 1501 }
1346 1502
1347 function bip49TabSelected() { 1503 function bip49TabSelected() {
@@ -1365,6 +1521,8 @@
1365 function showSegwitAvailable() { 1521 function showSegwitAvailable() {
1366 DOM.bip49unavailable.addClass("hidden"); 1522 DOM.bip49unavailable.addClass("hidden");
1367 DOM.bip49available.removeClass("hidden"); 1523 DOM.bip49available.removeClass("hidden");
1524 DOM.bip84unavailable.addClass("hidden");
1525 DOM.bip84available.removeClass("hidden");
1368 DOM.bip141unavailable.addClass("hidden"); 1526 DOM.bip141unavailable.addClass("hidden");
1369 DOM.bip141available.removeClass("hidden"); 1527 DOM.bip141available.removeClass("hidden");
1370 } 1528 }
@@ -1372,23 +1530,12 @@
1372 function showSegwitUnavailable() { 1530 function showSegwitUnavailable() {
1373 DOM.bip49available.addClass("hidden"); 1531 DOM.bip49available.addClass("hidden");
1374 DOM.bip49unavailable.removeClass("hidden"); 1532 DOM.bip49unavailable.removeClass("hidden");
1533 DOM.bip84available.addClass("hidden");
1534 DOM.bip84unavailable.removeClass("hidden");
1375 DOM.bip141available.addClass("hidden"); 1535 DOM.bip141available.addClass("hidden");
1376 DOM.bip141unavailable.removeClass("hidden"); 1536 DOM.bip141unavailable.removeClass("hidden");
1377 } 1537 }
1378 1538
1379 function useBitpayAddresses() {
1380 return !(DOM.useBitpayAddresses.prop("checked"));
1381 }
1382
1383 function setBitcoinCashNetworkValues() {
1384 if (useBitpayAddresses()) {
1385 network = bitcoinjs.bitcoin.networks.bitcoin;
1386 }
1387 else {
1388 network = bitcoinjs.bitcoin.networks.bitcoinCashBitbpay;
1389 }
1390 }
1391
1392 function adjustNetworkForSegwit() { 1539 function adjustNetworkForSegwit() {
1393 // If segwit is selected the xpub/xprv prefixes need to be adjusted 1540 // If segwit is selected the xpub/xprv prefixes need to be adjusted
1394 // to avoid accidentally importing BIP49 xpub to BIP44 watch only 1541 // to avoid accidentally importing BIP49 xpub to BIP44 watch only
@@ -1443,6 +1590,35 @@
1443 DOM.entropyWordIndexes.text(wordIndexesStr); 1590 DOM.entropyWordIndexes.text(wordIndexesStr);
1444 } 1591 }
1445 1592
1593 function showChecksum() {
1594 var phrase = DOM.phrase.val();
1595 var words = phraseToWordArray(phrase);
1596 var checksumBitlength = words.length / 3;
1597 var checksum = "";
1598 var binaryStr = "";
1599 var language = getLanguage();
1600 for (var i=words.length-1; i>=0; i--) {
1601 var word = words[i];
1602 var wordIndex = WORDLISTS[language].indexOf(word);
1603 var wordBinary = wordIndex.toString(2);
1604 while (wordBinary.length < 11) {
1605 wordBinary = "0" + wordBinary;
1606 }
1607 var binaryStr = wordBinary + binaryStr;
1608 if (binaryStr.length >= checksumBitlength) {
1609 var start = binaryStr.length - checksumBitlength;
1610 var end = binaryStr.length;
1611 checksum = binaryStr.substring(start, end);
1612 // add spaces so the last group is 11 bits, not the first
1613 checksum = checksum.split("").reverse().join("")
1614 checksum = addSpacesEveryElevenBits(checksum);
1615 checksum = checksum.split("").reverse().join("")
1616 break;
1617 }
1618 }
1619 DOM.entropyChecksum.text(checksum);
1620 }
1621
1446 function updateCsv() { 1622 function updateCsv() {
1447 var tableCsv = "path,address,public key,private key\n"; 1623 var tableCsv = "path,address,public key,private key\n";
1448 var rows = DOM.addresses.find("tr"); 1624 var rows = DOM.addresses.find("tr");
@@ -1463,27 +1639,118 @@
1463 DOM.csv.val(tableCsv); 1639 DOM.csv.val(tableCsv);
1464 } 1640 }
1465 1641
1642 function addSpacesEveryElevenBits(binaryStr) {
1643 return binaryStr.match(/.{1,11}/g).join(" ");
1644 }
1645
1466 var networks = [ 1646 var networks = [
1467 { 1647 {
1648 name: "AC - Asiacoin",
1649 onSelect: function() {
1650 network = bitcoinjs.bitcoin.networks.asiacoin;
1651 setHdCoin(51);
1652 },
1653 },
1654 {
1655 name: "ACC - Adcoin",
1656 onSelect: function() {
1657 network = bitcoinjs.bitcoin.networks.adcoin;
1658 setHdCoin(161);
1659 },
1660 },
1661 {
1662 name: "AUR - Auroracoin",
1663 onSelect: function() {
1664 network = bitcoinjs.bitcoin.networks.auroracoin;
1665 setHdCoin(85);
1666 },
1667 },
1668 {
1468 name: "AXE - Axe", 1669 name: "AXE - Axe",
1469 segwitAvailable: false,
1470 onSelect: function() { 1670 onSelect: function() {
1471 network = bitcoinjs.bitcoin.networks.axe; 1671 network = bitcoinjs.bitcoin.networks.axe;
1472 setHdCoin(0); 1672 setHdCoin(4242);
1673 },
1674 },
1675 {
1676 name: "ANON - ANON",
1677 onSelect: function() {
1678 network = bitcoinjs.bitcoin.networks.anon;
1679 setHdCoin(220);
1680 },
1681 },
1682 {
1683 name: "BCA - Bitcoin Atom",
1684 onSelect: function() {
1685 network = bitcoinjs.bitcoin.networks.atom;
1686 setHdCoin(185);
1473 }, 1687 },
1474 }, 1688 },
1475 { 1689 {
1476 name: "BCH - Bitcoin Cash", 1690 name: "BCH - Bitcoin Cash",
1477 segwitAvailable: false,
1478 onSelect: function() { 1691 onSelect: function() {
1479 DOM.useBitpayAddressesContainer.removeClass("hidden"); 1692 DOM.bitcoinCashAddressTypeContainer.removeClass("hidden");
1480 setBitcoinCashNetworkValues();
1481 setHdCoin(145); 1693 setHdCoin(145);
1482 }, 1694 },
1483 }, 1695 },
1484 { 1696 {
1697 name: "BEET - Beetlecoin",
1698 onSelect: function() {
1699 network = bitcoinjs.bitcoin.networks.beetlecoin;
1700 setHdCoin(800);
1701 },
1702 },
1703 {
1704 name: "BELA - Belacoin",
1705 onSelect: function() {
1706 network = bitcoinjs.bitcoin.networks.belacoin;
1707 setHdCoin(73);
1708 },
1709 },
1710 {
1711 name: "BLK - BlackCoin",
1712 onSelect: function() {
1713 network = bitcoinjs.bitcoin.networks.blackcoin;
1714 setHdCoin(10);
1715 },
1716 },
1717 {
1718 name: "BND - Blocknode",
1719 onSelect: function() {
1720 network = bitcoinjs.bitcoin.networks.blocknode;
1721 setHdCoin(2941);
1722 },
1723 },
1724 {
1725 name: "tBND - Blocknode Testnet",
1726 onSelect: function() {
1727 network = bitcoinjs.bitcoin.networks.blocknode_testnet;
1728 setHdCoin(1);
1729 },
1730 },
1731 {
1732 name: "BRIT - Britcoin",
1733 onSelect: function() {
1734 network = bitcoinjs.bitcoin.networks.britcoin;
1735 setHdCoin(70);
1736 },
1737 },
1738 {
1739 name: "BSD - Bitsend",
1740 onSelect: function() {
1741 network = bitcoinjs.bitcoin.networks.bitsend;
1742 setHdCoin(91);
1743 },
1744 },
1745 {
1746 name: "BTA - Bata",
1747 onSelect: function() {
1748 network = bitcoinjs.bitcoin.networks.bata;
1749 setHdCoin(89);
1750 },
1751 },
1752 {
1485 name: "BTC - Bitcoin", 1753 name: "BTC - Bitcoin",
1486 segwitAvailable: true,
1487 onSelect: function() { 1754 onSelect: function() {
1488 network = bitcoinjs.bitcoin.networks.bitcoin; 1755 network = bitcoinjs.bitcoin.networks.bitcoin;
1489 setHdCoin(0); 1756 setHdCoin(0);
@@ -1491,39 +1758,119 @@
1491 }, 1758 },
1492 { 1759 {
1493 name: "BTC - Bitcoin Testnet", 1760 name: "BTC - Bitcoin Testnet",
1494 segwitAvailable: true,
1495 onSelect: function() { 1761 onSelect: function() {
1496 network = bitcoinjs.bitcoin.networks.testnet; 1762 network = bitcoinjs.bitcoin.networks.testnet;
1497 setHdCoin(1); 1763 setHdCoin(1);
1498 }, 1764 },
1499 }, 1765 },
1766 {
1767 name: "BITG - Bitcoin Green",
1768 onSelect: function() {
1769 network = bitcoinjs.bitcoin.networks.bitcoingreen;
1770 setHdCoin(222);
1771 },
1772 },
1773 {
1774 name: "BTCP - Bitcoin Private",
1775 onSelect: function() {
1776 network = bitcoinjs.bitcoin.networks.bitcoinprivate;
1777 setHdCoin(183);
1778 },
1779 },
1780 {
1781 name: "BTCZ - Bitcoinz",
1782 onSelect: function() {
1783 network = bitcoinjs.bitcoin.networks.bitcoinz;
1784 setHdCoin(177);
1785 },
1786 },
1787 {
1788 name: "BTDX - BitCloud",
1789 onSelect: function() {
1790 network = bitcoinjs.bitcoin.networks.bitcloud;
1791 setHdCoin(218);
1792 },
1793 },
1500 { 1794 {
1501 name: "BTG - Bitcoin Gold", 1795 name: "BTG - Bitcoin Gold",
1502 segwitAvailable: true,
1503 onSelect: function() { 1796 onSelect: function() {
1504 network = bitcoinjs.bitcoin.networks.bgold; 1797 network = bitcoinjs.bitcoin.networks.bgold;
1505 setHdCoin(0); 1798 setHdCoin(156);
1799 },
1800 },
1801 {
1802 name: "BTX - Bitcore",
1803 onSelect: function() {
1804 network = bitcoinjs.bitcoin.networks.bitcore;
1805 setHdCoin(160);
1806 },
1807 },
1808 {
1809 name: "CCN - Cannacoin",
1810 onSelect: function() {
1811 network = bitcoinjs.bitcoin.networks.cannacoin;
1812 setHdCoin(19);
1813 },
1814 },
1815 {
1816 name: "CESC - Cryptoescudo",
1817 onSelect: function() {
1818 network = bitcoinjs.bitcoin.networks.cannacoin;
1819 setHdCoin(111);
1820 },
1821 },
1822 {
1823 name: "CDN - Canadaecoin",
1824 onSelect: function() {
1825 network = bitcoinjs.bitcoin.networks.canadaecoin;
1826 setHdCoin(34);
1506 }, 1827 },
1507 }, 1828 },
1508 { 1829 {
1509 name: "CLAM - Clams", 1830 name: "CLAM - Clams",
1510 segwitAvailable: false,
1511 onSelect: function() { 1831 onSelect: function() {
1512 network = bitcoinjs.bitcoin.networks.clam; 1832 network = bitcoinjs.bitcoin.networks.clam;
1513 setHdCoin(23); 1833 setHdCoin(23);
1514 }, 1834 },
1515 }, 1835 },
1516 { 1836 {
1517 name: "CRW - Crown", 1837 name: "CLO - Callisto",
1518 segwitAvailable: false, 1838 segwitAvailable: false,
1519 onSelect: function() { 1839 onSelect: function() {
1840 network = bitcoinjs.bitcoin.networks.bitcoin;
1841 setHdCoin(820);
1842 },
1843 },
1844 {
1845 name: "CLUB - Clubcoin",
1846 onSelect: function() {
1847 network = bitcoinjs.bitcoin.networks.clubcoin;
1848 setHdCoin(79);
1849 },
1850 },
1851 {
1852 name: "CMP - Compcoin",
1853 onSelect: function() {
1854 network = bitcoinjs.bitcoin.networks.compcoin;
1855 setHdCoin(71);
1856 },
1857 },
1858 {
1859 name: "CRAVE - Crave",
1860 onSelect: function() {
1861 network = bitcoinjs.bitcoin.networks.crave;
1862 setHdCoin(186);
1863 },
1864 },
1865 {
1866 name: "CRW - Crown",
1867 onSelect: function() {
1520 network = bitcoinjs.bitcoin.networks.crown; 1868 network = bitcoinjs.bitcoin.networks.crown;
1521 setHdCoin(72); 1869 setHdCoin(72);
1522 }, 1870 },
1523 }, 1871 },
1524 { 1872 {
1525 name: "DASH - Dash", 1873 name: "DASH - Dash",
1526 segwitAvailable: false,
1527 onSelect: function() { 1874 onSelect: function() {
1528 network = bitcoinjs.bitcoin.networks.dash; 1875 network = bitcoinjs.bitcoin.networks.dash;
1529 setHdCoin(5); 1876 setHdCoin(5);
@@ -1531,47 +1878,218 @@
1531 }, 1878 },
1532 { 1879 {
1533 name: "DASH - Dash Testnet", 1880 name: "DASH - Dash Testnet",
1534 segwitAvailable: false,
1535 onSelect: function() { 1881 onSelect: function() {
1536 network = bitcoinjs.bitcoin.networks.dashtn; 1882 network = bitcoinjs.bitcoin.networks.dashtn;
1537 setHdCoin(1); 1883 setHdCoin(1);
1538 }, 1884 },
1539 }, 1885 },
1540 { 1886 {
1887 name: "DFC - Defcoin",
1888 onSelect: function() {
1889 network = bitcoinjs.bitcoin.networks.defcoin;
1890 setHdCoin(1337);
1891 },
1892 },
1893 {
1894 name: "DGB - Digibyte",
1895 onSelect: function() {
1896 network = bitcoinjs.bitcoin.networks.digibyte;
1897 setHdCoin(20);
1898 },
1899 },
1900 {
1901 name: "DGC - Digitalcoin",
1902 onSelect: function() {
1903 network = bitcoinjs.bitcoin.networks.digitalcoin;
1904 setHdCoin(18);
1905 },
1906 },
1907 {
1908 name: "DMD - Diamond",
1909 onSelect: function() {
1910 network = bitcoinjs.bitcoin.networks.diamond;
1911 setHdCoin(152);
1912 },
1913 },
1914 {
1915 name: "DNR - Denarius",
1916 onSelect: function() {
1917 network = bitcoinjs.bitcoin.networks.denarius;
1918 setHdCoin(116);
1919 },
1920 },
1921 {
1541 name: "DOGE - Dogecoin", 1922 name: "DOGE - Dogecoin",
1542 segwitAvailable: false,
1543 onSelect: function() { 1923 onSelect: function() {
1544 network = bitcoinjs.bitcoin.networks.dogecoin; 1924 network = bitcoinjs.bitcoin.networks.dogecoin;
1545 setHdCoin(3); 1925 setHdCoin(3);
1546 }, 1926 },
1547 }, 1927 },
1548 { 1928 {
1549 name: "ETH - Ethereum", 1929 name: "ECN - Ecoin",
1930 onSelect: function() {
1931 network = bitcoinjs.bitcoin.networks.ecoin;
1932 setHdCoin(115);
1933 },
1934 },
1935 {
1936 name: "EDRC - Edrcoin",
1937 onSelect: function() {
1938 network = bitcoinjs.bitcoin.networks.edrcoin;
1939 setHdCoin(56);
1940 },
1941 },
1942 {
1943 name: "EFL - Egulden",
1944 onSelect: function() {
1945 network = bitcoinjs.bitcoin.networks.egulden;
1946 setHdCoin(78);
1947 },
1948 },
1949 {
1950 name: "EMC2 - Einsteinium",
1951 onSelect: function() {
1952 network = bitcoinjs.bitcoin.networks.einsteinium;
1953 setHdCoin(41);
1954 },
1955 },
1956 {
1957 name: "ERC - Europecoin",
1958 onSelect: function() {
1959 network = bitcoinjs.bitcoin.networks.europecoin;
1960 setHdCoin(151);
1961 },
1962 },
1963 {
1964 name: "ETC - Ethereum Classic",
1550 segwitAvailable: false, 1965 segwitAvailable: false,
1551 onSelect: function() { 1966 onSelect: function() {
1552 network = bitcoinjs.bitcoin.networks.bitcoin; 1967 network = bitcoinjs.bitcoin.networks.bitcoin;
1968 setHdCoin(61);
1969 },
1970 },
1971 {
1972 name: "ETH - Ethereum",
1973 onSelect: function() {
1974 network = bitcoinjs.bitcoin.networks.bitcoin;
1553 setHdCoin(60); 1975 setHdCoin(60);
1554 }, 1976 },
1555 }, 1977 },
1556 { 1978 {
1557 name: "FJC - Fujicoin", 1979 name: "EXCL - Exclusivecoin",
1980 onSelect: function() {
1981 network = bitcoinjs.bitcoin.networks.exclusivecoin;
1982 setHdCoin(190);
1983 },
1984 },
1985 {
1986 name: "EXCC - ExchangeCoin",
1987 onSelect: function() {
1988 network = bitcoinjs.bitcoin.networks.exchangecoin;
1989 setHdCoin(0);
1990 },
1991 },
1992 {
1993 name: "EXP - Expanse",
1558 segwitAvailable: false, 1994 segwitAvailable: false,
1559 onSelect: function() { 1995 onSelect: function() {
1996 network = bitcoinjs.bitcoin.networks.bitcoin;
1997 setHdCoin(40);
1998 },
1999 },
2000 {
2001 name: "FJC - Fujicoin",
2002 onSelect: function() {
1560 network = bitcoinjs.bitcoin.networks.fujicoin; 2003 network = bitcoinjs.bitcoin.networks.fujicoin;
1561 setHdCoin(75); 2004 setHdCoin(75);
1562 }, 2005 },
1563 }, 2006 },
1564 { 2007 {
2008 name: "FLASH - Flashcoin",
2009 onSelect: function() {
2010 network = bitcoinjs.bitcoin.networks.flashcoin;
2011 setHdCoin(120);
2012 },
2013 },
2014 {
2015 name: "FRST - Firstcoin",
2016 onSelect: function() {
2017 network = bitcoinjs.bitcoin.networks.firstcoin;
2018 setHdCoin(167);
2019 },
2020 },
2021 {
2022 name: "FTC - Feathercoin",
2023 onSelect: function() {
2024 network = bitcoinjs.bitcoin.networks.feathercoin;
2025 setHdCoin(8);
2026 },
2027 },
2028 {
1565 name: "GAME - GameCredits", 2029 name: "GAME - GameCredits",
1566 segwitAvailable: false,
1567 onSelect: function() { 2030 onSelect: function() {
1568 network = bitcoinjs.bitcoin.networks.game; 2031 network = bitcoinjs.bitcoin.networks.game;
1569 setHdCoin(101); 2032 setHdCoin(101);
1570 }, 2033 },
1571 }, 2034 },
1572 { 2035 {
2036 name: "GBX - Gobyte",
2037 onSelect: function() {
2038 network = bitcoinjs.bitcoin.networks.gobyte;
2039 setHdCoin(176);
2040 },
2041 },
2042 {
2043 name: "GCR - GCRCoin",
2044 onSelect: function() {
2045 network = bitcoinjs.bitcoin.networks.gcr;
2046 setHdCoin(79);
2047 },
2048 },
2049 {
2050 name: "GRC - Gridcoin",
2051 onSelect: function() {
2052 network = bitcoinjs.bitcoin.networks.gridcoin;
2053 setHdCoin(84);
2054 },
2055 },
2056 {
2057 name: "HNC - Helleniccoin",
2058 onSelect: function() {
2059 network = bitcoinjs.bitcoin.networks.helleniccoin;
2060 setHdCoin(168);
2061 },
2062 },
2063 {
2064 name: "HUSH - Hush",
2065 onSelect: function() {
2066 network = bitcoinjs.bitcoin.networks.hush;
2067 setHdCoin(197);
2068 },
2069 },
2070 {
2071 name: "INSN - Insane",
2072 onSelect: function() {
2073 network = bitcoinjs.bitcoin.networks.insane;
2074 setHdCoin(68);
2075 },
2076 },
2077 {
2078 name: "IOP - Iop",
2079 onSelect: function() {
2080 network = bitcoinjs.bitcoin.networks.iop;
2081 setHdCoin(66);
2082 },
2083 },
2084 {
2085 name: "IXC - Ixcoin",
2086 onSelect: function() {
2087 network = bitcoinjs.bitcoin.networks.ixcoin;
2088 setHdCoin(86);
2089 },
2090 },
2091 {
1573 name: "JBS - Jumbucks", 2092 name: "JBS - Jumbucks",
1574 segwitAvailable: false,
1575 onSelect: function() { 2093 onSelect: function() {
1576 network = bitcoinjs.bitcoin.networks.jumbucks; 2094 network = bitcoinjs.bitcoin.networks.jumbucks;
1577 setHdCoin(26); 2095 setHdCoin(26);
@@ -1586,8 +2104,43 @@
1586 }, 2104 },
1587 }, 2105 },
1588 { 2106 {
2107 name: "KOBO - Kobocoin",
2108 bip49available: false,
2109 onSelect: function() {
2110 network = bitcoinjs.bitcoin.networks.kobocoin;
2111 setHdCoin(196);
2112 },
2113 },
2114 {
2115 name: "LBC - Library Credits",
2116 onSelect: function() {
2117 network = bitcoinjs.bitcoin.networks.lbry;
2118 setHdCoin(140);
2119 },
2120 },
2121 {
2122 name: "LCC - Litecoincash",
2123 onSelect: function() {
2124 network = bitcoinjs.bitcoin.networks.litecoincash;
2125 setHdCoin(192);
2126 },
2127 },
2128 {
2129 name: "LDCN - Landcoin",
2130 onSelect: function() {
2131 network = bitcoinjs.bitcoin.networks.landcoin;
2132 setHdCoin(63);
2133 },
2134 },
2135 {
2136 name: "LINX - Linx",
2137 onSelect: function() {
2138 network = bitcoinjs.bitcoin.networks.linx;
2139 setHdCoin(114);
2140 },
2141 },
2142 {
1589 name: "LTC - Litecoin", 2143 name: "LTC - Litecoin",
1590 segwitAvailable: true,
1591 onSelect: function() { 2144 onSelect: function() {
1592 network = bitcoinjs.bitcoin.networks.litecoin; 2145 network = bitcoinjs.bitcoin.networks.litecoin;
1593 setHdCoin(2); 2146 setHdCoin(2);
@@ -1595,64 +2148,284 @@
1595 }, 2148 },
1596 }, 2149 },
1597 { 2150 {
2151 name: "LTZ - LitecoinZ",
2152 onSelect: function() {
2153 network = bitcoinjs.bitcoin.networks.litecoinz;
2154 setHdCoin(221);
2155 },
2156 },
2157 {
2158 name: "LYNX - Lynx",
2159 onSelect: function() {
2160 network = bitcoinjs.bitcoin.networks.lynx;
2161 setHdCoin(191);
2162 },
2163 },
2164 {
1598 name: "MAZA - Maza", 2165 name: "MAZA - Maza",
1599 segwitAvailable: false,
1600 onSelect: function() { 2166 onSelect: function() {
1601 network = bitcoinjs.bitcoin.networks.maza; 2167 network = bitcoinjs.bitcoin.networks.maza;
1602 setHdCoin(13); 2168 setHdCoin(13);
1603 }, 2169 },
1604 }, 2170 },
1605 { 2171 {
2172 name: "MEC - Megacoin",
2173 onSelect: function() {
2174 network = bitcoinjs.bitcoin.networks.megacoin;
2175 setHdCoin(217);
2176 },
2177 },
2178 {
2179 name: "MIX - MIX",
2180 segwitAvailable: false,
2181 onSelect: function() {
2182 network = bitcoinjs.bitcoin.networks.bitcoin;
2183 setHdCoin(76);
2184 },
2185 },
2186 {
2187 name: "MNX - Minexcoin",
2188 onSelect: function() {
2189 network = bitcoinjs.bitcoin.networks.minexcoin;
2190 setHdCoin(182);
2191 },
2192 },
2193 {
1606 name: "MONA - Monacoin", 2194 name: "MONA - Monacoin",
1607 segwitAvailable: true,
1608 onSelect: function() { 2195 onSelect: function() {
1609 network = bitcoinjs.bitcoin.networks.monacoin, 2196 network = bitcoinjs.bitcoin.networks.monacoin,
1610 setHdCoin(22); 2197 setHdCoin(22);
1611 }, 2198 },
1612 }, 2199 },
1613 { 2200 {
1614 name: "NMC - Namecoin", 2201 name: "MUSIC - Musicoin",
1615 segwitAvailable: false, 2202 segwitAvailable: false,
1616 onSelect: function() { 2203 onSelect: function() {
2204 network = bitcoinjs.bitcoin.networks.bitcoin;
2205 setHdCoin(184);
2206 },
2207 },
2208 {
2209 name: "NAV - Navcoin",
2210 onSelect: function() {
2211 network = bitcoinjs.bitcoin.networks.navcoin;
2212 setHdCoin(130);
2213 },
2214 },
2215 {
2216 name: "NEBL - Neblio",
2217 onSelect: function() {
2218 network = bitcoinjs.bitcoin.networks.neblio;
2219 setHdCoin(146);
2220 },
2221 },
2222 {
2223 name: "NEOS - Neoscoin",
2224 onSelect: function() {
2225 network = bitcoinjs.bitcoin.networks.neoscoin;
2226 setHdCoin(25);
2227 },
2228 },
2229 {
2230 name: "NLG - Gulden",
2231 onSelect: function() {
2232 network = bitcoinjs.bitcoin.networks.gulden;
2233 setHdCoin(87);
2234 },
2235 },
2236 {
2237 name: "NMC - Namecoin",
2238 onSelect: function() {
1617 network = bitcoinjs.bitcoin.networks.namecoin; 2239 network = bitcoinjs.bitcoin.networks.namecoin;
1618 setHdCoin(7); 2240 setHdCoin(7);
1619 }, 2241 },
1620 }, 2242 },
1621 { 2243 {
2244 name: "NRG - Energi",
2245 onSelect: function() {
2246 network = bitcoinjs.bitcoin.networks.energi;
2247 setHdCoin(204);
2248 },
2249 },
2250 {
2251 name: "NRO - Neurocoin",
2252 onSelect: function() {
2253 network = bitcoinjs.bitcoin.networks.neurocoin;
2254 setHdCoin(110);
2255 },
2256 },
2257 {
2258 name: "NSR - Nushares",
2259 onSelect: function() {
2260 network = bitcoinjs.bitcoin.networks.nushares;
2261 setHdCoin(11);
2262 },
2263 },
2264 {
2265 name: "NYC - Newyorkc",
2266 onSelect: function() {
2267 network = bitcoinjs.bitcoin.networks.newyorkc;
2268 setHdCoin(179);
2269 },
2270 },
2271 {
2272 name: "NVC - Novacoin",
2273 onSelect: function() {
2274 network = bitcoinjs.bitcoin.networks.novacoin;
2275 setHdCoin(50);
2276 },
2277 },
2278 {
2279 name: "OK - Okcash",
2280 onSelect: function() {
2281 network = bitcoinjs.bitcoin.networks.okcash;
2282 setHdCoin(69);
2283 },
2284 },
2285 {
2286 name: "OMNI - Omnicore",
2287 onSelect: function() {
2288 network = bitcoinjs.bitcoin.networks.omnicore;
2289 setHdCoin(200);
2290 },
2291 },
2292 {
1622 name: "ONX - Onixcoin", 2293 name: "ONX - Onixcoin",
1623 segwitAvailable: false,
1624 onSelect: function() { 2294 onSelect: function() {
1625 network = bitcoinjs.bitcoin.networks.onixcoin; 2295 network = bitcoinjs.bitcoin.networks.onixcoin;
1626 setHdCoin(174); 2296 setHdCoin(174);
1627 }, 2297 },
1628 }, 2298 },
2299 {
2300 name: "PHR - Phore",
2301 onSelect: function() {
2302 network = bitcoinjs.bitcoin.networks.phore;
2303 setHdCoin(444);
2304 },
2305 },
1629 { 2306 {
1630 name: "PIVX - PIVX", 2307 name: "PINK - Pinkcoin",
2308 onSelect: function() {
2309 network = bitcoinjs.bitcoin.networks.pinkcoin;
2310 setHdCoin(117);
2311 },
2312 },
2313 {
2314 name: "PIRL - Pirl",
1631 segwitAvailable: false, 2315 segwitAvailable: false,
1632 onSelect: function() { 2316 onSelect: function() {
2317 network = bitcoinjs.bitcoin.networks.bitcoin;
2318 setHdCoin(164);
2319 },
2320 },
2321 {
2322 name: "PIVX - PIVX",
2323 onSelect: function() {
1633 network = bitcoinjs.bitcoin.networks.pivx; 2324 network = bitcoinjs.bitcoin.networks.pivx;
1634 setHdCoin(119); 2325 setHdCoin(119);
1635 }, 2326 },
1636 }, 2327 },
1637 { 2328 {
1638 name: "PIVX - PIVX Testnet", 2329 name: "PIVX - PIVX Testnet",
1639 segwitAvailable: false,
1640 onSelect: function() { 2330 onSelect: function() {
1641 network = bitcoinjs.bitcoin.networks.pivxtestnet; 2331 network = bitcoinjs.bitcoin.networks.pivxtestnet;
1642 setHdCoin(1); 2332 setHdCoin(1);
1643 }, 2333 },
1644 }, 2334 },
1645 { 2335 {
1646 name: "PPC - Peercoin", 2336 name: "POA - Poa",
1647 segwitAvailable: false, 2337 segwitAvailable: false,
1648 onSelect: function() { 2338 onSelect: function() {
2339 network = bitcoinjs.bitcoin.networks.bitcoin;
2340 setHdCoin(178);
2341 },
2342 },
2343 {
2344 name: "POSW - POSWcoin",
2345 onSelect: function() {
2346 network = bitcoinjs.bitcoin.networks.poswcoin;
2347 setHdCoin(47);
2348 },
2349 },
2350 {
2351 name: "POT - Potcoin",
2352 onSelect: function() {
2353 network = bitcoinjs.bitcoin.networks.potcoin;
2354 setHdCoin(81);
2355 },
2356 },
2357 {
2358 name: "PPC - Peercoin",
2359 onSelect: function() {
1649 network = bitcoinjs.bitcoin.networks.peercoin; 2360 network = bitcoinjs.bitcoin.networks.peercoin;
1650 setHdCoin(6); 2361 setHdCoin(6);
1651 }, 2362 },
1652 }, 2363 },
2364 {
2365 name: "PRJ - ProjectCoin",
2366 onSelect: function() {
2367 network = bitcoinjs.bitcoin.networks.projectcoin;
2368 setHdCoin(533);
2369 },
2370 },
2371 {
2372 name: "PSB - Pesobit",
2373 onSelect: function() {
2374 network = bitcoinjs.bitcoin.networks.pesobit;
2375 setHdCoin(62);
2376 },
2377 },
2378 {
2379 name: "PUT - Putincoin",
2380 onSelect: function() {
2381 network = bitcoinjs.bitcoin.networks.putincoin;
2382 setHdCoin(122);
2383 },
2384 },
2385 {
2386 name: "RVN - Ravencoin",
2387 onSelect: function() {
2388 network = bitcoinjs.bitcoin.networks.ravencoin;
2389 setHdCoin(175);
2390 },
2391 },
2392 {
2393 name: "RBY - Rubycoin",
2394 onSelect: function() {
2395 network = bitcoinjs.bitcoin.networks.rubycoin;
2396 setHdCoin(16);
2397 },
2398 },
2399 {
2400 name: "RDD - Reddcoin",
2401 onSelect: function() {
2402 network = bitcoinjs.bitcoin.networks.reddcoin;
2403 setHdCoin(4);
2404 },
2405 },
2406 {
2407 name: "RVR - RevolutionVR",
2408 onSelect: function() {
2409 network = bitcoinjs.bitcoin.networks.revolutionvr;
2410 setHdCoin(129);
2411 },
2412 },
2413 {
2414 name: "SAFE - Safecoin",
2415 onSelect: function() {
2416 network = bitcoinjs.bitcoin.networks.safecoin;
2417 setHdCoin(19165);
2418 },
2419 },
2420 {
2421 name: "SLS - Salus",
2422 onSelect: function() {
2423 network = bitcoinjs.bitcoin.networks.salus;
2424 setHdCoin(63);
2425 },
2426 },
1653 { 2427 {
1654 name: "SDC - ShadowCash", 2428 name: "SDC - ShadowCash",
1655 segwitAvailable: false,
1656 onSelect: function() { 2429 onSelect: function() {
1657 network = bitcoinjs.bitcoin.networks.shadow; 2430 network = bitcoinjs.bitcoin.networks.shadow;
1658 setHdCoin(35); 2431 setHdCoin(35);
@@ -1660,7 +2433,6 @@
1660 }, 2433 },
1661 { 2434 {
1662 name: "SDC - ShadowCash Testnet", 2435 name: "SDC - ShadowCash Testnet",
1663 segwitAvailable: false,
1664 onSelect: function() { 2436 onSelect: function() {
1665 network = bitcoinjs.bitcoin.networks.shadowtn; 2437 network = bitcoinjs.bitcoin.networks.shadowtn;
1666 setHdCoin(1); 2438 setHdCoin(1);
@@ -1668,7 +2440,6 @@
1668 }, 2440 },
1669 { 2441 {
1670 name: "SLM - Slimcoin", 2442 name: "SLM - Slimcoin",
1671 segwitAvailable: false,
1672 onSelect: function() { 2443 onSelect: function() {
1673 network = bitcoinjs.bitcoin.networks.slimcoin; 2444 network = bitcoinjs.bitcoin.networks.slimcoin;
1674 setHdCoin(63); 2445 setHdCoin(63);
@@ -1676,23 +2447,104 @@
1676 }, 2447 },
1677 { 2448 {
1678 name: "SLM - Slimcoin Testnet", 2449 name: "SLM - Slimcoin Testnet",
1679 segwitAvailable: false,
1680 onSelect: function() { 2450 onSelect: function() {
1681 network = bitcoinjs.bitcoin.networks.slimcointn; 2451 network = bitcoinjs.bitcoin.networks.slimcointn;
1682 setHdCoin(111); 2452 setHdCoin(111);
1683 }, 2453 },
1684 }, 2454 },
1685 { 2455 {
2456 name: "SLR - Solarcoin",
2457 onSelect: function() {
2458 network = bitcoinjs.bitcoin.networks.solarcoin;
2459 setHdCoin(58);
2460 },
2461 },
2462 {
2463 name: "SMLY - Smileycoin",
2464 onSelect: function() {
2465 network = bitcoinjs.bitcoin.networks.smileycoin;
2466 setHdCoin(59);
2467 },
2468 },
2469 {
2470 name: "STASH - Stash",
2471 onSelect: function() {
2472 network = bitcoinjs.bitcoin.networks.stash;
2473 setHdCoin(0xC0C0);
2474 },
2475 },
2476 {
2477 name: "STASH - Stash Testnet",
2478 onSelect: function() {
2479 network = bitcoinjs.bitcoin.networks.stashtn;
2480 setHdCoin(0xCAFE);
2481 },
2482 },
2483 {
2484 name: "STRAT - Stratis",
2485 onSelect: function() {
2486 network = bitcoinjs.bitcoin.networks.stratis;
2487 setHdCoin(105);
2488 },
2489 },
2490 {
2491 name: "TSTRAT - Stratis Testnet",
2492 onSelect: function() {
2493 network = bitcoinjs.bitcoin.networks.stratistest;
2494 setHdCoin(105);
2495 },
2496 },
2497 {
2498 name: "SYS - Syscoin",
2499 onSelect: function() {
2500 network = bitcoinjs.bitcoin.networks.syscoin;
2501 setHdCoin(57);
2502 },
2503 },
2504 {
2505 name: "THC - Hempcoin",
2506 onSelect: function() {
2507 network = bitcoinjs.bitcoin.networks.hempcoin;
2508 setHdCoin(113);
2509 },
2510 },
2511 {
2512 name: "TOA - Toa",
2513 onSelect: function() {
2514 network = bitcoinjs.bitcoin.networks.toa;
2515 setHdCoin(159);
2516 },
2517 },
2518 {
2519 name: "USC - Ultimatesecurecash",
2520 onSelect: function() {
2521 network = bitcoinjs.bitcoin.networks.ultimatesecurecash;
2522 setHdCoin(112);
2523 },
2524 },
2525 {
1686 name: "USNBT - NuBits", 2526 name: "USNBT - NuBits",
1687 segwitAvailable: false,
1688 onSelect: function() { 2527 onSelect: function() {
1689 network = bitcoinjs.bitcoin.networks.nubits; 2528 network = bitcoinjs.bitcoin.networks.nubits;
1690 setHdCoin(12); 2529 setHdCoin(12);
1691 }, 2530 },
1692 }, 2531 },
1693 { 2532 {
2533 name: "UNO - Unobtanium",
2534 onSelect: function() {
2535 network = bitcoinjs.bitcoin.networks.unobtanium;
2536 setHdCoin(92);
2537 },
2538 },
2539 {
2540 name: "VASH - Vpncoin",
2541 onSelect: function() {
2542 network = bitcoinjs.bitcoin.networks.vpncoin;
2543 setHdCoin(33);
2544 },
2545 },
2546 {
1694 name: "VIA - Viacoin", 2547 name: "VIA - Viacoin",
1695 segwitAvailable: false,
1696 onSelect: function() { 2548 onSelect: function() {
1697 network = bitcoinjs.bitcoin.networks.viacoin; 2549 network = bitcoinjs.bitcoin.networks.viacoin;
1698 setHdCoin(14); 2550 setHdCoin(14);
@@ -1700,13 +2552,47 @@
1700 }, 2552 },
1701 { 2553 {
1702 name: "VIA - Viacoin Testnet", 2554 name: "VIA - Viacoin Testnet",
1703 segwitAvailable: false,
1704 onSelect: function() { 2555 onSelect: function() {
1705 network = bitcoinjs.bitcoin.networks.viacointestnet; 2556 network = bitcoinjs.bitcoin.networks.viacointestnet;
1706 setHdCoin(1); 2557 setHdCoin(1);
1707 }, 2558 },
1708 }, 2559 },
1709 { 2560 {
2561 name: "VIVO - Vivo",
2562 onSelect: function() {
2563 network = bitcoinjs.bitcoin.networks.vivo;
2564 setHdCoin(166);
2565 },
2566 },
2567 {
2568 name: "VTC - Vertcoin",
2569 onSelect: function() {
2570 network = bitcoinjs.bitcoin.networks.vertcoin;
2571 setHdCoin(28);
2572 },
2573 },
2574 {
2575 name: "WC - Wincoin",
2576 onSelect: function() {
2577 network = bitcoinjs.bitcoin.networks.wincoin;
2578 setHdCoin(181);
2579 },
2580 },
2581 {
2582 name: "XAX - Artax",
2583 onSelect: function() {
2584 network = bitcoinjs.bitcoin.networks.artax;
2585 setHdCoin(219);
2586 },
2587 },
2588 {
2589 name: "XBC - Bitcoinplus",
2590 onSelect: function() {
2591 network = bitcoinjs.bitcoin.networks.bitcoinplus;
2592 setHdCoin(65);
2593 },
2594 },
2595 {
1710 name: "XLM - Stellar", 2596 name: "XLM - Stellar",
1711 onSelect: function() { 2597 onSelect: function() {
1712 segwitAvailable: false, 2598 segwitAvailable: false,
@@ -1716,7 +2602,6 @@
1716 }, 2602 },
1717 { 2603 {
1718 name: "XMY - Myriadcoin", 2604 name: "XMY - Myriadcoin",
1719 segwitAvailable: false,
1720 onSelect: function() { 2605 onSelect: function() {
1721 network = bitcoinjs.bitcoin.networks.myriadcoin; 2606 network = bitcoinjs.bitcoin.networks.myriadcoin;
1722 setHdCoin(90); 2607 setHdCoin(90);
@@ -1724,12 +2609,68 @@
1724 }, 2609 },
1725 { 2610 {
1726 name: "XRP - Ripple", 2611 name: "XRP - Ripple",
1727 segwitAvailable: false,
1728 onSelect: function() { 2612 onSelect: function() {
1729 network = bitcoinjs.bitcoin.networks.bitcoin; 2613 network = bitcoinjs.bitcoin.networks.bitcoin;
1730 setHdCoin(144); 2614 setHdCoin(144);
1731 }, 2615 },
1732 } 2616 },
2617 {
2618 name: "XVC - Vcash",
2619 onSelect: function() {
2620 network = bitcoinjs.bitcoin.networks.vcash;
2621 setHdCoin(127);
2622 },
2623 },
2624 {
2625 name: "XVG - Verge",
2626 onSelect: function() {
2627 network = bitcoinjs.bitcoin.networks.verge;
2628 setHdCoin(77);
2629 },
2630 },
2631 {
2632 name: "XUEZ - Xuez",
2633 segwitAvailable: false,
2634 onSelect: function() {
2635 network = bitcoinjs.bitcoin.networks.xuez;
2636 setHdCoin(225);
2637 },
2638 },
2639 {
2640 name: "XWC - Whitecoin",
2641 onSelect: function() {
2642 network = bitcoinjs.bitcoin.networks.whitecoin;
2643 setHdCoin(155);
2644 },
2645 },
2646 {
2647 name: "XZC - Zcoin",
2648 onSelect: function() {
2649 network = bitcoinjs.bitcoin.networks.zcoin;
2650 setHdCoin(136);
2651 },
2652 },
2653 {
2654 name: "ZCL - Zclassic",
2655 onSelect: function() {
2656 network = bitcoinjs.bitcoin.networks.zclassic;
2657 setHdCoin(147);
2658 },
2659 },
2660 {
2661 name: "ZEC - Zcash",
2662 onSelect: function() {
2663 network = bitcoinjs.bitcoin.networks.zcash;
2664 setHdCoin(133);
2665 },
2666 },
2667 {
2668 name: "ZEN - Zencash",
2669 onSelect: function() {
2670 network = bitcoinjs.bitcoin.networks.zencash;
2671 setHdCoin(121);
2672 },
2673 },
1733 ] 2674 ]
1734 2675
1735 var clients = [ 2676 var clients = [
@@ -1753,6 +2694,13 @@
1753 DOM.bip32path.val("m/0'/0"); 2694 DOM.bip32path.val("m/0'/0");
1754 DOM.hardenedAddresses.prop('checked', false); 2695 DOM.hardenedAddresses.prop('checked', false);
1755 }, 2696 },
2697 },
2698 {
2699 name: "Coinomi, Ledger",
2700 onSelect: function() {
2701 DOM.bip32path.val("m/44'/"+DOM.bip44coin.val()+"'/0'");
2702 DOM.hardenedAddresses.prop('checked', false);
2703 },
1756 } 2704 }
1757 ] 2705 ]
1758 2706
diff --git a/src/js/jsbip39.js b/src/js/jsbip39.js
index 025f625..3230e3b 100644
--- a/src/js/jsbip39.js
+++ b/src/js/jsbip39.js
@@ -156,14 +156,7 @@ var Mnemonic = function(language) {
156 } 156 }
157 157
158 self.normalizeString = function(str) { 158 self.normalizeString = function(str) {
159 if (typeof str.normalize == "function") { 159 return str.normalize("NFKD");
160 return str.normalize("NFKD");
161 }
162 else {
163 // TODO decide how to handle this in the future.
164 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
165 return str;
166 }
167 } 160 }
168 161
169 function byteArrayToWordArray(data) { 162 function byteArrayToWordArray(data) {
diff --git a/src/js/segwit-parameters.js b/src/js/segwit-parameters.js
index 38cf9e0..8a3557e 100644
--- a/src/js/segwit-parameters.js
+++ b/src/js/segwit-parameters.js
@@ -15,6 +15,19 @@ bitcoinjs.bitcoin.networks.bitcoin.p2wpkh = {
15 wif: 0x80 15 wif: 0x80
16}; 16};
17 17
18bitcoinjs.bitcoin.networks.testnet.p2wpkh = {
19 baseNetwork: "testnet",
20 messagePrefix: '\x18Bitcoin Signed Message:\n',
21 bech32: 'tb',
22 bip32: {
23 public: 0x045f1cf6,
24 private: 0x045f18bc
25 },
26 pubKeyHash: 0x6f,
27 scriptHash: 0xc4,
28 wif: 0xef
29};
30
18// p2wpkh in p2sh 31// p2wpkh in p2sh
19 32
20bitcoinjs.bitcoin.networks.bitcoin.p2wpkhInP2sh = { 33bitcoinjs.bitcoin.networks.bitcoin.p2wpkhInP2sh = {
@@ -43,9 +56,23 @@ bitcoinjs.bitcoin.networks.testnet.p2wpkhInP2sh = {
43 wif: 0xef 56 wif: 0xef
44}; 57};
45 58
59bitcoinjs.bitcoin.networks.litecoin.p2wpkh = {
60 baseNetwork: "litecoin",
61 messagePrefix: '\x19Litecoin Signed Message:\n',
62 bech32: 'ltc',
63 bip32: {
64 public: 0x04b24746,
65 private: 0x04b2430c
66 },
67 pubKeyHash: 0x30,
68 scriptHash: 0x32,
69 wif: 0xb0
70};
71
46bitcoinjs.bitcoin.networks.litecoin.p2wpkhInP2sh = { 72bitcoinjs.bitcoin.networks.litecoin.p2wpkhInP2sh = {
47 baseNetwork: "litecoin", 73 baseNetwork: "litecoin",
48 messagePrefix: '\x19Litecoin Signed Message:\n', 74 messagePrefix: '\x19Litecoin Signed Message:\n',
75 bech32: 'ltc',
49 bip32: { 76 bip32: {
50 public: 0x01b26ef6, 77 public: 0x01b26ef6,
51 private: 0x01b26792 78 private: 0x01b26792
@@ -55,4 +82,131 @@ bitcoinjs.bitcoin.networks.litecoin.p2wpkhInP2sh = {
55 wif: 0xb0 82 wif: 0xb0
56}; 83};
57 84
85bitcoinjs.bitcoin.networks.fujicoin.p2wpkh = {
86 baseNetwork: "fujicoin",
87 messagePrefix: '\x19FujiCoin Signed Message:\n',
88 bech32: 'fc',
89 bip32: {
90 public: 0x04b24746,
91 private: 0x04b2430c
92 },
93 pubKeyHash: 0x24,
94 scriptHash: 0x10,
95 wif: 0xa4
96};
97
98bitcoinjs.bitcoin.networks.fujicoin.p2wpkhInP2sh = {
99 baseNetwork: "fujicoin",
100 messagePrefix: '\x19FujiCoin Signed Message:\n',
101 bech32: 'fc',
102 bip32: {
103 public: 0x049d7cb2,
104 private: 0x049d7878
105 },
106 pubKeyHash: 0x24,
107 scriptHash: 0x10,
108 wif: 0xa4
109};
110
111bitcoinjs.bitcoin.networks.vertcoin.p2wpkh = {
112 baseNetwork: "vertcoin",
113 messagePrefix: '\x18Vertcoin Signed Message:\n',
114 bech32: 'vtc',
115 bip32: {
116 public: 0x0488b21e,
117 private: 0x0488ade4
118 },
119 pubKeyHash: 71,
120 scriptHash: 5,
121 wif: 0x80
122};
123
124bitcoinjs.bitcoin.networks.vertcoin.p2wpkhInP2sh = {
125 baseNetwork: "vertcoin",
126 messagePrefix: '\x18Vertcoin Signed Message:\n',
127 bip32: {
128 public: 0x0488b21e,
129 private: 0x0488ade4
130 },
131 pubKeyHash: 71,
132 scriptHash: 5,
133 wif: 0x80
134};
135
136bitcoinjs.bitcoin.networks.bgold.p2wpkh = {
137 baseNetwork: "bgold",
138 messagePrefix: '\x1DBitcoin Gold Signed Message:\n',
139 bech32: 'btg',
140 bip32: {
141 public: 0x04b24746,
142 private: 0x04b2430c
143 },
144 pubKeyHash: 0x26,
145 scriptHash: 0x17,
146 wif: 0x80,
147};
148
149bitcoinjs.bitcoin.networks.bgold.p2wpkhInP2sh = {
150 baseNetwork: "bgold",
151 messagePrefix: '\x1DBitcoin Gold Signed Message:\n',
152 bech32: 'btg',
153 bip32: {
154 public: 0x049d7cb2,
155 private: 0x049d7878
156 },
157 pubKeyHash: 0x26,
158 scriptHash: 0x17,
159 wif: 0x80,
160};
161
162bitcoinjs.bitcoin.networks.digibyte.p2wpkh = {
163 baseNetwork: "digibyte",
164 messagePrefix: '\x18DigiByte Signed Message:\n',
165 bech32: 'dgb',
166 bip32: {
167 public: 0x0488B21E,
168 private: 0x0488ADE4
169 },
170 pubKeyHash: 0x1e,
171 scriptHash: 0x3f,
172 wif: 0x80
173};
174
175bitcoinjs.bitcoin.networks.digibyte.p2wpkhInP2sh = {
176 baseNetwork: "digibyte",
177 messagePrefix: '\x18DigiByte Signed Message:\n',
178 bech32: 'dgb',
179 bip32: {
180 public: 0x0488B21E,
181 private: 0x0488ADE4
182 },
183 pubKeyHash: 0x1e,
184 scriptHash: 0x3f,
185 wif: 0x80
186};
187 bitcoinjs.bitcoin.networks.deimos.p2wpkh = {
188 baseNetwork: "deimos",
189 messagePrefix: '\x18Deimos Signed Message:\n',
190 bech32: 'dei',
191 bip32: {
192 public: 0x0488B21E,
193 private: 0x0488ADE4
194 },
195 pubKeyHash: 0x1f,
196 scriptHash: 0x21,
197 wif: 0x8a
198};
199
200bitcoinjs.bitcoin.networks.deimos.p2wpkhInP2sh = {
201 baseNetwork: "deimos",
202 messagePrefix: '\x18Deimos Signed Message:\n',
203 bech32: 'dei',
204 bip32: {
205 public: 0x0488B21E,
206 private: 0x0488ADE4
207 },
208 pubKeyHash: 0x1f,
209 scriptHash: 0x21,
210 wif: 0x8a
211};
58})(); 212})();
diff --git a/src/js/unorm.js b/src/js/unorm.js
index 92d3699..d4292f3 100644
--- a/src/js/unorm.js
+++ b/src/js/unorm.js
@@ -1,3 +1,6 @@
1// Polyfill for NFKD normalization
2// See https://github.com/walling/unorm
3
1(function (root) { 4(function (root) {
2 "use strict"; 5 "use strict";
3 6
diff --git a/src/js/wordlist_korean.js b/src/js/wordlist_korean.js
new file mode 100644
index 0000000..8994c09
--- /dev/null
+++ b/src/js/wordlist_korean.js
@@ -0,0 +1,2051 @@
1WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
2WORDLISTS["korean"] = [
3 "가격",
4 "가끔",
5 "가난",
6 "가능",
7 "가득",
8 "가르침",
9 "가뭄",
10 "가방",
11 "가상",
12 "가슴",
13 "가운데",
14 "가을",
15 "가이드",
16 "가입",
17 "가장",
18 "가정",
19 "가족",
20 "가죽",
21 "각오",
22 "각자",
23 "간격",
24 "간부",
25 "간섭",
26 "간장",
27 "간접",
28 "간판",
29 "갈등",
30 "갈비",
31 "갈색",
32 "갈증",
33 "감각",
34 "감기",
35 "감소",
36 "감수성",
37 "감자",
38 "감정",
39 "갑자기",
40 "강남",
41 "강당",
42 "강도",
43 "강력히",
44 "강변",
45 "강북",
46 "강사",
47 "강수량",
48 "강아지",
49 "강원도",
50 "강의",
51 "강제",
52 "강조",
53 "같이",
54 "개구리",
55 "개나리",
56 "개방",
57 "개별",
58 "개선",
59 "개성",
60 "개인",
61 "객관적",
62 "거실",
63 "거액",
64 "거울",
65 "거짓",
66 "거품",
67 "걱정",
68 "건강",
69 "건물",
70 "건설",
71 "건조",
72 "건축",
73 "걸음",
74 "검사",
75 "검토",
76 "게시판",
77 "게임",
78 "겨울",
79 "견해",
80 "결과",
81 "결국",
82 "결론",
83 "결석",
84 "결승",
85 "결심",
86 "결정",
87 "결혼",
88 "경계",
89 "경고",
90 "경기",
91 "경력",
92 "경복궁",
93 "경비",
94 "경상도",
95 "경영",
96 "경우",
97 "경쟁",
98 "경제",
99 "경주",
100 "경찰",
101 "경치",
102 "경향",
103 "경험",
104 "계곡",
105 "계단",
106 "계란",
107 "계산",
108 "계속",
109 "계약",
110 "계절",
111 "계층",
112 "계획",
113 "고객",
114 "고구려",
115 "고궁",
116 "고급",
117 "고등학생",
118 "고무신",
119 "고민",
120 "고양이",
121 "고장",
122 "고전",
123 "고집",
124 "고춧가루",
125 "고통",
126 "고향",
127 "곡식",
128 "골목",
129 "골짜기",
130 "골프",
131 "공간",
132 "공개",
133 "공격",
134 "공군",
135 "공급",
136 "공기",
137 "공동",
138 "공무원",
139 "공부",
140 "공사",
141 "공식",
142 "공업",
143 "공연",
144 "공원",
145 "공장",
146 "공짜",
147 "공책",
148 "공통",
149 "공포",
150 "공항",
151 "공휴일",
152 "과목",
153 "과일",
154 "과장",
155 "과정",
156 "과학",
157 "관객",
158 "관계",
159 "관광",
160 "관념",
161 "관람",
162 "관련",
163 "관리",
164 "관습",
165 "관심",
166 "관점",
167 "관찰",
168 "광경",
169 "광고",
170 "광장",
171 "광주",
172 "괴로움",
173 "굉장히",
174 "교과서",
175 "교문",
176 "교복",
177 "교실",
178 "교양",
179 "교육",
180 "교장",
181 "교직",
182 "교통",
183 "교환",
184 "교훈",
185 "구경",
186 "구름",
187 "구멍",
188 "구별",
189 "구분",
190 "구석",
191 "구성",
192 "구속",
193 "구역",
194 "구입",
195 "구청",
196 "구체적",
197 "국가",
198 "국기",
199 "국내",
200 "국립",
201 "국물",
202 "국민",
203 "국수",
204 "국어",
205 "국왕",
206 "국적",
207 "국제",
208 "국회",
209 "군대",
210 "군사",
211 "군인",
212 "궁극적",
213 "권리",
214 "권위",
215 "권투",
216 "귀국",
217 "귀신",
218 "규정",
219 "규칙",
220 "균형",
221 "그날",
222 "그냥",
223 "그늘",
224 "그러나",
225 "그룹",
226 "그릇",
227 "그림",
228 "그제서야",
229 "그토록",
230 "극복",
231 "극히",
232 "근거",
233 "근교",
234 "근래",
235 "근로",
236 "근무",
237 "근본",
238 "근원",
239 "근육",
240 "근처",
241 "글씨",
242 "글자",
243 "금강산",
244 "금고",
245 "금년",
246 "금메달",
247 "금액",
248 "금연",
249 "금요일",
250 "금지",
251 "긍정적",
252 "기간",
253 "기관",
254 "기념",
255 "기능",
256 "기독교",
257 "기둥",
258 "기록",
259 "기름",
260 "기법",
261 "기본",
262 "기분",
263 "기쁨",
264 "기숙사",
265 "기술",
266 "기억",
267 "기업",
268 "기온",
269 "기운",
270 "기원",
271 "기적",
272 "기준",
273 "기침",
274 "기혼",
275 "기획",
276 "긴급",
277 "긴장",
278 "길이",
279 "김밥",
280 "김치",
281 "김포공항",
282 "깍두기",
283 "깜빡",
284 "깨달음",
285 "깨소금",
286 "껍질",
287 "꼭대기",
288 "꽃잎",
289 "나들이",
290 "나란히",
291 "나머지",
292 "나물",
293 "나침반",
294 "나흘",
295 "낙엽",
296 "난방",
297 "날개",
298 "날씨",
299 "날짜",
300 "남녀",
301 "남대문",
302 "남매",
303 "남산",
304 "남자",
305 "남편",
306 "남학생",
307 "낭비",
308 "낱말",
309 "내년",
310 "내용",
311 "내일",
312 "냄비",
313 "냄새",
314 "냇물",
315 "냉동",
316 "냉면",
317 "냉방",
318 "냉장고",
319 "넥타이",
320 "넷째",
321 "노동",
322 "노란색",
323 "노력",
324 "노인",
325 "녹음",
326 "녹차",
327 "녹화",
328 "논리",
329 "논문",
330 "논쟁",
331 "놀이",
332 "농구",
333 "농담",
334 "농민",
335 "농부",
336 "농업",
337 "농장",
338 "농촌",
339 "높이",
340 "눈동자",
341 "눈물",
342 "눈썹",
343 "뉴욕",
344 "느낌",
345 "늑대",
346 "능동적",
347 "능력",
348 "다방",
349 "다양성",
350 "다음",
351 "다이어트",
352 "다행",
353 "단계",
354 "단골",
355 "단독",
356 "단맛",
357 "단순",
358 "단어",
359 "단위",
360 "단점",
361 "단체",
362 "단추",
363 "단편",
364 "단풍",
365 "달걀",
366 "달러",
367 "달력",
368 "달리",
369 "닭고기",
370 "담당",
371 "담배",
372 "담요",
373 "담임",
374 "답변",
375 "답장",
376 "당근",
377 "당분간",
378 "당연히",
379 "당장",
380 "대규모",
381 "대낮",
382 "대단히",
383 "대답",
384 "대도시",
385 "대략",
386 "대량",
387 "대륙",
388 "대문",
389 "대부분",
390 "대신",
391 "대응",
392 "대장",
393 "대전",
394 "대접",
395 "대중",
396 "대책",
397 "대출",
398 "대충",
399 "대통령",
400 "대학",
401 "대한민국",
402 "대합실",
403 "대형",
404 "덩어리",
405 "데이트",
406 "도대체",
407 "도덕",
408 "도둑",
409 "도망",
410 "도서관",
411 "도심",
412 "도움",
413 "도입",
414 "도자기",
415 "도저히",
416 "도전",
417 "도중",
418 "도착",
419 "독감",
420 "독립",
421 "독서",
422 "독일",
423 "독창적",
424 "동화책",
425 "뒷모습",
426 "뒷산",
427 "딸아이",
428 "마누라",
429 "마늘",
430 "마당",
431 "마라톤",
432 "마련",
433 "마무리",
434 "마사지",
435 "마약",
436 "마요네즈",
437 "마을",
438 "마음",
439 "마이크",
440 "마중",
441 "마지막",
442 "마찬가지",
443 "마찰",
444 "마흔",
445 "막걸리",
446 "막내",
447 "막상",
448 "만남",
449 "만두",
450 "만세",
451 "만약",
452 "만일",
453 "만점",
454 "만족",
455 "만화",
456 "많이",
457 "말기",
458 "말씀",
459 "말투",
460 "맘대로",
461 "망원경",
462 "매년",
463 "매달",
464 "매력",
465 "매번",
466 "매스컴",
467 "매일",
468 "매장",
469 "맥주",
470 "먹이",
471 "먼저",
472 "먼지",
473 "멀리",
474 "메일",
475 "며느리",
476 "며칠",
477 "면담",
478 "멸치",
479 "명단",
480 "명령",
481 "명예",
482 "명의",
483 "명절",
484 "명칭",
485 "명함",
486 "모금",
487 "모니터",
488 "모델",
489 "모든",
490 "모범",
491 "모습",
492 "모양",
493 "모임",
494 "모조리",
495 "모집",
496 "모퉁이",
497 "목걸이",
498 "목록",
499 "목사",
500 "목소리",
501 "목숨",
502 "목적",
503 "목표",
504 "몰래",
505 "몸매",
506 "몸무게",
507 "몸살",
508 "몸속",
509 "몸짓",
510 "몸통",
511 "몹시",
512 "무관심",
513 "무궁화",
514 "무더위",
515 "무덤",
516 "무릎",
517 "무슨",
518 "무엇",
519 "무역",
520 "무용",
521 "무조건",
522 "무지개",
523 "무척",
524 "문구",
525 "문득",
526 "문법",
527 "문서",
528 "문제",
529 "문학",
530 "문화",
531 "물가",
532 "물건",
533 "물결",
534 "물고기",
535 "물론",
536 "물리학",
537 "물음",
538 "물질",
539 "물체",
540 "미국",
541 "미디어",
542 "미사일",
543 "미술",
544 "미역",
545 "미용실",
546 "미움",
547 "미인",
548 "미팅",
549 "미혼",
550 "민간",
551 "민족",
552 "민주",
553 "믿음",
554 "밀가루",
555 "밀리미터",
556 "밑바닥",
557 "바가지",
558 "바구니",
559 "바나나",
560 "바늘",
561 "바닥",
562 "바닷가",
563 "바람",
564 "바이러스",
565 "바탕",
566 "박물관",
567 "박사",
568 "박수",
569 "반대",
570 "반드시",
571 "반말",
572 "반발",
573 "반성",
574 "반응",
575 "반장",
576 "반죽",
577 "반지",
578 "반찬",
579 "받침",
580 "발가락",
581 "발걸음",
582 "발견",
583 "발달",
584 "발레",
585 "발목",
586 "발바닥",
587 "발생",
588 "발음",
589 "발자국",
590 "발전",
591 "발톱",
592 "발표",
593 "밤하늘",
594 "밥그릇",
595 "밥맛",
596 "밥상",
597 "밥솥",
598 "방금",
599 "방면",
600 "방문",
601 "방바닥",
602 "방법",
603 "방송",
604 "방식",
605 "방안",
606 "방울",
607 "방지",
608 "방학",
609 "방해",
610 "방향",
611 "배경",
612 "배꼽",
613 "배달",
614 "배드민턴",
615 "백두산",
616 "백색",
617 "백성",
618 "백인",
619 "백제",
620 "백화점",
621 "버릇",
622 "버섯",
623 "버튼",
624 "번개",
625 "번역",
626 "번지",
627 "번호",
628 "벌금",
629 "벌레",
630 "벌써",
631 "범위",
632 "범인",
633 "범죄",
634 "법률",
635 "법원",
636 "법적",
637 "법칙",
638 "베이징",
639 "벨트",
640 "변경",
641 "변동",
642 "변명",
643 "변신",
644 "변호사",
645 "변화",
646 "별도",
647 "별명",
648 "별일",
649 "병실",
650 "병아리",
651 "병원",
652 "보관",
653 "보너스",
654 "보라색",
655 "보람",
656 "보름",
657 "보상",
658 "보안",
659 "보자기",
660 "보장",
661 "보전",
662 "보존",
663 "보통",
664 "보편적",
665 "보험",
666 "복도",
667 "복사",
668 "복숭아",
669 "복습",
670 "볶음",
671 "본격적",
672 "본래",
673 "본부",
674 "본사",
675 "본성",
676 "본인",
677 "본질",
678 "볼펜",
679 "봉사",
680 "봉지",
681 "봉투",
682 "부근",
683 "부끄러움",
684 "부담",
685 "부동산",
686 "부문",
687 "부분",
688 "부산",
689 "부상",
690 "부엌",
691 "부인",
692 "부작용",
693 "부장",
694 "부정",
695 "부족",
696 "부지런히",
697 "부친",
698 "부탁",
699 "부품",
700 "부회장",
701 "북부",
702 "북한",
703 "분노",
704 "분량",
705 "분리",
706 "분명",
707 "분석",
708 "분야",
709 "분위기",
710 "분필",
711 "분홍색",
712 "불고기",
713 "불과",
714 "불교",
715 "불꽃",
716 "불만",
717 "불법",
718 "불빛",
719 "불안",
720 "불이익",
721 "불행",
722 "브랜드",
723 "비극",
724 "비난",
725 "비닐",
726 "비둘기",
727 "비디오",
728 "비로소",
729 "비만",
730 "비명",
731 "비밀",
732 "비바람",
733 "비빔밥",
734 "비상",
735 "비용",
736 "비율",
737 "비중",
738 "비타민",
739 "비판",
740 "빌딩",
741 "빗물",
742 "빗방울",
743 "빗줄기",
744 "빛깔",
745 "빨간색",
746 "빨래",
747 "빨리",
748 "사건",
749 "사계절",
750 "사나이",
751 "사냥",
752 "사람",
753 "사랑",
754 "사립",
755 "사모님",
756 "사물",
757 "사방",
758 "사상",
759 "사생활",
760 "사설",
761 "사슴",
762 "사실",
763 "사업",
764 "사용",
765 "사월",
766 "사장",
767 "사전",
768 "사진",
769 "사촌",
770 "사춘기",
771 "사탕",
772 "사투리",
773 "사흘",
774 "산길",
775 "산부인과",
776 "산업",
777 "산책",
778 "살림",
779 "살인",
780 "살짝",
781 "삼계탕",
782 "삼국",
783 "삼십",
784 "삼월",
785 "삼촌",
786 "상관",
787 "상금",
788 "상대",
789 "상류",
790 "상반기",
791 "상상",
792 "상식",
793 "상업",
794 "상인",
795 "상자",
796 "상점",
797 "상처",
798 "상추",
799 "상태",
800 "상표",
801 "상품",
802 "상황",
803 "새벽",
804 "색깔",
805 "색연필",
806 "생각",
807 "생명",
808 "생물",
809 "생방송",
810 "생산",
811 "생선",
812 "생신",
813 "생일",
814 "생활",
815 "서랍",
816 "서른",
817 "서명",
818 "서민",
819 "서비스",
820 "서양",
821 "서울",
822 "서적",
823 "서점",
824 "서쪽",
825 "서클",
826 "석사",
827 "석유",
828 "선거",
829 "선물",
830 "선배",
831 "선생",
832 "선수",
833 "선원",
834 "선장",
835 "선전",
836 "선택",
837 "선풍기",
838 "설거지",
839 "설날",
840 "설렁탕",
841 "설명",
842 "설문",
843 "설사",
844 "설악산",
845 "설치",
846 "설탕",
847 "섭씨",
848 "성공",
849 "성당",
850 "성명",
851 "성별",
852 "성인",
853 "성장",
854 "성적",
855 "성질",
856 "성함",
857 "세금",
858 "세미나",
859 "세상",
860 "세월",
861 "세종대왕",
862 "세탁",
863 "센터",
864 "센티미터",
865 "셋째",
866 "소규모",
867 "소극적",
868 "소금",
869 "소나기",
870 "소년",
871 "소득",
872 "소망",
873 "소문",
874 "소설",
875 "소속",
876 "소아과",
877 "소용",
878 "소원",
879 "소음",
880 "소중히",
881 "소지품",
882 "소질",
883 "소풍",
884 "소형",
885 "속담",
886 "속도",
887 "속옷",
888 "손가락",
889 "손길",
890 "손녀",
891 "손님",
892 "손등",
893 "손목",
894 "손뼉",
895 "손실",
896 "손질",
897 "손톱",
898 "손해",
899 "솔직히",
900 "솜씨",
901 "송아지",
902 "송이",
903 "송편",
904 "쇠고기",
905 "쇼핑",
906 "수건",
907 "수년",
908 "수단",
909 "수돗물",
910 "수동적",
911 "수면",
912 "수명",
913 "수박",
914 "수상",
915 "수석",
916 "수술",
917 "수시로",
918 "수업",
919 "수염",
920 "수영",
921 "수입",
922 "수준",
923 "수집",
924 "수출",
925 "수컷",
926 "수필",
927 "수학",
928 "수험생",
929 "수화기",
930 "숙녀",
931 "숙소",
932 "숙제",
933 "순간",
934 "순서",
935 "순수",
936 "순식간",
937 "순위",
938 "숟가락",
939 "술병",
940 "술집",
941 "숫자",
942 "스님",
943 "스물",
944 "스스로",
945 "스승",
946 "스웨터",
947 "스위치",
948 "스케이트",
949 "스튜디오",
950 "스트레스",
951 "스포츠",
952 "슬쩍",
953 "슬픔",
954 "습관",
955 "습기",
956 "승객",
957 "승리",
958 "승부",
959 "승용차",
960 "승진",
961 "시각",
962 "시간",
963 "시골",
964 "시금치",
965 "시나리오",
966 "시댁",
967 "시리즈",
968 "시멘트",
969 "시민",
970 "시부모",
971 "시선",
972 "시설",
973 "시스템",
974 "시아버지",
975 "시어머니",
976 "시월",
977 "시인",
978 "시일",
979 "시작",
980 "시장",
981 "시절",
982 "시점",
983 "시중",
984 "시즌",
985 "시집",
986 "시청",
987 "시합",
988 "시험",
989 "식구",
990 "식기",
991 "식당",
992 "식량",
993 "식료품",
994 "식물",
995 "식빵",
996 "식사",
997 "식생활",
998 "식초",
999 "식탁",
1000 "식품",
1001 "신고",
1002 "신규",
1003 "신념",
1004 "신문",
1005 "신발",
1006 "신비",
1007 "신사",
1008 "신세",
1009 "신용",
1010 "신제품",
1011 "신청",
1012 "신체",
1013 "신화",
1014 "실감",
1015 "실내",
1016 "실력",
1017 "실례",
1018 "실망",
1019 "실수",
1020 "실습",
1021 "실시",
1022 "실장",
1023 "실정",
1024 "실질적",
1025 "실천",
1026 "실체",
1027 "실컷",
1028 "실태",
1029 "실패",
1030 "실험",
1031 "실현",
1032 "심리",
1033 "심부름",
1034 "심사",
1035 "심장",
1036 "심정",
1037 "심판",
1038 "쌍둥이",
1039 "씨름",
1040 "씨앗",
1041 "아가씨",
1042 "아나운서",
1043 "아드님",
1044 "아들",
1045 "아쉬움",
1046 "아스팔트",
1047 "아시아",
1048 "아울러",
1049 "아저씨",
1050 "아줌마",
1051 "아직",
1052 "아침",
1053 "아파트",
1054 "아프리카",
1055 "아픔",
1056 "아홉",
1057 "아흔",
1058 "악기",
1059 "악몽",
1060 "악수",
1061 "안개",
1062 "안경",
1063 "안과",
1064 "안내",
1065 "안녕",
1066 "안동",
1067 "안방",
1068 "안부",
1069 "안주",
1070 "알루미늄",
1071 "알코올",
1072 "암시",
1073 "암컷",
1074 "압력",
1075 "앞날",
1076 "앞문",
1077 "애인",
1078 "애정",
1079 "액수",
1080 "앨범",
1081 "야간",
1082 "야단",
1083 "야옹",
1084 "약간",
1085 "약국",
1086 "약속",
1087 "약수",
1088 "약점",
1089 "약품",
1090 "약혼녀",
1091 "양념",
1092 "양력",
1093 "양말",
1094 "양배추",
1095 "양주",
1096 "양파",
1097 "어둠",
1098 "어려움",
1099 "어른",
1100 "어젯밤",
1101 "어쨌든",
1102 "어쩌다가",
1103 "어쩐지",
1104 "언니",
1105 "언덕",
1106 "언론",
1107 "언어",
1108 "얼굴",
1109 "얼른",
1110 "얼음",
1111 "얼핏",
1112 "엄마",
1113 "업무",
1114 "업종",
1115 "업체",
1116 "엉덩이",
1117 "엉망",
1118 "엉터리",
1119 "엊그제",
1120 "에너지",
1121 "에어컨",
1122 "엔진",
1123 "여건",
1124 "여고생",
1125 "여관",
1126 "여군",
1127 "여권",
1128 "여대생",
1129 "여덟",
1130 "여동생",
1131 "여든",
1132 "여론",
1133 "여름",
1134 "여섯",
1135 "여성",
1136 "여왕",
1137 "여인",
1138 "여전히",
1139 "여직원",
1140 "여학생",
1141 "여행",
1142 "역사",
1143 "역시",
1144 "역할",
1145 "연결",
1146 "연구",
1147 "연극",
1148 "연기",
1149 "연락",
1150 "연설",
1151 "연세",
1152 "연속",
1153 "연습",
1154 "연애",
1155 "연예인",
1156 "연인",
1157 "연장",
1158 "연주",
1159 "연출",
1160 "연필",
1161 "연합",
1162 "연휴",
1163 "열기",
1164 "열매",
1165 "열쇠",
1166 "열심히",
1167 "열정",
1168 "열차",
1169 "열흘",
1170 "염려",
1171 "엽서",
1172 "영국",
1173 "영남",
1174 "영상",
1175 "영양",
1176 "영역",
1177 "영웅",
1178 "영원히",
1179 "영하",
1180 "영향",
1181 "영혼",
1182 "영화",
1183 "옆구리",
1184 "옆방",
1185 "옆집",
1186 "예감",
1187 "예금",
1188 "예방",
1189 "예산",
1190 "예상",
1191 "예선",
1192 "예술",
1193 "예습",
1194 "예식장",
1195 "예약",
1196 "예전",
1197 "예절",
1198 "예정",
1199 "예컨대",
1200 "옛날",
1201 "오늘",
1202 "오락",
1203 "오랫동안",
1204 "오렌지",
1205 "오로지",
1206 "오른발",
1207 "오븐",
1208 "오십",
1209 "오염",
1210 "오월",
1211 "오전",
1212 "오직",
1213 "오징어",
1214 "오페라",
1215 "오피스텔",
1216 "오히려",
1217 "옥상",
1218 "옥수수",
1219 "온갖",
1220 "온라인",
1221 "온몸",
1222 "온종일",
1223 "온통",
1224 "올가을",
1225 "올림픽",
1226 "올해",
1227 "옷차림",
1228 "와이셔츠",
1229 "와인",
1230 "완성",
1231 "완전",
1232 "왕비",
1233 "왕자",
1234 "왜냐하면",
1235 "왠지",
1236 "외갓집",
1237 "외국",
1238 "외로움",
1239 "외삼촌",
1240 "외출",
1241 "외침",
1242 "외할머니",
1243 "왼발",
1244 "왼손",
1245 "왼쪽",
1246 "요금",
1247 "요일",
1248 "요즘",
1249 "요청",
1250 "용기",
1251 "용서",
1252 "용어",
1253 "우산",
1254 "우선",
1255 "우승",
1256 "우연히",
1257 "우정",
1258 "우체국",
1259 "우편",
1260 "운동",
1261 "운명",
1262 "운반",
1263 "운전",
1264 "운행",
1265 "울산",
1266 "울음",
1267 "움직임",
1268 "웃어른",
1269 "웃음",
1270 "워낙",
1271 "원고",
1272 "원래",
1273 "원서",
1274 "원숭이",
1275 "원인",
1276 "원장",
1277 "원피스",
1278 "월급",
1279 "월드컵",
1280 "월세",
1281 "월요일",
1282 "웨이터",
1283 "위반",
1284 "위법",
1285 "위성",
1286 "위원",
1287 "위험",
1288 "위협",
1289 "윗사람",
1290 "유난히",
1291 "유럽",
1292 "유명",
1293 "유물",
1294 "유산",
1295 "유적",
1296 "유치원",
1297 "유학",
1298 "유행",
1299 "유형",
1300 "육군",
1301 "육상",
1302 "육십",
1303 "육체",
1304 "은행",
1305 "음력",
1306 "음료",
1307 "음반",
1308 "음성",
1309 "음식",
1310 "음악",
1311 "음주",
1312 "의견",
1313 "의논",
1314 "의문",
1315 "의복",
1316 "의식",
1317 "의심",
1318 "의외로",
1319 "의욕",
1320 "의원",
1321 "의학",
1322 "이것",
1323 "이곳",
1324 "이념",
1325 "이놈",
1326 "이달",
1327 "이대로",
1328 "이동",
1329 "이렇게",
1330 "이력서",
1331 "이론적",
1332 "이름",
1333 "이민",
1334 "이발소",
1335 "이별",
1336 "이불",
1337 "이빨",
1338 "이상",
1339 "이성",
1340 "이슬",
1341 "이야기",
1342 "이용",
1343 "이웃",
1344 "이월",
1345 "이윽고",
1346 "이익",
1347 "이전",
1348 "이중",
1349 "이튿날",
1350 "이틀",
1351 "이혼",
1352 "인간",
1353 "인격",
1354 "인공",
1355 "인구",
1356 "인근",
1357 "인기",
1358 "인도",
1359 "인류",
1360 "인물",
1361 "인생",
1362 "인쇄",
1363 "인연",
1364 "인원",
1365 "인재",
1366 "인종",
1367 "인천",
1368 "인체",
1369 "인터넷",
1370 "인하",
1371 "인형",
1372 "일곱",
1373 "일기",
1374 "일단",
1375 "일대",
1376 "일등",
1377 "일반",
1378 "일본",
1379 "일부",
1380 "일상",
1381 "일생",
1382 "일손",
1383 "일요일",
1384 "일월",
1385 "일정",
1386 "일종",
1387 "일주일",
1388 "일찍",
1389 "일체",
1390 "일치",
1391 "일행",
1392 "일회용",
1393 "임금",
1394 "임무",
1395 "입대",
1396 "입력",
1397 "입맛",
1398 "입사",
1399 "입술",
1400 "입시",
1401 "입원",
1402 "입장",
1403 "입학",
1404 "자가용",
1405 "자격",
1406 "자극",
1407 "자동",
1408 "자랑",
1409 "자부심",
1410 "자식",
1411 "자신",
1412 "자연",
1413 "자원",
1414 "자율",
1415 "자전거",
1416 "자정",
1417 "자존심",
1418 "자판",
1419 "작가",
1420 "작년",
1421 "작성",
1422 "작업",
1423 "작용",
1424 "작은딸",
1425 "작품",
1426 "잔디",
1427 "잔뜩",
1428 "잔치",
1429 "잘못",
1430 "잠깐",
1431 "잠수함",
1432 "잠시",
1433 "잠옷",
1434 "잠자리",
1435 "잡지",
1436 "장관",
1437 "장군",
1438 "장기간",
1439 "장래",
1440 "장례",
1441 "장르",
1442 "장마",
1443 "장면",
1444 "장모",
1445 "장미",
1446 "장비",
1447 "장사",
1448 "장소",
1449 "장식",
1450 "장애인",
1451 "장인",
1452 "장점",
1453 "장차",
1454 "장학금",
1455 "재능",
1456 "재빨리",
1457 "재산",
1458 "재생",
1459 "재작년",
1460 "재정",
1461 "재채기",
1462 "재판",
1463 "재학",
1464 "재활용",
1465 "저것",
1466 "저고리",
1467 "저곳",
1468 "저녁",
1469 "저런",
1470 "저렇게",
1471 "저번",
1472 "저울",
1473 "저절로",
1474 "저축",
1475 "적극",
1476 "적당히",
1477 "적성",
1478 "적용",
1479 "적응",
1480 "전개",
1481 "전공",
1482 "전기",
1483 "전달",
1484 "전라도",
1485 "전망",
1486 "전문",
1487 "전반",
1488 "전부",
1489 "전세",
1490 "전시",
1491 "전용",
1492 "전자",
1493 "전쟁",
1494 "전주",
1495 "전철",
1496 "전체",
1497 "전통",
1498 "전혀",
1499 "전후",
1500 "절대",
1501 "절망",
1502 "절반",
1503 "절약",
1504 "절차",
1505 "점검",
1506 "점수",
1507 "점심",
1508 "점원",
1509 "점점",
1510 "점차",
1511 "접근",
1512 "접시",
1513 "접촉",
1514 "젓가락",
1515 "정거장",
1516 "정도",
1517 "정류장",
1518 "정리",
1519 "정말",
1520 "정면",
1521 "정문",
1522 "정반대",
1523 "정보",
1524 "정부",
1525 "정비",
1526 "정상",
1527 "정성",
1528 "정오",
1529 "정원",
1530 "정장",
1531 "정지",
1532 "정치",
1533 "정확히",
1534 "제공",
1535 "제과점",
1536 "제대로",
1537 "제목",
1538 "제발",
1539 "제법",
1540 "제삿날",
1541 "제안",
1542 "제일",
1543 "제작",
1544 "제주도",
1545 "제출",
1546 "제품",
1547 "제한",
1548 "조각",
1549 "조건",
1550 "조금",
1551 "조깅",
1552 "조명",
1553 "조미료",
1554 "조상",
1555 "조선",
1556 "조용히",
1557 "조절",
1558 "조정",
1559 "조직",
1560 "존댓말",
1561 "존재",
1562 "졸업",
1563 "졸음",
1564 "종교",
1565 "종로",
1566 "종류",
1567 "종소리",
1568 "종업원",
1569 "종종",
1570 "종합",
1571 "좌석",
1572 "죄인",
1573 "주관적",
1574 "주름",
1575 "주말",
1576 "주머니",
1577 "주먹",
1578 "주문",
1579 "주민",
1580 "주방",
1581 "주변",
1582 "주식",
1583 "주인",
1584 "주일",
1585 "주장",
1586 "주전자",
1587 "주택",
1588 "준비",
1589 "줄거리",
1590 "줄기",
1591 "줄무늬",
1592 "중간",
1593 "중계방송",
1594 "중국",
1595 "중년",
1596 "중단",
1597 "중독",
1598 "중반",
1599 "중부",
1600 "중세",
1601 "중소기업",
1602 "중순",
1603 "중앙",
1604 "중요",
1605 "중학교",
1606 "즉석",
1607 "즉시",
1608 "즐거움",
1609 "증가",
1610 "증거",
1611 "증권",
1612 "증상",
1613 "증세",
1614 "지각",
1615 "지갑",
1616 "지경",
1617 "지극히",
1618 "지금",
1619 "지급",
1620 "지능",
1621 "지름길",
1622 "지리산",
1623 "지방",
1624 "지붕",
1625 "지식",
1626 "지역",
1627 "지우개",
1628 "지원",
1629 "지적",
1630 "지점",
1631 "지진",
1632 "지출",
1633 "직선",
1634 "직업",
1635 "직원",
1636 "직장",
1637 "진급",
1638 "진동",
1639 "진로",
1640 "진료",
1641 "진리",
1642 "진짜",
1643 "진찰",
1644 "진출",
1645 "진통",
1646 "진행",
1647 "질문",
1648 "질병",
1649 "질서",
1650 "짐작",
1651 "집단",
1652 "집안",
1653 "집중",
1654 "짜증",
1655 "찌꺼기",
1656 "차남",
1657 "차라리",
1658 "차량",
1659 "차림",
1660 "차별",
1661 "차선",
1662 "차츰",
1663 "착각",
1664 "찬물",
1665 "찬성",
1666 "참가",
1667 "참기름",
1668 "참새",
1669 "참석",
1670 "참여",
1671 "참외",
1672 "참조",
1673 "찻잔",
1674 "창가",
1675 "창고",
1676 "창구",
1677 "창문",
1678 "창밖",
1679 "창작",
1680 "창조",
1681 "채널",
1682 "채점",
1683 "책가방",
1684 "책방",
1685 "책상",
1686 "책임",
1687 "챔피언",
1688 "처벌",
1689 "처음",
1690 "천국",
1691 "천둥",
1692 "천장",
1693 "천재",
1694 "천천히",
1695 "철도",
1696 "철저히",
1697 "철학",
1698 "첫날",
1699 "첫째",
1700 "청년",
1701 "청바지",
1702 "청소",
1703 "청춘",
1704 "체계",
1705 "체력",
1706 "체온",
1707 "체육",
1708 "체중",
1709 "체험",
1710 "초등학생",
1711 "초반",
1712 "초밥",
1713 "초상화",
1714 "초순",
1715 "초여름",
1716 "초원",
1717 "초저녁",
1718 "초점",
1719 "초청",
1720 "초콜릿",
1721 "촛불",
1722 "총각",
1723 "총리",
1724 "총장",
1725 "촬영",
1726 "최근",
1727 "최상",
1728 "최선",
1729 "최신",
1730 "최악",
1731 "최종",
1732 "추석",
1733 "추억",
1734 "추진",
1735 "추천",
1736 "추측",
1737 "축구",
1738 "축소",
1739 "축제",
1740 "축하",
1741 "출근",
1742 "출발",
1743 "출산",
1744 "출신",
1745 "출연",
1746 "출입",
1747 "출장",
1748 "출판",
1749 "충격",
1750 "충고",
1751 "충돌",
1752 "충분히",
1753 "충청도",
1754 "취업",
1755 "취직",
1756 "취향",
1757 "치약",
1758 "친구",
1759 "친척",
1760 "칠십",
1761 "칠월",
1762 "칠판",
1763 "침대",
1764 "침묵",
1765 "침실",
1766 "칫솔",
1767 "칭찬",
1768 "카메라",
1769 "카운터",
1770 "칼국수",
1771 "캐릭터",
1772 "캠퍼스",
1773 "캠페인",
1774 "커튼",
1775 "컨디션",
1776 "컬러",
1777 "컴퓨터",
1778 "코끼리",
1779 "코미디",
1780 "콘서트",
1781 "콜라",
1782 "콤플렉스",
1783 "콩나물",
1784 "쾌감",
1785 "쿠데타",
1786 "크림",
1787 "큰길",
1788 "큰딸",
1789 "큰소리",
1790 "큰아들",
1791 "큰어머니",
1792 "큰일",
1793 "큰절",
1794 "클래식",
1795 "클럽",
1796 "킬로",
1797 "타입",
1798 "타자기",
1799 "탁구",
1800 "탁자",
1801 "탄생",
1802 "태권도",
1803 "태양",
1804 "태풍",
1805 "택시",
1806 "탤런트",
1807 "터널",
1808 "터미널",
1809 "테니스",
1810 "테스트",
1811 "테이블",
1812 "텔레비전",
1813 "토론",
1814 "토마토",
1815 "토요일",
1816 "통계",
1817 "통과",
1818 "통로",
1819 "통신",
1820 "통역",
1821 "통일",
1822 "통장",
1823 "통제",
1824 "통증",
1825 "통합",
1826 "통화",
1827 "퇴근",
1828 "퇴원",
1829 "퇴직금",
1830 "튀김",
1831 "트럭",
1832 "특급",
1833 "특별",
1834 "특성",
1835 "특수",
1836 "특징",
1837 "특히",
1838 "튼튼히",
1839 "티셔츠",
1840 "파란색",
1841 "파일",
1842 "파출소",
1843 "판결",
1844 "판단",
1845 "판매",
1846 "판사",
1847 "팔십",
1848 "팔월",
1849 "팝송",
1850 "패션",
1851 "팩스",
1852 "팩시밀리",
1853 "팬티",
1854 "퍼센트",
1855 "페인트",
1856 "편견",
1857 "편의",
1858 "편지",
1859 "편히",
1860 "평가",
1861 "평균",
1862 "평생",
1863 "평소",
1864 "평양",
1865 "평일",
1866 "평화",
1867 "포스터",
1868 "포인트",
1869 "포장",
1870 "포함",
1871 "표면",
1872 "표정",
1873 "표준",
1874 "표현",
1875 "품목",
1876 "품질",
1877 "풍경",
1878 "풍속",
1879 "풍습",
1880 "프랑스",
1881 "프린터",
1882 "플라스틱",
1883 "피곤",
1884 "피망",
1885 "피아노",
1886 "필름",
1887 "필수",
1888 "필요",
1889 "필자",
1890 "필통",
1891 "핑계",
1892 "하느님",
1893 "하늘",
1894 "하드웨어",
1895 "하룻밤",
1896 "하반기",
1897 "하숙집",
1898 "하순",
1899 "하여튼",
1900 "하지만",
1901 "하천",
1902 "하품",
1903 "하필",
1904 "학과",
1905 "학교",
1906 "학급",
1907 "학기",
1908 "학년",
1909 "학력",
1910 "학번",
1911 "학부모",
1912 "학비",
1913 "학생",
1914 "학술",
1915 "학습",
1916 "학용품",
1917 "학원",
1918 "학위",
1919 "학자",
1920 "학점",
1921 "한계",
1922 "한글",
1923 "한꺼번에",
1924 "한낮",
1925 "한눈",
1926 "한동안",
1927 "한때",
1928 "한라산",
1929 "한마디",
1930 "한문",
1931 "한번",
1932 "한복",
1933 "한식",
1934 "한여름",
1935 "한쪽",
1936 "할머니",
1937 "할아버지",
1938 "할인",
1939 "함께",
1940 "함부로",
1941 "합격",
1942 "합리적",
1943 "항공",
1944 "항구",
1945 "항상",
1946 "항의",
1947 "해결",
1948 "해군",
1949 "해답",
1950 "해당",
1951 "해물",
1952 "해석",
1953 "해설",
1954 "해수욕장",
1955 "해안",
1956 "핵심",
1957 "핸드백",
1958 "햄버거",
1959 "햇볕",
1960 "햇살",
1961 "행동",
1962 "행복",
1963 "행사",
1964 "행운",
1965 "행위",
1966 "향기",
1967 "향상",
1968 "향수",
1969 "허락",
1970 "허용",
1971 "헬기",
1972 "현관",
1973 "현금",
1974 "현대",
1975 "현상",
1976 "현실",
1977 "현장",
1978 "현재",
1979 "현지",
1980 "혈액",
1981 "협력",
1982 "형부",
1983 "형사",
1984 "형수",
1985 "형식",
1986 "형제",
1987 "형태",
1988 "형편",
1989 "혜택",
1990 "호기심",
1991 "호남",
1992 "호랑이",
1993 "호박",
1994 "호텔",
1995 "호흡",
1996 "혹시",
1997 "홀로",
1998 "홈페이지",
1999 "홍보",
2000 "홍수",
2001 "홍차",
2002 "화면",
2003 "화분",
2004 "화살",
2005 "화요일",
2006 "화장",
2007 "화학",
2008 "확보",
2009 "확인",
2010 "확장",
2011 "확정",
2012 "환갑",
2013 "환경",
2014 "환영",
2015 "환율",
2016 "환자",
2017 "활기",
2018 "활동",
2019 "활발히",
2020 "활용",
2021 "활짝",
2022 "회견",
2023 "회관",
2024 "회복",
2025 "회색",
2026 "회원",
2027 "회장",
2028 "회전",
2029 "횟수",
2030 "횡단보도",
2031 "효율적",
2032 "후반",
2033 "후춧가루",
2034 "훈련",
2035 "훨씬",
2036 "휴식",
2037 "휴일",
2038 "흉내",
2039 "흐름",
2040 "흑백",
2041 "흑인",
2042 "흔적",
2043 "흔히",
2044 "흥미",
2045 "흥분",
2046 "희곡",
2047 "희망",
2048 "희생",
2049 "흰색",
2050 "힘껏"
2051]
diff --git a/tests/spec/tests.js b/tests/spec/tests.js
index b30cbe4..5c23f8b 100644
--- a/tests/spec/tests.js
+++ b/tests/spec/tests.js
@@ -33,6 +33,7 @@ var driver = null;
33var generateDelay = 1500; 33var generateDelay = 1500;
34var feedbackDelay = 500; 34var feedbackDelay = 500;
35var entropyFeedbackDelay = 500; 35var entropyFeedbackDelay = 500;
36var bip38delay = 15000;
36 37
37// url uses file:// scheme 38// url uses file:// scheme
38var path = require('path') 39var path = require('path')
@@ -422,6 +423,13 @@ it('Allows selection of dogecoin', function(done) {
422 }; 423 };
423 testNetwork(done, params); 424 testNetwork(done, params);
424}); 425});
426it('Allows selection of denarius', function(done) {
427 var params = {
428 selectText: "DNR - Denarius",
429 firstAddress: "DFdFMVUMzU9xX88EywXvAGwjiwpxyh9vKb",
430 };
431 testNetwork(done, params);
432});
425it('Allows selection of shadowcash', function(done) { 433it('Allows selection of shadowcash', function(done) {
426 var params = { 434 var params = {
427 selectText: "SDC - ShadowCash", 435 selectText: "SDC - ShadowCash",
@@ -545,7 +553,7 @@ it('Allows selection of slimcoin testnet', function(done) {
545it('Allows selection of bitcoin cash', function(done) { 553it('Allows selection of bitcoin cash', function(done) {
546 var params = { 554 var params = {
547 selectText: "BCH - Bitcoin Cash", 555 selectText: "BCH - Bitcoin Cash",
548 firstAddress: "1JKvb6wKtsjNoCRxpZ4DGrbniML7z5U16A", 556 firstAddress: "bitcoincash:qzlquk7w4hkudxypl4fgv8x279r754dkvur7jpcsps",
549 }; 557 };
550 testNetwork(done, params); 558 testNetwork(done, params);
551}); 559});
@@ -594,7 +602,7 @@ it('Allows selection of nubits', function(done) {
594it('Allows selection of bitcoin gold', function(done) { 602it('Allows selection of bitcoin gold', function(done) {
595 var params = { 603 var params = {
596 selectText: "BTG - Bitcoin Gold", 604 selectText: "BTG - Bitcoin Gold",
597 firstAddress: "GWYxuwSqANWGV3WT7Gpr6HE91euYXBqtwQ", 605 firstAddress: "GdDqug4WUsn5syNbSTHatNn4XnuwZtzedx",
598 }; 606 };
599 testNetwork(done, params); 607 testNetwork(done, params);
600}); 608});
@@ -608,7 +616,770 @@ it('Allows selection of monacoin', function(done) {
608it('Allows selection of AXE', function(done) { 616it('Allows selection of AXE', function(done) {
609 var params = { 617 var params = {
610 selectText: "AXE - Axe", 618 selectText: "AXE - Axe",
611 firstAddress: "XQ4HLxUVS3egk5ff1o9e2vJFJKSSsUH3B7", 619 firstAddress: "PScwtLUyPiGrqtKXrHF37DGETLXLZdw4up",
620 };
621 testNetwork(done, params);
622});
623it('Allows selection of BlackCoin', function(done) {
624 var params = {
625 selectText: "BLK - BlackCoin",
626 firstAddress: "B5MznAKwj7uQ42vDz3w4onhBXPcqhTwJ9z",
627 };
628 testNetwork(done, params);
629});
630it('Allows selection of Neblio', function(done) {
631 var params = {
632 selectText: "NEBL - Neblio",
633 firstAddress: "NefkeEEvhusbHMmTRrxx7H9wFnUXd8qQsE",
634 };
635 testNetwork(done, params);
636});
637it('Allows selection of Beetlecoin', function(done) {
638 var params = {
639 selectText: "BEET - Beetlecoin",
640 firstAddress: "BVmtbEsGrjpknprmpHFq26z4kYHJUFHE71",
641 };
642 testNetwork(done, params);
643});
644it('Allows selection of Adcoin', function(done) {
645 var params = {
646 selectText: "ACC - Adcoin",
647 firstAddress: "AcEDM6V5sF4kFHC76MJjjfProtS5Sw2qcd",
648 };
649 testNetwork(done, params);
650});
651it('Allows selection of Asiacoin', function(done) {
652 var params = {
653 selectText: "AC - Asiacoin",
654 firstAddress: "ALupuEEz7kJjQTAvmtcBMBVuEjPa7GqZzE",
655 };
656 testNetwork(done, params);
657});
658it('Allows selection of Auroracoin', function(done) {
659 var params = {
660 selectText: "AUR - Auroracoin",
661 firstAddress: "ANuraS6F4Jpi413FEnavjYkKYJJRHkgYCm",
662 };
663 testNetwork(done, params);
664});
665it('Allows selection of Bata', function(done) {
666 var params = {
667 selectText: "BTA - Bata",
668 firstAddress: "BGxBdNeYPtF3GCuTtZBPQdFxCkdBYSF3fj",
669 };
670 testNetwork(done, params);
671});
672it('Allows selection of Belacoin', function(done) {
673 var params = {
674 selectText: "BELA - Belacoin",
675 firstAddress: "BEeetqpNffdzeknSpNmQp5KAFh2KK1Qx7S",
676 };
677 testNetwork(done, params);
678});
679it('Allows selection of Bitcoin Atom', function(done) {
680 var params = {
681 selectText: "BCA - Bitcoin Atom",
682 firstAddress: "AMy6qMbJeC4zsGRL6iWszmeCdQH65fgfih",
683 };
684 testNetwork(done, params);
685});
686it('Allows selection of Bitcoinplus', function(done) {
687 var params = {
688 selectText: "XBC - Bitcoinplus",
689 firstAddress: "B7FSynZoDbEwTCSgsXq9nJ5ue8owYLVL8r",
690 };
691 testNetwork(done, params);
692});
693it('Allows selection of Bitcoin Private', function(done) {
694 var params = {
695 selectText: "BTCP - Bitcoin Private",
696 firstAddress: "b1M3PbiXXyN6Hdivdw5rJv5VKpLjPzhm4jM",
697 };
698 testNetwork(done, params);
699});
700it('Allows selection of Bitcoinz', function(done) {
701 var params = {
702 selectText: "BTCZ - Bitcoinz",
703 firstAddress: "t1X2YQoxs8cYRo2oaBYgVEwW5QNjCC59NYc",
704 };
705 testNetwork(done, params);
706});
707it('Allows selection of BitCloud', function(done) {
708 var params = {
709 selectText: "BTDX - BitCloud",
710 firstAddress: "BHbWitXCNgTf1BhsRDNMP186EeibuzmrBi",
711 };
712 testNetwork(done, params);
713});
714it('Allows selection of Bitcore', function(done) {
715 var params = {
716 selectText: "BTX - Bitcore",
717 firstAddress: "2Rgp5Znhpy34TK4QmPkfCiYs9r4KovfTH9",
718 };
719 testNetwork(done, params);
720});
721it('Allows selection of Bitsend', function(done) {
722 var params = {
723 selectText: "BSD - Bitsend",
724 firstAddress: "iBPk7LYjDun3EPk7CRR8UUmnPoceVc1bp2",
725 };
726 testNetwork(done, params);
727});
728it('Allows selection of Britcoin', function(done) {
729 var params = {
730 selectText: "BRIT - Britcoin",
731 firstAddress: "B6Aue4J2XLs1f1dtD4H1SHYFfh4XrmEbrw",
732 };
733 testNetwork(done, params);
734});
735it('Allows selection of Canadaecoin', function(done) {
736 var params = {
737 selectText: "CDN - Canadaecoin",
738 firstAddress: "CanAyCfd5Rj2CQVfaoAmvDUZunPM5W1AEQ",
739 };
740 testNetwork(done, params);
741});
742it('Allows selection of Cannacoin', function(done) {
743 var params = {
744 selectText: "CCN - Cannacoin",
745 firstAddress: "CYjW8xWB43g6krLJTmmrPk1PonoQX7h9Qd",
746 };
747 testNetwork(done, params);
748});
749it('Allows selection of Clubcoin', function(done) {
750 var params = {
751 selectText: "CLUB - Clubcoin",
752 firstAddress: "CHMDEXN4sihpSVX4GyAa2hZ62shnby7uyN",
753 };
754 testNetwork(done, params);
755});
756it('Allows selection of Compcoin', function(done) {
757 var params = {
758 selectText: "CMP - Compcoin",
759 firstAddress: "CLshtw3zhxkseBJS46UF12v3AFy9Dx7JVv",
760 };
761 testNetwork(done, params);
762});
763it('Allows selection of Crave', function(done) {
764 var params = {
765 selectText: "CRAVE - Crave",
766 firstAddress: "VCYJeti6uKMNBFKCL7eP96UwuFWYHM7c85",
767 };
768 testNetwork(done, params);
769});
770it('Allows selection of Defcoin', function(done) {
771 var params = {
772 selectText: "DFC - Defcoin",
773 firstAddress: "D8swcgyaaFUrXZU3ATwbgy16buCpWqbG1M",
774 };
775 testNetwork(done, params);
776});
777it('Allows selection of Diamond', function(done) {
778 var params = {
779 selectText: "DMD - Diamond",
780 firstAddress: "dJnrVbLL9UPjdaVRz2C8VpqHZknqAqjLek",
781 };
782 testNetwork(done, params);
783});
784it('Allows selection of Digibyte', function(done) {
785 var params = {
786 selectText: "DGB - Digibyte",
787 firstAddress: "D85Rp9jwLtMdmP6wGjTiqHBdVQLST3YCEq",
788 };
789 testNetwork(done, params);
790});
791it('Allows selection of Digitalcoin', function(done) {
792 var params = {
793 selectText: "DGC - Digitalcoin",
794 firstAddress: "DKw4UGKEAZWweDNEbBFNQx4EM8x1mpUdia",
795 };
796 testNetwork(done, params);
797});
798it('Allows selection of Ecoin', function(done) {
799 var params = {
800 selectText: "ECN - Ecoin",
801 firstAddress: "e6WFPLG5gcXyF7cESFteH1hE2XSmowW5yB",
802 };
803 testNetwork(done, params);
804});
805it('Allows selection of Edrcoin', function(done) {
806 var params = {
807 selectText: "EDRC - Edrcoin",
808 firstAddress: "eh1nUJsvgKPFv6ebMBfcwJ299GMCpjeZUG",
809 };
810 testNetwork(done, params);
811});
812it('Allows selection of Egulden', function(done) {
813 var params = {
814 selectText: "EFL - Egulden",
815 firstAddress: "Lg66yt55R7edRM58cDhKzXik2kFme3viX7",
816 };
817 testNetwork(done, params);
818});
819it('Allows selection of Einsteinium', function(done) {
820 var params = {
821 selectText: "EMC2 - Einsteinium",
822 firstAddress: "EVAABm9hXKHk2MpVMbwNakRubFnNha5m8m",
823 };
824 testNetwork(done, params);
825});
826it('Allows selection of Europecoin', function(done) {
827 var params = {
828 selectText: "ERC - Europecoin",
829 firstAddress: "ESA2YwPYntAoaPrE8Fm5qkKRtkcwLcwD6R",
830 };
831 testNetwork(done, params);
832});
833it('Allows selection of Exclusivecoin', function(done) {
834 var params = {
835 selectText: "EXCL - Exclusivecoin",
836 firstAddress: "EbUa6m8UZW6nTxsYZD2FsDjkadKbp5M6JT",
837 };
838 testNetwork(done, params);
839});
840it('Allows selection of Feathercoin', function(done) {
841 var params = {
842 selectText: "FTC - Feathercoin",
843 firstAddress: "6gDdjAMoSgQaW8UhqK3oboHs6ftGAroKkM",
844 };
845 testNetwork(done, params);
846});
847it('Allows selection of Firstcoin', function(done) {
848 var params = {
849 selectText: "FRST - Firstcoin",
850 firstAddress: "FJN9GzfMm7Q8R4DJwK1H9F6A1GTghvFiMJ",
851 };
852 testNetwork(done, params);
853});
854it('Allows selection of Flashcoin', function(done) {
855 var params = {
856 selectText: "FLASH - Flashcoin",
857 firstAddress: "UWfpf5LfMmLxZYooEb2EyvWhZ8NG7EZDRt",
858 };
859 testNetwork(done, params);
860});
861it('Allows selection of GCRCoin', function(done) {
862 var params = {
863 selectText: "GCR - GCRCoin",
864 firstAddress: "GJjF5cLwyXLacpuvXAVksxGxKvHDjx58d6",
865 };
866 testNetwork(done, params);
867});
868it('Allows selection of Gobyte', function(done) {
869 var params = {
870 selectText: "GBX - Gobyte",
871 firstAddress: "GS813Ys2brkmvSUw1rUqGPm2HqQVDHJRyA",
872 };
873 testNetwork(done, params);
874});
875it('Allows selection of Gridcoin', function(done) {
876 var params = {
877 selectText: "GRC - Gridcoin",
878 firstAddress: "SGrWbBPvobgqKRF8td1Kdc9vbRY7MJ78Y9",
879 };
880 testNetwork(done, params);
881});
882it('Allows selection of Gulden', function(done) {
883 var params = {
884 selectText: "NLG - Gulden",
885 firstAddress: "GcDP7cNEc33MPPdTFNJ8pZc6VMZJ2CbKxY",
886 };
887 testNetwork(done, params);
888});
889it('Allows selection of Helleniccoin', function(done) {
890 var params = {
891 selectText: "HNC - Helleniccoin",
892 firstAddress: "LbHEKe5H72zp9G1fuWNiiNePTUfJb88915",
893 };
894 testNetwork(done, params);
895});
896it('Allows selection of Hempcoin', function(done) {
897 var params = {
898 selectText: "THC - Hempcoin",
899 firstAddress: "H8sdWbZyJV4gyXyHtLXDaNnAuUDhK5mfTV",
900 };
901 testNetwork(done, params);
902});
903it('Allows selection of Insane', function(done) {
904 var params = {
905 selectText: "INSN - Insane",
906 firstAddress: "iMPqEJMiXWuxC9U2NVinCCMr4t72h58EWx",
907 };
908 testNetwork(done, params);
909});
910it('Allows selection of Iop', function(done) {
911 var params = {
912 selectText: "IOP - Iop",
913 firstAddress: "pGKQmcaPf95Ur5o6oHK4qdiZ52p1yaTvq1",
914 };
915 testNetwork(done, params);
916});
917it('Allows selection of Ixcoin', function(done) {
918 var params = {
919 selectText: "IXC - Ixcoin",
920 firstAddress: "xgE9bTZ6YypT3E6ByzkTt31Hq68E9BqywH",
921 };
922 testNetwork(done, params);
923});
924it('Allows selection of Kobocoin', function(done) {
925 var params = {
926 selectText: "KOBO - Kobocoin",
927 firstAddress: "FTVoNJETXDAM8x7MnmdE8RwWndSr9PQWhy",
928 };
929 testNetwork(done, params);
930});
931it('Allows selection of Landcoin', function(done) {
932 var params = {
933 selectText: "LDCN - Landcoin",
934 firstAddress: "LLvLwNjG1aJcn1RS4W4GJUbv8fNaRATG7c",
935 };
936 testNetwork(done, params);
937});
938it('Allows selection of Library Credits', function(done) {
939 var params = {
940 selectText: "LBC - Library Credits",
941 firstAddress: "bQJEQrHDJyHdqycB32uysh1SWn8Ln8LMdg",
942 };
943 testNetwork(done, params);
944});
945it('Allows selection of Linx', function(done) {
946 var params = {
947 selectText: "LINX - Linx",
948 firstAddress: "XGWQ3cb3LGUB3VnHmj6xYSMgnokNbf6dyk",
949 };
950 testNetwork(done, params);
951});
952it('Allows selection of Litecoincash', function(done) {
953 var params = {
954 selectText: "LCC - Litecoincash",
955 firstAddress: "Ce5n7fjUuQPLutJ4W5nCCfQLKdKLE1mv9A",
956 };
957 testNetwork(done, params);
958});
959it('Allows selection of Lynx', function(done) {
960 var params = {
961 selectText: "LYNX - Lynx",
962 firstAddress: "KUeY3ZdZkg96p4W98pj1JjygCFU1XqWdw3",
963 };
964 testNetwork(done, params);
965});
966it('Allows selection of Megacoin', function(done) {
967 var params = {
968 selectText: "MEC - Megacoin",
969 firstAddress: "MDfAj9CzkC1HpcUiVGnHp8yKTa7WXgu8AY",
970 };
971 testNetwork(done, params);
972});
973it('Allows selection of Minexcoin', function(done) {
974 var params = {
975 selectText: "MNX - Minexcoin",
976 firstAddress: "XC1VnyJVfiMDwWgFtAHDp41cgY3AHk3dJT",
977 };
978 testNetwork(done, params);
979});
980it('Allows selection of Navcoin', function(done) {
981 var params = {
982 selectText: "NAV - Navcoin",
983 firstAddress: "NTQVTPK3NWSQLKoffkiQw99T8PifkF1Y2U",
984 };
985 testNetwork(done, params);
986});
987it('Allows selection of Neoscoin', function(done) {
988 var params = {
989 selectText: "NEOS - Neoscoin",
990 firstAddress: "NgATz6QbQNXvayHQ4CpZayugb9HeaPDdby",
991 };
992 testNetwork(done, params);
993});
994it('Allows selection of Neurocoin', function(done) {
995 var params = {
996 selectText: "NRO - Neurocoin",
997 firstAddress: "NVdYErQ3mFpDuF5DquW9WMiT7sLc8ufFTn",
998 };
999 testNetwork(done, params);
1000});
1001it('Allows selection of Newyorkc', function(done) {
1002 var params = {
1003 selectText: "NYC - Newyorkc",
1004 firstAddress: "RSVMfyH1fKfy3puADJEhut2vfkRyon6imm",
1005 };
1006 testNetwork(done, params);
1007});
1008it('Allows selection of Novacoin', function(done) {
1009 var params = {
1010 selectText: "NVC - Novacoin",
1011 firstAddress: "4JRvUmxcKCJmaMXZyvRoSS1cmG2XvnZfHN",
1012 };
1013 testNetwork(done, params);
1014});
1015it('Allows selection of Nushares', function(done) {
1016 var params = {
1017 selectText: "NSR - Nushares",
1018 firstAddress: "SecjXzU3c7EecdT7EbC4vvmbdtBBokWh6J",
1019 };
1020 testNetwork(done, params);
1021});
1022it('Allows selection of Okcash', function(done) {
1023 var params = {
1024 selectText: "OK - Okcash",
1025 firstAddress: "PV4Qp1TUYuGv4TqVtLZtqvrsWWRycfx1Yi",
1026 };
1027 testNetwork(done, params);
1028});
1029it('Allows selection of Omnicore', function(done) {
1030 var params = {
1031 selectText: "OMNI - Omnicore",
1032 firstAddress: "1Q1t3gonjCT3rW38TsTsCvgSc3hh7zBGbi",
1033 };
1034 testNetwork(done, params);
1035});
1036it('Allows selection of Pesobit', function(done) {
1037 var params = {
1038 selectText: "PSB - Pesobit",
1039 firstAddress: "PDePsF7ALyXP7JaywokdYiRTDtKa14MAr1",
1040 };
1041 testNetwork(done, params);
1042});
1043it('Allows selection of Pinkcoin', function(done) {
1044 var params = {
1045 selectText: "PINK - Pinkcoin",
1046 firstAddress: "2TgjYQffjbzUHJghNaVbdsjHbRwruC3yzC",
1047 };
1048 testNetwork(done, params);
1049});
1050it('Allows selection of POSWcoin', function(done) {
1051 var params = {
1052 selectText: "POSW - POSWcoin",
1053 firstAddress: "PNxewmZoPnGBvoEbH6hgQZCK1igDiBCdgC",
1054 };
1055 testNetwork(done, params);
1056});
1057it('Allows selection of Potcoin', function(done) {
1058 var params = {
1059 selectText: "POT - Potcoin",
1060 firstAddress: "PEo7Vg2ctXgpP4vuLPeY9aGJtZotyrmiHc",
1061 };
1062 testNetwork(done, params);
1063});
1064it('Allows selection of Putincoin', function(done) {
1065 var params = {
1066 selectText: "PUT - Putincoin",
1067 firstAddress: "PViWnfr2uFtovd6e7joM49C94CsGSnqJis",
1068 };
1069 testNetwork(done, params);
1070});
1071it('Allows selection of Ravencoin', function(done) {
1072 var params = {
1073 selectText: "RVN - Ravencoin",
1074 firstAddress: "RBuDoVNnzvFsEcX8XKPm8ic4mgiCzjUCNk",
1075 };
1076 testNetwork(done, params);
1077});
1078it('Allows selection of Reddcoin', function(done) {
1079 var params = {
1080 selectText: "RDD - Reddcoin",
1081 firstAddress: "RtgRvXMBng1y51ftteveFqwNfyRG18HpxQ",
1082 };
1083 testNetwork(done, params);
1084});
1085it('Allows selection of RevolutionVR', function(done) {
1086 var params = {
1087 selectText: "RVR - RevolutionVR",
1088 firstAddress: "VXeeoP2jkzZnMFxtc66ZBZK1NHN5QJnnjL",
1089 };
1090 testNetwork(done, params);
1091});
1092it('Allows selection of Rubycoin', function(done) {
1093 var params = {
1094 selectText: "RBY - Rubycoin",
1095 firstAddress: "RV76JDtjTs11JdMDRToYn6CHecMRPLnKS6",
1096 };
1097 testNetwork(done, params);
1098});
1099it('Allows selection of Salus', function(done) {
1100 var params = {
1101 selectText: "SLS - Salus",
1102 firstAddress: "SNzPi1CafHFm3WWjRo43aMgiaEEj3ogjww",
1103 };
1104 testNetwork(done, params);
1105});
1106it('Allows selection of Smileycoin', function(done) {
1107 var params = {
1108 selectText: "SMLY - Smileycoin",
1109 firstAddress: "BEZVnEBCAyFByrgKpwAgYgtvP4rKAd9Sj2",
1110 };
1111 testNetwork(done, params);
1112});
1113it('Allows selection of Solarcoin', function(done) {
1114 var params = {
1115 selectText: "SLR - Solarcoin",
1116 firstAddress: "8LZ13HbnjtaMJWSvvVFNTLf71zFfDrhwLu",
1117 };
1118 testNetwork(done, params);
1119});
1120it('Allows selection of stash', function(done) {
1121 var params = {
1122 selectText: "STASH - Stash",
1123 firstAddress: "XxwAsWB7REDKmAvHA85SbEZQQtpxeUDxS3",
1124 };
1125 testNetwork(done, params);
1126});
1127it('Allows selection of stash testnet', function(done) {
1128 var params = {
1129 selectText: "STASH - Stash Testnet",
1130 firstAddress: "yWQCTSkUst7ddYuebKsqa1kSoXEjpCkGKR",
1131 };
1132 testNetwork(done, params);
1133});
1134it('Allows selection of Stratis', function(done) {
1135 var params = {
1136 selectText: "STRAT - Stratis",
1137 firstAddress: "ScfJnq3QDhKgDMEds6sqUE1ot6ShfhmXXq",
1138 };
1139 testNetwork(done, params);
1140});
1141it('Allows selection of Stratis Test', function(done) {
1142 var params = {
1143 selectText: "TSTRAT - Stratis Testnet",
1144 firstAddress: "TRLWm3dye4FRrDWouwYUSUZP96xb76mBE3",
1145 };
1146 testNetwork(done, params);
1147});
1148it('Allows selection of Syscoin', function(done) {
1149 var params = {
1150 selectText: "SYS - Syscoin",
1151 firstAddress: "SZwJi42Pst3VAMomyK5DG4157WM5ofRmSj",
1152 };
1153 testNetwork(done, params);
1154});
1155it('Allows selection of Toa', function(done) {
1156 var params = {
1157 selectText: "TOA - Toa",
1158 firstAddress: "TSe1QAnUwQzUfbBusDzRJ9URttrRGKoNKF",
1159 };
1160 testNetwork(done, params);
1161});
1162it('Allows selection of Ultimatesecurecash', function(done) {
1163 var params = {
1164 selectText: "USC - Ultimatesecurecash",
1165 firstAddress: "UPyLAZU2Che5fiy7Ed8xVJFmXAUhitA4ug",
1166 };
1167 testNetwork(done, params);
1168});
1169it('Allows selection of Unobtanium', function(done) {
1170 var params = {
1171 selectText: "UNO - Unobtanium",
1172 firstAddress: "uUBMPVMXrR6qhqornJqKTWgr8L69vihSL9",
1173 };
1174 testNetwork(done, params);
1175});
1176it('Allows selection of Vcash', function(done) {
1177 var params = {
1178 selectText: "XVC - Vcash",
1179 firstAddress: "VuL53MSY6KjvAjKSeRkh3NDnKykacDVeps",
1180 };
1181 testNetwork(done, params);
1182});
1183it('Allows selection of Verge', function(done) {
1184 var params = {
1185 selectText: "XVG - Verge",
1186 firstAddress: "DCrVuGkMjLJpTGgwAgv9AcMdeb1nkWbjZA",
1187 };
1188 testNetwork(done, params);
1189});
1190it('Allows selection of Vertcoin', function(done) {
1191 var params = {
1192 selectText: "VTC - Vertcoin",
1193 firstAddress: "Vf6koGuiWdXQfx8tNqxoNeEDxh4xh5cxsG",
1194 };
1195 testNetwork(done, params);
1196});
1197it('Allows selection of Vivo', function(done) {
1198 var params = {
1199 selectText: "VIVO - Vivo",
1200 firstAddress: "VFmBwuXXGhJe7MarQG2GfzHMFebRHgfSpB",
1201 };
1202 testNetwork(done, params);
1203});
1204it('Allows selection of Vpncoin', function(done) {
1205 var params = {
1206 selectText: "VASH - Vpncoin",
1207 firstAddress: "VoEmH1qXC4TsSgBAStR21QYetwnFqbqCx9",
1208 };
1209 testNetwork(done, params);
1210});
1211it('Allows selection of Whitecoin', function(done) {
1212 var params = {
1213 selectText: "XWC - Whitecoin",
1214 firstAddress: "WcSwCAUqrSgeSYbsaS3SSWWhsx8KRYTFDR",
1215 };
1216 testNetwork(done, params);
1217});
1218it('Allows selection of Wincoin', function(done) {
1219 var params = {
1220 selectText: "WC - Wincoin",
1221 firstAddress: "WaDVCESMGgyKgNESdn3u43NnwmGSkZED3Z",
1222 };
1223 testNetwork(done, params);
1224});
1225it('Allows selection of Zcoin', function(done) {
1226 var params = {
1227 selectText: "XZC - Zcoin",
1228 firstAddress: "a6VcMdP4XgAA9Tr7xNszmPG5FZpfRf17Cq",
1229 };
1230 testNetwork(done, params);
1231});
1232it('Allows selection of Zcash', function(done) {
1233 var params = {
1234 selectText: "ZEC - Zcash",
1235 firstAddress: "t1Sz8AneMcVuzUg3tPJ8et5AS5LFJ7K2EF9",
1236 };
1237 testNetwork(done, params);
1238});
1239it('Allows selection of Zclassic', function(done) {
1240 var params = {
1241 selectText: "ZCL - Zclassic",
1242 firstAddress: "t1TBMxTvVJRybUbMLGWq8H4A8F4VUL7czEc",
1243 };
1244 testNetwork(done, params);
1245});
1246it('Allows selection of Zencash', function(done) {
1247 var params = {
1248 selectText: "ZEN - Zencash",
1249 firstAddress: "znWh9XASyW2dZq5tck84wFjiwuqVysi7q3p",
1250 };
1251 testNetwork(done, params);
1252});
1253it('Allows selection of Energi', function(done) {
1254 var params = {
1255 selectText: "NRG - Energi",
1256 firstAddress: "EejRy4t4nidzhGGzkJUgFP3z4HYBjhTsRt",
1257 };
1258 testNetwork(done, params);
1259});
1260it('Allows selection of Ethereum Classic', function(done) {
1261 var params = {
1262 selectText: "ETC - Ethereum Classic",
1263 firstAddress: "0x3c05e5556693808367afB62eF3b63e35d6eD249A",
1264 };
1265 testNetwork(done, params);
1266});
1267it('Allows selection of Pirl', function(done) {
1268 var params = {
1269 selectText: "PIRL - Pirl",
1270 firstAddress: "0xe77FC0723dA122B5025CA79193c28563eB47e776",
1271 };
1272 testNetwork(done, params);
1273});
1274it('Allows selection of MIX', function(done) {
1275 var params = {
1276 selectText: "MIX - MIX",
1277 firstAddress: "0x98BC5e63aeb6A4e82d72850d20710F07E29A29F1",
1278 };
1279 testNetwork(done, params);
1280});
1281it('Allows selection of Musicoin', function(done) {
1282 var params = {
1283 selectText: "MUSIC - Musicoin",
1284 firstAddress: "0xDc060e4A0b0313ea83Cf6B3A39B9db2D29004897",
1285 };
1286 testNetwork(done, params);
1287});
1288it('Allows selection of Poa', function(done) {
1289 var params = {
1290 selectText: "POA - Poa",
1291 firstAddress: "0x53aF28d754e106210C3d0467Dd581eaf7e3C5e60",
1292 };
1293 testNetwork(done, params);
1294});
1295it('Allows selection of Expanse', function(done) {
1296 var params = {
1297 selectText: "EXP - Expanse",
1298 firstAddress: "0xf57FeAbf26582b6E3E666559d3B1Cc6fB2b2c5F6",
1299 };
1300 testNetwork(done, params);
1301});
1302it('Allows selection of Callisto', function(done) {
1303 var params = {
1304 selectText: "CLO - Callisto",
1305 firstAddress: "0x4f9364F7420B317266C51Dc8eB979717D4dE3f4E",
1306 };
1307 testNetwork(done, params);
1308});
1309it('Allows selection of HUSH', function(done) {
1310 var params = {
1311 selectText: "HUSH - Hush",
1312 firstAddress: "t1g6rLXUnJaiJuu4q4zmJjoa9Gk4fwKpiuA",
1313 };
1314 testNetwork(done, params);
1315});
1316it('Allows selection of ExchangeCoin', function(done) {
1317 var params = {
1318 selectText: "EXCC - ExchangeCoin",
1319 firstAddress: "22txYKpFN5fwGwdSs2UBf7ywewbLM92YqK7E",
1320 };
1321 testNetwork(done, params);
1322});
1323it('Allows selection of Artax', function(done) {
1324 var params = {
1325 selectText: "XAX - Artax",
1326 firstAddress: "AYxaQPY7XLidG31V7F3yNzwxPYpYzRqG4q",
1327 };
1328 testNetwork(done, params);
1329});
1330it('Allows selection of BitcoinGreen', function(done) {
1331 var params = {
1332 selectText: "BITG - Bitcoin Green",
1333 firstAddress: "GeNGm9SkEfwbsws3UrrUSE2sJeyWYjzraY",
1334 };
1335 testNetwork(done, params);
1336});
1337it('Allows selection of ANON', function(done) {
1338 var params = {
1339 selectText: "ANON - ANON",
1340 firstAddress: "AnU6pijpEeUZFWSTyM2qTqZQn996Zq1Xard",
1341 };
1342 testNetwork(done, params);
1343});
1344it('Allows selection of ProjectCoin', function(done) {
1345 var params = {
1346 selectText: "PRJ - ProjectCoin",
1347 firstAddress: "PXZG97saRseSCftfe1mcFmfAA7pf6qBbaz",
1348 };
1349 testNetwork(done, params);
1350});
1351it('Allows selection of Phore', function(done) {
1352 var params = {
1353 selectText: "PHR - Phore",
1354 firstAddress: "PJThxpoXAG6hqrmdeQQbVDX4TJtFTMMymC",
1355 };
1356 testNetwork(done, params);
1357});
1358it('Allows selection of Safecoin', function(done) {
1359 var params = {
1360 selectText: "SAFE - Safecoin",
1361 firstAddress: "RmV56kPW7jeCmDA8sukHwbR7RZSbg9NFNF",
1362 };
1363 testNetwork(done, params);
1364 });
1365it('Allows selection of Blocknode', function(done) {
1366 var params = {
1367 selectText: "BND - Blocknode",
1368 firstAddress: "BG8xZSAur2jYLG9VXt8dYfkKxxeR7w9bSe",
1369 };
1370 testNetwork(done, params);
1371});
1372it('Allows selection of Blocknode Testnet', function(done) {
1373 var params = {
1374 selectText: "tBND - Blocknode Testnet",
1375 firstAddress: "bSptsFyDktFSKpWveRywJsDoJA2TC6qfHv",
1376 };
1377 testNetwork(done, params);
1378});
1379it('Allows selection of LitecoinZ', function(done) {
1380 var params = {
1381 selectText: "LTZ - LitecoinZ",
1382 firstAddress: "L1VTXju7hLgKV4T7fGXS9sKsnm2gmtRCmyw",
612 }; 1383 };
613 testNetwork(done, params); 1384 testNetwork(done, params);
614}); 1385});
@@ -940,13 +1711,13 @@ it('Can generate more rows in the table', function(done) {
940 1711
941// A custom number of additional addresses can be generated 1712// A custom number of additional addresses can be generated
942it('Can generate more rows in the table', function(done) { 1713it('Can generate more rows in the table', function(done) {
943 driver.findElement(By.css('.rows-to-add'))
944 .clear();
945 driver.findElement(By.css('.rows-to-add'))
946 .sendKeys('1');
947 driver.findElement(By.css('.phrase')) 1714 driver.findElement(By.css('.phrase'))
948 .sendKeys('abandon abandon ability'); 1715 .sendKeys('abandon abandon ability');
949 driver.sleep(generateDelay).then(function() { 1716 driver.sleep(generateDelay).then(function() {
1717 driver.findElement(By.css('.rows-to-add'))
1718 .clear();
1719 driver.findElement(By.css('.rows-to-add'))
1720 .sendKeys('1');
950 driver.findElement(By.css('.more')) 1721 driver.findElement(By.css('.more'))
951 .click(); 1722 .click();
952 driver.sleep(generateDelay).then(function() { 1723 driver.sleep(generateDelay).then(function() {
@@ -2166,10 +2937,11 @@ it('Can change details while old addresses are still being generated', function(
2166 driver.findElement(By.css('.phrase')) 2937 driver.findElement(By.css('.phrase'))
2167 .sendKeys("abandon abandon ability"); 2938 .sendKeys("abandon abandon ability");
2168 driver.sleep(generateDelay).then(function() { 2939 driver.sleep(generateDelay).then(function() {
2169 // generate more addresses
2170 driver.findElement(By.css('.more'))
2171 .click();
2172 // change tabs which should cancel the previous generating 2940 // change tabs which should cancel the previous generating
2941 driver.findElement(By.css('.rows-to-add'))
2942 .clear();
2943 driver.findElement(By.css('.rows-to-add'))
2944 .sendKeys('20');
2173 driver.findElement(By.css('#bip32-tab a')) 2945 driver.findElement(By.css('#bip32-tab a'))
2174 .click() 2946 .click()
2175 driver.sleep(generateDelay).then(function() { 2947 driver.sleep(generateDelay).then(function() {
@@ -2182,7 +2954,7 @@ it('Can change details while old addresses are still being generated', function(
2182 }); 2954 });
2183 }); 2955 });
2184 }); 2956 });
2185}); 2957}, generateDelay + 10000);
2186 2958
2187// Github issue 49 2959// Github issue 49
2188// padding for binary should give length with multiple of 256 2960// padding for binary should give length with multiple of 256
@@ -2223,6 +2995,13 @@ it('Can set the derivation path on bip32 tab for multibit', function(done) {
2223 useHardenedAddresses: null, 2995 useHardenedAddresses: null,
2224 }); 2996 });
2225}); 2997});
2998it('Can set the derivation path on bip32 tab for coinomi/ledger', function(done) {
2999 testClientSelect(done, {
3000 selectValue: "3",
3001 bip32path: "m/44'/0'/0'",
3002 useHardenedAddresses: null,
3003 });
3004});
2226 3005
2227// github issue 58 3006// github issue 58
2228// https://github.com/iancoleman/bip39/issues/58 3007// https://github.com/iancoleman/bip39/issues/58
@@ -2557,10 +3336,26 @@ it('Warns when entropy is filtered and discarded', function(done) {
2557 }); 3336 });
2558}); 3337});
2559 3338
3339// Bitcoin Cash address can be set to use cashaddr format
3340it('Can use cashaddr format for bitcoin cash addresses', function(done) {
3341 driver.executeScript(function() {
3342 $(".use-bch-cashaddr-addresses").prop("checked", true);
3343 });
3344 driver.findElement(By.css('.phrase'))
3345 .sendKeys("abandon abandon ability");
3346 selectNetwork("BCH - Bitcoin Cash");
3347 driver.sleep(generateDelay).then(function() {
3348 getFirstAddress(function(address) {
3349 expect(address).toBe("bitcoincash:qzlquk7w4hkudxypl4fgv8x279r754dkvur7jpcsps");
3350 done();
3351 });
3352 });
3353});
3354
2560// Bitcoin Cash address can be set to use bitpay format 3355// Bitcoin Cash address can be set to use bitpay format
2561it('Can use bitpay format for bitcoin cash addresses', function(done) { 3356it('Can use bitpay format for bitcoin cash addresses', function(done) {
2562 driver.executeScript(function() { 3357 driver.executeScript(function() {
2563 $(".use-bitpay-addresses").prop("checked", true); 3358 $(".use-bch-bitpay-addresses").prop("checked", true);
2564 }); 3359 });
2565 driver.findElement(By.css('.phrase')) 3360 driver.findElement(By.css('.phrase'))
2566 .sendKeys("abandon abandon ability"); 3361 .sendKeys("abandon abandon ability");
@@ -2573,6 +3368,22 @@ it('Can use bitpay format for bitcoin cash addresses', function(done) {
2573 }); 3368 });
2574}); 3369});
2575 3370
3371// Bitcoin Cash address can be set to use legacy format
3372it('Can use legacy format for bitcoin cash addresses', function(done) {
3373 driver.executeScript(function() {
3374 $(".use-bch-legacy-addresses").prop("checked", true);
3375 });
3376 driver.findElement(By.css('.phrase'))
3377 .sendKeys("abandon abandon ability");
3378 selectNetwork("BCH - Bitcoin Cash");
3379 driver.sleep(generateDelay).then(function() {
3380 getFirstAddress(function(address) {
3381 expect(address).toBe("1JKvb6wKtsjNoCRxpZ4DGrbniML7z5U16A");
3382 done();
3383 });
3384 });
3385});
3386
2576// End of tests ported from old suit, so no more comments above each test now 3387// End of tests ported from old suit, so no more comments above each test now
2577 3388
2578it('Can generate more addresses from a custom index', function(done) { 3389it('Can generate more addresses from a custom index', function(done) {
@@ -2876,4 +3687,181 @@ it('LeftPads ethereum keys that are less than 32 bytes', function(done) {
2876 }); 3687 });
2877}); 3688});
2878 3689
3690it('Can encrypt private keys using BIP38', function(done) {
3691 // see https://github.com/iancoleman/bip39/issues/140
3692 driver.executeScript(function() {
3693 $(".use-bip38").prop("checked", true);
3694 });
3695 driver.findElement(By.css('.bip38-password'))
3696 .sendKeys('bip38password');
3697 driver.findElement(By.css('.rows-to-add'))
3698 .clear();
3699 driver.findElement(By.css('.rows-to-add'))
3700 .sendKeys('1');
3701 driver.findElement(By.css('.phrase'))
3702 .sendKeys('abandon abandon ability');
3703 driver.sleep(bip38delay).then(function() {
3704 // address
3705 getFirstRowValue(function(address) {
3706 expect(address).toBe("1NCvSdumA3ngMM9c4aqU56AM6rqXddfuXB");
3707 // pubkey
3708 getFirstRowValue(function(pubkey) {
3709 expect(pubkey).toBe("043f5aed5f6cfbafaf223188095b5980814897295f723815fea5d3f4b648d0d0b3884a74447ea901729b1e73a999b7520e7cb55b4120e6432c64153ccab8a848e1");
3710 // privkey
3711 getFirstRowValue(function(privkey) {
3712 expect(privkey).toBe("6PRNRiFnj1RoR3sXhymdCvoZCgnUHQpfupNdKkFbWJkwWQEKesWt1EDMDM");
3713 done();
3714 }, ".privkey");
3715 }, ".pubkey");
3716 }, ".address");
3717 });
3718}, bip38delay + 5000);
3719
3720it('Shows the checksum for the entropy', function(done) {
3721 driver.findElement(By.css('.use-entropy'))
3722 .click();
3723 driver.findElement(By.css('.entropy'))
3724 .sendKeys("00000000000000000000000000000000");
3725 driver.sleep(generateDelay).then(function() {
3726 driver.findElement(By.css('.checksum'))
3727 .getText()
3728 .then(function(text) {
3729 expect(text).toBe("1");
3730 done();
3731 });
3732 });
3733});
3734
3735it('Shows the checksum for the entropy with the correct groupings', function(done) {
3736 driver.findElement(By.css('.use-entropy'))
3737 .click();
3738 // create a checksum of 20 bits, which spans multiple words
3739 driver.findElement(By.css('.entropy'))
3740 .sendKeys("F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
3741 driver.sleep(generateDelay).then(function() {
3742 driver.findElement(By.css('.checksum'))
3743 .getText()
3744 .then(function(text) {
3745 // first group is 9 bits, second group is 11
3746 expect(text).toBe("011010111 01110000110");
3747 done();
3748 });
3749 });
3750});
3751
3752it('Uses vprv for bitcoin testnet p2wpkh', function(done) {
3753 selectNetwork("BTC - Bitcoin Testnet");
3754 driver.findElement(By.css('#bip84-tab a'))
3755 .click()
3756 driver.findElement(By.css('.phrase'))
3757 .sendKeys('abandon abandon ability');
3758 driver.sleep(generateDelay).then(function() {
3759 driver.findElement(By.css('.root-key'))
3760 .getAttribute("value")
3761 .then(function(path) {
3762 expect(path).toBe("vprv9DMUxX4ShgxML9N2YV5CvWEebWrM9aJ5ULpbRRyzyWu6vs4BzTvbfFFrH41N5hVi7MYSfiugd765L3JmAfDM5po36Y8ouCKRDeYQwByCmS7");
3763 done();
3764 })
3765 });
3766});
3767
3768it('Shows a warning if generating weak mnemonics', function(done) {
3769 driver.executeScript(function() {
3770 $(".strength option[selected]").removeAttr("selected");
3771 $(".strength option[value=6]").prop("selected", true);
3772 $(".strength").trigger("change");
3773 });
3774 driver.findElement(By.css(".generate-container .warning"))
3775 .getAttribute("class")
3776 .then(function(classes) {
3777 expect(classes).not.toContain("hidden");
3778 done();
3779 });
3780});
3781
3782it('Does not show a warning if generating strong mnemonics', function(done) {
3783 driver.executeScript(function() {
3784 $(".strength option[selected]").removeAttr("selected");
3785 $(".strength option[value=12]").prop("selected", true);
3786 });
3787 driver.findElement(By.css(".generate-container .warning"))
3788 .getAttribute("class")
3789 .then(function(classes) {
3790 expect(classes).toContain("hidden");
3791 done();
3792 });
3793});
3794
3795it('Shows a warning if overriding weak entropy with longer mnemonics', function(done) {
3796 driver.findElement(By.css('.use-entropy'))
3797 .click();
3798 driver.findElement(By.css('.entropy'))
3799 .sendKeys("0123456789abcdef"); // 6 words
3800 driver.executeScript(function() {
3801 $(".mnemonic-length").val("12").trigger("change");
3802 });
3803 driver.findElement(By.css(".weak-entropy-override-warning"))
3804 .getAttribute("class")
3805 .then(function(classes) {
3806 expect(classes).not.toContain("hidden");
3807 done();
3808 });
3809});
3810
3811it('Does not show a warning if entropy is stronger than mnemonic length', function(done) {
3812 driver.findElement(By.css('.use-entropy'))
3813 .click();
3814 driver.findElement(By.css('.entropy'))
3815 .sendKeys("0123456789abcdef0123456789abcdef0123456789abcdef"); // 18 words
3816 driver.executeScript(function() {
3817 $(".mnemonic-length").val("12").trigger("change");
3818 });
3819 driver.findElement(By.css(".weak-entropy-override-warning"))
3820 .getAttribute("class")
3821 .then(function(classes) {
3822 expect(classes).toContain("hidden");
3823 done();
3824 });
3825});
3826
3827it('Shows litecoin BIP49 addresses', function(done) {
3828 driver.findElement(By.css('.phrase'))
3829 .sendKeys('abandon abandon ability');
3830 selectNetwork("LTC - Litecoin");
3831 driver.findElement(By.css('#bip49-tab a'))
3832 .click()
3833 // bip49 addresses are shown
3834 driver.sleep(generateDelay).then(function() {
3835 driver.findElement(By.css('#bip49 .available'))
3836 .getAttribute("class")
3837 .then(function(classes) {
3838 expect(classes).not.toContain("hidden");
3839 // check first address
3840 getFirstAddress(function(address) {
3841 expect(address).toBe("MFwLPhsXoBuSLL8cLmW9uK6tChkzduV8qN");
3842 done();
3843 });
3844 });
3845 });
3846});
3847
3848it('Can use root keys to generate segwit table rows', function(done) {
3849 // segwit uses ypub / zpub instead of xpub but the root key should still
3850 // be valid regardless of the encoding used to import that key.
3851 // Maybe this breaks the reason for the different extended key prefixes, but
3852 // since the parsed root key is used behind the scenes anyhow this should be
3853 // allowed.
3854 driver.findElement(By.css('#root-key'))
3855 .sendKeys('xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi');
3856 driver.findElement(By.css('#bip49-tab a'))
3857 .click()
3858 // bip49 addresses are shown
3859 driver.sleep(generateDelay).then(function() {
3860 getFirstAddress(function(address) {
3861 expect(address).toBe("3QG2Y9AA4xZ846gKHZqNf7mvVKbLqMKxr2");
3862 done();
3863 });
3864 });
3865});
3866
2879}); 3867});