integrity

package
v0.45.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2018 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

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

func New

func New(rs *resource.Spec) *Client

New creates a new Client with the given specification.

func (*Client) Fingerprint

func (c *Client) Fingerprint(res resource.Resource, 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL