def hashpjw(s):
	"""A simple and reasonable string hash function due to Peter Weinberger"""
	val = 0
	for c in s:
		val = (val << 4) + ord(c)
		tmp = val & 0xf0000000
		if tmp != 0:
			val = val ^ (tmp >> 24)
			val = val ^ tmp
	return val