SHA1-DIGEST function
- Last Updated: October 9, 2025
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Hashes the specified data using the United States Government Secure Hash
Algorithm (SHA-1), and returns a 20-byte binary message digest value as a RAW value.
Note: This function is provided for backward compatibility only and should
not be used in new development. Existing applications and data storage should migrate away
from this function as soon as possible.
Syntax
|
- data-to-hash
- The source data to hash. The data may be of type CHARACTER, LONGCHAR, RAW, or MEMPTR. If the data is a CHARACTER or LONGCHAR value, the AVM converts it to UTF-8 (which ensures a consistent value regardless of code page settings). To avoid this automatic conversion, specify a RAW or MEMPTR value.
- hash-key
-
An optional key value to use in the hash operation. The key may be of type CHARACTER, LONGCHAR, RAW, or MEMPTR. If the key is a CHARACTER or LONGCHAR value, the AVM converts it to UTF-8 (which ensures a consistent value regardless of code page settings). To avoid this automatic conversion, specify a RAW or MEMPTR value. This key value is combined with the source data before the hash operation begins.
If either data-to-hash or hash-key is the Unknown value (
?), then the Unknown value (?) is returned from the function.If the hash-key value contains a null character, the null character is included in the hash operation.
Note: This function is not compatible with HMAC-SHA-1.