[{"data":1,"prerenderedAt":403},["ShallowReactive",2],{"navigation_docs":3,"-encodings-base85":100,"-encodings-base85-surround":398},[4,40],{"title":5,"path":6,"stem":7,"children":8,"icon":39},"Guide","\u002Fguide","1.guide\u002F01.index",[9,11,15,19,23,27,31,35],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Encoding and Decoding","\u002Fguide\u002Fencoding","1.guide\u002F02.encoding",{"title":16,"path":17,"stem":18},"Checksums","\u002Fguide\u002Fchecksums","1.guide\u002F03.checksums",{"title":20,"path":21,"stem":22},"Identify","\u002Fguide\u002Fidentify","1.guide\u002F04.identify",{"title":24,"path":25,"stem":26},"CLI","\u002Fguide\u002Fcli","1.guide\u002F05.cli",{"title":28,"path":29,"stem":30},"Agents","\u002Fguide\u002Fagents","1.guide\u002F06.agents",{"title":32,"path":33,"stem":34},"Custom Encodings","\u002Fguide\u002Fcustom","1.guide\u002F07.custom",{"title":36,"path":37,"stem":38},"Playground","\u002Fguide\u002Fplayground","1.guide\u002F08.playground","i-lucide-book-open",{"title":41,"path":42,"stem":43,"children":44,"icon":99},"Encodings","\u002Fencodings","2.encodings\u002F00.index",[45,47,51,55,59,63,67,71,75,79,83,87,91,95],{"title":46,"path":42,"stem":43},"Every encoding",{"title":48,"path":49,"stem":50},"Binary","\u002Fencodings\u002Fbinary","2.encodings\u002F01.binary",{"title":52,"path":53,"stem":54},"Octal","\u002Fencodings\u002Foctal","2.encodings\u002F02.octal",{"title":56,"path":57,"stem":58},"Decimal","\u002Fencodings\u002Fdecimal","2.encodings\u002F03.decimal",{"title":60,"path":61,"stem":62},"Hex","\u002Fencodings\u002Fhex","2.encodings\u002F04.hex",{"title":64,"path":65,"stem":66},"Base32","\u002Fencodings\u002Fbase32","2.encodings\u002F05.base32",{"title":68,"path":69,"stem":70},"Base45","\u002Fencodings\u002Fbase45","2.encodings\u002F09.base45",{"title":72,"path":73,"stem":74},"Base58","\u002Fencodings\u002Fbase58","2.encodings\u002F10.base58",{"title":76,"path":77,"stem":78},"Base64","\u002Fencodings\u002Fbase64","2.encodings\u002F14.base64",{"title":80,"path":81,"stem":82},"Base85","\u002Fencodings\u002Fbase85","2.encodings\u002F18.base85",{"title":84,"path":85,"stem":86},"basE91","\u002Fencodings\u002Fbase91","2.encodings\u002F19.base91",{"title":88,"path":89,"stem":90},"Bech32","\u002Fencodings\u002Fbech32","2.encodings\u002F20.bech32",{"title":92,"path":93,"stem":94},"uuencode","\u002Fencodings\u002Fuuencode","2.encodings\u002F22.uuencode",{"title":96,"path":97,"stem":98},"Quoted-Printable","\u002Fencodings\u002Fquoted-printable","2.encodings\u002F23.quoted-printable","i-lucide-library",{"id":101,"title":80,"body":102,"description":391,"extension":392,"links":393,"meta":394,"navigation":395,"path":81,"seo":396,"stem":82,"__hash__":397},"docs\u002F2.encodings\u002F18.base85.md",{"type":103,"value":104,"toc":387},"minimark",[105,109,113,153,160,175,180,191,294,322,326,345,380,383],[106,107],"encoding-facts",{"name":108},"base85",[110,111,112],"p",{},"RFC 1924 came out on 1 April 1996. It wanted every IPv6 address as one 128-bit number in base 85. Notice the date? Nobody writes IPv6 that way. The alphabet stuck anyway.",[114,115,120],"pre",{"className":116,"code":117,"language":118,"meta":119,"style":119},"language-ts shiki shiki-themes encodings encodings encodings","encode(\"base85\", \"hello world\");  \u002F\u002F \"Xk~0{Zy\u003CMXa%^M\"\n","ts","",[121,122,123],"code",{"__ignoreMap":119},[124,125,128,132,136,140,143,146,149],"span",{"class":126,"line":127},"line",1,[124,129,131],{"class":130},"sK71F","encode",[124,133,135],{"class":134},"s38Sx","(",[124,137,139],{"class":138},"shU9J","\"base85\"",[124,141,142],{"class":134},", ",[124,144,145],{"class":138},"\"hello world\"",[124,147,148],{"class":134},");  ",[124,150,152],{"class":151},"scIB-","\u002F\u002F \"Xk~0{Zy\u003CMXa%^M\"\n",[110,154,155,156,159],{},"This is the form people actually meet: four bytes as five characters, with a short last group cut. Python's ",[121,157,158],{},"b85encode"," writes it, and so does Mercurial. Git binary patches use the same alphabet and groups, with a length character in front of every line.",[110,161,162,163,166,167,170,171,174],{},"No ",[121,164,165],{},"z"," for zeros, no ",[121,168,169],{},"\u003C~ ~>",", and whitespace is an error. Python doesn't skip it either. Two more alphabets do the same arithmetic with other rules, and ",[121,172,173],{},"alphabet"," picks them. Decoding takes it too.",[176,177,179],"h2",{"id":178},"the-ascii85-alphabet","The ascii85 alphabet",[110,181,182,183,186,187,190],{},"Adobe's base85 from PostScript and PDF. Each group goes out as five digits from ",[121,184,185],{},"!"," to ",[121,188,189],{},"u",".",[114,192,194],{"className":116,"code":193,"language":118,"meta":119,"style":119},"const ascii85 = { alphabet: \"ascii85\" } as const;\nencode(\"base85\", \"Hello, World!\", ascii85);                       \u002F\u002F \"87cURD_*#4DfTZ)+T\"\nencode(\"base85\", \"Hello, World!\", { ...ascii85, delimiters: true });  \u002F\u002F \"\u003C~87cURD_*#4DfTZ)+T~>\"\nencode(\"base85\", new Uint8Array(4), ascii85);                     \u002F\u002F \"z\"\n",[121,195,196,226,246,271],{"__ignoreMap":119},[124,197,198,202,205,208,211,214,217,220,223],{"class":126,"line":127},[124,199,201],{"class":200},"skH_V","const",[124,203,204],{"class":134}," ascii85 ",[124,206,207],{"class":200},"=",[124,209,210],{"class":134}," { alphabet: ",[124,212,213],{"class":138},"\"ascii85\"",[124,215,216],{"class":134}," } ",[124,218,219],{"class":200},"as",[124,221,222],{"class":200}," const",[124,224,225],{"class":134},";\n",[124,227,229,231,233,235,237,240,243],{"class":126,"line":228},2,[124,230,131],{"class":130},[124,232,135],{"class":134},[124,234,139],{"class":138},[124,236,142],{"class":134},[124,238,239],{"class":138},"\"Hello, World!\"",[124,241,242],{"class":134},", ascii85);                       ",[124,244,245],{"class":151},"\u002F\u002F \"87cURD_*#4DfTZ)+T\"\n",[124,247,249,251,253,255,257,259,262,265,268],{"class":126,"line":248},3,[124,250,131],{"class":130},[124,252,135],{"class":134},[124,254,139],{"class":138},[124,256,142],{"class":134},[124,258,239],{"class":138},[124,260,261],{"class":134},", { ",[124,263,264],{"class":200},"...",[124,266,267],{"class":134},"ascii85, delimiters: true });  ",[124,269,270],{"class":151},"\u002F\u002F \"\u003C~87cURD_*#4DfTZ)+T~>\"\n",[124,272,274,276,278,280,282,285,288,291],{"class":126,"line":273},4,[124,275,131],{"class":130},[124,277,135],{"class":134},[124,279,139],{"class":138},[124,281,142],{"class":134},[124,283,284],{"class":200},"new",[124,286,287],{"class":130}," Uint8Array",[124,289,290],{"class":134},"(4), ascii85);                     ",[124,292,293],{"class":151},"\u002F\u002F \"z\"\n",[110,295,296,297,299,300,303,304,307,308,310,311,314,315,318,319,190],{},"Four zero bytes are a single ",[121,298,165],{},", a small gift for sparse data. Decoding takes the ",[121,301,302],{},"\u003C~"," ",[121,305,306],{},"~>"," wrapper or not, and skips whitespace. A ",[121,309,165],{}," in the middle of a group is an error. Can five digits overflow 32 bits? ",[121,312,313],{},"uuuuu"," can, and it's refused. Only this alphabet has the wrapper, so ",[121,316,317],{},"delimiters"," anywhere else is an ",[121,320,321],{},"InvalidOptionError",[176,323,325],{"id":324},"the-z85-alphabet","The z85 alphabet",[110,327,328,329,332,333,336,337,340,341,344],{},"ZeroMQ wanted base85 you can drop into a C string or a JSON value without escaping. So no ",[121,330,331],{},"\"",", no ",[121,334,335],{},"'",", no backslash. XML is another story, ",[121,338,339],{},"\u003C"," and ",[121,342,343],{},"&"," are both in there.",[114,346,348],{"className":116,"code":347,"language":118,"meta":119,"style":119},"base85.encode(hex.decode(\"864FD26FB559F75B\"), { alphabet: \"z85\" });  \u002F\u002F \"HelloWorld\"\n",[121,349,350],{"__ignoreMap":119},[124,351,352,355,357,360,363,365,368,371,374,377],{"class":126,"line":127},[124,353,354],{"class":134},"base85.",[124,356,131],{"class":130},[124,358,359],{"class":134},"(hex.",[124,361,362],{"class":130},"decode",[124,364,135],{"class":134},[124,366,367],{"class":138},"\"864FD26FB559F75B\"",[124,369,370],{"class":134},"), { alphabet: ",[124,372,373],{"class":138},"\"z85\"",[124,375,376],{"class":134}," });  ",[124,378,379],{"class":151},"\u002F\u002F \"HelloWorld\"\n",[110,381,382],{},"That's the example from ZeroMQ RFC 32. Did they pick the bytes to spell it? Of course they did. Z85 only does whole groups. Encode two bytes and you get an error, not padding. Pad it yourself if you have to.",[384,385,386],"style",{},"html pre.shiki code .sK71F, html code.shiki .sK71F{--shiki-light:var(--shiki-token-function);--shiki-default:var(--shiki-token-function);--shiki-dark:var(--shiki-token-function)}html pre.shiki code .s38Sx, html code.shiki .s38Sx{--shiki-light:var(--ui-text-highlighted);--shiki-default:var(--ui-text-highlighted);--shiki-dark:var(--ui-text-highlighted)}html pre.shiki code .shU9J, html code.shiki .shU9J{--shiki-light:var(--shiki-token-string);--shiki-default:var(--shiki-token-string);--shiki-dark:var(--shiki-token-string)}html pre.shiki code .scIB-, html code.shiki .scIB-{--shiki-light:var(--shiki-token-comment);--shiki-default:var(--shiki-token-comment);--shiki-dark:var(--shiki-token-comment)}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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);}html pre.shiki code .skH_V, html code.shiki .skH_V{--shiki-light:var(--shiki-token-keyword);--shiki-default:var(--shiki-token-keyword);--shiki-dark:var(--shiki-token-keyword)}",{"title":119,"searchDepth":228,"depth":228,"links":388},[389,390],{"id":178,"depth":228,"text":179},{"id":324,"depth":228,"text":325},"Four bytes as five characters in the RFC 1924 or Ascii85 or Z85 alphabet. Python b85encode and PDF streams and ZeroMQ","md",null,{},true,{"title":80,"description":391},"AsS1sOYoaAPUeY4yBnCvved3kqt7-MQbp3yNODjrWZo",[399,401],{"title":76,"path":77,"stem":78,"description":400,"children":-1},"RFC 4648 base64 with + and \u002F or the URL alphabet. Three bytes as four characters padded with = and line breaks skipped on decode",{"title":84,"path":85,"stem":86,"description":402,"children":-1},"Joachim Henke basE91 with 13 or 14 bits per two printable characters. About 23 percent overhead",1790973263205]