Skip to content

GetHash Method ​

Definition ​

  • Namespace: JASE
  • Assembly: JASE.dll

Overloads ​

NameDescription
byte[] GetHash(byte[] input, HashProvider? provider = null, int loop = null)Computes a hash over the specified byte array using the requested provider.
byte[] GetHash(object input, HashProvider? provider = null, int loop = null)Computes a hash over the JSON-serialized representation of the specified object.
byte[] GetHash(string input, HashProvider? provider = null, int loop = null)Computes a hash over the specified string using the requested provider.

byte[] GetHash(byte[] input, HashProvider? provider = null, int loop = null) ​

csharp
byte[] GetHash(byte[] input, HashProvider? provider = null, int loop = null)

Computes a hash over the specified byte array using the requested provider.

Parameters ​

NameDescription
inputThe input bytes to hash.
loopOptional number of additional iterations to hash the result. Provided for legacy compatibility.
providerThe hash provider to use. Defaults to DefaultHashalgorithm if null.

Returns ​

The hash bytes.

byte[] GetHash(object input, HashProvider? provider = null, int loop = null) ​

csharp
byte[] GetHash(object input, HashProvider? provider = null, int loop = null)

Computes a hash over the JSON-serialized representation of the specified object.

Parameters ​

NameDescription
inputThe object to hash. It will be serialized to UTF-8 JSON.
loopOptional number of additional iterations to hash the result. A value greater than zero recomputes the hash over its own output loop times. Provided for legacy compatibility and should generally be left at 0.
providerThe hash provider to use. Defaults to DefaultHashalgorithm if null.

Returns ​

The hash bytes.

byte[] GetHash(string input, HashProvider? provider = null, int loop = null) ​

csharp
byte[] GetHash(string input, HashProvider? provider = null, int loop = null)

Computes a hash over the specified string using the requested provider.

Parameters ​

NameDescription
inputThe input text to hash.
loopOptional number of additional iterations to hash the result. Provided for legacy compatibility.
providerThe hash provider to use. Defaults to DefaultHashalgorithm if null.

Returns ​

The hash bytes.