checkfile

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package checkfile parses and formats BLAKE3 checksum lines, matching the output and --check input of the reference b3sum tool.

Two line formats are supported:

<hex>  <name>          // default, two spaces (GNU coreutils style)
BLAKE3 (<name>) = <hex> // BSD style, emitted with --tag

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(sum []byte, name string, tag bool) string

Format renders a checksum line (without trailing newline). When tag is true it emits the BSD style; otherwise the default two-space style.

func IsSkip

func IsSkip(err error) bool

IsSkip reports whether err indicates a blank/comment line from ParseLine.

Types

type Entry

type Entry struct {
	Hash []byte
	Name string
}

Entry is one parsed checksum line: a hash and the file name it covers.

func Parse

func Parse(r io.Reader) ([]Entry, error)

Parse reads all checksum lines from r, skipping blank and comment lines.

func ParseLine

func ParseLine(line string) (Entry, error)

ParseLine parses a single checksum line in either supported format.

Jump to

Keyboard shortcuts

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