Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

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


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

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

 

 

 

 

 

 

 

 

Digest-MD5 hash a string and encode the result as a URL-encoded string

Download Chilkat C/C++ Libraries for VC++ 9.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 8.0 / Win32

Download Chilkat C/C++ 64-bit Libraries for VC++ 8.0 / x64

Download Chilkat Visual Studio 2005 C/C++ Libs for Windows Mobile, Pocket PC, SmartPhone, WinCE

Download Chilkat C/C++ Libraries for VC++ 7.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 6.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 6.0, Win 95/98/NT4 Compatible

This sample program demonstrates how to Digest-MD5 hash a string and encode the result as a URL-encoded string.

// The Chilkat Encryption library is also available as an ActiveX component
// or .NET class with the identical set of methods and properties.

// Digest-MD5 hash to a URL-encode a string.
void CryptExample(void)
    {
    CkCrypt2 crypt;
    
    // Any string passed to UnlockComponent automatically begins the 30-day trial.
    crypt.UnlockComponent("30-day trial");

    // Use the Digest-MD5 hash algorithm.
    // Other hash algorithms: haval, md2, sha-1 (sha-256), sha-384,sha-512
    crypt.put_HashAlgorithm("md5");
    
    // Set the output string encoding to "URL"
    // Other encoding modes: base64, hex, quoted-printable
    crypt.put_EncodingMode("url");

    CkString strHash;
    crypt.HashStringENC("Hash this string",strHash);

    printf("URL-encoded hash string: %s\n",strHash.getString());

    // PRINTS:
    // URL-encoded hash string: 7f0E%90%92%D7h%2C%2A%2Et%5Dt%AAk

 

 

 

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

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

Mail Component · .NET Mail Component · XML Parser