aboutsummaryrefslogtreecommitdiff
path: root/libs/libc/inc/random.h
blob: 1b41df5a7de90571c1d2819c4a9b93baf354b6e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// MIT License, Copyright (c) 2020 Marvin Borner

#ifndef RANDOM_H
#define RANDOM_H

#include <def.h>

#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