Created
October 20, 2011 11:25
-
-
Save geta6/1300916 to your computer and use it in GitHub Desktop.
for mod_auth_token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$key = 'token'; // Secret | |
$dirpath = '/token/'; //Prefix | |
$filepath = '/sample/file.mp3'; // relative path from ScriptAlias | |
$tokenize_url = auth_token($key, $dirpath, $filepath); | |
function auth_token($key,$dirpath,$filepath){ | |
$hex = dechex(time()); | |
return $dirpath.md5($key.$filepath.$hex).'/'.$hex.$filepath; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment