def iter_auth_hashes(user, purpose, minutes_valid):
now = timezone.now().replace(microsecond=<NUM_LIT:0>, second=<NUM_LIT:0>)<EOL>for minute in range(minutes_valid + <NUM_LIT:1>):<EOL><INDENT>yield hashlib.sha1(<EOL>'<STR_LIT>' % (<EOL>now - datetime.timedelta(minutes=minute),<EOL>user.password,<EOL>purpose,<EOL>user.pk,<EOL>settings.SECRET_KEY,<EOL>),<EOL>).hexdigest()<EOL><DEDENT>
Generate auth tokens tied to user and specified purpose.

The hash expires at midnight on the minute of now + minutes_valid, such
that when minutes_valid=1 you get *at least* 1 minute to use the token.