def number_to_string(number):
    """
    Converts given number to a String(32) representing
    an objectID primary key. Makes too long strings if
    the number is over 32 digits.

    >>> number_to_string(1)
    '00000000000000000000000000000001'

    >>> number_to_string(0xdeadbeef)
    '000000000000000000000000deadbeef'
    """

    # Convert to hexadecimal and remove leading '0x'
    objectID = hex(int(number))[2:]
    # Insert leading zeros.
    objectID = (32 - len(objectID)) * "0" + objectID
    return objectID