targets

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxDelegationHashPrefixBitLen = 32
View Source
const MinDelegationHashPrefixBitLen = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type HashBin

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

HashBin represents a hex prefix range. First should be less than Last.

func (*HashBin) HashPrefixes

func (b *HashBin) HashPrefixes() []string

HashPrefixes returns a slice of all hash prefixes in the bin.

func (*HashBin) RoleName

func (b *HashBin) RoleName() string

RoleName returns the name of the role that signs for the HashBin.

type HashBins

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

HashBins represents an ordered list of hash bin target roles, which together partition the space of target path hashes equal-sized buckets based on path has prefix.

func NewHashBins

func NewHashBins(rolePrefix string, bitLen int) (*HashBins, error)

NewHashBins creates a HashBins partitioning with 2^bitLen buckets.

func (*HashBins) GetBin

func (hb *HashBins) GetBin(i uint64) *HashBin

GetBin returns the HashBin at index i, or nil if i is out of bounds.

func (*HashBins) NumBins

func (hb *HashBins) NumBins() uint64

NumBins returns the number of hash bin partitions.

Jump to

Keyboard shortcuts

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