bmt

package
v0.0.0-...-b78b3a4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//
	//
	PoolSize = 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncHasher

type AsyncHasher struct {
	*Hasher //
	// contains filtered or unexported fields
}

func (*AsyncHasher) SectionSize

func (sw *AsyncHasher) SectionSize() int

func (*AsyncHasher) Sum

func (sw *AsyncHasher) Sum(b []byte, length int, meta []byte) (s []byte)

func (*AsyncHasher) Write

func (sw *AsyncHasher) Write(i int, section []byte)

type BaseHasherFunc

type BaseHasherFunc func() hash.Hash

type Hasher

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

func New

func New(p *TreePool) *Hasher

func (*Hasher) BlockSize

func (h *Hasher) BlockSize() int

func (*Hasher) NewAsyncWriter

func (h *Hasher) NewAsyncWriter(double bool) *AsyncHasher

func (*Hasher) Reset

func (h *Hasher) Reset()

func (*Hasher) ResetWithLength

func (h *Hasher) ResetWithLength(span []byte)

func (*Hasher) Size

func (h *Hasher) Size() int

func (*Hasher) Sum

func (h *Hasher) Sum(b []byte) (s []byte)

func (*Hasher) Write

func (h *Hasher) Write(b []byte) (int, error)

type RefHasher

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

func NewRefHasher

func NewRefHasher(hasher BaseHasherFunc, count int) *RefHasher

func (*RefHasher) Hash

func (rh *RefHasher) Hash(data []byte) []byte

type SectionWriter

type SectionWriter interface {
	Reset()                                       //
	Write(index int, data []byte)                 //
	Sum(b []byte, length int, span []byte) []byte //
	SectionSize() int                             //
}

type TreePool

type TreePool struct {
	SegmentSize  int //
	SegmentCount int //
	Capacity     int //
	Depth        int //
	Size         int //
	// contains filtered or unexported fields
}

func NewTreePool

func NewTreePool(hasher BaseHasherFunc, segmentCount, capacity int) *TreePool

func (*TreePool) Drain

func (p *TreePool) Drain(n int)

Jump to

Keyboard shortcuts

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