5.7.3 HASH

The HASH command generates the hash of the specified field or file. The hash value is returned in the command message response field.

Syntax:

Command

Keyword

Value

Developer notes

HASH

FILE

value

Optional. File Path.

FIELD

value

Optional. Field Name.

DIGEST

value

Optional. Hashing algorithm supported by the JVM.
MD2, MD5, SHA, SHA256, SHA384, SHA256.
Default is SHA.

ENCODING

value

Optional. Field value to byte encoding or special values *HEX, *BASE32 or *BASE64.
Default is UTF-8.

HMAC

value

Optional. HashMAC algorithm supported by the JVM.
HMACSHA1, HMACSHA256, HMACSH384, HMACSHA512.

KEYENCODING

value

Optional. KEY keyword value to byte encoding or special values *HEX, *BASE32 and *BASE64.
Default is UTF-8.

HASHENCODING

*HEX

Optional. String encoding of generated binary hash.
Default is *HEX

*BASE32

 

*BASE64

 

 

Example

HASH DIGEST(SHA256) FILE(/folder/file.pdf) HASHENCODING(*BASE64)

 

HASH DIGEST(SHA256) FIELD(DATA) ENCODING(UTF-8) SERVICE_EXCHANGE(*FIELD)

 

HASH HMAC(HMACSHA256) FILE(/folder/file.pdf) KEY(secretkey) KEYENCODING(UTF-8)

 

HASH HMAC(HMACSHA256) FIELD(DATA) ENCODING(UTF-8) KEY(dGVzdA==) KEYENCODING(*BASE64) HASHENCODING(*BASE64) SERVICE_EXCHANGE(*FIELD)