Imho bys nemel pouzivat metodu digest(), ale hexdigest() - ta vraci to co se bezne vsude pouziva jako hash string.
--- http://xkcd.com/327/ :) > ------------ Původní zpráva ------------ > Od: <[email protected]> > Předmět: [python] hash, mysql > Datum: 19.3.2009 20:24:52 > ---------------------------------------- > Dobrý den, mám problémy se spoluprací se sql serverem: > > server my vrací chybu: > ProgrammingError: (1064, 'You have an error in your SQL syntax; check the > manual > that corresponds to your MySQL server version for the right syntax to use near > \'\xa1A\x91k\xc7\xde\x17M\xe0j\xec\xc2\xf1(,iq|\x839;&\x17\xc4\xc1\xcc\x04\x93\x0e\xc81R\xf5UB&\xd1\xaf\xb4P"\' > at line 1') > > > při interpretaci: "SELECT * FROM users WHERE name='root' AND password=%s" % > password > > kde password je text získaný metodou: > def passToHash(self, password): > hash = hashlib.sha512() > hash.update(password) > hash = hash.digest() > return hash > > Nevíte kde dělám chybu? > _______________________________________________ > Python mailing list > [email protected] > http://www.py.cz/mailman/listinfo/python > > > _______________________________________________ Python mailing list [email protected] http://www.py.cz/mailman/listinfo/python
