1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! SHA-256 and lowercase hex, for identifiers and cache keys.
//!
//! A digest that ends up in a key has to be spelled the same way everywhere it
//! is computed, or two functions derive two keys for one thing. SHA-256 comes
//! from `ring`, which the TLS stack already links.
/// The SHA-256 digest of `data`.
/// The SHA-256 digest of `data` as lowercase hex.
///
/// # Examples
///
/// ```
/// assert_eq!(
/// davidrs::digest::sha256_hex(b"abc"),
/// "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
/// );
/// ```
/// Lowercase hex, two digits per byte.