(uint8)
| 810 | } |
| 811 | |
| 812 | function fromByteArray$1 (uint8) { |
| 813 | if (!inited$1) { |
| 814 | init$1(); |
| 815 | } |
| 816 | var tmp; |
| 817 | var len = uint8.length; |
| 818 | var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes |
| 819 | var output = ''; |
| 820 | var parts = []; |
| 821 | var maxChunkLength = 16383; // must be multiple of 3 |
| 822 | |
| 823 | // go through the array every three bytes, we'll deal with trailing stuff later |
| 824 | for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { |
| 825 | parts.push(encodeChunk$1(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))); |
| 826 | } |
| 827 | |
| 828 | // pad the end with zeros, but make sure to not forget the extra bytes |
| 829 | if (extraBytes === 1) { |
| 830 | tmp = uint8[len - 1]; |
| 831 | output += lookup$1[tmp >> 2]; |
| 832 | output += lookup$1[(tmp << 4) & 0x3F]; |
| 833 | output += '=='; |
| 834 | } else if (extraBytes === 2) { |
| 835 | tmp = (uint8[len - 2] << 8) + (uint8[len - 1]); |
| 836 | output += lookup$1[tmp >> 10]; |
| 837 | output += lookup$1[(tmp >> 4) & 0x3F]; |
| 838 | output += lookup$1[(tmp << 2) & 0x3F]; |
| 839 | output += '='; |
| 840 | } |
| 841 | |
| 842 | parts.push(output); |
| 843 | |
| 844 | return parts.join('') |
| 845 | } |
| 846 | |
| 847 | function read$1 (buffer, offset, isLE, mLen, nBytes) { |
| 848 | var e, m; |
no test coverage detected