From a0d6d7715d8aa463c364d15cc8f51896432b5b00 Mon Sep 17 00:00:00 2001 From: marcoezekiel Date: Thu, 9 May 2024 11:24:30 -0600 Subject: [PATCH] Added DecodeNoLimitGeneric to bech32.go --- btcutil/bech32/bech32.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/btcutil/bech32/bech32.go b/btcutil/bech32/bech32.go index a7b056bd7a0..250b6042e8f 100644 --- a/btcutil/bech32/bech32.go +++ b/btcutil/bech32/bech32.go @@ -266,6 +266,15 @@ func DecodeNoLimit(bech string) (string, []byte, error) { return hrp, data, err } +// DecodeGeneric is identical to the existing DecodeNoLimit method, but will also +// return the bech32 version that matches the decoded checksum. +// +// Note that the returned data is 5-bit (base32) encoded and the human-readable +// part will be lowercase. +func DecodeNoLimitGeneric(bech string) (string, []byte, Version, error) { + return decodeNoLimit(bech) +} + // Decode decodes a bech32 encoded string, returning the human-readable part and // the data part excluding the checksum. //