Cryptography.sha1

From GiderosMobile
Revision as of 19:39, 15 December 2023 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2023.12<br/> '''Class:''' Cryptography<br/> === Description === sha1 encode some data. <syntaxhighlight lang="lua"> (string) = Cr...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2023.12
Class: Cryptography

Description

sha1 encode some data.

(string) = Cryptography.sha1(data)

Parameters

data: (string) the data to be sha1 encoded

Return values

Returns (string) sha1 encoded string

Example

local data = Cryptography.sha1("password")
print((" %02x"):rep(#data):format(data:byte(1, #data)))
-- output: 5b aa 61 e4 c9 b9 3f 3f 06 82 25 0b 6c f8 33 1b 7e e6 8f d8