Questions tagged «hashlib»


10
如何更正TypeError:散列之前必须对Unicode对象进行编码?
我有这个错误: Traceback (most recent call last): File "python_md5_cracker.py", line 27, in <module> m.update(line) TypeError: Unicode-objects must be encoded before hashing 当我尝试在Python 3.2.2中执行以下代码时: import hashlib, sys m = hashlib.md5() hash = "" hash_file = input("What is the file name in which the hash resides? ") wordlist = input("What is your wordlist? …

13
在Python中获取大文件的MD5哈希
我使用过hashlib(在Python 2.6 / 3.0中取代了md5),如果我打开一个文件并将其内容放入hashlib.md5()函数中,它就可以正常工作。 问题在于非常大的文件,其大小可能超过RAM大小。 如何在不将整个文件加载到内存的情况下获取文件的MD5哈希?
188 python  md5  hashlib 

6
用Python哈希文件
我想让python读取EOF,这样我就可以获取适当的哈希,无论它是sha1还是md5。请帮忙。这是我到目前为止的内容: import hashlib inputFile = raw_input("Enter the name of the file:") openedFile = open(inputFile) readFile = openedFile.read() md5Hash = hashlib.md5(readFile) md5Hashed = md5Hash.hexdigest() sha1Hash = hashlib.sha1(readFile) sha1Hashed = sha1Hash.hexdigest() print "File Name: %s" % inputFile print "MD5: %r" % md5Hashed print "SHA1: %r" % sha1Hashed
98 python  hash  md5  sha1  hashlib 

2
ImportError:无法导入名称md5
我真的不知道这里发生了什么,我需要在弹性beantalk上部署我的flask应用程序,但是以某种方式改变了路径,无法再运行python application.py了。 [dotnet --info] .NET Core SDK (reflecting any global.json): Version: 2.1.701 Commit: 8cf7278aa1 Runtime Environment: OS Name: Mac OS X OS Version: 10.14 OS Platform: Darwin RID: osx.10.14-x64 Base Path: /usr/local/share/dotnet/sdk/2.1.701/ Host (useful for support): Version: 2.1.12 Commit: ccea2e606d [brew -v] Homebrew 2.2.0 Homebrew/homebrew-core (git revision 43ad0; last commit …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.