Documentation
¶
Index ¶
- type ChecksumRegistry
- func (cr *ChecksumRegistry) Adler32Sum(value string) string
- func (cr *ChecksumRegistry) LinkHandler(fh sprout.Handler) error
- func (cr *ChecksumRegistry) MD5Sum(value string) string
- func (cr *ChecksumRegistry) RegisterAliases(aliasMap sprout.FunctionAliasMap) error
- func (cr *ChecksumRegistry) RegisterFunctions(funcsMap sprout.FunctionMap) error
- func (cr *ChecksumRegistry) RegisterNotices(notices *[]sprout.FunctionNotice) error
- func (cr *ChecksumRegistry) SHA1Sum(value string) string
- func (cr *ChecksumRegistry) SHA256Sum(value string) string
- func (cr *ChecksumRegistry) SHA512Sum(value string) string
- func (cr *ChecksumRegistry) UID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChecksumRegistry ¶
type ChecksumRegistry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *ChecksumRegistry
NewRegistry creates a new instance of the checksum registry.
func (*ChecksumRegistry) Adler32Sum ¶
func (cr *ChecksumRegistry) Adler32Sum(value string) string
Adler32Sum calculates the Adler-32 checksum of the value string and returns it as a hexadecimal encoded string.
Parameters: - value: the string to be hashed.
Returns: - the Adler-32 checksum of the value string as a hexadecimal encoded string.
For an example of this function in a Go template, refer to Sprout Documentation: adler32Sum.
func (*ChecksumRegistry) LinkHandler ¶
func (cr *ChecksumRegistry) LinkHandler(fh sprout.Handler) error
LinkHandler links the handler to the registry at runtime.
func (*ChecksumRegistry) MD5Sum ¶
func (cr *ChecksumRegistry) MD5Sum(value string) string
MD5Sum calculates the MD5 hash of the value string and returns it as a hexadecimal encoded string.
Parameters: - value: the string to be hashed.
Returns: - the MD5 hash of the value string as a hexadecimal encoded string.
For an example of this function in a Go template, refer to Sprout Documentation: md5Sum.
func (*ChecksumRegistry) RegisterAliases ¶ added in v0.6.0
func (cr *ChecksumRegistry) RegisterAliases(aliasMap sprout.FunctionAliasMap) error
func (*ChecksumRegistry) RegisterFunctions ¶
func (cr *ChecksumRegistry) RegisterFunctions(funcsMap sprout.FunctionMap) error
RegisterFunctions registers all functions of the registry.
func (*ChecksumRegistry) RegisterNotices ¶ added in v0.6.0
func (cr *ChecksumRegistry) RegisterNotices(notices *[]sprout.FunctionNotice) error
func (*ChecksumRegistry) SHA1Sum ¶
func (cr *ChecksumRegistry) SHA1Sum(value string) string
SHA1Sum calculates the SHA-1 hash of the value string and returns it as a hexadecimal encoded string.
Parameters: - value: the string to be hashed.
Returns: - the SHA-1 hash of the value string as a hexadecimal encoded string.
For an example of this function in a Go template, refer to Sprout Documentation: sha1Sum.
func (*ChecksumRegistry) SHA256Sum ¶
func (cr *ChecksumRegistry) SHA256Sum(value string) string
SHA256Sum calculates the SHA-256 hash of the value string and returns it as a hexadecimal encoded string.
Parameters: - value: the string to be hashed.
Returns: - the SHA-256 hash of the value string as a hexadecimal encoded string.
For an example of this function in a Go template, refer to Sprout Documentation: sha256Sum.
func (*ChecksumRegistry) SHA512Sum ¶ added in v0.6.0
func (cr *ChecksumRegistry) SHA512Sum(value string) string
SHA512Sum calculates the SHA-512 hash of the value string and returns it as a hexadecimal encoded string.
Parameters: - value: the string to be hashed.
Returns: - the SHA-512 hash of the value string as a hexadecimal encoded string.
For an example of this function in a Go template, refer to Sprout Documentation: sha512Sum.
func (*ChecksumRegistry) UID ¶ added in v1.0.0
func (cr *ChecksumRegistry) UID() string
UID returns the unique identifier of the registry.