|
768 | 768 | return this;
|
769 | 769 | };
|
770 | 770 | default_1.prototype.getVersion = function () {
|
771 |
| - return '7.2.0'; |
| 771 | + return '7.2.1'; |
772 | 772 | };
|
773 | 773 | default_1.prototype._addPnsdkSuffix = function (name, suffix) {
|
774 | 774 | this._PNSDKSuffix[name] = suffix;
|
|
780 | 780 | return default_1;
|
781 | 781 | }());
|
782 | 782 |
|
| 783 | + var BASE64_CHARMAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; |
| 784 | + /** |
| 785 | + * Decode a Base64 encoded string. |
| 786 | + * |
| 787 | + * @param paddedInput Base64 string with padding |
| 788 | + * @returns ArrayBuffer with decoded data |
| 789 | + */ |
| 790 | + function decode$1(paddedInput) { |
| 791 | + // Remove up to last two equal signs. |
| 792 | + var input = paddedInput.replace(/==?$/, ''); |
| 793 | + var outputLength = Math.floor((input.length / 4) * 3); |
| 794 | + // Prepare output buffer. |
| 795 | + var data = new ArrayBuffer(outputLength); |
| 796 | + var view = new Uint8Array(data); |
| 797 | + var cursor = 0; |
| 798 | + /** |
| 799 | + * Returns the next integer representation of a sixtet of bytes from the input |
| 800 | + * @returns sixtet of bytes |
| 801 | + */ |
| 802 | + function nextSixtet() { |
| 803 | + var char = input.charAt(cursor++); |
| 804 | + var index = BASE64_CHARMAP.indexOf(char); |
| 805 | + if (index === -1) { |
| 806 | + throw new Error("Illegal character at ".concat(cursor, ": ").concat(input.charAt(cursor - 1))); |
| 807 | + } |
| 808 | + return index; |
| 809 | + } |
| 810 | + for (var i = 0; i < outputLength; i += 3) { |
| 811 | + // Obtain four sixtets |
| 812 | + var sx1 = nextSixtet(); |
| 813 | + var sx2 = nextSixtet(); |
| 814 | + var sx3 = nextSixtet(); |
| 815 | + var sx4 = nextSixtet(); |
| 816 | + // Encode them as three octets |
| 817 | + var oc1 = ((sx1 & 63) << 2) | (sx2 >> 4); |
| 818 | + var oc2 = ((sx2 & 15) << 4) | (sx3 >> 2); |
| 819 | + var oc3 = ((sx3 & 3) << 6) | (sx4 >> 0); |
| 820 | + view[i] = oc1; |
| 821 | + // Skip padding bytes. |
| 822 | + if (sx3 != 64) |
| 823 | + view[i + 1] = oc2; |
| 824 | + if (sx4 != 64) |
| 825 | + view[i + 2] = oc3; |
| 826 | + } |
| 827 | + return data; |
| 828 | + } |
| 829 | + |
783 | 830 | /*eslint-disable */
|
784 | 831 | /*
|
785 | 832 | CryptoJS v3.1.2
|
|
1467 | 1514 | })();
|
1468 | 1515 | var hmacSha256 = CryptoJS;
|
1469 | 1516 |
|
1470 |
| - /* */ |
1471 | 1517 | function bufferToWordArray(b) {
|
1472 | 1518 | var wa = [];
|
1473 | 1519 | var i;
|
1474 | 1520 | for (i = 0; i < b.length; i += 1) {
|
1475 |
| - // eslint-disable-next-line no-bitwise |
1476 | 1521 | wa[(i / 4) | 0] |= b[i] << (24 - 8 * i);
|
1477 | 1522 | }
|
1478 | 1523 | return hmacSha256.lib.WordArray.create(wa, b.length);
|
|
1585 | 1630 | var mode = this._getMode(options);
|
1586 | 1631 | var cipherKey = this._getPaddedKey(customCipherKey || this._config.cipherKey, options);
|
1587 | 1632 | if (this._config.useRandomIVs) {
|
1588 |
| - var ciphertext = Buffer.from(data, 'base64'); |
| 1633 | + var ciphertext = new Uint8ClampedArray(decode$1(data)); |
1589 | 1634 | var iv = bufferToWordArray(ciphertext.slice(0, 16));
|
1590 | 1635 | var payload = bufferToWordArray(ciphertext.slice(16));
|
1591 | 1636 | try {
|
|
7794 | 7839 | return default_1;
|
7795 | 7840 | }());
|
7796 | 7841 |
|
7797 |
| - var BASE64_CHARMAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; |
7798 |
| - /** |
7799 |
| - * Decode a Base64 encoded string. |
7800 |
| - * |
7801 |
| - * @param paddedInput Base64 string with padding |
7802 |
| - * @returns ArrayBuffer with decoded data |
7803 |
| - */ |
7804 |
| - function decode$1(paddedInput) { |
7805 |
| - // Remove up to last two equal signs. |
7806 |
| - var input = paddedInput.replace(/==?$/, ''); |
7807 |
| - var outputLength = Math.floor((input.length / 4) * 3); |
7808 |
| - // Prepare output buffer. |
7809 |
| - var data = new ArrayBuffer(outputLength); |
7810 |
| - var view = new Uint8Array(data); |
7811 |
| - var cursor = 0; |
7812 |
| - /** |
7813 |
| - * Returns the next integer representation of a sixtet of bytes from the input |
7814 |
| - * @returns sixtet of bytes |
7815 |
| - */ |
7816 |
| - function nextSixtet() { |
7817 |
| - var char = input.charAt(cursor++); |
7818 |
| - var index = BASE64_CHARMAP.indexOf(char); |
7819 |
| - if (index === -1) { |
7820 |
| - throw new Error("Illegal character at ".concat(cursor, ": ").concat(input.charAt(cursor - 1))); |
7821 |
| - } |
7822 |
| - return index; |
7823 |
| - } |
7824 |
| - for (var i = 0; i < outputLength; i += 3) { |
7825 |
| - // Obtain four sixtets |
7826 |
| - var sx1 = nextSixtet(); |
7827 |
| - var sx2 = nextSixtet(); |
7828 |
| - var sx3 = nextSixtet(); |
7829 |
| - var sx4 = nextSixtet(); |
7830 |
| - // Encode them as three octets |
7831 |
| - var oc1 = ((sx1 & 63) << 2) | (sx2 >> 4); |
7832 |
| - var oc2 = ((sx2 & 15) << 4) | (sx3 >> 2); |
7833 |
| - var oc3 = ((sx3 & 3) << 6) | (sx4 >> 0); |
7834 |
| - view[i] = oc1; |
7835 |
| - // Skip padding bytes. |
7836 |
| - if (sx3 != 64) |
7837 |
| - view[i + 1] = oc2; |
7838 |
| - if (sx4 != 64) |
7839 |
| - view[i + 2] = oc3; |
7840 |
| - } |
7841 |
| - return data; |
7842 |
| - } |
7843 |
| - |
7844 | 7842 | function stringifyBufferKeys(obj) {
|
7845 | 7843 | var isObject = function (value) { return value && typeof value === 'object' && value.constructor === Object; };
|
7846 | 7844 | var isString = function (value) { return typeof value === 'string' || value instanceof String; };
|
|
0 commit comments