Documentation
¶
Overview ¶
Package encoding defines the various encoding Algorithms supported by the gormcrypto package
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAlgo ¶
RegisterAlgo adds an Algorithm to the internal algos map so it can be used in YAML configs
func SupportedAlgos ¶
func SupportedAlgos() []string
SupportedAlgos returns a list of registered Algorithms that can be used in YAML configs
Types ¶
type ASCII85 ¶
type ASCII85 struct {
Algorithm
}
ASCII85 supports ASCII85 encoding of arbitrary data
type Algorithm ¶
type Algorithm interface {
// Name identifies the Algorithm as a string for exporting configurations
Name() string
// Config converts an Algorthim's internal configuration into a map for export
Config() map[string]interface{}
// Encode transforms a binary value into a text encoding that can safely be serialized/stored.
Encode([]byte) ([]byte, error)
// Decode transforms a text encoding into a raw binary value which can be used for decryption/signature verification.
Decode([]byte) ([]byte, error)
}
Algorithm is a bad name for the core interface all gormcrypto encodings implement. The name was chosen for consistency more than anything. A type implementing encoding.Algorithm will convert a value between its raw binary and encoded text forms, in a manner consistent with its type. The types implemented here wrap the Go standard library's various encoding packages.
type Base32 ¶
type Base32 struct {
Algorithm
}
Base32 supports Base32 encoding of arbitrary data
type Base64 ¶
type Base64 struct {
Algorithm
}
Base64 supports Base64 encoding of arbitrary data
type Hex ¶
type Hex struct {
Algorithm
}
Hex supports Hex encoding of arbitrary data