base58

Pure Haskell base58, base58check encoding/decoding (docs.ppad.tech/base58).
git clone git://git.ppad.tech/base58.git
Log | Files | Refs | README | LICENSE

commit 8de88f527e0c87264aecae4f4f0d13c524abf726
parent 9aec2633bffce9944bb9647b58abe5072e5834a8
Author: Jared Tobin <jared@jtobin.io>
Date:   Sun, 28 Dec 2025 12:14:33 -0330

release: v0.2.2

Diffstat:
MCHANGELOG | 3+++
MREADME.md | 32++++++++++++++++----------------
Mflake.lock | 36++++++++++++++++++------------------
Mflake.nix | 10+++++++---
Mppad-base58.cabal | 4++--
5 files changed, 46 insertions(+), 39 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -1,5 +1,8 @@ # Changelog +- 0.2.2 (2025-12-28) + * Adds an 'llvm' build flag and tests with GHC 9.10.3. + - 0.2.1 (2025-06-21) * Minor performance improvements and internal housekeeping. diff --git a/README.md b/README.md @@ -50,30 +50,30 @@ Current benchmark figures on a M4 Silicon MacBook Air look like (use ``` benchmarking ppad-base58/base58/encode/hello world - time 350.3 ns (349.2 ns .. 352.0 ns) - 0.999 R² (0.997 R² .. 1.000 R²) - mean 353.0 ns (351.9 ns .. 354.9 ns) - std dev 4.705 ns (3.411 ns .. 7.449 ns) - variance introduced by outliers: 13% (moderately inflated) + time 364.8 ns (362.4 ns .. 366.2 ns) + 1.000 R² (1.000 R² .. 1.000 R²) + mean 360.4 ns (359.3 ns .. 361.8 ns) + std dev 4.193 ns (3.434 ns .. 5.082 ns) + variance introduced by outliers: 10% (moderately inflated) benchmarking ppad-base58/base58/decode/StV1DL6CwTryKyV - time 377.7 ns (373.7 ns .. 380.7 ns) - 0.999 R² (0.999 R² .. 1.000 R²) - mean 379.4 ns (376.8 ns .. 381.8 ns) - std dev 9.020 ns (7.823 ns .. 10.76 ns) - variance introduced by outliers: 32% (moderately inflated) + time 355.0 ns (352.8 ns .. 358.9 ns) + 1.000 R² (0.999 R² .. 1.000 R²) + mean 360.6 ns (358.6 ns .. 362.2 ns) + std dev 6.168 ns (5.045 ns .. 7.390 ns) + variance introduced by outliers: 20% (moderately inflated) benchmarking ppad-base58/base58check/encode/0x00, hello world - time 1.197 μs (1.195 μs .. 1.200 μs) + time 998.1 ns (996.7 ns .. 999.5 ns) 1.000 R² (1.000 R² .. 1.000 R²) - mean 1.200 μs (1.198 μs .. 1.202 μs) - std dev 7.256 ns (6.187 ns .. 8.819 ns) + mean 999.1 ns (996.2 ns .. 1.002 μs) + std dev 9.393 ns (6.903 ns .. 11.96 ns) benchmarking ppad-base58/base58check/decode/13vQB7B6MrGQZaxCqW9KER - time 1.222 μs (1.218 μs .. 1.225 μs) + time 1.037 μs (1.033 μs .. 1.040 μs) 1.000 R² (1.000 R² .. 1.000 R²) - mean 1.220 μs (1.217 μs .. 1.223 μs) - std dev 9.566 ns (8.250 ns .. 11.28 ns) + mean 1.039 μs (1.038 μs .. 1.041 μs) + std dev 4.926 ns (3.584 ns .. 6.859 ns) ``` You should build with the 'llvm' flag for maximum performance. diff --git a/flake.lock b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1725910328, - "narHash": "sha256-n9pCtzGZ0httmTwMuEbi5E78UQ4ZbQMr1pzi5N0LAG8=", + "lastModified": 1766840161, + "narHash": "sha256-Ss/LHpJJsng8vz1Pe33RSGIWUOcqM1fjrehjUkdrWio=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5775c2583f1801df7b790bf7f7d710a19bac66f4", + "rev": "3edc4a30ed3903fdf6f90c837f961fa6b49582d1", "type": "github" }, "original": { @@ -51,11 +51,11 @@ ] }, "locked": { - "lastModified": 1741625558, - "narHash": "sha256-ZBDXRD5fsVqA5bGrAlcnhiu67Eo50q0M9614nR3NBwY=", + "lastModified": 1766934151, + "narHash": "sha256-BUFpuLfrGXE2xi3Wa9TYCEhhRhFp175Ghxnr0JRbG2I=", "ref": "master", - "rev": "fb63457f2e894eda28250dfe65d0fcd1d195ac2f", - "revCount": 24, + "rev": "58dfb7922401a60d5de76825fcd5f6ecbcd7afe0", + "revCount": 26, "type": "git", "url": "git://git.ppad.tech/base16.git" }, @@ -71,11 +71,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1737297101, - "narHash": "sha256-EnXnq+JLflbWt+DvaGGnY2gfAqsGNOm5vPgHh3hkfwQ=", + "lastModified": 1766932084, + "narHash": "sha256-GvVsbTfW+B7IQ9K/QP2xcXJAm1lhBin1jYZWNjOzT+o=", "ref": "master", - "rev": "f29823875250bc99b3891f7373535ccde9a29a44", - "revCount": 1, + "rev": "353e61763b959b960a55321a85423501e3e9ed7a", + "revCount": 2, "type": "git", "url": "git://git.ppad.tech/nixpkgs.git" }, @@ -105,11 +105,11 @@ ] }, "locked": { - "lastModified": 1766435555, - "narHash": "sha256-ysN0iRuBLSQrgWU3rCFUyq0NvRpug6DTBRZSlWbmI1A=", + "lastModified": 1766934663, + "narHash": "sha256-QFHvRxg/AN9/FHF9EyVui1os0sTxpawzsmxcHqcdhoc=", "ref": "master", - "rev": "a4c17689cd66e1ef35c667914765cb24c9a4b305", - "revCount": 96, + "rev": "0d9a7a2f83fc95bf3ac1d335d1c0237d397e44bc", + "revCount": 98, "type": "git", "url": "git://git.ppad.tech/sha256.git" }, diff --git a/flake.nix b/flake.nix @@ -33,9 +33,13 @@ pkgs = import nixpkgs { inherit system; }; hlib = pkgs.haskell.lib; - llvm = pkgs.llvmPackages_15.llvm; + llvm = pkgs.llvmPackages_19.llvm; base16 = ppad-base16.packages.${system}.default; + base16-llvm = + hlib.addBuildTools + (hlib.enableCabalFlag base16 "llvm") + [ llvm ]; sha256 = ppad-sha256.packages.${system}.default; sha256-llvm = @@ -43,8 +47,8 @@ (hlib.enableCabalFlag sha256 "llvm") [ llvm ]; - hpkgs = pkgs.haskell.packages.ghc981.extend (new: old: { - ppad-base16 = base16; + hpkgs = pkgs.haskell.packages.ghc910.extend (new: old: { + ppad-base16 = base16-llvm; ppad-sha256 = sha256-llvm; ${lib} = new.callCabal2nixWithOptions lib ./. "--enable-profiling" { ppad-base16 = new.ppad-base16; diff --git a/ppad-base58.cabal b/ppad-base58.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: ppad-base58 -version: 0.2.1 +version: 0.2.2 synopsis: base58 and base58check encoding/decoding. license: MIT license-file: LICENSE @@ -8,7 +8,7 @@ author: Jared Tobin maintainer: jared@ppad.tech category: Cryptography build-type: Simple -tested-with: GHC == 9.8.1 +tested-with: GHC == 9.10.3 extra-doc-files: CHANGELOG description: base58 and base58check encoding/decoding on strict bytestrings.