GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - darkskygit/precomp2

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
.clusterfuzzlite
.clusterfuzzlite
 
 
.github/workflows
.github/workflows
 
 
examples
examples
 
 
fixtures
fixtures
 
 
fuzz
fuzz
 
 
src
src
 
 
tests
tests
 
 
tools/lz4-matrix
tools/lz4-matrix
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.taplo.toml
.taplo.toml
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
rustfmt.toml
rustfmt.toml
 
 

Repository files navigation

precomp2

precomp2 is a Rust library for reversible preprocessing of compressed and container data. It turns recognizable streams into PCF2 segments that are easier for an outer compressor to handle, then restores the original bytes exactly.

The project is inspired by precomp-cpp and preflate-rs.

Features

  • Lossless encode/decode APIs for byte slices and async decode input.
  • PCF2 segment container with literal, nested, DEFLATE, zlib, gzip, PNG IDAT, JPEG, Base64, bzip2, PDF stream, and UnityFS segment kinds.
  • Recursive preprocessing with depth and output budget limits.
  • Configurable PNG and PDF preprocessing through EncodeConfig.

Usage

use precomp2::{DecodeConfig, EncodeConfig};

fn main() -> precomp2::Result<()> {
    let input = b"payload";
    let encoded = precomp2::encode_bytes(input, &EncodeConfig::default())?;
    let decoded = precomp2::decode_bytes(&encoded, &DecodeConfig::default())?;

    assert_eq!(decoded, input);
    Ok(())
}

Testing

cargo test needs a C compiler: tests/lz4-reference builds the vendored liblz4 releases as the reference for the LZ4HC ports. Real-archive acceptance and coverage-guided fuzzing are opt-in:

PRECOMP2_UNITYFS_FILES=list.txt cargo test --release --test unityfs_roundtrip -- --ignored --nocapture
cargo +nightly fuzz run lz4_reference   # see fuzz/README.md

Status

This crate is early-stage. The on-disk PCF2 format should be treated as unstable until a 1.0 release.

License

Licensed under the Apache License, Version 2.0.

About

No description, website, or topics provided.

Resources

Readme
Apache-2.0 license
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.