473,320 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to gernerate the fingerprints of a documents in python

i want to write a application for detecting near to duplicate document using rabin karp algorithm for generating fingerprint technique.
please any body can write a small code to generate fingerprints of a document using this algorithm or winnowing algorithm in python script.
please help me as soon as possible
thanks
Sep 26 '08 #1
1 3909
kudos
127 Expert 100+
Hi! Wasn't that algorithm something like this:

import hashlib

def rabinkarp(s0,s1):
n = hashlib.md5(s0).hexdigest()
m = hashlib.md5(s1).hexdigest()
for i in range((len(s1)-len(s0)+1)):
if(m == n):
return True;
m = hashlib.md5(s1[i:i+len(s0)]).hexdigest()
return False

print rabinkarp("teddy","I just want to be your teddy bear")

(it should return true :)

-kudos
Sep 28 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: sebb | last post by:
Hi, I want to do a script in python. Users will answer to some questions in rough text and, at the end, it will be saved in a format like abiword's one. Now, I want to know how to write...
1
by: webworldL | last post by:
Has anybody had any luck processing XHTML1.1 documents with xml.sax? Whenever I try it, python loads the W3C DTD from the top, then crashes saying that there's an error in the external DTD. All I...
4
by: Daryl Middleton | last post by:
Can python be used to merge pdf documents into a single pdf file so that I do not have to manually insert each one. Thanks
6
by: calmar | last post by:
Hi all, I would like to use python for a replacement for some binutils. I would like to be able to pipe things into python. Actually I would not like writing a 'script' to handle the input, but...
0
by: GMane Python | last post by:
Anyone know if there is the availability to integrate biometric fingerprint scanners into python programs?
33
by: Jim Hill | last post by:
I've done some Googling around on this and it seems like creating a here document is a bit tricky with Python. Trivial via triple-quoted strings if there's no need for variable interpolation but...
0
by: wyattroerb | last post by:
Hi, like a lot of other newbies in xml i suffer from the various ways you can take for xml data processing in python. Here are my two major problems: Problem number one: A application written...
3
by: defcon8 | last post by:
How can I print html documents in Python on Windows?
2
by: imtiaz4n | last post by:
Hi everybody. Can anyone help me in how I can capture fingerprints using VB 6.0 and save them in a database and then validate them for some kind of attendence? If anyone is there then please help me...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.