bech32

Pure Haskell bech32 and bech32m encodings.
git clone git://git.ppad.tech/bech32.git
Log | Files | Refs | README | LICENSE

commit 777e7e7906fc01fa4833c77cc504a017e56aa9b8
parent f22c920f86cb54c786e0ae07a7b11821e1c4f17a
Author: Jared Tobin <jared@jtobin.io>
Date:   Sat, 14 Dec 2024 04:29:27 -0330

meta: comments throughout

Diffstat:
MREADME.md | 9++++++---
Mflake.nix | 2+-
Mlib/Data/ByteString/Base32.hs | 1-
Mppad-bech32.cabal | 2+-
4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md @@ -19,10 +19,13 @@ A sample GHCi session: > bech32m "bc1vys8xarpdejxzunyypmk7uny8qsxy7t5v4ehgunfdenswyuz0e" > - > -- verify a bech32m checksum, given the HRP and data parts - > let dat = "vys8xarpdejxzunyypmk7uny8qsxy7t5v4ehgunfdenswyuz0e" - > Bech32m.verify_checksum "bc" dat + > -- verify that a bech32m string has a valid checksum + > Bech32m.verify bech32 True + > + > -- tweaked stuff will obviously fail to verify (s/m/w below) + > Bech32m.verify "bc1vys8xarpdejxzunyypwk7uny8qsxy7t5v4ehgunfdenswyuz0e" + False ``` ## Performance diff --git a/flake.nix b/flake.nix @@ -1,5 +1,5 @@ { - description = "Pure Haskell bech32m encoding and decoding."; + description = "Pure Haskell bech32m/bech32 encodings."; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; diff --git a/lib/Data/ByteString/Base32.hs b/lib/Data/ByteString/Base32.hs @@ -6,7 +6,6 @@ module Data.ByteString.Base32 ( encode , as_word5 - , as_bech32 , as_base32 -- not actually base32-related, but convenient to put here diff --git a/ppad-bech32.cabal b/ppad-bech32.cabal @@ -11,7 +11,7 @@ build-type: Simple tested-with: GHC == 9.8.1 extra-doc-files: CHANGELOG description: - BIP173 bech32 & BIP350 bech32m encoding/decoding on strict ByteStrings. + BIP173 bech32 & BIP350 bech32m encoding on strict ByteStrings. source-repository head type: git