This article describes the Python access to file Ssdeep value of the method, shared for everyone to reference. The specific methods are as follows:
First of all, get the Ssdeep value, you need to import first Ssdeep
Installing Pyssdeep on Ubuntu has been a mistake. Later found Apt-cache search "Ssdeep" when a few full apt-get install, but the problem remains.
Later downloaded to Pyssdeep source files, tar zxvf pyssdeep.tar.zip then apt-get install Python-dev then python setup.py install installed.
Overall, it should be the reason for not pretending Python-dev.
The specific code is as follows:
def _get_ssdeep (self, File_path): "" "
generates the Ssdeep fuzzy hash of the file.
@return: Ssdeep Fuzzy Hash of of the file
"" "
If not is_ssdeep: Return to
None
try: Return
ssdeep.ssdeep () . Hash_file (File_path)
except: Return
None
I hope this article will help you with your Python programming.