diff --git a/snix/nix-compat/src/nixhash/mod.rs b/snix/nix-compat/src/nixhash/mod.rs index edb34e57b..2be8caa10 100644 --- a/snix/nix-compat/src/nixhash/mod.rs +++ b/snix/nix-compat/src/nixhash/mod.rs @@ -93,7 +93,11 @@ impl NixHash { /// Formats a [NixHash] in the Nix default hash format, /// which is the algo, followed by a colon, then the lower hex encoded digest. pub fn to_nix_hex_string(&self) -> String { - format!("{}:{}", self.algo(), self.to_plain_hex_string()) + format!( + "{}:{}", + self.algo(), + HEXLOWER.encode(self.digest_as_bytes()) + ) } /// Formats a [NixHash] in the format that's used inside CAHash, @@ -123,11 +127,6 @@ impl NixHash { s } - - /// Returns the digest as a hex string -- without any algorithm prefix. - pub fn to_plain_hex_string(&self) -> String { - HEXLOWER.encode(self.digest_as_bytes()) - } } impl<'de> Deserialize<'de> for NixHash {