FileDigest

Computes a message digest (hash) for a file.

Syntax:

FileDigest (filename, algorithm, format)

Parameters:

(s) filename: either a fully qualified filename with drive and path, or just a filename and extension.

(s) algorithm: specifies the hash algorithm to use, and can be one of the following:
MD2, MD5, SHA, SHA1, SHA256. ( Note that "SHA" and "SHA1" are the same and "SHA256" requires Windows Vista/2008 or newer.)

(i) format: specifies the format of the returned string.

Returns:

(s) a message digest (hash) for a file.

 

"format" specifies the format of the returned string.  If "format" is 0, the message digest is returned as an unformatted sequence of hex characters, with each byte in the digest represented by two hex characters in the returned string.  For example:

          00112233445566778899AABBCCDDEEFF          (MD2/MD5  = 16 bytes)

          00112233445566778899AABBCCDDEEFF00112233  (SHA/SHA1 = 20 bytes)

          00112233445566778899AABBCCDDEEFF0011223300112233445566778899AABB   (SHA256 = 32 bytes)

If "format" is 1, then hyphens (for MD2 and MD5) or spaces (for SHA and SHA1) are inserted after every 8 characters in the returned string.  For example:

          00112233-44556677-8899AABB-CCDDEEFF           (MD2/MD5  = 16 bytes)

          00112233 44556677 8899AABB CCDDEEFF 00112233  (SHA/SHA1 = 20 bytes)

          00112233 44556677 8899AABB CCDDEEFF 00112233 00112233 44556677 8899AABB   (SHA256 = 32 bytes)