Kernel 8.0 APIs Banner [skip navigation]
Office of Information & Technology (OIT) Banner

$$SHAHASH^XUSHSH: Returns SHA Hash for a String Entry

Reference Type: Supported, Category: Data Security, Integration Agreement: 6189

Description

This extrinsic function returns the Secure Hash Algorithm (SHA) hash for a string entry. It uses an input variable to specify the length in bits of the desired hash.

NOTE: This API was released with Kernel patch XU*8.0*655.

Format

$$SHAHASH^XUSHSH(n,x,[,flag])
Input Parameters: n: (required) Length in bits of the desired hash:
  • 160 (SHA-1)
  • 224 (SHA-224)
  • 256 (SHA-256)
  • 384 (SHA-384)
  • 512 (SHA-512)
  x: (required) String to be hashed.
  flag: (optional) Flag to control format of hash:
  • "H" - Hexadecimal (default)
  • "B" - Base64 encoded
Output: returns: SHA hash for a string entry.

 

Example

>W $$SHAHASH^XUSHSH(256,"This is a test")
C7BE1ED902FB8DD4D48997C6452F5D7E509FBCDBE2808B16BCF4EDCE4C07D14E
>W $$SHAHASH^XUSHSH(256,"This is a test","B")
x74e2QL7jdTUiZfGRS9dflCfvNvigIsWvPTtzkwH0U4=