utils

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSalt

func GenerateSalt(length int) ([]byte, error)

GenerateSalt generates a random salt with the specified length

func GenerateSaltString added in v0.0.22

func GenerateSaltString(length int) (string, error)

func HMAC256

func HMAC256(b []byte, key []byte) []byte

HMAC256 calculates HMAC-SHA256 hash

func HMAC256String

func HMAC256String(s string, key string) string

HMAC256String calculates HMAC-SHA256 hash and returns hex string

func MD5

func MD5(b []byte) []byte

MD5 calculates MD5 hash

func MD5String

func MD5String(s string) string

MD5String calculates MD5 hash and returns hex string

func SHA1

func SHA1(b []byte) []byte

SHA1 calculates SHA1 hash

func SHA1String

func SHA1String(s string) string

SHA1String calculates SHA1 hash and returns hex string

func SHA256

func SHA256(b []byte) []byte

SHA256 calculates SHA256 hash

func SHA256String

func SHA256String(s string) string

SHA256String calculates SHA256 hash and returns hex string

Types

This section is empty.

Jump to

Keyboard shortcuts

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