aboutsummaryrefslogtreecommitdiff
path: root/basetypes
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-01-22 01:10:10 +0100
committerLinnea Gräf <nea@nea.moe>2025-01-22 01:10:10 +0100
commit6f148df84dfe5d0d0d1c6a0614f86e374fc8d1aa (patch)
tree1a49a6aeb9e7f901ede729f1fed9d1d230dadc87 /basetypes
parent550441921eed03b88ec94bea10deb1c45ef6e17b (diff)
downloadLocalTransactionLedger-6f148df84dfe5d0d0d1c6a0614f86e374fc8d1aa.tar.gz
LocalTransactionLedger-6f148df84dfe5d0d0d1c6a0614f86e374fc8d1aa.tar.bz2
LocalTransactionLedger-6f148df84dfe5d0d0d1c6a0614f86e374fc8d1aa.zip
feat(server): Add first analysis
Diffstat (limited to 'basetypes')
-rw-r--r--basetypes/src/main/kotlin/moe/nea/ledger/utils/ULIDWrapper.kt8
1 files changed, 8 insertions, 0 deletions
diff --git a/basetypes/src/main/kotlin/moe/nea/ledger/utils/ULIDWrapper.kt b/basetypes/src/main/kotlin/moe/nea/ledger/utils/ULIDWrapper.kt
index b8c5d3b..29d5e31 100644
--- a/basetypes/src/main/kotlin/moe/nea/ledger/utils/ULIDWrapper.kt
+++ b/basetypes/src/main/kotlin/moe/nea/ledger/utils/ULIDWrapper.kt
@@ -9,6 +9,14 @@ value class ULIDWrapper(
val wrapped: String
) {
companion object {
+ fun lowerBound(timestamp: Instant): ULIDWrapper {
+ return ULIDWrapper(ULID.generate(timestamp.toEpochMilli(), ByteArray(10)))
+ }
+
+ fun upperBound(timestamp: Instant): ULIDWrapper {
+ return ULIDWrapper(ULID.generate(timestamp.toEpochMilli(), ByteArray(10) { -1 }))
+ }
+
fun createULIDAt(timestamp: Instant): ULIDWrapper {
return ULIDWrapper(ULID.generate(
timestamp.toEpochMilli(),