update hash calculation