Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
MD2 Hash a String to a Base64, Hex, or URL-Encoded String
C# code showing how to MD2 hash a string returning 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 = "md2"; // Indicate that we want Base-64 output. crypt.EncodingMode = "base64"; string inputString = "This string is to be hashed."; string hashStr = crypt.HashStringENC(inputString); MessageBox.Show(hashStr); // Return the hash as a hexidecimalized string. crypt.EncodingMode = "hex"; hashStr = crypt.HashStringENC(inputString); MessageBox.Show(hashStr); // Return the hash as a URL-Encoded string. crypt.EncodingMode = "url"; hashStr = crypt.HashStringENC(inputString); MessageBox.Show(hashStr); Important: The download for this
example does not contain the ChilkatDotNet.dll which |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.