package
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Aug 15, 2025
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
miniid

miniid
generates ID encoded in base62.
Features
- Simple API.
- Clean and tested code.
- Dependency-free.
Install
Go version 1.20+
go get github.com/cristalhq/miniid
Example
gen := miniid.New(1200)
for i := 0; i < 10; i++ {
fmt.Print(gen.Next(), " ")
}
fmt.Println()
// Output:
// JN JO JP JQ JR JS JT JU JV JW
Also see examples: example_test.go.
Documentation
See these docs.
License
MIT License.
Documentation
¶
package main
import (
"fmt"
"github.com/cristalhq/miniid"
)
func main() {
gen := miniid.New(1200)
for i := 0; i < 10; i++ {
fmt.Print(gen.Next(), " ")
}
fmt.Println()
}
Output:
JN JO JP JQ JR JS JT JU JV JW
type Generator struct {
}
Generator can encode integers into base62 strings.
NewGenerator creates a new generator using the provided init number.
Next returns a next ID in base62.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.