shortuuid

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

shortuuid

This library uses base58 encoding to shorten the string representation of Universally Unique IDentifier (UUID) values making them smaller when stored in a document database such as DynamoDB.

This library provides a reduction of ~39% in storage of the string representation of these values.

GitHub Actions status Go Report Card Documentation Coverage Status

example

before 1c807ffe-b179-4a15-aa92-e06f5b5cf268 after 4X8k1aRv5UMp9pdKzxaHwu

License

This application is released under Apache 2.0 license and is copyright Mark Wolfe.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustShorten

func MustShorten(uuidv4s ...string) string

MustShorten take one or more uuids and encode them using base58 with the encoded values being appended in order.

func MustUnShorten

func MustUnShorten(val string) []string

MustUnShorten takes a shortened value and decodes it into on or more uuids with the result being in the original order.

func Shorten

func Shorten(uuidv4s ...string) (string, error)

Shorten take one or more uuids and encode them using base58 with the encoded values being appended in order.

func UnShorten

func UnShorten(val string) ([]string, error)

UnShorten takes a shortened value and decodes it into on or more uuids with the result being in the original order.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL