{ "info": { "author": "BananaLoaf", "author_email": "bananaloaf@protonmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# seedrandom\nRandom number generation based on the seed\n\n### Installation / Updating\n```\npip install seedrandom\npip install --upgrade seedrandom\n```\nOr\n```\npip install git+https://github.com/BananaLoaf/seedrandom.git\npip install --upgrade git+https://github.com/BananaLoaf/seedrandom.git\n```\n\n### Is it random?\n\nUppon generating 100000 random numbers in a range of 1 to 5, it showed equal distribution\n\n| | |\n|---\t|:-----:\t|\n| 1 \t| 20.0% \t|\n| 2 \t| 20.2% \t|\n| 3 \t| 19.9% \t|\n| 4 \t| 20.0% \t|\n| 5 \t| 19.9% \t|\n\n### Usage\n\n```python\nfrom seedrandom import Seed\nseed = Seed(b\"Test\", b\"values\")\n```\n\nGenerating random values:\n```python\nseed.randint(_min=1, _max=10)\nseed.randfloat(_min=0, _max=6, step=0.1)\nseed.randbool()\nseed.randbyte()\n```\n\n```Seed``` can be converted to and from ```int``` or ```bytes```:\n```python\nseed1 = Seed(b\"Bytes\")\nseed2 = Seed(b\"Int\")\nbytes(seed1) # b\"\\x9e^\\n\\x06j\\x99\\xe1`\\x86m-\\xe7Z\\n\\xbdSN\\x92O}\\x89@\\xd0\\r'\\x86\\xf1\\xaf\\xcd\\xd4\\xa2'\"\nint(seed2) # 31431599345838686137398213930967341686259486292204322755690725188121734625692\n\nseed1 = Seed.from_bytes(b\"\\x9e^\\n\\x06j\\x99\\xe1`\\x86m-\\xe7Z\\n\\xbdSN\\x92O}\\x89@\\xd0\\r'\\x86\\xf1\\xaf\\xcd\\xd4\\xa2'\") # \nseed2 = Seed.from_int(31431599345838686137398213930967341686259486292204322755690725188121734625692) # \n```\n\n```Seed``` can use different hashing functions from ```hashlib``` module\n```python\nseed1 = Seed(b\"Test\", b\"values\") # Uses hashlib.sha256 by default\nseed2 = Seed(b\"Test\", b\"values\", hash_func=hashlib.md5)\n\nseed1.randint(_min=0, _max=100000) # 2457\nseed2.randint(_min=0, _max=100000) # 98655\n```\n\n```ordered``` argument can be used:\n```python\nseed1 = Seed(b\"Hello\", b\"world\")\nseed2 = Seed(b\"world\", b\"Hello\")\nseed1 == seed2 # True\n\nseed1 = Seed(ordered=(b\"Hello\", b\"world\"))\nseed2 = Seed(ordered=(b\"world\", b\"Hello\"))\nseed1 == seed2 # False\n\nseed1 = Seed(b\"Hello\", b\"world\", ordered=(b\"spanish\", b\"inquisition\"))\nseed2 = Seed(b\"world\", b\"Hello\", ordered=(b\"spanish\", b\"inquisition\"))\nseed1 == seed2 # True\n\nseed1 = Seed(b\"Hello\", b\"world\", ordered=(b\"spanish\", b\"inquisition\"))\nseed2 = Seed(b\"Hello\", b\"world\", ordered=(b\"inquisition\", b\"spanish\"))\nseed1 == seed2 # False\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/BananaLoaf/seedrandom/archive/v1.4.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/BananaLoaf/seedrandom", "keywords": "random,seed,generator,hash,int,float,bool,bytes", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "seedrandom", "package_url": "https://pypi.org/project/seedrandom/", "platform": "", "project_url": "https://pypi.org/project/seedrandom/", "project_urls": { "Download": "https://github.com/BananaLoaf/seedrandom/archive/v1.4.1.tar.gz", "Homepage": "https://github.com/BananaLoaf/seedrandom" }, "release_url": "https://pypi.org/project/seedrandom/1.4.1/", "requires_dist": null, "requires_python": "", "summary": "Random number generation based on the seed", "version": "1.4.1" }, "last_serial": 5244262, "releases": { "1.4": [ { "comment_text": "", "digests": { "md5": "0cb166297af40399959340a41995e444", "sha256": "ab5dffaf895ad731f69677f1a590bf6c546b5a8fc49c863d657ec798e09da3ba" }, "downloads": -1, "filename": "seedrandom-1.4.tar.gz", "has_sig": false, "md5_digest": "0cb166297af40399959340a41995e444", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3512, "upload_time": "2019-05-08T18:32:06", "url": "https://files.pythonhosted.org/packages/cd/fa/f57d4d7ad5ad4e078970bee1c5b831e9264b0a61cbcfd875c8ee334f90b6/seedrandom-1.4.tar.gz" } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "a10cff4047a6e1f311f649116f46931a", "sha256": "c86a23d4b9779f178ced61ae546499fa4c1aae6cc71b88dfb4736c30956c9d11" }, "downloads": -1, "filename": "seedrandom-1.4.1.tar.gz", "has_sig": false, "md5_digest": "a10cff4047a6e1f311f649116f46931a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3495, "upload_time": "2019-05-08T19:11:15", "url": "https://files.pythonhosted.org/packages/9a/3f/a92d19b71a3b13821b3f842baee9fe41b4c486a86930478c812beef00d9a/seedrandom-1.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a10cff4047a6e1f311f649116f46931a", "sha256": "c86a23d4b9779f178ced61ae546499fa4c1aae6cc71b88dfb4736c30956c9d11" }, "downloads": -1, "filename": "seedrandom-1.4.1.tar.gz", "has_sig": false, "md5_digest": "a10cff4047a6e1f311f649116f46931a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3495, "upload_time": "2019-05-08T19:11:15", "url": "https://files.pythonhosted.org/packages/9a/3f/a92d19b71a3b13821b3f842baee9fe41b4c486a86930478c812beef00d9a/seedrandom-1.4.1.tar.gz" } ] }