[RESOLVED] Is there another way of comparing Byte()?
I'm wondering if there is another way of comparing two byte arrays, that isn't going through each index of the array. I'm just curious ;).
I tried using:
vb.net Code:
If ArrayA.Equals(ArrayB) Then
'Do something
Else
'Do something else
End If
But that would give me false negatives. If I wanted the real results then I would have to add a Not.
Thanks in advance!
Re: Is there another way of comparing Byte()?
Are you comparing byte for byte?
Re: Is there another way of comparing Byte()?
I'd say I have to compare the whole byte array, but yes, byte for byte. So I have to stick to the for... next loop, right? I'd like it to be exact as it can be.
Re: Is there another way of comparing Byte()?
I don't know if it's will be faster than just looping thru the array an comparing byte to byte, but you can compute the MD5 hash of each array and then compare the 2 hashes. If they match, the array's are identical.
Re: Is there another way of comparing Byte()?