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

package gonanoid

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


Package Files


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



Package gonanoid imports 2 packages (graph) and is imported by 2 packages. Updated 2018-01-09. Refresh now. Tools for package owners.