diff options
author | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-13 23:49:25 +0000 |
---|---|---|
committer | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-13 23:49:25 +0000 |
commit | f2c859a17e291cd481f89b55b79ac5450a81fcd0 (patch) | |
tree | fe38ce3e7712809d56967dc00316d85077ccc496 /base/rand_util.h | |
parent | c010c40a4aca2cb281c2e7a3c75cec24d2558661 (diff) | |
download | chromium_src-f2c859a17e291cd481f89b55b79ac5450a81fcd0.zip chromium_src-f2c859a17e291cd481f89b55b79ac5450a81fcd0.tar.gz chromium_src-f2c859a17e291cd481f89b55b79ac5450a81fcd0.tar.bz2 |
Factoring GUID generation from metrics to base
Factors GUID generation into base/rand_util. The Autofill feature is in need of this utility so am factoring GUID generation out of metrics and moving to the commons.
BUG=58813
TEST=RandUtilTest.GUIDGeneratesAllZeroes, RandUtilTest.GUIDGeneratesCorrectly, RandUtilTest.GUIDCorrectlyFormatted, MetricsServiceTest.ClientIdCorrectlyFormatted
Review URL: http://codereview.chromium.org/3800001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/rand_util.h')
-rw-r--r-- | base/rand_util.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/base/rand_util.h b/base/rand_util.h index 699fc7f..d298134 100644 --- a/base/rand_util.h +++ b/base/rand_util.h @@ -6,6 +6,8 @@ #define BASE_RAND_UTIL_H_ #pragma once +#include <string> + #include "base/basictypes.h" namespace base { @@ -26,6 +28,9 @@ uint64 RandGenerator(uint64 max); // Returns a random double in range [0, 1). Thread-safe. double RandDouble(); +// Generate a 128-bit random GUID of the form: "%08X-%04X-%04X-%04X-%012llX". +std::string GenerateGUID(); + } // namespace base #endif // BASE_RAND_UTIL_H_ |