[#bech32-Encode]
= xref:bech32.adoc[bech32]::Encode
:relfileprefix: ../
:mrdocs:

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;

== Synopsis

Declared in `&lt;bech32&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::string
Encode(
    xref:bech32/Encoding.adoc[Encoding] encoding,
    std::string const& hrp,
    std::vector&lt;uint8&lowbar;t&gt; const& values);
----

== Return Value

The encoded Bech32(m) string&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *encoding*
| The Bech32 variant to use (BECH32 or BECH32M)&period;
| *hrp*
| The human&hyphen;readable part&semi; must be lowercase&period;
| *values*
| The base32 data payload to encode&period;
|===


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