|
-
Aug 21st, 2009, 03:12 PM
#1
Thread Starter
Fanatic Member
[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!
-
Aug 21st, 2009, 03:30 PM
#2
Re: Is there another way of comparing Byte()?
Are you comparing byte for byte?
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Aug 21st, 2009, 03:55 PM
#3
Thread Starter
Fanatic Member
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.
-
Aug 21st, 2009, 06:29 PM
#4
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.
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Aug 21st, 2009, 06:30 PM
#5
Thread Starter
Fanatic Member
Re: Is there another way of comparing Byte()?
Oh, ok. Thanks stan .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|