import socket


def iptoint(ip_v4: str) -> int:
    """
    Convert an ip address to an integer.
    Adopted from http://goo.gl/AnSFV
    :param ip_v4: IPv4 address
    :returns: int of IPv4 hex
    """
    return int(socket.inet_aton(ip_v4).hex(), 16)