C# Class Yea.Encryption.HashExtensions

Hash based extensions
Mostrar archivo Open project: OxPatient/Rule-Engine

Public Methods

Method Description
Hash ( this data, HashAlgorithm algorithm = null ) : byte[]

Computes the hash of a byte array

Hash ( this data, HashAlgorithm algorithm = null, Encoding encodingUsing = null ) : string

Computes the hash of a string

Private Methods

Method Description
GenerateSalt ( this random, int size ) : byte[]

Method Details

Hash() public static method

Computes the hash of a byte array
public static Hash ( this data, HashAlgorithm algorithm = null ) : byte[]
data this Byte array to hash
algorithm System.Security.Cryptography.HashAlgorithm Hash algorithm to use (defaults to SHA1)
return byte[]

Hash() public static method

Computes the hash of a string
public static Hash ( this data, HashAlgorithm algorithm = null, Encoding encodingUsing = null ) : string
data this string to hash
algorithm System.Security.Cryptography.HashAlgorithm Algorithm to use (defaults to SHA1)
encodingUsing System.Text.Encoding Encoding used by the string (defaults to UTF8)
return string