Table of Contents

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

algorithm HashAlgorithm

The hash algorithm.

input string

The string to hash.

encoding Encoding

The encoding used to convert input into bytes.

Returns

string

The hash as hexadecimal pairs separated by hyphens (the format of ToString(byte[])).

Exceptions

ArgumentNullException

algorithm or encoding is null.