1.pip安装
pip3 install pysnowflake
2.启动服务
nohup snowflake_start_server --address=127.0.0.1 --port=8910 --dc=1 --worker=1 --log_file_prefix=/tmp/pysnowflask.log>/dev/null &
3.调用雪花算法
import snowflake.client
def get_snowflake_uuid():
guid = snowflake.client.get_guid()
return guid
get_snowflake_uuid()