let adler32 s =
  let a = ref 1 in
  let b = ref 0 in
  let m = 65521 in
  for i = 0 to String.length s - 1 do
    a := (!a + Char.code s.[i]) mod m;
    b := (!b + !a) mod m
  done;
  !b * 65536 + !a

;;

adler32 "Wikipedia"
