I'm trying to insert hundreds of accounts into a MySQL database. I can't insert clear-text passwords and my application is expecting an SHA-1 hash for passwords. A quick online search pointed me to Python's hashlib libray.
Here's my Python code to generate a SHA-1 hash:
import hashlib
m = hashlib.sha1();
m.update("kpVtk5y6");
m.digest();
How can I use m.digest in the SQL query to store passwords?
My web application uses Java's MessageDigest.digest(mypassword.getBytes()) method to store passwords, so I need to implement something similar in Python in order to auto inject user accounts.