hashid

package
v1.3.10 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

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

ID类型

Variables

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

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