kopia lustrzana https://github.com/micropython/micropython-lib
os: Add urandom().
rodzic
8bc5ac5b75
commit
c4c29b4f57
|
@ -1,4 +1,4 @@
|
||||||
srctype = micropython-lib
|
srctype = micropython-lib
|
||||||
type = package
|
type = package
|
||||||
version = 0.0.9
|
version = 0.1
|
||||||
author = Paul Sokolovsky
|
author = Paul Sokolovsky
|
||||||
|
|
|
@ -173,3 +173,8 @@ def fsdecode(s):
|
||||||
if type(s) is str:
|
if type(s) is str:
|
||||||
return s
|
return s
|
||||||
return str(s, "utf-8")
|
return str(s, "utf-8")
|
||||||
|
|
||||||
|
|
||||||
|
def urandom(n):
|
||||||
|
with open("/dev/urandom", "rb") as f:
|
||||||
|
return f.read(n)
|
||||||
|
|
|
@ -6,7 +6,7 @@ from setuptools import setup
|
||||||
|
|
||||||
|
|
||||||
setup(name='micropython-os',
|
setup(name='micropython-os',
|
||||||
version='0.0.9',
|
version='0.1',
|
||||||
description='os module for MicroPython',
|
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.",
|
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',
|
url='https://github.com/micropython/micropython/issues/405',
|
||||||
|
|
Ładowanie…
Reference in New Issue