Trait static_buffer::StandardPadding [] [src]

pub trait StandardPadding {
    fn pad<F: FnMut(&[u8])>(&mut self, padding: u8, rem: usize, func: F);

    fn standard_padding<F: FnMut(&[u8])>(&mut self, rem: usize, func: F) { ... }
}

The StandardPadding trait adds a method useful for various hash algorithms to a FixedBuffer struct.

Required Methods

Add standard padding to the buffer. The buffer must not be full when this method is called and is guaranteed to have exactly rem remaining bytes when it returns. If there are not at least rem bytes available, the buffer will be zero padded, processed, cleared, and then filled with zeros again until only rem bytes are remaining.

Provided Methods

Implementors