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

Side by Side Diff: base/rand_util.h

Issue 8418034: Make string_util::WriteInto() DCHECK() that the supplied |length_with_null| > 1, meaning that the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | « base/base_paths_mac.mm ('k') | base/rand_util.cc » ('j') | no next file with comments »
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 20 matching lines...) Expand all
31 31
32 // Given input |bits|, convert with maximum precision to a double in 32 // Given input |bits|, convert with maximum precision to a double in
33 // the range [0, 1). Thread-safe. 33 // the range [0, 1). Thread-safe.
34 BASE_EXPORT double BitsToOpenEndedUnitInterval(uint64 bits); 34 BASE_EXPORT double BitsToOpenEndedUnitInterval(uint64 bits);
35 35
36 // Fills |output_length| bytes of |output| with cryptographically strong random 36 // Fills |output_length| bytes of |output| with cryptographically strong random
37 // data. 37 // data.
38 BASE_EXPORT void RandBytes(void* output, size_t output_length); 38 BASE_EXPORT void RandBytes(void* output, size_t output_length);
39 39
40 // Fills a string of length |length| with with cryptographically strong random 40 // Fills a string of length |length| with with cryptographically strong random
41 // data and returns it. 41 // data and returns it. |length| should be nonzero.
42 // 42 //
43 // Not that this is a variation of |RandBytes| with a different return type. 43 // Note that this is a variation of |RandBytes| with a different return type.
44 BASE_EXPORT std::string RandBytesAsString(size_t length); 44 BASE_EXPORT std::string RandBytesAsString(size_t length);
45 45
46 } // namespace base 46 } // namespace base
47 47
48 #endif // BASE_RAND_UTIL_H_ 48 #endif // BASE_RAND_UTIL_H_
OLDNEW
« no previous file with comments | « base/base_paths_mac.mm ('k') | base/rand_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698