mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-04-24 07:44:42 +00:00
11 lines
241 B
Python
11 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])
|