bytesEqual static method

bool bytesEqual(
  1. List<int>? a,
  2. List<int>? b
)

Null-safe equality check for two byte lists.

Implementation

static bool bytesEqual(List<int>? a, List<int>? b) {
  if (a == null) {
    return b == null;
  }
  if (b == null || a.length != b.length) {
    return false;
  }
  if (identical(a, b)) {
    return true;
  }

  for (int index = 0; index < a.length; index += 1) {
    if (a[index] != b[index]) {
      return false;
    }
  }

  return true;
}