## Python Package Link: [![PyPI version](https://img.shields.io/pypi/v/hashed.svg)](https://pypi.org/project/hashed/)
> A simple SHA-2 implementation in python which gives hash for string or a file.
> Suported hashing algorithms: SHA56, SHA512
## CLI Tool Usage
* Example
```python
python hashed/cli.py -s "Hello World!!" --sha256
```
```
Hash: 096c0a72c31f9a2d65126d8e8a401a2ab2f2e21d0a282a6ffe6642bbef65ffd9
```
* For help
```python
usage: Hashing Library [-h] [--sha256] [--sha512] [-s STRING] [-f FILE] [-fb BINARY_FILE] [-t] [-p] [-b]
Provides secured hashes for given data
options:
-h, --help show this help message and exit
--sha256 Generates SHA-256 for given input (default: False)
--sha512 Generates SHA-512 for given input (default: False)
-s STRING, --string STRING
String to be hashed (default: None)
-f FILE, --file FILE File to be hashed (default: None)
-fb BINARY_FILE, --binary_file BINARY_FILE
Binary file to be hashed (default: None)
-t, --test Test accuracy of algorithm (default: False)
-p, --perf Log performance of the algorithm (default: False)
-b, --bits Returns size of hashed message in bytes (default: False)
Currently supported hashes [SHA256, SHA512]
```
## Package Usage
```python
from hashed import HashLib
h = HashLib('sha256').hasher_class()
h.hex_digest("Hello World")
```
## Code Coverage and UTs
- Run UT
```
pytest
```
- Generate Coverage
```
coverage run -m pytest test
coverage html
```
## Functions Supported
- hex_digest
- file_digest
- digest
- hashed_bits
- digest_size
## For Algo refer: [SHA-256 Wiki](https://en.wikipedia.org/wiki/SHA-2)
## For more refer:
- https://blog.boot.dev/cryptography/how-sha-2-works-step-by-step-sha-256/
- https://github.com/mukund26/softwareEnggGuide/blob/main/sha256-384-512.pdf
Raw data
{
"_id": null,
"home_page": "https://github.com/mukund26/hashed",
"name": "hashed",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "python, hashing, sha256, sha512",
"author": "Mukund Agarwal",
"author_email": "m.agarwalhp@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/26/f8/f70234726bd16c03039490e90708ccb84ad7bea97976e21210cf29b131f8/hashed-2.2.0.tar.gz",
"platform": null,
"description": "## Python Package Link: [![PyPI version](https://img.shields.io/pypi/v/hashed.svg)](https://pypi.org/project/hashed/)\n\n> A simple SHA-2 implementation in python which gives hash for string or a file.\n> Suported hashing algorithms: SHA56, SHA512\n\n## CLI Tool Usage\n\n* Example\n\n```python\npython hashed/cli.py -s \"Hello World!!\" --sha256\n```\n\n```\nHash: 096c0a72c31f9a2d65126d8e8a401a2ab2f2e21d0a282a6ffe6642bbef65ffd9\n```\n\n\n* For help\n```python\nusage: Hashing Library [-h] [--sha256] [--sha512] [-s STRING] [-f FILE] [-fb BINARY_FILE] [-t] [-p] [-b]\n\nProvides secured hashes for given data\n\noptions:\n -h, --help show this help message and exit\n --sha256 Generates SHA-256 for given input (default: False)\n --sha512 Generates SHA-512 for given input (default: False)\n -s STRING, --string STRING\n String to be hashed (default: None)\n -f FILE, --file FILE File to be hashed (default: None)\n -fb BINARY_FILE, --binary_file BINARY_FILE\n Binary file to be hashed (default: None)\n -t, --test Test accuracy of algorithm (default: False)\n -p, --perf Log performance of the algorithm (default: False)\n -b, --bits Returns size of hashed message in bytes (default: False)\n\nCurrently supported hashes [SHA256, SHA512]\n```\n\n\n## Package Usage\n\n```python\nfrom hashed import HashLib\nh = HashLib('sha256').hasher_class()\nh.hex_digest(\"Hello World\")\n```\n\n## Code Coverage and UTs\n\n- Run UT\n\n```\npytest\n```\n\n- Generate Coverage\n\n```\ncoverage run -m pytest test\ncoverage html\n```\n\n## Functions Supported\n\n- hex_digest\n- file_digest\n- digest\n- hashed_bits\n- digest_size\n\n## For Algo refer: [SHA-256 Wiki](https://en.wikipedia.org/wiki/SHA-2)\n\n## For more refer:\n\n- https://blog.boot.dev/cryptography/how-sha-2-works-step-by-step-sha-256/\n- https://github.com/mukund26/softwareEnggGuide/blob/main/sha256-384-512.pdf\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Provides secured hashes for given data",
"version": "2.2.0",
"project_urls": {
"Homepage": "https://github.com/mukund26/hashed"
},
"split_keywords": [
"python",
" hashing",
" sha256",
" sha512"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e85a36ce538880c25ab831fe451d9fb19800ca386f57d23b3cfaec9b7d0d4a7f",
"md5": "560e183e1b6eeed5a0d2dd09cbd88be5",
"sha256": "8797f46838f000b29c783c8a0dcaf2a2f047aeea4d7ce413e8c0acd39b5e62d9"
},
"downloads": -1,
"filename": "hashed-2.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "560e183e1b6eeed5a0d2dd09cbd88be5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 11724,
"upload_time": "2024-04-09T16:38:06",
"upload_time_iso_8601": "2024-04-09T16:38:06.551260Z",
"url": "https://files.pythonhosted.org/packages/e8/5a/36ce538880c25ab831fe451d9fb19800ca386f57d23b3cfaec9b7d0d4a7f/hashed-2.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "26f8f70234726bd16c03039490e90708ccb84ad7bea97976e21210cf29b131f8",
"md5": "5564d14634567e56b730621c392b7e98",
"sha256": "2ed658e0db819e40b69b71e29375ef6e48afb6d3c11b3789aba42cd2db22c313"
},
"downloads": -1,
"filename": "hashed-2.2.0.tar.gz",
"has_sig": false,
"md5_digest": "5564d14634567e56b730621c392b7e98",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 9245,
"upload_time": "2024-04-09T16:38:08",
"upload_time_iso_8601": "2024-04-09T16:38:08.114629Z",
"url": "https://files.pythonhosted.org/packages/26/f8/f70234726bd16c03039490e90708ccb84ad7bea97976e21210cf29b131f8/hashed-2.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-09 16:38:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mukund26",
"github_project": "hashed",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hashed"
}