|
BDE 4.14.0 Production release
|
Provide a value-semantic type encoding a message in a SHA-2 digest.
This component provides a set of classes (Sha224, Sha256, Sha384, and Sha512) that implement a mechanism for computing and updating a SHA-2 digest (a cryptographic hash). The specification for this is based on FIPS-180, which can be found at
Note that a SHA-2 digest does not aid in error correction.
This section illustrates intended use of this component.
The validatePassword function below returns whether a specified password has a specified hash value. The assertPasswordIsExpected function below has a sample password to hash and a hash value that matches it. Note that the output of loadDigest is a binary representation. When hashes are displayed for human consumption, they are typically converted to hex, but that would create unnecessary overhead here.