summaryrefslogtreecommitdiffstats
path: root/base/md5.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/md5.h')
-rw-r--r--base/md5.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/base/md5.h b/base/md5.h
index a317329..5a1762b 100644
--- a/base/md5.h
+++ b/base/md5.h
@@ -6,9 +6,8 @@
#define BASE_MD5_H_
#pragma once
-#include <string>
-
#include "base/base_api.h"
+#include "base/string_piece.h"
namespace base {
@@ -52,10 +51,10 @@ BASE_API void MD5Sum(const void* data, size_t length, MD5Digest* digest);
// MD5Update().
BASE_API void MD5Init(MD5Context* context);
-// For the given buffer of data, updates the given MD5 context with the sum of
-// the data. You can call this any number of times during the computation,
-// except that MD5Init() must have been called first.
-BASE_API void MD5Update(MD5Context* context, const void* data, size_t length);
+// For the given buffer of |data| as a StringPiece, updates the given MD5
+// context with the sum of the data. You can call this any number of times
+// during the computation, except that MD5Init() must have been called first.
+BASE_API void MD5Update(MD5Context* context, const StringPiece& data);
// Finalizes the MD5 operation and fills the buffer with the digest.
BASE_API void MD5Final(MD5Digest* digest, MD5Context* context);
@@ -64,7 +63,7 @@ BASE_API void MD5Final(MD5Digest* digest, MD5Context* context);
BASE_API std::string MD5DigestToBase16(const MD5Digest& digest);
// Returns the MD5 (in hexadecimal) of a string.
-BASE_API std::string MD5String(const std::string& str);
+BASE_API std::string MD5String(const StringPiece& str);
} // namespace base