Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //convert password hash of (val) to image because why not
- $img1 = @imagecreate(16,16);
- if(isset($_GET["val"]))
- $pf=$_GET["val"];
- else $pf="lal";
- $val=hash("haval256,3",$pf);
- $z="0000000000";
- $i=0;
- $bin="";
- while($i<64){
- $n=base_convert(substr($val,$i,8),16,2);
- if($L=8-strlen($n)) $n2=substr($z,0,$L).$n;
- else $n2=$n;
- $bin.=$n;
- $i+=8;
- }
- //exit("ay: ".(strlen($bin)*1));
- $green=imagecolorallocate($img1, 0, 255, 0);
- $black=imagecolorallocate($img1, 0, 0, 0);
- $i=0;
- for($y = 0; $y < 16; ++$y){
- for($x = 0; $x < 16; ++$x){
- imagesetpixel($img1, $x, $y, ($bin[$i])*1);
- $i++; if(!isset($bin[$i])) $i=5;
- }
- }
- imagepng($img1, $val."_.png");
- echo '<br><img width=128 height=128 src="'.$val.'_.png">';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement