| Crates.io | easy_salt |
| lib.rs | easy_salt |
| version | 0.3.0 |
| created_at | 2024-12-14 17:17:43.39318+00 |
| updated_at | 2024-12-21 11:39:29.932607+00 |
| description | Simple crate for generating hashed strings with salt, currently based on easy-hasher crate |
| homepage | |
| repository | https://github.com/DarkEclipse847/easy_salt |
| max_upload_size | |
| id | 1483274 |
| size | 28,057 |
This is a simple crate providing salt for commonly used hashing algorithms.
This crate will give you opportunity to generate tuple of type (hash, salt) for your needs.
All of the code was written on Android phone using Termux. :)
Unchecked algorithms will be added soon
extern crate easy_salt;
use easy_salt::salty_sha::*;
fn main(){
let length: u64 = 8;
let hash = salty_sha256("hello", length);
println!("Hash: {:?}, Salt: {:?}", hash.0, hash.1);
let another_hash = salty_sha256("hello", length);
println!("Second Hash: {:?}, Second salt: {:?}", another_hash.0, another_hash.1);
assert_ne!(hash.0, another_hash.0);
}
There is a plan to change logic so instead of tuple functions will return struct with fields hash and salt respectfully for better readability.