Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1815)

Unified Diff: base/sha2.cc

Issue 3214002: Add a term feature extractor for client-side phishing detection. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Add an extra comment/TODO about performance. Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/sha2.h ('k') | chrome/chrome_renderer.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sha2.cc
diff --git a/base/sha2.cc b/base/sha2.cc
index b6d6d5659c258684198d4ac1995d7d1f265dd9c4..47d381b18cf94bb3dd463455d1c6c413f1ad0152 100644
--- a/base/sha2.cc
+++ b/base/sha2.cc
@@ -4,6 +4,7 @@
#include "base/sha2.h"
+#include "base/stl_util-inl.h"
#include "base/third_party/nss/blapi.h"
#include "base/third_party/nss/sha256.h"
@@ -19,4 +20,10 @@ void SHA256HashString(const std::string& str, void* output, size_t len) {
static_cast<unsigned int>(len));
}
+std::string SHA256HashString(const std::string& str) {
+ std::string output(SHA256_LENGTH, 0);
+ SHA256HashString(str, string_as_array(&output), str.size());
+ return output;
+}
+
} // namespace base
« no previous file with comments | « base/sha2.h ('k') | chrome/chrome_renderer.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698