Expand description
Base64 encoding and decoding (RFC 4648 §4 + §5).
Zero-dependency replacement for the base64 crate.
§Supply Chain Sovereignty
This module has zero external dependencies. It replaces the base64 crate
for the nexcore ecosystem.
§Alphabets
- Standard (§4):
A-Z a-z 0-9 + /with=padding - URL-safe (§5):
A-Z a-z 0-9 - _with optional padding
§Examples
use nexcore_codec::base64;
let encoded = base64::encode(b"Hello, World!");
assert_eq!(encoded, "SGVsbG8sIFdvcmxkIQ==");
let decoded = base64::decode("SGVsbG8sIFdvcmxkIQ==").unwrap();
assert_eq!(decoded, b"Hello, World!");Enums§
- Decode
Error - Error returned when decoding an invalid Base64 string.
Functions§
- decode
- Decode a standard Base64 string (with or without padding).
- decode_
url_ safe_ no_ pad - Decode a URL-safe Base64 string (without padding).
- encode
- Encode bytes using standard Base64 with
=padding. - encode_
url_ safe - Encode bytes using URL-safe Base64 with
=padding. - encode_
url_ safe_ no_ pad - Encode bytes using URL-safe Base64 without padding.