Skip to content

Instantly share code, notes, and snippets.

Created November 29, 2013 21:16
Show Gist options
  • Save anonymous/7712098 to your computer and use it in GitHub Desktop.
Save anonymous/7712098 to your computer and use it in GitHub Desktop.
Pasted from IPython
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