cryptox

package
v0.0.0-...-e90a610 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 10 Imported by: 0

README

encrypt

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(payload []byte, secret string) ([]byte, error)

Decrypt decrypts a payload with a given secret.

func EncodePassword

func EncodePassword(password string, salt string) (string, error)

EncodePassword encodes a password using PBKDF2.

func Encrypt

func Encrypt(payload []byte, secret string) ([]byte, error)

Encrypt encrypts a payload with a given secret.

func GetRandomString

func GetRandomString(n int, alphabets ...byte) (string, error)

GetRandomString generate random string by specify chars. source: https://github.com/gogits/gogs/blob/9ee80e3e5426821f03a4e99fad34418f5c736413/modules/base/tool.go#L58

func MD5Sum

func MD5Sum(s string) string

MD5Sum calculates the MD5 of a string

func SHA256Sum

func SHA256Sum(s string) string

SHA256Sum calculates the SHA256Sum of a string

Types

This section is empty.

Jump to

Keyboard shortcuts

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