Add files via upload

This commit is contained in:
MatMasIt
2021-06-17 01:23:32 +02:00
committed by GitHub
parent bfc858ee04
commit 4e72a94841
11 changed files with 1097 additions and 0 deletions

38
server/common.php Normal file
View File

@ -0,0 +1,38 @@
<?php
/* Encode data to Base64URL
* @param string $data
* @return boolean|string
*/
function base64url_encode($data)
{
// First of all you should encode $data to Base64 string
$b64 = base64_encode($data);
// Make sure you get a valid result, otherwise, return FALSE, as the base64_encode() function do
if ($b64 === false) {
return false;
}
// Convert Base64 to Base64URL by replacing “+” with “-” and “/” with “_”
$url = strtr($b64, '+/', '-_');
// Remove padding character from the end of line and return the Base64URL result
return rtrim($url, '=');
}
/**
* Decode data from Base64URL
* @param string $data
* @param boolean $strict
* @return boolean|string
*/
function base64url_decode($data, $strict = false)
{
// Convert Base64URL to Base64 by replacing “-” with “+” and “_” with “/”
$b64 = strtr($data, '-_', '+/');
// Decode Base64 string and return the original data
return base64_decode($b64, $strict);
}
$GLOBALS["place"]="Liceo Scientifico Statale \"L.Cocito\"";