Table of Contents

Class Hash

Namespace
SunamoShared.Crypting
Assembly
SunamoShared.dll

Hash functions are fundamental to modern cryptography. These functions map binary strings of an arbitrary length to small binary strings of a fixed length, known as hash values. A cryptographic hash function has the property that it is computationally infeasible to find two distinct inputs that hash to the same value. Hash functions are commonly used with digital signatures and for data integrity.

public class Hash
Inheritance
Hash
Inherited Members
Extension Methods

Constructors

Hash(Provider)

Instantiates a new hash of the specified type.

public Hash(Hash.Provider provider)

Parameters

provider Hash.Provider

The hash algorithm provider to use.

Properties

Value

Returns the previously calculated hash.

public DataCrypt Value { get; }

Property Value

DataCrypt

Methods

Calculate(DataCrypt)

Calculates hash for fixed length DataCrypt.

public DataCrypt Calculate(DataCrypt dataCrypt)

Parameters

dataCrypt DataCrypt

The data to compute hash from.

Returns

DataCrypt

Calculate(DataCrypt, DataCrypt)

Calculates hash for a string with a prefixed salt value. A "salt" is random data prefixed to every hashed value to prevent common dictionary attacks.

public DataCrypt Calculate(DataCrypt dataCrypt, DataCrypt salt)

Parameters

dataCrypt DataCrypt

The data to compute hash from.

salt DataCrypt

The salt data to prefix before hashing.

Returns

DataCrypt

Calculate(ref Stream)

Calculates hash on a stream of arbitrary length.

public DataCrypt Calculate(ref Stream stream)

Parameters

stream Stream

The stream to compute hash from.

Returns

DataCrypt