#cryptocurrency #codec #base32 #bitcoin #encoding

no-std bech32

Encodes and decodes the Bech32 format and implements the bech32 and bech32m checksums

22 releases

0.11.0 Feb 23, 2024
0.10.0-beta2 Jan 16, 2024
0.10.0-beta Oct 9, 2023
0.9.1 Aug 12, 2022
0.2.1 May 17, 2017

#4 in #cryptocurrency

Download history 127370/week @ 2024-07-21 127256/week @ 2024-07-28 135569/week @ 2024-08-04 143961/week @ 2024-08-11 146950/week @ 2024-08-18 144534/week @ 2024-08-25 159361/week @ 2024-09-01 149924/week @ 2024-09-08 143447/week @ 2024-09-15 148638/week @ 2024-09-22 156177/week @ 2024-09-29 161081/week @ 2024-10-06 165082/week @ 2024-10-13 161441/week @ 2024-10-20 158622/week @ 2024-10-27 143910/week @ 2024-11-03

636,466 downloads per month
Used in 2,153 crates (209 directly)

MIT license

180KB
3K SLoC

Rust Bech32

Docs.rs badge Continuous Integration

Rust implementation of the Bech32 encoding format described in BIP-0173 and Bech32m encoding format described in BIP-0350.

You can find some usage examples in the documentation.

Bitcoin-specific address encoding is handled by the bitcoin-bech32 crate.

MSRV

This library should always compile with any combination of features on Rust 1.48.0.

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.

Benchmarks

We use a custom Rust compiler configuration conditional to guard the benchmark code. To run the benchmarks use: RUSTFLAGS='--cfg=bench' cargo +nightly bench.

API changes

All PRs that change the public API of rust-bech32 must include a patch to the api/ text files. For PRs that include API changes, add a separate patch to the PR that is the diff created by running contrib/check-for-api-changes.sh.

No runtime deps

Features