base38

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package base38 converts a 4-byte string, each byte in [ 0-9?a-z], to a base 38 number.

Index

Constants

View Source
const (
	// Max is the inclusive upper bound for the value returned by Encode. Its
	// value equals (38*38*38*38 - 1).
	Max = 2085135
	// MaxBits is the number of bits required to represent Max. It satisfies
	// (1<<(MaxBits-1) <= Max) && (Max < 1<<MaxBits).
	MaxBits = 21
)

Variables

This section is empty.

Functions

func Encode

func Encode(s string) (u uint32, ok bool)

Encode encodes a 4-byte string as a uint32 in the range [0, Max].

Each byte must be ' ', be in the range '0'-'9', be '?' or be in the range 'a'-'z'.

The string " " is mapped to zero.

Types

This section is empty.

Jump to

Keyboard shortcuts

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