Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hashime

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hashime

hash visualization tool

  • 0.1.0
  • PyPI
  • Socket score

Maintainers
1

hashime

CI

Hash visualization tool inspired by beautiful ssh-keygen randomart.

How can something so soulless be so pretty?

Installation

From PyPI:

pip install hashime

From git:

pip install git+https://github.com/sakhezech/hashime

Usage as CLI

hashime ... or python -m hashime ...

$ hashime -h
usage: hashime [-h] [-v] [-l] [-a ALGO] [-H HASH] [--frame FRAME | --no-frame]
               [--top-text TOP_TEXT] [--bottom-text BOTTOM_TEXT]
               [-d [DIGEST_FORM]] [-f FILE] [-o OUT]

hash visualization tool

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -l, --list            show visualization algorithms, hashing functions,
                        digest forms and exit
  -a ALGO, --algorithm ALGO
                        visualization algorithm (defaults to drunken_bishop)
  -H HASH, --hash-function HASH
                        hashing function (defaults to sha256)
  --frame FRAME         comma-separated frame characters in order of (top_line,
                        right_line, bottom_line, left_line, top_left_corner,
                        top_right_corner, bottom_right_corner,
                        bottom_left_corner, left_bracket, right_bracket)
  --no-frame            output visualization without a frame
  --top-text TOP_TEXT   text on the top frame line
  --bottom-text BOTTOM_TEXT
                        text on the bottom frame line
  -d [DIGEST_FORM], --digest [DIGEST_FORM]
                        show digest (defaults to base64)
  -f FILE, --file FILE  input file (defaults to stdin)
  -o OUT, --output OUT  output file (defaults to stdout)

$ hashime -H md5 -d -f LICENSE
+----[LICENSE]----+
|                 |
|         .       |
|  . .   o        |
| . = o +         |
|  * * + S        |
| o O +           |
|  * = +          |
| . + = .         |
|    E .          |
+------[MD5]------+
md5: lGqJe4ZYqSXluPYkZOH/oQ==

Usage in code

>>> import hashime
>>> bishop = hashime.DrunkenBishop()
>>> bishop.update_from_file_hash('./LICENSE')
>>> art = bishop.to_art(
...     top_text='LICENSE',
...     bottom_text='SHA256',
...     brackets=('<', '>'),
...     lines=('═', '│', '─', '║'),
...     corners=('╔', '╕', '┘', '╙'),
... )
>>> print(art)
╔════<LICENSE>════╕
║    ..o +        │
║   o E.= o       │
║  o +.. o        │
║ . o o.o         │
║.   o =.S.       │
║..   o.+..+      │
║o.  o.oo+..=     │
║. . *+=..+o o .  │
║  .=+O.++  . o.. │
╙─────<SHA256>────┘

Development

Use ruff check --fix . and ruff format . to check and format your code.

To get started:

git clone https://github.com/sakhezech/hashime
cd hashime
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc