RNG
概述
随机数生成器(Random number generation),可以生成指定长度的随机数。
应用实例
串口实例: customer_app/peripheral/demo_rng
。
API参考
Header File
- components/platform/hosal/include/hosal_rng.h
Functions
-
int
hosal_rng_init
(void) init rng
- Return
- 0 : success
- other: fail
-
int
hosal_random_num_read
(void *buf, uint32_t bytes) Fill in a memory buffer with random data.
- Return
- 0 : success
- other: fail
- Parameters
buf
: Point to a valid memory buffer, this function will fill in this memory with random numbers after executedbytes
: Length of the memory buffer (bytes)