This commit is contained in:
RoyceDa
2026-02-02 00:37:31 +02:00
parent eb91aab40b
commit ca562e90c1
26 changed files with 614 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package com.rosetta.im.protocol.util;
public class StringUtil {
public static String randomString(int length) {
StringBuilder sb = new StringBuilder();
String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (int i = 0; i < length; i++) {
int index = (int) (Math.random() * characters.length());
sb.append(characters.charAt(index));
}
return sb.toString();
}
}