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

Side by Side Diff: components/sync/android/java/src/org/chromium/components/sync/notifier/RandomizedInvalidationClientNameGenerator.java

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 package org.chromium.sync.notifier; 5 package org.chromium.components.sync.notifier;
6 6
7 import android.util.Base64; 7 import android.util.Base64;
8 8
9 import org.chromium.base.annotations.MainDex; 9 import org.chromium.base.annotations.MainDex;
10 10
11 import java.util.Random; 11 import java.util.Random;
12 12
13 /** 13 /**
14 * Generates a fully random client ID. 14 * Generates a fully random client ID.
15 * 15 *
(...skipping 17 matching lines...) Expand all
33 * the class description for more details. 33 * the class description for more details.
34 */ 34 */
35 public byte[] generateInvalidatorClientName() { 35 public byte[] generateInvalidatorClientName() {
36 byte[] randomBytes = new byte[8]; 36 byte[] randomBytes = new byte[8];
37 RANDOM.nextBytes(randomBytes); 37 RANDOM.nextBytes(randomBytes);
38 String encoded = Base64.encodeToString(randomBytes, 0, randomBytes.lengt h, Base64.NO_WRAP); 38 String encoded = Base64.encodeToString(randomBytes, 0, randomBytes.lengt h, Base64.NO_WRAP);
39 String idString = "BadID" + encoded; 39 String idString = "BadID" + encoded;
40 return idString.getBytes(); 40 return idString.getBytes();
41 } 41 }
42 } 42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698