stdhash

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADLER32 = cryptoHashEnd + iota
	CRC32
	CRC32_ISO
	CRC32_CAST
	CRC32_KOOP
	CRC64_ISO
	CRC64_ECMA
	FNV32
	FNV32A
	FNV64
	FNV64A
	FNV128
	FNV128A
	MAPHASH
)

internal hashes

Variables

This section is empty.

Functions

func IsHash added in v1.1.0

func IsHash(s string) bool

func NewMD5SHA1

func NewMD5SHA1() hash.Hash

func UpdateHashFunc

func UpdateHashFunc(hash Hash, hashFunc func() hash.Hash)

UpdateHashFunc updates a hash.Hash function

Types

type Hash

type Hash uint32
const (
	MD4        Hash = 1 + iota // import golang.org/x/crypto/md4
	MD5                        // import crypto/md5
	SHA1                       // import crypto/sha1
	SHA224                     // import crypto/sha256
	SHA256                     // import crypto/sha256
	SHA384                     // import crypto/sha512
	SHA512                     // import crypto/sha512
	MD5SHA1                    // no implementation; MD5+SHA1 used for TLS RSA
	RIPEMD160                  // import golang.org/x/crypto/ripemd160
	SHA3_224                   // import golang.org/x/crypto/sha3
	SHA3_256                   // import golang.org/x/crypto/sha3
	SHA3_384                   // import golang.org/x/crypto/sha3
	SHA3_512                   // import golang.org/x/crypto/sha3
	SHA512_224                 // import crypto/sha512
	SHA512_256                 // import crypto/sha512

)

crypto hashes

func ParseHash

func ParseHash(s string) (Hash, error)

ParseHash parses a hash function name and returns the Hash type

func (Hash) IsCrypto

func (h Hash) IsCrypto() bool

func (Hash) IsInternal

func (h Hash) IsInternal() bool

func (Hash) New

func (h Hash) New() hash.Hash

func (Hash) String

func (h Hash) String() string