apinstein / expiring-hash
A utililty to easily create crypographically signed URLs for temporary ad-hoc URL access.
Installs: 34 404
Dependents: 1
Suggesters: 0
Security: 0
Stars: 13
Watchers: 2
Forks: 4
Open Issues: 0
Requires
- php: >=5.2.0
This package is not auto-updated.
Last update: 2024-10-26 14:49:34 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']);