mdSignatureList

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockList

type BlockList struct {
	HashNamesSize int
	// contains filtered or unexported fields
}

BlockList object stores the file block signature list

func Init

func Init() (bl *BlockList)

Init returns a new BlockList object

func (*BlockList) AddBlockSig

func (bl *BlockList) AddBlockSig(hashSize int)

AddBlockSig add the hash block the blockSize Array and increment the blockSize count

func (*BlockList) AddHashList

func (bl *BlockList) AddHashList(hashName string, number int)

AddHashList add the hash name to the blockList hashList Array

func (*BlockList) CalcHashBlockSize

func (bl *BlockList) CalcHashBlockSize(hashlist string) (uint64, []int)

CalcHashBlockSize calculate the block size for a hashlist string This allows mdprint or mdunzip to decode each signature block and calculate their size

It returns the blocksize sum and the array of signature block sizes

Example block string: ax:md4:md5:sha1:sea:hw64 Example block size 84 block array size [16 16 16 20 8 8]

func (*BlockList) ClearBlockSig

func (bl *BlockList) ClearBlockSig()

clear the blocksize counts

func (*BlockList) ClearHashLists

func (bl *BlockList) ClearHashLists()

clear the block lists

func (*BlockList) CreateHashBlockList

func (bl *BlockList) CreateHashBlockList(hashlist string) []string

CreateHashBlockList checks the hashlist parameter It calls CreateHashBlockListBinary or CreateHashBlockListCSV based on the hashlist format If it is Binary (010111001111) call CreateHashBlockListBinary If it is CSV (1,2,4,11-15,15) call CreateHashBlockListCSV

func (*BlockList) CreateHashBlockListBinary

func (bl *BlockList) CreateHashBlockListBinary(hashlistBoolean string) []string

CreateHashBlockListBinary CreateHashBlockListBinary takes a hashlist boolean and converts it to a name list ie converts the boolean string to a hash name string example binary hash list 110011 is converted to hashlist [add32 aes8 blake2b blake2s_128]

func (*BlockList) CreateHashBlockListCSV

func (bl *BlockList) CreateHashBlockListCSV(hashlistCSV string) []string

CreateHashBlockListCSV This converts a csv hash number list to a hashlist with the corresponding hash ids csv string 1,3,4,5,7-100

The current format is SIGNUM,SIGNUM2,SIGNUMX,SIGNUMY-SIGNUMZ, ...

TODO: It could add an optional Type TYPE:SIGNUM,TYPE:SIGNUMSTART-SIDEND, ...

0 file 1 block 2 both block or file list: 0:1,1:5,2:7,2:8-12 block list 1,2,3,7-12,15-20 file list 5,6,7,8,10-20

Current Examples: hash list 1,2,3,4,5-6 [add32 aes8 ax blake2 blake2b blake2s_128] length 6 1,11,23,44 [add32 crc32k fnv128 md2] length 4

func (*BlockList) GetHashList

func (bl *BlockList) GetHashList() []string

GetHashList returns the signature hashList Struct HashName ID list

func (*BlockList) GetHashListObject

func (bl *BlockList) GetHashListObject() []HashList

GetHashListObject returns the signature hash list Struct

func (*BlockList) SetHashListBlockSize

func (bl *BlockList) SetHashListBlockSize()

SetHashListBlockSize set the block size map This function returns a hash map of signatures strings with their hash block size This allows a hash signature to lookup it's block size by name

func (*BlockList) Uniques

func (bl *BlockList) Uniques(s []int) []int

type HashList

type HashList struct {
	HashName    string
	Description string
	BlockSize   int
	Key         bool
}

HashList Struct

Jump to

Keyboard shortcuts

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