CryptoSys PKI Pro Manual

Hash.HexFromBytes Method

Create hash digest in hex format of byte input.

Syntax

[C#]
public static string HexFromBytes(
   byte[] message,
   HashAlgorithm hashAlg 
)
[VB]
Public Shared Function HexFromBytes (
   message As Byte(),
   hashAlg As HashAlgorithm 
) As String

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

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

VB6/C equivalent: HASH_HexFromBytes

[Contents] [Index]

[PREV: Hash.Double Method...]   [Contents]   [Index]   
   [NEXT: Hash.HexFromFile Method...]

Copyright © 2004-26 D.I. Management Services Pty Ltd t/a CryptoSys. All rights reserved. Generated 2026-09-21T05:59:39Z.