Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/matoous/go-nanoid
/ functions
Functions
11 in github.com/matoous/go-nanoid
⨍
Functions
11
◇
Types & classes
0
↓ 2 callers
Function
New
New generates secure URL-friendly unique ID. Accepts optional parameter - length of the ID to be generated (21 by default).
gonanoid.go:76
↓ 1 callers
Function
Generate
Generate is a low-level function to change alphabet and ID size.
gonanoid.go:29
↓ 1 callers
Function
Must
Must is the same as New but panics on error.
gonanoid.go:102
↓ 1 callers
Function
MustGenerate
MustGenerate is the same as Generate but panics on error.
gonanoid.go:66
↓ 1 callers
Function
getMask
getMask generates bit mask used to obtain bits from the random bytes that are used to get index of random character from the alphabet. Example: if the
gonanoid.go:18
Function
BenchmarkNanoid
Benchmark nanoid generator
gonanoid_internal_test.go:37
Function
TestFlatDistribution
(t *testing.T)
gonanoid_internal_test.go:19
Function
TestGenerate
(t *testing.T)
gonanoid_test.go:13
Function
TestHasNoCollisions
(t *testing.T)
gonanoid_internal_test.go:9
Function
TestNew
(t *testing.T)
gonanoid_test.go:52
Function
main
()
examples/simple_example.go:9