[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS: cvs.openbsd.org: src
- To: source-changes_(_at_)_cvs_(_dot_)_openbsd_(_dot_)_org
- Subject: CVS: cvs.openbsd.org: src
- From: Damien Miller <djm_(_at_)_cvs_(_dot_)_openbsd_(_dot_)_org>
- Date: Sun, 2 Mar 2008 14:29:07 -0700 (MST)
CVSROOT: /cvs
Module name: src
Changes by: djm_(_at_)_cvs_(_dot_)_openbsd_(_dot_)_org 2008/03/02 14:29:07
Modified files:
share/man/man9 : Makefile random.9
sys/dev : rnd.c rndvar.h
sys/netinet : ip_id.c
Log message:
Add a arc4random_uniform() that returns a uniformly distributed number
in the range 0 <= x < upper_bound
Please use this new API instead of "arc4random() % upper_bound", as it
avoids the "modulo bias" that favours small results when upper_bound is
not a power of two.
feedback deraadt@ mcbride@; ok deraadt@
Visit your host, monkey.org