Registry / utility / speps-go-hashids

speps-go-hashids

JSON →
library2.0.0+incompatiblegogounverified

Package hashids generates short, unique, non-sequential ids from numbers using the Hashids algorithm.

go get github.com/speps/go-hashids
INSTALL
IMPORT
SIG · SPEPS-GO-HASHIDS
S
speps-go-hashids
utilitygov2.0.0+incompatible
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

hashids
github.com/speps/go-hashids

Encode a list of integers into a Hashid string.

package main import ( "fmt" "github.com/speps/go-hashids" ) func main() { hd := hashids.NewData() hd.Salt = "my salt" h, _ := hashids.NewWithData(hd) id, _ := h.Encode([]int{1, 2, 3}) fmt.Println(id) }
Debug
Known issues
breakingVersion 2.0.0+incompatible uses a different API than v1; the NewWithData function replaces the old constructor.
fix
Use hashids.NewWithData(hashids.NewData()) instead of hashids.New() if migrating from v1.
affects: >=2.0.0
Upgrade
Version history
2.0.0+incompatiblelatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
speps-go-hashids — go get speps-go-hashids · libregistry