helper

package
v0.0.0-...-bfd875d Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClientProof

func CreateClientProof(clientSignature []byte, serverSignature []byte) string

CreateClientProof returns the client proof computed by client and server signature as base64 encoded string

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

GenerateRandomBytes returns random []byte with length n

func GetHMACSHA256

func GetHMACSHA256(secret []byte, valueToEncrypt string) []byte

GetHMACSHA256 returns a HMAC hash using the SHA256 algorithm as []byte Credits to https://golangcode.com/generate-sha256-hmac/

func GetPBKDF2Hash

func GetPBKDF2Hash(password string, salt string, rounds int) []byte

GetPBKDF2Hash returns a key from the password, salt and iteration count, returning a []byte of length 32

func GetSHA256Hash

func GetSHA256Hash(valueToHash []byte) []byte

GetSHA256Hash returns a SHA256 checksum of the data as []byte

func RandSeq

func RandSeq(n int) string

RandSeq returns a random sequence of letters as string value

Types

This section is empty.

Jump to

Keyboard shortcuts

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