mdHashContextList

package
v0.0.0-...-6c90f4e Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: GPL-3.0 Imports: 59 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashContextList

type HashContextList struct {
	MdBlockSize *mdSignatureList.BlockList
	// hash map
	//
	// hash list for files
	HashList map[string]hash.Hash
	// hash context signature list for files or blocks
	HashListBlocks map[string]hash.Hash
	// hash context count
	HashListFileSize  int
	HashListBlockSize int
	// contains filtered or unexported fields
}

HashContextList object stores the file signature hash context list

func Init

func Init() (hc *HashContextList)

Init returns a new HashContextList object

func (*HashContextList) CalcHashBlockSize

func (hc *HashContextList) CalcHashBlockSize(hashlist string, mdtype int) (uint64, []int)

CalcHashBlockSize takes a hashlist colon separated string of hash names

It calculates the total blocksize and a array of the hash signature block sizes this allows mdprint or mdunzip to decode each signature block and calculate their size returns blocksize and the blocksize array for each block

func (*HashContextList) CalcHashBlockSizeBlockList

func (hc *HashContextList) CalcHashBlockSizeBlockList(hashlist string) (uint64, []int)

CalcHashBlockSizeBlockList takes a hashlist colon separated string of hash names

It calculates the total blocksize and a array of the hash signature block sizes this allows mdprint or mdunzip to decode each signature block and calculate their size returns blocksize and the blocksize array for each block

func (*HashContextList) CalcHashBlockSizeFileList

func (hc *HashContextList) CalcHashBlockSizeFileList(hashlist string) (uint64, []int)

CalcHashBlockSizeFileList takes a hashlist colon separated string of hash names

It calculates the total blocksize and a array of the hash signature block sizes this allows mdprint or mdunzip to decode each signature block and calculate their size returns blocksize and the blocksize array for each block

func (*HashContextList) CheckFileHashBlock

func (hc *HashContextList) CheckFileHashBlock(byteblock []byte) bool

CheckFileHashBlock compares the current modulus scan byte block with the hash byte block at position start to end the hash byte block is the entire signature block [0:20]sha1[21:40]ripe160

func (*HashContextList) CheckKeyError

func (hc *HashContextList) CheckKeyError(key string, keyval string, err error)

Check if a Signature Key Returns an error

func (*HashContextList) CreateHashListMap

func (hc *HashContextList) CreateHashListMap(hashList string, mdtype int, threadNumber int)

createHashListMap create the hash context hash list map need to incorporate the thread number has to be either a thread list for each or a key_threadnumber create 16 hashlist context objects for each thread once

func (*HashContextList) GetBlockHash

func (hc *HashContextList) GetBlockHash() []string

Get the current Block Hash List Names more of a test function

func (*HashContextList) GetBlockHashBytes

func (hc *HashContextList) GetBlockHashBytes() []byte

GetBlockHashBytes return the current mdzip block hash signature block bytes

func (*HashContextList) GetFileHashBlockSigBytes

func (hc *HashContextList) GetFileHashBlockSigBytes(byteblock []byte) []string

GetFileHashBlockSigBytes creates a list with the signature name and hash block signature bytes Example: [aes8 80696185b5b00db8 blake2s_128 d26d0d2d40f394e279ab14f6f1bb4dde]

func (*HashContextList) SetBlockHash

func (hc *HashContextList) SetBlockHash(byteblock []byte)

sets the current mdzip file block hash signature block bytes this is the list of signature bytes

func (*HashContextList) SetFileHashBlock

func (hc *HashContextList) SetFileHashBlock(byteblock []byte)

sets the current mdzip file hash signature block bytes this is the list of signature bytes

func (*HashContextList) SetHashListKey

func (hc *HashContextList) SetHashListKey(keylist string) string

Set the Hash List Key should return a string not sure if I need this it's so that if a default is used it will specify it in the mdunzip key list

Jump to

Keyboard shortcuts

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