summaryrefslogtreecommitdiffstats
path: root/tpl/crypto
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-12-21 13:11:08 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-12-21 15:33:02 +0100
commitcd1ed563a82f8a9ebdd3109230e34e74bf5ec6eb (patch)
treed766a7d88e59d20be9380aaf3d45b799737a288e /tpl/crypto
parentaa2c724195ae53e698dfaa7f9bea63e5cecea391 (diff)
tpl: Improve template funcs GoDoc
Diffstat (limited to 'tpl/crypto')
-rw-r--r--tpl/crypto/crypto.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/tpl/crypto/crypto.go b/tpl/crypto/crypto.go
index 42b420d59..d40ddbe84 100644
--- a/tpl/crypto/crypto.go
+++ b/tpl/crypto/crypto.go
@@ -36,9 +36,9 @@ func New() *Namespace {
// Namespace provides template functions for the "crypto" namespace.
type Namespace struct{}
-// MD5 hashes the given input and returns its MD5 checksum.
-func (ns *Namespace) MD5(in any) (string, error) {
- conv, err := cast.ToStringE(in)
+// MD5 hashes the v and returns its MD5 checksum.
+func (ns *Namespace) MD5(v any) (string, error) {
+ conv, err := cast.ToStringE(v)
if err != nil {
return "", err
}
@@ -47,9 +47,9 @@ func (ns *Namespace) MD5(in any) (string, error) {
return hex.EncodeToString(hash[:]), nil
}
-// SHA1 hashes the given input and returns its SHA1 checksum.
-func (ns *Namespace) SHA1(in any) (string, error) {
- conv, err := cast.ToStringE(in)
+// SHA1 hashes v and returns its SHA1 checksum.
+func (ns *Namespace) SHA1(v any) (string, error) {
+ conv, err := cast.ToStringE(v)
if err != nil {
return "", err
}
@@ -58,9 +58,9 @@ func (ns *Namespace) SHA1(in any) (string, error) {
return hex.EncodeToString(hash[:]), nil
}
-// SHA256 hashes the given input and returns its SHA256 checksum.
-func (ns *Namespace) SHA256(in any) (string, error) {
- conv, err := cast.ToStringE(in)
+// SHA256 hashes v and returns its SHA256 checksum.
+func (ns *Namespace) SHA256(v any) (string, error) {
+ conv, err := cast.ToStringE(v)
if err != nil {
return "", err
}
@@ -69,9 +69,9 @@ func (ns *Namespace) SHA256(in any) (string, error) {
return hex.EncodeToString(hash[:]), nil
}
-// FNV32a hashes using fnv32a algorithm
-func (ns *Namespace) FNV32a(in any) (int, error) {
- conv, err := cast.ToStringE(in)
+// FNV32a hashes v using fnv32a algorithm.
+func (ns *Namespace) FNV32a(v any) (int, error) {
+ conv, err := cast.ToStringE(v)
if err != nil {
return 0, err
}