diff options
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util/uuid.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/uuid.kt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/uuid.kt b/src/main/kotlin/moe/nea/firmament/util/uuid.kt new file mode 100644 index 0000000..d5409fa --- /dev/null +++ b/src/main/kotlin/moe/nea/firmament/util/uuid.kt @@ -0,0 +1,10 @@ +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()) +} |