Skip to content

Instantly share code, notes, and snippets.

@patrickread
Created January 22, 2015 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickread/1b320927513866f71149 to your computer and use it in GitHub Desktop.
Save patrickread/1b320927513866f71149 to your computer and use it in GitHub Desktop.
Random MAC Address
def random_mac_address
hex_list = '0123456789ABCDEF'.split(//)
mac = ""
for i in 0..16
if i % 3 == 2
mac += ':'
else
mac += hex_list.sample
end
end
mac
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment