1
panlilu OP 勘误 已知 md5.hexdigest() 的结果求md5.digest() 的结果。。
|
2
Hyperion 2011-07-05 23:23:51 +08:00
import binascii
t = binascii.a2b_hex('05c12a287334386c94131ab8aa00d08a') print t |
4
gastlygem 2011-07-05 23:26:33 +08:00
提示:
for c in md5.digest(): print hex(ord(c)) |
5
imonyse 2011-07-05 23:27:00 +08:00
import binascii
binascii.unhexlify("05c12a287334386c94131ab8aa00d08a") http://docs.python.org/library/binascii.html |
6
gastlygem 2011-07-05 23:27:51 +08:00
偶慢了好多啊。另外Hyperion的答案好多了……
|
8
Hyperion 2011-07-05 23:29:48 +08:00
= =+ python新手一只…… 除了几个我经常用标准库其余都没记住……
话说很期待楼主的tuojin内测啊…… |
9
panlilu OP 谢谢楼上各位大牛相助。这贴可以结啦~
v2ex上果然多python牛人! |
10
reus 2011-07-06 01:43:55 +08:00
什么都不用import,直接用hex编码来decode
'05c12a287334386c94131ab8aa00d08a'.decode('hex') |
12
Hyperion 2011-07-06 13:40:27 +08:00
|
13
reus 2011-07-06 14:15:16 +08:00
http://docs.python.org/library/codecs.html 这里都有的,还有base64,bz2,zip,quote,rot13之类,很方便
|