The SHA1 function takes a single string as input and returns the hash of the input as a Hex-encoded string, arrived at via the SHA-1 hashing algorithm. 

This function takes either a single string as input. It returns a single 40-character string: the hash of the input as calculated by the SHA-1 hashing algorithm.

Declaration

SHA1(string) -> hash

Parameters

string (required, type: string)
Any string.

Return Values

hash (type: string)
The hash of the input as calculated by the SHA-1 hashing algorithm.

Examples

The following example returns the hash of the string "This is a string." as calculated by the SHA-1 hashing algorithm:

SHA1("This is a string.") => dd603477ba4c236ec5cfb4e4a34162d8d687850
The following example returns the hash of the email "no-reply@airkit.com" as calculated by the SHA-1 hashing algorithm. Note that within Airscript, an email is a subcategory of string:
SHA1("no-reply@airkit.com") => 4ad08d34a9b1d589cc80a220a67f115ee6b0dd7d

Was this article helpful?

0 out of 0 found this helpful