utils

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualPassword

func EqualPassword(origin, salt, pwd string) bool

func GetPassword

func GetPassword(origin string, salts ...string) (string, string)

func GetRandomString

func GetRandomString(str CharType, n int) string

func Hash

func Hash(ha crypto.Hash, data string) string

Types

type CharType

type CharType string

字符类型

const (
	// 随机字符串包含: 0-9,a-z,A-Z
	CHARS CharType = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
	// 字母随机字符串包含: a-z,A-Z
	LETTERS CharType = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
	// 数字随机字符串包含: 0-9
	NUMS CharType = "0123456789"
)

type Hasher

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

func NewHasher

func NewHasher(ha crypto.Hash) *Hasher

func (Hasher) Hash

func (h Hasher) Hash(data string) string

Jump to

Keyboard shortcuts

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