Checksums

Are we sure Lwt_io.position really gives the desired value here?
I think you want to get the position from this stream already on line 845 and use that too in your calculation...
(btw, is this code path under test?)