2 seed - return a value that may be used to seed a pseudo-random generator
11 Generate a pseudo-random seed based on a collection of system and process
12 information. The seed() builtin function returns a value:
18 It should be pointed out that the information collected by seed
19 is almost certainly non-chaotic. This function is likely not
20 suitable for applications (such as cryptographic applications)
21 where the unpredictability of seeds is critical. For such critical
22 applications, LavaRnd should be used. See the URL:
24 http://www.LavaRnd.org/
26 for information about seeding a pseudo-random number generator
27 (such as rand() or random()) with the cryptographic hash of the
28 digitization of chaotic system.
30 Given the above warning, this builtin function produces a seed that is
31 suitable for most applications that desire a different pseudo-random
32 sequence each time they are run.
34 The return value of this builtin function should NOT be considered
35 a random or pseudo-random value. The return value should be used
36 as an argument to a seed function such as srand() or srandom().
42 ; print srandom(seed())
49 NUMBER *pseudo_seed(void)
52 seed, srand, randbit, isrand, rand, random, srandom, israndom
54 ## Copyright (C) 1999 Landon Curt Noll
56 ## Calc is open software; you can redistribute it and/or modify it under
57 ## the terms of the version 2.1 of the GNU Lesser General Public License
58 ## as published by the Free Software Foundation.
60 ## Calc is distributed in the hope that it will be useful, but WITHOUT
61 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
62 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
63 ## Public License for more details.
65 ## A copy of version 2.1 of the GNU Lesser General Public License is
66 ## distributed with calc under the filename COPYING-LGPL. You should have
67 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
68 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
70 ## @(#) $Revision: 30.1 $
71 ## @(#) $Id: seed,v 30.1 2007/03/16 11:10:42 chongo Exp $
72 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/seed,v $
74 ## Under source code control: 1999/10/03 10:04:29
75 ## File existed as early as: 1999
77 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
78 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/