Edit

Checksum (text [, hash])

Result Type: String

Definition: Returns a text string containing a hexadecimal representation of the cryptographic hash of the given text. On v8 and earlier, the hash used will be md5. This is a reasonably reliable way of testing to see if there has been any change in a largish amount of data since you last checksummed it (because the checksum is small enough to store).

In v9 and later, you can optionally pass the name of the hash you require. Supported hashes are "md5" (default), "sha1", "sha256", "sha512"). You can also use this function to compute cryptographic hashes that might be required for certain online APIs. See also HMAC if you need a keyed-hash message authentication code.

Examples: 

Checksum("some text")

returns "552e21cd4cd9918678e3c1a0df491bc3"

If you are iterating over data (detail lines of a transaction, say), you can add the previously calculated checksum by appending it to the input text (in this example, CS is a cell name inside a for loop in a report)

CS = Checksum(D.StockCode + D.StockQty + D.Gross + CS)

Checksum("some text", "sha1")

returns "37aa63c77398d954473262e1a0057c1e632eda77"

See Also:

HMAC: Create a keyed-hash message authentication code