sortablebase64

package
Version: v0.0.0-...-1adb5bc Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package sortablebase64 contains routines for encoding text in a variant of base64. This variant has the useful property that encodings of numeric values retain their ordering under lexicographic (ASCII) sort as the values do under numeric sort.

Index

Constants

View Source
const Alphabet = "0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"

Alphabet is an ordered list of characters used in sortablebase64 encoding. The order is drawn from the placement of these characters in the ASCII table.

Variables

This section is empty.

Functions

func DecUint64

func DecUint64(s string) (string, error)

DecUint64 increments the sortablebase64-encoded uint64 s.

func DecodeUint64

func DecodeUint64(s string) (uint64, error)

DecodeUint64 returns a uint64 representing the sortablebase64-encoded string s, or an error.

func EncodeUint64

func EncodeUint64(n uint64) string

EncodeUint64 returns a string representing n in sortablebase64.

The returned string is always 11 bytes in length.

func IncUint64

func IncUint64(s string) (string, error)

IncUint64 increments the sortablebase64-encoded uint64 s.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL