diff --git a/Cargo.lock b/Cargo.lock index c8547cc..c64b4fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -281,6 +281,12 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "indexmap" version = "2.14.0" @@ -310,6 +316,7 @@ dependencies = [ "clap", "dirs", "glob", + "hex", "rayon", "regex", "serde", diff --git a/Cargo.toml b/Cargo.toml index c95b844..d215882 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,7 @@ glob = "0.3.3" dirs = "6.0" rayon = "1" sha2 = "0.10" +hex = "0.4" [dev-dependencies] tempfile = "3" diff --git a/src/baseline.rs b/src/baseline.rs index 502cf26..d64e722 100644 --- a/src/baseline.rs +++ b/src/baseline.rs @@ -24,7 +24,7 @@ fn hash_content(content: &str) -> String { let mut hasher = Sha256::new(); hasher.update(HASH_DOMAIN_SEPARATOR.as_bytes()); hasher.update(content.as_bytes()); - format!("{:x}", hasher.finalize()) + hex::encode(hasher.finalize()) } #[derive(Clone, Debug, PartialEq, Eq, Hash)]