Xceed Encryption Library Documentation
Examples / Hashing a file (VB example)
In This Topic
    Hashing a file (VB example)
    In This Topic
    Visual Basic Copy Code

    Dim xHash As New XceedHashing

    Call xHash.License( "your license key" )

    Dim vaHash As Variant 

    Set xHash.HashingMethod = New XceedSHAHashingMethod 

    On Error Resume Next

    xHash.HashingMethod.HashSize = 256
    Call xHash.ReadFile("c:\temp\source.txt", 0, 0, efpHash, True)
    vaHash = xHash.HashingMethod.HashValue 

    If Err.Number <> 0 Then
      Call MsgBox("Error 0x" & Hex(Err.Number) & " " & Err.Description) 
    Else
      Call MsgBox("Data hashed successfully to " & Str$(LenB(vaHash) * 8) & " bits") 
    End If 

    On Error Goto 0

    Set xHash = Nothing