merge method

Uint8List merge(
  1. Uint8List other,
  2. int merger(
    1. int a,
    2. int b,
    3. int index
    )
)

Merges this instance with other using the merger Function for each byte.

Implementation

Uint8List merge(
    Uint8List other, int Function(int a, int b, int index) merger) {
  var length = min(this.length, other.length);
  var out = Uint8List(length);

  for (var i = 0; i < length; ++i) {
    var b = merger(this[i], other[i], i);
    out[i] = b;
  }

  return out;
}