diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/digest/md5/md5.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 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 2c17aa05181..014323adea6 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 |