Skip to content

Instantly share code, notes, and snippets.

@volpino
Created April 5, 2015 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save volpino/02b0dc346ebebef3e1f1 to your computer and use it in GitHub Desktop.
Save volpino/02b0dc346ebebef3e1f1 to your computer and use it in GitHub Desktop.
NDH Quals 2015 weshgrow
def round(byte):
c = 162888806
for i in range(3, 0, -1):
state[i] = (state[0] * state[i] + state[0] * byte) % 4294967295
self.state[0] = (state[0] * c + state[1] * byte) % 4294967295
def hash(data):
for char in data:
round(ord(char))
return "".join([to_hex(x) for x in state])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment