Fixed short URL character set. Added short URL shuffling code to help you shuffle the order.

This commit is contained in:
GRMrGecko 2015-11-17 11:53:35 -06:00
parent b9501e3b0f
commit c231e4badb

View File

@ -11,8 +11,8 @@ class shortID {
var $lowerCase = false;
var $check = array(3, 20);
var $charactersAllCase = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@*-_=+,.;'|";
var $charactersLowerCase = "abcdefghijklmnopqrstuvwxyz1234567890!@*-_=+,.;'|";
var $charactersAllCase = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_.";
var $charactersLowerCase = "abcdefghijklmnopqrstuvwxyz1234567890-_.";
var $alphabet = array();
var $base = 0;
@ -83,8 +83,6 @@ class shortID {
}
}
header("Content-Type: application/json");
$_CS = array();
$_CS['version'] = "0.4";
$_CS['time'] = time();
@ -114,6 +112,15 @@ exit();
// End of MD5 code.
*/
/*
// Beginning of short URL shuffling.
header("Content-Type: text/plain");
$shortID = new shortID();
echo "All case: "$shortID->shuffleAlphabet()."\n";
echo "Lower case: "$shortID->shuffleAlphabet(true)."\n";
exit();
*/
$_CS['domain'] = $_SERVER['HTTP_HOST'];
$_CS['port'] = $_SERVER['SERVER_PORT'];
$_CS['ssl'] = ($_SERVER['HTTPS']=="on");
@ -145,6 +152,9 @@ if (!empty($_COOKIE["{$_CS['cookiePrefix']}user"])) {
$_CS['loggedIn'] = true;
}
header("Content-Type: application/json");
$response = array();
$response["version"] = $_CS['version'];