pub struct CryptoService { /* private fields */ }Implementations§
Source§impl CryptoService
impl CryptoService
pub fn new(key: &[u8; 32]) -> Result<Self>
pub fn sha_hash(&self, data: &str) -> Result<String>
pub fn verify_sha_hash(&self, data: &str, hash: &str) -> Result<bool>
pub fn encrypt_text(&self, text: &str) -> Result<String>
pub fn decrypt_text(&self, encrypted_text: &str) -> Result<String>
pub async fn argon2_hash(&self, data: &str) -> Result<String>
pub async fn verify_argon2_hash(&self, data: &str, hash: &str) -> Result<bool>
pub async fn sha_file_hash(&self, path: &str) -> Result<String>
pub async fn verify_sha_file_hash(&self, path: &str, hash: &str) -> Result<bool>
pub async fn argon2_file_hash(&self, path: &str) -> Result<String>
pub async fn verify_argon2_file_hash( &self, path: &str, hash: &str, ) -> Result<bool>
pub async fn encrypt_file(&self, path: &str) -> Result<String>
pub async fn decrypt_file(&self, path: &str) -> Result<String>
Trait Implementations§
Source§impl Clone for CryptoService
impl Clone for CryptoService
Source§fn clone(&self) -> CryptoService
fn clone(&self) -> CryptoService
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CryptoService
impl RefUnwindSafe for CryptoService
impl Send for CryptoService
impl Sync for CryptoService
impl Unpin for CryptoService
impl UnsafeUnpin for CryptoService
impl UnwindSafe for CryptoService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more