Struct short_crypt::ShortCrypt
source · pub struct ShortCrypt { /* private fields */ }
Implementations§
source§impl ShortCrypt
impl ShortCrypt
sourcepub fn new<S: AsRef<str>>(key: S) -> ShortCrypt
pub fn new<S: AsRef<str>>(key: S) -> ShortCrypt
Create a new ShortCrypt instance.
pub fn encrypt<T: ?Sized + AsRef<[u8]>>(&self, plaintext: &T) -> Cipher
pub fn decrypt(&self, data: &Cipher) -> Result<Vec<u8>, &'static str>
pub fn encrypt_to_url_component<T: ?Sized + AsRef<[u8]>>( &self, data: &T ) -> String
pub fn encrypt_to_url_component_and_push_to_string<T: ?Sized + AsRef<[u8]>, S: Into<String>>( &self, data: &T, output: S ) -> String
pub fn decrypt_url_component<S: AsRef<str>>( &self, url_component: S ) -> Result<Vec<u8>, &'static str>
pub fn decrypt_url_component_and_push_to_vec<S: AsRef<str>>( &self, url_component: S, output: Vec<u8> ) -> Result<Vec<u8>, &'static str>
pub fn encrypt_to_qr_code_alphanumeric<T: ?Sized + AsRef<[u8]>>( &self, data: &T ) -> String
pub fn encrypt_to_qr_code_alphanumeric_and_push_to_string<T: ?Sized + AsRef<[u8]>, S: Into<String>>( &self, data: &T, output: S ) -> String
pub fn decrypt_qr_code_alphanumeric<S: AsRef<str>>( &self, qr_code_alphanumeric: S ) -> Result<Vec<u8>, &'static str>
pub fn decrypt_qr_code_alphanumeric_and_push_to_vec<S: AsRef<str>>( &self, qr_code_alphanumeric: S, output: Vec<u8> ) -> Result<Vec<u8>, &'static str>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ShortCrypt
impl Send for ShortCrypt
impl Sync for ShortCrypt
impl Unpin for ShortCrypt
impl UnwindSafe for ShortCrypt
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