Click or drag to resize

HashHexFromString Method

Create hash digest in hex format of string input.

Namespace: CryptoSysPKI
Assembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.25611 (23.0.0.0)
Syntax
public static string HexFromString(
	string message,
	HashAlgorithm hashAlg
)

Parameters

message  String
Message data string
hashAlg  HashAlgorithm
Hash algorithm to be used

Return Value

String
Message digest in hex-encoded format
Example
C#
string m = "abc";
string s = Hash.HexFromString(m, HashAlgorithm.Sha256);
Console.WriteLine("SHA-256('abc')=\n" + s);
// ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
See Also