base256
Dense byte-to-unicode encoding. 32 bytes → 32 characters.
// Before: Debug output for [u8; 32]
// After: base256 encoding
«Íï"8LZy£½Éßêõ\x0c"8LZpijÔêõúûü
Install
Library:
CLI:
Use
Library:
use Base256;
let key = ;
let encoded = encode;
let decoded = decode.unwrap;
CLI:
# Encode stdin
|
# Decode stdin
| |
# SSH public key
| | |
Design
- 256 unique unicode characters for 256 byte values
- No expansion: 32 bytes → 32 characters (base64: 32 → 44)
- Characters selected for terminal compatibility and visual distinction
- No-std, no dependencies
Character set:
- ASCII printables (95)
- Latin-1 supplement (95)
- Greek lowercase (25)
- Cyrillic subset (25)
- Math symbols (16)
When to use
Use for:
- Ed25519/Curve25519 keys
- SHA-256 hashes
- 32-byte identifiers in logs
- Any fixed 32-byte value needing compact display
Don't use for:
- Variable-length data
- Systems requiring base64
- Non-unicode environments
License
MIT OR Apache-2.0