类型 函数 库 crypto.* 返回值 字符串 修订 版本 2024.3703 关键词 crypto, 哈希, 消息摘要
生成输入字符串的消息摘要(哈希值)。
crypto.digest( algorithm, data [, raw] )
字符串。 输入字符串。
布尔值。 指示输出是否应为消息摘要的直接二进制等效值。如果为 false
(默认值),则结果将格式化为十六进制字符串。
local crypto = require( "crypto" ) local hash = crypto.digest( crypto.md4, "test" ) print( hash ) --> db346d691d7acc4dc2625db19f9e3f52