def identhashtype(srcHash):
    """
    Identifies the hash function type
    Now supports: MD5, SHA256, SHA512

    :param srcHash: hasf as a string with hexadecimal digits
    :return: hash type -MD5, SHA256 or SHA512- as a string
    """

    #calculation of bits length of the hexdigest
    try:
        lenBits = len(srcHash) * 4

        if lenBits == 128:
            return 'MD5'
        elif lenBits == 256:
            return 'SHA256'
        elif lenBits == 512:
            return 'SHA512'
        else:
            print('unsupported hash type')
            exit(0)
    except Exception as e:
        print(e)
        exit(1)