Class HashAlgorithmExtensions
- Namespace
- Arc4u.Security.Cryptography
- Assembly
- Arc4u.dll
Extension methods for HashAlgorithm.
public static class HashAlgorithmExtensions
- Inheritance
-
HashAlgorithmExtensions
- Inherited Members
Methods
ComputeHash(HashAlgorithm, string, Encoding)
Computes the hash of a string.
public static string ComputeHash(this HashAlgorithm algorithm, string input, Encoding encoding)
Parameters
algorithmHashAlgorithmThe hash algorithm.
inputstringThe string to hash.
encodingEncodingThe encoding used to convert
inputinto bytes.
Returns
- string
The hash as hexadecimal pairs separated by hyphens (the format of ToString(byte[])).
Exceptions
- ArgumentNullException
algorithmorencodingis null.