def card_number(value: str) -> bool:
    """
    Return whether or not given value is a valid card number.

    This validator is based on Luhn algorithm.

    .. luhn:
       https://github.com/mmcloughlin/luhn

    Examples::

        >>> card_number('4242424242424242')
        True

        >>> card_number('4242424242424241')
        ValidationFailure(func=card_number, args={'value': '4242424242424241'})

    .. versionadded:: 0.15.0

    :param value: card number string to validate
    """
    try:
        digits = list(map(int, value))
        odd_sum: int = sum(digits[-1::-2])
        even_sum: int = sum([sum(divmod(2 * d, 10)) for d in digits[-2::-2]])
        return (odd_sum + even_sum) % 10 == 0
    except ValueError:
        return False