Skip to content
This repository was archived by the owner on Sep 15, 2023. It is now read-only.

dmasior/smartid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smartid CI Go Report Card

The smartid package generates URL and filename safe 160 bit (20 byte) random IDs using URL and Filename safe alphabet [RFC].

Fast and safe. Based on stdlib crypto/rand. No external depdendencies required.

Documentation

GoDoc

Full go doc: https://pkg.go.dev/github.com/dmasior/smartid

install
go get github.com/dmasior/smartid
usage
import
import "github.com/dmasior/smartid"
New()
id, err := smartid.New()
if err != nil {
    // handle err
}

fmt.Println(id.String())

// print example: 9z4Q7WaUmzQetcj8CCWcKITTg3w
MustNew()
id := smartid.MustNew()

fmt.Println(id.String())

// print example: oJemcLfABvB4buGAdXiKd2TJFiE
MustNewString()
id := smartid.MustNewString()

fmt.Println(id)

// print example: KkdpotMGjcJoBFrDtltifuIDw38

About

URL and Filename friendly random ID generator

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages