| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Calculates a message digest for a file using the MD5 algorithm.
HB_MD5File( <cFileName> ) --> cMD5
The function returns a character string of 32 characters which is the message digest of the file specified.
HB_MD5File() does the same as HB_MD5() but processes an entire file rather than a character string. The result is the message digest of the file <cFileName> which can be used to detect if the file is changed.
| See also: | HB_CheckSum(), HB_CRC32(), HB_MD5() |
| Category: | Checksum functions , xHarbour extensions |
| Source: | rtl\hbmd5.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example implements a simple command line tool that
// displays the MD5 message digest of a file.
PROCEDURE Main( cFileName )
IF PCount() > 0 .AND. File( cFileName )
? HB_MD5File( cFileName )
ELSE
? "Usage: MD5File <filename>"
ENDIF
RETURN
http://www.xHarbour.com