|
Bytes indexing. | |
|
Bytes slicing. | |
|
Bytes concatenation. | |
|
Comparison operators. | |
|
Get the nth bit of the bytes value. |
Bytes indexing.
Examples:
db>
SELECT b'binary \x01\x02\x03\x04 ftw!'[8];{b'\x02'}Bytes slicing.
Examples:
db>
SELECT b'\x01\x02\x03\x04 ftw!'[2:-1];{b'\x03\x04 ftw'}db>
SELECT b'some bytes'[2:-3];{b'me by'}Bytes concatenation.
db>
SELECT b'\x01\x02' ++ b'\x03\x04';{b'\x01\x02\x03\x04'}Get the nth bit of the bytes value.
When looking for the nth bit, this function enumerates bits from least to most significant in each byte.
db> ... ...
FOR n IN {0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13 ,14, 15}
UNION bytes_get_bit(b'ab', n);{1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0}