Click or drag to resize

HashBytesFromBytes Method

Create hash digest in byte format of byte input.

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

Parameters

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

Return Value

Byte
Message digest in byte format
Example
C#
byte[] m = { 0x61, 0x62, 0x63 };  // "abc" in byte array
byte[] h = Hash.BytesFromBytes(m, HashAlgorithm.Sha256);
Console.WriteLine("SHA-256(b'abc')=\n" + h.ToHex());
// BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD
See Also