Pure MoonBit 4-target RFC 9562 UUIDv7, Crockford ULID, and Snowflake ID generators for unmbt/ciallo
impl ToSqlValue for Snowflakepub struct SnowflakeGenerator {
worker_id : Int
epoch_ms : Int64
now_ms : () -> Int64
last_ms : Int64
seq : Int
}fn SnowflakeGenerator::SnowflakeGenerator(worker_id~ : Int, now_ms~ : () -> Int64, epoch_ms? : Int64) -> SnowflakeGenerator raise IdErrorpub struct UlidGenerator {
now_ms : () -> Int64
last_ms : Int64
last_rand : FixedArray[Byte]
rng_state : UInt64
}impl ToSqlValue for Uuidpub struct UuidV7Generator {
now_ms : () -> Int64
last_ms : Int64
seq : Int
rng_state : UInt64
}let default_snowflake_epoch_ms : Int64Install
Download zipPure MoonBit 4-target RFC 9562 UUIDv7, Crockford ULID, and Snowflake ID generators for unmbt/ciallo