Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultAlphabet = "23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
DefaultAlphabet is the default alphabet used.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ShortUUID ¶
type ShortUUID struct {
// contains filtered or unexported fields
}
ShortUUID represents a short UUID encoder.
func NewWithAlphabet ¶
NewWithAlphabet returns a new (short) UUID using alphabet. The alphabet will be sorted and if it contains duplicate characters, they will be removed.
func (*ShortUUID) Decode ¶
Decode decodes a string according to the alphabet into a uuid.UUID. If s is too short, its most significant bits (MSB) will be padded with 0 (zero).
func (*ShortUUID) Encode ¶
Encode encodes uuid.UUID into a string using the least significant bits (LSB) first according to the alphabet. if the most significant bits (MSB) are 0, the string might be shorter.
Click to show internal directories.
Click to hide internal directories.