added formatter
parent
593179c243
commit
2df4da7899
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue