Documentation
¶
Overview ¶
Uuid25: 25-digit case-insensitive UUID encoding
Uuid25 is an alternative UUID representation that shortens a UUID string to just 25 digits using the case-insensitive Base36 encoding. This library provides functionality to convert from the conventional UUID formats to Uuid25 and vice versa.
Index ¶
- type Uuid25
- func FromBytes(uuidBytes []byte) Uuid25
- func Parse(uuidString string) (Uuid25, error)
- func ParseBraced(uuidString string) (Uuid25, error)
- func ParseHex(uuidString string) (Uuid25, error)
- func ParseHyphenated(uuidString string) (Uuid25, error)
- func ParseUrn(uuidString string) (Uuid25, error)
- func ParseUuid25(uuidString string) (Uuid25, error)
- func (uuid25 Uuid25) MarshalBinary() (data []byte, err error)
- func (uuid25 Uuid25) MarshalText() (text []byte, err error)
- func (uuid25 *Uuid25) Scan(src any) error
- func (uuid25 Uuid25) String() string
- func (uuid25 Uuid25) ToBraced() string
- func (uuid25 Uuid25) ToBytes() [16]byte
- func (uuid25 Uuid25) ToHex() string
- func (uuid25 Uuid25) ToHyphenated() string
- func (uuid25 Uuid25) ToUrn() string
- func (uuid25 *Uuid25) UnmarshalBinary(data []byte) error
- func (uuid25 *Uuid25) UnmarshalText(text []byte) error
- func (uuid25 Uuid25) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Uuid25 ¶
type Uuid25 string
The primary value type containing the Uuid25 representation of a UUID.
A valid value of this type must be constructed through FromBytes() or one of Parse*() functions.
func Parse ¶
Creates an instance from a UUID string representation.
This method accepts the following formats:
- 25-digit Base36 Uuid25 format: `3ud3gtvgolimgu9lah6aie99o`
- 32-digit hexadecimal format without hyphens: `40eb9860cf3e45e2a90eb82236ac806c`
- 8-4-4-4-12 hyphenated format: `40eb9860-cf3e-45e2-a90e-b82236ac806c`
- Hyphenated format with surrounding braces: `{40eb9860-cf3e-45e2-a90e-b82236ac806c}`
- RFC 4122 URN format: `urn:uuid:40eb9860-cf3e-45e2-a90e-b82236ac806c`
func ParseBraced ¶
Creates an instance from the hyphenated format with surrounding braces: `{40eb9860-cf3e-45e2-a90e-b82236ac806c}`.
func ParseHex ¶
Creates an instance from the 32-digit hexadecimal format without hyphens: `40eb9860cf3e45e2a90eb82236ac806c`.
func ParseHyphenated ¶
Creates an instance from the 8-4-4-4-12 hyphenated format: `40eb9860-cf3e-45e2-a90e-b82236ac806c`.
func ParseUrn ¶
Creates an instance from the RFC 4122 URN format: `urn:uuid:40eb9860-cf3e-45e2-a90e-b82236ac806c`.
func ParseUuid25 ¶
Creates an instance from the 25-digit Base36 Uuid25 format: `3ud3gtvgolimgu9lah6aie99o`.
func (Uuid25) MarshalBinary ¶
Implements the encoding.BinaryMarshaler interface.
func (Uuid25) MarshalText ¶
Implements the encoding.TextMarshaler interface.
func (Uuid25) ToBraced ¶
Formats this type in the hyphenated format with surrounding braces: `{40eb9860-cf3e-45e2-a90e-b82236ac806c}`.
func (Uuid25) ToHex ¶
Formats this type in the 32-digit hexadecimal format without hyphens: `40eb9860cf3e45e2a90eb82236ac806c`.
func (Uuid25) ToHyphenated ¶
Formats this type in the 8-4-4-4-12 hyphenated format: `40eb9860-cf3e-45e2-a90e-b82236ac806c`.
func (Uuid25) ToUrn ¶
Formats this type in the RFC 4122 URN format: `urn:uuid:40eb9860-cf3e-45e2-a90e-b82236ac806c`.
func (*Uuid25) UnmarshalBinary ¶
Implements the encoding.BinaryUnmarshaler interface.
func (*Uuid25) UnmarshalText ¶
Implements the encoding.TextUnmarshaler interface.