Skip to main content

encode

Function encode 

Source
pub fn encode(input: &[u8]) -> Result<String, EncodeError>
Expand description

Encodes input as strict standard padded Base64.

This is a convenience wrapper around Engine::encode_string on STANDARD for callers migrating from simpler Base64 APIs. It requires the alloc feature because it returns an owned string.

ยงExamples

assert_eq!(base64_ng::encode(b"hello").unwrap(), "aGVsbG8=");