1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4438],{3752:function(s,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/posts/base64-note",function(){return r(5427)}])},5427:function(s,e,r){"use strict";r.r(e),r.d(e,{__toc:function(){return c}});var l=r(5893),n=r(2673),o=r(8473),i=r(797);r(3450),r(6067);var t=r(2643);let c=[{depth:3,value:"Base64 æ¯ä¸ç§åºäº 64 ä¸ªå¯æå°å符æ¥è¡¨ç¤ºäºè¿å¶æ°æ®çè¡¨ç¤ºæ¹æ³ã",id:"base64-æ¯ä¸ç§åºäº-64-ä¸ªå¯æå°å符æ¥è¡¨ç¤ºäºè¿å¶æ°æ®çè¡¨ç¤ºæ¹æ³"},{depth:4,value:"1.base64 ç®æ³çç±æ¥",id:"1base64-ç®æ³çç±æ¥"},{depth:4,value:"2.base64 䏿¯å å¯ç®æ³",id:"2base64-䏿¯å å¯ç®æ³"},{depth:4,value:"3.Base ç¼ç æ¹æ³",id:"3base-ç¼ç æ¹æ³"},{depth:4,value:"4.base64 ç´¢å¼è¡¨å¦ä¸",id:"4base64-ç´¢å¼è¡¨å¦ä¸"},{depth:4,value:"5.ä¸ä¸ªç®åçç¼ç æ¹æ³åè¯ç æ¹æ³å®ç°ï¼",id:"5ä¸ä¸ªç®åçç¼ç æ¹æ³åè¯ç æ¹æ³å®ç°"},{depth:3,value:"HTML5 æä¾çéç¨ Base64 æ¹æ³ API",id:"html5-æä¾çéç¨-base64-æ¹æ³-api"},{depth:4,value:"1.ç¼ç ï¼ window.btoa(stringToEncode)",id:"1ç¼ç -windowbtoastringtoencode"},{depth:4,value:"2.è§£ç ï¼ window.atob(encodedData)",id:"2è§£ç -windowatobencodeddata"},{depth:4,value:"3.ä½ç¨äº UTF-8 ç¼ç çæå",id:"3ä½ç¨äº-utf-8-ç¼ç çæå"},{depth:3,value:"Data URLä¸Base64",id:"data-urlä¸base64"},{depth:5,value:"åèèµæï¼",id:"åèèµæ"}];function a(s){let e=Object.assign({h1:"h1",h3:"h3",h4:"h4",p:"p",table:"table",tbody:"tbody",tr:"tr",th:"th",td:"td",pre:"pre",code:"code",span:"span",h5:"h5",ol:"ol",li:"li",a:"a"},(0,t.a)(),s.components);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(e.h1,{children:"Base64 ç®è¦ç¬è®°åå
¶ä»"}),"\n",(0,l.jsx)(e.h3,{id:"base64-æ¯ä¸ç§åºäº-64-ä¸ªå¯æå°å符æ¥è¡¨ç¤ºäºè¿å¶æ°æ®çè¡¨ç¤ºæ¹æ³",children:"Base64 æ¯ä¸ç§åºäº 64 ä¸ªå¯æå°å符æ¥è¡¨ç¤ºäºè¿å¶æ°æ®çè¡¨ç¤ºæ¹æ³ã"}),"\n",(0,l.jsx)(e.h4,{id:"1base64-ç®æ³çç±æ¥",children:"1.base64 ç®æ³çç±æ¥"}),"\n",(0,l.jsx)(e.p,{children:"base64 ææ©æ¯ç¨ä½è§£å³çµåé®ä»¶çä¼ è¾é®é¢ï¼ç±äºåå²åå ï¼æ©æçµåé®ä»¶åªå
è®¸ä¼ è¾ ASCII ç å符ï¼å¦ææ³ä¼ è¾ä¸å°å¸¦æé ASCII å符çé®ä»¶ï¼å¨éå°ä¸äºèæ§çç½å
³å°±å¯è½ä¼å¯¹å符æé«ä½è¿è¡è°æ´ï¼å¯¼è´æ¶å°çé®ä»¶åºç°ä¹±ç ã"}),"\n",(0,l.jsx)(e.h4,{id:"2base64-䏿¯å å¯ç®æ³",children:"2.base64 䏿¯å å¯ç®æ³"}),"\n",(0,l.jsx)(e.p,{children:"base64 ç®æ³çç¼ç åè§£ç æ¹æ³å¯ä»¥ä½ä¸ºå å¯åè§£å¯æä½ï¼ä½æ¯ä¸è½å«åå å¯ç®æ³ï¼å 为å
¶ç®æ³åå
å½å¯é¥çç´¢å¼è¡¨é½æ¯å
¬å¼çãæå¤æ¯è®©å¨ä½ 身åçäººä¸æ¶çä¸æï¼æè°é²ååä¸é²å°äººã"}),"\n",(0,l.jsx)(e.h4,{id:"3base-ç¼ç æ¹æ³",children:"3.Base ç¼ç æ¹æ³"}),"\n",(0,l.jsx)(e.p,{children:"转æ¢çæ¶åï¼å°ä¸ä¸ª byte çæ°æ®ï¼å
åæ¾å
¥ä¸ä¸ª 24bit çç¼å²åºä¸ï¼å
æ¥ç byte å é«ä½ãæ°æ®ä¸è¶³ 3byte çè¯ï¼å©ä¸ç bit ç¨ 0 补足ãç¶åï¼æ¯æ¬¡ååº 6 个 bitï¼æç
§å
¶å¼éæ©ç´¢å¼è¡¨çå符ä½ä¸ºç¼ç åçè¾åºã䏿è¿è¡ï¼ç´å°å
¨é¨è¾å
¥æ°æ®è½¬æ¢å®æã"}),"\n",(0,l.jsx)(e.p,{children:"è¿éå°±ä¸ä¸¾ä¾è¯´æï¼å
·ä½å¯ä»¥åèç»´åºç¾ç§ã"}),"\n",(0,l.jsx)(e.h4,{id:"4base64-ç´¢å¼è¡¨å¦ä¸",children:"4.base64 ç´¢å¼è¡¨å¦ä¸"}),"\n",(0,l.jsx)(e.table,{children:(0,l.jsxs)(e.tbody,{children:[(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.th,{scope:"col",children:"æ°å¼"}),(0,l.jsx)(e.th,{scope:"col",children:"å符"}),(0,l.jsx)(e.th,{scope:"col",children:"æ°å¼"}),(0,l.jsx)(e.th,{scope:"col",children:"å符"}),(0,l.jsx)(e.th,{scope:"col",children:"æ°å¼"}),(0,l.jsx)(e.th,{scope:"col",children:"å符"}),(0,l.jsx)(e.th,{scope:"col",children:"æ°å¼"}),(0,l.jsx)(e.th,{scope:"col",children:"å符"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"0"}),(0,l.jsx)(e.td,{children:"A"}),(0,l.jsx)(e.td,{children:"16"}),(0,l.jsx)(e.td,{children:"Q"}),(0,l.jsx)(e.td,{children:"32"}),(0,l.jsx)(e.td,{children:"g"}),(0,l.jsx)(e.td,{children:"48"}),(0,l.jsx)(e.td,{children:"w"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"1"}),(0,l.jsx)(e.td,{children:"B"}),(0,l.jsx)(e.td,{children:"17"}),(0,l.jsx)(e.td,{children:"R"}),(0,l.jsx)(e.td,{children:"33"}),(0,l.jsx)(e.td,{children:"h"}),(0,l.jsx)(e.td,{children:"49"}),(0,l.jsx)(e.td,{children:"x"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"2"}),(0,l.jsx)(e.td,{children:"C"}),(0,l.jsx)(e.td,{children:"18"}),(0,l.jsx)(e.td,{children:"S"}),(0,l.jsx)(e.td,{children:"34"}),(0,l.jsx)(e.td,{children:"i"}),(0,l.jsx)(e.td,{children:"50"}),(0,l.jsx)(e.td,{children:"y"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"3"}),(0,l.jsx)(e.td,{children:"D"}),(0,l.jsx)(e.td,{children:"19"}),(0,l.jsx)(e.td,{children:"T"}),(0,l.jsx)(e.td,{children:"35"}),(0,l.jsx)(e.td,{children:"j"}),(0,l.jsx)(e.td,{children:"51"}),(0,l.jsx)(e.td,{children:"z"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"4"}),(0,l.jsx)(e.td,{children:"E"}),(0,l.jsx)(e.td,{children:"20"}),(0,l.jsx)(e.td,{children:"U"}),(0,l.jsx)(e.td,{children:"36"}),(0,l.jsx)(e.td,{children:"k"}),(0,l.jsx)(e.td,{children:"52"}),(0,l.jsx)(e.td,{children:"0"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"5"}),(0,l.jsx)(e.td,{children:"F"}),(0,l.jsx)(e.td,{children:"21"}),(0,l.jsx)(e.td,{children:"V"}),(0,l.jsx)(e.td,{children:"37"}),(0,l.jsx)(e.td,{children:"l"}),(0,l.jsx)(e.td,{children:"53"}),(0,l.jsx)(e.td,{children:"1"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"6"}),(0,l.jsx)(e.td,{children:"G"}),(0,l.jsx)(e.td,{children:"22"}),(0,l.jsx)(e.td,{children:"W"}),(0,l.jsx)(e.td,{children:"38"}),(0,l.jsx)(e.td,{children:"m"}),(0,l.jsx)(e.td,{children:"54"}),(0,l.jsx)(e.td,{children:"2"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"7"}),(0,l.jsx)(e.td,{children:"H"}),(0,l.jsx)(e.td,{children:"23"}),(0,l.jsx)(e.td,{children:"X"}),(0,l.jsx)(e.td,{children:"39"}),(0,l.jsx)(e.td,{children:"n"}),(0,l.jsx)(e.td,{children:"55"}),(0,l.jsx)(e.td,{children:"3"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"8"}),(0,l.jsx)(e.td,{children:"I"}),(0,l.jsx)(e.td,{children:"24"}),(0,l.jsx)(e.td,{children:"Y"}),(0,l.jsx)(e.td,{children:"40"}),(0,l.jsx)(e.td,{children:"o"}),(0,l.jsx)(e.td,{children:"56"}),(0,l.jsx)(e.td,{children:"4"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"9"}),(0,l.jsx)(e.td,{children:"J"}),(0,l.jsx)(e.td,{children:"25"}),(0,l.jsx)(e.td,{children:"Z"}),(0,l.jsx)(e.td,{children:"41"}),(0,l.jsx)(e.td,{children:"p"}),(0,l.jsx)(e.td,{children:"57"}),(0,l.jsx)(e.td,{children:"5"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"10"}),(0,l.jsx)(e.td,{children:"K"}),(0,l.jsx)(e.td,{children:"26"}),(0,l.jsx)(e.td,{children:"a"}),(0,l.jsx)(e.td,{children:"42"}),(0,l.jsx)(e.td,{children:"q"}),(0,l.jsx)(e.td,{children:"58"}),(0,l.jsx)(e.td,{children:"6"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"11"}),(0,l.jsx)(e.td,{children:"L"}),(0,l.jsx)(e.td,{children:"27"}),(0,l.jsx)(e.td,{children:"b"}),(0,l.jsx)(e.td,{children:"43"}),(0,l.jsx)(e.td,{children:"r"}),(0,l.jsx)(e.td,{children:"59"}),(0,l.jsx)(e.td,{children:"7"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"12"}),(0,l.jsx)(e.td,{children:"M"}),(0,l.jsx)(e.td,{children:"28"}),(0,l.jsx)(e.td,{children:"c"}),(0,l.jsx)(e.td,{children:"44"}),(0,l.jsx)(e.td,{children:"s"}),(0,l.jsx)(e.td,{children:"60"}),(0,l.jsx)(e.td,{children:"8"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"13"}),(0,l.jsx)(e.td,{children:"N"}),(0,l.jsx)(e.td,{children:"29"}),(0,l.jsx)(e.td,{children:"d"}),(0,l.jsx)(e.td,{children:"45"}),(0,l.jsx)(e.td,{children:"t"}),(0,l.jsx)(e.td,{children:"61"}),(0,l.jsx)(e.td,{children:"9"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"14"}),(0,l.jsx)(e.td,{children:"O"}),(0,l.jsx)(e.td,{children:"30"}),(0,l.jsx)(e.td,{children:"e"}),(0,l.jsx)(e.td,{children:"46"}),(0,l.jsx)(e.td,{children:"u"}),(0,l.jsx)(e.td,{children:"62"}),(0,l.jsx)(e.td,{children:"+"})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:"15"}),(0,l.jsx)(e.td,{children:"P"}),(0,l.jsx)(e.td,{children:"31"}),(0,l.jsx)(e.td,{children:"f"}),(0,l.jsx)(e.td,{children:"47"}),(0,l.jsx)(e.td,{children:"v"}),(0,l.jsx)(e.td,{children:"63"}),(0,l.jsx)(e.td,{children:"/"})]})]})}),"\n","\n",(0,l.jsx)(e.h4,{id:"5ä¸ä¸ªç®åçç¼ç æ¹æ³åè¯ç æ¹æ³å®ç°",children:"5.ä¸ä¸ªç®åçç¼ç æ¹æ³åè¯ç æ¹æ³å®ç°ï¼"}),"\n",(0,l.jsx)(e.pre,{"data-language":"javascript","data-theme":"default",children:(0,l.jsxs)(e.code,{"data-language":"javascript","data-theme":"default",children:[(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"base64Encode"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"function"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"(data) {"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" map "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/'"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:";"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" out "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"''"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:";"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:" "}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"for"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" i "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"0"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" len "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"data"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"."}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"length"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"; i "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" len; i "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"3"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") {"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" binStr "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"''"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" newStr "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"''"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" threeChar "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"data"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".slice"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"(i"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" i"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"3"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:");"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:" "}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"for"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" j "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"0"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"; j "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"3"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"; j"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"++"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") {"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" t "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"threeChar"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".charCodeAt"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"(j)"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".toString"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"2"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:");"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"while"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"t"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"."}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"length"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"8"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") t "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'0'"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" t;"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" binStr "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" t;"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(e.span,{className:"line",children:" "}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"for"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" k "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"0"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"; k "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"24"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"; k "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"6"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") {"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" newStr "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" map["}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"parseInt"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"binStr"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".slice"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"(k"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" k"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"6"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:")"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"2"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:")];"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"if"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" (i"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"3"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"-"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"len "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"=="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"1"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") newStr "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"newStr"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".slice"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"0"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"3"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'='"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:";"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"if"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" (i"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"3"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"-"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"len "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"=="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"2"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") newStr "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"newStr"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".slice"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"0"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"2"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'=='"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:";"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" out "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" newStr;"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"return"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" out;"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"};"})}),"\n",(0,l.jsx)(e.span,{className:"line",children:" "}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.s
1pan,{style:{color:"var(--shiki-token-function)"},children:"base64Decode"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"function"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"(code) {"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" map "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:";"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ascii "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"' !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ'"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:";"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" out "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"''"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:";"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:" "}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"for"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" i "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"0"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" len "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"code"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"."}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"length"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"; i "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" len; i "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"4"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") {"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" fourChar "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"code"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".slice"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"(i"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" i"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"4"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:")"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" binStr "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"''"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" newStr "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"''"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:";"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:" "}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"for"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" j "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"0"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"; j "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"4"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"; j"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"++"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") {"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" t "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"map"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".indexOf"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"fourChar"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".charAt"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"(j))"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".toString"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"2"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:");"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"while"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"t"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"."}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"length"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"6"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") t "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'0'"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" t;"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" binStr "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" t;"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsx)(e.span,{className:"line",children:" "}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"for"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" k "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"0"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"; k "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"<"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"24"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"; k "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"8"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") {"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"var"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" char "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ascii["}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"parseInt"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"binStr"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".slice"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"(k"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" k"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"8"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:")"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"2"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"-"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"32"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"];"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"if"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"}
1,children:" (char "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"!=="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"undefined"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:") newStr "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" char;"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" out "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"+="}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" newStr;"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" }"})}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"return"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" out;"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"};"})})]})}),"\n",(0,l.jsx)(e.h3,{id:"html5-æä¾çéç¨-base64-æ¹æ³-api",children:"HTML5 æä¾çéç¨ Base64 æ¹æ³ API"}),"\n",(0,l.jsxs)(e.h4,{id:"1ç¼ç -windowbtoastringtoencode",children:["1.ç¼ç ï¼ ",(0,l.jsx)(e.code,{children:"window.btoa(stringToEncode)"})]}),"\n",(0,l.jsx)(e.p,{children:"åªè½å° ASCII å符串æäºè¿å¶æ°æ®è½¬æ¢æä¸ä¸ª base64 ç¼ç è¿çå符串,è¯¥æ¹æ³ä¸è½ç´æ¥ä½ç¨äº Unicode å符串ã"}),"\n",(0,l.jsxs)(e.h4,{id:"2è§£ç -windowatobencodeddata",children:["2.è§£ç ï¼ ",(0,l.jsx)(e.code,{children:"window.atob(encodedData)"})]}),"\n",(0,l.jsx)(e.p,{children:"å°å·²ç»è¢« base64 ç¼ç è¿çæ°æ®è¿è¡è§£ç ã"}),"\n",(0,l.jsx)(e.h4,{id:"3ä½ç¨äº-utf-8-ç¼ç çæå",children:"3.ä½ç¨äº UTF-8 ç¼ç çæå"}),"\n",(0,l.jsxs)(e.p,{children:["使¯è¿ä¸¤ä¸ª Web API åè½å¾ç®åï¼å¹¶ä¸è½ç´æ¥ä½ç¨äº Unicode åç¬¦ä¸²ï¼æä»¥å½è°ç¨ ",(0,l.jsx)(e.code,{children:"btoa()"})," æ¶è¥ä¼ å
¥ç䏿¯ ASCII æäºè¿å¶åç¬¦ä¸²ï¼æ¯å¦æ±åå°±ä¼åºéã"]}),"\n",(0,l.jsx)(e.p,{children:"ä¸é¢æ¯å«äººæä¾çç®åè§£å³æ¹æ³ï¼"}),"\n",(0,l.jsx)(e.pre,{"data-language":"javascript","data-theme":"default",children:(0,l.jsxs)(e.code,{"data-language":"javascript","data-theme":"default",children:[(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"function"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"utf8_to_b64"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"( str ) {"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"return"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"window"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".btoa"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"unescape"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"encodeURIComponent"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"(str)));"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,l.jsx)(e.span,{className:"line",children:" "}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"function"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"b64_to_utf8"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"( str ) {"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"return"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"decodeURIComponent"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"escape"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"window"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".atob"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"(str)));"})]}),"\n",(0,l.jsx)(e.span,{className:"line",children:(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,l.jsxs)(e.p,{children:["ä½è
å¨è¿é使ç¨äºä¸ä¸ªå°å°çHackæå·§ã",(0,l.jsx)(e.code,{children:"encodeURIComponent()"})," æ¯ECMAscriptä¸Global对象çURIæ¹æ³ï¼å¯¹URIè¿è¡ç¼ç ï¼å¯ä»¥ä½ç¨äºææUnicodeå符ãè ",(0,l.jsx)(e.code,{children:"escape()"})," æ¯å·²åºå¼çURIç¼ç æ¹æ³ï¼åè½å ",(0,l.jsx)(e.code,{children:"encodeURIComponent()"})," ç¸åï¼ä½æ¯åªè½ç¼ç ASCIIå符ã"]}),"\n",(0,l.jsxs)(e.p,{children:["å³ ",(0,l.jsx)(e.code,{children:"encodeURIComponent(str)"})," ç¸å½äº ",(0,l.jsx)(e.code,{children:"escape(unicodeToASCII(str))"})," ï¼å ",(0,l.jsx)(e.code,{children:"unescape(encodeURIComponent(str))"})," çåäº ",(0,l.jsx)(e.code,{children:"unicodeToASCII(str)"})," ,æä»¥å°±å° Unicode åç¬¦è½¬æ¢æäº ASCII å符ã( ",(0,l.jsx)(e.code,{children:"unescape()"})," æ¯å ",(0,l.jsx)(e.code,{children:"escape()"})," 对åºçè§£ç æ¹æ³ï¼"]}),"\n",(0,l.jsx)(e.p,{children:"å
³äºæåéåæåç¼ç æ¹é¢çç¥è¯ï¼æ¯å¦ UTF-8 æ¯åºäº Unicode æåéçä¸ç§å¹¿æ³ä½¿ç¨çç¼ç æ¹å¼ï¼å
·ä½æ¤å¤ä¸åèµè¿°ã"}),"\n",(0,l.jsx)(e.h3,{id:"data-urlä¸base64",children:"Data URLä¸Base64"}),"\n",(0,l.jsx)(e.p,{children:"è¿é主è¦è¯´è¯´ Data URL 模å¼å Base64 ï¼æ¯å¦ä¸é¢è¿æ®µä»£ç ï¼"}),"\n",(0,l.jsx)(e.pre,{"data-language":"javascript","data-theme":"default",children:(0,l.jsx)(e.code,{"data-language":"javascript","data-theme":"default",children:(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"console"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".log"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"}
1,children:'"\\n\\n\\n%c"'}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'font-size:0;margin-top:20px;line-height:36px;padding-top:50px;padding-left:158px;background:url(\"data:image/png;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAyAJ4DASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmq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9s/4d68HjE+pX0dpYwu7SSHy4x1Zj1J9z+lbsXg7xFqUqxta3bY6G4YhV9/mr0vwf4Kt/DUZuJmWfUJBhpMcIPRf8aqCw+Ai535p9CZzr49qmk4w3f8AWl/Is+EPCsPhrTsNiS+mAM8v/so9hXR0UV4tSpKpNzm9WevTpxpxUIrRGJ4p8Px+JNHNm85gdXEkcgGQGAI5HcYJqn4O8Jx+GLacm6+0zzkFnC4UAdABU3jKPVJNDzpUZmkSQNJEpwXTByB+ODj2rO8AW2tRWt3LqkUlvFI4MMEh5HqfbNdkef6o/f0vsccuT62vc1tudlXjnxAmay+JFjfG1knjt1ikZFX7wDZI6V7HRXAd55h/ws+w/wChXn/Jf/iawvFnjKDxFoh0+20Ga2kMiv5m0Hp24Fe2UUAcPZWlxb/B77NNDIk4sHBjK/Nzkjj8a4Sy1Oxi8H2+i6r4cvLtgXkSZPkaMlj904yOle50UAfPsmn+M5PDoR7fUjpAbiIjkL2+Xrj3xiuv8D6rpen6ha6dZeGb2Ga4bZJez/M3TOSccDjoMda9TooA8a8fX00/j+3M+n3FzY6dsxGgIEnRjzjvwPwrc/4WvL/0LN5/38/+xr0migDyPxF8QZ9c0C801fD95C1wm0SFydvPXG2ux+HFtcWngixjuYXikJdtrgg4LEg8+orq6KACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD//Z\");background-repeat:no-repeat;'"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:")"})]})})}),"\n",(0,l.jsxs)(e.p,{children:["è¿æ¯ä¸ä¸ªçå®çå°ä¾åï¼å¯ä»¥å¨ç¾åº¦ç½ççå°ï¼ä¼å¨æ§å¶å°æå°åºç¾åº¦äºlogoãè¿éç¨å°äº ",(0,l.jsx)(e.code,{children:"console.log()"})," çä¸äºç¨å¾®é«çº§ä¸ç¹çç¨æ³ï¼æ¯æç±»ä¼¼Cè¯è¨ ",(0,l.jsx)(e.code,{children:"printf()"})," 飿 ¼çæå°æ¹å¼ï¼å ä½ç¬¦ ",(0,l.jsx)(e.code,{children:"%c"})," å¯ä»¥ä½¿ç¨ä¸äºCSSæ ·å¼è¯å¥ãæ¯å¦è¿é使ç¨çï¼"]}),"\n",(0,l.jsx)(e.pre,{"data-language":"css","data-theme":"default",children:(0,l.jsxs)(e.code,{"data-language":"css","data-theme":"default",children:[(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"font-size"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:": 0;"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"margin-top"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:": 20px;"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"line-height"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:": 36px;"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"padding-top"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:": 50px;"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"padding-left"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:": 158px;"})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:'background: url("'}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"data"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:':image/png;base64...");'})]}),"\n",(0,l.jsxs)(e.span,{className:"line",children:[(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"background-repeat"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:": "}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"no-repeat"}),(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:";"})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["å
³äº ",(0,l.jsx)(e.code,{children:"console.log()"})," çç¨æ³ä»¥å ",(0,l.jsx)(e.code,{children:"console"})," 对象çå
¶ä»æ¹æ³ã屿§ï¼å
·ä½æ¤å¤ä¸åèµè¿°ã"]}),"\n",(0,l.jsx)(e.p,{children:"åå° urlï¼å¯ä»¥çå°ä¸é¿ä¸²æ°æ®ï¼å¨å¼å¤´æ¯è¿æ ·çï¼"}),"\n",(0,l.jsx)(e.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsx)(e.code,{"data-language":"text","data-theme":"default",children:(0,l.jsx)(e.span,{className:"line",children:(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" data:image/png;base64..."})})})}),"\n",(0,l.jsx)(e.p,{children:"è¿å°±æ¯ Data URL Scheme çè¯æ³æ ¼å¼ï¼å颿¯ç¨ Base64 ç¼ç çå¾çæ°æ®ã"}),"\n",(0,l.jsx)(e.p,{children:"宿´çå¾çå°±åä¸é¢è¿æ ·ï¼å¯ä»¥ç´æ¥å¤å¶å°å°åæ æ¥çï¼"}),"\n",(0,l.jsx)(e.pre,{"data-language":"text","data-theme":"default",children:(0,l.jsx)(e.code,{"data-language":"text","data-theme":"default",children:(0,l.jsx)(e.span,{className:"line",children:(0,l.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" data:image/png;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjI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ä½¿ç¨ Data URLï¼å¤§æ¦æ¯ç±äºè¿ä¸ªåå ï¼ææ¶åå¯ä»¥éçº§å¨æ§å¶å°ç´æ¥ä½¿ç¨ä¸å¼ å¾çã"}),"\n",(0,l.jsx)(e.h5,{id:"åèèµæ",children:"åèèµæï¼"}),"\n",(0,l.jsxs)(e.ol,{children:["\n",(0,l.jsx)(e.li,{children:(0,l.jsx)(e.a,{href:"https://developer.mozilla.org/zh-CN/docs/Web/API/Window.btoa",children:"https://developer.mozilla.org/zh-CN/docs/Web/API/Window.btoa"})}),"\n",(0,l.jsx)(e.li,{children:(0,l.jsx)(e.a,{href:"https://developer.mozilla.org/zh-CN/docs/Web/API/Window.atob",children:"https://developer.mozilla.org/zh-CN/docs/Web/API/Window.atob"})}),"\n",(0,l.jsx)(e.li,{children:(0,l.jsx)(e.a,{href:"http://tools.ietf.org/html/rfc2397",title:"RFC 2397 of the Internet Engineering Task Force (IETF)",children:"RFC 2397 of the Internet Engineering Task Force (IETF)"})}),"\n",(0,l.jsx)(e.li,{children:"Javascripté«çº§ç¨åºè®¾è®¡ï¼ç¬¬3çï¼[人æ°é®çµåºç社]"}),"\n",(0,l.jsx)(e.li,{children:"Javaå å¯ä¸è§£å¯çèºæ¯[æºæ¢°å·¥ä¸åºç社]"}),"\n"]})]})}let h={MDXContent:function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:e}=Object.assign({},(0,t.a)(),s.components);return e?(0,l.jsx)(e,{...s,children:(0,l.jsx)(a,{...s})}):a(s)},pageOpts:{filePath:"pages/posts/base64-note.md",route:"/posts/base64-note",frontMatter:{title:"Base64 ç®è¦ç¬è®°åå
¶ä»",date:"2014-11-06T00:00:00.000Z",tag:"JavaScript"},timestamp:1770794683e3,pageMap:[{kind:"MdxPage",name:"about",route:"/about",frontMatter:{type:"page",title:"About",date:"2024-04-01T00:00:00.000Z"}},{kind:"MdxPage",name:"if",route:"/if",frontMatter:{type:"page",title:"If",date:"2024-04-01T00:00:00.000Z"}},{kind:"MdxPage",name:"index",route:"/",frontMatter:{type:"page",title:"Home",date:"2024-04-01T00:00:00.000Z"}},{kind:"Folder",name:"posts",route:"/posts",children:[{kind:"MdxPage",name:"base64-note",route:"/posts/base64-note",frontMatter:{title:"Base64 ç®è¦ç¬è®°åå
¶ä»",date:"2014-11-06T00:00:00.000Z",tag:"JavaScript"}},{kind:"MdxPage",name:"call-apply-and-context-in-javascript",route:"/posts/call-apply-and-context-in-javascript",frontMatter:{title:"éå¹»è¯è¨ JavaScript ç³»åä¹ callãbind 以åä¸ä¸æ",date:"2017-11-09T00:00:00.000Z",categories:"translator",tag:"ECMAScript, JavaScript"}},{kind:"MdxPage",name:"game-of-life",route:"/posts/game-of-life",frontMatter:{title:"康å¨ç彿¸¸æçç®åå®ç°",date:"2014-08-21T10:00:00.000Z",tag:"JavaScript"}},{kind:"MdxPage",name:"index",route:"/posts",frontMatter:{type:"posts",title:"Posts",date:"2024-04-01T00:00:00.000Z"}},{kind:"MdxPage",name:"learning-at-work",route:"/posts/learning-at-work",frontMatter:{title:"å¨å·¥ä½ä¸å¦ä¹ ",date:"2017-09-02T00:00:00.000Z",categories:"translator",tag:"career"}},{kind:"MdxPage",name:"looking-into-assembly-code-of-coercion",route:"/posts/looking-into-assembly-code-of-coercion",frontMatter:{title:"éå¹»è¯è¨ JavaScript ç³»åä¹ç±»å转æ¢ã宽æ¾ç¸ç以ååå§å¼",date:"2018-04-12T00:00:00.000Z",categories:"translator",tag:"ECMAScript, JavaScript"}},{kind:"MdxPage",name:"my-atom-editor-setup-for-js-react",route:"/posts/my-atom-editor-setup-for-js-react",frontMatter:{title:"JS/React å¼åè
ç Atom ç»æé
ç½®",date:"2017-05-28T00:00:00.000Z",categories:"translator",tag:"editor, JavaScript"}},{kind:"MdxPage",name:"riding-on-318",route:"/posts/riding-on-318",frontMatter:{title:"318ï¼æ å
³æå£ï¼æ å
³æ¢¦æ³ï¼åªæ¯éªè¡èå·²",date:"2017-09-19T00:00:00.000Z",tag:"riding"}},{kind:"Meta",data:{index:"Posts","looking-into-assembly-code-of-coercion":"éå¹»è¯è¨ JavaScript ç³»åä¹ç±»å转æ¢ã宽æ¾ç¸ç以ååå§å¼","call-apply-and-context-in-javascript":"éå¹»è¯è¨ JavaScript ç³»åä¹ callãbind 以åä¸ä¸æ","riding-on-318":"318ï¼æ å
³æå£ï¼æ å
³æ¢¦æ³ï¼åªæ¯éªè¡èå·²","learning-at-work":"å¨å·¥ä½ä¸å¦ä¹ ","my-atom-editor-setup-for-js-react":"JS/React å¼åè
ç Atom ç»æé
ç½®","base64-note":"Base64 ç®è¦ç¬è®°åå
¶ä»","game-of-life":"康å¨ç彿¸¸æçç®åå®ç°"}}]},{kind:"Meta",data:{about:"About",if:"If",index:"Home"}}],flexsearch:{codeblocks:!0},title:"Base64 ç®è¦ç¬è®°åå
¶ä»",headings:c},pageNextRoute:"/posts/base64-note",nextraLayout:o.ZP,themeConfig:i.Z};e.default=(0,n.j)(h)},797:function(s,e,r){"use strict";var l=r(5893),n=r(9554),o=r.n(n);let i=new Date().getFullYear();e.Z={footer:(0,l.jsxs)("footer",{className:"jsx-2447ca1c11803f07",children:[(0,l.jsxs)("small",{className:"jsx-2447ca1c11803f07",children:[(0,l.jsx)("time",{className:"jsx-2447ca1c11803f07",children:i})," \xa9 Patrick Ran",(0,l.jsx)("a",{href:"/feed.xml",className:"jsx-2447ca1c11803f07",children:"RSS"})]}),(0,l.jsx)(o(),{id:"2447ca1c11803f07",children:"footer.jsx-2447ca1c11803f07{margin-top:8rem}a.jsx-2447ca1c11803f07{float:right}"})]})}}},function(s){s.O(0,[5936,2888,9774,179],function(){return s(s.s=3752)}),_N_E=s.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.