Module: UUIDv7
- Defined in:
- lib/uuidv7.rb,
lib/uuidv7/base62.rb,
lib/uuidv7/version.rb,
lib/uuidv7/generator.rb,
lib/uuidv7/monotonic_generator.rb
Defined Under Namespace
Modules: Base62, Generator, MonotonicGenerator
Classes: Error, InvalidCompactStringError, InvalidUUIDError
Constant Summary
collapse
- VERSION =
'0.1.0'
Class Method Summary
collapse
Class Method Details
.from_compact(compact_string) ⇒ Object
30
31
32
|
# File 'lib/uuidv7.rb', line 30
def from_compact(compact_string)
Base62.decode(compact_string)
end
|
.generate(&clock) ⇒ Object
14
15
16
|
# File 'lib/uuidv7.rb', line 14
def generate(&clock)
Generator.generate(&clock)
end
|
.generate_compact(&clock) ⇒ Object
.timestamp(uuid) ⇒ Object
22
23
24
|
# File 'lib/uuidv7.rb', line 22
def timestamp(uuid)
Generator.timestamp(uuid)
end
|
.to_compact(uuid) ⇒ Object
26
27
28
|
# File 'lib/uuidv7.rb', line 26
def to_compact(uuid)
Base62.encode(uuid)
end
|