{"id":26933553,"url":"https://github.com/ppad-tech/bech32","last_synced_at":"2025-04-02T09:19:35.594Z","repository":{"id":268094935,"uuid":"902915344","full_name":"ppad-tech/bech32","owner":"ppad-tech","description":"(mirror of https://git.ppad.tech/bech32)","archived":false,"fork":false,"pushed_at":"2025-02-28T05:40:00.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T12:47:52.995Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppad-tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-13T14:31:08.000Z","updated_at":"2025-02-28T05:40:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"0e673d01-187c-4dc0-aaf7-c43c23406ff5","html_url":"https://github.com/ppad-tech/bech32","commit_stats":null,"previous_names":["ppad-tech/bech32"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fbech32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fbech32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fbech32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fbech32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppad-tech","download_url":"https://codeload.github.com/ppad-tech/bech32/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246785456,"owners_count":20833498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-02T09:19:35.095Z","updated_at":"2025-04-02T09:19:35.587Z","avatar_url":"https://github.com/ppad-tech.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bech32\n\n[![](https://img.shields.io/hackage/v/ppad-bech32?color=blue)](https://hackage.haskell.org/package/ppad-bech32)\n![](https://img.shields.io/badge/license-MIT-brightgreen)\n[![](https://img.shields.io/badge/haddock-bech32-lightblue)](https://docs.ppad.tech/bech32)\n\nA pure Haskell implementation of bech32m and bech32 encoding/decoding on\nstrict ByteStrings, as specified by [BIP350][bi350] and [BIP173][bi173].\n\n## Usage\n\nA sample GHCi session:\n\n```\n  \u003e :set -XOverloadedStrings\n  \u003e\n  \u003e -- import qualified\n  \u003e import qualified Data.ByteString.Bech32m as Bech32m\n  \u003e\n  \u003e -- create a bech32m-encoded string using a human-readable part (HRP)\n  \u003e -- and some input\n  \u003e let Just bech32m = Bech32m.encode \"bc\" \"a standard word8 bytestring\"\n  \u003e bech32m\n  \"bc1vys8xarpdejxzunyypmk7uny8qsxy7t5v4ehgunfdenswyuz0e\"\n  \u003e\n  \u003e -- verify that a bech32m string has a valid checksum\n  \u003e Bech32m.verify bech32\n  True\n  \u003e\n  \u003e -- tweaked stuff will obviously fail to verify (s/m/w below)\n  \u003e Bech32m.verify \"bc1vys8xarpdejxzunyypwk7uny8qsxy7t5v4ehgunfdenswyuz0e\"\n  False\n  \u003e\n  \u003e -- decode bech32m-encoded input\n  \u003e Bech32m.decode bech32m\n  Just (\"bc\",\"a standard word8 bytestring\")\n```\n\n## Documentation\n\nHaddocks (API documentation, etc.) are hosted at\n[docs.ppad.tech/bech32](https://docs.ppad.tech/bech32).\n\n## Performance\n\nThe aim is best-in-class performance for pure, highly-auditable Haskell\ncode. At present we're a little over twice as fast as the official\nBIP173 reference implementation.\n\nCurrent benchmark figures on a relatively-beefy NixOS VPS look like (use\n`cabal bench` to run the benchmark suite):\n\n```\n  benchmarking benchmarks/ppad-bech32/bech32 encode/120b\n  time                 1.126 μs   (1.115 μs .. 1.136 μs)\n                       0.999 R²   (0.999 R² .. 1.000 R²)\n  mean                 1.132 μs   (1.125 μs .. 1.140 μs)\n  std dev              26.29 ns   (21.47 ns .. 31.93 ns)\n  variance introduced by outliers: 29% (moderately inflated)\n\n  benchmarking benchmarks/ppad-bech32/bech32 decode/120b\n  time                 1.293 μs   (1.281 μs .. 1.308 μs)\n                       0.999 R²   (0.999 R² .. 1.000 R²)\n  mean                 1.280 μs   (1.274 μs .. 1.290 μs)\n  std dev              24.47 ns   (18.39 ns .. 33.71 ns)\n  variance introduced by outliers: 21% (moderately inflated)\n\n  benchmarking benchmarks/reference/bech32 encode/120b\n  time                 2.897 μs   (2.865 μs .. 2.920 μs)\n                       0.999 R²   (0.999 R² .. 1.000 R²)\n  mean                 2.828 μs   (2.806 μs .. 2.856 μs)\n  std dev              81.33 ns   (70.94 ns .. 97.46 ns)\n  variance introduced by outliers: 36% (moderately inflated)\n```\n\n## Security\n\nThis library aims at the maximum security achievable in a\ngarbage-collected language under an optimizing compiler such as GHC, in\nwhich strict constant-timeness can be challenging to achieve.\n\nIf you discover any vulnerabilities, please disclose them via\nsecurity@ppad.tech.\n\n## Development\n\nYou'll require [Nix][nixos] with [flake][flake] support enabled. Enter a\ndevelopment shell with:\n\n```\n$ nix develop\n```\n\nThen do e.g.:\n\n```\n$ cabal repl ppad-bech32\n```\n\nto get a REPL for the main library.\n\n## Attribution\n\nThe base32 implementation used internally is more or less a pure\ntranslation of the [base32][bas32] package on Hackage.\n\n[nixos]: https://nixos.org/\n[flake]: https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html\n[bi173]: https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki\n[bi350]: https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki\n[bas32]: https://hackage.haskell.org/package/base32\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppad-tech%2Fbech32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppad-tech%2Fbech32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppad-tech%2Fbech32/lists"}