Skip to content
DizzasTeR edited this page Nov 3, 2020 · 1 revision

Hash Class

Provides cryptography utilities

Hash Functions

  • Hash.MD5(string input)
  • Hash.SHA1(string input)
  • Hash.SHA256(string input)
  • Hash.SHA512(string input)
  • Hash.Whirlpool(string input)

XOFs

  • Hash.KMAC256(string key, string input)
  • Hash.SKEIN256(string key, string input)
  • Hash.SKEIN512(string key, string input)

General Example

Event.bind("onServerInit", function()
    local textToHash = "My Secret Text"
    local hashes = {"MD5", "SHA1", "SHA256", "SHA512", "Whirlpool"}
    for _, hashAlgo in pairs(hashes) do
        print(hashAlgo..": "..Hash[hashAlgo](textToHash))
    end
    --
    local key = "dizz"
    print("KMAC256: "..Hash.KMAC256(key, textToHash))
    print("SKEIN256: "..Hash.SKEIN256(key, textToHash))
    print("SKEIN512: "..Hash.SKEIN512(key, textToHash))
end)
Clone this wiki locally