base256
Dense byte-to-unicode encoding. 32 bytes → 32 characters.
// Before: Debug output for [u8; 32]
// After: base256 encoding
_Гî┤gÅωυ3î·ж┤;ÏÌЦXXλÎ2M÷·
Install
Library:
CLI:
Use
Library:
use Base256;
let key = ;
let encoded = encode; // !#%&()*+,-./0123456789:;<=>?@AB
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)
- Shell-safe: no quotes, backslashes, or dollar signs
- No-std, no dependencies
Character set:
- ASCII printables (89) - excluding shell metacharacters
- Latin-1 supplement (95)
- Greek letters (48) - visually distinct from Latin
- Cyrillic/Box drawing (24)
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