Move fast_hast* functions into util, removes code duplications.