Go Nanoid Save

Golang random IDs generator.

Project README

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.

There's also this alternative: https://github.com/jaevor/go-nanoid.

Install

Via go get tool

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

Usage

Generate ID

id, err := gonanoid.New()

Generate ID with a custom alphabet and length

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

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.

Open Source Agenda is not affiliated with "Go Nanoid" Project. README Source: matoous/go-nanoid
Stars
1,080
Open Issues
8
Last Commit
1 month ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating