Export (0) Print
Expand All

HashAlgorithm.Create Method (String)

Creates an instance of the specified implementation of a hash algorithm.

Namespace:  System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

public static HashAlgorithm Create(
	string hashName
)

Parameters

hashName
Type: System.String

The hash algorithm implementation to use. The following table shows the valid values for the hashName parameter and the algorithms they map to.

Parameter value

Implements

SHA

SHA1CryptoServiceProvider

SHA1

SHA1CryptoServiceProvider

System.Security.Cryptography.SHA1

SHA1CryptoServiceProvider

System.Security.Cryptography.HashAlgorithm

SHA1CryptoServiceProvider

MD5

MD5CryptoServiceProvider

System.Security.Cryptography.MD5

MD5CryptoServiceProvider

SHA256

SHA256Managed

SHA-256

SHA256Managed

System.Security.Cryptography.SHA256

SHA256Managed

SHA384

SHA384Managed

SHA-384

SHA384Managed

System.Security.Cryptography.SHA384

SHA384Managed

SHA512

SHA512Managed

SHA-512

SHA512Managed

System.Security.Cryptography.SHA512

SHA512Managed

Return Value

Type: System.Security.Cryptography.HashAlgorithm
A new instance of the specified hash algorithm, or null if hashName is not a valid hash algorithm.

.NET Framework

Supported in: 4.5.3, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft