Documentation ¶
Index ¶
- func CompareHashAndPassword(token []byte, pwd []byte) error
- func CreateRandomByteSlice(n int) ([]byte, error)
- func CreateRandomString(n int) (string, error)
- func GenerateHash(byteSlice []byte) ([]byte, error)
- func ParseForm(dest interface{}, r *http.Request) error
- func PrettyPrint(v interface{}) (err error)
- func RememberToken() (string, error)
- type HMAC
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareHashAndPassword ¶
CompareHashAndPassword returns bool error if password and hash doesn't match
func CreateRandomByteSlice ¶
CreateRandomByteSlice will generate random bytes using crypto/rand package
func CreateRandomString ¶
CreateRandomString converts byte slice to a base64 encoded string we don't use normal string conversion because random bytes may not be valid UTF8
func GenerateHash ¶
GenerateHash generates bcrypt hash with default cost
func PrettyPrint ¶
func PrettyPrint(v interface{}) (err error)
PrettyPrint variable (struct, map, array, slice) in Golang
func RememberToken ¶
RememberToken return random generated string of predef size
Types ¶
Click to show internal directories.
Click to hide internal directories.