Crate sha2_hasher

Crate sha2_hasher 

Source
Expand description

A trait extension for hashing files with SHA-2 algorithms.

This crate provides the Sha2Hasher trait, which adds sha224, sha256, sha384, and sha512 methods to any type implementing AsRef<Path>.

§Features

One of the following features must be enabled:

  • async - Async implementation using tokio
  • sync - Blocking implementation

These features are mutually exclusive.

§Example

use sha2_hasher::Sha2Hasher;

let hash = std::path::Path::new("Cargo.toml").sha256().await.unwrap();
println!("{hash}");

Traits§

Sha2Hasher