uuid64
This is a library generating unique id in short pattern.
- Generate a 64-bit encoded uuid in Ruby with length of 22.
- Generate a 16-bit encoded BSON object_id.
- Generate a 64-bit encoded BSON object_id with length of 16.
Status
Get Started
Install
gem install uuid64
Using Bundler
gem 'uuid64'
How To Use
require 'uuid64'
puts SecureRandom.uuid64 # "Ymu4xVZrRP29PPnixxwoPg"
puts SecureRandom.mongo_id # "57320baec9de9a14d2000000"
puts SecureRandom.mongo_id64 # "VzILtMnemhTSAAAD"
Known Issues
- object_id and object_id64 may conflict when running on same process, multiple threads.