go-nanoid

Go implementation of ai's nanoid

Go Nanoid

Build Status
Build Status
GoDoc
Go Report Card
GitHub issues
License

This package is Go implementation of ai's nanoid!

Safe. It uses cryptographically strong random generator.

Compact. It uses more symbols than UUID (A-Za-z0-9_-)
and has the same number of unique options in just 22 symbols instead of 36.

Fast. Nanoid is as fast as UUID but can be used in URLs.

Install

Via go get tool

$ go get github.com/matoous/go-nanoid

Usage

Generate ID

id, err := gonanoid.Nanoid()

Generate ID with custom alphabet and length

id, err := gonanoid.Generate("abcde", 54)

Testing

$ go test

Notice

If you use Go Nanoid in your project, please let me know!

If you have any issues, just feel free and open it in this repository, thanks!

Credits

License

The MIT License (MIT). Please see License File for more information.

主要指标

概览
名称与所有者foo123/FILTER.js
主编程语言JavaScript
编程语言Go (语言数: 4)
平台
许可证
所有者活动
创建于2011-12-23 21:04:16
推送于2025-04-30 15:43:25
最后一次提交2025-04-30 18:43:22
发布数33
最新版本名称1.13.0 (发布于 )
第一版名称0.1 (发布于 )
用户参与
星数400
关注者数19
派生数47
提交数505
已启用问题?
问题数12
打开的问题数1
拉请求数2
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?