summaryrefslogtreecommitdiffstats
path: root/base/rand_util.h
diff options
context:
space:
mode:
authorqsr@google.com <qsr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-05 08:46:11 +0000
committerqsr@google.com <qsr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-05 08:46:11 +0000
commit51a018181c93b3c190146432805836155d69effa (patch)
treea9ed7d4a2acdbfad83f4c3063250ef283b15405b /base/rand_util.h
parent1817055ea2667eda23f5d53d623b3a547a7d19ee (diff)
downloadchromium_src-51a018181c93b3c190146432805836155d69effa.zip
chromium_src-51a018181c93b3c190146432805836155d69effa.tar.gz
chromium_src-51a018181c93b3c190146432805836155d69effa.tar.bz2
Move crypto_helpers from sync to crypto
crypto_helpers only depends on resources in base and is used by sync and password_manager. BUG= TEST= Review URL: http://codereview.chromium.org/6873156 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84223 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/rand_util.h')
-rw-r--r--base/rand_util.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/base/rand_util.h b/base/rand_util.h
index d10cc8b..6bfbcb4 100644
--- a/base/rand_util.h
+++ b/base/rand_util.h
@@ -33,7 +33,14 @@ BASE_API double RandDouble();
// the range [0, 1). Thread-safe.
BASE_API double BitsToOpenEndedUnitInterval(uint64 bits);
-// Returns a random string of the specified length.
+// Fills |output_length| bytes of |output| with cryptographically strong random
+// data.
+BASE_API void RandBytes(void* output, size_t output_length);
+
+// Fills a string of length |length| with with cryptographically strong random
+// data and returns it.
+//
+// Not that this is a variation of |RandBytes| with a different return type.
BASE_API std::string RandBytesAsString(size_t length);
} // namespace base