/usr/lib/ruby/vendor_ruby/fog/core/uuid.rb is in ruby-fog-core 1.45.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | require "securerandom"
module Fog
class UUID
class << self
def uuid
if supported?
SecureRandom.uuid
else
ary = SecureRandom.random_bytes(16).unpack("NnnnnN")
ary[2] = (ary[2] & 0x0fff) | 0x4000
ary[3] = (ary[3] & 0x3fff) | 0x8000
"%08x-%04x-%04x-%04x-%04x%08x" % ary
end
end
def supported?
SecureRandom.respond_to?(:uuid)
end
end
end
end
|