fhash (<file> {,<password> {,<algorithm>}})
string
A derived fingerprint (hash value) for a file.
Various algorithms are available for computing hash values, and the fingerprint may be encrypted via a supplied password.
Fingerprints are text strings of hexadecimal numeric sequences. Different algorithms generate different fingerprint string lengths.
<file>
The name of the file
for which a fingerprint (hash value) is to be derived. The file must exist.
<password>
A password to encrypt the hash value.
If this omitted, or null, no encryption is performed.
<algorithm>
The hashing algorithm to be used.
This is a numeric parameter with a value from the following table. If omitted, the value 3 (SHA1/160) is assumed.
Value Algorithm Value String
LengthDetails 0 CRC16 4 Cyclic Redundancy Check (2-byte) 1 CRC32 8 Cyclic Redundancy Check (4-byte) 2 MD5 32 Message Digest 3* SHA1/160 40 Secure Hash Algorithm (160-bit) 4 SHA2/256 64 Secure Hash Algorithm (256-bit) 5 SHA2/384 96 Secure Hash Algorithm (384-bit) 6 SHA2/512 128 Secure Hash Algorithm (512-bit)
* - the default algorithm
The following would return a 32-character password-encrypted string MD5 value.
string myhash = fhash(myfile,'toblerone',2)