md5差异 [英] md5 differences

查看:80
本文介绍了md5差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!


我正在尝试匹配在tcsh shell中完成的md5校验和的结果。

我一直得到不同的结果并且在谷歌上找不到任何东西...


这里的例子是:


Arno @计算机:〜%echo "你好" | md5

b1946ac92492d2347c6235b4d2611184

Arno @ Computer:〜%python

Python 2.5.1(r251:54863,2008年1月17日, 19:35:17)

[GCC 4.0.1(Apple Inc. build 5465)]在darwin上

输入help,copyright,币"或许可证或欲获得更多信息。

Hi there!

I''m trying to match the results of an md5 checksum done in a tcsh shell.
I keep getting different results and can''t find anything on google...

here''s an example:

Arno@Computer:~% echo "hello" | md5
b1946ac92492d2347c6235b4d2611184

Arno@Computer:~% python
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.


>> import md5
md5.new(" hello" ).hexdigest()
>>import md5
md5.new("hello").hexdigest()



''5d41402abc4b2a76b9719d911017c592''

如何获得相同的结果?


谢谢

Arno

''5d41402abc4b2a76b9719d911017c592''
How do I get the same results?

thanks
Arno

推荐答案



Python < py **** @ rgbaz.euwrote in message

news:ma ************************** *********** @ pytho n.org ...

"Python" <py****@rgbaz.euwrote in message
news:ma*************************************@pytho n.org...

here'这是一个例子:

Arno @ Computer:〜%echo" hello" | md5

b1946ac92492d2347c6235b4d2611184

如何获得相同的结果?
here''s an example:
Arno@Computer:~% echo "hello" | md5
b1946ac92492d2347c6235b4d2611184
How do I get the same results?



校验和相同的字符串。

Checksum the same string.


>> md5.new(" hello \ n")。hexdigest()
>>md5.new("hello\n").hexdigest()



''b1946ac92492d2347c6235b4d2611184 ''

''b1946ac92492d2347c6235b4d2611184''




2008年10月10日18:30,Richard Brodie写道:

On 10 sep 2008, at 18:30, Richard Brodie wrote:

>

" Python" < py **** @ rgbaz.euwrote in message

news:ma ************************** *********** @ pytho n.org ...
>
"Python" <py****@rgbaz.euwrote in message
news:ma*************************************@pytho n.org...

>这里有一个例子:
Arno @电脑:〜%echo你好 | md5
b1946ac92492d2347c6235b4d2611184
如何获得相同的结果?
>here''s an example:
Arno@Computer:~% echo "hello" | md5
b1946ac92492d2347c6235b4d2611184
How do I get the same results?



校验和相同的字符串。


Checksum the same string.


>>> ; md5.new(" hello \ n")。hexdigest()
>>>md5.new("hello\n").hexdigest()



''b1946ac92492d2347c6235b4d2611184''

''b1946ac92492d2347c6235b4d2611184''



hmm然后:


Arno @ Computer:〜%echo" test" test.txt


Arno @ Computer:〜%md5 test.txt

MD5(test.txt)= d8e8fca2dc0f896fd7cb4cb0031ba249


Arno @ Computer:〜%python

Python 2.5.1(r251:54863,2008年1月17日,19:35:17)

[GCC 4.0.1 (Apple Inc. build 5465)]在darwin上

输入help,copyright,credit等等。或许可证或欲获得更多信息。

hmm and this then:

Arno@Computer:~% echo "test" test.txt

Arno@Computer:~% md5 test.txt
MD5 (test.txt) = d8e8fca2dc0f896fd7cb4cb0031ba249

Arno@Computer:~% python
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.


>> import md5
md5.new(" / Volumes /data/Arno/test.txt")。hexdigest()
>>import md5
md5.new("/Volumes/data/Arno/test.txt").hexdigest()



''90364ed45b452d43378629c20543a81d''

甚至

echo -n" hello" | md5

没有返回相同的数字

gr

Arno

''90364ed45b452d43378629c20543a81d''
even
echo -n "hello" | md5
doesn''t return the same number
gr
Arno


2008年9月10日星期三19:12:28 +0200

Python< py **** @ rgbaz.euwrote:
On Wed, 10 Sep 2008 19:12:28 +0200
Python <py****@rgbaz.euwrote:

嗯,然后:


Arno @ Computer:〜%echo" test" test.txt


Arno @ Computer:〜%md5 test.txt

MD5(test.txt)= d8e8fca2dc0f896fd7cb4cb0031ba249


Arno @ Computer:〜%python

Python 2.5.1(r251:54863,2008年1月17日,19:35:17)

[GCC 4.0.1 (Apple Inc. build 5465)]在darwin上

输入help,copyright,credit等等。或许可证或欲获得更多信息。
hmm and this then:

Arno@Computer:~% echo "test" test.txt

Arno@Computer:~% md5 test.txt
MD5 (test.txt) = d8e8fca2dc0f896fd7cb4cb0031ba249

Arno@Computer:~% python
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>> import md5

>> md5.new(" / Volumes /data/Arno/test.txt")。hexdigest()
>>import md5
>>md5.new("/Volumes/data/Arno/test.txt").hexdigest()



''90364ed45b452d43378629c20543a81d''

''90364ed45b452d43378629c20543a81d''



你要打扰自己。 :-)

You''re going to smack yourself on the head over this one. :-)


>> md5.new(open(" / Volumes / data / Arno / test.txt")。read())。hexdigest()
>>md5.new(open("/Volumes/data/Arno/test.txt").read()).hexdigest()



-

D''Arcy JM Cain< da *** @ druid.net |民主是三只狼
http://www.druid.net/darcy/ |和一只羊投票

+1 416 425 1212(mod#0082)(eNTP)|什么是晚餐。

--
D''Arcy J.M. Cain <da***@druid.net | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what''s for dinner.


这篇关于md5差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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