StaticUid

Generates static and readable UIDs for a fixed size of input integers

Installation

Add this line to your application's Gemfile:

gem 'static_uid'

And then execute:

$ bundle

Or install it yourself as:

$ gem install static_uid

Usage

Require the correct generator based on the amount of UIDs it should be capable of:

require 'static_uid/million'

StaticUid::Million.generate(3826) #=> "ab5U"

The lookup-table is lazy loaded, so the first lookup is a bit slower.

Preload the lookup-table this way:

StaticUid::Million.fetch_lookup_table

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request