Distributed UUID Generation

Distributed UUID Generation

Can be used for unique ID generation, applicable to short link generation.

Twitter SnowFlake ID Generator to Short Links

  1. Generate a 64-bit ID that can be stored exactly as a long integer, composed of: 0 - 41 bits timestamp - 5 bits data center identifier - 5 bits machine identifier - 12 bits sequence number
  2. Then perform base-62 encoding, this base-62 includes uppercase and lowercase letters of 26 alphabets plus 10 digits from 0 to 9, which achieves the purpose of size reduction.