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 Hash a String returning a URL-Encoded Hash StringDownload: Chilkat .NET Assemblies Source code to SHA-1 hash a string, returning the hash value as a url-encoded string. ' This example uses the Chilkat .NET encryption library, which can be downloaded
' at http://www.chilkatsoft.com/downloads.asp
' Create an instance of the Chilkat encryption class.
Dim crypt As New Chilkat.Crypt2()
' Any code begins the 30-day trial.
crypt.UnlockComponent("30-day-trial")
' Set the hash algorithm to "sha-1"
crypt.HashAlgorithm = "SHA-1"
' Tell the encryption object to return a url-encoded string.
crypt.EncodingMode = "url"
' EncodingMode can be set to "Base64", "QP", or "Hex" also.
' Generate some data to hash...
Dim str As String
Dim i As Integer
For i = 1 To 10
str = str + "This is line " & i & vbCrLf
Next
TextBox1.Text = str
' Create an SHA-1 hash, returning the result as a url-encoded string.
TextBox2.Text = crypt.HashStringENC(str)
Important: The download for this
example does not contain the ChilkatDotNet.dll which |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.