27 releases (14 breaking)

0.15.0 Nov 1, 2024
0.14.0 Mar 25, 2024
0.13.0 Aug 24, 2023
0.12.0 Mar 14, 2023
0.1.0 Dec 8, 2018

#239 in Magic Beans

Download history 138468/week @ 2024-07-23 123989/week @ 2024-07-30 152962/week @ 2024-08-06 164898/week @ 2024-08-13 139689/week @ 2024-08-20 173460/week @ 2024-08-27 180976/week @ 2024-09-03 169014/week @ 2024-09-10 159649/week @ 2024-09-17 174022/week @ 2024-09-24 187088/week @ 2024-10-01 195532/week @ 2024-10-08 199942/week @ 2024-10-15 189909/week @ 2024-10-22 182098/week @ 2024-10-29 201409/week @ 2024-11-05

810,334 downloads per month
Used in 1,422 crates (125 directly)

CC0 license

235KB
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.63.0.

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

~145–315KB