Python 中的 SHA-256 实现 [英] SHA-256 implementation in Python

查看:113
本文介绍了Python 中的 SHA-256 实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找 SHA-256 哈希函数的 Python 实现.我想用它来更好地了解 SHA-256 函数的工作原理,我认为 Python 是实现此目的的理想语言.伪代码有一个限制,我不能运行/测试它,看看我对代码的修改对输出做了什么.

I'm looking for a Python implementation of the SHA-256 hash function. I want to use it to get a better understanding of how the SHA-256 function works, and I think Python is the ideal language for this. Pseudo-code has the limitation that I can't run/test it, to see what my modifications of the code do to the output.

推荐答案

PyPy 的源代码包含 SHA-256 的纯 Python 实现 这里.在该目录中浏览一下,您可能还会发现其他标准哈希的纯 Python 实现.

PyPy's source contains a pure-python implementation of SHA-256 here. Poking around in that directory, you'll probably also find pure-python implementations of other standard hashes.

这篇关于Python 中的 SHA-256 实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆