Mittwoch
Okt242007
Rubies and Gems: UUID
Mittwoch, Oktober 24, 2007 at 10:18AM
Often your application needs some form of UUID. For example for "Secret URLs" or Persistent Logins. I found the uuidtools to be very useful for this task. It allows you to create various forms of UUIDs (i.e. MD5, SHA1, Timestamp or Random).
Get the gem [code]sudo gem install uuidtools[/code]
And generate UUIDs[ruby]UUID.random_create.to_s
UUID.timestamp_create.to_s
[/ruby]
and thats all there is about it.
Resources:
RFC 4122
uuidtools API
Get the gem [code]sudo gem install uuidtools[/code]
And generate UUIDs[ruby]UUID.random_create.to_s
UUID.timestamp_create.to_s
[/ruby]
and thats all there is about it.
Resources:
RFC 4122
uuidtools API


Reader Comments