Skip to content

Instantly share code, notes, and snippets.

@jdiez17
Created July 27, 2014 00:11
Show Gist options
  • Save jdiez17/22c55213211e3ea4a409 to your computer and use it in GitHub Desktop.
Save jdiez17/22c55213211e3ea4a409 to your computer and use it in GitHub Desktop.
def long(data, offset, size):
n = 0
for i in range(size):
shft = ((size-i-1)*8)
n |= data[offset+i] << shft
return n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment