happy-cracking 0.5.0

A fast, comprehensive CTF toolkit for cryptographic encoding/decoding, classic ciphers, hash operations, and analysis tools
Documentation
use happy_cracking::crypto::hash;

#[test]
fn test_md5() {
    assert_eq!(hash::md5_hash("hello"), "5d41402abc4b2a76b9719d911017c592");
}

#[test]
fn test_sha1() {
    assert_eq!(
        hash::sha1_hash("hello"),
        "aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d"
    );
}

#[test]
fn test_sha256() {
    assert_eq!(
        hash::sha256_hash("hello"),
        "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
    );
}

#[test]
fn test_sha512() {
    assert_eq!(
        hash::sha512_hash("hello"),
        "9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043"
    );
}

#[test]
fn test_empty_string() {
    assert_eq!(hash::md5_hash(""), "d41d8cd98f00b204e9800998ecf8427e");
}