3

我需要用 python 语言编写代码来使用指纹技术比较文档的文本。我不知道获取文件指纹或生成文件指纹。我在问是否有人知道该方法或具有用于生成以位形式存储的文档指纹的源代码。

4

2 回答 2

4

If you want message digests (cryptographic hashes), use the hashlib library. Here's 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'
于 2008-09-18T09:39:06.413 回答
4

You might try the following papers to get started with the concept of fingerprinting:

于 2008-09-18T09:41:55.283 回答