Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
break;

case 'img':
if ($_SERVER['REQUEST_METHOD'] !== 'GET' || empty($_GET['html'])) {
if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
exit;
}

Expand Down Expand Up @@ -81,7 +81,39 @@

echo '<img src="data:image/png;base64, '.$based.'" alt="nice" style="margin-bottom: 10px;"/>';
break;

case 'nft':
if ($_SERVER['REQUEST_METHOD'] !== 'GET' || empty($_GET['html'])) {
Comment thread
Smoggert marked this conversation as resolved.
exit;
}
// get something randomish
$nft_generation_seed = "000000000000" . rand();
// make it look even more random

// implement a blokeChain - with really secure hashing, cuz other ones take too long
$blokeChain = function($seed) {
return hash('sha1',$seed);
};

$almost_an_nft = $blokeChain($nft_generation_seed);

// run it through the blokeChain until it his critical mass.
// this could take a while - so we are going to pretend that we are trying a lot to fix it.
$we_tried = 0;
while(strpos($almost_an_nft,"69") !== 0 && $we_tried !== 69) {
$almost_an_nft = $blokeChain($nft_generation_seed);
$we_tried++;
}

$actualy_an_nft = ($we_tried === 69) ? "69" . substr($almost_an_nft,2) :$almost_an_nft;

echo "<p>{$actualy_an_nft}</p>";
// do some hacker stuff

unset($nft_generation_seed);
unset($actualy_an_nft);
unset($almost_an_nft);

break;
default:
exit('no valid endpoint specified');
break;
Expand Down