diff options
| author | rsc <devnull@localhost> | 2003-11-23 18:21:42 +0000 |
|---|---|---|
| committer | rsc <devnull@localhost> | 2003-11-23 18:21:42 +0000 |
| commit | db6608bd819d10cc2ddb57d18054d62d4ca15596 (patch) | |
| tree | f896aa4af2274555fbafb765ccaa877d53eb4cc9 /src/libsec/port/fastrand.c | |
| parent | 056fe1ba7fa0b70f871dfb9005b24eb8e4cc230b (diff) | |
| download | plan9port-db6608bd819d10cc2ddb57d18054d62d4ca15596.tar.gz plan9port-db6608bd819d10cc2ddb57d18054d62d4ca15596.zip | |
add libsec
Diffstat (limited to 'src/libsec/port/fastrand.c')
| -rw-r--r-- | src/libsec/port/fastrand.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libsec/port/fastrand.c b/src/libsec/port/fastrand.c new file mode 100644 index 00000000..14571277 --- /dev/null +++ b/src/libsec/port/fastrand.c @@ -0,0 +1,16 @@ +#include <u.h> +#include <libc.h> +#include <libsec.h> + +/* + * use the X917 random number generator to create random + * numbers (faster than truerand() but not as random). + */ +ulong +fastrand(void) +{ + ulong x; + + genrandom((uchar*)&x, sizeof x); + return x; +} |
