Documentation
¶
Index ¶
- Variables
- func Base64UrlDecode(seg string) ([]byte, error)
- func Base64UrlEncode(seg []byte) string
- func GetFileSha256(path string) (hash string, err error)
- func GetJwtBySecret(keyBytes []byte, bodyInfo map[string]interface{}) (string, error)
- func GetRandString(l int) string
- func GetSha256(s string) string
- func GetSha256BySecret(secret string, keyBytes []byte) []byte
- func JsonDecodeUseNumber(infoBytes []byte, result interface{}) error
- func Md5(s string) string
- type JsonWebToken
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Base64UrlDecode ¶
Base64UrlDecode Decode JWT specific base64url encoding with padding stripped
func Base64UrlEncode ¶
Base64UrlEncode Encode JWT specific base64url encoding with padding stripped
func GetFileSha256 ¶
GetFileSha256 get SHA256 hash of file.
func GetJwtBySecret ¶
func GetRandString ¶
func GetSha256BySecret ¶
GetSha256BySecret get SHA256 hash by Key
func JsonDecodeUseNumber ¶
Types ¶
type JsonWebToken ¶
type JsonWebToken struct {
TokenString string
// contains filtered or unexported fields
}
func (*JsonWebToken) Create ¶
func (j *JsonWebToken) Create(claims map[string]interface{}, expiresin time.Duration) (token string, err error)
Create JsonWebToken string Create(map[string]interface{}{"id": 123456789, "username": "Harvey"}, time.Second*time.Duration(3600))
Click to show internal directories.
Click to hide internal directories.