Refactored weak checksum algorithm