Xor computes the logical XOR of two bit arrays. The caller must ensure they have the same bit size.
(lhs, rhs BitArray)
| 452 | // Xor computes the logical XOR of two bit arrays. |
| 453 | // The caller must ensure they have the same bit size. |
| 454 | func Xor(lhs, rhs BitArray) BitArray { |
| 455 | res := lhs.Clone() |
| 456 | for i, w := range rhs.words { |
| 457 | res.words[i] ^= w |
| 458 | } |
| 459 | return res |
| 460 | } |
| 461 | |
| 462 | // Compare compares two bit arrays. They can have mixed sizes. |
| 463 | func Compare(lhs, rhs BitArray) int { |