function value = luhn_is_valid ( s )

%*****************************************************************************80
%
%% luhn_is_valid() determines whether a string with Luhn check digit is valid.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 September 2015
%
%  Reference:
%
%    https://en.wikipedia.org/wiki/Luhn_algorithm
%
%  Input:
%
%    string S, the string of digits to be checked.
%
%  Output:
%
%    logical VALUE: true if the string is valid.
%
  d = luhn_checksum ( s );

  if ( d == 0 )
    value = true;
  else
    value = false;
  end

  return
end
 
