[{"data":1,"prerenderedAt":224},["ShallowReactive",2],{"navigation_docs":3,"-formats-zstd":84,"-formats-zstd-surround":219},[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":68,"body":86,"description":212,"extension":213,"links":214,"meta":215,"navigation":216,"path":69,"seo":217,"stem":70,"__hash__":218},"docs\u002F2.formats\u002F04.zstd.md",{"type":87,"value":88,"toc":208},"minimark",[89,93,97,157,163,168,181,185,204],[90,91],"format-facts",{"name":92},"zstd",[94,95,96],"p",{},"What Linux packages, kernels and half of HTTP use now. LZ77 again, with the matches coded by FSE, a table driven cousin of arithmetic coding, and the literals by Huffman. The decoder here reads all of RFC 8878: raw, RLE and compressed blocks, predefined, RLE, compressed and repeated tables, the three repeat offsets, the frame content size and the checksum.",[98,99,104],"pre",{"className":100,"code":101,"language":102,"meta":103,"style":103},"language-ts shiki shiki-themes compressions compressions compressions","decompress(\"zstd\", Buffer.from(\"28b52ffd0468a500007068656c6c6f20776f726c642120680100e0994a31ba782b\", \"hex\"));\n\u002F\u002F { bytes: \"hello world! hello world! hello world! hello world!\",\n\u002F\u002F   details: { window: 8388608, checksum: true, frames: 1 } }\n","ts","",[105,106,107,144,151],"code",{"__ignoreMap":103},[108,109,112,116,120,124,127,130,132,135,138,141],"span",{"class":110,"line":111},"line",1,[108,113,115],{"class":114},"sK71F","decompress",[108,117,119],{"class":118},"s38Sx","(",[108,121,123],{"class":122},"shU9J","\"zstd\"",[108,125,126],{"class":118},", Buffer.",[108,128,129],{"class":114},"from",[108,131,119],{"class":118},[108,133,134],{"class":122},"\"28b52ffd0468a500007068656c6c6f20776f726c642120680100e0994a31ba782b\"",[108,136,137],{"class":118},", ",[108,139,140],{"class":122},"\"hex\"",[108,142,143],{"class":118},"));\n",[108,145,147],{"class":110,"line":146},2,[108,148,150],{"class":149},"scIB-","\u002F\u002F { bytes: \"hello world! hello world! hello world! hello world!\",\n",[108,152,154],{"class":110,"line":153},3,[108,155,156],{"class":149},"\u002F\u002F   details: { window: 8388608, checksum: true, frames: 1 } }\n",[94,158,159,160,162],{},"That stream came out of ",[105,161,92],{}," 1.5.7. 33 bytes for 51, and four of them are the checksum.",[164,165,167],"h2",{"id":166},"read-only","Read only",[94,169,170,173,174,177,178,180],{},[105,171,172],{},"compress(\"zstd\", …)"," throws ",[105,175,176],{},"zstd: this package reads Zstandard but does not write it",". A zstd writer worth using is a long project, and ",[105,179,92],{}," is one package install away on every system that has a terminal. Reading is the part a blob from somewhere else needs.",[164,182,184],{"id":183},"frames","Frames",[94,186,187,188,191,192,195,196,199,200,203],{},"Frames in a row decompress into one output, the way ",[105,189,190],{},"zstd -d"," reads them, and ",[105,193,194],{},"details.frames"," counts them. Skippable frames, the ones that start ",[105,197,198],{},"5x 2a 4d 18",", get skipped. The checksum is the low 32 bits of XXH64 over the frame's output, checked when the frame header says it's there. A frame that needs a dictionary is an ",[105,201,202],{},"UnsupportedError"," naming the dictionary ID, since a dictionary is a file nobody handed over.",[205,206,207],"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":103,"searchDepth":146,"depth":146,"links":209},[210,211],{"id":166,"depth":146,"text":167},{"id":183,"depth":146,"text":184},"RFC 8878 read in full. FSE and Huffman and repeat offsets and the XXH64 check. Read only","md",null,{},true,{"title":68,"description":212},"BUVRtydT3eboNkgK1waWsvx8Nm7PpR90VAQFMuETrjA",[220,222],{"title":64,"path":65,"stem":66,"description":221,"children":-1},"LZ77 with a range coder that learns every bit. The xz container with its checks and filters and the older .lzma",{"title":72,"path":73,"stem":74,"description":223,"children":-1},"RFC 7932 read in full. Context modeling and the built-in dictionary of 120 KiB of web words. Read only",1791071141270]