apparently python thinks everything is unicode in py3k, even empty strings. Had to add another str.encode call to make hashlib work.