hashid

package
v3.0.0-...-3373b9d Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: GPL-3.0 Imports: 3 Imported by: 8

Documentation

Index

Constants

View Source
const (
	ShareID  = iota // 分享
	UserID          // 用户
	FileID          // 文件ID
	FolderID        // 目录ID
	TagID           // 标签ID
	PolicyID        // 存储策略ID
	SourceLinkID
)

ID类型

Variables

View Source
var (
	// ErrTypeNotMatch ID类型不匹配
	ErrTypeNotMatch = errors.New("mismatched ID type.")
)

Functions

func DecodeHashID

func DecodeHashID(id string, t int) (uint, error)

DecodeHashID 计算HashID对应的数据库ID

func HashDecode

func HashDecode(raw string) ([]int, error)

HashDecode 对给定数据计算原始数据

func HashEncode

func HashEncode(v []int) (string, error)

HashEncode 对给定数据计算HashID

func HashID

func HashID(id uint, t int) string

HashID 计算数据库内主键对应的HashID

Types

This section is empty.

Jump to

Keyboard shortcuts

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