Binary Functions
Use the binary functions to operate on binary data.
Function | Return Type | Input Arguments | Description |
---|---|---|---|
concat(b1, b2, ...) | Varbinary |
| Returns the concatenation of the input arguments. |
crc32(b) | Bigint |
| Returns the CRC-32 checksum of the input binary. |
from_base64(s) | Binary |
| Returns binary data from the base64 encoded input string. |
from_base64url(s) | Binary |
| Returns binary data from the base64 encoded input string using the URL safe alphabet. |
from_big_endian_32(b) | Integer |
| Returns the 32-bit two's complement big-endian binary. The input must be exactly four bytes. |
from_big_endian_64(b) | Bigint |
| Returns the 64-bit two's complement big-endian binary. The input must be exactly eight bytes. |
from_hex(s) | Binary |
| Returns binary data from hex encoded input string. |
from_ieee754_32(b) | Real |
| Returns the 32-bit big-endian binary in IEEE 754 single-precision floating-point format. The input must be exactly four bytes. |
from_ieee754_64(b) | Double |
| Returns the 64-bit big-endian binary in IEEE 754 double-precision floating-point format. The input must be exactly eight bytes. |
hmac_md5(b, key) | Varbinary |
| Returns the MD5 HMAC of the input binary with the given key. |
hmac_sha1(b, key) | Varbinary |
| Returns the SHA1 HMAC of the input binary with the given key. |
hmac_sha256(b, key) | Varbinary |
| Returns the SHA256 HMAC of the input binary with the given key. |
hmac_sha512(b, key) | Varbinary |
| Returns the SHA512 HMAC of the input binary with the given key. |
length(b) | Bigint |
| Returns the length of binary in bytes. |
lpad(b, size, padbinary) | Varbinary |
| Left pads the input binary to size bytes with padbinary. If size is less than the length of b, the result is truncated to size characters. size must not be negative and padbinary must be non-empty. |
md5(b) | Varbinary |
| Returns the MD5 of the input. |
murmur3(b) | Varbinary |
| Returns the 128-bit MurmurHash3 of the input. |
reverse(b) | Varbinary |
| Returns b with the bytes in reverse order. |
rpad(b, size, padbinary) | Varbinary |
| Right pads the input binary to size bytes with padbinary. If size is less than the length of b, the result is truncated to size characters. size must not be negative and padbinary must be non-empty. |
sha1(b) | Varbinary |
| Returns the SHA1 hash of the input. |
sha256(b) | Varbinary |
| Returns the SHA256 of the input. |
sha512(b) | Varbinary |
| Returns the SHA512 hash of the input. |
spooky_hash_v2_32(b) | Varbinary |
| Returns the 32-bit SpookyHashV2 hash of the input. |
spooky_hash_v2_64(b) | Varbinary |
| Returns the 64-bit SpookyHashV2 hash of the input. |
substr(b, start) | Varbinary |
| Returns the end of the input binary from the starting position start, measured in bytes. Positions start with 1. A negative starting position is interpreted as being relative to the end of the string. |
to_base64(b) | Varchar |
| Encodes the input into a base64 string representation. |
to_base64url(b) | Varchar |
| Encodes the input into a base64 string representation using the URL safe alphabet. |
to_big_endian_32(n) | Varbinary |
| Encodes the input into a 32-bit two's complement big-endian format. |
to_big_endian_64(n) | Varbinary |
| Encodes the input into a 64-bit two's complement big-endian format. |
to_hex(b) | Varchar |
| Encodes the input into a hex string representation. |
to_ieee754_32(r) | Varbinary |
| Encodes the input into a 32-bit big-endian binary according to IEEE 754 single-precision floating-point format. |
to_ieee754_64(d) | Varbinary |
| Encodes the input into a 64-bit big-endian binary according to IEEE 754 double-precision floating-point format. |
xxhash64(b) | Varbinary |
| Returns the xxHash64 hash of the input. |