checksums

package
v0.0.0-...-cf07509 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 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