| version 1.5, 2002/03/28 21:41:57 |
version 1.6, 2002/09/19 23:18:00 |
|
|
| * Credit card validation * |
* Credit card validation * |
| * * |
* * |
| * Programmed by Ondrej Jombik <nepto@pobox.sk> * |
* Programmed by Ondrej Jombik <nepto@pobox.sk> * |
| * (c) Copyright 2000 Condy software inc. * |
* Copyright (c) 2000 Condy software inc. * |
| * (c) Copyright 2001-2002 Platon software development group * |
* Copyright (c) 2001-2002 Platon software development group * |
| * All rights reserved. * |
* All rights reserved. * |
| * * |
* * |
| * Updates: 10.10.2000, 9.11.2000, 5.10.2001, 4.2.2002 * |
* Updates: 10.10.2000, 9.11.2000, 5.10.2001, 4.2.2002 * |
| * * |
* * |
| **************************************************************************/ |
**************************************************************************/ |
| |
|
| #ifndef _PLATON_UTILS_LUHNCHK_H |
/** |
| #define _PLATON_UTILS_LUHNCHK_H |
* @file misc/luhnchk.h |
| |
* @brief Credit card validation using Luhn check algorithm |
| |
* @author Hysteria team <hysteria@hysteria.sk> |
| |
* @author Ondrej Jombik <nepto@pobox.sk> |
| |
* @version \$Id$ |
| |
* @date 2001-2002 [created: 19/4/2002] |
| |
*/ |
| |
|
| |
#ifndef _PLATON_MISC_LUHNCHK_H |
| |
#define _PLATON_MISC_LUHNCHK_H |
| |
|
| #define luhnchk(__s) luhncheck(__s) |
#define luhnchk(__s) luhncheck(__s) /**< Alias macro */ |
| |
|
| #ifdef __cplusplus |
#ifdef __cplusplus |
| extern "C" { |
extern "C" { |
| #endif |
#endif |
| |
|
| /* |
/** |
| * luhncheck() |
* Checks number according to Luhn check algorithm |
| * |
* |
| * Function checks validation of credit card according to number passed |
* @param number number to check (ie. credit card number) |
| * as string parameter. Returns 1 if valid, 0 if not. |
* @return 1 if number is valid, 0 otherwise |
| */ |
* |
| int luhncheck(const char *number); |
* 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 <br> |
| |
* http://www.merriampark.com/anatomycc.htm <br> |
| |
* http://hysteria.sk/prielom/prielom-12.html#3 (Slovak language) <br> |
| |
* http://www.speech.cs.cmu.edu/~sburke/pub/luhn_lib.html (Perl lib) |
| |
*/ |
| |
int luhncheck(const char *number); |
| |
|
| #ifdef __cplusplus |
#ifdef __cplusplus |
| } |
} |
| #endif |
#endif |
| |
|
| #endif /* #ifndef _PLATON_UTILS_LUHNCHK_H */ |
#endif /* #ifndef _PLATON_MISC_LUHNCHK_H */ |
| |
|