def Adler32(data):
  """Computes the unsigned Adler-32 checksum of a string."""
  # We're using this instead of zlib.adler32() because it's easier to confirm
  # that this matches the JavaScript version of the same function below.  Also,
  # zlib.adler32() returns a signed result, and we want an unsigned result.
  a, b = 1, 0
  for ch in map(ord, data):
    a = (a + ch) % 0xfff1
    b = (b + a) % 0xfff1
  return b * 0x10000 + a