Here is an MD5 Hash Sample:
PHP
1<?PHP2 $url = $_POST["url"];3 $secret = $_POST["md5"];45 if (!$url && !$secret) {6 $url = "http://limelighturl/file.ext";7 $secret = "Secret";8 }9?>10<html>11 <head>12 <title>MD5 Hash Sample Page</title>13 </head>14 <body>15 <form method="post">16 URL: <input type="text" name="url" value="<?PHP print $url;?>" size=80>17 <br>18 Secret: <input type="text" name="md5" value="<?PHP print $secret;?>">19 <br>20 <br>21 <input type="submit">22 </form>2324 <?PHP25 if (ereg("[&?]h=", $url)) {26 print "<p>Oops! You should not include the h= portion of the url. This script will calculate it for you!</p>\n";27 exit();28 }2930 $end = time() + 24*60*60; //24 hours in seconds31 $md5 = md5("$secret$url");3233 if (strpos($url, '?') > 0) {34 $auth_url = "$url&h=$md5";35 } else {36 $auth_url = "$url?h=$md5";37 }3839 print "<table border>\n";40 print "<tr><td>Secret:</td><td>$secret</td></tr>\n";41 print "<tr><td>Url with options:</td><td>$url</td></tr>\n";42 print "<tr><td>MD5 Hash Input:</td><td>$secret$url</td></tr>\n";43 print "<tr><td>Generated MD5 Hash:</td><td>$md5</td></tr>\n";44 print "<tr><td>Authenticated URL</td><td><a4546 href=\"$auth_url\">$auth_url</a></td></tr>\n";4748 print "</table>\n";4950 if (strpos($url, 'e=') <= 0) {51 print "If you want to have an expiring url that expires after a day, enter the following into the URL box:\n";52 print "<pre>\n";5354 if (strpos($url, '?'))55 print "$url&e=".(time()+24*60*60)."\n";56 else57 print "$url?e=".(time()+24*60*60)."\n";5859 print "</pre>\n";60 }6162 if (strpos($url, 'rs=') <= 0) {63 print "If you want to have a rate limited url, enter the following into the URL box (where rs can equal any number greater than your minimum limit):\n";64 print "<pre>\n";6566 if (strpos($url, '?'))67 print "$url&rs=85\n";68 else69 print "$url?rs=85\n";7071 print "</pre>\n";72 }7374 if (strpos($url, 'ri=') <= 0) {75 print "If you want to allow the user to download a number of bytes w/out being ratelimited, enter the following into the URL box (where ri equals the value in bytes to not be rate limited ):\n";76 print "<pre>\n";7778 if (strpos($url, '?'))79 print "$url&ri=1000\n";80 else81 print "$url?ri=1000\n";8283 print "</pre>\n";84 }85 ?>86 </body>87</html>