binary_string
Creates a binary string from the hexadecimal notation. The string must contain only the characters 0-9 and a-f. For example:
- Q: binary_string "82a4"
returns binary string of 2 bytes, the first byte contains 0x82, second byte contains 0xa4.
Version | Platforms |
---|---|
9.5.3.211 | AIX, Debian, Mac, Red Hat, SUSE, Session, Solaris, Ubuntu, Windows |
9.5.13.130 | Raspbian |
Creation
Properties
Returns binary_substring containing length integer
bytes from position integer
. Position is zero origin.
- Q: (binary_substring(2,3) of (binary_string "001122334455667788")) as hexadecimal
- A: 223344
- Q: binary_substrings (integers in (0, length of it, 1), 1) of binary_string "68656c6c6f2f776f726c64"
- A: h
- A: e
- A: l
- A: l
- A: o
- A: /
- A: w
- A: o
- A: r
- A: l
- A: d
Version | Platforms |
---|---|
9.5.5.193 | AIX, Debian, Mac, Red Hat, SUSE, Session, Solaris, Ubuntu, Windows |
9.5.13.130 | Raspbian |
Iterates through the binary string returning all the binary substrings matching the name given.
- Q: number of binary_substrings (binary_string "11") of (binary_string "11225511225511")
- A: 3
Version | Platforms |
---|---|
9.5.5.193 | AIX, Debian, Mac, Red Hat, SUSE, Session, Solaris, Ubuntu, Windows |
9.5.13.130 | Raspbian |
Returns the binary substring value of the byte located at the offset specified by number. Number is zero origin.
- Q: (byte 0 of (binary_string "1122334455")) as hexadecimal
- A: 11
Version | Platforms |
---|---|
9.5.5.193 | AIX, Debian, Mac, Red Hat, SUSE, Session, Solaris, Ubuntu, Windows |
9.5.13.130 | Raspbian |
Returns a binary substring containing first integer
bytes of binary_string
.
- Q: first 3 of (binary_string "112233445566778899") as hexadecimal
- A: 112233
- Q: first 5 of "To be or not to be"
- A: To be
Version | Platforms |
---|---|
9.5.5.193 | AIX, Debian, Mac, Red Hat, SUSE, Session, Solaris, Ubuntu, Windows |
9.5.13.130 | Raspbian |
Checks if the binary value in the binary string is valid in one or more encodings. To specify multiple encodings, separate them with a semicolon. The binary value is tested with the first encoding, and if it is not valid, it is tested against next encoding until a valid encoding, among those specified, if found or untile the list of encodings to test ends. The inspector returns true if binary value is valid in any of specified encodings, returns false otherwise.
- Q: representable in "UTF-8;Shift_JIS" of (binary_string "82a082a2")
- A: True
Version | Platforms |
---|---|
9.5.7.90 | AIX, Debian, Mac, Red Hat, SUSE, Session, Solaris, Ubuntu, Windows |
9.5.13.130 | Raspbian |
Returns true if binary data in binary_string
is valid UTF-16 data on Windows systems. Returns true if binary data in binary_string
is valid UTF-8 data on non-Windows systems.
Version | Platforms |
---|---|
9.5.7.90 | AIX, Debian, Mac, Red Hat, SUSE, Session, Solaris, Ubuntu, Windows |
9.5.13.130 | Raspbian |
Tries to transcode binary data in binary_string
from the specified encoding to UTF-8. If the conversion succeeds, returns the converted data, if the conversion does not succeed, tries next encodings.
- Q: representations in "UTF-8;euc_jp;Shift_JIS" of (binary_string "e3838fe383ad")
- A: "ハロ"
Version | Platforms |
---|---|
9.5.7.90 | AIX, Debian, Mac, Red Hat, SUSE, Session, Solaris, Ubuntu, Windows |
9.5.13.130 | Raspbian |
Casts
Interprets binary data in binary_string as UTF-16 and converts to string on Windows systems. Interprets binary data in binary_string as UTF-8 and converts to string on non-Windows systems.
Version | Platforms |
---|---|
9.5.3.211 | AIX, Debian, Mac, Red Hat, SUSE, Session, Solaris, Ubuntu, Windows |
9.5.13.130 | Raspbian |
Operators
Returns a boolean TRUE if the first binary_string
contains with the second binary_string
. The value is checked on byte basis.
- Q: (binary_string "11ee22") contains (binary_string "ee")
- A: True
- Q: (binary_string "11ee22") contains (binary_string "1e")
- A: False
Version | Platforms |
---|---|
9.5.7.90 | AIX, Debian, Mac, Red Hat, SUSE, Session, Solaris, Ubuntu, Windows |
9.5.13.130 | Raspbian |