Expand description
base64 encoding and decoding.
This module provides base64 encoding/decoding using a 64-character alphabet. Both padded and unpadded variants are available.
Constants§
- PADDED
- Padded base64 encoding (alias of STD).
- RAW
- Raw base64 encoding without padding.
- STD
- Standard base64 encoding with padding.
Functions§
- decode
- Decodes base64 encoded bytes with padding.
- decode_
len - Returns the decoded output length for padded input.
- decode_
mut - Decodes base64 encoded bytes into a mutable buffer with padding.
- decode_
n - Decodes a fixed-size base64 array with padding.
- decode_
raw - Decodes base64 encoded bytes without padding.
- decode_
raw_ len - Returns the decoded output length for unpadded input.
- decode_
raw_ mut - Decodes base64 encoded bytes into a mutable buffer without padding.
- decode_
raw_ n - Decodes a fixed-size base64 array without padding.
- decode_
writer - Creates a decoding writer that wraps an
io::Write.\n\nThe writer buffers base64 encoded bytes with padding, decodes them, and writes the raw output to the inner writer.\n\n# Examples\n\n\nuse omp_core::base64;\nuse std::io::Write;\n\nlet mut output = Vec::new();\nlet encoded = base64::encode(b\"Hello\").into_vec();\nlet mut writer = base64::decode_writer(&mut output);\nwriter.write_all(&encoded).unwrap();\nwriter.flush().unwrap();\nassert_eq!(output, b\"Hello\");\n\n - decode_
writer_ raw - Creates a decoding writer for unpadded base64.\n\nThe writer buffers base64 encoded bytes without padding, decodes them, and writes the raw output to the inner writer.\n\n# Examples\n\n
\nuse omp_core::base64;\nuse std::io::Write;\n\nlet mut output = Vec::new();\nlet encoded = base64::encode_raw(b\"Hello\").into_vec();\nlet mut writer = base64::decode_writer_raw(&mut output);\nwriter.write_all(&encoded).unwrap();\nwriter.flush().unwrap();\nassert_eq!(output, b\"Hello\");\n\n - encode
- Encodes a byte slice to base64 with padding.
- encode_
len - Returns the encoded length including padding.
- encode_
mut - Encodes bytes into a mutable buffer with padding.
- encode_
n - Encodes a fixed-size byte array to base64 with padding.
- encode_
raw - Encodes a byte slice to base64 without padding.
- encode_
raw_ len - Returns the encoded length without padding.
- encode_
raw_ mut - Encodes bytes into a mutable buffer without padding.
- encode_
raw_ n - Encodes a fixed-size byte array to base64 without padding.
- encode_
writer - Creates an encoding writer that wraps an
io::Write.\n\nThe writer buffers raw bytes, encodes them to base64 with padding, and writes the encoded output to the inner writer.\n\n# Examples\n\n\nuse omp_core::base64;\nuse std::io::Write;\n\nlet mut output = Vec::new();\nlet mut writer = base64::encode_writer(&mut output);\nwriter.write_all(b\"Hello\").unwrap();\nwriter.flush().unwrap();\n\n - encode_
writer_ raw - Creates an encoding writer for unpadded base64.\n\nThe writer buffers raw bytes, encodes them to base64 without padding, and writes the encoded output to the inner writer.\n\n# Examples\n\n
\nuse omp_core::base64;\nuse std::io::Write;\n\nlet mut output = Vec::new();\nlet mut writer = base64::encode_writer_raw(&mut output);\nwriter.write_all(b\"Hello\").unwrap();\nwriter.flush().unwrap();\n\n