You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/sql-reference/functions/encoding-functions.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -975,14 +975,14 @@ Encodes a binary data string, along with a human-readable part (HRP), using the
975
975
**Syntax**
976
976
977
977
```sql
978
-
Bech32Encode(hrp, data, witver(optional))
978
+
Bech32Encode(hrp, data[, witver])
979
979
```
980
980
981
981
**Parameters**
982
982
983
983
-`hrp` — String of 1 - 83 lowercase characters specifying the "human-readable part" of the code. Usually 'bc' or 'tb'. [String](../data-types/string.md), [FixedString](../data-types/fixedstring.md).
984
984
-`data` — String of binary data to encode. [String](../data-types/string.md), [FixedString](../data-types/fixedstring.md).
985
-
-`witver` (optional, default = 0): An [unsigned integer](../../sql-reference/data-types/int-uint.md) specifying the version of the algorithm to run. 0 for Bech32 and 1 or greater for Bech32m.
985
+
-`witver` (optional, default = 1): An [unsigned integer](../../sql-reference/data-types/int-uint.md) specifying the version of the algorithm to run. 0 for Bech32 and 1 or greater for Bech32m.
986
986
987
987
:::note
988
988
When using the [FixedString](../data-types/fixedstring.md) data type, if a value does not fully fill the row it is padded with null characters. While the `Bech32Encode` function will handle this automatically for the hrp argument, for the data argument the values must not be padded. For this reason it is not recommended to use the [FixedString](../data-types/fixedstring.md) data type for your data values unless you are certain that they are all the same length and ensure that your [FixedString](../data-types/fixedstring.md) column is set to that length as well.
0 commit comments