Skip to main content

format_sha256

Macro format_sha256 

Source
macro_rules! format_sha256 {
    ($($args:tt)*) => { ... };
}
Expand description

Analogous to std::format, but returning only the SHA-256 digest of the formatted string.

ยงExamples

use nix_compat::format_sha256;
let sha256 = format_sha256!("{}bc", "a");
assert_eq!(format!("{sha256:x}"), "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad");