public static int[] GetStringIndexesOfDifferenceBits(LongBits first, LongBits second) { if (first.bitsString.Equals(second.bitsString)) { return new int[] { } } ; string firstString = first.ToString(); string secondString = second.ToString(); while (firstString.Length > secondString.Length) { secondString = "0" + secondString; } while (firstString.Length < secondString.Length) { firstString = "0" + firstString; } List <int> indexesOfBits = new List <int>(); for (int i = 0; i < firstString.Length; i++) { if (firstString[i] != secondString[i]) { indexesOfBits.Add(i); } } return(indexesOfBits.ToArray()); }
bool GetIndexesOfDiffs(LongBits first, LongBits second, out List <int> diffs) { //Все таки пришлось циклом сравнить. Ваня, не бей( diffs = null; if (first.Length != second.Length) { return(first == second); } diffs = new List <int>() { }; string sf = first.ToString(); string ss = second.ToString(); for (int i = 0; i < sf.Length; i++) { if (sf[i] != ss[i]) { diffs.Add(i); } } return(diffs.Count == 0); }