Closed ChrisJefferson closed 5 months ago
The repository readme already contains this example:
use base64ct::{Base64, Encoding};
let base64_hash = Base64::encode_string(&hash);
println!("Base64-encoded hash: {}", base64_hash);
let hex_hash = base16ct::lower::encode_string(&hash);
println!("Hex-encoded hash: {}", hex_hash);
I guess we could add hex-encoding examples to all crate docs. It would require adding base16ct
to dev dependencies for all crates, but it should be fine.
I want to get hashes in "that standard hex string format", which most hashes are displayed in all over the internet and I found this a bit harder than I expected. I realise it's obvious once you know, but we all didn't know once!
After some testing, it seems what I want is the 'base16ct' crate. Would you be open to a change to the readme which removed the
base64ct
example, and just gavebase16ct
? Maybe, something like (I'll go do this properly / clean up if the idea seems reasonable):Hash functions are usually displayed to users as hex strings. You can do this with the
base16ct
crate: