Skip to content

jakubtomsu/odin-lz4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

odin-lz4

Odin bindings for the LZ4 library.

LZ4 is lossless compression algorithm, providing compression speed > 500 MB/s per core, scalable with multi-cores CPU. It features an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limits on multi-core systems.

Usage

Import the packages:

import "project:lz4"
import "project:lz4hc"

Compress data:

data := [?]byte{1, 2, 3, 4, 5}
compressed := lz4.compress_slice(data) or_return
// HC is _much_ slower to compress, but very fast to decompress.
hc_compressed := lz4hc.compress_slice(data) or_return

Decompress data:

decompressed_buf := mem.alloc_bytes(orig_size) // You need to store the original size separately.
// Decompress data from LZ4 or LZ4HC
decompressed := lz4.decompress(compressed, decompressed_buf) or_return

Features

  • LZ4
    • simple functions
    • advanced functions
    • streaming functions (WIP: implemented but not fully tested!)
  • LZ4HC
    • block compression
    • streaming compression (WIP: implemented but not fully tested!)

Frame and file support isn't implemented. I might implement them if ever need them.

Contributing

All contributions are welcome! I will merge any pull requests with meaningful work, whether that is small bug fixes, odin helpers or missing API implementation.

About

Odin bindings for LZ4 (https://github.com/lz4/lz4) - an extremely fast lossless compression algorithm

Topics

Resources

License

Stars

Watchers

Forks

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy