Documentation
¶
Index ¶
- type RandomEncrypt
- func (e *RandomEncrypt) Config(config map[string]interface{}) *RandomEncrypt
- func (e *RandomEncrypt) Decrypt(str string) string
- func (e *RandomEncrypt) DecryptByKeyIv(str string, key string, iv string) (string, error)
- func (e *RandomEncrypt) DoDecrypt(str string, timestamp int64) (string, error)
- func (e *RandomEncrypt) Encrypt(str string) (string, string, string, int64)
- func (e *RandomEncrypt) SetSalt(salt string) *RandomEncrypt
- func (e *RandomEncrypt) SetSecondRedundancy(secondRedundancy int64) *RandomEncrypt
- func (e *RandomEncrypt) SetTimeInterval(timeInterval int64) *RandomEncrypt
- func (e *RandomEncrypt) SetTimezoneOffset(offset int64) *RandomEncrypt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RandomEncrypt ¶
type RandomEncrypt struct {
// contains filtered or unexported fields
}
func NewRandomEncrypt ¶
func NewRandomEncrypt(config map[string]interface{}) RandomEncrypt
NewRandomEncrypt 初始化参数 map[string]interface{}{"salt": "salt", "offset": 10, "timeInterval": 7, "secondRedundancy": 3}
func (*RandomEncrypt) Config ¶
func (e *RandomEncrypt) Config(config map[string]interface{}) *RandomEncrypt
Config 自定义设置参数 map[string]interface{}{"salt": "salt", "offset": 10, "timeInterval": 7, "secondRedundancy": 3}
func (*RandomEncrypt) Decrypt ¶
func (e *RandomEncrypt) Decrypt(str string) string
func (*RandomEncrypt) DecryptByKeyIv ¶
func (*RandomEncrypt) DoDecrypt ¶
func (e *RandomEncrypt) DoDecrypt(str string, timestamp int64) (string, error)
func (*RandomEncrypt) SetSalt ¶
func (e *RandomEncrypt) SetSalt(salt string) *RandomEncrypt
SetSalt 自定义盐值 加密时不能为空
func (*RandomEncrypt) SetSecondRedundancy ¶
func (e *RandomEncrypt) SetSecondRedundancy(secondRedundancy int64) *RandomEncrypt
SetSecondRedundancy 自定义跨区间 冗余秒数 默认2秒
func (*RandomEncrypt) SetTimeInterval ¶
func (e *RandomEncrypt) SetTimeInterval(timeInterval int64) *RandomEncrypt
SetTimeInterval 自定义加密key有效时间 默认5秒
func (*RandomEncrypt) SetTimezoneOffset ¶
func (e *RandomEncrypt) SetTimezoneOffset(offset int64) *RandomEncrypt
SetTimezoneOffset 自定义对齐时区 默认东八区
Click to show internal directories.
Click to hide internal directories.