Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Waher.Security.Hashes Class Reference

Contains methods for simple hash calculations. More...

Static Public Member Functions

static string BinaryToString (byte[] Data)
 Converts an array of bytes to a string with their hexadecimal representations (in lower case). More...
 
static string BinaryToString (byte[] Data, bool SpaceDelimiter)
 Converts an array of bytes to a string with their hexadecimal representations (in lower case). More...
 
static byte[] StringToBinary (string s)
 Parses a hex string. More...
 
static string ComputeHashString (HashFunction Function, byte[] Data)
 Computes a hash of a block of binary data. More...
 
static string ComputeHashString (HashFunction Function, Stream Data)
 Computes a hash of a block of binary data. More...
 
static byte[] ComputeHash (HashFunction Function, byte[] Data)
 Computes a hash of a block of binary data. More...
 
static byte[] ComputeHash (HashFunction Function, Stream Data)
 Computes a hash of a block of binary data. More...
 
static string ComputeSHA1HashString (byte[] Data)
 Computes the SHA-1 hash of a block of binary data. More...
 
static string ComputeSHA1HashString (Stream Data)
 Computes the SHA-1 hash of a block of binary data. More...
 
static byte[] ComputeSHA1Hash (byte[] Data)
 Computes the SHA-1 hash of a block of binary data. More...
 
static byte[] ComputeSHA1Hash (Stream Data)
 Computes the SHA-1 hash of a block of binary data. More...
 
static string ComputeSHA256HashString (byte[] Data)
 Computes the SHA-256 hash of a block of binary data. More...
 
static string ComputeSHA256HashString (Stream Data)
 Computes the SHA-256 hash of a block of binary data. More...
 
static byte[] ComputeSHA256Hash (byte[] Data)
 Computes the SHA-256 hash of a block of binary data. More...
 
static byte[] ComputeSHA256Hash (Stream Data)
 Computes the SHA-256 hash of a block of binary data. More...
 
static string ComputeSHA384HashString (byte[] Data)
 Computes the SHA-384 hash of a block of binary data. More...
 
static string ComputeSHA384HashString (Stream Data)
 Computes the SHA-384 hash of a block of binary data. More...
 
static byte[] ComputeSHA384Hash (byte[] Data)
 Computes the SHA-384 hash of a block of binary data. More...
 
static byte[] ComputeSHA384Hash (Stream Data)
 Computes the SHA-384 hash of a block of binary data. More...
 
static string ComputeSHA512HashString (byte[] Data)
 Computes the SHA-512 hash of a block of binary data. More...
 
static string ComputeSHA512HashString (Stream Data)
 Computes the SHA-512 hash of a block of binary data. More...
 
static byte[] ComputeSHA512Hash (byte[] Data)
 Computes the SHA-512 hash of a block of binary data. More...
 
static byte[] ComputeSHA512Hash (Stream Data)
 Computes the SHA-512 hash of a block of binary data. More...
 
static string ComputeMD5HashString (byte[] Data)
 Computes the MD5 hash of a block of binary data. More...
 
static string ComputeMD5HashString (Stream Data)
 Computes the MD5 hash of a block of binary data. More...
 
static byte[] ComputeMD5Hash (byte[] Data)
 Computes the MD5 hash of a block of binary data. More...
 
static byte[] ComputeMD5Hash (Stream Data)
 Computes the MD5 hash of a block of binary data. More...
 
static string ComputeHMACSHA1HashString (byte[] Key, byte[] Data)
 Computes the HMAC-SHA-1 hash of a block of binary data. More...
 
static byte[] ComputeHMACSHA1Hash (byte[] Key, byte[] Data)
 Computes the HMAC-SHA-1 hash of a block of binary data. More...
 
static string ComputeHMACSHA256HashString (byte[] Key, byte[] Data)
 Computes the HMAC-SHA-256 hash of a block of binary data. More...
 
static byte[] ComputeHMACSHA256Hash (byte[] Key, byte[] Data)
 Computes the HMAC-SHA-256 hash of a block of binary data. More...
 
static string ComputeHMACSHA384HashString (byte[] Key, byte[] Data)
 Computes the HMAC-SHA-384 hash of a block of binary data. More...
 
static byte[] ComputeHMACSHA384Hash (byte[] Key, byte[] Data)
 Computes the HMAC-SHA-384 hash of a block of binary data. More...
 
static string ComputeHMACSHA512HashString (byte[] Key, byte[] Data)
 Computes the HMAC-SHA-512 hash of a block of binary data. More...
 
static byte[] ComputeHMACSHA512Hash (byte[] Key, byte[] Data)
 Computes the HMAC-SHA-512 hash of a block of binary data. More...
 

Detailed Description

Contains methods for simple hash calculations.

Definition at line 58 of file Hashes.cs.

Member Function Documentation

◆ BinaryToString() [1/2]

static string Waher.Security.Hashes.BinaryToString ( byte[]  Data)
static

Converts an array of bytes to a string with their hexadecimal representations (in lower case).

Parameters
DataBinary Data
Returns
Hexadecimal string representation.

Definition at line 65 of file Hashes.cs.

◆ BinaryToString() [2/2]

static string Waher.Security.Hashes.BinaryToString ( byte[]  Data,
bool  SpaceDelimiter 
)
static

Converts an array of bytes to a string with their hexadecimal representations (in lower case).

Parameters
DataBinary Data
SpaceDelimiterIf bytes are to be separated by space characters.
Returns
Hexadecimal string representation.

Definition at line 76 of file Hashes.cs.

◆ ComputeHash() [1/2]

static byte[] Waher.Security.Hashes.ComputeHash ( HashFunction  Function,
byte[]  Data 
)
static

Computes a hash of a block of binary data.

Parameters
FunctionHash function.
DataBinary data.
Returns
Hash value.

Definition at line 214 of file Hashes.cs.

◆ ComputeHash() [2/2]

static byte[] Waher.Security.Hashes.ComputeHash ( HashFunction  Function,
Stream  Data 
)
static

Computes a hash of a block of binary data.

Parameters
FunctionHash function.
DataBinary data.
Returns
Hash value.

Definition at line 244 of file Hashes.cs.

◆ ComputeHashString() [1/2]

static string Waher.Security.Hashes.ComputeHashString ( HashFunction  Function,
byte[]  Data 
)
static

Computes a hash of a block of binary data.

Parameters
FunctionHash function.
DataBinary data.
Returns
String representation of hash.

Definition at line 154 of file Hashes.cs.

◆ ComputeHashString() [2/2]

static string Waher.Security.Hashes.ComputeHashString ( HashFunction  Function,
Stream  Data 
)
static

Computes a hash of a block of binary data.

Parameters
FunctionHash function.
DataBinary data.
Returns
String representation of hash.

Definition at line 184 of file Hashes.cs.

◆ ComputeHMACSHA1Hash()

static byte[] Waher.Security.Hashes.ComputeHMACSHA1Hash ( byte[]  Key,
byte[]  Data 
)
static

Computes the HMAC-SHA-1 hash of a block of binary data.

Parameters
KeyBinary key.
DataBinary data.
Returns
Hash value.

Definition at line 556 of file Hashes.cs.

◆ ComputeHMACSHA1HashString()

static string Waher.Security.Hashes.ComputeHMACSHA1HashString ( byte[]  Key,
byte[]  Data 
)
static

Computes the HMAC-SHA-1 hash of a block of binary data.

Parameters
KeyBinary key.
DataBinary data.
Returns
String representation of hash.

Definition at line 545 of file Hashes.cs.

◆ ComputeHMACSHA256Hash()

static byte[] Waher.Security.Hashes.ComputeHMACSHA256Hash ( byte[]  Key,
byte[]  Data 
)
static

Computes the HMAC-SHA-256 hash of a block of binary data.

Parameters
KeyBinary key.
DataBinary data.
Returns
Hash value.

Definition at line 585 of file Hashes.cs.

◆ ComputeHMACSHA256HashString()

static string Waher.Security.Hashes.ComputeHMACSHA256HashString ( byte[]  Key,
byte[]  Data 
)
static

Computes the HMAC-SHA-256 hash of a block of binary data.

Parameters
KeyBinary key.
DataBinary data.
Returns
String representation of hash.

Definition at line 574 of file Hashes.cs.

◆ ComputeHMACSHA384Hash()

static byte[] Waher.Security.Hashes.ComputeHMACSHA384Hash ( byte[]  Key,
byte[]  Data 
)
static

Computes the HMAC-SHA-384 hash of a block of binary data.

Parameters
KeyBinary key.
DataBinary data.
Returns
Hash value.

Definition at line 614 of file Hashes.cs.

◆ ComputeHMACSHA384HashString()

static string Waher.Security.Hashes.ComputeHMACSHA384HashString ( byte[]  Key,
byte[]  Data 
)
static

Computes the HMAC-SHA-384 hash of a block of binary data.

Parameters
KeyBinary key.
DataBinary data.
Returns
String representation of hash.

Definition at line 603 of file Hashes.cs.

◆ ComputeHMACSHA512Hash()

static byte[] Waher.Security.Hashes.ComputeHMACSHA512Hash ( byte[]  Key,
byte[]  Data 
)
static

Computes the HMAC-SHA-512 hash of a block of binary data.

Parameters
KeyBinary key.
DataBinary data.
Returns
Hash value.

Definition at line 643 of file Hashes.cs.

◆ ComputeHMACSHA512HashString()

static string Waher.Security.Hashes.ComputeHMACSHA512HashString ( byte[]  Key,
byte[]  Data 
)
static

Computes the HMAC-SHA-512 hash of a block of binary data.

Parameters
KeyBinary key.
DataBinary data.
Returns
String representation of hash.

Definition at line 632 of file Hashes.cs.

◆ ComputeMD5Hash() [1/2]

static byte[] Waher.Security.Hashes.ComputeMD5Hash ( byte[]  Data)
static

Computes the MD5 hash of a block of binary data.

Parameters
DataBinary data.
Returns
Hash value.

Definition at line 510 of file Hashes.cs.

◆ ComputeMD5Hash() [2/2]

static byte[] Waher.Security.Hashes.ComputeMD5Hash ( Stream  Data)
static

Computes the MD5 hash of a block of binary data.

Parameters
DataBinary data.
Returns
Hash value.

Definition at line 527 of file Hashes.cs.

◆ ComputeMD5HashString() [1/2]

static string Waher.Security.Hashes.ComputeMD5HashString ( byte[]  Data)
static

Computes the MD5 hash of a block of binary data.

Parameters
DataBinary data.
Returns
String representation of hash.

Definition at line 490 of file Hashes.cs.

◆ ComputeMD5HashString() [2/2]

static string Waher.Security.Hashes.ComputeMD5HashString ( Stream  Data)
static

Computes the MD5 hash of a block of binary data.

Parameters
DataBinary data.
Returns
String representation of hash.

Definition at line 500 of file Hashes.cs.

◆ ComputeSHA1Hash() [1/2]

static byte[] Waher.Security.Hashes.ComputeSHA1Hash ( byte[]  Data)
static

Computes the SHA-1 hash of a block of binary data.

Parameters
DataBinary data.
Returns
Hash value.

Definition at line 294 of file Hashes.cs.

◆ ComputeSHA1Hash() [2/2]

static byte[] Waher.Security.Hashes.ComputeSHA1Hash ( Stream  Data)
static

Computes the SHA-1 hash of a block of binary data.

Parameters
DataBinary data.
Returns
Hash value.

Definition at line 311 of file Hashes.cs.

◆ ComputeSHA1HashString() [1/2]

static string Waher.Security.Hashes.ComputeSHA1HashString ( byte[]  Data)
static

Computes the SHA-1 hash of a block of binary data.

Parameters
DataBinary data.
Returns
String representation of hash.

Definition at line 274 of file Hashes.cs.

◆ ComputeSHA1HashString() [2/2]

static string Waher.Security.Hashes.ComputeSHA1HashString ( Stream  Data)
static

Computes the SHA-1 hash of a block of binary data.

Parameters
DataBinary data.
Returns
String representation of hash.

Definition at line 284 of file Hashes.cs.

◆ ComputeSHA256Hash() [1/2]

static byte[] Waher.Security.Hashes.ComputeSHA256Hash ( byte[]  Data)
static

Computes the SHA-256 hash of a block of binary data.

Parameters
DataBinary data.
Returns
Hash value.

Definition at line 348 of file Hashes.cs.

◆ ComputeSHA256Hash() [2/2]

static byte[] Waher.Security.Hashes.ComputeSHA256Hash ( Stream  Data)
static

Computes the SHA-256 hash of a block of binary data.

Parameters
DataBinary data.
Returns
Hash value.

Definition at line 365 of file Hashes.cs.

◆ ComputeSHA256HashString() [1/2]

static string Waher.Security.Hashes.ComputeSHA256HashString ( byte[]  Data)
static

Computes the SHA-256 hash of a block of binary data.

Parameters
DataBinary data.
Returns
String representation of hash.

Definition at line 328 of file Hashes.cs.

◆ ComputeSHA256HashString() [2/2]

static string Waher.Security.Hashes.ComputeSHA256HashString ( Stream  Data)
static

Computes the SHA-256 hash of a block of binary data.

Parameters
DataBinary data.
Returns
String representation of hash.

Definition at line 338 of file Hashes.cs.

◆ ComputeSHA384Hash() [1/2]

static byte[] Waher.Security.Hashes.ComputeSHA384Hash ( byte[]  Data)
static

Computes the SHA-384 hash of a block of binary data.

Parameters
DataBinary data.
Returns
Hash value.

Definition at line 402 of file Hashes.cs.

◆ ComputeSHA384Hash() [2/2]

static byte[] Waher.Security.Hashes.ComputeSHA384Hash ( Stream  Data)
static

Computes the SHA-384 hash of a block of binary data.

Parameters
DataBinary data.
Returns
Hash value.

Definition at line 419 of file Hashes.cs.

◆ ComputeSHA384HashString() [1/2]

static string Waher.Security.Hashes.ComputeSHA384HashString ( byte[]  Data)
static

Computes the SHA-384 hash of a block of binary data.

Parameters
DataBinary data.
Returns
String representation of hash.

Definition at line 382 of file Hashes.cs.

◆ ComputeSHA384HashString() [2/2]

static string Waher.Security.Hashes.ComputeSHA384HashString ( Stream  Data)
static

Computes the SHA-384 hash of a block of binary data.

Parameters
DataBinary data.
Returns
String representation of hash.

Definition at line 392 of file Hashes.cs.

◆ ComputeSHA512Hash() [1/2]

static byte[] Waher.Security.Hashes.ComputeSHA512Hash ( byte[]  Data)
static

Computes the SHA-512 hash of a block of binary data.

Parameters
DataBinary data.
Returns
Hash value.

Definition at line 456 of file Hashes.cs.

◆ ComputeSHA512Hash() [2/2]

static byte[] Waher.Security.Hashes.ComputeSHA512Hash ( Stream  Data)
static

Computes the SHA-512 hash of a block of binary data.

Parameters
DataBinary data.
Returns
Hash value.

Definition at line 473 of file Hashes.cs.

◆ ComputeSHA512HashString() [1/2]

static string Waher.Security.Hashes.ComputeSHA512HashString ( byte[]  Data)
static

Computes the SHA-512 hash of a block of binary data.

Parameters
DataBinary data.
Returns
String representation of hash.

Definition at line 436 of file Hashes.cs.

◆ ComputeSHA512HashString() [2/2]

static string Waher.Security.Hashes.ComputeSHA512HashString ( Stream  Data)
static

Computes the SHA-512 hash of a block of binary data.

Parameters
DataBinary data.
Returns
String representation of hash.

Definition at line 446 of file Hashes.cs.

◆ StringToBinary()

static byte[] Waher.Security.Hashes.StringToBinary ( string  s)
static

Parses a hex string.

Parameters
sString.
Returns
Array of bytes found in the string, or null if not a hex string.

Definition at line 102 of file Hashes.cs.


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