source: vendor/python/2.5/Doc/lib/sqlite3/md5func.py

Last change on this file was 3225, checked in by bird, 19 years ago

Python 2.5

File size: 231 bytes
RevLine 
[3225]1import 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]
Note: See TracBrowser for help on using the repository browser.