mapping

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package mapping provides URL shortening functions base58.go provides functions to encode and decode numbers to base58

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidInput base error for invalid input
	ErrInvalidInput = errors.New("base58 invalid input")
	// ErrBase58Overflow is returned when the number to decode is too large, greater than eight bytes
	ErrBase58Overflow = fmt.Errorf("%w: number is too large", ErrInvalidInput)
	// ErrorInvalidCharacter is returned when an invalid character is found in the input
	ErrorInvalidCharacter = fmt.Errorf("%w: invalid character in input", ErrInvalidInput)
)

Functions

func Base58Decode

func Base58Decode(b []byte) (uint64, error)

Base58Decode decodes a base58 encoded string to a number

func Base58Encode

func Base58Encode(num uint64) []byte

Base58Encode encodes a number to base58

Types

This section is empty.

Jump to

Keyboard shortcuts

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