This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Generate a unique Image based on a input string | |
* @param string $data | |
* @return string A SVG image | |
*/ | |
function unique_img(string $data, string $background = "#000"): string | |
{ | |
$hash = hash("sha512", $data); | |
$svg_data = '<rect x="0" y="0" width="128" height="128" fill="' . $background . '" />'; |