💡Hex Converters
These functions convert from hexadecimal to string and integer formats
UDF_HEX_TO_INT()
Converts from hexadecimal to integer. The number is returned as a string to avoid any big number limitations.
Syntax
Arguments
Required:
hex
(string): The hex string to convert
Optional:
encoding
(string): The encoding to use. Valid values ares2c
andhex
. This parameter is optimal.Default:
hex
Sample Queries
UDF_INT_TO_HEX()
Synatx
Arguments
Required:
int
(integer): The integer to conver
Sample Query
UDF_HEX_TO_STRING()
Converts from hexadecimal to string. It will handle obscure characters like emojis and special characters.
Syntax
Arguments
Required:
hex
(string): The hex string to convert
Sample Query
UDF_BASE58_TO_HEX()
Converts from base58 to hexadecimal. Typically used for encoding Solana public keys and instructions.
Syntax
Arguments
Required:
base58
(string): The base58 string to convert. This cannot be NULL. Output will contain the0x
prefix. If 32 byte outputs are required, append leading zeroes on encoded outputs <= 64 characters (excluding0x
).
Sample Query
UDF_HEX_TO_BASE58()
Converts from hexadecimal to base58. Typically used for decoding within EVM to non-EVM environments, such as Solana.
Syntax
Arguments
Required:
hex
(string): The hex string to convert. This cannot be NULL and must contain the '0x' prefix.
Sample Query
UDF_HEX_TO_BECH32()
Converts from hexadecimal to bech32. Typically used for decoding within EVM to non-EVM environments, such as IBC. Requires both a hex string input and HRP (human-readable part), which is chain specific. Please refer to the respective blockchain's documentation for proper HRP input.
Syntax
Arguments
Required:
hex
(string): The hex string to convert. This cannot be NULL and must contain the '0x' prefix.hrp
(string): The human-readable part to be included within the decoding algorithm. This is empty by default, but is required for proper decoding.
Sample Query
Last updated