DarthSim 2e6296c4d9 Go go mod il y a 6 ans
..
.gitignore 2e6296c4d9 Go go mod il y a 6 ans
.travis.yml 2e6296c4d9 Go go mod il y a 6 ans
LICENSE 92c91dfd54 Update dependencies il y a 7 ans
README.md 2e6296c4d9 Go go mod il y a 6 ans
go.mod 2e6296c4d9 Go go mod il y a 6 ans
gonanoid.go 69505cb6d2 Update vendored packages il y a 7 ans

README.md

Go Nanoid

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.