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

Side by Side Diff: base/rand_util.h

Issue 6873156: Move crypto_helpers from sync to base (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Follow agl review Created 9 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/rand_util.cc » ('j') | chrome/browser/sync/util/user_settings.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_RAND_UTIL_H_ 5 #ifndef BASE_RAND_UTIL_H_
6 #define BASE_RAND_UTIL_H_ 6 #define BASE_RAND_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 11 matching lines...) Expand all
22 // Returns a random number in range [0, max). Thread-safe. 22 // Returns a random number in range [0, max). Thread-safe.
23 // 23 //
24 // Note that this can be used as an adapter for std::random_shuffle(): 24 // Note that this can be used as an adapter for std::random_shuffle():
25 // Given a pre-populated |std::vector<int> myvector|, shuffle it as 25 // Given a pre-populated |std::vector<int> myvector|, shuffle it as
26 // std::random_shuffle(myvector.begin(), myvector.end(), base::RandGenerator); 26 // std::random_shuffle(myvector.begin(), myvector.end(), base::RandGenerator);
27 BASE_API uint64 RandGenerator(uint64 max); 27 BASE_API uint64 RandGenerator(uint64 max);
28 28
29 // Returns a random double in range [0, 1). Thread-safe. 29 // Returns a random double in range [0, 1). Thread-safe.
30 BASE_API double RandDouble(); 30 BASE_API double RandDouble();
31 31
32 // fills |output_length| bytes of |output| with cryptographically strong random
brettw 2011/05/03 17:36:53 Be sure all comments are complete sentences with c
33 // data.
34 BASE_API void RandBytes(void* output, size_t output_length);
35
32 // Returns a random string of the specified length. 36 // Returns a random string of the specified length.
33 BASE_API std::string RandBytesAsString(size_t length); 37 BASE_API std::string RandBytesAsString(size_t length);
brettw 2011/05/03 17:36:53 Can you update the comment for this function so it
34 38
35 } // namespace base 39 } // namespace base
36 40
37 #endif // BASE_RAND_UTIL_H_ 41 #endif // BASE_RAND_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | base/rand_util.cc » ('j') | chrome/browser/sync/util/user_settings.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698