A sequence of UInt8 values.
UInt8
Bytes can hold up to math.maxInt amount of bytes.
math.maxInt
The following operators are supported for Bytes:
Bytes
bytes1 + bytes2 // concatenation bytes[3] // subscript
For other list-like procedures, convert this into a List using toList().
List
toList()
The length of these bytes.
The number of bytes as DataSize.
DataSize
The bytes in base64 encoding.
The bytes in hexadecimal encoding.
The MD5 hash of these bytes as hexadecimal string.
MD5 is cryptographically broken and should not be used for secure applications.
The SHA-1 hash of these bytes as hexadecimal string.
SHA-1 is cryptographically broken and should not be used for secure applications.
The SHA-256 cryptographic hash of these bytes as hexadecimal string.
The first 64 bits of the SHA-256 cryptographic hash of these bytes.
Returns the class of this.
this
Returns a string representation of this.
This method is used to convert the values of string interpolation expressions to strings.
Returns this |> transform if this is non-null, and null otherwise.
this |> transform
null
This method is the complement of the ?? operator and the equivalent of an Option type's map and flatMap methods.
??
Option
map
flatMap
Returns the element at index.
index
Returns null if index is outside the bounds of these Bytes.
Facts:
Bytes(3, 9, 6).getOrNull(0) == 3 Bytes(3, 9, 6).getOrNull(1) == 9 Bytes(3, 9, 6).getOrNull(2) == 6 Bytes(3, 9, 6).getOrNull(-1) == null Bytes(3, 9, 6).getOrNull(3) == null Bytes(3, 9, 6).getOrNull(99) == null
Converts these bytes into a string using the given charset.
charset
Throws if these bytes are invalid according to the given charset.
Converts these bytes into a List.
A sequence of
UInt8
values.