Binary & Hashing
Encode, inspect, and hash byte values.
Scalar Functions
| Function | Summary |
|---|---|
spql.bytes.from_base64 | Decode standard padded Base64 text into bytes. |
spql.bytes.from_hex | Decode hexadecimal text into bytes. |
spql.bytes.is_empty | Return whether a binary value contains no bytes. |
spql.bytes.len | Return the number of bytes in a binary value. |
spql.bytes.reverse | Reverse the bytes in a binary value. |
spql.bytes.starts_with | Return whether bytes start with a literal prefix. |
spql.bytes.to_base64 | Encode bytes using standard padded Base64. |
spql.bytes.to_hex | Encode bytes as lowercase hexadecimal text. |
spql.hash.crc32 | Compute an IEEE CRC-32 checksum. |
spql.hash.md5 | Compute an MD5 digest. |
spql.hash.sha1 | Compute a SHA-1 digest. |
spql.hash.sha256 | Compute a SHA-256 digest. |
spql.hash.sha512 | Compute a SHA-512 digest. |
spql.bytes.from_base64
Decode standard padded Base64 text into bytes.
- Kind:
scalar function - Volatility:
immutable
spql.bytes.from_base64(value) -> binary?Nullable when an argument is nullable; otherwise non-nullable.
Malformed input produces a query error.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | utf8 | Encoded text to decode. |
Returns
A binary value.
spql.bytes.from_hex
Decode hexadecimal text into bytes.
- Kind:
scalar function - Volatility:
immutable
spql.bytes.from_hex(value) -> binary?Nullable when an argument is nullable; otherwise non-nullable.
Malformed input produces a query error.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | utf8 | Encoded text to decode. |
Returns
A binary value.
spql.bytes.is_empty
Return whether a binary value contains no bytes.
- Kind:
scalar function - Volatility:
immutable
spql.bytes.is_empty(value) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | binary | Bytes to inspect. |
Returns
A boolean value or expression.
spql.bytes.len
Return the number of bytes in a binary value.
- Kind:
scalar function - Volatility:
immutable
spql.bytes.len(value) -> u64?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | binary | Bytes to measure. |
Returns
An unsigned 64-bit length.
spql.bytes.reverse
Reverse the bytes in a binary value.
- Kind:
scalar function - Volatility:
immutable
spql.bytes.reverse(value) -> binary?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | binary | Bytes to transform. |
Returns
A binary value.
spql.bytes.starts_with
Return whether bytes start with a literal prefix.
- Kind:
scalar function - Volatility:
immutable
spql.bytes.starts_with(value, prefix) -> bool?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | binary | Bytes to inspect. |
prefix | yes | binary | Prefix to match literally. |
Returns
A boolean value or expression.
spql.bytes.to_base64
Encode bytes using standard padded Base64.
- Kind:
scalar function - Volatility:
immutable
spql.bytes.to_base64(value) -> utf8?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | binary | Bytes to transform. |
Returns
A Utf8 value.
spql.bytes.to_hex
Encode bytes as lowercase hexadecimal text.
- Kind:
scalar function - Volatility:
immutable
spql.bytes.to_hex(value) -> utf8?Nullable when an argument is nullable; otherwise non-nullable.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | binary | Bytes to transform. |
Returns
A Utf8 value.
spql.hash.crc32
Compute an IEEE CRC-32 checksum.
- Kind:
scalar function - Volatility:
immutable
spql.hash.crc32(value) -> binary?Nullable when an argument is nullable; otherwise non-nullable.
Returns raw digest bytes; use spql.bytes.to_hex for text output.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | binary | Bytes to hash. |
Returns
A binary digest.
spql.hash.md5
Compute an MD5 digest.
- Kind:
scalar function - Volatility:
immutable
spql.hash.md5(value) -> binary?Nullable when an argument is nullable; otherwise non-nullable.
Returns raw digest bytes; use spql.bytes.to_hex for text output.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | binary | Bytes to hash. |
Returns
A binary digest.
spql.hash.sha1
Compute a SHA-1 digest.
- Kind:
scalar function - Volatility:
immutable
spql.hash.sha1(value) -> binary?Nullable when an argument is nullable; otherwise non-nullable.
Returns raw digest bytes; use spql.bytes.to_hex for text output.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | binary | Bytes to hash. |
Returns
A binary digest.
spql.hash.sha256
Compute a SHA-256 digest.
- Kind:
scalar function - Volatility:
immutable
spql.hash.sha256(value) -> binary?Nullable when an argument is nullable; otherwise non-nullable.
Returns raw digest bytes; use spql.bytes.to_hex for text output.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | binary | Bytes to hash. |
Returns
A binary digest.
spql.hash.sha512
Compute a SHA-512 digest.
- Kind:
scalar function - Volatility:
immutable
spql.hash.sha512(value) -> binary?Nullable when an argument is nullable; otherwise non-nullable.
Returns raw digest bytes; use spql.bytes.to_hex for text output.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
value | yes | binary | Bytes to hash. |
Returns
A binary digest.