Home > OS >  A unique ID, snowflake how to solve the time back to dial (UUID, snowflake, Uni - Generator))
A unique ID, snowflake how to solve the time back to dial (UUID, snowflake, Uni - Generator))

Time:11-16

Lightweight, in addition to the basic C/C + + library that does not rely on a third party, the Linux + arm platform,
Consider only use single now, do not consider distributed, (uni - generator requires a third party, UUID mainly distributed, snowflake will be a time back issues),

Simple explanation:
Single c/c + + programs generated exe, 1 running exe, and then exit the frequent operation, quit, hope every run, simple internal c/c + + code to generate a unique id
2 at the same time run multiple same exe, every internal generate a unique id


Snowflake is simple, just time to dial is very easy to operate, easy to cause id, whether can get other content from the system, each run exe exe inside to add some code to generate a unique id