digest

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AlgorithmCRC32 is crc32 algorithm name of hash.
	AlgorithmCRC32 = "crc32"

	// AlgorithmBlake3 is blake3 algorithm name of hash.
	AlgorithmBlake3 = "blake3"

	// AlgorithmSHA1 is sha1 algorithm name of hash.
	AlgorithmSHA1 = "sha1"

	// AlgorithmSHA256 is sha256 algorithm name of hash.
	AlgorithmSHA256 = "sha256"

	// AlgorithmSHA512 is sha512 algorithm name of hash.
	AlgorithmSHA512 = "sha512"

	// AlgorithmMD5 is md5 algorithm name of hash.
	AlgorithmMD5 = "md5"
)

Variables

This section is empty.

Functions

func SHA256FromStrings

func SHA256FromStrings(data ...string) string

SHA256FromStrings computes the SHA256 checksum with multiple strings.

Types

type Digest

type Digest struct {
	// Algorithm is hash algorithm.
	Algorithm string

	// Encoded is hash encode.
	Encoded string
}

Digest provides digest operation function.

func New

func New(algorithm, encoded string) *Digest

New return digest instance.

func Parse

func Parse(digest string) (*Digest, error)

Parse uses to parse digest string to algorithm and encoded.

func (*Digest) String

func (d *Digest) String() string

String return digest string.

Jump to

Keyboard shortcuts

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