{ "info": { "author": "Ashutosh Kumar", "author_email": "ashutoshk.akumar@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "hashver ![Build Status](https://travis-ci.org/ashutoshkumr/python-hashver.svg?branch=master)\n=======\n\nIs a python module to derive a unique numeric value from a version string and vice versa, adhering to following constraints:\n - Resultant number must be unique for all possible values of a, b, c and d\n - Each of a, b, c and d needs to be below certain maximum unsigned int guided\n by max possible bits allotted to each version component\n - We should be able to derive unique a.b.c.d back from given number\n - If a.b.c.d => x and p.q.r.s => y then, a.b.c.d < p.q.r.s => x < y\n\n### Usage\n\nAfter performing **python -m pip install hashver**, execute python code as mentioned below.\n```python\n>>> from hashver import HashVer\n>>> hob = HashVer()\n>>> hob.get_num('1.0.6')\n4294967302\n>>> hob.get_version_str(8590000133)\n2.1.5\n>>> # if your version is of format a.b.c.d, each of which should be at most 2^16\n>>> hob = HashVer(bits_per_component='16.16.16.16')\n>>> hob.get_num('9.0.100.10')\n2533274796949514\n>>> hob.get_version_str(2533274796949514)\n9.0.100.10\n```\n\nOr if you have curl,\n```bash\ncurl -skL https://raw.githubusercontent.com/ashutoshkumr/python-hashver/master/hashver/hashver.py | python - 1.0.6 8590000133\n\n1.0.6 : 4294967302\n8590000133 : 2.1.5\n```\n\n### Modification and Testing\n\nIf any modification is done to hashver source, use following to validate changes,\n```bash\n# ensure various combinations of version string or number can be derived from each other\npython -B ${hashver-root}/hashver.py 9.0.100.10 2533274796949514 --bpc 16.16.16.16\n\n9.0.100.10 : 2533274796949514\n2533274796949514: 9.0.100.10\n\n# or simply add them to the existing test suite in hashver/test_hashver.py and run pytest\ncd ${hashver-root} && pytest\n```", "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/ashutoshkumr/python-hashver", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "hashver", "package_url": "https://pypi.org/project/hashver/", "platform": "", "project_url": "https://pypi.org/project/hashver/", "project_urls": { "Homepage": "https://github.com/ashutoshkumr/python-hashver" }, "release_url": "https://pypi.org/project/hashver/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "hashver is a python module to derive a unique numeric value from a version string and vice versa", "version": "0.0.2" }, "last_serial": 5668552, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "942e5366f25f14bef5383cb7a70ba026", "sha256": "b6db1f0f8bedab6bf891f54238f536b880113e535baaf8bffcfc74ee4754f7d5" }, "downloads": -1, "filename": "hashver-0.0.1.tar.gz", "has_sig": false, "md5_digest": "942e5366f25f14bef5383cb7a70ba026", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3796, "upload_time": "2019-08-12T19:50:33", "url": "https://files.pythonhosted.org/packages/5f/7a/7f8f03126e019c8fa939fcfc23bef634dd8cce913f537b824ac575fb29e2/hashver-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "e24521045fa808c5016c3fcd6cd00448", "sha256": "5258de64b14556fee9c8aa05fcd759dd581939d13131515c62995f8f5f9aa885" }, "downloads": -1, "filename": "hashver-0.0.2.tar.gz", "has_sig": false, "md5_digest": "e24521045fa808c5016c3fcd6cd00448", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3792, "upload_time": "2019-08-12T20:10:38", "url": "https://files.pythonhosted.org/packages/dc/98/f5ee72a374afaa832c0d7e4ed9b2b81530a18489af9a2a33a5e8bcf0ea54/hashver-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e24521045fa808c5016c3fcd6cd00448", "sha256": "5258de64b14556fee9c8aa05fcd759dd581939d13131515c62995f8f5f9aa885" }, "downloads": -1, "filename": "hashver-0.0.2.tar.gz", "has_sig": false, "md5_digest": "e24521045fa808c5016c3fcd6cd00448", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3792, "upload_time": "2019-08-12T20:10:38", "url": "https://files.pythonhosted.org/packages/dc/98/f5ee72a374afaa832c0d7e4ed9b2b81530a18489af9a2a33a5e8bcf0ea54/hashver-0.0.2.tar.gz" } ] }