#include "crandom.h"

unsigned long rand_seed;

void rand_num_init()
{
	//rand_seed = (unsigned long)time((time_t *)0);
	rand_seed = 0;
}

unsigned long rand_num_get()
{
	rand_seed *= 1566083941UL;
	rand_seed++;
	rand_seed &= 0xffffffffUL;
	return rand_seed;
}

unsigned long rand_num_get_bit(unsigned int bit)
{
	rand_seed *= 1566083941UL;
	rand_seed++;
	rand_seed &= 0xffffffffUL;
	return (rand_seed >> (32 - bit));
}

