Repository navigation
OnixLabs.Core.Text.IBaseValue T
Defines a generic base encoding representation.
| Namespace | OnixLabs.Core.Text |
| Assembly | OnixLabs.Core.dll (NuGet) |
| Implements |
IValueEquatable<T>, ISpanParsable<T>, IBaseValue
|
public interface IBaseValue<T> : IValueEquatable<T>, ISpanParsable<T>, IBaseValue
where T : struct, IBaseValue<T>| Parameter | Description |
|---|---|
T |
The underlying value type implementing the base encoding representation. The constraint where T : struct, IBaseValue<T> is the curiously recurring template pattern, restricting T to a value type that implements this interface in terms of itself. |
IBaseValue<T> is the strongly typed contract implemented by the concrete Base-N value structs (Base16, Base32, Base58, and Base64). In addition to value equality (via IValueEquatable<T>), span parsing (via ISpanParsable<T>), and the formatting members inherited from IBaseValue, it declares a family of static abstract implicit conversion operators. These allow any byte- or character-based buffer — a span, memory, or buffer sequence — to be converted into a T instance without an explicit cast. The character-based conversions use the default Encoding.
| Operator | Description |
|---|---|
implicit operator T(ReadOnlySpan<byte>) |
Converts a byte span into a new T instance. |
implicit operator T(ReadOnlyMemory<byte>) |
Converts a byte memory region into a new T instance. |
implicit operator T(ReadOnlySequence<byte>) |
Converts a byte buffer sequence into a new T instance. |
implicit operator T(ReadOnlySpan<char>) |
Converts a character span into a new T instance using the default Encoding. |
implicit operator T(ReadOnlyMemory<char>) |
Converts a character memory region into a new T instance using the default Encoding. |
implicit operator T(ReadOnlySequence<char>) |
Converts a character buffer sequence into a new T instance using the default Encoding. |
public static abstract implicit operator T(ReadOnlySpan<byte> value);Implicitly converts the specified ReadOnlySpan<byte> into a new T instance.
| Parameter | Type | Description |
|---|---|---|
value |
ReadOnlySpan<byte> |
The value to convert. |
Returns — A new T instance converted from value.
public static abstract implicit operator T(ReadOnlyMemory<byte> value);Implicitly converts the specified ReadOnlyMemory<byte> into a new T instance.
| Parameter | Type | Description |
|---|---|---|
value |
ReadOnlyMemory<byte> |
The value to convert. |
Returns — A new T instance converted from value.
public static abstract implicit operator T(ReadOnlySequence<byte> value);Implicitly converts the specified ReadOnlySequence<byte> into a new T instance.
| Parameter | Type | Description |
|---|---|---|
value |
ReadOnlySequence<byte> |
The value to convert. |
Returns — A new T instance converted from value.
public static abstract implicit operator T(ReadOnlySpan<char> value);Implicitly converts the specified ReadOnlySpan<char> into a new T instance using the default Encoding.
| Parameter | Type | Description |
|---|---|---|
value |
ReadOnlySpan<char> |
The value to convert. |
Returns — A new T instance converted from value.
public static abstract implicit operator T(ReadOnlyMemory<char> value);Implicitly converts the specified ReadOnlyMemory<char> into a new T instance using the default Encoding.
| Parameter | Type | Description |
|---|---|---|
value |
ReadOnlyMemory<char> |
The value to convert. |
Returns — A new T instance converted from value.
public static abstract implicit operator T(ReadOnlySequence<char> value);Implicitly converts the specified ReadOnlySequence<char> into a new T instance using the default Encoding.
| Parameter | Type | Description |
|---|---|---|
value |
ReadOnlySequence<char> |
The value to convert. |
Returns — A new T instance converted from value.
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