hex
Formats a BLOB-backed EVM byte value as uppercase hexadecimal text without a 0x prefix. hex and to_hex are compatibility aliases with identical behavior.
Example
Local
API reference
Exact signatures with descriptions, requirements, inputs, returns, and examples.
hex(ADDRESS) #
Returns uppercase hexadecimal for the stored bytes of ADDRESS, BYTES4, BYTES32, or BYTES256.
Inputs
| Name | Type | Use |
|---|---|---|
value | ADDRESS ADDRESS, BYTES4, BYTES32, or BYTES256 value encoded exactly as stored. | required positional |
Returns
| Name | Type |
|---|---|
hex | VARCHAR |
Uppercase hexadecimal text. Returns two uppercase hex characters per stored byte, without a 0x prefix. NULL returns NULL.
3 additional overloads
hex(BYTES4) #
Returns uppercase hexadecimal for the stored bytes of ADDRESS, BYTES4, BYTES32, or BYTES256.
Inputs
| Name | Type | Use |
|---|---|---|
value | BYTES4 ADDRESS, BYTES4, BYTES32, or BYTES256 value encoded exactly as stored. | required positional |
Returns
| Name | Type |
|---|---|
hex | VARCHAR |
Uppercase hexadecimal text. Returns two uppercase hex characters per stored byte, without a 0x prefix. NULL returns NULL.
hex(BYTES32) #
Returns uppercase hexadecimal for the stored bytes of ADDRESS, BYTES4, BYTES32, or BYTES256.
Inputs
| Name | Type | Use |
|---|---|---|
value | BYTES32 ADDRESS, BYTES4, BYTES32, or BYTES256 value encoded exactly as stored. | required positional |
Returns
| Name | Type |
|---|---|
hex | VARCHAR |
Uppercase hexadecimal text. Returns two uppercase hex characters per stored byte, without a 0x prefix. NULL returns NULL.
hex(BYTES256) #
Returns uppercase hexadecimal for the stored bytes of ADDRESS, BYTES4, BYTES32, or BYTES256.
Inputs
| Name | Type | Use |
|---|---|---|
value | BYTES256 ADDRESS, BYTES4, BYTES32, or BYTES256 value encoded exactly as stored. | required positional |
Returns
| Name | Type |
|---|---|
hex | VARCHAR |
Uppercase hexadecimal text. Returns two uppercase hex characters per stored byte, without a 0x prefix. NULL returns NULL.
Category and tags
- Category
- EVM utilities
- Tag
- Bytes
- Tag
- Hex
- Tag
- EVM
- Tag
- Deterministic
- Tag
- Types