Table of Contents

Base32Variant Enum

Definition

Namespace
Bodu.Text.Encoding
Assembly
Bodu.Text.Encoding.dll
Package
Bodu.Text.Encoding 1.0.0
Source
Base32Variant.cs

Identifies the Base32 alphabet and decoding rules used by Base32.

public enum Base32Variant : byte
Extension Methods

Fields

Standard = 0

RFC 4648 §6 Base32 using the alphabet A-Z followed by 2-7. Encoded output is padded with = characters to align to multiples of eight by default.

HexExtended = 1

RFC 4648 §7 base32hex (sometimes called "hex-extended") using the alphabet 0-9 followed by A-V. Used by NSEC3 DNSSEC labels. Encoded output is padded with = by default.

Crockford = 2

Crockford Base32 - alphabet 0-9 then A-Z with I, L, O, and U excluded to reduce visual ambiguity. The decoder aliases I/L to 1 and O to 0. No padding is emitted by default.

ZBase32 = 3

z-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

ProductVersions
.NET8, 10