module documentation
Token stream decoder
Function | decode |
Decodes a byte stream into a string of tokens and its minimum supported OS version |
def decode(bytestream:
bytes
, *, tokens: Tokens
= None, lang: str
= 'en', mode: str
= 'display') -> tuple[ str | bytes, OsVersion]
:
(source)
¶
Decodes a byte stream into a string of tokens and its minimum supported OS version
- Each token is represented using one of three different representations formats, dictated by mode:
- display: Represents the tokens with Unicode characters matching the calculator's display
- accessible: Represents the tokens with ASCII-only equivalents, often requiring multi-character glyphs
- ti_ascii: Represents the tokens with their internal font indices (returns a bytes object)
Parameters | |
bytestream:bytes | The token bytes to decode |
tokens:Tokens | The Tokens object to use for decoding (defaults to the TI-84+CE tokens) |
lang:str | The language used in string (defaults to English, en) |
mode:str | The form of token representation to use for output (defaults to display) |
Returns | |
tuple[ | A tuple of a string of token representations and a minimum OsVersion |