hash - sha256 哈希长度
问题描述
我想从字符串中获取哈希 sha256,因为 sha256 的长度为 256 位,每个字节的大小为 8 位,我认为哈希的长度(在字符串中)必须是 32 个字符(256/8 = 32)。但哈希长度为 64 个字符。谁能帮我?
print(hashlib.sha256('lsd'.encode()).hexdigest())
输出:
3fd7dcbd130286b3799aa74e7fcb1d2ecc80d4c95a158d91dfa1d6a72557f769
哈希长度是64,不应该是32吗?
解决方案
推荐阅读
- regex - 正则表达式:检查字符串是否对应单词编号列表样式
- css - CSS3 媒体查询不能接受更大的最小宽度值
- java - @JsonFormat 在序列化对象时更改时间戳值
- javascript - 如何从 MongoDB 函数中的函数获取变量?
- mysql - 根据其他两个时间戳字段更新日期字段
- git - github SSH 是如何工作的?
- spring-kafka - 多个spring cloud stream应用一起运行
- c - Unix系统调用复制文件夹中所有具有相同扩展名的文件
- java - 如何在 Java 机器人中按 Right Shift 键?
- android - 如何禁用活动中的主页按钮单击 - 就像在锁屏应用程序中一样?