请问Python生md5与shell生成不同原因,pythonmd5,python 代码:im


python 代码:

import hashlibh = hashlib.md5('helloworld')print h.hexdigest()---输出:fc5e038d38a57032085441e7fe7010b0

shell 代码:

$> echo helloworld | md5---输出:d73b04b0e696b0945283defa3eee4538

echo默认会在字符串后面加上"\n",可以用-n选项,如下:

➜  ~  echo -n helloworld | md5fc5e038d38a57032085441e7fe7010b0

编橙之家文章,

评论关闭