/** * Credit card validation using Luhn check algorithm * * @file platon/misc/luhnchk.h * @author Gizmo * @author Ondrej Jombik * @version \$Platon: libplaton/platon/misc/luhnchk.h,v 1.10 2003/04/23 19:01:37 nepto Exp $ * @date 2000-2003 */ /* Updates: 10/10/2000 9/11/2000 5/10/2001 4/2/2002 19/4/2002 20/9/2002 - Doxygen documentation added */ #ifndef _PLATON_MISC_LUHNCHK_H #define _PLATON_MISC_LUHNCHK_H #define luhnchk(__s) luhncheck(__s) /**< alias to luhncheck() */ #ifdef __cplusplus extern "C" { #endif /** * Checks number according to Luhn check algorithm * * @param number number to check (ie. credit card number) * @return 1 if number is valid, 0 otherwise * * Function is useful check credit cards numbers. All credit cards must * pass this algorithm. Luhn check algorithm is published on several * places, and also here: * * http://www.webopedia.com/TERM/L/Luhn_formula.html
* http://www.merriampark.com/anatomycc.htm
* http://hysteria.sk/prielom/prielom-12.html#3 (Slovak language)
* http://www.speech.cs.cmu.edu/~sburke/pub/luhn_lib.html (Perl lib) */ int luhncheck(const char *number); #ifdef __cplusplus } #endif #endif /* #ifndef _PLATON_MISC_LUHNCHK_H */