Calculate a 32-bit UUID for a given exception.
    
    Useful for looking for an existing ticket coresponding to a given exception.
    Takes into account the type of exception, and the name of every file and
    function in the traceback, along with the source code from those lines.
    
    This should remain consistant until a file or function is renamed, the
    source changed on the precise lines in the traceback, or the evaluation path
    changes.
    
    :return: Hex ``str`` of length 8.

def exception_uuid(exc_type, exc_value, exc_traceback):
    """Calculate a 32-bit UUID for a given exception.
    
    Useful for looking for an existing ticket coresponding to a given exception.
    Takes into account the type of exception, and the name of every file and
    function in the traceback, along with the source code from those lines.
    
    This should remain consistant until a file or function is renamed, the
    source changed on the precise lines in the traceback, or the evaluation path
    changes.
    
    :return: Hex ``str`` of length 8.
    
    """
    hasher = hashlib.sha256(str(exc_type))
    for file_name, line_no, func_name, source in traceback.extract_tb(exc_traceback):
        hasher.update('\n' + file_name + ':' + func_name + ':' + (source or ''))
    return hasher.hexdigest()[:8]