stableHash32 function

int stableHash32(
  1. String s
)

FNV-1a-32 over the UTF-8 encoding of s (32-bit safe on the web).

Implementation

int stableHash32(String s) {
  var h = 0x811C9DC5;
  for (final byte in utf8.encode(s)) {
    h = mul32((h ^ byte) & 0xFFFFFFFF, 0x01000193);
  }
  return h;
}