rust-bitcoin-unsafe-fast/hashes
Andrew Poelstra 2bd1e731b8
Merge rust-bitcoin/rust-bitcoin#2104: Add wasm dev-deps using CI script
685e5101ce Add wasm dev-deps using CI script (Tobin C. Harding)

Pull request description:

  We only test WASM in CI using a stable toolchain however because we have a target specific dev-dependencies section the wasm deps get pulled in during MSRV builds - this breaks the MSRV build.

  Instead of including WASM dev-dependencies in the manifest we can dynamically modify the manifest when running the WASM tests. We do this already to add the `crate-type` section so this is not really that surprising to see in the CI script.

  Doing so allows us to stop pinning the transitive `syn` dependency also which is included in the dependency graph because of `wasm-bingen-test`.

  Originally part of #2093

ACKs for top commit:
  apoelstra:
    ACK 685e5101ce
  sanket1729:
    ACK 685e5101ce. Removing wasm from lock-files is a win

Tree-SHA512: ad607a8a8af329e9830d9284a95a2540bf15a2ceda826b8d1c0312ee094f1f5f54599ee2faa6b611439997c349bdd9a29e6d5ae447bff96a9a538753434e2248
2023-10-06 20:18:32 +00:00
..
contrib Add wasm dev-deps using CI script 2023-10-05 11:16:24 +11:00
embedded hashes/embedded: Add script dir and README 2023-07-18 10:27:48 +10:00
extended_tests/schemars schemars: Add pinning docs 2023-07-18 10:27:48 +10:00
src Make error types uniform 2023-10-04 15:15:52 +11:00
CHANGELOG.md hashes: Remove duplicate entry 2023-09-07 14:19:01 -04:00
Cargo.toml Add wasm dev-deps using CI script 2023-10-05 11:16:24 +11:00
README.md hashes: Remove stale status badge 2023-05-25 14:34:28 +10:00

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 ancilliary 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.48.0.

To build with the MSRV you will need to pin serde (if you have either the serde or the schemars feature enabled)

# serde 1.0.157 uses syn 2.0 which requires edition 2021
cargo update -p serde --precise 1.0.156

before building. (And if your code is a library, your downstream users will need to run these commands, and so on.)

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.