module Uniqid

ID uniform generation rules, using SnowFlake algorithm, composed of 64 bits | 40 bits: Timestamp (millisecond) | 9 bits: WORKER_ID | 6 bits: SERVER_ID | 2 bits: reserved | 7 bits: serial number| VERSION = 1.0.0, Release: 2018-03-08 Usage: Gemfile => gem 'uniqid' Commandline => $ bundle install ApplicationRecord => include Uniqid before the object of model being created => UniqID.generate(worker_id, server_id)

Constants

VERSION

Public Class Methods

included(klass) click to toggle source
# File lib/uniqid.rb, line 16
def self.included(klass)
  klass.extend ClassMethods
end