aboutsummaryrefslogtreecommitdiff
path: root/py/objmodule.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-01-17 12:10:28 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-01-17 12:13:01 +0200
commita58a91eb04c50daafb31228a79f6752374338c5e (patch)
tree67c1aaf41dc3e52f650b2a9168a1e80c0f0e77f3 /py/objmodule.c
parente7bee6b35ea4c9e622209902456be64559b94d17 (diff)
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
Diffstat (limited to 'py/objmodule.c')
-rw-r--r--py/objmodule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/py/objmodule.c b/py/objmodule.c
index 32ded8919..1034d00f6 100644
--- a/py/objmodule.c
+++ b/py/objmodule.c
@@ -184,6 +184,9 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
#if MICROPY_PY_UBINASCII
{ MP_ROM_QSTR(MP_QSTR_ubinascii), MP_ROM_PTR(&mp_module_ubinascii) },
#endif
+#if MICROPY_PY_URANDOM
+ { MP_ROM_QSTR(MP_QSTR_urandom), MP_ROM_PTR(&mp_module_urandom) },
+#endif
#if MICROPY_PY_USSL
{ MP_ROM_QSTR(MP_QSTR_ussl), MP_ROM_PTR(&mp_module_ussl) },
#endif