security

package
v1.46.7 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const HexTable = "0123456789abcdef"

Variables

This section is empty.

Functions

func BcryptHash

func BcryptHash(text string) (string, error)

BcryptHash returns the bcrypt hash of the password with a default cost of 10.

func BcryptHashWithCost

func BcryptHashWithCost(text string, cost int) (string, error)

BcryptHashWithCost returns the bcrypt hash of the password at the given cost.

func BcryptVerify

func BcryptVerify(hash string, text string) bool

BcryptVerify verifies that a bcrypt hash matches the given text.

func HmacSha256

func HmacSha256(text string, key string) string

HmacSha256 computes hmac hash using sha256 checksum.

func HmacSha512

func HmacSha512(text string, key string) string

HmacSha512 computes hmac hash using sha512 checksum.

func HmacVerifySha256

func HmacVerifySha256(text string, key string, signature string) bool

HmacVerifySha256 verifies hmac hash using sha256 checksum.

func HmacVerifySha512

func HmacVerifySha512(text string, key string, signature string) bool

HmacVerifySha512 verifies hmac hash using sha512 checksum.

func RandomHex

func RandomHex(length int) string

func Sha1

func Sha1(text string) string

func Sha3Variant256

func Sha3Variant256(text string) string

Sha3Variant256 returns the sha3-256 digest of the text.

func Sha3Variant512

func Sha3Variant512(text string) string

Sha3Variant512 returns the sha3-512 digest of the text.

func Sha256

func Sha256(text string) string

Sha256 returns the sha256 checksum of the text.

Types

This section is empty.

Jump to

Keyboard shortcuts

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