fix hash generation under python