Skip to main content

Provides secured hashes for given data

Project description

Python Package Link: PyPI version

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 hashed/ -s "Hello World!!" --sha256
Hash:  096c0a72c31f9a2d65126d8e8a401a2ab2f2e21d0a282a6ffe6642bbef65ffd9
  • For help
usage: Hashing Library [-h] [--sha256] [--sha512] [-s STRING] [-f FILE] [-fb BINARY_FILE] [-t] [-p] [-b]

Provides secured hashes for given data

  -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

from hashed import HashLib
h = HashLib('sha256').hasher_class()
h.hex_digest("Hello World")

Code Coverage and UTs

  • Run UT
  • 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

For more refer:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hashed-2.2.0.tar.gz (9.2 kB view hashes)

Uploaded Source

Built Distribution

hashed-2.2.0-py3-none-any.whl (11.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page