util

package
v0.0.0-...-ae4999c Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RandNum   = iota // 纯数字
	RandLower        // 小写字母
	RandUpper        // 大写字母
	RandAll          // 数字、大小写字母
)

Variables

This section is empty.

Functions

func ComparePassword

func ComparePassword(hashedPassword []byte, password []byte) bool

func Exponent

func Exponent(a, n uint64) uint64

a的n次方

func FormatFileSize

func FormatFileSize(fileSize uint64) (size string)

func HashPassword

func HashPassword(password []byte) ([]byte, error)

func If

func If(cond bool, yes interface{}, no interface{}) interface{}

func PathExists

func PathExists(path string) (bool, error)

func RandStr

func RandStr(size int, kind int) string

随机字符串

Types

type GobCopier

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

func NewCopier

func NewCopier() *GobCopier

func (*GobCopier) Decode

func (c *GobCopier) Decode(data interface{}) error

func (*GobCopier) Encode

func (c *GobCopier) Encode(v interface{}) error

Jump to

Keyboard shortcuts

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