def sqlite_bit_hamming_distance(a: int, b: int) -> int:
    """Calculate the Hamming distance between two integers."""
    diff = (a & MAX_INT64) ^ (b & MAX_INT64)
    if hasattr(diff, "bit_count"):
        return diff.bit_count()
    return bin(diff).count("1")
Calculate the Hamming distance between two integers.
src/datachain/sql/sqlite/base.py