Skip to content

Instantly share code, notes, and snippets.

@philippreston
Created November 10, 2016 18:36
Show Gist options
  • Save philippreston/b12d80601155bf6d690b823dc4ee447e to your computer and use it in GitHub Desktop.
Save philippreston/b12d80601155bf6d690b823dc4ee447e to your computer and use it in GitHub Desktop.
Function for long to IP
@staticmethod
def decode_ip(raw):
ip = ["%d" % ((raw >> (24 - (i * 8))) & 0xFF) for i in range(0, 4)]
return '.'.join(ip)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment