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

Side by Side Diff: chrome/common/random.cc

Issue 6873156: Move crypto_helpers from sync to base (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Correct WriteInto length. Created 9 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
OLDNEW
(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 random_bytes(kNumberBytes, ' ');
agl 2011/05/03 14:53:40 You have RandBytesAsString now, did you not want t
15 base::RandBytes(&random_bytes[0], kNumberBytes);
16 std::string base64_encoded_bytes;
17 base::Base64Encode(random_bytes, &base64_encoded_bytes);
18 return base64_encoded_bytes;
19 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698