| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Calculates a message digest for a stream of data using the MD5 algorithm.
HB_MD5( <cString> ) --> cMD5
The function returns a character string of 32 characters which is the message digest of <cString>.
HB_MD5() is a cryptographic hash function wich accepts a variable length character string (or message) as input, and produces a fixed length string as output, also known as Message Digest or Digital Fingerprint. The algorithm used is the MD5 algorithm.
| See also: | HB_CheckSum(), HB_CRC32(), HB_MD5File() |
| Category: | Checksum functions , xHarbour extensions |
| Source: | rtl\hbmd5.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example displays the message digest of severeal character
// strings, including null string.
PROCEDURE Main
? HB_MD5("") // result: d41d8cd98f00b204e9800998ecf8427e
? HB_MD5("a") // result: 0cc175b9c0f1b6a831c399e269772661
? HB_MD5("abc") // result: 900150983cd24fb0d6963f7d28e17f72
? HB_MD5("message digest")
// result: f96b697d7cb7938d525a2f31aaf161d0
RETURN
http://www.xHarbour.com