| Crates.io | memo128 |
| lib.rs | memo128 |
| version | 0.5.0 |
| created_at | 2025-05-02 11:45:43.514495+00 |
| updated_at | 2025-05-02 21:24:07.841956+00 |
| description | A library for encoding and decoding 128-bit data as mnemonic sentences |
| homepage | https://github.com/haraldh/memo128 |
| repository | https://github.com/haraldh/memo128 |
| max_upload_size | |
| id | 1657593 |
| size | 207,228 |
A Rust library and CLI tool for encoding 128-bit numbers as memorable natural language sentences.
Memo128 converts cryptographic keys, blockchain addresses, and other 128-bit values into easy-to-remember sentences. It adds a 7-bit checksum for error detection and uses five dictionaries to create structured sentences that form mini-stories.
Each 128-bit value (plus 7-bit checksum) is encoded as three sentences, with each sentence containing:
cargo install --path .
cargo run -- encode 0123456789abcdef0123456789abcdef
This will output three sentences representing the encoded value.
Sentence 1: a brave mouse inside a cosmic cathedral disconnected a question of time but it was already too late
Sentence 2: a worried parent within the cosmic algorithm accepted a mathematical impossibility as code predicted
Sentence 3: the fjord elder inside a particle accelerator stole a reality glitch rebooting the system
cargo run -- decode \
"a brave mouse inside a cosmic cathedral disconnected a question of time but it was already too late" \
"a worried parent within the cosmic algorithm accepted a mathematical impossibility as code predicted" \
"the fjord elder inside a particle accelerator stole a reality glitch rebooting the system"
Make sure to quote each sentence and provide all three sentences in the correct order.
Memo128 provides fuzzy decoding capabilities to handle sentences with typos, minor rephrasing, or other imperfections:
cargo run -- fuzzy-decode --max-distance 1 \
"a brave mouze inside a cosmic cathedral disconnected a question of time but it was already too late" \
"a worried parent within the cosmic algorithm accepted a mathematical impossibility as code predicted" \
"the fjord elder inside a particle accelerator stole a reality glitch rebooting the system"
cargo run -- fuzzy-decode --max-distance 3 \
"a brave mouse inside the cosmic cathedral disconnected a question of time but it was already too late" \
"a worried parent within the cosmic algorithm accepted a mathematical impossibility as code predicted" \
"the fjord elder inside a particle accelerator stole a reality glitch rebooting the system"
The --max-distance parameter specifies the maximum Levenshtein distance allowed when matching sentence components
against
dictionary entries. Higher values allow more flexibility but may increase computation time and false matches:
--max-distance 1: Handles minor typos (e.g., "mouze" instead of "mouse")--max-distance 2: Handles word form changes (e.g., "rebooting the systems" vs "rebooting the system")--max-distance 3+: Handles more extensive rephrasing but may be slow and less accurateFuzzy decoding may return multiple possible matches if the imperfect sentences can be interpreted in different ways.
character_10bit.txt (1024 entries)setting_10bit.txt (1024 entries)action_8bit.txt (256 entries)object_9bit.txt (512 entries)outcome_8bit.txt (256 entries)For full details, see SPEC.md.
# Build the project
cargo build
# Run tests
cargo test
# Format code
cargo fmt
# Run linter
cargo clippy