Skip to content

apinstein/ExpiringHash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExpiringHash

Small helper class to create a URL parameter containing a tamper-proof expiration date.

This allows you to implement expiring URLs in the same way that Amazon S3 supports.

// create
$eh = new ExpiringHash('my secret');
$hash = $eh->generate("15 minutes");
$url = "http://foo.com/mydownload?hash={$hash}";

// verify
$eh = new ExpiringHash('my secret');
$okToDownload = $eh->validate($_GET['hash']);

About

Simple class for generating secure, expiring URLs

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages