Sha256: 6f87f2bfcb504cc9b55aae1aeefb767a511486ac93ee0479016b2d1af48f09aa
Contents?: true
Size: 458 Bytes
Versions: 42
Compression:
Stored size: 458 Bytes
Contents
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
Version data entries
42 entries across 42 versions & 3 rubygems