Giter VIP home page Giter VIP logo

hashicon's Introduction

HashIcon

HashIcon is a PHP Class which generate unique icon based on a hash.
Icons are generated in a Base64 format.

Functions

function toIcon($algo, $hash, $size = 300, $format = 'png');

Usage

require 'HashIcon.php';

$hash  = hash('sha256', 'Lorem ipsum dolor sit amet.');
$image = HashIcon::toIcon(HashIcon::SHA256, $hash);

header('Content-type:image/png');
echo base64_decode($image);

// or <img src="data:image/png;base64,<?= $image ?>">

HashIcon example

Accepted algorythms

  • HAVAL-256,3
  • HAVAL-256,4
  • HAVAL-256,5
  • GOST
  • RIPEMD-256
  • SHA-256
  • Snefru

Accepted formats

  • PNG
  • JPG
  • GIF

TODO-LIST

Add a reverse function : HashIcon::toHash().
Add algorythms :

  • Adler-32
  • CRC-32
  • CRC-32B
  • MD2
  • MD4
  • MD5
  • HAVAL-128,3
  • HAVAL-128,4
  • HAVAL-128,5
  • HAVAL-160,3
  • HAVAL-160,4
  • HAVAL-160,5
  • HAVAL-192,3
  • HAVAL-192,4
  • HAVAL-192,5
  • HAVAL-224,3
  • HAVAL-224,4
  • HAVAL-224,5
  • RIPEMD-128
  • RIPEMD-160
  • RIPEMD-320
  • Tiger-128,3
  • Tiger-128,4
  • Tiger-160,3
  • Tiger-160,4
  • Tiger-192,3
  • Tiger-192,4
  • SHA-1
  • SHA-384
  • SHA-512
  • Whirlpool

Legals

Donations

Buy me a coffee !

hashicon's People

Contributors

zessx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.