得到文件的ssdeep值


得到ssdeep值
要先import ssdeep
在ubuntu上安装pyssdeep时 一直出错  后来发现apt-cache search "ssdeep"时把几个全apt-get install 上。。。问题依旧。。
后来下载到pyssdeep的源文件 ,tar zxvf pyssdeep.tar.zip 然后 apt-get install python-dev 然后 python setup.py install  就安装上了。。。
应该是没装python-dev的原因。。。。。


[python]
#----------------------------------------------------------------------    
    def _get_ssdeep(self, file_path): 
        """
        Generates the ssdeep fuzzy hash of the file.
        @return: ssdeep fuzzy hash of the file
        """ 
        if not IS_SSDEEP: 
            return None 
 
        try: 
            return ssdeep.ssdeep().hash_file(file_path) 
        except: 
            return None 
     
    #---------------------------------------------------------------------- 

 

 

摘自 小驹的专栏

相关内容

    暂无相关文章

评论关闭