blob: 5769687d9cb06e6478628267cfbe77785e9de158 [file] [log] [blame]
Thomas Wouters477c8d52006-05-27 19:21:47 +00001import sqlite3
2import md5
3
4def md5sum(t):
5 return md5.md5(t).hexdigest()
6
7con = sqlite3.connect(":memory:")
8con.create_function("md5", 1, md5sum)
9cur = con.cursor()
10cur.execute("select md5(?)", ("foo",))
11print cur.fetchone()[0]