Class HashAlgorithmType
Represents the type of HashAlgorithm.
It is guaranteed that only one instance is created for the same subclass of HashAlgorithm.
Implements
Inherited Members
Namespace: Libplanet
Assembly: Libplanet.dll
Syntax
[Pure]
public sealed class HashAlgorithmType : IEquatable<HashAlgorithmType>
Properties
| Improve this Doc View SourceDigestSize
The length of bytes of every digest that the HashAlgorithmType makes.
Declaration
[Pure]
public int DigestSize { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Type
The Type object which refers to a subclass of HashAlgorithm.
Declaration
[Pure]
public Type Type { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Methods
| Improve this Doc View SourceDigest(ImmutableArray<Byte>)
Computes a hash digest of the hash algorithm from the given
input bytes.
Declaration
[Pure]
public ImmutableArray<byte> Digest(ImmutableArray<byte> input)
Parameters
| Type | Name | Description |
|---|---|---|
| ImmutableArray<Byte> | input | The bytes to compute its hash. |
Returns
| Type | Description |
|---|---|
| ImmutableArray<Byte> | The hash digest derived from |
Digest(Byte[])
Computes a hash digest of the hash algorithm from the given
input bytes.
Declaration
[Pure]
public byte[] Digest(byte[] input)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte[] | input | The bytes to compute its hash. |
Returns
| Type | Description |
|---|---|
| Byte[] | The hash digest derived from |
Digest(IEnumerable<ImmutableArray<Byte>>)
Computes a hash digest of the hash algorithm from the given chunks of
input bytes.
Declaration
[Pure]
public ImmutableArray<byte> Digest(IEnumerable<ImmutableArray<byte>> chunks)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ImmutableArray<Byte>> | chunks | The chunks of bytes to compute its hash. |
Returns
| Type | Description |
|---|---|
| ImmutableArray<Byte> | The hash digest derivied from input |
Digest(IEnumerable<Byte[]>)
Computes a hash digest of the hash algorithm from the given chunks of
input bytes.
Declaration
[Pure]
public byte[] Digest(IEnumerable<byte[]> chunks)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Byte[]> | chunks | The chunks of bytes to compute its hash. |
Returns
| Type | Description |
|---|---|
| Byte[] | The hash digest derivied from input |
Equals(HashAlgorithmType)
Declaration
[Pure]
public bool Equals(HashAlgorithmType other)
Parameters
| Type | Name | Description |
|---|---|---|
| HashAlgorithmType | other |
Returns
| Type | Description |
|---|---|
| Boolean |
Equals(Object)
Declaration
[Pure]
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj |
Returns
| Type | Description |
|---|---|
| Boolean |
Overrides
| Improve this Doc View SourceGetHashCode()
Declaration
[Pure]
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| Int32 |
Overrides
| Improve this Doc View SourceOf<T>(T)
Creates a HashAlgorithmType which refers to T.
Declaration
[Pure]
public static HashAlgorithmType Of<T>(T objectToInferType = null)
where T : HashAlgorithm
Parameters
| Type | Name | Description |
|---|---|---|
| T | objectToInferType | An optional object to make the compiler infers the
type parameter |
Returns
| Type | Description |
|---|---|
| HashAlgorithmType | A HashAlgorithmType which refers to |
Type Parameters
| Name | Description |
|---|---|
| T | A subclass of HashAlgorithm. |
ToString()
Declaration
[Pure]
public override string ToString()
Returns
| Type | Description |
|---|---|
| String |
Overrides
Operators
| Improve this Doc View SourceEquality(HashAlgorithmType, HashAlgorithmType)
Checks if two HashAlgorithmTypes refers to the same HashAlgorithm class.
Declaration
[Pure]
public static bool operator ==(HashAlgorithmType left, HashAlgorithmType right)
Parameters
| Type | Name | Description |
|---|---|---|
| HashAlgorithmType | left | An instance. |
| HashAlgorithmType | right | Another instance. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Inequality(HashAlgorithmType, HashAlgorithmType)
Checks if two HashAlgorithmTypes do not refer to the different HashAlgorithm class.
Declaration
public static bool operator !=(HashAlgorithmType left, HashAlgorithmType right)
Parameters
| Type | Name | Description |
|---|---|---|
| HashAlgorithmType | left | An instance. |
| HashAlgorithmType | right | Another instance. |
Returns
| Type | Description |
|---|---|
| Boolean |
|