Calculate digests while reading or writing