diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/digest/md5/md5.h | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/digest/md5/md5.h')
-rw-r--r-- | library/cpp/digest/md5/md5.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/library/cpp/digest/md5/md5.h b/library/cpp/digest/md5/md5.h index 014323adea..2c17aa0518 100644 --- a/library/cpp/digest/md5/md5.h +++ b/library/cpp/digest/md5/md5.h @@ -5,30 +5,30 @@ class IInputStream; -class MD5 { +class MD5 { public: MD5() { Init(); } - - void Init(); - + + void Init(); + inline MD5& Update(const void* data, size_t len) { return Update(MakeArrayRef(static_cast<const ui8*>(data), len)); } - + inline MD5& Update(TStringBuf data) { return Update(data.data(), data.size()); } - + inline MD5& Update(const TArrayRef<const ui8> data) { UpdatePart(data); return *this; - } - - void Pad(); + } + + void Pad(); ui8* Final(ui8[16]); - + // buf must be char[33]; char* End(char* buf); @@ -39,7 +39,7 @@ public: ui64 EndHalfMix(); MD5& Update(IInputStream* in); - + /* * Return hex-encoded md5 checksum for given file. * @@ -53,7 +53,7 @@ public: static TString Data(const TArrayRef<const ui8>& data); static TString Data(TStringBuf data); static char* Stream(IInputStream* in, char* buf); - + static TString Calc(TStringBuf data); // 32-byte hex-encoded static TString Calc(const TArrayRef<const ui8>& data); // 32-byte hex-encoded static TString CalcRaw(TStringBuf data); // 16-byte raw |