hash

package
v1.1.91 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 5 Imported by: 18

Documentation

Overview

Package hash provides a utility to create hash from string or bytes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePasswords

func ComparePasswords(hashedPwd string, plainPwd []byte) bool

ComparePasswords, Compare hash bcrypt password and plaintext password.

func CreateHash

func CreateHash(key ...string) string

CreateHash from string, using sha256.

func CreateHashByte

func CreateHashByte(key []byte) string

CreateHashByte from string, using sha256.

func CreateRandomId

func CreateRandomId(ln int) string

CreateRandomId, generate hash using uuid and split hash result.

func CreateSmallHash

func CreateSmallHash(ln int, key ...string) string

CreateSmallHash, generate hash and split hash result.

func HashAndSalt

func HashAndSalt(pwd []byte) (str string, err error)

HashAndSalt, Creating password hash using bcrypt with DefaultCost.

Types

This section is empty.

Jump to

Keyboard shortcuts

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