A lightweight Python library and CLI for hashing text and files using multiple cryptographic algorithms.
- π Hash text strings
- π Hash files of any size
- π» Built-in CLI support
- β‘ Supports multiple algorithms
- π¦ Zero dependencies
- π Python 3.8+
- π Lightweight and fast
PyHashKit provides a simple and beginner-friendly interface for Python's built-in hashing functionality.
Instead of manually working with hashlib, you can hash text and files with a single function call or directly from the command line.
PyHashKit supports most algorithms available through Python's built-in hashlib.
Common examples:
- SHA-256
- SHA-512
- SHA-224
- SHA-384
- MD5
- SHA-1
- SHA3-224
- SHA3-256
- SHA3-384
- SHA3-512
- BLAKE2b
- BLAKE2s
The following algorithms are currently not supported:
- SHAKE-128 (
shake_128) - SHAKE-256 (
shake_256)
These algorithms require a custom digest length and are intentionally excluded to keep the API simple and consistent.
pip install PyHashKitfrom pyhashkit import hash_text, hash_file
print(hash_text("Hello World"))
print(hash_file("example.txt"))PyHashKit includes a built-in command-line interface for hashing text and files directly from your terminal.
text Hash a text string
file Hash a file
commands Show all commands
-v, -V, --version
Show version information
-a, --algorithm
Specify hashing algorithm
(default: sha256)
Hash text:
pyhashkit text "Hello World"Hash text using MD5:
pyhashkit text "Hello World" -a md5Hash a file:
pyhashkit file example.txtHash a file using SHA-512:
pyhashkit file example.txt -a sha512Show version information:
pyhashkit -vShow all available commands:
pyhashkit commandsfrom pyhashkit import hash_text
result = hash_text("Hello World")
print(result)from pyhashkit import hash_text
result = hash_text(
"Hello World",
algorithm="md5"
)
print(result)from pyhashkit import hash_file
result = hash_file("example.txt")
print(result)from pyhashkit import hash_file
result = hash_file(
"example.txt",
algorithm="sha512"
)
print(result)from pyhashkit import __version__
print(__version__)from pyhashkit import (
hash_text,
hash_file,
algorithms,
__version__
)Returns a list of supported hashing algorithms available on the current Python installation.
from pyhashkit import algorithms
print(algorithms())a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e
PyHashKit/
βββ pyhashkit/
β βββ __init__.py
β βββ hashing.py
β βββ cli.py
β βββ version.py
βββ tests/
β βββ test_hashing.py
βββ pyproject.toml
βββ LICENSE
βββ README.md
Contributions, bug reports, and feature requests are welcome.
- Fork the repository
- Create a new branch
- Make your changes
- Submit a pull request
Developed by JackMa
GitHub: https://github.com/Fmasterpro27
Homepage: https://github.com/Fmasterpro27/PyHashKit
Issues: https://github.com/Fmasterpro27/PyHashKit/issues
PyPI: https://pypi.org/project/pyhashkit/
Licensed under the Apache License 2.0.