hash

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package hash provides a simple interface to hash strings and files using various algorithms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileMd5

func FileMd5(path string) (string, error)

FileMd5 returns the md5 hash of the file

func FileSha1

func FileSha1(path string) (string, error)

FileSha1 returns the sha1 hash of the file

func FileSha256

func FileSha256(path string) (string, error)

FileSha256 returns the sha256 hash of the file

func FileSha3New256

func FileSha3New256(path string) (string, error)

FileSha3New256 returns the sha3-256 hash of the file

func StringMd5

func StringMd5(data string) string

StringMd5 returns the md5 hash of the string

func StringSha1

func StringSha1(data string) string

StringSha1 returns the sha1 hash of the string

func StringSha256

func StringSha256(data string) string

StringSha256 returns the sha256 hash of the string

func StringSha3New256

func StringSha3New256(data string) string

StringSha3New256 returns the sha3-256 hash of the string

Types

type Algorithm

type Algorithm int

Algorithm The algorithm for the hash

const (
	// Md5 The md5 algorithm
	Md5 Algorithm = iota
	// Sha1 The sha1 algorithm
	Sha1
	// Sha256 The sha256 algorithm
	Sha256
	// Sha3New256 The sha3-256 algorithm
	Sha3New256
)

Jump to

Keyboard shortcuts

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