]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/util/RandomToken.java
fixup! Finish up signup process (so that it's usable except "verify")
[gigi.git] / src / org / cacert / gigi / util / RandomToken.java
index 8e83bb90aab8943b559ef5c450f6cfb762565d47..7d87b7bd7273c1f62f58b8d506cdcf8c409746d2 100644 (file)
@@ -9,14 +9,16 @@ public class RandomToken {
                for (int i = 0; i < length; i++) {
                        int rand = sr.nextInt(26 * 2 + 10);
                        if (rand < 10) {
-                               token.append('0' + rand);
+                               token.append((char) ('0' + rand));
+                               continue;
                        }
                        rand -= 10;
                        if (rand < 26) {
-                               token.append('a' + rand);
+                               token.append((char) ('a' + rand));
+                               continue;
                        }
                        rand -= 26;
-                       token.append('A' + rand);
+                       token.append((char) ('A' + rand));
                }
                return token.toString();
        }