mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-30 08:20:21 +00:00
16b34c6e4d
* Explain RNG differences, add FURI_HAL_RANDOM_MAX * Mark FURI_HAL_RANDOM_MAX unsigned Co-authored-by: あく <alleteam@gmail.com>
31 lines
607 B
C
31 lines
607 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define FURI_HAL_RANDOM_MAX 0xFFFFFFFFU
|
|
|
|
/** Initialize random subsystem */
|
|
void furi_hal_random_init(void);
|
|
|
|
/** Get random value
|
|
* furi_hal_random_get() gives up to FURI_HAL_RANDOM_MAX
|
|
* rand() and random() give up to RAND_MAX
|
|
*
|
|
* @return 32 bit random value (up to FURI_HAL_RANDOM_MAX)
|
|
*/
|
|
uint32_t furi_hal_random_get(void);
|
|
|
|
/** Fill buffer with random data
|
|
*
|
|
* @param buf buffer pointer
|
|
* @param data buffer len
|
|
*/
|
|
void furi_hal_random_fill_buf(uint8_t* buf, uint32_t len);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|