Crypto
crypto.hash
Shared
Retrieves computed cryptographic hash of a string
Syntax
local hash = crypto.hash(mode, input)Parameters
| Type | Name | Description |
|---|---|---|
string | mode | Hash mode: • "SHA1" - Secure Hash Algorithm 1• "SHA224" - Secure Hash Algorithm 224-bit• "SHA256" - Secure Hash Algorithm 256-bit• "SHA384" - Secure Hash Algorithm 384-bit• "SHA512" - Secure Hash Algorithm 512-bit |
string | input | String containing data to be hashed |
Returns
| Type | Name | Description |
|---|---|---|
string / bool | hash | Computed hash on successful execution, or false on failure |
Examples
local input = "Hello World"
engine.print("Input:", input)
engine.print("Hash:", crypto.hash("SHA256", input))