iswbm / magic-python

Python 黑魔法手册

Home Page:http://magic.iswbm.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

c02/c02_04

utterances-bot opened this issue · comments

2.4 命令行式执行 Python 代码 — Python黑魔法手册 1.0.0 documentation

https://magic.iswbm.com/c02/c02_04.html

gpt4:hashlib.md5('hello').hexdigest() 中存在一个错误。因为 hashlib.md5() 需要一个字节串(bytes)作为输入,而不是一个普通的字符串。

@楼上 python -c "import hashlib;print(hashlib.md5('hello'.encode()).hexdigest())"