Quick take, assuming equal length of a and b:
For each byte index i:
x[i] = a[i] XOR b[i]
return sum(x) == 0
For each byte index i:
x[i] = a[i] XOR b[i]
return sum(x) == 0
So it’ll be faster if: most characters match, most characters don’t match or there are runs of matching characters.
Have a read of this: https://stackoverflow.com/questions/11227809/why-is-processi...