misc

package module
v0.0.0-...-96e1015 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CharsetByType

func CharsetByType(typ string) string

func Clamp

func Clamp[T cmp.Ordered](val, min, max T) T

Clamp 取值上下限,限制取值返回

func ExtensionByType

func ExtensionByType(mimeType string) string

func Hmac

func Hmac(key, data string) string

func MD5

func MD5(str string) string

func PasswordHash

func PasswordHash(password string) (string, error)

PasswordHash 使用 Bcrypt 算法生成密码哈希值

func PasswordVerify

func PasswordVerify(password, hash string) bool

PasswordVerify 比较输入的密码与哈希值是否匹配

func Sha1

func Sha1(str string) string

func Sha256

func Sha256(str string) string

func TypeByExtension

func TypeByExtension(ext string) string

Types

type WeakMap

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

func NewWeakMap

func NewWeakMap() *WeakMap

func (*WeakMap) Delete

func (w *WeakMap) Delete(key any)

func (*WeakMap) Get

func (w *WeakMap) Get(key any) (any, bool)

func (*WeakMap) Has

func (w *WeakMap) Has(key any) bool

func (*WeakMap) Len

func (w *WeakMap) Len() int

func (*WeakMap) Put

func (w *WeakMap) Put(key, value any)

Put key is weakly referenced.

Jump to

Keyboard shortcuts

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