[4.2] Hashing : factorize calculation of the cost

Docblock isn't formatted correctly.