From 687dda19c052b30dececd9a016b05e9b9d17a7ea Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Mon, 13 Mar 2023 21:53:38 +0000 Subject: [PATCH] remove sneaky hasher --- Cargo.lock | 2 -- atuin-common/Cargo.toml | 2 -- atuin-common/src/utils.rs | 11 ----------- 3 files changed, 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17c325ad..e3ffdf5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -159,9 +159,7 @@ name = "atuin-common" version = "13.0.1" dependencies = [ "chrono", - "hex", "serde", - "sha2", "uuid", ] diff --git a/atuin-common/Cargo.toml b/atuin-common/Cargo.toml index 34698fe7..17ade596 100644 --- a/atuin-common/Cargo.toml +++ b/atuin-common/Cargo.toml @@ -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" } diff --git a/atuin-common/src/utils.rs b/atuin-common/src/utils.rs index 88cf2ed3..91625a69 100644 --- a/atuin-common/src/utils.rs +++ b/atuin-common/src/utils.rs @@ -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.