Sha256: 920ca73bf47eaabda31a0ae0ec9ebe4eb0a3073969ce3f2da07069d4c7c35411
Contents?: true
Size: 365 Bytes
Versions: 10
Compression:
Stored size: 365 Bytes
Contents
class UUID4 module Formatter class Compact REGEXP = /^[\da-f]{12}[1-5][\da-f]{3}[89ab][\da-f]{15}$/i FORMAT = '%032x'.freeze def encode(uuid) FORMAT % uuid.to_int end def decode(value) if value.respond_to?(:to_str) && (value = value.to_str) =~ REGEXP value.hex end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems