jaevor / go-nanoid Goto Github PK
View Code? Open in Web Editor NEWNano ID for Go
Home Page: https://pkg.go.dev/github.com/jaevor/go-nanoid
License: GNU General Public License v3.0
Nano ID for Go
Home Page: https://pkg.go.dev/github.com/jaevor/go-nanoid
License: GNU General Public License v3.0
Can you comment on what major version of nanoid this library is based on? Their current library is at v4.
What are the advantages against matoous? Any benchmark improvement vs that library?
Would be nice to have MustCompile option like regex module.
Example with init()
var newNanoId func() string
func init() {
var err error
newNanoId, err = nanoid.CustomASCII("0123456789abcdefghijklmnopqrstuvxyz", 4)
if err != nil {
panic("nanoid: " + err.Error())
}
}
This would be nicer
var newNanoId = nanoid.MustCompileCustomASCII("0123456789abcdefghijklmnopqrstuvxyz", 4)
I was wondering if it made sense to create a nanoid.StandardCanonical()
method (with no parameters) in order to avoid having to remember that 21
is the canonic length every time.
In other words, whoever wants a canonic generator could choose one between:
nanoid.Standard(21)
or
nanoid.StandardCanonic()
Reading this function I noticed you use sync,Mutex to lock a variable, however you are not using any go routine, so my question is about the purpose of this?
https://github.com/jaevor/go-nanoid/blob/master/nanoid.go#L84C9-L84C19
Some times I'm getting this panic on nanoid use.
github.com/jaevor/go-nanoid.ASCII.func1()
/Users/deferbot/go/pkg/mod/github.com/jaevor/[email protected]/nanoid.go:269 +0x1f0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.