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(alphabet string, size int) (string, error)

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

func Nanoid Uses

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

Nanoid generates secure URL-friendly unique ID.

func Random Uses

func Random(size int) ([]byte, error)

Random generates cryptographically strong pseudo-random data. The size argument is a number indicating the number of bytes to generate.

type DefaultsType Uses

type DefaultsType struct {
    Alphabet string
    Size     int
    MaskSize int
}

DefaultsType is the type of the default configuration for Nanoid

func GetDefaults Uses

func GetDefaults() *DefaultsType

GetDefaults returns the default configuration for Nanoid

Directories

PathSynopsis
examples

Package gonanoid imports 3 packages (graph) and is imported by 1 packages. Updated 2017-09-21. Refresh now. Tools for package owners.