Skip to content

Instantly share code, notes, and snippets.

@geta6
Created October 20, 2011 11:25
Show Gist options
  • Save geta6/1300916 to your computer and use it in GitHub Desktop.
Save geta6/1300916 to your computer and use it in GitHub Desktop.
for mod_auth_token
<?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