C# Class Utilities.Cryptography.ExtensionMethods.HashExtensions

Hash based extensions
Mostra file Open project: feanz/Utilities

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
ToByteArray ( this input, Encoding encodingUsing = null ) : 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 SHA256)
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 SHA256)
encodingUsing System.Text.Encoding Encoding used by the string (defaults to UTF8)
return string