Skip to content

Instantly share code, notes, and snippets.

@jmcarbo
Created February 12, 2010 12:51
Show Gist options
  • Save jmcarbo/302530 to your computer and use it in GitHub Desktop.
Save jmcarbo/302530 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'uuid'
# import random
mac = [ 0x00, 0x16, 0x3e,
rand(0x7f),
rand(0xff),
rand(0xff) ]
puts mac.map{|a| sprintf("%02x", a).upcase}.join(':')
puts UUID.new.generate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment