Generate TTL based self expiring crumbs (token).
Project description
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 `
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
File details
Details for the file crumb.py-0.5.tar.gz.
File metadata
- Download URL: crumb.py-0.5.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e425670765ab01f3ba95bf554d0c0e745c7423622e07c47a8e3a85cf5dfa892
|
|
| MD5 |
cbcbea34544051baca2f122ed0767c5e
|
|
| BLAKE2b-256 |
4f03f4120e6a273a634f96d64404463b396f9b156cb43a51afcd07e828d17360
|