use const_hex to replace hex

This commit is contained in:
ShuiRuTian 2024-05-10 14:37:08 +08:00
parent c102c01e76
commit 5e274f428b
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ async-std = { version = "1.10.0", features = ["unstable"], optional = true }
digest = "0.10.6"
either = "1.6.1"
futures = { version = "0.3.17", optional = true }
hex = "0.4.3"
const-hex = "1.0.0"
memmap2 = { version = "0.5.8", optional = true }
miette = "5.7.0"
reflink-copy = "0.1.9"

View File

@ -309,13 +309,13 @@ fn bucket_path(cache: &Path, key: &str) -> PathBuf {
fn hash_key(key: &str) -> String {
let mut hasher = Sha1::new();
hasher.update(key);
hex::encode(hasher.finalize())
const_hex::encode(hasher.finalize())
}
fn hash_entry(key: &str) -> String {
let mut hasher = Sha256::new();
hasher.update(key);
hex::encode(hasher.finalize())
const_hex::encode(hasher.finalize())
}
fn now() -> u128 {