Multipetros.Validation  1.0
Validation for greek VIES VAT IDs, greek social IDs and Luhn formula based numbers
Multipetros.Validation.Luhn Class Reference

This class provide static methods for validation checking of Luhn formula numbers. More...

Static Public Member Functions

static bool IsValid (string id)
 The greek social id, uses the Luhn formula.
The last digit is the validation digit using the Luhn check digit algorithm.
 

Detailed Description

This class provide static methods for validation checking of Luhn formula numbers.

Member Function Documentation

static bool Multipetros.Validation.Luhn.IsValid ( string  id)
static

The greek social id, uses the Luhn formula.
The last digit is the validation digit using the Luhn check digit algorithm.

  • 1 - Counting from the check digit, which is the rightmost, and moving left, double the value of every second digit.
  • 2 - Sum the digits of the products (e.g., 10: 1 + 0 = 1, 14: 1 + 4 = 5) together with the undoubled digits from the original number.
  • 3 - If the total modulo 10 is equal to 0 (if the total ends in zero) then the number is valid according to the Luhn formula; else it is not valid.
Parameters
sidNumThe social id number in string
Returns
True if pass the Luhn validation, else false