b58id

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Base58 ID

Create random base58 ID's based on UUID's.

Motivation

I wanted the simplest possible way of generating unique base58 ID's.

Usage

id := b58iud.New() // e.g. "A3hYyNE2ZXNFJZbTenaB36"

License

The MIT License (MIT)

Copyright (c) 2024 Scott Barr

See LICENSE

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build() (string, error)

Build returns an ID, and any error that could have occurred when generating a new UUID.

func FromString

func FromString(id string) (string, error)

FromString returns a base58 encoded ID from a string. The input string must be parsable as a UUID.

func FromUUID

func FromUUID(u uuid.UUID) (string, error)

FromUUID returns a base58 encoded ID from a UUID.

func New

func New() string

New returns a new ID.

Will panic if UUID generation fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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