eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'RandomKISS':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: RandomKISS


Inheritance:

   Object
   |
   +--RandomKISS

Package:
stx:libbasic2
Category:
Magnitude-Numbers-Random
Version:
rev: 1.11 date: 2021/04/10 08:29:05
user: cg
file: RandomKISS.st directory: libbasic2
module: stx stc-classLibrary: libbasic2
Author:
Ported to Smalltalk by Claus Gittinger.

Description:


WARNING: this generator should NOT be used for cryptographic work.

NO WARRANTY

KISS combines a linear congruence, XorShift and Lag with carry generator.
The idea is from George Marsaglia.

RandomKISS new nextInteger
(RandomKISS new:5489) nextInteger

If heavily used, it may be useful to embed the original C code as inline C code for a big speedup)

Please read:
    Wikipedia article on KISS http://de.wikipedia.org/wiki/KISS_(Zufallszahlengenerator)
    http://de.wikipedia.org/wiki/Liste_von_Zufallszahlengeneratoren
    http://eprint.iacr.org/2011/007.pdf  (KISS is not cryptographically secure)


Related information:

    http://www0.cs.ucl.ac.uk/staff/d.jones/GoodPracticeRNG.pdf
    RandomGenerator
    -
    the
    default;
    uses
    the
    machine's
    /dev/random
    if
    available
    Random
    -
    fast,
    but
    generates
    less
    quality
    random
    numbers
    RandomTT800
    -
    another
    random
    generator
    RandomParkMiller
    -
    another
    random
    generator
    RandomMT19937
    -
    another
    random
    generator

Class protocol:

instance creation
o  new
(comment from inherited method)
return an instance of myself without indexed variables

o  new: seed
(comment from inherited method)
return an instance of myself with anInteger indexed variables


Instance protocol:

initialization
o  initialize
<- any seed != 0

o  seed: seed

random numbers
o  nextBoolean
generates a boolean random

o  nextInteger
generates the next integer in 0..FFFFFFFF



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Thu, 21 Nov 2024 11:54:26 GMT