Python 2.4: work around lack of hashlib.