hash

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSuchFile = errors.New("no such file")

ErrNoSuchFile ...

Functions

func File

func File(file string, method ...string) (hash string, err error)

File 哈希一个文件,输出 hex 的编码,method 支持:md5,sha1,sha256(默认),sha512

func FileVerify

func FileVerify(file, hash string, method ...string) (verify bool, err error)

FileVerify 哈希校验一个文件,以 hex 的方式校验,method 支持:md5,sha1,sha256(默认),sha512

func MustString

func MustString(str string, method ...string) string

MustString ...

func Reader

func Reader(reader io.Reader, method ...string) (hash string, err error)

Reader ...

func String

func String(str string, method ...string) (hash string, err error)

String 哈希一个字符串,输出 hex 的编码,method 支持:md5,sha1,sha256(默认),sha512

Types

This section is empty.

Jump to

Keyboard shortcuts

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