snowflake4cj 是一个基于 Cangjie 的雪花算法实现。
snowflake4cj is a snowflake algorithm implementation based on Cangjie.
# In the `dependencies` section of `cjpm.toml`
snowflake4cj = { git = "https://github.com/gtn1024/snowflake4cj.git", tag = "1.1.0" }
import snowflake4cj.Snowflake
main(): Int64 {
let snowflake = Snowflake(0, 0)
for (i in 0..1000) {
let id = snowflake.nextId()
println(id)
}
return 0
}
欢迎加入 仓颉交流群(非官方):985038695