Struct nitro_hash::HasherConfig
source · pub struct HasherConfig<'a> {
pub secure: u8,
pub hash_len: u8,
pub salt: &'a str,
pub rihl: usize,
}
Expand description
A inital set up to hash Strings.
Fields§
§secure: u8
§hash_len: u8
§salt: &'a str
§rihl: usize
Implementations§
source§impl HasherConfig<'_>
impl HasherConfig<'_>
sourcepub fn hash(&self, s: &str) -> String
pub fn hash(&self, s: &str) -> String
Mainly hashing strings Here’s a example of it
Examples
use nitro_hash::HasherConfig;
let mut hasher = HasherConfig::new();
hasher.secure = 3; //Default 1, But security increase cause performance decrease linearly
hasher.salt = "Super-Secret-Salt"; //Setting salt
hasher.hash_len = 32; //Length final hashed string Default, 16
println!("{}", hasher.hash("Super-secret-password")); //Hash ///
sourcepub fn new<'a>() -> HasherConfig<'a>
pub fn new<'a>() -> HasherConfig<'a>
Create A new Hasher Config Check the hash function
Trait Implementations§
source§impl<'a> Clone for HasherConfig<'a>
impl<'a> Clone for HasherConfig<'a>
source§fn clone(&self) -> HasherConfig<'a>
fn clone(&self) -> HasherConfig<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more