codeq
A binary codec library optimized for storage and networking, with built-in checksum support and file operation utilities.
Features
- 🔒 Data Integrity: Built-in CRC32 checksum support for detecting data corruption
- 📍 Position Tracking: Type-safe offset and size handling for file operations
- ⚡ Performance: Optimized for binary format with fixed-size type support
- 🛠️ Simple API: Direct encoding/decoding without intermediate formats
- 📦 Zero Dependencies: Minimal dependency footprint
Usage
Add this to your Cargo.toml
:
[]
= "0.1"
Basic Example
use ;
use io;
// Add checksum protection
let record = Record ;
let protected = new;
let mut buf = Vec new;
protected.encode.unwrap;
assert_eq!;
let decoded = decode.unwrap;
assert_eq!;
When to Use codeq vs serde
Choose codeq when you need:
- Efficient binary serialization with checksums
- Direct control over the binary format
- File/buffer position tracking
- Simple implementation without format abstraction
Use serde when you need:
- Multiple format support (JSON, YAML, etc.)
- Derive macros for automatic implementation
- Complex data structure serialization
- Format-agnostic code