bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9118: 23.3.50; Don't seed the RNG in message-unique-id


From: Leo
Subject: bug#9118: 23.3.50; Don't seed the RNG in message-unique-id
Date: Wed, 20 Jul 2011 10:12:12 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3.50 (Mac OS X 10.6.8)

On 2011-07-19 23:49 +0800, Lars Magne Ingebrigtsen wrote:
> Once per package?  That means that it's called many times in a single
> Emacs session, so I don't really see the problem.

Only at the time of loading a package and only a package or two in the
following do I use. After loading the packages, they won't change the
rng any more.

But calling (random t) every time a function is called just gets in the
way, that means I am no longer getting a uniform distribution from the
RNG. Also (random t) is much more predictable.

,----
| ChangeLog.6:6494:     (life): Do (random t) only once and only when `life' is 
called.
| allout-widgets.el:1351:;;                  (random t)
| calc/calc-comb.el:575:    (random t)
| gnus/message.el:4788:           (format "%x%x%x" (random) (random t) (random))
| gnus/message.el:5494: (% (1+ (or message-unique-id-char (logand (random t) 
(1- (lsh 1 20)))))
| net/sasl.el:186:      (% (1+ (or sasl-unique-id-char (logand (random t) (1- 
(lsh 1 20)))))
| org/org-id.el:322:                      (random t)
| play/5x5.el:957:(random t)
| play/animate.el:204:(random t)
| play/blackbox.el:260:  (random t)
| play/cookie1.el:57:(random t)
| Binary file play/cookie1.elc matches
| play/dissociate.el:97:(random t)
| play/doctor.el:1620:(random t)
| play/dunnet.el:3013:(random t)
| play/gomoku.el:1200:(random t)
| play/landmark.el:1686:(random t)
| play/life.el:125:      (random t))
| play/mpuz.el:38:(random t)                            ; randomize
| play/tetris.el:639:(random t)
| play/zone.el:683:(random t)
| server.el:97:           (when val (random t))
| type-break.el:584:        (random t)
`----

> This should really be fixed by Emacs calling `(random t)' at startup.

That should leave for the user to do. Common Lisp also does no seeding
at start up.

Leo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]