Click or drag to resize

HashHexFromBytes Method

Create hash digest in hex format of byte input.

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

Parameters

message  Byte
Message data in byte format
hashAlg  HashAlgorithm
Hash algorithm to be used

Return Value

String
Message digest in hex-encoded format
Example
C#
byte[] m = { 0x61, 0x62, 0x63 };  // "abc" in byte array
string s = Hash.HexFromBytes(m, HashAlgorithm.Sha256);
Console.WriteLine("SHA-256(b'abc')=\n" + s);
// ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
See Also