hash_encode

Function hash_encode 

Source
pub fn hash_encode(
    data: &[u8],
    registry: &DictionaryRegistry,
) -> Result<HashEncodeResult, Box<dyn Error>>
Expand description

Hash data with a random algorithm and encode with a random dictionary.

ยงExample

use base_d::{DictionaryRegistry, convenience::hash_encode};

let registry = DictionaryRegistry::load_default().unwrap();
let result = hash_encode(b"Hello, world!", &registry).unwrap();
println!("Encoded: {}", result.encoded);
println!("Hash: {}", result.hash_algo.as_str());
println!("Dictionary: {}", result.dictionary_name);