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

Side by Side Diff: base/rand_util.h

Issue 273283002: Sync: Do not generate non-UTF8 names for delete directives. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: adapt to base namespace change in r268754 Created 6 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 | chrome/browser/history/delete_directive_handler.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
(...skipping 21 matching lines...) Expand all
32 // the range [0, 1). Thread-safe. 32 // the range [0, 1). Thread-safe.
33 BASE_EXPORT double BitsToOpenEndedUnitInterval(uint64 bits); 33 BASE_EXPORT double BitsToOpenEndedUnitInterval(uint64 bits);
34 34
35 // Fills |output_length| bytes of |output| with random data. 35 // Fills |output_length| bytes of |output| with random data.
36 // 36 //
37 // WARNING: 37 // WARNING:
38 // Do not use for security-sensitive purposes. 38 // Do not use for security-sensitive purposes.
39 // See crypto/ for cryptographically secure random number generation APIs. 39 // See crypto/ for cryptographically secure random number generation APIs.
40 BASE_EXPORT void RandBytes(void* output, size_t output_length); 40 BASE_EXPORT void RandBytes(void* output, size_t output_length);
41 41
42 // Fills a string of length |length| with with random data and returns it. 42 // Fills a string of length |length| with random data and returns it.
43 // |length| should be nonzero. 43 // |length| should be nonzero.
44 // 44 //
45 // Note that this is a variation of |RandBytes| with a different return type. 45 // Note that this is a variation of |RandBytes| with a different return type.
46 // The returned string is likely not ASCII/UTF-8. Use with care.
46 // 47 //
47 // WARNING: 48 // WARNING:
48 // Do not use for security-sensitive purposes. 49 // Do not use for security-sensitive purposes.
49 // See crypto/ for cryptographically secure random number generation APIs. 50 // See crypto/ for cryptographically secure random number generation APIs.
50 BASE_EXPORT std::string RandBytesAsString(size_t length); 51 BASE_EXPORT std::string RandBytesAsString(size_t length);
51 52
52 #if defined(OS_POSIX) 53 #if defined(OS_POSIX)
53 BASE_EXPORT int GetUrandomFD(); 54 BASE_EXPORT int GetUrandomFD();
54 #endif 55 #endif
55 56
56 } // namespace base 57 } // namespace base
57 58
58 #endif // BASE_RAND_UTIL_H_ 59 #endif // BASE_RAND_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/delete_directive_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698