Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Version is the version number of the library Version string = "1.0.0" // DefaultAlphabet is the default alphabet used by go-hashids DefaultAlphabet string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashID ¶
type HashID struct {
// contains filtered or unexported fields
}
HashID contains everything needed to encode/decode hashids
func NewWithData ¶
func NewWithData(data *HashIDData) *HashID
NewWithData creates a new HashID with the provided HashIDData
type HashIDData ¶
type HashIDData struct { // Alphabet is the alphabet used to generate new ids Alphabet string // MinLength is the minimum length of a generated id MinLength int // Salt is the secret used to make the generated id harder to guess Salt string }
HashIDData contains the information needed to generate hashids
func NewData ¶
func NewData() *HashIDData
NewData creates a new HashIDData with the DefaultAlphabet already set.
Click to show internal directories.
Click to hide internal directories.