xor method
Implementation
Uint8List xor(Uint8List b) {
if (lengthInBytes == 0 || b.lengthInBytes == 0) {
throw ArgumentError.value(
"lengthInBytes of Uint8List arguments must be > 0");
}
bool aIsBigger = lengthInBytes > b.lengthInBytes;
int length = aIsBigger ? lengthInBytes : b.lengthInBytes;
Uint8List buffer = Uint8List(length);
for (int i = 0; i < length; i++) {
var aa, bb;
try {
aa = elementAt(i);
} catch (e) {
aa = 0;
}
try {
bb = b.elementAt(i);
} catch (e) {
bb = 0;
}
buffer[i] = aa ^ bb;
}
return buffer;
}