class BSON::Binary
def from_uuid_old_to_java_legacy_uuid(hex)
-
(String)
- the java-legacy-formatted UUID
Parameters:
-
hex
(String
) -- The hexadecimal string to convert
def from_uuid_old_to_java_legacy_uuid(hex) hex.sub(/\A(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)\z/) do (::Regexp.last_match[1..8].reverse + ::Regexp.last_match[9..16].reverse).join end end