package
module
Version:
v0.1.1
Opens a new window with list of versions in this module.
Published: Nov 23, 2022
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
smartid 
The smartid package generates URL-friendly 160 bit (20 byte) random identifiers.
install
go get github.com/dmasior/smartid
usage
// import lib
import "github.com/dmasior/smartid"
// use
id := smartid.MustNew()
fmt.Println(id.String())
// print example: 9z4Q7WaUmzQetcj8CCWcKITTg3w
Documentation

View GoDocs: https://pkg.go.dev/github.com/dmasior/smartid
Documentation
¶
id := MustNew()
fmt.Println(id.String())
MustNewString creates new SmartID and returns it as string or panics.
MustNewString is equivalent of:
smartid.Must(smartid.New()).String()
A SmartID has size of 27 bytes which is encoded size of a 160 bit (20 byte) random identifier.
Must returns SmartID if err is nil and panics otherwise.
MustNew creates new SmartID or panics.
MustNew is equivalent of:
smartid.Must(smartid.New())
String returns string from SmartID
Source Files
¶
Click to show internal directories.
Click to hide internal directories.