I am trying to output a result I get from the SHA1-DIGEST hash function of Progress to a file. But I need to convert it to a Hex format first. Here’s my code for doing that.
ASSIGN hashedData = SHA1-DIGEST(fileData)
hexValue = HEX-ENCODE(hashedData).
OUTPUT TO VALUE (mHashedFileName) BINARY NO-MAP NO-CONVERT.
EXPORT hexValue.
OUTPUT CLOSE.
When I do this I get a result like this:
"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"
The quotation marks are extra.
So say I change the code to do this:
hashedData = SHA1-DIGEST(fileData).
OUTPUT TO VALUE (mHashedFileName) BINARY NO-MAP NO-CONVERT.
EXPORT HEX-ENCODE(hashedData).
OUTPUT CLOSE.
I get the following:
!ISO8859-1!2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
The value in red is ALWAYS there. The value after the red is correct, but I don’t get what that value in red is for. Any ideas on how to just get the value after the part in red – without the quotes?
ASSIGN hashedData = SHA1-DIGEST(fileData)
hexValue = HEX-ENCODE(hashedData).
OUTPUT TO VALUE (mHashedFileName) BINARY NO-MAP NO-CONVERT.
EXPORT hexValue.
OUTPUT CLOSE.
When I do this I get a result like this:
"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"
The quotation marks are extra.
So say I change the code to do this:
hashedData = SHA1-DIGEST(fileData).
OUTPUT TO VALUE (mHashedFileName) BINARY NO-MAP NO-CONVERT.
EXPORT HEX-ENCODE(hashedData).
OUTPUT CLOSE.
I get the following:
!ISO8859-1!2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
The value in red is ALWAYS there. The value after the red is correct, but I don’t get what that value in red is for. Any ideas on how to just get the value after the part in red – without the quotes?