Repository navigation
OnixLabs.Core.Text.Base64FormatProvider
Represents a Base-64 format provider.
| Namespace | OnixLabs.Core.Text |
| Assembly | OnixLabs.Core.dll (NuGet) |
| Inheritance |
object → Enumeration<Base64FormatProvider> → Base64FormatProvider
|
| Implements |
IEquatable<Base64FormatProvider>, IComparable<Base64FormatProvider>, IComparable, IFormatProvider
|
public sealed class Base64FormatProvider : Enumeration<Base64FormatProvider>, IFormatProviderBase64FormatProvider is a smart enumeration that carries the alphabet used by Base64Codec to validate encoding and decoding operations. It derives from Enumeration<Base64FormatProvider> and implements IFormatProvider.
A single entry, Rfc4648, is declared. Unlike the other format providers, Base64FormatProvider does not vary the alphabet used by the underlying codec — Base64Codec always delegates to Convert.ToBase64String and Convert.FromBase64String. The provider is used to validate that the codec was invoked with a compatible format provider: supplying a provider of a different type causes the Try* operations to return false and the Encode/Decode operations to throw FormatException.
Because the type derives from Enumeration<T>, all entries are also available through the inherited static query methods such as GetAll, FromName, and FromValue.
The field is declared as public static readonly Base64FormatProvider.
| Field | Description |
|---|---|
Rfc4648 |
The RFC 4648 Base-64 format provider. Alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=. |
public static readonly Base64FormatProvider Rfc4648;The RFC 4648 Base-64 format provider. Alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=. This is the only declared entry and the default provider used by Base64Codec.
| Property | Type | Description |
|---|---|---|
Alphabet |
string |
Gets the Base-64 alphabet associated with the current format provider. |
public string Alphabet { get; }Gets the alphabet of the current Base64FormatProvider instance.
| Method | Returns | Description |
|---|---|---|
GetFormat(Type?) |
object? |
Returns the current instance when formatType is typeof(Base64FormatProvider); otherwise, returns null. |
public object? GetFormat(Type? formatType)Returns the current instance when formatType is typeof(Base64FormatProvider); otherwise, returns null. This is the IFormatProvider contract method that allows the format provider to be passed to any API that accepts IFormatProvider.
| Parameter | Type | Description |
|---|---|---|
formatType |
Type? |
The type of format object to obtain. |
Returns — The current instance if formatType is typeof(Base64FormatProvider); otherwise, null.
ONIXLabs .NET Library · Repository · NuGet · License (Apache-2.0)
Copyright © ONIXLabs 2020. Licensed under the Apache License, Version 2.0.
- Enumeration<T>
- Optional<T>
- OptionalEqualityComparer<T>
- OptionalExtensions
- Result
- Result<T>
- ResultEqualityComparer<T>
- ResultExtensions
- Specification<T>
- Preconditions
- IValueEquatable<T>
- IValueComparable<T>
- IBinaryConvertible
- ISpanBinaryConvertible
- IMemoryBinaryConvertible
- ArrayExtensions
- ComparableExtensions
- DateTimeExtensions
- ISpanParsableExtensions
- ObjectExtensions
- RandomExtensions
- ReadOnlySequenceExtensions
- ReadOnlySpanExtensions
- StringExtensions
- Base16
- Base32
- Base58
- Base64
- IBaseCodec
- IBaseValue
- IBaseValue<T>
- Base16Codec
- Base32Codec
- Base58Codec
- Base64Codec
- Base16FormatProvider
- Base32FormatProvider
- Base58FormatProvider
- Base64FormatProvider
- EncodingExtensions
- ReadOnlySpanExtensions
- StringBuilderExtensions
- BigDecimal
- BigDecimalEqualityComparer
- BigDecimalOrdinalityComparer
- NumberInfo
- NumberInfoEqualityComparer
- NumberInfoOrdinalityComparer
- Int256
- Int512
- UInt256
- UInt512
- Float128
- Float256
- GenericMath
- NumericsExtensions
- ConversionMode
- ScaleMode
- Hash
- NamedHash
- Sha3
- Sha3Hash224
- Sha3Hash256
- Sha3Hash384
- Sha3Hash512
- Sha3Shake128
- Sha3Shake256
- MerkleTree
- MerkleTree<T>
- PrivateKey
- PublicKey
- NamedPrivateKey
- NamedPublicKey
- EcdhPrivateKey
- EcdhPublicKey
- EcdsaPrivateKey
- EcdsaPublicKey
- EddsaPrivateKey
- EddsaPublicKey
- RsaPrivateKey
- RsaPublicKey
- DigitalSignature
- DigitalSignatureAndPublicKey
- Salt
- Secret
- ICryptoPrimitive<T>
- IHashable
- IEcdhPrivateKey
- IEcdsaPrivateKey
- IEddsaPrivateKey
- IRsaPrivateKey
- IPrivateKeyDerivable<T>
- IPrivateKeyExportable
- IPrivateKeyImportable<T>
- IPrivateKeyPemImportable<T>
- IPrivateKeyPkcs8Exportable
- IPrivateKeyPkcs8Importable<T>
- IPrivateKeyPkcs8PemExportable
- IPrivateKeyRawExportable
- IPrivateKeyRawImportable<T>
- IPrivateKeyRawPemExportable
- IEcdhPublicKey
- IEcdsaPublicKey
- IEddsaPublicKey
- IRsaPublicKey
- IPublicKeyExportable
- IPublicKeyImportable<T>
- IPublicKeyPemExportable
- IPublicKeyPemImportable<T>
- IPublicKeyRawExportable
- IPublicKeyRawImportable<T>
- HashAlgorithmExtensions
- ReadOnlySpanExtensions