extmod/modurandom: Add "urandom" module.

Seedable and reproducible pseudo-random number generator. Implemented
functions are getrandbits(n) (n <= 32) and seed().

The algorithm used is Yasmarang by Ilya Levin:
http://www.literatecode.com/yasmarang
This commit is contained in:
Paul Sokolovsky
2016-01-17 12:10:28 +02:00
parent e7bee6b35e
commit a58a91eb04
8 changed files with 109 additions and 0 deletions

View File

@@ -101,6 +101,7 @@ extern const mp_obj_module_t mp_module_ure;
extern const mp_obj_module_t mp_module_uheapq;
extern const mp_obj_module_t mp_module_uhashlib;
extern const mp_obj_module_t mp_module_ubinascii;
extern const mp_obj_module_t mp_module_urandom;
extern const mp_obj_module_t mp_module_ussl;
extern const mp_obj_module_t mp_module_machine;
extern const mp_obj_module_t mp_module_lwip;