You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 686 B

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132
  1. ## л
  2. JDK 1.8+
  3. ## maven
  4. ```
  5. <dependency>
  6. <groupId>com.github.yitter</groupId>
  7. <artifactId>yitter-idgenerator</artifactId>
  8. <version>1.0.2</version>
  9. </dependency>
  10. ```
  11. ## ʾ
  12. ```
  13. // ȫֳʼWorkerIdĬ2^16-1ʼȫֻһΣұã
  14. IdGeneratorOptions options = new IdGeneratorOptions();
  15. options.WorkerId = 1;
  16. YitIdHelper.setIdGenerator(options);
  17. // ʼԺ󣬾ͿҪĵط÷ID
  18. long newId = YitIdHelper.nextId();
  19. ```
  20. DIܼɣԲο YitIdHelper ȥ IdGenerator 󣬱ʹ****ģʽ
  21. ## options Ĭֵ˵
  22. οԴ룺/contract/IdGeneratorOptions.java

雪花算法中非常好用的数字ID生成器