Done in preparation for adding a `length` field to `Midstate` and also in preparation for removing the `Display` implementation (will be justified in the patch that does it). Currently in the `Debug` impl of `Midstate` we are calling through to `Display` using the alternate form of printing, we can use `as_hex` to achieve almost the same thing. Note that in `LowerHex` we use the `fmt_hex_exact` macro that allows us to reverse the iterator however when we later attempt to use `f.debug_struct` we cannot use the macro. Elect to change the current behaviour to `Debug` forwards, shown by the change to the regression test. |
||
---|---|---|
.. | ||
contrib | ||
embedded | ||
extended_tests/schemars | ||
src | ||
tests | ||
CHANGELOG.md | ||
Cargo.toml | ||
README.md |
README.md
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.
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
.