2022-09-16 01:52:57 +00:00
|
|
|
[package]
|
|
|
|
name = "bitcoin_hashes"
|
2023-07-14 04:45:33 +00:00
|
|
|
version = "0.13.0"
|
2022-09-16 01:52:57 +00:00
|
|
|
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"]
|
|
|
|
license = "CC0-1.0"
|
2023-05-25 04:11:00 +00:00
|
|
|
repository = "https://github.com/rust-bitcoin/rust-bitcoin"
|
2022-09-16 01:52:57 +00:00
|
|
|
documentation = "https://docs.rs/bitcoin_hashes/"
|
2023-02-02 22:26:22 +00:00
|
|
|
description = "Hash functions used by the rust-bitcoin eccosystem"
|
|
|
|
categories = ["algorithms"]
|
2022-09-16 01:52:57 +00:00
|
|
|
keywords = [ "crypto", "bitcoin", "hash", "digest" ]
|
|
|
|
readme = "README.md"
|
|
|
|
edition = "2018"
|
2023-02-02 22:20:08 +00:00
|
|
|
exclude = ["tests", "contrib"]
|
2022-09-16 01:52:57 +00:00
|
|
|
|
|
|
|
[features]
|
|
|
|
default = ["std"]
|
Add a `bitcoin_io` crate
In order to support standard (de)serialization of structs, the
`rust-bitcoin` ecosystem uses the standard `std::io::{Read,Write}`
traits. This works great for environments with `std`, however sadly
the `std::io` module has not yet been added to the `core` crate.
Thus, in `no-std`, the `rust-bitcoin` ecosystem has historically
used the `core2` crate to provide copies of the `std::io` module
without any major dependencies. Sadly, its one dependency,
`memchr`, recently broke our MSRV.
Worse, because we didn't want to take on any excess dependencies
for `std` builds, `rust-bitcoin` has had to have
mutually-exclusive `std` and `no-std` builds. This breaks general
assumptions about how features work in Rust, causing substantial
pain for applications far downstream of `rust-bitcoin` crates.
Here, we add a new `bitcoin_io` crate, making it an unconditional
dependency and using its `io` module in the in-repository crates
in place of `std::io` and `core2::io`. As it is not substantial
additional code, the `hashes` io implementations are no longer
feature-gated.
This doesn't actually accomplish anything on its own, only adding
the new crate which still depends on `core2`.
2023-10-04 05:51:26 +00:00
|
|
|
std = ["alloc", "hex/std", "bitcoin-io/std"]
|
2023-09-22 02:27:53 +00:00
|
|
|
alloc = ["hex/alloc"]
|
2022-09-16 01:52:57 +00:00
|
|
|
serde-std = ["serde/std"]
|
2023-11-06 19:22:43 +00:00
|
|
|
# If you want I/O you must enable either "std" or "io".
|
|
|
|
io = ["bitcoin-io"]
|
2023-08-11 19:31:20 +00:00
|
|
|
# Smaller (but slower) implementation of sha256, sha512 and ripemd160
|
|
|
|
small-hash = []
|
2022-09-16 01:52:57 +00:00
|
|
|
|
2023-02-02 22:24:48 +00:00
|
|
|
[package.metadata.docs.rs]
|
|
|
|
all-features = true
|
|
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
|
|
|
|
2022-09-16 01:52:57 +00:00
|
|
|
[dependencies]
|
2023-07-21 00:38:34 +00:00
|
|
|
hex = { package = "hex-conservative", version = "0.1.1", default-features = false }
|
2022-09-16 01:52:57 +00:00
|
|
|
|
Add a `bitcoin_io` crate
In order to support standard (de)serialization of structs, the
`rust-bitcoin` ecosystem uses the standard `std::io::{Read,Write}`
traits. This works great for environments with `std`, however sadly
the `std::io` module has not yet been added to the `core` crate.
Thus, in `no-std`, the `rust-bitcoin` ecosystem has historically
used the `core2` crate to provide copies of the `std::io` module
without any major dependencies. Sadly, its one dependency,
`memchr`, recently broke our MSRV.
Worse, because we didn't want to take on any excess dependencies
for `std` builds, `rust-bitcoin` has had to have
mutually-exclusive `std` and `no-std` builds. This breaks general
assumptions about how features work in Rust, causing substantial
pain for applications far downstream of `rust-bitcoin` crates.
Here, we add a new `bitcoin_io` crate, making it an unconditional
dependency and using its `io` module in the in-repository crates
in place of `std::io` and `core2::io`. As it is not substantial
additional code, the `hashes` io implementations are no longer
feature-gated.
This doesn't actually accomplish anything on its own, only adding
the new crate which still depends on `core2`.
2023-10-04 05:51:26 +00:00
|
|
|
bitcoin-io = { version = "0.1", default-features = false, optional = true }
|
|
|
|
|
2023-03-06 22:39:20 +00:00
|
|
|
schemars = { version = "0.8.3", optional = true }
|
2023-02-02 23:28:14 +00:00
|
|
|
# Only enable this if you explicitly do not want to use "std", otherwise enable "serde-std".
|
|
|
|
serde = { version = "1.0", default-features = false, optional = true }
|
2022-09-16 01:52:57 +00:00
|
|
|
|
|
|
|
[dev-dependencies]
|
|
|
|
serde_test = "1.0"
|
|
|
|
serde_json = "1.0"
|