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
-
... ... @@ -140,7 +140,7 @@ 140 140 141 141 Table 2-1 142 142 143 -(% class="box errormessage" %)143 +(% class="box infomessage" %) 144 144 ((( 145 145 **✎Note: **If HLword enters any other value, it will be treated as invalid. 146 146 ))) ... ... @@ -1834,7 +1834,7 @@ 1834 1834 1835 1835 Succeed: string: The value of the monitor point before it is written 1836 1836 1837 -Failed: mil1837 +Failed: nil 1838 1838 1839 1839 == **normal_getdata_byname(string name)** == 1840 1840 ... ... @@ -1850,7 +1850,7 @@ 1850 1850 1851 1851 Succeed: string 1852 1852 1853 -Failed: mil1853 +Failed: nil 1854 1854 1855 1855 = **11 MySQL database operation** = 1856 1856 ... ... @@ -1890,7 +1890,7 @@ 1890 1890 1891 1891 Succeed: status: returns the number of rows affected by SQL statement execution. 1892 1892 1893 -Failed: mil, errorString1893 +Failed: nil, errorString 1894 1894 1895 1895 == **luaMySql.execWithResult(string statement)** == 1896 1896 ... ... @@ -1904,7 +1904,7 @@ 1904 1904 1905 1905 Succeed: table: returns the result set 1906 1906 1907 -Failed: mil, errorString1907 +Failed: nil, errorString 1908 1908 1909 1909 For example: 1910 1910 ... ... @@ -2034,14 +2034,78 @@ 2034 2034 2035 2035 == **hmac(string hash_func, string key, string message)** == 2036 2036 2037 -**Function:** Executethe given SQL statement returning the resultset (check)2037 +**Function:** HMAC calculate 2038 2038 2039 +**Function name** 2040 + 2041 +hash_func: 2042 + 2043 +* [md5, sha1, sha224, sha256, sha384, sha512] 2044 +* [sha512_224, sha512_256, sha3_224, sha3_256] 2045 +* [sha3_384, sha3_512] 2046 + 2039 2039 **Parameter:** 2040 2040 2041 - statement: thegiven SQL statement2049 +key: the key 2042 2042 2051 +message: message content 2052 + 2043 2043 **Return:** 2044 2044 2045 -Succeed: ta ble: returnstheresultset2055 +Succeed: string, calculation result 2046 2046 2047 -Failed: mil, errorString 2057 +Failed: nil 2058 + 2059 +For example: 2060 + 2061 +{{code language="LUA"}} 2062 +local sha = require"sha2" 2063 + 2064 +function hmac_test.main() 2065 + 2066 +local hmac = sha.hmac 2067 + 2068 +print(hmac(sha.sha1, 2069 + 2070 +"your key", "your message")) 2071 + 2072 +end 2073 +{{/code}} 2074 + 2075 +== **sha(string message** == 2076 + 2077 +**Function:** SHA calculate 2078 + 2079 +**Function name:** 2080 + 2081 +sha: 2082 + 2083 +* sha1, sha224, sha256, sha384, sha512] 2084 +* [sha512_224, sha512_256, sha3_224, sha3_256] 2085 +* [sha3_384, sha3_512] 2086 + 2087 +**Parameter:** 2088 + 2089 +key: the key 2090 + 2091 +message: message content 2092 + 2093 +**Return:** 2094 + 2095 +Succeed: string, calculation result 2096 + 2097 +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}}