[{"data":1,"prerenderedAt":349},["ShallowReactive",2],{"navigation_docs":3,"-guide-checksums":84,"-guide-checksums-surround":344},[4,48],{"title":5,"path":6,"stem":7,"children":8,"icon":47},"Guide","\u002Fguide","1.guide\u002F01.index",[9,11,15,19,23,27,31,35,39,43],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Compressing","\u002Fguide\u002Fcompressing","1.guide\u002F02.compressing",{"title":16,"path":17,"stem":18},"Containers","\u002Fguide\u002Fcontainers","1.guide\u002F03.containers",{"title":20,"path":21,"stem":22},"Checksums","\u002Fguide\u002Fchecksums","1.guide\u002F04.checksums",{"title":24,"path":25,"stem":26},"Identify and peel","\u002Fguide\u002Fidentify","1.guide\u002F05.identify",{"title":28,"path":29,"stem":30},"Limits","\u002Fguide\u002Flimits","1.guide\u002F06.limits",{"title":32,"path":33,"stem":34},"CLI","\u002Fguide\u002Fcli","1.guide\u002F07.cli",{"title":36,"path":37,"stem":38},"Agents","\u002Fguide\u002Fagents","1.guide\u002F08.agents",{"title":40,"path":41,"stem":42},"Custom formats","\u002Fguide\u002Fcustom","1.guide\u002F09.custom",{"title":44,"path":45,"stem":46},"Playground","\u002Fguide\u002Fplayground","1.guide\u002F10.playground","i-lucide-book-open",{"title":49,"path":50,"stem":51,"children":52,"icon":83},"Formats","\u002Fformats","2.formats\u002F00.index",[53,55,59,63,67,71,75,79],{"title":54,"path":50,"stem":51},"Every format",{"title":56,"path":57,"stem":58},"deflate","\u002Fformats\u002Fdeflate","2.formats\u002F01.deflate",{"title":60,"path":61,"stem":62},"bzip2","\u002Fformats\u002Fbzip2","2.formats\u002F02.bzip2",{"title":64,"path":65,"stem":66},"LZMA","\u002Fformats\u002Flzma","2.formats\u002F03.lzma",{"title":68,"path":69,"stem":70},"Zstandard","\u002Fformats\u002Fzstd","2.formats\u002F04.zstd",{"title":72,"path":73,"stem":74},"Brotli","\u002Fformats\u002Fbrotli","2.formats\u002F05.brotli",{"title":76,"path":77,"stem":78},"LZ4","\u002Fformats\u002Flz4","2.formats\u002F06.lz4",{"title":80,"path":81,"stem":82},"Unix compress","\u002Fformats\u002Flzw","2.formats\u002F07.lzw","i-lucide-library",{"id":85,"title":20,"body":86,"description":336,"extension":337,"links":338,"meta":339,"navigation":341,"path":21,"seo":342,"stem":22,"__hash__":343},"docs\u002F1.guide\u002F04.checksums.md",{"type":87,"value":88,"toc":330},"minimark",[89,94,103,145,160,164,262,269,273,316,320,326],[90,91,93],"h2",{"id":92},"checked-not-trusted","Checked, not trusted",[95,96,97,98,102],"p",{},"Every container that stores a checksum gets it checked on the way out. A wrong one is a ",[99,100,101],"code",{},"ChecksumError",", never a shrug and a warning:",[104,105,110],"pre",{"className":106,"code":107,"language":108,"meta":109,"style":109},"language-ts shiki shiki-themes compressions compressions compressions","decompress(\"deflate\", flipped, { container: \"gzip\" });\n\u002F\u002F ChecksumError: deflate: gzip CRC-32 does not match at byte 24\n","ts","",[99,111,112,138],{"__ignoreMap":109},[113,114,117,121,125,129,132,135],"span",{"class":115,"line":116},"line",1,[113,118,120],{"class":119},"sK71F","decompress",[113,122,124],{"class":123},"s38Sx","(",[113,126,128],{"class":127},"shU9J","\"deflate\"",[113,130,131],{"class":123},", flipped, { container: ",[113,133,134],{"class":127},"\"gzip\"",[113,136,137],{"class":123}," });\n",[113,139,141],{"class":115,"line":140},2,[113,142,144],{"class":143},"scIB-","\u002F\u002F ChecksumError: deflate: gzip CRC-32 does not match at byte 24\n",[95,146,147,148,151,152,156,157,159],{},"The bytes did come out, though. They're on the error as ",[99,149,150],{},"partial",", so a puzzle with a deliberately broken trailer can still be read. ",[153,154,155],"a",{"href":29},"Limits and partial reads"," has the ",[99,158,150],{}," option that returns them instead of throwing.",[90,161,163],{"id":162},"which-one-where","Which one where",[165,166,167,183],"table",{},[168,169,170],"thead",{},[171,172,173,177,180],"tr",{},[174,175,176],"th",{},"Container",[174,178,179],{},"Checksum",[174,181,182],{},"Over",[184,185,186,198,209,219,230,240,251],"tbody",{},[171,187,188,192,195],{},[189,190,191],"td",{},"zlib",[189,193,194],{},"Adler-32",[189,196,197],{},"the output",[171,199,200,203,206],{},[189,201,202],{},"gzip",[189,204,205],{},"CRC-32, and the size modulo 2³²",[189,207,208],{},"the output of each member",[171,210,211,213,216],{},[189,212,60],{},[189,214,215],{},"CRC-32\u002FBZIP2",[189,217,218],{},"each block's output, then all blocks combined",[171,220,221,224,227],{},[189,222,223],{},"xz",[189,225,226],{},"CRC-32, CRC-64 or SHA-256, as the stream says",[189,228,229],{},"each block's output",[171,231,232,234,237],{},[189,233,223],{},[189,235,236],{},"CRC-32",[189,238,239],{},"the stream header, each block header, the index, the footer",[171,241,242,245,248],{},[189,243,244],{},"zstd",[189,246,247],{},"the low 32 bits of XXH64",[189,249,250],{},"the frame's output, when the flag is set",[171,252,253,256,259],{},[189,254,255],{},"lz4 frame",[189,257,258],{},"XXH32",[189,260,261],{},"the header, each block when flagged, the content when flagged",[95,263,264,265,268],{},"Raw deflate, .lzma, brotli, lz4 legacy and Unix compress carry none. A damaged stream in one of those can decode into garbage without a word. That's the format, not this package. ",[99,266,267],{},"identify"," scores them lower for exactly that reason.",[90,270,272],{"id":271},"where-the-checksums-come-from","Where the checksums come from",[95,274,275,276,284,285,288,289,288,292,295,296,299,300,302,303,306,307,309,310,302,312,315],{},"From ",[153,277,281],{"href":278,"rel":279},"https:\u002F\u002Fhashes.agntn.dev",[280],"nofollow",[99,282,283],{},"@agntn\u002Fhashes",", not from this package. The same code that computes ",[99,286,287],{},"crc32",", ",[99,290,291],{},"crc64",[99,293,294],{},"adler32"," and ",[99,297,298],{},"xxhash"," there checks the streams here, so a fix lands in one place. A few of them came in for this package: CRC-32\u002FBZIP2 is ",[99,301,287],{}," with ",[99,304,305],{},"variant: \"bzip2\"",", CRC-64\u002FXZ is ",[99,308,291],{},", XXH32 is ",[99,311,298],{},[99,313,314],{},"bits: 32",".",[90,317,319],{"id":318},"sizes-count-too","Sizes count too",[95,321,322,323,325],{},"gzip stores the size modulo 2³², zstd and lz4 can store the content size, xz stores sizes in the block headers and the index. Each one is held against what actually came out, and a mismatch is a ",[99,324,101],{}," as well. A stream that decodes cleanly but to the wrong length is still a broken stream.",[327,328,329],"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);}",{"title":109,"searchDepth":140,"depth":140,"links":331},[332,333,334,335],{"id":92,"depth":140,"text":93},{"id":162,"depth":140,"text":163},{"id":271,"depth":140,"text":272},{"id":318,"depth":140,"text":319},"CRC-32 and Adler-32 and CRC-64 and XXH32 and XXH64. Every one checked on the way out and a wrong one is an error","md",null,{"icon":340},"i-lucide-shield-check",true,{"title":20,"description":336},"S4K1sIvLsisLn-GUnaTfs62yto42TQYbI2sFCDgKIbk",[345,347],{"title":16,"path":17,"stem":18,"description":346,"children":-1},"gzip and zlib and raw deflate are one compression in three wrappers. Why that's an option and what each wrapper adds",{"title":24,"path":25,"stem":26,"description":348,"children":-1},"Which format made these bytes. Ranked by magic numbers and headers and checksums and every layer peeled off in one call",1791071143817]