Base32Variant Enum
Definition
Identifies the Base32 alphabet and decoding rules used by Base32.
public enum Base32Variant : byte
- Extension Methods
Fields
Standard = 0RFC 4648 §6 Base32 using the alphabet
A-Zfollowed by2-7. Encoded output is padded with=characters to align to multiples of eight by default.HexExtended = 1RFC 4648 §7 base32hex (sometimes called "hex-extended") using the alphabet
0-9followed byA-V. Used by NSEC3 DNSSEC labels. Encoded output is padded with=by default.Crockford = 2Crockford Base32 - alphabet
0-9thenA-ZwithI,L,O, andUexcluded to reduce visual ambiguity. The decoder aliasesI/Lto1andOto0. No padding is emitted by default.ZBase32 = 3z-base-32 - a lowercase, human-oriented alphabet designed for spoken transmission. No padding is emitted by default.
Remarks
Each variant differs in its alphabet, default casing, padding convention, and decoder leniency around visually ambiguous characters. The encoder always emits the canonical case for the chosen variant; the decoder is case-insensitive for every variant.
byte[] payload = { 0xDE, 0xAD, 0xBE, 0xEF };
var rfc = Base32.Encode(payload); // RFC 4648 alphabet
var hex = Base32.Encode(payload, Base32Variant.HexExtended); // sortable hex-extended
var human = Base32.Encode(payload, Base32Variant.Crockford); // transcription-safe
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |