-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathkennitala.js
1588 lines (1335 loc) · 177 KB
/
kennitala.js
1
2
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
(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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.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){
(function (process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){
'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Kennitala = function () {
function Kennitala(kennitala) {
_classCallCheck(this, Kennitala);
var kt = void 0;
if ((kennitala.toString() || '').toLowerCase() === 'fake') {
kt = this.createFakeKennitala();
} else {
kt = kennitala ? kennitala.toString() : '';
}
kt = kt.replace(/-/g, '');
if (kt.length === 9) kt = '0' + kt;
var validate = this.isValid(kt);
if (validate.valid) {
this.type = this.getType(kt);
var age = this.getAge(kt);
return {
valid: validate.valid,
type: this.type,
age: age.years,
msAge: age.msAge,
birthdayToday: age.birthdayToday,
kt: kt,
formattedKt: kt.substr(0, 6) + '-' + kt.substr(6, 10)
};
} else {
return {
valid: validate.valid,
reason: validate.reason,
errorCode: validate.errorCode
};
}
}
_createClass(Kennitala, [{
key: 'randomInt',
value: function randomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}
}, {
key: 'createFakeKennitala',
value: function createFakeKennitala() {
// Should be gte 1 and lte 72
// But can not be between 31 and 41
var person_or_company = Math.round(Math.random()) ? 'person' : 'company';
var _1_2 = person_or_company === 'person' ? this.randomInt(1, 31).toString() : this.randomInt(41, 71).toString();
_1_2 = _1_2.length === 1 ? '0' + _1_2 : _1_2;
var _3_4 = this.randomInt(1, 12).toString();
_3_4 = _3_4.length === 1 ? '0' + _3_4 : _3_4;
var _5_6 = this.randomInt(0, 99).toString();
_5_6 = _5_6.length === 1 ? '0' + _5_6 : _5_6;
var _7_8 = this.randomInt(0, 99).toString();
_7_8 = _7_8.length === 1 ? '0' + _7_8 : _7_8;
var list = _1_2 + _3_4 + _5_6 + _7_8;
list = list.split('').map(function (value) {
return parseInt(value, 10);
});
this.currentRadtala = parseInt(_7_8, 10);
var vartala = this.calculateVartala(list);
if (vartala === 10) {
var v = 10;
while (v === 10) {
var calcAgain = this.calculateVartala(list, true);
if (calcAgain !== 10) vartala = calcAgain;
v = calcAgain;
}
}
var _9 = vartala.toString();
var _10 = ['0', '8', '9'][this.randomInt(0, 2)];
return _1_2 + _3_4 + _5_6 + _7_8 + _9 + _10;
}
}, {
key: 'existanceInYears',
value: function existanceInYears(birthday) {
var today = new Date();
var age = today.getUTCFullYear() - birthday.getUTCFullYear();
var m = today.getUTCMonth() - birthday.getUTCMonth();
if (m < 0 || m === 0 && today.getUTCDate() < birthday.getUTCDate()) {
age--;
}
return age;
}
}, {
key: 'getAge',
value: function getAge(kt) {
// This function returns persons age in years and in millisecond along with a boolean
// stating if the kennitala owner has a birthday today
var list = kt.split('');
var century = void 0;
if (list[9] === '0') {
century = 20;
} else if (list[9] === '9') {
century = 19;
} else if (list[9] === '8') {
century = 18;
}
var now = new Date();
var nowMonth = now.getUTCMonth(); //Javascript month (actual month - 1)
var nowDay = now.getUTCDate();
var month = parseInt(list[2] + list[3], 10) - 1; //Javascript month (actual month - 1)
var day = this.type === 'person' ? parseInt(list[0] + list[1], 10) : parseInt(list[0] - 4 + list[1], 10);
var birthday = new Date(parseInt(century + list[4] + list[5], 10), month, day);
var birthdayToday = nowMonth === month && nowDay === day ? true : false;
return {
years: this.existanceInYears(birthday),
msAge: now - birthday,
birthdayToday: birthdayToday
};
}
}, {
key: 'getType',
value: function getType(kt) {
var list = kt.split('');
// Checking if first two digits are between 41 and 71
// if so then this kennitala is a compnay kennitala
var dd = parseInt(list[0] + list[1], 10);
if (dd > 40 && dd < 72) return 'company';
return 'person';
}
}, {
key: 'isValid',
value: function isValid(kt) {
/* Note that kt is a string */
if (kt.length !== 10) return { valid: false, reason: 'Kennitala is too short', errorCode: 1 };
var list = kt.split('');
// Validating digits 1 and 2
// Should be gte 1 and lte 72
// But can not be between 31 and 41
var dd = parseInt(list[0] + list[1], 10);
if (!(dd > 0 && dd < 72) || dd > 31 && dd < 41) return {
valid: false,
reason: 'Birthdate is out of range (digits 1 and 2)',
errorCode: 2
};
// Validating digits 3 and 4
// Must be gt 0 lt 13
var mm = parseInt(list[2] + list[3], 10);
if (!(mm > 0 && mm < 13)) return {
valid: false,
reason: 'Month digits are out of range (digits 3 and 4)',
errorCode: 3
};
//Digits 5,6(years range from 0-99), 7 and 8 can be anything so we cant validate them
// We are storing this in a variable because we need to increement this
// if the calculated "vartala" is 10 and then recalculate with the incremented value
this.currentRadtala = parseInt(list[6] + list[7], 10);
// Turning list of numbers to int (from string)
// since we will be working with ints from now on
list.map(function (value) {
return parseInt(value, 10);
});
//Validating digit 9
if (this.validateNine(list) === false) return {
valid: false,
reason: 'Digit 9 is not valid. Read about "Níundi stafurinn" here: https://is.wikipedia.org/wiki/Kennitala',
errorCode: 4
};
//Validating digit 10
var lastDigit = parseInt(list[9], 10);
if (!(lastDigit === 0 || lastDigit === 8 || lastDigit === 9)) return {
valid: false,
reason: 'Century digit out of range (digit 10)',
errorCode: 5
};
return { valid: true };
}
}, {
key: 'calculateVartala',
value: function calculateVartala(list, incrementRadtala) {
// Vartala is digit number 9
// This url explains how its calculated: https://is.wikipedia.org/wiki/Kennitala'
if (incrementRadtala) {
this.currentRadtala++;
}
var radtala = ('0' + this.currentRadtala.toString()).slice(-2).split('');
var radtalaOne = parseInt(radtala[0], 10);
var radtalaTwo = parseInt(radtala[1], 10);
var sum = list[0] * 3 + list[1] * 2 + list[2] * 7 + list[3] * 6 + list[4] * 5 + list[5] * 4 + radtalaOne * 3 + radtalaTwo * 2;
var mod = sum % 11;
var vartala = mod === 0 ? 0 : 11 - mod;
return vartala;
}
}, {
key: 'validateNine',
value: function validateNine(list) {
var vartala = this.calculateVartala(list);
if (vartala === 10) {
var v = 10;
while (v === 10) {
var calcAgain = this.calculateVartala(list, true);
if (calcAgain !== 10) vartala = calcAgain;
v = calcAgain;
}
}
if (vartala === parseInt(list[8], 10)) {
return true;
}
return false;
}
}]);
return Kennitala;
}();
global.Kennitala = Kennitala;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZha2VfOGMwNTVkODEuanMiXSwibmFtZXMiOlsiS2Vubml0YWxhIiwia2Vubml0YWxhIiwia3QiLCJ0b1N0cmluZyIsInRvTG93ZXJDYXNlIiwiY3JlYXRlRmFrZUtlbm5pdGFsYSIsInJlcGxhY2UiLCJsZW5ndGgiLCJ2YWxpZGF0ZSIsImlzVmFsaWQiLCJ2YWxpZCIsInR5cGUiLCJnZXRUeXBlIiwiYWdlIiwiZ2V0QWdlIiwieWVhcnMiLCJtc0FnZSIsImJpcnRoZGF5VG9kYXkiLCJmb3JtYXR0ZWRLdCIsInN1YnN0ciIsInJlYXNvbiIsImVycm9yQ29kZSIsIm1pbiIsIm1heCIsIk1hdGgiLCJmbG9vciIsInJhbmRvbSIsInBlcnNvbl9vcl9jb21wYW55Iiwicm91bmQiLCJfMV8yIiwicmFuZG9tSW50IiwiXzNfNCIsIl81XzYiLCJfN184IiwibGlzdCIsInNwbGl0IiwibWFwIiwidmFsdWUiLCJwYXJzZUludCIsImN1cnJlbnRSYWR0YWxhIiwidmFydGFsYSIsImNhbGN1bGF0ZVZhcnRhbGE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KTtcclxuXHJcbiAgICAgICAgICAgIHJldHVybiB7XHJcbiAgICAgICAgICAgICAgICB2YWxpZDogdmFsaWRhdGUudmFsaWQsXHJcbiAgICAgICAgICAgICAgICB0eXBlOiB0aGlzLnR5cGUsXHJcbiAgICAgICAgICAgICAgICBhZ2U6IGFnZS55ZWFycyxcclxuICAgICAgICAgICAgICAgIG1zQWdlOiBhZ2UubXNBZ2UsXHJcbiAgICAgICAgICAgICAgICBiaXJ0aGRheVRvZGF5OiBhZ2UuYmlydGhkYXlUb2RheSxcclxuICAgICAgICAgICAgICAgIGt0OiBrdCxcclxuICAgICAgICAgICAgICAgIGZvcm1hdHRlZEt0OiBrdC5zdWJzdHIoMCwgNikgKyAnLScgKyBrdC5zdWJzdHIoNiwgMTApLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIHJldHVybiB7XHJcbiAgICAgICAgICAgICAgICB2YWxpZDogdmFsaWRhdGUudmFsaWQsXHJcbiAgICAgICAgICAgICAgICByZWFzb246IHZhbGlkYXRlLnJlYXNvbixcclxuICAgICAgICAgICAgICAgIGVycm9yQ29kZTogdmFsaWRhdGUuZXJyb3JDb2RlLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICByYW5kb21JbnQobWluLCBtYXgpIHtcclxuICAgICAgICByZXR1cm4gTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogKG1heCAtIG1pbiArIDEpICsgbWluKTtcclxuICAgIH1cclxuXHJcbiAgICBjcmVhdGVGYWtlS2Vubml0YWxhKCkge1xyXG4gICAgICAgIC8vIFNob3VsZCBiZSBndGUgMSBhbmQgbHRlIDcyXHJcbiAgICAgICAgLy8gQnV0IGNhbiBub3QgYmUgYmV0d2VlbiAzMSBhbmQgNDFcclxuICAgICAgICBjb25zdCBwZXJzb25fb3JfY29tcGFueSA9IE1hdGgucm91bmQoTWF0aC5yYW5kb20oKSkgPyAncGVyc29uJyA6ICdjb21wYW55JztcclxuXHJcbiAgICAgICAgbGV0IF8xXzIgPVxyXG4gICAgICAgICAgICBwZXJzb25fb3JfY29tcGFueSA9PT0gJ3BlcnNvbicgPyB0aGlzLnJhbmRvbUludCgxLCAzMSkudG9TdHJpbmcoKSA6IHRoaXMucmFuZG9tSW50KDQxLCA3MSkudG9TdHJpbmcoKTtcclxuICAgICAgICBfMV8yID0gXzFfMi5sZW5ndGggPT09IDEgPyAnMCcgKyBfMV8yIDogXzFfMjtcclxuXHJcbiAgICAgICAgbGV0IF8zXzQgPSB0aGlzLnJhbmRvbUludCgxLCAxMikudG9TdHJpbmcoKTtcclxuICAgICAgICBfM180ID0gXzNfNC5sZW5ndGggPT09IDEgPyAnMCcgKyBfM180IDogXzNfNDtcclxuXHJcbiAgICAgICAgbGV0IF81XzYgPSB0aGlzLnJhbmRvbUludCgwLCA5OSkudG9TdHJpbmcoKTtcclxuICAgICAgICBfNV82ID0gXzVfNi5sZW5ndGggPT09IDEgPyAnMCcgKyBfNV82IDogXzVfNjtcclxuXHJcbiAgICAgICAgbGV0IF83XzggPSB0aGlzLnJhbmRvbUludCgwLCA5OSkudG9TdHJpbmcoKTtcclxuICAgICAgICBfN184ID0gXzdfOC5sZW5ndGggPT09IDEgPyAnMCcgKyBfN184IDogXzdfODtcclxuXHJcbiAgICAgICAgbGV0IGxpc3QgPSBfMV8yICsgXzNfNCArIF81XzYgKyBfN184O1xyXG4gICAgICAgIGxpc3QgPSBsaXN0LnNwbGl0KCcnKS5tYXAoKHZhbHVlKSA9PiB7XHJcbiAgICAgICAgICAgIHJldHVybiBwYXJzZUludCh2YWx1ZSwgMTApO1xyXG4gICAgICAgIH0pO1xyXG5cclxuICAgICAgICB0aGlzLmN1cnJlbnRSYWR0YWxhID0gcGFyc2VJbnQoXzdfOCwgMTApO1xyXG4gICAgICAgIGxldCB2YXJ0YWxhID0gdGhpcy5jYWxjdWxhdGVWYXJ0YWxhKGxpc3QpO1xyXG5cclxuICAgICAgICBpZiAodmFydGFsYSA9PT0gMTApIHtcclxuICAgICAgICAgICAgbGV0IHYgPSAxMDtcclxuICAgICAgICAgICAgd2hpbGUgKHYgPT09IDEwKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjYWxjQWdhaW4gPSB0aGlzLmNhbGN1bGF0ZVZhcnRhbGEobGlzdCwgdHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICBpZiAoY2FsY0FnYWluICE9PSAxMCkgdmFydGFsYSA9IGNhbGNBZ2FpbjtcclxuICAgICAgICAgICAgICAgIHYgPSBjYWxjQWdhaW47XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGxldCBfOSA9IHZhcnRhbGEudG9TdHJpbmcoKTtcclxuXHJcbiAgICAgICAgbGV0IF8xMCA9IFsnMCcsICc4JywgJzknXVt0aGlzLnJhbmRvbUludCgwLCAyKV07XHJcblxyXG4gICAgICAgIHJldHVybiBfMV8yICsgXzNfNCArIF81XzYgKyBfN184ICsgXzkgKyBfMTA7XHJcbiAgICB9XHJcblxyXG4gICAgZXhpc3RhbmNlSW5ZZWFycyhiaXJ0aGRheSkge1xyXG4gICAgICAgIHZhciB0b2RheSA9IG5ldyBEYXRlKCk7XHJcbiAgICAgICAgdmFyIGFnZSA9IHRvZGF5LmdldFVUQ0Z1bGxZZWFyKCkgLSBiaXJ0aGRheS5nZXRVVENGdWxsWWVhcigpO1xyXG4gICAgICAgIHZhciBtID0gdG9kYXkuZ2V0VVRDTW9udGgoKSAtIGJpcnRoZGF5LmdldFVUQ01vbnRoKCk7XHJcbiAgICAgICAgaWYgKG0gPCAwIHx8IChtID09PSAwICYmIHRvZGF5LmdldFVUQ0RhdGUoKSA8IGJpcnRoZGF5LmdldFVUQ0RhdGUoKSkpIHtcclxuICAgICAgICAgICAgYWdlLS07XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBhZ2U7XHJcbiAgICB9XHJcblxyXG4gICA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1cmlublwiIGhlcmU6IGh0dHBzOi8vaXMud2lraXBlZGlhLm9yZy93aWtpL0tlbm5pdGFsYScsXHJcbiAgICAgICAgICAgICAgICBlcnJvckNvZGU6IDQsXHJcbiAgICAgICAgICAgIH07XHJcblxyXG4gICAgICAgIC8vVmFsaWRhdGluZyBkaWdpdCAxMFxyXG4gICAgICAgIGNvbnN0IGxhc3REaWdpdCA9IHBhcnNlSW50KGxpc3RbOV0sIDEwKTtcclxuICAgICAgICBpZiAoIShsYXN0RGlnaXQgPT09IDAgfHwgbGFzdERpZ2l0ID09PSA4IHx8IGxhc3REaWdpdCA9PT0gOSkpXHJcbiAgICAgICAgICAgIHJldHVybiB7XHJcbiAgICAgICAgICAgICAgICB2YWxpZDogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICByZWFzb246ICdDZW50dXJ5IGRpZ2l0IG91dCBvZiByYW5nZSAoZGlnaXQgMTApJyxcclxuICAgICAgICAgICAgICAgIGVycm9yQ29kZTogNSxcclxuICAgICAgICAgICAgfTtcclxuXHJcbiAgICAgICAgcmV0dXJuIHsgdmFsaWQ6IHRydWUgfTtcclxuICAgIH1cclxuXHJcbiAgICBjYWxjdWxhdGVWYXJ0YWxhKGxpc3QsIGluY3JlbWVudFJhZHRhbGEpIHtcclxuICAgICAgICAvLyBWYXJ0YWxhIGlzIGRpZ2l0IG51bWJlciA5XHJcbiAgICAgICAgLy8gVGhpcyB1cmwgZXhwbGFpbnMgaG93IGl0cyBjYWxjdWxhdGVkOiBodHRwczovL2lzLndpa2lwZWRpYS5vcmcvd2lraS9LZW5uaXRhbGEnXHJcblxyXG4gICAgICAgIGlmIChpbmNyZW1lbnRSYWR0YWxhKSB7XHJcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFJhZHRhbGErKztcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGNvbnN0IHJhZHRhbGEgPSAoJzAnICsgdGhpcy5jdXJyZW50UmFkdGFsYS50b1N0cmluZygpKS5zbGljZSgtMikuc3BsaXQoJycpO1xyXG5cclxuICAgICAgICBjb25zdCByYWR0YWxhT25lID0gcGFyc2VJbnQocmFkdGFsYVswXSwgMTApO1xyXG4gICAgICAgIGNvbnN0IHJhZHRhbGFUd28gPSBwYXJzZUludChyYWR0YWxhWzFdLCAxMCk7XHJcblxyXG4gICAgICAgIGNvbnN0IHN1bSA9XHJcbiAgICAgICAgICAgIGxpc3RbMF0gKiAzICtcclxuICAgICAgICAgICAgbGlzdFsxXSAqIDIgK1xyXG4gICAgICAgICAgICBsaXN0WzJdICogNyArXHJcbiAgICAgICAgICAgIGxpc3RbM10gKiA2ICtcclxuICAgICAgICAgICAgbGlzdFs0XSAqIDUgK1xyXG4gICAgICAgICAgICBsaXN0WzVdICogNCArXHJcbiAgICAgICAgICAgIHJhZHRhbGFPbmUgKiAzICtcclxuICAgICAgICAgICAgcmFkdGFsYVR3byAqIDI7XHJcblxyXG4gICAgICAgIGxldCBtb2QgPSBzdW0gJSAxMTtcclxuXHJcbiAgICAgICAgY29uc3QgdmFydGFsYSA9IG1vZCA9PT0gMCA/IDAgOiAxMSAtIG1vZDtcclxuICAgICAgICByZXR1cm4gdmFydGFsYTtcclxuICAgIH1cclxuXHJcbiAgICB2YWxpZGF0ZU5pbmUobGlzdCkge1xyXG4gICAgICAgIGxldCB2YXJ0YWxhID0gdGhpcy5jYWxjdWxhdGVWYXJ0YWxhKGxpc3QpO1xyXG5cclxuICAgICAgICBpZiAodmFydGFsYSA9PT0gMTApIHtcclxuICAgICAgICAgICAgbGV0IHYgPSAxMDtcclxuICAgICAgICAgICAgd2hpbGUgKHYgPT09IDEwKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjYWxjQWdhaW4gPSB0aGlzLmNhbGN1bGF0ZVZhcnRhbGEobGlzdCwgdHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICBpZiAoY2FsY0FnYWluICE9PSAxMCkgdmFydGFsYSA9IGNhbGNBZ2FpbjtcclxuICAgICAgICAgICAgICAgIHYgPSBjYWxjQWdhaW47XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmICh2YXJ0YWxhID09PSBwYXJzZUludChsaXN0WzhdLCAxMCkpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICB9XHJcbn1cclxuXHJcbmdsb2JhbC5LZW5uaXRhbGEgPSBLZW5uaXRhbGE7XHJcbiJdfQ==
}).call(this,require("U9cQDF"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_8c055d81.js","/")
},{"U9cQDF":3,"buffer":4}],2:[function(require,module,exports){
(function (process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){
'use strict';
var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
;(function (exports) {
'use strict';
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
var PLUS = '+'.charCodeAt(0);
var SLASH = '/'.charCodeAt(0);
var NUMBER = '0'.charCodeAt(0);
var LOWER = 'a'.charCodeAt(0);
var UPPER = 'A'.charCodeAt(0);
var PLUS_URL_SAFE = '-'.charCodeAt(0);
var SLASH_URL_SAFE = '_'.charCodeAt(0);
function decode(elt) {
var code = elt.charCodeAt(0);
if (code === PLUS || code === PLUS_URL_SAFE) return 62; // '+'
if (code === SLASH || code === SLASH_URL_SAFE) return 63; // '/'
if (code < NUMBER) return -1; //no match
if (code < NUMBER + 10) return code - NUMBER + 26 + 26;
if (code < UPPER + 26) return code - UPPER;
if (code < LOWER + 26) return code - LOWER + 26;
}
function b64ToByteArray(b64) {
var i, j, l, tmp, placeHolders, arr;
if (b64.length % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4');
}
// the number of equal signs (place holders)
// if there are two placeholders, than the two characters before it
// represent one byte
// if there is only one, then the three characters before it represent 2 bytes
// this is just a cheap hack to not do indexOf twice
var len = b64.length;
placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0;
// base64 is 4/3 + up to two characters of the original data
arr = new Arr(b64.length * 3 / 4 - placeHolders);
// if there are placeholders, only get up to the last complete 4 chars
l = placeHolders > 0 ? b64.length - 4 : b64.length;
var L = 0;
function push(v) {
arr[L++] = v;
}
for (i = 0, j = 0; i < l; i += 4, j += 3) {
tmp = decode(b64.charAt(i)) << 18 | decode(b64.charAt(i + 1)) << 12 | decode(b64.charAt(i + 2)) << 6 | decode(b64.charAt(i + 3));
push((tmp & 0xFF0000) >> 16);
push((tmp & 0xFF00) >> 8);
push(tmp & 0xFF);
}
if (placeHolders === 2) {
tmp = decode(b64.charAt(i)) << 2 | decode(b64.charAt(i + 1)) >> 4;
push(tmp & 0xFF);
} else if (placeHolders === 1) {
tmp = decode(b64.charAt(i)) << 10 | decode(b64.charAt(i + 1)) << 4 | decode(b64.charAt(i + 2)) >> 2;
push(tmp >> 8 & 0xFF);
push(tmp & 0xFF);
}
return arr;
}
function uint8ToBase64(uint8) {
var i,
extraBytes = uint8.length % 3,
// if we have 1 byte left, pad 2 bytes
output = "",
temp,
length;
function encode(num) {
return lookup.charAt(num);
}
function tripletToBase64(num) {
return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F);
}
// go through the array every three bytes, we'll deal with trailing stuff later
for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2];
output += tripletToBase64(temp);
}
// pad the end with zeros, but make sure to not forget the extra bytes
switch (extraBytes) {
case 1:
temp = uint8[uint8.length - 1];
output += encode(temp >> 2);
output += encode(temp << 4 & 0x3F);
output += '==';
break;
case 2:
temp = (uint8[uint8.length - 2] << 8) + uint8[uint8.length - 1];
output += encode(temp >> 10);
output += encode(temp >> 4 & 0x3F);
output += encode(temp << 2 & 0x3F);
output += '=';
break;
}
return output;
}
exports.toByteArray = b64ToByteArray;
exports.fromByteArray = uint8ToBase64;
})(typeof exports === 'undefined' ? undefined.base64js = {} : exports);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImI2NC5qcyJdLCJuYW1lcyI6WyJsb29rdXAiLCJleHBvcnRzIiwiQXJyIiwiVWludDhBcnJheSIsIkFycmF5IiwiUExVUyIsImNoYXJDb2RlQXQiLCJTTEFTSCIsIk5VTUJFUiIsIkxPV0VSIiwiVVBQRVIiLCJQTFVTX1VSTF9TQUZFIiwiU0xBU0hfVVJMX1NBRkUiLCJkZWNvZGUiLCJlbHQiLCJjb2RlIiwiYjY0VG9CeXRlQXJyYXkiLCJiNjQiLCJpIiwiaiIsImwiLCJ0bXAiLCJwbGFjZUhvbGRlcnMiLCJhcnIiLCJsZW5ndGgiLCJFcnJvciIsImxlbiIsImNoYXJBdCIsIkwiLCJwdXNoIiwidiIsInVpbnQ4VG9CYXNlNjQiLCJ1aW50OCIsImV4dHJhQnl0ZXMiLCJvdXRwdXQiLCJ0ZW1wIiwiZW5jb2RlIiwibnVtIiwidHJpcGxldFRvQmFzZTY0IiwidG9CeXRlQXJyYXkiLCJmcm9tQnl0ZUFycmF5IiwiYmFzZTY0anMiXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBSUEsU0FBUyxrRUFBYjs7QUFFQSxDQUFFLFdBQVVDLE9BQVYsRUFBbUI7QUFDcEI7O0FBRUMsS0FBSUMsTUFBTyxPQUFPQyxVQUFQLEtBQXNCLFdBQXZCLEdBQ05BLFVBRE0sR0FFTkMsS0FGSjs7QUFJRCxLQUFJQyxPQUFTLElBQUlDLFVBQUosQ0FBZSxDQUFmLENBQWI7QUFDQSxLQUFJQyxRQUFTLElBQUlELFVBQUosQ0FBZSxDQUFmLENBQWI7QUFDQSxLQUFJRSxTQUFTLElBQUl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9IGVuY29kZSgodGVtcCA8PCAyKSAmIDB4M0YpXG5cdFx0XHRcdG91dHB1dCArPSAnPSdcblx0XHRcdFx0YnJlYWtcblx0XHR9XG5cblx0XHRyZXR1cm4gb3V0cHV0XG5cdH1cblxuXHRleHBvcnRzLnRvQnl0ZUFycmF5ID0gYjY0VG9CeXRlQXJyYXlcblx0ZXhwb3J0cy5mcm9tQnl0ZUFycmF5ID0gdWludDhUb0Jhc2U2NFxufSh0eXBlb2YgZXhwb3J0cyA9PT0gJ3VuZGVmaW5lZCcgPyAodGhpcy5iYXNlNjRqcyA9IHt9KSA6IGV4cG9ydHMpKVxuIl19
}).call(this,require("U9cQDF"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/..\\..\\..\\..\\Óli Tómas\\jobs\\kennitalajs\\node_modules\\base64-js\\lib\\b64.js","/..\\..\\..\\..\\Óli Tómas\\jobs\\kennitalajs\\node_modules\\base64-js\\lib")
},{"U9cQDF":3,"buffer":4}],3:[function(require,module,exports){
(function (process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){
'use strict';
// shim for using process in browser
var process = module.exports = {};
process.nextTick = function () {
var canSetImmediate = typeof window !== 'undefined' && window.setImmediate;
var canPost = typeof window !== 'undefined' && window.postMessage && window.addEventListener;
if (canSetImmediate) {
return function (f) {
return window.setImmediate(f);
};
}
if (canPost) {
var queue = [];
window.addEventListener('message', function (ev) {
var source = ev.source;
if ((source === window || source === null) && ev.data === 'process-tick') {
ev.stopPropagation();
if (queue.length > 0) {
var fn = queue.shift();
fn();
}
}
}, true);
return function nextTick(fn) {
queue.push(fn);
window.postMessage('process-tick', '*');
};
}
return function nextTick(fn) {
setTimeout(fn, 0);
};
}();
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
// TODO(shtylman)
process.cwd = function () {
return '/';
};
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJyb3dzZXIuanMiXSwibmFtZXMiOlsicHJvY2VzcyIsIm1vZHVsZSIsImV4cG9ydHMiLCJuZXh0VGljayIsImNhblNldEltbWVkaWF0ZSIsIndpbmRvdyIsInNldEltbWVkaWF0ZSIsImNhblBvc3QiLCJwb3N0TWVzc2FnZSIsImFkZEV2ZW50TGlzdGVuZXIiLCJmIiwicXVldWUiLCJldiIsInNvdXJjZSIsImRhdGEiLCJzdG9wUHJvcGFnYXRpb24iLCJsZW5ndGgiLCJmbiIsInNoaWZ0IiwicHVzaCIsInNldFRpbWVvdXQiLCJ0aXRsZSIsImJyb3dzZXIiLCJlbnYiLCJhcmd2Iiwibm9vcCIsIm9uIiwiYWRkTGlzdGVuZXIiLCJvbmNlIiwib2ZmIiwicmVtb3ZlTGlzdGVuZXIiLCJyZW1vdmVBbGxMaXN0ZW5lcnMiLCJlbWl0IiwiYmluZGluZyIsIm5hbWUiLCJFcnJvciIsImN3ZCIsImNoZGlyIiwiZGlyIl0sIm1hcHBpbmdzIjoiOztBQUFBOztBQUVBLElBQUlBLFVBQVVDLE9BQU9DLE9BQVAsR0FBaUIsRUFBL0I7O0FBRUFGLFFBQVFHLFFBQVIsR0FBb0IsWUFBWTtBQUM1QixRQUFJQyxrQkFBa0IsT0FBT0MsTUFBUCxLQUFrQixXQUFsQixJQUNuQkEsT0FBT0MsWUFEVjtBQUVBLFFBQUlDLFVBQVUsT0FBT0YsTUFBUCxLQUFrQixXQUFsQixJQUNYQSxPQUFPRyxXQURJLElBQ1dILE9BQU9JLGdCQURoQzs7QUFJQSxRQUFJTCxlQUFKLEVBQXFCO0FBQ2pCLGVBQU8sVUFBVU0sQ0FBVixFQUFhO0FBQUUsb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tdO1xuXG5mdW5jdGlvbiBub29wKCkge31cblxucHJvY2Vzcy5vbiA9IG5vb3A7XG5wcm9jZXNzLmFkZExpc3RlbmVyID0gbm9vcDtcbnByb2Nlc3Mub25jZSA9IG5vb3A7XG5wcm9jZXNzLm9mZiA9IG5vb3A7XG5wcm9jZXNzLnJlbW92ZUxpc3RlbmVyID0gbm9vcDtcbnByb2Nlc3MucmVtb3ZlQWxsTGlzdGVuZXJzID0gbm9vcDtcbnByb2Nlc3MuZW1pdCA9IG5vb3A7XG5cbnByb2Nlc3MuYmluZGluZyA9IGZ1bmN0aW9uIChuYW1lKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdwcm9jZXNzLmJpbmRpbmcgaXMgbm90IHN1cHBvcnRlZCcpO1xufVxuXG4vLyBUT0RPKHNodHlsbWFuKVxucHJvY2Vzcy5jd2QgPSBmdW5jdGlvbiAoKSB7IHJldHVybiAnLycgfTtcbnByb2Nlc3MuY2hkaXIgPSBmdW5jdGlvbiAoZGlyKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdwcm9jZXNzLmNoZGlyIGlzIG5vdCBzdXBwb3J0ZWQnKTtcbn07XG4iXX0=
}).call(this,require("U9cQDF"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/..\\..\\..\\..\\Óli Tómas\\jobs\\kennitalajs\\node_modules\\browserify\\node_modules\\process\\browser.js","/..\\..\\..\\..\\Óli Tómas\\jobs\\kennitalajs\\node_modules\\browserify\\node_modules\\process")
},{"U9cQDF":3,"buffer":4}],4:[function(require,module,exports){
(function (process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var base64 = require('base64-js');
var ieee754 = require('ieee754');
exports.Buffer = Buffer;
exports.SlowBuffer = Buffer;
exports.INSPECT_MAX_BYTES = 50;
Buffer.poolSize = 8192;
/**
* If `Buffer._useTypedArrays`:
* === true Use Uint8Array implementation (fastest)
* === false Use Object implementation (compatible down to IE6)
*/
Buffer._useTypedArrays = function () {
// Detect if browser supports Typed Arrays. Supported browsers are IE 10+, Firefox 4+,
// Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+. If the browser does not support adding
// properties to `Uint8Array` instances, then that's the same as no `Uint8Array` support
// because we need to be able to add all the node Buffer API methods. This is an issue
// in Firefox 4-29. Now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438
try {
var buf = new ArrayBuffer(0);
var arr = new Uint8Array(buf);
arr.foo = function () {
return 42;
};
return 42 === arr.foo() && typeof arr.subarray === 'function'; // Chrome 9-10 lack `subarray`
} catch (e) {
return false;
}
}();
/**
* Class: Buffer
* =============
*
* The Buffer constructor returns instances of `Uint8Array` that are augmented
* with function properties for all the node `Buffer` API functions. We use
* `Uint8Array` so that square bracket notation works as expected -- it returns
* a single octet.
*
* By augmenting the instances, we can avoid modifying the `Uint8Array`
* prototype.
*/
function Buffer(subject, encoding, noZero) {
if (!(this instanceof Buffer)) return new Buffer(subject, encoding, noZero);
var type = typeof subject === 'undefined' ? 'undefined' : _typeof(subject);
// Workaround: node's base64 implementation allows for non-padded strings
// while base64-js does not.
if (encoding === 'base64' && type === 'string') {
subject = stringtrim(subject);
while (subject.length % 4 !== 0) {
subject = subject + '=';
}
}
// Find the length
var length;
if (type === 'number') length = coerce(subject);else if (type === 'string') length = Buffer.byteLength(subject, encoding);else if (type === 'object') length = coerce(subject.length); // assume that object is array-like
else throw new Error('First argument needs to be a number, array or string.');
var buf;
if (Buffer._useTypedArrays) {
// Preferred: Return an augmented `Uint8Array` instance for best performance
buf = Buffer._augment(new Uint8Array(length));
} else {
// Fallback: Return THIS instance of Buffer (created by `new`)
buf = this;
buf.length = length;
buf._isBuffer = true;
}
var i;
if (Buffer._useTypedArrays && typeof subject.byteLength === 'number') {
// Speed optimization -- use set if we're copying from a typed array
buf._set(subject);
} else if (isArrayish(subject)) {
// Treat array-ish objects as a byte array
for (i = 0; i < length; i++) {
if (Buffer.isBuffer(subject)) buf[i] = subject.readUInt8(i);else buf[i] = subject[i];
}
} else if (type === 'string') {
buf.write(subject, 0, encoding);
} else if (type === 'number' && !Buffer._useTypedArrays && !noZero) {
for (i = 0; i < length; i++) {
buf[i] = 0;
}
}
return buf;
}
// STATIC METHODS
// ==============
Buffer.isEncoding = function (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'binary':
case 'base64':
case 'raw':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true;
default:
return false;
}
};
Buffer.isBuffer = function (b) {
return !!(b !== null && b !== undefined && b._isBuffer);
};
Buffer.byteLength = function (str, encoding) {
var ret;
str = str + '';
switch (encoding || 'utf8') {
case 'hex':
ret = str.length / 2;
break;
case 'utf8':
case 'utf-8':
ret = utf8ToBytes(str).length;
break;
case 'ascii':
case 'binary':
case 'raw':
ret = str.length;
break;
case 'base64':
ret = base64ToBytes(str).length;
break;
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
ret = str.length * 2;
break;
default:
throw new Error('Unknown encoding');
}
return ret;
};
Buffer.concat = function (list, totalLength) {
assert(isArray(list), 'Usage: Buffer.concat(list, [totalLength])\n' + 'list should be an Array.');
if (list.length === 0) {
return new Buffer(0);
} else if (list.length === 1) {
return list[0];
}
var i;
if (typeof totalLength !== 'number') {
totalLength = 0;
for (i = 0; i < list.length; i++) {
totalLength += list[i].length;
}
}
var buf = new Buffer(totalLength);
var pos = 0;
for (i = 0; i < list.length; i++) {
var item = list[i];
item.copy(buf, pos);
pos += item.length;
}
return buf;
};
// BUFFER INSTANCE METHODS
// =======================
function _hexWrite(buf, string, offset, length) {
offset = Number(offset) || 0;
var remaining = buf.length - offset;
if (!length) {
length = remaining;
} else {
length = Number(length);
if (length > remaining) {
length = remaining;
}
}
// must be an even number of digits
var strLen = string.length;
assert(strLen % 2 === 0, 'Invalid hex string');
if (length > strLen / 2) {
length = strLen / 2;
}
for (var i = 0; i < length; i++) {
var byte = parseInt(string.substr(i * 2, 2), 16);
assert(!isNaN(byte), 'Invalid hex string');
buf[offset + i] = byte;
}
Buffer._charsWritten = i * 2;
return i;
}
function _utf8Write(buf, string, offset, length) {
var charsWritten = Buffer._charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length);
return charsWritten;
}
function _asciiWrite(buf, string, offset, length) {
var charsWritten = Buffer._charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length);
return charsWritten;
}
function _binaryWrite(buf, string, offset, length) {
return _asciiWrite(buf, string, offset, length);
}
function _base64Write(buf, string, offset, length) {
var charsWritten = Buffer._charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length);
return charsWritten;
}
function _utf16leWrite(buf, string, offset, length) {
var charsWritten = Buffer._charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length);
return charsWritten;
}
Buffer.prototype.write = function (string, offset, length, encoding) {
// Support both (string, offset, length, encoding)
// and the legacy (string, encoding, offset, length)
if (isFinite(offset)) {
if (!isFinite(length)) {
encoding = length;
length = undefined;
}
} else {
// legacy
var swap = encoding;
encoding = offset;
offset = length;
length = swap;
}
offset = Number(offset) || 0;
var remaining = this.length - offset;
if (!length) {
length = remaining;
} else {
length = Number(length);
if (length > remaining) {
length = remaining;
}
}
encoding = String(encoding || 'utf8').toLowerCase();
var ret;
switch (encoding) {
case 'hex':
ret = _hexWrite(this, string, offset, length);
break;
case 'utf8':
case 'utf-8':
ret = _utf8Write(this, string, offset, length);
break;
case 'ascii':
ret = _asciiWrite(this, string, offset, length);
break;
case 'binary':
ret = _binaryWrite(this, string, offset, length);
break;
case 'base64':
ret = _base64Write(this, string, offset, length);
break;
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
ret = _utf16leWrite(this, string, offset, length);
break;
default:
throw new Error('Unknown encoding');
}
return ret;
};
Buffer.prototype.toString = function (encoding, start, end) {
var self = this;
encoding = String(encoding || 'utf8').toLowerCase();
start = Number(start) || 0;
end = end !== undefined ? Number(end) : end = self.length;
// Fastpath empty strings
if (end === start) return '';
var ret;
switch (encoding) {
case 'hex':
ret = _hexSlice(self, start, end);
break;
case 'utf8':
case 'utf-8':
ret = _utf8Slice(self, start, end);
break;
case 'ascii':
ret = _asciiSlice(self, start, end);
break;
case 'binary':
ret = _binarySlice(self, start, end);
break;
case 'base64':
ret = _base64Slice(self, start, end);
break;
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
ret = _utf16leSlice(self, start, end);
break;
default:
throw new Error('Unknown encoding');
}
return ret;
};
Buffer.prototype.toJSON = function () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0)
};
};
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function (target, target_start, start, end) {
var source = this;
if (!start) start = 0;
if (!end && end !== 0) end = this.length;
if (!target_start) target_start = 0;
// Copy 0 bytes; we're done
if (end === start) return;
if (target.length === 0 || source.length === 0) return;
// Fatal error conditions
assert(end >= start, 'sourceEnd < sourceStart');
assert(target_start >= 0 && target_start < target.length, 'targetStart out of bounds');
assert(start >= 0 && start < source.length, 'sourceStart out of bounds');
assert(end >= 0 && end <= source.length, 'sourceEnd out of bounds');
// Are we oob?
if (end > this.length) end = this.length;
if (target.length - target_start < end - start) end = target.length - target_start + start;
var len = end - start;
if (len < 100 || !Buffer._useTypedArrays) {
for (var i = 0; i < len; i++) {
target[i + target_start] = this[i + start];
}
} else {
target._set(this.subarray(start, start + len), target_start);
}
};
function _base64Slice(buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf);
} else {
return base64.fromByteArray(buf.slice(start, end));
}
}
function _utf8Slice(buf, start, end) {
var res = '';
var tmp = '';
end = Math.min(buf.length, end);
for (var i = start; i < end; i++) {
if (buf[i] <= 0x7F) {
res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i]);
tmp = '';
} else {
tmp += '%' + buf[i].toString(16);
}
}
return res + decodeUtf8Char(tmp);
}
function _asciiSlice(buf, start, end) {
var ret = '';
end = Math.min(buf.length, end);
for (var i = start; i < end; i++) {
ret += String.fromCharCode(buf[i]);
}return ret;
}
function _binarySlice(buf, start, end) {
return _asciiSlice(buf, start, end);
}
function _hexSlice(buf, start, end) {
var len = buf.length;
if (!start || start < 0) start = 0;
if (!end || end < 0 || end > len) end = len;
var out = '';
for (var i = start; i < end; i++) {
out += toHex(buf[i]);
}
return out;
}
function _utf16leSlice(buf, start, end) {
var bytes = buf.slice(start, end);
var res = '';
for (var i = 0; i < bytes.length; i += 2) {
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
}
return res;
}
Buffer.prototype.slice = function (start, end) {
var len = this.length;
start = clamp(start, len, 0);
end = clamp(end, len, len);
if (Buffer._useTypedArrays) {
return Buffer._augment(this.subarray(start, end));
} else {
var sliceLen = end - start;
var newBuf = new Buffer(sliceLen, undefined, true);
for (var i = 0; i < sliceLen; i++) {
newBuf[i] = this[i + start];
}
return newBuf;
}
};
// `get` will be removed in Node 0.13+
Buffer.prototype.get = function (offset) {
console.log('.get() is deprecated. Access using array indexes instead.');
return this.readUInt8(offset);
};
// `set` will be removed in Node 0.13+
Buffer.prototype.set = function (v, offset) {
console.log('.set() is deprecated. Access using array indexes instead.');
return this.writeUInt8(v, offset);
};
Buffer.prototype.readUInt8 = function (offset, noAssert) {
if (!noAssert) {
assert(offset !== undefined && offset !== null, 'missing offset');
assert(offset < this.length, 'Trying to read beyond buffer length');
}
if (offset >= this.length) return;
return this[offset];
};
function _readUInt16(buf, offset, littleEndian, noAssert) {
if (!noAssert) {
assert(typeof littleEndian === 'boolean', 'missing or invalid endian');
assert(offset !== undefined && offset !== null, 'missing offset');
assert(offset + 1 < buf.length, 'Trying to read beyond buffer length');
}
var len = buf.length;
if (offset >= len) return;
var val;
if (littleEndian) {
val = buf[offset];
if (offset + 1 < len) val |= buf[offset + 1] << 8;
} else {
val = buf[offset] << 8;
if (offset + 1 < len) val |= buf[offset + 1];
}
return val;
}
Buffer.prototype.readUInt16LE = function (offset, noAssert) {
return _readUInt16(this, offset, true, noAssert);
};
Buffer.prototype.readUInt16BE = function (offset, noAssert) {
return _readUInt16(this, offset, false, noAssert);
};
function _readUInt32(buf, offset, littleEndian, noAssert) {
if (!noAssert) {
assert(typeof littleEndian === 'boolean', 'missing or invalid endian');
assert(offset !== undefined && offset !== null, 'missing offset');
assert(offset + 3 < buf.length, 'Trying to read beyond buffer length');
}
var len = buf.length;
if (offset >= len) return;
var val;
if (littleEndian) {
if (offset + 2 < len) val = buf[offset + 2] << 16;
if (offset + 1 < len) val |= buf[offset + 1] << 8;
val |= buf[offset];
if (offset + 3 < len) val = val + (buf[offset + 3] << 24 >>> 0);
} else {
if (offset + 1 < len) val = buf[offset + 1] << 16;
if (offset + 2 < len) val |= buf[offset + 2] << 8;
if (offset + 3 < len) val |= buf[offset + 3];
val = val + (buf[offset] << 24 >>> 0);
}
return val;
}
Buffer.prototype.readUInt32LE = function (offset, noAssert) {
return _readUInt32(this, offset, true, noAssert);
};
Buffer.prototype.readUInt32BE = function (offset, noAssert) {
return _readUInt32(this, offset, false, noAssert);
};
Buffer.prototype.readInt8 = function (offset, noAssert) {
if (!noAssert) {
assert(offset !== undefined && offset !== null, 'missing offset');
assert(offset < this.length, 'Trying to read beyond buffer length');
}
if (offset >= this.length) return;
var neg = this[offset] & 0x80;