I decided to use the Luhn alghorithm to validate some swedish social security numbers. By writing the function myself i got this to work as planned, although there are some issues. With my code and the others i've tried i've found out that it still validates easy combinations for example like 2222222222 and 4444444444 as valid.
Those two examples as easily avoided, but then it got me wondering about the rest of the combinations that are fake but still validates true by using the algorithm.
Is it me, and those examples that i've looked at, that has done something wrong with the code or is this a known error with the algorithm? If so, how can i solve that or is there some other more suitable approach?