base36

package
v0.0.0-...-69d094b Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package base36 实现混合字母和数字的数字型 ID 值, 这主要是为了便于人为设定一个可读友好的字符串, 同时又能转换为数字的 ID 存储。不区分大小写, 最多 10 个字符

Index

Constants

View Source
const Float64PrecisionSize = 10

Float64PrecisionSize IEEE 754 双精度浮点数不会丢失的精度。推荐使用这个值

View Source
const MaxID = 3656158440062975 // ZZZZZZZZZZ

MaxID ID 最大值

Variables

This section is empty.

Functions

func Atoi

func Atoi[N Double](s string) (N, error)

Atoi 将一个 string 转为数字值

func Itoa

func Itoa[N Double](id N) string

Itoa 将一个 id 转为 string 类型

Types

type Double

type Double interface {
	~float64 | ~int64 | ~uint64
}

Double 表示支持的数据类型

Jump to

Keyboard shortcuts

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