How to obtain the ssdeep value of a file using Python

Source: Internet
Author: User
This article mainly introduces how to obtain the ssdeep value of a file using Python. it is a practical technique. This article describes in detail the specific steps and precautions for implementing this function, for more information about how to obtain the ssdeep value of a file in Python, see the following example. The specific method is as follows:

First, to obtain the ssdeep value, you must first import ssdeep
An error occurred while installing pyssdeep on ubuntu. later, we found that the apt-cache search "ssdeep" had several full apt-get install, but the problem remained.
Then download to the pyssdeep source file, tar zxvf pyssdeep.tar.zip, apt-get install python-dev, and then python setup. py install.
In general, it should be because python-dev is not installed.

The code is as follows:

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) handle T: return None

I hope this article will help you with Python programming.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.