crypto

package
v0.0.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(password, hash string) bool

CheckPassword checks if a password matches a hash

func Decrypt

func Decrypt(encryptedData, key string) (string, error)

Decrypt decrypts data using AES-GCM with the provided key

func Encrypt

func Encrypt(data, key string) (string, error)

Encrypt encrypts data using AES-GCM with the provided key

func GenerateID

func GenerateID() (string, error)

GenerateID generates a unique ID

func GenerateToken

func GenerateToken(length int) (string, error)

GenerateToken generates a cryptographically secure random token

func HashPassword

func HashPassword(password string) (string, error)

HashPassword hashes a password using bcrypt

Types

This section is empty.

Jump to

Keyboard shortcuts

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