mIRC Home    About    Download    Register    News    Help

Print Thread
$md5 -- Broken implementation? #182580 11/08/07 01:31 PM
Joined: Aug 2003
Posts: 20
S
SGR Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2003
Posts: 20
From mIRC:

Quote:

MD5 of $null: d41d8cd98f00b204e9800998ecf8427e
MD5 of A: 7fc56270e7a70fa81a5935b72eacbe29
MD5 of a: 0cc175b9c0f1b6a831c399e269772661
MD5 of 863: 19b650660b253761af189682e03501dd


Quote:

-bash-3.1$ echo $NUL[EOL] | md5sum && echo "A" | md5sum && echo "a" | md5sum && echo "863" | md5sum
d41d8cd98f00b204e9800998ecf8427e - null
bf072e9119077b4e76437a93986787ef - A
60b725f10c9c85c70d97880dfe8191b3 - a
89f6a0bff21f3bb3f1fa73bf8391f25a - 863


mIRC only returns the correct MD% checksum for $null?

Am I missing something here?



Re: $md5 -- Broken implementation? [Re: SGR] #182581 11/08/07 01:51 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Apparently there's something wrong with your tests in bash, as a bunch of online md5 hash calculators I tried, such as this and this, agree with mirc.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: $md5 -- Broken implementation? [Re: SGR] #182583 11/08/07 01:57 PM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
qwerty- is correct. The problem is that "echo" appends a Line Feed to the output. If you use the -n switch for echo the result will agree with mIRC.