Use base32 for contact links.

This commit is contained in:
akwizgran
2018-09-25 13:54:27 +01:00
committed by Torsten Grote
parent 2546f8c2f8
commit 101b600f0e
3 changed files with 15 additions and 3 deletions

View File

@@ -153,4 +153,15 @@ public class StringUtils {
return new String(c);
}
public static String getRandomBase32String(int length) {
char[] c = new char[length];
for (int i = 0; i < length; i++) {
int character = random.nextInt(32);
if (character < 26) c[i] = (char) ('A' + character);
else c[i] = (char) ('2' + (character - 26));
}
return new String(c);
}
}