view Doc/includes/sqlite3/md5func.py @ 80272:ec00f8570c55

Merge typo fix.
author Ezio Melotti <ezio.melotti@gmail.com>
date Mon, 05 Nov 2012 22:23:16 +0200
parents 9eb77d455be1
children
line wrap: on
line source

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])