CryptoSys API Library Manual

Example: Sha1.AddData  Sha1.HexDigest  Sha1.Init  Sha1.Instance 

[VB6 equivalent: SHA1_AddString]

Dim strDigest As String
Dim fIsOK As Boolean
Dim oSha1 As Sha1 = Sha1.Instance()

' Set context handle
fIsOK = oSha1.Init()

Console.WriteLine("SHA1_Init() returns handle = " & fIsOK)
' Remember to check for an invalid handle
If Not fIsOK Then
    Console.WriteLine("ERROR: Failed to set context")
    Exit Sub
End If

' Add strings one by one
oSha1.AddData("a")
oSha1.AddData("bc")

' Set strDigest to be 40 chars
strDigest = oSha1.HexDigest()
Console.WriteLine(strDigest)

See Also:
Sha1.AddData Method (String)

[Contents] [Index]

[PREV: Example: Rng.Number ...]   [Contents]   [Index]   
   [NEXT: Example: Sha1.BytesHash ...]

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