Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cargo.lock
target/
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1.0.0-rc.0 - 2025-03-25

- Add two crate level decoding functions (for `Vec` and const generic arrays)
- Rename the error types to convey purpose rather than type they are decoding
- Add `newer-rust-version` feature to enable `core::error::Error`
- Remove everything except the decoding functions and associated error types, so that types can be stabilized quickly
- Prepare the crate for stabilization!!!

# 0.3.0 - 2024-09-18

- Re-implement `HexWriter` [#113](https://github.com/rust-bitcoin/hex-conservative/pull/113)
Expand Down
11 changes: 10 additions & 1 deletion Cargo-minimal.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@ version = 3

[[package]]
name = "hex-conservative"
version = "0.3.0"
version = "1.0.0-rc.0"
dependencies = [
"if_rust_version",
]

[[package]]
name = "if_rust_version"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46dbcb333e86939721589d25a3557e180b52778cb33c7fdfe9e0158ff790d5ec"
11 changes: 10 additions & 1 deletion Cargo-recent.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@ version = 3

[[package]]
name = "hex-conservative"
version = "0.3.0"
version = "1.0.0-rc.0"
dependencies = [
"if_rust_version",
]

[[package]]
name = "if_rust_version"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46dbcb333e86939721589d25a3557e180b52778cb33c7fdfe9e0158ff790d5ec"
7 changes: 0 additions & 7 deletions Cargo.lock

This file was deleted.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hex-conservative"
version = "0.3.0"
version = "1.0.0-rc.0"
authors = ["Martin Habovštiak <[email protected]>", "Andrew Poelstra <[email protected]>"]
license = "CC0-1.0"
repository = "https://github.com/rust-bitcoin/hex-conservative"
Expand All @@ -19,10 +19,13 @@ rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["std"]
# Activates the usage of standard library, namely implementations of std::error::Error
std = ["alloc"]
# Activates the usage of standard alloc library (enables Vec<u8>)
alloc = []
# Enables detection of newer rust versions to provide additional features
# Turning it on may pull in dependencies that run build scripts and prolong compile time.
newer-rust-version = ["dep:if_rust_version"]

[dependencies]


[dev-dependencies]
if_rust_version = { version = "1.0.0", optional = true }
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,51 @@
# Bitcoin Hexadecimal Library
# A Rust hexadecimal decoding library

General purpose hex encoding/decoding library with a conservative MSRV and dependency policy.
General purpose hex decoding library with a conservative MSRV and dependency policy.

You're currently looking at the stable crate which has advanced features removed to make
stabilization quicker and thus allowing downstream crates to stabilize quicker too. To get the
full feature set check the lower (0.x.y) versions.

## Stabilization strategy

Because downstream crates may need to return hex errors in their APIs and they need to be
stabilized soon, this crate only exposes the errors and two basic decoding functions. This
should already help with the vast majority of the cases and we're sufficiently confident that
these errors won't have a breaking change any time soon (possibly never).

If you're writing a binary you don't need to worry about any of this and just use the unstable
version for now. If you're writing a library you should use these stable errors in the API but
you may internally depend on the unstable crate version to get the advanced features that won't
affect your API. This way your API can stabilize before all features in this crate are fully
stable and you still can use all of them.

## Crate features

* `std` - enables the standard library, on by default.
* `alloc` - enables features that require allocation such as decoding into `Vec<u8>`, implied
by `std`.
* `newer-rust-version` - enables Rust version detection and thus newer features, may add
dependency on a feature detection crate to reduce compile times. This
feature is expected to do nothing once the native detection is in Rust
and our MSRV is at least that version. We may also remove the feature
gate in 2.0 with semver trick once that happens.

## MSRV policy

The MSRV of the crate is currently 1.63.0 and we don't intend to bump it until the newer Rust
version is at least two years old and also included in Debian stable (1.63 is in Debian 12 at
the moment).

Note though that the dependencies may have looser policy. This is not considered breaking/wrong
- you would just need to pin them in `Cargo.lock` (not `.toml`).

## Minimum Supported Rust Version (MSRV)

This library should compile with almost any combination of features on **Rust 1.63.0**, however we
reserve the right to use features to guard compiler specific code so `--all-features` may not work
using the MSRV toolchain.

### Githooks
## 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
Expand Down
Loading