weakauras-codec-lib-compress 0.1.1

Provides a routine for decompressing data compressed by a Lua library called LibCompress.
Documentation
  • Coverage
  • 100%
    9 out of 9 items documented2 out of 3 items with examples
  • Size
  • Source code size: 30.8 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 389.79 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Zireael-N

weakauras-codec-lib-compress

This library provides a routine for decompressing data compressed by a Lua library called LibCompress.

Example

use weakauras_codec_lib_compress::{DecompressionError, decompress};

fn main() -> Result<(), DecompressionError> {
    let expected = b"aaaaaaaa bbbbbbbb cccccccc";

    // Huffman code
    assert_eq!(
        &*decompress(
            &[
                0x03, 0x03, 0x1a, 0x00, 0x00, 0x62, 0x0c, 0x52, 0x8f,
                0xe9, 0xb0, 0x5c, 0x55, 0x35, 0x00, 0xc0, 0xaa, 0xaa
            ],
            1024
        )?,
        expected
    );

    // Uncompressed
    assert_eq!(
        &*decompress(b"\x01aaaaaaaa bbbbbbbb cccccccc", 1024)?,
        expected
    );

    Ok(())
}