Changes for page 01 Lua Functions
Last modified by Theodore Xu on 2023/10/26 10:51
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -2038,7 +2038,7 @@ 2038 2038 2039 2039 **Function name** 2040 2040 2041 -hash_func: use hash algorithm2041 +hash_func: 2042 2042 2043 2043 * [md5, sha1, sha224, sha256, sha384, sha512] 2044 2044 * [sha512_224, sha512_256, sha3_224, sha3_256] ... ... @@ -2076,14 +2076,16 @@ 2076 2076 2077 2077 **Function:** SHA calculate 2078 2078 2079 -** Parameter:**2079 +**Function name:** 2080 2080 2081 - hash_func:use hash algorithm2081 +sha: 2082 2082 2083 -* [md5,sha1, sha224, sha256, sha384, sha512]2083 +* sha1, sha224, sha256, sha384, sha512] 2084 2084 * [sha512_224, sha512_256, sha3_224, sha3_256] 2085 2085 * [sha3_384, sha3_512] 2086 2086 2087 +**Parameter:** 2088 + 2087 2087 key: the key 2088 2088 2089 2089 message: message content ... ... @@ -2093,3 +2093,17 @@ 2093 2093 Succeed: string, calculation result 2094 2094 2095 2095 Failed: nil 2098 + 2099 +For example: 2100 + 2101 +{{code language="LUA"}} 2102 +local sha = require"sha2" 2103 + 2104 +function sha_test.main() 2105 + 2106 +local sha256 = sha.sha256 2107 + 2108 +print(sha256("your message")) 2109 + 2110 +end 2111 +{{/code}}