C hash implementation based on khash