Std.Bytes
45 public declarations
- at
&Bytes -> Int -> Option[UInt8]The byte at a position, or nothing when the position is outside.
- BytesError
What went wrong while reading a byte sequence.
- concat
&Bytes -> &Bytes -> BytesTwo sequences joined. This copies, and is named so a reader can see it.
- contains
&Bytes -> &Bytes -> BoolWhether a sub-sequence appears anywhere.
- decodeBase64
Str -> Result[Bytes, Std.Bytes.BytesError]The bytes base64 text spells, or why it spells none.
- decodeBase64Url
Str -> Result[Bytes, Std.Bytes.BytesError]The bytes URL-alphabet base64 spells, padded or not.
- decodeHex
Str -> Result[Bytes, Std.Bytes.BytesError]The bytes hexadecimal text spells, or why it spells none.
- drop
&Bytes -> Int -> BytesEverything after the first bytes, sharing storage with the source.
- empty
BytesA sequence holding nothing.
- encodeBase64
&Bytes -> StrA sequence written as base64, padded to a multiple of four characters.
- encodeBase64Url
&Bytes -> StrA sequence written as base64 in the alphabet a URL admits, unpadded.
- encodeHex
&Bytes -> StrA sequence written as lower-case hexadecimal, two digits a byte.
- endsWith
&Bytes -> &Bytes -> BoolWhether a sequence ends with another.
- fromArray
&Array[UInt8] -> BytesThe bytes of an array of octets.
- fromText
Str -> BytesThe UTF-8 encoding of text. This direction cannot fail.
- getBytes
&Bytes -> Int -> Result[(Bytes, Bytes), Std.Bytes.BytesError]The next bytes as their own sequence, and the rest of the input.
- getText
&Bytes -> Int -> Result[(Str, Bytes), Std.Bytes.BytesError]The next bytes decoded as text, and the rest of the input.
- getU16Be
&Bytes -> Result[(UInt16, Bytes), Std.Bytes.BytesError]Two bytes as a number, most significant first, and the rest of the input.
- getU16Le
&Bytes -> Result[(UInt16, Bytes), Std.Bytes.BytesError]Two bytes as a number, least significant first, and the rest of the input.
- getU32Be
&Bytes -> Result[(UInt32, Bytes), Std.Bytes.BytesError]Four bytes as a number, most significant first, and the rest of the input.
- getU32Le
&Bytes -> Result[(UInt32, Bytes), Std.Bytes.BytesError]Four bytes as a number, least significant first, and the rest of the input.
- getU64Be
&Bytes -> Result[(UInt64, Bytes), Std.Bytes.BytesError]Eight bytes as a number, most significant first, and the rest of the input.
- getU64Le
&Bytes -> Result[(UInt64, Bytes), Std.Bytes.BytesError]Eight bytes as a number, least significant first, and the rest of the input.
- getU8
&Bytes -> Result[(UInt8, Bytes), Std.Bytes.BytesError]One byte, and the rest of the input.
- indexOf
&Bytes -> &Bytes -> IntWhere a sub-sequence begins, or `-1` when it is absent.
- isEmpty
&Bytes -> BoolWhether a sequence holds nothing.
- join
&Array[Bytes] -> BytesEvery sequence joined in order.
- length
&Bytes -> IntHow many bytes a sequence holds.
- putU16Be
UInt16 -> BytesTwo bytes written, most significant first.
- putU16Le
UInt16 -> BytesTwo bytes written, least significant first.
- putU32Be
UInt32 -> BytesFour bytes written, most significant first.
- putU32Le
UInt32 -> BytesFour bytes written, least significant first.
- putU64Be
UInt64 -> BytesEight bytes written, most significant first.
- putU64Le
UInt64 -> BytesEight bytes written, least significant first.
- putU8
UInt8 -> BytesOne byte written.
- repeat
&Bytes -> Int -> BytesA sequence repeated, or nothing repeated when the count is not positive.
- reverse
&Bytes -> BytesA sequence in reverse. This copies.
- slice
&Bytes -> Int -> Int -> BytesThe stretch between two positions, sharing storage with its source.
- split
&Bytes -> &Bytes -> Array[Bytes]The pieces between each appearance of a separator.
- splitAt
&Bytes -> Int -> (Bytes, Bytes)A sequence cut in two at a position, both halves sharing its storage.
- startsWith
&Bytes -> &Bytes -> BoolWhether a sequence begins with another.
- take
&Bytes -> Int -> BytesThe first bytes of a sequence, sharing storage with it.
- toArray
&Bytes -> Array[UInt8]The octets of a sequence, one value per byte.
- toText
&Bytes -> Result[Str, Std.Bytes.BytesError]The text a sequence encodes, or the reason it is not text.
- xorWith
&Bytes -> &Bytes -> BytesTwo sequences combined bit by bit, as long as the shorter of them.
