summaryrefslogtreecommitdiffstatshomepage
path: root/py/qstrdefs.h
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/qstrdefs.h
parente7bee6b35ea4c9e622209902456be64559b94d17 (diff)
downloadmicropython-a58a91eb04c50daafb31228a79f6752374338c5e.tar.gz
micropython-a58a91eb04c50daafb31228a79f6752374338c5e.zip
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/qstrdefs.h')
-rw-r--r--py/qstrdefs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/qstrdefs.h b/py/qstrdefs.h
index 50f2b3b385..7e21090063 100644
--- a/py/qstrdefs.h
+++ b/py/qstrdefs.h
@@ -671,3 +671,9 @@ Q(count)
#if MICROPY_PY_OS_DUPTERM
Q(dupterm)
#endif
+
+#if MICROPY_PY_URANDOM
+Q(urandom)
+Q(getrandbits)
+Q(seed)
+#endif