hashing

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 11 Imported by: 0

README

hashing

A utility to generate hashes using common cryptography algorithms.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(algorithm Algorithm, parameters ...interface{}) ([]byte, error)

Generate - generates the hash using the selected algorithm

func GenerateByteArray

func GenerateByteArray(parameters ...interface{}) ([]byte, error)

GenerateByteArray - generates a new byte array based on the given parameters

func GenerateCRC32

func GenerateCRC32(parameters ...interface{}) ([]byte, error)

GenerateCRC32 - generates a sha256 hash based on the specified parameters

func GenerateMD5

func GenerateMD5(parameters ...interface{}) ([]byte, error)

GenerateMD5 - generates a md5 hash based on the specified parameters

func GenerateSHA1

func GenerateSHA1(parameters ...interface{}) ([]byte, error)

GenerateSHA1 - generates a sha1 hash based on the specified parameters

func GenerateSHA256

func GenerateSHA256(parameters ...interface{}) ([]byte, error)

GenerateSHA256 - generates a sha256 hash based on the specified parameters

func GenerateSHAKE

func GenerateSHAKE(algorithm Algorithm, outputSize int, parameters ...interface{}) ([]byte, error)

GenerateSHAKE - generates the shake hash using the selected algorithm

func GenerateSHAKE128

func GenerateSHAKE128(outputSize int, parameters ...interface{}) ([]byte, error)

GenerateSHAKE128 - generates a shake128 hash based on the specified parameters

func GenerateSHAKE256

func GenerateSHAKE256(outputSize int, parameters ...interface{}) ([]byte, error)

GenerateSHAKE256 - generates a shake256 hash based on the specified parameters

Types

type Algorithm

type Algorithm string

Algorithm - the algorithm constant type

const (
	// SHA256 - constant
	SHA256 Algorithm = "sha256"

	// SHA1 - constant
	SHA1 Algorithm = "sha1"

	// MD5 - constant
	MD5 Algorithm = "md5"

	// CRC32 - constant
	CRC32 Algorithm = "crc32"

	// SHAKE128 - constant
	SHAKE128 Algorithm = "shake128"

	// SHAKE256 - constant
	SHAKE256 Algorithm = "shake256"
)

Jump to

Keyboard shortcuts

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