Command AP Get file MD5 digest

4D Pack

AP Get file MD5 digest

version 11


AP Get file MD5 digest (filePath; digest{; fork}) Longint

ParameterTypeDescription
filePathTextComplete pathname of file
digestTestMD5 Digest of file
forkLongint0=Data fork, 1=Resource fork

Function result Longint Error code

Description

The AP Get file MD5 digest command returns the MD5 digest key of a specific document. The MD5 (Message Digest 5) algorithm is a hashing function used for encrypting data.

Pass the name of the document containing the key in the filePath parameter. The MD5 digest key is returned in the digest parameter.

The fork parameter can be used to set, under Mac OS only, the part of the file to be selected:

• 0 for the data fork

• 1 for the resource fork.

Example

1. Typical use of command:

   C_TEXT($thedoc)
   C_TEXT(<>digest)
   C_LONGINT($resfork)
   $resfork:=0
   $thedoc:=Select document
   $error:=AP Get file MD5 digest($thedoc;<>digest;§resfork)