source: python/trunk/Doc/includes/sqlite3/md5func.py

Last change on this file was 2, checked in by Yuri Dario, 15 years ago

Initial import for vendor code.

  • Property svn:eol-style set to native
File size: 231 bytes
Line 
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.