[{"data":1,"prerenderedAt":363},["ShallowReactive",2],{"navigation_docs":3,"-encodings-base256":108,"-encodings-base256-surround":358},[4,44],{"title":5,"path":6,"stem":7,"children":8,"icon":43},"Guide","\u002Fguide","1.guide\u002F01.index",[9,11,15,19,23,27,31,35,39],{"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},"Code pages","\u002Fguide\u002Fcode-pages","1.guide\u002F07.code-pages",{"title":36,"path":37,"stem":38},"Custom Encodings","\u002Fguide\u002Fcustom","1.guide\u002F08.custom",{"title":40,"path":41,"stem":42},"Playground","\u002Fguide\u002Fplayground","1.guide\u002F09.playground","i-lucide-book-open",{"title":45,"path":46,"stem":47,"children":48,"icon":107},"Encodings","\u002Fencodings","2.encodings\u002F00.index",[49,51,55,59,63,67,71,75,79,83,87,91,95,99,103],{"title":50,"path":46,"stem":47},"Every encoding",{"title":52,"path":53,"stem":54},"Binary","\u002Fencodings\u002Fbinary","2.encodings\u002F01.binary",{"title":56,"path":57,"stem":58},"Octal","\u002Fencodings\u002Foctal","2.encodings\u002F02.octal",{"title":60,"path":61,"stem":62},"Decimal","\u002Fencodings\u002Fdecimal","2.encodings\u002F03.decimal",{"title":64,"path":65,"stem":66},"Hex","\u002Fencodings\u002Fhex","2.encodings\u002F04.hex",{"title":68,"path":69,"stem":70},"Base32","\u002Fencodings\u002Fbase32","2.encodings\u002F05.base32",{"title":72,"path":73,"stem":74},"Base45","\u002Fencodings\u002Fbase45","2.encodings\u002F09.base45",{"title":76,"path":77,"stem":78},"Base58","\u002Fencodings\u002Fbase58","2.encodings\u002F10.base58",{"title":80,"path":81,"stem":82},"Base64","\u002Fencodings\u002Fbase64","2.encodings\u002F14.base64",{"title":84,"path":85,"stem":86},"Base85","\u002Fencodings\u002Fbase85","2.encodings\u002F18.base85",{"title":88,"path":89,"stem":90},"basE91","\u002Fencodings\u002Fbase91","2.encodings\u002F19.base91",{"title":92,"path":93,"stem":94},"Base256","\u002Fencodings\u002Fbase256","2.encodings\u002F20.base256",{"title":96,"path":97,"stem":98},"Bech32","\u002Fencodings\u002Fbech32","2.encodings\u002F21.bech32",{"title":100,"path":101,"stem":102},"uuencode","\u002Fencodings\u002Fuuencode","2.encodings\u002F22.uuencode",{"title":104,"path":105,"stem":106},"Quoted-Printable","\u002Fencodings\u002Fquoted-printable","2.encodings\u002F23.quoted-printable","i-lucide-library",{"id":109,"title":92,"body":110,"description":351,"extension":352,"links":353,"meta":354,"navigation":355,"path":93,"seo":356,"stem":94,"__hash__":357},"docs\u002F2.encodings\u002F20.base256.md",{"type":111,"value":112,"toc":346},"minimark",[113,117,126,186,191,206,217,221,228,287,290,293,297,304,333,342],[114,115],"encoding-facts",{"name":116},"base256",[118,119,120,121,125],"p",{},"One byte, one emoji. That's the whole trick. The ",[122,123,124],"code",{},"emoji"," alphabet is the base256emoji table from multiformats, and it's the default. The roster puts it at +0%, since it counts characters. Don't pick it to save space though. In UTF-8 most emoji take four bytes, so the text runs about four times the data.",[127,128,133],"pre",{"className":129,"code":130,"language":131,"meta":132,"style":132},"language-ts shiki shiki-themes encodings encodings encodings","encode(\"base256\", \"gsmg\", { multibase: true });  \u002F\u002F \"🚀😝🌈🌷😝\"\ndecode(\"base256\", \"🚀😝🌈🌷😝\", { multibase: true }).bytes;  \u002F\u002F \"gsmg\" as bytes\n","ts","",[122,134,135,165],{"__ignoreMap":132},[136,137,140,144,148,152,155,158,161],"span",{"class":138,"line":139},"line",1,[136,141,143],{"class":142},"sK71F","encode",[136,145,147],{"class":146},"s38Sx","(",[136,149,151],{"class":150},"shU9J","\"base256\"",[136,153,154],{"class":146},", ",[136,156,157],{"class":150},"\"gsmg\"",[136,159,160],{"class":146},", { multibase: true });  ",[136,162,164],{"class":163},"scIB-","\u002F\u002F \"🚀😝🌈🌷😝\"\n",[136,166,168,171,173,175,177,180,183],{"class":138,"line":167},2,[136,169,170],{"class":142},"decode",[136,172,147],{"class":146},[136,174,151],{"class":150},[136,176,154],{"class":146},[136,178,179],{"class":150},"\"🚀😝🌈🌷😝\"",[136,181,182],{"class":146},", { multibase: true }).bytes;  ",[136,184,185],{"class":163},"\u002F\u002F \"gsmg\" as bytes\n",[187,188,190],"h2",{"id":189},"the-rocket","The rocket",[118,192,193,194,197,198,201,202,205],{},"Multibase puts 🚀 in front of base256emoji text. Fair enough. But 🚀 is also the table's first emoji, so it means byte 0 too. Read that string without ",[122,195,196],{},"multibase"," and you get a zero byte before ",[122,199,200],{},"gsmg",". Nothing here strips it on a hunch, because a real zero byte looks exactly the same. ",[122,203,204],{},"identify"," tries both readings and puts the prefixed one first, since only that one reads as text.",[118,207,208,209,212,213,216],{},"Decoding skips ASCII whitespace and the emoji presentation selector. Copy ",[122,210,211],{},"☄️"," from a web page and it reads as the ",[122,214,215],{},"☄"," in the table.",[187,218,220],{"id":219},"your-own-table","Your own table",[118,222,223,224,227],{},"Puzzles keep inventing alphabets. Card suits, runes, a grid of emoji in a picture. ",[122,225,226],{},"symbols"," takes the table in order, digit 0 first, and spaces between symbols don't count.",[127,229,231],{"className":129,"code":230,"language":131,"meta":132,"style":132},"decode(\"base256\", \"♣ ♠ ♦\", { symbols: \"♠ ♥ ♦ ♣\" }).bytes;  \u002F\u002F [3, 0, 2]\nencode(\"base256\", new Uint8Array([3, 0]), { symbols: \"♠♥♦♣\" });  \u002F\u002F \"♣♠\"\n",[122,232,233,258],{"__ignoreMap":132},[136,234,235,237,239,241,243,246,249,252,255],{"class":138,"line":139},[136,236,170],{"class":142},[136,238,147],{"class":146},[136,240,151],{"class":150},[136,242,154],{"class":146},[136,244,245],{"class":150},"\"♣ ♠ ♦\"",[136,247,248],{"class":146},", { symbols: ",[136,250,251],{"class":150},"\"♠ ♥ ♦ ♣\"",[136,253,254],{"class":146}," }).bytes;  ",[136,256,257],{"class":163},"\u002F\u002F [3, 0, 2]\n",[136,259,260,262,264,266,268,272,275,278,281,284],{"class":138,"line":167},[136,261,143],{"class":142},[136,263,147],{"class":146},[136,265,151],{"class":150},[136,267,154],{"class":146},[136,269,271],{"class":270},"skH_V","new",[136,273,274],{"class":142}," Uint8Array",[136,276,277],{"class":146},"([3, 0]), { symbols: ",[136,279,280],{"class":150},"\"♠♥♦♣\"",[136,282,283],{"class":146}," });  ",[136,285,286],{"class":163},"\u002F\u002F \"♣♠\"\n",[118,288,289],{},"Fewer than 256 symbols? Then you get digits, not bytes. Four suits read 0 to 3, and turning those digits into a message is the next layer of the puzzle. A byte past the end of the table throws on encode.",[118,291,292],{},"A symbol is what you see. A flag, a family emoji joined with ZWJ, a suit with or without its selector, each is one symbol. Zero-width characters are the exception, each one is a symbol of its own, so text that looks empty can still hold a table. Put 🇵, 🇱 and 🇵🇱 in one table and encode won't write 🇵 before 🇱. That reads back as the flag. Better an error than other bytes, right?",[187,294,296],{"id":295},"order-from-a-sample","Order from a sample",[118,298,299,300,303],{},"Sometimes the puzzle never lists the alphabet. It just shows it, and the order things first appear in is the order. ",[122,301,302],{},"sample"," reads the table that way, so repeats are fine there.",[127,305,307],{"className":129,"code":306,"language":131,"meta":132,"style":132},"decode(\"base256\", \"ᚦᚠᚢ\", { sample: \"ᚠᚢᚠ ᚦᚢ\" }).bytes;  \u002F\u002F [2, 0, 1]\n",[122,308,309],{"__ignoreMap":132},[136,310,311,313,315,317,319,322,325,328,330],{"class":138,"line":139},[136,312,170],{"class":142},[136,314,147],{"class":146},[136,316,151],{"class":150},[136,318,154],{"class":146},[136,320,321],{"class":150},"\"ᚦᚠᚢ\"",[136,323,324],{"class":146},", { sample: ",[136,326,327],{"class":150},"\"ᚠᚢᚠ ᚦᚢ\"",[136,329,254],{"class":146},[136,331,332],{"class":163},"\u002F\u002F [2, 0, 1]\n",[118,334,335,336,338,339,341],{},"Pass the ciphertext itself as the sample and every symbol gets numbered by its first sighting. Pass ",[122,337,226],{}," or ",[122,340,302],{},", not both.",[343,344,345],"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":132,"searchDepth":167,"depth":167,"links":347},[348,349,350],{"id":189,"depth":167,"text":190},{"id":219,"depth":167,"text":220},{"id":295,"depth":167,"text":296},"One symbol per byte. The multiformats base256emoji table by default or any table of 2 to 256 symbols you give it","md",null,{},true,{"title":92,"description":351},"p8fo4LrNpUQnMVevbM1RAZFfkVVhyExBn3CuVwcszJQ",[359,361],{"title":88,"path":89,"stem":90,"description":360,"children":-1},"Joachim Henke basE91 with 13 or 14 bits per two printable characters. About 23 percent overhead",{"title":96,"path":97,"stem":98,"description":362,"children":-1},"BIP173 bech32 with a prefix and 5-bit words and a BCH checksum. With m it's BIP350 bech32m for Taproot",1790982430642]