pub fn encode_in_slice(content: &[u8], slice: &mut [u8]) -> Result<usize, EncodingError> {
    let required_slice_size = compute_encoded_size(content.len());

    if slice.len() < required_slice_size {
        return Err(EncodingError::NotEnoughSpaceInSlice {
            actual: slice.len(),
            required: required_slice_size,
        });
    }

    encode_in_writer(content, &mut std::io::Cursor::new(slice))
}
/// Encodes a list of bytes into a G60 encoding format.
/// The result is placed into `slice` and returns the number of elements written.
///
/// # Errors
/// An error will be thrown if `slice` does not have at least `ceil(11 * content.len() / 8)` of size.
Encodes a list of bytes into a G60 encoding format.
The result is placed into `slice` and returns the number of elements written.
Encodes a list of bytes into a G60 encoding format . The result is placed into ` slice ` and returns the number of elements written .
pub fn encode_in_slice(content: &[u8], slice: &mut [u8]) -> Result<usize, EncodingError> {
    let required_slice_size = compute_encoded_size(content.len());
    if slice.len() < required_slice_size {
        return Err(EncodingError::NotEnoughSpaceInSlice {
            actual: slice.len(),
            required: required_slice_size,
        });
    }
    encode_in_writer(content, &mut std::io::Cursor::new(slice))
}
pub fn encode_in_slice ( content : & [ u8 ] , slice : & mut [ u8 ] ) -> Result < usize , EncodingError > { let required_slice_size = compute_encoded_size ( content . len ( ) ) ; if slice . len ( ) < required_slice_size { return Err ( EncodingError :: NotEnoughSpaceInSlice { actual : slice . len ( ) , required : required_slice_size , } ) ; } encode_in_writer ( content , & mut std :: io :: Cursor :: new ( slice ) ) }
Encodes a list of bytes into a G60 encoding format.
Encodes a list of bytes into a G60 encoding format .
content
&[u8]
slice
&mut [u8]
content
&[u8]
slice
&mut [u8]
errors
An error will be thrown if `slice` does not have at least `ceil(11 * content.len() / 8)` of size.
An error will be thrown if ` slice ` does not have at least ` ceil ( 11 * content . len () / 8 ) ` of size .