Documentation ¶
Index ¶
- type BlockList
- func (bl *BlockList) AddBlockSig(hashSize int)
- func (bl *BlockList) AddHashList(hashName string, number int)
- func (bl *BlockList) CalcHashBlockSize(hashlist string) (uint64, []int)
- func (bl *BlockList) ClearBlockSig()
- func (bl *BlockList) ClearHashLists()
- func (bl *BlockList) CreateHashBlockList(hashlist string) []string
- func (bl *BlockList) CreateHashBlockListBinary(hashlistBoolean string) []string
- func (bl *BlockList) CreateHashBlockListCSV(hashlistCSV string) []string
- func (bl *BlockList) GetHashList() []string
- func (bl *BlockList) GetHashListObject() []HashList
- func (bl *BlockList) SetHashListBlockSize()
- func (bl *BlockList) Uniques(s []int) []int
- type HashList
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 (*BlockList) AddBlockSig ¶
AddBlockSig add the hash block the blockSize Array and increment the blockSize count
func (*BlockList) AddHashList ¶
AddHashList add the hash name to the blockList hashList Array
func (*BlockList) CalcHashBlockSize ¶
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) CreateHashBlockList ¶
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 ¶
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 ¶
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 ¶
GetHashList returns the signature hashList Struct HashName ID list
func (*BlockList) GetHashListObject ¶
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