ReferenceSPQL

Binary & Hashing

Encode, inspect, and hash byte values.

Scalar Functions

FunctionSummary
spql.bytes.from_base64Decode standard padded Base64 text into bytes.
spql.bytes.from_hexDecode hexadecimal text into bytes.
spql.bytes.is_emptyReturn whether a binary value contains no bytes.
spql.bytes.lenReturn the number of bytes in a binary value.
spql.bytes.reverseReverse the bytes in a binary value.
spql.bytes.starts_withReturn whether bytes start with a literal prefix.
spql.bytes.to_base64Encode bytes using standard padded Base64.
spql.bytes.to_hexEncode bytes as lowercase hexadecimal text.
spql.hash.crc32Compute an IEEE CRC-32 checksum.
spql.hash.md5Compute an MD5 digest.
spql.hash.sha1Compute a SHA-1 digest.
spql.hash.sha256Compute a SHA-256 digest.
spql.hash.sha512Compute 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

NameRequiredTypeDescription
valueyesutf8Encoded 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

NameRequiredTypeDescription
valueyesutf8Encoded 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

NameRequiredTypeDescription
valueyesbinaryBytes 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

NameRequiredTypeDescription
valueyesbinaryBytes 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

NameRequiredTypeDescription
valueyesbinaryBytes 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

NameRequiredTypeDescription
valueyesbinaryBytes to inspect.
prefixyesbinaryPrefix 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

NameRequiredTypeDescription
valueyesbinaryBytes 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

NameRequiredTypeDescription
valueyesbinaryBytes 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

NameRequiredTypeDescription
valueyesbinaryBytes 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

NameRequiredTypeDescription
valueyesbinaryBytes 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

NameRequiredTypeDescription
valueyesbinaryBytes 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

NameRequiredTypeDescription
valueyesbinaryBytes 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

NameRequiredTypeDescription
valueyesbinaryBytes to hash.

Returns

A binary digest.

Found a problem? Edit this page or report an issue.

On this page