MathExtensionsLunhAlgorithm Method

The Lunh algorithm is used a simple check digit formula to validate a variety of identification numbers. We use it for ImeiNumbers and SimCardNumbers.

Definition

Namespace: MobileTrack.Common.Extensions
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+45c8d9adb5970d727cceec44a5ed61aea0016e50
public static bool LunhAlgorithm(
	string input,
	ValidationModel onError,
	out ValidationModel validationModel
)

Parameters

input  String
String to check whether its last digit (check digit) pans out.
onError  ValidationModel
Validation model to return if the output is faulty.
validationModel  ValidationModel
Validation result

Return Value

Boolean
if the number was correct.

Exceptions

ArgumentExceptionThrown if input is IsNullOrEmpty(String), or if it contains anything else than digits.

See Also