chore: fix comments on bech32 (#18114)

This commit is contained in:
Marko 2023-10-13 15:33:39 +02:00 committed by GitHub
parent ec9bcc41ef
commit bff3104781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ import (
"github.com/cosmos/btcutil/bech32"
)
// ConvertAndEncode converts from a base64 encoded byte string to base32 encoded byte string and then to bech32.
// ConvertAndEncode converts from a base256 encoded byte string to base32 encoded byte string and then to bech32.
func ConvertAndEncode(hrp string, data []byte) (string, error) {
converted, err := bech32.ConvertBits(data, 8, 5, true)
if err != nil {
@ -16,7 +16,7 @@ func ConvertAndEncode(hrp string, data []byte) (string, error) {
return bech32.Encode(hrp, converted)
}
// DecodeAndConvert decodes a bech32 encoded string and converts to base64 encoded bytes.
// DecodeAndConvert decodes a bech32 encoded string and converts to base256 encoded bytes.
func DecodeAndConvert(bech string) (string, []byte, error) {
hrp, data, err := bech32.Decode(bech, 1023)
if err != nil {