| Index: base/rand_util_win.cc
|
| diff --git a/base/rand_util_win.cc b/base/rand_util_win.cc
|
| index 391fe5b9e61d6f48f413b97f3f3f536dd38d5da0..52103eb93e556ce19269edd04cda5c2d2c84fccc 100644
|
| --- a/base/rand_util_win.cc
|
| +++ b/base/rand_util_win.cc
|
| @@ -28,4 +28,14 @@ uint64 RandUint64() {
|
| return (static_cast<uint64>(first_half) << 32) + second_half;
|
| }
|
|
|
| +void RandBytes(void* output, size_t output_length) {
|
| + uint64 random_int;
|
| + const size_t random_int_size = sizeof(random_int);
|
| + for (size_t i = 0; i < output_length; i += random_int_size) {
|
| + random_int = base::RandUint64();
|
| + const size_t copy_count = std::min(output_length - i, random_int_size);
|
| + memcpy(((uint8*)output) + i, &random_int, copy_count);
|
| + }
|
| +}
|
| +
|
| } // namespace base
|
|
|