类型 常量 库 crypto.* 修订版 Release 2024.3703 关键词 crypto、SHA-256
用于指定 SHA-256 算法的常量。
crypto.sha256
crypto.digest() 和 crypto.hmac() 函数在每个平台上受支持,如下所示
平台 | crypto.digest() | crypto.hmac() |
---|---|---|
Android | ✓ | ✓ |
iOS | ✓ | ✓ |
macOS | ✓ | ✓ |
Windows Desktop | ✓ | ✓ |
local crypto = require( "crypto" ) local hash = crypto.digest( crypto.sha256, "test" ) print( hash ) --> 9f86...(etc)...0a08