In particular:
julia> sum(count_ones.(xor.(codeunits(str1), codeunits(str2))))
37
(I used codeunits
rather than Vector{UInt8}
to avoid making a copy — codeunits
is just a byte-based view of the string contents.)
In particular:
julia> sum(count_ones.(xor.(codeunits(str1), codeunits(str2))))
37
(I used codeunits
rather than Vector{UInt8}
to avoid making a copy — codeunits
is just a byte-based view of the string contents.)