generateBytesHashCode static method

int generateBytesHashCode(
  1. List<int> bytes, [
  2. List<Object> optional = const []
])

Implementation

static int generateBytesHashCode(List<int> bytes,
    [List<Object> optional = const []]) {
  int hash = 12;
  for (final element in bytes) {
    hash ^= element; // XOR each element into the hash
    hash = (hash * 31) & mask32;
  }
  for (final element in optional) {
    hash = (hash ^ element.hashCode) & mask32;
  }
  return hash;
}