• Stars
    star
    120
  • Rank 295,983 (Top 6 %)
  • Language
    Ruby
  • License
    Other
  • Created almost 15 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple uuid library for ruby

simple_uuidยถ โ†‘

Simple, scalable UUID generation.

Licenseยถ โ†‘

Copyright 2009-2010 Twitter, Inc. See included LICENSE file.

Featuresยถ โ†‘

  • pure-Ruby

  • no MAC address scraping

  • no file-based locking

This library implements UUID format version 1, as specified in RFC 4122, with jitter in place of the mac address and sequence counter.

Installationยถ โ†‘

Install the gem:

sudo gem install simple_uuid

Usageยถ โ†‘

# Creating and getting a timestamp from the UUID
uuid = SimpleUUID::UUID.new => <UUID#2278170300  .... >
uuid.to_time => Thu Aug 18 19:15:16 -0400 2011

# Given raw bytes from a source such as cassandra (using bytes from an existing UUID as an example)
bytes = SimpleUUID::UUID.new.bytes
SimpleUUID::UUID.to_time(bytes) => Thu Aug 18 19:15:16 -0400 2011

Reporting problemsยถ โ†‘

The support forum is here.

Patches and contributions are very welcome.