Postgresql Hash Function In Python