pub struct GeneralPurpose { /* private fields */ }
Expand description

A general-purpose base64 engine.

  • It uses no vector CPU instructions, so it will work on any system.
  • It is reasonably fast (~2-3GiB/s).
  • It is not constant-time, though, so it is vulnerable to timing side-channel attacks. For loading cryptographic keys, etc, it is suggested to use the forthcoming constant-time implementation.

Implementations

Create a GeneralPurpose engine from an Alphabet.

While not very expensive to initialize, ideally these should be cached if the engine will be used repeatedly.

Trait Implementations

The config type used by this engine
The decode estimate used by this engine
Returns the config for this engine.
Encode arbitrary octets as base64 using the provided Engine. Returns a String. Read more
Encode arbitrary octets as base64 into a supplied String. Writes into the supplied String, which may allocate if its internal buffer isn’t big enough. Read more
Encode arbitrary octets as base64 into a supplied slice. Writes into the supplied output buffer. Read more
Decode the input into a new Vec. Read more
Decode the input into the supplied buffer. Read more
Decode the input into the provided output slice. Read more
Decode the input into the provided output slice. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.