Documentation ¶
Index ¶
- type ChecksumRegistry
- func (cr *ChecksumRegistry) Adler32Sum(input string) string
- func (cr *ChecksumRegistry) LinkHandler(fh sprout.Handler) error
- func (cr *ChecksumRegistry) MD5Sum(input 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(input string) string
- func (cr *ChecksumRegistry) SHA256Sum(input string) string
- func (cr *ChecksumRegistry) SHA512Sum(input 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(input string) string
Adler32Sum calculates the Adler-32 checksum of the input string and returns it as a hexadecimal encoded string.
Parameters: - input: the string to be hashed.
Returns: - the Adler-32 checksum of the input string as a hexadecimal encoded string.
Example:
{{ adler32Sum "Hello, World!" }} // Output: 1f9e046a
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(input string) string
MD5Sum calculates the MD5 hash of the input string and returns it as a hexadecimal encoded string.
Parameters: - input: the string to be hashed.
Returns: - the MD5 hash of the input string as a hexadecimal encoded string.
Example:
{{ md5Sum "Hello, World!" }} // Output: 65a8e27d8879283831b664bd8b7f0ad4
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(input string) string
SHA1Sum calculates the SHA-1 hash of the input string and returns it as a hexadecimal encoded string.
Parameters: - input: the string to be hashed.
Returns: - the SHA-1 hash of the input string as a hexadecimal encoded string.
Example:
{{ sha1Sum "Hello, World!" }} // Output: 0a0a9f2a6772942557ab5355d76af442f8f65e01
func (*ChecksumRegistry) SHA256Sum ¶
func (cr *ChecksumRegistry) SHA256Sum(input string) string
SHA256Sum calculates the SHA-256 hash of the input string and returns it as a hexadecimal encoded string.
Parameters: - input: the string to be hashed.
Returns: - the SHA-256 hash of the input string as a hexadecimal encoded string.
Example:
{{ sha256Sum "Hello, World!" }} // Output: dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f
func (*ChecksumRegistry) SHA512Sum ¶ added in v0.6.0
func (cr *ChecksumRegistry) SHA512Sum(input string) string
SHA512Sum calculates the SHA-512 hash of the input string and returns it as a hexadecimal encoded string.
Parameters: - input: the string to be hashed.
Returns: - the SHA-512 hash of the input string as a hexadecimal encoded string.
Example:
{{ sha512Sum "Hello, World!" }} // Output: 374d794a95cdcfd8b35993185fef9ba368f160d8daf432d08ba9f1ed1e5abe6cc69291e0fa2fe0006a52570ef18c19def4e617c33ce52ef0a6e5fbe318cb0387
func (*ChecksumRegistry) Uid ¶
func (cr *ChecksumRegistry) Uid() string
Uid returns the unique identifier of the registry.