hasher

package
v4.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBlockSize = 10 * 1024 * 1024
)

Variables

This section is empty.

Functions

func Tee

func Tee(reader io.Reader, hashFunc func() hash.Hash, metaName string, complete func(s string, hashes [][]byte)) io.Reader

Types

type BlockHash

type BlockHash struct {
	hash.Hash
	// contains filtered or unexported fields
}

BlockHash is a hash.Hash implementation that compute sub-hashes on each blocks of BlockSize and re-hash them together at the end. It is uses to provide a stable hashing algorithm for standard PUT Object requests vs Multipart Uploads. Bewre that this implies that the Multipart PartSize must be a multiple of this block size.

func NewBlockHash

func NewBlockHash(h hash.Hash, blockSize int) *BlockHash

func (*BlockHash) Next

func (b *BlockHash) Next(p []byte)

func (*BlockHash) Reset

func (b *BlockHash) Reset()

func (*BlockHash) Sum

func (b *BlockHash) Sum(p []byte) []byte

func (*BlockHash) Write

func (b *BlockHash) Write(p []byte) (n int, err error)

type HashCloser

type HashCloser interface {
	Close()
}

type Reader

type Reader struct {
	io.Reader
	hash.Hash
	// contains filtered or unexported fields
}

func (*Reader) ExtractedMeta

func (r *Reader) ExtractedMeta() (map[string]string, bool)

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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