def format32BitHexStr(hexStr):
    """
    format the given string which represents a valid 32-bit hexadecimal number.
    prefix "0x" will be added and will replace any valid prefix.
    alphabetic letter will be formatted into upper case.
    "0" will be used to fill the hexadecimal number if this number is represented as less than 8-letter.

    Exmaple usage:
    input: 0Xff  -> output:0x000000FF
    input: Ab -> output: 0x000000AB
    input 0xAf -> output: 0x000000AF


    :param hexStr:  a valid string representing a 32-bit hexadecimal number
    :return: a formatted string representing 32-bit hexadecimal number as described
    """
    # remove "0x" or "OX"  prefix if it had any
    hexStr = hexStr.replace("0x", "").replace("0X", "")

    hexStr = hexStr[0:8].zfill(8)

    hexStr = hexStr.upper()

    hexStr = "0x" + hexStr

    return hexStr