Skip to content

Instantly share code, notes, and snippets.

@bwesterb
Last active December 12, 2015 02:48
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 bwesterb/4701471 to your computer and use it in GitHub Desktop.
Save bwesterb/4701471 to your computer and use it in GitHub Desktop.
import struct
def f():
f = open('test')
s = f.read(1000000)
ret = 0
for i in xrange(len(s)/4):
ret = (ret + struct.unpack("i", s[4*i:4*i+4])[0]) % 6000
return ret
print f()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment