OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/common/random.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "base/base64.h" |
| 10 #include "base/rand_util.h" |
| 11 |
| 12 std::string Generate128BitRandomBase64String() { |
| 13 const int kNumberBytes = 128 / 8; |
| 14 std::string base64_encoded_bytes; |
| 15 base::Base64Encode(base::RandBytesAsString(kNumberBytes), |
| 16 &base64_encoded_bytes); |
| 17 return base64_encoded_bytes; |
| 18 } |
OLD | NEW |