I create a list like this:
private List<byte[]> shaList = new List<byte[]>();
and fill it with millions of shas. Afterwards I wanna sort it like this:
shaList.Sort();
But it throws an exception:
Unbehandelte Ausnahme: System.InvalidOperationException: Fehler beim Vergleichen
von zwei Elementen im Array. ---> System.ArgumentException: Mindestens ein
Objekt muss IComparable implementieren.
bei System.Collections.Comparer.Compare(Object a, Object b)
bei System.Collections.Generic.ObjectComparer`1.Compare(T x, T y)
bei System.Collections.Generic.ArraySortHelper`1.SwapIfGreaterWithItems(T[]
keys, IComparer`1 comparer, Int32 a, Int32 b)
bei System.Collections.Generic.ArraySortHelper`1.QuickSort(T[] keys, Int32
left, Int32 right, IComparer`1 comparer)
bei System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index,
Int32 length, IComparer`1 comparer)
--- Ende der internen Ausnahmestapelüberwachung ---
bei System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index,
Int32 length, IComparer`1 comparer)
bei System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer`1
comparer)
bei System.Collections.Generic.List`1.Sort(Int32 index, Int32 count, I
Comparer`1 comparer)
bei System.Collections.Generic.List`1.Sort()
I don't have a clue how to sort it on my own. I only had Bubble and Insertion Sort in school but sorting millions of hashes with bubble sort... xD
//3vilc00kie
byte[]
but how do you want to sort a list ofbyte[]
? Which array comes first, and which last? – Rango Feb 20 '14 at 13:33