Skip to main content

Compute SHA1 hash of string (string.sha1)

Declaration​

hash = string.sha1(data)

Parameters​

  • data
    string. Original string (or binary data).

Returns​

  • hash
    string. Hex text of the SHA1 digest.

Description​

Compute SHA1 checksum of a string (or binary data).

Example​

sys.alert(string.sha1('XXTouch 真棒')) -- "a959c48d904c1075c7ddfdb1fda49effb2142493"

Note: Uses function outside of this chapter: sys.alert

More examples​

At the end of this chapter