Documentation ¶
Overview ¶
Copyright 2018 Keydap. All rights reserved. Licensed under the Apache License, Version 2.0, see LICENSE.
Index ¶
- Constants
- func B64Decode(val string) ([]byte, error)
- func B64Encode(data []byte) string
- func B64UrlDecode(val string) ([]byte, error)
- func B64UrlEncode(data []byte) string
- func BtoUint16(data []byte) uint16
- func Btof(data []byte) float64
- func Btoi(data []byte) int64
- func CheckAndCreate(dirName string)
- func ComparePassword(plaintext string, hashVal string) bool
- func CreateCert(dirName string, suffix string) error
- func DateTime() string
- func DateTimeMillis() int64
- func DecodeUint32(data []byte) uint32
- func EncodeUint32(v uint32) []byte
- func FindHashMech(password string) *hashMech
- func FormatUUID(b []byte) string
- func Ftob(f float64) []byte
- func GenUUID() string
- func GetRemoteAddr(r *http.Request) string
- func GetTimeMillis(rfc3339Date string) int64
- func HashPassword(plaintext string, algo string) string
- func IsHashAlgoSupported(algoName string) bool
- func IsPasswordHashed(password string) bool
- func Itob(i int64) []byte
- func NewRandShaStr() string
- func Rand32() []byte
- func RandBytes(n int) []byte
- func SignWithWebHookToken(data []byte, key []byte) (string, error)
- func Uint16tob(i uint16) []byte
- type CookieKeyCache
Constants ¶
View Source
const DIR_PERM os.FileMode = 0744 //rwxr--r--
View Source
const FILE_PERM os.FileMode = 0644 //rw-r--r--
Variables ¶
This section is empty.
Functions ¶
func B64UrlDecode ¶
func B64UrlEncode ¶
func CheckAndCreate ¶
func CheckAndCreate(dirName string)
func ComparePassword ¶
func CreateCert ¶
Generates a self-signed certificate and stores the PEM encoded certificate and private key with the names {suffix}.cer and {suffix}.key under the given directory.
func DateTimeMillis ¶
func DateTimeMillis() int64
func DecodeUint32 ¶
func EncodeUint32 ¶
func FindHashMech ¶
func FindHashMech(password string) *hashMech
func FormatUUID ¶
func GetRemoteAddr ¶
func GetTimeMillis ¶
func HashPassword ¶
func IsHashAlgoSupported ¶
func IsPasswordHashed ¶
func NewRandShaStr ¶
func NewRandShaStr() string
Types ¶
type CookieKeyCache ¶
type CookieKeyCache struct {
// contains filtered or unexported fields
}
func NewCookieKeyCache ¶
func NewCookieKeyCache() *CookieKeyCache
func (*CookieKeyCache) Decrypt ¶
func (ckc *CookieKeyCache) Decrypt(b64value string) (data []byte, err error)
func (*CookieKeyCache) DecryptBytes ¶
func (ckc *CookieKeyCache) DecryptBytes(data []byte) ([]byte, error)
func (*CookieKeyCache) Encrypt ¶
func (ckc *CookieKeyCache) Encrypt(value []byte) []byte
Click to show internal directories.
Click to hide internal directories.