#word-list #encode #decode #u32 #triple #eff #value

mnemyme

Encode and decode integers based on the EFF large word list

1 unstable release

0.1.0 Oct 3, 2022

#1331 in Data structures

21 downloads per month

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

~0.4–0.8MB
~19K SLoC