CryptoSys API Library Manual

Example: Md5.AddData  Md5.HexDigest  Md5.Init  Md5.Instance  (2)

[VB6 equivalent: MD5_AddString]

Dim strDigest As String
Dim i As Integer
Dim sA1000 As String
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

' Create a string of 1000 'a's
sA1000 = New String("a"c, 1000)

' Add 1000 times => one million repetitions of "a"
For i = 1 To 1000
    oMd5.AddData(sA1000)
Next
strDigest = oMd5.HexDigest()
Console.WriteLine(strDigest)

See Also:
Md5.AddData Method (String)

[Contents] [Index]

[PREV: Example: Md5.AddData ...]   [Contents]   [Index]   
   [NEXT: Example: Md5.BytesHash ...]

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