Skip to content

OnixLabs.Core.Text

matthew edited this page May 27, 2026 · 3 revisions

OnixLabs.Core.Text Namespace

The OnixLabs.Core.Text namespace provides strongly typed Base-N value types, the codecs and format providers that encode and decode them, and text-oriented extension methods.

Namespace OnixLabs.Core.Text
Assembly OnixLabs.Core.dll (NuGet)

Remarks

The Base16, Base32, Base58, and Base64 types wrap binary data as an immutable, strongly typed text value with value semantics, so an encoded string is modelled as a distinct type rather than a bare string. Each value type parses and formats through a corresponding codec and format providers, which perform the actual Base-N encode and decode and honour a format string. The extension methods augment common text and binary BCL types — Encoding, ReadOnlySpan<byte>, and StringBuilder.

Bring the namespace into scope with using OnixLabs.Core.Text;.

Types in this namespace

Base-N value types

Type Description
Base16 Strongly typed Base-16 (hexadecimal) value.
Base32 Strongly typed Base-32 value.
Base58 Strongly typed Base-58 value.
Base64 Strongly typed Base-64 value.

Codec and value contracts

Type Description
IBaseCodec Base-N codec contract (encode/decode).
IBaseValue Non-generic Base-N value contract.
IBaseValue<T> Generic Base-N value contract.

Codecs

Type Description
Base16Codec Base-16 codec.
Base32Codec Base-32 codec.
Base58Codec Base-58 codec.
Base64Codec Base-64 codec.

Format providers

Type Description
Base16FormatProvider Base-16 format provider.
Base32FormatProvider Base-32 format provider.
Base58FormatProvider Base-58 format provider.
Base64FormatProvider Base-64 format provider.

Extensions

Type Description
EncodingExtensions Extensions for Encoding.
ReadOnlySpanExtensions Base-N conversion extensions for ReadOnlySpan<byte>.
StringBuilderExtensions Extensions for StringBuilder.

See Also

ONIXLabs .NET Library


Clone this wiki locally