Created
November 15, 2014 20:56
-
-
Save adoc/de965008d0a542bbf604 to your computer and use it in GitHub Desktop.
forme.validators.sec usage example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import forme.validators.sec | |
import formencode | |
v = forme.validators.sec.HmacValidator(b'12345') | |
val = v.from_python(b'abcdef') | |
v.to_python(val) | |
v = formencode.compound.Pipe(validators=[ | |
forme.validators.sec.HmacValidator(b'12345'), | |
forme.validators.sec.DelayValidator(min=5, max=10)]) | |
val = v.from_python(b'') | |
time.sleep(9.9) | |
v.to_python(val) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment