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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request