unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* md5 broken?
@ 2011-05-28  9:32 Antoine Levitt
  2011-05-28 12:23 ` Jim Meyering
  0 siblings, 1 reply; 16+ messages in thread
From: Antoine Levitt @ 2011-05-28  9:32 UTC (permalink / raw)
  To: emacs-devel

Hi,

I've got this code, that hashes ERC nicks to get a color (the same every
time) for every nick.

(defun erc-get-color-for-nick (nick)
  "Gets a color for NICK. If NICK is specified
  in erc-nick-color-alist, use it, else hash
  the nick and get a color from that"
  (or (cdr (assoc nick erc-nick-color-alist))
      (nth
       (mod (string-to-number
	     (substring (md5 nick) 0 6) 16)
	    (length erc-colors-list))
       erc-colors-list)))

Recently (between yesterday and today), some colors have changed.

From an emacs compiled 2011-05-26 13:47 (GMT+1) (just the binary, with
same elisp),

(md5 "truc")
=> 45723a2af3788c4ff17f8d1114760e62
(which is the same thing as md5sum)

From an emacs just compiled,

(md5 "truc")
=> 45723a2aff78ff4fff7fff1114760e62
(it seems some digits have been randomly replaced by f, for some reason)

The only likely culprit I can see is the integer overflow fixes:

revno: 104390 [merge]
committer: Paul Eggert <eggert@cs.ucla.edu>
timestamp: Fri 2011-05-27 13:32:41 -0700
  Merge: Integer overflow fixes.

Could someone look into that, please? I'm on x86-64 by the way.




^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-05-31  4:22 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-28  9:32 md5 broken? Antoine Levitt
2011-05-28 12:23 ` Jim Meyering
2011-05-28 12:28   ` Antoine Levitt
2011-05-28 12:51   ` Eli Zaretskii
2011-05-28 13:32     ` Jim Meyering
2011-05-28 14:10       ` Eli Zaretskii
2011-05-28 16:09         ` Paul Eggert
2011-05-28 16:55           ` Eli Zaretskii
2011-05-28 19:12             ` Paul Eggert
2011-05-28 19:35               ` Eli Zaretskii
2011-05-28 22:47                 ` INLINE -> inline (was: md5 broken?) Paul Eggert
2011-05-29  4:51                   ` Eli Zaretskii
2011-05-29  8:05                   ` INLINE -> inline Jim Meyering
2011-05-30  2:47           ` md5 broken? Ken Raeburn
2011-05-30  5:31             ` Paul Eggert
2011-05-31  4:22               ` Ken Raeburn

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).