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
Properties
Value
Returns the previously calculated hash.
public DataCrypt Value { get; }
Property Value
Methods
Calculate(DataCrypt)
Calculates hash for fixed length DataCrypt.
public DataCrypt Calculate(DataCrypt dataCrypt)
Parameters
dataCryptDataCryptThe data to compute hash from.
Returns
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
dataCryptDataCryptThe data to compute hash from.
saltDataCryptThe salt data to prefix before hashing.
Returns
Calculate(ref Stream)
Calculates hash on a stream of arbitrary length.
public DataCrypt Calculate(ref Stream stream)
Parameters
streamStreamThe stream to compute hash from.