Difference between revisions of "Global Command: sha1"
From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "Calculates the 160-bit (20-byte) SHA-1 (Secure Hash Algorithm 1) hash of a string. == Syntax == <syntaxhighlight lang="lua"> sha1(tohash) </syntaxhighlight> == Parameters...") |
(No difference)
|
Latest revision as of 01:45, 3 May 2023
Calculates the 160-bit (20-byte) SHA-1 (Secure Hash Algorithm 1) hash of a string.
Syntax
sha1(tohash)
Parameters
Parameter | Type | Description |
---|---|---|
tohash | string | String to calculate the SHA-1 hash of. |
Return values
Type | Description |
---|---|
string | SHA-1 hash, rendered as 40 hexadecimal digits. |
Examples
Example 1: Calculate and print the SHA-1 hash of the string "Hello World".
local helloWorldHash = sha1("Hello World")
print(helloWorldHash)
-- prints "0a4d55a8d778e5022fab701977c5d840bbc486d0"