26 releases (13 breaking)

0.14.0 Mar 25, 2024
0.13.0 Aug 24, 2023
0.12.0 Mar 14, 2023
0.11.0 Jun 27, 2022
0.1.0 Dec 8, 2018

#1239 in Magic Beans

Download history 33064/week @ 2023-12-23 51683/week @ 2023-12-30 78291/week @ 2024-01-06 83695/week @ 2024-01-13 92488/week @ 2024-01-20 95457/week @ 2024-01-27 89845/week @ 2024-02-03 101093/week @ 2024-02-10 105322/week @ 2024-02-17 97654/week @ 2024-02-24 102574/week @ 2024-03-02 109159/week @ 2024-03-09 124511/week @ 2024-03-16 126917/week @ 2024-03-23 148439/week @ 2024-03-30 121697/week @ 2024-04-06

539,915 downloads per month
Used in 1,191 crates (118 directly)

CC0 license

215KB
4.5K SLoC

Bitcoin Hashes Library

This is a simple, no-dependency library which implements the hash functions needed by Bitcoin. These are SHA1, SHA256, SHA256d, SHA512, and RIPEMD160. As an ancillary thing, it exposes hexadecimal serialization and deserialization, since these are needed to display hashes anway.

Documentation

Minimum Supported Rust Version (MSRV)

This library should always compile with any combination of features on Rust 1.56.1.

Contributions

Contributions are welcome, including additional hash function implementations.

Githooks

To assist devs in catching errors before running CI we provide some githooks. If you do not already have locally configured githooks you can use the ones in this repository by running, in the root directory of the repository:

git config --local core.hooksPath githooks/

Alternatively add symlinks in your .git/hooks directory to any of the githooks we provide.

Running Benchmarks

We use a custom Rust compiler configuration conditional to guard the bench mark code. To run the bench marks use: RUSTFLAGS='--cfg=bench' cargo +nightly bench.

Dependencies

~115–430KB