basetype

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Id added in v0.29.0

type Id uint64

Id 在json编码时会转为字符串,以防止js的数字溢出

func (Id) MarshalJSON added in v0.29.0

func (id Id) MarshalJSON() ([]byte, error)

func (*Id) UnmarshalJSON added in v0.29.0

func (id *Id) UnmarshalJSON(data []byte) error

type Pager

type Pager struct {
	Page     int `json:"page"`     // 分页页数
	PageSize int `json:"pageSize"` // 分页大小
}

type Password

type Password string

func (Password) Compare

func (p Password) Compare(hash string) error

Compare 使用bcrypt算法判断密码是否与传入hash值匹配

func (Password) Encrypt

func (p Password) Encrypt() (pp string, err error)

Encrypt 使用bcrypt算法将明文密码哈希得到hash字符串 bcrypt算法在对同一个密码哈希多次会得出不同结果,极大的保证了用户密码的安全

func (Password) String

func (p Password) String() string

Password 实现String方法,打印时自动替换为*

Jump to

Keyboard shortcuts

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