Repository: RustCrypto/hashes (language: rust)

Issue:
Point users to how to make hex strings
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 gave `base16ct`? 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:

<insert example here>

There are a number of other ways to display hashes, including `base64ct`, which can be seen in the `formats` repository (which links to https://github.com/RustCrypto/formats/)



Discussion / hints:
The repository readme already [contains](https://github.com/RustCrypto/hashes?tab=readme-ov-file#examples) this example:
```rust
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.

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 3d94ade60..ed207914e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -16,12 +16,19 @@ name = "ascon-hash"
 version = "0.3.0-pre"
 dependencies = [
  "ascon",
+ "base16ct",
  "digest",
  "hex",
  "hex-literal",
  "spectral",
 ]
 
+[[package]]
+name = "base16ct"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf"
+
 [[package]]
 name = "belt-block"
 version = "0.1.2"
@@ -32,6 +39,7 @@ checksum = "d9aa1eef3994e2ccd304a78fe3fea4a73e5792007f85f09b79bb82143ca5f82b"
 name = "belt-hash"
 version = "0.2.0-pre.3"
 dependencies = [
+ "base16ct",
  "belt-block",
  "digest",
  "hex-literal",
@@ -41,6 +49,7 @@ dependencies = [
 name = "blake2"
 version = "0.11.0-pre.3"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
 ]
@@ -96,7 +105,7 @@ dependencies = [
 [[package]]
 name = "digest"
 version = "0.11.0-pre.8"
-source = "git+https://github.com/RustCrypto/traits.git#7c7a0d2a2caa60e286835051e6ad5fd10a9a9554"
+source = "git+https://github.com/RustCrypto/traits.git#5e6ddf673d83b6e1ae7eea9e61c526f5cf41cd65"
 dependencies = [
  "blobby",
  "block-buffer",
@@ -110,6 +119,7 @@ dependencies = [
 name = "fsb"
 version = "0.2.0-pre"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
  "whirlpool",
@@ -117,9 +127,9 @@ dependencies = [
 
 [[package]]
 name = "getrandom"
-version = "0.2.12"
+version = "0.2.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
+checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
 dependencies = [
  "cfg-if",
  "libc",
@@ -130,6 +140,7 @@ dependencies = [
 name = "gost94"
 version = "0.11.0-pre"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
 ]
@@ -138,6 +149,7 @@ dependencies = [
 name = "groestl"
 version = "0.11.0-pre"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
 ]
@@ -167,6 +179,7 @@ dependencies = [
 name = "jh"
 version = "0.2.0-pre"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
  "ppv-lite86",
@@ -192,14 +205,15 @@ dependencies = [
 
 [[package]]
 name = "libc"
-version = "0.2.152"
+version = "0.2.155"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
+checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
 
 [[package]]
 name = "md-5"
 version = "0.11.0-pre.3"
 dependencies = [
+ "base16ct",
  "cfg-if",
  "digest",
  "hex-literal",
@@ -209,6 +223,7 @@ dependencies = [
 name = "md2"
 version = "0.11.0-pre"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
 ]
@@ -217,6 +232,7 @@ dependencies = [
 name = "md4"
 version = "0.11.0-pre"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
 ]
@@ -240,6 +256,7 @@ dependencies = [
 name = "ripemd"
 version = "0.2.0-pre"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
 ]
@@ -248,6 +265,7 @@ dependencies = [
 name = "sha1"
 version = "0.11.0-pre.3"
 dependencies = [
+ "base16ct",
  "cfg-if",
  "cpufeatures",
  "digest",
@@ -258,6 +276,7 @@ dependencies = [
 name = "sha1-checked"
 version = "0.11.0-pre"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
  "sha1",
@@ -268,6 +287,7 @@ dependencies = [
 name = "sha2"
 version = "0.11.0-pre.3"
 dependencies = [
+ "base16ct",
  "cfg-if",
  "cpufeatures",
  "digest",
@@ -278,6 +298,7 @@ dependencies = [
 name = "sha3"
 version = "0.11.0-pre.3"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
  "keccak",
@@ -287,6 +308,7 @@ dependencies = [
 name = "shabal"
 version = "0.5.0-pre"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
 ]
@@ -295,6 +317,7 @@ dependencies = [
 name = "skein"
 version = "0.2.0-pre"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
  "threefish",
@@ -304,6 +327,7 @@ dependencies = [
 name = "sm3"
 version = "0.5.0-pre.3"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
 ]
@@ -318,15 +342,16 @@ checksum = "ae3c15181f4b14e52eeaac3efaeec4d2764716ce9c86da0c934c3e318649c5ba"
 name = "streebog"
 version = "0.11.0-pre.3"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
 ]
 
 [[package]]
 name = "subtle"
-version = "2.5.0"
+version = "2.6.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
+checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5"
 
 [[package]]
 name = "threefish"
@@ -341,6 +366,7 @@ dependencies = [
 name = "tiger"
 version = "0.3.0-pre"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
 ]
@@ -361,6 +387,7 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
 name = "whirlpool"
 version = "0.11.0-pre.2"
 dependencies = [
+ "base16ct",
  "digest",
  "hex-literal",
 ]
diff --git a/ascon-hash/Cargo.toml b/ascon-hash/Cargo.toml
index 37d46be7f..724fbf265 100644
--- a/ascon-hash/Cargo.toml
+++ b/ascon-hash/Cargo.toml
@@ -23,6 +23,7 @@ ascon = { version = "0.4", default-features = false }
 spectral = { version = "0.6", default-features = false }
 hex = "0.4"
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["std"]
diff --git a/ascon-hash/README.md b/ascon-hash/README.md
index f70c5817a..49d9f45d9 100644
--- a/ascon-hash/README.md
+++ b/ascon-hash/README.md
@@ -28,6 +28,10 @@ hasher.update(b"some bytes");
 let hash = hasher.finalize();
 
 assert_eq!(hash, hex!("b742ca75e57038757059cccc6874714f9dbd7fc5924a7df4e316594fd1426ca8"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "b742ca75e57038757059cccc6874714f9dbd7fc5924a7df4e316594fd1426ca8");
 ```
 
 XOF hashing:
diff --git a/belt-hash/Cargo.toml b/belt-hash/Cargo.toml
index 36668c814..82e856bc0 100644
--- a/belt-hash/Cargo.toml
+++ b/belt-hash/Cargo.toml
@@ -19,6 +19,7 @@ belt-block = { version = "0.1.1", default-features = false }
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["oid", "std"]
diff --git a/belt-hash/README.md b/belt-hash/README.md
index 071694ef2..a5a336084 100644
--- a/belt-hash/README.md
+++ b/belt-hash/README.md
@@ -19,6 +19,10 @@ hasher.update(b"hello world");
 let hash = hasher.finalize();
 
 assert_eq!(hash, hex!("afb175816416fbadad4629ecbd78e1887789881f2d2e5b80c22a746b7ac7ba88"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "afb175816416fbadad4629ecbd78e1887789881f2d2e5b80c22a746b7ac7ba88");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/blake2/Cargo.toml b/blake2/Cargo.toml
index 92943f0a8..33d0c2921 100644
--- a/blake2/Cargo.toml
+++ b/blake2/Cargo.toml
@@ -18,6 +18,7 @@ digest = { version = "=0.11.0-pre.8", features = ["mac"] }
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["std"]
diff --git a/blake2/README.md b/blake2/README.md
index 733fb77c1..91a92212e 100644
--- a/blake2/README.md
+++ b/blake2/README.md
@@ -24,8 +24,8 @@ let mut hasher = Blake2b512::new();
 hasher.update(b"hello world");
 
 // read hash digest and consume hasher
-let res = hasher.finalize();
-assert_eq!(res, hex!(
+let hash = hasher.finalize();
+assert_eq!(hash, hex!(
     "021ced8799296ceca557832ab941a50b4a11f83478cf141f51f933f653ab9fbc"
     "c05a037cddbed06e309bf334942c4e58cdf1a46e237911ccd7fcf9787cbc7fd0"
 ));
@@ -33,8 +33,12 @@ assert_eq!(res, hex!(
 // same example for Blake2s256:
 let mut hasher = Blake2s256::new();
 hasher.update(b"hello world");
-let res = hasher.finalize();
-assert_eq!(res, hex!("9aec6806794561107e594b1f6a8a6b0c92a0cba9acf5e5e93cca06f781813b0b"));
+let hash = hasher.finalize();
+assert_eq!(hash, hex!("9aec6806794561107e594b1f6a8a6b0c92a0cba9acf5e5e93cca06f781813b0b"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "9aec6806794561107e594b1f6a8a6b0c92a0cba9acf5e5e93cca06f781813b0b");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/fsb/Cargo.toml b/fsb/Cargo.toml
index 8fb2299d9..29640251e 100644
--- a/fsb/Cargo.toml
+++ b/fsb/Cargo.toml
@@ -19,6 +19,7 @@ whirlpool = { version = "=0.11.0-pre.2", path = "../whirlpool", default-features
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["std"]
diff --git a/fsb/README.md b/fsb/README.md
index af5de0a50..eb9fb0a7a 100644
--- a/fsb/README.md
+++ b/fsb/README.md
@@ -31,6 +31,10 @@ hasher.update(b"hello");
 let hash = hasher.finalize();
 
 assert_eq!(hash, hex!("0f036dc3761aed2cba9de586a85976eedde6fa8f115c0190763decc02f28edbc"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "0f036dc3761aed2cba9de586a85976eedde6fa8f115c0190763decc02f28edbc");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/gost94/Cargo.toml b/gost94/Cargo.toml
index b9fde47db..17301f475 100644
--- a/gost94/Cargo.toml
+++ b/gost94/Cargo.toml
@@ -18,6 +18,7 @@ digest = "=0.11.0-pre.8"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["oid", "std"]
diff --git a/gost94/README.md b/gost94/README.md
index 4c4ec68e0..313b95318 100644
--- a/gost94/README.md
+++ b/gost94/README.md
@@ -20,6 +20,10 @@ hasher.update("The quick brown fox jumps over the lazy dog");
 let hash = hasher.finalize();
 
 assert_eq!(hash, hex!("9004294a361a508c586fe53d1f1b02746765e71b765472786e4770d565830a76"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "9004294a361a508c586fe53d1f1b02746765e71b765472786e4770d565830a76");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/groestl/Cargo.toml b/groestl/Cargo.toml
index ad05fa907..4eb272b84 100644
--- a/groestl/Cargo.toml
+++ b/groestl/Cargo.toml
@@ -18,6 +18,7 @@ digest = "=0.11.0-pre.8"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["std"]
diff --git a/groestl/README.md b/groestl/README.md
index 769239098..a410019db 100644
--- a/groestl/README.md
+++ b/groestl/README.md
@@ -17,9 +17,13 @@ use hex_literal::hex;
 
 let mut hasher = Groestl256::default();
 hasher.update(b"my message");
-let result = hasher.finalize();
+let hash = hasher.finalize();
 
-assert_eq!(result, hex!("dc0283ca481efa76b7c19dd5a0b763dff0e867451bd9488a9c59f6c8b8047a86"));
+assert_eq!(hash, hex!("dc0283ca481efa76b7c19dd5a0b763dff0e867451bd9488a9c59f6c8b8047a86"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "dc0283ca481efa76b7c19dd5a0b763dff0e867451bd9488a9c59f6c8b8047a86");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/jh/Cargo.toml b/jh/Cargo.toml
index 68ea7fd1a..a62f7cb8d 100644
--- a/jh/Cargo.toml
+++ b/jh/Cargo.toml
@@ -19,6 +19,7 @@ simd = { package = "ppv-lite86", version = "0.2.6" }
 
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 zeroize = ["digest/zeroize"]
diff --git a/jh/README.md b/jh/README.md
index bc573194f..3854c79da 100644
--- a/jh/README.md
+++ b/jh/README.md
@@ -24,9 +24,13 @@ use hex_literal::hex;
 
 let mut hasher = Jh256::new();
 hasher.update(b"hello");
-let result = hasher.finalize();
+let hash = hasher.finalize();
 
-assert_eq!(result, hex!("94fd3f4c564957c6754265676bf8b244c707d3ffb294e18af1f2e4f9b8306089"));
+assert_eq!(hash, hex!("94fd3f4c564957c6754265676bf8b244c707d3ffb294e18af1f2e4f9b8306089"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "94fd3f4c564957c6754265676bf8b244c707d3ffb294e18af1f2e4f9b8306089");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/md2/Cargo.toml b/md2/Cargo.toml
index 72472fb4a..293871cbe 100644
--- a/md2/Cargo.toml
+++ b/md2/Cargo.toml
@@ -18,6 +18,7 @@ digest = "=0.11.0-pre.8"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["oid", "std"]
diff --git a/md2/README.md b/md2/README.md
index d24bb58fb..fff7795ec 100644
--- a/md2/README.md
+++ b/md2/README.md
@@ -20,6 +20,10 @@ hasher.update(b"hello world");
 let hash = hasher.finalize();
 
 assert_eq!(hash, hex!("d9cce882ee690a5c1ce70beff3a78c77"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "d9cce882ee690a5c1ce70beff3a78c77");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/md4/Cargo.toml b/md4/Cargo.toml
index e5464d46a..08a4c9b08 100644
--- a/md4/Cargo.toml
+++ b/md4/Cargo.toml
@@ -18,6 +18,7 @@ digest = "=0.11.0-pre.8"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["oid", "std"]
diff --git a/md4/README.md b/md4/README.md
index bd80a2fe1..767ab9f28 100644
--- a/md4/README.md
+++ b/md4/README.md
@@ -23,8 +23,12 @@ hasher.update(b"hello world");
 
 // acquire hash digest in the form of Array,
 // which in this case is equivalent to [u8; 16]
-let result = hasher.finalize();
-assert_eq!(result[..], hex!("aa010fbc1d14c795d86ef98c95479d17"));
+let hash = hasher.finalize();
+assert_eq!(hash, hex!("aa010fbc1d14c795d86ef98c95479d17"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "aa010fbc1d14c795d86ef98c95479d17");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/md5/Cargo.toml b/md5/Cargo.toml
index f53ff3fd4..edfe4bbdb 100644
--- a/md5/Cargo.toml
+++ b/md5/Cargo.toml
@@ -22,6 +22,7 @@ cfg-if = "1"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["oid", "std"]
diff --git a/md5/README.md b/md5/README.md
index 1501dd173..a9c2c9368 100644
--- a/md5/README.md
+++ b/md5/README.md
@@ -33,6 +33,10 @@ hasher.update(b"hello world");
 let hash = hasher.finalize();
 
 assert_eq!(hash, hex!("5eb63bbbe01eeed093cb22bb8f5acdc3"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "5eb63bbbe01eeed093cb22bb8f5acdc3");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/ripemd/Cargo.toml b/ripemd/Cargo.toml
index 946106796..246655695 100644
--- a/ripemd/Cargo.toml
+++ b/ripemd/Cargo.toml
@@ -18,6 +18,7 @@ digest = "=0.11.0-pre.8"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["oid", "std"]
diff --git a/ripemd/README.md b/ripemd/README.md
index 52eb89097..fa6a3596c 100644
--- a/ripemd/README.md
+++ b/ripemd/README.md
@@ -27,6 +27,11 @@ let hash160 = hasher.finalize();
 
 assert_eq!(hash160, hex!("7f772647d88750add82d8e1a7a3e5c0902a346a3"));
 
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash160 = base16ct::lower::encode_string(&hash160);
+assert_eq!(hex_hash160, "7f772647d88750add82d8e1a7a3e5c0902a346a3");
+
+// Same example for RIPEMD-320
 let mut hasher = Ripemd320::new();
 hasher.update(b"Hello world!");
 let hash320 = hasher.finalize();
diff --git a/sha1-checked/Cargo.toml b/sha1-checked/Cargo.toml
index c9151d781..a0d47ce09 100644
--- a/sha1-checked/Cargo.toml
+++ b/sha1-checked/Cargo.toml
@@ -25,6 +25,7 @@ zeroize = { version = "1.8", default-features = false, optional = true }
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["oid", "std"]
diff --git a/sha1-checked/README.md b/sha1-checked/README.md
index f66e34cfe..3b58335bf 100644
--- a/sha1-checked/README.md
+++ b/sha1-checked/README.md
@@ -32,6 +32,10 @@ use sha1_checked::Sha1;
 let result = Sha1::try_digest(b"hello world");
 assert_eq!(result.hash().as_ref(), hex!("2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"));
 assert!(!result.has_collision());
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(result.hash().as_ref());
+assert_eq!(hex_hash, "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed");
 ```
 
 ### Incremental API
diff --git a/sha1-checked/src/lib.rs b/sha1-checked/src/lib.rs
index 76b1199b1..bdcadfc86 100644
--- a/sha1-checked/src/lib.rs
+++ b/sha1-checked/src/lib.rs
@@ -6,6 +6,8 @@
 )]
 #![cfg_attr(docsrs, feature(doc_auto_cfg))]
 #![warn(missing_docs, rust_2018_idioms)]
+// TODO: remove after fixing https://github.com/RustCrypto/hashes/issues/594
+#![allow(dead_code)]
 
 //! Collision checked Sha1.
 //!
@@ -240,7 +242,6 @@ impl Drop for DetectionState {
 impl ZeroizeOnDrop for DetectionState {}
 
 #[cfg(feature = "oid")]
-#[cfg_attr(docsrs, doc(cfg(feature = "oid")))]
 impl digest::const_oid::AssociatedOid for Sha1 {
     const OID: digest::const_oid::ObjectIdentifier = sha1::Sha1Core::OID;
 }
diff --git a/sha1/Cargo.toml b/sha1/Cargo.toml
index af002663a..96ce64c9f 100644
--- a/sha1/Cargo.toml
+++ b/sha1/Cargo.toml
@@ -22,6 +22,7 @@ cpufeatures = "0.2"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["oid", "std"]
diff --git a/sha1/README.md b/sha1/README.md
index 85e3ade3f..e6716d8ce 100644
--- a/sha1/README.md
+++ b/sha1/README.md
@@ -43,6 +43,10 @@ hasher.update(b"hello world");
 let hash = hasher.finalize();
 
 assert_eq!(hash, hex!("2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/sha2/Cargo.toml b/sha2/Cargo.toml
index 88875aa3b..88f94f8d2 100644
--- a/sha2/Cargo.toml
+++ b/sha2/Cargo.toml
@@ -25,6 +25,7 @@ cpufeatures = "0.2"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["oid", "std"]
diff --git a/sha2/README.md b/sha2/README.md
index a1635d72d..42b7c4802 100644
--- a/sha2/README.md
+++ b/sha2/README.md
@@ -28,6 +28,10 @@ use hex_literal::hex;
 
 let hash = Sha256::digest(b"hello world");
 assert_eq!(hash, hex!("b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9");
 ```
 
 ### Incremental API
@@ -37,7 +41,8 @@ use sha2::{Sha256, Sha512, Digest};
 use hex_literal::hex;
 
 let mut hasher = Sha256::new();
-hasher.update(b"hello world");
+hasher.update(b"hello ");
+hasher.update(b"world");
 let hash256 = hasher.finalize();
 
 assert_eq!(hash256, hex!("b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"));
diff --git a/sha3/Cargo.toml b/sha3/Cargo.toml
index 27d48689e..7a2736d25 100644
--- a/sha3/Cargo.toml
+++ b/sha3/Cargo.toml
@@ -23,6 +23,7 @@ keccak = "=0.2.0-pre.0"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["oid", "std"]
diff --git a/sha3/README.md b/sha3/README.md
index e16d3ef81..a6465e1bf 100644
--- a/sha3/README.md
+++ b/sha3/README.md
@@ -36,6 +36,10 @@ hasher.update(b"abc");
 let hash = hasher.finalize();
 
 assert_eq!(hash, hex!("3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532");
 ```
 
 SHAKE functions have an extendable output, so finalization method returns
diff --git a/shabal/Cargo.toml b/shabal/Cargo.toml
index 0ca2917b5..7f7ec3a02 100644
--- a/shabal/Cargo.toml
+++ b/shabal/Cargo.toml
@@ -18,6 +18,7 @@ digest = "=0.11.0-pre.8"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["std"]
diff --git a/shabal/README.md b/shabal/README.md
index 94fa4db5e..c00859e46 100644
--- a/shabal/README.md
+++ b/shabal/README.md
@@ -22,6 +22,10 @@ hasher.update(b"helloworld");
 let hash = hasher.finalize();
 
 assert_eq!(hash, hex!("d945dee21ffca23ac232763aa9cac6c15805f144db9d6c97395437e01c8595a8"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "d945dee21ffca23ac232763aa9cac6c15805f144db9d6c97395437e01c8595a8");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/skein/Cargo.toml b/skein/Cargo.toml
index de5e4ce50..92b5be820 100644
--- a/skein/Cargo.toml
+++ b/skein/Cargo.toml
@@ -19,6 +19,7 @@ threefish = { version = "0.5.2", default-features = false }
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["std"]
diff --git a/skein/README.md b/skein/README.md
index d847c6db2..08c20d6a0 100644
--- a/skein/README.md
+++ b/skein/README.md
@@ -26,6 +26,10 @@ hasher.update(b"jumps over the lazy dog");
 let hash = hasher.finalize();
 
 assert_eq!(hash, hex!("b3250457e05d3060b1a4bbc1428bc75a3f525ca389aeab96cfa34638d96e492a"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "b3250457e05d3060b1a4bbc1428bc75a3f525ca389aeab96cfa34638d96e492a");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/sm3/Cargo.toml b/sm3/Cargo.toml
index dd1fef3ba..00835de90 100644
--- a/sm3/Cargo.toml
+++ b/sm3/Cargo.toml
@@ -18,6 +18,7 @@ digest = "=0.11.0-pre.8"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["std"]
diff --git a/sm3/README.md b/sm3/README.md
index 9802ce00a..dbfcc99ad 100644
--- a/sm3/README.md
+++ b/sm3/README.md
@@ -21,6 +21,10 @@ hasher.update(b"hello world");
 let hash = hasher.finalize();
 
 assert_eq!(hash, hex!("44f0061e69fa6fdfc290c494654a05dc0c053da7e5c52b84ef93a9d67d3fff88"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "44f0061e69fa6fdfc290c494654a05dc0c053da7e5c52b84ef93a9d67d3fff88");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/streebog/Cargo.toml b/streebog/Cargo.toml
index 3fc5cf9ce..ed825d17e 100644
--- a/streebog/Cargo.toml
+++ b/streebog/Cargo.toml
@@ -18,6 +18,7 @@ digest = "=0.11.0-pre.8"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["oid", "std"]
diff --git a/streebog/README.md b/streebog/README.md
index 52c023403..16a15f503 100644
--- a/streebog/README.md
+++ b/streebog/README.md
@@ -21,6 +21,11 @@ let hash256 = hasher.finalize();
 
 assert_eq!(hash256, hex!("3e7dea7f2384b6c5a3d0e24aaa29c05e89ddd762145030ec22c71a6db8b2c1f4"));
 
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash256 = base16ct::lower::encode_string(&hash256);
+assert_eq!(hex_hash256, "3e7dea7f2384b6c5a3d0e24aaa29c05e89ddd762145030ec22c71a6db8b2c1f4");
+
+// Same example for Streebog-512
 let mut hasher = Streebog512::new();
 hasher.update("The quick brown fox jumps over the lazy dog.");
 let hash512 = hasher.finalize();
diff --git a/tiger/Cargo.toml b/tiger/Cargo.toml
index 5a05cb6b0..50af0a9d7 100644
--- a/tiger/Cargo.toml
+++ b/tiger/Cargo.toml
@@ -18,6 +18,7 @@ digest = "=0.11.0-pre.8"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["std"]
diff --git a/tiger/README.md b/tiger/README.md
index a0c084477..50eb66590 100644
--- a/tiger/README.md
+++ b/tiger/README.md
@@ -22,6 +22,10 @@ hasher.update(b"hello world");
 let hash = hasher.finalize();
 
 assert_eq!(hash, hex!("4c8fbddae0b6f25832af45e7c62811bb64ec3e43691e9cc3"));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(hex_hash, "4c8fbddae0b6f25832af45e7c62811bb64ec3e43691e9cc3");
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.
diff --git a/whirlpool/Cargo.toml b/whirlpool/Cargo.toml
index ac9fd2819..3eec8ae50 100644
--- a/whirlpool/Cargo.toml
+++ b/whirlpool/Cargo.toml
@@ -18,6 +18,7 @@ digest = "=0.11.0-pre.8"
 [dev-dependencies]
 digest = { version = "=0.11.0-pre.8", features = ["dev"] }
 hex-literal = "0.4"
+base16ct = { version = "0.2", features = ["alloc"] }
 
 [features]
 default = ["std"]
diff --git a/whirlpool/README.md b/whirlpool/README.md
index 8902f78f4..b2e6d59c9 100644
--- a/whirlpool/README.md
+++ b/whirlpool/README.md
@@ -34,6 +34,14 @@ assert_eq!(hash, hex!(
     "8eaccdc136903c458ea0b1376be2a5fc9dc5b8ce8892a3b4f43366e2610c206c"
     "a373816495e63db0fff2ff25f75aa7162f332c9f518c3036456502a8414d300a"
 ));
+
+// Hex-encode hash using https://docs.rs/base16ct
+let hex_hash = base16ct::lower::encode_string(&hash);
+assert_eq!(
+    hex_hash,
+    "8eaccdc136903c458ea0b1376be2a5fc9dc5b8ce8892a3b4f43366e2610c206c\
+     a373816495e63db0fff2ff25f75aa7162f332c9f518c3036456502a8414d300a",
+);
 ```
 
 Also, see the [examples section] in the RustCrypto/hashes readme.


Test patch: