Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidData = errors.New("invalid data")
ErrInvalidData should be returned by DecryptString if the data validation fails.
Functions ¶
This section is empty.
Types ¶
type BytesCipher ¶ added in v0.1.5
BytesCipher defines methods that need to be defined to have a convenient way to encrypt and decrypt arbitrary data.
type Cipher ¶ added in v0.1.5
type Cipher interface { BytesCipher StringCipher }
BytesCipher defines methods that need to be defined to have a convenient way to encrypt and decrypt arbitrary data and strings.
type StringCipher ¶
type StringCipher interface { EncryptString(string) (string, error) DecryptString(string) (string, error) }
StringCipher defines methods that need to be defined to have a convenient way to encrypt and decrypt arbitrary strings.
type StringEncoder ¶ added in v0.1.2
StringEncoder is used to specify encoding for input or output data.
var DefaultEncoder StringEncoder = base32.NewEncoding("0123456789abcdefghjkmnpqrstvwxyz").WithPadding(base32.NoPadding)
DefaultEncoding is a Base32 encoding with "0123456789abcdefghjkmnpqrstvwxyz" charset and without padding. It is used to encode data returned by EncryptString.