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

#19 in #bitcoin

Download history 130419/week @ 2024-08-02 174888/week @ 2024-08-09 140305/week @ 2024-08-16 160428/week @ 2024-08-23 180417/week @ 2024-08-30 168028/week @ 2024-09-06 160384/week @ 2024-09-13 177063/week @ 2024-09-20 169491/week @ 2024-09-27 203969/week @ 2024-10-04 192841/week @ 2024-10-11 195343/week @ 2024-10-18 185789/week @ 2024-10-25 201440/week @ 2024-11-01 180383/week @ 2024-11-08 151355/week @ 2024-11-15

753,705 downloads per month
Used in 1,443 crates (131 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