#word-list

mnemyme

Encode and decode integers based on the EFF large word list

1 unstable release

0.1.0 Oct 3, 2022

#36 in #word-list

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

~245–700KB
~16K SLoC