Difference between revisions of "Cryptography.sha1"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2023.12<br/> '''Class:''' Cryptography<br/> === Description === sha1 encode some data. <syntaxhighlight lang="lua"> (string) = Cr...")
 
(No difference)

Latest revision as of 19:39, 15 December 2023

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