/// <summary> /// Supplement first 11th digit of "My Number" with check digit /// </summary> /// <param name="number">First 11 digits of "My Number"</param> /// <returns>Resulting "My Number"</returns> private static string Complete(string number) { var sanitized = Sanitize(number); var sum = MyNumber.CalculateCheckDigits(sanitized); return(number + sum); }
/// <summary> /// Generate "My Number" of range specified /// </summary> /// <param name="min">Minimum value</param> /// <param name="max">Maximum value</param> private static void RangeS(string min, string max) { var minFilled = Fill(min, RangeMode.Sequential); var maxFilled = Fill(max, RangeMode.Sequential); Log.Debug("Filled min: " + minFilled); Log.Debug("Filled max: " + maxFilled); var value = Array.ConvertAll(minFilled.ToCharArray(), c => (int)GetNumericValue(c)); var stop = Array.ConvertAll(maxFilled.ToCharArray(), c => (int)GetNumericValue(c)); do { var checkDigit = MyNumber.CalculateCheckDigits(value); Console.WriteLine(string.Join("", value) + checkDigit); value = Increment(value); } while (!Compare(value, stop, RangeMode.Sequential) && value != null); }