Skip to main content

decoded_units

Function decoded_units 

Source
pub fn decoded_units(
    vocabulary: &Vocabulary,
    tokens: &TokenSequence,
) -> Result<u64, KuteError>
Expand description

How many units (bytes or symbols) tokens decodes to, computed from the token table without decoding. A five-byte id can stand for a 64 KiB token, so callers that decode untrusted sequences check this against a budget first.