Skip to content
This repository has been archived by the owner on Sep 28, 2019. It is now read-only.
/ go-shortid Public archive

Short id generator. Url-friendly. Non-predictable. Cluster-compatible.

License

Notifications You must be signed in to change notification settings

skahack/go-shortid

Repository files navigation

ShortId

Build Status

Port of dylang/shortid to Go

Usage

package main

import(
  "github.com/SKAhack/go-shortid"
)

func main() {
  g := shortid.Generator()
  g.Generate() // => 9uK7FCrIm
}

Example

$ ./example
HJpRDHKIP
JJBjvDJ5IQ
HHLZUC9hVP
JuQpRCJhVg
u91ZUCJhIm
u9np_ru5SQ
9HV6UCH5Vg
99_Z_D9hVP
9HsZ_rJKVg
JJOpvDH5Vg

API

See: dylang/shortid

Initialize

  g := shortid.Generator()

Generate()

generate a new ShortId

  g.Generate() // => JJOpvDH5Vg

SetSeed(float64)

  g.SetSeed(1)

License

MIT

About

Short id generator. Url-friendly. Non-predictable. Cluster-compatible.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages