indexedhashes3

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHashStoreCreatorFromFile

func NewHashStoreCreatorFromFile(
	folder string, name string) (indexedhashes.HashStoreCreator, error)

Types

type ConcreteHashStoreCreator

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

func NewHashStoreCreatorPrivate

func NewHashStoreCreatorPrivate(params *HashIndexingParams, folderPath string) *ConcreteHashStoreCreator

func (*ConcreteHashStoreCreator) CreateHashStore

func (c *ConcreteHashStoreCreator) CreateHashStore() error

func (*ConcreteHashStoreCreator) HashStoreExists

func (c *ConcreteHashStoreCreator) HashStoreExists() bool

func (*ConcreteHashStoreCreator) OpenHashStore

func (*ConcreteHashStoreCreator) OpenHashStoreReadOnly

func (c *ConcreteHashStoreCreator) OpenHashStoreReadOnly() (indexedhashes.HashReader, error)

type Hash

type Hash indexedhashes.Sha256

func NewHashFromTruncatedHashAbbreviatedHash

func NewHashFromTruncatedHashAbbreviatedHash(t *truncatedHash, a abbreviatedHash) *Hash

type HashIndexingParams

type HashIndexingParams struct {
	// A parameter, room for the number of hashes you ever want to append
	BitsPerHashIndex_ int64 `json:"bitsPerHashIndex"`
	// A parameter, a guideline for estimating the amount of memory that preloading will use
	HashCountEstimate_ int64 `json:"hashCountEstimate"`
	// A parameter, probably the result of an optimization calculation
	NumberOfBins_ int64 `json:"numberOfBins"`
	// A parameter, perhaps optimized to result in 4096 binstart bytes per bin
	EntriesInBinStart_ int64 `json:"entriesInBinStart"`
	// A parameter, used to arrange overflow files into a sensible number of folders
	DigitsPerNumberedFolder_ int `json:"digitsPerNumberedFolder"`
	// A parameter
	BytesPerSortNum_ int64 `json:"bytesPerSortNum"`
	// contains filtered or unexported fields
}

func NewHashStoreParams

func NewHashStoreParams(bitsPerHashIndex int64, hashCountEstimate int64, digitsPerNumberedFolder int,
	numberOfBins int64, entriesInBinStart int64, bytesPerSortNum int64) *HashIndexingParams

bitsPerHashIndex is critical, you will only ever be able to add as many hashes whose count fits in these bits. hashCountEstimate is not critical, you CAN exceed this number by appending more. digitsPerNumberedFolder is a matter of taste, but 2 is a very good balance. numberOfBins, entriesInBinStart, bytesPerSortNum are the subject of careful and complicated optimization.

func Sensible2YearsAddressHashParams

func Sensible2YearsAddressHashParams() *HashIndexingParams

func Sensible2YearsBlockHashParams

func Sensible2YearsBlockHashParams() *HashIndexingParams

func Sensible2YearsTransactionHashParams

func Sensible2YearsTransactionHashParams() *HashIndexingParams

func Sensible16YearsAddressHashParams

func Sensible16YearsAddressHashParams() *HashIndexingParams

func Sensible16YearsBlockHashParams

func Sensible16YearsBlockHashParams() *HashIndexingParams

func Sensible16YearsTransactionHashParams

func Sensible16YearsTransactionHashParams() *HashIndexingParams

func (*HashIndexingParams) BitsPerHashIndex

func (p *HashIndexingParams) BitsPerHashIndex() int64

func (*HashIndexingParams) BytesPerBinEntry

func (p *HashIndexingParams) BytesPerBinEntry() int64

func (*HashIndexingParams) BytesPerHashIndex

func (p *HashIndexingParams) BytesPerHashIndex() int64

func (*HashIndexingParams) BytesPerSortNum

func (p *HashIndexingParams) BytesPerSortNum() int64

func (*HashIndexingParams) BytesRoomForBinNum

func (p *HashIndexingParams) BytesRoomForBinNum() int64

func (*HashIndexingParams) DigitsPerNumberedFolder

func (p *HashIndexingParams) DigitsPerNumberedFolder() int

func (*HashIndexingParams) Divider

func (p *HashIndexingParams) Divider() uint64

func (*HashIndexingParams) EntriesInBinStart

func (p *HashIndexingParams) EntriesInBinStart() int64

func (*HashIndexingParams) HashCountEstimate

func (p *HashIndexingParams) HashCountEstimate() int64

func (*HashIndexingParams) NumberOfBins

func (p *HashIndexingParams) NumberOfBins() int64

type MultipassPreloader

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

func NewHashStoreCreatorAndPreloader

func NewHashStoreCreatorAndPreloader(folder string, name string,
	params *HashIndexingParams) (indexedhashes.HashStoreCreator, *MultipassPreloader, error)

func NewMultipassPreloader

func NewMultipassPreloader(params *HashIndexingParams, folderPath string, binNumsWordFile wordfile.WriterAtWord) *MultipassPreloader

func (*MultipassPreloader) IndexTheHashes

func (mp *MultipassPreloader) IndexTheHashes() error

func (*MultipassPreloader) TestTheHashes added in v0.0.14

func (mp *MultipassPreloader) TestTheHashes() error

Jump to

Keyboard shortcuts

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