UNPKG

@yuebai008/cli

Version:

Command line interface for rapid qg-minigame development

1 lines 582 B
const BASE64_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",BASE64_CODES=new Uint8Array(123);for(let t=0;t<64;++t)BASE64_CODES[BASE64_CHARS.charCodeAt(t)]=t;export function decode(t){let e=3*t.length/4>>>0;61===t.charCodeAt(t.length-2)?e-=2:61===t.charCodeAt(t.length-1)&&(e-=1);const A=new Uint8Array(e);for(let e=0,r=0;e<t.length;e+=4){const S=BASE64_CODES[t.charCodeAt(e+0)],o=BASE64_CODES[t.charCodeAt(e+1)],C=BASE64_CODES[t.charCodeAt(e+2)],n=BASE64_CODES[t.charCodeAt(e+3)];A[r++]=S<<2|o>>4,A[r++]=(15&o)<<4|C>>2,A[r++]=(3&C)<<6|63&n}return A.buffer}