Ruby
Latest commit 49e7e0a Jan 20, 2014 @natemueller natemueller Merge pull request #14 from retailnext/fix_encoding
Fix crash newing up from frozen bytes.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
CHANGELOG
LICENSE
Manifest
README.rdoc
Rakefile
simple_uuid.gemspec

README.rdoc

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.