|
|
@ -71,11 +71,11 @@ public class StringUtil { |
|
|
|
public static String randomString(int length){ |
|
|
|
public static String randomString(int length){ |
|
|
|
StringBuffer randomString=new StringBuffer(); |
|
|
|
StringBuffer randomString=new StringBuffer(); |
|
|
|
while (length>0){ |
|
|
|
while (length>0){ |
|
|
|
Random random=new Random(); |
|
|
|
ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); |
|
|
|
int ran=random.nextInt(3); |
|
|
|
int ran=threadLocalRandom.nextInt(3); |
|
|
|
switch (ran){ |
|
|
|
switch (ran){ |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
|
randomString.append(random.nextInt(10)); |
|
|
|
randomString.append(threadLocalRandom.nextInt(10)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
|
randomString.append(randomLowerCase()); |
|
|
|
randomString.append(randomLowerCase()); |
|
|
|