Module: UUID7
- Defined in:
- lib/uuid7.rb,
lib/uuid7/version.rb,
lib/uuid7/generator.rb
Overview
UUID v7 Generator
Defined Under Namespace
Modules: Generator
Constant Summary collapse
- VERSION =
"0.2.0"
Class Method Summary collapse
-
.generate(timestamp: Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond)) ⇒ String
Generate a new UUID v7.
Class Method Details
.generate(timestamp: Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond)) ⇒ String
Generate a new UUID v7
20 21 22 |
# File 'lib/uuid7.rb', line 20 def self.generate(timestamp: Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond)) format("%08x-%04x-%04x-%04x-%04x%08x", *Generator.generate()) end |