Moved the costs to a constant and added

a new function to check if a password needs to be rehashed.