ultracdc

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMaxSize = errors.New("MaxSize is required and must be 64B <= MaxSize <= 1GB && MaxSize > NormalSize")
View Source
var ErrMinSize = errors.New("MinSize is required and must be 64B <= MinSize <= 1GB && MinSize < NormalSize")
View Source
var ErrNormalSize = errors.New("NormalSize is required and must be 64B <= NormalSize <= 1GB")

Functions

This section is empty.

Types

type UltraCDC

type UltraCDC struct {
}

func (*UltraCDC) Algorithm

func (c *UltraCDC) Algorithm(options *chunkers.ChunkerOpts, data []byte, n int) (cutpoint int)

Algorithm's return value, cutpoint, might typically be used next in segment := data[:cutpoint], so we expect to exclude the cutpoint index value itself. Also commonly when n == len(data) and data is short, then the returned cutpoint will be n; n is the default to return when we did not find a shorter cutpoint. The segment := data[:len(data)] will then take all of data as the segment to hash.

PRE condition: n must be <= len(data). We will panic if this does not hold. It is always safe to pass n = len(data).

POST INVARIANT: cutpoint <= n. We never return a cutpoint > n.

func (*UltraCDC) DefaultOptions

func (c *UltraCDC) DefaultOptions() *chunkers.ChunkerOpts

func (*UltraCDC) Validate

func (c *UltraCDC) Validate(options *chunkers.ChunkerOpts) error

Jump to

Keyboard shortcuts

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