Brian Dunning's FileMaker Custom Functions

Luhn10.isValid ( _number ; _requiredLength )

Validates Credit Card numbers, SIREN, Canadian Social Security numbers…

  Average rating: 5.0 (1 vote) Log in to vote

Fabrice Nordmann   Fabrice Nordmann - Show more from this author
1-more-thing
https://www.1-more-thing.com

Share on Facebook Share on Twitter

  Sample input:
Luhn10.isValid ( "4012 8888 8888 1881" /*(Visa)*/ ; 16 )
  Sample output:
1

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

/*
Luhn10.isValid ( _number ; _requiredLength )
by Fabrice Nordmann, 1-more-thing
Jan 2023

parameters:
_number: the number to check
_requiredLength: optional: allows to check the length of the number (digits only).
For example pass 16 for a Credit card number, or 9 for a SIREN ID.

result: Boolean (True for Valid)

input examples (valid numbers)
- Credit card numbers:
- 5555 5555 5555 4444 (MasterCard)
- 5185 5408 1000 0019 (MasterCard)
- 4012 8888 8888 1881 (Visa)
- 4111 1111 1111 1111 (Visa)
- 3714 496353 98431 (AMEX)
- 3782 822463 10005 (AMEX)
- SIREN Company ID (France)
- 813730132
- 892185877
- 794430686
- Canadian social security
- many more…
*/

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 19 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: