#pragma once

#include <library/cpp/digest/md5/md5.h>

#include <util/stream/output.h>

class TMD5ProxyStream : public IOutputStream {
    IOutputStream& Slave;
    MD5 Digest;
    bool IsFinished = false;
public:
    TMD5ProxyStream(IOutputStream& slave);

    virtual void DoWrite(const void* buf, size_t len) override;
    virtual void DoFinish() override;

    TString GetMD5();
};

