hugo: github.com/gohugoio/hugo/resources/resource_transformers/integrity Index | Files

package integrity

import "github.com/gohugoio/hugo/resources/resource_transformers/integrity"

Index

Package Files

integrity.go

type Client Uses

type Client struct {
    // contains filtered or unexported fields
}

Client contains methods to fingerprint (cachebusting) and other integrity-related methods.

func New Uses

func New(rs *resources.Spec) *Client

New creates a new Client with the given specification.

func (*Client) Fingerprint Uses

func (c *Client) Fingerprint(res resources.ResourceTransformer, algo string) (resource.Resource, error)

Fingerprint applies fingerprinting of the given resource and hash algorithm. It defaults to sha256 if none given, and the options are md5, sha256 or sha512. The same algo is used for both the fingerprinting part (aka cache busting) and the base64-encoded Subresource Integrity hash, so you will have to stay away from md5 if you plan to use both. See https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity

Package integrity imports 12 packages (graph) and is imported by 9 packages. Updated 2019-09-16. Refresh now. Tools for package owners.