HashBytesFromBytes Method |
Create hash digest in byte format of byte input.
Namespace: CryptoSysPKIAssembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.25611 (23.0.0.0)
Syntaxpublic static byte[] BytesFromBytes(
byte[] message,
HashAlgorithm hashAlg
)
Public Shared Function BytesFromBytes (
message As Byte(),
hashAlg As HashAlgorithm
) As Byte()
Parameters
- message Byte
- Message data in byte format
- hashAlg HashAlgorithm
- Hash algorithm to be used
Return Value
ByteMessage digest in byte format
Examplebyte[] m = { 0x61, 0x62, 0x63 };
byte[] h = Hash.BytesFromBytes(m, HashAlgorithm.Sha256);
Console.WriteLine("SHA-256(b'abc')=\n" + h.ToHex());
See Also