Sha1 Shared function

From Gothic 2 Online: Wiki
Jump to navigation Jump to search

This function was added in version: 0.0.0

Calculates the Sha1 hash of the specified text. Hash lenght is 40 hex chars.

NOTE! Returned hash is lowercase.

Syntax

string sha1(string text)

Required Arguments

  • text: The text which will be hashed.

Returns

  • string: The function returns Sha1 text hash.

Example

Server

local function initHandler(pid)
{
	local message = "My name is Paul";
	local hash = sha1(message);
	print(hash);
}

addEventHandler("onInit", initHandler);

Client

local function initHandler()
{
	local message = "My name is Paul";
	local hash = sha1(message);
	print(hash);
}

addEventHandler("onInit", initHandler);

Related functions