Skip to content

URL safe base64 encoded unique ID generator using "crypto/rand".

License

Notifications You must be signed in to change notification settings

neptulon/shortid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Short ID

Build Status GoDoc

URL-Safe Base64 encoded (unpadded) unique ID generator using "crypto/rand".

You can generate:

  • Crypto-safe IDs of custom length.
  • UUID v4 (128 bit) in short ID form.

Example

import (
	"github.com/neptulon/shortid"
)

func main() {
	// short ID with a custom (64 bits) length
	id, err := shortid.ID(64)
	// id: XOga_Cq2h-8

	// standard UUID (128 bits) in short ID form
	uuid, err := shortid.UUID()
	// uuid: gK_qBTwDH5i31evhbD-Wvw
}

License

MIT

About

URL safe base64 encoded unique ID generator using "crypto/rand".

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages