Skip to content

KingkongWang/lua-resty-snowflake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lua-resty-snowflake (snowflake算法在OpenResty下的实现)

  • 将lib中文件复制到lualib目录相同文件夹下

  • make命令生成libsnowflake.so

  • 添加lua代码:

  local snowflake = require "resty.snowflake"  
  local worker_id = 1
  local datacenter_id = 1
  local sf = snowflake:new(worker_id, datacenter_id)
  local next_id = sf:next_id()

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published