Crates.io | mnemonic-16bit |
lib.rs | mnemonic-16bit |
version | 0.1.1 |
source | src |
created_at | 2023-02-07 11:46:16.169753 |
updated_at | 2023-02-10 06:46:09.838687 |
description | library for converting binary data into phrases with 16 bits per word |
homepage | |
repository | https://github.com/DavidVorick/mneonic-16bit |
max_upload_size | |
id | 778686 |
size | 10,264 |
mnemonic-16bit is a mnemonic library that will take any binary data and convert it into a phrase which is more human friendly. Each word of the phrase maps to 16 bits, where the first 10 bits are represented by one word from the seed15 dictionary, and the remaining 6 bits are represented by a number between 0 and 63. If the number is '64', that signifies that the word only represents 1 byte instead of 2. Only the final word of a phrase may use the numerical suffix 64.
use mnemonic_16bit::{binary_to_phrase, phrase_to_binary};
fn main() {
let my_data = [0u8; 2];
let phrase = binary_to_phrase(&my_data); // "abbey0"
let data = phrase_to_binary(&phrase).unwrap();
assert!(data[..] == my_data[..]);
}