From 4cec85862c7900018742abab305630e6b6336705 Mon Sep 17 00:00:00 2001 From: nikola-bozin-org Date: Wed, 22 May 2024 09:37:39 +0200 Subject: [PATCH] add clone trait --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- Cargo.toml | 2 +- src/lib.rs | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f356eaf..da216f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.1.1 + +Add Clone trait to EncryptionData and PasswordEncryptor + # 1.1.0 Encryption data is now &str instead of String. \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index df39e27..d6ead8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -89,7 +89,7 @@ checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "password-encryptor" -version = "1.1.0" +version = "1.1.1" dependencies = [ "base64-url", "hmac", diff --git a/Cargo.toml b/Cargo.toml index c8ab14a..559b1ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "password-encryptor" -version = "1.1.0" +version = "1.1.1" edition = "2021" description = "A helper crate for encrypting and validating password" license = "MIT" diff --git a/src/lib.rs b/src/lib.rs index 4e0e70c..7615427 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,11 +4,14 @@ use error::{Error, Result}; use hmac::{Hmac, Mac}; use sha2::Sha512; + +#[derive(Clone)] pub struct EncryptionData<'a> { pub content: &'a str, pub salt: &'a str, } +#[derive(Clone)] pub struct PasswordEncryptor<'a> { key: &'a [u8], encryption_prefix: Option<&'a str>,