messageDigest | ||||||||||||||||
Type | function | |||||||||||||||
Dictionary | LCS | |||||||||||||||
Library | LiveCode Script | |||||||||||||||
Syntax |
| |||||||||||||||
Summary | Computes a cryptographic message digest. | |||||||||||||||
Introduced | 9.0 | |||||||||||||||
OS | mac, windows, linux, ios, android | |||||||||||||||
Platforms | desktop, server, mobile | |||||||||||||||
Parameters |
| |||||||||||||||
Example |
| |||||||||||||||
Values |
| |||||||||||||||
Related | Function: md5digest, sha1digest, textEncode Glossary: binary data, checksum, function, platform | |||||||||||||||
Description | Compute a message digest of message using the cryptographic hash function digestType. A cryptographic hash function is a mathematical algorithm that maps data of an arbitrary length to a fixed-length binary data string. It has the special property that it is designed to be a one-way function; if you are given the output of the cryptographic hash function (the "message digest"), it should be impossible to guess the input to the function (the "message"). Even a very small change to the message will make a very large change to the messageDigest. This makes it useful for whether data has changed. The messageDigest function can be used:
The messageDigest function supports the following standardised cryptographic hash functions. Numbers like "256", "384" etc. indicate the number of bits of binary data that the messageDigest function returns; for example, if you specify the "SHA3-256" digestType, then messageDigest will return 32 bytes of data.
When generating a messageDigest for a string, it is a good idea to encode it to binary data using the textEncode function. Otherwise, the messageDigest could be different, depending on the platform on which your application is running. In some cases you may wish to use a irreversible, keyed one-way transform of data, for example in a password storage scheme. You can use the messageDigest function to implement a keyed-hash message authentication code, as described in RFC 2014. | |||||||||||||||
Tags | math |