Generate digest now supports SHA-2

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.

Vanessa Talbot
• Product Owner •Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.