CryptoSys API Library Manual

Example: Md5.AddData  Md5.HexDigest  Md5.Init  Md5.Instance 

[VB6 equivalent: MD5_AddBytes]

Dim strDigest As String
Dim abData(1) As Byte
Dim fIsOK As Boolean
Dim oMd5 As Md5 = Md5.Instance()

fIsOK = oMd5.Init()
If Not fIsOK Then
    Console.WriteLine("ERROR: Failed to set context")
    Exit Sub
End If

' Set up a test array of bytes
abData(0) = Asc("a")
abData(1) = &H62    ' same as Asc("b")
' Add mixture of bytes and strings
oMd5.AddData(abData)
oMd5.AddData("c")

' Set strDigest to be 32 chars
strDigest = oMd5.HexDigest()
Console.WriteLine(strDigest)

See Also:
Md5.AddData Method (Byte[])

[Contents] [Index]

[PREV: Example: Mac.HexFromHex ...]   [Contents]   [Index]   
   [NEXT: Example: Md5.AddData ...]

Copyright © 2001-23 D.I. Management Services Pty Ltd. All rights reserved. Generated 2023-05-20T13:01:10Z.