Skip to content

OnixLabs.Core.Text.IBaseValue

matthew edited this page May 27, 2026 · 1 revision

IBaseValue Interface

Defines a Base-N value.

Namespace OnixLabs.Core.Text
Assembly OnixLabs.Core.dll (NuGet)
Implements IBinaryConvertible, ISpanFormattable

Definition

public interface IBaseValue : IBinaryConvertible, ISpanFormattable

Remarks

IBaseValue is the non-generic base contract for the Base-N value types (Base16, Base32, Base58, and Base64). By extending IBinaryConvertible it guarantees access to the underlying bytes, and by extending ISpanFormattable it guarantees span-based formatting. It adds two provider-aware ToString overloads that let callers select the Base-N alphabet through an IFormatProvider.

The strongly typed generic extension of this interface is IBaseValue<T>, which is the contract implemented by the concrete Base-N value structs.

Methods

Method Returns Description
ToString(IFormatProvider?) string Formats the value using the specified format provider.
ToString(ReadOnlySpan<char>, IFormatProvider?) string Formats the value using the specified format and format provider.

ToString(IFormatProvider?)

string ToString(IFormatProvider? formatProvider);

Formats the value of the current instance using the specified format provider.

Parameter Type Description
formatProvider IFormatProvider? The provider to use to format the value.

Returns — The value of the current instance formatted using the specified format provider.

ToString(ReadOnlySpan<char>, IFormatProvider?)

string ToString(ReadOnlySpan<char> format, IFormatProvider? formatProvider);

Formats the value of the current instance using the specified format and format provider.

Parameter Type Description
format ReadOnlySpan<char> The format to use.
formatProvider IFormatProvider? The provider to use to format the value.

Returns — The value of the current instance formatted using the specified format and format provider.

See Also

ONIXLabs .NET Library


Clone this wiki locally