Documentation
¶
Index ¶
- type Cipher
- type Crypto
- func (c *Crypto) ComputeSHA1HMAC(data ...string) string
- func (c *Crypto) ComputeSHA256HMAC(data ...string) string
- func (c *Crypto) ComputeSHA512HMAC(data ...string) string
- func (c *Crypto) DecodeBASE64(text string) (string, error)
- func (c *Crypto) EncodeBASE64(text string) string
- func (c *Crypto) EncodeBASE64URL(text string) string
- func (c *Crypto) EncodeDES(text string) (cipher.Block, error)
- func (c *Crypto) EncodeMD5(text string) string
- func (c *Crypto) EncodeMD5Base64(text string) string
- func (c *Crypto) EncodeSHA1HMAC(data ...string) string
- func (c *Crypto) EncodeSHA1HMACBase64(data ...string) string
- func (c *Crypto) EncodeSHA256(text string) string
- func (c *Crypto) EncodeSHA256HMAC(data ...string) string
- func (c *Crypto) EncodeSHA256HMACBase64(data ...string) string
- func (c *Crypto) EncodeSHA512(text string) string
- func (c *Crypto) EncodeSHA512HMAC(data ...string) string
- func (c *Crypto) EncodeSHA512HMACBase64(data ...string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
Cipher represents a cryptographic cipher using the AES (Advanced Encryption Standard) algorithm in CBC (Cipher Block Chaining) mode.
func NewES256 ¶
NewES256 creates a new Cipher instance with the specified key for AES encryption. Parameters:
- key: The encryption key.
Returns:
- *Cipher: A pointer to the newly created Cipher instance.
- error: An error if the cipher creation fails.
type Crypto ¶
type Crypto struct {
// contains filtered or unexported fields
}
func (*Crypto) ComputeSHA1HMAC ¶
ComputeSHA1HMAC : encrypt to SHA1HMAC input key, data String. Output to String
func (*Crypto) ComputeSHA256HMAC ¶
func (*Crypto) ComputeSHA512HMAC ¶
func (*Crypto) DecodeBASE64 ¶
DecodeBASE64 : Decrypt Base64. Input string, output string
func (*Crypto) EncodeBASE64 ¶
EncodeBASE64 : Encrypt to Base64. Input string, output string
func (*Crypto) EncodeBASE64URL ¶
EncodeBASE64URL : Encrypt to Base64URL. Input string, output text
func (*Crypto) EncodeMD5Base64 ¶
func (*Crypto) EncodeSHA1HMAC ¶
EncodeSHA1HMAC : encrypt to SHA1HMAC input key, data String. Output to String in Base16/Hex format
func (*Crypto) EncodeSHA1HMACBase64 ¶
EncodeSHA1HMACBase64 : encrypt to SHA1HMAC input key, data String. Output to String in Base64 format
func (*Crypto) EncodeSHA256 ¶
EncodeSHA256: Encrypt to SHA256. input string, output text
func (*Crypto) EncodeSHA256HMAC ¶
func (*Crypto) EncodeSHA256HMACBase64 ¶
func (*Crypto) EncodeSHA512 ¶
EncodeSHA512 Encrypt to SHA512. input string, output text