Defer content hashing when not needed for speed

This mostly applies to optional content hashing.
If a header does not contain a hash and you opt out
of hash checking then you save some cpu by not
pre-calculating a hash