Unify checksum code.