blob: 270999cef6182084a1a69a05df4173fa685f528a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// Copyright © 2020 rsiddharth <s@ricketyspace.net>
// SPDX-License-Identifier: ISC
package lib
func FixedXOR(a, b string) string {
cs := ""
if len(a) != len(b) {
return cs
}
ab := []byte(a)
bb := []byte(b)
for i := 0; i < len(ab); i++ {
p := HexCharToDec(ab[i])
q := HexCharToDec(bb[i])
r := DecToHexChar(p ^ q)
cs += string(r)
}
return cs
}
|