Skip to content

A PRNGs that can use the TSC (Time Stamp Counter) from the x86 based host processor

License

Notifications You must be signed in to change notification settings

shadergz/prng64

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prng64

  • A PRNGs that can use the TSC (Time Stamp Counter) from the x86 based host processor

Usage examples

  • With BY_TIME 1 (Using the current raw time as seed)
sprng (time (NULL));
  • With BY_RANDOM_FILE 1 (Using the pseudo random file from an unix env)
#if defined (__unix__)
int pseudo = 0;
int fd = open ("/dev/random", O_RDONLY);
read (fd, &pseudo, sizeof (int));
close (fd);
#endif
  • With TSC (BY_TIME 0 && BY_RANDOM_FILE 0)
sprng (0);

How to build

make

How to clean

make clean

About

A PRNGs that can use the TSC (Time Stamp Counter) from the x86 based host processor

Topics

Resources

License

Stars

Watchers

Forks