(return to David's Python Resources)
HashCash
Functions to generate and verify hashcash tokens
HashCash is a technique with several uses, such as spam deterrence and DoS resistance.
This pure-python implementation gives you two functions:
- genToken(s, quality) - generate a hashcash token against string s of quality
quality
- verifyToken(s, quality, tok) - verify token tok against string s,
returning True if the token is valid to quality quality or greater, or False if not
Download this module: hashcash.py
David McNab
Last modified: Sun Aug 8 23:42:13 NZST 2004