public override int GetHashCode() { int hash = 1; if (CandidateUsername.Length != 0) { hash ^= CandidateUsername.GetHashCode(); } if (CandidatePassword.Length != 0) { hash ^= CandidatePassword.GetHashCode(); } if (clientInstanceId_ != null) { hash ^= ClientInstanceId.GetHashCode(); } if (OauthClientId.Length != 0) { hash ^= OauthClientId.GetHashCode(); } if (clientInstance_ != null) { hash ^= ClientInstance.GetHashCode(); } return(hash); }
public bool IsSatisfiedBy(CandidatePassword password) { var foundTwoAdjacentDigitsThatAreTheSame = false; using (var enumerator = password.GetEnumerator()) { if (enumerator.MoveNext()) { var previous = enumerator.Current; while (enumerator.MoveNext() && !foundTwoAdjacentDigitsThatAreTheSame) { foundTwoAdjacentDigitsThatAreTheSame = enumerator.Current.Equals(previous); if (!foundTwoAdjacentDigitsThatAreTheSame) { previous = enumerator.Current; } } } } return(foundTwoAdjacentDigitsThatAreTheSame); }
public bool IsSatisfiedBy(CandidatePassword password) { var digitsNeverDecrease = true; using (var enumerator = password.GetEnumerator()) { if (enumerator.MoveNext()) { var previous = enumerator.Current; while (enumerator.MoveNext() && digitsNeverDecrease) { digitsNeverDecrease = previous <= enumerator.Current; if (digitsNeverDecrease) { previous = enumerator.Current; } } } } return(digitsNeverDecrease); }