/// <summary> /// Determines whether [has valid checksum] [the specified employer identifier]. /// </summary> /// <param name="employerID">The employer identifier.</param> /// <returns> /// <c>true</c> if [has valid checksum] [the specified employer identifier]; otherwise, <c>false</c>. /// </returns> public bool HasValidChecksum(int employerID) { var checkSum = _derivedData05.GetEmployerIDChecksum(employerID); if (It.IsInRange(checkSum, _derivedData05.InvalidLengthChecksum)) { return(false); } var candidate = employerID.AsSafeReadOnlyDigitList().ElementAt(8).ToString(); return(candidate.ComparesWith(checkSum.ToString())); }
public bool HasValidChecksum(int employerID) { var checkSum = _derivedData05.GetEmployerIDChecksum(employerID); if (checkSum == _derivedData05.InvalidLengthChecksum) { return(false); } var candidate = employerID.SplitIntDigitsToList().ElementAt(8).ToString(); return(candidate.CaseInsensitiveEquals(checkSum.ToString())); }