{"id":19783683,"url":"https://github.com/intersectmbo/bech32","last_synced_at":"2025-12-11T23:16:10.507Z","repository":{"id":46226526,"uuid":"211222119","full_name":"IntersectMBO/bech32","owner":"IntersectMBO","description":"Haskell implementation of the Bech32 address format (BIP 0173).","archived":false,"fork":false,"pushed_at":"2024-02-23T08:40:00.000Z","size":12684,"stargazers_count":41,"open_issues_count":7,"forks_count":13,"subscribers_count":44,"default_branch":"master","last_synced_at":"2024-04-10T09:06:21.957Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IntersectMBO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-09-27T02:43:31.000Z","updated_at":"2024-04-24T06:59:50.733Z","dependencies_parsed_at":"2024-01-16T00:38:50.865Z","dependency_job_id":"f269ce95-4549-4e00-b913-a6c8fe4e87e9","html_url":"https://github.com/IntersectMBO/bech32","commit_stats":null,"previous_names":["input-output-hk/bech32"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fbech32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fbech32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fbech32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fbech32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IntersectMBO","download_url":"https://codeload.github.com/IntersectMBO/bech32/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251791631,"owners_count":21644434,"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":"2024-11-12T06:08:59.369Z","updated_at":"2025-12-11T23:16:10.471Z","avatar_url":"https://github.com/IntersectMBO.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://hackage.haskell.org/package/bech32\"\u003e\u003cimg src=\"https://img.shields.io/hackage/v/bech32?style=for-the-badge\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/input-output-hk/bech32/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/input-output-hk/bech32.svg?style=for-the-badge\" /\u003e\u003c/a\u003e\n\n## `bech32` command-line\n\nA small executable is available for rapid conversion in the console. You can obtain a pre-compiled `bech32` binary for Linux, macOS, and Windows as part of the [`cardano-wallet` Releases](https://github.com/input-output-hk/cardano-wallet/releases).\n\n```console\nUsage: bech32 [PREFIX]\n  Convert to and from bech32 strings. Data are read from standard input.\n\nAvailable options:\n  -h,--help                Show this help text\n  PREFIX                   An optional human-readable prefix (e.g. 'addr').\n                             - When provided, the input text is decoded from\n                               various encoding formats and re-encoded to\n                               bech32 using the given prefix.\n                             - When omitted, the input text is decoded from\n                               bech32 to base16.\n  -v,--version             output version information and exit\n\nSupported encoding formats: Base16, Bech32 \u0026 Base58.\n```\n\n### Examples\n\n#### To Bech32:\n\n```console\n$ bech32 base16_ \u003c\u003c\u003c 706174617465\nbase16_1wpshgct5v5r5mxh0\n\n$ bech32 base58_ \u003c\u003c\u003c Ae2tdPwUPEYy\nbase58_1p58rejhd9592uusa8pzj2\n\n$ bech32 new_prefix \u003c\u003c\u003c old_prefix1wpshgcg2s33x3\nnew_prefix1wpshgcgeak9mv\n```\n\n#### From Bech32\n\n```console\n$ bech32 \u003c\u003c\u003c base16_1wpshgct5v5r5mxh0\n706174617465\n```\n\n## Bech32 Haskell Libraries\n\nThe repository provides [Haskell](https://www.haskell.org/) libraries for\nworking with the **Bech32** address format, as specified by\n[BIP-0173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki).\n\nThere are **two** libraries provided:\n\n* [`bech32`](http://hackage.haskell.org/package/bech32)\n\n    Core primitives for encoding and decoding Bech32 strings.\n\n* [`bech32-th`](http://hackage.haskell.org/package/bech32-th)\n\n    Template-Haskell specific extensions, including quasiquoters\n    for compile-time parsing of string literals.\n\n## Contents\n\n   * [Documentation](#documentation)\n   * [Usage](#usage)\n      * [Encoding Data](#encoding-data)\n      * [Decoding Data](#decoding-data)\n   * [Contributing](#contributing)\n\n## Documentation\n\nFor comprehensive instructions on how to use these libraries, see the Haddock documentation:\n\n* [Documentation for `bech32`](https://hackage.haskell.org/package/bech32/docs/Codec-Binary-Bech32.html)\n* [Documentation for `bech32-th`](https://hackage.haskell.org/package/bech32-th/docs/Codec-Binary-Bech32-TH.html)\n\n## Usage\n\n### Encoding Data\n\n```hs\n\u003e\u003e\u003e import Prelude\n\u003e\u003e\u003e import Codec.Binary.Bech32\n\u003e\u003e\u003e import Data.Text.Encoding\n```\n\nFirst, prepare a human-readable prefix:\n```hs\n\u003e\u003e\u003e Right prefix = humanReadablePartFromText \"example\"\n```\n\nNext, prepare a data payload:\n```hs\n\u003e\u003e\u003e messageToEncode = \"Lorem ipsum dolor sit amet!\"\n\u003e\u003e\u003e dataPart = dataPartFromBytes $ encodeUtf8 messageToEncode\n```\n\nFinally, produce a Bech32 string:\n```hs\n\u003e\u003e\u003e encode prefix dataPart\nRight \"example1f3hhyetdyp5hqum4d5sxgmmvdaezqumfwssxzmt9wsss9un3cx\"\n```\n\n### Decoding Data\n\n```hs\n\u003e\u003e\u003e import Prelude\n\u003e\u003e\u003e import Codec.Binary.Bech32\n\u003e\u003e\u003e import Data.Text.Encoding\n```\n\nFirst, decode the input:\n\n```hs\n\u003e\u003e\u003e input = \"example1f3hhyetdyp5hqum4d5sxgmmvdaezqumfwssxzmt9wsss9un3cx\"\n\u003e\u003e\u003e Right (prefix, dataPart) = decode input\n```\n\nNext, examine the decoded human-readable prefix:\n\n```hs\n\u003e\u003e\u003e humanReadablePartToText prefix\n\"example\"\n```\n\nFinally, examine the decoded data payload:\n\n```hs\n\u003e\u003e\u003e decodeUtf8 \u003c$\u003e dataPartToBytes dataPart\nJust \"Lorem ipsum dolor sit amet!\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintersectmbo%2Fbech32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintersectmbo%2Fbech32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintersectmbo%2Fbech32/lists"}