Created
November 29, 2013 21:16
-
-
Save anonymous/7712098 to your computer and use it in GitHub Desktop.
Pasted from IPython
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
from pyhashxx import hashxx | |
import pyparsing | |
pyparsing? | |
from pyparsing import Word, alphas | |
greet = Word( alphas ) + "," + Word( alphas ) + "!" | |
hello = "Hello, World!" | |
print (hello, "->", greet.parseString( hello )) | |
hashxx(b'Hello World!') | |
hashxx(b'Hello', b' ', b'World!') | |
hashxx((b'Hello', b' ', b'World!')) | |
hashxx((b'Hello', b' '), (b'World!',)) | |
hashxx(b'Hello World!', seed=1) | |
from pyhashxx import Hashxx | |
hasher = Hashxx(seed=0) | |
hasher.update(b'Hello') | |
hasher.update(b' ') | |
print(hasher.digest()) | |
hasher.update(b'World!') | |
print(hasher.digest()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment