Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
SHA-1 and SHA-256 in Visual Basic 6.0
Demonstrates SHA-1 and SHA-256 in VB6. Private Sub Command16_Click()
Dim crypt As New ChilkatCrypt2
crypt.UnlockComponent "anything for 30-day trial"
crypt.HashAlgorithm = "SHA-1"
crypt.EncodingMode = "hex"
s = "The quick brown fox jumps over the lazy dog"
sHex = crypt.HashStringENC(s)
' Displays: 2FD4E1C67A2D28FCED849EE1BB76E7391B93EB12
' This is identical to the results published at http://en.wikipedia.org/wiki/SHA-1
' (assuming the Wikipedia page has not changed since 20-Nov-2006)
MsgBox "SHA-1: " + sHex
crypt.HashAlgorithm = "SHA-256"
sHex = crypt.HashStringENC(s)
' Displays: D7A8FBB307D7809469CA9ABCB0082E4F8D5651E46D3CDB762D02D0BF37C9E592
' This is identical to the results published at http://en.wikipedia.org/wiki/SHA-1
' (assuming the Wikipedia page has not changed since 20-Nov-2006)
MsgBox "SHA-256: " + sHex
End Sub
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.