heap

package
v1.62.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Md5      = "md5"
	Sha1     = "sha1"
	Sha256   = "sha256"
	Sha3     = "sha3"
	Sha3_224 = "sha3-224"
	Sha3_256 = "sha3-256"
	Sha3_384 = "sha3-384"
	Sha3_512 = "sha3-512"
	Sdhash   = "sdhash"
	Ssdeep   = "ssdeep"
	Tlsh     = "tlsh"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache map[string]any

type Context

type Context struct {
	B int // context before
	A int // context after
	// contains filtered or unexported fields
}

type Filter

type Filter struct {
	Pattern string         // filter pattern
	Context Context        // filter context
	Regex   *regexp.Regexp // filter regex
	// contains filtered or unexported fields
}

type Hash

type Hash map[string][]byte

type Heap

type Heap struct {
	sync.RWMutex

	Title string // heap title
	Path  string // file path
	Base  string // base path

	Type types.Heap // heap type
	// contains filtered or unexported fields
}

func New

func New(title, path, base string, ht types.Heap) *Heap

func (*Heap) AddFilter

func (h *Heap) AddFilter(pattern string, b, a int)

func (*Heap) Bytes

func (h *Heap) Bytes() []byte

func (*Heap) Cache

func (h *Heap) Cache() Cache

func (*Heap) Count

func (h *Heap) Count() int

func (*Heap) DelFilter

func (h *Heap) DelFilter()

func (*Heap) Ensure

func (h *Heap) Ensure() *Heap

func (*Heap) FMap

func (h *Heap) FMap() *smap.SMap

func (*Heap) Filters

func (h *Heap) Filters() []*Filter

func (*Heap) HasContext

func (h *Heap) HasContext() bool

func (*Heap) HashSum

func (h *Heap) HashSum(algo string) ([]byte, error)

func (*Heap) LastCount

func (h *Heap) LastCount() (int, int)

func (*Heap) LastFilter

func (h *Heap) LastFilter() *Filter

func (*Heap) Len

func (h *Heap) Len() int64

func (*Heap) MMap

func (h *Heap) MMap() *mmap.MMap

func (*Heap) Md5

func (h *Heap) Md5() ([]byte, error)

func (*Heap) ModContext

func (h *Heap) ModContext(delta int) bool

func (*Heap) Patterns

func (h *Heap) Patterns() []string

func (*Heap) Reload

func (h *Heap) Reload()

func (*Heap) SMap

func (h *Heap) SMap() *smap.SMap

func (*Heap) Sdhash

func (h *Heap) Sdhash() ([]byte, error)

func (*Heap) Sha1

func (h *Heap) Sha1() ([]byte, error)

func (*Heap) Sha3

func (h *Heap) Sha3() ([]byte, error)

func (*Heap) Sha256

func (h *Heap) Sha256() ([]byte, error)

func (*Heap) Ssdeep

func (h *Heap) Ssdeep() ([]byte, error)

func (*Heap) String

func (h *Heap) String() string

func (*Heap) Strings

func (h *Heap) Strings(n int) <-chan String

func (*Heap) ThrowAway

func (h *Heap) ThrowAway()

func (*Heap) Tlsh

func (h *Heap) Tlsh() ([]byte, error)

type SDHash

type SDHash struct {
	// contains filtered or unexported fields
}

func (*SDHash) BlockSize

func (sd *SDHash) BlockSize() int

func (*SDHash) Reset

func (sd *SDHash) Reset()

func (*SDHash) Size

func (sd *SDHash) Size() int

func (*SDHash) Sum

func (sd *SDHash) Sum(_ []byte) []byte

func (*SDHash) Write

func (sd *SDHash) Write(b []byte) (int, error)

type String

type String struct {
	Off int
	Str string
}

Jump to

Keyboard shortcuts

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