Comparisons after hashing are naturally resistant to timing attacks, because you are not in direct control of the bytes being compared.<p>Just ask Bitcoin miners how hard it is to pick an input which results in a hash with a desired n-bit prefix.<p>But as a belt-and-suspenders you often see an attempt at fixed time comparisons of digests in any case.<p>Coincidentally, hashing before comparing can be used in scripting languages where the compare function will often be optimized out from under you, making constant time compare difficult or impossible to actually guarantee.