util

package
v0.0.0-...-d9fbcb9 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

password related helper function

Index

Constants

View Source
const DefaultPassword = "123456"

default password for test use

Variables

This section is empty.

Functions

func ComparePassword

func ComparePassword(hash, pwd string) bool

func Password

func Password(pwd string) string

hash and salt the password

func RandomString

func RandomString(length int) string

generate random string

func RandomStringWithGenerator

func RandomStringWithGenerator(length int, r *rand.Rand) string

generate random string with a random generator

Types

type DefaultValidator

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

func (*DefaultValidator) Engine

func (v *DefaultValidator) Engine() interface{}

func (*DefaultValidator) ValidateStruct

func (v *DefaultValidator) ValidateStruct(obj interface{}) error

Jump to

Keyboard shortcuts

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