md5sum linux命令工作正常吗? [英] Is the md5sum linux command working right?

查看:95
本文介绍了md5sum linux命令工作正常吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据Wikipedia,空字符串的md5和为d41d8cd98f00b204e9800998ecf8427e

According to Wikipedia, the md5 sum of an empty string is d41d8cd98f00b204e9800998ecf8427e

我通过md5库确认了这一点

I confirmed this with my md5 library

但是,当我跑步

echo "" | md5sum

在我的Linux shell中,我得到68b329da9893e34099c7d8ad5cb9c940-

in my linux shell, I get 68b329da9893e34099c7d8ad5cb9c940 -

实际上,我的所有哈希都不匹配md5sum命令的输出.

In fact, none of my hashes match the output of the md5sum command.

对这种差异有任何想法吗?

Any thoughts on this discrepancy?

推荐答案

使用该命令,您正在计算单个换行符的md5sum.尝试尝试:

With that command, you are calculating the md5sum of a single newline character. Try instead:

echo -n "" | md5sum

这篇关于md5sum linux命令工作正常吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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