Features
Custom Magic Numbers
Applications define their own 4-byte identifiers: TRIX, STIM, SMSG
JSON Header
Extensible metadata: sigils applied, checksums, application-specific data
Streaming Friendly
Header length prefix enables reading metadata before loading payload
Protocol Agnostic
No assumptions about encryption, compression, or encoding
Installation
# Install CLI tool
go install github.com/Snider/Enchantrix/cmd/trix@latest
# Or use as library
go get github.com/Snider/Enchantrix
Usage
File Structure
┌─────────────────────────────────────┐
│ Magic Bytes (4 bytes) │
├─────────────────────────────────────┤
│ Version (1 byte) │
├─────────────────────────────────────┤
│ Header Length (4 bytes BE) │
├─────────────────────────────────────┤
│ JSON Header (variable) │
│ - sigils applied │
│ - checksums │
│ - metadata │
├─────────────────────────────────────┤
│ Payload (encrypted/compressed data) │
└─────────────────────────────────────┘
CLI Usage
# Encode to .trix
echo "Hello" | trix encode --magic TRIX base64
# Decode from .trix
trix decode --input file.trix --magic TRIX base64
Quick Links
More from Lethean R&D Labs
Fancy helping out?
Spotted a bug? Got an idea? We'd love to hear from you.
Read the contributing guide →