定制 anscd/shape-hash 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

anscd/shape-hash

最新稳定版本:v1.0.0

Composer 安装命令:

composer require anscd/shape-hash

包简介

A library to generate deterministic SVG images from strings.

README 文档

README

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

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

  • 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

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

Usage

Run the script from your terminal:

php hash.php "your input string"

Options

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

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

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

Credits

Visualizations inspired by beautiful circles from https://github.com/danfinlay/jazzicon

统计信息

  • 总下载量: 21
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: ISC
  • 更新时间: 2026-03-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固