Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
Clarifying non-numeric alphanumeric strings
Browse files Browse the repository at this point in the history
  • Loading branch information
pimotte committed Aug 4, 2014
1 parent 2b42bc0 commit 60845d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions syncany-lib/src/main/java/org/syncany/crypto/CipherUtil.java
Expand Up @@ -64,7 +64,8 @@
*/
public class CipherUtil {
private static final Logger logger = Logger.getLogger(CipherUtil.class.getSimpleName());
private static final String ALPHANUMERIC_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789";
// This is not alphanumeric to prevent breaking of the VectorClock format.
private static final String ALPHABETHIC_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

private static AtomicBoolean initialized = new AtomicBoolean(false);
private static AtomicBoolean unlimitedStrengthEnabled = new AtomicBoolean(false);
Expand Down Expand Up @@ -167,7 +168,7 @@ public static String createRandomAlphanumericString(int size) {
StringBuilder sb = new StringBuilder(size);

for (int i = 0; i < size; i++) {
sb.append(ALPHANUMERIC_CHARS.charAt(secureRandom.nextInt(ALPHANUMERIC_CHARS.length())));
sb.append(ALPHABETHIC_CHARS.charAt(secureRandom.nextInt(ALPHABETHIC_CHARS.length())));
}

return sb.toString();
Expand Down

1 comment on commit 60845d0

@binwiederhier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.