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 Byte Array to StringDownload: Chilkat .NET Assemblies C# code showing how to SHA-1 hash a byte array and return the result as an encoded string. // Create an instance of the Chilkat encryption class. Chilkat.Crypt2 crypt = new Chilkat.Crypt2(); // Any code begins the 30-day trial. crypt.UnlockComponent("30-day-trial"); // Set the hashing algorithm crypt.HashAlgorithm = "sha-1"; // Indicate that we want Base-64 output. crypt.EncodingMode = "base64"; // Generate some data to be hashed. byte[] inputByteData = new byte[10]; int i; for (i=0; i<10; i++) inputByteData[i] = (byte)(i); string hashStr = crypt.HashBytesENC(inputByteData); MessageBox.Show(hashStr); // Return the hash as a hexidecimalized string. crypt.EncodingMode = "hex"; hashStr = crypt.HashBytesENC(inputByteData); MessageBox.Show(hashStr); // Return the hash as a URL-Encoded string. crypt.EncodingMode = "url"; hashStr = crypt.HashBytesENC(inputByteData); MessageBox.Show(hashStr); Important: The download for this
example does not contain the ChilkatDotNet.dll which |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.