# File lib/uuid.rb, line 155
155:   def initialize
156:     @drift = 0
157:     @last_clock = (Time.now.to_f * CLOCK_MULTIPLIER).to_i
158:     @mutex = Mutex.new
159: 
160:     if File.exist?(self.class.state_file) then
161:       next_sequence
162:     else
163:       @mac = Mac.addr.gsub(/:|-/, '').hex & 0x7FFFFFFFFFFF
164:       fail "Cannot determine MAC address from any available interface, tried with #{Mac.addr}" if @mac == 0
165:       @sequence = rand 0x10000
166: 
167:       open_lock 'w' do |io|
168:         write_state io
169:       end
170:     end
171:   end