| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_COMMON_RAND_UTIL_H__ | |
| 6 #define CHROME_COMMON_RAND_UTIL_H__ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 | |
| 10 namespace rand_util { | |
| 11 | |
| 12 // Returns a random number between min and max (inclusive). This is a | |
| 13 // non-cryptographic random number generator, using rand() from the CRT. | |
| 14 int RandInt(int min, int max); | |
| 15 | |
| 16 // Returns a random number between min and max (inclusive). This is a (slower) | |
| 17 // cryptographic random number generator using rand_s() from the CRT. Note | |
| 18 // that it does not work in Win2K, so it degrades to RandInt. | |
| 19 int RandIntSecure(int min, int max); | |
| 20 | |
| 21 } // namespace rand_util | |
| 22 | |
| 23 #endif // CHROME_COMMON_RAND_UTIL_H__ | |
| 24 | |
| OLD | NEW |