ยปCore Development>Code coverage>Doc/includes/sqlite3/md5func.py

Python code coverage for Doc/includes/sqlite3/md5func.py

#countcontent
1n/aimport sqlite3
2n/aimport hashlib
3n/a
4n/adef md5sum(t):
5n/a return hashlib.md5(t).hexdigest()
6n/a
7n/acon = sqlite3.connect(":memory:")
8n/acon.create_function("md5", 1, md5sum)
9n/acur = con.cursor()
10n/acur.execute("select md5(?)", (b"foo",))
11n/aprint(cur.fetchone()[0])