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

#1235 in Magic Beans

Download history 63903/week @ 2024-01-02 79302/week @ 2024-01-09 88841/week @ 2024-01-16 93005/week @ 2024-01-23 93746/week @ 2024-01-30 91625/week @ 2024-02-06 102935/week @ 2024-02-13 103670/week @ 2024-02-20 98949/week @ 2024-02-27 100809/week @ 2024-03-05 112190/week @ 2024-03-12 132250/week @ 2024-03-19 124902/week @ 2024-03-26 151102/week @ 2024-04-02 147471/week @ 2024-04-09 112916/week @ 2024-04-16

562,947 downloads per month
Used in 1,195 crates (120 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–435KB