From 9ded3a2bde80eede5fd887812d70c2f834b53c84 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 13 Apr 2021 22:09:23 +0200 Subject: Started IO dev manager --- libs/libc/inc/rand.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 libs/libc/inc/rand.h (limited to 'libs/libc/inc/rand.h') diff --git a/libs/libc/inc/rand.h b/libs/libc/inc/rand.h new file mode 100644 index 0000000..1b41df5 --- /dev/null +++ b/libs/libc/inc/rand.h @@ -0,0 +1,15 @@ +// MIT License, Copyright (c) 2020 Marvin Borner + +#ifndef RANDOM_H +#define RANDOM_H + +#include + +#define rand_range(min, max) (rand() % ((max) + 1 - (min)) + (min)) + +void srand(u32 seed); +u32 rand(void); +void rand_fill(void *buf, u32 size); +char *randstr(u32 size); + +#endif -- cgit v1.2.3