Crates.io | rust_utilities |
lib.rs | rust_utilities |
version | 0.2.0 |
source | src |
created_at | 2022-04-22 19:54:16.173309 |
updated_at | 2022-04-22 20:55:08.809523 |
description | Utilities for Rust |
homepage | https://github.com/MedzikUser/rust-utilities |
repository | https://github.com/MedzikUser/rust-utilities.git |
max_upload_size | |
id | 572347 |
size | 12,887 |
The driver is available on crates.io. To use the driver in
your application, simply add it to your project's Cargo.toml
.
[dependencies]
rust_utilities = "0.2.0"
Add sha
features
[dependencies.rust_utilities]
version = "0.2.0"
features = ["sha"]
Quick and easy sha1, sha256 and sha512 hash calculation.
use rust_utilities::crypto::sha::{Algorithm, CryptographicHash};
let text = "test" // &str
let hash = hex::encode(CryptographicHash::hash(Algorithm::SHA1, text.as_bytes())); // String
println!("Output hash: {}", hash); // output: `a94a8fe5ccb19ba61c4c0873d391e987982fbbd3`