Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
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.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft