I have a TCP file server in Rust / Tokio stack.
When a client is uploading a file, the data is being read from a tokio::net::TcpStream
and written to a futures_fs::FsWriteSink
, which has been started on a separate futures_fs::FsPool
.
When the file is completely uploaded, I need to check its consistency by checking its checksum against the one sent by the client.
What is the easiest way to asynchronously calculate the checksum, especially if the file does not fit into RAM?