hash

package
v0.0.0-...-51a7f25 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package Hash can be used to construct Hash values for data types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	Hash hash.Hash
}

Manager struct represents the Hash Manager.

func (*Manager) AddArray

func (m *Manager) AddArray(arr []string) error

AddArray method adds the given unsorted array content for hashing irrespective of the element order. Returns an error if the Hash is not initialized.

func (*Manager) AddBool

func (m *Manager) AddBool(b bool) error

AddBool method adds the given bool for hashing. Returns an error if encountered.

func (*Manager) AddInt32

func (m *Manager) AddInt32(i int32) error

AddInt32 method adds the given int32 for hashing. Returns an error if encountered.

func (*Manager) AddInt64

func (m *Manager) AddInt64(i int64) error

AddInt64 method adds the given int64 for hashing. Returns an error if encountered.

func (*Manager) AddMap

func (m *Manager) AddMap(mVal map[string]string) error

AddMap method adds the given Map content for hashing irrespective of the element order. Returns an error if the Hash is not initialized.

func (*Manager) AddString

func (m *Manager) AddString(str string) error

AddString method adds the given string for hashing. Returns an error if encountered.

func (*Manager) AddUint32

func (m *Manager) AddUint32(u uint32) error

AddUint32 method adds the given uint32 for hashing. Returns an error if encountered.

func (*Manager) AddUint64

func (m *Manager) AddUint64(u uint64) error

AddUint64 method adds the given uint64 for hashing. Returns an error if encountered.

func (*Manager) Generate

func (m *Manager) Generate() (string, error)

Generate method returns a hash value for added content.

func (*Manager) ResetHash

func (m *Manager) ResetHash()

ResetHash resets the underneath Hash Manager. This method should be called before generating Hash if the Manager is used for more than once.

Jump to

Keyboard shortcuts

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