[{"data":1,"prerenderedAt":366},["ShallowReactive",2],{"navigation_docs":3,"-guide-identify":128,"-guide-identify-surround":361},[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":127},"Encodings","\u002Fencodings","2.encodings\u002F00.index",[45,47,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107,111,115,119,123],{"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},"Hex","\u002Fencodings\u002Fhex","2.encodings\u002F02.hex",{"title":56,"path":57,"stem":58},"Base32","\u002Fencodings\u002Fbase32","2.encodings\u002F03.base32",{"title":60,"path":61,"stem":62},"Base32hex","\u002Fencodings\u002Fbase32hex","2.encodings\u002F04.base32hex",{"title":64,"path":65,"stem":66},"Crockford's Base32","\u002Fencodings\u002Fbase32-crockford","2.encodings\u002F05.base32-crockford",{"title":68,"path":69,"stem":70},"z-base-32","\u002Fencodings\u002Fz-base-32","2.encodings\u002F06.z-base-32",{"title":72,"path":73,"stem":74},"Base45","\u002Fencodings\u002Fbase45","2.encodings\u002F07.base45",{"title":76,"path":77,"stem":78},"Base58","\u002Fencodings\u002Fbase58","2.encodings\u002F08.base58",{"title":80,"path":81,"stem":82},"Base58Check","\u002Fencodings\u002Fbase58check","2.encodings\u002F09.base58check",{"title":84,"path":85,"stem":86},"Base58 (Flickr)","\u002Fencodings\u002Fbase58-flickr","2.encodings\u002F10.base58-flickr",{"title":88,"path":89,"stem":90},"Base58 (Ripple)","\u002Fencodings\u002Fbase58-ripple","2.encodings\u002F11.base58-ripple",{"title":92,"path":93,"stem":94},"Base64","\u002Fencodings\u002Fbase64","2.encodings\u002F12.base64",{"title":96,"path":97,"stem":98},"Base64url","\u002Fencodings\u002Fbase64url","2.encodings\u002F13.base64url",{"title":100,"path":101,"stem":102},"Ascii85","\u002Fencodings\u002Fascii85","2.encodings\u002F14.ascii85",{"title":104,"path":105,"stem":106},"Z85","\u002Fencodings\u002Fz85","2.encodings\u002F15.z85",{"title":108,"path":109,"stem":110},"basE91","\u002Fencodings\u002Fbase91","2.encodings\u002F16.base91",{"title":112,"path":113,"stem":114},"Bech32","\u002Fencodings\u002Fbech32","2.encodings\u002F17.bech32",{"title":116,"path":117,"stem":118},"Bech32m","\u002Fencodings\u002Fbech32m","2.encodings\u002F18.bech32m",{"title":120,"path":121,"stem":122},"uuencode","\u002Fencodings\u002Fuuencode","2.encodings\u002F19.uuencode",{"title":124,"path":125,"stem":126},"Quoted-Printable","\u002Fencodings\u002Fquoted-printable","2.encodings\u002F20.quoted-printable","i-lucide-library",{"id":129,"title":20,"body":130,"description":355,"extension":356,"links":357,"meta":358,"navigation":179,"path":21,"seo":359,"stem":22,"__hash__":360},"docs\u002F1.guide\u002F04.identify.md",{"type":131,"value":132,"toc":350},"minimark",[133,142,234,243,279,282,287,293,300,304,310,314,338,346],[134,135,136,137,141],"p",{},"Somebody sends you ",[138,139,140],"code",{},"JBSWY3DPEBLW64TMMQ======",". What is it?",[143,144,149],"pre",{"className":145,"code":146,"language":147,"meta":148,"style":148},"language-ts shiki shiki-themes encodings encodings encodings","import { identify } from \"@agntn\u002Fencodings\";\n\nidentify(\"JBSWY3DPEBLW64TMMQ======\");\n\u002F\u002F [\n\u002F\u002F   { encoding: \"base32\", confidence: 0.593, text: \"Hello World\",\n\u002F\u002F     reasons: [\"padding fits the block length\", \"decodes to readable text\"], … },\n\u002F\u002F   { encoding: \"base32-crockford\", confidence: 0.043, … },\n\u002F\u002F   …\n\u002F\u002F ]\n","ts","",[138,150,151,174,181,197,204,210,216,222,228],{"__ignoreMap":148},[152,153,156,160,164,167,171],"span",{"class":154,"line":155},"line",1,[152,157,159],{"class":158},"skH_V","import",[152,161,163],{"class":162},"s38Sx"," { identify } ",[152,165,166],{"class":158},"from",[152,168,170],{"class":169},"shU9J"," \"@agntn\u002Fencodings\"",[152,172,173],{"class":162},";\n",[152,175,177],{"class":154,"line":176},2,[152,178,180],{"emptyLinePlaceholder":179},true,"\n",[152,182,184,188,191,194],{"class":154,"line":183},3,[152,185,187],{"class":186},"sK71F","identify",[152,189,190],{"class":162},"(",[152,192,193],{"class":169},"\"JBSWY3DPEBLW64TMMQ======\"",[152,195,196],{"class":162},");\n",[152,198,200],{"class":154,"line":199},4,[152,201,203],{"class":202},"scIB-","\u002F\u002F [\n",[152,205,207],{"class":154,"line":206},5,[152,208,209],{"class":202},"\u002F\u002F   { encoding: \"base32\", confidence: 0.593, text: \"Hello World\",\n",[152,211,213],{"class":154,"line":212},6,[152,214,215],{"class":202},"\u002F\u002F     reasons: [\"padding fits the block length\", \"decodes to readable text\"], … },\n",[152,217,219],{"class":154,"line":218},7,[152,220,221],{"class":202},"\u002F\u002F   { encoding: \"base32-crockford\", confidence: 0.043, … },\n",[152,223,225],{"class":154,"line":224},8,[152,226,227],{"class":202},"\u002F\u002F   …\n",[152,229,231],{"class":154,"line":230},9,[152,232,233],{"class":202},"\u002F\u002F ]\n",[134,235,236,238,239,242],{},[138,237,187],{}," decodes the text in every registered encoding and keeps the ones that work. Then it ranks them by evidence, and the evidence is written down in ",[138,240,241],{},"reasons",":",[244,245,246,250,273,276],"ul",{},[247,248,249],"li",{},"A matching checksum. Base58Check and bech32 can't match by accident, so this outweighs everything else.",[247,251,252,253,256,257,260,261,264,265,268,269,272],{},"Framing only one encoding writes. Padding that fits, ",[138,254,255],{},"\u003C~"," and ",[138,258,259],{},"~>",", a ",[138,262,263],{},"begin 644"," line, ",[138,266,267],{},"=XX"," escapes, a ",[138,270,271],{},"0x"," prefix.",[247,274,275],{},"Decoded bytes that read as text. Valid UTF-8, mostly printable.",[247,277,278],{},"A small alphabet. If the text fits in sixteen characters, hex is likelier than base64.",[134,280,281],{},"It leaves out anything that decodes to nothing, and anything that decodes to the input itself. Plain ASCII is technically valid Quoted-Printable. That's not an answer.",[283,284,286],"h2",{"id":285},"the-number-is-a-ranking","The number is a ranking",[134,288,289,292],{},[138,290,291],{},"confidence"," runs from 0 to 1 and it sorts candidates. It isn't a probability. A base64 string of random bytes scores low, because there's no text and no checksum to vouch for it, and it's still the right answer. Read the reasons. Then decide.",[134,294,295,296,299],{},"Two encodings can write the same text. ",[138,297,298],{},"aGVsbG8gd29ybGQh"," is valid base64 and valid base64url, with the same score. The registry order breaks the tie, so base64 comes first. Ties are honest, not bugs.",[283,301,303],{"id":302},"long-text","Long text",[134,305,306,307,309],{},"Base58 decoding is quadratic in the length. Real base58 strings are short, addresses and keys and CIDs, so ",[138,308,187],{}," skips the base58 family above 1024 characters. The tools cap base58 at 10000 characters either way.",[283,311,313],{"id":312},"only-some-encodings","Only some encodings",[143,315,317],{"className":145,"code":316,"language":147,"meta":148,"style":148},"identify(text, { encodings: [\"base64\", \"base64url\"], limit: 1 });\n",[138,318,319],{"__ignoreMap":148},[152,320,321,323,326,329,332,335],{"class":154,"line":155},[152,322,187],{"class":186},[152,324,325],{"class":162},"(text, { encodings: [",[152,327,328],{"class":169},"\"base64\"",[152,330,331],{"class":162},", ",[152,333,334],{"class":169},"\"base64url\"",[152,336,337],{"class":162},"], limit: 1 });\n",[134,339,340,341,345],{},"Your own ",[342,343,344],"a",{"href":33},"registered encodings"," join the line-up without extra wiring.",[347,348,349],"style",{},"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)}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 .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 .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);}",{"title":148,"searchDepth":176,"depth":176,"links":351},[352,353,354],{"id":285,"depth":176,"text":286},{"id":302,"depth":176,"text":303},{"id":312,"depth":176,"text":313},"Rank the encodings a string decodes in. Each score comes with the reasons behind it","md",null,{},{"title":20,"description":355},"O92X6I3bxfLFIQZlGrFcP52Q0J1Z055hpf3Wx15Xi0g",[362,364],{"title":16,"path":17,"stem":18,"description":363,"children":-1},"Base58Check and bech32 and bech32m verify themselves on decode. A segwit address comes back as its version and program",{"title":24,"path":25,"stem":26,"description":365,"children":-1},"encode and decode and identify and list from the terminal. Bytes go to stdout raw and everything else goes to stderr",1790940133608]