remove sneaky hasher

This commit is contained in:
Ellie Huxtable 2023-03-13 21:53:38 +00:00
parent 1cb41cb1ab
commit 687dda19c0
3 changed files with 0 additions and 15 deletions

2
Cargo.lock generated
View File

@ -159,9 +159,7 @@ name = "atuin-common"
version = "13.0.1"
dependencies = [
"chrono",
"hex",
"serde",
"sha2",
"uuid",
]

View File

@ -14,5 +14,3 @@ repository = "https://github.com/ellie/atuin"
chrono = { version = "0.4", features = ["serde"] }
serde = { version = "1.0.145", features = ["derive"] }
uuid = { version = "1.3", features = ["v7"] }
sha2 = { version = "0.10" }
hex = { version = "0.4" }

View File

@ -7,17 +7,6 @@ pub fn uuid_v7() -> String {
Uuid::now_v7().as_simple().to_string()
}
pub fn hash_str(string: &str) -> String {
hash_bytes(string.as_bytes())
}
pub fn hash_bytes(buf: &[u8]) -> String {
use sha2::{Digest, Sha256};
let mut hasher = Sha256::new();
hasher.update(buf);
hex::encode(hasher.finalize())
}
// TODO: more reliable, more tested
// I don't want to use ProjectDirs, it puts config in awkward places on
// mac. Data too. Seems to be more intended for GUI apps.