I need to write code in python to compare the text of two documents using fingerprint methods

I need to write python code to compare document text using fingerprint methods. I do not know whether to take a fingerprint of a document or create a fingerprint of a document. I ask if anyone knows this method or has the source code for creating fingerprints of documents that are stored in bit form.

+3
source share
2 answers

If you want message digests (cryptographic hashes), use hashlib . Here is an example ( IPython session):

 In [1]: import hashlib

 In [2]: md = hashlib.sha256 (open ('/ tmp / Calendar.xls', 'rb'). Read ())

 In [3]: md.hexdigest ()
 Out [3]: '8517f1eae176f1a20de78d879f81f23de503cfd6b8e4be1d798fb2342934b187'
+4
source

You can try the following documents to get started with the fingerprint concept:

+4
source

Source: https://habr.com/ru/post/1697111/


All Articles