Visual Basic Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
String
Tar
Unicode
Upload
XML
XMP
Zip Compression

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor


VB Strings
VB Byte Array

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

 

Haval Hash Algorithm

Download Chilkat Crypt ActiveX

VB6 source code example showing how to create a hash of a file using the Haval algorithm.

Private Sub Command1_Click()

    Dim nfile As Long
    Dim filelength As Long ' length of document
    Dim filedata As Variant ' file data read from document
        
    Dim crypt As New ChilkatCrypt2
    crypt.UnlockComponent "UnlockCode"
    
    ' Read the file as binary data.
    nfile = FreeFile
    Open "hashThis.txt" For Binary As nfile
    filelength = LOF(nfile)
    filedata = InputB(filelength, nfile)
    
    ' The hash length can be 128, 160, 192, 224, or 256 bits.
    crypt.HashAlgorithm = "haval"
    ' Set the length of the hash to 128 bits.
    crypt.KeyLength = 128
    ' Provide output as a hex-encoded string.
    crypt.EncodingMode = "hex"
    
    Text1.Text = crypt.HashBytesENC(filedata)
    
    ' Do it again, but return the result as a base-64 encoded string.
    crypt.EncodingMode = "base64"
    Text2.Text = crypt.HashBytesENC(filedata)
    
End Sub
 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.