MathExtensionsLunhAlgorithm Method

The Lunh algorithm is used as 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.8+34f1bbd8dc6b32752cfce829cbed66e15113d7ba
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