checksums

package
v0.0.0-...-9799ab4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: GPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const SumsLineRe = `(.*?) \*(.*)`

Variables

Functions

func CalculateFileChecksum

func CalculateFileChecksum(
	filename string,
	new_hash hash.Hash,
	bs int,
) ([]byte, error)

Types

type Sums

type Sums struct {
	Lines []*SumsLine
}

func NewSums

func NewSums() *Sums

func (*Sums) LoadFromFile

func (self *Sums) LoadFromFile(filename string) error

func (*Sums) RemoveDuplicates

func (self *Sums) RemoveDuplicates()

warning: this may be slow for large list. working with 1000 takes few seconds

func (*Sums) SaveToFile

func (self *Sums) SaveToFile(filename string) error

func (*Sums) SortLinesByValue

func (self *Sums) SortLinesByValue()

warning: this may be slow for large list. working with 1000 takes few seconds

type SumsLine

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

func NewSumsLine

func NewSumsLine(
	sum []byte,
	value string,
) *SumsLine

func NewSumsLineFromBytes

func NewSumsLineFromBytes(data []byte) (*SumsLine, error)

func NewSumsLineFromString

func NewSumsLineFromString(data string) (*SumsLine, error)

NOTE: trailing newline trimmed from value

func (*SumsLine) IsEqual

func (self *SumsLine) IsEqual(other *SumsLine) bool

func (*SumsLine) String

func (self *SumsLine) String() string

NOTE: result does not ends with newline

Jump to

Keyboard shortcuts

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