Data.HashFunction 3.1.1
DHF
Loading...
Searching...
No Matches
Data.HashFunction.IStreamableHashFunction Interface Reference

Common interface to non-cryptographic hash functions that can be computed over a stream of data without buffering. More...

+ Inheritance diagram for Data.HashFunction.IStreamableHashFunction:
+ Collaboration diagram for Data.HashFunction.IStreamableHashFunction:

Public Member Functions

IBlockTransformer CreateBlockTransformer ()
 Creates a new transformer that will process data and hold the internal state using this hash function's algorithm.
 
IHashValue ComputeHash (Stream data)
 Computes hash value for given stream.
 
IHashValue ComputeHash (Stream data, CancellationToken cancellationToken)
 Computes hash value for given stream.
 
Task< IHashValueComputeHashAsync (Stream data)
 Computes hash value for given stream asynchronously.
 
Task< IHashValueComputeHashAsync (Stream data, CancellationToken cancellationToken)
 Computes hash value for given stream asynchronously.
 
- Public Member Functions inherited from Data.HashFunction.IHashFunction
IHashValue ComputeHash (byte[] data)
 Computes hash value for given byte array.
 
IHashValue ComputeHash (byte[] data, CancellationToken cancellationToken)
 Computes hash value for given byte array.
 
IHashValue ComputeHash (byte[] data, int offset, int count)
 Computes hash value for given byte array.
 
IHashValue ComputeHash (byte[] data, int offset, int count, CancellationToken cancellationToken)
 Computes hash value for given byte array.
 
IHashValue ComputeHash (ArraySegment< byte > data)
 Computes hash value for given array segment.
 
IHashValue ComputeHash (ArraySegment< byte > data, CancellationToken cancellationToken)
 Computes hash value for given array segment.
 

Additional Inherited Members

- Properties inherited from Data.HashFunction.IHashFunction
int HashSizeInBits [get]
 Size of produced hash, in bits.
 

Detailed Description

Common interface to non-cryptographic hash functions that can be computed over a stream of data without buffering.

Member Function Documentation

◆ ComputeHash() [1/2]

IHashValue Data.HashFunction.IStreamableHashFunction.ComputeHash ( Stream data)

Computes hash value for given stream.

Parameters
dataStream of data to hash.
Returns
Hash value of the data.
Exceptions
ArgumentNullExceptiondata
ArgumentExceptionStream must be readable.;data
ArgumentExceptionStream must be seekable for this type of hash function.;data

Implemented in Data.HashFunction.Core.StreamableHashFunctionBase.

◆ ComputeHash() [2/2]

IHashValue Data.HashFunction.IStreamableHashFunction.ComputeHash ( Stream data,
CancellationToken cancellationToken )

Computes hash value for given stream.

Parameters
dataStream of data to hash.
cancellationTokenA CancellationToken to observe while calculating the hash value.
Returns
Hash value of the data.
Exceptions
ArgumentNullExceptiondata
ArgumentExceptionStream must be readable.;data
ArgumentExceptionStream must be seekable for this type of hash function.;data
TaskCanceledExceptionThe cancellationToken was canceled.

Implemented in Data.HashFunction.Core.StreamableHashFunctionBase.

◆ ComputeHashAsync() [1/2]

Task< IHashValue > Data.HashFunction.IStreamableHashFunction.ComputeHashAsync ( Stream data)

Computes hash value for given stream asynchronously.

Parameters
dataStream of data to hash.
Returns
Hash value of the data.

All stream IO is done via ReadAsync.

Exceptions
ArgumentNullExceptiondata
ArgumentExceptionStream must be readable.;data
ArgumentExceptionStream must be seekable for this type of hash function.;data

Implemented in Data.HashFunction.Core.StreamableHashFunctionBase.

◆ ComputeHashAsync() [2/2]

Task< IHashValue > Data.HashFunction.IStreamableHashFunction.ComputeHashAsync ( Stream data,
CancellationToken cancellationToken )

Computes hash value for given stream asynchronously.

Parameters
dataStream of data to hash.
cancellationTokenA CancellationToken to observe while calculating the hash value.
Returns
Hash value of the data.

All stream IO is done via ReadAsync.

Exceptions
ArgumentNullExceptiondata
ArgumentExceptionStream must be readable.;data
ArgumentExceptionStream must be seekable for this type of hash function.;data
TaskCanceledExceptionThe cancellationToken was canceled.

Implemented in Data.HashFunction.Core.StreamableHashFunctionBase.

◆ CreateBlockTransformer()


The documentation for this interface was generated from the following file: