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

Unified Diff: base/rand_util.h

Issue 6904118: Add a rand_util method for generating a random string. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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/rand_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/rand_util.h
===================================================================
--- base/rand_util.h (revision 83409)
+++ base/rand_util.h (working copy)
@@ -6,6 +6,8 @@
#define BASE_RAND_UTIL_H_
#pragma once
+#include <string>
+
#include "base/base_api.h"
#include "base/basictypes.h"
@@ -27,6 +29,9 @@
// Returns a random double in range [0, 1). Thread-safe.
BASE_API double RandDouble();
+// Returns a random string of the specified length.
+BASE_API std::string RandBytesAsString(size_t length);
+
} // namespace base
#endif // BASE_RAND_UTIL_H_
« no previous file with comments | « no previous file | base/rand_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698