PHPackages                             anscd/shape-hash - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. anscd/shape-hash

ActiveLibrary[Image &amp; Media](/categories/media)

anscd/shape-hash
================

A library to generate deterministic SVG images from strings.

v1.0.0(3mo ago)021ISCPHPPHP &gt;=7.4

Since Mar 18Pushed 3mo agoCompare

[ Source](https://github.com/binary-data/shapehash)[ Packagist](https://packagist.org/packages/anscd/shape-hash)[ RSS](/packages/anscd-shape-hash/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

ShapeHash
=========

[](#shapehash)

A deterministic hash visualization tool inspired by the "Hash Visualization: a New Technique to improve Real-World Security" paper by Perrig and Song.

Purpose
-------

[](#purpose)

ShapeHash converts any input string into a unique, deterministic SVG image. It uses an SHA-256 based PRNG to ensure that the same input string always produces the exact same visualization. The resulting image is a circular composition of overlapping basic shapes (triangles, squares, and circles) with varying colors and opacities, designed to be easily distinguishable by humans.

Features
--------

[](#features)

- **Deterministic**: Same input always yields the same image.
- **Visual Clarity**: Uses a 20-color palette with contrast checks to ensure distinct shapes.
- **Zero Dependencies**: Pure PHP implementation with no external libraries or extensions required for SVG generation.
- **CLI Interface**: Easy to use from the command line.

Installation
------------

[](#installation)

No installation or dependencies are required. Ensure you have PHP installed on your system.

Usage
-----

[](#usage)

Run the script from your terminal:

```
php hash.php "your input string"
```

### Options

[](#options)

- `-o, --outfile `: Specify the output file path (default: `out.svg`).
- `-h, --help`: Show help information.

### Examples

[](#examples)

Generate a visualization for "Hello World":

```
php hash.php "Hello World" -o hello.svg
```

Generate a visualization with the default output name (`out.svg`):

```
php hash.php "unique identity"
```

Requirements
------------

[](#requirements)

- PHP 7.4 or higher (for `hash()` and `unpack()` functions).

Credits
-------

[](#credits)

Visualizations inspired by beautiful circles from

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance82

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

97d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd5028acaedd7fe84df8bad6147d07fe00aa15a95de41ace10596e826719ae57?d=identicon)[binarydata](/maintainers/binarydata)

---

Top Contributors

[![binary-data](https://avatars.githubusercontent.com/u/875296?v=4)](https://github.com/binary-data "binary-data (4 commits)")

### Embed Badge

![Health badge](/badges/anscd-shape-hash/health.svg)

```
[![Health](https://phpackages.com/badges/anscd-shape-hash/health.svg)](https://phpackages.com/packages/anscd-shape-hash)
```

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

133890.0k3](/packages/goat1000-svggraph)[imagekit/imagekit

PHP library for Imagekit

46877.3k10](/packages/imagekit-imagekit)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

12644.1k2](/packages/gravatarphp-gravatar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
