@braydenCN Thanks. I'm also concerning about overflow when doing sum. But it seems that even in the case of underflow or overflow, the final result is still correct. Anyway, XOR is easier and more reliable.
// Test with:
String a = "\uFFFE\uFFFF";
String b = "\uFFFF\uFFFE\u1234";
// Return '\u1234'