diff options
Diffstat (limited to '')
| -rw-r--r-- | atuin-common/src/utils.rs (renamed from src/utils.rs) | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils.rs b/atuin-common/src/utils.rs index b395b148..ac5738b3 100644 --- a/src/utils.rs +++ b/atuin-common/src/utils.rs @@ -1,6 +1,7 @@ use crypto::digest::Digest; use crypto::sha2::Sha256; use sodiumoxide::crypto::pwhash::argon2id13; +use uuid::Uuid; pub fn hash_secret(secret: &str) -> String { sodiumoxide::init().unwrap(); @@ -22,3 +23,7 @@ pub fn hash_str(string: &str) -> String { hasher.result_str() } + +pub fn uuid_v4() -> String { + Uuid::new_v4().to_simple().to_string() +} |
