crypto.sha1

类型 常量
crypto.*
修订 版本 2024.3703
关键词 crypto, SHA-1

概述

用于指定 SHA-1 算法的常量。

语法

crypto.sha1

陷阱

crypto.digest()crypto.hmac() 函数在以下平台上受支持每个平台支持情况如下

平台 crypto.digest() crypto.hmac()
Android
iOS
macOS
Windows 桌面

示例

local crypto = require( "crypto" )
local hash = crypto.digest( crypto.sha1, "test" )
print( hash )   --> a94a8fe5ccb19ba61c4c0873d391e987982fbbd3