Generate TTL based self expiring crumbs (token).
Project description
Generate TTL based self expiring crumbs (token).
Usage
` >>> from crumb import Crumb >>> >>> # generate crumb for user that expires in 30 seconds >>> c = Crumb('tim@tom.com', 30, secret='!@#$') >>> c.generate() >>> print c.key 830b60fe77b2 >>> >>> # verify the generated crumb >>> c = Crumb('tim@tom.com', 300, secret='!@#$', key='495077577439') >>> c.validate() True >>> >>> # try to verify again after 60 sec >>> c.validate() False `
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
crumb.py-0.1.tar.gz
(2.9 kB
view hashes)