[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"i-icon:name":3,"i-ri:twitter-x-fill":9,"i-ri:github-fill":12,"i-ri:rss-line":14,"i-ri:sun-line":16,"i-ri:moon-clear-line":18,"i-ri:menu-line":20,"blog-cs\u002Fwhat-is-encoding":22,"related-articles-cs\u002Fwhat-is-encoding":1286,"i-icon:openai":1287,"i-ri:arrow-right-s-line":1291,"i-ep:copy-document":1293},{"left":4,"top":4,"width":5,"height":6,"rotate":4,"vFlip":7,"hFlip":7,"body":8},0,89,22,false,"\u003Cg fill=\"currentColor\">\u003Cstyle>\n        .signature {\n        fill: none;\n        stroke: currentColor;\n        stroke-linecap: round;\n        stroke-linejoin: round;\n        stroke-dasharray: 200;\n        stroke-dashoffset: 200;\n        animation: draw 6s alternate forwards;\n        }\n\n        @keyframes draw {\n        to {\n        stroke-dashoffset: 0;\n        opacity: 1;\n        }\n        }\n    \u003C\u002Fstyle>\n    \u003Cpath class=\"signature\"\n        d=\"M3.744 21.76C3.648 21.76 3.504 21.72 3.312 21.64C3.136 21.576 3.008 21.544 2.928 21.544C2.944 21.544 2.912 21.568 2.832 21.616L2.736 21.568C1.904 21.152 1.288 20.624 0.888 19.984C0.488 19.344 0.288 18.632 0.288 17.848C0.288 17.112 0.536 16.512 1.032 16.048C1.544 15.584 2.168 15.352 2.904 15.352C3.88 15.352 5.112 15.744 6.6 16.528L7.104 16.792C7.36 16.072 7.6 15.272 7.824 14.392C7.728 14.488 7.616 14.584 7.488 14.68C7.376 14.776 7.256 14.888 7.128 15.016C6.792 14.824 6.624 14.544 6.624 14.176C6.624 14.032 6.688 13.864 6.816 13.672C6.944 13.464 7.08 13.352 7.224 13.336C7.368 13.848 7.584 14.12 7.872 14.152C8.736 10.648 9.168 7.936 9.168 6.016C9.168 5.472 9.144 4.976 9.096 4.528C8.072 4.592 7.128 4.704 6.264 4.864C5.4 5.008 4.624 5.192 3.936 5.416C2.016 6.04 1.056 6.88 1.056 7.936C1.056 8.912 1.944 9.76 3.72 10.48C3.72 10.48 3.736 10.496 3.768 10.528C3.768 10.576 3.68 10.6 3.504 10.6C2.992 10.6 2.312 10.264 1.464 9.592C0.616 8.888 0.192 8.208 0.192 7.552C0.192 6.192 1.432 5.16 3.912 4.456C4.664 4.232 5.456 4.056 6.288 3.928C7.136 3.8 8.024 3.704 8.952 3.64C8.616 1.992 7.912 1.168 6.84 1.168H6.504C6.952 1.36 7.176 1.704 7.176 2.2C7.176 2.664 7.024 2.968 6.72 3.112C6.576 2.2 6.104 1.752 5.304 1.768C5.56 1.192 6.064 0.904 6.816 0.904C8.128 0.904 8.992 1.808 9.408 3.616C9.616 3.6 9.824 3.592 10.032 3.592C10.24 3.592 10.448 3.592 10.656 3.592C11.584 3.592 12.48 3.64 13.344 3.736C14.592 2.248 15.856 1.504 17.136 1.504C17.52 1.504 17.912 1.648 18.312 1.936C18.712 2.176 18.912 2.488 18.912 2.872C18.912 3.16 18.84 3.304 18.696 3.304C18.648 3.304 18.44 3.072 18.072 2.608C17.736 2.128 17.296 1.888 16.752 1.888C16.24 1.888 15.752 2.056 15.288 2.392C14.824 2.728 14.4 3.208 14.016 3.832C19.616 4.648 22.416 7.184 22.416 11.44C22.416 13.616 21.544 15.496 19.8 17.08C18.056 18.68 16.104 19.48 13.944 19.48C12.408 19.48 10.744 19.152 8.952 18.496C8.28 19.344 7.528 20 6.696 20.464C5.864 20.928 4.952 21.16 3.96 21.16H3.888C3.296 21.16 3 20.92 3 20.44C3 20.056 3.112 19.864 3.336 19.864C3.368 19.864 3.576 20.008 3.96 20.296C4.344 20.584 4.72 20.728 5.088 20.728C6.032 20.728 6.96 19.84 7.872 18.064L7.008 17.704L6.744 18.304C6.696 18.416 6.648 18.472 6.6 18.472C6.536 18.472 6.504 18.416 6.504 18.304C6.504 18.288 6.592 18.056 6.768 17.608C6.048 17.336 5.384 17.104 4.776 16.912C4.184 16.72 3.632 16.576 3.12 16.48C2.944 16.448 2.776 16.424 2.616 16.408C2.472 16.392 2.336 16.384 2.208 16.384C1.04 16.384 0.456 16.88 0.456 17.872C0.456 19.088 1.152 20.152 2.544 21.064C2.704 21.176 2.88 21.272 3.072 21.352C3.264 21.448 3.48 21.552 3.72 21.664C3.768 21.664 3.8 21.688 3.816 21.736C3.816 21.752 3.792 21.76 3.744 21.76ZM8.184 17.368C8.6 16.472 9 15.408 9.384 14.176C9.768 12.928 10.136 11.528 10.488 9.976C10.744 8.92 11.056 7.936 11.424 7.024C11.808 6.112 12.248 5.288 12.744 4.552C12.408 4.52 12.072 4.496 11.736 4.48C11.4 4.464 11.056 4.456 10.704 4.456C10.544 4.456 10.368 4.464 10.176 4.48C9.984 4.48 9.776 4.488 9.552 4.504C9.584 4.76 9.608 5.04 9.624 5.344C9.656 5.648 9.672 5.96 9.672 6.28C9.672 7.688 9.544 8.928 9.288 10C8.968 11.424 8.64 12.712 8.304 13.864C7.984 15.016 7.648 16.024 7.296 16.888L8.184 17.368ZM13.944 19.192C16.008 19.192 17.744 18.472 19.152 17.032C20.592 15.608 21.312 13.864 21.312 11.8C21.312 7.752 18.736 5.368 13.584 4.648C13.28 5.288 12.968 6.072 12.648 7C12.328 7.928 12.016 9 11.712 10.216L10.44 15.448C10.328 15.896 10.176 16.328 9.984 16.744C9.808 17.144 9.592 17.528 9.336 17.896C11.24 18.76 12.776 19.192 13.944 19.192ZM25.0843 19.192C24.4283 19.192 23.8603 19.008 23.3803 18.64C22.9163 18.256 22.6843 17.68 22.6843 16.912C22.6843 16.064 22.9643 15.192 23.5243 14.296C23.8123 13.832 24.1643 13.464 24.5803 13.192C24.9963 12.904 25.3643 12.76 25.6843 12.76C26.1483 12.76 26.3803 13.04 26.3803 13.6C26.3803 14.08 26.0603 14.664 25.4203 15.352C24.8283 15.96 24.2683 16.376 23.7403 16.6C23.7243 16.664 23.7083 16.736 23.6923 16.816C23.6923 16.88 23.6923 16.952 23.6923 17.032C23.6923 18.04 24.2923 18.544 25.4923 18.544C26.1803 18.544 26.8203 18.336 27.4123 17.92C28.0203 17.488 28.5483 17 28.9963 16.456C29.0763 16.36 29.1483 16.312 29.2123 16.312C29.2763 16.312 29.3083 16.344 29.3083 16.408C29.3083 16.472 29.2763 16.56 29.2123 16.672C29.1483 16.768 29.1003 16.832 29.0683 16.864C28.8123 17.216 28.5403 17.528 28.2523 17.8C27.9803 18.072 27.6123 18.336 27.1483 18.592C26.8123 18.8 26.4603 18.952 26.0923 19.048C25.7403 19.144 25.4043 19.192 25.0843 19.192ZM23.8363 16.096C24.0443 15.984 24.2443 15.856 24.4363 15.712C24.6443 15.552 24.8443 15.368 25.0363 15.16C25.4683 14.648 25.6843 14.2 25.6843 13.816C25.6843 13.576 25.6123 13.456 25.4683 13.456C25.3403 13.456 25.1723 13.568 24.9643 13.792C24.7723 14 24.5883 14.264 24.4123 14.584C24.1083 15.208 23.9163 15.712 23.8363 16.096ZM31.3656 19.192C30.7096 19.192 30.1416 19.008 29.6616 18.64C29.1976 18.256 28.9656 17.68 28.9656 16.912C28.9656 16.064 29.2456 15.192 29.8056 14.296C30.0936 13.832 30.4456 13.464 30.8616 13.192C31.2776 12.904 31.6456 12.76 31.9656 12.76C32.4296 12.76 32.6616 13.04 32.6616 13.6C32.6616 14.08 32.3416 14.664 31.7016 15.352C31.1096 15.96 30.5496 16.376 30.0216 16.6C30.0056 16.664 29.9896 16.736 29.9736 16.816C29.9736 16.88 29.9736 16.952 29.9736 17.032C29.9736 18.04 30.5736 18.544 31.7736 18.544C32.4616 18.544 33.1016 18.336 33.6936 17.92C34.3016 17.488 34.8296 17 35.2776 16.456C35.3576 16.36 35.4296 16.312 35.4936 16.312C35.5576 16.312 35.5896 16.344 35.5896 16.408C35.5896 16.472 35.5576 16.56 35.4936 16.672C35.4296 16.768 35.3816 16.832 35.3496 16.864C35.0936 17.216 34.8216 17.528 34.5336 17.8C34.2616 18.072 33.8936 18.336 33.4296 18.592C33.0936 18.8 32.7416 18.952 32.3736 19.048C32.0216 19.144 31.6856 19.192 31.3656 19.192ZM30.1176 16.096C30.3256 15.984 30.5256 15.856 30.7176 15.712C30.9256 15.552 31.1256 15.368 31.3176 15.16C31.7496 14.648 31.9656 14.2 31.9656 13.816C31.9656 13.576 31.8936 13.456 31.7496 13.456C31.6216 13.456 31.4536 13.568 31.2456 13.792C31.0536 14 30.8696 14.264 30.6936 14.584C30.3896 15.208 30.1976 15.712 30.1176 16.096ZM39.0868 19.12C38.5108 19.12 38.2228 18.76 38.2228 18.04C38.2228 17.656 38.3668 17.176 38.6548 16.6C38.9268 15.96 39.0628 15.496 39.0628 15.208C39.0628 15 38.9828 14.84 38.8228 14.728C38.6788 14.616 38.4948 14.512 38.2708 14.416C38.1108 14.336 37.9428 14.24 37.7668 14.128C37.5908 14.016 37.4468 13.904 37.3348 13.792C37.2228 14.032 36.9748 14.448 36.5908 15.04C36.2068 15.632 35.7908 16.24 35.3428 16.864C35.2788 16.944 35.2148 16.984 35.1508 16.984C35.0868 16.984 35.0548 16.928 35.0548 16.816C35.0548 16.704 35.1188 16.584 35.2468 16.456C35.3748 16.296 35.5588 16.04 35.7988 15.688C36.0388 15.32 36.2788 14.928 36.5188 14.512C36.7588 14.08 36.9428 13.704 37.0708 13.384C36.9908 13.112 36.9268 12.88 36.8788 12.688C36.8308 12.496 36.8068 12.304 36.8068 12.112C36.8068 11.776 36.9028 11.472 37.0948 11.2C37.2868 10.928 37.5348 10.792 37.8388 10.792C38.2708 10.792 38.4868 11.048 38.4868 11.56C38.4868 12.12 38.2708 12.704 37.8388 13.312C37.9028 13.408 37.9828 13.488 38.0788 13.552C38.1748 13.616 38.3268 13.688 38.5348 13.768C38.6468 13.816 38.7508 13.848 38.8468 13.864C38.9588 13.88 39.0548 13.888 39.1348 13.888C39.2628 13.888 39.3668 13.88 39.4468 13.864C39.5428 13.848 39.6228 13.84 39.6868 13.84C39.7828 13.84 39.8948 13.896 40.0228 14.008C40.1668 14.104 40.2388 14.256 40.2388 14.464C40.2388 14.576 40.2308 14.648 40.2148 14.68C40.1988 14.712 40.1508 14.848 40.0708 15.088C40.0068 15.312 39.8868 15.632 39.7108 16.048C39.3908 16.88 39.2308 17.464 39.2308 17.8C39.2308 18.248 39.3828 18.472 39.6868 18.472C40.0228 18.472 40.4228 18.272 40.8868 17.872C41.3668 17.472 41.8068 17 42.2068 16.456C42.2548 16.408 42.2948 16.384 42.3268 16.384C42.3908 16.384 42.4228 16.44 42.4228 16.552C42.4228 16.664 42.3828 16.768 42.3028 16.864C41.6628 17.712 41.0868 18.304 40.5748 18.64C40.0628 18.96 39.5668 19.12 39.0868 19.12ZM49.9123 21.448C49.4963 21.448 49.1923 21.16 49.0003 20.584C48.8243 20.136 48.7363 19.672 48.7363 19.192C48.7363 18.2 48.9923 17.024 49.5043 15.664C47.8083 15.376 46.2003 15.016 44.6803 14.584C43.7683 14.824 43.1123 14.944 42.7123 14.944C42.0723 14.944 41.7523 14.728 41.7523 14.296C41.7523 13.896 42.1923 13.696 43.0723 13.696C43.5843 13.696 44.2563 13.792 45.0883 13.984C46.1923 13.6 48.1763 12.448 51.0403 10.528C53.9363 8.576 55.7683 7.168 56.5363 6.304C56.7123 6.128 56.8483 6.04 56.9443 6.04C57.2323 6.04 57.3763 6.2 57.3763 6.52C57.3763 6.68 57.2483 6.832 56.9923 6.976L56.4403 7.336C55.9443 7.72 55.4163 8.208 54.8563 8.8C54.3123 9.392 53.7443 10.08 53.1523 10.864C52.6403 11.568 52.1683 12.272 51.7363 12.976C51.3203 13.664 50.9443 14.336 50.6083 14.992C51.9043 15.136 53.0403 15.208 54.0163 15.208C54.7203 15.208 55.4083 15.112 56.0803 14.92C57.0403 14.648 57.5203 14.264 57.5203 13.768C57.5203 13.368 57.1203 13.032 56.3203 12.76C55.5363 12.52 55.1443 12.368 55.1443 12.304C55.1443 12.224 55.1923 12.2 55.2883 12.232H55.3603C57.2003 12.344 58.1203 12.984 58.1203 14.152C58.1203 14.936 57.6563 15.496 56.7283 15.832C56.0723 16.088 55.2803 16.216 54.3523 16.216C53.3123 16.216 51.9363 16.072 50.2243 15.784C49.6483 17.128 49.3603 18.248 49.3603 19.144C49.3603 19.704 49.5123 20.184 49.8163 20.584C50.1043 21.032 50.2483 21.24 50.2483 21.208C50.2483 21.368 50.1363 21.448 49.9123 21.448ZM49.8163 14.896C50.1523 14.144 50.5283 13.408 50.9443 12.688C51.3763 11.952 51.8483 11.24 52.3603 10.552C50.5683 11.864 48.3363 13.064 45.6643 14.152C46.3363 14.312 47.0163 14.456 47.7043 14.584C48.3923 14.696 49.0963 14.8 49.8163 14.896ZM43.0483 14.536C43.3043 14.536 43.6803 14.464 44.1763 14.32C43.6483 14.096 43.2003 13.984 42.8323 13.984C42.3363 13.984 42.0883 14.096 42.0883 14.32C42.0883 14.464 42.4083 14.536 43.0483 14.536ZM62.9111 20.272C61.6311 20.272 60.6151 19.904 59.8631 19.168C59.1271 18.448 58.7591 17.456 58.7591 16.192C58.7591 15.504 58.8551 14.84 59.0471 14.2C58.7751 13.608 58.6391 12.944 58.6391 12.208C58.6391 11.072 59.0951 10.024 60.0071 9.064C61.7191 7.256 64.0071 6.352 66.8711 6.352C68.0551 6.352 69.1031 6.688 70.0151 7.36C70.9911 8.048 71.5671 8.976 71.7431 10.144C71.7911 10.496 71.8151 10.872 71.8151 11.272C71.8151 13.112 71.2311 14.832 70.0631 16.432C68.9431 17.952 67.4951 19.04 65.7191 19.696C64.7591 20.08 63.8231 20.272 62.9111 20.272ZM62.4311 19.288C63.4711 19.288 64.5991 19.008 65.8151 18.448C66.5991 18.064 67.3191 17.624 67.9751 17.128C68.6311 16.632 69.2151 16.08 69.7271 15.472C70.3191 14.752 70.7671 14.024 71.0711 13.288C71.3751 12.536 71.5271 11.768 71.5271 10.984C71.5271 10.856 71.5191 10.728 71.5031 10.6C71.5031 10.456 71.4951 10.32 71.4791 10.192C71.3351 9.184 70.7831 8.368 69.8231 7.744C68.9431 7.152 67.9591 6.856 66.8711 6.856C65.3511 6.856 63.9831 7.184 62.7671 7.84C61.4231 8.544 60.4391 9.536 59.8151 10.816C59.5111 11.408 59.3591 12.056 59.3591 12.76C59.3591 12.92 59.3751 13.048 59.4071 13.144C59.6311 12.728 59.9111 12.296 60.2471 11.848C60.5991 11.4 61.0151 10.936 61.4951 10.456C62.4711 9.48 63.3511 8.816 64.1351 8.464C64.9191 8.096 65.6391 7.912 66.2951 7.912C66.6151 7.912 66.7751 7.952 66.7751 8.032C66.7751 8.096 66.6071 8.144 66.2711 8.176C65.1991 8.176 63.9271 8.96 62.4551 10.528C61.1751 11.872 60.2551 13.168 59.6951 14.416C59.8231 14.624 59.9591 14.808 60.1031 14.968C60.2631 15.112 60.4311 15.232 60.6071 15.328C60.7831 15.408 60.8711 15.472 60.8711 15.52C60.8711 15.568 60.8231 15.592 60.7271 15.592C60.3271 15.592 59.9111 15.368 59.4791 14.92C59.3671 15.272 59.2791 15.552 59.2151 15.76C59.1671 15.968 59.1431 16.128 59.1431 16.24C59.1431 18.272 60.2391 19.288 62.4311 19.288ZM80.4983 21.448C80.0823 21.448 79.7783 21.16 79.5863 20.584C79.4103 20.136 79.3223 19.672 79.3223 19.192C79.3223 18.2 79.5783 17.024 80.0903 15.664C78.3943 15.376 76.7863 15.016 75.2663 14.584C74.3543 14.824 73.6983 14.944 73.2983 14.944C72.6583 14.944 72.3383 14.728 72.3383 14.296C72.3383 13.896 72.7783 13.696 73.6583 13.696C74.1703 13.696 74.8423 13.792 75.6743 13.984C76.7783 13.6 78.7623 12.448 81.6263 10.528C84.5223 8.576 86.3543 7.168 87.1223 6.304C87.2983 6.128 87.4343 6.04 87.5303 6.04C87.8183 6.04 87.9623 6.2 87.9623 6.52C87.9623 6.68 87.8343 6.832 87.5783 6.976L87.0263 7.336C86.5303 7.72 86.0023 8.208 85.4423 8.8C84.8983 9.392 84.3303 10.08 83.7383 10.864C83.2263 11.568 82.7543 12.272 82.3223 12.976C81.9063 13.664 81.5303 14.336 81.1943 14.992C82.4903 15.136 83.6263 15.208 84.6023 15.208C85.3063 15.208 85.9943 15.112 86.6663 14.92C87.6263 14.648 88.1063 14.264 88.1063 13.768C88.1063 13.368 87.7063 13.032 86.9062 12.76C86.1223 12.52 85.7303 12.368 85.7303 12.304C85.7303 12.224 85.7783 12.2 85.8743 12.232H85.9463C87.7863 12.344 88.7063 12.984 88.7063 14.152C88.7063 14.936 88.2423 15.496 87.3143 15.832C86.6583 16.088 85.8663 16.216 84.9383 16.216C83.8983 16.216 82.5223 16.072 80.8103 15.784C80.2343 17.128 79.9463 18.248 79.9463 19.144C79.9463 19.704 80.0983 20.184 80.4023 20.584C80.6903 21.032 80.8343 21.24 80.8343 21.208C80.8343 21.368 80.7223 21.448 80.4983 21.448ZM80.4023 14.896C80.7383 14.144 81.1143 13.408 81.5303 12.688C81.9623 11.952 82.4343 11.24 82.9463 10.552C81.1543 11.864 78.9223 13.064 76.2503 14.152C76.9223 14.312 77.6023 14.456 78.2903 14.584C78.9783 14.696 79.6823 14.8 80.4023 14.896ZM73.6343 14.536C73.8903 14.536 74.2663 14.464 74.7623 14.32C74.2343 14.096 73.7863 13.984 73.4183 13.984C72.9223 13.984 72.6743 14.096 72.6743 14.32C72.6743 14.464 72.9943 14.536 73.6343 14.536Z\"\n        fill=\"currentColor\" \u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":10,"height":10,"rotate":4,"vFlip":7,"hFlip":7,"body":11},24,"\u003Cpath fill=\"currentColor\" d=\"m17.687 3.063l-4.996 5.711l-4.32-5.711H2.112l7.477 9.776l-7.086 8.099h3.034l5.469-6.25l4.78 6.25h6.102l-7.794-10.304l6.625-7.571zm-1.064 16.06L5.654 4.782h1.803l10.846 14.34z\"\u002F>",{"left":4,"top":4,"width":10,"height":10,"rotate":4,"vFlip":7,"hFlip":7,"body":13},"\u003Cpath fill=\"currentColor\" d=\"M12.001 2c-5.525 0-10 4.475-10 10a9.99 9.99 0 0 0 6.837 9.488c.5.087.688-.213.688-.476c0-.237-.013-1.024-.013-1.862c-2.512.463-3.162-.612-3.362-1.175c-.113-.288-.6-1.175-1.025-1.413c-.35-.187-.85-.65-.013-.662c.788-.013 1.35.725 1.538 1.025c.9 1.512 2.337 1.087 2.912.825c.088-.65.35-1.087.638-1.337c-2.225-.25-4.55-1.113-4.55-4.938c0-1.088.387-1.987 1.025-2.687c-.1-.25-.45-1.275.1-2.65c0 0 .837-.263 2.75 1.024a9.3 9.3 0 0 1 2.5-.337c.85 0 1.7.112 2.5.337c1.913-1.3 2.75-1.024 2.75-1.024c.55 1.375.2 2.4.1 2.65c.637.7 1.025 1.587 1.025 2.687c0 3.838-2.337 4.688-4.562 4.938c.362.312.675.912.675 1.85c0 1.337-.013 2.412-.013 2.75c0 .262.188.574.688.474A10.02 10.02 0 0 0 22 12c0-5.525-4.475-10-10-10\"\u002F>",{"left":4,"top":4,"width":10,"height":10,"rotate":4,"vFlip":7,"hFlip":7,"body":15},"\u003Cpath fill=\"currentColor\" d=\"M3 17a4 4 0 0 1 4 4H3zm0-7c6.075 0 11 4.925 11 11h-2a9 9 0 0 0-9-9zm0-7c9.941 0 18 8.059 18 18h-2c0-8.837-7.163-16-16-16z\"\u002F>",{"left":4,"top":4,"width":10,"height":10,"rotate":4,"vFlip":7,"hFlip":7,"body":17},"\u003Cpath fill=\"currentColor\" d=\"M12 18a6 6 0 1 1 0-12a6 6 0 0 1 0 12m0-2a4 4 0 1 0 0-8a4 4 0 0 0 0 8M11 1h2v3h-2zm0 19h2v3h-2zM3.515 4.929l1.414-1.414L7.05 5.636L5.636 7.05zM16.95 18.364l1.414-1.414l2.121 2.121l-1.414 1.414zm2.121-14.85l1.414 1.415l-2.121 2.121l-1.414-1.414zM5.636 16.95l1.414 1.414l-2.121 2.121l-1.414-1.414zM23 11v2h-3v-2zM4 11v2H1v-2z\"\u002F>",{"left":4,"top":4,"width":10,"height":10,"rotate":4,"vFlip":7,"hFlip":7,"body":19},"\u003Cpath fill=\"currentColor\" d=\"M10 6a8 8 0 0 0 11.955 6.956C21.474 18.03 17.2 22 12 22C6.477 22 2 17.523 2 12c0-5.2 3.97-9.474 9.044-9.955A7.96 7.96 0 0 0 10 6m-6 6a8 8 0 0 0 8 8a8 8 0 0 0 6.957-4.045Q18.482 16 18 16C12.477 16 8 11.523 8 6q0-.481.045-.957A8 8 0 0 0 4 12m14.164-9.709L19 2.5v1l-.836.209a2 2 0 0 0-1.455 1.455L16.5 6h-1l-.209-.836a2 2 0 0 0-1.455-1.455L13 3.5v-1l.836-.209A2 2 0 0 0 15.29.836L15.5 0h1l.209.836a2 2 0 0 0 1.455 1.455m5 5L24 7.5v1l-.836.209a2 2 0 0 0-1.455 1.455L21.5 11h-1l-.209-.836a2 2 0 0 0-1.455-1.455L18 8.5v-1l.836-.209a2 2 0 0 0 1.455-1.455L20.5 5h1l.209.836a2 2 0 0 0 1.455 1.455\"\u002F>",{"left":4,"top":4,"width":10,"height":10,"rotate":4,"vFlip":7,"hFlip":7,"body":21},"\u003Cpath fill=\"currentColor\" d=\"M3 4h18v2H3zm0 7h18v2H3zm0 7h18v2H3z\"\u002F>",{"id":23,"type":24,"sourcePath":25,"routePath":26,"path":26,"title":27,"updatedAt":28,"meta":29,"body":36,"toc":1275},"YmxvZzpibG9nL2NzL3doYXQtaXMtZW5jb2RpbmcubWQ","blog","blog\u002Fcs\u002Fwhat-is-encoding.md","\u002Fposts\u002Fcs\u002Fwhat-is-encoding","编码：字符与计算机的桥梁","2026-02-12T10:13:18.000Z",{"id":23,"type":24,"sourcePath":25,"slug":30,"title":27,"updatedAt":28,"date":31,"tags":32,"summary":34,"comment":35,"draft":35,"lastUpdated":28},"cs\u002Fwhat-is-encoding","2024-11-21",[33],"cs","编码是连接字符与计算机的桥梁，解决容量、标准和效率问题。ASCII和Unicode分别奠定单语言和多语言编码基础，而Base64则确保二进制数据在文本格式中的安全传输。",true,{"type":37,"children":38},"root",[39,47,53,60,65,110,116,121,127,180,185,311,316,334,340,345,351,356,389,395,430,436,441,523,529,534,540,634,640,1144,1149,1177,1186,1191,1209,1214,1219,1224,1269],{"type":40,"tag":41,"props":42,"children":44},"element","h2",{"id":43},"编码字符与计算机的桥梁",[45],{"type":46,"value":27},"text",{"type":40,"tag":48,"props":49,"children":50},"p",{},[51],{"type":46,"value":52},"计算机世界中，一切本质上都是二进制。但二进制如何准确地表达人类语言和符号？这需要复杂的编码机制。",{"type":40,"tag":54,"props":55,"children":57},"h3",{"id":56},"编码的本质是什么",[58],{"type":46,"value":59},"编码的本质是什么？",{"type":40,"tag":48,"props":61,"children":62},{},[63],{"type":46,"value":64},"编码看起来只是把字符转换成二进制数字，但实际上要解决三个核心问题：",{"type":40,"tag":66,"props":67,"children":68},"ol",{},[69,81,100],{"type":40,"tag":70,"props":71,"children":72},"li",{},[73,79],{"type":40,"tag":74,"props":75,"children":76},"strong",{},[77],{"type":46,"value":78},"容量问题",{"type":46,"value":80},"：计算机只能存储有限的二进制位（0和1），但人类语言中的字符是无限的。就像用有限的数字去表示无限的物品。",{"type":40,"tag":70,"props":82,"children":83},{},[84,89,91,98],{"type":40,"tag":74,"props":85,"children":86},{},[87],{"type":46,"value":88},"统一标准",{"type":46,"value":90},"：不同的计算机系统都要能正确理解这些二进制数据。就像全世界的人都认可美元符号 ",{"type":40,"tag":92,"props":93,"children":95},"code",{"className":94},[],[96],{"type":46,"value":97},"$",{"type":46,"value":99}," 代表美元一样，我们需要一个统一的规则，让所有计算机都能正确显示文字。",{"type":40,"tag":70,"props":101,"children":102},{},[103,108],{"type":40,"tag":74,"props":104,"children":105},{},[106],{"type":46,"value":107},"效率问题",{"type":46,"value":109},"：在保证正确性的同时，还要让数据占用尽可能少的空间，传输尽可能快。就像我们在微信发消息，既要确保对方收到的内容准确无误，又要让消息传输速度快。",{"type":40,"tag":54,"props":111,"children":113},{"id":112},"ascii编码计算机字符表示的开端",[114],{"type":46,"value":115},"ASCII编码：计算机字符表示的开端",{"type":40,"tag":48,"props":117,"children":118},{},[119],{"type":46,"value":120},"ASCII（American Standard Code for Information Interchange）是计算机编码历史上的里程碑，它为字符在计算机中的表示建立了最初的标准。",{"type":40,"tag":122,"props":123,"children":125},"h4",{"id":124},"技术设计原理",[126],{"type":46,"value":124},{"type":40,"tag":128,"props":129,"children":130},"ul",{},[131,141],{"type":40,"tag":70,"props":132,"children":133},{},[134,139],{"type":40,"tag":74,"props":135,"children":136},{},[137],{"type":46,"value":138},"7位二进制编码",{"type":46,"value":140},"：总共可表示 2^7 = 128 个字符",{"type":40,"tag":70,"props":142,"children":143},{},[144,149,151],{"type":40,"tag":74,"props":145,"children":146},{},[147],{"type":46,"value":148},"字符范围",{"type":46,"value":150},"：\n",{"type":40,"tag":128,"props":152,"children":153},{},[154,175],{"type":40,"tag":70,"props":155,"children":156},{},[157,159,165,167,173],{"type":46,"value":158},"0-31：控制字符（如换行 ",{"type":40,"tag":92,"props":160,"children":162},{"className":161},[],[163],{"type":46,"value":164},"\\n",{"type":46,"value":166},"、回车 ",{"type":40,"tag":92,"props":168,"children":170},{"className":169},[],[171],{"type":46,"value":172},"\\r",{"type":46,"value":174},"）",{"type":40,"tag":70,"props":176,"children":177},{},[178],{"type":46,"value":179},"32-126：可打印字符（字母、数字、标点符号）",{"type":40,"tag":122,"props":181,"children":183},{"id":182},"编码映射示例",[184],{"type":46,"value":182},{"type":40,"tag":186,"props":187,"children":192},"pre",{"className":188,"code":189,"language":190,"meta":191,"style":191},"language-javascript shiki shiki-themes github-light github-dark","\u002F\u002F ASCII码点分析\nconsole.log((65).toString(2));  \u002F\u002F 1000001 - 大写A的二进制表示\nconsole.log((97).toString(2));  \u002F\u002F 1100001 - 小写a的二进制表示\n","javascript","",[193],{"type":40,"tag":92,"props":194,"children":195},{"__ignoreMap":191},[196,208,265],{"type":40,"tag":197,"props":198,"children":201},"span",{"class":199,"line":200},"line",1,[202],{"type":40,"tag":197,"props":203,"children":205},{"style":204},"--shiki-default:#6A737D;--shiki-dark:#6A737D",[206],{"type":46,"value":207},"\u002F\u002F ASCII码点分析\n",{"type":40,"tag":197,"props":209,"children":211},{"class":199,"line":210},2,[212,218,224,229,235,240,245,250,255,260],{"type":40,"tag":197,"props":213,"children":215},{"style":214},"--shiki-default:#24292E;--shiki-dark:#E1E4E8",[216],{"type":46,"value":217},"console.",{"type":40,"tag":197,"props":219,"children":221},{"style":220},"--shiki-default:#6F42C1;--shiki-dark:#B392F0",[222],{"type":46,"value":223},"log",{"type":40,"tag":197,"props":225,"children":226},{"style":214},[227],{"type":46,"value":228},"((",{"type":40,"tag":197,"props":230,"children":232},{"style":231},"--shiki-default:#005CC5;--shiki-dark:#79B8FF",[233],{"type":46,"value":234},"65",{"type":40,"tag":197,"props":236,"children":237},{"style":214},[238],{"type":46,"value":239},").",{"type":40,"tag":197,"props":241,"children":242},{"style":220},[243],{"type":46,"value":244},"toString",{"type":40,"tag":197,"props":246,"children":247},{"style":214},[248],{"type":46,"value":249},"(",{"type":40,"tag":197,"props":251,"children":252},{"style":231},[253],{"type":46,"value":254},"2",{"type":40,"tag":197,"props":256,"children":257},{"style":214},[258],{"type":46,"value":259},"));  ",{"type":40,"tag":197,"props":261,"children":262},{"style":204},[263],{"type":46,"value":264},"\u002F\u002F 1000001 - 大写A的二进制表示\n",{"type":40,"tag":197,"props":266,"children":268},{"class":199,"line":267},3,[269,273,277,281,286,290,294,298,302,306],{"type":40,"tag":197,"props":270,"children":271},{"style":214},[272],{"type":46,"value":217},{"type":40,"tag":197,"props":274,"children":275},{"style":220},[276],{"type":46,"value":223},{"type":40,"tag":197,"props":278,"children":279},{"style":214},[280],{"type":46,"value":228},{"type":40,"tag":197,"props":282,"children":283},{"style":231},[284],{"type":46,"value":285},"97",{"type":40,"tag":197,"props":287,"children":288},{"style":214},[289],{"type":46,"value":239},{"type":40,"tag":197,"props":291,"children":292},{"style":220},[293],{"type":46,"value":244},{"type":40,"tag":197,"props":295,"children":296},{"style":214},[297],{"type":46,"value":249},{"type":40,"tag":197,"props":299,"children":300},{"style":231},[301],{"type":46,"value":254},{"type":40,"tag":197,"props":303,"children":304},{"style":214},[305],{"type":46,"value":259},{"type":40,"tag":197,"props":307,"children":308},{"style":204},[309],{"type":46,"value":310},"\u002F\u002F 1100001 - 小写a的二进制表示\n",{"type":40,"tag":48,"props":312,"children":313},{},[314],{"type":46,"value":315},"关键特征：",{"type":40,"tag":128,"props":317,"children":318},{},[319,324,329],{"type":40,"tag":70,"props":320,"children":321},{},[322],{"type":46,"value":323},"7位二进制表示（2^7 = 128个字符）",{"type":40,"tag":70,"props":325,"children":326},{},[327],{"type":46,"value":328},"前32个码点用于控制字符（如换行、退格）",{"type":40,"tag":70,"props":330,"children":331},{},[332],{"type":46,"value":333},"设计时的局限性：仅支持英语字符集",{"type":40,"tag":54,"props":335,"children":337},{"id":336},"unicode多语言编码的全球标准",[338],{"type":46,"value":339},"Unicode：多语言编码的全球标准",{"type":40,"tag":48,"props":341,"children":342},{},[343],{"type":46,"value":344},"ASCII只能表达128个字符，可是世界上有成千上万的字符，导致产生了很多基于不同地区的编码标准。例如GB2312、Shift-JIS、EUC-KR。\nUnicode是解决多语言字符编码的方案，旨在为全球每一个字符提供唯一且统一的编码标准。",{"type":40,"tag":122,"props":346,"children":348},{"id":347},"unicode的关键设计理念",[349],{"type":46,"value":350},"Unicode的关键设计理念",{"type":40,"tag":48,"props":352,"children":353},{},[354],{"type":46,"value":355},"Unicode本身只是一个字符集，会把字符映射成对应的码点（Code Point）。",{"type":40,"tag":128,"props":357,"children":358},{},[359,369,379],{"type":40,"tag":70,"props":360,"children":361},{},[362,367],{"type":40,"tag":74,"props":363,"children":364},{},[365],{"type":46,"value":366},"通用性",{"type":46,"value":368},"：覆盖全球所有书写系统和符号",{"type":40,"tag":70,"props":370,"children":371},{},[372,377],{"type":40,"tag":74,"props":373,"children":374},{},[375],{"type":46,"value":376},"唯一性",{"type":46,"value":378},"：每个字符都有独特的码点（Code Point）",{"type":40,"tag":70,"props":380,"children":381},{},[382,387],{"type":40,"tag":74,"props":383,"children":384},{},[385],{"type":46,"value":386},"可扩展性",{"type":46,"value":388},"：目前已定义超过140,000个字符",{"type":40,"tag":122,"props":390,"children":392},{"id":391},"unicode编码空间",[393],{"type":46,"value":394},"Unicode编码空间",{"type":40,"tag":128,"props":396,"children":397},{},[398,408],{"type":40,"tag":70,"props":399,"children":400},{},[401,406],{"type":40,"tag":74,"props":402,"children":403},{},[404],{"type":46,"value":405},"码点范围",{"type":46,"value":407},"：U+0000 到 U+10FFFF",{"type":40,"tag":70,"props":409,"children":410},{},[411,416,417],{"type":40,"tag":74,"props":412,"children":413},{},[414],{"type":46,"value":415},"平面划分",{"type":46,"value":150},{"type":40,"tag":128,"props":418,"children":419},{},[420,425],{"type":40,"tag":70,"props":421,"children":422},{},[423],{"type":46,"value":424},"基本多语言平面（BMP）：U+0000 - U+FFFF",{"type":40,"tag":70,"props":426,"children":427},{},[428],{"type":46,"value":429},"辅助平面：U+10000 - U+10FFFF",{"type":40,"tag":122,"props":431,"children":433},{"id":432},"unicode编码方式",[434],{"type":46,"value":435},"Unicode编码方式",{"type":40,"tag":48,"props":437,"children":438},{},[439],{"type":46,"value":440},"UTF-8、UTF-16、UTF-32、是Unicode的编码方式，定义了如何将码点转换为二进制，不同的编码方式会影响码点的存储空间。",{"type":40,"tag":66,"props":442,"children":443},{},[444,472,495],{"type":40,"tag":70,"props":445,"children":446},{},[447,452,454],{"type":40,"tag":74,"props":448,"children":449},{},[450],{"type":46,"value":451},"UTF-8",{"type":46,"value":453},"：变长编码的精妙设计",{"type":40,"tag":128,"props":455,"children":456},{},[457,462,467],{"type":40,"tag":70,"props":458,"children":459},{},[460],{"type":46,"value":461},"ASCII兼容：英文字符仍占1字节",{"type":40,"tag":70,"props":463,"children":464},{},[465],{"type":46,"value":466},"中文字符：基本汉字（BMP平面内）3字节，扩展汉字 4字节",{"type":40,"tag":70,"props":468,"children":469},{},[470],{"type":46,"value":471},"动态长度编码（1-4字节）",{"type":40,"tag":70,"props":473,"children":474},{},[475,480,482],{"type":40,"tag":74,"props":476,"children":477},{},[478],{"type":46,"value":479},"UTF-16",{"type":46,"value":481},"：定长编码的权衡",{"type":40,"tag":128,"props":483,"children":484},{},[485,490],{"type":40,"tag":70,"props":486,"children":487},{},[488],{"type":46,"value":489},"对于基本多语言平面（BMP）字符，固定16位",{"type":40,"tag":70,"props":491,"children":492},{},[493],{"type":46,"value":494},"对于辅助平面字符，使用代理对（surrogate pairs）",{"type":40,"tag":70,"props":496,"children":497},{},[498,503,505],{"type":40,"tag":74,"props":499,"children":500},{},[501],{"type":46,"value":502},"UTF-32",{"type":46,"value":504},"：简单但低效",{"type":40,"tag":128,"props":506,"children":507},{},[508,513,518],{"type":40,"tag":70,"props":509,"children":510},{},[511],{"type":46,"value":512},"固定4字节表示每个字符",{"type":40,"tag":70,"props":514,"children":515},{},[516],{"type":46,"value":517},"空间利用率低",{"type":40,"tag":70,"props":519,"children":520},{},[521],{"type":46,"value":522},"计算简单，但存储成本高",{"type":40,"tag":54,"props":524,"children":526},{"id":525},"base64编码数据转换的桥梁",[527],{"type":46,"value":528},"Base64编码：数据转换的桥梁",{"type":40,"tag":48,"props":530,"children":531},{},[532],{"type":46,"value":533},"Base64是一种将二进制数据转换为文本格式的编码技术，使用64个可打印字符表示二进制数据，广泛应用于数据传输和存储场景。",{"type":40,"tag":122,"props":535,"children":537},{"id":536},"base64的核心特点",[538],{"type":46,"value":539},"Base64的核心特点",{"type":40,"tag":66,"props":541,"children":542},{},[543,577,608],{"type":40,"tag":70,"props":544,"children":545},{},[546,551],{"type":40,"tag":74,"props":547,"children":548},{},[549],{"type":46,"value":550},"字符集转换",{"type":40,"tag":128,"props":552,"children":553},{},[554,559,564],{"type":40,"tag":70,"props":555,"children":556},{},[557],{"type":46,"value":558},"将二进制数据映射到64个可打印字符",{"type":40,"tag":70,"props":560,"children":561},{},[562],{"type":46,"value":563},"包括A-Z、a-z、0-9和两个特殊字符（+\u002F）",{"type":40,"tag":70,"props":565,"children":566},{},[567,569,575],{"type":46,"value":568},"使用 ",{"type":40,"tag":92,"props":570,"children":572},{"className":571},[],[573],{"type":46,"value":574},"=",{"type":46,"value":576}," 作为填充字符",{"type":40,"tag":70,"props":578,"children":579},{},[580,585],{"type":40,"tag":74,"props":581,"children":582},{},[583],{"type":46,"value":584},"应用场景",{"type":40,"tag":128,"props":586,"children":587},{},[588,593,598,603],{"type":40,"tag":70,"props":589,"children":590},{},[591],{"type":46,"value":592},"电子邮件附件编码",{"type":40,"tag":70,"props":594,"children":595},{},[596],{"type":46,"value":597},"Web数据传输",{"type":40,"tag":70,"props":599,"children":600},{},[601],{"type":46,"value":602},"图片、音频等资源的内嵌",{"type":40,"tag":70,"props":604,"children":605},{},[606],{"type":46,"value":607},"JWT令牌存储",{"type":40,"tag":70,"props":609,"children":610},{},[611,616],{"type":40,"tag":74,"props":612,"children":613},{},[614],{"type":46,"value":615},"编码原理",{"type":40,"tag":128,"props":617,"children":618},{},[619,624,629],{"type":40,"tag":70,"props":620,"children":621},{},[622],{"type":46,"value":623},"将3字节（24位）数据分割为4个6位组",{"type":40,"tag":70,"props":625,"children":626},{},[627],{"type":46,"value":628},"每个6位组映射到一个可打印字符",{"type":40,"tag":70,"props":630,"children":631},{},[632],{"type":46,"value":633},"确保数据在不同系统间安全传输",{"type":40,"tag":122,"props":635,"children":637},{"id":636},"深入解析base64编码机制",[638],{"type":46,"value":639},"深入解析Base64编码机制",{"type":40,"tag":186,"props":641,"children":643},{"className":188,"code":642,"language":190,"meta":191,"style":191},"function detailedBase64Encoding(input) {\n  \u002F\u002F 1. 文本转UTF-8字节\n  const utf8Bytes = new TextEncoder().encode(input);\n  \n  \u002F\u002F 2. 二进制处理的底层逻辑\n  const binaryString = utf8Bytes.reduce(\n    (acc, byte) => acc + byte.toString(2).padStart(8, '0'), \n    ''\n  );\n  \n  \u002F\u002F 3. 6位分组\n  const base64Groups = binaryString.match(\u002F.{1,6}\u002Fg)\n    .map(group => group.padEnd(6, '0'));\n  \n  return {\n    originalText: input,\n    utf8Bytes,\n    binaryRepresentation: binaryString,\n    base64Groups\n  };\n}\n\nconsole.log(detailedBase64Encoding('Hello'));\n",[644],{"type":40,"tag":92,"props":645,"children":646},{"__ignoreMap":191},[647,676,684,727,736,745,777,871,880,889,897,906,966,1026,1034,1048,1057,1066,1075,1084,1093,1102,1110],{"type":40,"tag":197,"props":648,"children":649},{"class":199,"line":200},[650,656,661,665,671],{"type":40,"tag":197,"props":651,"children":653},{"style":652},"--shiki-default:#D73A49;--shiki-dark:#F97583",[654],{"type":46,"value":655},"function",{"type":40,"tag":197,"props":657,"children":658},{"style":220},[659],{"type":46,"value":660}," detailedBase64Encoding",{"type":40,"tag":197,"props":662,"children":663},{"style":214},[664],{"type":46,"value":249},{"type":40,"tag":197,"props":666,"children":668},{"style":667},"--shiki-default:#E36209;--shiki-dark:#FFAB70",[669],{"type":46,"value":670},"input",{"type":40,"tag":197,"props":672,"children":673},{"style":214},[674],{"type":46,"value":675},") {\n",{"type":40,"tag":197,"props":677,"children":678},{"class":199,"line":210},[679],{"type":40,"tag":197,"props":680,"children":681},{"style":204},[682],{"type":46,"value":683},"  \u002F\u002F 1. 文本转UTF-8字节\n",{"type":40,"tag":197,"props":685,"children":686},{"class":199,"line":267},[687,692,697,702,707,712,717,722],{"type":40,"tag":197,"props":688,"children":689},{"style":652},[690],{"type":46,"value":691},"  const",{"type":40,"tag":197,"props":693,"children":694},{"style":231},[695],{"type":46,"value":696}," utf8Bytes",{"type":40,"tag":197,"props":698,"children":699},{"style":652},[700],{"type":46,"value":701}," =",{"type":40,"tag":197,"props":703,"children":704},{"style":652},[705],{"type":46,"value":706}," new",{"type":40,"tag":197,"props":708,"children":709},{"style":220},[710],{"type":46,"value":711}," TextEncoder",{"type":40,"tag":197,"props":713,"children":714},{"style":214},[715],{"type":46,"value":716},"().",{"type":40,"tag":197,"props":718,"children":719},{"style":220},[720],{"type":46,"value":721},"encode",{"type":40,"tag":197,"props":723,"children":724},{"style":214},[725],{"type":46,"value":726},"(input);\n",{"type":40,"tag":197,"props":728,"children":730},{"class":199,"line":729},4,[731],{"type":40,"tag":197,"props":732,"children":733},{"style":214},[734],{"type":46,"value":735},"  \n",{"type":40,"tag":197,"props":737,"children":739},{"class":199,"line":738},5,[740],{"type":40,"tag":197,"props":741,"children":742},{"style":204},[743],{"type":46,"value":744},"  \u002F\u002F 2. 二进制处理的底层逻辑\n",{"type":40,"tag":197,"props":746,"children":748},{"class":199,"line":747},6,[749,753,758,762,767,772],{"type":40,"tag":197,"props":750,"children":751},{"style":652},[752],{"type":46,"value":691},{"type":40,"tag":197,"props":754,"children":755},{"style":231},[756],{"type":46,"value":757}," binaryString",{"type":40,"tag":197,"props":759,"children":760},{"style":652},[761],{"type":46,"value":701},{"type":40,"tag":197,"props":763,"children":764},{"style":214},[765],{"type":46,"value":766}," utf8Bytes.",{"type":40,"tag":197,"props":768,"children":769},{"style":220},[770],{"type":46,"value":771},"reduce",{"type":40,"tag":197,"props":773,"children":774},{"style":214},[775],{"type":46,"value":776},"(\n",{"type":40,"tag":197,"props":778,"children":780},{"class":199,"line":779},7,[781,786,791,796,801,806,811,816,821,826,830,834,838,842,847,851,856,860,866],{"type":40,"tag":197,"props":782,"children":783},{"style":214},[784],{"type":46,"value":785},"    (",{"type":40,"tag":197,"props":787,"children":788},{"style":667},[789],{"type":46,"value":790},"acc",{"type":40,"tag":197,"props":792,"children":793},{"style":214},[794],{"type":46,"value":795},", ",{"type":40,"tag":197,"props":797,"children":798},{"style":667},[799],{"type":46,"value":800},"byte",{"type":40,"tag":197,"props":802,"children":803},{"style":214},[804],{"type":46,"value":805},") ",{"type":40,"tag":197,"props":807,"children":808},{"style":652},[809],{"type":46,"value":810},"=>",{"type":40,"tag":197,"props":812,"children":813},{"style":214},[814],{"type":46,"value":815}," acc ",{"type":40,"tag":197,"props":817,"children":818},{"style":652},[819],{"type":46,"value":820},"+",{"type":40,"tag":197,"props":822,"children":823},{"style":214},[824],{"type":46,"value":825}," byte.",{"type":40,"tag":197,"props":827,"children":828},{"style":220},[829],{"type":46,"value":244},{"type":40,"tag":197,"props":831,"children":832},{"style":214},[833],{"type":46,"value":249},{"type":40,"tag":197,"props":835,"children":836},{"style":231},[837],{"type":46,"value":254},{"type":40,"tag":197,"props":839,"children":840},{"style":214},[841],{"type":46,"value":239},{"type":40,"tag":197,"props":843,"children":844},{"style":220},[845],{"type":46,"value":846},"padStart",{"type":40,"tag":197,"props":848,"children":849},{"style":214},[850],{"type":46,"value":249},{"type":40,"tag":197,"props":852,"children":853},{"style":231},[854],{"type":46,"value":855},"8",{"type":40,"tag":197,"props":857,"children":858},{"style":214},[859],{"type":46,"value":795},{"type":40,"tag":197,"props":861,"children":863},{"style":862},"--shiki-default:#032F62;--shiki-dark:#9ECBFF",[864],{"type":46,"value":865},"'0'",{"type":40,"tag":197,"props":867,"children":868},{"style":214},[869],{"type":46,"value":870},"), \n",{"type":40,"tag":197,"props":872,"children":874},{"class":199,"line":873},8,[875],{"type":40,"tag":197,"props":876,"children":877},{"style":862},[878],{"type":46,"value":879},"    ''\n",{"type":40,"tag":197,"props":881,"children":883},{"class":199,"line":882},9,[884],{"type":40,"tag":197,"props":885,"children":886},{"style":214},[887],{"type":46,"value":888},"  );\n",{"type":40,"tag":197,"props":890,"children":892},{"class":199,"line":891},10,[893],{"type":40,"tag":197,"props":894,"children":895},{"style":214},[896],{"type":46,"value":735},{"type":40,"tag":197,"props":898,"children":900},{"class":199,"line":899},11,[901],{"type":40,"tag":197,"props":902,"children":903},{"style":204},[904],{"type":46,"value":905},"  \u002F\u002F 3. 6位分组\n",{"type":40,"tag":197,"props":907,"children":909},{"class":199,"line":908},12,[910,914,919,923,928,933,937,942,947,952,956,961],{"type":40,"tag":197,"props":911,"children":912},{"style":652},[913],{"type":46,"value":691},{"type":40,"tag":197,"props":915,"children":916},{"style":231},[917],{"type":46,"value":918}," base64Groups",{"type":40,"tag":197,"props":920,"children":921},{"style":652},[922],{"type":46,"value":701},{"type":40,"tag":197,"props":924,"children":925},{"style":214},[926],{"type":46,"value":927}," binaryString.",{"type":40,"tag":197,"props":929,"children":930},{"style":220},[931],{"type":46,"value":932},"match",{"type":40,"tag":197,"props":934,"children":935},{"style":214},[936],{"type":46,"value":249},{"type":40,"tag":197,"props":938,"children":939},{"style":862},[940],{"type":46,"value":941},"\u002F",{"type":40,"tag":197,"props":943,"children":944},{"style":231},[945],{"type":46,"value":946},".",{"type":40,"tag":197,"props":948,"children":949},{"style":652},[950],{"type":46,"value":951},"{1,6}",{"type":40,"tag":197,"props":953,"children":954},{"style":862},[955],{"type":46,"value":941},{"type":40,"tag":197,"props":957,"children":958},{"style":652},[959],{"type":46,"value":960},"g",{"type":40,"tag":197,"props":962,"children":963},{"style":214},[964],{"type":46,"value":965},")\n",{"type":40,"tag":197,"props":967,"children":969},{"class":199,"line":968},13,[970,975,980,984,989,994,999,1004,1008,1013,1017,1021],{"type":40,"tag":197,"props":971,"children":972},{"style":214},[973],{"type":46,"value":974},"    .",{"type":40,"tag":197,"props":976,"children":977},{"style":220},[978],{"type":46,"value":979},"map",{"type":40,"tag":197,"props":981,"children":982},{"style":214},[983],{"type":46,"value":249},{"type":40,"tag":197,"props":985,"children":986},{"style":667},[987],{"type":46,"value":988},"group",{"type":40,"tag":197,"props":990,"children":991},{"style":652},[992],{"type":46,"value":993}," =>",{"type":40,"tag":197,"props":995,"children":996},{"style":214},[997],{"type":46,"value":998}," group.",{"type":40,"tag":197,"props":1000,"children":1001},{"style":220},[1002],{"type":46,"value":1003},"padEnd",{"type":40,"tag":197,"props":1005,"children":1006},{"style":214},[1007],{"type":46,"value":249},{"type":40,"tag":197,"props":1009,"children":1010},{"style":231},[1011],{"type":46,"value":1012},"6",{"type":40,"tag":197,"props":1014,"children":1015},{"style":214},[1016],{"type":46,"value":795},{"type":40,"tag":197,"props":1018,"children":1019},{"style":862},[1020],{"type":46,"value":865},{"type":40,"tag":197,"props":1022,"children":1023},{"style":214},[1024],{"type":46,"value":1025},"));\n",{"type":40,"tag":197,"props":1027,"children":1029},{"class":199,"line":1028},14,[1030],{"type":40,"tag":197,"props":1031,"children":1032},{"style":214},[1033],{"type":46,"value":735},{"type":40,"tag":197,"props":1035,"children":1037},{"class":199,"line":1036},15,[1038,1043],{"type":40,"tag":197,"props":1039,"children":1040},{"style":652},[1041],{"type":46,"value":1042},"  return",{"type":40,"tag":197,"props":1044,"children":1045},{"style":214},[1046],{"type":46,"value":1047}," {\n",{"type":40,"tag":197,"props":1049,"children":1051},{"class":199,"line":1050},16,[1052],{"type":40,"tag":197,"props":1053,"children":1054},{"style":214},[1055],{"type":46,"value":1056},"    originalText: input,\n",{"type":40,"tag":197,"props":1058,"children":1060},{"class":199,"line":1059},17,[1061],{"type":40,"tag":197,"props":1062,"children":1063},{"style":214},[1064],{"type":46,"value":1065},"    utf8Bytes,\n",{"type":40,"tag":197,"props":1067,"children":1069},{"class":199,"line":1068},18,[1070],{"type":40,"tag":197,"props":1071,"children":1072},{"style":214},[1073],{"type":46,"value":1074},"    binaryRepresentation: binaryString,\n",{"type":40,"tag":197,"props":1076,"children":1078},{"class":199,"line":1077},19,[1079],{"type":40,"tag":197,"props":1080,"children":1081},{"style":214},[1082],{"type":46,"value":1083},"    base64Groups\n",{"type":40,"tag":197,"props":1085,"children":1087},{"class":199,"line":1086},20,[1088],{"type":40,"tag":197,"props":1089,"children":1090},{"style":214},[1091],{"type":46,"value":1092},"  };\n",{"type":40,"tag":197,"props":1094,"children":1096},{"class":199,"line":1095},21,[1097],{"type":40,"tag":197,"props":1098,"children":1099},{"style":214},[1100],{"type":46,"value":1101},"}\n",{"type":40,"tag":197,"props":1103,"children":1104},{"class":199,"line":6},[1105],{"type":40,"tag":197,"props":1106,"children":1107},{"emptyLinePlaceholder":35},[1108],{"type":46,"value":1109},"\n",{"type":40,"tag":197,"props":1111,"children":1113},{"class":199,"line":1112},23,[1114,1118,1122,1126,1131,1135,1140],{"type":40,"tag":197,"props":1115,"children":1116},{"style":214},[1117],{"type":46,"value":217},{"type":40,"tag":197,"props":1119,"children":1120},{"style":220},[1121],{"type":46,"value":223},{"type":40,"tag":197,"props":1123,"children":1124},{"style":214},[1125],{"type":46,"value":249},{"type":40,"tag":197,"props":1127,"children":1128},{"style":220},[1129],{"type":46,"value":1130},"detailedBase64Encoding",{"type":40,"tag":197,"props":1132,"children":1133},{"style":214},[1134],{"type":46,"value":249},{"type":40,"tag":197,"props":1136,"children":1137},{"style":862},[1138],{"type":46,"value":1139},"'Hello'",{"type":40,"tag":197,"props":1141,"children":1142},{"style":214},[1143],{"type":46,"value":1025},{"type":40,"tag":48,"props":1145,"children":1146},{},[1147],{"type":46,"value":1148},"Base64编码的关键步骤：",{"type":40,"tag":66,"props":1150,"children":1151},{},[1152,1157,1162,1167,1172],{"type":40,"tag":70,"props":1153,"children":1154},{},[1155],{"type":46,"value":1156},"将输入数据转换成二进制",{"type":40,"tag":70,"props":1158,"children":1159},{},[1160],{"type":46,"value":1161},"按3个字节（24位）为一组进行重组",{"type":40,"tag":70,"props":1163,"children":1164},{},[1165],{"type":46,"value":1166},"将24位重新分组成4个6位组",{"type":40,"tag":70,"props":1168,"children":1169},{},[1170],{"type":46,"value":1171},"因为计算机以字节（8位）存储，每个6位会补齐到8位",{"type":40,"tag":70,"props":1173,"children":1174},{},[1175],{"type":46,"value":1176},"所以3个字节（24位）会变成4个字节（32位），导致存储的数据量增加33% (3 * 8 = 4 * 6, 但是6个位放入一个字节，也会填充多余的2个位进去，所以编码后会有32个位，所以会多 （32-24）\u002F24 = 0.33)",{"type":40,"tag":1178,"props":1179,"children":1180},"blockquote",{},[1181],{"type":40,"tag":48,"props":1182,"children":1183},{},[1184],{"type":46,"value":1185},"因为分成6个位为一个字节，所以重新分出来的字节里，有效位就到第六位，也就是不会超过64，刚好可以对照字符集，取到对应的字符。",{"type":40,"tag":54,"props":1187,"children":1189},{"id":1188},"实践中的深度思考",[1190],{"type":46,"value":1188},{"type":40,"tag":128,"props":1192,"children":1193},{},[1194,1199,1204],{"type":40,"tag":70,"props":1195,"children":1196},{},[1197],{"type":46,"value":1198},"存储中文：UTF-8是比较好的选择",{"type":40,"tag":70,"props":1200,"children":1201},{},[1202],{"type":46,"value":1203},"网络传输：Base64确保二进制安全传输",{"type":40,"tag":70,"props":1205,"children":1206},{},[1207],{"type":46,"value":1208},"性能考量：根据具体场景选择编码方案",{"type":40,"tag":41,"props":1210,"children":1212},{"id":1211},"结语",[1213],{"type":46,"value":1211},{"type":40,"tag":48,"props":1215,"children":1216},{},[1217],{"type":46,"value":1218},"编码不仅是技术，更是人类语言与计算机系统之间的复杂翻译机制。每一个字节都承载着信息传递的精妙设计。",{"type":40,"tag":41,"props":1220,"children":1222},{"id":1221},"参考资料",[1223],{"type":46,"value":1221},{"type":40,"tag":128,"props":1225,"children":1226},{},[1227,1239,1249,1259],{"type":40,"tag":70,"props":1228,"children":1229},{},[1230],{"type":40,"tag":1231,"props":1232,"children":1236},"a",{"href":1233,"rel":1234},"https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002F3538021\u002Fwhy-do-we-use-base64",[1235],"nofollow",[1237],{"type":46,"value":1238},"algorithm - Why do we use Base64? - Stack Overflow",{"type":40,"tag":70,"props":1240,"children":1241},{},[1242],{"type":40,"tag":1231,"props":1243,"children":1246},{"href":1244,"rel":1245},"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=wdeZIOJjjdE",[1235],[1247],{"type":46,"value":1248},"How the Most Popular Encoding on Web Works? Base64 Explained - YouTube",{"type":40,"tag":70,"props":1250,"children":1251},{},[1252],{"type":40,"tag":1231,"props":1253,"children":1256},{"href":1254,"rel":1255},"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=GMF2Z1EZHXk&t=311s",[1235],[1257],{"type":46,"value":1258},"How Computers Store Text - ASCII, Unicode, UTF-8, UTF-16, and UTF-32 - YouTube",{"type":40,"tag":70,"props":1260,"children":1261},{},[1262],{"type":40,"tag":1231,"props":1263,"children":1266},{"href":1264,"rel":1265},"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=7QCq3aT9kFQ",[1235],[1267],{"type":46,"value":1268},"How does Binary work? From the Basics to Floating Point - YouTube",{"type":40,"tag":1270,"props":1271,"children":1272},"style",{},[1273],{"type":46,"value":1274},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":191,"searchDepth":210,"depth":210,"links":1276},[1277,1284,1285],{"id":43,"depth":210,"text":27,"children":1278},[1279,1280,1281,1282,1283],{"id":56,"depth":267,"text":59},{"id":112,"depth":267,"text":115},{"id":336,"depth":267,"text":339},{"id":525,"depth":267,"text":528},{"id":1188,"depth":267,"text":1188},{"id":1211,"depth":210,"text":1211},{"id":1221,"depth":210,"text":1221},[],{"left":4,"top":4,"width":1288,"height":1289,"rotate":4,"vFlip":7,"hFlip":7,"body":1290},256,260,"\u003Cg fill=\"currentColor\">\u003Cpath\n        d=\"M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87l51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921l51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272l-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695l-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69l-1.535-.922l-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87l-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58L128.067 97.3l28.188 16.218v32.434l-28.086 16.218l-28.188-16.218l-.052-32.434Z\">\n    \u003C\u002Fpath>\u003C\u002Fg>",{"left":4,"top":4,"width":10,"height":10,"rotate":4,"vFlip":7,"hFlip":7,"body":1292},"\u003Cpath fill=\"currentColor\" d=\"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z\"\u002F>",{"left":4,"top":4,"width":1294,"height":1294,"rotate":4,"vFlip":7,"hFlip":7,"body":1295},1024,"\u003Cpath fill=\"currentColor\" d=\"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z\"\u002F>\u003Cpath fill=\"currentColor\" d=\"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64\"\u002F>"]