signature

package
v0.0.0-...-4ee0c84 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(file, signatureFile string, chunkSize int64) error

Generate ...

Types

type Checksum

type Checksum struct {
	RChecksum   int64    `json:"r_checksum"`
	MD5Checksum [16]byte `json:"md5_checksum"`
	Start       int64    `json:"start"`
	End         int64    `json:"end"`
	Content     []byte   `json:"content"`
}

Checksum

type SigGenerator

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

func NewSigGenerator

func NewSigGenerator(reader bufio.Reader, chunkSize int64) *SigGenerator

func (*SigGenerator) GenSig

func (sg *SigGenerator) GenSig() *Signature

func (*SigGenerator) NextChunkHashes

func (sg *SigGenerator) NextChunkHashes() (int64, [16]byte, error)

type Signature

type Signature struct {
	Checksums []*Checksum `json:"checksums"`
	ChunkSize int64       `json:"chunk_size"`
}

Signature of the file

func UnmarshalJSON

func UnmarshalJSON(bytes []byte) (*Signature, error)

func (*Signature) MarshalJSON

func (s *Signature) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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