| Crates.io | identyhash |
| lib.rs | identyhash |
| version | 0.1.0 |
| created_at | 2025-01-17 19:03:00.908404+00 |
| updated_at | 2025-01-17 19:03:00.908404+00 |
| description | A CLI tool to identify hash types. |
| homepage | |
| repository | https://github.com/TrixSec/identyhash |
| max_upload_size | |
| id | 1520900 |
| size | 9,084 |
IdentYhash is a Rust-based library for identifying various cryptographic hash types. It supports common hashing algorithms such as MD5, SHA-1, SHA-256, bcrypt, and more. This crate is useful for developers or security professionals who need to quickly identify the hash type of a given string.
Current Version: 0.1.0 Author: Trix Cyrus Copyright: © 2024 Trixsec Org Maintained: Yes
To use IdentYhash in your project, add it to your Cargo.toml:
[dependencies]
identyhash = "0.1.0"
Here is an example of how to use IdentYhash to identify a hash:
use identyhash::identify_hash;
let hash = "d41d8cd98f00b204e9800998ecf8427e"; // MD5 hash
let result = identify_hash(hash);
println!("Hash type: {}", result);
This will output:
Hash type: MD5
identify_hash(hash: &str) -> &strThis function identifies the hash type of a given hash string. It recognizes multiple common hash types based on the hash length and format.
hash: A string slice that holds the hash to identify.let hash = "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8"; // SHA-1 hash
let result = identify_hash(hash);
println!("{}", result); // Output: SHA-1
read_hashes_from_file(file_path: &str) -> io::Result<()>This function reads a file containing hashes, identifies each hash's type, and prints the result to the console.
file_path: The path to the file containing hashes, each hash on a new line.Ok(()) if the function succeeds, or an Err if there is an error (e.g., file not found).read_hashes_from_file("hashes.txt").unwrap();
The following hash types are recognized by IdentYhash:
$2a$, $2b$, or $2y$.$P$.$apr1$.This project is licensed under the MIT License - see the LICENSE file for details.