package
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Nov 22, 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, base64 encoded.
160 bit is better than uid v4 (122 bit) and is OWASP-compatible (>= 128 bit)
install
go get github.com/dmasior/smartid
usage
id := smartid.MustNew()
fmt.Println(id.String())
// Prints: 9z4Q7WaUmzQetcj8CCWcKITTg3w
Documentation

View GoDocs: https://pkg.go.dev/github.com/dmasior/smartid
Documentation
¶
MustNewString creates new SmartID and returns it as string or panics.
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.
id := MustNew()
fmt.Println(id.String())
String returns string from SmartID
Source Files
¶
Click to show internal directories.
Click to hide internal directories.