restore the partial hash pre-computation trick