X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utils%2Fyarandom.c;h=f12ea952857d3a84cc5e939814b9ee11acb74337;hb=c8c6deae79b408cffbc88043c766b3bc12cf0f13;hp=63958e24700b35bdff62cda8af9a7f34d50cdb26;hpb=df7adbee81405e2849728a24b498ad2117784b1f;p=xscreensaver diff --git a/utils/yarandom.c b/utils/yarandom.c index 63958e24..f12ea952 100644 --- a/utils/yarandom.c +++ b/utils/yarandom.c @@ -1,6 +1,16 @@ /* yarandom.c -- Yet Another Random Number Generator. + * Copyright (c) 1997, 1998, 2003 by Jamie Zawinski + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. No representations are made about the suitability of this + * software for any purpose. It is provided "as is" without express or + * implied warranty. + */ - The unportable mess that is rand(), random(), drand48() and friends led me +/* The unportable mess that is rand(), random(), drand48() and friends led me to ask Phil Karlton what the Right Thing to Do was. He responded with this. It is non-cryptographically secure, reasonably random (more so than anything that is in any C library), and very fast. @@ -51,6 +61,7 @@ #include /* for gettimeofday() */ #include "yarandom.h" +# undef ya_rand_init /* The following 'random' numbers are taken from CRC, 18th Edition, page 622.