update hashfunc to save time