skip to navigation
skip to content

Not Logged In

crumb.py 0.5

Generate TTL based self expiring crumbs (token).

Generate TTL based self expiring crumbs (token).

Usage

` pip install --upgrade crumb.py `

` >>> from crumb import Crumb >>> >>> # generate crumb for user that expires in 30 seconds >>> c = Crumb('tim@tom.com', 30, secret='!@#$') >>> c.generate() 830b60fe77b2 >>> >>> # key attribute also contains the generated crumb >>> print c.key 830b60fe77b2 >>> >>> # verify the generated crumb >>> c = Crumb('tim@tom.com', 30, secret='!@#$', key='830b60fe77b2') >>> c.validate() True >>> >>> # try to verify again after 60 sec >>> c.validate() False `

 
File Type Py Version Uploaded on Size
crumb.py-0.5.tar.gz (md5) Source 2014-04-29 3KB
  • Downloads (All Versions):
  • 15 downloads in the last day
  • 79 downloads in the last week
  • 316 downloads in the last month