import struct


def ip_quad_to_num(ip: str):
    """Convert an IP address string (e.g. '192.168.0.1') to an IP number as a
    base-10 integer given in ASCII representation."""
    bytes = map(int, ip.split("."))
    packed = struct.pack("BBBB", *bytes)
    return str(struct.unpack(">L", packed)[0])