小编Pep*_*uez的帖子

Python 中 hashlib 不支持的哈希类型ripemd160

经过彻底的搜索,我在整个网络上都没有找到这个非常常见的问题的完整解释和解决方案。所有需要使用 hashlib 进行编码的脚本都会给我错误:

Python 3.10

import hashlib
h = hashlib.new('ripemd160')
Run Code Online (Sandbox Code Playgroud)

返回:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new
    return __get_builtin_constructor(name)(data)
  File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type ripemd160
Run Code Online (Sandbox Code Playgroud)

我已经尝试检查该哈希值是否存在于库中,以及是否有:

print(hashlib.algorithms_available):{'md5','sm3','sha3_512','sha384','sha256','sha1','shake_128','sha224','sha512_224','sha512_256','blake2b','ripemd160 ', 'md5-sha1'、'sha512'、'sha3_256'、'shake_256'、'sha3_384'、'漩涡'、'md4'、'blake2s'、'sha3_224'}

我在 Linux 的 vps 中遇到这个问题,但在我的电脑上使用 Windows,没有这个问题。

我真诚地感谢任何帮助或建议。

python hashlib ripemd

11
推荐指数
1
解决办法
1万
查看次数

标签 统计

hashlib ×1

python ×1

ripemd ×1