[{"data":1,"prerenderedAt":289},["ShallowReactive",2],{"navigation_docs":3,"-formats-lzma":84,"-formats-lzma-surround":284},[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":64,"body":86,"description":277,"extension":278,"links":279,"meta":280,"navigation":281,"path":65,"seo":282,"stem":66,"__hash__":283},"docs\u002F2.formats\u002F03.lzma.md",{"type":87,"value":88,"toc":272},"minimark",[89,93,97,162,166,183,217,220,244,251,258,262,268],[90,91],"format-facts",{"name":92},"lzma",[94,95,96],"p",{},"LZMA doesn't write Huffman codes. It keeps a probability for every decision, a literal or a match, which length, which distance, and a range coder spends a fraction of a bit on each one it guessed right. Those probabilities learn as the stream goes, and that's where the size comes from.",[98,99,104],"pre",{"className":100,"code":101,"language":102,"meta":103,"style":103},"language-ts shiki shiki-themes compressions compressions compressions","compress(\"lzma\", \"hello world!\");                       \u002F\u002F 30 bytes, .lzma\ncompress(\"lzma\", \"hello world!\", { container: \"xz\" });  \u002F\u002F 68 bytes, fd377a585a00…\n","ts","",[105,106,107,137],"code",{"__ignoreMap":103},[108,109,112,116,120,124,127,130,133],"span",{"class":110,"line":111},"line",1,[108,113,115],{"class":114},"sK71F","compress",[108,117,119],{"class":118},"s38Sx","(",[108,121,123],{"class":122},"shU9J","\"lzma\"",[108,125,126],{"class":118},", ",[108,128,129],{"class":122},"\"hello world!\"",[108,131,132],{"class":118},");                       ",[108,134,136],{"class":135},"scIB-","\u002F\u002F 30 bytes, .lzma\n",[108,138,140,142,144,146,148,150,153,156,159],{"class":110,"line":139},2,[108,141,115],{"class":114},[108,143,119],{"class":118},[108,145,123],{"class":122},[108,147,126],{"class":118},[108,149,129],{"class":122},[108,151,152],{"class":118},", { container: ",[108,154,155],{"class":122},"\"xz\"",[108,157,158],{"class":118}," });  ",[108,160,161],{"class":135},"\u002F\u002F 68 bytes, fd377a585a00…\n",[163,164,165],"h2",{"id":92},".lzma",[94,167,168,169,172,173,126,176,126,179,182],{},"The ",[105,170,171],{},"alone"," container, the default: thirteen header bytes with the ",[105,174,175],{},"lc",[105,177,178],{},"lp",[105,180,181],{},"pb"," properties, the dictionary size and the unpacked size, then one LZMA stream. No checksum. It's what LZMA Utils wrote before xz existed, and what plenty of embedded firmware still ships.",[98,184,186],{"className":100,"code":185,"language":102,"meta":103,"style":103},"decompress(\"lzma\", compress(\"lzma\", \"hello world!\")).details;\n\u002F\u002F { properties: \"lc=3 lp=0 pb=2\", dictionary: 8388608 }\n",[105,187,188,212],{"__ignoreMap":103},[108,189,190,193,195,197,199,201,203,205,207,209],{"class":110,"line":111},[108,191,192],{"class":114},"decompress",[108,194,119],{"class":118},[108,196,123],{"class":122},[108,198,126],{"class":118},[108,200,115],{"class":114},[108,202,119],{"class":118},[108,204,123],{"class":122},[108,206,126],{"class":118},[108,208,129],{"class":122},[108,210,211],{"class":118},")).details;\n",[108,213,214],{"class":110,"line":139},[108,215,216],{"class":135},"\u002F\u002F { properties: \"lc=3 lp=0 pb=2\", dictionary: 8388608 }\n",[163,218,219],{"id":219},"xz",[94,221,222,223,226,227,126,230,126,233,236,237,240,241,243],{},"LZMA2 inside blocks, an index of every block, CRC-32 on every header and a check of your choosing on the data. ",[105,224,225],{},"check"," takes ",[105,228,229],{},"none",[105,231,232],{},"crc32",[105,234,235],{},"crc64"," (the default) or ",[105,238,239],{},"sha256",". On ",[105,242,129],{}," that's 60, 64, 68 and 92 bytes.",[94,245,246,247,250],{},"LZMA2 cuts the stream into chunks, so a chunk that won't compress gets stored as it is instead of growing. Concatenated streams and the padding between them decompress into one output, as ",[105,248,249],{},"xz -d"," reads them.",[94,252,253,254,257],{},"Filters on the read side: delta and x86 BCJ, mirrored from xz 5.8. ARM, PowerPC, SPARC, IA-64 and RISC-V filters are an ",[105,255,256],{},"UnsupportedError"," that names the filter. The writer uses no filters.",[163,259,261],{"id":260},"levels","Levels",[94,263,264,267],{},[105,265,266],{},"level"," from 0 to 9, 6 by default, sets the dictionary and how hard the match finder looks, the same way the xz presets do. The writer is honest and not fast: about 10% bigger than xz on binaries, close on text.",[269,270,271],"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":139,"depth":139,"links":273},[274,275,276],{"id":92,"depth":139,"text":165},{"id":219,"depth":139,"text":219},{"id":260,"depth":139,"text":261},"LZ77 with a range coder that learns every bit. The xz container with its checks and filters and the older .lzma","md",null,{},true,{"title":64,"description":277},"S-23PyQTxPP6Aur7m_LtCm77woEdp4TjPNOr40QliAM",[285,287],{"title":60,"path":61,"stem":62,"description":286,"children":-1},"Burrows-Wheeler transform then move-to-front then Huffman. Slow and small on text with a CRC on every block",{"title":68,"path":69,"stem":70,"description":288,"children":-1},"RFC 8878 read in full. FSE and Huffman and repeat offsets and the XXH64 check. Read only",1791071141270]