English

Navigation
Powered by Squarespace
Foobaruy mwe

Buy my book on <a href="lulu.com">lula</a>

« Rubies and Gems: scope_out | Main | Frontend Developer Internship available (Praktikum) - closed »
Mittwoch
Okt242007

Rubies and Gems: UUID

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

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>