#hash #digest #operating-system #crypto

crypto-hash

A wrapper for OS-level cryptographic hash functions

7 releases

Uses old Rust 2015

0.3.4 Aug 18, 2019
0.3.3 Dec 20, 2018
0.3.1 Mar 5, 2018
0.3.0 Jun 18, 2017
0.1.0 Jun 27, 2016

#809 in Cryptography

Download history 6190/week @ 2023-12-01 5758/week @ 2023-12-08 4902/week @ 2023-12-15 3069/week @ 2023-12-22 4117/week @ 2023-12-29 5308/week @ 2024-01-05 4946/week @ 2024-01-12 4925/week @ 2024-01-19 4724/week @ 2024-01-26 4999/week @ 2024-02-02 5041/week @ 2024-02-09 4827/week @ 2024-02-16 4654/week @ 2024-02-23 5612/week @ 2024-03-01 5249/week @ 2024-03-08 4206/week @ 2024-03-15

20,632 downloads per month
Used in 99 crates (29 directly)

MIT license

23KB
266 lines

crypto-hash

Linux/OS X Status Windows status Crates.io

crypto-hash is a Rust wrapper around OS-level implementations of cryptographic hash functions.

The purpose of this crate is to provide access to hash algorithms with as few dependencies as possible. This means that when possible, the library uses the hashing functions that are provided by the given operating system's bundled cryptographic libraries.

Supported Implementations

By operating system:

Supported Algorithms

  • MD5
  • SHA1
  • SHA256
  • SHA512

Usage

Add crypto-hash to your project's Cargo.toml. For more details, consult the Cargo guide.

Example:

use crypto_hash::{Algorithm, hex_digest};

let digest = hex_digest(Algorithm::SHA256, b"crypto-hash");

For more examples, consult the documentation.

Release Notes

Contributing

Acknowledgements

This crate was inspired by rust-native-tls and crypto-bench.

crypto-hash is copyrighted under the terms of the MIT license. See LICENSE for details.

Dependencies

~24–690KB
~12K SLoC