Documentation
¶
Overview ¶
*
@author: fanyanan @date: 2022/6/9 @note: //Aes Encryption and decryption tools
*
*
@author: fanyanan @date: 2022/6/9 @note: //Encrypt and decrypt global public resource
*
*
@author: fanyanan @date: 2022/6/9 @note: //DES Encryption and decryption
*
*
@author: fanyanan @date: 2022/6/9 @note: //md5 Encryption and decryption tools
*
Index ¶
- type Encryption
- func (e *Encryption) AesDecrypt(crated string, salt ...string) (string, error)
- func (e *Encryption) AesEncrypt(original string, key ...string) (string, error)
- func (*Encryption) DesDecrypt(decrypted string, key ...string) (string, error)
- func (*Encryption) DesEncrypt(text string, key ...string) (string, error)
- func (e *Encryption) Md5Check(content, encrypted string) bool
- func (e *Encryption) Md5Encode(data string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encryption ¶
type Encryption struct { }
Encryption and decryption overall structure
func (*Encryption) AesDecrypt ¶
func (e *Encryption) AesDecrypt(crated string, salt ...string) (string, error)
AesDecrypt function original The original password, salt is an optional variable. If the salt exists, the passed variable is used. If it does not exist, the system default salt value is used.
func (*Encryption) AesEncrypt ¶
func (e *Encryption) AesEncrypt(original string, key ...string) (string, error)
AesEncrypt function original The original password, salt is an optional variable. If the salt exists, the passed variable is used. If it does not exist, the system default salt value is used.
func (*Encryption) DesDecrypt ¶
func (*Encryption) DesDecrypt(decrypted string, key ...string) (string, error)
DesDecrypt des encrypted function salt The parameter is the salt value of encryption and decryption, and the maximum length is 8. If the length is exceeded, the corresponding exception will be thrown
func (*Encryption) DesEncrypt ¶
func (*Encryption) DesEncrypt(text string, key ...string) (string, error)
DesEncrypt des encrypted function salt The parameter is the salt value of encryption and decryption, and the maximum length is 8. If the length is exceeded, the corresponding exception will be thrown
func (*Encryption) Md5Check ¶
func (e *Encryption) Md5Check(content, encrypted string) bool
Md5Check md5 Check method
func (*Encryption) Md5Encode ¶
func (e *Encryption) Md5Encode(data string) string
Md5Encode md5 Signature function