md5_stream.cpp 382 B

1234567891011121314151617181920
  1. #include "md5_stream.h"
  2. namespace NYql {
  3. TMd5OutputStream::TMd5OutputStream(IOutputStream& delegatee)
  4. : Delegatee_(delegatee)
  5. {
  6. }
  7. TString TMd5OutputStream::Finalize() {
  8. char buf[33] = { 0 };
  9. return TString(Accumulator_.End(buf));
  10. }
  11. void TMd5OutputStream::DoWrite(const void* buf, size_t len) {
  12. Delegatee_.Write(buf, len);
  13. Accumulator_.Update(buf, len);
  14. }
  15. }