DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Generate A UUID With UUIDTools In Ruby1.9.1

  • submit to reddit
        Source: <a href="">Generate a UUID with UUIDTools</a> []

sudo gem1.9.1 install uuidtools

Successfully installed uuidtools-2.1.1
1 gem installed

require 'uuidtools'
#=> true
UUIDTools::UUID.md5_create(UUIDTools::UUID_DNS_NAMESPACE, "")
#=> #<UUID:0x5262112 UUID:3d813cbb-47fb-32ba-91df-831e1593ac29>