#encode #decode #base #integer #list #word #integers #transform #ids #eff

mnemyme

Encode and decode integers based on the EFF large word list

1 unstable release

Uses new Rust 2021

0.1.0 Oct 3, 2022

#967 in Data structures

MIT license

27KB
69 lines

A crate to word list encode IDs

This crate can be used to transform u32 values (IDs) to user-friendly word triples.

The word list is based on the EFF large word list which can encode nearly 13 bits. Therefore, the base for this crate is 12 bits, which effectively uses only 4096 items from the list. To encode a u32 value, three words are required.

The wordlist is statically compiled into the library and cannot be changed.

Build

cargo build

lib.rs:

This crate can be used to transform u32 values (IDs) to user-friendly word triples.

The word list is based on the EFF large word list which can encode nearly 13 bits. Therefore, the base for this crate is 12 bits, which effectively uses only 4096 items from the list. To encode a u32 value, three words are required.

The wordlist is statically compiled into the library and cannot be changed.

Dependencies

~230–640KB
~15K SLoC