content.gif menu.gif basics.gif

cryptoHash()

Allows to create a checksum for a string or blob element.

Synopsis

string cryptoHash(blob|string data, string algorithm = "MD5");

Parameter

  1. Parameter

    Description

    data

    String or blob element for which a checksum shall be created.

    algorithm

    Following algorithms are available:

    • MD5 (default)

    • MD4

    • SHA1

Return value

hash value in hexadecimal format

Error

In case of an error an empty string will be returned and a corresponding message will be displayed in the LogViewer.

Description

The function cryptoHash() allows to create a checksum for elements of the data types string and blob. Additionally the algorithm for creating the checksum can be stated.

example.gifexample

Following example creates a checksum for the string s and displays it inside the logviewer. The algorithm "MD5" will be used.

main()

{

string s = "Example String";

DebugN(cryptoHash(s));

}

Assignment

 

Availability

CTRL

See also

getFileCryptoHash()

Top Of Page

V 3.11 SP1

Copyright ETM professional control 2012 All Rights Reserved