| OLD | NEW |
| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // Fills a string of length |length| with with random data and returns it. | 42 // Fills a string of length |length| with 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 // | 46 // |
| 47 // WARNING: | 47 // WARNING: |
| 48 // Do not use for security-sensitive purposes. | 48 // Do not use for security-sensitive purposes. |
| 49 // See crypto/ for cryptographically secure random number generation APIs. | 49 // See crypto/ for cryptographically secure random number generation APIs. |
| 50 BASE_EXPORT std::string RandBytesAsString(size_t length); | 50 BASE_EXPORT std::string RandBytesAsString(size_t length); |
| 51 | 51 |
| 52 #ifdef OS_POSIX | 52 #if defined(OS_POSIX) |
| 53 BASE_EXPORT int GetUrandomFD(); | 53 BASE_EXPORT int GetUrandomFD(); |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 } // namespace base | 56 } // namespace base |
| 57 | 57 |
| 58 #endif // BASE_RAND_UTIL_H_ | 58 #endif // BASE_RAND_UTIL_H_ |
| OLD | NEW |