The digest functions are mathematical functions that compute a digest key for a document. Identical documents have the same digest key; if you change part of the document, the digest key is different. These functions are very useful for checking data integrity when you exchange or compare data. In 4D v16 R5, 4D has enhanced the Generate digest command to support SHA-2 algorithms following security recommendations.
What is SHA-2? SHA-2 is a cryptographic hashing standard, selected from NIST (US National Institute of Standards and Technology) as successor to SHA-1. SHA-2 is often called the SHA-2 family of hashes because it contains several hash sizes.
New algorithms
The Generate digest command now supports two new algorithms of the SHA-2 family: SHA-256 and SHA-512. The syntax has not changed, but two new constants have been added:
- SHA256 digest
- SHA512 digest
$varDigest:=Generate digest($myMessage;SHA256 digest)
Please note that the Generate digest command is inappropriate for password hashing, we recommend you to use the new dedicated commands instead.