split to pure and impure versions of computeHash (cndition fix)