Re: Bug in Digest::MD5
"David A. Black" <[email protected]> Sun, 16 Jan 2005 05:54:04 -0800 (PST)
| Newsgroups | gmane.comp.lang.ruby.german |
|---|---|
| Message-ID | <Pine.LNX.4.61.0501160549190.13165@wobblini> |
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--927295978-432876567-1105883644=:13165
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
Hi --
On Sun, 16 Jan 2005, Detlef Reichl wrote:
> Hallo,
>
> rubys MD5.hexdigest liefert andere Ergebnisse als der Shell-Befehl
> md5sum, obwohl nach meinem Verst=E4ndnis beide das gleiche tun sollten.
> Bug oder Verst=E4ndnisproblem?
>
> #!/usr/bin/ruby
> require 'digest/md5'
>
> p Digest::MD5.hexdigest('meinpasswort')
> system('echo meinpasswort | md5sum')
Ich glaube, es hat wie so oft der Fall ist mit "\n" zu tun:
$ ruby -r 'digest/md5' -e 'p Digest::MD5.hexdigest("meinpasswort\n")'
"121868f498263b6f93212708bd2a4009"
David
--=20
David A. Black
[email protected]
--927295978-432876567-1105883644=:13165
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Ruby-de-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ruby-de-talk
--927295978-432876567-1105883644=:13165--