mysql hash generator in python

M

Matías Hernández

(sorry for my english, but i'm speak spanish)
Hi list.. this is my first post... and obviously if for help..

I try to implement the password function of mysql in a python script.

I read that the password function of mysql was implemented with a double
sha1()

I python i try this:
example1:
if __name__=="__main__":
s = hashlib.sha1()
s.update('test')
s2 = hashlib.sha1()
s2.update(s.digest()
print s2.hexdigest()

This script show me the same hash that password function of mysql, but
when i implement this in a class the hash is different??? why???

And if is posible??? can you show a example code of old_password
function of mysql in python???

THNX
 
N

News123

Hi Matias.


Could you show us the 'class implementation'?


Whether class or not the result should be the same.
If it isn't, then there should be a small error.
If we have both code versions to look at it's easier to help you.


bye


N
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top