ultracdc

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: ISC Imports: 5 Imported by: 0

README

go-ultracdc

go-ultracdc is a Golang package implementing the ultraCDC chunking algorithm.

    chunker, err := fastcdc.NewChunker(rd, nil)
    if err != nil {
        log.Fatal(err)
    }

    offset := 0
    for {
        chunk, err := chunker.Next()
        if err != nil && err != io.EOF {
            log.Fatal(err)
        }

        chunkLen := len(chunk)
        fmt.Println(offset, chunkLen)

        if err == io.EOF {
            // no more chunks to read
            break
        }
        offset += chunkLen
    }

Reference

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunker

type Chunker struct {
	NormalSize uint32
	MinSize    uint32
	MaxSize    uint32
	// contains filtered or unexported fields
}

func NewChunker

func NewChunker(reader io.Reader, options *ChunkerOpts) (*Chunker, error)

func (*Chunker) Next

func (chunker *Chunker) Next() ([]byte, error)

type ChunkerOpts

type ChunkerOpts struct {
	MinSize uint32
	MaxSize uint32
}

func NewChunkerOptions

func NewChunkerOptions() *ChunkerOpts

Jump to

Keyboard shortcuts

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