os: Add urandom().

pull/118/head^2
Paul Sokolovsky 2014-06-07 23:16:36 +03:00
rodzic 8bc5ac5b75
commit c4c29b4f57
3 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -1,4 +1,4 @@
srctype = micropython-lib
type = package
version = 0.0.9
version = 0.1
author = Paul Sokolovsky

Wyświetl plik

@ -173,3 +173,8 @@ def fsdecode(s):
if type(s) is str:
return s
return str(s, "utf-8")
def urandom(n):
with open("/dev/urandom", "rb") as f:
return f.read(n)

Wyświetl plik

@ -6,7 +6,7 @@ from setuptools import setup
setup(name='micropython-os',
version='0.0.9',
version='0.1',
description='os module for MicroPython',
long_description="This is a module reimplemented specifically for MicroPython standard library,\nwith efficient and lean design in mind. Note that this module is likely work\nin progress and likely supports just a subset of CPython's corresponding\nmodule. Please help with the development if you are interested in this\nmodule.",
url='https://github.com/micropython/micropython/issues/405',