@tola/hash
计算 BLAKE3 哈希摘要,以及将字节编码为小写十六进制字符串。
导入
#import "@tola/hash:0.0.0": *导出成员
blake3
let blake3(
value: bytes,
) = bytes;返回输入字节的 32 字节 BLAKE3 摘要。
位置参数
valuebytes必填:待计算摘要的字节。字符串可先用bytes(text)转为 UTF-8 字节。
计算字符串的十六进制 BLAKE3 摘要
#import "@tola/hash:0.0.0": blake3, bytes-to-hex
#let digest = bytes-to-hex(blake3(bytes("hello")))bytes-to-hex
let bytes-to-hex(
value: bytes,
) = str;将字节编码为小写十六进制字符串(每字节两位)。
位置参数
valuebytes必填:待编码的字节。