{ "info": { "author": "Antoni Baum", "author_email": "antoni.baum@protonmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "sourcerandom for Python\n============\n\nTrue randomness, with minimal fuss.\n\nAlternate random number generator using sources provided by either True Random Number Generator online services ([RANDOM.org](http://random.org) and [qrng.anu.edu.au](http://qrng.anu.edu.au)), plaintext uint8 files (separated by whitespace) or collections of ints.\n\nsourcerandom's ``SourceRandom`` class extends ``SystemRandom`` class found in default ``random`` package, and only overwrites the ``getrandbits`` method, meaning all of the functionality of ``random`` package is included and unchanged.\n\nsourcerandom obtains bytes from the given source, which are then used to generate random numbers. The bytes are cached for quick access - the amount of cached bytes can be set by the user.\n\n``OnlineRandomnessSource`` enumerator is provided to easily choose between RANDOM.org (``RANDOM_ORG``) and qrng.anu.edu.au (``QRNG_ANU``).\n\nSince the bytes generated by the online services are truly random (please refer to the services for explanation), they can be theoretically used for cryptography instead of OS sources. However, I hold no responsibility for any problems or damages this may cause.\n\nAsync/multithread friendly.\n\nRequires Python 3.5.2 or above, and the ``requests`` package.\n\nPull requests are encouraged :D\n\nInstalling\n----------\n\n pip install sourcerandom\n\nUsage\n----------\n\n import sourcerandom\n\n # From an online source\n\n RAND_GEN = sourcerandom.SourceRandom(source=sourcerandom.OnlineRandomnessSource.QRNG_ANU) # Initialize the generator - use the same generator to take advantage of caching\n\n print(RAND_GEN.randint(0, 20)) # Every method from random package is included\n\n # From file\n\n RAND_GEN = sourcerandom.SourceRandom(source=\"path/to/file\") # File has to be a plaintext file with integers from range of 0 to 255 separated by whitespace, path is a simple string, relative to working directory. Files are read in cache_size chunks.\n\n # From collection\n\n BYTES_LIST = [ 0, 156, 245, 63, 52 ] # Integers from range of 0 to 255 separated by whitespace\n\n RAND_GEN = sourcerandom.SourceRandom(source=BYTES_LIST)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Yard1/sourcerandom", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sourcerandom", "package_url": "https://pypi.org/project/sourcerandom/", "platform": "", "project_url": "https://pypi.org/project/sourcerandom/", "project_urls": { "Homepage": "https://github.com/Yard1/sourcerandom" }, "release_url": "https://pypi.org/project/sourcerandom/1.0.2/", "requires_dist": null, "requires_python": ">=3.5.2", "summary": "Python package for alternate true random number generator using sources provided by either TRNG online services, plaintext uint8 files (separated by whitespace) or collections of ints.", "version": "1.0.2" }, "last_serial": 3932832, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "5e0319f9d1e6f36e6349cc98ca0fe891", "sha256": "e4b6a3f5c43fff68af2ad77aacddd84b2c4e0ab3e8294d34e43317fb73ae24c1" }, "downloads": -1, "filename": "sourcerandom-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5e0319f9d1e6f36e6349cc98ca0fe891", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.2", "size": 6009, "upload_time": "2018-06-05T13:50:06", "url": "https://files.pythonhosted.org/packages/5a/9c/da13d172aa89116456b0c6507b06a2ccea44cdd8716af6835a1efb1bd557/sourcerandom-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "bd20f4f340aded54a704956123172ee2", "sha256": "4f1de75ac8a29e8ad596022baeb9736544aa42e85026f9b21d6e709a740fdd49" }, "downloads": -1, "filename": "sourcerandom-1.0.1.tar.gz", "has_sig": false, "md5_digest": "bd20f4f340aded54a704956123172ee2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.2", "size": 6064, "upload_time": "2018-06-05T14:05:41", "url": "https://files.pythonhosted.org/packages/44/cd/e3eeab99bb2e49a47378c6ee85dc8c2ab9b8e53fee8819fa9f18c7f6e3fa/sourcerandom-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "66eb667db8ecbe3f2c75554820b9da95", "sha256": "20aac8b05e632307630b26d88b527acbe7cea7c6fd892f0bd797ee30f795b1f7" }, "downloads": -1, "filename": "sourcerandom-1.0.2.tar.gz", "has_sig": false, "md5_digest": "66eb667db8ecbe3f2c75554820b9da95", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.2", "size": 6085, "upload_time": "2018-06-05T16:15:50", "url": "https://files.pythonhosted.org/packages/1b/d9/4d1186ecff37b29dfdf81936df77f6514a4239f09fbe557b1438bafd213a/sourcerandom-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "66eb667db8ecbe3f2c75554820b9da95", "sha256": "20aac8b05e632307630b26d88b527acbe7cea7c6fd892f0bd797ee30f795b1f7" }, "downloads": -1, "filename": "sourcerandom-1.0.2.tar.gz", "has_sig": false, "md5_digest": "66eb667db8ecbe3f2c75554820b9da95", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.2", "size": 6085, "upload_time": "2018-06-05T16:15:50", "url": "https://files.pythonhosted.org/packages/1b/d9/4d1186ecff37b29dfdf81936df77f6514a4239f09fbe557b1438bafd213a/sourcerandom-1.0.2.tar.gz" } ] }