Method: LexicalUUID#to_guid
- Defined in:
- lib/lexical_uuid.rb
#to_guid ⇒ Object
Also borrowed from simple_uuid
56 57 58 59 60 61 |
# File 'lib/lexical_uuid.rb', line 56 def to_guid elements = to_bytes.unpack("NnnCCa6") node = elements[-1].unpack('C*') elements[-1] = '%02x%02x%02x%02x%02x%02x' % node "%08x-%04x-%04x-%02x%02x-%s" % elements end |