Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

fastrand.h

Go to the documentation of this file.
00001 /*
00002  * fast pseudo random generation 
00003  *
00004  * $Id: fastrand.h,v 1.1 2007/06/14 23:23:47 andrei Exp $
00005  *
00006  * Copyright (C) 2007 iptelorg GmbH
00007  *
00008  * Permission to use, copy, modify, and distribute this software for any
00009  * purpose with or without fee is hereby granted, provided that the above
00010  * copyright notice and this permission notice appear in all copies.
00011  *
00012  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
00013  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
00014  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
00015  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00016  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00017  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
00018  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00019  */
00020 /*
00021  *History:
00022  *--------
00023  *  2007-06-15  wrapper around isaac (see 
00024  *              http://www.burtleburtle.net/bob/rand/isaacafa.html) (andrei)
00025  */
00026 
00027 #ifndef _fastrand_h
00028 #define _fastrand_h
00029 
00030 
00031 /* side effect: seeds also random w/ seed */
00032 void fastrand_seed(unsigned int seed);
00033 /* generate a 32 bit random number */
00034 unsigned int fastrand();
00035 /* generate a random number between 0 and max inclusive ( 0 <= r <= max)
00036  * should not be used for cryptography */
00037 unsigned int fastrand_max(unsigned int max);
00038 
00039 #endif

Generated on Tue Sep 7 04:16:13 2010 for SIPExpressRouter by  doxygen 1.3.9.1