go-nanoid: github.com/matoous/go-nanoid Index | Files | Directories

package gonanoid

import "github.com/matoous/go-nanoid"

Index

Package Files

gonanoid.go

func Generate Uses

func Generate(rawAlphabet string, size int) (string, error)

Generate is a low-level function to change alphabet and ID size.

func ID Uses

func ID(l int) (string, error)

ID provides more golang idiomatic interface for generating IDs. Calling ID is shorter yet still clear `gonanoid.ID(20)` and it requires the lengths parameter by default.

func Nanoid Uses

func Nanoid(param ...int) (string, error)

Nanoid generates secure URL-friendly unique ID.

type Generator Uses

type Generator func([]byte) (int, error)

Generator function

var BytesGenerator Generator = rand.Read

BytesGenerator is the default bytes generator

Directories

PathSynopsis
examples

Package gonanoid imports 4 packages (graph) and is imported by 17 packages. Updated 2020-05-18. Refresh now. Tools for package owners.