#NEWLINE# def compare_ssdeep( payload1 , payload2 ) : #NEWLINE# #INDENT# '\n    Compare binary payloads with ssdeep to determine\n\n    :param bytes payload1: Binary content to compare\n    :param bytes payload2: Binary content to compare\n\n    :returns: Match score from 0 (no match) to 100\n    :type: int or None\n\n    ' #NEWLINE# payload1_hash = get_ssdeep ( payload1 ) #NEWLINE# payload2_hash = get_ssdeep ( payload2 ) #NEWLINE# try : #NEWLINE# #INDENT# match = ssdeep . compare ( payload1_hash , payload1_hash ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# match = None #NEWLINE# #UNINDENT# return match