package crypto

import "github.com/gohugoio/hugo/tpl/crypto"

Package crypto provides template functions for cryptographic operations.

Index

Package Files

crypto.go init.go

type Namespace

type Namespace struct{}

Namespace provides template functions for the "crypto" namespace.

func New

func New() *Namespace

New returns a new instance of the crypto-namespaced template functions.

func (*Namespace) FNV32a

func (ns *Namespace) FNV32a(in any) (int, error)

FNV32a hashes using fnv32a algorithm

func (*Namespace) HMAC

func (ns *Namespace) HMAC(h any, k any, m any, e ...any) (string, error)

HMAC returns a cryptographic hash that uses a key to sign a message.

func (*Namespace) MD5

func (ns *Namespace) MD5(in any) (string, error)

MD5 hashes the given input and returns its MD5 checksum.

func (*Namespace) SHA1

func (ns *Namespace) SHA1(in any) (string, error)

SHA1 hashes the given input and returns its SHA1 checksum.

func (*Namespace) SHA256

func (ns *Namespace) SHA256(in any) (string, error)

SHA256 hashes the given input and returns its SHA256 checksum.

Version
v0.101.0 (latest)
Published
Jun 16, 2022
Platform
linux/amd64
Imports
12 packages (graph)
Last checked
4 hours ago

Tools for package owners.