UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

DIGEST Syntax DIGEST(algorithm, data, dataLoc, result) Description The DIGEST function generates a message digest of supplied data. A message digest is the result of a one-way hash function (digest algorithm) performed on the message. Message digest has the unique properties that alight change in the input results in a significant difference in the resulting digest. Therefore, the probability of two different messages resulting in the same digest (collision) is very unlikely. It is also virtually impossible to reverse to the original message from a digest. Message digest is widely used for digital signatures and other purposes. The desired digest algorithm is specified in algorithm. You specify data and its location are with data and dataLoc, respectively. UniData puts the arrived digest into a dynamic array in result. Since digest is short and has a fixed length, it is always put into a string, and no file option is provided. The result can be in either binary or hex format. 1-213 UniBasic Commands Reference

Parameters The following table describes each parameter of the syntax. Parameter Description algorithm A string containing the digest algorithm name (uppercase or lowercase). UniData supports the following algorithms: “md2” “md4” “md5” “mdc2” “rmd160” “sha” “sha1” data Data or the name of the file containing the data to be digested. dataLoc 1 - Data in a string 2 - Data in a file result A string to store the digest result. DIGEST Parameters The following table describes the status of each return code. Return Code Status 0 Success 1 Unsupported digest algorithm 2 The data file cannot be read 3 Message digest cannot be obtained 4 Invalid parameters Return Code Status DIGEST 1-214

DIGEST<br />

Syntax<br />

DIGEST(algorithm, data, dataLoc, result)<br />

Description<br />

The DIGEST function generates a message digest of supplied data. A message digest<br />

is the result of a one-way hash function (digest algorithm) performed on the message.<br />

Message digest has the unique properties that alight change in the input results in a<br />

significant difference in the resulting digest. Therefore, the probability of two<br />

different messages resulting in the same digest (collision) is very unlikely. It is also<br />

virtually impossible to reverse to the original message from a digest. Message digest<br />

is widely used for digital signatures and other purposes.<br />

The desired digest algorithm is specified in algorithm. You specify data and its<br />

location are with data and dataLoc, respectively. UniData puts the arrived digest into<br />

a dynamic array in result. Since digest is short and has a fixed length, it is always put<br />

into a string, and no file option is provided. The result can be in either binary or hex<br />

format.<br />

1-213 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!