digest

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package digest provides the message digest features.

Index

Constants

This section is empty.

Variables

View Source
var (
	SHA256 = &Algorithm{
		Name:    "sha256",
		Suffix:  ".sha256",
		NewHash: sha256.New,
	}
	SHA512 = &Algorithm{
		Name:    "sha512",
		Suffix:  ".sha512",
		NewHash: sha512.New,
	}
)
View Source
var AvailableAlgorithms = []*Algorithm{
	SHA256,
	SHA512,
}

Functions

This section is empty.

Types

type Algorithm

type Algorithm struct {
	Name    string
	Suffix  string
	NewHash func() hash.Hash
}

Algorithm represents a digest algorithm.

func NewAlgorithm

func NewAlgorithm(name string) (*Algorithm, error)

NewAlgorithm returns the corresponding Algorithm. If not found, it returns an error.

Jump to

Keyboard shortcuts

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