baseconv

package
Version: v0.0.0-...-61a4d47 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Base2Converter  = NewBaseConverter([]byte("01"))
	Base16Converter = NewBaseConverter([]byte("0123456789ABCDEF"))
	Base62Converter = NewBaseConverter([]byte("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"))
)

Functions

This section is empty.

Types

type BaseConverter

type BaseConverter struct {
	// contains filtered or unexported fields
}

BaseConverter 用于 10 进制与任意进制互转

func NewBaseConverter

func NewBaseConverter(toDigits []byte) *BaseConverter

func (*BaseConverter) FromDecimal

func (c *BaseConverter) FromDecimal(num int) string

func (*BaseConverter) ToDecimal

func (c *BaseConverter) ToDecimal(num string) (int, error)

Source Files

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