# crypto 库 ## 功能 crypto 标准库用于生成文本摘要、HMAC 签名和 UUID。 ## API 列表 | API | 说明 | | ------ | ------ | | [crypto.sha256](/zh-hans/docs/crypto/sha256) | 返回 SHA-256 小写十六进制摘要。 | | [crypto.sha512](/zh-hans/docs/crypto/sha512) | 返回 SHA-512 小写十六进制摘要。 | | [crypto.hmac_sha256](/zh-hans/docs/crypto/hmac_sha256) | 使用密钥生成 HMAC-SHA256 签名。 | | [crypto.hmac_sha512](/zh-hans/docs/crypto/hmac_sha512) | 使用密钥生成 HMAC-SHA512 签名。 | | [crypto.uuid](/zh-hans/docs/crypto/uuid) | 生成 UUID v4 字符串。 | | [crypto.to_string](/zh-hans/docs/crypto/to_string) | 返回当前输入文本。 | ## 示例 ```bt result = crypto('BT').sha256() // 输出:4ea3d68e3581fa27f86acaa247b297686a8e1a8fecd5523cd8314f14b6a28c31 print result ``` ## 注意事项 - SHA 和 HMAC 返回小写十六进制字符串。 - UUID 使用 v4 随机 UUID。