Skip to main content

Module general_purpose

Module general_purpose 

Source
Expand description

Provides the GeneralPurpose engine and associated config types.

See preconfigured engines like STANDARD_NO_PAD or STANDARD_NO_PAD_INDIFFERENT.

ModulesΒ§

decode πŸ”’
decode_suffix πŸ”’

StructsΒ§

GeneralPurpose
A general-purpose base64 engine.
GeneralPurposeConfig
Contains configuration parameters for base64 encoding and decoding.

ConstantsΒ§

INVALID_VALUE πŸ”’
NO_PAD
Don’t add padding when encoding, and require that there is no padding when decoding.
NO_PAD_INDIFFERENT
Don’t add padding when encoding, and allow input with or without padding when decoding.
PAD
Include padding bytes when encoding, and require that they be present when decoding.
PAD_INDIFFERENT
Include padding bytes when encoding, but allow input with or without padding when decoding.
STANDARD
A GeneralPurpose engine using the alphabet::STANDARD base64 alphabet and PAD config.
STANDARD_NO_PAD
A GeneralPurpose engine using the alphabet::STANDARD base64 alphabet and NO_PAD config.
STANDARD_NO_PAD_INDIFFERENT
A GeneralPurpose engine using the alphabet::STANDARD base64 alphabet and NO_PAD_INDIFFERENT config.
STANDARD_PAD_INDIFFERENT
A GeneralPurpose engine using the alphabet::STANDARD base64 alphabet and PAD_INDIFFERENT config.
URL_SAFE
A GeneralPurpose engine using the alphabet::URL_SAFE base64 alphabet and PAD config.
URL_SAFE_NO_PAD
A GeneralPurpose engine using the alphabet::URL_SAFE base64 alphabet and NO_PAD config.
URL_SAFE_NO_PAD_INDIFFERENT
A GeneralPurpose engine using the alphabet::URL_SAFE base64 alphabet and NO_PAD_INDIFFERENT config.
URL_SAFE_PAD_INDIFFERENT
A GeneralPurpose engine using the alphabet::URL_SAFE base64 alphabet and PAD_INDIFFERENT config.

FunctionsΒ§

decode_table πŸ”’
Returns a table mapping base64 bytes as the lookup index to either:
encode_helper πŸ”’
Scalar base64 encode of input into output, returning the number of bytes written.
encode_scalar_tail πŸ”’
Scalar encode of input[input_index..] into output[output_index..], resuming from a 3-byte group boundary. Returns the total number of output bytes written.
encode_table πŸ”’
Returns a table mapping a 6-bit index to the ASCII byte encoding of the index
read_u64 πŸ”’

Type AliasesΒ§

Scalar
A purely scalar base64 engine that never uses hardware-specific vector instructions.