A utililty to easily create crypographically signed URLs for temporary ad-hoc URL access.

Installs: 4 138

Dependents: 1

Suggesters: 0

Stars: 12

Watchers: 1

Forks: 2

Open Issues: 0

v0.0.2 2013-02-12 16:48 UTC



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']);