ViaTag 生成规则调整

This commit is contained in:
shikong 2023-09-27 02:04:31 +08:00
parent 87d4fc2a38
commit d820cb7a9c

View File

@ -29,7 +29,11 @@ public class SipUtil {
private static final char[] DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz".toCharArray(); private static final char[] DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz".toCharArray();
public static String nanoId(){ public static String nanoId(){
return NanoId.randomNanoId(null,DEFAULT_ALPHABET,32); return nanoId(32);
}
public static String nanoId(int size){
return NanoId.randomNanoId(null,DEFAULT_ALPHABET,size);
} }
public static String getIdFromFromHeader(FromHeader fromHeader) { public static String getIdFromFromHeader(FromHeader fromHeader) {
@ -56,7 +60,7 @@ public class SipUtil {
} }
public static String generateViaTag() { public static String generateViaTag() {
return "z9hG4bK" + RandomStringUtils.randomNumeric(10); return "z9hG4bK" + nanoId(10);
} }
@SneakyThrows @SneakyThrows