From 6960a14d9de852806093efac8688deac6a000c86 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sun, 28 May 2023 18:22:55 +0000 Subject: [PATCH] Merged key.php into the main codebase and removed all non-index.php PHP files. --- .gitignore | 2 -- lib/index-new | 2 +- public/ascii.php | 2 -- public/index.php | 18 ++++++++++++++++++ public/key.php | 26 -------------------------- 5 files changed, 19 insertions(+), 31 deletions(-) delete mode 100644 public/ascii.php delete mode 100644 public/key.php diff --git a/.gitignore b/.gitignore index 72e37ab..3323ee7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -/public/volatile -/public/whois/vendor .DS_Store [Dd]esktop.ini /.debug diff --git a/lib/index-new b/lib/index-new index ac2255d..bce5ba7 160000 --- a/lib/index-new +++ b/lib/index-new @@ -1 +1 @@ -Subproject commit ac2255d24d7dd39ac91fa50d3a7aa71ce0a92188 +Subproject commit bce5ba77a268ecd6338d0e3520e41ff4c40cbeda diff --git a/public/ascii.php b/public/ascii.php deleted file mode 100644 index 41cc616..0000000 --- a/public/ascii.php +++ /dev/null @@ -1,2 +0,0 @@ - '/contact', '/nintendo.php' => '/contact', '/ascii.php' => '/ascii', + '/key.php' => '/rngstr', ]); $router = new HttpFx; @@ -179,6 +181,22 @@ $router->get('/ascii', function() use ($ctx) { return $ctx->getTemplating()->render('ascii'); }); +$router->get('/rngstr', function($response, $request) { + $response->setTypePlain(); + + $length = (int)$request->getParam('length', FILTER_SANITIZE_NUMBER_INT); + if($length > 0 && $length <= 1024) + return XString::random($length); + + $out = '8: ' . XString::random(8) . PHP_EOL; + $out .= '16: ' . XString::random(16) . PHP_EOL; + $out .= '32: ' . XString::random(32) . PHP_EOL; + $out .= '64: ' . XString::random(64) . PHP_EOL; + $out .= '128: ' . XString::random(128) . PHP_EOL; + + return $out; +}); + $router->get('/ssh.php', function() { $query = ''; diff --git a/public/key.php b/public/key.php deleted file mode 100644 index 1e67f69..0000000 --- a/public/key.php +++ /dev/null @@ -1,26 +0,0 @@ - 0 && $length < 1000) { - echo generateKey($length); - return; - } -} - -echo '8: ' . generateKey(8) . PHP_EOL; -echo '16: ' . generateKey(16) . PHP_EOL; -echo '32: ' . generateKey(32) . PHP_EOL; -echo '64: ' . generateKey(64) . PHP_EOL; -echo '128: ' . generateKey(128) . PHP_EOL;