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

Unified Diff: base/string_util.h

Issue 18452: Adding a HexEncode function to string_utils.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 | « no previous file | base/string_util.cc » ('j') | base/string_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util.h
===================================================================
--- base/string_util.h (revision 8370)
+++ base/string_util.h (working copy)
@@ -528,5 +528,13 @@
bool MatchPattern(const std::wstring& string, const std::wstring& pattern);
bool MatchPattern(const std::string& string, const std::string& pattern);
+// Returns a hex string representation of a binary buffer.
+// The returned hex string will be in upper case.
+// This function does not check if |size| is within reasonable limits since
+// it's written with trusted data in mind.
+// If you suspect that the data you want to format might be large,
+// the absolute max size for |size| should be is
+// std::numeric_limits<size_t>::max() / 2
+std::string HexEncode(const void* bytes, size_t size);
+
#endif // BASE_STRING_UTIL_H_
-
« no previous file with comments | « no previous file | base/string_util.cc » ('j') | base/string_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698