aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/uuid.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/util/uuid.kt')
-rw-r--r--src/main/kotlin/util/uuid.kt12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/kotlin/util/uuid.kt b/src/main/kotlin/util/uuid.kt
new file mode 100644
index 0000000..4aa0749
--- /dev/null
+++ b/src/main/kotlin/util/uuid.kt
@@ -0,0 +1,12 @@
+
+
+package moe.nea.firmament.util
+
+import java.math.BigInteger
+import java.util.UUID
+
+fun parseDashlessUUID(dashlessUuid: String): UUID {
+ val most = BigInteger(dashlessUuid.substring(0, 16), 16)
+ val least = BigInteger(dashlessUuid.substring(16, 32), 16)
+ return UUID(most.toLong(), least.toLong())
+}