Struct base64::engine::fast_portable::FastPortable
source · pub struct FastPortable { /* 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 (~2GiB/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§
source§impl FastPortable
impl FastPortable
sourcepub const fn from(alphabet: &Alphabet, config: FastPortableConfig) -> Self
pub const fn from(alphabet: &Alphabet, config: FastPortableConfig) -> Self
Create a FastPortable
engine from an Alphabet.
While not very expensive to initialize, ideally these should be cached if the engine will be used repeatedly.
Trait Implementations§
source§impl Engine for FastPortable
impl Engine for FastPortable
§type Config = FastPortableConfig
type Config = FastPortableConfig
The config type used by this engine
§type DecodeEstimate = FastPortableEstimate
type DecodeEstimate = FastPortableEstimate
The decode estimate used by this engine
source§fn decoded_length_estimate(&self, input_len: usize) -> Self::DecodeEstimate
fn decoded_length_estimate(&self, input_len: usize) -> Self::DecodeEstimate
As an optimization to prevent the decoded length from being calculated twice, it is
sometimes helpful to have a conservative estimate of the decoded size before doing the
decoding, so this calculation is done separately and passed to Engine::decode() as needed. Read more