package hash

import "cmd/internal/hash"

Package hash implements hash functions used in the compiler toolchain.

Index

Constants

const (
	// Size32 is the size of 32 bytes hash checksum.
	Size32 = sha256.Size
	// Size20 is the size of 20 bytes hash checksum.
	Size20 = sha1.Size
	// Size16 is the size of 16 bytes hash checksum.
	Size16 = md5.Size
)

Functions

func New16

func New16() hash.Hash

New16 returns a new hash.Hash computing the 16 bytes hash checksum.

func New20

func New20() hash.Hash

New20 returns a new hash.Hash computing the 20 bytes hash checksum.

func New32

func New32() hash.Hash

New32 returns a new hash.Hash computing the 32 bytes hash checksum.

func Sum16

func Sum16(data []byte) [Size16]byte

Sum16 returns the 16 bytes checksum of the data.

func Sum20

func Sum20(data []byte) [Size20]byte

Sum20 returns the 20 bytes checksum of the data.

func Sum32

func Sum32(data []byte) [Size32]byte

Sum32 returns the 32 bytes checksum of the data.

Source Files

hash.go

Version
v1.24.0-rc.1
Published
Dec 12, 2024
Platform
js/wasm
Imports
4 packages
Last checked
2 minutes ago

Tools for package owners.