Skip to content

Instantly share code, notes, and snippets.

@tjhartmann
tjhartmann / ipv4.py
Last active August 29, 2015 14:18 — forked from cslarsen/ipv4.py
#!/usr/bin/env python
"""Functions to convert IPv4 address to integer and vice-versa.
Written by Christian Stigen Larsen, http://csl.sublevel3.org
Placed in the public domain by the author, 2012-01-11
Example usage:
$ ./ipv4 192.168.0.1 3232235521
192.168.0.1 ==> 3232235521