algorithms

package
v0.0.0-...-830a97e Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetName

func GetName(algo HashAlgorithm) string

GetName get algorithm name from it type

Types

type Algorithms

type Algorithms struct {
	Supported map[string]HashAlgorithm
	Default   string
	Current   HashAlgorithm
}

Algorithms implements group of one typed crypto algorithms

func (*Algorithms) RandomSupported

func (algos *Algorithms) RandomSupported() string

RandomSupported get random supported crypto hashing algorithm

func (*Algorithms) SetAlgorithm

func (algos *Algorithms) SetAlgorithm(algoStr string)

SetAlgorithm setting crypto hashing algorithm for interaction from given string

func (*Algorithms) ValidateAlgorithm

func (algos *Algorithms) ValidateAlgorithm(check string) bool

ValidateAlgorithm check if the given algorithm is currently supported

type HashAlgorithm

type HashAlgorithm interface {
	DoHash(string) string
	CheckHash(string, string) bool
}

HashAlgorithm implements hashing algorithms interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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