HARMcksL: ARM HAL toolbox (yet STM32 oriented) 1.6
SMFSW collection of HAL hacks for STM32
Loading...
Searching...
No Matches
random_utils.c File Reference

(A little less pseudo) random numbers generation utilities More...

#include <stdlib.h>
#include <string.h>
#include "random_utils.h"
#include "exceptions.h"
Include dependency graph for random_utils.c:

Functions

uint32_t random_Get (const uint32_t start)
 Generate a random number based on STM32 unique ID.
 

Detailed Description

(A little less pseudo) random numbers generation utilities

Author
SMFSW
Note
Randomness is enhanced between MCUs (using UID), through calls and time
Warning
Unfortunately, after reset, assuming call will happen at same clock tick, random_Get will give same result (unless start saved/restore from some storage is given as parameter at first call)

Function Documentation

◆ random_Get()

uint32_t random_Get ( const uint32_t start)

Generate a random number based on STM32 unique ID.

Parameters
[in]start- Value for a first seed (if a value has been stored for next reset)
Returns
Generated random number