def calculate_luhn(partial_number: float) -> int:
    """
    Generates the Checksum using Luhn's algorithm
    """
    check_digit = luhn_checksum(int(partial_number) * 10)
    return check_digit if check_digit == 0 else 10 - check_digit

    Generates the Checksum using Luhn's algorithm
    
faker/utils/checksums.py