Class Base64Text
Base64 decoding that reads a value the same way on every runtime. .NET 11 refuses a value whose last character
carries non-zero unused bits (YR== where an encoder writes YQ==); .NET 10 ignores those bits and
decodes both to the same bytes. RFC 4648 §3.5 allows a decoder either behaviour, so each place picks one:
accepts such a value on every runtime (data and digests from a partner, as .NET 10 read
them), refuses it on every runtime (credentials and tokens: one value, one
spelling). Everything else (alphabet, padding, whitespace, errors) is that of
.
public static class Base64Text
Inheritance
Methods
Decode(string)
with the unused bits of the last character read as zero.
public static byte[] Decode(string value)
HasUnusedBitsSet(string)
Whether the last character of value carries non-zero unused bits: the spelling XML Schema
public static bool HasUnusedBitsSet(string value)
TryDecode(string, Span<byte>, out int)
with the unused bits of the last character read as zero.
public static bool TryDecode(string value, Span<byte> bytes, out int bytesWritten)
TryDecodeCanonical(string, Span<byte>, out int)
that refuses a value whose last character has non-zero unused bits on
public static bool TryDecodeCanonical(string value, Span<byte> bytes, out int bytesWritten)