[#bech32]
= bech32
:mrdocs:

Bech32 and Bech32m string encoding used by newer Bitcoin address types&period;

== Types

[cols="1,4"]
|===
| Name| Description
| xref:bech32/DecodeResult.adoc[`DecodeResult`] 
| Result of decoding a Bech32(m) string&colon; its encoding, human&hyphen;readable part, and payload&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:bech32/CharLimit.adoc[`CharLimit`] 
| Character limits for Bech32(m) encoded strings&period; Character limits are how we provide error location guarantees&period; These values should never exceed 2&circ;31 &hyphen; 1 (max value for a 32&hyphen;bit int), since there are places where we may need to convert the CharLimit&colon;&colon;VALUE to an int&period; In practice, this should never happen since this CharLimit applies to an address encoding and we would never encode an address with such a massive value
| xref:bech32/Encoding.adoc[`Encoding`] 
| Which Bech32 variant a string uses, or that decoding failed&period;
|===


== Functions

[cols="1,4"]
|===
| Name| Description
| xref:bech32/Decode.adoc[`Decode`] 
| Decode a Bech32 or Bech32m string&period;
| xref:bech32/Encode.adoc[`Encode`] 
| Encode a Bech32 or Bech32m string&period; If hrp contains uppercase characters, this will cause an assertion error&period; Encoding must be one of BECH32 or BECH32M&period;
| xref:bech32/LocateErrors.adoc[`LocateErrors`] 
| Return the positions of errors in a Bech32 string&period;
|===


== Variables

[cols="1,4"]
|===
| Name| Description
| xref:bech32/CHECKSUM_SIZE.adoc[`CHECKSUM&lowbar;SIZE`] 
| Number of trailing checksum characters in a Bech32(m) string&period;
| xref:bech32/SEPARATOR.adoc[`SEPARATOR`] 
| Character separating the human&hyphen;readable part from the data section&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
