Products Downloads


French version


 


ADELIA

VADELIA

SADELIA

WADELIA

MADELIA

(I/B)

(I/B)

(B)

(I/B)

(I)


Description

Returns the result when the specified hashing algorithm is applied to the variable passed as a parameter.

The result is a hexadecimal encoded character string, with a maximum length of 128 characters in the current implementation (with the SHA-512 algorithm).

The function authorizes a result of up to 512 characters to allow a margin for further development.


Syntax

Result = &HASH(IdVar;Algorithm[;Normalize])


Parameters


Definition

Content

Controls

Result

Alphanumerical variable

Hashing of the variable, encoded in hexadecimal or *BLANK in the event of an error (algorithm not supported, etc.).


IdVar

Program variable

Data to process.

Mandatory parameter.

Algorithm

Alphanumerical variable or constant.

Name of the hashing algorithm.

The valid values depend on the execution platform and its configuration.


The MD5, SHA-1, SHA-256, SHA-384 and SHA-512 algorithms are supported on all the platforms.

Mandatory parameter.

Normalize

Numerical constant.

Accepted values: 0 and 1.

Indicates whether the result must be standardized on all the platforms.


If this option is enabled (value 1), the character strings are converted into UTF-8 before processing, which will send back the same result to all the platforms. Binary numeric data (num_bin_2, num_bin_4 and num_bin_8) is converted to comply with the order of the big-endian bytes.


If this option is disabled (value 0), the data is not converted and the result depends on the platform's page of code (ANSI, UTF-16LE, UTF-16BE or EBCDIC depending on the platform) for character data, or on the order of the platform's bytes (low endian or big endian) for binary numeric data.


It should be noted that encoding of decimal or date/time data is different, depending on the precision and the platform, and is not taken into account.

If the parameter is omitted, the option is active.

Optional parameter.


Example

If "SIGNATURE" is a 128 character alphanumeric variable and "MY_VARIABLE" is a program variable:

SIGNATURE = &HASH(MY_VARIABLE;'SHA-512')


If you want to hash alphanumeric content in non-standardized mode:

SIGNATURE = &HASH(My_ALPHA_VARIABLE;'SHA-512' ; 0)


 List of predefined functions by topic



↑ Top of page

  • Aucune étiquette