added formatter

master
Alex 2022-04-06 21:39:43 +02:00
parent 593179c243
commit 2df4da7899
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
package earth.krakatoa.core.util;
import java.math.BigInteger;
import java.util.UUID;
public class Formatter {
public String formatUuid(String uuid) {
return uuid.replaceAll("-", "");
}
public UUID stringToUuid(String s) {
BigInteger bigInteger = new BigInteger(s.substring(0, 16), 16);
BigInteger bigInteger1 = new BigInteger(s.substring(16, 32), 16);
return new UUID(bigInteger.longValue(), bigInteger1.longValue());
}
}