Modulecardano-binary-1.9.1.0
Cardano.Binary
- 12 types
- 2 classes
- 152 values
- Packagecardano-binary-1.9.1.0
- Exports166
- LicenceApache-2.0
- SourceDecoding.hs
Deprecated. In favor of decodeMaybe
Deprecated. Use serialize' instead, since Encoding has ToCBOR instance
Deprecated. In favor of encodeMaybe
Decode a bool.
Decode a string of bytes as a ByteString.
Decode canonical representation of a string of bytes as a ByteString.
Decode a token marking the beginning of an indefinite length set of bytes.
Decode a Double.
Decode canonical representation of a Double.
Decode a Float.
Decode canonical representation of a half-precision Float.
Decode canonical representation of a Float.
Decode an Int.
Decode an Int16.
Decode canonical representation of an Int16.
Decode an Int32.
Decode canonical representation of an Int32.
Decode an Int64.
Decode canonical representation of an Int64.
Decode an Int8.
Decode canonical representation of an Int8.
Decode canonical representation of an Int.
Decode an Integer.
Decode canonical representation of an Integer.
Decode the length of a list.
Decode canonical representation of the length of a list.
Attempt to decode canonical representation of a list length using decodeListLenCanonical, and ensure it is exactly the specified length, or fail.
Decode a token marking the beginning of a list of indefinite length.
Attempt to decode a list length using decodeListLen, and ensure it is exactly the specified length, or fail.
Decode the length of a map.
Decode canonical representation of the length of a map.
Decode a token marking the beginning of a map of indefinite length.
Decode a negative Word.
Decode a negative Word64.
Decode canonical representation of a negative Word64.
Decode canonical representation of a negative Word.
Decode a nullary value, and return a unit value.
Decode an indefinite sequence length.
Decode a sequence length.
Decode a simple CBOR value and give back a Word8. You
probably don't ever need to use this.
Decode canonical representation of a simple CBOR value and give back a
Word8. You probably don't ever need to use this.
Decode a textual string as a piece of Text.
Decode canonical representation of a textual string as a piece of Text.
Decode a token marking the beginning of an indefinite length string.
Decode an arbitrary tag and return it as a Word.
Decode an arbitrary 64-bit tag and return it as a Word64.
Decode canonical representation of an arbitrary 64-bit tag and return it as a Word64.
Decode canonical representation of an arbitrary tag and return it as a Word.
Decode canonical representation of a textual string as UTF-8 encoded ByteArray. Note that the result is not validated to be well-formed UTF-8.
Also note that this will eagerly copy the content out of the input to ensure that the input does not leak in the event that the ByteArray is live but not forced.
This captures the pattern of getting the byte offsets before and after decoding a subterm.
!before <- peekByteOffset
x <- decode
!after <- peekByteOffsetDecode a Word.
Decode a Word16.
Decode canonical representation of a Word16.
Decode a Word32.
Decode canonical representation of a Word32.
Decode a Word64.
Decode canonical representation of a Word64.
Decode a Word8.
Decode canonical representation of a Word8.
Decode canonical representation of a Word.
Attempt to decode canonical representation of a word with decodeWordCanonical, and ensure the word is exactly as expected, or fail.
Attempt to decode a word with decodeWord, and ensure the word is exactly as expected, or fail.
Given a Decoder, give us the DecodeAction
Lift an ST action into a Decoder. Useful for, e.g., leveraging
in-place mutation to efficiently build a deserialised value.
Peek and return the length of the current buffer that we're running our decoder on.
Get the current ByteOffset in the input byte sequence of the Decoder.
The Decoder does not provide any facility to get at the input data directly (since that is tricky with an incremental decoder). The next best is this primitive which can be used to keep track of the offset within the input bytes that makes up the encoded form of a term.
By keeping track of the byte offsets before and after decoding a subterm (a pattern captured by decodeWithByteSpan) and if the overall input data is retained then this is enables later retrieving the span of bytes for the subterm.
Peek at the current token we're about to decode, and return a TokenType specifying what it is.
Encode a Bool.
Encode a 'break', used to specify the end of indefinite length objects like maps or lists.
Encode a bytestring in a flattened format.
Encode an arbitrary strict ByteString in a flattened format.
Encode a token specifying the beginning of a string of bytes of indefinite length. In reality, this specifies a stream of many occurrences of encodeBytes, each specifying a single chunk of the overall string. After all the bytes desired have been encoded, you should follow it with a break token (see encodeBreak).
Encode a Double in a flattened format.
Encode a full precision Float in a flattened format.
Encode a small 16-bit Float in a flattened format.
Encode an Int in a flattened format.
Encode an Int16 in a flattened format.
Encode an Int32 in a flattened format.
Encode an @Int64 in a flattened format.
Encode an Int8 in a flattened format.
Encode an arbitrarily large @Integer in a flattened format.
Encode the length of a list, used to indicate that the following tokens represent the list values.
Encode a token specifying that this is the beginning of an indefinite list of unknown size. Tokens representing the list are expected afterwords, followed by a break token (see encodeBreak) when the list has ended.
Encode the length of a Map, used to indicate that the following tokens represent the map values.
Encode a token specifying that this is the beginning of an indefinite map of unknown size. Tokens representing the map are expected afterwords, followed by a break token (see encodeBreak) when the map has ended.
Encode a Null value.
Include pre-encoded valid CBOR data into the Encoding.
The data is included into the output as-is without any additional wrapper.
This should be used with care. The data must be a valid CBOR encoding, but this is not checked.
This is useful when you have CBOR data that you know is already valid, e.g. previously validated and stored on disk, and you wish to include it without having to decode and re-encode it.
Encode a 'simple' CBOR token that can be represented with an 8-bit word. You probably don't ever need this.
Encode a Text in a flattened format.
Encode the beginning of an indefinite string.
Encode an arbitrary Word tag.
Encode an arbitrary 64-bit Word64 tag.
Encode an Undef value.
Encode a UTF-8 string in a flattened format. Note that the contents is not validated to be well-formed UTF-8.
Encode a Word in a flattened format.
Encode a Word16 in a flattened format.
Encode a Word32 in a flattened format.
Encode a Word64 in a flattened format.
Encode a Word8 in a flattened format.
Turn an Encoding into a strict ByteString in CBOR binary format.
Instances5Eq, Show, Exception, NFData, Buildable
Eq DecoderErrorDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORShow DecoderErrorDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORException DecoderErrorDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORNFData DecoderErrorDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORBuildable DecoderErrorDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR
Instances44FromCBOR, …
FromCBOR ByteArrayDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR ByteStringDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR ByteStringDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR ShortByteStringDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR IPv4Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR IPv6Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR ByteArrayDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR TermTokenDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR TermDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR VoidDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR IntegerDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR NaturalDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR Int32Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR Int64Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR RationalDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR BoolDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR DoubleDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR FloatDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR IntDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR WordDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR Word16Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR Word32Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR Word64Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR Word8Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR TextDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR UTCTimeDefined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR ()Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR a => FromCBOR (Seq a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR a => FromCBOR (NonEmpty a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR a => FromCBOR (Maybe a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR a => FromCBOR (Vector a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORFromCBOR a => FromCBOR [a]Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR(Ord a, FromCBOR a) => FromCBOR (Set a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBORTypeable a => FromCBOR (Fixed a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR(FromCBOR a, FromCBOR b) => FromCBOR (Either a b)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR(FromCBOR a, FromCBOR b) => FromCBOR (a, b)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR(Ord k, FromCBOR k, FromCBOR v) => FromCBOR (Map k v)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR(FromCBOR a, FromCBOR b, FromCBOR c) => FromCBOR (a, b, c)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR(Typeable s, FromCBOR a) => FromCBOR (Tagged s a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR(FromCBOR a, FromCBOR b, FromCBOR c, FromCBOR d) => FromCBOR (a, b, c, d)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR(FromCBOR a, FromCBOR b, FromCBOR c, FromCBOR d, FromCBOR e) => FromCBOR (a, b, c, d, e)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR(FromCBOR a, FromCBOR b, FromCBOR c, FromCBOR d, FromCBOR e, FromCBOR f) => FromCBOR (a, b, c, d, e, f)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR(FromCBOR a, FromCBOR b, FromCBOR c, FromCBOR d, FromCBOR e, FromCBOR f, FromCBOR g) => FromCBOR (a, b, c, d, e, f, g)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR(FromCBOR a, FromCBOR b, FromCBOR c, FromCBOR d, FromCBOR e, FromCBOR f, FromCBOR g, FromCBOR h) => FromCBOR (a, b, c, d, e, f, g, h)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.FromCBOR
Constructors
LengthOf xs
Constructors
SizeConstant SizeSizeExpression ((forall a. ToCBOR a => Proxy a -> Size) -> Size)SelectCases [Text]
Instances46ToCBOR, …
ToCBOR ByteArrayDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR ByteStringDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR ByteStringDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR ShortByteStringDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR IPv4Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR IPv6Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR ByteArrayDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR EncodingDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR TermDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR VoidDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR IntegerDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR NaturalDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR Int32Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR Int64Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR BoolDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR DoubleDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR FloatDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR IntDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR WordDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR Word16Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR Word32Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR Word64Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR Word8Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR TextDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR UTCTimeDefined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR ()Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR a => ToCBOR (Seq a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR a => ToCBOR (NonEmpty a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR a => ToCBOR (Maybe a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR a => ToCBOR (Ratio a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR a => ToCBOR (Vector a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR a => ToCBOR [a]Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORTypeable xs => ToCBOR (LengthOf xs)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBOR(Ord a, ToCBOR a) => ToCBOR (Set a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORToCBOR (Tokens -> Tokens)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBORTypeable a => ToCBOR (Fixed a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBOR(ToCBOR a, ToCBOR b) => ToCBOR (Either a b)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBOR(ToCBOR a, ToCBOR b) => ToCBOR (a, b)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBOR(Ord k, ToCBOR k, ToCBOR v) => ToCBOR (Map k v)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBOR(ToCBOR a, ToCBOR b, ToCBOR c) => ToCBOR (a, b, c)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBOR(Typeable s, ToCBOR a) => ToCBOR (Tagged s a)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBOR(ToCBOR a, ToCBOR b, ToCBOR c, ToCBOR d) => ToCBOR (a, b, c, d)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBOR(ToCBOR a, ToCBOR b, ToCBOR c, ToCBOR d, ToCBOR e) => ToCBOR (a, b, c, d, e)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBOR(ToCBOR a, ToCBOR b, ToCBOR c, ToCBOR d, ToCBOR e, ToCBOR f) => ToCBOR (a, b, c, d, e, f)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBOR(ToCBOR a, ToCBOR b, ToCBOR c, ToCBOR d, ToCBOR e, ToCBOR f, ToCBOR g) => ToCBOR (a, b, c, d, e, f, g)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBOR(ToCBOR a, ToCBOR b, ToCBOR c, ToCBOR d, ToCBOR e, ToCBOR f, ToCBOR g, ToCBOR h) => ToCBOR (a, b, c, d, e, f, g, h)Defined in cardano-binary-1.9.1.0 · Cardano.Binary.ToCBOR
An action, representing a step for a decoder to taken and a continuation to invoke with the expected value.
Constructors
ConsumeWord (Word# -> ST s (DecodeAction s a))ConsumeWord8 (Word# -> ST s (DecodeAction s a))ConsumeWord16 (Word# -> ST s (DecodeAction s a))ConsumeWord32 (Word# -> ST s (DecodeAction s a))ConsumeNegWord (Word# -> ST s (DecodeAction s a))ConsumeInt (Int# -> ST s (DecodeAction s a))ConsumeInt8 (Int# -> ST s (DecodeAction s a))ConsumeInt16 (Int# -> ST s (DecodeAction s a))ConsumeInt32 (Int# -> ST s (DecodeAction s a))ConsumeListLen (Int# -> ST s (DecodeAction s a))ConsumeMapLen (Int# -> ST s (DecodeAction s a))ConsumeTag (Word# -> ST s (DecodeAction s a))ConsumeInteger (Integer -> ST s (DecodeAction s a))ConsumeFloat (Float# -> ST s (DecodeAction s a))ConsumeDouble (Double# -> ST s (DecodeAction s a))ConsumeBytes (ByteString -> ST s (DecodeAction s a))ConsumeByteArray (ByteArray -> ST s (DecodeAction s a))ConsumeString (Text -> ST s (DecodeAction s a))ConsumeUtf8ByteArray (ByteArray -> ST s (DecodeAction s a))ConsumeBool (Bool -> ST s (DecodeAction s a))ConsumeSimple (Word# -> ST s (DecodeAction s a))ConsumeBytesIndef (ST s (DecodeAction s a))ConsumeStringIndef (ST s (DecodeAction s a))ConsumeListLenIndef (ST s (DecodeAction s a))ConsumeMapLenIndef (ST s (DecodeAction s a))ConsumeNull (ST s (DecodeAction s a))ConsumeListLenOrIndef (Int# -> ST s (DecodeAction s a))ConsumeMapLenOrIndef (Int# -> ST s (DecodeAction s a))ConsumeBreakOr (Bool -> ST s (DecodeAction s a))PeekTokenType (TokenType -> ST s (DecodeAction s a))PeekAvailable (Int# -> ST s (DecodeAction s a))PeekByteOffset (Int# -> ST s (DecodeAction s a))ConsumeWordCanonical (Word# -> ST s (DecodeAction s a))ConsumeWord8Canonical (Word# -> ST s (DecodeAction s a))ConsumeWord16Canonical (Word# -> ST s (DecodeAction s a))ConsumeWord32Canonical (Word# -> ST s (DecodeAction s a))ConsumeNegWordCanonical (Word# -> ST s (DecodeAction s a))ConsumeIntCanonical (Int# -> ST s (DecodeAction s a))ConsumeInt8Canonical (Int# -> ST s (DecodeAction s a))ConsumeInt16Canonical (Int# -> ST s (DecodeAction s a))ConsumeInt32Canonical (Int# -> ST s (DecodeAction s a))ConsumeListLenCanonical (Int# -> ST s (DecodeAction s a))ConsumeMapLenCanonical (Int# -> ST s (DecodeAction s a))ConsumeTagCanonical (Word# -> ST s (DecodeAction s a))ConsumeIntegerCanonical (Integer -> ST s (DecodeAction s a))ConsumeFloat16Canonical (Float# -> ST s (DecodeAction s a))ConsumeFloatCanonical (Float# -> ST s (DecodeAction s a))ConsumeDoubleCanonical (Double# -> ST s (DecodeAction s a))ConsumeBytesCanonical (ByteString -> ST s (DecodeAction s a))ConsumeByteArrayCanonical (ByteArray -> ST s (DecodeAction s a))ConsumeStringCanonical (Text -> ST s (DecodeAction s a))ConsumeUtf8ByteArrayCanonical (ByteArray -> ST s (DecodeAction s a))ConsumeSimpleCanonical (Word# -> ST s (DecodeAction s a))Fail StringDone a
A continuation-based decoder, used for decoding values that were previously encoded using the Codec.CBOR.Encoding module. As Decoder has a Monad instance, you can easily write Decoders monadically for building your deserialisation logic.
Instances4Monad, Functor, MonadFail, Applicative
The type of a token, which a decoder can ask for at an arbitrary time.
Instances5Bounded, Enum, Eq, Ord, Show
Bounded TokenTypeDefined in cborg-0.2.10.0 · Codec.CBOR.DecodingEnum TokenTypeDefined in cborg-0.2.10.0 · Codec.CBOR.DecodingEq TokenTypeDefined in cborg-0.2.10.0 · Codec.CBOR.DecodingOrd TokenTypeDefined in cborg-0.2.10.0 · Codec.CBOR.DecodingShow TokenTypeDefined in cborg-0.2.10.0 · Codec.CBOR.Decoding
An intermediate form used during serialisation, specified as a Monoid. It supports efficient concatenation, and is equivalent to a specialised Endo Tokens type.
It is used for the stage in serialisation where we flatten out the Haskell data structure but it is independent of any specific external binary or text format.
Traditionally, to build any arbitrary Encoding value, you specify larger structures from smaller ones and append the small ones together using mconcat.
Instances4Show, Semigroup, Monoid, ToCBOR
A flattened representation of a term, which is independent of any underlying binary representation, but which we later serialise into CBOR format.
Constructors
TkWord !Word TokensTkWord64 !Word64 TokensTkInt !Int TokensTkInt64 !Int64 TokensTkBytes !ByteString TokensTkBytesBegin TokensTkByteArray !SlicedByteArray TokensTkString !Text TokensTkUtf8ByteArray !SlicedByteArray TokensTkStringBegin TokensTkListLen !Word TokensTkListBegin TokensTkMapLen !Word TokensTkMapBegin TokensTkTag !Word TokensTkTag64 !Word64 TokensTkInteger !Integer TokensTkNull TokensTkUndef TokensTkBool !Bool TokensTkSimple !Word8 TokensTkFloat16 !Float TokensTkFloat32 !Float TokensTkFloat64 !Double TokensTkBreak TokensTkEncoded !ByteString TokensTkEnd