1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
#pike __REAL_VERSION__ 
#pragma strict_types 
#require constant(Nettle.Fortuna) 
 
//! This class implements a detministic random generator by combining 
//! a Fortuna random generator with the @[Random.Interface]. The 
//! generator is not reseeded after the initial seed. 
//! 
//! In case of a process fork the random generators in both processes 
//! will continue to generate identical results. 
 
inherit Builtin.RandomInterface; 
inherit Nettle.Fortuna; 
 
//! Initialize the random generator with seed. The internal state is 
//! 256 bits, but all seed sizes are allowed. 
protected void create(string(8bit)|int seed) 
{ 
  reseed((string(8bit))seed); 
}