Browse Source

update: readme

pull/19/MERGE
koukouchan 2 years ago
parent
commit
caeabb1029
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      Python/README.md

+ 3
- 3
Python/README.md View File

@@ -11,11 +11,11 @@ Python 3.6+
```python
# 导入包
from source import options,generator
from source import Options,Generator
# 声明id生成器参数,需要自己构建一个workerId
options = options.IdGeneratorOptions(workerId=23)
options = Options.IdGeneratorOptions(workerId=23)
# 参数中,WorkerIdBitLength 默认值6,支持的 WorkerId 最大值为2^6-1,若 WorkerId 超过64,可设置更大的 WorkerIdBitLength
idgen = generator.DefaultIdGenerator()
idgen = Generator.DefaultIdGenerator()
# 保存参数
idgen.SetIdGernerator(options)
# 生成id


Loading…
Cancel
Save