Global Command: sha1

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 01:45, 3 May 2023 by EK (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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"