@livechat/accounts-sdk 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -4,13 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var qs = require('qs');
6
6
  var Cookie = require('js-cookie');
7
- var sjcl = require('sjcl');
8
7
 
9
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
9
 
11
10
  var qs__default = /*#__PURE__*/_interopDefaultLegacy(qs);
12
11
  var Cookie__default = /*#__PURE__*/_interopDefaultLegacy(Cookie);
13
- var sjcl__default = /*#__PURE__*/_interopDefaultLegacy(sjcl);
14
12
 
15
13
  var errors = {
16
14
  extend: function (error) {
@@ -501,6 +499,671 @@ class Transaction {
501
499
  }
502
500
  }
503
501
 
502
+ /** @fileOverview Javascript cryptography implementation.
503
+ *
504
+ * Crush to remove comments, shorten variable names and
505
+ * generally reduce transmission size.
506
+ *
507
+ * @author Emily Stark
508
+ * @author Mike Hamburg
509
+ * @author Dan Boneh
510
+ */
511
+ /*jslint indent: 2, bitwise: false, nomen: false, plusplus: false, white: false, regexp: false */
512
+ /*global document, window, escape, unescape, module, require, Uint32Array */
513
+
514
+ /**
515
+ * The Stanford Javascript Crypto Library, top-level namespace.
516
+ * @namespace
517
+ */
518
+ var sjcl = {
519
+ /**
520
+ * Symmetric ciphers.
521
+ * @namespace
522
+ */
523
+ cipher: {},
524
+
525
+ /**
526
+ * Hash functions. Right now only SHA256 is implemented.
527
+ * @namespace
528
+ */
529
+ hash: {},
530
+
531
+ /**
532
+ * Key exchange functions. Right now only SRP is implemented.
533
+ * @namespace
534
+ */
535
+ keyexchange: {},
536
+
537
+ /**
538
+ * Cipher modes of operation.
539
+ * @namespace
540
+ */
541
+ mode: {},
542
+
543
+ /**
544
+ * Miscellaneous. HMAC and PBKDF2.
545
+ * @namespace
546
+ */
547
+ misc: {},
548
+
549
+ /**
550
+ * Bit array encoders and decoders.
551
+ * @namespace
552
+ *
553
+ * @description
554
+ * The members of this namespace are functions which translate between
555
+ * SJCL's bitArrays and other objects (usually strings). Because it
556
+ * isn't always clear which direction is encoding and which is decoding,
557
+ * the method names are "fromBits" and "toBits".
558
+ */
559
+ codec: {},
560
+
561
+ /**
562
+ * Exceptions.
563
+ * @namespace
564
+ */
565
+ exception: {
566
+ /**
567
+ * Ciphertext is corrupt.
568
+ * @constructor
569
+ */
570
+ corrupt: function (message) {
571
+ this.toString = function () {
572
+ return 'CORRUPT: ' + this.message;
573
+ };
574
+ this.message = message;
575
+ },
576
+
577
+ /**
578
+ * Invalid parameter.
579
+ * @constructor
580
+ */
581
+ invalid: function (message) {
582
+ this.toString = function () {
583
+ return 'INVALID: ' + this.message;
584
+ };
585
+ this.message = message;
586
+ },
587
+
588
+ /**
589
+ * Bug or missing feature in SJCL.
590
+ * @constructor
591
+ */
592
+ bug: function (message) {
593
+ this.toString = function () {
594
+ return 'BUG: ' + this.message;
595
+ };
596
+ this.message = message;
597
+ },
598
+
599
+ /**
600
+ * Something isn't ready.
601
+ * @constructor
602
+ */
603
+ notReady: function (message) {
604
+ this.toString = function () {
605
+ return 'NOT READY: ' + this.message;
606
+ };
607
+ this.message = message;
608
+ },
609
+ },
610
+ };
611
+ /** @fileOverview Arrays of bits, encoded as arrays of Numbers.
612
+ *
613
+ * @author Emily Stark
614
+ * @author Mike Hamburg
615
+ * @author Dan Boneh
616
+ */
617
+
618
+ /**
619
+ * Arrays of bits, encoded as arrays of Numbers.
620
+ * @namespace
621
+ * @description
622
+ * <p>
623
+ * These objects are the currency accepted by SJCL's crypto functions.
624
+ * </p>
625
+ *
626
+ * <p>
627
+ * Most of our crypto primitives operate on arrays of 4-byte words internally,
628
+ * but many of them can take arguments that are not a multiple of 4 bytes.
629
+ * This library encodes arrays of bits (whose size need not be a multiple of 8
630
+ * bits) as arrays of 32-bit words. The bits are packed, big-endian, into an
631
+ * array of words, 32 bits at a time. Since the words are double-precision
632
+ * floating point numbers, they fit some extra data. We use this (in a private,
633
+ * possibly-changing manner) to encode the number of bits actually present
634
+ * in the last word of the array.
635
+ * </p>
636
+ *
637
+ * <p>
638
+ * Because bitwise ops clear this out-of-band data, these arrays can be passed
639
+ * to ciphers like AES which want arrays of words.
640
+ * </p>
641
+ */
642
+ sjcl.bitArray = {
643
+ /**
644
+ * Array slices in units of bits.
645
+ * @param {bitArray} a The array to slice.
646
+ * @param {Number} bstart The offset to the start of the slice, in bits.
647
+ * @param {Number} bend The offset to the end of the slice, in bits. If this is undefined,
648
+ * slice until the end of the array.
649
+ * @return {bitArray} The requested slice.
650
+ */
651
+ bitSlice: function (a, bstart, bend) {
652
+ a = sjcl.bitArray
653
+ ._shiftRight(a.slice(bstart / 32), 32 - (bstart & 31))
654
+ .slice(1);
655
+ return bend === undefined ? a : sjcl.bitArray.clamp(a, bend - bstart);
656
+ },
657
+
658
+ /**
659
+ * Extract a number packed into a bit array.
660
+ * @param {bitArray} a The array to slice.
661
+ * @param {Number} bstart The offset to the start of the slice, in bits.
662
+ * @param {Number} blength The length of the number to extract.
663
+ * @return {Number} The requested slice.
664
+ */
665
+ extract: function (a, bstart, blength) {
666
+ // FIXME: this Math.floor is not necessary at all, but for some reason
667
+ // seems to suppress a bug in the Chromium JIT.
668
+ var x,
669
+ sh = Math.floor((-bstart - blength) & 31);
670
+ if (((bstart + blength - 1) ^ bstart) & -32) {
671
+ // it crosses a boundary
672
+ x =
673
+ (a[(bstart / 32) | 0] << (32 - sh)) ^ (a[(bstart / 32 + 1) | 0] >>> sh);
674
+ } else {
675
+ // within a single word
676
+ x = a[(bstart / 32) | 0] >>> sh;
677
+ }
678
+ return x & ((1 << blength) - 1);
679
+ },
680
+
681
+ /**
682
+ * Concatenate two bit arrays.
683
+ * @param {bitArray} a1 The first array.
684
+ * @param {bitArray} a2 The second array.
685
+ * @return {bitArray} The concatenation of a1 and a2.
686
+ */
687
+ concat: function (a1, a2) {
688
+ if (a1.length === 0 || a2.length === 0) {
689
+ return a1.concat(a2);
690
+ }
691
+
692
+ var last = a1[a1.length - 1],
693
+ shift = sjcl.bitArray.getPartial(last);
694
+ if (shift === 32) {
695
+ return a1.concat(a2);
696
+ } else {
697
+ return sjcl.bitArray._shiftRight(
698
+ a2,
699
+ shift,
700
+ last | 0,
701
+ a1.slice(0, a1.length - 1)
702
+ );
703
+ }
704
+ },
705
+
706
+ /**
707
+ * Find the length of an array of bits.
708
+ * @param {bitArray} a The array.
709
+ * @return {Number} The length of a, in bits.
710
+ */
711
+ bitLength: function (a) {
712
+ var l = a.length,
713
+ x;
714
+ if (l === 0) {
715
+ return 0;
716
+ }
717
+ x = a[l - 1];
718
+ return (l - 1) * 32 + sjcl.bitArray.getPartial(x);
719
+ },
720
+
721
+ /**
722
+ * Truncate an array.
723
+ * @param {bitArray} a The array.
724
+ * @param {Number} len The length to truncate to, in bits.
725
+ * @return {bitArray} A new array, truncated to len bits.
726
+ */
727
+ clamp: function (a, len) {
728
+ if (a.length * 32 < len) {
729
+ return a;
730
+ }
731
+ a = a.slice(0, Math.ceil(len / 32));
732
+ var l = a.length;
733
+ len = len & 31;
734
+ if (l > 0 && len) {
735
+ a[l - 1] = sjcl.bitArray.partial(
736
+ len,
737
+ a[l - 1] & (0x80000000 >> (len - 1)),
738
+ 1
739
+ );
740
+ }
741
+ return a;
742
+ },
743
+
744
+ /**
745
+ * Make a partial word for a bit array.
746
+ * @param {Number} len The number of bits in the word.
747
+ * @param {Number} x The bits.
748
+ * @param {Number} [_end=0] Pass 1 if x has already been shifted to the high side.
749
+ * @return {Number} The partial word.
750
+ */
751
+ partial: function (len, x, _end) {
752
+ if (len === 32) {
753
+ return x;
754
+ }
755
+ return (_end ? x | 0 : x << (32 - len)) + len * 0x10000000000;
756
+ },
757
+
758
+ /**
759
+ * Get the number of bits used by a partial word.
760
+ * @param {Number} x The partial word.
761
+ * @return {Number} The number of bits used by the partial word.
762
+ */
763
+ getPartial: function (x) {
764
+ return Math.round(x / 0x10000000000) || 32;
765
+ },
766
+
767
+ /**
768
+ * Compare two arrays for equality in a predictable amount of time.
769
+ * @param {bitArray} a The first array.
770
+ * @param {bitArray} b The second array.
771
+ * @return {boolean} true if a == b; false otherwise.
772
+ */
773
+ equal: function (a, b) {
774
+ if (sjcl.bitArray.bitLength(a) !== sjcl.bitArray.bitLength(b)) {
775
+ return false;
776
+ }
777
+ var x = 0,
778
+ i;
779
+ for (i = 0; i < a.length; i++) {
780
+ x |= a[i] ^ b[i];
781
+ }
782
+ return x === 0;
783
+ },
784
+
785
+ /** Shift an array right.
786
+ * @param {bitArray} a The array to shift.
787
+ * @param {Number} shift The number of bits to shift.
788
+ * @param {Number} [carry=0] A byte to carry in
789
+ * @param {bitArray} [out=[]] An array to prepend to the output.
790
+ * @private
791
+ */
792
+ _shiftRight: function (a, shift, carry, out) {
793
+ var i,
794
+ last2 = 0,
795
+ shift2;
796
+ if (out === undefined) {
797
+ out = [];
798
+ }
799
+
800
+ for (; shift >= 32; shift -= 32) {
801
+ out.push(carry);
802
+ carry = 0;
803
+ }
804
+ if (shift === 0) {
805
+ return out.concat(a);
806
+ }
807
+
808
+ for (i = 0; i < a.length; i++) {
809
+ out.push(carry | (a[i] >>> shift));
810
+ carry = a[i] << (32 - shift);
811
+ }
812
+ last2 = a.length ? a[a.length - 1] : 0;
813
+ shift2 = sjcl.bitArray.getPartial(last2);
814
+ out.push(
815
+ sjcl.bitArray.partial(
816
+ (shift + shift2) & 31,
817
+ shift + shift2 > 32 ? carry : out.pop(),
818
+ 1
819
+ )
820
+ );
821
+ return out;
822
+ },
823
+
824
+ /** xor a block of 4 words together.
825
+ * @private
826
+ */
827
+ _xor4: function (x, y) {
828
+ return [x[0] ^ y[0], x[1] ^ y[1], x[2] ^ y[2], x[3] ^ y[3]];
829
+ },
830
+
831
+ /** byteswap a word array inplace.
832
+ * (does not handle partial words)
833
+ * @param {sjcl.bitArray} a word array
834
+ * @return {sjcl.bitArray} byteswapped array
835
+ */
836
+ byteswapM: function (a) {
837
+ var i,
838
+ v,
839
+ m = 0xff00;
840
+ for (i = 0; i < a.length; ++i) {
841
+ v = a[i];
842
+ a[i] = (v >>> 24) | ((v >>> 8) & m) | ((v & m) << 8) | (v << 24);
843
+ }
844
+ return a;
845
+ },
846
+ };
847
+ /** @fileOverview Bit array codec implementations.
848
+ *
849
+ * @author Emily Stark
850
+ * @author Mike Hamburg
851
+ * @author Dan Boneh
852
+ */
853
+
854
+ /**
855
+ * UTF-8 strings
856
+ * @namespace
857
+ */
858
+ sjcl.codec.utf8String = {
859
+ /** Convert from a bitArray to a UTF-8 string. */
860
+ fromBits: function (arr) {
861
+ var out = '',
862
+ bl = sjcl.bitArray.bitLength(arr),
863
+ i,
864
+ tmp;
865
+ for (i = 0; i < bl / 8; i++) {
866
+ if ((i & 3) === 0) {
867
+ tmp = arr[i / 4];
868
+ }
869
+ out += String.fromCharCode(((tmp >>> 8) >>> 8) >>> 8);
870
+ tmp <<= 8;
871
+ }
872
+ return decodeURIComponent(escape(out));
873
+ },
874
+
875
+ /** Convert from a UTF-8 string to a bitArray. */
876
+ toBits: function (str) {
877
+ str = unescape(encodeURIComponent(str));
878
+ var out = [],
879
+ i,
880
+ tmp = 0;
881
+ for (i = 0; i < str.length; i++) {
882
+ tmp = (tmp << 8) | str.charCodeAt(i);
883
+ if ((i & 3) === 3) {
884
+ out.push(tmp);
885
+ tmp = 0;
886
+ }
887
+ }
888
+ if (i & 3) {
889
+ out.push(sjcl.bitArray.partial(8 * (i & 3), tmp));
890
+ }
891
+ return out;
892
+ },
893
+ };
894
+ /** @fileOverview Javascript SHA-256 implementation.
895
+ *
896
+ * An older version of this implementation is available in the public
897
+ * domain, but this one is (c) Emily Stark, Mike Hamburg, Dan Boneh,
898
+ * Stanford University 2008-2010 and BSD-licensed for liability
899
+ * reasons.
900
+ *
901
+ * Special thanks to Aldo Cortesi for pointing out several bugs in
902
+ * this code.
903
+ *
904
+ * @author Emily Stark
905
+ * @author Mike Hamburg
906
+ * @author Dan Boneh
907
+ */
908
+
909
+ /**
910
+ * Context for a SHA-256 operation in progress.
911
+ * @constructor
912
+ */
913
+ sjcl.hash.sha256 = function (hash) {
914
+ if (!this._key[0]) {
915
+ this._precompute();
916
+ }
917
+ if (hash) {
918
+ this._h = hash._h.slice(0);
919
+ this._buffer = hash._buffer.slice(0);
920
+ this._length = hash._length;
921
+ } else {
922
+ this.reset();
923
+ }
924
+ };
925
+
926
+ /**
927
+ * Hash a string or an array of words.
928
+ * @static
929
+ * @param {bitArray|String} data the data to hash.
930
+ * @return {bitArray} The hash value, an array of 16 big-endian words.
931
+ */
932
+ sjcl.hash.sha256.hash = function (data) {
933
+ return new sjcl.hash.sha256().update(data).finalize();
934
+ };
935
+
936
+ sjcl.hash.sha256.prototype = {
937
+ /**
938
+ * The hash's block size, in bits.
939
+ * @constant
940
+ */
941
+ blockSize: 512,
942
+
943
+ /**
944
+ * Reset the hash state.
945
+ * @return this
946
+ */
947
+ reset: function () {
948
+ this._h = this._init.slice(0);
949
+ this._buffer = [];
950
+ this._length = 0;
951
+ return this;
952
+ },
953
+
954
+ /**
955
+ * Input several words to the hash.
956
+ * @param {bitArray|String} data the data to hash.
957
+ * @return this
958
+ */
959
+ update: function (data) {
960
+ if (typeof data === 'string') {
961
+ data = sjcl.codec.utf8String.toBits(data);
962
+ }
963
+ var i,
964
+ b = (this._buffer = sjcl.bitArray.concat(this._buffer, data)),
965
+ ol = this._length,
966
+ nl = (this._length = ol + sjcl.bitArray.bitLength(data));
967
+ if (nl > 9007199254740991) {
968
+ throw new sjcl.exception.invalid('Cannot hash more than 2^53 - 1 bits');
969
+ }
970
+
971
+ if (typeof Uint32Array !== 'undefined') {
972
+ var c = new Uint32Array(b);
973
+ var j = 0;
974
+ for (i = 512 + ol - ((512 + ol) & 511); i <= nl; i += 512) {
975
+ this._block(c.subarray(16 * j, 16 * (j + 1)));
976
+ j += 1;
977
+ }
978
+ b.splice(0, 16 * j);
979
+ } else {
980
+ for (i = 512 + ol - ((512 + ol) & 511); i <= nl; i += 512) {
981
+ this._block(b.splice(0, 16));
982
+ }
983
+ }
984
+ return this;
985
+ },
986
+
987
+ /**
988
+ * Complete hashing and output the hash value.
989
+ * @return {bitArray} The hash value, an array of 8 big-endian words.
990
+ */
991
+ finalize: function () {
992
+ var i,
993
+ b = this._buffer,
994
+ h = this._h;
995
+
996
+ // Round out and push the buffer
997
+ b = sjcl.bitArray.concat(b, [sjcl.bitArray.partial(1, 1)]);
998
+
999
+ // Round out the buffer to a multiple of 16 words, less the 2 length words.
1000
+ for (i = b.length + 2; i & 15; i++) {
1001
+ b.push(0);
1002
+ }
1003
+
1004
+ // append the length
1005
+ b.push(Math.floor(this._length / 0x100000000));
1006
+ b.push(this._length | 0);
1007
+
1008
+ while (b.length) {
1009
+ this._block(b.splice(0, 16));
1010
+ }
1011
+
1012
+ this.reset();
1013
+ return h;
1014
+ },
1015
+
1016
+ /**
1017
+ * The SHA-256 initialization vector, to be precomputed.
1018
+ * @private
1019
+ */
1020
+ _init: [],
1021
+ /*
1022
+ _init:[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],
1023
+ */
1024
+
1025
+ /**
1026
+ * The SHA-256 hash key, to be precomputed.
1027
+ * @private
1028
+ */
1029
+ _key: [],
1030
+ /*
1031
+ _key:
1032
+ [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
1033
+ 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
1034
+ 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
1035
+ 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
1036
+ 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
1037
+ 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
1038
+ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
1039
+ 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2],
1040
+ */
1041
+
1042
+ /**
1043
+ * Function to precompute _init and _key.
1044
+ * @private
1045
+ */
1046
+ _precompute: function () {
1047
+ var i = 0,
1048
+ prime = 2,
1049
+ factor,
1050
+ isPrime;
1051
+
1052
+ function frac(x) {
1053
+ return ((x - Math.floor(x)) * 0x100000000) | 0;
1054
+ }
1055
+
1056
+ for (; i < 64; prime++) {
1057
+ isPrime = true;
1058
+ for (factor = 2; factor * factor <= prime; factor++) {
1059
+ if (prime % factor === 0) {
1060
+ isPrime = false;
1061
+ break;
1062
+ }
1063
+ }
1064
+ if (isPrime) {
1065
+ if (i < 8) {
1066
+ this._init[i] = frac(Math.pow(prime, 1 / 2));
1067
+ }
1068
+ this._key[i] = frac(Math.pow(prime, 1 / 3));
1069
+ i++;
1070
+ }
1071
+ }
1072
+ },
1073
+
1074
+ /**
1075
+ * Perform one cycle of SHA-256.
1076
+ * @param {Uint32Array|bitArray} w one block of words.
1077
+ * @private
1078
+ */
1079
+ _block: function (w) {
1080
+ var i,
1081
+ tmp,
1082
+ a,
1083
+ b,
1084
+ h = this._h,
1085
+ k = this._key,
1086
+ h0 = h[0],
1087
+ h1 = h[1],
1088
+ h2 = h[2],
1089
+ h3 = h[3],
1090
+ h4 = h[4],
1091
+ h5 = h[5],
1092
+ h6 = h[6],
1093
+ h7 = h[7];
1094
+
1095
+ /* Rationale for placement of |0 :
1096
+ * If a value can overflow is original 32 bits by a factor of more than a few
1097
+ * million (2^23 ish), there is a possibility that it might overflow the
1098
+ * 53-bit mantissa and lose precision.
1099
+ *
1100
+ * To avoid this, we clamp back to 32 bits by |'ing with 0 on any value that
1101
+ * propagates around the loop, and on the hash state h[]. I don't believe
1102
+ * that the clamps on h4 and on h0 are strictly necessary, but it's close
1103
+ * (for h4 anyway), and better safe than sorry.
1104
+ *
1105
+ * The clamps on h[] are necessary for the output to be correct even in the
1106
+ * common case and for short inputs.
1107
+ */
1108
+ for (i = 0; i < 64; i++) {
1109
+ // load up the input word for this round
1110
+ if (i < 16) {
1111
+ tmp = w[i];
1112
+ } else {
1113
+ a = w[(i + 1) & 15];
1114
+ b = w[(i + 14) & 15];
1115
+ tmp = w[i & 15] =
1116
+ (((a >>> 7) ^ (a >>> 18) ^ (a >>> 3) ^ (a << 25) ^ (a << 14)) +
1117
+ ((b >>> 17) ^ (b >>> 19) ^ (b >>> 10) ^ (b << 15) ^ (b << 13)) +
1118
+ w[i & 15] +
1119
+ w[(i + 9) & 15]) |
1120
+ 0;
1121
+ }
1122
+
1123
+ tmp =
1124
+ tmp +
1125
+ h7 +
1126
+ ((h4 >>> 6) ^
1127
+ (h4 >>> 11) ^
1128
+ (h4 >>> 25) ^
1129
+ (h4 << 26) ^
1130
+ (h4 << 21) ^
1131
+ (h4 << 7)) +
1132
+ (h6 ^ (h4 & (h5 ^ h6))) +
1133
+ k[i]; // | 0;
1134
+
1135
+ // shift register
1136
+ h7 = h6;
1137
+ h6 = h5;
1138
+ h5 = h4;
1139
+ h4 = (h3 + tmp) | 0;
1140
+ h3 = h2;
1141
+ h2 = h1;
1142
+ h1 = h0;
1143
+
1144
+ h0 =
1145
+ (tmp +
1146
+ ((h1 & h2) ^ (h3 & (h1 ^ h2))) +
1147
+ ((h1 >>> 2) ^
1148
+ (h1 >>> 13) ^
1149
+ (h1 >>> 22) ^
1150
+ (h1 << 30) ^
1151
+ (h1 << 19) ^
1152
+ (h1 << 10))) |
1153
+ 0;
1154
+ }
1155
+
1156
+ h[0] = (h[0] + h0) | 0;
1157
+ h[1] = (h[1] + h1) | 0;
1158
+ h[2] = (h[2] + h2) | 0;
1159
+ h[3] = (h[3] + h3) | 0;
1160
+ h[4] = (h[4] + h4) | 0;
1161
+ h[5] = (h[5] + h5) | 0;
1162
+ h[6] = (h[6] + h6) | 0;
1163
+ h[7] = (h[7] + h7) | 0;
1164
+ },
1165
+ };
1166
+
504
1167
  // eslint-disable-next-line require-jsdoc
505
1168
  function base64URLEncode(str) {
506
1169
  return btoa(str).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
@@ -660,7 +1323,7 @@ class AccountsSDK {
660
1323
 
661
1324
  switch (localOptions.pkce.code_challange_method) {
662
1325
  case 'S256':
663
- const codeChallenge = sjcl__default['default'].hash.sha256.hash(codeVerifier);
1326
+ const codeChallenge = sjcl.hash.sha256.hash(codeVerifier);
664
1327
  Object.assign(params, {
665
1328
  code_verifier: codeVerifier,
666
1329
  code_challenge: encoding.base64URLEncode(codeChallenge),