[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)