Files
websocket-FileTransfer/_client/base64.js
Sepp Jeremiah Morris 39d9c23dee final
i'm sleepy so english not very good looking
2022-10-11 20:31:13 +02:00

1 line
2.2 KiB
JavaScript

(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.base64js=a()}})(function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c<g.length;c++)a(g[c]);return a}return b}()({"/":[function(a,b,c){'use strict';function d(a){const b=a.length;if(0<b%4)throw new Error("Invalid string. Length must be a multiple of 4");let c=a.indexOf("=");-1===c&&(c=b);const d=c===b?0:4-c%4;return[c,d]}function e(a,b,c){return 3*(b+c)/4-c}function f(a){return h[63&a>>18]+h[63&a>>12]+h[63&a>>6]+h[63&a]}function g(a,b,c){let d;const e=[];for(let g=b;g<c;g+=3)d=(16711680&a[g]<<16)+(65280&a[g+1]<<8)+(255&a[g+2]),e.push(f(d));return e.join("")}c.byteLength=function(a){const b=d(a),c=b[0],e=b[1];return 3*(c+e)/4-e},c.toByteArray=function(a){let b;const c=d(a),f=c[0],g=c[1],h=new k(e(a,f,g));let l=0;const m=0<g?f-4:f;let n;for(n=0;n<m;n+=4)b=j[a.charCodeAt(n)]<<18|j[a.charCodeAt(n+1)]<<12|j[a.charCodeAt(n+2)]<<6|j[a.charCodeAt(n+3)],h[l++]=255&b>>16,h[l++]=255&b>>8,h[l++]=255&b;return 2===g&&(b=j[a.charCodeAt(n)]<<2|j[a.charCodeAt(n+1)]>>4,h[l++]=255&b),1===g&&(b=j[a.charCodeAt(n)]<<10|j[a.charCodeAt(n+1)]<<4|j[a.charCodeAt(n+2)]>>2,h[l++]=255&b>>8,h[l++]=255&b),h},c.fromByteArray=function(a){let b;const c=a.length,d=c%3,e=[],f=16383;for(let b=0,h=c-d;b<h;b+=f)e.push(g(a,b,b+f>h?h:b+f));return 1===d?(b=a[c-1],e.push(h[b>>2]+h[63&b<<4]+"==")):2===d&&(b=(a[c-2]<<8)+a[c-1],e.push(h[b>>10]+h[63&b>>4]+h[63&b<<2]+"=")),e.join("")};const h=[],j=[],k="undefined"==typeof Uint8Array?Array:Uint8Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let d=0,e=l.length;d<e;++d)h[d]=l[d],j[l.charCodeAt(d)]=d;j[45]=62,j[95]=63},{}]},{},[])("/")});