https://github.com/goapt/gencode
Generate unique code
https://github.com/goapt/gencode
Last synced: 9 months ago
JSON representation
Generate unique code
- Host: GitHub
- URL: https://github.com/goapt/gencode
- Owner: goapt
- License: mit
- Created: 2019-03-13T05:31:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-26T03:58:50.000Z (about 6 years ago)
- Last Synced: 2024-06-21T03:15:13.354Z (over 1 year ago)
- Language: Go
- Size: 15.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gencode
Generate unique code
同一秒内生成10W个不重复的,无规则的16位纯数字编码,并且当一秒内生成超过10W个编码,程序会阻塞1秒之后再次生产编码
```
import "github.com/goapt/gencode"
func main(){
manager := gencode.New("", "20180919",false)
code := manager.Get()
fmt.Println(code)
c, err := manager.Verify(code)
fmt.Println(c, err)
}
```