Skip to content

heckpsi-lab/uuid64

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uuid64

This is a library generating unique id in short pattern.

  1. Generate a 64-bit encoded uuid in Ruby with length of 22.
  2. Generate a 16-bit encoded BSON object_id.
  3. Generate a 64-bit encoded BSON object_id with length of 16.

Status

Gem Version

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.

About

This is a library generating unique id in short pattern.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages