import struct
import socket


def ip_address_to_32bit(address):
    """
    Returns IP address converted to a "32bit" long binary string
    127.0.0.1 will be returned as 01111111000000000000000000000001
    """
    binary = bin(struct.unpack('!L', socket.inet_aton(address))[0])
    # Remove the leading '0b' text:
    binary = binary[2:]
    # Pad the number's string until it is 32 characters wide
    while len(binary) < 32:
        binary = '0' + binary
    return binary