Python code coverage for Doc/includes/sqlite3/md5func.py
# | count | content |
---|---|---|
1 | n/a | import sqlite3 |
2 | n/a | import hashlib |
3 | n/a | |
4 | n/a | def md5sum(t): |
5 | n/a | return hashlib.md5(t).hexdigest() |
6 | n/a | |
7 | n/a | con = sqlite3.connect(":memory:") |
8 | n/a | con.create_function("md5", 1, md5sum) |
9 | n/a | cur = con.cursor() |
10 | n/a | cur.execute("select md5(?)", (b"foo",)) |
11 | n/a | print(cur.fetchone()[0]) |