Class Hasher
The base hasher class.
Implements
Inherited Members
Namespace: Isopoh.Cryptography.Blake2b
Assembly: Isopoh.Cryptography.Blake2b.dll
Syntax
public abstract class Hasher : IDisposable
Methods
| Edit this page View SourceAsHashAlgorithm()
Create a HashAlgorithm from this.
Declaration
public HashAlgorithm AsHashAlgorithm()
Returns
| Type | Description |
|---|---|
| HashAlgorithm | The HashAlgorithm based on this Hasher. |
Dispose()
Zero and release sensitive resources.
Declaration
public void Dispose()
Dispose(bool)
Disposes resources if disposing is true.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | Set to true if disposing. |
Finish()
Generate the hash from the hash's state.
Declaration
public abstract Memory<byte> Finish()
Returns
| Type | Description |
|---|---|
| Memory<byte> | The generated hash. |
Finish(Span<byte>)
Generate the hash from the hash's state.
Declaration
public abstract Span<byte> Finish(Span<byte> hash)
Parameters
| Type | Name | Description |
|---|---|---|
| Span<byte> | hash | Loaded with the hash. |
Returns
| Type | Description |
|---|---|
| Span<byte> | The generated hash. |
Init()
Initialize for hash generation.
Declaration
public abstract void Init()
Update(byte[])
Update the hash's state with the given data.
Declaration
public void Update(byte[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The data to add to the hash's state. |
Update(byte[], int, int)
Update the hash's state with the given data.
Declaration
public void Update(byte[] data, int start, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The data to add to the hash's state. |
| int | start | The index of the first byte of |
| int | count | The number of bytes of |
Update(ReadOnlySpan<byte>)
Update the hash's state with the given data.
Declaration
public abstract void Update(ReadOnlySpan<byte> data)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<byte> | data | The data to add to the hash's state. |