hash

package
v1.0.1000 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 5 Imported by: 14

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) []byte

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