-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.php
31 lines (24 loc) · 1.25 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require("vendor/autoload.php");
require("includes/cryptotools.php");
$router = new AltoRouter();
$router->setBasePath("");
$router->map('GET', '/', 'CryptoToolsRoute::page_home', 'home');
$router->map('GET', '/aes', 'CryptoToolsRoute::page_aes_string', 'aes_string');
$router->map('GET', '/rsagen', 'CryptoToolsRoute::page_rsa_gen', 'rsa_gen');
$router->map('GET', '/dhe', 'CryptoToolsRoute::page_dhe', 'dhe');
$router->map('GET', '/hash', 'CryptoToolsRoute::page_hash_string', 'hash_string');
$router->map('GET', '/hmac', 'CryptoToolsRoute::page_hmac_string', 'hmac_string');
$router->map('GET', '/otp', 'CryptoToolsRoute::page_otp', 'otp');
$router->map('GET', '/base64', 'CryptoToolsRoute::page_base64', 'base64');
$router->map('GET', '/bitcoin', 'CryptoToolsRoute::page_bitcoin', 'bitcoin');
$router->map('GET', '/about', 'CryptoToolsRoute::page_about', 'about');
$router->map('GET', '/attributions', 'CryptoToolsRoute::page_attributions', 'attributions');
$router->map('GET', '/api', 'CryptoToolsAPI::test', 'apitest');
$match = $router->match();
if( $match && is_callable( $match['target'] ) ) {
call_user_func_array( $match['target'], $match['params'] );
} else {
header( $_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found');
echo "Error 404: Not found";
}