cryptox

package
Version: v0.0.0-...-2443ee7 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 11 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(reader io.Reader) (string, error)

MD5Sum calculates the MD5 of a stream

func MD5SumSumString

func MD5SumSumString(input string) (string, error)

MD5SumSumString calculates the MD5 of a string

func SHA256

func SHA256(reader io.Reader) (string, error)

SHA256 calculates the SHA256 of a stream

func SHA256SumString

func SHA256SumString(input string) (string, error)

SHA256SumString calculates the MD5 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