security.Digest.CreateDigestString
Creates a SHA1 digest from the given string.
Syntax
security.Digest.CreateDigestString(
toDigest STRING,
randomBase64 STRING )
RETURNS STRING
- toDigest defines the password to be digested.
- randomBase64 defines a random string in Base64.
Usage
Use this method to compute the SHA1 digest from the string in toDigest and an optional random Base64 form string, and return it in a string encoded in Base64 form.
The random value must be a valid Base64 string. You typically generate this value with the security.RandomGenerator.CreateRandomString()
method.
In case of error, the method throws an exception and sets the
status
variable. Depending on the error, a human-readable description of the
problem is available in the sqlca.sqlerrm
register. See Error handling in GWS calls (status).
Example
DEFINE password, digest STRING
...
LET digest =
security.Digest.CreateDigestString(
password,
security.RandomGenerator.CreateRandomString(16) )