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 610 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829303132333435
  1. # idgenerator
  2. ##
  3. Goרڣhttps://gitee.com/yitter/idgenerator-go
  4. Go רΪ׼
  5. ## Go
  6. 1.SDKgo1.16
  7. 2. Go-Modules
  8. ```
  9. go env -w GO111MODULE=on
  10. go env -w GOPROXY=https://goproxy.cn,https://goproxy.io,direct
  11. ```
  12. ## Goʾ
  13. ```
  14. var yid = idgen.YitIdHelper{}
  15. fmt.Println(yid.NextId())
  16. // Զ
  17. var options = contract.NewIdGeneratorOptions(1)
  18. //options.WorkerIdBitLength = 6
  19. //options.SeqBitLength = 6
  20. //options.TopOverCostCount = 2000
  21. //options.BaseTime = time.Date(2020, 2, 20, 2, 20, 2, 20, time.UTC).UnixNano() / 1e6
  22. yid.SetIdGenerator(options)
  23. ```

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