| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |