From Sludgy Zebra, 9 Months ago, written in Plain Text.
Embed
  1. <?php
  2. header("Content-type: image/png");
  3. $sizex=800;
  4. $sizey=800;
  5.  
  6. $img = imagecreatetruecolor(3 * $sizex,$sizey);
  7. $r = imagecolorallocate($img,255, 0, 0);
  8. $g = imagecolorallocate($img,0, 255, 0);
  9. $b = imagecolorallocate($img,0, 0, 255);
  10. imagefilledrectangle($img, 0, 0, 3 * $sizex, $sizey, imagecolorallocate($img, 255, 255, 255));
  11.  
  12. $p = 0;
  13. for($i=0; $i < 100000; $i++) {
  14.     $np = rand(0,$sizex);
  15.     imagesetpixel($img, $p, $np, $r);
  16.     $p = $np;
  17. }
  18.  
  19. $p = 0;
  20. for($i=0; $i < 100000; $i++) {
  21.     $np = mt_rand(0,$sizex);
  22.     imagesetpixel($img, $p + $sizex, $np, $g);
  23.     $p = $np;
  24. }
  25.  
  26. $p = 0;
  27. for($i=0; $i < 100000; $i++) {
  28.     $np = floor($sizex*(hexdec(bin2hex(openssl_random_pseudo_bytes(4)))/0xffffffff));
  29.     imagesetpixel($img, $p + (2*$sizex), $np, $b);
  30.     $p = $np;
  31. }
  32.  
  33. imagepng($img);
  34. imagedestroy($img);
  35. ?>

A PHP Error was encountered

Severity: Core Warning

Message: PHP Startup: Unable to load dynamic library 'mcrypt.so' (tried: /usr/lib/php/20170718/mcrypt.so (/usr/lib/php/20170718/mcrypt.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mcrypt.so.so (/usr/lib/php/20170718/mcrypt.so.so: cannot open shared object file: No such file or directory))

Filename: Unknown

Line Number: 0

Backtrace: