diff options
author | Linnea Gräf <nea@nea.moe> | 2024-12-08 03:42:07 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-12-08 03:42:07 +0100 |
commit | ef11dd51a61d25bc8722cc844358869b00a5369c (patch) | |
tree | 8545e3e1724bb08dba316dd26b0d5edd9918a6e8 /src/main/kotlin/moe/nea/ledger/UUIDUtil.kt | |
parent | fa72dd4ce107190cda7bc56234fed650f20e3aa9 (diff) | |
download | LocalTransactionLedger-ef11dd51a61d25bc8722cc844358869b00a5369c.tar.gz LocalTransactionLedger-ef11dd51a61d25bc8722cc844358869b00a5369c.tar.bz2 LocalTransactionLedger-ef11dd51a61d25bc8722cc844358869b00a5369c.zip |
feat: Add query command
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/UUIDUtil.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/ledger/UUIDUtil.kt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/UUIDUtil.kt b/src/main/kotlin/moe/nea/ledger/UUIDUtil.kt index ddfb8c2..5549908 100644 --- a/src/main/kotlin/moe/nea/ledger/UUIDUtil.kt +++ b/src/main/kotlin/moe/nea/ledger/UUIDUtil.kt @@ -12,6 +12,10 @@ object UUIDUtil { value class ULIDWrapper( val wrapped: String ) { + fun getTimestamp(): Instant { + return Instant.ofEpochMilli(ULID.getTimestamp(wrapped)) + } + init { require(ULID.isValid(wrapped)) } |