nanoid

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 4 Imported by: 0

README

nanoid

Nanoid is a compact, secure, URL-friendly, unique string ID generator for Go.

Getting Started

This package provides a simple and efficient way to generate random IDs. The generated IDs are safe to use in URLs and are unique across all time with a high degree of certainty.

Installation

To use nanoid in your Go project, you need to install it using go get:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {
	Generate() (string, error)
}

func MockGenerator

func MockGenerator(prefix string, length int) Generator

type NanoGenerator

type NanoGenerator struct {
	// contains filtered or unexported fields
}

func CustomGenerator

func CustomGenerator(prefix string, length int, alphabet []byte) (*NanoGenerator, error)

func DefaultGenerator

func DefaultGenerator(prefix string) *NanoGenerator

func (*NanoGenerator) Generate

func (g *NanoGenerator) Generate() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL