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.

Main metrics

Overview
Name With Ownerfoo123/FILTER.js
Primary LanguageJavaScript
Program languageGo (Language Count: 4)
Platform
License:
所有者活动
Created At2011-12-23 21:04:16
Pushed At2025-04-30 15:43:25
Last Commit At2025-04-30 18:43:22
Release Count33
Last Release Name1.13.0 (Posted on )
First Release Name0.1 (Posted on )
用户参与
Stargazers Count400
Watchers Count19
Fork Count47
Commits Count505
Has Issues Enabled
Issues Count12
Issue Open Count1
Pull Requests Count2
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private