Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27189

Basic XOR help

$
0
0
Hey, I have 2 binary strings
e.g.
"0101001" and "11100"

They are different lengths and can change
Sometimes, when I try and XOR them, I get non-binary numbers e.g. 9 and 8 in the answer
Why does this happen? :(

More code:
I have some values in a string array called bitarray. Im trying to do something like this:

Code:

For i = 1 To bitarray.Length
            'Console.WriteLine(Str(CLng(bitarray(i - 1)) Xor CLng(keyBin)))
            Console.WriteLine(bitarray(i - 1) Xor "1")
        Next

This works however Xor "101" does not :(

Viewing all articles
Browse latest Browse all 27189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>