hash

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package hash provides ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileDetector

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

FileDetector implements exact file duplicate detection.

func NewFileDetector

func NewFileDetector(threshold int) *FileDetector

NewFileDetector creates a new file-level hash detector.

func (*FileDetector) FindDuplOver

func (f *FileDetector) FindDuplOver(data []*syntax.Node, threshold int) <-chan syntax.Match

FindDuplOver finds exact file duplicates using XXH3 hashing.

type FileDuplicate

type FileDuplicate struct {
	Hash  string
	Files []FileHash
}

FileDuplicate represents a group of files with identical content.

func FindFileDuplicates

func FindFileDuplicates(files []string, threshold int) []FileDuplicate

FindFileDuplicates finds exact file duplicates by hashing file contents. Files are hashed one at a time via io.Copy through XXH3 — file content is never held in memory. Only (hash, filename, size) is retained per file.

type FileHash

type FileHash struct {
	Hash     string
	Filename string
	Size     int
}

FileHash represents a hash of a complete file.

Jump to

Keyboard shortcuts

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