#utilities #crypto #jwt #hash #sha

yanked rust_utilities

Utilities for Rust

0.2.0 Apr 22, 2022
0.1.0 Apr 22, 2022

#7 in #jsonwebtoken

MIT license

11KB
145 lines

Utilities for Rust

Importing

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"

How to use?

Compute Sha hash

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`

lib.rs:

Importing

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"

How to use?

Compute Sha hash

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`

Dependencies

~0.3–4MB
~84K SLoC