easy_salt

Crates.ioeasy_salt
lib.rseasy_salt
version0.3.0
created_at2024-12-14 17:17:43.39318+00
updated_at2024-12-21 11:39:29.932607+00
descriptionSimple crate for generating hashed strings with salt, currently based on easy-hasher crate
homepage
repositoryhttps://github.com/DarkEclipse847/easy_salt
max_upload_size
id1483274
size28,057
(DarkEclipse847)

documentation

https://docs.rs/easy_salt

README

easy_salt 0.3.0

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. :)

List of hashing algorithms

Unchecked algorithms will be added soon

  • SHA:
    • sha-1
    • sha-224
    • sha-256
    • sha-384
    • sha-512
    • sha3-224
    • sha3-256
    • sha3-384
    • sha3-512
  • MD:
    • md2
    • md4
    • md5
  • Bcrypt
  • Argon2:
    • Argon2d
    • Argon2i
    • Argon2id

Example

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.

Commit count: 10

cargo fmt