mirror of
https://github.com/python/cpython.git
synced 2024-12-01 03:01:36 +01:00
1ca93954e1
Initial patch by Johannes Vogel.
12 lines
241 B
Python
12 lines
241 B
Python
import sqlite3
|
|
import hashlib
|
|
|
|
def md5sum(t):
|
|
return hashlib.md5(t).hexdigest()
|
|
|
|
con = sqlite3.connect(":memory:")
|
|
con.create_function("md5", 1, md5sum)
|
|
cur = con.cursor()
|
|
cur.execute("select md5(?)", (b"foo",))
|
|
print(cur.fetchone()[0])
|