apinstein / expiring-hash
A utililty to easily create crypographically signed URLs for temporary ad-hoc URL access.
v0.0.2
2013-02-12 16:48 UTC
Requires
- php: >=5.2.0
This package is not auto-updated.
Last update: 2026-02-28 21:05:52 UTC
README
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']);