crypto

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstantTimeCmp added in v2.1.1

func ConstantTimeCmp(a, b string) bool

func GenerateRandomBytes

func GenerateRandomBytes(size int) []byte

GenerateRandomBytes returns random bytes.

func GenerateRandomString

func GenerateRandomString(size int) string

GenerateRandomString returns a random string.

func GenerateRandomStringHex

func GenerateRandomStringHex(size int) string

GenerateRandomStringHex returns a random hexadecimal string.

func GenerateSHA256Hmac added in v2.0.48

func GenerateSHA256Hmac(secret string, data []byte) string

func GenerateUUID added in v2.1.1

func GenerateUUID() string

func Hash

func Hash(value string) string

Hash returns a SHA-256 checksum of a string.

func HashFromBytes

func HashFromBytes(value []byte) string

HashFromBytes returns a SHA-256 checksum of the input.

func HashPassword

func HashPassword(password string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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